| 1 |
dnl $Id: configure.ac 71105 2024-04-28 16:42:00Z karl $ |
| 2 |
dnl Process this file with autoconf to produce a configure script. |
| 3 |
dnl |
| •4 |
dnl Copyright (C) 2016-2026 Karl Berry <[email protected]> |
| 5 |
dnl Copyright (C) 2010-2014 Peter Breitenlohner <[email protected]> |
| 6 |
dnl |
| 7 |
dnl based on zziplib-0.13.58: |
| 8 |
dnl Copyright (C) 2009 Guido Draheim <[email protected]> for ZZipLib.SF.net |
| 9 |
dnl |
| 10 |
dnl This file is free software; the copyright holder |
| 11 |
dnl gives unlimited permission to copy and/or distribute it, |
| 12 |
dnl with or without modifications, as long as this notice is preserved. |
| 13 |
dnl |
| 14 |
m4_include([version.ac])[] dnl define zziplib_version |
| 15 |
AC_INIT([zziplib (TeX Live)], zziplib_version, [[email protected]]) |
| 16 |
AC_PREREQ([2.65]) |
| 17 |
AC_CONFIG_SRCDIR([zziplib-src/zziplib.spec]) |
| 18 |
AC_CONFIG_AUX_DIR([../../build-aux]) |
| 19 |
AC_CONFIG_MACRO_DIRS([../../m4 m4]) |
| 20 |
|
| 21 |
KPSE_BASIC([zziplib]) |
| 22 |
|
| 23 |
AC_CANONICAL_HOST |
| 24 |
|
| 25 |
# Checks for programs. |
| 26 |
AC_PROG_CC |
| 27 |
AM_PROG_AS |
| 28 |
AM_PROG_AR |
| 29 |
AC_PROG_RANLIB |
| 30 |
AC_PROG_LN_S |
| 31 |
|
| 32 |
KPSE_COMPILER_VISIBILITY |
| 33 |
|
| 34 |
# Checks for header files. |
| 35 |
AC_HEADER_DIRENT |
| 36 |
AC_CHECK_HEADERS([stdint.h unistd.h windows.h sys/int_types.h]) |
| 37 |
AC_CHECK_HEADERS([winnt.h winbase.h], , , [#include <windows.h>]) |
| 38 |
AC_CHECK_HEADERS([sys/types.h sys/mman.h sys/stat.h sys/param.h]) dnl posix'ish |
| 39 |
AC_CHECK_HEADERS([io.h direct.h byteswap.h]) |
| 40 |
AC_CHECK_HEADERS([fnmatch.h]) |
| 41 |
|
| 42 |
# mmap --------------------------------------------------------------- |
| 43 |
AC_MSG_CHECKING([whether can use mmap for file scanning]) |
| 44 |
enable_mmap='no (just a bit slower)' |
| 45 |
test "x$ac_cv_header_winbase_h" = xyes && enable_mmap="yes, winbase.h" |
| 46 |
test "x$ac_cv_header_sys_mman_h" = xyes && enable_mmap="yes, sys/mman.h" |
| 47 |
AS_CASE([$enable_mmap], |
| 48 |
[yes*], [ZZIPLIB_DEFINES='-D_USE_MMAP']) |
| 49 |
AC_MSG_RESULT([$enable_mmap]) |
| 50 |
AC_SUBST([ZZIPLIB_DEFINES]) |
| 51 |
|
| 52 |
AC_SYS_LARGEFILE_SENSITIVE |
| 53 |
|
| 54 |
# Need this to avoid off64_t error with system extensions enabled. |
| 55 |
KPSE_LARGEFILE([ZZIPLIB_DEFINES], [_LARGEFILE64_SOURCE]) |
| 56 |
|
| 57 |
AC_FUNC_FSEEKO |
| 58 |
|
| 59 |
# Checks for typedefs, structures, and compiler characteristics. |
| 60 |
AC_C_INLINE |
| 61 |
AC_C_CONST |
| 62 |
AC_C_RESTRICT |
| 63 |
AC_TYPE_SIZE_T |
| 64 |
AC_CHECK_TYPE([ssize_t], [int]) |
| 65 |
AC_CHECK_TYPE([off64_t], [_zzip_off_t]) |
| 66 |
AC_CHECK_TYPE([__int64], [long long]) |
| 67 |
AC_CHECK_SIZEOF([short]) |
| 68 |
AC_CHECK_SIZEOF([int]) |
| 69 |
AC_CHECK_SIZEOF([long]) |
| 70 |
AC_C_BIGENDIAN |
| 71 |
ZZIPLIB_CHECK_ALIGNED_ACCESS |
| 72 |
|
| 73 |
# Checks for library functions. |
| 74 |
AC_CHECK_FUNCS([strcasecmp strnlen strndup]) |
| 75 |
|
| 76 |
KPSE_ZLIB_FLAGS |
| 77 |
|
| 78 |
AM_CONDITIONAL([build], [test "x$enable_build" != xno]) |
| 79 |
|
| 80 |
if test "x$enable_build" != xno || test -f config.force; then |
| 81 |
|
| 82 |
KPSE_ADD_FLAGS([zlib]) |
| 83 |
AC_CHECK_HEADERS([zlib.h]) |
| •84 |
AC_CHECK_FUNC([zlibVersion], , [AC_MSG_ERROR([zlib not found])]) |
| 85 |
KPSE_RESTORE_FLAGS |
| 86 |
|
| 87 |
echo timestamp >config.force |
| 88 |
fi |
| 89 |
|
| 90 |
AC_SUBST([ZZIPLIB_TREE], [zziplib-src]) |
| 91 |
|
| 92 |
# ----------------------------------------------------------------------- |
| 93 |
AC_MSG_RESULT([creating include/zzip/_msvc.in via zzip/_msvc.sed of config.h.in]) |
| 94 |
test -d include || mkdir include |
| •95 |
sed -f "$srcdir"/$ZZIPLIB_TREE/zzip/_msvc.sed "$srcdir"/config.h.in >include/_msvc.in |
| 96 |
AC_CONFIG_HEADERS([config.h]) |
| •97 |
AC_MSG_NOTICE([applying ax_prefix_config_h to config.h and include/_msvc.in]) |
| 98 |
AX_PREFIX_CONFIG_H([include/zzip/_config.h],[zzip],[config.h]) |
| 99 |
AX_PREFIX_CONFIG_H([include/zzip/_msvc.h],[zzip],[include/_msvc.in]) |
| 100 |
|
| 101 |
AC_CONFIG_FILES([Makefile include/zzip/Makefile]) |
| 102 |
|
| 103 |
AC_OUTPUT |