Skip to content

Latest commit

 

History

History
290 lines (237 loc) · 7.81 KB

configure.in

File metadata and controls

290 lines (237 loc) · 7.81 KB
 
May 10, 2002
May 10, 2002
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Process this file with autoconf to produce a configure script.
AC_INIT(physfs.c)
dnl ---------------------------------------------------------------------
dnl System/version info
dnl ---------------------------------------------------------------------
# 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=0
MINOR_VERSION=1
Jul 10, 2002
Jul 10, 2002
18
MICRO_VERSION=7
May 10, 2002
May 10, 2002
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
INTERFACE_AGE=0
BINARY_AGE=0
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)
dnl Detect the canonical host and target build environment
Jun 28, 2002
Jun 28, 2002
42
AC_CANONICAL_BUILD
May 10, 2002
May 10, 2002
43
44
45
46
47
48
49
50
51
52
53
54
55
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
dnl Setup for automake
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(physfs, $VERSION)
dnl ---------------------------------------------------------------------
dnl Compilers and other tools
dnl ---------------------------------------------------------------------
AC_PROG_CC
May 24, 2002
May 24, 2002
56
AC_PROG_CXX
May 10, 2002
May 10, 2002
57
58
AC_PROG_INSTALL
AC_PROG_LN_S
Jun 15, 2002
Jun 15, 2002
59
AC_LIBTOOL_WIN32_DLL
Jun 28, 2002
Jun 28, 2002
60
61
LIBTOOL="libtool"
AM_PROG_LIBTOOL
Jun 28, 2002
Jun 28, 2002
62
AC_CHECK_PROG(we_have_sed, sed, yes, no)
May 10, 2002
May 10, 2002
63
64
65
66
67
68
dnl ---------------------------------------------------------------------
dnl Debug mode?
dnl ---------------------------------------------------------------------
AC_ARG_ENABLE(debug,
May 10, 2002
May 10, 2002
69
70
[ --enable-debug enable debug mode [default=yes]],
, enable_debug=yes)
May 10, 2002
May 10, 2002
71
72
73
74
75
76
if test x$enable_debug = xyes; then
if test x$ac_cv_prog_cc_g = xyes; then
CFLAGS="-g -O0"
else
CFLAGS="-O0"
fi
Jun 2, 2002
Jun 2, 2002
77
CFLAGS="$CFLAGS -Werror -Wall"
Jul 11, 2002
Jul 11, 2002
78
79
AC_DEFINE([DEBUG], 1, [define if debug build is enabled])
AC_DEFINE([DEBUG_CHATTER], 1, [define if debug chatter is enabled])
May 10, 2002
May 10, 2002
80
81
else
CFLAGS="-O2"
Jul 11, 2002
Jul 11, 2002
82
AC_DEFINE([NDEBUG], 1, [define if debug build is disabled])
May 10, 2002
May 10, 2002
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
fi
dnl ---------------------------------------------------------------------
dnl Build test program?
dnl ---------------------------------------------------------------------
AC_ARG_ENABLE(testprog,
[ --enable-testprog build test program [default=yes]],
, enable_testprog=yes)
dnl ---------------------------------------------------------------------
dnl Checks for libraries.
dnl ---------------------------------------------------------------------
Jun 6, 2002
Jun 6, 2002
99
100
101
102
dnl !!! FIXME: Not sure how to detect this...
dnl check for 64-bit llseek()...
dnl AC_CHECK_LIB(c, llseek, have_llseek=yes)
if test x$have_llseek = xyes; then
Jul 11, 2002
Jul 11, 2002
103
AC_DEFINE([PHYSFS_HAVE_LLSEEK], 1, [define if we have llseek])
Jun 6, 2002
Jun 6, 2002
104
105
fi
Jul 20, 2002
Jul 20, 2002
106
107
108
109
110
111
112
113
114
115
116
117
118
dnl BSD systems use sys/ucred.h for getting mounted volumes.
dnl Linux and others use mntent.h.
AC_CHECK_HEADER(sys/ucred.h, have_ucred_hdr=yes)
if test x$have_ucred_hdr = xyes; then
AC_DEFINE([PHYSFS_HAVE_SYS_UCRED_H], 1, [define if we have sys/ucred.h])
fi
AC_CHECK_HEADER(mntent.h, have_mntent_hdr=yes)
if test x$have_mntent_hdr = xyes; then
AC_DEFINE([PHYSFS_HAVE_MNTENT_H], 1, [define if we have mntent.h])
fi
May 10, 2002
May 10, 2002
119
120
121
122
123
124
125
require_zlib="no"
dnl Check for zip archiver inclusion...
AC_ARG_ENABLE(zip,
[ --enable-zip enable ZIP support [default=yes]],
, enable_zip=yes)
if test x$enable_zip = xyes; then
Jul 11, 2002
Jul 11, 2002
126
AC_DEFINE([PHYSFS_SUPPORTS_ZIP], 1, [define if zip support is enabled])
May 10, 2002
May 10, 2002
127
128
129
130
131
132
133
134
135
require_zlib="yes"
fi
dnl Check for zip archiver inclusion...
AC_ARG_ENABLE(grp,
[ --enable-grp enable Build Engine GRP support [default=yes]],
, enable_grp=yes)
if test x$enable_grp = xyes; then
Jul 11, 2002
Jul 11, 2002
136
AC_DEFINE([PHYSFS_SUPPORTS_GRP], 1, [define if grp support is enabled])
May 10, 2002
May 10, 2002
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
fi
AC_ARG_ENABLE(internal-zlib,
[ --enable-internal-zlib use included zlib [default=only if needed]],
, enable_internal_zlib=maybe)
dnl Check for zlib if needed.
have_external_zlib="no"
if test x$enable_internal_zlib != xyes; then
if test x$require_zlib = xyes; then
AC_CHECK_HEADER(zlib.h, have_zlib_hdr=yes)
AC_CHECK_LIB(z, zlibVersion, have_zlib_lib=yes)
if test x$have_zlib_hdr = xyes -a x$have_zlib_lib = xyes; then
have_external_zlib="yes"
fi
fi
fi
AC_MSG_CHECKING([what zlib to use])
dnl no zlib is needed at all if we aren't supporting ZIP files.
if test x$require_zlib = xno; then
enable_internal_zlib="no"
enable_external_zlib="no"
AC_MSG_RESULT([no zlib needed])
else
if test x$enable_internal_zlib = xmaybe; then
if test x$have_external_zlib = xyes; then
enable_internal_zlib="no"
enable_external_zlib="yes"
else
enable_internal_zlib="yes"
enable_external_zlib="no"
fi
else
if test x$enable_internal_zlib = xno -a x$have_external_zlib = xyes; then
enable_internal_zlib="no"
enable_external_zlib="yes"
fi
fi
if test x$enable_internal_zlib = xyes; then
AC_MSG_RESULT([internal zlib])
else
if test x$enable_external_zlib = xyes; then
AC_MSG_RESULT([external zlib])
LIBS="$LIBS -lz"
else
AC_MSG_ERROR([Need zlib, but you disabled our copy and have no system lib])
fi
fi
fi
dnl determine if we should include readline support...
AC_ARG_ENABLE(readline,
[ --enable-readline use GNU readline in test program [default=yes]],
, enable_readline=yes)
if test x$enable_readline = xyes; then
AC_CHECK_HEADER(readline/readline.h, have_readline_hdr=yes)
May 16, 2002
May 16, 2002
199
AC_CHECK_LIB(readline, readline, have_readline_lib=yes, , -lcurses)
May 10, 2002
May 10, 2002
200
AC_CHECK_HEADER(readline/history.h, have_history_hdr=yes)
May 16, 2002
May 16, 2002
201
AC_CHECK_LIB(readline, add_history, have_history_lib=yes, , -lcurses)
May 10, 2002
May 10, 2002
202
203
if test x$have_readline_hdr = xyes -a x$have_readline_lib = xyes; then
if test x$have_history_hdr = xyes -a x$have_history_lib = xyes; then
Jul 11, 2002
Jul 11, 2002
204
AC_DEFINE([PHYSFS_HAVE_READLINE], 1, [define if we have readline])
May 16, 2002
May 16, 2002
205
LIBS="$LIBS -lreadline -lcurses"
May 10, 2002
May 10, 2002
206
207
208
209
fi
fi
fi
Jun 28, 2002
Jun 28, 2002
210
211
212
213
dnl AC_CHECK_HEADER(be/kernel/OS.h, this_is_beos=yes)
AC_MSG_CHECKING([if this is BeOS])
if test x$build_os = xbeos; then
this_is_beos=yes
May 24, 2002
May 24, 2002
214
LIBS="$LIBS -lroot -lbe"
Jun 28, 2002
Jun 28, 2002
215
216
217
218
219
220
else
this_is_beos=no
fi
AC_MSG_RESULT([$this_is_beos])
Jun 29, 2002
Jun 29, 2002
221
222
223
224
225
226
227
228
229
230
AC_MSG_CHECKING([if this is Cygwin])
if test x$build_os = xcygwin; then
this_is_cygwin=yes
CFLAGS="$CFLAGS -DWIN32"
else
this_is_cygwin=no
fi
AC_MSG_RESULT([$this_is_cygwin])
Jun 28, 2002
Jun 28, 2002
231
232
233
234
235
236
237
238
239
this_is_macosx=no
if test x$we_have_sed = xyes; then
AC_MSG_CHECKING([if this is MacOS X])
x=`echo $build_os |sed "s/darwin.*/darwin/"`
if test x$x = xdarwin -a x$build_vendor = xapple; then
this_is_macosx=yes
fi
AC_MSG_RESULT([$this_is_macosx])
May 24, 2002
May 24, 2002
240
fi
May 10, 2002
May 10, 2002
241
Jul 17, 2002
Jul 17, 2002
242
243
244
245
246
247
this_is_freebsd=no
if test x$we_have_sed = xyes; then
AC_MSG_CHECKING([if this is FreeBSD])
x=`echo $build_os |tr A-Z a-z |sed "s/.*freebsd.*/freebsd/"`
if test x$x = xfreebsd; then
this_is_freebsd=yes
Jul 21, 2002
Jul 21, 2002
248
LDFLAGS="$LDFLAGS -pthread"
Jul 17, 2002
Jul 17, 2002
249
250
251
252
253
fi
AC_MSG_RESULT([$this_is_freebsd])
fi
May 10, 2002
May 10, 2002
254
255
256
257
258
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
Jun 8, 2002
Jun 8, 2002
259
260
dnl AC_C_CONST
dnl AC_TYPE_SIZE_T
May 10, 2002
May 10, 2002
261
262
263
264
265
266
267
268
269
# Checks for library functions.
# This is only in the bleeding edge autoconf distro...
#AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_CHECK_FUNCS([memset strrchr])
Jul 17, 2002
Jul 17, 2002
270
271
272
CFLAGS="$CFLAGS -D_REENTRANT -D_THREAD_SAFE"
LDFLAGS="$LDFLAGS -no-undefined"
May 10, 2002
May 10, 2002
273
274
275
dnl Add Makefile conditionals
AM_CONDITIONAL(BUILD_ZLIB, test x$enable_internal_zlib = xyes)
AM_CONDITIONAL(BUILD_TEST_PHYSFS, test x$enable_testprog = xyes)
Jun 28, 2002
Jun 28, 2002
276
AM_CONDITIONAL(BUILD_MACOSX, test x$this_is_macosx = xyes)
Jun 28, 2002
Jun 28, 2002
277
AM_CONDITIONAL(BUILD_BEOS, test x$this_is_beos = xyes)
Jun 29, 2002
Jun 29, 2002
278
AM_CONDITIONAL(BUILD_CYGWIN, test x$this_is_cygwin = xyes)
Jun 28, 2002
Jun 28, 2002
279
May 10, 2002
May 10, 2002
280
281
AC_OUTPUT([
Makefile
Jun 28, 2002
Jun 28, 2002
282
283
284
285
286
archivers/Makefile
platform/Makefile
zlib114/Makefile
test/Makefile
extras/Makefile
May 10, 2002
May 10, 2002
287
])
May 24, 2002
May 24, 2002
288
Jun 28, 2002
Jun 28, 2002
289
dnl end of configure.in ...