]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Support for g++ with non-GNU ld.
authorBruno Haible <bruno@clisp.org>
Mon, 11 Nov 2002 13:31:40 +0000 (13:31 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:08:50 +0000 (12:08 +0200)
libasprintf/configure.in

index b66ecf4dc02737802b8faa4536f896c118c3fbb6..80978924583b656e8fee71350fa74ebcefa83b82 100644 (file)
@@ -50,7 +50,7 @@ SunPro C
 SunPro C++
 #endif
 EOF
-if $CXX -E conftest.cc  | grep SunPro > /dev/null ; then
+if $CXX -E conftest.cc | grep SunPro > /dev/null ; then
   # SUNWspro CC, defines __SUNPRO_CC
   cxxcmd=CC
   for word in $CXX; do
@@ -75,10 +75,37 @@ if $CXX -E conftest.cc  | grep SunPro > /dev/null ; then
   case "$cxxcmd" in
     */bin/CC)
       cxxdir=`echo "$cxxcmd" | sed -e 's,/bin/CC$,,'`
-      LIBCXX="-L$cxxdir -lCstd -lCrun"
+      LIBCXX="-L$cxxdir/lib -lCstd -lCrun"
       ;;
   esac
 fi
+cat > conftest.cc <<EOF
+#ifdef __GNUC__
+GCC
+#endif
+EOF
+if $CXX -E conftest.cc | grep GCC > /dev/null ; then
+  # GNU g++
+changequote(,)dnl
+  lib1=`g++ --print-file-name libstdc++.a`
+  case "$lib1" in
+    */*)
+      libdir1=`echo "$lib1" | sed -e 's,/[^/]*$,,'`
+      LIBCXX="$LIBCXX -L$libdir1"
+      ;;
+  esac
+  LIBCXX="$LIBCXX -lstdc++"
+  lib2=`g++ --print-file-name libgcc.a`
+  case "$lib2" in
+    */*)
+      libdir2=`echo "$lib2" | sed -e 's,/[^/]*$,,'`
+      LIBCXX="$LIBCXX -L$libdir2"
+      ;;
+  esac
+  LIBCXX="$LIBCXX -lgcc"
+  LIBCXX="$LIBCXX -lm"
+changequote([, ])dnl
+fi
 rm -f conftest.cc
 AC_SUBST(LIBCXX)