From 495f0d105f809a265c34aa9a0eb20af0dcdcf283 Mon Sep 17 00:00:00 2001 From: Martin Lucina Date: Thu, 18 Feb 2010 17:29:14 +0100 Subject: Fix detection of libstdc++ We only care about libstdc++ when using GNU C++. Further, libstdc++ depends on libm on some platforms, fix this. --- configure.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 45def38..7fbc2cf 100644 --- a/configure.in +++ b/configure.in @@ -55,8 +55,12 @@ AC_PROG_SED AC_PROG_AWK # Checks for libraries. -AC_CHECK_LIB(pthread, pthread_create) -AC_CHECK_LIB(stdc++, malloc) +AC_CHECK_LIB([pthread], [pthread_create]) +# If using GNU C++, libstdc++ must be available. +if test "x$GXX" = "xyes"; then + AC_CHECK_LIB([stdc++], [main], , + [AC_MSG_ERROR([cannot link with -lstdc++])], [-lm]) +fi # Extra CXXFLAGS are appended at the end of CXXFLAGS for libzmq. LIBZMQ_EXTRA_CXXFLAGS="" @@ -139,7 +143,6 @@ case "${host_os}" in # Define on FreeBSD to enable all library features CPPFLAGS="-D__BSD_VISIBLE $CPPFLAGS" AC_DEFINE(ZMQ_HAVE_FREEBSD, 1, [Have FreeBSD OS]) - LIBS="-pthread" ;; *darwin*) # Define on Darwin to enable all library features @@ -147,14 +150,12 @@ case "${host_os}" in pedantic="no" werror="no" AC_DEFINE(ZMQ_HAVE_OSX, 1, [Have DarwinOSX OS]) - LIBS="-pthread" LIBZMQ_EXTRA_CXXFLAGS+="-Wno-uninitialized" ;; *openbsd*) # Define on OpenBSD to enable all library features CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS" AC_DEFINE(ZMQ_HAVE_OPENBSD, 1, [Have OpenBSD OS]) - LIBS="-pthread" ;; *nto-qnx*) pedantic="no" -- cgit v1.2.3