- # If no audio api flags specified, use ALSA
- AS_IF([test "x$api" = "x" ], [
- AC_MSG_RESULT([using ALSA])
- api="${api} -D__LINUX_ALSA__"
- req="${req} alsa"
- AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR([ALSA support requires the asound library!]))
- ])
- AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR([RtAudio requires the pthread library!]))
- ],
- [*-apple*],[
- # Look for Core flag
- 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"
- ])
- # If no audio api flags specified, use CoreAudio
- AS_IF([test "x$api" = "x" ], [
- 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"
- ])
- AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR([RtAudio requires the pthread library!]))
- ],
- [*-mingw32*],[
- AS_IF([test "x$with_asio" = "xyes" ], [
- AC_MSG_RESULT([using ASIO])
- api="$api -D__WINDOWS_ASIO__"
- use_asio=yes
- CPPFLAGS="-I$srcdir/include $CPPFLAGS"
- ])
- # Look for DirectSound flag
- AS_IF([test "x$with_ds" = "xyes" ], [
- AC_MSG_RESULT([using DirectSound])
- api="$api -D__WINDOWS_DS__"
- LIBS="-ldsound -lwinmm $LIBS"
- ])
- # Look for WASAPI flag
- AS_IF([test "x$with_wasapi" = "xyes"], [
- AC_MSG_RESULT([using WASAPI])
- api="$api -D__WINDOWS_WASAPI__"
- LIBS="-lwinmm -luuid -lksuser $LIBS"
- CPPFLAGS="-I$srcdir/include $CPPFLAGS"
- ])
- # If no audio api flags specified, use DS
- AS_IF([test "x$api" = "x" ], [
- AC_MSG_RESULT([using DirectSound])
- api="$api -D__WINDOWS_DS__"
- LIBS="-ldsound -lwinmm $LIBS"
- ])
- LIBS="-lole32 $LIBS"
- ],[
+AS_CASE(["$systems"], [*" jack "*], [
+ AC_CHECK_LIB(jack, jack_client_open,
+ [api="$api -D__UNIX_JACK__"
+ req="$req jack"
+ need_pthread=yes
+ found="$found JACK"
+ LIBS="-ljack $LIBS"],
+ AS_CASE(["$required"], [*" jack "*],
+ AC_MSG_ERROR([JACK support requires the jack library!])))
+])
+
+AS_CASE(["$systems"], [*" core "*], [
+ AC_CHECK_HEADER(CoreAudio/CoreAudio.h,
+ [api="$api -D__MACOSX_CORE__"
+ need_pthread=yes
+ found="$found CoreAudio",
+ LIBS="$LIBS -framework CoreAudio -framework CoreFoundation"],
+ AS_CASE(["$required"], [*" core "*],
+ AC_MSG_ERROR([CoreAudio header files not found!])))
+])
+
+AS_CASE(["$systems"], [*" asio "*], [
+ api="$api -D__WINDOWS_ASIO__"
+ use_asio=yes
+ CPPFLAGS="-I$srcdir/include $CPPFLAGS"
+ need_ole32=yes
+ found="$found ASIO"
+])
+
+AS_CASE(["$systems"], [*" dsound "*], [
+ AC_CHECK_HEADERS(windows.h)
+ AC_CHECK_HEADERS(mmsystem.h mmreg.h dsound.h, [], [],
+[#ifdef HAVE_WINDOWS_H
+# include <windows.h>
+#endif])
+ AS_IF([test "x$ac_cv_header_windows_h" = xyes \
+ && test "x$ac_cv_header_mmsystem_h" = xyes \
+ && test "x$ac_cv_header_mmreg_h" = xyes \
+ && test "x$ac_cv_header_dsound_h" = xyes],
+ [api="$api -D__WINDOWS_DS__"
+ need_ole32=yes
+ found="$found DirectSound"
+ LIBS="-ldsound -lwinmm $LIBS"])
+])
+
+AS_CASE(["$systems"], [*" wasapi "*], [
+ AC_CHECK_HEADERS(windows.h)
+ AC_CHECK_HEADERS(audioclient.h avrt.h mmdeviceapi.h, [], [],
+[#ifdef HAVE_WINDOWS_H
+# include <windows.h>
+#endif])
+ AS_IF([test "x$ac_cv_header_windows_h" = xyes \
+ && test "x$ac_cv_header_audioclient_h" = xyes \
+ && test "x$ac_cv_header_avrt_h" = xyes \
+ && test "x$ac_cv_header_mmdeviceapi_h" = xyes],
+ [api="$api -D__WINDOWS_WASAPI__"
+ CPPFLAGS="-I$srcdir/include $CPPFLAGS"
+ need_ole32=yes
+ found="$found WASAPI"
+ LIBS="-lwinmm -lksuser -lmfplat -lmfuuid -lwmcodecdspuuid $LIBS"])
+])
+
+AS_IF([test -n "$need_ole32"], [LIBS="-lole32 $LIBS"])
+
+AS_IF([test -n "$need_pthread"],[
+ AC_MSG_CHECKING([for pthread])
+ AC_CHECK_LIB(pthread, pthread_create, ,
+ AC_MSG_ERROR([RtAudio requires the pthread library!]))])
+
+AC_MSG_CHECKING([for audio API])
+
+# Error case: no known realtime systems found.
+AS_IF([test x"$api" = "x"], [