diff options
-rw-r--r-- | NEWS | 9 | ||||
-rw-r--r-- | build-aux/ltmain.in | 49 | ||||
-rw-r--r-- | m4/libtool.m4 | 84 |
3 files changed, 85 insertions, 57 deletions
@@ -21,13 +21,20 @@ NEWS - list of user-visible changes between releases of GNU Libtool - Fix a 2.4.4 regression so that libltdl subprojects do not warn about missing libltdl/libltdl directory as in prior releases. + - When using Sun C++ on Solaris or GNU/Linux we used to set libtool's + postdeps permanently, based on the contents of $CXX and $CXXFLAGS at + configure time, which was brittle and error-prone. Now, we no + longer check for a SunCC ABI at configure time, but augment the + postdeps at libtool time based on the current invocation flags on + each call. + ** Changes in supported systems or compilers: - /usr/local prefixed rpaths are now added to the link-line on ia64-hp-hpux*, because the default system runtime loader path does not contain them. - - Previously, when using Sun C++ on Solaris or Linux, `-Cstd -Crun` + - Previously, when using Sun C++ on Solaris or GNU/Linux, `-Cstd -Crun` flags were added to $postdeps unless CXX or CXXFLAGS contained `-library=stlport4`. Newer releases have added other compiler flags that are also incompatible with `-Cstd -Crun`, so now we don't add diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 42048dfe..b901c1b4 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -4549,6 +4549,24 @@ func_win32_import_lib_p () esac } +# func_suncc_cstd_abi +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! +# Several compiler flags select an ABI that is incompatible with the +# Cstd library. Avoid specifying it if any are in CXXFLAGS. +func_suncc_cstd_abi () +{ + $debug_cmd + + case " $compile_command " in + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) + suncc_use_cstd_abi=no + ;; + *) + suncc_use_cstd_abi=yes + ;; + esac +} + # func_mode_link arg... func_mode_link () { @@ -6690,6 +6708,37 @@ func_mode_link () eval $var=\"$tmp_libs\" done # for var fi + + # Add Sun CC postdeps if required: + test CXX = "$tagname" && { + case $host_os in + linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C++ 5.9 + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + + solaris*) + func_cc_basename "$CC" + case $func_cc_basename_result in + CC* | sunCC*) + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + esac + } + # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 22a72849..f8799880 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -103,19 +103,36 @@ dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + # _LT_CC_BASENAME(CC) # ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result ]) @@ -736,6 +753,7 @@ _LT_EOF ## -------------------------------------- ## _LT_PREPARE_MUNGE_PATH_LIST +_LT_PREPARE_CC_BASENAME _LT_EOF @@ -7423,27 +7441,6 @@ func_stripname_cnf () ])# _LT_FUNC_STRIPNAME_CNF -# _LT_FUNC_SUNCC_CSTD_ABI -# ----------------------- -# func_suncc_cstd_abi -# Several compiler flags select an ABI that is -# incompatible with the Cstd library. Avoid specifying -# it if any are in CXXFLAGS. -m4_defun([_LT_FUNC_SUNCC_CSTD_ABI], [[ -func_suncc_cstd_abi () -{ - case " $CXX $CXXFLAGS " in - *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) - suncc_use_cstd_abi=no - ;; - *) - suncc_use_cstd_abi=yes - ;; - esac -} # func_suncc_cstd_abi -]])# _LT_FUNC_SUNCC_CSTD_ABI - - # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -7452,7 +7449,6 @@ func_suncc_cstd_abi () # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_FUNC_SUNCC_CSTD_ABI])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= @@ -7623,30 +7619,6 @@ interix[[3-9]]*) _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C++ 5.9 - func_suncc_cstd_abi - - if test no != "$suncc_use_cstd_abi"; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC* | sunCC*) - func_suncc_cstd_abi - - if test no != "$suncc_use_cstd_abi"; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; esac ]) |