# HG changeset patch # User Matti Hamalainen # Date 1352282326 -7200 # Node ID 1fe6005ed58cdde8f7767c8d65fa9607f7b3993d # Parent 13483b855058c634117ab0211963188dca601a76 Make it so that both libSIDPlay2 and libSIDPlay-FP can co-exist, though not at run-time, but either one can be chosen via --with-/--without- configure options. diff -r 13483b855058 -r 1fe6005ed58c acinclude.m4 --- a/acinclude.m4 Wed Nov 07 11:26:31 2012 +0200 +++ b/acinclude.m4 Wed Nov 07 11:58:46 2012 +0200 @@ -187,33 +187,66 @@ dnl @SIDPLAY_LIBS@ will be substituted with linker parameters dnl @SIDPLAY_INCLUDES@ will be substituted with compiler parameters dnl ------------------------------------------------------------------------- -AC_DEFUN([XS_PATH_LIBSIDPLAY2], + + +AC_DEFUN([XS_PATH_LIBSIDPLAYFP], [ - AC_MSG_CHECKING([for working SIDPlay2/FP library and headers]) + AC_MSG_CHECKING([for working SIDPlayFP library and headers]) AC_LANG_PUSH([C++]) - PKG_CHECK_EXISTS([libsidplay2 >= 2.1.1], [xs_pkg_sidplay2="yes"], []) PKG_CHECK_EXISTS([libsidplayfp >= 0.3.7], [xs_pkg_sidplayfp="yes"], []) if test "x$xs_pkg_sidplayfp" = "xyes"; then AC_CACHE_VAL([xs_cv_have_sidplayfp], [ - xs_sidplay2_cflags=`$PKG_CONFIG --libs libsidplayfp` - xs_sidplay2_ldflags=`$PKG_CONFIG --libs libsidplayfp` + xs_sidplayfp_cflags=`$PKG_CONFIG --libs libsidplayfp` + xs_sidplayfp_ldflags=`$PKG_CONFIG --libs libsidplayfp` - XS_TRY_LIBRARY([sidplay2], - [$xs_sidplay2_cxxflags -DHAVE_UNIX], [$xs_sidplay2_ldflags], + XS_TRY_LIBRARY([sidplayfp], + [$xs_sidplayfp_cxxflags -DHAVE_UNIX], [$xs_sidplayfp_ldflags], [sidplayfp], [sidplayfp/sidplay2.h], [sidplay2 *myEngine;]) - if test "x$xs_sidplay2_works" = "xyes"; then - xs_cv_have_sidplay2="xs_have_sidplayfp=yes \ - xs_sidplay2_cxxflags=\"$xs_sidplay2_cxxflags\" \ - xs_sidplay2_ldflags=\"$xs_sidplay2_ldflags\"" + if test "x$xs_sidplayfp_works" = "xyes"; then + xs_cv_have_sidplayfp="xs_have_sidplayfp=yes \ + xs_sidplayfp_cxxflags=\"$xs_sidplayfp_cxxflags\" \ + xs_sidplayfp_ldflags=\"$xs_sidplayfp_ldflags\"" fi ]) + fi - elif test "x$xs_pkg_sidplay2" = "xyes"; then + eval "$xs_cv_have_sidplayfp" + + if test "x$xs_have_sidplayfp" = "xyes"; then + if test "x$xs_sidplayfp_cxxflags" != "x" || test "x$xs_sidplayfp_ldflags" != "x"; then + AC_MSG_RESULT([$xs_sidplayfp_cxxflags $xs_sidplayfp_ldflags]) + else + AC_MSG_RESULT([yes]) + fi + + SIDPLAY2_LIBS="$xs_sidplayfp_ldflags" + SIDPLAY2_CFLAGS="$xs_sidplayfp_cxxflags" + AC_SUBST([SIDPLAY2_LIBS])dnl + AC_SUBST([SIDPLAY2_CFLAGS])dnl + else + AC_MSG_RESULT([no]) + fi + + AC_LANG_POP([C++]) +]) + + + + +AC_DEFUN([XS_PATH_LIBSIDPLAY2], +[ + AC_MSG_CHECKING([for working SIDPlay2 library and headers]) + + AC_LANG_PUSH([C++]) + + PKG_CHECK_EXISTS([libsidplay2 >= 2.1.1], [xs_pkg_sidplay2="yes"], []) + + if test "x$xs_pkg_sidplay2" = "xyes"; then AC_CACHE_VAL([xs_cv_have_sidplay2], [ @@ -256,9 +289,8 @@ fi eval "$xs_cv_have_sidplay2" - eval "$xs_cv_have_sidplayfp" - if test "x$xs_have_sidplay2" = "xyes" -o "x$xs_have_sidplayfp" = "xyes"; then + if test "x$xs_have_sidplay2" = "xyes"; then if test "x$xs_sidplay2_cxxflags" != "x" || test "x$xs_sidplay2_ldflags" != "x"; then AC_MSG_RESULT([$xs_sidplay2_cxxflags $xs_sidplay2_ldflags]) else diff -r 13483b855058 -r 1fe6005ed58c configure.ac --- a/configure.ac Wed Nov 07 11:26:31 2012 +0200 +++ b/configure.ac Wed Nov 07 11:58:46 2012 +0200 @@ -97,7 +97,7 @@ xs_have_sidplay2_api="" -XS_ARG_WITH([sidplay2], [libSIDPlay2], [XS_PATH_LIBSIDPLAY2]) +XS_ARG_WITH([sidplayfp], [libSIDPlayFP], [XS_PATH_LIBSIDPLAYFP]) if test "x$xs_have_sidplayfp" = "xyes"; then xs_have_sidplay2_api="(FP)" @@ -108,7 +108,9 @@ AC_DEFINE([HAVE_RESID_BUILDER]) AC_DEFINE([HAVE_RESID_FP_BUILDER]) -elif test "x$xs_have_sidplay2" = "xyes"; then +else +XS_ARG_WITH([sidplay2], [libSIDPlay2], [XS_PATH_LIBSIDPLAY2]) +if test "x$xs_have_sidplay2" = "xyes"; then xs_have_sidplay2_api="(non-COMI)" xs_have_sidplay2_lib="yes" AC_DEFINE([HAVE_SIDPLAY2]) @@ -126,6 +128,7 @@ AC_LANG_POP([C++]) fi +fi dnl *** diff -r 13483b855058 -r 1fe6005ed58c src/config.h.in --- a/src/config.h.in Wed Nov 07 11:26:31 2012 +0200 +++ b/src/config.h.in Wed Nov 07 11:58:46 2012 +0200 @@ -53,6 +53,9 @@ http://sourceforge.net/projects/sidplay-residfp/ */ #undef HAVE_SIDPLAY2_FP +/* Define if you have and want to use libSIDPlayFP */ +#undef HAVE_SIDPLAYFP + /* Define if you have XMMS patched with the songpos patch. */ #undef HAVE_SONG_POSITION