79
77
AM_PATH_SDL($SDL_VERSION,
81
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
79
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
83
81
CFLAGS="$CFLAGS $SDL_CFLAGS"
84
82
LIBS="$LIBS $SDL_LIBS"
86
85
dnl Check command-line options
88
[ --enable-bmp support loading BMP images [default=yes]],
86
AC_ARG_ENABLE([bmp], [AC_HELP_STRING([--enable-bmp], [support loading BMP images [default=yes]])],
88
AC_ARG_ENABLE([gif], [AC_HELP_STRING([--enable-gif], [support loading GIF images [default=yes]])],
90
AC_ARG_ENABLE([jpg], [AC_HELP_STRING([--enable-jpg], [support loading JPG images [default=yes]])],
92
AC_ARG_ENABLE([jpg-shared], AC_HELP_STRING([--enable-jpg-shared], [dynamically load JPG support [[default=yes]]]),
93
[], [enable_jpg_shared=yes])
94
AC_ARG_ENABLE([lbm], [AC_HELP_STRING([--enable-lbm], [support loading LBM images [default=yes]])],
96
AC_ARG_ENABLE([pcx], [AC_HELP_STRING([--enable-pcx], [support loading PCX images [default=yes]])],
98
AC_ARG_ENABLE([png], [AC_HELP_STRING([--enable-png], [support loading PNG images [default=yes]])],
100
AC_ARG_ENABLE([png-shared], AC_HELP_STRING([--enable-png-shared], [dynamically load PNG support [[default=yes]]]),
101
[], [enable_png_shared=yes])
102
AC_ARG_ENABLE([pnm], [AC_HELP_STRING([--enable-pnm], [support loading PNM images [default=yes]])],
103
[], [enable_pnm=yes])
104
AC_ARG_ENABLE([tga], [AC_HELP_STRING([--enable-tga], [support loading TGA images [default=yes]])],
105
[], [enable_tga=yes])
106
AC_ARG_ENABLE([tif], [AC_HELP_STRING([--enable-tif], [support loading TIFF images [default=yes]])],
107
[], [enable_tif=yes])
108
AC_ARG_ENABLE([tif-shared], AC_HELP_STRING([--enable-tif-shared], [dynamically load TIFF support [[default=yes]]]),
109
[], [enable_tif_shared=yes])
110
AC_ARG_ENABLE([xcf], [AC_HELP_STRING([--enable-xcf], [support loading XCF images [default=yes]])],
111
[], [enable_xcf=yes])
112
AC_ARG_ENABLE([xpm], [AC_HELP_STRING([--enable-xpm], [support loading XPM images [default=yes]])],
113
[], [enable_xpm=yes])
114
AC_ARG_ENABLE([xv], [AC_HELP_STRING([--enable-xv], [support loading XV images [default=yes]])],
117
if test x$enable_png = xyes || test x$enable_tif = xyes; then
118
AC_CHECK_LIB([z], [uncompress], [
123
if test x$enable_jpg = xyes || test x$enable_tif = xyes; then
124
AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], [have_libjpeg=yes])
125
if test x$have_libjpeg = xyes; then
126
if test x$enable_jpg = xyes; then
132
*-*-darwin*) # FIXME when Mac OS X ships with libjpeg
135
*-*-cygwin* | *-*-mingw32*)
139
for path in /usr/lib /usr/local/lib; do
140
if test x$jpg_lib = x; then
141
jpg_lib=[`ls -- $path/libjpeg.so.[0-9][0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
146
elif test x$enable_jpg = xyes; then
147
AC_MSG_WARN([*** Unable to find JPEG library (http://www.ijg.org/)])
148
AC_MSG_WARN([JPG image loading disabled])
152
if test x$enable_png = xyes; then
153
AC_CHECK_LIB([png], [png_create_read_struct], [have_libpng=yes])
154
if test x$have_libpng = xyes; then
155
AC_DEFINE([LOAD_PNG])
158
*-*-darwin*) # FIXME when Mac OS X ships with libpng
161
*-*-cygwin* | *-*-mingw32*)
162
png_lib='libpng13.dll'
165
for path in /usr/lib /usr/local/lib; do
166
if test x$png_lib = x; then
167
png_lib=[`ls -- $path/libpng.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
173
AC_MSG_WARN([*** Unable to find PNG library (http://www.libpng.org/pub/png/libpng.html)])
174
AC_MSG_WARN([PNG image loading disabled])
178
if test x$enable_tif = xyes; then
179
AC_CHECK_LIB([tiff], [TIFFClientOpen], [have_libtiff=yes])
180
if test x$have_libtiff = xyes; then
181
AC_DEFINE([LOAD_TIF])
184
*-*-darwin*) # FIXME when Mac OS X ships with libtiff
187
*-*-cygwin* | *-*-mingw32*)
188
tif_lib='libtiff.dll'
191
for path in /usr/lib /usr/local/lib; do
192
if test x$tif_lib = x; then
193
tif_lib=[`ls -- $path/libtiff.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
199
AC_MSG_WARN([*** Unable to find Tiff library (http://www.remotesensing.org/libtiff/)])
200
AC_MSG_WARN([TIF image loading disabled])
90
204
if test x$enable_bmp = xyes; then
91
CFLAGS="$CFLAGS -DLOAD_BMP"
205
AC_DEFINE([LOAD_BMP])
94
[ --enable-gif support loading GIF images [default=yes]],
96
208
if test x$enable_gif = xyes; then
97
CFLAGS="$CFLAGS -DLOAD_GIF"
100
[ --enable-jpg support loading JPG images [default=yes]],
102
if test x$enable_jpg = xyes; then
103
AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, have_libjpeg=yes)
104
if test x$have_libjpeg = xyes; then
105
CFLAGS="$CFLAGS -DLOAD_JPG"
106
IMG_LIBS="$IMG_LIBS -ljpeg"
109
*** Unable to find JPEG library (http://www.ijg.org/)
111
AC_MSG_WARN([JPG image loading disabled])
115
[ --enable-lbm support loading LBM images [default=yes]],
209
AC_DEFINE([LOAD_GIF])
117
212
if test x$enable_lbm = xyes; then
118
CFLAGS="$CFLAGS -DLOAD_LBM"
213
AC_DEFINE([LOAD_LBM])
121
[ --enable-pcx support loading PCX images [default=yes]],
123
216
if test x$enable_pcx = xyes; then
124
CFLAGS="$CFLAGS -DLOAD_PCX"
127
[ --enable-png support loading PNG images [default=yes]],
129
if test x$enable_png = xyes; then
130
AC_CHECK_LIB(png, png_create_read_struct, have_libpng=yes, , -lz)
131
if test x$have_libpng != xyes; then
133
*** Unable to find PNG library (http://www.libpng.org/pub/png/libpng.html)
136
AC_CHECK_LIB(z, uncompress, have_libz=yes)
137
if test x$have_libz != xyes; then
139
*** Unable to find Zlib library (http://www.gzip.org/zlib/)
142
if test x$have_libpng = xyes -a x$have_libz = xyes; then
143
CFLAGS="$CFLAGS -DLOAD_PNG"
144
IMG_LIBS="$IMG_LIBS -lpng -lz"
146
AC_MSG_WARN([PNG image loading disabled])
150
[ --enable-pnm support loading PNM images [default=yes]],
217
AC_DEFINE([LOAD_PCX])
152
220
if test x$enable_pnm = xyes; then
153
CFLAGS="$CFLAGS -DLOAD_PNM"
221
AC_DEFINE([LOAD_PNM])
156
[ --enable-tga support loading TGA images [default=yes]],
158
224
if test x$enable_tga = xyes; then
159
CFLAGS="$CFLAGS -DLOAD_TGA"
162
[ --enable-tif support loading TIFF images [default=no]],
164
if test x$enable_tif = xyes; then
165
AC_CHECK_LIB(tiff, TIFFClientOpen, have_libtiff=yes)
166
if test x$have_libtiff = xyes; then
167
CFLAGS="$CFLAGS -DLOAD_TIF"
168
IMG_LIBS="$IMG_LIBS -ltiff"
171
*** Unable to find Tiff library (ftp://ftp.sgi.com/graphics/tiff/)
173
AC_MSG_WARN([TIF image loading disabled])
177
[ --enable-xcf support loading XCF images [default=no]],
225
AC_DEFINE([LOAD_TGA])
179
228
if test x$enable_xcf = xyes; then
180
CFLAGS="$CFLAGS -DLOAD_XCF"
229
AC_DEFINE([LOAD_XCF])
183
[ --enable-xpm support loading XPM images [default=yes]],
185
232
if test x$enable_xpm = xyes; then
186
CFLAGS="$CFLAGS -DLOAD_XPM"
233
AC_DEFINE([LOAD_XPM])
236
if test x$enable_xv = xyes; then
240
if test x$enable_tif = xyes; then
241
if test x$enable_tif_shared = xyes && test x$tif_lib != x; then
242
echo "-- dynamic libtiff -> $tif_lib"
243
AC_DEFINE_UNQUOTED(LOAD_TIF_DYNAMIC, "$tif_lib")
245
if test x$have_libjpeg = xyes; then
246
# Disable dynamic jpeg since we're linking it explicitly
248
IMG_LIBS="-ljpeg $IMG_LIBS"
250
IMG_LIBS="-ltiff -lz"
253
if test x$enable_jpg = xyes; then
254
if test x$enable_jpg_shared = xyes && test x$jpg_lib != x; then
255
echo "-- dynamic libjpeg -> $jpg_lib"
256
AC_DEFINE_UNQUOTED(LOAD_JPG_DYNAMIC, "$jpg_lib")
258
IMG_LIBS="-ljpeg $IMG_LIBS"
261
if test x$enable_png = xyes; then
262
if test x$enable_png_shared = xyes && test x$png_lib != x; then
263
echo "-- dynamic libpng -> $png_lib"
264
AC_DEFINE_UNQUOTED(LOAD_PNG_DYNAMIC, "$png_lib")
266
IMG_LIBS="-lpng -lz $IMG_LIBS"
190
274
# Finally create all the generated files