/
configure.in
199 lines (170 loc) · 5.52 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
MINOR_VERSION=2
16
17
18
MICRO_VERSION=5
INTERFACE_AGE=4
BINARY_AGE=5
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)
39
40
dnl Detect the canonical build and host environments
AC_CANONICAL_HOST
41
42
43
44
dnl Setup for automake
AM_INIT_AUTOMAKE(SDL_image, $VERSION)
45
46
dnl Check for tools
47
48
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
49
50
AC_PROG_MAKE_SET
AC_PROG_CC
51
AC_C_INLINE
52
53
54
AC_PROG_INSTALL
dnl The alpha architecture needs special flags for binary portability
55
case "$host" in
56
57
58
alpha*-*-linux*)
CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
;;
59
60
61
*-*-beos*)
ac_default_prefix=/boot/develop/tools/gnupro
;;
62
*-*-cygwin* | *-*-mingw32*)
63
if test "$build" != "$host"; then # cross-compiling
64
# Default cross-compile location
65
ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
66
67
else
# Look for the location of the tools and install there
68
if test "$BUILD_PREFIX" != ""; then
69
70
ac_default_prefix=$BUILD_PREFIX
fi
71
72
fi
;;
73
74
75
esac
dnl Check for SDL
76
SDL_VERSION=1.2.4
77
78
AM_PATH_SDL($SDL_VERSION,
:,
79
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
80
81
)
CFLAGS="$CFLAGS $SDL_CFLAGS"
82
LIBS="$LIBS $SDL_LIBS"
83
saved_LIBS="$LIBS"
84
85
dnl Check command-line options
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
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])
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])
AC_ARG_ENABLE([png], [AC_HELP_STRING([--enable-bmp], [support loading PNG images [default=yes]])],
[], [enable_png=yes])
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])
AC_ARG_ENABLE([tif], [AC_HELP_STRING([--enable-tif], [support loading TIFF images [default=no]])],
[], [enable_tif=no])
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])
if test x$enable_png = xyes || x$enable_tif = xyes; then
AC_CHECK_LIB([z], [uncompress], [
LIBS="-lz $LIBS"
IMG_LIBS="-lz $IMG_LIBS"
])
116
fi
117
118
119
if test x$enable_jpg = xyes || x$enable_tif = xyes; then
AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], [have_libjpeg=yes])
120
if test x$have_libjpeg = xyes; then
121
122
123
124
125
126
127
if test x$enable_jpg = xyes; then
AC_DEFINE(LOAD_JPG)
fi
LIBS="-ljpeg $LIBS"
IMG_LIBS="-ljpeg $IMG_LIBS"
elif test x$enable_jpg = xyes; then
AC_MSG_WARN([*** Unable to find JPEG library (http://www.ijg.org/)])
128
129
130
AC_MSG_WARN([JPG image loading disabled])
fi
fi
131
132
if test x$enable_png = xyes; then
133
134
135
136
AC_CHECK_LIB([png], [png_create_read_struct], [have_libpng=yes])
if test x$have_libpng = xyes; then
AC_DEFINE([LOAD_PNG])
IMG_LIBS="-lpng $IMG_LIBS"
137
else
138
AC_MSG_WARN([*** Unable to find PNG library (http://www.libpng.org/pub/png/libpng.html)])
139
140
141
AC_MSG_WARN([PNG image loading disabled])
fi
fi
142
143
if test x$enable_tif = xyes; then
144
AC_CHECK_LIB([tiff], [TIFFClientOpen], [have_libtiff=yes])
145
if test x$have_libtiff = xyes; then
146
147
AC_DEFINE([LOAD_TIF])
IMG_LIBS="-ltiff $IMG_LIBS"
148
else
149
AC_MSG_WARN([*** Unable to find Tiff library (ftp://ftp.sgi.com/graphics/tiff/)])
150
151
152
AC_MSG_WARN([TIF image loading disabled])
fi
fi
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
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
178
if test x$enable_xcf = xyes; then
179
AC_DEFINE([LOAD_XCF])
180
fi
181
182
if test x$enable_xpm = xyes; then
183
AC_DEFINE([LOAD_XPM])
184
fi
185
186
if test x$enable_xv = xyes; then
187
AC_DEFINE([LOAD_XV])
188
fi
189
190
191
192
LIBS="$saved_LIBS"
AC_SUBST([IMG_LIBS])
193
194
195
196
197
# Finally create all the generated files
AC_OUTPUT([
Makefile
SDL_image.spec
198
SDL_image.qpg
199
])