summaryrefslogtreecommitdiff
path: root/Build/source/m4
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2014-06-18 11:12:01 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2014-06-18 11:12:01 +0000
commit0c2f0333a4e539325da80cdf3fb182cd17134665 (patch)
treede5daa66b5595292a33c25110aa58ff8bff75543 /Build/source/m4
parentdb612d5045ef55da386a2c3350d4811d1da1a858 (diff)
Add libs/gmp and libs/mpfr in preparation for MetaPost 2.0
git-svn-id: svn://tug.org/texlive/trunk@34274 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/m4')
-rw-r--r--Build/source/m4/ChangeLog10
-rw-r--r--Build/source/m4/kpse-cairo-flags.m47
-rw-r--r--Build/source/m4/kpse-common.m441
-rw-r--r--Build/source/m4/kpse-freetype2-flags.m47
-rw-r--r--Build/source/m4/kpse-gmp-flags.m428
-rw-r--r--Build/source/m4/kpse-graphite2-flags.m410
-rw-r--r--Build/source/m4/kpse-harfbuzz-flags.m410
-rw-r--r--Build/source/m4/kpse-libpng-flags.m410
-rw-r--r--Build/source/m4/kpse-lua52-flags.m47
-rw-r--r--Build/source/m4/kpse-luajit-flags.m47
-rw-r--r--Build/source/m4/kpse-mpfr-flags.m428
-rw-r--r--Build/source/m4/kpse-pixman-flags.m47
-rw-r--r--Build/source/m4/kpse-pkgs.m44
-rw-r--r--Build/source/m4/kpse-poppler-flags.m47
-rw-r--r--Build/source/m4/kpse-ptexenc-flags.m413
-rw-r--r--Build/source/m4/kpse-search-libs.m423
-rw-r--r--Build/source/m4/kpse-size-max.m415
-rw-r--r--Build/source/m4/kpse-zziplib-flags.m48
18 files changed, 159 insertions, 83 deletions
diff --git a/Build/source/m4/ChangeLog b/Build/source/m4/ChangeLog
index cf937fd9ab5..9807a11635e 100644
--- a/Build/source/m4/ChangeLog
+++ b/Build/source/m4/ChangeLog
@@ -1,3 +1,13 @@
+2014-06-16 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * kpse-gmp-flags.m4, kpse-mpfr-flags.m4: New files.
+ * kpse-pkgs.m4 (kpse_libs_pkgs): Add gmp and mpfr.
+
+ * kpse-lua52-flags.m4 (LUA52_DEFINES): Add -DLUAI_HASHLIMIT=6.
+ * kpse-luajit-flags.m4 (LUAJIT_DEFINES): Add -DLUAI_HASHLIMIT=6.
+
+ * kpse-search-libs.m4, kpse-size-max.m4: New files.
+
2014-05-06 Peter Breitenlohner <peb@mppmu.mpg.de>
* kpse-pkgs.m4 (kpse_utils_pkgs): Drop biber.
diff --git a/Build/source/m4/kpse-cairo-flags.m4 b/Build/source/m4/kpse-cairo-flags.m4
index 8e093e8643c..3d7539633fc 100644
--- a/Build/source/m4/kpse-cairo-flags.m4
+++ b/Build/source/m4/kpse-cairo-flags.m4
@@ -19,12 +19,7 @@ _KPSE_LIB_FLAGS([cairo], [cairo], [],
# KPSE_CAIRO_OPTIONS([WITH-SYSTEM])
# ---------------------------------
-AC_DEFUN([KPSE_CAIRO_OPTIONS], [dnl
-m4_ifval([$1],
- [AC_ARG_WITH([system-cairo],
- AS_HELP_STRING([--with-system-cairo],
- [use installed cairo headers and library (requires pkg-config)]))])[]dnl
-]) # KPSE_CAIRO_OPTIONS
+AC_DEFUN([KPSE_CAIRO_OPTIONS], [_KPSE_LIB_OPTIONS([cairo], [$1], [pkg-config])])
# KPSE_CAIRO_SYSTEM_FLAGS
# -----------------------
diff --git a/Build/source/m4/kpse-common.m4 b/Build/source/m4/kpse-common.m4
index c39762274a8..70a4c48d79f 100644
--- a/Build/source/m4/kpse-common.m4
+++ b/Build/source/m4/kpse-common.m4
@@ -1,6 +1,6 @@
# Public macros for the TeX Live (TL) tree.
# Copyright (C) 1995-2009 Karl Berry <tex-live@tug.org>
-# Copyright (C) 2009-2012 Peter Breitenlohner <tex-live@tug.org>
+# Copyright (C) 2009-2014 Peter Breitenlohner <tex-live@tug.org>
#
# This file is free software; the copyright holders
# give unlimited permission to copy and/or distribute it,
@@ -54,8 +54,8 @@ AC_LANG(_AC_LANG)[]dnl
# [REBUILD-BLD-DEPENDENCIES])
# -----------------------------------------------
# For generic libraries in libs/LIBDIR.
-# Provide the configure options '--with-system-LIBDIR' (if in the TL tree),
-# '--with-LIBDIR-includes', and '--with-LIBDIR-libdir'.
+# Provide the configure options '--with-system-LIBDIR' (if in the TL tree)
+# and, if applicable '--with-LIBDIR-includes' and '--with-LIBDIR-libdir'.
# Options:
# lt - this is a Libtool library
# tree - only use library from the TL tree
@@ -146,22 +146,22 @@ m4_define([_KPSE_LIB_FLAGS_STANDALONE],
[m4_fatal([$0: not in TL tree])])[]dnl m4_if
]) # _KPSE_LIB_FLAGS_STANDALONE
-# _KPSE_LIB_OPTIONS(LIBDIR, [WITH-SYSTEM])
-# ----------------------------------------
+# _KPSE_LIB_OPTIONS(LIBDIR, [WITH-SYSTEM], [CONFIG-PROG])
+# -------------------------------------------------------
# Internal subroutine: default configure options for system library,
# including '--with-system-LIBDIR' if WITH-SYSTEM is nonempty.
-m4_define([_KPSE_LIB_OPTIONS],
-[m4_ifval([$2],
- [AC_ARG_WITH([system-$1],
- AS_HELP_STRING([--with-system-$1],
- [use installed $1 headers and library]))])[]dnl
+m4_define([_KPSE_LIB_OPTIONS], [m4_ifval([$2], [dnl
+AC_ARG_WITH([system-$1],
+ AS_HELP_STRING([--with-system-$1],
+ [use installed $1 headers and library]m4_ifval([$3], [ (requires $3)])))[]dnl
+m4_ifval([$3], [], [dnl
AC_ARG_WITH([$1-includes],
AS_HELP_STRING([--with-$1-includes=DIR],
[$1 headers installed in DIR]))[]dnl
AC_ARG_WITH([$1-libdir],
AS_HELP_STRING([--with-$1-libdir=DIR],
[$1 library installed in DIR]))[]dnl
-]) # _KPSE_LIB_OPTIONS
+])])]) # _KPSE_LIB_OPTIONS
# _KPSE_LIB_FLAGS_SYSTEM(LIBDIR, LIBNAME)
# ---------------------------------------
@@ -296,10 +296,25 @@ AC_CHECK_TOOL([PKG_CONFIG], [pkg-config], [false])[]dnl
# KPSE_CANONICAL_HOST
# -------------------
# Require both --host and --build for cross compilations; set kpse_build_alias.
-AC_DEFUN([KPSE_CANONICAL_HOST],
-[AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
+AC_DEFUN([KPSE_CANONICAL_HOST], [dnl
+AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
AS_IF([test "x$host_alias" != x && test "x$build_alias" = x],
[AC_MSG_ERROR([when cross-compiling you must specify both --host and --build.])])
eval kpse_build_alias=\${build_alias-$build}
]) # KPSE_CANONICAL_HOST
+# KPSE_NATIVE_SUBDIRS(DIR ...)
+# ----------------------------
+# Similar to AC_CONFIG_SUBDIRS for subdirectories configured for the build system.
+# When cross compiling, the subdirectories need a different cache file.
+AC_DEFUN([KPSE_NATIVE_SUBDIRS], [dnl
+AC_REQUIRE([KPSE_CANONICAL_HOST])[]dnl
+AC_CONFIG_SUBDIRS($@)
+AC_CONFIG_COMMANDS_POST([dnl
+AS_IF([test "x$cross_compiling" = xyes], [dnl
+AS_IF([test "x$cache_file" != x/dev/null],
+ [cache_file=config.cache])
+ac_configure_args="$ac_configure_args --host='$kpse_build_alias' \
+CC='$BUILDCC' CFLAGS='$BUILDCFLAGS' \
+CPPFLAGS='$BUILDCPPFLAGS' LDFLAGS='$BUILDLDFLAGS'"])])
+]) # KPSE_NATIVE_SUBDIRS
diff --git a/Build/source/m4/kpse-freetype2-flags.m4 b/Build/source/m4/kpse-freetype2-flags.m4
index 9c83475bb9c..c00b24a2488 100644
--- a/Build/source/m4/kpse-freetype2-flags.m4
+++ b/Build/source/m4/kpse-freetype2-flags.m4
@@ -21,12 +21,7 @@ _KPSE_LIB_FLAGS([freetype2], [freetype], [],
# KPSE_FREETYPE2_OPTIONS([WITH-SYSTEM])
# -------------------------------------
-AC_DEFUN([KPSE_FREETYPE2_OPTIONS],
-[m4_ifval([$1],
- [AC_ARG_WITH([system-freetype2],
- AS_HELP_STRING([--with-system-freetype2],
- [use installed freetype2 headers and library (requires freetype-config)]))])[]dnl
-]) # KPSE_FREETYPE2_OPTIONS
+AC_DEFUN([KPSE_FREETYPE2_OPTIONS], [_KPSE_LIB_OPTIONS([freetype2], [$1], [freetype-config])])
# KPSE_FREETYPE2_SYSTEM_FLAGS
# ---------------------------
diff --git a/Build/source/m4/kpse-gmp-flags.m4 b/Build/source/m4/kpse-gmp-flags.m4
new file mode 100644
index 00000000000..07edc013cf6
--- /dev/null
+++ b/Build/source/m4/kpse-gmp-flags.m4
@@ -0,0 +1,28 @@
+# Public macros for the TeX Live (TL) tree.
+# Copyright (C) 2014 Taco Hoekwater <taco@metatex.org>
+# Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# KPSE_GMP_FLAGS
+# -----------------
+# Provide the configure options '--with-system-gmp' (if in the TL tree),
+# '--with-gmp-includes', and '--with-gmp-libdir'.
+#
+# Set the make variables GMP_INCLUDES and GMP_LIBS to the CPPFLAGS and
+# LIBS required for the `-lgmp' library in libs/gmp/ of the TL tree.
+AC_DEFUN([KPSE_GMP_FLAGS], [dnl
+_KPSE_LIB_FLAGS([gmp], [gmp], [],
+ [-IBLD/libs/gmp/include], [BLD/libs/gmp/libgmp.a], [],
+ [], [${top_builddir}/../../libs/gmp/include/gmp.h])[]dnl
+]) # KPSE_GMP_FLAGS
+
+# KPSE_GMP_OPTIONS([WITH-SYSTEM])
+# ----------------------------------
+AC_DEFUN([KPSE_GMP_OPTIONS], [_KPSE_LIB_OPTIONS([gmp], [$1])])
+
+# KPSE_GMP_SYSTEM_FLAGS
+# ------------------------
+AC_DEFUN([KPSE_GMP_SYSTEM_FLAGS], [_KPSE_LIB_FLAGS_SYSTEM([gmp], [gmp])])
diff --git a/Build/source/m4/kpse-graphite2-flags.m4 b/Build/source/m4/kpse-graphite2-flags.m4
index d408dfd4d6c..7c853707458 100644
--- a/Build/source/m4/kpse-graphite2-flags.m4
+++ b/Build/source/m4/kpse-graphite2-flags.m4
@@ -1,5 +1,5 @@
# Public macros for the TeX Live (TL) tree.
-# Copyright (C) 2012 Peter Breitenlohner <tex-live@tug.org>
+# Copyright (C) 2012-2014 Peter Breitenlohner <tex-live@tug.org>
#
# This file is free software; the copyright holder
# gives unlimited permission to copy and/or distribute it,
@@ -22,13 +22,7 @@ _KPSE_LIB_FLAGS([graphite2], [graphite2], [],
# KPSE_GRAPHITE2_OPTIONS([WITH-SYSTEM])
# -------------------------------------
-AC_DEFUN([KPSE_GRAPHITE2_OPTIONS],
-[m4_ifval([$1],
- [AC_ARG_WITH([system-graphite2],
- AS_HELP_STRING([--with-system-graphite2],
- [use installed graphite2 headers and library
- (requires pkg-config)]))])[]dnl
-]) # KPSE_GRAPHITE2_OPTIONS
+AC_DEFUN([KPSE_GRAPHITE2_OPTIONS], [_KPSE_LIB_OPTIONS([graphite2], [$1], [pkg-config])])
# KPSE_GRAPHITE2_SYSTEM_FLAGS
# ---------------------------
diff --git a/Build/source/m4/kpse-harfbuzz-flags.m4 b/Build/source/m4/kpse-harfbuzz-flags.m4
index dca4a2dd5e3..716ab28a3b9 100644
--- a/Build/source/m4/kpse-harfbuzz-flags.m4
+++ b/Build/source/m4/kpse-harfbuzz-flags.m4
@@ -1,5 +1,5 @@
# Public macros for the TeX Live (TL) tree.
-# Copyright (C) 2012 Peter Breitenlohner <tex-live@tug.org>
+# Copyright (C) 2012-2014 Peter Breitenlohner <tex-live@tug.org>
#
# This file is free software; the copyright holder
# gives unlimited permission to copy and/or distribute it,
@@ -21,13 +21,7 @@ _KPSE_LIB_FLAGS([harfbuzz], [harfbuzz], [],
# KPSE_HARFBUZZ_OPTIONS([WITH-SYSTEM])
# ------------------------------------
-AC_DEFUN([KPSE_HARFBUZZ_OPTIONS],
-[m4_ifval([$1],
- [AC_ARG_WITH([system-harfbuzz],
- AS_HELP_STRING([--with-system-harfbuzz],
- [use installed harfbuzz headers and library
- (requires pkg-config)]))])[]dnl
-]) # KPSE_HARFBUZZ_OPTIONS
+AC_DEFUN([KPSE_HARFBUZZ_OPTIONS], [_KPSE_LIB_OPTIONS([harfbuzz], [$1], [pkg-config])])
# KPSE_HARFBUZZ_SYSTEM_FLAGS
# --------------------------
diff --git a/Build/source/m4/kpse-libpng-flags.m4 b/Build/source/m4/kpse-libpng-flags.m4
index 433100c0c98..a2bb76c6814 100644
--- a/Build/source/m4/kpse-libpng-flags.m4
+++ b/Build/source/m4/kpse-libpng-flags.m4
@@ -1,5 +1,5 @@
# Public macros for the TeX Live (TL) tree.
-# Copyright (C) 2009, 2011 Peter Breitenlohner <tex-live@tug.org>
+# Copyright (C) 2009-2014 Peter Breitenlohner <tex-live@tug.org>
#
# This file is free software; the copyright holder
# gives unlimited permission to copy and/or distribute it,
@@ -22,13 +22,7 @@ _KPSE_LIB_FLAGS([libpng], [png], [],
# KPSE_LIBPNG_OPTIONS([WITH-SYSTEM])
# ----------------------------------
-AC_DEFUN([KPSE_LIBPNG_OPTIONS],
-[m4_ifval([$1],
- [AC_ARG_WITH([system-libpng],
- AS_HELP_STRING([--with-system-libpng],
- [use installed libpng headers and library
- (requires pkg-config)]))])[]dnl
-]) # KPSE_LIBPNG_OPTIONS
+AC_DEFUN([KPSE_LIBPNG_OPTIONS], [_KPSE_LIB_OPTIONS([libpng], [$1], [pkg-config])])
# KPSE_LIBPNG_SYSTEM_FLAGS
# ------------------------
diff --git a/Build/source/m4/kpse-lua52-flags.m4 b/Build/source/m4/kpse-lua52-flags.m4
index 5e1d40466ff..ff10b340253 100644
--- a/Build/source/m4/kpse-lua52-flags.m4
+++ b/Build/source/m4/kpse-lua52-flags.m4
@@ -7,9 +7,8 @@
# KPSE_LUA52_FLAGS
# ----------------
-# Set the make variables LUA52_INCLUDES and LUA52_LIBS to
-# the CPPFLAGS and LIBS required for the `-llua52' library in
-# libs/lua52/ of the TL tree.
+# Set the make variables LUA52_INCLUDES and LUA52_LIBS to the CPPFLAGS and
+# LIBS required for the `-llua52' library in libs/lua52/ of the TL tree.
AC_DEFUN([KPSE_LUA52_FLAGS], [dnl
_KPSE_LIB_FLAGS([lua52], [lua52], [tree],
[-IBLD/libs/lua52/include], [BLD/libs/lua52/liblua52.a], [],
@@ -22,7 +21,7 @@ _KPSE_LIB_FLAGS([lua52], [lua52], [tree],
# compiling or using the `-llua52' library.
AC_DEFUN([KPSE_LUA52_DEFINES], [dnl
AC_REQUIRE([KPSE_CHECK_WIN32])[]dnl
-AC_SUBST([LUA52_DEFINES], [-DLUA_COMPAT_MODULE])
+AC_SUBST([LUA52_DEFINES], ['-DLUA_COMPAT_MODULE -DLUAI_HASHLIMIT=6'])
if test "x$kpse_cv_have_win32" = xno; then
LUA52_DEFINES="$LUA52_DEFINES -DLUA_USE_POSIX"
AC_SEARCH_LIBS([dlopen], [dl])
diff --git a/Build/source/m4/kpse-luajit-flags.m4 b/Build/source/m4/kpse-luajit-flags.m4
index 996dca12e7e..21e1e32b603 100644
--- a/Build/source/m4/kpse-luajit-flags.m4
+++ b/Build/source/m4/kpse-luajit-flags.m4
@@ -7,9 +7,8 @@
# KPSE_LUAJIT_FLAGS
# -----------------
-# Set the make variables LUAJIT_INCLUDES and LUAJIT_LIBS to
-# the CPPFLAGS and LIBS required for the `-lluajit' library in
-# libs/luajit/ of the TL tree.
+# Set the make variables LUAJIT_INCLUDES and LUAJIT_LIBS to the CPPFLAGS and
+# LIBS required for the `-lluajit' library in libs/luajit/ of the TL tree.
AC_DEFUN([KPSE_LUAJIT_FLAGS], [dnl
_KPSE_LIB_FLAGS([luajit], [luajit], [tree],
[-IBLD/libs/luajit/include], [BLD/libs/luajit/libluajit.a], [],
@@ -24,7 +23,7 @@ _KPSE_LIB_FLAGS([luajit], [luajit], [tree],
# linking with the `-lluajit' library.
AC_DEFUN([KPSE_LUAJIT_DEFINES], [dnl
AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
-AC_SUBST([LUAJIT_DEFINES], [-DLUAJIT_ENABLE_LUA52COMPAT])
+AC_SUBST([LUAJIT_DEFINES], ['-DLUAJIT_ENABLE_LUA52COMPAT -DLUAI_HASHLIMIT=6'])
AS_CASE([$host_os:$host_cpu],
[*darwin*:x86_64], [LUAJIT_LDEXTRA='-pagezero_size 10000 -image_base 100000000'])
AC_SUBST([LUAJIT_LDEXTRA])
diff --git a/Build/source/m4/kpse-mpfr-flags.m4 b/Build/source/m4/kpse-mpfr-flags.m4
new file mode 100644
index 00000000000..364d5fa5537
--- /dev/null
+++ b/Build/source/m4/kpse-mpfr-flags.m4
@@ -0,0 +1,28 @@
+# Public macros for the TeX Live (TL) tree.
+# Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# KPSE_MPFR_FLAGS
+# ---------------
+# Provide the configure options '--with-system-mpfr' (if in the TL tree),
+# '--with-mpfr-includes', and '--with-mpfr-libdir'.
+#
+# Set the make variables MPFR_INCLUDES and MPFR_LIBS to the CPPFLAGS and
+# LIBS required for the `-lmpfr' library in libs/mpfr/ of the TL tree.
+AC_DEFUN([KPSE_MPFR_FLAGS], [dnl
+AC_REQUIRE([KPSE_GMP_FLAGS])[]dnl
+_KPSE_LIB_FLAGS([mpfr], [mpfr], [],
+ [-IBLD/libs/mpfr/include], [BLD/libs/mpfr/libmpfr.a], [],
+ [], [${top_builddir}/../../libs/mpfr/include/mpfr.h])[]dnl
+]) # KPSE_MPFR_FLAGS
+
+# KPSE_MPFR_OPTIONS([WITH-SYSTEM])
+# --------------------------------
+AC_DEFUN([KPSE_MPFR_OPTIONS], [_KPSE_LIB_OPTIONS([mpfr], [$1])])
+
+# KPSE_MPFR_SYSTEM_FLAGS
+# ----------------------
+AC_DEFUN([KPSE_MPFR_SYSTEM_FLAGS], [_KPSE_LIB_FLAGS_SYSTEM([mpfr], [mpfr])])
diff --git a/Build/source/m4/kpse-pixman-flags.m4 b/Build/source/m4/kpse-pixman-flags.m4
index b184e1db253..d0266535028 100644
--- a/Build/source/m4/kpse-pixman-flags.m4
+++ b/Build/source/m4/kpse-pixman-flags.m4
@@ -19,12 +19,7 @@ _KPSE_LIB_FLAGS([pixman], [pixman], [],
# KPSE_PIXMAN_OPTIONS([WITH-SYSTEM])
# ----------------------------------
-AC_DEFUN([KPSE_PIXMAN_OPTIONS], [dnl
-m4_ifval([$1],
- [AC_ARG_WITH([system-pixman],
- AS_HELP_STRING([--with-system-pixman],
- [use installed pixman headers and library (requires pkg-config)]))])[]dnl
-]) # KPSE_PIXMAN_OPTIONS
+AC_DEFUN([KPSE_PIXMAN_OPTIONS], [_KPSE_LIB_OPTIONS([pixman], [$1], [pkg-config])])
# KPSE_PIXMAN_SYSTEM_FLAGS
# ------------------------
diff --git a/Build/source/m4/kpse-pkgs.m4 b/Build/source/m4/kpse-pkgs.m4
index b377c1b29c5..5c751873252 100644
--- a/Build/source/m4/kpse-pkgs.m4
+++ b/Build/source/m4/kpse-pkgs.m4
@@ -30,6 +30,8 @@ graphite2
zziplib
xpdf
poppler
+mpfr
+gmp
cairo
pixman
potrace
@@ -62,6 +64,8 @@ AC_REQUIRE([KPSE_GD_SYSTEM_FLAGS])[]dnl
AC_REQUIRE([KPSE_POTRACE_SYSTEM_FLAGS])[]dnl
AC_REQUIRE([KPSE_PIXMAN_SYSTEM_FLAGS])[]dnl
AC_REQUIRE([KPSE_CAIRO_SYSTEM_FLAGS])[]dnl
+AC_REQUIRE([KPSE_GMP_SYSTEM_FLAGS])[]dnl
+AC_REQUIRE([KPSE_MPFR_SYSTEM_FLAGS])[]dnl
AC_REQUIRE([KPSE_POPPLER_SYSTEM_FLAGS])[]dnl
AC_REQUIRE([KPSE_XPDF_SYSTEM_FLAGS])[]dnl
AC_REQUIRE([KPSE_ZZIPLIB_SYSTEM_FLAGS])[]dnl
diff --git a/Build/source/m4/kpse-poppler-flags.m4 b/Build/source/m4/kpse-poppler-flags.m4
index d2f67719e42..37aa4af0977 100644
--- a/Build/source/m4/kpse-poppler-flags.m4
+++ b/Build/source/m4/kpse-poppler-flags.m4
@@ -22,12 +22,7 @@ test "x$kpse_cv_have_win32" = xno || POPPLER_LIBS="$POPPLER_LIBS -lgdi32"
# KPSE_POPPLER_OPTIONS([WITH-SYSTEM])
# -----------------------------------
-AC_DEFUN([KPSE_POPPLER_OPTIONS], [dnl
-m4_ifval([$1],
- [AC_ARG_WITH([system-poppler],
- AS_HELP_STRING([--with-system-poppler],
- [use installed poppler headers and library (requires pkg-config)]))])[]dnl
-]) # KPSE_POPPLER_OPTIONS
+AC_DEFUN([KPSE_POPPLER_OPTIONS], [_KPSE_LIB_OPTIONS([poppler], [$1], [pkg-config])])
# KPSE_POPPLER_SYSTEM_FLAGS
# -------------------------
diff --git a/Build/source/m4/kpse-ptexenc-flags.m4 b/Build/source/m4/kpse-ptexenc-flags.m4
index a7532dda44a..8d151660bdb 100644
--- a/Build/source/m4/kpse-ptexenc-flags.m4
+++ b/Build/source/m4/kpse-ptexenc-flags.m4
@@ -1,12 +1,10 @@
# Public macros for the TeX Live (TL) tree.
-# Copyright (C) 2010 Peter Breitenlohner <tex-live@tug.org>
+# Copyright (C) 2010-2014 Peter Breitenlohner <tex-live@tug.org>
#
# This file is free software; the copyright holder
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 0
-
# KPSE_PTEXENC_FLAGS
# ------------------
# Provide the configure options '--with-system-ptexenc' (if in the TL tree),
@@ -14,10 +12,11 @@
#
# Set the make variables PTEXENC_INCLUDES and PTEXENC_LIBS to the CPPFLAGS and
# LIBS required for the `-lptexenc' library in texk/ptexenc/ of the TL tree.
-AC_DEFUN([KPSE_PTEXENC_FLAGS],
-[_KPSE_TEXLIB_FLAGS([ptexenc], [ptexenc], [lt],
- [-IBLD/texk/ptexenc -ISRC/texk/ptexenc], [BLD/texk/ptexenc/libptexenc.la], [],
- [${top_srcdir}/../ptexenc/*.c ${top_srcdir}/../ptexenc/ptexenc/*.h])[]dnl
+AC_DEFUN([KPSE_PTEXENC_FLAGS], [dnl
+AC_REQUIRE([KPSE_KPATHSEA_FLAGS])[]dnl
+_KPSE_TEXLIB_FLAGS([ptexenc], [ptexenc], [lt],
+ [-IBLD/texk/ptexenc -ISRC/texk/ptexenc], [BLD/texk/ptexenc/libptexenc.la], [],
+ [${top_srcdir}/../ptexenc/*.c ${top_srcdir}/../ptexenc/ptexenc/*.h])[]dnl
]) # KPSE_PTEXENC_FLAGS
# KPSE_PTEXENC_OPTIONS([WITH-SYSTEM])
diff --git a/Build/source/m4/kpse-search-libs.m4 b/Build/source/m4/kpse-search-libs.m4
new file mode 100644
index 00000000000..7f459990622
--- /dev/null
+++ b/Build/source/m4/kpse-search-libs.m4
@@ -0,0 +1,23 @@
+# Public macros for the TeX Live (TL) tree.
+# Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holders
+# give unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# KPSE_SEARCH_LIBS(VARIABLE, FUNCTION, SEARCH-LIBS, [ACTION-IF-NOT-FOUND])
+# ------------------------------------------------------------------------
+# Search for a library defining FUNCTION, if it's not already available and
+# set the output variable VARIABLE to the required lib.
+# If FUNCTION is not found, the shell code ACTION-IF-NOT-FOUND if given or
+# AC_MSG_ERROR with a suitable text is executed.
+AC_DEFUN([KPSE_SEARCH_LIBS], [dnl
+kpse_search_save_LIBS=$LIBS
+AC_SEARCH_LIBS([$2], [$3])
+LIBS=$kpse_search_save_LIBS
+AS_CASE([$ac_cv_search_$2],
+ ["none required"], [],
+ [no], [m4_ifval([$4], [$4], [AC_MSG_ERROR([Sorry, did not find $2()])])],
+ [$1=$ac_cv_search_$2])
+AC_SUBST([$1])[]dnl
+]) # KPSE_SEARCH_LIBS
diff --git a/Build/source/m4/kpse-size-max.m4 b/Build/source/m4/kpse-size-max.m4
new file mode 100644
index 00000000000..d80276c42d7
--- /dev/null
+++ b/Build/source/m4/kpse-size-max.m4
@@ -0,0 +1,15 @@
+# Public macros for the TeX Live (TL) tree.
+# Copyright (C) 2014 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holders
+# give unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# KPSE_CHECK_SIZE_MAX
+# -------------------
+# Define SIZE_MAX if necessary, e.g., for Solaris 9.
+AC_DEFUN([KPSE_CHECK_SIZE_MAX], [dnl
+AC_CHECK_DECL([SIZE_MAX], , [dnl
+AC_DEFINE([SIZE_MAX], [((size_t)-1)],
+ [Define to `((size_t)-1)' if <stdint.h> does not define it.])])[]dnl
+]) # KPSE_CHECK_SIZE_MAX
diff --git a/Build/source/m4/kpse-zziplib-flags.m4 b/Build/source/m4/kpse-zziplib-flags.m4
index e2197defb40..7f48c3cb379 100644
--- a/Build/source/m4/kpse-zziplib-flags.m4
+++ b/Build/source/m4/kpse-zziplib-flags.m4
@@ -21,13 +21,7 @@ _KPSE_LIB_FLAGS([zziplib], [zzip], [],
# KPSE_ZZIPLIB_OPTIONS([WITH-SYSTEM])
# -----------------------------------
-AC_DEFUN([KPSE_ZZIPLIB_OPTIONS], [dnl
-m4_ifval([$1],
- [AC_ARG_WITH([system-zziplib],
- AS_HELP_STRING([--with-system-zziplib],
- [use installed zziplib headers and library
- (requires pkg-config)]))])[]dnl
-]) # KPSE_ZZIPLIB_OPTIONS
+AC_DEFUN([KPSE_ZZIPLIB_OPTIONS], [_KPSE_LIB_OPTIONS([zziplib], [$1], [pkg-config])])
# KPSE_ZZIPLIB_SYSTEM_FLAGS
# -------------------------