Skip to content

Latest commit

 

History

History
287 lines (253 loc) · 8.56 KB

configure.in

File metadata and controls

287 lines (253 loc) · 8.56 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
Jul 13, 2007
Jul 13, 2007
16
17
18
MICRO_VERSION=6
INTERFACE_AGE=5
BINARY_AGE=6
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
AC_PROG_CC
Mar 2, 2001
Mar 2, 2001
50
AC_C_INLINE
Aug 10, 2000
Aug 10, 2000
51
AC_PROG_INSTALL
Jul 18, 2007
Jul 18, 2007
52
53
54
55
56
57
58
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])
Aug 10, 2000
Aug 10, 2000
59
Mar 19, 2006
Mar 19, 2006
60
case "$host" in
Apr 5, 2001
Apr 5, 2001
61
62
63
*-*-beos*)
ac_default_prefix=/boot/develop/tools/gnupro
;;
Aug 10, 2000
Aug 10, 2000
64
*-*-cygwin* | *-*-mingw32*)
Mar 19, 2006
Mar 19, 2006
65
if test "$build" != "$host"; then # cross-compiling
Aug 20, 2001
Aug 20, 2001
66
# Default cross-compile location
Jul 7, 2007
Jul 7, 2007
67
ac_default_prefix=/usr/local/cross-tools/i386-mingw32
Aug 20, 2001
Aug 20, 2001
68
69
else
# Look for the location of the tools and install there
Jan 24, 2006
Jan 24, 2006
70
if test "$BUILD_PREFIX" != ""; then
Aug 20, 2001
Aug 20, 2001
71
72
ac_default_prefix=$BUILD_PREFIX
fi
Aug 10, 2000
Aug 10, 2000
73
fi
Jul 18, 2007
Jul 18, 2007
74
75
76
if test x$WINDRES != x; then
use_version_rc=true
fi
Aug 10, 2000
Aug 10, 2000
77
;;
Aug 10, 2000
Aug 10, 2000
78
esac
Jul 18, 2007
Jul 18, 2007
79
AM_CONDITIONAL(USE_VERSION_RC, test x$use_version_rc = xtrue)
Aug 10, 2000
Aug 10, 2000
80
81
dnl Check for SDL
May 12, 2006
May 12, 2006
82
SDL_VERSION=1.2.10
Aug 10, 2000
Aug 10, 2000
83
84
AM_PATH_SDL($SDL_VERSION,
:,
May 1, 2006
May 1, 2006
85
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
Aug 10, 2000
Aug 10, 2000
86
87
)
CFLAGS="$CFLAGS $SDL_CFLAGS"
Jan 26, 2003
Jan 26, 2003
88
LIBS="$LIBS $SDL_LIBS"
May 1, 2006
May 1, 2006
89
saved_LIBS="$LIBS"
Aug 10, 2000
Aug 10, 2000
90
91
dnl Check command-line options
May 1, 2006
May 1, 2006
92
93
94
95
96
97
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
98
99
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
100
101
102
103
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
104
AC_ARG_ENABLE([png], [AC_HELP_STRING([--enable-png], [support loading PNG images [default=yes]])],
May 1, 2006
May 1, 2006
105
[], [enable_png=yes])
May 12, 2006
May 12, 2006
106
107
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
108
109
110
111
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
112
113
114
115
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
116
117
118
119
120
121
122
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
123
if test x$enable_png = xyes || test x$enable_tif = xyes; then
Jul 13, 2007
Jul 13, 2007
124
CHECK_ZLIB()
Aug 10, 2000
Aug 10, 2000
125
fi
May 1, 2006
May 1, 2006
126
Jul 18, 2007
Jul 18, 2007
127
128
129
130
131
132
133
134
135
136
137
138
139
find_lib()
{
gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
env_lib_path=[`echo $LIBS $LDFLAGS | sed 's/-L[ ]*//g'`]
for path in $gcc_lib_path $env_lib_path /usr/lib /usr/local/lib; do
lib=[`ls -- $path/$1 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
if test x$lib != x; then
echo $lib
return
fi
done
}
May 12, 2006
May 12, 2006
140
if test x$enable_jpg = xyes || test x$enable_tif = xyes; then
Jul 18, 2007
Jul 18, 2007
141
142
143
AC_CHECK_HEADER([jpeglib.h], [have_jpg_hdr=yes])
AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], [have_jpg_lib=yes])
if test x$have_jpg_hdr = xyes -a x$have_jpg_lib = xyes; then
May 1, 2006
May 1, 2006
144
if test x$enable_jpg = xyes; then
Jul 18, 2007
Jul 18, 2007
145
AC_DEFINE([LOAD_JPG])
May 1, 2006
May 1, 2006
146
147
fi
LIBS="-ljpeg $LIBS"
May 12, 2006
May 12, 2006
148
149
case "$host" in
Jul 18, 2007
Jul 18, 2007
150
151
*-*-darwin*)
jpg_lib=[`find_lib libjpeg.dylib`]
May 12, 2006
May 12, 2006
152
153
;;
*-*-cygwin* | *-*-mingw32*)
Jul 18, 2007
Jul 18, 2007
154
jpg_lib=[`find_lib "jpeg*dll"`]
May 12, 2006
May 12, 2006
155
156
;;
*)
Jul 18, 2007
Jul 18, 2007
157
jpg_lib=[`find_lib "libjpeg.so.[0-9]*"`]
May 12, 2006
May 12, 2006
158
159
;;
esac
May 1, 2006
May 1, 2006
160
161
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
162
163
164
AC_MSG_WARN([JPG image loading disabled])
fi
fi
May 1, 2006
May 1, 2006
165
Aug 10, 2000
Aug 10, 2000
166
if test x$enable_png = xyes; then
Jul 18, 2007
Jul 18, 2007
167
168
169
AC_CHECK_HEADER([png.h], [have_png_hdr=yes])
AC_CHECK_LIB([png], [png_create_read_struct], [have_png_lib=yes])
if test x$have_png_hdr = xyes -a x$have_png_lib = xyes; then
May 1, 2006
May 1, 2006
170
AC_DEFINE([LOAD_PNG])
May 12, 2006
May 12, 2006
171
172
case "$host" in
Jul 18, 2007
Jul 18, 2007
173
174
*-*-darwin*)
png_lib=[`find_lib libpng.dylib`]
May 12, 2006
May 12, 2006
175
176
;;
*-*-cygwin* | *-*-mingw32*)
Jul 18, 2007
Jul 18, 2007
177
png_lib=[`find_lib "png*dll"`]
May 12, 2006
May 12, 2006
178
179
;;
*)
Jul 18, 2007
Jul 18, 2007
180
png_lib=[`find_lib "libpng.so.[0-9]*"`]
May 12, 2006
May 12, 2006
181
182
;;
esac
Aug 10, 2000
Aug 10, 2000
183
else
May 1, 2006
May 1, 2006
184
AC_MSG_WARN([*** Unable to find PNG library (http://www.libpng.org/pub/png/libpng.html)])
Aug 10, 2000
Aug 10, 2000
185
186
187
AC_MSG_WARN([PNG image loading disabled])
fi
fi
May 1, 2006
May 1, 2006
188
Aug 10, 2000
Aug 10, 2000
189
if test x$enable_tif = xyes; then
Jul 18, 2007
Jul 18, 2007
190
191
192
AC_CHECK_HEADER([tiffio.h], [have_tif_hdr=yes])
AC_CHECK_LIB([tiff], [TIFFClientOpen], [have_tif_lib=yes])
if test x$have_tif_hdr = xyes -a x$have_tif_lib = xyes; then
May 1, 2006
May 1, 2006
193
AC_DEFINE([LOAD_TIF])
May 12, 2006
May 12, 2006
194
195
case "$host" in
Jul 18, 2007
Jul 18, 2007
196
197
*-*-darwin*)
tif_lib=[`find_lib libtiff.dylib`]
May 12, 2006
May 12, 2006
198
199
;;
*-*-cygwin* | *-*-mingw32*)
Jul 18, 2007
Jul 18, 2007
200
tif_lib=[`find_lib "tiff*dll"`]
May 12, 2006
May 12, 2006
201
202
;;
*)
Jul 18, 2007
Jul 18, 2007
203
tif_lib=[`find_lib "libtiff.so.[0-9]*"`]
May 12, 2006
May 12, 2006
204
205
;;
esac
Aug 10, 2000
Aug 10, 2000
206
else
May 12, 2006
May 12, 2006
207
AC_MSG_WARN([*** Unable to find Tiff library (http://www.remotesensing.org/libtiff/)])
Aug 10, 2000
Aug 10, 2000
208
209
210
AC_MSG_WARN([TIF image loading disabled])
fi
fi
May 1, 2006
May 1, 2006
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
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
236
if test x$enable_xcf = xyes; then
May 1, 2006
May 1, 2006
237
AC_DEFINE([LOAD_XCF])
Mar 7, 2001
Mar 7, 2001
238
fi
May 1, 2006
May 1, 2006
239
Nov 29, 2000
Nov 29, 2000
240
if test x$enable_xpm = xyes; then
May 1, 2006
May 1, 2006
241
AC_DEFINE([LOAD_XPM])
Nov 29, 2000
Nov 29, 2000
242
fi
May 1, 2006
May 1, 2006
243
Feb 4, 2006
Feb 4, 2006
244
if test x$enable_xv = xyes; then
May 1, 2006
May 1, 2006
245
AC_DEFINE([LOAD_XV])
Feb 4, 2006
Feb 4, 2006
246
fi
May 1, 2006
May 1, 2006
247
Jul 18, 2007
Jul 18, 2007
248
if test x$enable_tif = xyes -a x$have_tif_hdr = xyes -a x$have_tif_lib = xyes; then
May 12, 2006
May 12, 2006
249
250
251
252
253
254
255
256
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=''
fi
Jul 5, 2007
Jul 5, 2007
257
IMG_LIBS="-ltiff -lz $IMG_LIBS"
May 12, 2006
May 12, 2006
258
259
fi
fi
Jul 18, 2007
Jul 18, 2007
260
if test x$enable_jpg = xyes -a x$have_jpg_hdr = xyes -a x$have_jpg_lib = xyes; then
May 12, 2006
May 12, 2006
261
262
263
264
265
266
267
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
Jul 18, 2007
Jul 18, 2007
268
if test x$enable_png = xyes -a x$have_png_hdr = xyes -a x$have_png_lib = xyes; then
May 12, 2006
May 12, 2006
269
270
271
272
273
274
275
276
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
277
278
LIBS="$saved_LIBS"
Jul 18, 2007
Jul 18, 2007
279
280
AC_SUBST([WINDRES])
AC_SUBST([IMG_LIBS])
Aug 10, 2000
Aug 10, 2000
281
282
283
284
285
# Finally create all the generated files
AC_OUTPUT([
Makefile
SDL_image.spec
Aug 23, 2003
Aug 23, 2003
286
SDL_image.qpg
Aug 10, 2000
Aug 10, 2000
287
])