Added configure and cmake support for libsamplerate

This commit is contained in:
Sam Lantinga
2017-01-06 20:43:53 -08:00
parent c5825b698d
commit df25258a1e
7 changed files with 294 additions and 179 deletions

View File

@@ -1049,6 +1049,58 @@ AC_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [[
fi
}
dnl Find FusionSound
CheckFusionSound()
{
AC_ARG_ENABLE(fusionsound,
AC_HELP_STRING([--enable-fusionsound], [use FusionSound audio driver [[default=no]]]),
, enable_fusionsound=no)
if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then
fusionsound=no
FUSIONSOUND_REQUIRED_VERSION=1.1.1
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
AC_MSG_CHECKING(for FusionSound $FUSIONSOUND_REQUIRED_VERSION support)
if test x$PKG_CONFIG != xno; then
if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $FUSIONSOUND_REQUIRED_VERSION fusionsound; then
FUSIONSOUND_CFLAGS=`$PKG_CONFIG --cflags fusionsound`
FUSIONSOUND_LIBS=`$PKG_CONFIG --libs fusionsound`
fusionsound=yes
fi
fi
AC_MSG_RESULT($fusionsound)
if test x$fusionsound = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_FUSIONSOUND, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS"
AC_ARG_ENABLE(fusionsound-shared,
AC_HELP_STRING([--enable-fusionsound-shared], [dynamically load fusionsound audio support [[default=yes]]]),
, enable_fusionsound_shared=yes)
fusionsound_shared=no
AC_MSG_CHECKING(for FusionSound dynamic loading support)
if test x$have_loadso != xyes && \
test x$enable_fusionsound_shared = xyes; then
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic fusionsound loading])
fi
if test x$have_loadso = xyes && \
test x$enable_fusionsound_shared = xyes; then
AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC, "libfusionsound.so", [ ])
fusionsound_shared=yes
SUMMARY_audio="${SUMMARY_audio} fusionsound(dynamic)"
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS"
SUMMARY_audio="${SUMMARY_audio} fusionsound"
fi
AC_MSG_RESULT($fusionsound_shared)
have_audio=yes
fi
fi
}
dnl rcg07142001 See if the user wants the disk writer audio driver...
CheckDiskAudio()
{
@@ -1075,6 +1127,34 @@ AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=
fi
}
dnl See if libsamplerate is available
CheckLibSampleRate()
{
AC_ARG_ENABLE(libsamplerate,
AC_HELP_STRING([--enable-libsamplerate], [use libsamplerate for audio rate conversion [[default=yes]]]),
, enable_libsamplerate=yes)
if test x$enable_libsamplerate = xyes; then
AC_CHECK_HEADER(samplerate.h,
have_samplerate_h_hdr=yes,
have_samplerate_h_hdr=no)
if test x$have_samplerate_h_hdr = xyes; then
AC_DEFINE(HAVE_LIBSAMPLERATE_H, 1, [ ])
AC_ARG_ENABLE(libsamplerate-shared,
AC_HELP_STRING([--enable-libsamplerate-shared], [dynamically load libsamplerate [[default=yes]]]),
, enable_libsamplerate_shared=yes)
if test x$enable_libsamplerate_shared = xyes; then
samplerate_lib=[`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
if test x$samplerate_lib != x; then
echo "-- dynamic samplerate -> $samplerate_lib"
AC_DEFINE_UNQUOTED(SDL_LIBSAMPLERATE_DYNAMIC, "$samplerate_lib", [ ])
fi
fi
fi
fi
}
dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
dnl Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
CheckVisibilityHidden()
@@ -1904,58 +1984,6 @@ AC_MSG_WARN("directfb $directfb_lib")
fi
}
dnl Find FusionSound
CheckFusionSound()
{
AC_ARG_ENABLE(fusionsound,
AC_HELP_STRING([--enable-fusionsound], [use FusionSound audio driver [[default=no]]]),
, enable_fusionsound=no)
if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then
fusionsound=no
FUSIONSOUND_REQUIRED_VERSION=1.1.1
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
AC_MSG_CHECKING(for FusionSound $FUSIONSOUND_REQUIRED_VERSION support)
if test x$PKG_CONFIG != xno; then
if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $FUSIONSOUND_REQUIRED_VERSION fusionsound; then
FUSIONSOUND_CFLAGS=`$PKG_CONFIG --cflags fusionsound`
FUSIONSOUND_LIBS=`$PKG_CONFIG --libs fusionsound`
fusionsound=yes
fi
fi
AC_MSG_RESULT($fusionsound)
if test x$fusionsound = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_FUSIONSOUND, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS"
AC_ARG_ENABLE(fusionsound-shared,
AC_HELP_STRING([--enable-fusionsound-shared], [dynamically load fusionsound audio support [[default=yes]]]),
, enable_fusionsound_shared=yes)
fusionsound_shared=no
AC_MSG_CHECKING(for FusionSound dynamic loading support)
if test x$have_loadso != xyes && \
test x$enable_fusionsound_shared = xyes; then
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic fusionsound loading])
fi
if test x$have_loadso = xyes && \
test x$enable_fusionsound_shared = xyes; then
AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC, "libfusionsound.so", [ ])
fusionsound_shared=yes
SUMMARY_audio="${SUMMARY_audio} fusionsound(dynamic)"
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS"
SUMMARY_audio="${SUMMARY_audio} fusionsound"
fi
AC_MSG_RESULT($fusionsound_shared)
have_audio=yes
fi
fi
}
dnl rcg04172001 Set up the Null video driver.
CheckDummyVideo()
{
@@ -2968,9 +2996,10 @@ case "$host" in
CheckESD
CheckNAS
CheckSNDIO
CheckFusionSound
CheckLibSampleRate
CheckX11
CheckDirectFB
CheckFusionSound
CheckOpenGLX11
CheckOpenGLESX11
CheckMir