Fix detection of libstdc++

We only care about libstdc++ when using GNU C++.
Further, libstdc++ depends on libm on some platforms, fix this.
This commit is contained in:
Martin Lucina 2010-02-18 17:29:14 +01:00
parent 46824abeb2
commit 495f0d105f

View File

@ -55,8 +55,12 @@ AC_PROG_SED
AC_PROG_AWK AC_PROG_AWK
# Checks for libraries. # Checks for libraries.
AC_CHECK_LIB(pthread, pthread_create) AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_LIB(stdc++, malloc) # 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. # Extra CXXFLAGS are appended at the end of CXXFLAGS for libzmq.
LIBZMQ_EXTRA_CXXFLAGS="" LIBZMQ_EXTRA_CXXFLAGS=""
@ -139,7 +143,6 @@ case "${host_os}" in
# Define on FreeBSD to enable all library features # Define on FreeBSD to enable all library features
CPPFLAGS="-D__BSD_VISIBLE $CPPFLAGS" CPPFLAGS="-D__BSD_VISIBLE $CPPFLAGS"
AC_DEFINE(ZMQ_HAVE_FREEBSD, 1, [Have FreeBSD OS]) AC_DEFINE(ZMQ_HAVE_FREEBSD, 1, [Have FreeBSD OS])
LIBS="-pthread"
;; ;;
*darwin*) *darwin*)
# Define on Darwin to enable all library features # Define on Darwin to enable all library features
@ -147,14 +150,12 @@ case "${host_os}" in
pedantic="no" pedantic="no"
werror="no" werror="no"
AC_DEFINE(ZMQ_HAVE_OSX, 1, [Have DarwinOSX OS]) AC_DEFINE(ZMQ_HAVE_OSX, 1, [Have DarwinOSX OS])
LIBS="-pthread"
LIBZMQ_EXTRA_CXXFLAGS+="-Wno-uninitialized" LIBZMQ_EXTRA_CXXFLAGS+="-Wno-uninitialized"
;; ;;
*openbsd*) *openbsd*)
# Define on OpenBSD to enable all library features # Define on OpenBSD to enable all library features
CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS" CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS"
AC_DEFINE(ZMQ_HAVE_OPENBSD, 1, [Have OpenBSD OS]) AC_DEFINE(ZMQ_HAVE_OPENBSD, 1, [Have OpenBSD OS])
LIBS="-pthread"
;; ;;
*nto-qnx*) *nto-qnx*)
pedantic="no" pedantic="no"