summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Lucina <mato@kotelna.sk>2010-02-18 17:29:14 +0100
committerMartin Lucina <mato@kotelna.sk>2010-02-18 17:29:14 +0100
commit495f0d105f809a265c34aa9a0eb20af0dcdcf283 (patch)
treef2961d66888e14ecbc4221f547912cc018fce009
parent46824abeb2b016c51f406401d965816f71189aed (diff)
Fix detection of libstdc++
We only care about libstdc++ when using GNU C++. Further, libstdc++ depends on libm on some platforms, fix this.
-rw-r--r--configure.in11
1 files 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"