configure.in
changeset 11081 eea7f98a37e4
parent 11028 25cd7fe50180
child 11090 d85832ad10c3
     1.1 --- a/configure.in	Thu Jun 08 22:40:35 2017 +0200
     1.2 +++ b/configure.in	Thu Jun 08 13:27:58 2017 -0400
     1.3 @@ -839,6 +839,63 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 +dnl Find JACK Audio
     1.8 +CheckJACK()
     1.9 +{
    1.10 +    AC_ARG_ENABLE(jack,
    1.11 +AC_HELP_STRING([--enable-jack], [use JACK audio [[default=yes]]]),
    1.12 +                  , enable_jack=yes)
    1.13 +    if test x$enable_audio = xyes -a x$enable_jack = xyes; then
    1.14 +        audio_jack=no
    1.15 +
    1.16 +        JACK_REQUIRED_VERSION=0.125
    1.17 +
    1.18 +        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
    1.19 +        AC_MSG_CHECKING(for JACK $JACK_REQUIRED_VERSION support)
    1.20 +        if test x$PKG_CONFIG != xno; then
    1.21 +        if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $JACK_REQUIRED_VERSION jack; then
    1.22 +                JACK_CFLAGS=`$PKG_CONFIG --cflags jack`
    1.23 +                JACK_LIBS=`$PKG_CONFIG --libs jack`
    1.24 +                audio_jack=yes
    1.25 +            fi
    1.26 +        fi
    1.27 +        AC_MSG_RESULT($audio_jack)
    1.28 +
    1.29 +        if test x$audio_jack = xyes; then
    1.30 +            AC_ARG_ENABLE(jack-shared,
    1.31 +AC_HELP_STRING([--enable-jack-shared], [dynamically load JACK audio support [[default=yes]]]),
    1.32 +                          , enable_jack_shared=yes)
    1.33 +            jack_lib=[`find_lib "libjack.so.*" "$JACK_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
    1.34 +
    1.35 +            AC_DEFINE(SDL_AUDIO_DRIVER_JACK, 1, [ ])
    1.36 +            SOURCES="$SOURCES $srcdir/src/audio/jack/*.c"
    1.37 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $JACK_CFLAGS"
    1.38 +            if test x$have_loadso != xyes && \
    1.39 +               test x$enable_jack_shared = xyes; then
    1.40 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic JACK audio loading])
    1.41 +            fi
    1.42 +            if test x$have_loadso = xyes && \
    1.43 +               test x$enable_jack_shared = xyes && test x$jack_lib != x; then
    1.44 +                echo "-- dynamic libjack -> $jack_lib"
    1.45 +                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_JACK_DYNAMIC, "$jack_lib", [ ])
    1.46 +                SUMMARY_audio="${SUMMARY_audio} jack(dynamic)"
    1.47 +
    1.48 +                case "$host" in
    1.49 +                    # On Solaris, jack must be linked deferred explicitly
    1.50 +                    # to prevent undefined symbol failures.
    1.51 +                    *-*-solaris*)
    1.52 +                        JACK_LIBS=`echo $JACK_LIBS | sed 's/\-l/-Wl,-l/g'`
    1.53 +                        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $JACK_LIBS -Wl,-znodeferred"
    1.54 +                esac
    1.55 +            else
    1.56 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $JACK_LIBS"
    1.57 +                SUMMARY_audio="${SUMMARY_audio} jack"
    1.58 +            fi
    1.59 +            have_audio=yes
    1.60 +        fi
    1.61 +    fi
    1.62 +}
    1.63 +
    1.64  dnl Find the ESD includes and libraries
    1.65  CheckESD()
    1.66  {
    1.67 @@ -3035,6 +3092,7 @@
    1.68          CheckOSS
    1.69          CheckALSA
    1.70          CheckPulseAudio
    1.71 +        CheckJACK
    1.72          CheckARTSC
    1.73          CheckESD
    1.74          CheckNAS