summaryrefslogtreecommitdiff
path: root/Build/source/m4/kpse-lt-hack.m4
diff options
context:
space:
mode:
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
+