summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Lucina <mato@kotelna.sk>2010-02-17 15:40:26 +0100
committerMartin Lucina <mato@kotelna.sk>2010-02-17 15:40:26 +0100
commitf745c96a9bcf930d10fe31de5f7b3e772cccfa83 (patch)
treeddc47610c2e14d8b21c5b73bc7cd837da2ea3d24
parent9d8623b28f09f5a6db94c7d69ae264984ef1fbe3 (diff)
Add POSIX and GNU Feature Test Macros
This should fix more exotic POSIX platforms such as HPUX which insist on having _POSIX_C_SOURCE defined to get proper threading behaviour. We also define _GNU_SOURCE so that we get any extensions on systems with glibc, e.g. eventfd.
-rw-r--r--configure.in16
1 files changed, 5 insertions, 11 deletions
diff --git a/configure.in b/configure.in
index 49266c7..a031458 100644
--- a/configure.in
+++ b/configure.in
@@ -91,10 +91,13 @@ if test ! -f "doc/zmq.html"; then
fi
fi
+# Set some default features required by 0MQ code.
+CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE -D_POSIX_C_SOURCE=200112L $CPPFLAGS"
+
+# OS-specific tests
case "${host_os}" in
*linux*)
AC_DEFINE(ZMQ_HAVE_LINUX, 1, [Have Linux OS])
- CPPFLAGS="-D_REENTRANT $CPPFLAGS"
AC_CHECK_LIB(uuid, main, ,
[AC_MSG_ERROR([cannot link with -luuid, install uuid-dev.])])
;;
@@ -105,7 +108,7 @@ case "${host_os}" in
AC_CHECK_LIB(rt, main)
AC_CHECK_LIB(uuid, main, ,
[AC_MSG_ERROR([cannot link with -luuid, install uuid-dev.])])
- CPPFLAGS="-D_REENTRANT -D_PTHREADS $CPPFLAGS"
+ CPPFLAGS="-D_PTHREADS $CPPFLAGS"
AC_MSG_CHECKING([wheter atomic operations can be used])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <atomic.h>]],
@@ -122,7 +125,6 @@ case "${host_os}" in
;;
*freebsd*)
AC_DEFINE(ZMQ_HAVE_FREEBSD, 1, [Have FreeBSD OS])
- CPPFLAGS="-D_THREAD_SAFE $CPPFLAGS"
LIBS="-pthread"
;;
*darwin*)
@@ -134,26 +136,18 @@ case "${host_os}" in
;;
*openbsd*)
AC_DEFINE(ZMQ_HAVE_OPENBSD, 1, [Have OpenBSD OS])
- CPPFLAGS="-pthread $CPPFLAGS"
LIBS="-pthread"
;;
*nto-qnx*)
pedantic="no"
AC_DEFINE(ZMQ_HAVE_QNXNTO, 1, [Have QNX Neutrino OS])
- CPPFLAGS="-D_THREAD_SAFE $CPPFLAGS"
AC_CHECK_LIB(socket,main)
;;
*aix*)
AC_DEFINE(ZMQ_HAVE_AIX, 1, [Have AIX OS])
- if test "x$GXX" = "xyes"; then
- CPPFLAGS="-D_THREAD_SAFE $CPPFLAGS"
- fi
;;
*hpux*)
AC_DEFINE(ZMQ_HAVE_HPUX, 1, [Have HPUX OS])
- if test "x$GXX" = "xyes"; then
- CPPFLAGS="-D_THREAD_SAFE $CPPFLAGS"
- fi
AC_CHECK_LIB(rt, main)
;;
*mingw32*)