4
AC_COPYRIGHT([Guido Draheim <guido@gmx.de> for ZZipLib.SF.net])
5
AC_REVISION($Revision: 0.0$)
6
ln -s . uses # _AC_CONFIG_AUX_DIR(uses)
7
# =======================================================================
10
AC_SET_DEFAULT_PATHS_SYSTEM
11
# -----------------------------------------------------------------------
12
AC_ARG_ENABLE(thread-safe,AC_HELP_STRING([--disable-thread-safe],
13
[disable thread-safe libtool option]),, with_thread_safe="yes")
15
test "$with_thread_safe" = "yes" && THREAD_SAFE="-thread-safe"
16
test "$with_thread_safe" = "$host_os" && THREAD_SAFE="-thread-safe"
18
if test -n "$THREAD_SAFE" ; then
19
AC_MSG_RESULT(...using thread-safe linkage)
21
AC_MSG_RESULT(disabled thread-safe linkage)
23
# ----------------------------------------------------------------
24
AC_MSG_CHECKING(zlib install prefix)
25
AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib],
26
[zlib prefix (e.g. '$HOME/software')]), , [with_zlib="no"])
27
if test "${with_zlib}" = yes ; then # choose --prefix paths
28
if test "${prefix}" = NONE ; then
29
AC_MSG_RESULT(oops, but only itself...)
30
AC_MSG_ERROR(--with-zlib requires a path argument or a --prefix path set)
35
if test ".$with_zlib" = ".no" ; then
37
elif test ".$with_zlib" = "./usr" ; then
38
AC_MSG_RESULT([oops, ignored (may try --with-zlib=/usr/.)])
40
if test ! -d "$with_zlib/include" ; then
41
AC_MSG_RESULT(oops, given but...)
42
AC_MSG_ERROR("$with_zlib/include" is not a directory)
44
if test ! -d "$with_zlib/lib" ; then
45
AC_MSG_RESULT(oops, given but...)
46
AC_MSG_ERROR("$with_zlib/lib" is not a directory)
48
CPPFLAGS="$CPPFLAGS -I$with_zlib/include"
49
LDFLAGS="$LDFLAGS -L$with_zlib/lib"
50
AC_MSG_RESULT($with_zlib)
51
AC_MSG_RESULT(..adding CPPFLAGS -I$with_zlib/include)
52
AC_MSG_RESULT(..adding LDFLAGS -L$with_zlib/include)
54
# -----------------------------------------------------------------------
55
AC_SPEC_PACKAGE_VERSION(zziplib.spec)
56
AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
62
AC_SET_RELEASEINFO_VERSIONINFO
64
# -----------------------------------------------------------------------
65
AC_MSG_RESULT([creating zzip-msvc.in via zzip-msvc.sed of config.h.in])
66
sed -f zzip-msvc.sed config.h.in >zzip-msvc.in
67
AM_CONFIG_HEADER(config.h)
68
AX_PREFIX_CONFIG_H([zzip-config.h],[zzip])
69
AX_PREFIX_CONFIG_H([zzip-msvc.h],[zzip],[zzip-msvc.in])
72
AC_PATH_PROGS(PERL, perl5 perl, echo no perl found for)
73
AC_PATH_PROGS(PHP, php-standalone php, echo no php found for)
74
AC_PATH_PROGS(MKZIP, zip pkzip, :)
75
AC_PATH_PROGS(XMLTO, xmlto, :)
81
AC_CHECK_HEADERS(stdint.h unistd.h windows.h winnt.h zlib.h sys/int_types.h)
82
AC_CHECK_HEADERS(sys/types.h sys/mman.h sys/stat.h sys/param.h) dnl posix'ish
85
AC_COMPILE_CHECK_SIZEOF(short)
86
AC_COMPILE_CHECK_SIZEOF(int)
87
AC_COMPILE_CHECK_SIZEOF(long)
88
AC_COMPILE_CHECK_SIZEOF(size_t)
89
dnl -------------------------------------------------------------
90
AC_MSG_CHECKING(for zlib being found)
91
if test "_$ac_cv_header_zlib_h" != "_yes" ; then
93
...oops: zlib.h not found - try adding some CPPFLAGS to configure call)
95
...note: and when linkage fails you might also need to set some LDFLAGS)
99
...note: both can be set by specifying the install prefix of the zlib library)
101
...note: via --with-zlib=path ... it will test for -Ipath/include -Lpath/lib)
103
*) if test -d $prefix/include ; then
105
...note: -I$prefix/include is not added to CPPFLAGS automatically and)
107
...note: neither is -L$prefix/lib for LDFLAGS .. both will be if you specify)
109
...note: --with-zlib to configure call, or use --with-zlib=installprefix)
113
AC_MSG_ERROR(zlib.h not found: "zlib" is required to build "$PACKAGE")
117
# ----------------------------------------------------------------
118
AC_MSG_CHECKING(docdir default)
119
AC_ARG_WITH(docdir, AC_HELP_STRING([--with-docdir],
120
[docdir prefix (prefix/share/doc)]), , [with_docdir="no"])
121
case "${with_docdir}" in
122
prefix/*) docdir=` echo "$withval" | sed 's/^prefix/${prefix}'` ;;
123
datadir/*) docdir=` echo "$withval" | sed 's/^datadir/${datadir}'` ;;
124
yes) docdir='${prefix}/doc' ;;
125
no) docdir='${datadir}/doc' ;;
126
/*|\\*|[a-zA-Z]:*) docdir="$with_docdir" ;;
127
*) AC_MSG_RESULT(oops)
128
AC_MSG_ERROR(bad value ${withval} for --with-docdir)
132
AC_MSG_RESULT($docdir)
133
# ----------------------------------------------------------------
134
AC_MSG_CHECKING(whether io-wrap needs to wrap system calls)
135
AC_ARG_WITH(wrapwrap, AC_HELP_STRING([--with-wrapwrap],
136
[io-wrap needs to wrap systemcalls (no)]), , [with_wrapwrap="auto"])
137
case "$with_wrapwrap" in
138
yes|no) WRAPWRAP="$with_wrapwrap" ;;
140
if test "$ac_cv_sizeof_size_t" != "$ac_cv_sizeof_int"
141
then WRAPWRAP="yes" ; else WRAPWRAP="no" ; fi ;;
142
*) AC_MSG_RESULT(oops)
143
AC_MSG_ERROR(bad value $with_wrapwrap for --with-wrapwrap) ;;
145
if test "$WRAPWRAP" = "yes" ; then
146
AC_DEFINE(WRAPWRAP, 1, [io-wrap needs to wrap systemcalls])
148
AC_MSG_RESULT($WRAPWRAP)
149
# ----------------------------------------------------------------
150
AC_MSG_CHECKING(whether using debugging messages in libraries)
151
AC_ARG_WITH(debug, AC_HELP_STRING([--with-debug],
152
[debug messages in library]),
153
[case "${withval}" in
154
yes|no) with_debug="$withval" ;;
155
*) AC_MSG_RESULT(oops)
156
AC_MSG_ERROR(bad value ${withval} for --with-debug) ;;
157
esac], [with_debug="no"])
158
test "$with_debug" != "yes" && with_debug="no" # yes or no
159
test "$with_debug" = "yes" && export CFLAGS="$CFLAGS -DDEBUG"
160
result="$with_debug" ; test "$result" = "yes" && result="yes, added -DDEBUG"
161
AC_MSG_RESULT($result)
162
if test "$with_debug" = "yes" ; then if test -n "$RELEASEINFO" ; then
163
RELEASEINFO="$RELEASEINFO-dbg"
164
AC_MSG_RESULT(modified release, $RELEASEINFO)
166
# ----------------------------------------------------------------
167
AC_MSG_CHECKING(whether thread stack is too small for bufsiz buffers)
168
# many embedded platforms, superthreaded systems and kernel usage
169
# will severely limit the stackspace for its threads. Use _LOWSTK
170
# compile-define on those platforms.
171
AC_ARG_WITH(lowstk, AC_HELP_STRING([--with-lowstk],
172
[limited thread stack]),
173
[case "${withval}" in
174
yes|no|auto) with_lowstk="$withval" ;;
175
*) AC_MSG_ERROR(bad value ${withval} for --with-lowstk) ;;
176
esac], [with_lowstk="auto"])
177
if test "$with_lowstk" = "auto"; then
179
*-palmos-*) $with_lowstk="yes" ;;
182
test "$with_lowstk" != "yes" && with_lowstk="no" # yes or no
183
test "$with_lowstk" = "yes" && CFLAGS="$CFLAGS -D_LOWSTK"
184
result="$with_lowstk" ; test "$result" = "yes" && result="yes, added -D_LOWSTK"
185
AC_MSG_RESULT($with_lowstk)
186
# ---------------------------------------------------------------
187
AC_MSG_CHECKING(whether can use mmap for file scanning)
188
# system with mmap are probably better performing an searching
189
# and parsing - atleast memory consumption is far better
190
AC_ARG_ENABLE(mmap, AC_HELP_STRING([--disable-mmap],
191
[disable mmap usage]),
192
[case "${enableval}" in
193
yes|no|auto) enable_mmap="${enableval}" ;;
194
*) AC_MSG_RESULT(oops)
195
AC_MSG_ERROR(bad value ${enableval} for --disable-mmap) ;;
196
esac], [enable_mmap="auto"])
197
if test "$enable_mmap" = "auto"
199
test "$ac_cv_header_winbase_h" && enable_mmap="yes, winbase.h"
200
test "$ac_cv_header_sys_mman_h" && enable_mmap="yes, sys/mman.h"
202
case "$enable_mmap" in
203
yes|yes,*) CFLAGS="$CFLAGS -D_USE_MMAP"
204
AC_MSG_RESULT($enable_mmap, added -D_USE_MMAP) ;;
206
AC_MSG_RESULT(no (just a bit slower)) ;;
208
# ---------------------------------------------------------------
209
AC_MSG_CHECKING(running extra tests on make check)
210
if test "MKZIP" != ":" ; then
218
# ---------------------------------------------------------------
219
test "$GCC" = "yes" && CFLAGS="$CFLAGS -Wall"
221
# ---------------------------------------------------------------
222
AC_MSG_CHECKING(link options)
225
ZZIPLIB_LDFLAGS="-no-undefined -export-all-symbols -mconsole"
229
ZZIPLIB_LDFLAGS="--export-dynamic"
233
AC_MSG_RESULT([$ZZIPLIB_LDFLAGS $RESOLVES])
234
AC_SUBST([ZZIPLIB_LDFLAGS])
236
# ---------------------------------------------------------------
237
AC_MSG_CHECKING(maintainer mode)
238
if test "$USE_MAINTAINER_MODE" = "no" ; then
239
LIBTOOL="$LIBTOOL --silent"
240
test -z "$TIMEOUT" && TIMEOUT="99"
242
AUTOHEADER="$T ; true ERROR: CALL TO AUTOHEADER BUT NO MAINTAINER-MODE"
243
AUTOMAKE="$T ; true ERROR: CALL TO AUTOMAKE BUT NO MAINTAINER-MODE"
244
AUTOCONF="$T ; true ERROR: CALL TO AUTOCONF BUT NO MAINTAINER-MODE"
245
result="libtool-silent, autotools-sleep-$TIMEOUT"
249
AC_MSG_RESULT([$result])
250
# ---------------------------------------------------------------
252
AX_CFLAGS_NO_WRITABLE_STRINGS
253
AX_CFLAGS_STRICT_PROTOTYPES
254
# ---------------------------------------------------------------
255
AC_SUBST([CONFIG_FILES])
256
AC_OUTPUT([Makefile zzip-config])
257
dnl -------------------------------------------------------------
258
PATCH_LIBTOOL_ON_DARWIN_ZSH_OVERQUOTING
259
PATCH_LIBTOOL_SYS_LIB_SEARCH_PATH_SPEC
260
PATCH_LIBTOOL_TO_ADD_HOST_CC
261
# ---------------------------------------------------------------
262
echo '-----' $PACKAGE $VERSION $prefix
263
$SHELL libtool --features || true
264
test "$enable_mmap" != "no" && echo "enable mmap ($enable_mmap)"
265
test "$enable_mmap" = "no" && echo "disable mmap ($enable_mmap)"
266
test "$with_lowstk" != "no" && echo "with lowstk ($with_lowstk)"
267
test "$with_lowstk" = "no" && echo "without lowstk ($with_lowstk)"
268
test "$with_debug" != "no" && echo "with debug ($with_debug)"
269
test "$with_debug" = "no" && echo "without debug ($with_debug)"
270
echo '# make && make check && make install'