diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-03-29 16:03:30 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-03-29 16:03:30 +0000 |
commit | 1de70c5fe1e18157efb4a592390ce08534139aa0 (patch) | |
tree | e95068190830febe15dfaab6f0600fb769492706 /Build/source/m4 | |
parent | 5b8dcec4983808da1a0b25a4f41435b03370a79f (diff) |
new build system: multiplatform, cxx-runtime-hack, luatex
git-svn-id: svn://tug.org/texlive/trunk@12563 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/m4')
-rw-r--r-- | Build/source/m4/kpse-cxx-hack.m4 | 89 | ||||
-rw-r--r-- | Build/source/m4/kpse-options.m4 | 29 | ||||
-rw-r--r-- | Build/source/m4/kpse-setup.m4 | 12 |
3 files changed, 127 insertions, 3 deletions
diff --git a/Build/source/m4/kpse-cxx-hack.m4 b/Build/source/m4/kpse-cxx-hack.m4 new file mode 100644 index 00000000000..94f0eb6cf16 --- /dev/null +++ b/Build/source/m4/kpse-cxx-hack.m4 @@ -0,0 +1,89 @@ +# Public macros for the teTeX / 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_ENABLE_CXX_HACK +# -------------------- +# Provide the configure option '--enable-cxx-runtime-hack'. +AC_DEFUN([KPSE_ENABLE_CXX_HACK], +[AC_ARG_ENABLE([cxx-runtime-hack], + AS_HELP_STRING([--enable-cxx-runtime-hack], + [link C++ runtime statically], + [29]))[]dnl +]) # KPSE_ENABLE_CXX_HACK + +# KPSE_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 +# 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 + _KPSE_CXX_HACK +fi +if $cpp_link_hack; then + CXXLD='$(top_builddir)/CXXLD.sh' + CXX_HACK_DEPS=$CXXLD + cxxld_sh="#! ${CONFIG_SHELL-/bin/sh} +# CXXLD.sh. Generated by configure. +set -- $CXX \"\$[]@\" $CXX_HACK_LIBS +echo \"\$[]0:\" \"\$[]@\" +exec \"\$[]@\"" + AC_CONFIG_FILES([CXXLD.sh:Makefile.in], + [echo "$cxxld_sh" >CXXLD.sh; chmod +x CXXLD.sh], + [cxxld_sh='$cxxld_sh']) +else + CXXLD='$(CXX)' +fi +AC_SUBST([CXXLD]) +AC_SUBST([CXX_HACK_DEPS]) +AC_SUBST([CXX_HACK_LIBS]) +]) # KPSE_CXX_HACK + +# _KPSE_CXX_HACK() +# ---------------- +# internal subroutine +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 +#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) +fi +AC_LANG_POP([C++]) +]) # _KPSE_CXX_HACK diff --git a/Build/source/m4/kpse-options.m4 b/Build/source/m4/kpse-options.m4 new file mode 100644 index 00000000000..159c63b5f16 --- /dev/null +++ b/Build/source/m4/kpse-options.m4 @@ -0,0 +1,29 @@ +# Public macros for the teTeX / 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_OPTIONS +# ------------ +# Provide configure options used by the higher level TL directories +# as well as by packages maintained independently. +AC_DEFUN([KPSE_OPTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])[]dnl +AC_ARG_ENABLE([multiplatform], + AS_HELP_STRING([--enable-multiplatform], + [put executables into bin/PLATFORM and libraries into lib/PLATFORM]))[]dnl +if test "x$enable_multiplatform" = xyes; then + if test "x$bindir" = 'x${exec_prefix}/bin'; then + bindir="$bindir/$host" + ac_configure_args="$ac_configure_args '--bindir=$bindir'" + fi + if test "x$libdir" = 'x${exec_prefix}/lib'; then + libdir="$libdir/$host" + ac_configure_args="$ac_configure_args '--libdir=$libdir'" + fi +fi +]) # KPSE_OPTIONS diff --git a/Build/source/m4/kpse-setup.m4 b/Build/source/m4/kpse-setup.m4 index 61996a77ac0..8eeb4a22a87 100644 --- a/Build/source/m4/kpse-setup.m4 +++ b/Build/source/m4/kpse-setup.m4 @@ -19,6 +19,12 @@ AC_DEFUN([KPSE_SETUP], [m4_define([kpse_TL], [$1])[]dnl m4_define([kpse_indent_26], [28])[]dnl m4_define([kpse_indent_28], [30])[]dnl +AC_ARG_ENABLE([all-pkgs], + AS_HELP_STRING([--disable-all-pkgs], + [do not build packages unless explicitly enabled]))[]dnl +test "x$enable_all_pkgs" = xno || enable_all_pkgs=yes +KPSE_ENABLE_CXX_HACK +KPSE_OPTIONS KPSE_WEB2C_PREPARE m4_sinclude(kpse_TL[ac/withenable.ac]) m4_sinclude(kpse_TL[utils/ac/withenable.ac]) @@ -46,9 +52,9 @@ AC_ARG_ENABLE([$1], [($4) ])[package]))[]dnl case $enable_[]AS_TR_SH($1) in #( yes|no);; #( - *) AC_MSG_NOTICE([Assuming `--]m4_if(Kpse_with, [no], [dis], [en])[able-$1']) - enable_[]AS_TR_SH($1)=Kpse_with - ac_configure_args="$ac_configure_args '--[]m4_if(Kpse_with, [no], [dis], [en])able-$1'";; + *) enable_[]AS_TR_SH($1)=m4_if(Kpse_with, [yes], [$enable_all_pkgs], [no]) + AC_MSG_NOTICE([Assuming `--enable-$1=$enable_]AS_TR_SH($1)[']) + ac_configure_args="$ac_configure_args '--enable-$1=$enable_[]AS_TR_SH($1)'";; esac m4_popdef([Kpse_with])[]dnl m4_ifval([$2], [ |