changeset 677:0e879fb48b48

Use the improved m4 macros; Some additional configure cleanups done; Added preliminary detection for the new COMI interface used in libSIDPlay2 CVS; Added VERY preliminary detection for Antti Lankila's libSIDPlay2+reSID patches. NOTICE! Neither of these are actually yet supported.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 10 May 2008 01:22:02 +0300
parents 60782f6c2bc8
children 4ab3252b83b8
files Makefile.am configure.in
diffstat 2 files changed, 82 insertions(+), 141 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am	Sat May 10 01:19:49 2008 +0300
+++ b/Makefile.am	Sat May 10 01:22:02 2008 +0300
@@ -68,15 +68,15 @@
 lib_LTLIBRARIES = libxmmssid.la
 
 # Generals
-AM_CFLAGS = -W -Wall -D_REENTRANT @XMMS_CFLAGS@ @SIDPLAY1_INCLUDES@	\
-		@SIDPLAY2_INCLUDES@ @BUILDERS_INCLUDES@			\
+AM_CFLAGS = -W -Wall -D_REENTRANT @XMMS_CFLAGS@ @SIDPLAY1_CFLAGS@	\
+		@SIDPLAY2_CFLAGS@ @BUILDERS_CFLAGS@			\
 		-DTHEMETUNE_FILE="\"$(pkgdatadir)/$(themetune)\""	\
 		-DLOCALEDIR="\"$(localedir)\""
 
 AM_CXXFLAGS = $(AM_CFLAGS)
 
 libxmmssid_la_LDFLAGS = -module -avoid-version @BUILDERS_LDFLAGS@
-libxmmssid_la_LIBADD  = @XMMS_LIBS@ @SIDPLAY1_LDADD@ @SIDPLAY2_LDADD@ @RESID_LDADD@ @HARDSID_LDADD@
+libxmmssid_la_LIBADD  = @XMMS_LIBS@ @SIDPLAY1_LIBS@ @SIDPLAY2_LIBS@ @BUILDERS_LIBS@
 
 # Glade-generated sources
 update-glade: xmms-sid.glade
--- a/configure.in	Sat May 10 01:19:49 2008 +0300
+++ b/configure.in	Sat May 10 01:22:02 2008 +0300
@@ -18,13 +18,13 @@
 dnl ***
 dnl *** Define some templates
 dnl ***
-AH_TEMPLATE([HAVE_SONG_POSITION],[Define if you have XMMS patched with the songpos patch.])
-AH_TEMPLATE([HAVE_XMMSEXTRA],[Define if you have XMMS version 1.2.5 or later and you want XMMS-SID to support some extra features.])
-AH_TEMPLATE([HAVE_SIDPLAY1],[Define if you have and want to use libSIDPlay 1])
-AH_TEMPLATE([HAVE_SIDPLAY2],[Define if you have and want to use libSIDPlay 2])
-AH_TEMPLATE([HAVE_RESID_BUILDER],[Define if you have reSID with libSIDPlay 2])
-AH_TEMPLATE([HAVE_HARDSID_BUILDER],[Define if you have HardSID with libSIDPlay 2])
-AH_TEMPLATE([HAVE_THEMETUNE],[Define if you want to build code to play XMMS-SID theme SID-tune. The tune needs to be installed too, though.])
+AH_TEMPLATE([HAVE_SONG_POSITION], [Define if you have XMMS patched with the songpos patch.])
+AH_TEMPLATE([HAVE_XMMSEXTRA], [Define if you have XMMS version 1.2.5 or later and you want XMMS-SID to support some extra features.])
+AH_TEMPLATE([HAVE_SIDPLAY1], [Define if you have and want to use libSIDPlay 1])
+AH_TEMPLATE([HAVE_SIDPLAY2], [Define if you have and want to use libSIDPlay 2])
+AH_TEMPLATE([HAVE_SIDPLAY2_COMI], [Define if you have libSIDPlay2 v2.2.x or later (or CVS version) with the new COMI API])
+AH_TEMPLATE([HAVE_SIDPLAY2_DISTORTION], [Define if you have libSIDPlay2 + reSID with Antti Lankila's distortion patches (v10 and possibly later) http://bel.fi/~alankila/c64-sw/])
+AH_TEMPLATE([HAVE_THEMETUNE], [Define if you want to build code to play XMMS-SID theme SID-tune. The tune needs to be installed too, though.])
 
 
 dnl ***
@@ -53,7 +53,7 @@
 dnl ***
 AC_CHECK_HEADER([pthread.h],,AC_MSG_ERROR([[*** POSIX thread support not found. Strange, maybe you don't have some development packages installed?]]))
 AM_PATH_GLIB([1.2.5],,AC_MSG_ERROR([[*** GLib >= 1.2.5 not found. You either don't have GLib at all or your GLib is too old. Latest GLib can be found from Gtk+ homepages (http://www.gtk.org/)]]))
-AM_PATH_GTK([1.2.5],,AC_MSG_ERROR([[*** Gtk+ >= 1.2.5 not found. You either don't have Gtk+ at all or your Gtk+ is too old. Latest Gtk+ can be found from Gtk+ homepages (http://www.gtk.org/)]]), gthread)
+AM_PATH_GTK([1.2.5],,AC_MSG_ERROR([[*** Gtk+ >= 1.2.5 not found. You either don't have Gtk+ at all or your Gtk+ is too old. Latest Gtk+ can be found from Gtk+ homepages (http://www.gtk.org/)]]), [gthread])
 
 
 dnl ***
@@ -78,164 +78,92 @@
                         not under GNU GPL, refer to README for license.
 ],[
 if test "x$enableval" = "xyes"; then
-	OPT_THEMETUNE=yes
+	xs_have_themetune=yes
 else
 	if test "x$enableval" = "xno"; then
-		OPT_THEMETUNE=no
+		xs_have_themetune=no
 	else
-		OPT_THEMETUNE=no
+		xs_have_themetune=no
 	fi
 fi
-],[OPT_THEMETUNE=yes])
-AC_DEFINE([HAVE_THEMETUNE],[test "x$OPT_THEMETUNE" = "xyes"])
-
-
-dnl ***
-dnl *** libSIDPlay 1 options
-dnl ***
-AC_ARG_WITH([sidplay1],
-[
-  --with-sidplay1=PREFIX   Enable SIDPlay1 with install-PREFIX],
-[
-if test "x$withval" = "xyes"; then
-xs_sidplay1=yes
-xs_sidplay1_library=""
-xs_sidplay1_includes=""
-else
-	if test "x$withval" = "xno"; then
-		xs_sidplay1=no
-	else
-		xs_sidplay1=yes
-		xs_sidplay1_includes="$withval/include"
-		xs_sidplay1_library="$withval/lib"
-	fi
-fi
-],[
-	xs_sidplay1=try
-	xs_sidplay1_library=""
-	xs_sidplay1_includes=""
-])
-
-
-AC_ARG_WITH([sidplay1-inc],
-[  --with-sidplay1-inc=DIR    Where the SIDPlay1 headers are located],
-[xs_sidplay1_includes="$withval"],)
-
-AC_ARG_WITH([sidplay1-lib],
-[  --with-sidplay1-lib=DIR    Where the SIDPlay1 library is installed],
-[xs_sidplay1_library="$withval"],)
+], [xs_have_themetune=yes])
+AC_DEFINE([HAVE_THEMETUNE], [test "x$xs_have_themetune" = "xyes"])
 
 
 dnl ***
-dnl *** libSIDPlay 2 options
+dnl *** libSIDPlay1/2 options
 dnl ***
-AC_ARG_WITH([sidplay2],
-[
-  --with-sidplay2=PREFIX   Enable SIDPlay2 with install-PREFIX],
-[
-if test "x$withval" = "xyes"; then
-	xs_sidplay2=yes
-	xs_sidplay2_library=""
-	xs_sidplay2_includes=""
-else
-	if test "x$withval" = "xno"; then
-		xs_sidplay2=no
-	else
-		xs_sidplay2=yes
-		xs_sidplay2_includes="$withval/include"
-		xs_sidplay2_library="$withval/lib"
-	fi
-fi
-],[
-	xs_sidplay2=try
-	xs_sidplay2_library=""
-	xs_sidplay2_includes=""
-])
-
-
-AC_ARG_WITH([sidplay2-inc],
-[  --with-sidplay2-inc=DIR    Where the SIDPlay2 headers are located],
-[xs_sidplay2_includes="$withval"],)
-
-
-AC_ARG_WITH([sidplay2-lib],
-[  --with-sidplay2-lib=DIR    Where the SIDPlay2 library is installed],
-[xs_sidplay2_library="$withval"],)
-
-
-dnl ***
-dnl *** Determine if libraries are wanted and available
-dnl ***
-OPT_SIDPLAY1="no"
-if test "x$xs_sidplay1" = "xtry"; then
-	XS_PATH_LIBSIDPLAY1
-else
-	if test "x$xs_sidplay1" = "xyes"; then
-		XS_PATH_LIBSIDPLAY1
-		if test "x$xs_have_sidplay1" = "xno"; then
-			AC_MSG_ERROR([libSIDPlay1 library and/or headers were not found!])
-		fi
-	fi
-fi
+XS_ARG_WITH([sidplay1], [libSIDPlay1], [XS_PATH_LIBSIDPLAY1])
 if test "x$xs_have_sidplay1" = "xyes"; then
 	AC_DEFINE([HAVE_SIDPLAY1])
-	OPT_SIDPLAY1="yes"
 fi
 
-
-
-OPT_SIDPLAY2="no"
-LIBSIDPLAY2_REQUIRED_VERSION="2.1.0"
-if test "x$xs_sidplay2" = "xtry"; then
-	XS_PATH_LIBSIDPLAY2
-else
-	if test "x$xs_sidplay2" = "xyes"; then
-		XS_PATH_LIBSIDPLAY2
-		if test "x$xs_have_sidplay2" = "xno"; then
-			AC_MSG_ERROR([libSIDPlay2 library and/or headers were not found!])
-		fi
-	fi
-fi
+XS_ARG_WITH([sidplay2], [libSIDPlay2], [XS_PATH_LIBSIDPLAY2])
+xs_have_sidplay2_api=""
+xs_have_distortion="no"
 if test "x$xs_have_sidplay2" = "xyes"; then
 	AC_DEFINE([HAVE_SIDPLAY2])
-	OPT_SIDPLAY2="yes"
-	BUILDERS_FIND
-	BUILDERS_FIND_RESID
-	BUILDERS_FIND_HARDSID
-	if test "x$builders_available" = "xno"; then
+	AC_LANG_PUSH([C++])
+	XS_BUILDERS_CHECK
+	XS_BUILDERS_FIND([reSID], [resid-builder], [resid.h], [ReSIDBuilder])
+	XS_BUILDERS_FIND([HardSID], [hardsid-builder], [hardsid.h], [HardSID])
+	AC_LANG_POP([C++])
+	if test "x$xs_builders_available" = "xno"; then
 		AC_MSG_ERROR([No builder modules were found in the sidbuilders directory!]);
 	fi
+	
+	dnl *** Check for new COMI API
+	AC_MSG_CHECKING([libSIDPlay2 API style])
+	tmp_CPPFLAGS="$CPPFLAGS"
+	if test -d "$xs_sidplay2_includes"; then
+		CPPFLAGS="$CPPFLAGS -I${xs_sidplay2_includes}"
+	fi
+	AC_EGREP_HEADER([SIDIID], [sidplay/sidplay2.h], [
+		xs_have_sidplay2_api="(new COMI style API)"
+		AC_DEFINE([HAVE_SIDPLAY2_COMI])
+	],[
+		xs_have_sidplay2_api="(old style API)"
+	])
+	AC_MSG_RESULT([$xs_sidplay2_api])
+	
+	dnl *** Check for distortion patch
+	AC_MSG_CHECKING([libSIDPlay2+reSID distortion patch])
+	AC_EGREP_HEADER([minimumfetresistance], [sidplay/sidtypes.h], [
+		xs_have_distortion="yes"
+		AC_DEFINE([HAVE_SIDPLAY2_DISTORTION])
+	],[
+		xs_have_distortion="no"
+	])
+	AC_MSG_RESULT([$xs_sidplay2_api])
+	CPPFLAGS="$tmp_CPPFLAGS"
 fi
 
 
 dnl ***
 dnl *** Check if we have some emulator library available?
 dnl ***
-if test "x$OPT_SIDPLAY1" = "xno"; then
-if test "x$OPT_SIDPLAY2" = "xno"; then
+if test "x$xs_have_sidplay1" = "xno" && test "x$xs_have_sidplay2" = "xno"; then
 	AC_MSG_ERROR([Either libSIDPlay1 or libSIDPlay2 is required! Please read INSTALL for more information!])
 fi
-fi
 
 
 dnl ***
 dnl *** Song position patch check
 dnl ***
 AC_MSG_CHECKING([for song position patch])
-tmp_CPPFLAGS=$CPPFLAGS
+tmp_CPPFLAGS="$CPPFLAGS"
 if test -d "$prefix"; then
 	CPPFLAGS="$CPPFLAGS -I${prefix}/include"
 fi
 
-AC_EGREP_HEADER([set_song_position],[xmms/plugin.h],[
-	OPT_SONGPOS="yes"
+AC_EGREP_HEADER([set_song_position], [xmms/plugin.h], [
+	xs_have_songpos="yes"
 	AC_DEFINE([HAVE_SONG_POSITION])
-	AC_MSG_RESULT([yes])
 ],[
-	OPT_SONGPOS="no"
-	AC_MSG_RESULT([no])
+	xs_have_songpos="no"
 ])
-CPPFLAGS=$tmp_CPPFLAGS
+AC_MSG_RESULT([$xs_have_songpos])
+CPPFLAGS="$tmp_CPPFLAGS"
 
 
 dnl ***
@@ -244,13 +172,13 @@
 AM_PATH_XMMS([1.2.0],, [
 AC_MSG_ERROR([*** XMMS >= 1.2.0 not found. You need XMMS v1.2.0 or later to use XMMS-SID plugin.])
 ])
-libdir=$XMMS_INPUT_PLUGIN_DIR
+libdir="$XMMS_INPUT_PLUGIN_DIR"
 
 XMMS_TEST_VERSION([$XMMS_VERSION], [1.2.5], [
 	AC_DEFINE([HAVE_XMMSEXTRA])
-	OPT_XMMSEXTRA="yes"
+	xs_have_xmmsextra="yes"
 ], [
-	OPT_XMMSEXTRA="no"
+	xs_have_xmmsextra="no"
 ])
 
 
@@ -269,14 +197,27 @@
 dnl *** Show the result message
 dnl ***
 AC_MSG_RESULT([
-	XMMS-SID has been configured successfully:
+	$PACKAGE_STRING has been configured successfully:
 
 	Installation directory        : $libdir
-	XMMS >= v1.2.5 extra features : $OPT_XMMSEXTRA
-	Song-position patch           : $OPT_SONGPOS
-	libSIDPlay 1 support          : $OPT_SIDPLAY1
-	libSIDPlay 2 support          : $OPT_SIDPLAY2
-		Included builders     : $xs_builders
-	XMMS-SID theme SID-tune       : $OPT_THEMETUNE
+	XMMS >= v1.2.5 extra features : $xs_have_xmmsextra
+	Song-position patch           : $xs_have_songpos
+	libSIDPlay 1 support          : $xs_have_sidplay1
+	libSIDPlay 2 support          : $xs_have_sidplay2 $xs_have_sidplay2_api
+	    With distortion patch?    : $xs_have_distortion
+	    Included builders         : $xs_builders
+	XMMS-SID theme SID-tune       : $xs_have_themetune
 	Translations (i18n/nls)       : $USE_NLS
 ])
+
+if test "x$xs_have_distortion" = "xyes"; then
+	echo "***"
+	echo "*** WARNING! A version of libSIDPlay2 with Antti Lankila's distortion"
+	echo "*** patches has been detected. Due to the fast-changing nature of this"
+	echo "*** particular patch-set, it is possible that this version of XMMS-SID"
+	echo "*** may be incompatible."
+	echo "***"
+	echo "*** If you encounter any compilation problems, try a non-patched"
+	echo "*** version of libSIDPlay2+reSID."
+	echo "***"
+fi