diff options
author | jerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68> | 2004-07-04 23:38:18 +0000 |
---|---|---|
committer | jerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68> | 2004-07-04 23:38:18 +0000 |
commit | cce9c869978597d58a3385109e96337d343ba1a4 (patch) | |
tree | a714d1d6d40711e7af6827290ee4c63c4ac0edae /build | |
parent | 83eb34995d9143e634b17ca5f5096c4d7c7cd4a8 (diff) | |
download | libapr-cce9c869978597d58a3385109e96337d343ba1a4.tar.gz |
Support threading on FreeBSD 5.x where kern.osreldate >= 502102.
5.3 will be the first release with this enabled by default (current -CURRENT
will also be enabled); 5.2 and earlier still use the broken libc_r by default.
Those people on 5.2 can pass --enable-threads and setup libmap.conf to use
libkse instead.
As for the 502102 magic number, from
http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html:
"5.2-CURRENT after change of default thread library from libc_r to libpthread. 502102"
Submitted by: Craig Rodrigues <rodrigc crodrigues.org>
Reviewed by: Justin Erenkrantz, Aaron Bannert (concept)
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65257 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build')
-rw-r--r-- | build/apr_hints.m4 | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 00316d00b..4ba64a8cf 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -136,14 +136,16 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DNETBSD]) ;; *-freebsd*) - case $host in - *freebsd[[2345]]*) - APR_ADDTO(CFLAGS, [-funsigned-char]) - ;; - esac - APR_SETIFNULL(enable_threads, [no]) APR_SETIFNULL(apr_lock_method, [USE_FLOCK_SERIALIZE]) - APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_THREAD_SAFE]) + os_version=`sysctl -n kern.osreldate` + dnl 502102 is when libc_r switched to libpthread (aka libkse). + if test $os_version -ge "502102"; then + apr_cv_pthreads_cflags="none" + apr_cv_pthreads_lib="-lpthread" + else + apr_cv_pthreads_cflags="-D_THREAD_SAFE -D_REENTRANT" + APR_SETIFNULL(enable_threads, [no]) + fi ;; *-next-nextstep*) APR_SETIFNULL(CFLAGS, [-O]) |