1 dnl Process this file with autoconf to produce a configure script.
3 dnl Copyright (C) 2016 Karl Berry <tex-live@tug.org>
4 dnl Copyright (C) 2009-2013 Peter Breitenlohner <tex-live@tug.org>
6 dnl This file is free software; the copyright holder
7 dnl gives unlimited permission to copy and/or distribute it,
8 dnl with or without modifications, as long as this notice is preserved.
10 m4_include([version.ac])[] dnl define zlib_version
11 AC_INIT([zlib (TeX Live)], zlib_version, [tex-k@tug.org])
13 AC_CONFIG_SRCDIR([zlib-src/zlib.h])
14 AC_CONFIG_AUX_DIR([../../build-aux])
15 AC_CONFIG_MACRO_DIR([../../m4])
23 KPSE_COMPILER_VISIBILITY
25 AC_CONFIG_HEADERS([config.h])[]dnl unused, to avoid zillions of -D's on command line
27 AM_CONDITIONAL([build], [test "x$enable_build" != xno])
29 if test "x$GCC" = xyes; then
30 CFLAGS=${CFLAGS-"-O3"}
34 if test "x$ac_cv_header_stdc" != xyes; then
35 AC_MSG_ERROR([Sorry, can't do anything for you without header_stdc])
38 AC_CHECK_HEADER([errno.h],
40 [ZLIB_DEFINES="-DNO_ERRNO_H"])
42 AC_CHECK_HEADERS([unistd.h])
43 ZCONF_SRC=[zlib-src/zconf.h.in]
44 if test x"$ac_cv_header_unistd_h" = xyes; then
45 zconf_sh='sed <$srcdir/'"$ZCONF_SRC"' "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H\\(.*\\) may be/ 1\\1 was/" >'
47 zconf_sh='cp $srcdir/'"$ZCONF_SRC"
50 KPSE_LARGEFILE([ZLIB_DEFINES], [_LARGEFILE64_SOURCE])
52 AC_CONFIG_COMMANDS([zconf.h],
53 [eval "$zconf_sh" zconf.h],
54 [zconf_sh='$zconf_sh'])
56 AC_MSG_CHECKING([for mmap support])
57 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
61 return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0);
64 ZLIB_DEFINES="$ZLIB_DEFINES -DUSE_MMAP"],
65 [AC_MSG_RESULT([no])])
68 if test "x$kpse_cv_have_win32" != xno; then
69 ZLIB_DEFINES="$ZLIB_DEFINES -DNO_VIZ"
72 AC_SUBST([ZLIB_DEFINES])
74 AC_SUBST([ZLIB_TREE], [zlib-src])
76 if test -f $srcdir/$ZLIB_TREE/zconf.h; then
77 AC_MSG_ERROR([Sorry, you must remove the file $ZLIB_TREE/zconf.h])
80 AC_CONFIG_FILES([Makefile include/Makefile])