summaryrefslogtreecommitdiff
path: root/x11/libX11/patches/patch-aa
blob: b84256f08dbfde078429c731e30ee25002b1c8db (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
$NetBSD: patch-aa,v 1.5 2008/07/24 01:07:31 bjs Exp $

Include pthread.h as thread stubs might be macros like on NetBSD.

Define conditional for cross-compiling support.

Also, don't look for keysmydef.h, as this could break cross
builds (from GIT).

--- configure.ac.orig	2008-03-06 15:48:26.000000000 -0500
+++ configure.ac
@@ -180,7 +180,7 @@ esac
 AC_SUBST(XTHREADS)
 AC_SUBST(XUSE_MTSAFE_API)
 
-AC_CHECK_LIB(c, pthread_self, [thrstubs="no"], [thrstubs="yes"])
+AC_CHECK_DECLS([pthread_self], [thrstubs="no"], [thrstubs="yes"], [[#include <pthread.h>]])
 AM_CONDITIONAL(THRSTUBS, test x$thrstubs = xyes)
 
 dnl XXX incomplete, please fill this in
@@ -189,8 +189,8 @@ if test x$xthreads = xyes ; then
     linux*|openbsd*|gnu*|k*bsd*-gnu)
         XTHREADLIB=-lpthread ;;
     netbsd*)
-	XTHREAD_CFLAGS="-D_POSIX_THREAD_SAFE_FUNCTIONS"
-	XTHREADLIB="-lpthread" ;;
+	XTHREAD_CFLAGS="-D_REENTRANT"
+	XTHREADLIB="-pthread" ;;
     freebsd*)
         XTHREAD_CFLAGS="-D_THREAD_SAFE"
         XTHREADLIB="-pthread" ;;
@@ -220,31 +220,14 @@ AC_CHECK_FUNC(poll, [AC_DEFINE(USE_POLL,
 #
 # Find keysymdef.h
 #
-KEYSYMDEF=""
 AC_MSG_CHECKING([keysymdef.h])
-for flag in $XPROTO_CFLAGS -I/usr/include; do
-	case "$KEYSYMDEF" in
-	"")
-		case "$flag" in
-		*-I*)
-			dir=`echo "$flag" | sed 's/ *-I//'`
-			file="$dir/X11/keysymdef.h"
-			if test -f "$file"; then
-				KEYSYMDEF="$file"
-			fi
-			;;
-		esac
-		;;
-	esac
-done
-case "$KEYSYMDEF" in
-"")
-	AC_MSG_ERROR([Cannot find keysymdef.h])
-	;;
-*)
+dir=`pkg-config --variable=includedir xproto`
+KEYSYMDEF="$dir/X11/keysymdef.h"
+if test -f "$KEYSYMDEF"; then
 	AC_MSG_RESULT([$KEYSYMDEF])
-        ;;
-esac
+else
+	AC_MSG_ERROR([Cannot find keysymdef.h])
+fi
 AC_SUBST(KEYSYMDEF)
 
 AM_CONDITIONAL(UDC, test xfalse = xtrue)
@@ -322,6 +305,8 @@ else
 fi
 AC_SUBST(XKBPROTO_REQUIRES)
 
+AM_CONDITIONAL(CROSS_COMPILING, [ test $cross_compiling = yes ])
+
 AC_FUNC_MMAP()
 composecache_default=$ac_cv_func_mmap_fixed_mapped
 AC_CHECK_FUNC(nl_langinfo, , [composecache_default=no])