From 09950a732cfa76559d18b3540d69bf7eed235171 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Mon, 16 Nov 2009 09:51:30 +0000 Subject: 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 --- Build/source/m4/kpse-cxx-hack.m4 | 2 +- Build/source/m4/kpse-lt-hack.m4 | 37 +++++++++++++++++++++++++++++++++++++ Build/source/m4/kpse-setup.m4 | 8 ++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 Build/source/m4/kpse-lt-hack.m4 (limited to 'Build/source/m4') diff --git a/Build/source/m4/kpse-cxx-hack.m4 b/Build/source/m4/kpse-cxx-hack.m4 index 75a3ac89956..9beec894270 100644 --- a/Build/source/m4/kpse-cxx-hack.m4 +++ b/Build/source/m4/kpse-cxx-hack.m4 @@ -55,7 +55,7 @@ AC_SUBST([CXX_HACK_LIBS]) # _KPSE_CXX_HACK() # ---------------- -# internal subroutine +# Internal subroutine. m4_define([_KPSE_CXX_HACK], [ AC_LANG_PUSH([C++]) AC_CHECK_HEADERS([iostream]) 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 +# +# 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 + diff --git a/Build/source/m4/kpse-setup.m4 b/Build/source/m4/kpse-setup.m4 index 2579286c11a..765a9fd7f8e 100644 --- a/Build/source/m4/kpse-setup.m4 +++ b/Build/source/m4/kpse-setup.m4 @@ -41,6 +41,13 @@ if test "x$enable_native_texlive_build" = xyes; then [enable_cxx_runtime_hack=yes ac_configure_args="$ac_configure_args '--enable-cxx-runtime-hack'"]) fi +AS_CASE([$enable_libtool_hack], + [yes | no], [:], + [AS_CASE([$host_os], + [linux* | solaris*], + [enable_libtool_hack=yes], + [enable_libtool_hack=no]) + ac_configure_args="$ac_configure_args '--enable-libtool-hack=$enable_libtool_hack'"]) AS_CASE([$enable_shared], [no], [:], [yes ], [AS_IF([test "x$enable_native_texlive_build" = xyes], @@ -55,6 +62,7 @@ AS_CASE([$enable_texlive_build], ac_configure_args="$ac_configure_args '--enable-texlive-build'"]) KPSE_OPTIONS KPSE_ENABLE_CXX_HACK +KPSE_ENABLE_LT_HACK KPSE_LIBS_PREPARE KPSE_WEB2C_PREPARE AS_CASE([$with_x], -- cgit v1.2.3