From cfc66c91ef935af2e0ee80c95fc01e40663cb471 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Tue, 10 Jan 2006 21:35:37 +0000 Subject: [PATCH] - cleaned up the configure a bit more, it will now pick a default audio method if none given. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@82 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.in | 4 ++-- configure | 44 +++++++++++++++++++++++++++++--------------- configure.ac | 44 ++++++++++++++++++++++++++++++++------------ 3 files changed, 63 insertions(+), 29 deletions(-) diff --git a/Makefile.in b/Makefile.in index d20f43885..898aafb54 100644 --- a/Makefile.in +++ b/Makefile.in @@ -75,7 +75,7 @@ wsjt.spec: wsjt.py astro.py g.py options.py palettes.py smeter.py specjt.py # --tk --onefile wsjt.py jtaudio.o: jtaudio.c - $(CC) -c $(CPPFLAGS) jtaudio.c + $(CC) -c $(CLAGS) jtaudio.c init_rs_int.o: init_rs.c $(CC) -c -DBIGSYM=1 -o init_rs_int.o init_rs.c @@ -102,7 +102,7 @@ igray.o: igray.c $(CC) -c igray.c start_threads.o: start_threads.c - $(CC) -c start_threads.c + $(CC) -c $(CFLAGS) start_threads.c .PHONY : clean clean: diff --git a/configure b/configure index af01816fc..3f2247535 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 0.9. # -# $Id: configure.ac 75 2006-01-10 05:00:34Z va3db $ +# $Id: configure.ac 76 2006-01-10 16:36:04Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -924,7 +924,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 75 2006-01-10 05:00:34Z va3db $ +$Id: configure.ac 76 2006-01-10 16:36:04Z va3db $ _ACEOF exit 0 fi @@ -5713,6 +5713,16 @@ else portaudio=no fi; + + +if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then + if test $HAS_PORTAUDIO_H -eq 1; then + portaudio=yes; + elif test $HAS_ASOUNDLIB_H -eq 1; then + alsa=yes; + fi +fi + if test "$alsa" = yes; then cat >>confdefs.h <<\_ACEOF @@ -5722,6 +5732,8 @@ _ACEOF AUDIO="start_threads.c" LDFLAGS="${LDFLAGS} -lasound" + CFLAGS="${CFLAGS} -DUSE_ALSA" + CPPFLAGS="${CPPFLAGS} -DUSE_ALSA" fi if test "$oss" = yes; then @@ -5777,19 +5789,6 @@ _ACEOF fi -if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then - if test $HAS_PORTAUDIO_H -eq 1; then - set portaudio = yes; - echo "$as_me:$LINENO: result: Using portaudio" >&5 -echo "${ECHO_T}Using portaudio" >&6 - elif test $HAS_ASOUNDLIB_H -eq 1; then - set alsa = yes; - echo "$as_me:$LINENO: result: Using alsa" >&5 -echo "${ECHO_T}Using alsa" >&6 - fi -fi - - if test "$alsa" = yes; then if test $HAS_ASOUNDLIB_H -eq 0; then { { echo "$as_me:$LINENO: error: You need asoundlib.h to use --enable-alsa" >&5 @@ -6857,6 +6856,21 @@ if test "$no_create" != yes; then fi +echo +echo + +if test $portaudio == "yes"; then + echo "Using portaudio"; +fi + +if test $alsa == "yes"; then + echo "Using alsa"; +fi + +if test $oss == "yes"; then + echo "Using oss"; +fi + echo echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" echo diff --git a/configure.ac b/configure.ac index 182626409..2876e5a69 100644 --- a/configure.ac +++ b/configure.ac @@ -217,10 +217,26 @@ AC_ARG_ENABLE(portaudio, AC_HELP_STRING([--enable-portaudio],[Force PORTAUDIO SOUND usage.]), [portaudio=$enableval], [portaudio=no]) +dnl now set conf.h,, CPPFLAGS and CFLAGS flags as needed +dnl ==================================================== + +dnl set defaults +dnl ============ + +if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then + if test $HAS_PORTAUDIO_H -eq 1; then + [portaudio=yes]; + elif test $HAS_ASOUNDLIB_H -eq 1; then + [alsa=yes]; + fi +fi + if test "$alsa" = yes; then AC_DEFINE(USE_ALSA, 1, [Define if you want ALSA used.]) AC_SUBST(AUDIO, "start_threads.c") LDFLAGS="${LDFLAGS} -lasound" + CFLAGS="${CFLAGS} -DUSE_ALSA" + CPPFLAGS="${CPPFLAGS} -DUSE_ALSA" fi if test "$oss" = yes; then @@ -255,19 +271,8 @@ if test $HAS_SAMPLERATE_H -eq 1; then AC_DEFINE(HAS_SAMPLERATE_H, 1, ) fi -dnl set defaults - -if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then - if test $HAS_PORTAUDIO_H -eq 1; then - set portaudio = yes; - AC_MSG_RESULT([Using portaudio]) - elif test $HAS_ASOUNDLIB_H -eq 1; then - set alsa = yes; - AC_MSG_RESULT([Using alsa]) - fi -fi - dnl sanity tests. +dnl ============= if test "$alsa" = yes; then if test $HAS_ASOUNDLIB_H -eq 0; then @@ -301,6 +306,21 @@ AC_SUBST(CFLAGS) AC_OUTPUT dnl do summary +echo +echo + +if test $portaudio == "yes"; then + echo "Using portaudio"; +fi + +if test $alsa == "yes"; then + echo "Using alsa"; +fi + +if test $oss == "yes"; then + echo "Using oss"; +fi + echo echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" echo