Skip to content

Latest commit

 

History

History
279 lines (246 loc) · 8.37 KB

configure.in

File metadata and controls

279 lines (246 loc) · 8.37 KB
 
Aug 10, 2000
Aug 10, 2000
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
Apr 4, 2001
Apr 4, 2001
15
MINOR_VERSION=2
Dec 24, 2004
Dec 24, 2004
16
17
18
MICRO_VERSION=5
INTERFACE_AGE=4
BINARY_AGE=5
Aug 10, 2000
Aug 10, 2000
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
40
dnl Detect the canonical build and host environments
AC_CANONICAL_HOST
Aug 10, 2000
Aug 10, 2000
41
Jul 24, 2001
Jul 24, 2001
42
43
44
dnl Setup for automake
AM_INIT_AUTOMAKE(SDL_image, $VERSION)
Aug 10, 2000
Aug 10, 2000
45
46
dnl Check for tools
Aug 10, 2000
Aug 10, 2000
47
48
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
Aug 10, 2000
Aug 10, 2000
49
50
AC_PROG_MAKE_SET
AC_PROG_CC
Mar 2, 2001
Mar 2, 2001
51
AC_C_INLINE
Aug 10, 2000
Aug 10, 2000
52
53
54
AC_PROG_INSTALL
dnl The alpha architecture needs special flags for binary portability
Mar 19, 2006
Mar 19, 2006
55
case "$host" in
Aug 10, 2000
Aug 10, 2000
56
57
58
alpha*-*-linux*)
CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
;;
Apr 5, 2001
Apr 5, 2001
59
60
61
*-*-beos*)
ac_default_prefix=/boot/develop/tools/gnupro
;;
Aug 10, 2000
Aug 10, 2000
62
*-*-cygwin* | *-*-mingw32*)
Mar 19, 2006
Mar 19, 2006
63
if test "$build" != "$host"; then # cross-compiling
Aug 20, 2001
Aug 20, 2001
64
# Default cross-compile location
Aug 10, 2000
Aug 10, 2000
65
ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
Aug 20, 2001
Aug 20, 2001
66
67
else
# Look for the location of the tools and install there
Jan 24, 2006
Jan 24, 2006
68
if test "$BUILD_PREFIX" != ""; then
Aug 20, 2001
Aug 20, 2001
69
70
ac_default_prefix=$BUILD_PREFIX
fi
Aug 10, 2000
Aug 10, 2000
71
72
fi
;;
Aug 10, 2000
Aug 10, 2000
73
74
75
esac
dnl Check for SDL
May 12, 2006
May 12, 2006
76
SDL_VERSION=1.2.10
Aug 10, 2000
Aug 10, 2000
77
78
AM_PATH_SDL($SDL_VERSION,
:,
May 1, 2006
May 1, 2006
79
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
Aug 10, 2000
Aug 10, 2000
80
81
)
CFLAGS="$CFLAGS $SDL_CFLAGS"
Jan 26, 2003
Jan 26, 2003
82
LIBS="$LIBS $SDL_LIBS"
May 1, 2006
May 1, 2006
83
saved_LIBS="$LIBS"
Aug 10, 2000
Aug 10, 2000
84
85
dnl Check command-line options
May 1, 2006
May 1, 2006
86
87
88
89
90
91
AC_ARG_ENABLE([bmp], [AC_HELP_STRING([--enable-bmp], [support loading BMP images [default=yes]])],
[], [enable_bmp=yes])
AC_ARG_ENABLE([gif], [AC_HELP_STRING([--enable-gif], [support loading GIF images [default=yes]])],
[], [enable_gif=yes])
AC_ARG_ENABLE([jpg], [AC_HELP_STRING([--enable-jpg], [support loading JPG images [default=yes]])],
[], [enable_jpg=yes])
May 12, 2006
May 12, 2006
92
93
AC_ARG_ENABLE([jpg-shared], AC_HELP_STRING([--enable-jpg-shared], [dynamically load JPG support [[default=yes]]]),
[], [enable_jpg_shared=yes])
May 1, 2006
May 1, 2006
94
95
96
97
AC_ARG_ENABLE([lbm], [AC_HELP_STRING([--enable-lbm], [support loading LBM images [default=yes]])],
[], [enable_lbm=yes])
AC_ARG_ENABLE([pcx], [AC_HELP_STRING([--enable-pcx], [support loading PCX images [default=yes]])],
[], [enable_pcx=yes])
May 12, 2006
May 12, 2006
98
AC_ARG_ENABLE([png], [AC_HELP_STRING([--enable-png], [support loading PNG images [default=yes]])],
May 1, 2006
May 1, 2006
99
[], [enable_png=yes])
May 12, 2006
May 12, 2006
100
101
AC_ARG_ENABLE([png-shared], AC_HELP_STRING([--enable-png-shared], [dynamically load PNG support [[default=yes]]]),
[], [enable_png_shared=yes])
May 1, 2006
May 1, 2006
102
103
104
105
AC_ARG_ENABLE([pnm], [AC_HELP_STRING([--enable-pnm], [support loading PNM images [default=yes]])],
[], [enable_pnm=yes])
AC_ARG_ENABLE([tga], [AC_HELP_STRING([--enable-tga], [support loading TGA images [default=yes]])],
[], [enable_tga=yes])
May 12, 2006
May 12, 2006
106
107
108
109
AC_ARG_ENABLE([tif], [AC_HELP_STRING([--enable-tif], [support loading TIFF images [default=yes]])],
[], [enable_tif=yes])
AC_ARG_ENABLE([tif-shared], AC_HELP_STRING([--enable-tif-shared], [dynamically load TIFF support [[default=yes]]]),
[], [enable_tif_shared=yes])
May 1, 2006
May 1, 2006
110
111
112
113
114
115
116
AC_ARG_ENABLE([xcf], [AC_HELP_STRING([--enable-xcf], [support loading XCF images [default=yes]])],
[], [enable_xcf=yes])
AC_ARG_ENABLE([xpm], [AC_HELP_STRING([--enable-xpm], [support loading XPM images [default=yes]])],
[], [enable_xpm=yes])
AC_ARG_ENABLE([xv], [AC_HELP_STRING([--enable-xv], [support loading XV images [default=yes]])],
[], [enable_xv=yes])
May 12, 2006
May 12, 2006
117
if test x$enable_png = xyes || test x$enable_tif = xyes; then
May 1, 2006
May 1, 2006
118
119
120
AC_CHECK_LIB([z], [uncompress], [
LIBS="-lz $LIBS"
])
Aug 10, 2000
Aug 10, 2000
121
fi
May 1, 2006
May 1, 2006
122
May 12, 2006
May 12, 2006
123
if test x$enable_jpg = xyes || test x$enable_tif = xyes; then
May 1, 2006
May 1, 2006
124
AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], [have_libjpeg=yes])
Aug 10, 2000
Aug 10, 2000
125
if test x$have_libjpeg = xyes; then
May 1, 2006
May 1, 2006
126
127
128
129
if test x$enable_jpg = xyes; then
AC_DEFINE(LOAD_JPG)
fi
LIBS="-ljpeg $LIBS"
May 12, 2006
May 12, 2006
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
case "$host" in
*-*-darwin*) # FIXME when Mac OS X ships with libjpeg
jpg_lib=''
;;
*-*-cygwin* | *-*-mingw32*)
jpg_lib='jpeg.dll'
;;
*)
for path in /usr/lib /usr/local/lib; do
if test x$jpg_lib = x; then
jpg_lib=[`ls -- $path/libjpeg.so.[0-9][0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
fi
done
;;
esac
May 1, 2006
May 1, 2006
146
147
elif test x$enable_jpg = xyes; then
AC_MSG_WARN([*** Unable to find JPEG library (http://www.ijg.org/)])
Aug 10, 2000
Aug 10, 2000
148
149
150
AC_MSG_WARN([JPG image loading disabled])
fi
fi
May 1, 2006
May 1, 2006
151
Aug 10, 2000
Aug 10, 2000
152
if test x$enable_png = xyes; then
May 1, 2006
May 1, 2006
153
154
155
AC_CHECK_LIB([png], [png_create_read_struct], [have_libpng=yes])
if test x$have_libpng = xyes; then
AC_DEFINE([LOAD_PNG])
May 12, 2006
May 12, 2006
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
case "$host" in
*-*-darwin*) # FIXME when Mac OS X ships with libpng
png_lib=''
;;
*-*-cygwin* | *-*-mingw32*)
png_lib='libpng13.dll'
;;
*)
for path in /usr/lib /usr/local/lib; do
if test x$png_lib = x; then
png_lib=[`ls -- $path/libpng.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
fi
done
;;
esac
Aug 10, 2000
Aug 10, 2000
172
else
May 1, 2006
May 1, 2006
173
AC_MSG_WARN([*** Unable to find PNG library (http://www.libpng.org/pub/png/libpng.html)])
Aug 10, 2000
Aug 10, 2000
174
175
176
AC_MSG_WARN([PNG image loading disabled])
fi
fi
May 1, 2006
May 1, 2006
177
Aug 10, 2000
Aug 10, 2000
178
if test x$enable_tif = xyes; then
May 1, 2006
May 1, 2006
179
AC_CHECK_LIB([tiff], [TIFFClientOpen], [have_libtiff=yes])
Aug 10, 2000
Aug 10, 2000
180
if test x$have_libtiff = xyes; then
May 1, 2006
May 1, 2006
181
AC_DEFINE([LOAD_TIF])
May 12, 2006
May 12, 2006
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
case "$host" in
*-*-darwin*) # FIXME when Mac OS X ships with libtiff
tif_lib=''
;;
*-*-cygwin* | *-*-mingw32*)
tif_lib='libtiff.dll'
;;
*)
for path in /usr/lib /usr/local/lib; do
if test x$tif_lib = x; then
tif_lib=[`ls -- $path/libtiff.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
fi
done
;;
esac
Aug 10, 2000
Aug 10, 2000
198
else
May 12, 2006
May 12, 2006
199
AC_MSG_WARN([*** Unable to find Tiff library (http://www.remotesensing.org/libtiff/)])
Aug 10, 2000
Aug 10, 2000
200
201
202
AC_MSG_WARN([TIF image loading disabled])
fi
fi
May 1, 2006
May 1, 2006
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
if test x$enable_bmp = xyes; then
AC_DEFINE([LOAD_BMP])
fi
if test x$enable_gif = xyes; then
AC_DEFINE([LOAD_GIF])
fi
if test x$enable_lbm = xyes; then
AC_DEFINE([LOAD_LBM])
fi
if test x$enable_pcx = xyes; then
AC_DEFINE([LOAD_PCX])
fi
if test x$enable_pnm = xyes; then
AC_DEFINE([LOAD_PNM])
fi
if test x$enable_tga = xyes; then
AC_DEFINE([LOAD_TGA])
fi
Mar 7, 2001
Mar 7, 2001
228
if test x$enable_xcf = xyes; then
May 1, 2006
May 1, 2006
229
AC_DEFINE([LOAD_XCF])
Mar 7, 2001
Mar 7, 2001
230
fi
May 1, 2006
May 1, 2006
231
Nov 29, 2000
Nov 29, 2000
232
if test x$enable_xpm = xyes; then
May 1, 2006
May 1, 2006
233
AC_DEFINE([LOAD_XPM])
Nov 29, 2000
Nov 29, 2000
234
fi
May 1, 2006
May 1, 2006
235
Feb 4, 2006
Feb 4, 2006
236
if test x$enable_xv = xyes; then
May 1, 2006
May 1, 2006
237
AC_DEFINE([LOAD_XV])
Feb 4, 2006
Feb 4, 2006
238
fi
May 1, 2006
May 1, 2006
239
May 12, 2006
May 12, 2006
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
if test x$enable_tif = xyes; then
if test x$enable_tif_shared = xyes && test x$tif_lib != x; then
echo "-- dynamic libtiff -> $tif_lib"
AC_DEFINE_UNQUOTED(LOAD_TIF_DYNAMIC, "$tif_lib")
else
if test x$have_libjpeg = xyes; then
# Disable dynamic jpeg since we're linking it explicitly
jpg_lib=''
IMG_LIBS="-ljpeg $IMG_LIBS"
fi
IMG_LIBS="-ltiff -lz"
fi
fi
if test x$enable_jpg = xyes; then
if test x$enable_jpg_shared = xyes && test x$jpg_lib != x; then
echo "-- dynamic libjpeg -> $jpg_lib"
AC_DEFINE_UNQUOTED(LOAD_JPG_DYNAMIC, "$jpg_lib")
else
IMG_LIBS="-ljpeg $IMG_LIBS"
fi
fi
if test x$enable_png = xyes; then
if test x$enable_png_shared = xyes && test x$png_lib != x; then
echo "-- dynamic libpng -> $png_lib"
AC_DEFINE_UNQUOTED(LOAD_PNG_DYNAMIC, "$png_lib")
else
IMG_LIBS="-lpng -lz $IMG_LIBS"
fi
fi
May 1, 2006
May 1, 2006
270
271
272
LIBS="$saved_LIBS"
AC_SUBST([IMG_LIBS])
Aug 10, 2000
Aug 10, 2000
273
274
275
276
277
# Finally create all the generated files
AC_OUTPUT([
Makefile
SDL_image.spec
Aug 23, 2003
Aug 23, 2003
278
SDL_image.qpg
Aug 10, 2000
Aug 10, 2000
279
])