Debian Codegraph @

libs/zziplib/zziplib-src/old.configure.ac

raw
1 AC_INIT([zziplib.spec])
2 AC_PREREQ(2.61)
3 AC_COPYRIGHT([Guido Draheim <[email protected]> for ZZipLib.SF.net])
4 AC_REVISION($Revision: 1.15 $)
5 AC_CONFIG_AUX_DIR([uses])
6 AC_CONFIG_MACRO_DIR([m4])
7 # =======================================================================
8 AC_CANONICAL_SYSTEM
9 dnl AM_ENABLE_MULTILIB([Makefile],[$host])
10 dnl AX_ENABLE_BUILDDIR
11 AC_SET_DEFAULT_PATHS_SYSTEM
12 # -----------------------------------------------------------------------
13 AC_ARG_ENABLE([thread-safe],
14 AS_HELP_STRING([--disable-thread-safe],[disable thread-safe libtool option])
15 ,,[ enable_thread_safe="yes"])
16 THREAD_SAFE=""
17 test "$enable_thread_safe" = "yes" && THREAD_SAFE="-thread-safe"
18 test "$enable_thread_safe" = "$host_os" && THREAD_SAFE="-thread-safe"
19 AC_SUBST(THREAD_SAFE)
20 if test -n "$THREAD_SAFE" ; then
21 AC_MSG_RESULT(...using thread-safe linkage)
22 else
23 AC_MSG_RESULT(disabled thread-safe linkage)
24 fi
25 # ----------------------------------------------------------------
26 AC_MSG_CHECKING(zlib install prefix)
27 AC_ARG_WITH(zlib,
28 AS_HELP_STRING([--with-zlib],[zlib prefix (e.g. '$HOME/software')])
29 ,,[with_zlib="no"])
30 if test "${with_zlib}" = yes ; then # choose --prefix paths
31 if test "${prefix}" = NONE ; then
32 AC_MSG_RESULT([oops, but only itself...])
33 AC_MSG_ERROR(--with-zlib requires a path argument or a --prefix path set)
34 fi
35 with_zlib="$prefix"
36 fi
37
38 case ".$with_zlib" in
39 .no|.no,*)
40 AC_MSG_RESULT(none)
41 with_zlib="no, not configured" ;;
42 ./usr)
43 AC_MSG_RESULT([oops, ignored (may try --with-zlib=/usr/.)])
44 with_zlib="no, /usr ignored" ;;
45 *) if test ! -d "$with_zlib/include" ; then
46 AC_MSG_RESULT([oops, given but...])
47 AC_MSG_ERROR("$with_zlib/include" is not a directory)
48 fi
49 if test ! -d "$with_zlib/lib" ; then
50 AC_MSG_RESULT([oops, given but...])
51 AC_MSG_ERROR("$with_zlib/lib" is not a directory)
52 fi
53 AC_MSG_RESULT($with_zlib)
54 ZLIB_INCL="-I$with_zlib/include"
55 ZLIB_LDIR="-L$with_zlib/lib"
56 AC_MSG_RESULT(..adding CPPFLAGS $ZLIB_INCL)
57 AC_MSG_RESULT(..adding LDFLAGS $ZLIB_LDIR)
58 CPPFLAGS="$CPPFLAGS $ZLIB_INCL"
59 LDFLAGS="$LDFLAGS $ZLIB_LDIR"
60 ;;
61 esac
62 AC_SUBST(ZLIB_INCL)
63 AC_SUBST(ZLIB_LDIR)
64 # -----------------------------------------------------------------------
65 AX_SPEC_DEFAULTS
66 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
67 AX_CHECK_ENABLE_DEBUG()
68 dnl test ".$CFLAGS" = "." && CFLAGS=""
69 AC_PROG_CC
70 dnl test ".$CFLAGS" = "." && test "$GCC" = "yes" && CFLAGS="-O3"
71 AC_PROG_INSTALL
72 AC_LIBTOOL_WIN32_DLL
73 AM_PROG_LIBTOOL
74 AX_SET_VERSION_INFO
75
76 # -----------------------------------------------------------------------
77 AC_MSG_RESULT([creating zzip/_msvc.in via zzip/_msvc.sed of config.h.in])
78 test -d zzip || mkdir zzip
79 sed -f $srcdir/zzip/_msvc.sed $srcdir/config.h.in >zzip/_msvc.in
80 AC_CONFIG_HEADERS([config.h])
81 AX_PREFIX_CONFIG_H([zzip/_config.h],[zzip],[config.h])
82 AX_PREFIX_CONFIG_H([zzip/_msvc.h],[zzip],[zzip/_msvc.in])
83 AM_MAINTAINER_MODE
84
85 AX_CREATE_PKGCONFIG_INFO(dnl
86 [zzip/zziplib.pc], [zzip-zlib-config],[-lzzip],,[ ])
87 # -----------------------------------------------------------------------
88 AX_PAX_TAR_CREATE
89 AX_PAX_TAR_EXTRACT
90 AC_PATH_PROGS(PERL, perl5 perl, echo no perl found for)
91 AC_PATH_PROGS(PYTHON, python3, echo no python found for)
92 AC_PATH_PROGS(MKZIP, zip pkzip, :)
93 AC_PATH_PROGS(XMLTO, xmlto, :)
94
95 AC_C_INLINE
96 AC_C_CONST
97 ACX_C_RESTRICT
98 AC_STDC_HEADERS
99 AC_HEADER_DIRENT
100 AC_CHECK_HEADERS(stdint.h unistd.h windows.h winnt.h winbase.h sys/int_types.h)
101 AC_CHECK_HEADERS(sys/types.h sys/mman.h sys/stat.h sys/param.h) dnl posix'ish
102 AC_CHECK_HEADERS(io.h direct.h zlib.h byteswap.h)
103 AC_CHECK_HEADERS(fnmatch.h)
104 AC_CHECK_FUNCS( strcasecmp strnlen strndup )
105
106 AC_TYPE_OFF_T
107 AC_TYPE_SIZE_T
108 dnl AC_TYPE_SSIZE_T
109 AC_CHECK_TYPE(ssize_t,int)
110 AC_CHECK_TYPE(off64_t,_zzip_off_t)
111 AC_CHECK_TYPE(__int64,long long)
112 if test "xno" = "x$ac_cv_header_stdint_h" ; then
113 AC_COMPILE_CHECK_SIZEOF([short])
114 AC_COMPILE_CHECK_SIZEOF([int])
115 AC_COMPILE_CHECK_SIZEOF([long])
116 AC_COMPILE_CHECK_SIZEOF([int *])
117 fi
118 AC_C_BIGENDIAN
119 AX_CHECK_ALIGNED_ACCESS_REQUIRED
120 dnl -------------------------------------------------------------
121 # the default is _disabled_!! anyway, result is prefixed in zzip/_config.h!!
122 AC_SYS_LARGEFILE_SENSITIVE
123 test ".$LARGEFILE_CFLAGS" = "." && LARGEFILE_CFLAGS=""
124 AC_ARG_WITH(largefile,AC_HELP_STRING(
125 [--with-largefile],[compile as off64_t instead of 32bit off_t])
126 ,,[with_largefile="no"])
127 if test ".$ac_cv_sys_largefile_sensitive" = ".no" ; then
128 AC_MSG_RESULT(compiles library with the only off_t seen)
129 elif test ".$with_largefile" != ".no" ; then
130 AC_MSG_RESULT(compiles library as 64bit off_t variant dnl
131 - and renaming some function names)
132 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGEFILE_SOURCE"
133 AC_MSG_RESULT(..adding CFLAGS $LARGEFILE_CFLAGS)
134 CFLAGS="$CFLAGS $LARGEFILE_CFLAGS"
135 AC_MSG_RESULT(..adding 64 into RELEASE_INFO for the libraries)
136 RELEASE_INFO="$RELEASE_INFO-64"
137 else
138 AC_MSG_RESULT(compiles library as 32bit off_t variant dnl
139 - largefile is not the default here)
140 fi
141 AC_SUBST(LARGEFILE_CFLAGS)
142 dnl -------------------------------------------------------------
143 AC_MSG_CHECKING(for zlib being found)
144 if test "_$ac_cv_header_zlib_h" != "_yes" ; then
145 AC_MSG_RESULT(dnl
146 ...oops: zlib.h not found - try adding some CPPFLAGS to configure call)
147 AC_MSG_RESULT(dnl
148 ...note: and when linkage fails you might also need to set some LDFLAGS)
149 case "$prefix" in
150 NONE|/usr)
151 AC_MSG_RESULT(dnl
152 ...note: both can be set by specifying the install prefix of the zlib library)
153 AC_MSG_RESULT(dnl
154 ...note: via --with-zlib=path ... it will test for -Ipath/include -Lpath/lib)
155 ;;
156 *) if test -d $prefix/include ; then
157 AC_MSG_RESULT(dnl
158 ...note: -I$prefix/include is not added to CPPFLAGS automatically and)
159 AC_MSG_RESULT(dnl
160 ...note: neither is -L$prefix/lib for LDFLAGS .. both will be if you specify)
161 AC_MSG_RESULT(dnl
162 ...note: --with-zlib to configure call, or use --with-zlib=installprefix)
163 fi
164 ;;
165 esac
166 AC_MSG_ERROR(zlib.h not found: "zlib" is required to build "$PACKAGE")
167 exit 1
168 fi
169 cat >conftest.c <<EOF
170 #include <zlib.h>
171 const char* zlib_VeRsIoN = ZLIB_VERSION "dEtEcT";
172 EOF
173 ZLIB_VERSION=`(eval "$ac_cpp conftest.c") 2>/dev/null \
174 | grep zlib_VeRsIoN | sed -e 's,.*= *.,,' -e 's,. *.dEtEcT.*,,'`
175 rm conftest.c
176 AC_SUBST(ZLIB_VERSION)
177 AC_MSG_RESULT(yes - $ZLIB_VERSION)
178 # ----------------------------------------------------------------
179 AC_MSG_CHECKING(docdir default)
180 AC_ARG_WITH(docdir, AC_HELP_STRING(
181 [--with-docdir],[docdir prefix (prefix/share/doc)])
182 ,,[with_docdir="no"])
183 case "${with_docdir}" in
184 prefix/*) docdir=` echo "$withval" | sed 's/^prefix/${prefix}'` ;;
185 datadir/*) docdir=` echo "$withval" | sed 's/^datadir/${datadir}'` ;;
186 yes) docdir='${prefix}/doc' ;;
187 no) docdir='${datadir}/doc' ;;
188 /*|\\*|[a-zA-Z]:*) docdir="$with_docdir" ;;
189 *) AC_MSG_RESULT(oops)
190 AC_MSG_ERROR(bad value ${withval} for --with-docdir)
191 ;;
192 esac
193 AC_SUBST(docdir)
194 AC_MSG_RESULT($docdir)
195 # ----------------------------------------------------------------
196 AC_MSG_CHECKING(whether using debugging messages in libraries)
197 AC_ARG_WITH(debug, AC_HELP_STRING(
198 [--with-debug],[debug messages in library])
199 , [case "${withval}" in
200 yes|no) with_debug="$withval" ;;
201 *) AC_MSG_RESULT(oops)
202 AC_MSG_ERROR(bad value ${withval} for --with-debug) ;;
203 esac], [with_debug="no"])
204 test "$with_debug" != "yes" && with_debug="no" # yes or no
205 test "$with_debug" = "yes" && export CFLAGS="$CFLAGS -DDEBUG"
206 result="$with_debug" ; test "$result" = "yes" && result="yes, added -DDEBUG"
207 AC_MSG_RESULT($result)
208 if test "$with_debug" = "yes" ; then if test -n "$RELEASE_INFO" ; then
209 RELEASE_INFO="$RELEASE_INFO-dbg"
210 AC_MSG_RESULT(modified release, $RELEASE_INFO)
211 fi fi
212 # ----------------------------------------------------------------
213 AC_MSG_CHECKING(whether thread stack is too small for bufsiz buffers)
214 # many embedded platforms, superthreaded systems and kernel usage
215 # will severely limit the stackspace for its threads. Use _LOWSTK
216 # compile-define on those platforms.
217 AC_ARG_WITH(lowstk, AC_HELP_STRING(
218 [--with-lowstk], [limited thread stack])
219 , [case "${withval}" in
220 yes|no|auto) with_lowstk="$withval" ;;
221 *) AC_MSG_ERROR(bad value ${withval} for --with-lowstk) ;;
222 esac], [with_lowstk="auto"])
223 if test "$with_lowstk" = "auto"; then
224 case $target in
225 *-palmos-*) $with_lowstk="yes" ;;
226 esac
227 fi
228 test "$with_lowstk" != "yes" && with_lowstk="no" # yes or no
229 test "$with_lowstk" = "yes" && CFLAGS="$CFLAGS -D_LOWSTK"
230 result="$with_lowstk" ; test "$result" = "yes" && result="yes, added -D_LOWSTK"
231 AC_MSG_RESULT($with_lowstk)
232 # ---------------------------------------------------------------
233 AC_MSG_CHECKING(whether can use mmap for file scanning)
234 # system with mmap are probably better performing an searching
235 # and parsing - atleast memory consumption is far better
236 AC_ARG_ENABLE(mmap, AC_HELP_STRING(
237 [--disable-mmap],[disable mmap usage])
238 , [case "${enableval}" in
239 yes|no|auto) enable_mmap="${enableval}" ;;
240 *) AC_MSG_RESULT(oops)
241 AC_MSG_ERROR(bad value ${enableval} for --disable-mmap) ;;
242 esac], [enable_mmap="auto"])
243 if test "$enable_mmap" = "auto"
244 then
245 test "$ac_cv_header_winbase_h" && enable_mmap="yes, winbase.h"
246 test "$ac_cv_header_sys_mman_h" && enable_mmap="yes, sys/mman.h"
247 fi
248 case "$enable_mmap" in
249 yes|yes,*) CFLAGS="$CFLAGS -D_USE_MMAP"
250 AC_MSG_RESULT($enable_mmap, added -D_USE_MMAP) ;;
251 *) enable_mmap="no"
252 AC_MSG_RESULT(no (just a bit slower)) ;;
253 esac
254 # ---------------------------------------------------------------
255 PKG_PROG_PKG_CONFIG
256 AC_MSG_CHECKING(whether making SDL parts)
257 SDL=""
258 SDL_GENERATE=""
259 AC_ARG_ENABLE(sdl, AC_HELP_STRING(
260 [--enable-sdl],[enable SDL usage (if present)])
261 ,,[enable_sdl="no"])
262 if test "$enable_sdl" = "no" ; then
263 AC_MSG_RESULT([no, disabled])
264 else
265 enable_sdl1=`$PKG_CONFIG --modversion sdl 2>/dev/null`
266 if test -z "$enable_sdl1"; then
267 enable_sdl2=`$PKG_CONFIG --modversion sdl2 2>/dev/null`
268 if test -z "$enable_sdl2"; then
269 enable_sdl3=`sdl-config --version 2>/dev/null`
270 SDL_GENERATE="sdl-uninstalled.pc"
271 enable_sdl="$enable_sdl3 (sdl-config)"
272 else
273 enable_sdl="$enable_sdl2 (pkgconfig sdl2)"
274 fi
275 else
276 enable_sdl="$enable_sdl1 (pkgconfig sdl)"
277 fi
278 enable_sdl="$enable_sdl."
279 case ".$enable_sdl" in
280 .1.*) AC_MSG_RESULT([yes, using SDL $enable_sdl])
281 SDL="SDL" ;;
282 .2.*) AC_MSG_RESULT([yes, untested $enable_sdl])
283 SDL="SDL" ;;
284 *) AC_MSG_RESULT([no, $enable_sdl]) ;;
285 esac
286 if test -n "$SDL_GENERATE"; then
287 AC_MSG_RESULT([enabled SDL generation of... $SDL_GENERATE])
288 fi
289 fi
290 AC_SUBST([SDL])
291 AC_SUBST([SDL_GENERATE])
292
293 # ----------------------------------------------------------------
294 AC_MSG_CHECKING(whether using address sanitizer)
295 AC_ARG_WITH(asan, AC_HELP_STRING(
296 [--with-asan],[compile with adress sanitizer])
297 , [case "${withval}" in
298 yes|no) with_asan="$withval" ;;
299 *) AC_MSG_RESULT(oops)
300 AC_MSG_ERROR(bad value ${withval} for --with-asan) ;;
301 esac], [with_asan="no"])
302 ASAN_LIBS=""
303 ASAN_CFLAGS=""
304 if test ".$with_asan" = ".yes" ; then
305 ASAN_LIBS="-lasan"
306 ASAN_CFLAGS="-fsanitize=address"
307 fi
308 AC_MSG_RESULT([$with_asan, $ASAN_CFLAGS])
309 AC_SUBST([ASAN_LIBS])
310 AC_SUBST([ASAN_CFLAGS])
311 # ---------------------------------------------------------------
312 AC_MSG_CHECKING(running extra tests on make check)
313 if test "MKZIP" != ":" ; then
314 AC_MSG_RESULT(yes)
315 ZIPTESTS=""
316 else
317 AC_MSG_RESULT(no)
318 ZIPTESTS="#"
319 fi
320 AC_SUBST(ZIPTESTS)
321 # ---------------------------------------------------------------
322 AC_MSG_CHECKING([link options])
323 ZZIPLIB_LDFLAGS=""
324 case "$host_os" in mingw*)
325 # we may assume that the backend is gnu-ld but DLLs need full resolution
326 ZZIPLIB_LDFLAGS="${wl}-no-undefined ${wl}-export-all-symbols -mconsole"
327 RESOLVES=' '
328 ;; darwin*)
329 # darwin never uses gnu-ld but the linker can do it anyway
330 ZZIPLIB_LDFLAGS="-export-dynamic"
331 RESOLVES=" # "
332 ;; *)
333 if test ".$can_build_shared" != ".no" ; then
334 ZZIPLIB_LDFLAGS="-export-dynamic"
335 if test ".$lt_cv_prog_gnu_ld" == ".yes" ; then
336 ZZIPLIB_LDFLAGS="${wl}--export-dynamic"
337 # TODO: that is for backward compatibility only
338 fi
339 fi
340 RESOLVES=" # "
341 ;; esac
342 AC_MSG_RESULT([$ZZIPLIB_LDFLAGS $RESOLVES])
343 AC_SUBST([ZZIPLIB_LDFLAGS])
344 AC_SUBST([RESOLVES])
345 AC_ARG_WITH([defines],
346 AS_HELP_STRING([--with-defines],[easy,harden,allow_modulo_entries]),
347 ,[with_defines="normal"])
348
349 #
350 case ",$with_defines," in *,easy,*)
351 AC_MSG_RESULT([..adding CFLAGS -DZZIP_EASY])
352 CFLAGS="$CFLAGS -DZZIP_EASY"
353 ;; esac
354 case ",$with_defines," in *,harden,*)
355 AC_MSG_RESULT([..adding CFLAGS -DZZIP_HARDEN])
356 CFLAGS="$CFLAGS -DZZIP_HARDEN"
357 ;; esac
358 case ",$with_defines," in *,allow_modulo_entries,*)
359 AC_MSG_RESULT([..adding CFLAGS -DZZIP_ALLOW_MODULO_ENTRIES])
360 CFLAGS="$CFLAGS -DZZIP_ALLOW_MODULO_ENTRIES"
361 ;; esac
362
363 # ---------------------------------------------------------------
364 AX_MAINTAINER_MODE_AUTO_SILENT
365 AX_NOT_ENABLE_FRAME_POINTER
366 AX_CFLAGS_WARN_ALL
367 AX_CFLAGS_GCC_OPTION(-Wpointer-arith)
368 AX_CFLAGS_GCC_OPTION(-Wsign-compare)
369 AX_CFLAGS_GCC_OPTION(-Wmissing-declarations)
370 AX_CFLAGS_GCC_OPTION(-Wdeclaration-after-statement)
371 AX_CFLAGS_GCC_OPTION(-Werror-implicit-function-declaration)
372 AX_CFLAGS_GCC_OPTION(-Wstrict-aliasing)
373 AX_CFLAGS_GCC_OPTION(-Warray-bounds)
374 AX_CFLAGS_NO_WRITABLE_STRINGS
375 AX_CFLAGS_STRICT_PROTOTYPES
376 # ---------------------------------------------------------------
377 AX_ENABLE_DEFAULT_PKGCONFIGDIR
378 AX_ENABLE_DEFAULT_ACLOCALDIR
379 AC_SUBST([CONFIG_FILES])
380 AC_OUTPUT([Makefile
381 zzip/Makefile zzipwrap/Makefile SDL/Makefile
382 docs/Makefile test/Makefile bins/Makefile])
383 dnl -------------------------------------------------------------
384 PATCH_LIBTOOL_ON_DARWIN_ZSH_OVERQUOTING
385 PATCH_LIBTOOL_SYS_LIB_SEARCH_PATH_SPEC
386 PATCH_LIBTOOL_TO_ADD_HOST_CC
387 # ---------------------------------------------------------------
388 echo '-----' $PACKAGE $VERSION $prefix
389 $SHELL libtool --features || true
390 echo "CPPFLAGS=$CPPFLAGS"
391 echo "CFLAGS=$CFLAGS"
392 test "$enable_mmap" != "no" && echo "enable mmap ($enable_mmap)"
393 test "$enable_mmap" = "no" && echo "disable mmap ($enable_mmap)"
394 test "$with_lowstk" != "no" && echo "with lowstk ($with_lowstk)"
395 test "$with_lowstk" = "no" && echo "without lowstk ($with_lowstk)"
396 test "$with_debug" != "no" && echo "with debug ($with_debug)"
397 test "$with_debug" = "no" && echo "without debug ($with_debug)"
398 # test -f ./zziplib.spec && echo warning - do not build in the source dirs
399 echo '# make && make check && make install'