beta-0.89.2
[luatex.git] / source / libs / zlib / configure.ac
bloba7ac859d7b84e332c3ad01d322393ad86f69332e
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 dnl   Copyright (C) 2016 Karl Berry <tex-live@tug.org>
4 dnl   Copyright (C) 2009-2013 Peter Breitenlohner <tex-live@tug.org>
5 dnl
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.
9 dnl
10 m4_include([version.ac])[] dnl define zlib_version
11 AC_INIT([zlib (TeX Live)], zlib_version, [tex-k@tug.org])
12 AC_PREREQ([2.65])
13 AC_CONFIG_SRCDIR([zlib-src/zlib.h])
14 AC_CONFIG_AUX_DIR([../../build-aux])
15 AC_CONFIG_MACRO_DIR([../../m4])
17 KPSE_BASIC([zlib])
19 AC_PROG_CC
20 AC_PROG_RANLIB
21 AC_PROG_LN_S
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"}
33 AC_HEADER_STDC
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],
39                 [ZLIB_DEFINES=],
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/" >'
46 else
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>
58 #include <sys/mman.h>
59 #include <sys/stat.h>
60 caddr_t hello() {
61   return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0);
62 }]])],
63                   [AC_MSG_RESULT([yes])
64                   ZLIB_DEFINES="$ZLIB_DEFINES -DUSE_MMAP"],
65                   [AC_MSG_RESULT([no])])
67 KPSE_CHECK_WIN32
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])
82 AC_OUTPUT