summaryrefslogtreecommitdiff
path: root/Build/source/libs/zziplib/configure.ac
blob: 98ff5c7fb40af8fc9576fe16cd863d0cd9cad262 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
dnl Process this file with autoconf to produce a configure script.
dnl
dnl   Copyright (C) 2010-2013 Peter Breitenlohner <tex-live@tug.org>
dnl
dnl   based on zziplib-0.13.58:
dnl     Copyright (C) 2009 Guido Draheim <guido@gmx.de> for ZZipLib.SF.net
dnl
dnl   This file is free software; the copyright holder
dnl   gives unlimited permission to copy and/or distribute it,
dnl   with or without modifications, as long as this notice is preserved.
dnl
m4_include([version.ac])[] dnl define zziplib_version
AC_INIT([zziplib (TeX Live)], zziplib_version, [tex-k@tug.org])
AC_PREREQ([2.65])
AC_CONFIG_SRCDIR([zziplib-]zziplib_version[/zziplib.spec])
AC_CONFIG_AUX_DIR([../../build-aux])
AC_CONFIG_MACRO_DIRS([../../m4 m4])

KPSE_BASIC([zziplib])

AC_CANONICAL_HOST

# Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_LN_S

# Checks for header files.
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_CHECK_HEADERS([stdint.h unistd.h windows.h sys/int_types.h])
AC_CHECK_HEADERS([winnt.h winbase.h], , , [#include <windows.h>])
AC_CHECK_HEADERS([sys/types.h sys/mman.h sys/stat.h sys/param.h]) dnl posix'ish
AC_CHECK_HEADERS([io.h direct.h byteswap.h])
AC_CHECK_HEADERS([fnmatch.h])

# ---------------------------------------------------------------
AC_MSG_CHECKING([whether can use mmap for file scanning])
enable_mmap='no (just a bit slower)'
test "x$ac_cv_header_winbase_h" = xyes && enable_mmap="yes, winbase.h"
test "x$ac_cv_header_sys_mman_h" = xyes && enable_mmap="yes, sys/mman.h"
case "$enable_mmap" in
   yes*) ZZIPLIB_DEFINES='-D_USE_MMAP';;
esac
AC_MSG_RESULT([$enable_mmap])
AC_SUBST([ZZIPLIB_DEFINES])

AC_SYS_LARGEFILE_SENSITIVE
AC_FUNC_FSEEKO

# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_C_CONST
AC_C_RESTRICT
AC_TYPE_SIZE_T
AC_CHECK_TYPE([ssize_t], [int])
AC_CHECK_TYPE([off64_t], [_zzip_off_t])
AC_CHECK_TYPE([__int64], [long long])
AC_CHECK_SIZEOF([short])
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])
AC_C_BIGENDIAN
ZZIPLIB_CHECK_ALIGNED_ACCESS

# Checks for library functions.
AC_CHECK_FUNCS([strcasecmp strndup])

KPSE_ZLIB_FLAGS

AM_CONDITIONAL([build], [test "x$enable_build" != xno])

if test "x$enable_build" != xno || test -f config.force; then

KPSE_ADD_FLAGS([zlib])
AC_CHECK_HEADERS([zlib.h])
AC_CHECK_FUNC([zlibVersion], , [AC_ERROR([zlib not found])])
KPSE_RESTORE_FLAGS

echo timestamp >config.force
fi

ZZIPLIB_TREE=zziplib-[]zziplib_version
AC_SUBST([ZZIPLIB_TREE])

# -----------------------------------------------------------------------
AC_MSG_RESULT([creating include/zzip/_msvc.in via zzip/_msvc.sed of config.h.in])
test -d include || mkdir include
sed -f $srcdir/$ZZIPLIB_TREE/zzip/_msvc.sed $srcdir/config.h.in >include/_msvc.in
AC_CONFIG_HEADERS([config.h])
AX_PREFIX_CONFIG_H([include/zzip/_config.h],[zzip],[config.h])
AX_PREFIX_CONFIG_H([include/zzip/_msvc.h],[zzip],[include/_msvc.in])

AC_CONFIG_FILES([Makefile include/zzip/Makefile])

AC_OUTPUT