summaryrefslogtreecommitdiff
path: root/Build/source/m4
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2013-06-24 11:36:53 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2013-06-24 11:36:53 +0000
commit8a9fa865b4d372ab53ccc70fe46a25273c49e9af (patch)
tree96a83e43801be4faa0662613ff4ef46adf58d04b /Build/source/m4
parent432d51af8c3f6760dc1dda1f229f9a27e34d4a44 (diff)
Update build system
git-svn-id: svn://tug.org/texlive/trunk@30903 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/m4')
-rw-r--r--Build/source/m4/ChangeLog24
-rw-r--r--Build/source/m4/kpse-cairo-flags.m42
-rw-r--r--Build/source/m4/kpse-gd-flags.m412
-rw-r--r--Build/source/m4/kpse-largefile.m425
-rw-r--r--Build/source/m4/kpse-lua52-flags.m435
-rw-r--r--Build/source/m4/kpse-pixman-flags.m46
-rw-r--r--Build/source/m4/kpse-pkgs.m433
-rw-r--r--Build/source/m4/kpse-poppler-flags.m410
-rw-r--r--Build/source/m4/kpse-potrace-flags.m427
-rw-r--r--Build/source/m4/kpse-t1lib-flags.m429
-rw-r--r--Build/source/m4/kpse-visibility.m474
-rw-r--r--Build/source/m4/kpse-warnings.m44
12 files changed, 217 insertions, 64 deletions
diff --git a/Build/source/m4/ChangeLog b/Build/source/m4/ChangeLog
index eb964951b2a..77fcdceec0d 100644
--- a/Build/source/m4/ChangeLog
+++ b/Build/source/m4/ChangeLog
@@ -1,3 +1,27 @@
+2013-06-19 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * kpse-pkgs.m4 (KPSE_LIBS_PKGS): Add lua52.
+ * kpse-lua52-flags.m4: New file.
+ * kpse-largefile.m4 (new): CPPFLAGS for largefile support.
+
+2013-06-06 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * kpse-pkgs.m4 (kpse_texk_pkgs): Remove xdv2pdf.
+
+2013-06-02 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * kpse-poppler-flags.m4: Headers installed as for system-poppler.
+
+2013-05-18 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * kpse-pkgs.m4 (KPSE_LIBS_PKGS): Remove t1lib.
+ * kpse-t1lib-flags.m4: Removed.
+
+2013-04-12 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * kpse-pkgs.m4 (KPSE_LIBS_PKGS): Add t1lib.
+ * kpse-potrace-flags.m4: New file.
+
2013-03-26 Peter Breitenlohner <peb@mppmu.mpg.de>
* kpse-cairo-flags.m4: Require cairo-1.12 or better (message).
diff --git a/Build/source/m4/kpse-cairo-flags.m4 b/Build/source/m4/kpse-cairo-flags.m4
index c7a6c9bf65b..f9c38f2e588 100644
--- a/Build/source/m4/kpse-cairo-flags.m4
+++ b/Build/source/m4/kpse-cairo-flags.m4
@@ -12,7 +12,7 @@
# Set the make variables CAIRO_INCLUDES and CAIRO_LIBS to the CPPFLAGS and
# LIBS required for the `-lcairo' library in libs/cairo/ of the TL tree.
AC_DEFUN([KPSE_CAIRO_FLAGS],
-[_KPSE_LIB_FLAGS([cairo], [cairo], [lt],
+[_KPSE_LIB_FLAGS([cairo], [cairo], [],
[-IBLD/libs/cairo/cairo], [BLD/libs/cairo/libcairo.a], [],
[], [${top_builddir}/../../libs/cairo/cairo/cairo.h])[]dnl
]) # KPSE_CAIRO_FLAGS
diff --git a/Build/source/m4/kpse-gd-flags.m4 b/Build/source/m4/kpse-gd-flags.m4
index db5213bd751..7703541f834 100644
--- a/Build/source/m4/kpse-gd-flags.m4
+++ b/Build/source/m4/kpse-gd-flags.m4
@@ -1,12 +1,10 @@
# Public macros for the TeX Live (TL) tree.
-# Copyright (C) 2009, 2010 Peter Breitenlohner <tex-live@tug.org>
+# Copyright (C) 2009-2013 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_GD_FLAGS
# -------------
# Provide the configure options '--with-system-gd' (if in the TL tree),
@@ -14,11 +12,13 @@
#
# Set the make variables GD_INCLUDES and GD_LIBS to the CPPFLAGS and
# LIBS required for the `-lgd' library in libs/gd/ of the TL tree.
-AC_DEFUN([KPSE_GD_FLAGS],
-[AC_REQUIRE([KPSE_LIBPNG_FLAGS])[]dnl
+AC_DEFUN([KPSE_GD_FLAGS], [dnl
+AC_REQUIRE([KPSE_CHECK_WIN32])[]dnl
+AC_REQUIRE([KPSE_LIBPNG_FLAGS])[]dnl
AC_REQUIRE([KPSE_FREETYPE2_FLAGS])[]dnl
_KPSE_LIB_FLAGS([gd], [gd], [],
- [-IBLD/libs/gd/include -DNONDLL], [BLD/libs/gd/libgd.a], [],
+ [-IBLD/libs/gd/include], [BLD/libs/gd/libgd.a],
+ [test "x$kpse_cv_have_win32" = xno || GD_INCLUDES="$GD_INCLUDES -DBGDWIN32 -DNONDLL"],
[], [${top_builddir}/../../libs/gd/include/gd.h])[]dnl
]) # KPSE_GD_FLAGS
diff --git a/Build/source/m4/kpse-largefile.m4 b/Build/source/m4/kpse-largefile.m4
new file mode 100644
index 00000000000..b9af9acee3f
--- /dev/null
+++ b/Build/source/m4/kpse-largefile.m4
@@ -0,0 +1,25 @@
+# Public macros for the TeX Live (TL) tree.
+# Copyright (C) 2013 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_LARGEFILE(MAKE-VAR,[EXTRA-DEFINE])
+# ---------------------------------------
+# Append -D's required for largefile support to MAKE-VAR.
+AC_DEFUN([KPSE_LARGEFILE], [dnl
+AC_REQUIRE([AC_SYS_LARGEFILE])[]dnl
+AC_REQUIRE([AC_FUNC_FSEEKO])[]dnl
+if test "x$enable_largefile" != xno; then
+ AS_CASE([$ac_cv_sys_file_offset_bits],
+ [no], [],
+ [unknown], [AS_CASE([$ac_cv_sys_large_files],
+ [no | unknown], [],
+ [$1="$$1 -D_LARGE_FILES"])],
+ [$1="$$1 m4_ifval([$2], [-D$2 ])-D_FILE_OFFSET_BITS=64"])
+fi
+AS_CASE([$ac_cv_sys_largefile_source],
+ [no | unknown], [],
+ [$1="$$1 -D_LARGEFILE_SOURCE"])
+]) # KPSE_LARGEFILE
diff --git a/Build/source/m4/kpse-lua52-flags.m4 b/Build/source/m4/kpse-lua52-flags.m4
new file mode 100644
index 00000000000..598191f353a
--- /dev/null
+++ b/Build/source/m4/kpse-lua52-flags.m4
@@ -0,0 +1,35 @@
+# Public macros for the TeX Live (TL) tree.
+# Copyright (C) 2013 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_LUA52_FLAGS
+# ----------------
+# Set the make variables LUA52_INCLUDES and LUA52_LIBS to
+# the CPPFLAGS and LIBS required for the `-llua52' library in
+# libs/luz52/ 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], [],
+ [], [${top_builddir}/../../libs/lua52/include/lua.h])[]dnl
+]) # KPSE_LUA52_FLAGS
+
+# KPSE_LUA52_DEFINES
+# ------------------
+# Set the make variable LUA52_DEFINES to the CPPFLAGS required when
+# 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])
+if test "x$kpse_cv_have_win32" = xno; then
+ LUA52_DEFINES="$LUA52_DEFINES -DLUA_USE_POSIX"
+ AC_SEARCH_LIBS([dlopen], [dl])
+ if test "x$ac_cv_search_dlopen" != xno; then
+ AC_CHECK_HEADER([dlfcn.h],
+ [LUA52_DEFINES="$LUA52_DEFINES -DLUA_USE_DLOPEN"],
+ [], [AC_INCLUDES_DEFAULT])
+ fi
+fi
+]) # KPSE_LUA52_DEFINES
diff --git a/Build/source/m4/kpse-pixman-flags.m4 b/Build/source/m4/kpse-pixman-flags.m4
index d3f93cd1669..08889fe3367 100644
--- a/Build/source/m4/kpse-pixman-flags.m4
+++ b/Build/source/m4/kpse-pixman-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, 2013 Peter Breitenlohner <tex-live@tug.org>
#
# This file is free software; the copyright holder
# gives unlimited permission to copy and/or distribute it,
@@ -12,8 +12,8 @@
# Set the make variables PIXMAN_INCLUDES and PIXMAN_LIBS to the CPPFLAGS and
# LIBS required for the `-lpixman-1' library in libs/pixman/ of the TL tree.
AC_DEFUN([KPSE_PIXMAN_FLAGS],
-[_KPSE_LIB_FLAGS([pixman], [pixman], [lt],
- [-IBLD/libs/pixman/include], [BLD/libs/pixman/libpixman.la], [],
+[_KPSE_LIB_FLAGS([pixman], [pixman], [],
+ [-IBLD/libs/pixman/include], [BLD/libs/pixman/libpixman.a], [],
[], [${top_builddir}/../../libs/pixman/include/pixman.h])[]dnl
]) # KPSE_PIXMAN_FLAGS
diff --git a/Build/source/m4/kpse-pkgs.m4 b/Build/source/m4/kpse-pkgs.m4
index 1ad77724c16..8528c908d5a 100644
--- a/Build/source/m4/kpse-pkgs.m4
+++ b/Build/source/m4/kpse-pkgs.m4
@@ -1,5 +1,5 @@
# Private macros for the TeX Live (TL) tree.
-# Copyright (C) 2009-2012 Peter Breitenlohner <tex-live@tug.org>
+# Copyright (C) 2009-2013 Peter Breitenlohner <tex-live@tug.org>
#
# This file is free software; the copyright holder
# gives unlimited permission to copy and/or distribute it,
@@ -21,9 +21,8 @@
# TeX specific libraries, i.e., subdirs 'texk/*', that can only
# be used by TeXk sub-packages and can't use generic libraries
# Each library must precede required other libraries (if any).
-AC_DEFUN([KPSE_LIBS_PKGS],
-[dnl generic libraries 'libs/*'
-m4_define([kpse_libs_pkgs], [
+AC_DEFUN([KPSE_LIBS_PKGS], [dnl
+m4_define([kpse_libs_pkgs], [dnl
harfbuzz
icu
teckit
@@ -33,15 +32,15 @@ xpdf
poppler
cairo
pixman
+potrace
gd
freetype2
freetype
-t1lib
libpng
+lua52
zlib
])[]dnl
-dnl TeX specific libraries
-m4_define([kpse_texlibs_pkgs], [
+m4_define([kpse_texlibs_pkgs], [dnl
ptexenc
kpathsea
])]) # KPSE_LIBS_PKGS
@@ -50,20 +49,20 @@ kpathsea
# -----------------------
# Generate flags for all potential system libraries available,
# only used at top-level.
-AC_DEFUN([KPSE_ALL_SYSTEM_FLAGS],
-[AC_REQUIRE([KPSE_LIBS_PREPARE])[]dnl
+AC_DEFUN([KPSE_ALL_SYSTEM_FLAGS], [dnl
+AC_REQUIRE([KPSE_LIBS_PREPARE])[]dnl
AC_REQUIRE([KPSE_KPATHSEA_SYSTEM_FLAGS])[]dnl
AC_REQUIRE([KPSE_PTEXENC_SYSTEM_FLAGS])[]dnl
AC_REQUIRE([KPSE_ZLIB_SYSTEM_FLAGS])[]dnl
AC_REQUIRE([KPSE_LIBPNG_SYSTEM_FLAGS])[]dnl
-AC_REQUIRE([KPSE_T1LIB_SYSTEM_FLAGS])[]dnl
AC_REQUIRE([KPSE_FREETYPE_SYSTEM_FLAGS])[]dnl
AC_REQUIRE([KPSE_FREETYPE2_SYSTEM_FLAGS])[]dnl
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_XPDF_SYSTEM_FLAGS])[]dnl
AC_REQUIRE([KPSE_POPPLER_SYSTEM_FLAGS])[]dnl
+AC_REQUIRE([KPSE_XPDF_SYSTEM_FLAGS])[]dnl
AC_REQUIRE([KPSE_ZZIPLIB_SYSTEM_FLAGS])[]dnl
AC_REQUIRE([KPSE_GRAPHITE2_SYSTEM_FLAGS])[]dnl
AC_REQUIRE([KPSE_TECKIT_SYSTEM_FLAGS])[]dnl
@@ -74,8 +73,8 @@ AC_REQUIRE([KPSE_HARFBUZZ_SYSTEM_FLAGS])[]dnl
# KPSE_UTILS_PKGS()
# -----------------
# Define the list of utility sub-packages, i.e., subdirs 'utils/*'.
-AC_DEFUN([KPSE_UTILS_PKGS],
-[m4_define([kpse_utils_pkgs], [
+AC_DEFUN([KPSE_UTILS_PKGS], [dnl
+m4_define([kpse_utils_pkgs], [dnl
biber
m-tx
pmx
@@ -93,8 +92,8 @@ xpdfopen
# ----------------
# Define the list of TeXk sub-packages, i.e., subdirs 'texk/*',
# excluding 'texk/kpathsea'.
-AC_DEFUN([KPSE_TEXK_PKGS],
-[m4_define([kpse_texk_pkgs], [
+AC_DEFUN([KPSE_TEXK_PKGS], [dnl
+m4_define([kpse_texk_pkgs], [dnl
web2c
afm2pl
bibtex-x
@@ -106,7 +105,7 @@ dtl
dvi2tty
dvidvi
dviljk
-dvipdfmx
+dvipdfm-x
dvipng
dvipos
dvipsk
@@ -123,9 +122,7 @@ tex4htk
ttf2pk
ttf2pk2
ttfdump
-xdv2pdf
xdvik
-xdvipdfmx
texlive
])]) # KPSE_TEXK_PKGS
diff --git a/Build/source/m4/kpse-poppler-flags.m4 b/Build/source/m4/kpse-poppler-flags.m4
index c11d727f1d2..6345f9f3146 100644
--- a/Build/source/m4/kpse-poppler-flags.m4
+++ b/Build/source/m4/kpse-poppler-flags.m4
@@ -1,5 +1,5 @@
# Public macros for the TeX Live (TL) tree.
-# Copyright (C) 2011, 2012 Peter Breitenlohner <tex-live@tug.org>
+# Copyright (C) 2011-2013 Peter Breitenlohner <tex-live@tug.org>
#
# This file is free software; the copyright holder
# gives unlimited permission to copy and/or distribute it,
@@ -11,12 +11,12 @@
#
# Set the make variables POPPLER_INCLUDES and POPPLER_LIBS to the CPPFLAGS and
# LIBS required for the `-lpoppler' library in libs/poppler/ of the TL tree.
-AC_DEFUN([KPSE_POPPLER_FLAGS],
-[AC_REQUIRE([KPSE_CHECK_WIN32])[]dnl
+AC_DEFUN([KPSE_POPPLER_FLAGS], [dnl
+AC_REQUIRE([KPSE_CHECK_WIN32])[]dnl
_KPSE_LIB_FLAGS([poppler], [poppler], [],
- [-IBLD/libs/poppler -IBLD/libs/poppler/goo -IBLD/libs/poppler/poppler],
+ [-IBLD/libs/poppler/include],
[BLD/libs/poppler/libpoppler.a], [],
- [], [${top_builddir}/../../libs/poppler/poppler/Stream.h])[]dnl
+ [], [${top_builddir}/../../libs/poppler/include/Stream.h])[]dnl
test "x$kpse_cv_have_win32" = xno || POPPLER_LIBS="$POPPLER_LIBS -lgdi32"
]) # KPSE_POPPLER_FLAGS
diff --git a/Build/source/m4/kpse-potrace-flags.m4 b/Build/source/m4/kpse-potrace-flags.m4
new file mode 100644
index 00000000000..f88936996d2
--- /dev/null
+++ b/Build/source/m4/kpse-potrace-flags.m4
@@ -0,0 +1,27 @@
+# Public macros for the TeX Live (TL) tree.
+# Copyright (C) 2013 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_POTRACE_FLAGS
+# ---------------
+# Provide the configure options '--with-system-potrace' (if in the TL tree),
+# '--with-potrace-includes', and '--with-potrace-libdir'.
+#
+# Set the make variables POTRACE_INCLUDES and POTRACE_LIBS to the CPPFLAGS and
+# LIBS required for the `-lpotrace' library in libs/potrace/ of the TL tree.
+AC_DEFUN([KPSE_POTRACE_FLAGS],
+[_KPSE_LIB_FLAGS([potrace], [potrace], [],
+ [-IBLD/libs/potrace/include], [BLD/libs/potrace/libpotrace.a], [],
+ [], [${top_builddir}/../../libs/potrace/include/potracelib.h])[]dnl
+]) # KPSE_POTRACE_FLAGS
+
+# KPSE_POTRACE_OPTIONS([WITH-SYSTEM])
+# --------------------------------
+AC_DEFUN([KPSE_POTRACE_OPTIONS], [_KPSE_LIB_OPTIONS([potrace], [$1])])
+
+# KPSE_POTRACE_SYSTEM_FLAGS
+# ----------------------
+AC_DEFUN([KPSE_POTRACE_SYSTEM_FLAGS], [_KPSE_LIB_FLAGS_SYSTEM([potrace], [potrace])])
diff --git a/Build/source/m4/kpse-t1lib-flags.m4 b/Build/source/m4/kpse-t1lib-flags.m4
deleted file mode 100644
index 5e3a73e9552..00000000000
--- a/Build/source/m4/kpse-t1lib-flags.m4
+++ /dev/null
@@ -1,29 +0,0 @@
-# Public macros for the TeX Live (TL) tree.
-# Copyright (C) 2009 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_T1LIB_FLAGS
-# ----------------
-# Provide the configure options '--with-system-t1lib' (if in the TL tree),
-# '--with-t1lib-includes', and '--with-t1lib-libdir'.
-#
-# Set the make variables T1LIB_INCLUDES and T1LIB_LIBS to the CPPFLAGS and
-# LIBS required for the `-lt1' library in libs/t1lib/ of the TL tree.
-AC_DEFUN([KPSE_T1LIB_FLAGS],
-[_KPSE_LIB_FLAGS([t1lib], [t1], [],
- [-IBLD/libs/t1lib], [BLD/libs/t1lib/libt1.a], [],
- [], [${top_builddir}/../../libs/t1lib/t1lib.h])[]dnl
-]) # KPSE_T1LIB_FLAGS
-
-# KPSE_T1LIB_OPTIONS([WITH-SYSTEM])
-# ---------------------------------
-AC_DEFUN([KPSE_T1LIB_OPTIONS], [_KPSE_LIB_OPTIONS([t1lib], [$1])])
-
-# KPSE_T1LIB_SYSTEM_FLAGS
-# -----------------------
-AC_DEFUN([KPSE_T1LIB_SYSTEM_FLAGS], [_KPSE_LIB_FLAGS_SYSTEM([t1lib], [t1])])
diff --git a/Build/source/m4/kpse-visibility.m4 b/Build/source/m4/kpse-visibility.m4
new file mode 100644
index 00000000000..740fc459a53
--- /dev/null
+++ b/Build/source/m4/kpse-visibility.m4
@@ -0,0 +1,74 @@
+# Public macros for the TeX Live (TL) tree.
+# Copyright (C) 2013 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_COMPILER_VISIBILITY
+# ------------------------
+# Set up compiler flags for C and C++ to hide external symbols.
+# This macro determines and substitutes VISIBILITY_CFLAGS for the C compiler
+# and, if applicable, VISIBILITY_CXXFLAGS for the C++ compiler. To activate
+# them a Makefile.am must use them, e.g., in AM_CFLAGS or AM_CXXFLAGS.
+AC_DEFUN([KPSE_COMPILER_VISIBILITY],
+[dnl arrange that AC_PROG_CC uses _KPSE_VISIBILITY_CFLAGS etc.
+AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_KPSE_VISIBILITY_CFLAGS],
+ [m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[_KPSE_VISIBILITY_CFLAGS
+])])
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_KPSE_VISIBILITY_CXXFLAGS],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_KPSE_VISIBILITY_CXXFLAGS
+])])
+]) # KPSE_COMPILER_VISIBILITY
+
+_KPSE_VISIBILITY_CFLAGS
+# ---------------------
+# Internal subroutine.
+# Set up compiler flags for C to hide external symbols.
+AC_DEFUN([_KPSE_VISIBILITY_CFLAGS], [dnl
+AC_REQUIRE([AC_PROG_CC])[]dnl
+_KPSE_VISIBILITY_FLAGS([C], [cflags])
+m4_define([_KPSE_VISIBILITY_CFLAGS], [])[]dnl
+]) # _KPSE_VISIBILITY_CFLAGS
+
+_KPSE_VISIBILITY_CXXFLAGS
+# -----------------------
+# Internal subroutine.
+# Set up compiler flags for C++ to hide external symbols.
+AC_DEFUN([_KPSE_VISIBILITY_CXXFLAGS], [dnl
+AC_REQUIRE([AC_PROG_CXX])[]dnl
+_KPSE_VISIBILITY_FLAGS([C++], [cxxflags])
+m4_define([_KPSE_VISIBILITY_CXXFLAGS], [])[]dnl
+]) # _KPSE_VISIBILITY_CFLAGS
+
+_KPSE_VISIBILITY_FLAGS(LANG, TAG)
+# -------------------------------
+# Internal subroutine.
+# Set up compiler flags for C or C++ to hide external symbols.
+m4_define([_KPSE_VISIBILITY_FLAGS], [dnl
+AC_CACHE_CHECK(AS_TR_CPP($2) [for $1 to hide external symbols],
+ [kpse_cv_visibility_$2],
+ [dnl
+AC_LANG_PUSH([$1])
+kpse_cv_visibility_$2=unknown
+kpse_save_flags=$AS_TR_CPP($2)
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <stdio.h>
+ extern void foo(void);
+ void foo(void){printf("foo\n");}]])])
+# FIXME: Add tests for non-GNU compilers
+for kpse_flag in '-fvisibility=hidden'; do
+ AS_TR_CPP($2)="$kpse_save_flags $kpse_flag"
+ AC_COMPILE_IFELSE([], [kpse_cv_visibility_$2=$kpse_flag; break])
+done
+AC_LANG_POP([$1])
+])
+AS_TR_CPP($2)=$kpse_save_flags
+AS_CASE([$kpse_cv_visibility_$2],
+ [unknown], [],
+ [AC_SUBST([VISIBILITY_]AS_TR_CPP($2), [$kpse_cv_visibility_$2])])
+]) # _KPSE_VISIBILITY_FLAGS
+
diff --git a/Build/source/m4/kpse-warnings.m4 b/Build/source/m4/kpse-warnings.m4
index 34c52844551..782674ef786 100644
--- a/Build/source/m4/kpse-warnings.m4
+++ b/Build/source/m4/kpse-warnings.m4
@@ -1,5 +1,5 @@
# Public macros for the TeX Live (TL) tree.
-# Copyright (C) 2009-2012 Peter Breitenlohner <tex-live@tug.org>
+# Copyright (C) 2009-2013 Peter Breitenlohner <tex-live@tug.org>
#
# This file is free software; the copyright holders
# give unlimited permission to copy and/or distribute it,
@@ -7,7 +7,7 @@
# KPSE_COMPILER_WARNINGS
# ----------------------
-# Set up compiler warnings for C and C++.
+# Set up compiler warnings for (Objective) C and (Objective) C++.
# This macro determines and substitutes WARNING_CFLAGS for the C compiler
# and, if applicable, WARNING_CXXFLAGS for the C++ compiler. To activate
# them a Makefile.am must use them, e.g., in AM_CFLAGS or AM_CXXFLAGS.