On Tue, Aug 01, 2006 at 02:12:31PM +0900, Peter O'Gorman wrote:
> 
> On Aug 1, 2006, at 1:38 PM, Albert Chin wrote:
> 
> >Sun C++ supports two C++ libraries, -library=Cstd (default), and the
> >newer -library=stlport4. They are incompatible. Therefore, libtool's
> >use of -lCstd (equivalent to -library=Cstd) should not be assigned to
> >$postdeps if -library=stlport4 is in CXXFLAGS. Patch attached.
> >
> >Patch against branch-1-5 and branch-2.0 attached.
> 
> This makes sense, but branch-2-0 is dead :-)
> 
> Before I apply it though, do we also want to check CXX for - 
> library=stlport4 ? Someone could do CXX='CC -library=stlport4' and  
> expect libtool not to add CStd etc. Can't we do
> 
> case        " $CXX $CXXFLAGS " in
>    *" -library=stlport4 "*) solaris_use_stlport4=yes ;;
> esac
> 
> To save the loop too?

Good catch. Updated patch attached.

2006-08-01  Albert Chin <[EMAIL PROTECTED]>

        * libtool.m4 (AC_LIBTOOL_POSTDEP_PREDEP) [ solaris ]:
        Don't set $postdeps to "-lCstd -lCrun" if
        "-library=stlport4" set in CXXFLAGS as stlport4 C++
        library incompatible with Cstd C++ library. Use
        '-library=Cstd -library=Crun' instead of '-lCstd -lCrun'.

2006-08-01  Albert Chin <[EMAIL PROTECTED]>

        * libltdl/m4/libtool.m4 (_LT_SYS_HIDDEN_LIBDEPS) [ solaris ]:
        Don't set $postdeps to "-lCstd -lCrun" if
        "-library=stlport4" set in CXXFLAGS as stlport4 C++
        library incompatible with Cstd C++ library. Use
        '-library=Cstd -library=Crun' instead of '-lCstd -lCrun'.

-- 
albert chin ([EMAIL PROTECTED])
Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.160
diff -u -p -r1.314.2.160 libtool.m4
--- libtool.m4  28 Jul 2006 16:57:36 -0000      1.314.2.160
+++ libtool.m4  1 Aug 2006 16:57:51 -0000
@@ -3921,10 +3928,22 @@ linux*)
 solaris*)
   case $cc_basename in
   CC*)
+    # 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
+
     # 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.
-    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
     ;;
   esac
   ;;
Index: libltdl/m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v
retrieving revision 1.76
diff -u -p -r1.76 libtool.m4
--- libltdl/m4/libtool.m4       28 Jul 2006 17:01:05 -0000      1.76
+++ libltdl/m4/libtool.m4       1 Aug 2006 16:58:11 -0000
@@ -6338,7 +6338,21 @@ linux*)
   case `$CC -V 2>&1 | sed 5q` in
   *Sun\ C*)
     # Sun C++ 5.9
-    _LT_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.
+    for cc_flag in $CXXFLAGS; do
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
     ;;
   esac
   ;;

Reply via email to