summaryrefslogtreecommitdiff
path: root/buildlib/tools.m4
diff options
context:
space:
mode:
Diffstat (limited to 'buildlib/tools.m4')
-rw-r--r--buildlib/tools.m445
1 files changed, 45 insertions, 0 deletions
diff --git a/buildlib/tools.m4 b/buildlib/tools.m4
index d47d79e7e..281a4ec1d 100644
--- a/buildlib/tools.m4
+++ b/buildlib/tools.m4
@@ -88,3 +88,48 @@ AC_DEFUN(ah_NUM_PROCS,
AC_MSG_RESULT([$NUM_PROCS])
AC_SUBST(NUM_PROCS)
])
+
+AC_DEFUN(ah_GLIBC_VER,
+ [AC_MSG_CHECKING([glibc version])
+ dummy=if$$
+ cat <<_GLIBC_>$dummy.c
+#include <features.h>
+#include <stdio.h>
+int main(int argc, char **argv) { printf("libc6.%d",__GLIBC_MINOR__); exit(0); }
+_GLIBC_
+ ${CC-cc} $dummy.c -o $dummy
+ if test "$?" = 0; then
+ GLIBC_VER=`./$dummy`
+ AC_MSG_RESULT([$GLIBC_VER])
+ GLIBC_VER="-$GLIBC_VER"
+ else
+ AC_MSG_WARN([cannot determine GNU C library minor version number])
+ fi
+ rm -f $dummy $dummy.c
+ AC_SUBST(GLIBC_VER)
+])
+
+AC_DEFUN(ah_LIBSTDCPP_VER,
+ [AC_MSG_CHECKING([libstdc++ version])
+ dummy=if$$
+ cat <<_LIBSTDCPP_>$dummy.cc
+#include <features.h>
+#include <stdio.h>
+int main(int argc, char **argv) { exit(0); }
+_LIBSTDCPP_
+ ${CXX-c++} $dummy.cc -o $dummy
+
+ if test "$?" = 0; then
+ soname=`objdump -p ./$dummy |grep NEEDED|grep libstd`
+ LIBSTDCPP_VER=`echo $soname | sed -e 's/.*NEEDED.*libstdc++-libc.*-\(.*\).so.\(.*\)/\2-\1/'`
+ fi
+ rm -f $dummy $dummy.cc
+
+ if test -z "$LIBSTDCPP_VER"; then
+ AC_MSG_WARN([cannot determine standard C++ library version number])
+ else
+ AC_MSG_RESULT([$LIBSTDCPP_VER])
+ LIBSTDCPP_VER="-$LIBSTDCPP_VER"
+ fi
+ AC_SUBST(LIBSTDCPP_VER)
+])