Browse Source

consistent API checks

consistent ordering of AC_MSG, additional library checks and var-setting.
also, use "=" rather than "=" when testing for equality
tags/5.1.0
IOhannes m zmölnig 8 years ago
parent
commit
587cd78467
1 changed files with 39 additions and 29 deletions
  1. +39
    -29
      configure.ac

+ 39
- 29
configure.ac View File

@@ -127,50 +127,56 @@ AC_CANONICAL_HOST
AC_MSG_CHECKING(for audio API)

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__"
AS_IF([test "x$with_jack" = "xyes"], [
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!))
api="$api -D__UNIX_JACK__"
])

case $host in
*-*-netbsd*)
AS_IF([test "$api" == ""], [
AS_IF([test "x$api" = "x"], [
AC_MSG_RESULT(using OSS)
api="$api -D__LINUX_OSS__"
LIBS="$LIBS -lossaudio"
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))])
AC_CHECK_LIB(ossaudio, main, , AC_MSG_ERROR([RtAudio requires the ossaudio library]))
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
])
;;

*-*-freebsd*)
AS_IF([test "$api" == ""], [
AS_IF([test "x$api" = "x"], [
AC_MSG_RESULT(using OSS)
api="$api -D__LINUX_OSS__"
LIBS="$LIBS -lossaudio"
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))])
AC_CHECK_LIB(ossaudio, main, , AC_MSG_ERROR([RtAudio requires the ossaudio library]))
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
])
;;

*-*-linux*)
# Look for ALSA flag
AC_ARG_WITH(alsa, [ --with-alsa = choose native ALSA API support (linux only)])
AS_IF([test "x$with_alsa" == "xyes"], [
AS_IF([test "x$with_alsa" = "xyes"], [
AC_MSG_RESULT(using ALSA)
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)])
AS_IF([test "x$with_pulse" == "xyes"], [
AS_IF([test "x$with_pulse" = "xyes"], [
AC_MSG_RESULT(using PulseAudio)
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 (unixes)])
AS_IF([test "x$with_oss" == "xyes"], [
AS_IF([test "x$with_oss" = "xyes"], [
AC_MSG_RESULT(using OSS)
api="$api -D__LINUX_OSS__"
AC_MSG_RESULT(using OSS)])
])

# If no audio api flags specified, use ALSA
AS_IF([test "x$api" = "x" ], [
@@ -185,11 +191,12 @@ case $host in
*-apple*)
# Look for Core flag
AC_ARG_WITH(core, [ --with-core = choose CoreAudio API support (mac only)])
AS_IF([test "x$with_core" == "xyes"], [
api="$api -D__MACOSX_CORE__"
AS_IF([test "x$with_core" = "xyes"], [
AC_MSG_RESULT(using CoreAudio)
api="$api -D__MACOSX_CORE__"
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
AS_IF([test "x$api" = "x" ], [
@@ -206,24 +213,27 @@ case $host in

*-mingw32*)
AC_ARG_WITH(asio, [ --with-asio = choose ASIO API support (windoze only)])
AS_IF([test "x$with_asio" == "xyes"], [
api="$api -D__WINDOWS_ASIO__"
AS_IF([test "x$with_asio" = "xyes" ], [
AC_MSG_RESULT(using ASIO)
AC_SUBST( objects, ["asio.o asiodrivers.o asiolist.o iasiothiscallresolver.o"] ) ])
api="$api -D__WINDOWS_ASIO__"
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)])
AS_IF([test "x$with_ds" == "xyes"], [
api="$api -D__WINDOWS_DS__"
AS_IF([test "x$with_ds" = "xyes" ], [
AC_MSG_RESULT(using DirectSound)
LIBS="-ldsound -lwinmm $LIBS" ])
api="$api -D__WINDOWS_DS__"
LIBS="-ldsound -lwinmm $LIBS"
])

# Look for WASAPI flag
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__"
AS_IF([test "x$with_wasapi" = "xyes"], [
AC_MSG_RESULT(using WASAPI)
LIBS="-lwinmm -luuid -lksuser $LIBS" ])
api="$api -D__WINDOWS_WASAPI__"
LIBS="-lwinmm -luuid -lksuser $LIBS"
])

# If no audio api flags specified, use DS
AS_IF([test "x$api" = "x" ], [


Loading…
Cancel
Save