Skip to content

Latest commit

 

History

History
343 lines (324 loc) · 11.3 KB

configure.in

File metadata and controls

343 lines (324 loc) · 11.3 KB
 
Oct 21, 1999
Oct 21, 1999
1
2
3
4
5
6
7
8
9
10
11
12
dnl Process this file with autoconf to produce a configure script.
AC_INIT(README)
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
13
#
Oct 21, 1999
Oct 21, 1999
14
MAJOR_VERSION=1
Apr 4, 2001
Apr 4, 2001
15
MINOR_VERSION=2
Jul 14, 2007
Jul 14, 2007
16
17
18
MICRO_VERSION=8
INTERFACE_AGE=6
BINARY_AGE=8
Oct 21, 1999
Oct 21, 1999
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
LT_REVISION=$INTERFACE_AGE
LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
Mar 19, 2006
Mar 19, 2006
39
dnl Detect the canonical build and host environments
Apr 30, 2006
Apr 30, 2006
40
AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
Mar 19, 2006
Mar 19, 2006
41
AC_CANONICAL_HOST
Aug 10, 2000
Aug 10, 2000
42
Apr 30, 2006
Apr 30, 2006
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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"
for path in /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
CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
Jun 10, 2001
Jun 10, 2001
70
Oct 21, 1999
Oct 21, 1999
71
dnl Check for tools
Dec 26, 1999
Dec 26, 1999
72
AC_LIBTOOL_WIN32_DLL
Apr 30, 2006
Apr 30, 2006
73
74
75
AC_PROG_LIBTOOL
AC_PROG_CC
AC_PROG_CXX
Oct 21, 1999
Oct 21, 1999
76
AC_PROG_INSTALL
Apr 30, 2006
Apr 30, 2006
77
78
79
80
AC_PROG_MAKE_SET
dnl Check for compiler characteristics
AC_C_CONST
Oct 21, 1999
Oct 21, 1999
81
Mar 19, 2006
Mar 19, 2006
82
case "$host" in
Aug 10, 2000
Aug 10, 2000
83
*-*-cygwin* | *-*-mingw32*)
Apr 30, 2006
Apr 30, 2006
84
EXE=".exe"
Aug 10, 2000
Aug 10, 2000
85
;;
Apr 30, 2006
Apr 30, 2006
86
87
*)
EXE=""
Feb 4, 2003
Feb 4, 2003
88
;;
Oct 25, 1999
Oct 25, 1999
89
90
esac
Apr 30, 2006
Apr 30, 2006
91
92
93
94
95
96
97
98
99
100
# 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"
Nov 23, 1999
Nov 23, 1999
101
dnl Check for SDL
May 9, 2006
May 9, 2006
102
SDL_VERSION=1.2.10
Nov 23, 1999
Nov 23, 1999
103
104
105
106
AM_PATH_SDL($SDL_VERSION,
:,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
Apr 30, 2006
Apr 30, 2006
107
108
EXTRA_CFLAGS="$EXTRA_CFLAGS $SDL_CFLAGS"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SDL_LIBS"
Oct 21, 1999
Oct 21, 1999
109
110
dnl Check command-line options
Jun 10, 2001
Jun 10, 2001
111
May 12, 2006
May 12, 2006
112
113
114
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
115
if test x$enable_music_cmd = xyes; then
Apr 30, 2006
Apr 30, 2006
116
117
SOURCES="$SOURCES $srcdir/music_cmd.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DCMD_MUSIC"
Oct 21, 1999
Oct 21, 1999
118
fi
May 12, 2006
May 12, 2006
119
120
121
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
122
if test x$enable_music_wave = xyes; then
Apr 30, 2006
Apr 30, 2006
123
124
SOURCES="$SOURCES $srcdir/wavestream.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DWAV_MUSIC"
Oct 21, 1999
Oct 21, 1999
125
fi
Dec 27, 2004
Dec 27, 2004
126
no_libmikmod=yes
Nov 13, 2004
Nov 13, 2004
127
128
129
130
libmikmod_maj=3
libmikmod_min=1
libmikmod_rev=10
libmikmod_ver="$libmikmod_maj.$libmikmod_min.$libmikmod_rev"
May 12, 2006
May 12, 2006
131
132
133
AC_ARG_ENABLE([music-libmikmod],
AC_HELP_STRING([--enable-music-libmikmod], [enable MOD music via external libmikmod [[default=no]]]),
[], [enable_music_libmikmod=no])
Nov 13, 2004
Nov 13, 2004
134
135
if test x$enable_music_libmikmod = xyes; then
AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no, [$PATH])
Dec 27, 2004
Dec 27, 2004
136
137
if test "$LIBMIKMOD_CONFIG" != "no" ; then
no_libmikmod=no
Nov 13, 2004
Nov 13, 2004
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
CFLAGS_SAVED="$CFLAGS"
LIBS_SAVED="$LIBS"
CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
LIBS="$LIBS `$LIBMIKMOD_CONFIG --libs`"
AC_MSG_CHECKING([for libmikmod - version >= $libmikmod_ver])
AC_TRY_RUN([
#include "mikmod.h"
#include "stdio.h"
int main(int argc, char **argv)
{
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;
}
Aug 10, 2006
Aug 10, 2006
158
], EXTRA_CFLAGS="$EXTRA_CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`";EXTRA_LDFLAGS="$EXTRA_LDFLAGS `$LIBMIKMOD_CONFIG --libs`", CFLAGS="$CFLAGS_SAVED";LIBS="$LIBS_SAVED",
Nov 13, 2004
Nov 13, 2004
159
160
161
162
[echo $ac_n "cross compiling; assumed OK... $ac_c"])
fi
fi
May 12, 2006
May 12, 2006
163
164
165
AC_ARG_ENABLE([music-mod],
AC_HELP_STRING([--enable-music-mod], [enable MOD music via mikmod [[default=yes]]]),
[], [enable_music_mod=$no_libmikmod])
Aug 10, 2006
Aug 10, 2006
166
if test x$enable_music_mod = xyes -a x$enable_music_libmikmod = xno; then
Apr 30, 2006
Apr 30, 2006
167
168
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_MUSIC -I\$(srcdir)/mikmod"
SOURCES="$SOURCES $srcdir/mikmod/*.c"
Oct 21, 1999
Oct 21, 1999
169
fi
May 12, 2006
May 12, 2006
170
171
172
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
173
if test x$enable_music_midi = xyes; then
Apr 30, 2006
Apr 30, 2006
174
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMID_MUSIC"
May 12, 2006
May 12, 2006
175
176
177
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
178
if test x$enable_music_timidity_midi = xyes; then
Apr 30, 2006
Apr 30, 2006
179
180
EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_TIMIDITY_MIDI -I\$(srcdir)/timidity"
SOURCES="$SOURCES $srcdir/timidity/*.c"
Sep 5, 2001
Sep 5, 2001
181
fi
May 12, 2006
May 12, 2006
182
183
184
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
185
186
if test x$enable_music_native_midi = xyes; then
use_music_native_midi=no
Mar 19, 2006
Mar 19, 2006
187
case "$host" in
Aug 19, 2001
Aug 19, 2001
188
189
*-*-cygwin* | *-*-mingw32*)
use_music_native_midi=yes
Apr 30, 2006
Apr 30, 2006
190
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lwinmm"
Aug 19, 2001
Aug 19, 2001
191
;;
Sep 5, 2001
Sep 5, 2001
192
193
*-*-darwin*)
use_music_native_midi=yes
Jul 3, 2007
Jul 3, 2007
194
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuickTime -Wl,-framework,CoreServices"
Sep 5, 2001
Sep 5, 2001
195
;;
Aug 19, 2001
Aug 19, 2001
196
197
esac
if test x$use_music_native_midi = xyes; then
Apr 30, 2006
Apr 30, 2006
198
199
EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
SOURCES="$SOURCES $srcdir/native_midi/*.c"
Aug 19, 2001
Aug 19, 2001
200
201
fi
fi
May 12, 2006
May 12, 2006
202
203
204
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
205
206
if test x$enable_music_native_midi_gpl = xyes; then
use_music_native_midi_gpl=no
Mar 19, 2006
Mar 19, 2006
207
case "$host" in
Feb 13, 2002
Feb 13, 2002
208
209
210
211
212
*-*-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
213
214
EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
SOURCES="$SOURCES $srcdir/native_midi_gpl/*.c"
Feb 13, 2002
Feb 13, 2002
215
216
fi
fi
Oct 21, 1999
Oct 21, 1999
217
fi
May 12, 2006
May 12, 2006
218
219
220
AC_ARG_ENABLE([music-ogg],
AC_HELP_STRING([--enable-music-ogg], [enable Ogg Vorbis music [[default=yes]]]),
[], [enable_music_ogg=yes])
Jul 3, 2000
Jul 3, 2000
221
222
223
224
225
226
227
228
229
230
231
if test x$enable_music_ogg = xyes; then
AC_MSG_CHECKING(for Ogg Vorbis headers and libraries)
have_vorbis=no
AC_TRY_COMPILE([
#include <vorbis/vorbisfile.h>
],[
],[
have_vorbis=yes
])
AC_MSG_RESULT($have_vorbis)
if test x$have_vorbis = xyes; then
May 12, 2006
May 12, 2006
232
233
234
235
AC_ARG_ENABLE([music-ogg-shared],
AC_HELP_STRING([--enable-music-ogg-shared], [dynamically load Ogg Vorbis support [[default=yes]]]),
[], [enable_music_ogg_shared=yes])
case "$host" in
Feb 13, 2007
Feb 13, 2007
236
237
238
239
240
241
*-*-darwin*)
for path in /usr/lib /usr/local/lib; do
if test x$ogg_lib = x; then
ogg_lib=[`ls -- $path/libvorbisfile.[0-9].dylib 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
fi
done
May 12, 2006
May 12, 2006
242
243
244
245
246
247
248
249
250
251
252
253
254
;;
*-*-cygwin* | *-*-mingw32*)
ogg_lib='vorbisfile.dll'
;;
*)
for path in /usr/lib /usr/local/lib; do
if test x$ogg_lib = x; then
ogg_lib=[`ls -- $path/libvorbisfile.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
fi
done
;;
esac
SOURCES="$SOURCES $srcdir/*_ogg.c"
Apr 30, 2006
Apr 30, 2006
255
EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC"
May 12, 2006
May 12, 2006
256
257
258
259
260
261
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
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis -logg"
fi
Jul 3, 2000
Jul 3, 2000
262
263
fi
fi
Jul 15, 2007
Jul 15, 2007
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
AC_ARG_ENABLE(music-ogg-tremor,
[ --enable-music-ogg-tremor enable OGG music via libtremor [[default=no]]],
, enable_music_ogg_tremor=no)
if test x$enable_music_ogg_tremor = xyes; then
AC_MSG_CHECKING(for libtremor headers)
have_tremor=no
AC_TRY_COMPILE([
#include <tremor/ivorbiscodec.h>
#include <tremor/ivorbisfile.h>
],[
],[
have_tremor=yes
])
AC_MSG_RESULT($have_tremor)
if test x$have_tremor = xyes; then
SOURCES="$SOURCES $srcdir/*_ogg.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC -DOGG_USE_TREMOR"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisidec"
fi
fi
Oct 21, 1999
Oct 21, 1999
284
AC_ARG_ENABLE(music-mp3,
May 12, 2006
May 12, 2006
285
[ --enable-music-mp3 enable MP3 music via smpeg [[default=yes]]],
Oct 21, 1999
Oct 21, 1999
286
287
, enable_music_mp3=yes)
if test x$enable_music_mp3 = xyes; then
Apr 5, 2001
Apr 5, 2001
288
289
SMPEG_VERSION=0.4.3
AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
Oct 21, 1999
Oct 21, 1999
290
if test x$have_smpeg = xyes; then
May 12, 2006
May 12, 2006
291
AC_ARG_ENABLE([music-mp3-shared],
May 12, 2006
May 12, 2006
292
293
AC_HELP_STRING([--enable-music-mp3-shared], [dynamically load MP3 support [[default=yes]]]),
[], [enable_music_mp3_shared=yes])
May 12, 2006
May 12, 2006
294
295
case "$host" in
*-*-darwin*)
Feb 13, 2007
Feb 13, 2007
296
297
298
299
300
for path in /usr/lib /usr/local/lib; do
if test x$smpeg_lib = x; then
smpeg_lib=[`ls -- $path/libsmpeg*.[0-9].dylib 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
fi
done
May 12, 2006
May 12, 2006
301
302
303
304
305
306
307
308
309
310
311
312
;;
*-*-cygwin* | *-*-mingw32*)
smpeg_lib='smpeg.dll'
;;
*)
for path in /usr/lib /usr/local/lib; do
if test x$smpeg_lib = x; then
smpeg_lib=[`ls -- $path/libsmpeg*.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
fi
done
;;
esac
May 12, 2006
May 12, 2006
313
SOURCES="$SOURCES $srcdir/*_mp3.c"
Apr 30, 2006
Apr 30, 2006
314
EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
May 12, 2006
May 12, 2006
315
316
317
318
319
320
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 21, 1999
Oct 21, 1999
321
322
323
fi
fi
Apr 30, 2006
Apr 30, 2006
324
OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
Oct 21, 1999
Oct 21, 1999
325
Apr 30, 2006
Apr 30, 2006
326
327
328
329
330
331
332
333
334
335
336
dnl Expand the sources and objects needed to build the library
AC_SUBST(ac_aux_dir)
AC_SUBST(SOURCES)
AC_SUBST(OBJECTS)
AC_SUBST(BUILD_CFLAGS)
AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(BUILD_LDFLAGS)
AC_SUBST(EXTRA_LDFLAGS)
AC_SUBST(EXE)
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
Jan 26, 2003
Jan 26, 2003
337
Oct 21, 1999
Oct 21, 1999
338
AC_OUTPUT([
Apr 30, 2006
Apr 30, 2006
339
340
341
342
Makefile SDL_mixer.spec SDL_mixer.qpg
], [
: >build-deps
if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend
Oct 21, 1999
Oct 21, 1999
343
])