]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtool: more carefully avoid automatic -Cstd -Crun on Sun Pro CXX.
authorGary V. Vaughan <gary@gnu.org>
Fri, 12 Dec 2014 13:33:40 +0000 (13:33 +0000)
committerGary V. Vaughan <gary@gnu.org>
Fri, 12 Dec 2014 15:01:01 +0000 (15:01 +0000)
* m4/libtool.m4 (_LT_FUNC_SUNCC_CSTD_ABI): New function factored out
of repeated code.  Take note of other known -Cstd incompatible
compiler flags.
(_LT_SYS_HIDDEN_LIBDEPS): Use it to determine whether -Cstd -Crun
can be safely added to postdeps with Sun Pro CXX.
* NEWS: Update.
* NO-THANKS: Add Marc Glisse.
Reported by Marc Glisse

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
NEWS
NO-THANKS
m4/libtool.m4

diff --git a/NEWS b/NEWS
index 87926bda89e9cbafdd817f8559ce54024af01496..c2f667b405a487f7197c9eb7075a329d11edc380 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,14 @@ NEWS - list of user-visible changes between releases of GNU Libtool
     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`
+    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
+    them if any of `-std=c++[0-9][0-9]`, `-library=stdcxx4` or
+    `-compat=g` were found in CXX or CXXFLAGS when the Sun C++ compiler
+    is detected.
+
 
 * Noteworthy changes in release 2.4.4 (2014-11-29) [stable]
 
index dc33834838edada5e2683c663b769c6626b884e4..7f592768e4c65a2a3adba04fa1a178f44e43d223 100644 (file)
--- a/NO-THANKS
+++ b/NO-THANKS
@@ -100,6 +100,7 @@ Lawrence Velázquez         larryv@macports.org
 Lionel Landwerlin              llandwerlin@gmail.com
 Maciej Helminiak               dion2@wp.pl
 Mahesh Narayanamurthi          mahesh.mach@gmail.com
+Marc Glisse                    marc.glisse@inria.fr
 Marcel Loose                   loose@astron.nl
 Markus Duft                    markus.duft@salomon.at
 Martin Doucha                  doucha@integri.cz
index 0c120ff96f1f1ded7f048c36b5463932d71449bd..22a72849ebf76c14459092f0fd6b5cb8eb7bdae7 100644 (file)
@@ -7422,6 +7422,28 @@ func_stripname_cnf ()
 } # 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
@@ -7430,6 +7452,7 @@ func_stripname_cnf ()
 # 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)=
@@ -7603,20 +7626,10 @@ interix[[3-9]]*)
 
 linux*)
   case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
+  *Sun\ C*) # Sun C++ 5.9
+    func_suncc_cstd_abi
 
-    if test yes != "$solaris_use_stlport4"; then
+    if test no != "$suncc_use_cstd_abi"; then
       _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
     fi
     ;;
@@ -7626,20 +7639,9 @@ linux*)
 solaris*)
   case $cc_basename in
   CC* | sunCC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
+    func_suncc_cstd_abi
 
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test yes != "$solaris_use_stlport4"; then
+    if test no != "$suncc_use_cstd_abi"; then
       _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
     fi
     ;;