summaryrefslogtreecommitdiff
path: root/Build/source/m4
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2009-03-30 11:13:40 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2009-03-30 11:13:40 +0000
commitcebdda463446a4efc44c356c0e8c85d4a8932373 (patch)
tree991922e9198a0245e34ee54e7362a19828666d68 /Build/source/m4
parentf6449e724e0cf3a3559dd53daf9ba5e23ce783e5 (diff)
remove Omega and references to the defunct eOmega and pdfeTeX
git-svn-id: svn://tug.org/texlive/trunk@12570 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/m4')
-rw-r--r--Build/source/m4/kpse-cxx-hack.m460
1 files changed, 33 insertions, 27 deletions
diff --git a/Build/source/m4/kpse-cxx-hack.m4 b/Build/source/m4/kpse-cxx-hack.m4
index 94f0eb6cf16..1f2527ba204 100644
--- a/Build/source/m4/kpse-cxx-hack.m4
+++ b/Build/source/m4/kpse-cxx-hack.m4
@@ -1,8 +1,9 @@
# Public macros for the teTeX / TeX Live (TL) tree.
+# Copyright (C) 2002 Olaf Weber <olaf@infovore.xs4all.nl>
# 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,
+# 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
@@ -22,19 +23,20 @@ AC_DEFUN([KPSE_ENABLE_CXX_HACK],
# Try statically linking C++ runtime library (g++ only)
# and define CXX_HACK_LIBS with required flags.
# Since Libtool reshuffles the argument list, we define CXXLD
-# as wrapper script appending these flags to g++ as invoked
+# as wrapper script appending these flags to g++ as invoked
# by Libtool when linking progams (but not shared libraries).
#
AC_DEFUN([KPSE_CXX_HACK],
[AC_REQUIRE([AC_PROG_CXX])[]dnl
AC_REQUIRE([KPSE_ENABLE_CXX_HACK])[]dnl
cpp_link_hack=false
-if test "x$GXX" = xyes && test "x$enable_cxx_runtime_hack" = xyes; then
+if test "x$GXX:$enable_cxx_runtime_hack" = xyes:yes; then
_KPSE_CXX_HACK
fi
-if $cpp_link_hack; then
+if test "x$kpse_cv_cxx_flags" = xok; then
CXXLD='$(top_builddir)/CXXLD.sh'
CXX_HACK_DEPS=$CXXLD
+ CXX_HACK_LIBS=$kpse_cv_cxx_flags
cxxld_sh="#! ${CONFIG_SHELL-/bin/sh}
# CXXLD.sh. Generated by configure.
set -- $CXX \"\$[]@\" $CXX_HACK_LIBS
@@ -57,33 +59,37 @@ AC_SUBST([CXX_HACK_LIBS])
m4_define([_KPSE_CXX_HACK], [
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([iostream])
-AC_MSG_CHECKING([for statically linking C++ runtime library])
-AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#ifdef HAVE_IOSTREAM
+AC_CACHE_CHECK([for statically linking C++ runtime library],
+ [kpse_cv_cxx_hack],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#ifdef HAVE_IOSTREAM
#include <iostream>
using namespace std;
#else
#include <iostream.h>
#endif]],
- [[cout <<"worksok\n";]])])
-flags_try0='-nodefaultlibs -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lm'
-flags_try1='-lgcc_eh -lgcc -lc -lgcc_eh -lgcc'
-flags_try2='-lgcc -lc -lgcc'
-kpse_save_LIBS=$LIBS
-for flags in "$flags_try1" "$flags_try2"; do
- LIBS="$kpse_save_LIBS $flags_try0 $flags"
- AC_LINK_IFELSE([],
- [case `(./conftest$ac_exeext; exit) 2>/dev/null` in
- worksok)
- cpp_link_hack=true; break;;
- esac])
-done
-LIBS=$kpse_save_LIBS
-
-if $cpp_link_hack; then
- CXX_HACK_LIBS="$flags_try0 $flags"
- AC_MSG_RESULT(ok using $CXX_HACK_LIBS)
-else
- AC_MSG_RESULT(not supported)
+ [[cout <<"worksok\n";]])])
+ flags_try0='-nodefaultlibs -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lm'
+ flags_try1='-lgcc_eh -lgcc -lc -lgcc_eh -lgcc'
+ flags_try2='-lgcc -lc -lgcc'
+ kpse_save_LIBS=$LIBS
+ cpp_link_hack=false
+ for flags in "$flags_try1" "$flags_try2"; do
+ LIBS="$kpse_save_LIBS $flags_try0 $flags"
+ AC_LINK_IFELSE([],
+ [AS_IF([test "x$cross_compiling" = xyes],
+ [cpp_link_hack=true; break],
+ [AS_CASE([`(./conftest$ac_exeext; exit) 2>/dev/null`],
+ [worksok], [cpp_link_hack=true; break])])])
+ done
+ LIBS=$kpse_save_LIBS
+ if $cpp_link_hack; then
+ kpse_cv_cxx_hack=ok
+ kpse_cv_cxx_flags="$flags_try0 $flags"
+ else
+ kpse_cv_cxx_hack="not supported"
+ fi])
+if test "x$kpse_cv_cxx_hack" = xok; then
+ AC_MSG_NOTICE([using $kpse_cv_cxx_flags])
fi
AC_LANG_POP([C++])
]) # _KPSE_CXX_HACK