summaryrefslogtreecommitdiff
path: root/x11/libX11/patches/patch-aa
blob: 507348063d9a86b4dc1f7fe7b1cff49216eebc8b (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
$NetBSD: patch-aa,v 1.6 2008/09/16 21:57:09 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-09-04 17:38:59.000000000 -0400
+++ 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" ;;
@@ -305,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])