| 1 |
# Public macros for the TeX Live (TL) tree. |
| 2 |
# Copyright (C) 2009-2013 Peter Breitenlohner <[email protected]> |
| 3 |
# |
| 4 |
# This file is free software; the copyright holder |
| 5 |
# gives unlimited permission to copy and/or distribute it, |
| 6 |
# with or without modifications, as long as this notice is preserved. |
| 7 |
|
| 8 |
# KPSE_ZLIB_FLAGS |
| 9 |
# --------------- |
| 10 |
# Provide the configure options '--with-system-zlib' (if in the TL tree), |
| 11 |
# '--with-zlib-includes', and '--with-zlib-libdir'. |
| 12 |
# |
| 13 |
# Also test if <zlib.h> defines 'z_const' and define ZLIB_CONST or z_const. |
| 14 |
# |
| 15 |
# Set the make variables ZLIB_INCLUDES and ZLIB_LIBS to the CPPFLAGS and |
| 16 |
# LIBS required for the `-lz' library in libs/zlib/ of the TL tree. |
| 17 |
AC_DEFUN([KPSE_ZLIB_FLAGS], [dnl |
| 18 |
AC_REQUIRE([KPSE_SAVE_FLAGS])[]dnl |
| 19 |
_KPSE_LIB_FLAGS([zlib], [z], [], |
| 20 |
[-IBLD/libs/zlib/include], [BLD/libs/zlib/libz.a], [], |
| 21 |
[], [${top_builddir}/../../libs/zlib/include/zconf.h])[]dnl |
| 22 |
AC_CACHE_CHECK([if <zlib.h> defines 'z_const'], |
| 23 |
[kpse_cv_have_decl_z_const], |
| 24 |
[KPSE_ADD_FLAGS([zlib]) |
| 25 |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], |
| 26 |
[[z_const char * foo();]])], |
| 27 |
[kpse_cv_have_decl_z_const=yes], |
| 28 |
[kpse_cv_have_decl_z_const=no]) |
| 29 |
KPSE_RESTORE_FLAGS]) |
| 30 |
AS_CASE([$kpse_cv_have_decl_z_const], |
| 31 |
[yes], [AC_DEFINE([ZLIB_CONST], [1], [Define to 1 if <zlib.h> declares 'z_const'.])], |
| 32 |
[AC_DEFINE([z_const], [], [Define as empty if not declared in <zlib.h>.])]) |
| 33 |
]) # KPSE_ZLIB_FLAGS |
| 34 |
|
| 35 |
# KPSE_ZLIB_OPTIONS([WITH-SYSTEM]) |
| 36 |
# -------------------------------- |
| 37 |
AC_DEFUN([KPSE_ZLIB_OPTIONS], [_KPSE_LIB_OPTIONS([zlib], [$1])]) |
| 38 |
|
| 39 |
# KPSE_ZLIB_SYSTEM_FLAGS |
| 40 |
# ---------------------- |
| 41 |
AC_DEFUN([KPSE_ZLIB_SYSTEM_FLAGS], [_KPSE_LIB_FLAGS_SYSTEM([zlib], [z])]) |