Index: libtool.m4 =================================================================== RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v retrieving revision 1.314.2.161 diff -u -p -r1.314.2.161 libtool.m4 --- libtool.m4 2 Aug 2006 13:35:37 -0000 1.314.2.161 +++ libtool.m4 3 Aug 2006 13:45:30 -0000 @@ -3913,7 +3920,23 @@ linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 - _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun' + + # 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 "*) + suncpp_use_stlport4=yes + ;; + esac + + # 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 "$suncpp_use_stlport4" != yes; then + _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi ;; esac ;; @@ -3927,14 +3950,14 @@ solaris*) # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) - solaris_use_stlport4=yes + suncpp_use_stlport4=yes ;; esac # 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 "$solaris_use_stlport4" != yes; then + if test "$suncpp_use_stlport4" != yes; then _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;;