Skip to content

Latest commit

 

History

History
699 lines (649 loc) · 25 KB

configure.in

File metadata and controls

699 lines (649 loc) · 25 KB
 
Oct 21, 1999
Oct 21, 1999
1
2
dnl Process this file with autoconf to produce a configure script.
AC_INIT(README)
Nov 17, 2011
Nov 17, 2011
3
AC_CONFIG_AUX_DIR(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
Jan 28, 2012
Jan 28, 2012
17
18
19
MICRO_VERSION=13
INTERFACE_AGE=1
BINARY_AGE=13
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
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
Oct 13, 2018
Oct 13, 2018
113
Mar 19, 2006
Mar 19, 2006
114
case "$host" in
Apr 14, 2010
Apr 14, 2010
115
116
117
118
*mingw32ce*)
#VERSION_SOURCES="$srcdir/version.rc"
EXE=".exe"
;;
Aug 10, 2000
Aug 10, 2000
119
*-*-cygwin* | *-*-mingw32*)
Oct 4, 2009
Oct 4, 2009
120
VERSION_SOURCES="$srcdir/version.rc"
Apr 30, 2006
Apr 30, 2006
121
EXE=".exe"
Jul 18, 2007
Jul 18, 2007
122
123
124
125
126
127
128
129
130
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
131
;;
Apr 30, 2006
Apr 30, 2006
132
*)
Jul 18, 2007
Jul 18, 2007
133
SOURCES=""
Apr 30, 2006
Apr 30, 2006
134
EXE=""
Feb 4, 2003
Feb 4, 2003
135
;;
Oct 25, 1999
Oct 25, 1999
136
137
esac
Apr 30, 2006
Apr 30, 2006
138
139
140
141
142
143
144
145
146
147
# 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
148
149
150
dnl set this to use on systems that use lib64 instead of lib
base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
Jan 5, 2010
Jan 5, 2010
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
dnl Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
CheckVisibilityHidden()
{
AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
have_gcc_fvisibility=no
visibility_CFLAGS="-fvisibility=hidden"
save_CFLAGS="$CFLAGS"
CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
AC_TRY_COMPILE([
#if !defined(__GNUC__) || __GNUC__ < 4
#error SDL only uses visibility attributes in GCC 4 or newer
#endif
],[
],[
have_gcc_fvisibility=yes
])
AC_MSG_RESULT($have_gcc_fvisibility)
CFLAGS="$save_CFLAGS"
if test x$have_gcc_fvisibility = xyes; then
EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
fi
}
Oct 13, 2009
Oct 13, 2009
177
dnl Function to find a library in the compiler search path
Jul 18, 2007
Jul 18, 2007
178
179
find_lib()
{
Jul 21, 2007
Jul 21, 2007
180
181
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
182
env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
Oct 2, 2009
Oct 2, 2009
183
184
185
if test "$cross_compiling" = yes; then
host_lib_path=""
else
Oct 13, 2009
Oct 13, 2009
186
host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
Oct 2, 2009
Oct 2, 2009
187
fi
Oct 7, 2018
Oct 7, 2018
188
for path in $env_lib_path $gcc_bin_path $gcc_lib_path $host_lib_path; do
Oct 13, 2018
Oct 13, 2018
189
lib=[`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`]
Jul 18, 2007
Jul 18, 2007
190
191
192
193
194
195
196
if test x$lib != x; then
echo $lib
return
fi
done
}
Nov 23, 1999
Nov 23, 1999
197
dnl Check for SDL
May 9, 2006
May 9, 2006
198
SDL_VERSION=1.2.10
Nov 23, 1999
Nov 23, 1999
199
200
AM_PATH_SDL($SDL_VERSION,
:,
Jul 18, 2007
Jul 18, 2007
201
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
Nov 23, 1999
Nov 23, 1999
202
)
Apr 30, 2006
Apr 30, 2006
203
204
EXTRA_CFLAGS="$EXTRA_CFLAGS $SDL_CFLAGS"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SDL_LIBS"
Oct 21, 1999
Oct 21, 1999
205
Oct 26, 2009
Oct 26, 2009
206
207
208
dnl Check for math library
AC_CHECK_LIB(m, pow, [LIBM="-lm"])
Oct 21, 1999
Oct 21, 1999
209
dnl Check command-line options
Jun 10, 2001
Jun 10, 2001
210
Jan 5, 2010
Jan 5, 2010
211
212
CheckVisibilityHidden
May 12, 2006
May 12, 2006
213
214
AC_ARG_ENABLE([music-cmd],
AC_HELP_STRING([--enable-music-cmd], [support an external music player [[default=yes]]]),
Nov 6, 2009
Nov 6, 2009
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
[], [enable_music_cmd=detect])
if test "x$enable_music_cmd" != xno; then
AC_CHECK_FUNCS([fork vfork])
if test "x$ac_cv_func_fork" = "xyes"; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_FORK"
elif test "x$ac_cv_func_vfork" = "xyes"; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_VFORK"
elif test "x$enable_music_cmd" = "xyes"; then
AC_MSG_ERROR([external music player not available on your platform])
else
enable_music_cmd=no
fi
if test "x$enable_music_cmd" != xno; then
SOURCES="$SOURCES $srcdir/music_cmd.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DCMD_MUSIC"
fi
Oct 21, 1999
Oct 21, 1999
231
fi
Oct 3, 2009
Oct 3, 2009
232
May 12, 2006
May 12, 2006
233
234
235
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
236
if test x$enable_music_wave = xyes; then
Apr 30, 2006
Apr 30, 2006
237
238
SOURCES="$SOURCES $srcdir/wavestream.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DWAV_MUSIC"
Oct 21, 1999
Oct 21, 1999
239
fi
Oct 3, 2009
Oct 3, 2009
240
241
242
243
244
245
246
247
248
249
250
251
252
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
253
254
255
256
257
258
AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no, [$PATH])
if test "$LIBMIKMOD_CONFIG" != "no" ; then
CFLAGS_SAVED="$CFLAGS"
LIBS_SAVED="$LIBS"
CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
LIBS="$LIBS `$LIBMIKMOD_CONFIG --libs`"
Oct 3, 2009
Oct 3, 2009
259
have_libmikmod=yes
Jul 18, 2007
Jul 18, 2007
260
261
AC_MSG_CHECKING([for libmikmod - version >= $libmikmod_ver])
AC_TRY_RUN([
Nov 13, 2004
Nov 13, 2004
262
263
264
265
266
#include "mikmod.h"
#include "stdio.h"
int main(int argc, char **argv)
{
Oct 3, 2009
Oct 3, 2009
267
268
269
270
271
272
273
274
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
275
}
Oct 3, 2009
Oct 3, 2009
276
277
], [], have_libmikmod=no; CFLAGS="$CFLAGS_SAVED"; LIBS="$LIBS_SAVED",
[echo $ac_n "cross compiling; assumed OK... $ac_c"])
Jul 18, 2007
Jul 18, 2007
278
fi
Nov 13, 2004
Nov 13, 2004
279
Oct 3, 2009
Oct 3, 2009
280
281
282
if test x$have_libmikmod = xyes; then
case "$host" in
*-*-darwin*)
Oct 18, 2009
Oct 18, 2009
283
mikmod_lib=[`find_lib libmikmod.dylib`]
Oct 3, 2009
Oct 3, 2009
284
285
;;
*-*-cygwin* | *-*-mingw32*)
Jan 9, 2012
Jan 9, 2012
286
mikmod_lib=[`find_lib "libmikmod*.dll"`]
Oct 3, 2009
Oct 3, 2009
287
288
;;
*)
Oct 13, 2018
Oct 13, 2018
289
mikmod_lib=[`find_lib "libmikmod[0-9]*.so.*"`]
Oct 3, 2009
Oct 3, 2009
290
if test x$mikmod_lib = x; then
Oct 13, 2018
Oct 13, 2018
291
mikmod_lib=[`find_lib "libmikmod.so.*"`]
Oct 3, 2009
Oct 3, 2009
292
293
294
295
296
297
298
299
300
301
302
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
303
else
Oct 3, 2009
Oct 3, 2009
304
AC_MSG_WARN([*** Unable to find MikMod library (http://mikmod.raphnet.net/)])
Oct 3, 2009
Oct 3, 2009
305
fi
Oct 21, 1999
Oct 21, 1999
306
fi
Oct 3, 2009
Oct 3, 2009
307
Nov 16, 2009
Nov 16, 2009
308
309
310
311
AC_ARG_ENABLE([music-mod-modplug],
AC_HELP_STRING([--enable-music-mod-modplug], [enable MOD music via modplug [[default=no]]]),
[], [enable_music_mod_modplug=no])
if test x$enable_music_mod_modplug = xyes; then
Oct 13, 2018
Oct 13, 2018
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
PKG_CHECK_MODULES([MODPLUG], [libmodplug >= 0.8.7], [dnl
have_libmodplug_hdr=yes
have_libmodplug_lib=yes
], [dnl
AC_CHECK_HEADER([libmodplug/modplug.h], [have_libmodplug_hdr=yes])
AC_CHECK_LIB([modplug], [ModPlug_Load], [have_libmodplug_lib=yes])
])
if test x$have_libmodplug_hdr = xyes -a x$have_libmodplug_lib = xyes; then
have_libmodplug=yes
SOURCES="$SOURCES $srcdir/music_modplug.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMODPLUG_MUSIC $MODPLUG_CFLAGS"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MODPLUG_LIBS"
else
AC_MSG_WARN([*** Unable to find ModPlug library (http://modplug-xmms.sourceforge.net/)])
fi
Nov 16, 2009
Nov 16, 2009
328
329
330
331
332
333
fi
if test x$have_libmikmod != xyes -a x$have_libmodplug != xyes ; then
AC_MSG_WARN([MOD support disabled])
fi
May 12, 2006
May 12, 2006
334
335
336
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
337
if test x$enable_music_midi = xyes; then
Apr 30, 2006
Apr 30, 2006
338
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMID_MUSIC"
May 12, 2006
May 12, 2006
339
340
341
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
342
if test x$enable_music_timidity_midi = xyes; then
Apr 30, 2006
Apr 30, 2006
343
344
EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_TIMIDITY_MIDI -I\$(srcdir)/timidity"
SOURCES="$SOURCES $srcdir/timidity/*.c"
Sep 5, 2001
Sep 5, 2001
345
fi
May 12, 2006
May 12, 2006
346
347
348
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
349
350
if test x$enable_music_native_midi = xyes; then
use_music_native_midi=no
Mar 19, 2006
Mar 19, 2006
351
case "$host" in
Apr 14, 2010
Apr 14, 2010
352
353
354
*mingw32ce*)
use_music_native_midi=no
;;
Aug 19, 2001
Aug 19, 2001
355
356
*-*-cygwin* | *-*-mingw32*)
use_music_native_midi=yes
Apr 30, 2006
Apr 30, 2006
357
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lwinmm"
Aug 19, 2001
Aug 19, 2001
358
;;
Sep 5, 2001
Sep 5, 2001
359
*-*-darwin*)
Oct 18, 2009
Oct 18, 2009
360
use_music_native_midi=yes
Oct 19, 2009
Oct 19, 2009
361
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,CoreServices"
Sep 5, 2001
Sep 5, 2001
362
;;
Jan 18, 2011
Jan 18, 2011
363
364
365
366
*-*-haiku*)
use_music_native_midi=yes_cpp
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmidi"
;;
Aug 19, 2001
Aug 19, 2001
367
368
esac
if test x$use_music_native_midi = xyes; then
Apr 30, 2006
Apr 30, 2006
369
370
EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
SOURCES="$SOURCES $srcdir/native_midi/*.c"
Jan 18, 2011
Jan 18, 2011
371
372
373
374
elif test x$use_music_native_midi = xyes_cpp; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
SOURCES="$SOURCES $srcdir/native_midi/*.c"
SOURCES_CXX="$SOURCES_CXX $srcdir/native_midi/*.cpp"
Aug 19, 2001
Aug 19, 2001
375
376
fi
fi
Mar 20, 2011
Mar 20, 2011
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
AC_ARG_ENABLE([music-fluidsynth-midi],
AC_HELP_STRING([--enable-music-fluidsynth-midi], [enable FluidSynth MIDI output [[default=yes]]]),
[], [enable_music_fluidsynth_midi=yes])
AC_ARG_ENABLE([music-fluidsynth-shared],
AC_HELP_STRING([--enable-music-fluidsynth-shared], [dynamically load FluidSynth support [[default=yes]]]),
[], [enable_music_fluidsynth_shared=yes])
if test x$enable_music_fluidsynth_midi = xyes; then
AC_CHECK_HEADER([fluidsynth.h], [have_fluidsynth_hdr=yes])
AC_CHECK_LIB([fluidsynth], [fluid_player_add_mem], [have_fluidsynth_lib=yes])
if test x$have_fluidsynth_hdr = xyes -a x$have_fluidsynth_lib = xyes; then
case "$host" in
*-*-darwin*)
fluidsynth_lib=[`find_lib libfluidsynth.dylib`]
;;
*-*-cygwin* | *-*-mingw32*)
fluidsynth_lib=[`find_lib "fluidsynth*.dll"`]
;;
*)
Oct 13, 2018
Oct 13, 2018
395
fluidsynth_lib=[`find_lib "libfluidsynth[0-9]*.so.*"`]
Mar 20, 2011
Mar 20, 2011
396
if test x$fluidsynth_lib = x; then
Oct 13, 2018
Oct 13, 2018
397
fluidsynth_lib=[`find_lib "libfluidsynth.so.*"`]
Mar 20, 2011
Mar 20, 2011
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
fi
;;
esac
SOURCES="$SOURCES $srcdir/dynamic_fluidsynth.c $srcdir/fluidsynth.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_FLUIDSYNTH_MIDI"
if test x$enable_music_fluidsynth_shared = xyes && test x$fluidsynth_lib != x; then
echo "-- dynamic libfluidsyth -> $fluidsynth_lib"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLUIDSYNTH_DYNAMIC=\\\"$fluidsynth_lib\\\""
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lfluidsynth"
fi
else
AC_MSG_WARN([*** Unable to find FluidSynth library (http://www.fluidsynth.org/)])
AC_MSG_WARN([FluidSynth support disabled])
fi
fi
Oct 21, 1999
Oct 21, 1999
414
fi
Oct 3, 2009
Oct 3, 2009
415
May 12, 2006
May 12, 2006
416
417
418
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
419
AC_ARG_ENABLE(music-ogg-tremor,
Oct 3, 2009
Oct 3, 2009
420
AC_HELP_STRING([--enable-music-ogg-tremor], [enable OGG Vorbis music via libtremor [[default=no]]]),
Jul 18, 2007
Jul 18, 2007
421
422
[], enable_music_ogg_tremor=no)
AC_ARG_ENABLE([music-ogg-shared],
May 12, 2006
May 12, 2006
423
AC_HELP_STRING([--enable-music-ogg-shared], [dynamically load Ogg Vorbis support [[default=yes]]]),
Jul 18, 2007
Jul 18, 2007
424
425
426
427
[], [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 6, 2018
Oct 6, 2018
428
AC_CHECK_LIB([vorbisidec -logg], [ov_open_callbacks], [have_tremor_lib=yes])
Jul 18, 2007
Jul 18, 2007
429
430
431
if test x$have_tremor_hdr = xyes -a x$have_tremor_lib = xyes; then
case "$host" in
*-*-darwin*)
Oct 18, 2009
Oct 18, 2009
432
ogg_lib=[`find_lib libvorbisidec.dylib`]
Jul 18, 2007
Jul 18, 2007
433
434
;;
*-*-cygwin* | *-*-mingw32*)
Jul 21, 2007
Jul 21, 2007
435
ogg_lib=[`find_lib "vorbisidec*.dll"`]
Jul 18, 2007
Jul 18, 2007
436
437
;;
*)
Oct 13, 2018
Oct 13, 2018
438
ogg_lib=[`find_lib "libvorbisidec[0-9]*.so.*"`]
Jul 18, 2007
Jul 18, 2007
439
if test x$ogg_lib = x; then
Oct 13, 2018
Oct 13, 2018
440
ogg_lib=[`find_lib "libvorbisidec.so.*"`]
Jul 18, 2007
Jul 18, 2007
441
442
443
444
445
446
447
448
449
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
Jan 21, 2012
Jan 21, 2012
450
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisidec -lvorbis"
Jul 18, 2007
Jul 18, 2007
451
fi
Oct 3, 2009
Oct 3, 2009
452
453
454
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
455
456
457
fi
else
AC_CHECK_HEADER([vorbis/vorbisfile.h], [have_ogg_hdr=yes])
Oct 6, 2018
Oct 6, 2018
458
AC_CHECK_LIB([vorbisfile -lvorbis -logg -lm], [ov_open_callbacks], [have_ogg_lib=yes])
Jul 18, 2007
Jul 18, 2007
459
460
461
if test x$have_ogg_hdr = xyes -a x$have_ogg_lib = xyes; then
case "$host" in
*-*-darwin*)
Oct 18, 2009
Oct 18, 2009
462
ogg_lib=[`find_lib libvorbisfile.dylib`]
Jul 18, 2007
Jul 18, 2007
463
464
;;
*-*-cygwin* | *-*-mingw32*)
Jul 21, 2007
Jul 21, 2007
465
ogg_lib=[`find_lib "libvorbisfile*.dll"`]
Jul 18, 2007
Jul 18, 2007
466
467
;;
*)
Oct 13, 2018
Oct 13, 2018
468
ogg_lib=[`find_lib "libvorbisfile[0-9]*.so.*"`]
Jul 18, 2007
Jul 18, 2007
469
if test x$ogg_lib = x; then
Oct 13, 2018
Oct 13, 2018
470
ogg_lib=[`find_lib "libvorbisfile.so.*"`]
Jul 18, 2007
Jul 18, 2007
471
472
473
474
475
476
477
478
479
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 6, 2018
Oct 6, 2018
480
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis -logg -lm"
Jul 18, 2007
Jul 18, 2007
481
fi
Oct 3, 2009
Oct 3, 2009
482
483
484
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
485
fi
Jul 15, 2007
Jul 15, 2007
486
487
fi
fi
Oct 3, 2009
Oct 3, 2009
488
Sep 26, 2009
Sep 26, 2009
489
libflac_ver=8
Feb 27, 2008
Feb 27, 2008
490
491
492
493
494
495
496
497
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
498
499
500
501
502
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])
Feb 17, 2011
Feb 17, 2011
503
AC_TRY_COMPILE([
Sep 26, 2009
Sep 26, 2009
504
505
#include "FLAC/export.h"
#include "stdio.h"
Feb 17, 2011
Feb 17, 2011
506
],[
Sep 26, 2009
Sep 26, 2009
507
508
#if defined(FLAC_API_VERSION_CURRENT) && (FLAC_API_VERSION_CURRENT >= $libflac_ver)
#else
Feb 17, 2011
Feb 17, 2011
509
#error "old-flac"
Sep 26, 2009
Sep 26, 2009
510
511
#endif
], have_flac_ver=yes, have_flac_ver=no)
Oct 3, 2009
Oct 3, 2009
512
513
514
515
516
517
518
519
520
521
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
522
flac_lib=[`find_lib libFLAC.dylib`]
Oct 3, 2009
Oct 3, 2009
523
524
;;
*-*-cygwin* | *-*-mingw32*)
Oct 13, 2018
Oct 13, 2018
525
flac_lib=[`find_lib "libFLAC-*.dll"`]
Oct 3, 2009
Oct 3, 2009
526
527
;;
*)
Oct 13, 2018
Oct 13, 2018
528
flac_lib=[`find_lib "libFLAC[0-9]*.so.*"`]
Oct 3, 2009
Oct 3, 2009
529
if test x$flac_lib = x; then
Oct 13, 2018
Oct 13, 2018
530
flac_lib=[`find_lib "libFLAC.so.*"`]
Oct 3, 2009
Oct 3, 2009
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
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
547
fi
Oct 3, 2009
Oct 3, 2009
548
Apr 14, 2010
Apr 14, 2010
549
550
551
AC_CHECK_HEADERS([signal.h], [EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_SIGNAL_H"])
AC_CHECK_FUNCS(setbuf, [EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_SETBUF"])
Oct 21, 1999
Oct 21, 1999
552
AC_ARG_ENABLE(music-mp3,
Oct 11, 2018
Oct 11, 2018
553
AC_HELP_STRING([--enable-music-mp3], [enable MP3 music via libmpg123 [[default=yes]]]),
Oct 3, 2009
Oct 3, 2009
554
555
556
557
[], 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
558
if test x$enable_music_mp3 = xyes; then
Oct 11, 2018
Oct 11, 2018
559
560
561
562
AC_CHECK_HEADER([mpg123.h], [have_mpg123_hdr=yes])
AC_CHECK_LIB([mpg123], [mpg123_replace_reader_handle], [have_mpg123_lib=yes])
if test x$have_mpg123_hdr = xyes -a x$have_mpg123_lib = xyes; then
have_mpg123=yes
May 12, 2006
May 12, 2006
563
564
case "$host" in
*-*-darwin*)
Oct 11, 2018
Oct 11, 2018
565
mpg123_lib=[`find_lib libmpg123.dylib`]
May 12, 2006
May 12, 2006
566
567
;;
*-*-cygwin* | *-*-mingw32*)
Oct 11, 2018
Oct 11, 2018
568
mpg123_lib=[`find_lib "libmpg123*.dll"`]
May 12, 2006
May 12, 2006
569
570
;;
*)
Oct 13, 2018
Oct 13, 2018
571
mpg123_lib=[`find_lib "libmpg123.so.*"`]
May 12, 2006
May 12, 2006
572
573
;;
esac
Oct 11, 2018
Oct 11, 2018
574
575
576
577
578
SOURCES="$SOURCES $srcdir/*_mp3.c $srcdir/*_mpg.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC"
if test x$enable_music_mp3_shared = xyes && test x$mpg123_lib != x; then
echo "-- dynamic libmpg123 -> $mpg123_lib"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMPG123_DYNAMIC=\\\"$mpg123_lib\\\""
May 12, 2006
May 12, 2006
579
else
Oct 11, 2018
Oct 11, 2018
580
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmpg123"
May 12, 2006
May 12, 2006
581
fi
Oct 3, 2009
Oct 3, 2009
582
else
Oct 11, 2018
Oct 11, 2018
583
AC_MSG_WARN([*** Unable to find mpg123 library (https://www.mpg123.de)])
Oct 21, 1999
Oct 21, 1999
584
585
fi
fi
Oct 3, 2009
Oct 3, 2009
586
Jul 15, 2007
Jul 15, 2007
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
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
604
605
else
AC_MSG_WARN([*** Unable to find MAD library (http://www.underbit.com/products/mad/)])
Jul 15, 2007
Jul 15, 2007
606
607
fi
fi
Oct 21, 1999
Oct 21, 1999
608
Oct 11, 2018
Oct 11, 2018
609
if test x$have_mpg123 != xyes -a x$have_libmad != xyes; then
Oct 3, 2009
Oct 3, 2009
610
611
612
AC_MSG_WARN([MP3 support disabled])
fi
Feb 17, 2011
Feb 17, 2011
613
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBM"
Oct 4, 2009
Oct 4, 2009
614
615
616
617
618
619
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
620
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
Oct 4, 2009
Oct 4, 2009
621
Jan 18, 2011
Jan 18, 2011
622
623
624
625
626
627
628
629
OBJECTS_CXX=`echo $SOURCES_CXX`
DEPENDS_CXX=`echo $SOURCES_CXX`
OBJECTS_CXX=`echo "$OBJECTS_CXX" | sed 's,[[^ ]]*/\([[^ ]]*\)\.cpp,$(objects)/\1.lo,g'`
DEPENDS_CXX=`echo "$DEPENDS_CXX" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.cpp,\\
$(objects)/\2.lo: \1/\2.cpp\\
\$(LIBTOOL) --mode=compile \$(CXX) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
OBJECTS="$OBJECTS $OBJECTS_CXX"
DEPENDS="$DEPENDS $DEPENDS_CXX"
Jan 21, 2011
Jan 21, 2011
630
DEPENDS=`echo "$DEPENDS" | sed 's,\\$,\\\\$,g'`
Jan 18, 2011
Jan 18, 2011
631
Oct 4, 2009
Oct 4, 2009
632
633
634
635
636
637
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'`
Jan 21, 2011
Jan 21, 2011
638
VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\\$,\\\\$,g'`
Oct 4, 2009
Oct 4, 2009
639
640
641
642
643
644
645
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
646
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
Jan 21, 2011
Jan 21, 2011
647
PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\\$,\\\\$,g'`
Oct 4, 2009
Oct 4, 2009
648
649
650
651
652
653
654
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
655
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
Jan 21, 2011
Jan 21, 2011
656
PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\\$,\\\\$,g'`
Oct 21, 1999
Oct 21, 1999
657
Apr 30, 2006
Apr 30, 2006
658
659
660
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
661
662
663
AC_SUBST(VERSION_OBJECTS)
AC_SUBST(PLAYWAVE_OBJECTS)
AC_SUBST(PLAYMUS_OBJECTS)
Apr 30, 2006
Apr 30, 2006
664
665
666
667
668
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
669
AC_SUBST(WINDRES)
Sep 19, 2009
Sep 19, 2009
670
AC_SUBST(SDL_VERSION)
Apr 30, 2006
Apr 30, 2006
671
672
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
Jan 26, 2003
Jan 26, 2003
673
Oct 21, 1999
Oct 21, 1999
674
AC_OUTPUT([
Jan 21, 2011
Jan 21, 2011
675
676
])
AC_CONFIG_FILES([
Sep 19, 2009
Sep 19, 2009
677
Makefile SDL_mixer.spec SDL_mixer.qpg SDL_mixer.pc
Oct 21, 1999
Oct 21, 1999
678
])
Jan 21, 2011
Jan 21, 2011
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
AC_CONFIG_COMMANDS([default],
[cat >>Makefile <<__EOF__
# Build rules for objects
-include \$(OBJECTS:.lo=.d)
$DEPENDS
$VERSION_DEPENDS
-include \$(PLAYWAVE_OBJECTS:.lo=.d)
$PLAYWAVE_DEPENDS
-include \$(PLAYMUS_OBJECTS:.lo=.d)
$PLAYMUS_DEPENDS
__EOF__
], [
DEPENDS="$DEPENDS"
VERSION_DEPENDS="$VERSION_DEPENDS"
PLAYWAVE_DEPENDS="$PLAYWAVE_DEPENDS"
PLAYMUS_DEPENDS="$PLAYMUS_DEPENDS"
])
AC_OUTPUT