comparison configure.in @ 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 1c9fad120bbc
children 0c4e0feca4df
comparison
equal deleted inserted replaced
676:60782f6c2bc8 677:0e879fb48b48
16 16
17 17
18 dnl *** 18 dnl ***
19 dnl *** Define some templates 19 dnl *** Define some templates
20 dnl *** 20 dnl ***
21 AH_TEMPLATE([HAVE_SONG_POSITION],[Define if you have XMMS patched with the songpos patch.]) 21 AH_TEMPLATE([HAVE_SONG_POSITION], [Define if you have XMMS patched with the songpos patch.])
22 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.]) 22 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.])
23 AH_TEMPLATE([HAVE_SIDPLAY1],[Define if you have and want to use libSIDPlay 1]) 23 AH_TEMPLATE([HAVE_SIDPLAY1], [Define if you have and want to use libSIDPlay 1])
24 AH_TEMPLATE([HAVE_SIDPLAY2],[Define if you have and want to use libSIDPlay 2]) 24 AH_TEMPLATE([HAVE_SIDPLAY2], [Define if you have and want to use libSIDPlay 2])
25 AH_TEMPLATE([HAVE_RESID_BUILDER],[Define if you have reSID with libSIDPlay 2]) 25 AH_TEMPLATE([HAVE_SIDPLAY2_COMI], [Define if you have libSIDPlay2 v2.2.x or later (or CVS version) with the new COMI API])
26 AH_TEMPLATE([HAVE_HARDSID_BUILDER],[Define if you have HardSID with libSIDPlay 2]) 26 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/])
27 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.]) 27 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.])
28 28
29 29
30 dnl *** 30 dnl ***
31 dnl *** Some general checks 31 dnl *** Some general checks
32 dnl *** 32 dnl ***
51 dnl *** 51 dnl ***
52 dnl *** Checks for generic libraries 52 dnl *** Checks for generic libraries
53 dnl *** 53 dnl ***
54 AC_CHECK_HEADER([pthread.h],,AC_MSG_ERROR([[*** POSIX thread support not found. Strange, maybe you don't have some development packages installed?]])) 54 AC_CHECK_HEADER([pthread.h],,AC_MSG_ERROR([[*** POSIX thread support not found. Strange, maybe you don't have some development packages installed?]]))
55 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/)]])) 55 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/)]]))
56 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) 56 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])
57 57
58 58
59 dnl *** 59 dnl ***
60 dnl *** Checks for header files, types and functions 60 dnl *** Checks for header files, types and functions
61 dnl *** 61 dnl ***
76 --disable-themetune Disable XMMS-SID theme song-related code and 76 --disable-themetune Disable XMMS-SID theme song-related code and
77 installation of the SID-tune file. The tune is 77 installation of the SID-tune file. The tune is
78 not under GNU GPL, refer to README for license. 78 not under GNU GPL, refer to README for license.
79 ],[ 79 ],[
80 if test "x$enableval" = "xyes"; then 80 if test "x$enableval" = "xyes"; then
81 OPT_THEMETUNE=yes 81 xs_have_themetune=yes
82 else 82 else
83 if test "x$enableval" = "xno"; then 83 if test "x$enableval" = "xno"; then
84 OPT_THEMETUNE=no 84 xs_have_themetune=no
85 else 85 else
86 OPT_THEMETUNE=no 86 xs_have_themetune=no
87 fi 87 fi
88 fi 88 fi
89 ],[OPT_THEMETUNE=yes]) 89 ], [xs_have_themetune=yes])
90 AC_DEFINE([HAVE_THEMETUNE],[test "x$OPT_THEMETUNE" = "xyes"]) 90 AC_DEFINE([HAVE_THEMETUNE], [test "x$xs_have_themetune" = "xyes"])
91 91
92 92
93 dnl *** 93 dnl ***
94 dnl *** libSIDPlay 1 options 94 dnl *** libSIDPlay1/2 options
95 dnl *** 95 dnl ***
96 AC_ARG_WITH([sidplay1], 96 XS_ARG_WITH([sidplay1], [libSIDPlay1], [XS_PATH_LIBSIDPLAY1])
97 [
98 --with-sidplay1=PREFIX Enable SIDPlay1 with install-PREFIX],
99 [
100 if test "x$withval" = "xyes"; then
101 xs_sidplay1=yes
102 xs_sidplay1_library=""
103 xs_sidplay1_includes=""
104 else
105 if test "x$withval" = "xno"; then
106 xs_sidplay1=no
107 else
108 xs_sidplay1=yes
109 xs_sidplay1_includes="$withval/include"
110 xs_sidplay1_library="$withval/lib"
111 fi
112 fi
113 ],[
114 xs_sidplay1=try
115 xs_sidplay1_library=""
116 xs_sidplay1_includes=""
117 ])
118
119
120 AC_ARG_WITH([sidplay1-inc],
121 [ --with-sidplay1-inc=DIR Where the SIDPlay1 headers are located],
122 [xs_sidplay1_includes="$withval"],)
123
124 AC_ARG_WITH([sidplay1-lib],
125 [ --with-sidplay1-lib=DIR Where the SIDPlay1 library is installed],
126 [xs_sidplay1_library="$withval"],)
127
128
129 dnl ***
130 dnl *** libSIDPlay 2 options
131 dnl ***
132 AC_ARG_WITH([sidplay2],
133 [
134 --with-sidplay2=PREFIX Enable SIDPlay2 with install-PREFIX],
135 [
136 if test "x$withval" = "xyes"; then
137 xs_sidplay2=yes
138 xs_sidplay2_library=""
139 xs_sidplay2_includes=""
140 else
141 if test "x$withval" = "xno"; then
142 xs_sidplay2=no
143 else
144 xs_sidplay2=yes
145 xs_sidplay2_includes="$withval/include"
146 xs_sidplay2_library="$withval/lib"
147 fi
148 fi
149 ],[
150 xs_sidplay2=try
151 xs_sidplay2_library=""
152 xs_sidplay2_includes=""
153 ])
154
155
156 AC_ARG_WITH([sidplay2-inc],
157 [ --with-sidplay2-inc=DIR Where the SIDPlay2 headers are located],
158 [xs_sidplay2_includes="$withval"],)
159
160
161 AC_ARG_WITH([sidplay2-lib],
162 [ --with-sidplay2-lib=DIR Where the SIDPlay2 library is installed],
163 [xs_sidplay2_library="$withval"],)
164
165
166 dnl ***
167 dnl *** Determine if libraries are wanted and available
168 dnl ***
169 OPT_SIDPLAY1="no"
170 if test "x$xs_sidplay1" = "xtry"; then
171 XS_PATH_LIBSIDPLAY1
172 else
173 if test "x$xs_sidplay1" = "xyes"; then
174 XS_PATH_LIBSIDPLAY1
175 if test "x$xs_have_sidplay1" = "xno"; then
176 AC_MSG_ERROR([libSIDPlay1 library and/or headers were not found!])
177 fi
178 fi
179 fi
180 if test "x$xs_have_sidplay1" = "xyes"; then 97 if test "x$xs_have_sidplay1" = "xyes"; then
181 AC_DEFINE([HAVE_SIDPLAY1]) 98 AC_DEFINE([HAVE_SIDPLAY1])
182 OPT_SIDPLAY1="yes" 99 fi
183 fi 100
184 101 XS_ARG_WITH([sidplay2], [libSIDPlay2], [XS_PATH_LIBSIDPLAY2])
185 102 xs_have_sidplay2_api=""
186 103 xs_have_distortion="no"
187 OPT_SIDPLAY2="no"
188 LIBSIDPLAY2_REQUIRED_VERSION="2.1.0"
189 if test "x$xs_sidplay2" = "xtry"; then
190 XS_PATH_LIBSIDPLAY2
191 else
192 if test "x$xs_sidplay2" = "xyes"; then
193 XS_PATH_LIBSIDPLAY2
194 if test "x$xs_have_sidplay2" = "xno"; then
195 AC_MSG_ERROR([libSIDPlay2 library and/or headers were not found!])
196 fi
197 fi
198 fi
199 if test "x$xs_have_sidplay2" = "xyes"; then 104 if test "x$xs_have_sidplay2" = "xyes"; then
200 AC_DEFINE([HAVE_SIDPLAY2]) 105 AC_DEFINE([HAVE_SIDPLAY2])
201 OPT_SIDPLAY2="yes" 106 AC_LANG_PUSH([C++])
202 BUILDERS_FIND 107 XS_BUILDERS_CHECK
203 BUILDERS_FIND_RESID 108 XS_BUILDERS_FIND([reSID], [resid-builder], [resid.h], [ReSIDBuilder])
204 BUILDERS_FIND_HARDSID 109 XS_BUILDERS_FIND([HardSID], [hardsid-builder], [hardsid.h], [HardSID])
205 if test "x$builders_available" = "xno"; then 110 AC_LANG_POP([C++])
111 if test "x$xs_builders_available" = "xno"; then
206 AC_MSG_ERROR([No builder modules were found in the sidbuilders directory!]); 112 AC_MSG_ERROR([No builder modules were found in the sidbuilders directory!]);
207 fi 113 fi
114
115 dnl *** Check for new COMI API
116 AC_MSG_CHECKING([libSIDPlay2 API style])
117 tmp_CPPFLAGS="$CPPFLAGS"
118 if test -d "$xs_sidplay2_includes"; then
119 CPPFLAGS="$CPPFLAGS -I${xs_sidplay2_includes}"
120 fi
121 AC_EGREP_HEADER([SIDIID], [sidplay/sidplay2.h], [
122 xs_have_sidplay2_api="(new COMI style API)"
123 AC_DEFINE([HAVE_SIDPLAY2_COMI])
124 ],[
125 xs_have_sidplay2_api="(old style API)"
126 ])
127 AC_MSG_RESULT([$xs_sidplay2_api])
128
129 dnl *** Check for distortion patch
130 AC_MSG_CHECKING([libSIDPlay2+reSID distortion patch])
131 AC_EGREP_HEADER([minimumfetresistance], [sidplay/sidtypes.h], [
132 xs_have_distortion="yes"
133 AC_DEFINE([HAVE_SIDPLAY2_DISTORTION])
134 ],[
135 xs_have_distortion="no"
136 ])
137 AC_MSG_RESULT([$xs_sidplay2_api])
138 CPPFLAGS="$tmp_CPPFLAGS"
208 fi 139 fi
209 140
210 141
211 dnl *** 142 dnl ***
212 dnl *** Check if we have some emulator library available? 143 dnl *** Check if we have some emulator library available?
213 dnl *** 144 dnl ***
214 if test "x$OPT_SIDPLAY1" = "xno"; then 145 if test "x$xs_have_sidplay1" = "xno" && test "x$xs_have_sidplay2" = "xno"; then
215 if test "x$OPT_SIDPLAY2" = "xno"; then
216 AC_MSG_ERROR([Either libSIDPlay1 or libSIDPlay2 is required! Please read INSTALL for more information!]) 146 AC_MSG_ERROR([Either libSIDPlay1 or libSIDPlay2 is required! Please read INSTALL for more information!])
217 fi 147 fi
218 fi
219 148
220 149
221 dnl *** 150 dnl ***
222 dnl *** Song position patch check 151 dnl *** Song position patch check
223 dnl *** 152 dnl ***
224 AC_MSG_CHECKING([for song position patch]) 153 AC_MSG_CHECKING([for song position patch])
225 tmp_CPPFLAGS=$CPPFLAGS 154 tmp_CPPFLAGS="$CPPFLAGS"
226 if test -d "$prefix"; then 155 if test -d "$prefix"; then
227 CPPFLAGS="$CPPFLAGS -I${prefix}/include" 156 CPPFLAGS="$CPPFLAGS -I${prefix}/include"
228 fi 157 fi
229 158
230 AC_EGREP_HEADER([set_song_position],[xmms/plugin.h],[ 159 AC_EGREP_HEADER([set_song_position], [xmms/plugin.h], [
231 OPT_SONGPOS="yes" 160 xs_have_songpos="yes"
232 AC_DEFINE([HAVE_SONG_POSITION]) 161 AC_DEFINE([HAVE_SONG_POSITION])
233 AC_MSG_RESULT([yes])
234 ],[ 162 ],[
235 OPT_SONGPOS="no" 163 xs_have_songpos="no"
236 AC_MSG_RESULT([no]) 164 ])
237 ]) 165 AC_MSG_RESULT([$xs_have_songpos])
238 CPPFLAGS=$tmp_CPPFLAGS 166 CPPFLAGS="$tmp_CPPFLAGS"
239 167
240 168
241 dnl *** 169 dnl ***
242 dnl *** Check XMMS version 170 dnl *** Check XMMS version
243 dnl *** 171 dnl ***
244 AM_PATH_XMMS([1.2.0],, [ 172 AM_PATH_XMMS([1.2.0],, [
245 AC_MSG_ERROR([*** XMMS >= 1.2.0 not found. You need XMMS v1.2.0 or later to use XMMS-SID plugin.]) 173 AC_MSG_ERROR([*** XMMS >= 1.2.0 not found. You need XMMS v1.2.0 or later to use XMMS-SID plugin.])
246 ]) 174 ])
247 libdir=$XMMS_INPUT_PLUGIN_DIR 175 libdir="$XMMS_INPUT_PLUGIN_DIR"
248 176
249 XMMS_TEST_VERSION([$XMMS_VERSION], [1.2.5], [ 177 XMMS_TEST_VERSION([$XMMS_VERSION], [1.2.5], [
250 AC_DEFINE([HAVE_XMMSEXTRA]) 178 AC_DEFINE([HAVE_XMMSEXTRA])
251 OPT_XMMSEXTRA="yes" 179 xs_have_xmmsextra="yes"
252 ], [ 180 ], [
253 OPT_XMMSEXTRA="no" 181 xs_have_xmmsextra="no"
254 ]) 182 ])
255 183
256 184
257 dnl *** 185 dnl ***
258 dnl *** And finally, output the all generatable files! 186 dnl *** And finally, output the all generatable files!
267 195
268 dnl *** 196 dnl ***
269 dnl *** Show the result message 197 dnl *** Show the result message
270 dnl *** 198 dnl ***
271 AC_MSG_RESULT([ 199 AC_MSG_RESULT([
272 XMMS-SID has been configured successfully: 200 $PACKAGE_STRING has been configured successfully:
273 201
274 Installation directory : $libdir 202 Installation directory : $libdir
275 XMMS >= v1.2.5 extra features : $OPT_XMMSEXTRA 203 XMMS >= v1.2.5 extra features : $xs_have_xmmsextra
276 Song-position patch : $OPT_SONGPOS 204 Song-position patch : $xs_have_songpos
277 libSIDPlay 1 support : $OPT_SIDPLAY1 205 libSIDPlay 1 support : $xs_have_sidplay1
278 libSIDPlay 2 support : $OPT_SIDPLAY2 206 libSIDPlay 2 support : $xs_have_sidplay2 $xs_have_sidplay2_api
279 Included builders : $xs_builders 207 With distortion patch? : $xs_have_distortion
280 XMMS-SID theme SID-tune : $OPT_THEMETUNE 208 Included builders : $xs_builders
209 XMMS-SID theme SID-tune : $xs_have_themetune
281 Translations (i18n/nls) : $USE_NLS 210 Translations (i18n/nls) : $USE_NLS
282 ]) 211 ])
212
213 if test "x$xs_have_distortion" = "xyes"; then
214 echo "***"
215 echo "*** WARNING! A version of libSIDPlay2 with Antti Lankila's distortion"
216 echo "*** patches has been detected. Due to the fast-changing nature of this"
217 echo "*** particular patch-set, it is possible that this version of XMMS-SID"
218 echo "*** may be incompatible."
219 echo "***"
220 echo "*** If you encounter any compilation problems, try a non-patched"
221 echo "*** version of libSIDPlay2+reSID."
222 echo "***"
223 fi