summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorFrancesco Salvestrini <salvestrini@gmail.com>2009-09-18 00:08:56 +0200
committerFrancesco Salvestrini <salvestrini@gmail.com>2009-09-18 00:08:56 +0200
commit090919996132751b4bf413932fd1dc95754ca2d4 (patch)
tree1388391566db12258a93d222e89eeb711348ee63 /m4
parent6c2ee7a790f92e422e727e5639281a786432ec66 (diff)
downloadautoconf-archive-090919996132751b4bf413932fd1dc95754ca2d4.tar.gz
Fixed AX_GCC_LIBSUPCXX
Diffstat (limited to 'm4')
-rw-r--r--m4/ax_gcc_libsupcxx.m432
1 files changed, 25 insertions, 7 deletions
diff --git a/m4/ax_gcc_libsupcxx.m4 b/m4/ax_gcc_libsupcxx.m4
index d7dca12..d30832e 100644
--- a/m4/ax_gcc_libsupcxx.m4
+++ b/m4/ax_gcc_libsupcxx.m4
@@ -9,11 +9,12 @@
# DESCRIPTION
#
# AX_GCC_LIBSUPCXX defines VARIABLE as the absolute path to libsupc++.a if
-# it is available on the system, empty otherwise
+# it is available on the system, empty otherwise.
#
# LICENSE
#
# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+# Copyright (c) 2009 Alessandro Massignan <ff0000.it@gmail.com>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -42,10 +43,27 @@
# exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_GCC_LIBSUPCXX], [
- AX_GCC_LIB([libsupc++.a],[
- AX_GCC_INSTALL_DIR([GCC_INSTALL_DIR])
- $1="$GCC_INSTALL_DIR/libsupc++.a"
- ],[
- $1=""
- ])
+ AX_GCC_LIBRARIES_DIR([GCC_LIBRARIES_DIR])
+ AS_IF([test -z "$GCC_LIBRARIES_DIR"],[
+ AC_MSG_ERROR([problems detecting gcc libraries dir])
+ ])
+
+ AC_MSG_CHECKING([for libsupc++.a])
+
+ ax_gcc_libraries_dir_IFS=$IFS
+ IFS=":"
+
+ $1=""
+ for i in $GCC_LIBRARIES_DIR
+ do
+ AS_IF([test -f "$i/libsupc++.a"],[
+ IFS=$ax_gcc_libraries_dir_IFS
+ $1="$i/libsupc++.a"
+ break
+ ])
+ done
+
+ IFS=$ax_gcc_libraries_dir_IFS
+
+ AC_MSG_RESULT([$$1])
])