author | Ryan C. Gordon <icculus@icculus.org> |
Fri, 28 Jun 2002 05:48:41 +0000 | |
changeset 300 | 44170fd5ea40 |
parent 296 | 32658d27c62f |
child 302 | b6fe2b615045 |
permissions | -rw-r--r-- |
213 | 1 |
# Process this file with autoconf to produce a configure script. |
2 |
AC_INIT(physfs.c) |
|
3 |
||
4 |
dnl --------------------------------------------------------------------- |
|
5 |
dnl System/version info |
|
6 |
dnl --------------------------------------------------------------------- |
|
7 |
||
8 |
# Making releases: |
|
9 |
# MICRO_VERSION += 1; |
|
10 |
# INTERFACE_AGE += 1; |
|
11 |
# BINARY_AGE += 1; |
|
12 |
# if any functions have been added, set INTERFACE_AGE to 0. |
|
13 |
# if backwards compatibility has been broken, |
|
14 |
# set BINARY_AGE and INTERFACE_AGE to 0. |
|
15 |
||
16 |
MAJOR_VERSION=0 |
|
17 |
MINOR_VERSION=1 |
|
237
2abc99254366
Upped version to 0.1.6
Ryan C. Gordon <icculus@icculus.org>
parents:
234
diff
changeset
|
18 |
MICRO_VERSION=6 |
213 | 19 |
INTERFACE_AGE=0 |
20 |
BINARY_AGE=0 |
|
21 |
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION |
|
22 |
||
23 |
AC_SUBST(MAJOR_VERSION) |
|
24 |
AC_SUBST(MINOR_VERSION) |
|
25 |
AC_SUBST(MICRO_VERSION) |
|
26 |
AC_SUBST(INTERFACE_AGE) |
|
27 |
AC_SUBST(BINARY_AGE) |
|
28 |
AC_SUBST(VERSION) |
|
29 |
||
30 |
# libtool versioning |
|
31 |
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION |
|
32 |
LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE` |
|
33 |
LT_REVISION=$INTERFACE_AGE |
|
34 |
LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE` |
|
35 |
||
36 |
AC_SUBST(LT_RELEASE) |
|
37 |
AC_SUBST(LT_CURRENT) |
|
38 |
AC_SUBST(LT_REVISION) |
|
39 |
AC_SUBST(LT_AGE) |
|
40 |
||
41 |
dnl Detect the canonical host and target build environment |
|
296
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
42 |
AC_CANONICAL_BUILD |
213 | 43 |
AC_CANONICAL_HOST |
44 |
AC_CANONICAL_TARGET |
|
45 |
||
46 |
dnl Setup for automake |
|
47 |
AM_CONFIG_HEADER(config.h) |
|
48 |
AM_INIT_AUTOMAKE(physfs, $VERSION) |
|
49 |
||
50 |
||
51 |
dnl --------------------------------------------------------------------- |
|
52 |
dnl Compilers and other tools |
|
53 |
dnl --------------------------------------------------------------------- |
|
54 |
||
55 |
AC_PROG_CC |
|
234 | 56 |
AC_PROG_CXX |
213 | 57 |
AC_PROG_INSTALL |
58 |
AC_PROG_LN_S |
|
289
a0bca1a03a54
Can now build shared libraries under BeOS, and probably Cygwin, too.
Ryan C. Gordon <icculus@icculus.org>
parents:
285
diff
changeset
|
59 |
AC_LIBTOOL_WIN32_DLL |
213 | 60 |
AC_PROG_LIBTOOL |
296
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
61 |
AC_CHECK_PROG(we_have_sed, sed, yes, no) |
213 | 62 |
|
63 |
dnl --------------------------------------------------------------------- |
|
64 |
dnl Debug mode? |
|
65 |
dnl --------------------------------------------------------------------- |
|
66 |
||
67 |
AC_ARG_ENABLE(debug, |
|
216
d297da72cd4e
--enable-debug is default.
Ryan C. Gordon <icculus@icculus.org>
parents:
214
diff
changeset
|
68 |
[ --enable-debug enable debug mode [default=yes]], |
d297da72cd4e
--enable-debug is default.
Ryan C. Gordon <icculus@icculus.org>
parents:
214
diff
changeset
|
69 |
, enable_debug=yes) |
213 | 70 |
if test x$enable_debug = xyes; then |
71 |
if test x$ac_cv_prog_cc_g = xyes; then |
|
72 |
CFLAGS="-g -O0" |
|
73 |
else |
|
74 |
CFLAGS="-O0" |
|
75 |
fi |
|
252
5e537265e682
Added -Wall to debug builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
241
diff
changeset
|
76 |
CFLAGS="$CFLAGS -Werror -Wall" |
213 | 77 |
AC_DEFINE(DEBUG) |
78 |
AC_DEFINE(DEBUG_CHATTER) |
|
79 |
else |
|
80 |
CFLAGS="-O2" |
|
81 |
AC_DEFINE(NDEBUG) |
|
82 |
fi |
|
83 |
||
84 |
||
85 |
dnl --------------------------------------------------------------------- |
|
86 |
dnl Build test program? |
|
87 |
dnl --------------------------------------------------------------------- |
|
88 |
||
89 |
AC_ARG_ENABLE(testprog, |
|
90 |
[ --enable-testprog build test program [default=yes]], |
|
91 |
, enable_testprog=yes) |
|
92 |
||
93 |
||
94 |
dnl --------------------------------------------------------------------- |
|
95 |
dnl Checks for libraries. |
|
96 |
dnl --------------------------------------------------------------------- |
|
97 |
||
261
9e1647c75ae0
64-bit _llseek() detection code.
Ryan C. Gordon <icculus@icculus.org>
parents:
252
diff
changeset
|
98 |
dnl !!! FIXME: Not sure how to detect this... |
9e1647c75ae0
64-bit _llseek() detection code.
Ryan C. Gordon <icculus@icculus.org>
parents:
252
diff
changeset
|
99 |
dnl check for 64-bit llseek()... |
9e1647c75ae0
64-bit _llseek() detection code.
Ryan C. Gordon <icculus@icculus.org>
parents:
252
diff
changeset
|
100 |
dnl AC_CHECK_LIB(c, llseek, have_llseek=yes) |
9e1647c75ae0
64-bit _llseek() detection code.
Ryan C. Gordon <icculus@icculus.org>
parents:
252
diff
changeset
|
101 |
if test x$have_llseek = xyes; then |
9e1647c75ae0
64-bit _llseek() detection code.
Ryan C. Gordon <icculus@icculus.org>
parents:
252
diff
changeset
|
102 |
AC_DEFINE(PHYSFS_HAVE_LLSEEK) |
9e1647c75ae0
64-bit _llseek() detection code.
Ryan C. Gordon <icculus@icculus.org>
parents:
252
diff
changeset
|
103 |
fi |
9e1647c75ae0
64-bit _llseek() detection code.
Ryan C. Gordon <icculus@icculus.org>
parents:
252
diff
changeset
|
104 |
|
213 | 105 |
require_zlib="no" |
106 |
||
107 |
dnl Check for zip archiver inclusion... |
|
108 |
AC_ARG_ENABLE(zip, |
|
109 |
[ --enable-zip enable ZIP support [default=yes]], |
|
110 |
, enable_zip=yes) |
|
111 |
if test x$enable_zip = xyes; then |
|
112 |
AC_DEFINE(PHYSFS_SUPPORTS_ZIP) |
|
113 |
require_zlib="yes" |
|
114 |
fi |
|
115 |
||
116 |
||
117 |
dnl Check for zip archiver inclusion... |
|
118 |
AC_ARG_ENABLE(grp, |
|
119 |
[ --enable-grp enable Build Engine GRP support [default=yes]], |
|
120 |
, enable_grp=yes) |
|
121 |
if test x$enable_grp = xyes; then |
|
122 |
AC_DEFINE(PHYSFS_SUPPORTS_GRP) |
|
123 |
fi |
|
124 |
||
125 |
||
126 |
AC_ARG_ENABLE(internal-zlib, |
|
127 |
[ --enable-internal-zlib use included zlib [default=only if needed]], |
|
128 |
, enable_internal_zlib=maybe) |
|
129 |
||
130 |
dnl Check for zlib if needed. |
|
131 |
have_external_zlib="no" |
|
132 |
if test x$enable_internal_zlib != xyes; then |
|
133 |
if test x$require_zlib = xyes; then |
|
134 |
AC_CHECK_HEADER(zlib.h, have_zlib_hdr=yes) |
|
135 |
AC_CHECK_LIB(z, zlibVersion, have_zlib_lib=yes) |
|
136 |
if test x$have_zlib_hdr = xyes -a x$have_zlib_lib = xyes; then |
|
137 |
have_external_zlib="yes" |
|
138 |
fi |
|
139 |
fi |
|
140 |
fi |
|
141 |
||
142 |
AC_MSG_CHECKING([what zlib to use]) |
|
143 |
||
144 |
dnl no zlib is needed at all if we aren't supporting ZIP files. |
|
145 |
if test x$require_zlib = xno; then |
|
146 |
enable_internal_zlib="no" |
|
147 |
enable_external_zlib="no" |
|
148 |
AC_MSG_RESULT([no zlib needed]) |
|
149 |
else |
|
150 |
||
151 |
if test x$enable_internal_zlib = xmaybe; then |
|
152 |
if test x$have_external_zlib = xyes; then |
|
153 |
enable_internal_zlib="no" |
|
154 |
enable_external_zlib="yes" |
|
155 |
else |
|
156 |
enable_internal_zlib="yes" |
|
157 |
enable_external_zlib="no" |
|
158 |
fi |
|
159 |
else |
|
160 |
if test x$enable_internal_zlib = xno -a x$have_external_zlib = xyes; then |
|
161 |
enable_internal_zlib="no" |
|
162 |
enable_external_zlib="yes" |
|
163 |
fi |
|
164 |
fi |
|
165 |
||
166 |
if test x$enable_internal_zlib = xyes; then |
|
167 |
AC_MSG_RESULT([internal zlib]) |
|
168 |
else |
|
169 |
if test x$enable_external_zlib = xyes; then |
|
170 |
AC_MSG_RESULT([external zlib]) |
|
171 |
LIBS="$LIBS -lz" |
|
172 |
else |
|
173 |
AC_MSG_ERROR([Need zlib, but you disabled our copy and have no system lib]) |
|
174 |
fi |
|
175 |
fi |
|
176 |
fi |
|
177 |
||
178 |
||
179 |
dnl determine if we should include readline support... |
|
180 |
AC_ARG_ENABLE(readline, |
|
181 |
[ --enable-readline use GNU readline in test program [default=yes]], |
|
182 |
, enable_readline=yes) |
|
183 |
if test x$enable_readline = xyes; then |
|
184 |
AC_CHECK_HEADER(readline/readline.h, have_readline_hdr=yes) |
|
218
9415dcace296
readline detection fixes by Edward Rudd.
Ryan C. Gordon <icculus@icculus.org>
parents:
216
diff
changeset
|
185 |
AC_CHECK_LIB(readline, readline, have_readline_lib=yes, , -lcurses) |
213 | 186 |
AC_CHECK_HEADER(readline/history.h, have_history_hdr=yes) |
218
9415dcace296
readline detection fixes by Edward Rudd.
Ryan C. Gordon <icculus@icculus.org>
parents:
216
diff
changeset
|
187 |
AC_CHECK_LIB(readline, add_history, have_history_lib=yes, , -lcurses) |
213 | 188 |
if test x$have_readline_hdr = xyes -a x$have_readline_lib = xyes; then |
189 |
if test x$have_history_hdr = xyes -a x$have_history_lib = xyes; then |
|
190 |
AC_DEFINE(PHYSFS_HAVE_READLINE) |
|
218
9415dcace296
readline detection fixes by Edward Rudd.
Ryan C. Gordon <icculus@icculus.org>
parents:
216
diff
changeset
|
191 |
LIBS="$LIBS -lreadline -lcurses" |
213 | 192 |
fi |
193 |
fi |
|
194 |
fi |
|
195 |
||
296
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
196 |
dnl AC_CHECK_HEADER(be/kernel/OS.h, this_is_beos=yes) |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
197 |
AC_MSG_CHECKING([if this is BeOS]) |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
198 |
if test x$build_os = xbeos; then |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
199 |
this_is_beos=yes |
234 | 200 |
LIBS="$LIBS -lroot -lbe" |
296
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
201 |
else |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
202 |
this_is_beos=no |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
203 |
fi |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
204 |
|
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
205 |
AC_MSG_RESULT([$this_is_beos]) |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
206 |
|
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
207 |
this_is_macosx=no |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
208 |
if test x$we_have_sed = xyes; then |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
209 |
AC_MSG_CHECKING([if this is MacOS X]) |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
210 |
x=`echo $build_os |sed "s/darwin.*/darwin/"` |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
211 |
if test x$x = xdarwin -a x$build_vendor = xapple; then |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
212 |
this_is_macosx=yes |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
213 |
fi |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
214 |
|
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
215 |
AC_MSG_RESULT([$this_is_macosx]) |
234 | 216 |
fi |
213 | 217 |
|
218 |
# Checks for header files. |
|
219 |
AC_HEADER_STDC |
|
220 |
AC_CHECK_HEADERS([stdlib.h string.h]) |
|
221 |
||
222 |
# Checks for typedefs, structures, and compiler characteristics. |
|
269
d41c0a399a99
Removed some unnecessary things that broke BeOS builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
261
diff
changeset
|
223 |
dnl AC_C_CONST |
d41c0a399a99
Removed some unnecessary things that broke BeOS builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
261
diff
changeset
|
224 |
dnl AC_TYPE_SIZE_T |
213 | 225 |
|
226 |
# Checks for library functions. |
|
227 |
||
228 |
# This is only in the bleeding edge autoconf distro... |
|
229 |
#AC_FUNC_MALLOC |
|
230 |
||
231 |
AC_FUNC_MEMCMP |
|
232 |
AC_CHECK_FUNCS([memset strrchr]) |
|
233 |
||
234 |
dnl Add Makefile conditionals |
|
235 |
AM_CONDITIONAL(BUILD_ZLIB, test x$enable_internal_zlib = xyes) |
|
236 |
AM_CONDITIONAL(BUILD_TEST_PHYSFS, test x$enable_testprog = xyes) |
|
241
9353a112793f
Only attempt to build BeOS code on BeOS (don't even try building an empty
Ryan C. Gordon <icculus@icculus.org>
parents:
237
diff
changeset
|
237 |
AM_CONDITIONAL(BUILD_BEOS_CPP, test x$this_is_beos = xyes) |
296
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
238 |
AM_CONDITIONAL(BUILD_MACOSX, test x$this_is_macosx = xyes) |
213 | 239 |
|
289
a0bca1a03a54
Can now build shared libraries under BeOS, and probably Cygwin, too.
Ryan C. Gordon <icculus@icculus.org>
parents:
285
diff
changeset
|
240 |
LDFLAGS="$LDFLAGS -no-undefined" |
a0bca1a03a54
Can now build shared libraries under BeOS, and probably Cygwin, too.
Ryan C. Gordon <icculus@icculus.org>
parents:
285
diff
changeset
|
241 |
|
213 | 242 |
AC_OUTPUT([ |
243 |
Makefile |
|
296
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
244 |
archivers/Makefile |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
245 |
platform/Makefile |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
246 |
zlib114/Makefile |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
247 |
test/Makefile |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
248 |
extras/Makefile |
213 | 249 |
]) |
231
e4f81b0f1c93
Corrected to fix "make dist".
Ryan C. Gordon <icculus@icculus.org>
parents:
224
diff
changeset
|
250 |
|
296
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
251 |
dnl end of configure.in ... |
32658d27c62f
Build system should now work everywhere, including older autoconfs. I hope.
Ryan C. Gordon <icculus@icculus.org>
parents:
289
diff
changeset
|
252 |