Added configure checks for libsidplay.

Original commit message from CVS:
Added configure checks for libsidplay.
This commit is contained in:
Wim Taymans 2001-06-30 15:22:03 +00:00
parent 02ed6e0635
commit 67b62497ca
2 changed files with 137 additions and 4 deletions

View file

@ -430,3 +430,137 @@ AC_DEFUN(GST_CHECK_ARTSC,
AC_SUBST(ARTSC_CFLAGS) AC_SUBST(ARTSC_CFLAGS)
]) ])
dnl sidplay stuff (taken from xmms)
AC_DEFUN(AC_FIND_FILE,
[
$3=NO
for i in $2; do
for j in $1; do
if test -r "$i/$j"; then
$3=$i
break 2
fi
done
done
])
AC_DEFUN(AC_PATH_LIBSIDPLAY,
[
AC_MSG_CHECKING([for SIDPLAY includes and library])
ac_sidplay_cflags=NO
ac_sidplay_library=NO
sidplay_cflags=""
sidplay_library=""
AC_ARG_WITH(sidplay-includes,
[ --with-sidplay-includes=DIR
where the sidplay includes are located],
[ac_sidplay_cflags="$withval"
])
AC_ARG_WITH(sidplay-library,
[ --with-sidplay-library=DIR
where the sidplay library is installed],
[ac_sidplay_library="$withval"
])
if test "$ac_sidplay_cflags" = NO || test "$ac_sidplay_library" = NO; then
#search common locations
AC_CACHE_VAL(ac_cv_have_sidplay,
[
sidplay_incdirs="$ac_sidplay_cflags /usr/include /usr/local/include /usr/lib/sidplay/include /usr/local/lib/sidplay/include"
AC_FIND_FILE(sidplay/sidtune.h,$sidplay_incdirs,sidplay_foundincdir)
ac_sidplay_cflags=$sidplay_foundincdir
sidplay_libdirs="$ac_sidplay_library /usr/lib /usr/local/lib /usr/lib/sidplay /usr/local/lib/sidplay"
AC_FIND_FILE(libsidplay.so libsidplay.so.1 libsidplay.so.1.36 libsidplay.so.1.37,$sidplay_libdirs,sidplay_foundlibdir)
ac_sidplay_library=$sidplay_foundlibdir
if test "$ac_sidplay_cflags" = NO || test "$ac_sidplay_library" = NO; then
ac_cv_have_sidplay="have_sidplay=no"
ac_sidplay_notfound=""
if test "$ac_sidplay_cflags" = NO; then
if test "$ac_sidplay_library" = NO; then
ac_sidplay_notfound="(headers and library)";
else
ac_sidplay_notfound="(headers)";
fi
else
ac_sidplay_notfound="(library)";
fi
eval "$ac_cv_have_sidplay"
AC_MSG_RESULT([$have_sidplay])
else
have_sidplay=yes
fi
]) dnl AC_CACHE_VAL(ac_cv_have_sidplay,
else
have_sidplay=yes
fi dnl if (have_to_search)
eval "$ac_cv_have_sidplay"
if test "$have_sidplay" != yes; then
AC_MSG_RESULT([$have_sidplay]);
else
ac_cv_have_sidplay="have_sidplay=yes \
ac_sidplay_cflags=$ac_sidplay_cflags ac_sidplay_library=$ac_sidplay_library"
AC_MSG_RESULT([library $ac_sidplay_library, headers $ac_sidplay_cflags])
sidplay_library=$ac_sidplay_library
sidplay_cflags=$ac_sidplay_cflags
SIDPLAY_LIBS="-L$sidplay_library -lsidplay"
all_libraries="$SIDPLAY_LIBS $all_libraries"
SIDPLAY_CFLAGS="-I$sidplay_cflags"
all_includes="$SIDPLAY_CFLAGS $all_includes"
fi
dnl Test compilation.
AC_MSG_CHECKING([whether -lsidplay works])
ac_cxxflags_safe=$CXXFLAGS
ac_ldflags_safe=$LDFLAGS
ac_libs_safe=$LIBS
CXXFLAGS="$CXXFLAGS -I$sidplay_cflags"
LDFLAGS="$LDFLAGS -L$sidplay_library"
LIBS="-lsidplay"
AC_CACHE_VAL(ac_cv_sidplay_works,
[
AC_LANG_CPLUSPLUS
AC_TRY_RUN([
#include <sidplay/player.h>
int main()
{
sidTune tune = sidTune(0);
}
],
ac_cv_sidplay_works="yes",
ac_cv_sidplay_works="no",
ac_cv_sidplay_works="no")
AC_LANG_C
])
CXXFLAGS="$ac_cxxflags_safe"
LDFLAGS="$ac_ldflags_safe"
LIBS="$ac_libs_safe"
AC_MSG_RESULT([$ac_cv_sidplay_works])
if test "$ac_cv_sidplay_works" != yes; then
have_sidplay=no
fi
dnl
AC_SUBST(SIDPLAY_CFLAGS)
AC_SUBST(SIDPLAY_LIBS)
AC_SUBST(sidplay_library)
AC_SUBST(sidplay_cflags)
])

View file

@ -565,10 +565,8 @@ AC_MSG_CHECKING(mpeg2dec library)
AC_CHECK_LIB(mpeg2, mpeg2_init, HAVE_MPEG2DEC=yes, HAVE_MPEG2DEC=no, ) AC_CHECK_LIB(mpeg2, mpeg2_init, HAVE_MPEG2DEC=yes, HAVE_MPEG2DEC=no, )
AC_CHECK_HEADER(mpeg2dec/mpeg2.h, :, HAVE_MPEG2DEC=no) AC_CHECK_HEADER(mpeg2dec/mpeg2.h, :, HAVE_MPEG2DEC=no)
dnl Check for flac dnl Check for sidplay
AC_MSG_CHECKING(FLAC library) AC_PATH_LIBSIDPLAY
AC_CHECK_LIB(FLAC, FLAC__stream_decoder_new, HAVE_FLAC=yes, HAVE_FLAC=no, -lm)
AC_CHECK_HEADER(FLAC/all.h, :, HAVE_FLAC=no)
dnl Check for librtp dnl Check for librtp
AC_MSG_CHECKING(rtp library) AC_MSG_CHECKING(rtp library)
@ -976,6 +974,7 @@ AM_CONDITIONAL(HAVE_AVIFILE, test "x$HAVE_AVIFILE" = "xyes")
AM_CONDITIONAL(HAVE_LIBOPENQUICKTIME, test "x$HAVE_LIBOPENQUICKTIME" = "xyes") AM_CONDITIONAL(HAVE_LIBOPENQUICKTIME, test "x$HAVE_LIBOPENQUICKTIME" = "xyes")
AM_CONDITIONAL(HAVE_LIBGSM, test "x$HAVE_LIBGSM" = "xyes") AM_CONDITIONAL(HAVE_LIBGSM, test "x$HAVE_LIBGSM" = "xyes")
AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes") AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
AM_CONDITIONAL(HAVE_SIDPLAY, test "x$have_sidplay" = "xyes")
dnl ############################ dnl ############################