summaryrefslogtreecommitdiff
path: root/Build/source/m4/kpse-lt-hack.m4
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2009-11-16 09:51:30 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2009-11-16 09:51:30 +0000
commit09950a732cfa76559d18b3540d69bf7eed235171 (patch)
tree00e395f5458e8c3d6904d313d1d513fc9d1dabfb /Build/source/m4/kpse-lt-hack.m4
parent6d04c5f72978b866477b0608d68285045337b061 (diff)
build system: --enable-libtool-hack to prvent linking with dependency_libs
git-svn-id: svn://tug.org/texlive/trunk@16027 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/m4/kpse-lt-hack.m4')
-rw-r--r--Build/source/m4/kpse-lt-hack.m437
1 files changed, 37 insertions, 0 deletions
diff --git a/Build/source/m4/kpse-lt-hack.m4 b/Build/source/m4/kpse-lt-hack.m4
new file mode 100644
index 00000000000..fc5a78dec75
--- /dev/null
+++ b/Build/source/m4/kpse-lt-hack.m4
@@ -0,0 +1,37 @@
+# Public macros for the TeX Live (TL) tree.
+# Copyright (C) 2009 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.
+
+# serial 0
+
+# KPSE_ENABLE_LT_HACK
+# -------------------
+# Provide the configure option '--enable-libtool-hack'.
+AC_DEFUN([KPSE_ENABLE_LT_HACK],
+[AC_ARG_ENABLE([libtool-hack],
+ AS_HELP_STRING([--enable-libtool-hack],
+ [ignore libtool dependency_libs]))[]dnl
+]) # KPSE_ENABLE_LT_HACK
+
+# KPSE_LT_HACK()
+# --------------
+# Try to ignore libtool dependency_libs when possible, e.g., on systems
+# using ELF shared libraries.
+AC_DEFUN([KPSE_LT_HACK],
+[AC_REQUIRE([KPSE_ENABLE_LT_HACK])[]dnl
+AC_PROVIDE_IFELSE([LT_INIT], ,
+ [m4_fatal([$0: requires libtool])])[]dnl
+AC_PROVIDE_IFELSE([LT_OUTPUT],
+ [m4_fatal([$0: too late])])[]dnl
+_LT_CONFIG_SAVE_COMMANDS([## $0: Prevent libtool from linking dependency_libs
+if test "x$enable_libtool_hack" = xyes; then
+ sed '/for search_ext in/s/ \.la / /' "$ofile" >"$cfgfile"
+ mv "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+fi], [enable_libtool_hack='$enable_libtool_hack'])
+]) # KPSE_LT_HACK
+