Add files from parent branch HEAD:
[pkgsrc.git] / sysutils / dbus / patches / patch-ac
1 $NetBSD$
2
3 --- configure.orig      2008-04-04 14:23:44.000000000 -0400
4 +++ configure
5 @@ -5996,6 +5996,224 @@ esac
6  
7  need_locks="$enable_libtool_lock"
8  
9 +if test "${ac_cv_header_sys_atomic_h+set}" = set; then
10 +  { echo "$as_me:$LINENO: checking for sys/atomic.h" >&5
11 +echo $ECHO_N "checking for sys/atomic.h... $ECHO_C" >&6; }
12 +if test "${ac_cv_header_sys_atomic_h+set}" = set; then
13 +  echo $ECHO_N "(cached) $ECHO_C" >&6
14 +fi
15 +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_atomic_h" >&5
16 +echo "${ECHO_T}$ac_cv_header_sys_atomic_h" >&6; }
17 +else
18 +  # Is the header compilable?
19 +{ echo "$as_me:$LINENO: checking sys/atomic.h usability" >&5
20 +echo $ECHO_N "checking sys/atomic.h usability... $ECHO_C" >&6; }
21 +cat >conftest.$ac_ext <<_ACEOF
22 +/* confdefs.h.  */
23 +_ACEOF
24 +cat confdefs.h >>conftest.$ac_ext
25 +cat >>conftest.$ac_ext <<_ACEOF
26 +/* end confdefs.h.  */
27 +$ac_includes_default
28 +#include <sys/atomic.h>
29 +_ACEOF
30 +rm -f conftest.$ac_objext
31 +if { (ac_try="$ac_compile"
32 +case "(($ac_try" in
33 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
34 +  *) ac_try_echo=$ac_try;;
35 +esac
36 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
37 +  (eval "$ac_compile") 2>conftest.er1
38 +  ac_status=$?
39 +  grep -v '^ *+' conftest.er1 >conftest.err
40 +  rm -f conftest.er1
41 +  cat conftest.err >&5
42 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
43 +  (exit $ac_status); } && {
44 +        test -z "$ac_c_werror_flag" ||
45 +        test ! -s conftest.err
46 +       } && test -s conftest.$ac_objext; then
47 +  ac_header_compiler=yes
48 +else
49 +  echo "$as_me: failed program was:" >&5
50 +sed 's/^/| /' conftest.$ac_ext >&5
51 +
52 +       ac_header_compiler=no
53 +fi
54 +
55 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
57 +echo "${ECHO_T}$ac_header_compiler" >&6; }
58 +
59 +# Is the header present?
60 +{ echo "$as_me:$LINENO: checking sys/atomic.h presence" >&5
61 +echo $ECHO_N "checking sys/atomic.h presence... $ECHO_C" >&6; }
62 +cat >conftest.$ac_ext <<_ACEOF
63 +/* confdefs.h.  */
64 +_ACEOF
65 +cat confdefs.h >>conftest.$ac_ext
66 +cat >>conftest.$ac_ext <<_ACEOF
67 +/* end confdefs.h.  */
68 +#include <sys/atomic.h>
69 +_ACEOF
70 +if { (ac_try="$ac_cpp conftest.$ac_ext"
71 +case "(($ac_try" in
72 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
73 +  *) ac_try_echo=$ac_try;;
74 +esac
75 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
76 +  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
77 +  ac_status=$?
78 +  grep -v '^ *+' conftest.er1 >conftest.err
79 +  rm -f conftest.er1
80 +  cat conftest.err >&5
81 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
82 +  (exit $ac_status); } >/dev/null && {
83 +        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
84 +        test ! -s conftest.err
85 +       }; then
86 +  ac_header_preproc=yes
87 +else
88 +  echo "$as_me: failed program was:" >&5
89 +sed 's/^/| /' conftest.$ac_ext >&5
90 +
91 +  ac_header_preproc=no
92 +fi
93 +
94 +rm -f conftest.err conftest.$ac_ext
95 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
96 +echo "${ECHO_T}$ac_header_preproc" >&6; }
97 +
98 +# So?  What about this header?
99 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
100 +  yes:no: )
101 +    { echo "$as_me:$LINENO: WARNING: sys/atomic.h: accepted by the compiler, rejected by the preprocessor!" >&5
102 +echo "$as_me: WARNING: sys/atomic.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
103 +    { echo "$as_me:$LINENO: WARNING: sys/atomic.h: proceeding with the compiler's result" >&5
104 +echo "$as_me: WARNING: sys/atomic.h: proceeding with the compiler's result" >&2;}
105 +    ac_header_preproc=yes
106 +    ;;
107 +  no:yes:* )
108 +    { echo "$as_me:$LINENO: WARNING: sys/atomic.h: present but cannot be compiled" >&5
109 +echo "$as_me: WARNING: sys/atomic.h: present but cannot be compiled" >&2;}
110 +    { echo "$as_me:$LINENO: WARNING: sys/atomic.h:     check for missing prerequisite headers?" >&5
111 +echo "$as_me: WARNING: sys/atomic.h:     check for missing prerequisite headers?" >&2;}
112 +    { echo "$as_me:$LINENO: WARNING: sys/atomic.h: see the Autoconf documentation" >&5
113 +echo "$as_me: WARNING: sys/atomic.h: see the Autoconf documentation" >&2;}
114 +    { echo "$as_me:$LINENO: WARNING: sys/atomic.h:     section \"Present But Cannot Be Compiled\"" >&5
115 +echo "$as_me: WARNING: sys/atomic.h:     section \"Present But Cannot Be Compiled\"" >&2;}
116 +    { echo "$as_me:$LINENO: WARNING: sys/atomic.h: proceeding with the preprocessor's result" >&5
117 +echo "$as_me: WARNING: sys/atomic.h: proceeding with the preprocessor's result" >&2;}
118 +    { echo "$as_me:$LINENO: WARNING: sys/atomic.h: in the future, the compiler will take precedence" >&5
119 +echo "$as_me: WARNING: sys/atomic.h: in the future, the compiler will take precedence" >&2;}
120 +
121 +    ;;
122 +esac
123 +{ echo "$as_me:$LINENO: checking for sys/atomic.h" >&5
124 +echo $ECHO_N "checking for sys/atomic.h... $ECHO_C" >&6; }
125 +if test "${ac_cv_header_sys_atomic_h+set}" = set; then
126 +  echo $ECHO_N "(cached) $ECHO_C" >&6
127 +else
128 +  ac_cv_header_sys_atomic_h=$ac_header_preproc
129 +fi
130 +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_atomic_h" >&5
131 +echo "${ECHO_T}$ac_cv_header_sys_atomic_h" >&6; }
132 +
133 +fi
134 +if test $ac_cv_header_sys_atomic_h = yes; then
135 +  { echo "$as_me:$LINENO: checking for atomic_inc_32_nv" >&5
136 +echo $ECHO_N "checking for atomic_inc_32_nv... $ECHO_C" >&6; }
137 +if test "${ac_cv_func_atomic_inc_32_nv+set}" = set; then
138 +  echo $ECHO_N "(cached) $ECHO_C" >&6
139 +else
140 +  cat >conftest.$ac_ext <<_ACEOF
141 +/* confdefs.h.  */
142 +_ACEOF
143 +cat confdefs.h >>conftest.$ac_ext
144 +cat >>conftest.$ac_ext <<_ACEOF
145 +/* end confdefs.h.  */
146 +/* Define atomic_inc_32_nv to an innocuous variant, in case <limits.h> declares atomic_inc_32_nv.
147 +   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
148 +#define atomic_inc_32_nv innocuous_atomic_inc_32_nv
149 +
150 +/* System header to define __stub macros and hopefully few prototypes,
151 +    which can conflict with char atomic_inc_32_nv (); below.
152 +    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
153 +    <limits.h> exists even on freestanding compilers.  */
154 +
155 +#ifdef __STDC__
156 +# include <limits.h>
157 +#else
158 +# include <assert.h>
159 +#endif
160 +
161 +#undef atomic_inc_32_nv
162 +
163 +/* Override any GCC internal prototype to avoid an error.
164 +   Use char because int might match the return type of a GCC
165 +   builtin and then its argument prototype would still apply.  */
166 +#ifdef __cplusplus
167 +extern "C"
168 +#endif
169 +char atomic_inc_32_nv ();
170 +/* The GNU C library defines this for functions which it implements
171 +    to always fail with ENOSYS.  Some functions are actually named
172 +    something starting with __ and the normal name is an alias.  */
173 +#if defined __stub_atomic_inc_32_nv || defined __stub___atomic_inc_32_nv
174 +choke me
175 +#endif
176 +
177 +int
178 +main ()
179 +{
180 +return atomic_inc_32_nv ();
181 +  ;
182 +  return 0;
183 +}
184 +_ACEOF
185 +rm -f conftest.$ac_objext conftest$ac_exeext
186 +if { (ac_try="$ac_link"
187 +case "(($ac_try" in
188 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
189 +  *) ac_try_echo=$ac_try;;
190 +esac
191 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
192 +  (eval "$ac_link") 2>conftest.er1
193 +  ac_status=$?
194 +  grep -v '^ *+' conftest.er1 >conftest.err
195 +  rm -f conftest.er1
196 +  cat conftest.err >&5
197 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
198 +  (exit $ac_status); } && {
199 +        test -z "$ac_c_werror_flag" ||
200 +        test ! -s conftest.err
201 +       } && test -s conftest$ac_exeext &&
202 +       $as_test_x conftest$ac_exeext; then
203 +  ac_cv_func_atomic_inc_32_nv=yes
204 +else
205 +  echo "$as_me: failed program was:" >&5
206 +sed 's/^/| /' conftest.$ac_ext >&5
207 +
208 +       ac_cv_func_atomic_inc_32_nv=no
209 +fi
210 +
211 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
212 +      conftest$ac_exeext conftest.$ac_ext
213 +fi
214 +{ echo "$as_me:$LINENO: result: $ac_cv_func_atomic_inc_32_nv" >&5
215 +echo "${ECHO_T}$ac_cv_func_atomic_inc_32_nv" >&6; }
216 +if test $ac_cv_func_atomic_inc_32_nv = yes; then
217 +
218 +cat >>confdefs.h <<\_ACEOF
219 +#define HAVE_NETBSD_ATOMIC_OPS 1
220 +_ACEOF
221 +
222 +fi
223 +
224 +fi
225 +
226 +
227  
228  # On IRIX 5.3, sys/types and inttypes.h are conflicting.
229