apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig Rodrigues <rodr...@crodrigues.org>
Subject [PATCH] FreeBSD threads configure support
Date Sun, 09 Nov 2003 23:41:57 GMT
Hi,

I am the maintainer of the FreeBSD port of apr.

Here is a patch that updates the configury checks for
pthread flags in FreeBSD.

In FreeBSD versions less than 5.0.16, you need the
following flags for pthreads stuff
CFLAGS=-D_REENTRANT -D_THREAD_SAFE
LIBS=-pthread

In FreeBSD versions greater than or equal to 5.0.16, you need the
following flags for pthreads stuff
CFLAGS=
LIBS=-lc_r


Index: apr_hints.m4
===================================================================
RCS file: /home/cvspublic/apr/build/apr_hints.m4,v
retrieving revision 1.53
diff -u -r1.53 apr_hints.m4
--- apr_hints.m4	2 Jun 2003 15:52:28 -0000	1.53
+++ apr_hints.m4	9 Nov 2003 23:27:11 -0000
@@ -130,14 +130,15 @@
 	APR_ADDTO(CPPFLAGS, [-DNETBSD])
 	;;
     *-freebsd*)
-	case $host in
-	    *freebsd[2345]*)
-		APR_ADDTO(CFLAGS, [-funsigned-char])
-		;;
-	esac
-	APR_SETIFNULL(enable_threads, [no])
+	os_version=`sysctl -n kern.osreldate`
+	APR_ADDTO(CFLAGS, [-funsigned-char])
         APR_SETIFNULL(apr_lock_method, [USE_FLOCK_SERIALIZE])
-	APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_THREAD_SAFE])
+	if test $os_version -lt "500016"; then
+		ac_cv_pthreads_cflags="-D_THREAD_SAFE -D_REENTRANT"
+		APR_ADDTO(LIBS, [-pthread])
+	else
+		ac_cv_pthreads_lib="c_r"
+	fi
 	;;
     *-next-nextstep*)
 	APR_SETIFNULL(CFLAGS, [-O])
-- 
Craig Rodrigues        
http://crodrigues.org
rodrigc@crodrigues.org

Mime
View raw message