diff configure.in @ 31:ca6dab6c4ead

Re-wrote configuration scripts and libsidplay 1/2 detection.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 08 Jun 2003 03:03:01 +0000
parents 469efc05e01e
children 13db37492b6d
line wrap: on
line diff
--- a/configure.in	Sat Jun 07 23:54:00 2003 +0000
+++ b/configure.in	Sun Jun 08 03:03:01 2003 +0000
@@ -6,8 +6,8 @@
 AC_PREREQ(2.54)
 
 dnl Initialize
-AC_INIT(XMMS-SID, 0.8.0rc1, ccr@tnsp.org)
-AC_COPYRIGHT([[(C) 2002 Michael Schwendt, Matti 'ccr' Hämäläinen]])
+AC_INIT(XMMS-SID, 0.8.0beta1, ccr@tnsp.org)
+AC_COPYRIGHT([[(C) 2002-2003 Matti 'ccr' Hämäläinen]])
 AC_CONFIG_SRCDIR(src/xmms-sid.h)
 AM_INIT_AUTOMAKE
 AC_CONFIG_HEADERS(config.h)
@@ -30,16 +30,125 @@
 AC_PROG_INSTALL
 AC_HEADER_STDC
 
+AC_PREFIX_PROGRAM(xmms)
+
+dnl ***
+dnl *** Checks for generic libraries
+dnl ***
+AM_PATH_GLIB(1.2.8,,AC_MSG_ERROR([*** GLib >= 1.2.8 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.8,,AC_MSG_ERROR([*** Gtk+ >= 1.2.8 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 ***
+dnl *** libSIDPlay 1 options
+dnl ***
+AC_ARG_WITH(libsidplay1,
+[  --with-libsidplay1=PREFIX   Enable SIDPlay1 with install-PREFIX is],
+[
+if test "$withval" = yes; then
+xs_sidplay1=yes
+xs_sidplay1_library=""
+xs_sidplay1_includes=""
+else
+if test "$withval" = no; then
+	xs_sidplay1=no
+	else
+	xs_sidplay1=yes
+	xs_sidplay1_includes="$withval/include"
+	xs_sidplay1_library="$withval/lib"
+	fi
+fi
+],[
+xs_sidplay1=yes
+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"],)
+
 
 dnl ***
-dnl *** Checks for libraries
+dnl *** libSIDPlay 2 options
+dnl ***
+AC_ARG_WITH(libsidplay2,
+[  --with-libsidplay2=PREFIX   Enable SIDPlay1 with install-PREFIX is],
+[
+if test "$withval" = yes; then
+xs_sidplay2=yes
+xs_sidplay2_library=""
+xs_sidplay2_includes=""
+else
+if test "$withval" = no; then
+	xs_sidplay2=no
+	else
+	xs_sidplay2=yes
+	xs_sidplay2_includes="$withval/include"
+	xs_sidplay2_library="$withval/lib"
+	fi
+fi
+],[
+xs_sidplay2=yes
+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 ***
-AC_PATH_LIBSIDPLAY
-dnl AC_PATH_LIBSIDPLAY2
+OPT_SIDPLAY1="no"
+if test "$xs_sidplay1" = yes; then
+XS_PATH_LIBSIDPLAY1
+if test "$xs_have_sidplay1" = yes; then
+AC_DEFINE(ENABLE_SIDPLAY1)
+OPT_SIDPLAY1="yes"
+else
+AC_MSG_ERROR([libSIDPlay1 library and/or headers were not found!])
+fi
+fi
+
 
-AM_PATH_GLIB(1.2.8,,AC_MSG_ERROR([*** GLIB >= 1.2.8 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/)]))
+OPT_SIDPLAY2="no"
+if test "$xs_sidplay2" = yes; then
+LIBSIDPLAY2_REQUIRED_VERSION="2.1.0"
+XS_PATH_LIBSIDPLAY2
+if test "$xs_have_sidplay2" = yes; then
+AC_DEFINE(ENABLE_SIDPLAY2)
+OPT_SIDPLAY2="yes"
+BUILDERS_FIND
+BUILDERS_FIND_RESID
+if test "$builders_available" = no; then
+AC_MSG_ERROR([No builder modules were found in the sidbuilders directory!]);
+fi
+else
+AC_MSG_ERROR([libSIDPlay2 library and/or headers were not found!])
+fi
+fi
 
-AM_PATH_GTK(1.2.8,,AC_MSG_ERROR([*** Gtk+ >= 1.2.8 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 ***
+dnl *** Check if we have some SIDPlay version
+dnl ***
+if test "$OPT_SIDPLAY1" = no; then
+if test "$OPT_SIDPLAY2" = no; then
+AC_MSG_ERROR([Either libSIDPlay1 or libSIDPlay2 is required! Please read INSTALL for more information!])
+fi
+fi
 
 
 dnl ***
@@ -51,7 +160,7 @@
 libdir=$XMMS_INPUT_PLUGIN_DIR
 
 XMMS_TEST_VERSION($XMMS_VERSION, 1.2.5, [
-AC_DEFINE(HAVE_XMMSEXTRA)
+AC_DEFINE(ENABLE_XMMSEXTRA)
 OPT_XMMSEXTRA="yes"
 ], [
 OPT_XMMSEXTRA="no"
@@ -59,30 +168,11 @@
 
 
 dnl ***
-dnl *** Check for optional settings
-dnl ***
-OPT_SUBSONGSEL="yes"
-
-AC_ARG_ENABLE(subsongsel,
-[
-XMMS-SID specific options:
-  --disable-subsongsel		Disable SIDAmp-style sub-song selector],
-[
-OPT_SUBSONGSEL="yes"
-], [
-OPT_SUBSONGSEL="no"
-])
-
-if test $OPT_SUBSONGSEL = "yes"; then
-AC_DEFINE(USE_SUBSONGSEL)
-fi
-
-
-dnl ***
 dnl *** Define some templates
 dnl ***
-AC_DEFINE(USE_SUBSONGSEL, 0, Define to 1 if user wants to use SIDAmp-style sub-song selector)
-AC_DEFINE(HAVE_XMMSEXTRA, 0, Define to 1 if you have XMMS version 1.2.5 or later)
+AC_DEFINE(ENABLE_XMMSEXTRA, 0, Define to 1 if you have XMMS version 1.2.5 or later)
+AC_DEFINE(ENABLE_SIDPLAY1, 1, Define to 1 if you want to use libSIDPlay 1)
+AC_DEFINE(ENABLE_SIDPLAY2, 1, Define to 1 if you want to use libSIDPlay 2)
 
 
 dnl ***
@@ -93,7 +183,6 @@
 src/Makefile
 xmms-sid.spec
 ])
-
 AC_OUTPUT
 
 
@@ -104,10 +193,8 @@
 	XMMS-SID has been configured successfully:
 
 	Installation directory        : $libdir
-	Sub-song selector enabled     : $OPT_SUBSONGSEL
 	XMMS >= v1.2.5 extra features : $OPT_XMMSEXTRA
-	libSIDPlay 1                  : $have_sidplay
-	libSIDPlay 2                  : $have_sidplay2
+	libSIDPlay 1 support          : $OPT_SIDPLAY1
+	libSIDPlay 2 support          : $OPT_SIDPLAY2
 
-	Now just run 'make && make install'!
 ])