summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/apr_common.m417
-rw-r--r--build/apr_hints.m44
-rw-r--r--configure.in18
3 files changed, 6 insertions, 33 deletions
diff --git a/build/apr_common.m4 b/build/apr_common.m4
index 4b3294a71..73a435726 100644
--- a/build/apr_common.m4
+++ b/build/apr_common.m4
@@ -546,30 +546,15 @@ crypt_r("passwd", "hash", &buffer);
], ac_cv_crypt_r_style=struct_crypt_data)
fi
dnl
-if test "$ac_cv_crypt_r_style" = "none"; then
-dnl same as previous test, but see if defining _GNU_SOURCE helps
-AC_TRY_COMPILE([
-#define _GNU_SOURCE
-#include <crypt.h>
-],[
-struct crypt_data buffer;
-crypt_r("passwd", "hash", &buffer);
-], ac_cv_crypt_r_style=struct_crypt_data_gnu_source)
-fi
-dnl
])
if test "$ac_cv_crypt_r_style" = "cryptd"; then
AC_DEFINE(CRYPT_R_CRYPTD, 1, [Define if crypt_r has uses CRYPTD])
fi
# if we don't combine these conditions, CRYPT_R_STRUCT_CRYPT_DATA
# will end up defined twice
-if test "$ac_cv_crypt_r_style" = "struct_crypt_data" -o \
- "$ac_cv_crypt_r_style" = "struct_crypt_data_gnu_source"; then
+if test "$ac_cv_crypt_r_style" = "struct_crypt_data"; then
AC_DEFINE(CRYPT_R_STRUCT_CRYPT_DATA, 1, [Define if crypt_r uses struct crypt_data])
fi
-if test "$ac_cv_crypt_r_style" = "struct_crypt_data_gnu_source"; then
- APR_ADDTO(CPPFLAGS, [-D_GNU_SOURCE])
-fi
])
dnl
diff --git a/build/apr_hints.m4 b/build/apr_hints.m4
index f8c59500b..9c83a47e5 100644
--- a/build/apr_hints.m4
+++ b/build/apr_hints.m4
@@ -104,10 +104,10 @@ dnl # Not a problem in 10.20. Otherwise, who knows?
* )
;;
esac
- APR_ADDTO(CPPFLAGS, [-D_REENTRANT])
+ APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_GNU_SOURCE])
;;
*-GNU*)
- APR_ADDTO(CPPFLAGS, [-DHURD])
+ APR_ADDTO(CPPFLAGS, [-DHURD -D_GNU_SOURCE])
;;
*-lynx-lynxos)
APR_ADDTO(CPPFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS])
diff --git a/configure.in b/configure.in
index 322843b40..4645e5339 100644
--- a/configure.in
+++ b/configure.in
@@ -526,25 +526,13 @@ else
if test "$ac_cv_func_pthread_rwlock_init" = "yes"; then
dnl ----------------------------- Checking for pthread_rwlock_t
- dnl Linux is silly as it has pthread_rwlock_init defined
- dnl but keeps the pthread_rwlock_t structure hidden unless
- dnl special things are defined.
AC_CACHE_CHECK([for pthread_rwlock_t], [apr_cv_type_rwlock_t],
AC_TRY_COMPILE([#include <sys/types.h>
#include <pthread.h>], [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
- [apr_cv_type_rwlock_t=yes],
- [AC_TRY_COMPILE([#define _XOPEN_SOURCE 500
-#define _BSD_SOURCE
-#define _SVID_SOURCE
-#include <sys/types.h>
-#include <pthread.h>], [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;],
- [apr_cv_type_rwlock_t=yes-with-XOPEN_SOURCE], [apr_cv_type_rwlock_t=no])],
+ [apr_cv_type_rwlock_t=yes], [apr_cv_type_rwlock_t=no],
[apr_cv_type_rwlock_t=no]))
- case $apr_cv_type_rwlock_t in
- yes*) AC_DEFINE(HAVE_PTHREAD_RWLOCKS, 1, [Define if pthread rwlocks are available]) ;;
- esac
- if test "$apr_cv_type_rwlock_t" = "yes-with-XOPEN_SOURCE"; then
- APR_ADDTO(CPPFLAGS, [-D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE])
+ if test "$apr_cv_type_rwlock_t" = "yes"; then
+ AC_DEFINE(HAVE_PTHREAD_RWLOCKS, 1, [Define if pthread rwlocks are available])
fi
fi
fi