Skip to content

Latest commit

 

History

History
371 lines (313 loc) · 11.3 KB

configure.in

File metadata and controls

371 lines (313 loc) · 11.3 KB
 
Sep 25, 2001
Sep 25, 2001
1
# Process this file with autoconf to produce a configure script.
Sep 25, 2001
Sep 25, 2001
2
AC_INIT(SDL_sound.c)
Sep 25, 2001
Sep 25, 2001
3
4
5
6
7
8
9
10
11
12
13
14
15
dnl ---------------------------------------------------------------------
dnl System/version info
dnl ---------------------------------------------------------------------
# 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.
Oct 9, 2002
Oct 9, 2002
16
17
MAJOR_VERSION=1
MINOR_VERSION=0
Apr 20, 2008
Apr 20, 2008
18
19
20
MICRO_VERSION=3
INTERFACE_AGE=2
BINARY_AGE=2
Sep 25, 2001
Sep 25, 2001
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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)
dnl Detect the canonical host and target build environment
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
dnl Setup for automake
Oct 3, 2001
Oct 3, 2001
46
AM_CONFIG_HEADER(config.h)
Sep 25, 2001
Sep 25, 2001
47
48
49
50
51
52
53
54
55
56
AM_INIT_AUTOMAKE(SDL_sound, $VERSION)
dnl ---------------------------------------------------------------------
dnl Compilers and other tools
dnl ---------------------------------------------------------------------
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
Jul 2, 2002
Jul 2, 2002
57
AM_PROG_LIBTOOL
Sep 25, 2001
Sep 25, 2001
58
59
Jan 5, 2010
Jan 5, 2010
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
dnl ---------------------------------------------------------------------
dnl Have GCC's -fvisibility option?
dnl ---------------------------------------------------------------------
AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
have_gcc_fvisibility=no
visibility_CFLAGS="-fvisibility=hidden"
save_CFLAGS="$CFLAGS"
CFLAGS="$save_CFLAGS $visibility_CFLAGS"
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
CFLAGS="$CFLAGS $visibility_CFLAGS"
fi
Oct 3, 2001
Oct 3, 2001
84
85
86
87
88
89
dnl ---------------------------------------------------------------------
dnl Debug mode?
dnl ---------------------------------------------------------------------
AC_ARG_ENABLE(debug,
[ --enable-debug enable debug mode [default=no]],
Nov 9, 2001
Nov 9, 2001
90
, enable_debug=no)
Oct 3, 2001
Oct 3, 2001
91
92
93
94
95
96
if test x$enable_debug = xyes; then
if test x$ac_cv_prog_cc_g = xyes; then
CFLAGS="-g -O0"
else
CFLAGS="-O0"
fi
Oct 3, 2001
Oct 3, 2001
97
CFLAGS="$CFLAGS -Werror"
Dec 6, 2005
Dec 6, 2005
98
99
AC_DEFINE(DEBUG, 1, [Define for debug builds.])
AC_DEFINE(DEBUG_CHATTER, 1, [Define for debug build chattering.])
Oct 3, 2001
Oct 3, 2001
100
else
Dec 6, 2005
Dec 6, 2005
101
AC_DEFINE(NDEBUG, 1, [Define to disable debugging.])
Oct 3, 2001
Oct 3, 2001
102
103
104
fi
Sep 25, 2001
Sep 25, 2001
105
106
107
108
109
110
111
112
dnl ---------------------------------------------------------------------
dnl Checks for libraries.
dnl ---------------------------------------------------------------------
dnl Check for SDL
SDL_VERSION=1.2.0
AM_PATH_SDL($SDL_VERSION,
:,
Jul 2, 2002
Jul 2, 2002
113
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
Sep 25, 2001
Sep 25, 2001
114
115
116
117
)
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
Dec 6, 2005
Dec 6, 2005
118
Sep 25, 2001
Sep 25, 2001
119
120
121
122
123
dnl Check for voc decoder inclusion...
AC_ARG_ENABLE(voc,
[ --enable-voc enable VOC decoding [default=yes]],
, enable_voc=yes)
if test x$enable_voc = xyes; then
Dec 6, 2005
Dec 6, 2005
124
AC_DEFINE(SOUND_SUPPORTS_VOC, 1, [Define if VOC support is desired.])
Sep 25, 2001
Sep 25, 2001
125
126
127
128
129
130
131
132
fi
dnl Check for wav decoder inclusion...
AC_ARG_ENABLE(wav,
[ --enable-wav enable WAV decoding [default=yes]],
, enable_wav=yes)
if test x$enable_wav = xyes; then
Dec 6, 2005
Dec 6, 2005
133
AC_DEFINE(SOUND_SUPPORTS_WAV, 1, [Define if WAV support is desired.])
Sep 25, 2001
Sep 25, 2001
134
135
136
137
138
139
140
141
fi
dnl Check for raw decoder inclusion...
AC_ARG_ENABLE(raw,
[ --enable-raw enable raw audio "decoding" [default=yes]],
, enable_raw=yes)
if test x$enable_raw = xyes; then
Dec 6, 2005
Dec 6, 2005
142
AC_DEFINE(SOUND_SUPPORTS_RAW, 1, [Define if RAW support is desired.])
Sep 25, 2001
Sep 25, 2001
143
144
145
146
147
148
149
150
fi
dnl Check for aiff decoder inclusion...
AC_ARG_ENABLE(aiff,
[ --enable-aiff enable AIFF decoding [default=yes]],
, enable_aiff=yes)
if test x$enable_aiff = xyes; then
Dec 6, 2005
Dec 6, 2005
151
AC_DEFINE(SOUND_SUPPORTS_AIFF, 1, [Define if AIFF support is desired.])
Sep 25, 2001
Sep 25, 2001
152
153
fi
Jan 13, 2002
Jan 13, 2002
154
155
dnl Check for au decoder inclusion
AC_ARG_ENABLE(au,
Mar 14, 2002
Mar 14, 2002
156
[ --enable-au enable AU decoding [default=yes]],
Jan 13, 2002
Jan 13, 2002
157
158
, enable_au=yes)
if test x$enable_au = xyes; then
Dec 6, 2005
Dec 6, 2005
159
AC_DEFINE(SOUND_SUPPORTS_AU, 1, [Define if AU support is desired.])
Jan 13, 2002
Jan 13, 2002
160
fi
Sep 25, 2001
Sep 25, 2001
161
Sep 25, 2001
Sep 25, 2001
162
163
dnl Check for shn decoder inclusion...
AC_ARG_ENABLE(shn,
Oct 3, 2001
Oct 3, 2001
164
165
[ --enable-shn enable SHN decoding [default=yes]],
, enable_shn=yes)
Sep 25, 2001
Sep 25, 2001
166
if test x$enable_shn = xyes; then
Dec 6, 2005
Dec 6, 2005
167
AC_DEFINE(SOUND_SUPPORTS_SHN, 1, [Define if SHN support is desired.])
Sep 25, 2001
Sep 25, 2001
168
169
fi
Feb 21, 2002
Feb 21, 2002
170
dnl Check for the MIDI decoder...
Oct 3, 2001
Oct 3, 2001
171
AC_ARG_ENABLE(midi,
Jan 4, 2002
Jan 4, 2002
172
173
[ --enable-midi enable software MIDI music [default=yes]],
, enable_midi=yes)
Oct 3, 2001
Oct 3, 2001
174
if test x$enable_midi = xyes; then
Dec 6, 2005
Dec 6, 2005
175
AC_DEFINE(SOUND_SUPPORTS_MIDI, 1, [Define if MIDI support is desired.])
Oct 3, 2001
Oct 3, 2001
176
177
178
179
fi
dnl Check for SMPEG
AC_ARG_ENABLE(smpeg,
Feb 21, 2002
Feb 21, 2002
180
[ --enable-smpeg enable MP3 decoding via smpeg [default=yes]],
Oct 3, 2001
Oct 3, 2001
181
182
, enable_smpeg=yes)
if test x$enable_smpeg = xyes; then
Dec 6, 2005
Dec 6, 2005
183
184
185
186
187
AC_CHECK_HEADER(smpeg.h, have_smpeg_hdr=yes)
AC_CHECK_LIB(smpeg, SMPEG_new, have_smpeg_lib=yes)
if test x$have_smpeg_hdr = xyes -a x$have_smpeg_lib = xyes; then
LIBS="$LIBS -lsmpeg"
AC_DEFINE(SOUND_SUPPORTS_SMPEG, 1, [Define if SMPEG support is desired.])
Oct 3, 2001
Oct 3, 2001
188
189
fi
fi
Sep 25, 2001
Sep 25, 2001
190
Feb 21, 2002
Feb 21, 2002
191
192
193
194
195
dnl Check for the MIDI decoder...
AC_ARG_ENABLE(mpglib,
[ --enable-mpglib enable MP3 decoding internally [default=yes]],
, enable_mpglib=yes)
if test x$enable_mpglib = xyes; then
Dec 6, 2005
Dec 6, 2005
196
AC_DEFINE(SOUND_SUPPORTS_MPGLIB, 1, [Define if MPGLIB support is desired.])
Feb 21, 2002
Feb 21, 2002
197
198
199
fi
Sep 25, 2001
Sep 25, 2001
200
201
202
203
204
dnl Check for libmikmod
AC_ARG_ENABLE(mikmod,
[ --enable-mikmod enable MOD decoding via mikmod [default=yes]],
, enable_mikmod=yes)
if test x$enable_mikmod = xyes; then
Dec 6, 2005
Dec 6, 2005
205
206
207
208
209
AC_CHECK_HEADER(mikmod.h, have_mikmod_hdr=yes)
AC_CHECK_LIB(mikmod, MikMod_RegisterDriver, have_mikmod_lib=yes)
if test x$have_mikmod_hdr = xyes -a x$have_mikmod_lib = xyes; then
LIBS="$LIBS -lmikmod"
AC_DEFINE(SOUND_SUPPORTS_MIKMOD, 1, [Define if MIKMOD support is desired.])
Jan 10, 2002
Jan 10, 2002
210
211
212
213
214
215
216
217
fi
fi
dnl Check for libmodplug
AC_ARG_ENABLE(modplug,
[ --enable-modplug enable MOD decoding via modplug [default=yes]],
, enable_modplug=yes)
if test x$enable_modplug = xyes; then
Oct 12, 2005
Oct 12, 2005
218
have_modplug_hdr=no
Jan 10, 2002
Jan 10, 2002
219
AC_CHECK_HEADER(modplug.h, have_modplug_hdr=yes)
Oct 12, 2005
Oct 12, 2005
220
221
222
223
if test x$have_modplug_hdr = xno; then
AC_CHECK_HEADER(libmodplug/modplug.h, have_modplug_hdr=yes)
if test x$have_modplug_hdr = xyes; then
have_modplug_hdr=yes
Dec 6, 2005
Dec 6, 2005
224
AC_DEFINE(SOUND_MODPLUG_IN_OWN_PATH, 1, [Define if modplug header is in own directory.])
Oct 12, 2005
Oct 12, 2005
225
226
227
fi
fi
Jan 10, 2002
Jan 10, 2002
228
229
230
AC_CHECK_LIB(modplug, ModPlug_Load, have_modplug_lib=yes)
if test x$have_modplug_hdr = xyes -a x$have_modplug_lib = xyes; then
LIBS="$LIBS -lmodplug"
Dec 6, 2005
Dec 6, 2005
231
AC_DEFINE(SOUND_SUPPORTS_MODPLUG, 1, [Define if MODPLUG support is desired.])
Sep 25, 2001
Sep 25, 2001
232
233
234
fi
fi
Oct 28, 2006
Oct 28, 2006
235
236
237
238
239
240
241
242
243
AC_CHECK_HEADER(ogg/ogg.h, have_ogg_hdr=yes)
AC_CHECK_LIB(ogg, ogg_sync_init, have_ogg_lib=yes)
have_ogg=no
if test x$have_ogg_hdr = xyes -a x$have_ogg_lib = xyes; then
have_ogg=yes
fi
dnl !!! FIXME: should be --enable-vorbis.
dnl Check for Ogg Vorbis
Mar 14, 2002
Mar 14, 2002
244
245
246
247
AC_ARG_ENABLE(ogg,
[ --enable-ogg enable OGG decoding via libvorbis [default=yes]],
, enable_ogg=yes)
if test x$enable_ogg = xyes; then
Dec 6, 2005
Dec 6, 2005
248
249
250
251
252
AC_CHECK_HEADER(vorbis/codec.h, have_vorbis_hdr=yes)
AC_CHECK_LIB(vorbis, vorbis_info_init, have_vorbis_lib=yes)
AC_CHECK_HEADER(vorbis/vorbisfile.h, have_vorbisfile_hdr=yes)
AC_CHECK_LIB(vorbisfile, ov_open_callbacks, have_vorbisfile_lib=yes)
have_vorbis=no
Oct 28, 2006
Oct 28, 2006
253
if test x$have_ogg = xyes; then
Dec 6, 2005
Dec 6, 2005
254
255
256
257
258
259
260
261
262
263
264
if test x$have_vorbis_hdr = xyes -a x$have_vorbis_lib = xyes; then
if test x$have_vorbisfile_hdr = xyes -a x$have_vorbisfile_lib = xyes; then
have_vorbis=yes
fi
fi
fi
if test x$have_vorbis = xyes; then
CFLAGS="$CFLAGS"
LIBS="$LIBS -logg -lvorbis -lvorbisfile"
AC_DEFINE(SOUND_SUPPORTS_OGG, 1, [Define if OGG support is desired.])
Sep 25, 2001
Sep 25, 2001
265
266
267
fi
fi
Oct 28, 2006
Oct 28, 2006
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
dnl Note that we intentionally look for a symbol in FLAC 1.0.4, since the
dnl FLAC developers tend to break their API with every release, so we're
dnl checking for the latest-and-greatest here so we don't have to support
dnl obsolete versions.
dnl Starting with FLAC 1.1.3:
dnl libFLAC supports Ogg FLAC (no more libOggFLAC) so we also need -logg
dnl the libFLAC .so version is also #defined in FLAC/export.h
dnl Hooray for shitty autoconf bugs!
x="C__stream_decoder_process_single"
flcsym="FLA$x"
dnl Check for libFLAC
AC_ARG_ENABLE(flac,
[ --enable-flac enable FLAC decoding via libFLAC [default=yes]],
, enable_flac=yes)
if test x$enable_flac = xyes; then
AC_CHECK_HEADER(FLAC/stream_decoder.h, have_flac_hdr=yes)
AC_CHECK_LIB(FLAC, $flcsym, have_flac_lib=yes)
if test x$have_ogg = xyes; then
if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then
LIBS="$LIBS -lFLAC -logg"
AC_DEFINE(SOUND_SUPPORTS_FLAC, 1, [Define if FLAC support is desired.])
fi
fi
fi
Sep 13, 2003
Sep 13, 2003
296
297
298
299
300
301
302
dnl Check for speex
AC_ARG_ENABLE(speex,
[ --enable-speex enable SPX decoding via libspeex [default=yes]],
, enable_speex=yes)
if test x$enable_speex = xyes; then
AC_CHECK_HEADER(ogg/ogg.h, have_ogg_hdr=yes)
AC_CHECK_LIB(ogg, ogg_sync_init, have_ogg_lib=yes)
Apr 17, 2008
Apr 17, 2008
303
AC_CHECK_HEADER(speex/speex.h, have_speex_hdr=yes)
Sep 13, 2003
Sep 13, 2003
304
305
306
AC_CHECK_LIB(speex, speex_bits_init, have_speex_lib=yes)
if test "x$have_ogg_hdr" = "xyes" -a "x$have_ogg_lib" = "xyes" -a "x$have_speex_hdr" = "xyes" -a "x$have_speex_lib" = "xyes"; then
LIBS="$LIBS -logg -lspeex"
Dec 6, 2005
Dec 6, 2005
307
AC_DEFINE(SOUND_SUPPORTS_SPEEX, 1, [Define if SPEEX support is desired.])
Sep 13, 2003
Sep 13, 2003
308
309
310
311
fi
fi
Mar 16, 2002
Mar 16, 2002
312
313
314
315
316
317
318
319
dnl Check for PhysicsFS http://icculus.org/physfs/
AC_ARG_ENABLE(physfs,
[ --enable-physfs enable PhysicsFS in playsound [default=yes]],
, enable_physfs=yes)
if test x$enable_physfs = xyes; then
AC_CHECK_HEADER(physfs.h, have_physfs_hdr=yes)
AC_CHECK_LIB(physfs, PHYSFS_init, have_physfs_lib=yes)
if test x$have_physfs_hdr = xyes -a x$have_physfs_lib = xyes; then
May 20, 2002
May 20, 2002
320
321
322
enable_physfs="yes"
else
enable_physfs="no"
Mar 16, 2002
Mar 16, 2002
323
324
325
fi
fi
May 20, 2002
May 20, 2002
326
327
328
329
330
dnl Check for PhysicsFS http://icculus.org/physfs/
AC_ARG_ENABLE(altcvt,
[ --enable-altcvt enable EXPERIMENTAL audio converter [default=no]],
, enable_altcvt=no)
if test x$enable_altcvt = xyes; then
Dec 6, 2005
Dec 6, 2005
331
AC_DEFINE(SOUND_USE_ALTCVT, 1, [Define to use alternate audio converter.])
May 20, 2002
May 20, 2002
332
333
fi
Mar 16, 2002
Mar 16, 2002
334
Dec 27, 2001
Dec 27, 2001
335
336
337
338
339
340
341
342
dnl Check for efence (!!! FIXME : This doesn't work.)
dnl AC_ARG_ENABLE(efence,
dnl [ --enable-efence enable ElectricFence usage [default=no]],
dnl , enable_efence=no)
dnl if test x$enable_efence = xyes; then
dnl LIBS="$LIBS /usr/lib/libefence.a"
dnl fi
Sep 25, 2001
Sep 25, 2001
343
344
# Checks for header files.
AC_HEADER_STDC
Jul 2, 2002
Jul 2, 2002
345
AC_CHECK_HEADERS([stdlib.h string.h signal.h assert.h])
Sep 25, 2001
Sep 25, 2001
346
347
348
349
350
351
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
# Checks for library functions.
Sep 25, 2001
Sep 25, 2001
352
353
354
355
# This is only in the bleeding edge autoconf distro...
#AC_FUNC_MALLOC
Jul 2, 2002
Jul 2, 2002
356
Sep 25, 2001
Sep 25, 2001
357
AC_FUNC_MEMCMP
Jul 2, 2002
Jul 2, 2002
358
AC_CHECK_FUNCS([memset strrchr setbuf])
Sep 25, 2001
Sep 25, 2001
359
Jan 4, 2002
Jan 4, 2002
360
361
dnl Add Makefile conditionals
AM_CONDITIONAL(USE_TIMIDITY, test x$enable_midi = xyes)
Feb 21, 2002
Feb 21, 2002
362
AM_CONDITIONAL(USE_MPGLIB, test x$enable_mpglib = xyes)
May 20, 2002
May 20, 2002
363
AM_CONDITIONAL(USE_PHYSICSFS, test x$enable_physfs = xyes)
Sep 25, 2001
Sep 25, 2001
364
365
366
367
AC_OUTPUT([
Makefile
decoders/Makefile
Jan 4, 2002
Jan 4, 2002
368
decoders/timidity/Makefile
Feb 21, 2002
Feb 21, 2002
369
decoders/mpglib/Makefile
Jan 19, 2002
Jan 19, 2002
370
playsound/Makefile
Sep 25, 2001
Sep 25, 2001
371
])