/
configure.in
147 lines (131 loc) · 3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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.
MAJOR_VERSION=1
15
16
17
18
MINOR_VERSION=2
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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 Setup for automake
40
AM_INIT_AUTOMAKE(SDL_mixer, $VERSION)
41
42
43
44
45
dnl Detect the canonical host and target build environment
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
46
47
48
49
dnl Check for tools
AC_PROG_MAKE_SET
AC_PROG_CC
50
AC_LIBTOOL_WIN32_DLL
51
52
53
AM_PROG_LIBTOOL
AC_PROG_INSTALL
54
55
56
57
58
dnl The alpha architecture needs special flags for binary portability
case "$target" in
alpha*-*-linux*)
CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
;;
59
60
61
62
63
*-*-cygwin* | *-*-mingw32*)
if test "$build" != "$target"; then # cross-compiling
ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
fi
;;
64
65
esac
66
dnl Check for SDL
67
SDL_VERSION=1.2.0
68
69
70
71
AM_PATH_SDL($SDL_VERSION,
:,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
72
73
74
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
75
76
77
78
dnl Flag for using SDL_RWops
dnl Matt Campbell (matt@campbellhome.dhs.org)
CFLAGS="$CFLAGS -DUSE_RWOPS"
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
dnl Check command-line options
AC_ARG_ENABLE(music-cmd,
[ --enable-music-cmd support an external music player [default=yes]],
, enable_music_cmd=yes)
if test x$enable_music_cmd = xyes; then
CFLAGS="$CFLAGS -DCMD_MUSIC"
fi
AC_ARG_ENABLE(music-wave,
[ --enable-music-wave enable streaming WAVE music [default=yes]],
, enable_music_wave=yes)
if test x$enable_music_wave = xyes; then
CFLAGS="$CFLAGS -DWAV_MUSIC"
fi
AC_ARG_ENABLE(music-mod,
[ --enable-music-mod enable MOD music via mikmod [default=yes]],
, enable_music_mod=yes)
if test x$enable_music_mod = xyes; then
CFLAGS="$CFLAGS -DMOD_MUSIC -I\$(top_srcdir)/mikmod"
97
98
99
100
101
102
103
104
MUSIC_SUBDIRS="$MUSIC_SUBDIRS mikmod"
fi
AC_ARG_ENABLE(music-midi,
[ --enable-music-midi enable MIDI music via timidity [default=yes]],
, enable_music_midi=yes)
if test x$enable_music_midi = xyes; then
CFLAGS="$CFLAGS -DMID_MUSIC -I\$(top_srcdir)/timidity"
MUSIC_SUBDIRS="$MUSIC_SUBDIRS timidity"
105
fi
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
AC_ARG_ENABLE(music-ogg,
[ --enable-music-ogg enable Ogg Vorbis music [default=yes]],
, enable_music_ogg=yes)
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
CFLAGS="$CFLAGS -DOGG_MUSIC"
LIBS="$LIBS -lvorbisfile -lvorbis"
fi
fi
124
125
126
127
AC_ARG_ENABLE(music-mp3,
[ --enable-music-mp3 enable MP3 music via smpeg [default=yes]],
, enable_music_mp3=yes)
if test x$enable_music_mp3 = xyes; then
128
129
SMPEG_VERSION=0.4.3
AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
130
if test x$have_smpeg = xyes; then
131
132
CFLAGS="$CFLAGS $SMPEG_CFLAGS"
LIBS="$LIBS $SMPEG_LIBS"
133
134
135
fi
fi
136
137
138
139
140
dnl Add Makefile conditionals
AC_SUBST(MUSIC_SUBDIRS)
AM_CONDITIONAL(USE_MIKMOD, test x$enable_music_mod = xyes)
AM_CONDITIONAL(USE_TIMIDITY, test x$enable_music_midi = xyes)
141
142
143
144
145
# Finally create all the generated files
AC_OUTPUT([
Makefile
mikmod/Makefile
timidity/Makefile
146
SDL_mixer.spec
147
])