Skip to content

Commit

Permalink
Don't check all libraries, use AS_IF.
Browse files Browse the repository at this point in the history
Fix AC_ARG_WITH usage to be like the manual suggests:
https://autotools.io/autoconf/arguments.html
  • Loading branch information
radarsat1 committed Aug 27, 2017
1 parent db9277b commit 6fc0f5a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,12 @@ case $host in
AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!))], )

# Look for ALSA flag
AC_ARG_WITH(alsa, [ --with-alsa = choose native ALSA sequencer API support (linux only)], [
AC_ARG_WITH(alsa, [ --with-alsa = choose native ALSA sequencer 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_seq_open, , AC_MSG_ERROR(ALSA support requires the asound library!))], )
AC_CHECK_LIB(asound, snd_seq_open, , AC_MSG_ERROR(ALSA support requires the asound library!))])

if [test "$api" == "";] then
AC_MSG_RESULT(using ALSA)
Expand All @@ -136,11 +137,12 @@ case $host in
AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!))], )

# Look for Core flag
AC_ARG_WITH(core, [ --with-core = choose CoreMidi API support (mac only)], [
AC_ARG_WITH(core, [ --with-core = choose CoreMidi API support (mac only)])
AS_IF([test "x$with_core" == "xyes"], [
api="$api -D__MACOSX_CORE__"
AC_MSG_RESULT(using CoreMidi)
AC_CHECK_HEADER(CoreMIDI/CoreMIDI.h, [], [AC_MSG_ERROR(CoreMIDI header files not found!)] )
LIBS="$LIBS -framework CoreMIDI -framework CoreFoundation -framework CoreAudio" ], )
LIBS="$LIBS -framework CoreMIDI -framework CoreFoundation -framework CoreAudio" ])

# If no api flags specified, use CoreMidi
if [test "$api" == ""; ] then
Expand All @@ -155,15 +157,17 @@ case $host in

*-mingw32*)
# Look for WinMM flag
AC_ARG_WITH(winmm, [ --with-winmm = choose Windows MultiMedia (MM) API support (windoze only)], [
AC_ARG_WITH(winmm, [ --with-winmm = choose Windows MultiMedia (MM) API support (windoze only)])
AS_IF([test "x$with_winmm" == "xyes"], [
api="$api -D__WINDOWS_MM__"
AC_MSG_RESULT(using WinMM)
AC_SUBST( LIBS, [-lwinmm] )], )
AC_SUBST( LIBS, [-lwinmm] )])

AC_ARG_WITH(winks, [ --with-winks = choose kernel streaming support (windoze only)], [
AC_ARG_WITH(winks, [ --with-winks = choose kernel streaming support (windoze only)])
AS_IF([test "x$with_winks" == "xyes"], [
api="$api -D__WINDOWS_KS__"
AC_SUBST( LIBS, ["-lsetupapi -lksuser"] )
AC_MSG_RESULT(using kernel streaming) ], )
AC_MSG_RESULT(using kernel streaming) ])

# I can't get the following check to work so just manually add the library
# or could try the following? AC_LIB_WINMM([midiOutGetNumDevs])
Expand Down

0 comments on commit 6fc0f5a

Please sign in to comment.