summaryrefslogtreecommitdiff
path: root/x11/libX11/patches/patch-ac
blob: 44ad02bb9436b3973ac1fccd7a6eff8a9a830277 (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
$NetBSD: patch-ac,v 1.6 2008/09/16 21:57:09 bjs Exp $

_POSIX_THREAD_SAFE_FUNCTIONS is not used on NetBSD.  Instead,
let's use _REENTRANT.

--- configure.orig	2008-09-04 17:48:46.000000000 -0400
+++ configure
@@ -929,6 +929,8 @@ XKB_FALSE
 XKBPROTO_CFLAGS
 XKBPROTO_LIBS
 XKBPROTO_REQUIRES
+CROSS_COMPILING_TRUE
+CROSS_COMPILING_FALSE
 LINT
 LINT_FLAGS
 LINT_TRUE
@@ -23393,43 +23395,38 @@ esac
 
 
 
-{ echo "$as_me:$LINENO: checking for pthread_self in -lc" >&5
-echo $ECHO_N "checking for pthread_self in -lc... $ECHO_C" >&6; }
-if test "${ac_cv_lib_c_pthread_self+set}" = set; then
+{ echo "$as_me:$LINENO: checking whether pthread_self is declared" >&5
+echo $ECHO_N "checking whether pthread_self is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_pthread_self+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <pthread.h>
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_self ();
 int
 main ()
 {
-return pthread_self ();
+#ifndef pthread_self
+  (void) pthread_self;
+#endif
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -23438,28 +23435,35 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_c_pthread_self=yes
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_pthread_self=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_c_pthread_self=no
+	ac_cv_have_decl_pthread_self=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_self" >&5
-echo "${ECHO_T}$ac_cv_lib_c_pthread_self" >&6; }
-if test $ac_cv_lib_c_pthread_self = yes; then
-  thrstubs="no"
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_pthread_self" >&5
+echo "${ECHO_T}$ac_cv_have_decl_pthread_self" >&6; }
+if test $ac_cv_have_decl_pthread_self = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_PTHREAD_SELF 1
+_ACEOF
+
+thrstubs="no"
 else
-  thrstubs="yes"
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_PTHREAD_SELF 0
+_ACEOF
+
+thrstubs="yes"
 fi
 
+
  if test x$thrstubs = xyes; then
   THRSTUBS_TRUE=
   THRSTUBS_FALSE='#'
@@ -23474,8 +23478,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" ;;
@@ -24006,6 +24010,15 @@ else
 fi
 
 
+ if  test $cross_compiling = yes ; then
+  CROSS_COMPILING_TRUE=
+  CROSS_COMPILING_FALSE='#'
+else
+  CROSS_COMPILING_TRUE='#'
+  CROSS_COMPILING_FALSE=
+fi
+
+
 
 
 for ac_header in stdlib.h unistd.h
@@ -25140,6 +25153,13 @@ echo "$as_me: error: conditional \"XKB\"
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"CROSS_COMPILING\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"CROSS_COMPILING\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 if test -z "${LINT_TRUE}" && test -z "${LINT_FALSE}"; then
   { { echo "$as_me:$LINENO: error: conditional \"LINT\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -25967,6 +25993,8 @@ XKB_FALSE!$XKB_FALSE$ac_delim
 XKBPROTO_CFLAGS!$XKBPROTO_CFLAGS$ac_delim
 XKBPROTO_LIBS!$XKBPROTO_LIBS$ac_delim
 XKBPROTO_REQUIRES!$XKBPROTO_REQUIRES$ac_delim
+CROSS_COMPILING_TRUE!$CROSS_COMPILING_TRUE$ac_delim
+CROSS_COMPILING_FALSE!$CROSS_COMPILING_FALSE$ac_delim
 LINT!$LINT$ac_delim
 LINT_FLAGS!$LINT_FLAGS$ac_delim
 LINT_TRUE!$LINT_TRUE$ac_delim
@@ -25991,7 +26019,7 @@ LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 85; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 87; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5