From 4543e0a2ca986111f64b62871197662dcae32e21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 10 Oct 2017 13:01:35 +0200 Subject: [PATCH] use AS_CASE rather than "case" --- configure.ac | 42 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/configure.ac b/configure.ac index 7fdc4c8..b8ba18d 100644 --- a/configure.ac +++ b/configure.ac @@ -165,26 +165,23 @@ AS_IF([test "x$with_jack" = "xyes"], [ api="$api -D__UNIX_JACK__" ]) -case $host in - *-*-netbsd*) + +AS_CASE([$host], + [*-*-netbsd*], AS_IF([test "x$api" = "x"], [ AC_MSG_RESULT(using OSS) api="$api -D__LINUX_OSS__" 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*) + ]), + [*-*-freebsd*], AS_IF([test "x$api" = "x"], [ AC_MSG_RESULT(using OSS) api="$api -D__LINUX_OSS__" 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*) + ]), + [*-*-linux*], [ # Look for ALSA flag AS_IF([test "x$with_alsa" = "xyes"], [ AC_MSG_RESULT(using ALSA) @@ -192,7 +189,6 @@ case $host in req="$req alsa" AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!)) ]) - # Look for PULSE flag AS_IF([test "x$with_pulse" = "xyes"], [ AC_MSG_RESULT(using PulseAudio) @@ -215,9 +211,8 @@ case $host in 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*) + ], + [*-apple*],[ # Look for Core flag AS_IF([test "x$with_core" = "xyes"], [ AC_MSG_RESULT(using CoreAudio) @@ -225,7 +220,6 @@ case $host in 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) @@ -235,46 +229,38 @@ case $host in [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*) + ], + [*-mingw32*],[ AS_IF([test "x$with_asio" = "xyes" ], [ AC_MSG_RESULT(using ASIO) api="$api -D__WINDOWS_ASIO__" AC_SUBST( objects, ["asio.o asiodrivers.o asiolist.o iasiothiscallresolver.o"] ) ]) - # 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" ]) - # 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" - ;; - - *) + ],[ # Default case for unknown realtime systems. AC_MSG_ERROR(Unknown system type for realtime support!) - ;; -esac + ] +) CPPFLAGS="$CPPFLAGS $api" -- 2.30.2