summaryrefslogtreecommitdiff
path: root/net/bind9/patches/patch-af
blob: 22186601f3325c178d9a92b67466d2d357ac1c12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
$NetBSD: patch-af,v 1.4 2003/03/10 02:47:38 hubertf Exp $

--- lib/bind/configure.in.orig	2003-03-10 01:09:39.000000000 +0000
+++ lib/bind/configure.in
@@ -367,7 +367,8 @@ then
 [linking with PTL2 is highly experimental and not expected to work])
 			CC=ptlgcc
 		else
-			if test ! -d $LOCALBASE/pthreads
+			if test ! -d $LOCALBASE/pthreads \
+				-a ! -f /usr/include/pthread.h
 			then
 				AC_MSG_RESULT(none)
 				use_threads=false
@@ -375,13 +376,21 @@ then
 
 			if $use_threads
 			then
-				AC_MSG_RESULT(mit-pthreads/unproven-pthreads)
-				pkg="$LOCALBASE/pthreads"
-				lib1="-L$pkg/lib -Wl,-R$pkg/lib"
-				lib2="-lpthread -lm -lgcc -lpthread"
-				LIBS="$lib1 $lib2 $LIBS"
-				CPPFLAGS="$CPPFLAGS -I$pkg/include"
-				STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include"
+				if test -f /usr/include/pthread.h
+				then
+					AC_MSG_RESULT(native pthreads)
+					LIBS="-lpthread $LIBS"
+					CPPFLAGS="$CPPFLAGS -I/usr/include"
+					STD_CINCLUDES="$STD_CINCLUDES -I/usr/include"
+				else
+					AC_MSG_RESULT(mit-pthreads/unproven-pthreads)
+					pkg="$LOCALBASE/pthreads"
+					lib1="-L$pkg/lib -Wl,-R$pkg/lib"
+					lib2="-lpthread -lm -lgcc -lpthread"
+					LIBS="$lib1 $lib2 $LIBS"
+					CPPFLAGS="$CPPFLAGS -I$pkg/include"
+					STD_CINCLUDES="$STD_CINCLUDES -I$pkg/include"
+				fi
 			fi
 		fi
 		;;