summaryrefslogtreecommitdiffstats
path: root/libasprintf/configure.in
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2002-11-11 13:31:40 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:08:50 +0200
commit205bd96a0dcff2945bdbc2c0fa40c99fc1994202 (patch)
treec75495c2581d0f31f619e2e611e5112884ffc56b /libasprintf/configure.in
parent5873bb0f087bf863f3be93b73a471bd9e74d6f4b (diff)
downloadexternal_gettext-205bd96a0dcff2945bdbc2c0fa40c99fc1994202.zip
external_gettext-205bd96a0dcff2945bdbc2c0fa40c99fc1994202.tar.gz
external_gettext-205bd96a0dcff2945bdbc2c0fa40c99fc1994202.tar.bz2
Support for g++ with non-GNU ld.
Diffstat (limited to 'libasprintf/configure.in')
-rw-r--r--libasprintf/configure.in31
1 files changed, 29 insertions, 2 deletions
diff --git a/libasprintf/configure.in b/libasprintf/configure.in
index b66ecf4..8097892 100644
--- a/libasprintf/configure.in
+++ b/libasprintf/configure.in
@@ -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)