Skip to content

Latest commit

 

History

History
572 lines (533 loc) · 20.2 KB

configure.in

File metadata and controls

572 lines (533 loc) · 20.2 KB
 
Oct 21, 1999
Oct 21, 1999
1
2
dnl Process this file with autoconf to produce a configure script.
AC_INIT(README)
Oct 4, 2009
Oct 4, 2009
3
AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
Oct 21, 1999
Oct 21, 1999
4
5
6
7
8
9
10
11
12
13
dnl Set various version strings - taken gratefully from the GTk sources
# Making releases:
# MICRO_VERSION += 1;
# INTERFACE_AGE += 1;
# BINARY_AGE += 1;
# if any functions have been added, set INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set BINARY_AGE and INTERFACE_AGE to 0.
Apr 30, 2006
Apr 30, 2006
14
#
Oct 21, 1999
Oct 21, 1999
15
MAJOR_VERSION=1
Apr 4, 2001
Apr 4, 2001
16
MINOR_VERSION=2
Oct 7, 2009
Oct 7, 2009
17
18
19
MICRO_VERSION=9
INTERFACE_AGE=7
BINARY_AGE=9
Oct 21, 1999
Oct 21, 1999
20
21
22
23
24
25
26
27
28
29
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_SUBST(MICRO_VERSION)
AC_SUBST(INTERFACE_AGE)
AC_SUBST(BINARY_AGE)
AC_SUBST(VERSION)
# libtool versioning
Oct 4, 2009
Oct 4, 2009
30
31
LT_INIT([win32-dll])
Oct 21, 1999
Oct 21, 1999
32
33
34
35
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
LT_REVISION=$INTERFACE_AGE
LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
Oct 10, 2009
Oct 10, 2009
36
m4_pattern_allow([^LT_])
Oct 21, 1999
Oct 21, 1999
37
38
39
40
41
42
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
Mar 19, 2006
Mar 19, 2006
43
dnl Detect the canonical build and host environments
Apr 30, 2006
Apr 30, 2006
44
AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
Oct 10, 2009
Oct 10, 2009
45
dnl AC_CANONICAL_HOST
Aug 10, 2000
Aug 10, 2000
46
Oct 2, 2009
Oct 2, 2009
47
48
49
50
51
52
53
54
55
56
57
58
dnl Check for tools
AC_PROG_LIBTOOL
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
if test -z "$host_alias"; then
hostaliaswindres=
else
hostaliaswindres="$host_alias-windres"
fi
AC_CHECK_PROGS(WINDRES, [windres $hostaliaswindres $host_os-windres])
Apr 30, 2006
Apr 30, 2006
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
dnl Set up the compiler and linker flags
case "$host" in
*-*-cygwin*)
# We build SDL on cygwin without the UNIX emulation layer
BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
BASE_LDFLAGS="-mno-cygwin"
;;
*)
BASE_CFLAGS="-D_GNU_SOURCE=1"
BASE_LDFLAGS=""
;;
esac
BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
BUILD_LDFLAGS="$LDFLAGS"
EXTRA_LDFLAGS="$BASE_LDFLAGS"
Jul 18, 2007
Jul 18, 2007
75
76
77
78
79
80
81
82
83
## These are common directories to find software packages
#for path in /usr/freeware /usr/pkg /usr/local; do
# if test -d $path/include; then
# EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
# fi
# if test -d $path/lib; then
# EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
# fi
#done
Apr 30, 2006
Apr 30, 2006
84
85
86
CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
Jun 10, 2001
Jun 10, 2001
87
Apr 30, 2006
Apr 30, 2006
88
89
dnl Check for compiler characteristics
AC_C_CONST
Oct 21, 1999
Oct 21, 1999
90
Oct 8, 2009
Oct 8, 2009
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
dnl See whether we can use gcc style dependency tracking
AC_ARG_ENABLE(dependency-tracking,
AC_HELP_STRING([--enable-dependency-tracking],
[Use gcc -MMD -MT dependency tracking [[default=yes]]]),
, enable_dependency_tracking=yes)
if test x$enable_dependency_tracking = xyes; then
have_gcc_mmd_mt=no
AC_MSG_CHECKING(for GCC -MMD -MT option)
AC_TRY_COMPILE([
#if !defined(__GNUC__) || __GNUC__ < 3
#error Dependency tracking requires GCC 3.0 or newer
#endif
],[
],[
have_gcc_mmd_mt=yes
])
AC_MSG_RESULT($have_gcc_mmd_mt)
if test x$have_gcc_mmd_mt = xyes; then
DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
fi
fi
Mar 19, 2006
Mar 19, 2006
114
case "$host" in
Aug 10, 2000
Aug 10, 2000
115
*-*-cygwin* | *-*-mingw32*)
Oct 4, 2009
Oct 4, 2009
116
VERSION_SOURCES="$srcdir/version.rc"
Apr 30, 2006
Apr 30, 2006
117
EXE=".exe"
Jul 18, 2007
Jul 18, 2007
118
119
120
121
122
123
124
125
126
if test "$build" != "$host"; then # cross-compiling
# Default cross-compile location
ac_default_prefix=/usr/local/cross-tools/i386-mingw32
else
# Look for the location of the tools and install there
if test "$BUILD_PREFIX" != ""; then
ac_default_prefix=$BUILD_PREFIX
fi
fi
Aug 10, 2000
Aug 10, 2000
127
;;
Apr 30, 2006
Apr 30, 2006
128
*)
Jul 18, 2007
Jul 18, 2007
129
SOURCES=""
Apr 30, 2006
Apr 30, 2006
130
EXE=""
Feb 4, 2003
Feb 4, 2003
131
;;
Oct 25, 1999
Oct 25, 1999
132
133
esac
Apr 30, 2006
Apr 30, 2006
134
135
136
137
138
139
140
141
142
143
# Standard C sources
SOURCES="$SOURCES \
$srcdir/effect_position.c \
$srcdir/effect_stereoreverse.c \
$srcdir/effects_internal.c \
$srcdir/load_aiff.c \
$srcdir/load_voc.c \
$srcdir/mixer.c \
$srcdir/music.c"
Oct 13, 2009
Oct 13, 2009
144
145
146
147
dnl set this to use on systems that use lib64 instead of lib
base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
dnl Function to find a library in the compiler search path
Jul 18, 2007
Jul 18, 2007
148
149
find_lib()
{
Jul 21, 2007
Jul 21, 2007
150
151
gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
Oct 13, 2009
Oct 13, 2009
152
env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
Oct 2, 2009
Oct 2, 2009
153
154
155
if test "$cross_compiling" = yes; then
host_lib_path=""
else
Oct 13, 2009
Oct 13, 2009
156
host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
Oct 2, 2009
Oct 2, 2009
157
158
fi
for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
Oct 13, 2009
Oct 13, 2009
159
lib=[`ls -- $path/$1 2>/dev/null | sort | sed 's/.*\/\(.*\)/\1/; q'`]
Jul 18, 2007
Jul 18, 2007
160
161
162
163
164
165
166
if test x$lib != x; then
echo $lib
return
fi
done
}
Nov 23, 1999
Nov 23, 1999
167
dnl Check for SDL
May 9, 2006
May 9, 2006
168
SDL_VERSION=1.2.10
Nov 23, 1999
Nov 23, 1999
169
170
AM_PATH_SDL($SDL_VERSION,
:,
Jul 18, 2007
Jul 18, 2007
171
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
Nov 23, 1999
Nov 23, 1999
172
)
Apr 30, 2006
Apr 30, 2006
173
174
EXTRA_CFLAGS="$EXTRA_CFLAGS $SDL_CFLAGS"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SDL_LIBS"
Oct 21, 1999
Oct 21, 1999
175
Oct 26, 2009
Oct 26, 2009
176
177
178
dnl Check for math library
AC_CHECK_LIB(m, pow, [LIBM="-lm"])
Oct 21, 1999
Oct 21, 1999
179
dnl Check command-line options
Jun 10, 2001
Jun 10, 2001
180
May 12, 2006
May 12, 2006
181
182
183
AC_ARG_ENABLE([music-cmd],
AC_HELP_STRING([--enable-music-cmd], [support an external music player [[default=yes]]]),
[], [enable_music_cmd=yes])
Oct 21, 1999
Oct 21, 1999
184
if test x$enable_music_cmd = xyes; then
Apr 30, 2006
Apr 30, 2006
185
186
SOURCES="$SOURCES $srcdir/music_cmd.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DCMD_MUSIC"
Oct 21, 1999
Oct 21, 1999
187
fi
Oct 3, 2009
Oct 3, 2009
188
May 12, 2006
May 12, 2006
189
190
191
AC_ARG_ENABLE([music-wave],
AC_HELP_STRING([--enable-music-wave], [enable streaming WAVE music [[default=yes]]]),
[], [enable_music_wave=yes])
Oct 21, 1999
Oct 21, 1999
192
if test x$enable_music_wave = xyes; then
Apr 30, 2006
Apr 30, 2006
193
194
SOURCES="$SOURCES $srcdir/wavestream.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DWAV_MUSIC"
Oct 21, 1999
Oct 21, 1999
195
fi
Oct 3, 2009
Oct 3, 2009
196
197
198
199
200
201
202
203
204
205
206
207
208
AC_ARG_ENABLE([music-mod],
AC_HELP_STRING([--enable-music-mod], [enable MOD music via mikmod [[default=yes]]]),
[], [enable_music_mod=yes])
AC_ARG_ENABLE([music-mod-shared],
AC_HELP_STRING([--enable-music-mod-shared], [dynamically load MOD support [[default=yes]]]),
[], [enable_music_mod_shared=yes])
if test x$enable_music_mod = xyes; then
have_libmikmod=no
libmikmod_maj=3
libmikmod_min=1
libmikmod_rev=10
libmikmod_ver="$libmikmod_maj.$libmikmod_min.$libmikmod_rev"
Jul 18, 2007
Jul 18, 2007
209
210
AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no, [$PATH])
if test "$LIBMIKMOD_CONFIG" != "no" ; then
Oct 3, 2009
Oct 3, 2009
211
Jul 18, 2007
Jul 18, 2007
212
213
214
215
CFLAGS_SAVED="$CFLAGS"
LIBS_SAVED="$LIBS"
CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
LIBS="$LIBS `$LIBMIKMOD_CONFIG --libs`"
Oct 3, 2009
Oct 3, 2009
216
have_libmikmod=yes
Jul 18, 2007
Jul 18, 2007
217
218
AC_MSG_CHECKING([for libmikmod - version >= $libmikmod_ver])
AC_TRY_RUN([
Nov 13, 2004
Nov 13, 2004
219
220
221
222
223
#include "mikmod.h"
#include "stdio.h"
int main(int argc, char **argv)
{
Oct 3, 2009
Oct 3, 2009
224
225
226
227
228
229
230
231
long maj=$libmikmod_maj,min=$libmikmod_min,rev=$libmikmod_rev,ver=MikMod_GetVersion();
/*printf("(%d.%d.%d) ",ver>>16,(ver>>8)&0xff,ver&0xff);*/
if(ver>=((maj<<16)|(min<<8)|(rev))) {
printf("yes\n");
return 0;
}
printf("no\n*** libmikmod is older than %d.%d.%d, not using.\n",maj,min,rev);
return 1;
Nov 13, 2004
Nov 13, 2004
232
}
Oct 3, 2009
Oct 3, 2009
233
234
], [], have_libmikmod=no; CFLAGS="$CFLAGS_SAVED"; LIBS="$LIBS_SAVED",
[echo $ac_n "cross compiling; assumed OK... $ac_c"])
Jul 18, 2007
Jul 18, 2007
235
fi
Nov 13, 2004
Nov 13, 2004
236
Oct 3, 2009
Oct 3, 2009
237
238
239
if test x$have_libmikmod = xyes; then
case "$host" in
*-*-darwin*)
Oct 18, 2009
Oct 18, 2009
240
mikmod_lib=[`find_lib libmikmod.dylib`]
Oct 3, 2009
Oct 3, 2009
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
;;
*-*-cygwin* | *-*-mingw32*)
mikmod_lib=[`find_lib "mikmod*.dll"`]
;;
*)
mikmod_lib=[`find_lib "libmikmod*.so.[0-9]"`]
if test x$mikmod_lib = x; then
mikmod_lib=[`find_lib "libmikmod*.so.[0-9]*"`]
fi
;;
esac
SOURCES="$SOURCES $srcdir/*_mod.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
if test x$enable_music_mod_shared = xyes && test x$mikmod_lib != x; then
echo "-- dynamic libmikmod -> $mikmod_lib"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_DYNAMIC=\\\"$mikmod_lib\\\""
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS `$LIBMIKMOD_CONFIG --libs`"
fi
Oct 3, 2009
Oct 3, 2009
260
else
Oct 3, 2009
Oct 3, 2009
261
262
AC_MSG_WARN([*** Unable to find MikMod library (http://mikmod.raphnet.net/)])
AC_MSG_WARN([MOD support disabled])
Oct 3, 2009
Oct 3, 2009
263
fi
Oct 21, 1999
Oct 21, 1999
264
fi
Oct 3, 2009
Oct 3, 2009
265
May 12, 2006
May 12, 2006
266
267
268
AC_ARG_ENABLE([music-midi],
AC_HELP_STRING([--enable-music-midi], [enable MIDI music via timidity [[default=yes]]]),
[], [enable_music_midi=yes])
Oct 21, 1999
Oct 21, 1999
269
if test x$enable_music_midi = xyes; then
Apr 30, 2006
Apr 30, 2006
270
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMID_MUSIC"
May 12, 2006
May 12, 2006
271
272
273
AC_ARG_ENABLE([music-timidity-midi],
AC_HELP_STRING([--enable-music-timidity-midi], [enable timidity MIDI output [[default=yes]]]),
[], [enable_music_timidity_midi=yes])
Sep 5, 2001
Sep 5, 2001
274
if test x$enable_music_timidity_midi = xyes; then
Apr 30, 2006
Apr 30, 2006
275
276
EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_TIMIDITY_MIDI -I\$(srcdir)/timidity"
SOURCES="$SOURCES $srcdir/timidity/*.c"
Sep 5, 2001
Sep 5, 2001
277
fi
May 12, 2006
May 12, 2006
278
279
280
AC_ARG_ENABLE([music-native-midi],
AC_HELP_STRING([--enable-music-native-midi], [enable native MIDI music output [[default=yes]]]),
[], [enable_music_native_midi=yes])
Aug 19, 2001
Aug 19, 2001
281
282
if test x$enable_music_native_midi = xyes; then
use_music_native_midi=no
Mar 19, 2006
Mar 19, 2006
283
case "$host" in
Aug 19, 2001
Aug 19, 2001
284
285
*-*-cygwin* | *-*-mingw32*)
use_music_native_midi=yes
Apr 30, 2006
Apr 30, 2006
286
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lwinmm"
Aug 19, 2001
Aug 19, 2001
287
;;
Sep 5, 2001
Sep 5, 2001
288
*-*-darwin*)
Oct 18, 2009
Oct 18, 2009
289
use_music_native_midi=yes
Oct 19, 2009
Oct 19, 2009
290
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,CoreServices"
Sep 5, 2001
Sep 5, 2001
291
;;
Aug 19, 2001
Aug 19, 2001
292
293
esac
if test x$use_music_native_midi = xyes; then
Apr 30, 2006
Apr 30, 2006
294
295
EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
SOURCES="$SOURCES $srcdir/native_midi/*.c"
Aug 19, 2001
Aug 19, 2001
296
297
fi
fi
May 12, 2006
May 12, 2006
298
299
300
AC_ARG_ENABLE([music-native-midi-gpl],
AC_HELP_STRING([--enable-music-native-midi-gpl], [enable native MIDI on UNIX using GPL code [[default=no]]]),
[], [enable_music_native_midi_gpl=no])
Feb 13, 2002
Feb 13, 2002
301
302
if test x$enable_music_native_midi_gpl = xyes; then
use_music_native_midi_gpl=no
Mar 19, 2006
Mar 19, 2006
303
case "$host" in
Feb 13, 2002
Feb 13, 2002
304
305
306
307
308
*-*-linux* | *-*-freebsd*)
use_music_native_midi_gpl=yes
;;
esac
if test x$use_music_native_midi_gpl = xyes; then
Apr 30, 2006
Apr 30, 2006
309
310
EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
SOURCES="$SOURCES $srcdir/native_midi_gpl/*.c"
Feb 13, 2002
Feb 13, 2002
311
312
fi
fi
Oct 21, 1999
Oct 21, 1999
313
fi
Oct 3, 2009
Oct 3, 2009
314
May 12, 2006
May 12, 2006
315
316
317
AC_ARG_ENABLE([music-ogg],
AC_HELP_STRING([--enable-music-ogg], [enable Ogg Vorbis music [[default=yes]]]),
[], [enable_music_ogg=yes])
Jul 18, 2007
Jul 18, 2007
318
AC_ARG_ENABLE(music-ogg-tremor,
Oct 3, 2009
Oct 3, 2009
319
AC_HELP_STRING([--enable-music-ogg-tremor], [enable OGG Vorbis music via libtremor [[default=no]]]),
Jul 18, 2007
Jul 18, 2007
320
321
[], enable_music_ogg_tremor=no)
AC_ARG_ENABLE([music-ogg-shared],
May 12, 2006
May 12, 2006
322
AC_HELP_STRING([--enable-music-ogg-shared], [dynamically load Ogg Vorbis support [[default=yes]]]),
Jul 18, 2007
Jul 18, 2007
323
324
325
326
[], [enable_music_ogg_shared=yes])
if test x$enable_music_ogg = xyes; then
if test x$enable_music_ogg_tremor = xyes; then
AC_CHECK_HEADER([tremor/ivorbisfile.h], [have_tremor_hdr=yes])
Oct 26, 2009
Oct 26, 2009
327
AC_CHECK_LIB([vorbisidec], [ov_open_callbacks], [have_tremor_lib=yes], [have_tremor_lib=no], [-lvorbis -logg $LIBM])
Jul 18, 2007
Jul 18, 2007
328
329
330
if test x$have_tremor_hdr = xyes -a x$have_tremor_lib = xyes; then
case "$host" in
*-*-darwin*)
Oct 18, 2009
Oct 18, 2009
331
ogg_lib=[`find_lib libvorbisidec.dylib`]
Feb 13, 2007
Feb 13, 2007
332
if test x$ogg_lib = x; then
Jul 18, 2007
Jul 18, 2007
333
ogg_lib=[`find_lib libvorbisidec.[0-9]`]
Feb 13, 2007
Feb 13, 2007
334
fi
May 12, 2006
May 12, 2006
335
if test x$ogg_lib = x; then
Jul 18, 2007
Jul 18, 2007
336
ogg_lib=[`find_lib libvorbisidec.[0-9]*`]
May 12, 2006
May 12, 2006
337
fi
Jul 18, 2007
Jul 18, 2007
338
339
;;
*-*-cygwin* | *-*-mingw32*)
Jul 21, 2007
Jul 21, 2007
340
ogg_lib=[`find_lib "vorbisidec*.dll"`]
Jul 18, 2007
Jul 18, 2007
341
342
343
344
345
346
347
348
349
350
351
352
353
354
;;
*)
ogg_lib=[`find_lib "libvorbisidec.so.[0-9]"`]
if test x$ogg_lib = x; then
ogg_lib=[`find_lib "libvorbisidec.so.[0-9]*"`]
fi
;;
esac
SOURCES="$SOURCES $srcdir/*_ogg.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC -DOGG_USE_TREMOR"
if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
echo "-- dynamic libvorbisidec -> $ogg_lib"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
else
Oct 26, 2009
Oct 26, 2009
355
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisidec -lvorbis -logg $LIBM"
Jul 18, 2007
Jul 18, 2007
356
fi
Oct 3, 2009
Oct 3, 2009
357
358
359
else
AC_MSG_WARN([*** Unable to find Ogg Vorbis Tremor library (http://www.xiph.org/)])
AC_MSG_WARN([Ogg Vorbis support disabled])
Jul 18, 2007
Jul 18, 2007
360
361
362
fi
else
AC_CHECK_HEADER([vorbis/vorbisfile.h], [have_ogg_hdr=yes])
Oct 26, 2009
Oct 26, 2009
363
AC_CHECK_LIB([vorbisfile], [ov_open_callbacks], [have_ogg_lib=yes], [have_ogg_lib=no], [-lvorbis -logg $LIBM])
Jul 18, 2007
Jul 18, 2007
364
365
366
if test x$have_ogg_hdr = xyes -a x$have_ogg_lib = xyes; then
case "$host" in
*-*-darwin*)
Oct 18, 2009
Oct 18, 2009
367
ogg_lib=[`find_lib libvorbisfile.dylib`]
Jul 18, 2007
Jul 18, 2007
368
369
;;
*-*-cygwin* | *-*-mingw32*)
Jul 21, 2007
Jul 21, 2007
370
ogg_lib=[`find_lib "libvorbisfile*.dll"`]
Jul 18, 2007
Jul 18, 2007
371
372
373
374
375
376
377
378
379
380
381
382
383
384
;;
*)
ogg_lib=[`find_lib "libvorbisfile.so.[0-9]"`]
if test x$ogg_lib = x; then
ogg_lib=[`find_lib "libvorbisfile.so.[0-9]*"`]
fi
;;
esac
SOURCES="$SOURCES $srcdir/*_ogg.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC"
if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
echo "-- dynamic libvorbisfile -> $ogg_lib"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
else
Oct 26, 2009
Oct 26, 2009
385
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis -logg $LIBM"
Jul 18, 2007
Jul 18, 2007
386
fi
Oct 3, 2009
Oct 3, 2009
387
388
389
else
AC_MSG_WARN([*** Unable to find Ogg Vorbis library (http://www.xiph.org/)])
AC_MSG_WARN([Ogg Vorbis support disabled])
May 12, 2006
May 12, 2006
390
fi
Jul 15, 2007
Jul 15, 2007
391
392
fi
fi
Oct 3, 2009
Oct 3, 2009
393
Sep 26, 2009
Sep 26, 2009
394
libflac_ver=8
Feb 27, 2008
Feb 27, 2008
395
396
397
398
399
400
401
402
AC_ARG_ENABLE([music-flac],
AC_HELP_STRING([--enable-music-flac], [enable FLAC music [[default=yes]]]),
[], [enable_music_flac=yes])
AC_ARG_ENABLE([music-flac-shared],
AC_HELP_STRING([--enable-music-flac-shared],
[dynamically load FLAC support [[default=yes]]]),
[], [enable_music_flac_shared=yes])
if test x$enable_music_flac = xyes; then
Oct 13, 2009
Oct 13, 2009
403
404
405
406
407
408
AC_CHECK_HEADER([FLAC/export.h], [have_flac_export=yes])
if test x$have_flac_export = xyes; then
LIBS_SAVED="$LIBS"
LIBS="-lFLAC"
AC_MSG_CHECKING([for libflac so-name version >= $libflac_ver])
AC_TRY_RUN([
Sep 26, 2009
Sep 26, 2009
409
410
411
412
#include "FLAC/export.h"
#include "stdio.h"
int main( int argc, char *argv[] ) {
#if defined(FLAC_API_VERSION_CURRENT) && (FLAC_API_VERSION_CURRENT >= $libflac_ver)
Oct 13, 2009
Oct 13, 2009
413
return 0;
Sep 26, 2009
Sep 26, 2009
414
#else
Oct 13, 2009
Oct 13, 2009
415
return 1;
Sep 26, 2009
Sep 26, 2009
416
417
418
#endif
}
], have_flac_ver=yes, have_flac_ver=no)
Oct 3, 2009
Oct 3, 2009
419
420
421
422
423
424
425
426
427
428
LIBS="$LIBS_SAVED"
AC_MSG_RESULT($have_flac_ver)
fi
if test x$have_flac_ver = xyes; then
AC_CHECK_HEADER([FLAC/stream_decoder.h], [have_flac_hdr=yes])
AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_new], [have_flac_lib=yes])
if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then
case "$host" in
*-*-darwin*)
Oct 18, 2009
Oct 18, 2009
429
flac_lib=[`find_lib libFLAC.dylib`]
Oct 3, 2009
Oct 3, 2009
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
;;
*-*-cygwin* | *-*-mingw32*)
flac_lib=[`find_lib "libFLAC*.dll"`]
;;
*)
flac_lib=[`find_lib "libFLAC.so.[0-9]"`]
if test x$flac_lib = x; then
flac_lib=[`find_lib "libFLAC.so.[0-9]*"`]
fi
;;
esac
SOURCES="$SOURCES $srcdir/*_flac.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_MUSIC"
if test x$enable_music_flac_shared = xyes && test x$flac_lib != x; then
echo "-- dynamic libFLAC -> $flac_lib"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_DYNAMIC=\\\"$flac_lib\\\""
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lFLAC"
fi
fi
else
AC_MSG_WARN([*** Unable to find FLAC library (http://flac.sourceforge.net/)])
AC_MSG_WARN([FLAC support disabled])
fi
Feb 27, 2008
Feb 27, 2008
454
fi
Oct 3, 2009
Oct 3, 2009
455
Oct 21, 1999
Oct 21, 1999
456
AC_ARG_ENABLE(music-mp3,
Oct 3, 2009
Oct 3, 2009
457
458
459
460
461
AC_HELP_STRING([--enable-music-mp3], [enable MP3 music via smpeg [[default=yes]]]),
[], enable_music_mp3=yes)
AC_ARG_ENABLE([music-mp3-shared],
AC_HELP_STRING([--enable-music-mp3-shared], [dynamically load MP3 support [[default=yes]]]),
[], [enable_music_mp3_shared=yes])
Oct 21, 1999
Oct 21, 1999
462
if test x$enable_music_mp3 = xyes; then
Apr 5, 2001
Apr 5, 2001
463
464
SMPEG_VERSION=0.4.3
AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
Oct 21, 1999
Oct 21, 1999
465
if test x$have_smpeg = xyes; then
May 12, 2006
May 12, 2006
466
467
case "$host" in
*-*-darwin*)
Oct 18, 2009
Oct 18, 2009
468
smpeg_lib=[`find_lib libsmpeg.dylib`]
May 12, 2006
May 12, 2006
469
470
;;
*-*-cygwin* | *-*-mingw32*)
Jul 21, 2007
Jul 21, 2007
471
smpeg_lib=[`find_lib "smpeg*.dll"`]
May 12, 2006
May 12, 2006
472
473
;;
*)
Jul 21, 2007
Jul 21, 2007
474
smpeg_lib=[`find_lib "libsmpeg*.so.[0-9]"`]
Jul 18, 2007
Jul 18, 2007
475
if test x$smpeg_lib = x; then
Jul 21, 2007
Jul 21, 2007
476
smpeg_lib=[`find_lib "libsmpeg*.so.[0-9]*"`]
Jul 18, 2007
Jul 18, 2007
477
fi
May 12, 2006
May 12, 2006
478
479
;;
esac
May 12, 2006
May 12, 2006
480
SOURCES="$SOURCES $srcdir/*_mp3.c"
Apr 30, 2006
Apr 30, 2006
481
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
May 12, 2006
May 12, 2006
482
483
484
485
486
487
if test x$enable_music_mp3_shared = xyes && test x$smpeg_lib != x; then
echo "-- dynamic libsmpeg -> $smpeg_lib"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_DYNAMIC=\\\"$smpeg_lib\\\""
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SMPEG_LIBS"
fi
Oct 3, 2009
Oct 3, 2009
488
489
else
AC_MSG_WARN([*** Unable to find SMPEG library (http://icculus.org/smpeg/)])
Oct 21, 1999
Oct 21, 1999
490
491
fi
fi
Oct 3, 2009
Oct 3, 2009
492
Jul 15, 2007
Jul 15, 2007
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
AC_ARG_ENABLE(music-mp3-mad-gpl,
AC_HELP_STRING([--enable-music-mp3-mad-gpl], [enable MP3 music via libmad GPL code [[default=no]]]),
[], [enable_music_mp3_mad_gpl=no])
if test x$enable_music_mp3_mad_gpl = xyes; then
AC_MSG_CHECKING(for libmad headers)
have_libmad=no
AC_TRY_COMPILE([
#include "mad.h"
],[
],[
have_libmad=yes
])
AC_MSG_RESULT($have_libmad)
if test x$have_libmad = xyes; then
SOURCES="$SOURCES $srcdir/music_mad.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MAD_MUSIC"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmad"
Oct 3, 2009
Oct 3, 2009
510
511
else
AC_MSG_WARN([*** Unable to find MAD library (http://www.underbit.com/products/mad/)])
Jul 15, 2007
Jul 15, 2007
512
513
fi
fi
Oct 21, 1999
Oct 21, 1999
514
Oct 3, 2009
Oct 3, 2009
515
516
517
518
if test x$have_smpeg != xyes -a x$have_libmad != xyes; then
AC_MSG_WARN([MP3 support disabled])
fi
Oct 4, 2009
Oct 4, 2009
519
520
521
522
523
524
OBJECTS=`echo $SOURCES`
DEPENDS=`echo $SOURCES`
OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
DEPENDS=`echo "$DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
$(objects)/\2.lo: \1/\2.c\\
Oct 8, 2009
Oct 8, 2009
525
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
Oct 4, 2009
Oct 4, 2009
526
527
528
529
530
531
532
533
534
535
536
537
538
539
VERSION_OBJECTS=`echo $VERSION_SOURCES`
VERSION_DEPENDS=`echo $VERSION_SOURCES`
VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.rc,\\
$(objects)/\2.o: \1/\2.rc\\
\$(WINDRES) \$< \$@,g'`
PLAYWAVE_SOURCES="$srcdir/playwave.c"
PLAYWAVE_OBJECTS=`echo $PLAYWAVE_SOURCES`
PLAYWAVE_DEPENDS=`echo $PLAYWAVE_SOURCES`
PLAYWAVE_OBJECTS=`echo "$PLAYWAVE_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
$(objects)/\2.lo: \1/\2.c\\
Oct 8, 2009
Oct 8, 2009
540
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
Oct 4, 2009
Oct 4, 2009
541
542
543
544
545
546
547
PLAYMUS_SOURCES="$srcdir/playmus.c"
PLAYMUS_OBJECTS=`echo $PLAYMUS_SOURCES`
PLAYMUS_DEPENDS=`echo $PLAYMUS_SOURCES`
PLAYMUS_OBJECTS=`echo "$PLAYMUS_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
$(objects)/\2.lo: \1/\2.c\\
Oct 8, 2009
Oct 8, 2009
548
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
Oct 21, 1999
Oct 21, 1999
549
Apr 30, 2006
Apr 30, 2006
550
551
552
dnl Expand the sources and objects needed to build the library
AC_SUBST(ac_aux_dir)
AC_SUBST(OBJECTS)
Oct 4, 2009
Oct 4, 2009
553
554
555
556
557
558
559
AC_SUBST(DEPENDS)
AC_SUBST(VERSION_OBJECTS)
AC_SUBST(VERSION_DEPENDS)
AC_SUBST(PLAYWAVE_OBJECTS)
AC_SUBST(PLAYWAVE_DEPENDS)
AC_SUBST(PLAYMUS_OBJECTS)
AC_SUBST(PLAYMUS_DEPENDS)
Apr 30, 2006
Apr 30, 2006
560
561
562
563
564
AC_SUBST(BUILD_CFLAGS)
AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(BUILD_LDFLAGS)
AC_SUBST(EXTRA_LDFLAGS)
AC_SUBST(EXE)
Jul 18, 2007
Jul 18, 2007
565
AC_SUBST(WINDRES)
Sep 19, 2009
Sep 19, 2009
566
AC_SUBST(SDL_VERSION)
Apr 30, 2006
Apr 30, 2006
567
568
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
Jan 26, 2003
Jan 26, 2003
569
Oct 21, 1999
Oct 21, 1999
570
AC_OUTPUT([
Sep 19, 2009
Sep 19, 2009
571
Makefile SDL_mixer.spec SDL_mixer.qpg SDL_mixer.pc
Oct 21, 1999
Oct 21, 1999
572
])