diff options
| author | Stephen Sinclair <radarsat1@gmail.com> | 2017-08-26 22:16:55 -0300 |
|---|---|---|
| committer | Stephen Sinclair <radarsat1@gmail.com> | 2017-08-26 22:16:55 -0300 |
| commit | 0a5344b064cdaec8f048c6b10be245807601a147 (patch) | |
| tree | 33f6d8d87f8d0fa788d2721b7f82a8875772c0a6 /configure.ac | |
| parent | 4ee8b95d791a54aca593ad24d4eabbaac90355c0 (diff) | |
Don't check all libraries, use AS_IF.
Fix AC_ARG_WITH usage to be like the manual suggests:
https://autotools.io/autoconf/arguments.html
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac index 25589e1..671b406 100644 --- a/configure.ac +++ b/configure.ac @@ -131,30 +131,34 @@ case $host in ;; *-*-linux*) - AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (mac and linux only)], [ + AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (mac and linux only)]) + AS_IF([test "x$with_jack" == "xyes"], [ api="$api -D__UNIX_JACK__" AC_MSG_RESULT(using JACK) AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!)) - AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(Jack support also requires the asound library!))], ) + AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(Jack support also requires the asound library!))]) # Look for ALSA flag - AC_ARG_WITH(alsa, [ --with-alsa = choose native ALSA API support (linux only)], [ + AC_ARG_WITH(alsa, [ --with-alsa = choose native ALSA API support (linux only)]) + AS_IF([test "x$with_alsa" == "xyes"], [ api="$api -D__LINUX_ALSA__" req="$req alsa" AC_MSG_RESULT(using ALSA) - AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))], ) + AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))]) # Look for PULSE flag - AC_ARG_WITH(pulse, [ --with-pulse = choose PulseAudio API support (linux only)], [ + AC_ARG_WITH(pulse, [ --with-pulse = choose PulseAudio API support (linux only)]) + AS_IF([test "x$with_pulse" == "xyes"], [ api="$api -D__LINUX_PULSE__" req="$req libpulse-simple" AC_MSG_RESULT(using PulseAudio) - AC_CHECK_LIB(pulse-simple, pa_simple_flush, , AC_MSG_ERROR(PulseAudio support requires the pulse-simple library!))], ) + AC_CHECK_LIB(pulse-simple, pa_simple_flush, , AC_MSG_ERROR(PulseAudio support requires the pulse-simple library!))]) # Look for OSS flag - AC_ARG_WITH(oss, [ --with-oss = choose OSS API support (linux only)], [ + AC_ARG_WITH(oss, [ --with-oss = choose OSS API support (linux only)]) + AS_IF([test "x$with_oss" == "xyes"], [ api="$api -D__LINUX_OSS__" - AC_MSG_RESULT(using OSS)], ) + AC_MSG_RESULT(using OSS)]) # If no audio api flags specified, use ALSA if [test "$api" == "";] then @@ -168,21 +172,23 @@ case $host in ;; *-apple*) - AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (unix only)], [ + AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (unix only)]) + AS_IF([test "x$with_jack" == "xyes"], [ api="$api -D__UNIX_JACK__" AC_MSG_RESULT(using JACK) - AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!))], ) + AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!))]) # AC_CHECK_HEADER(jack/jack.h, [], [AC_MSG_ERROR(Jack header file not found!)] ) # LIBS="$LIBS -framework jackmp" ], ) # Look for Core flag - AC_ARG_WITH(core, [ --with-core = choose CoreAudio API support (mac only)], [ + AC_ARG_WITH(core, [ --with-core = choose CoreAudio API support (mac only)]) + AS_IF([test "x$with_core" == "xyes"], [ api="$api -D__MACOSX_CORE__" AC_MSG_RESULT(using CoreAudio) AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [], [AC_MSG_ERROR(CoreAudio header files not found!)] ) - LIBS="$LIBS -framework CoreAudio -framework CoreFoundation" ], ) + LIBS="$LIBS -framework CoreAudio -framework CoreFoundation" ]) # If no audio api flags specified, use CoreAudio if [test "$api" == ""; ] then @@ -198,22 +204,25 @@ case $host in ;; *-mingw32*) - AC_ARG_WITH(asio, [ --with-asio = choose ASIO API support (windoze only)], [ + AC_ARG_WITH(asio, [ --with-asio = choose ASIO API support (windoze only)]) + AS_IF([test "x$with_asio" == "xyes"], [ api="$api -D__WINDOWS_ASIO__" AC_MSG_RESULT(using ASIO) - AC_SUBST( objects, ["asio.o asiodrivers.o asiolist.o iasiothiscallresolver.o"] ) ], ) + AC_SUBST( objects, ["asio.o asiodrivers.o asiolist.o iasiothiscallresolver.o"] ) ]) # Look for DirectSound flag - AC_ARG_WITH(ds, [ --with-ds = choose DirectSound API support (windoze only)], [ + AC_ARG_WITH(ds, [ --with-ds = choose DirectSound API support (windoze only)]) + AS_IF([test "x$with_ds" == "xyes"], [ api="$api -D__WINDOWS_DS__" AC_MSG_RESULT(using DirectSound) - LIBS="-ldsound -lwinmm $LIBS" ], ) + LIBS="-ldsound -lwinmm $LIBS" ]) # Look for WASAPI flag - AC_ARG_WITH(wasapi, [ --with-wasapi = choose Windows Audio Session API support (windoze only)], [ + AC_ARG_WITH(wasapi, [ --with-wasapi = choose Windows Audio Session API support (windoze only)]) + AS_IF([test "x$with_wasapi" == "xyes"], [ api="$api -D__WINDOWS_WASAPI__" AC_MSG_RESULT(using WASAPI) - LIBS="-lwinmm -luuid -lksuser $LIBS" ], ) + LIBS="-lwinmm -luuid -lksuser $LIBS" ]) # If no audio api flags specified, use DS if [test "$api" == "";] then |
