jack: Initial shot at a JACK audio target.

http://jackaudio.org/

Fixes Bugzilla #2163.
(with several more commits following to improve this code.)

--HG--
extra : rebase_source : 5d0d44fcca077c41c56381575a45184bdc050003
This commit is contained in:
Ryan C. Gordon 2017-06-08 13:27:58 -04:00
parent 6219e4a880
commit 0240079805
10 changed files with 763 additions and 1 deletions

120
configure vendored
View file

@ -658,10 +658,10 @@ X_PRE_LIBS
X_CFLAGS
XMKMF
ARTSCONFIG
PKG_CONFIG
ESD_LIBS
ESD_CFLAGS
ESD_CONFIG
PKG_CONFIG
ALSA_LIBS
ALSA_CFLAGS
POW_LIB
@ -806,6 +806,8 @@ with_alsa_prefix
with_alsa_inc_prefix
enable_alsatest
enable_alsa_shared
enable_jack
enable_jack_shared
enable_esd
with_esd_prefix
with_esd_exec_prefix
@ -1535,6 +1537,8 @@ Optional Features:
--enable-alsa support the ALSA audio API [[default=yes]]
--disable-alsatest Do not try to compile and run a test Alsa program
--enable-alsa-shared dynamically load ALSA audio support [[default=yes]]
--enable-jack use JACK audio [[default=yes]]
--enable-jack-shared dynamically load JACK audio support [[default=yes]]
--enable-esd support the Enlightened Sound Daemon [[default=yes]]
--disable-esdtest Do not try to compile and run a test ESD program
--enable-esd-shared dynamically load ESD audio support [[default=yes]]
@ -17870,6 +17874,119 @@ _ACEOF
fi
}
CheckJACK()
{
# Check whether --enable-jack was given.
if test "${enable_jack+set}" = set; then :
enableval=$enable_jack;
else
enable_jack=yes
fi
if test x$enable_audio = xyes -a x$enable_jack = xyes; then
audio_jack=no
JACK_REQUIRED_VERSION=0.125
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
$as_echo "$PKG_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JACK $JACK_REQUIRED_VERSION support" >&5
$as_echo_n "checking for JACK $JACK_REQUIRED_VERSION support... " >&6; }
if test x$PKG_CONFIG != xno; then
if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $JACK_REQUIRED_VERSION jack; then
JACK_CFLAGS=`$PKG_CONFIG --cflags jack`
JACK_LIBS=`$PKG_CONFIG --libs jack`
audio_jack=yes
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $audio_jack" >&5
$as_echo "$audio_jack" >&6; }
if test x$audio_jack = xyes; then
# Check whether --enable-jack-shared was given.
if test "${enable_jack_shared+set}" = set; then :
enableval=$enable_jack_shared;
else
enable_jack_shared=yes
fi
jack_lib=`find_lib "libjack.so.*" "$JACK_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
$as_echo "#define SDL_AUDIO_DRIVER_JACK 1" >>confdefs.h
SOURCES="$SOURCES $srcdir/src/audio/jack/*.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS $JACK_CFLAGS"
if test x$have_loadso != xyes && \
test x$enable_jack_shared = xyes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic JACK audio loading" >&5
$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic JACK audio loading" >&2;}
fi
if test x$have_loadso = xyes && \
test x$enable_jack_shared = xyes && test x$jack_lib != x; then
echo "-- dynamic libjack -> $jack_lib"
cat >>confdefs.h <<_ACEOF
#define SDL_AUDIO_DRIVER_JACK_DYNAMIC "$jack_lib"
_ACEOF
SUMMARY_audio="${SUMMARY_audio} jack(dynamic)"
case "$host" in
# On Solaris, jack must be linked deferred explicitly
# to prevent undefined symbol failures.
*-*-solaris*)
JACK_LIBS=`echo $JACK_LIBS | sed 's/\-l/-Wl,-l/g'`
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $JACK_LIBS -Wl,-znodeferred"
esac
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $JACK_LIBS"
SUMMARY_audio="${SUMMARY_audio} jack"
fi
have_audio=yes
fi
fi
}
CheckESD()
{
# Check whether --enable-esd was given.
@ -23264,6 +23381,7 @@ case "$host" in
CheckOSS
CheckALSA
CheckPulseAudio
CheckJACK
CheckARTSC
CheckESD
CheckNAS