Commit | Line | Data |
---|---|---|
c971b7fa PA |
1 | #! /bin/sh |
2 | # Guess values for system-dependent variables and create Makefiles. | |
d0ac1c44 SM |
3 | # Generated by GNU Autoconf 2.69 for libgnu UNUSED-VERSION. |
4 | # | |
5 | # | |
6 | # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. | |
c971b7fa | 7 | # |
c971b7fa PA |
8 | # |
9 | # This configure script is free software; the Free Software Foundation | |
10 | # gives unlimited permission to copy, distribute and modify it. | |
11 | ## -------------------- ## | |
12 | ## M4sh Initialization. ## | |
13 | ## -------------------- ## | |
14 | ||
15 | # Be more Bourne compatible | |
16 | DUALCASE=1; export DUALCASE # for MKS sh | |
17 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : | |
18 | emulate sh | |
19 | NULLCMD=: | |
20 | # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which | |
21 | # is contrary to our usage. Disable this feature. | |
22 | alias -g '${1+"$@"}'='"$@"' | |
23 | setopt NO_GLOB_SUBST | |
24 | else | |
25 | case `(set -o) 2>/dev/null` in #( | |
26 | *posix*) : | |
27 | set -o posix ;; #( | |
28 | *) : | |
29 | ;; | |
30 | esac | |
31 | fi | |
32 | ||
33 | ||
34 | as_nl=' | |
35 | ' | |
36 | export as_nl | |
37 | # Printing a long string crashes Solaris 7 /usr/bin/printf. | |
38 | as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' | |
39 | as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo | |
40 | as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo | |
41 | # Prefer a ksh shell builtin over an external printf program on Solaris, | |
42 | # but without wasting forks for bash or zsh. | |
43 | if test -z "$BASH_VERSION$ZSH_VERSION" \ | |
44 | && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then | |
45 | as_echo='print -r --' | |
46 | as_echo_n='print -rn --' | |
47 | elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then | |
48 | as_echo='printf %s\n' | |
49 | as_echo_n='printf %s' | |
50 | else | |
51 | if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then | |
52 | as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' | |
53 | as_echo_n='/usr/ucb/echo -n' | |
54 | else | |
55 | as_echo_body='eval expr "X$1" : "X\\(.*\\)"' | |
56 | as_echo_n_body='eval | |
57 | arg=$1; | |
58 | case $arg in #( | |
59 | *"$as_nl"*) | |
60 | expr "X$arg" : "X\\(.*\\)$as_nl"; | |
61 | arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; | |
62 | esac; | |
63 | expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" | |
64 | ' | |
65 | export as_echo_n_body | |
66 | as_echo_n='sh -c $as_echo_n_body as_echo' | |
67 | fi | |
68 | export as_echo_body | |
69 | as_echo='sh -c $as_echo_body as_echo' | |
70 | fi | |
71 | ||
72 | # The user is always right. | |
73 | if test "${PATH_SEPARATOR+set}" != set; then | |
74 | PATH_SEPARATOR=: | |
75 | (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { | |
76 | (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || | |
77 | PATH_SEPARATOR=';' | |
78 | } | |
79 | fi | |
80 | ||
81 | ||
82 | # IFS | |
83 | # We need space, tab and new line, in precisely that order. Quoting is | |
84 | # there to prevent editors from complaining about space-tab. | |
85 | # (If _AS_PATH_WALK were called with IFS unset, it would disable word | |
86 | # splitting by setting IFS to empty value.) | |
87 | IFS=" "" $as_nl" | |
88 | ||
89 | # Find who we are. Look in the path if we contain no directory separator. | |
d0ac1c44 | 90 | as_myself= |
c971b7fa PA |
91 | case $0 in #(( |
92 | *[\\/]* ) as_myself=$0 ;; | |
93 | *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
94 | for as_dir in $PATH | |
95 | do | |
96 | IFS=$as_save_IFS | |
97 | test -z "$as_dir" && as_dir=. | |
98 | test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break | |
99 | done | |
100 | IFS=$as_save_IFS | |
101 | ||
102 | ;; | |
103 | esac | |
104 | # We did not find ourselves, most probably we were run as `sh COMMAND' | |
105 | # in which case we are not to be found in the path. | |
106 | if test "x$as_myself" = x; then | |
107 | as_myself=$0 | |
108 | fi | |
109 | if test ! -f "$as_myself"; then | |
110 | $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 | |
111 | exit 1 | |
112 | fi | |
113 | ||
114 | # Unset variables that we do not need and which cause bugs (e.g. in | |
115 | # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" | |
116 | # suppresses any "Segmentation fault" message there. '((' could | |
117 | # trigger a bug in pdksh 5.2.14. | |
118 | for as_var in BASH_ENV ENV MAIL MAILPATH | |
119 | do eval test x\${$as_var+set} = xset \ | |
120 | && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : | |
121 | done | |
122 | PS1='$ ' | |
123 | PS2='> ' | |
124 | PS4='+ ' | |
125 | ||
126 | # NLS nuisances. | |
127 | LC_ALL=C | |
128 | export LC_ALL | |
129 | LANGUAGE=C | |
130 | export LANGUAGE | |
131 | ||
132 | # CDPATH. | |
133 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH | |
134 | ||
d0ac1c44 SM |
135 | # Use a proper internal environment variable to ensure we don't fall |
136 | # into an infinite loop, continuously re-executing ourselves. | |
137 | if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then | |
138 | _as_can_reexec=no; export _as_can_reexec; | |
139 | # We cannot yet assume a decent shell, so we have to provide a | |
140 | # neutralization value for shells without unset; and this also | |
141 | # works around shells that cannot unset nonexistent variables. | |
142 | # Preserve -v and -x to the replacement shell. | |
143 | BASH_ENV=/dev/null | |
144 | ENV=/dev/null | |
145 | (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV | |
146 | case $- in # (((( | |
147 | *v*x* | *x*v* ) as_opts=-vx ;; | |
148 | *v* ) as_opts=-v ;; | |
149 | *x* ) as_opts=-x ;; | |
150 | * ) as_opts= ;; | |
151 | esac | |
152 | exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} | |
153 | # Admittedly, this is quite paranoid, since all the known shells bail | |
154 | # out after a failed `exec'. | |
155 | $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 | |
156 | as_fn_exit 255 | |
157 | fi | |
158 | # We don't want this to propagate to other subprocesses. | |
159 | { _as_can_reexec=; unset _as_can_reexec;} | |
c971b7fa PA |
160 | if test "x$CONFIG_SHELL" = x; then |
161 | as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : | |
162 | emulate sh | |
163 | NULLCMD=: | |
164 | # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which | |
165 | # is contrary to our usage. Disable this feature. | |
166 | alias -g '\${1+\"\$@\"}'='\"\$@\"' | |
167 | setopt NO_GLOB_SUBST | |
168 | else | |
169 | case \`(set -o) 2>/dev/null\` in #( | |
170 | *posix*) : | |
171 | set -o posix ;; #( | |
172 | *) : | |
173 | ;; | |
174 | esac | |
175 | fi | |
176 | " | |
177 | as_required="as_fn_return () { (exit \$1); } | |
178 | as_fn_success () { as_fn_return 0; } | |
179 | as_fn_failure () { as_fn_return 1; } | |
180 | as_fn_ret_success () { return 0; } | |
181 | as_fn_ret_failure () { return 1; } | |
182 | ||
183 | exitcode=0 | |
184 | as_fn_success || { exitcode=1; echo as_fn_success failed.; } | |
185 | as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } | |
186 | as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } | |
187 | as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } | |
188 | if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : | |
189 | ||
190 | else | |
191 | exitcode=1; echo positional parameters were not saved. | |
192 | fi | |
d0ac1c44 SM |
193 | test x\$exitcode = x0 || exit 1 |
194 | test -x / || exit 1" | |
c971b7fa PA |
195 | as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO |
196 | as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO | |
197 | eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && | |
198 | test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 | |
199 | test \$(( 1 + 1 )) = 2 || exit 1" | |
200 | if (eval "$as_required") 2>/dev/null; then : | |
201 | as_have_required=yes | |
202 | else | |
203 | as_have_required=no | |
204 | fi | |
205 | if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : | |
206 | ||
207 | else | |
208 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
209 | as_found=false | |
210 | for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH | |
211 | do | |
212 | IFS=$as_save_IFS | |
213 | test -z "$as_dir" && as_dir=. | |
214 | as_found=: | |
215 | case $as_dir in #( | |
216 | /*) | |
217 | for as_base in sh bash ksh sh5; do | |
218 | # Try only shells that exist, to save several forks. | |
219 | as_shell=$as_dir/$as_base | |
220 | if { test -f "$as_shell" || test -f "$as_shell.exe"; } && | |
221 | { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : | |
222 | CONFIG_SHELL=$as_shell as_have_required=yes | |
223 | if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : | |
224 | break 2 | |
225 | fi | |
226 | fi | |
227 | done;; | |
228 | esac | |
229 | as_found=false | |
230 | done | |
231 | $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && | |
232 | { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : | |
233 | CONFIG_SHELL=$SHELL as_have_required=yes | |
234 | fi; } | |
235 | IFS=$as_save_IFS | |
236 | ||
237 | ||
238 | if test "x$CONFIG_SHELL" != x; then : | |
d0ac1c44 SM |
239 | export CONFIG_SHELL |
240 | # We cannot yet assume a decent shell, so we have to provide a | |
241 | # neutralization value for shells without unset; and this also | |
242 | # works around shells that cannot unset nonexistent variables. | |
243 | # Preserve -v and -x to the replacement shell. | |
244 | BASH_ENV=/dev/null | |
245 | ENV=/dev/null | |
246 | (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV | |
247 | case $- in # (((( | |
248 | *v*x* | *x*v* ) as_opts=-vx ;; | |
249 | *v* ) as_opts=-v ;; | |
250 | *x* ) as_opts=-x ;; | |
251 | * ) as_opts= ;; | |
252 | esac | |
253 | exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} | |
254 | # Admittedly, this is quite paranoid, since all the known shells bail | |
255 | # out after a failed `exec'. | |
256 | $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 | |
257 | exit 255 | |
c971b7fa PA |
258 | fi |
259 | ||
260 | if test x$as_have_required = xno; then : | |
261 | $as_echo "$0: This script requires a shell more modern than all" | |
262 | $as_echo "$0: the shells that I found on your system." | |
263 | if test x${ZSH_VERSION+set} = xset ; then | |
264 | $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" | |
265 | $as_echo "$0: be upgraded to zsh 4.3.4 or later." | |
266 | else | |
267 | $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, | |
268 | $0: including any error possibly output before this | |
269 | $0: message. Then install a modern shell, or manually run | |
270 | $0: the script under such a shell if you do have one." | |
271 | fi | |
272 | exit 1 | |
273 | fi | |
274 | fi | |
275 | fi | |
276 | SHELL=${CONFIG_SHELL-/bin/sh} | |
277 | export SHELL | |
278 | # Unset more variables known to interfere with behavior of common tools. | |
279 | CLICOLOR_FORCE= GREP_OPTIONS= | |
280 | unset CLICOLOR_FORCE GREP_OPTIONS | |
281 | ||
282 | ## --------------------- ## | |
283 | ## M4sh Shell Functions. ## | |
284 | ## --------------------- ## | |
285 | # as_fn_unset VAR | |
286 | # --------------- | |
287 | # Portably unset VAR. | |
288 | as_fn_unset () | |
289 | { | |
290 | { eval $1=; unset $1;} | |
291 | } | |
292 | as_unset=as_fn_unset | |
293 | ||
294 | # as_fn_set_status STATUS | |
295 | # ----------------------- | |
296 | # Set $? to STATUS, without forking. | |
297 | as_fn_set_status () | |
298 | { | |
299 | return $1 | |
300 | } # as_fn_set_status | |
301 | ||
302 | # as_fn_exit STATUS | |
303 | # ----------------- | |
304 | # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. | |
305 | as_fn_exit () | |
306 | { | |
307 | set +e | |
308 | as_fn_set_status $1 | |
309 | exit $1 | |
310 | } # as_fn_exit | |
311 | ||
312 | # as_fn_mkdir_p | |
313 | # ------------- | |
314 | # Create "$as_dir" as a directory, including parents if necessary. | |
315 | as_fn_mkdir_p () | |
316 | { | |
317 | ||
318 | case $as_dir in #( | |
319 | -*) as_dir=./$as_dir;; | |
320 | esac | |
321 | test -d "$as_dir" || eval $as_mkdir_p || { | |
322 | as_dirs= | |
323 | while :; do | |
324 | case $as_dir in #( | |
325 | *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( | |
326 | *) as_qdir=$as_dir;; | |
327 | esac | |
328 | as_dirs="'$as_qdir' $as_dirs" | |
329 | as_dir=`$as_dirname -- "$as_dir" || | |
330 | $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
331 | X"$as_dir" : 'X\(//\)[^/]' \| \ | |
332 | X"$as_dir" : 'X\(//\)$' \| \ | |
333 | X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || | |
334 | $as_echo X"$as_dir" | | |
335 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
336 | s//\1/ | |
337 | q | |
338 | } | |
339 | /^X\(\/\/\)[^/].*/{ | |
340 | s//\1/ | |
341 | q | |
342 | } | |
343 | /^X\(\/\/\)$/{ | |
344 | s//\1/ | |
345 | q | |
346 | } | |
347 | /^X\(\/\).*/{ | |
348 | s//\1/ | |
349 | q | |
350 | } | |
351 | s/.*/./; q'` | |
352 | test -d "$as_dir" && break | |
353 | done | |
354 | test -z "$as_dirs" || eval "mkdir $as_dirs" | |
d0ac1c44 | 355 | } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" |
c971b7fa PA |
356 | |
357 | ||
358 | } # as_fn_mkdir_p | |
d0ac1c44 SM |
359 | |
360 | # as_fn_executable_p FILE | |
361 | # ----------------------- | |
362 | # Test if FILE is an executable regular file. | |
363 | as_fn_executable_p () | |
364 | { | |
365 | test -f "$1" && test -x "$1" | |
366 | } # as_fn_executable_p | |
c971b7fa PA |
367 | # as_fn_append VAR VALUE |
368 | # ---------------------- | |
369 | # Append the text in VALUE to the end of the definition contained in VAR. Take | |
370 | # advantage of any shell optimizations that allow amortized linear growth over | |
371 | # repeated appends, instead of the typical quadratic growth present in naive | |
372 | # implementations. | |
373 | if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : | |
374 | eval 'as_fn_append () | |
375 | { | |
376 | eval $1+=\$2 | |
377 | }' | |
378 | else | |
379 | as_fn_append () | |
380 | { | |
381 | eval $1=\$$1\$2 | |
382 | } | |
383 | fi # as_fn_append | |
384 | ||
385 | # as_fn_arith ARG... | |
386 | # ------------------ | |
387 | # Perform arithmetic evaluation on the ARGs, and store the result in the | |
388 | # global $as_val. Take advantage of shells that can avoid forks. The arguments | |
389 | # must be portable across $(()) and expr. | |
390 | if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : | |
391 | eval 'as_fn_arith () | |
392 | { | |
393 | as_val=$(( $* )) | |
394 | }' | |
395 | else | |
396 | as_fn_arith () | |
397 | { | |
398 | as_val=`expr "$@" || test $? -eq 1` | |
399 | } | |
400 | fi # as_fn_arith | |
401 | ||
402 | ||
d0ac1c44 SM |
403 | # as_fn_error STATUS ERROR [LINENO LOG_FD] |
404 | # ---------------------------------------- | |
c971b7fa PA |
405 | # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are |
406 | # provided, also output the error to LOG_FD, referencing LINENO. Then exit the | |
d0ac1c44 | 407 | # script with STATUS, using 1 if that was 0. |
c971b7fa PA |
408 | as_fn_error () |
409 | { | |
d0ac1c44 SM |
410 | as_status=$1; test $as_status -eq 0 && as_status=1 |
411 | if test "$4"; then | |
412 | as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
413 | $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 | |
c971b7fa | 414 | fi |
d0ac1c44 | 415 | $as_echo "$as_me: error: $2" >&2 |
c971b7fa PA |
416 | as_fn_exit $as_status |
417 | } # as_fn_error | |
418 | ||
419 | if expr a : '\(a\)' >/dev/null 2>&1 && | |
420 | test "X`expr 00001 : '.*\(...\)'`" = X001; then | |
421 | as_expr=expr | |
422 | else | |
423 | as_expr=false | |
424 | fi | |
425 | ||
426 | if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then | |
427 | as_basename=basename | |
428 | else | |
429 | as_basename=false | |
430 | fi | |
431 | ||
432 | if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then | |
433 | as_dirname=dirname | |
434 | else | |
435 | as_dirname=false | |
436 | fi | |
437 | ||
438 | as_me=`$as_basename -- "$0" || | |
439 | $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ | |
440 | X"$0" : 'X\(//\)$' \| \ | |
441 | X"$0" : 'X\(/\)' \| . 2>/dev/null || | |
442 | $as_echo X/"$0" | | |
443 | sed '/^.*\/\([^/][^/]*\)\/*$/{ | |
444 | s//\1/ | |
445 | q | |
446 | } | |
447 | /^X\/\(\/\/\)$/{ | |
448 | s//\1/ | |
449 | q | |
450 | } | |
451 | /^X\/\(\/\).*/{ | |
452 | s//\1/ | |
453 | q | |
454 | } | |
455 | s/.*/./; q'` | |
456 | ||
457 | # Avoid depending upon Character Ranges. | |
458 | as_cr_letters='abcdefghijklmnopqrstuvwxyz' | |
459 | as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
460 | as_cr_Letters=$as_cr_letters$as_cr_LETTERS | |
461 | as_cr_digits='0123456789' | |
462 | as_cr_alnum=$as_cr_Letters$as_cr_digits | |
463 | ||
464 | ||
465 | as_lineno_1=$LINENO as_lineno_1a=$LINENO | |
466 | as_lineno_2=$LINENO as_lineno_2a=$LINENO | |
467 | eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && | |
468 | test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { | |
469 | # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) | |
470 | sed -n ' | |
471 | p | |
472 | /[$]LINENO/= | |
473 | ' <$as_myself | | |
474 | sed ' | |
475 | s/[$]LINENO.*/&-/ | |
476 | t lineno | |
477 | b | |
478 | :lineno | |
479 | N | |
480 | :loop | |
481 | s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ | |
482 | t loop | |
483 | s/-\n.*// | |
484 | ' >$as_me.lineno && | |
485 | chmod +x "$as_me.lineno" || | |
486 | { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } | |
487 | ||
d0ac1c44 SM |
488 | # If we had to re-execute with $CONFIG_SHELL, we're ensured to have |
489 | # already done that, so ensure we don't try to do so again and fall | |
490 | # in an infinite loop. This has already happened in practice. | |
491 | _as_can_reexec=no; export _as_can_reexec | |
c971b7fa PA |
492 | # Don't try to exec as it changes $[0], causing all sort of problems |
493 | # (the dirname of $[0] is not the place where we might find the | |
494 | # original and so on. Autoconf is especially sensitive to this). | |
495 | . "./$as_me.lineno" | |
496 | # Exit status is that of the last command. | |
497 | exit | |
498 | } | |
499 | ||
500 | ECHO_C= ECHO_N= ECHO_T= | |
501 | case `echo -n x` in #((((( | |
502 | -n*) | |
503 | case `echo 'xy\c'` in | |
504 | *c*) ECHO_T=' ';; # ECHO_T is single tab character. | |
505 | xy) ECHO_C='\c';; | |
506 | *) echo `echo ksh88 bug on AIX 6.1` > /dev/null | |
507 | ECHO_T=' ';; | |
508 | esac;; | |
509 | *) | |
510 | ECHO_N='-n';; | |
511 | esac | |
512 | ||
513 | rm -f conf$$ conf$$.exe conf$$.file | |
514 | if test -d conf$$.dir; then | |
515 | rm -f conf$$.dir/conf$$.file | |
516 | else | |
517 | rm -f conf$$.dir | |
518 | mkdir conf$$.dir 2>/dev/null | |
519 | fi | |
520 | if (echo >conf$$.file) 2>/dev/null; then | |
521 | if ln -s conf$$.file conf$$ 2>/dev/null; then | |
522 | as_ln_s='ln -s' | |
523 | # ... but there are two gotchas: | |
524 | # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. | |
525 | # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. | |
d0ac1c44 | 526 | # In both cases, we have to default to `cp -pR'. |
c971b7fa | 527 | ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || |
d0ac1c44 | 528 | as_ln_s='cp -pR' |
c971b7fa PA |
529 | elif ln conf$$.file conf$$ 2>/dev/null; then |
530 | as_ln_s=ln | |
531 | else | |
d0ac1c44 | 532 | as_ln_s='cp -pR' |
c971b7fa PA |
533 | fi |
534 | else | |
d0ac1c44 | 535 | as_ln_s='cp -pR' |
c971b7fa PA |
536 | fi |
537 | rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file | |
538 | rmdir conf$$.dir 2>/dev/null | |
539 | ||
540 | if mkdir -p . 2>/dev/null; then | |
541 | as_mkdir_p='mkdir -p "$as_dir"' | |
542 | else | |
543 | test -d ./-p && rmdir ./-p | |
544 | as_mkdir_p=false | |
545 | fi | |
546 | ||
d0ac1c44 SM |
547 | as_test_x='test -x' |
548 | as_executable_p=as_fn_executable_p | |
c971b7fa PA |
549 | |
550 | # Sed expression to map a string onto a valid CPP name. | |
551 | as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" | |
552 | ||
553 | # Sed expression to map a string onto a valid variable name. | |
554 | as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" | |
555 | ||
556 | ||
d0ac1c44 SM |
557 | test -n "$DJDIR" || exec 7<&0 </dev/null |
558 | exec 6>&1 | |
c971b7fa PA |
559 | |
560 | # Name of the host. | |
d0ac1c44 | 561 | # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, |
c971b7fa PA |
562 | # so uname gets run too. |
563 | ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` | |
564 | ||
565 | # | |
566 | # Initializations. | |
567 | # | |
568 | ac_default_prefix=/usr/local | |
569 | ac_clean_files= | |
570 | ac_config_libobj_dir=. | |
571 | LIBOBJS= | |
572 | cross_compiling=no | |
573 | subdirs= | |
574 | MFLAGS= | |
575 | MAKEFLAGS= | |
576 | ||
577 | # Identity of this package. | |
d0ac1c44 SM |
578 | PACKAGE_NAME='libgnu' |
579 | PACKAGE_TARNAME='libgnu' | |
580 | PACKAGE_VERSION='UNUSED-VERSION' | |
581 | PACKAGE_STRING='libgnu UNUSED-VERSION' | |
582 | PACKAGE_BUGREPORT='' | |
583 | PACKAGE_URL='' | |
c971b7fa | 584 | |
8690e634 | 585 | ac_unique_file="import/memmem.c" |
9c9d63b1 | 586 | ac_header_list= |
c971b7fa PA |
587 | # Factoring default headers for most tests. |
588 | ac_includes_default="\ | |
589 | #include <stdio.h> | |
590 | #ifdef HAVE_SYS_TYPES_H | |
591 | # include <sys/types.h> | |
592 | #endif | |
593 | #ifdef HAVE_SYS_STAT_H | |
594 | # include <sys/stat.h> | |
595 | #endif | |
596 | #ifdef STDC_HEADERS | |
597 | # include <stdlib.h> | |
598 | # include <stddef.h> | |
599 | #else | |
600 | # ifdef HAVE_STDLIB_H | |
601 | # include <stdlib.h> | |
602 | # endif | |
603 | #endif | |
604 | #ifdef HAVE_STRING_H | |
605 | # if !defined STDC_HEADERS && defined HAVE_MEMORY_H | |
606 | # include <memory.h> | |
607 | # endif | |
608 | # include <string.h> | |
609 | #endif | |
610 | #ifdef HAVE_STRINGS_H | |
611 | # include <strings.h> | |
612 | #endif | |
613 | #ifdef HAVE_INTTYPES_H | |
614 | # include <inttypes.h> | |
615 | #endif | |
616 | #ifdef HAVE_STDINT_H | |
617 | # include <stdint.h> | |
618 | #endif | |
619 | #ifdef HAVE_UNISTD_H | |
620 | # include <unistd.h> | |
621 | #endif" | |
622 | ||
5abebf3c | 623 | gl_use_threads_default= |
c0c3707f | 624 | gl_use_winpthreads_default= |
c0c3707f | 625 | ac_func_list= |
8690e634 | 626 | gl_fnmatch_required=POSIX |
c971b7fa PA |
627 | ac_subst_vars='am__EXEEXT_FALSE |
628 | am__EXEEXT_TRUE | |
629 | gltests_LTLIBOBJS | |
630 | gltests_LIBOBJS | |
631 | gl_LTLIBOBJS | |
632 | gl_LIBOBJS | |
633 | LTLIBOBJS | |
634 | LIBOBJS | |
635 | LN_S | |
39be3c7e SM |
636 | AM_BACKSLASH |
637 | AM_DEFAULT_VERBOSITY | |
d0ac1c44 SM |
638 | AM_DEFAULT_V |
639 | AM_V | |
c971b7fa PA |
640 | am__fastdepCC_FALSE |
641 | am__fastdepCC_TRUE | |
642 | CCDEPMODE | |
d0ac1c44 | 643 | am__nodep |
c971b7fa PA |
644 | AMDEPBACKSLASH |
645 | AMDEP_FALSE | |
646 | AMDEP_TRUE | |
647 | am__quote | |
648 | am__include | |
649 | DEPDIR | |
650 | am__untar | |
651 | am__tar | |
652 | AMTAR | |
653 | am__leading_dot | |
654 | SET_MAKE | |
655 | AWK | |
656 | mkdir_p | |
c971b7fa PA |
657 | INSTALL_STRIP_PROGRAM |
658 | STRIP | |
659 | install_sh | |
660 | MAKEINFO | |
661 | AUTOHEADER | |
662 | AUTOMAKE | |
663 | AUTOCONF | |
664 | ACLOCAL | |
665 | VERSION | |
666 | PACKAGE | |
667 | CYGPATH_W | |
668 | am__isrc | |
669 | INSTALL_DATA | |
670 | INSTALL_SCRIPT | |
671 | INSTALL_PROGRAM | |
672 | LIBGNU_LTLIBDEPS | |
673 | LIBGNU_LIBDEPS | |
674 | gltests_WITNESS | |
8690e634 JK |
675 | REPLACE_TOWLOWER |
676 | REPLACE_ISWCNTRL | |
677 | HAVE_WCTYPE_H | |
678 | NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H | |
679 | NEXT_WCTYPE_H | |
680 | HAVE_ISWCNTRL | |
5df4cba6 SM |
681 | REPLACE_ISWXDIGIT |
682 | REPLACE_ISWDIGIT | |
8690e634 JK |
683 | REPLACE_ISWBLANK |
684 | HAVE_WCTRANS_T | |
685 | HAVE_WCTYPE_T | |
686 | HAVE_ISWBLANK | |
687 | GNULIB_TOWCTRANS | |
688 | GNULIB_WCTRANS | |
689 | GNULIB_ISWCTYPE | |
690 | GNULIB_WCTYPE | |
5df4cba6 SM |
691 | GNULIB_ISWXDIGIT |
692 | GNULIB_ISWDIGIT | |
8690e634 | 693 | GNULIB_ISWBLANK |
c0c3707f | 694 | HAVE_CRTDEFS_H |
8690e634 | 695 | HAVE_WINT_T |
8690e634 JK |
696 | NEXT_AS_FIRST_DIRECTIVE_WCHAR_H |
697 | NEXT_WCHAR_H | |
8839a007 PA |
698 | HAVE_UNISTD_H |
699 | NEXT_AS_FIRST_DIRECTIVE_UNISTD_H | |
700 | NEXT_UNISTD_H | |
9c9d63b1 | 701 | TIME_H_DEFINES_TIME_UTC |
4a626d0a | 702 | UNISTD_H_DEFINES_STRUCT_TIMESPEC |
09607c9e TT |
703 | PTHREAD_H_DEFINES_STRUCT_TIMESPEC |
704 | SYS_TIME_H_DEFINES_STRUCT_TIMESPEC | |
705 | TIME_H_DEFINES_STRUCT_TIMESPEC | |
706 | NEXT_AS_FIRST_DIRECTIVE_TIME_H | |
707 | NEXT_TIME_H | |
9c9d63b1 PM |
708 | REPLACE_LOCALTIME |
709 | REPLACE_GMTIME | |
710 | REPLACE_TZSET | |
711 | REPLACE_TIMEGM | |
712 | REPLACE_STRFTIME | |
713 | REPLACE_NANOSLEEP | |
714 | REPLACE_MKTIME | |
715 | REPLACE_LOCALTIME_R | |
716 | REPLACE_CTIME | |
717 | HAVE_TIMEZONE_T | |
718 | HAVE_TIMESPEC_GET | |
719 | HAVE_TIMEGM | |
720 | HAVE_STRPTIME | |
721 | HAVE_NANOSLEEP | |
722 | HAVE_DECL_LOCALTIME_R | |
723 | GNULIB_MDA_TZSET | |
724 | GNULIB_TZSET | |
725 | GNULIB_TIME_RZ | |
726 | GNULIB_TIME_R | |
727 | GNULIB_TIMESPEC_GET | |
728 | GNULIB_TIMEGM | |
729 | GNULIB_STRPTIME | |
730 | GNULIB_STRFTIME | |
731 | GNULIB_NANOSLEEP | |
732 | GNULIB_LOCALTIME | |
733 | GNULIB_MKTIME | |
734 | GNULIB_CTIME | |
725e2999 JB |
735 | HAVE_SYS_UIO_H |
736 | NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H | |
737 | NEXT_SYS_UIO_H | |
c0c3707f | 738 | WINDOWS_STAT_INODES |
63ce7108 TT |
739 | WINDOWS_64_BIT_OFF_T |
740 | NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H | |
741 | NEXT_SYS_TYPES_H | |
698be2d8 CB |
742 | HAVE_SYS_RANDOM_H |
743 | NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H | |
744 | NEXT_SYS_RANDOM_H | |
32e2770e MF |
745 | HAVE_STRINGS_H |
746 | NEXT_AS_FIRST_DIRECTIVE_STRINGS_H | |
747 | NEXT_STRINGS_H | |
2196f55f YQ |
748 | NEXT_AS_FIRST_DIRECTIVE_STRING_H |
749 | NEXT_STRING_H | |
98399780 YQ |
750 | NEXT_AS_FIRST_DIRECTIVE_STDLIB_H |
751 | NEXT_STDLIB_H | |
6a29c58e YQ |
752 | NEXT_AS_FIRST_DIRECTIVE_STDIO_H |
753 | NEXT_STDIO_H | |
2196f55f YQ |
754 | HAVE__BOOL |
755 | GL_GENERATE_STDBOOL_H_FALSE | |
756 | GL_GENERATE_STDBOOL_H_TRUE | |
757 | STDBOOL_H | |
725e2999 JB |
758 | GL_GENERATE_STDALIGN_H_FALSE |
759 | GL_GENERATE_STDALIGN_H_TRUE | |
760 | STDALIGN_H | |
0750520d PA |
761 | NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H |
762 | NEXT_SIGNAL_H | |
763 | REPLACE_RAISE | |
764 | REPLACE_PTHREAD_SIGMASK | |
765 | HAVE_SIGHANDLER_T | |
766 | HAVE_TYPE_VOLATILE_SIG_ATOMIC_T | |
767 | HAVE_STRUCT_SIGACTION_SA_SIGACTION | |
768 | HAVE_SIGACTION | |
769 | HAVE_SIGINFO_T | |
770 | HAVE_SIGSET_T | |
771 | HAVE_RAISE | |
772 | HAVE_PTHREAD_SIGMASK | |
773 | HAVE_POSIX_SIGNALBLOCKING | |
774 | GNULIB_SIGACTION | |
775 | GNULIB_SIGPROCMASK | |
776 | GNULIB_SIGNAL_H_SIGPIPE | |
777 | GNULIB_RAISE | |
778 | GNULIB_PTHREAD_SIGMASK | |
725e2999 JB |
779 | GL_GENERATE_NETINET_IN_H_FALSE |
780 | GL_GENERATE_NETINET_IN_H_TRUE | |
781 | NETINET_IN_H | |
782 | HAVE_NETINET_IN_H | |
783 | NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H | |
784 | NEXT_NETINET_IN_H | |
c971b7fa | 785 | UNDEFINE_STRTOK_R |
c971b7fa | 786 | REPLACE_STRSIGNAL |
9c9d63b1 | 787 | REPLACE_STRERRORNAME_NP |
c971b7fa PA |
788 | REPLACE_STRERROR_R |
789 | REPLACE_STRERROR | |
c0c3707f | 790 | REPLACE_STRTOK_R |
c971b7fa PA |
791 | REPLACE_STRCASESTR |
792 | REPLACE_STRSTR | |
c0c3707f CB |
793 | REPLACE_STRNLEN |
794 | REPLACE_STRNDUP | |
795 | REPLACE_STRNCAT | |
c971b7fa | 796 | REPLACE_STRDUP |
c0c3707f | 797 | REPLACE_STRCHRNUL |
c971b7fa PA |
798 | REPLACE_STPNCPY |
799 | REPLACE_MEMMEM | |
800 | REPLACE_MEMCHR | |
9c9d63b1 | 801 | REPLACE_FFSLL |
c971b7fa PA |
802 | HAVE_STRVERSCMP |
803 | HAVE_DECL_STRSIGNAL | |
9c9d63b1 PM |
804 | HAVE_SIGDESCR_NP |
805 | HAVE_SIGABBREV_NP | |
806 | HAVE_STRERRORNAME_NP | |
c971b7fa PA |
807 | HAVE_DECL_STRERROR_R |
808 | HAVE_DECL_STRTOK_R | |
809 | HAVE_STRCASESTR | |
810 | HAVE_STRSEP | |
811 | HAVE_STRPBRK | |
812 | HAVE_DECL_STRNLEN | |
813 | HAVE_DECL_STRNDUP | |
814 | HAVE_DECL_STRDUP | |
815 | HAVE_STRCHRNUL | |
816 | HAVE_STPNCPY | |
817 | HAVE_STPCPY | |
818 | HAVE_RAWMEMCHR | |
819 | HAVE_DECL_MEMRCHR | |
820 | HAVE_MEMPCPY | |
821 | HAVE_DECL_MEMMEM | |
c971b7fa PA |
822 | HAVE_FFSLL |
823 | HAVE_FFSL | |
c0c3707f | 824 | HAVE_EXPLICIT_BZERO |
9c9d63b1 PM |
825 | GNULIB_MDA_STRDUP |
826 | GNULIB_MDA_MEMCCPY | |
c971b7fa PA |
827 | HAVE_MBSLEN |
828 | GNULIB_STRVERSCMP | |
829 | GNULIB_STRSIGNAL | |
9c9d63b1 PM |
830 | GNULIB_SIGDESCR_NP |
831 | GNULIB_SIGABBREV_NP | |
832 | GNULIB_STRERRORNAME_NP | |
c971b7fa PA |
833 | GNULIB_STRERROR_R |
834 | GNULIB_STRERROR | |
835 | GNULIB_MBSTOK_R | |
836 | GNULIB_MBSSEP | |
837 | GNULIB_MBSSPN | |
838 | GNULIB_MBSPBRK | |
839 | GNULIB_MBSCSPN | |
840 | GNULIB_MBSCASESTR | |
841 | GNULIB_MBSPCASECMP | |
842 | GNULIB_MBSNCASECMP | |
843 | GNULIB_MBSCASECMP | |
844 | GNULIB_MBSSTR | |
845 | GNULIB_MBSRCHR | |
846 | GNULIB_MBSCHR | |
847 | GNULIB_MBSNLEN | |
848 | GNULIB_MBSLEN | |
849 | GNULIB_STRTOK_R | |
850 | GNULIB_STRCASESTR | |
851 | GNULIB_STRSTR | |
852 | GNULIB_STRSEP | |
853 | GNULIB_STRPBRK | |
854 | GNULIB_STRNLEN | |
855 | GNULIB_STRNDUP | |
856 | GNULIB_STRNCAT | |
857 | GNULIB_STRDUP | |
858 | GNULIB_STRCHRNUL | |
859 | GNULIB_STPNCPY | |
860 | GNULIB_STPCPY | |
861 | GNULIB_RAWMEMCHR | |
862 | GNULIB_MEMRCHR | |
863 | GNULIB_MEMPCPY | |
864 | GNULIB_MEMMEM | |
865 | GNULIB_MEMCHR | |
866 | GNULIB_FFSLL | |
867 | GNULIB_FFSL | |
c0c3707f | 868 | GNULIB_EXPLICIT_BZERO |
5df4cba6 SM |
869 | HAVE_VISIBILITY |
870 | CFLAG_VISIBILITY | |
871 | LIB_MBRTOWC | |
8690e634 | 872 | LOCALE_ZH_CN |
c0c3707f | 873 | LOCALE_FR_UTF8 |
8690e634 | 874 | LOCALE_JA |
88b48903 WN |
875 | NEXT_AS_FIRST_DIRECTIVE_MATH_H |
876 | NEXT_MATH_H | |
5abebf3c CB |
877 | LTLIBMULTITHREAD |
878 | LIBMULTITHREAD | |
879 | LTLIBTHREAD | |
880 | LIBTHREAD | |
5df4cba6 SM |
881 | LIBSTDTHREAD |
882 | NEXT_AS_FIRST_DIRECTIVE_LOCALE_H | |
883 | NEXT_LOCALE_H | |
884 | HAVE_XLOCALE_H | |
885 | NEXT_AS_FIRST_DIRECTIVE_STDDEF_H | |
886 | NEXT_STDDEF_H | |
887 | GL_GENERATE_STDDEF_H_FALSE | |
888 | GL_GENERATE_STDDEF_H_TRUE | |
889 | STDDEF_H | |
890 | HAVE_WCHAR_T | |
891 | HAVE_MAX_ALIGN_T | |
892 | REPLACE_NULL | |
893 | REPLACE_STRUCT_LCONV | |
894 | REPLACE_FREELOCALE | |
895 | REPLACE_DUPLOCALE | |
896 | REPLACE_NEWLOCALE | |
897 | REPLACE_SETLOCALE | |
898 | REPLACE_LOCALECONV | |
899 | HAVE_FREELOCALE | |
900 | HAVE_DUPLOCALE | |
901 | HAVE_NEWLOCALE | |
902 | GNULIB_LOCALENAME | |
903 | GNULIB_DUPLOCALE | |
904 | GNULIB_SETLOCALE_NULL | |
905 | GNULIB_SETLOCALE | |
906 | GNULIB_LOCALECONV | |
8690e634 | 907 | LOCALCHARSET_TESTS_ENVIRONMENT |
c971b7fa PA |
908 | NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H |
909 | NEXT_INTTYPES_H | |
910 | UINT64_MAX_EQ_ULONG_MAX | |
911 | UINT32_MAX_LT_UINTMAX_MAX | |
912 | PRIPTR_PREFIX | |
c971b7fa PA |
913 | INT64_MAX_EQ_LONG_MAX |
914 | INT32_MAX_LT_INTMAX_MAX | |
4a626d0a | 915 | REPLACE_STRTOUMAX |
c971b7fa | 916 | REPLACE_STRTOIMAX |
c0c3707f | 917 | HAVE_IMAXDIV_T |
c971b7fa PA |
918 | HAVE_DECL_STRTOUMAX |
919 | HAVE_DECL_STRTOIMAX | |
920 | HAVE_DECL_IMAXDIV | |
921 | HAVE_DECL_IMAXABS | |
922 | GNULIB_STRTOUMAX | |
923 | GNULIB_STRTOIMAX | |
924 | GNULIB_IMAXDIV | |
925 | GNULIB_IMAXABS | |
926 | GL_GENERATE_STDINT_H_FALSE | |
927 | GL_GENERATE_STDINT_H_TRUE | |
928 | STDINT_H | |
49e4877c PA |
929 | HAVE_SYS_INTTYPES_H |
930 | HAVE_SYS_BITYPES_H | |
931 | HAVE_C99_STDINT_H | |
c971b7fa PA |
932 | WINT_T_SUFFIX |
933 | WCHAR_T_SUFFIX | |
934 | SIG_ATOMIC_T_SUFFIX | |
935 | SIZE_T_SUFFIX | |
936 | PTRDIFF_T_SUFFIX | |
937 | HAVE_SIGNED_WINT_T | |
938 | HAVE_SIGNED_WCHAR_T | |
939 | HAVE_SIGNED_SIG_ATOMIC_T | |
940 | BITSIZEOF_WINT_T | |
941 | BITSIZEOF_WCHAR_T | |
942 | BITSIZEOF_SIG_ATOMIC_T | |
943 | BITSIZEOF_SIZE_T | |
944 | BITSIZEOF_PTRDIFF_T | |
945 | APPLE_UNIVERSAL_BUILD | |
c971b7fa PA |
946 | HAVE_STDINT_H |
947 | NEXT_AS_FIRST_DIRECTIVE_STDINT_H | |
948 | NEXT_STDINT_H | |
c971b7fa PA |
949 | HAVE_SYS_TYPES_H |
950 | HAVE_INTTYPES_H | |
951 | HAVE_WCHAR_H | |
c0c3707f | 952 | GNULIB_OVERRIDES_WINT_T |
49e4877c PA |
953 | GL_GENERATE_LIMITS_H_FALSE |
954 | GL_GENERATE_LIMITS_H_TRUE | |
955 | LIMITS_H | |
956 | NEXT_AS_FIRST_DIRECTIVE_LIMITS_H | |
957 | NEXT_LIMITS_H | |
725e2999 JB |
958 | HAVE_SYS_SOCKET_H |
959 | NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H | |
960 | NEXT_SYS_SOCKET_H | |
961 | HAVE_ACCEPT4 | |
962 | HAVE_SA_FAMILY_T | |
963 | HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY | |
964 | HAVE_STRUCT_SOCKADDR_STORAGE | |
965 | GNULIB_ACCEPT4 | |
966 | GNULIB_SHUTDOWN | |
967 | GNULIB_SETSOCKOPT | |
968 | GNULIB_SENDTO | |
969 | GNULIB_RECVFROM | |
970 | GNULIB_SEND | |
971 | GNULIB_RECV | |
972 | GNULIB_LISTEN | |
973 | GNULIB_GETSOCKOPT | |
974 | GNULIB_GETSOCKNAME | |
975 | GNULIB_GETPEERNAME | |
976 | GNULIB_BIND | |
977 | GNULIB_ACCEPT | |
978 | GNULIB_CONNECT | |
979 | GNULIB_SOCKET | |
980 | INET_NTOP_LIB | |
5df4cba6 SM |
981 | LIB_HARD_LOCALE |
982 | LIB_SETLOCALE_NULL | |
983 | LIB_SCHED_YIELD | |
984 | LIBPMULTITHREAD | |
985 | LIBPTHREAD | |
6ec2e0f5 SDJ |
986 | GL_GENERATE_GLOB_H_FALSE |
987 | GL_GENERATE_GLOB_H_TRUE | |
988 | GLOB_H | |
c0c3707f CB |
989 | HAVE_GLOB_H |
990 | NEXT_AS_FIRST_DIRECTIVE_GLOB_H | |
991 | NEXT_GLOB_H | |
992 | REPLACE_GLOB_PATTERN_P | |
993 | REPLACE_GLOB | |
994 | HAVE_GLOB_PATTERN_P | |
995 | HAVE_GLOB | |
996 | GNULIB_GLOB | |
4a626d0a PA |
997 | NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H |
998 | NEXT_SYS_TIME_H | |
999 | REPLACE_STRUCT_TIMEVAL | |
1000 | REPLACE_GETTIMEOFDAY | |
4a626d0a PA |
1001 | HAVE_SYS_TIME_H |
1002 | HAVE_STRUCT_TIMEVAL | |
1003 | HAVE_GETTIMEOFDAY | |
1004 | GNULIB_GETTIMEOFDAY | |
6ec2e0f5 SDJ |
1005 | LTLIBINTL |
1006 | LIBINTL | |
698be2d8 CB |
1007 | LIB_GETRANDOM |
1008 | REPLACE_GETRANDOM | |
1009 | HAVE_GETRANDOM | |
1010 | GNULIB_GETRANDOM | |
c0c3707f | 1011 | LIB_GETLOGIN |
c17253b9 MF |
1012 | REPLACE_VSPRINTF |
1013 | REPLACE_VSNPRINTF | |
1014 | REPLACE_VPRINTF | |
1015 | REPLACE_VFPRINTF | |
1016 | REPLACE_VDPRINTF | |
1017 | REPLACE_VASPRINTF | |
1018 | REPLACE_TMPFILE | |
1019 | REPLACE_STDIO_WRITE_FUNCS | |
1020 | REPLACE_STDIO_READ_FUNCS | |
1021 | REPLACE_SPRINTF | |
1022 | REPLACE_SNPRINTF | |
1023 | REPLACE_RENAMEAT | |
1024 | REPLACE_RENAME | |
1025 | REPLACE_REMOVE | |
1026 | REPLACE_PRINTF | |
1027 | REPLACE_POPEN | |
1028 | REPLACE_PERROR | |
1029 | REPLACE_OBSTACK_PRINTF | |
1030 | REPLACE_GETLINE | |
1031 | REPLACE_GETDELIM | |
1032 | REPLACE_FTELLO | |
1033 | REPLACE_FTELL | |
1034 | REPLACE_FSEEKO | |
1035 | REPLACE_FSEEK | |
1036 | REPLACE_FREOPEN | |
1037 | REPLACE_FPURGE | |
1038 | REPLACE_FPRINTF | |
1039 | REPLACE_FOPEN | |
1040 | REPLACE_FFLUSH | |
1041 | REPLACE_FDOPEN | |
1042 | REPLACE_FCLOSE | |
1043 | REPLACE_DPRINTF | |
1044 | HAVE_VDPRINTF | |
1045 | HAVE_VASPRINTF | |
1046 | HAVE_RENAMEAT | |
1047 | HAVE_POPEN | |
1048 | HAVE_PCLOSE | |
1049 | HAVE_FTELLO | |
1050 | HAVE_FSEEKO | |
1051 | HAVE_DPRINTF | |
1052 | HAVE_DECL_VSNPRINTF | |
1053 | HAVE_DECL_SNPRINTF | |
1054 | HAVE_DECL_OBSTACK_PRINTF | |
1055 | HAVE_DECL_GETLINE | |
1056 | HAVE_DECL_GETDELIM | |
1057 | HAVE_DECL_FTELLO | |
1058 | HAVE_DECL_FSEEKO | |
1059 | HAVE_DECL_FPURGE | |
1060 | HAVE_DECL_FCLOSEALL | |
1061 | GNULIB_MDA_TEMPNAM | |
1062 | GNULIB_MDA_PUTW | |
1063 | GNULIB_MDA_GETW | |
1064 | GNULIB_MDA_FILENO | |
1065 | GNULIB_MDA_FDOPEN | |
1066 | GNULIB_MDA_FCLOSEALL | |
1067 | GNULIB_VSPRINTF_POSIX | |
1068 | GNULIB_VSNPRINTF | |
1069 | GNULIB_VPRINTF_POSIX | |
1070 | GNULIB_VPRINTF | |
1071 | GNULIB_VFPRINTF_POSIX | |
1072 | GNULIB_VFPRINTF | |
1073 | GNULIB_VDPRINTF | |
1074 | GNULIB_VSCANF | |
1075 | GNULIB_VFSCANF | |
1076 | GNULIB_VASPRINTF | |
1077 | GNULIB_TMPFILE | |
1078 | GNULIB_STDIO_H_SIGPIPE | |
1079 | GNULIB_STDIO_H_NONBLOCKING | |
1080 | GNULIB_SPRINTF_POSIX | |
1081 | GNULIB_SNPRINTF | |
1082 | GNULIB_SCANF | |
1083 | GNULIB_RENAMEAT | |
1084 | GNULIB_RENAME | |
1085 | GNULIB_REMOVE | |
1086 | GNULIB_PUTS | |
1087 | GNULIB_PUTCHAR | |
1088 | GNULIB_PUTC | |
1089 | GNULIB_PRINTF_POSIX | |
1090 | GNULIB_PRINTF | |
1091 | GNULIB_POPEN | |
1092 | GNULIB_PERROR | |
1093 | GNULIB_PCLOSE | |
1094 | GNULIB_OBSTACK_PRINTF_POSIX | |
1095 | GNULIB_OBSTACK_PRINTF | |
1096 | GNULIB_GETLINE | |
1097 | GNULIB_GETDELIM | |
1098 | GNULIB_GETCHAR | |
1099 | GNULIB_GETC | |
1100 | GNULIB_FWRITE | |
1101 | GNULIB_FTELLO | |
1102 | GNULIB_FTELL | |
1103 | GNULIB_FSEEKO | |
1104 | GNULIB_FSEEK | |
1105 | GNULIB_FSCANF | |
1106 | GNULIB_FREOPEN | |
1107 | GNULIB_FREAD | |
1108 | GNULIB_FPUTS | |
1109 | GNULIB_FPUTC | |
1110 | GNULIB_FPURGE | |
1111 | GNULIB_FPRINTF_POSIX | |
1112 | GNULIB_FPRINTF | |
1113 | GNULIB_FOPEN | |
1114 | GNULIB_FGETS | |
1115 | GNULIB_FGETC | |
1116 | GNULIB_FFLUSH | |
1117 | GNULIB_FDOPEN | |
1118 | GNULIB_FCLOSE | |
1119 | GNULIB_DPRINTF | |
6ec2e0f5 | 1120 | WINDOWS_64_BIT_ST_SIZE |
c0c3707f | 1121 | WINDOWS_STAT_TIMESPEC |
6ec2e0f5 SDJ |
1122 | NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H |
1123 | NEXT_SYS_STAT_H | |
1124 | REPLACE_UTIMENSAT | |
1125 | REPLACE_STAT | |
9c9d63b1 | 1126 | REPLACE_MKNODAT |
6ec2e0f5 | 1127 | REPLACE_MKNOD |
9c9d63b1 | 1128 | REPLACE_MKFIFOAT |
6ec2e0f5 SDJ |
1129 | REPLACE_MKFIFO |
1130 | REPLACE_MKDIR | |
1131 | REPLACE_LSTAT | |
1132 | REPLACE_FUTIMENS | |
1133 | REPLACE_FSTATAT | |
1134 | REPLACE_FSTAT | |
5df4cba6 | 1135 | REPLACE_FCHMODAT |
6ec2e0f5 SDJ |
1136 | HAVE_UTIMENSAT |
1137 | HAVE_MKNODAT | |
1138 | HAVE_MKNOD | |
1139 | HAVE_MKFIFOAT | |
1140 | HAVE_MKFIFO | |
1141 | HAVE_MKDIRAT | |
1142 | HAVE_LSTAT | |
1143 | HAVE_LCHMOD | |
9c9d63b1 | 1144 | HAVE_GETUMASK |
6ec2e0f5 SDJ |
1145 | HAVE_FUTIMENS |
1146 | HAVE_FSTATAT | |
1147 | HAVE_FCHMODAT | |
9c9d63b1 PM |
1148 | GNULIB_MDA_UMASK |
1149 | GNULIB_MDA_MKDIR | |
1150 | GNULIB_MDA_CHMOD | |
c0c3707f | 1151 | GNULIB_OVERRIDES_STRUCT_STAT |
6ec2e0f5 SDJ |
1152 | GNULIB_UTIMENSAT |
1153 | GNULIB_STAT | |
1154 | GNULIB_MKNODAT | |
1155 | GNULIB_MKNOD | |
1156 | GNULIB_MKFIFOAT | |
1157 | GNULIB_MKFIFO | |
1158 | GNULIB_MKDIRAT | |
9c9d63b1 | 1159 | GNULIB_MKDIR |
6ec2e0f5 SDJ |
1160 | GNULIB_LSTAT |
1161 | GNULIB_LCHMOD | |
9c9d63b1 | 1162 | GNULIB_GETUMASK |
6ec2e0f5 SDJ |
1163 | GNULIB_FUTIMENS |
1164 | GNULIB_FSTATAT | |
1165 | GNULIB_FSTAT | |
1166 | GNULIB_FCHMODAT | |
88b48903 WN |
1167 | FREXPL_LIBM |
1168 | HAVE_SAME_LONG_DOUBLE_AS_DOUBLE | |
1169 | FREXP_LIBM | |
1170 | REPLACE_TRUNCL | |
1171 | REPLACE_TRUNCF | |
1172 | REPLACE_TRUNC | |
c0c3707f CB |
1173 | REPLACE_TANHF |
1174 | REPLACE_TANF | |
88b48903 | 1175 | REPLACE_SQRTL |
c0c3707f CB |
1176 | REPLACE_SQRTF |
1177 | REPLACE_SINHF | |
1178 | REPLACE_SINF | |
9c9d63b1 | 1179 | REPLACE_SIGNBIT_USING_BUILTINS |
88b48903 WN |
1180 | REPLACE_SIGNBIT |
1181 | REPLACE_ROUNDL | |
1182 | REPLACE_ROUNDF | |
1183 | REPLACE_ROUND | |
c0c3707f | 1184 | REPLACE_RINTL |
88b48903 WN |
1185 | REPLACE_REMAINDERL |
1186 | REPLACE_REMAINDERF | |
1187 | REPLACE_REMAINDER | |
1188 | REPLACE_NAN | |
1189 | REPLACE_MODFL | |
1190 | REPLACE_MODFF | |
1191 | REPLACE_MODF | |
1192 | REPLACE_LOGBL | |
1193 | REPLACE_LOGBF | |
1194 | REPLACE_LOGB | |
1195 | REPLACE_LOG2L | |
1196 | REPLACE_LOG2F | |
1197 | REPLACE_LOG2 | |
1198 | REPLACE_LOG1PL | |
1199 | REPLACE_LOG1PF | |
1200 | REPLACE_LOG1P | |
1201 | REPLACE_LOG10L | |
1202 | REPLACE_LOG10F | |
1203 | REPLACE_LOG10 | |
1204 | REPLACE_LOGL | |
1205 | REPLACE_LOGF | |
1206 | REPLACE_LOG | |
1207 | REPLACE_LDEXPL | |
1208 | REPLACE_ISNAN | |
1209 | REPLACE_ISINF | |
1210 | REPLACE_ISFINITE | |
c0c3707f | 1211 | REPLACE_ILOGBL |
88b48903 WN |
1212 | REPLACE_ILOGBF |
1213 | REPLACE_ILOGB | |
1214 | REPLACE_HYPOTL | |
1215 | REPLACE_HYPOTF | |
1216 | REPLACE_HYPOT | |
1217 | REPLACE_HUGE_VAL | |
1218 | REPLACE_FREXPL | |
1219 | REPLACE_FREXP | |
1220 | REPLACE_FREXPF | |
1221 | REPLACE_FMODL | |
1222 | REPLACE_FMODF | |
1223 | REPLACE_FMOD | |
1224 | REPLACE_FMAL | |
1225 | REPLACE_FMAF | |
1226 | REPLACE_FMA | |
1227 | REPLACE_FLOORL | |
1228 | REPLACE_FLOORF | |
1229 | REPLACE_FLOOR | |
1230 | REPLACE_FABSL | |
1231 | REPLACE_EXP2L | |
1232 | REPLACE_EXP2 | |
c0c3707f | 1233 | REPLACE_EXPM1L |
88b48903 WN |
1234 | REPLACE_EXPM1F |
1235 | REPLACE_EXPM1 | |
c0c3707f CB |
1236 | REPLACE_EXPL |
1237 | REPLACE_EXPF | |
1238 | REPLACE_COSHF | |
1239 | REPLACE_COSF | |
88b48903 WN |
1240 | REPLACE_CEILL |
1241 | REPLACE_CEILF | |
1242 | REPLACE_CEIL | |
1243 | REPLACE_CBRTL | |
1244 | REPLACE_CBRTF | |
c0c3707f CB |
1245 | REPLACE_ATAN2F |
1246 | REPLACE_ATANF | |
1247 | REPLACE_ASINF | |
1248 | REPLACE_ACOSF | |
88b48903 WN |
1249 | HAVE_DECL_TRUNCL |
1250 | HAVE_DECL_TRUNCF | |
1251 | HAVE_DECL_TRUNC | |
1252 | HAVE_DECL_TANL | |
1253 | HAVE_DECL_SQRTL | |
1254 | HAVE_DECL_SINL | |
1255 | HAVE_DECL_ROUNDL | |
1256 | HAVE_DECL_ROUNDF | |
1257 | HAVE_DECL_ROUND | |
1258 | HAVE_DECL_RINTF | |
1259 | HAVE_DECL_REMAINDERL | |
1260 | HAVE_DECL_REMAINDER | |
1261 | HAVE_DECL_LOGB | |
1262 | HAVE_DECL_LOG2L | |
1263 | HAVE_DECL_LOG2F | |
1264 | HAVE_DECL_LOG2 | |
1265 | HAVE_DECL_LOG10L | |
1266 | HAVE_DECL_LOGL | |
1267 | HAVE_DECL_LDEXPL | |
1268 | HAVE_DECL_FREXPL | |
1269 | HAVE_DECL_FLOORL | |
1270 | HAVE_DECL_FLOORF | |
1271 | HAVE_DECL_EXPM1L | |
1272 | HAVE_DECL_EXP2L | |
1273 | HAVE_DECL_EXP2F | |
1274 | HAVE_DECL_EXP2 | |
1275 | HAVE_DECL_EXPL | |
1276 | HAVE_DECL_COSL | |
1277 | HAVE_DECL_COPYSIGNF | |
1278 | HAVE_DECL_CEILL | |
1279 | HAVE_DECL_CEILF | |
1280 | HAVE_DECL_CBRTL | |
1281 | HAVE_DECL_CBRTF | |
1282 | HAVE_DECL_ATANL | |
1283 | HAVE_DECL_ASINL | |
1284 | HAVE_DECL_ACOSL | |
1285 | HAVE_TANHF | |
1286 | HAVE_TANL | |
1287 | HAVE_TANF | |
1288 | HAVE_SQRTL | |
1289 | HAVE_SQRTF | |
1290 | HAVE_SINHF | |
1291 | HAVE_SINL | |
1292 | HAVE_SINF | |
1293 | HAVE_RINTL | |
1294 | HAVE_RINT | |
1295 | HAVE_REMAINDERF | |
1296 | HAVE_REMAINDER | |
1297 | HAVE_POWF | |
1298 | HAVE_MODFL | |
1299 | HAVE_MODFF | |
1300 | HAVE_LOGBL | |
1301 | HAVE_LOGBF | |
1302 | HAVE_LOG1PL | |
1303 | HAVE_LOG1PF | |
1304 | HAVE_LOG1P | |
1305 | HAVE_LOG10L | |
1306 | HAVE_LOG10F | |
1307 | HAVE_LOGL | |
1308 | HAVE_LOGF | |
1309 | HAVE_LDEXPF | |
1310 | HAVE_ISNANL | |
1311 | HAVE_ISNAND | |
1312 | HAVE_ISNANF | |
1313 | HAVE_ILOGBL | |
1314 | HAVE_ILOGBF | |
1315 | HAVE_ILOGB | |
1316 | HAVE_HYPOTL | |
1317 | HAVE_HYPOTF | |
1318 | HAVE_FREXPF | |
1319 | HAVE_FMODL | |
1320 | HAVE_FMODF | |
1321 | HAVE_FMAL | |
1322 | HAVE_FMAF | |
1323 | HAVE_FMA | |
1324 | HAVE_FABSL | |
1325 | HAVE_FABSF | |
1326 | HAVE_EXPM1F | |
1327 | HAVE_EXPM1 | |
1328 | HAVE_EXPL | |
1329 | HAVE_EXPF | |
1330 | HAVE_COSHF | |
1331 | HAVE_COSL | |
1332 | HAVE_COSF | |
1333 | HAVE_COPYSIGNL | |
1334 | HAVE_COPYSIGN | |
1335 | HAVE_CBRTL | |
1336 | HAVE_CBRTF | |
1337 | HAVE_CBRT | |
1338 | HAVE_ATAN2F | |
1339 | HAVE_ATANL | |
1340 | HAVE_ATANF | |
1341 | HAVE_ASINL | |
1342 | HAVE_ASINF | |
1343 | HAVE_ACOSL | |
1344 | HAVE_ACOSF | |
9c9d63b1 PM |
1345 | GNULIB_MDA_YN |
1346 | GNULIB_MDA_Y1 | |
1347 | GNULIB_MDA_Y0 | |
1348 | GNULIB_MDA_JN | |
1349 | GNULIB_MDA_J1 | |
1350 | GNULIB_MDA_J0 | |
88b48903 WN |
1351 | GNULIB_TRUNCL |
1352 | GNULIB_TRUNCF | |
1353 | GNULIB_TRUNC | |
1354 | GNULIB_TANHF | |
1355 | GNULIB_TANL | |
1356 | GNULIB_TANF | |
1357 | GNULIB_SQRTL | |
1358 | GNULIB_SQRTF | |
1359 | GNULIB_SINHF | |
1360 | GNULIB_SINL | |
1361 | GNULIB_SINF | |
1362 | GNULIB_SIGNBIT | |
1363 | GNULIB_ROUNDL | |
1364 | GNULIB_ROUNDF | |
1365 | GNULIB_ROUND | |
1366 | GNULIB_RINTL | |
1367 | GNULIB_RINTF | |
1368 | GNULIB_RINT | |
1369 | GNULIB_REMAINDERL | |
1370 | GNULIB_REMAINDERF | |
1371 | GNULIB_REMAINDER | |
1372 | GNULIB_POWF | |
1373 | GNULIB_MODFL | |
1374 | GNULIB_MODFF | |
1375 | GNULIB_MODF | |
1376 | GNULIB_LOGBL | |
1377 | GNULIB_LOGBF | |
1378 | GNULIB_LOGB | |
1379 | GNULIB_LOG2L | |
1380 | GNULIB_LOG2F | |
1381 | GNULIB_LOG2 | |
1382 | GNULIB_LOG1PL | |
1383 | GNULIB_LOG1PF | |
1384 | GNULIB_LOG1P | |
1385 | GNULIB_LOG10L | |
1386 | GNULIB_LOG10F | |
1387 | GNULIB_LOG10 | |
1388 | GNULIB_LOGL | |
1389 | GNULIB_LOGF | |
1390 | GNULIB_LOG | |
1391 | GNULIB_LDEXPL | |
1392 | GNULIB_LDEXPF | |
1393 | GNULIB_ISNANL | |
1394 | GNULIB_ISNAND | |
1395 | GNULIB_ISNANF | |
1396 | GNULIB_ISNAN | |
1397 | GNULIB_ISINF | |
1398 | GNULIB_ISFINITE | |
1399 | GNULIB_ILOGBL | |
1400 | GNULIB_ILOGBF | |
1401 | GNULIB_ILOGB | |
1402 | GNULIB_HYPOTL | |
1403 | GNULIB_HYPOTF | |
1404 | GNULIB_HYPOT | |
1405 | GNULIB_FREXPL | |
1406 | GNULIB_FREXP | |
1407 | GNULIB_FREXPF | |
1408 | GNULIB_FMODL | |
1409 | GNULIB_FMODF | |
1410 | GNULIB_FMOD | |
1411 | GNULIB_FMAL | |
1412 | GNULIB_FMAF | |
1413 | GNULIB_FMA | |
1414 | GNULIB_FLOORL | |
1415 | GNULIB_FLOORF | |
1416 | GNULIB_FLOOR | |
1417 | GNULIB_FABSL | |
1418 | GNULIB_FABSF | |
1419 | GNULIB_EXPM1L | |
1420 | GNULIB_EXPM1F | |
1421 | GNULIB_EXPM1 | |
1422 | GNULIB_EXP2L | |
1423 | GNULIB_EXP2F | |
1424 | GNULIB_EXP2 | |
1425 | GNULIB_EXPL | |
1426 | GNULIB_EXPF | |
1427 | GNULIB_COSHF | |
1428 | GNULIB_COSL | |
1429 | GNULIB_COSF | |
1430 | GNULIB_COPYSIGNL | |
1431 | GNULIB_COPYSIGNF | |
1432 | GNULIB_COPYSIGN | |
1433 | GNULIB_CEILL | |
1434 | GNULIB_CEILF | |
1435 | GNULIB_CEIL | |
1436 | GNULIB_CBRTL | |
1437 | GNULIB_CBRTF | |
1438 | GNULIB_CBRT | |
1439 | GNULIB_ATAN2F | |
1440 | GNULIB_ATANL | |
1441 | GNULIB_ATANF | |
1442 | GNULIB_ASINL | |
1443 | GNULIB_ASINF | |
1444 | GNULIB_ACOSL | |
1445 | GNULIB_ACOSF | |
8690e634 JK |
1446 | GL_GENERATE_FNMATCH_H_FALSE |
1447 | GL_GENERATE_FNMATCH_H_TRUE | |
1448 | FNMATCH_H | |
c0c3707f CB |
1449 | HAVE_FNMATCH_H |
1450 | NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H | |
1451 | NEXT_FNMATCH_H | |
1452 | REPLACE_FNMATCH | |
1453 | HAVE_FNMATCH | |
1454 | GNULIB_FNMATCH | |
88b48903 WN |
1455 | REPLACE_ITOLD |
1456 | GL_GENERATE_FLOAT_H_FALSE | |
1457 | GL_GENERATE_FLOAT_H_TRUE | |
1458 | FLOAT_H | |
1459 | NEXT_AS_FIRST_DIRECTIVE_FLOAT_H | |
1460 | NEXT_FLOAT_H | |
32e2770e MF |
1461 | HAVE_DECL_STRNCASECMP |
1462 | HAVE_STRCASECMP | |
1463 | HAVE_FFS | |
1464 | GNULIB_FFS | |
6ec2e0f5 SDJ |
1465 | NEXT_AS_FIRST_DIRECTIVE_FCNTL_H |
1466 | NEXT_FCNTL_H | |
1467 | REPLACE_OPENAT | |
1468 | REPLACE_OPEN | |
1469 | REPLACE_FCNTL | |
c0c3707f | 1470 | REPLACE_CREAT |
6ec2e0f5 SDJ |
1471 | HAVE_OPENAT |
1472 | HAVE_FCNTL | |
9c9d63b1 PM |
1473 | GNULIB_MDA_OPEN |
1474 | GNULIB_MDA_CREAT | |
6ec2e0f5 SDJ |
1475 | GNULIB_OPENAT |
1476 | GNULIB_OPEN | |
1477 | GNULIB_NONBLOCKING | |
1478 | GNULIB_FCNTL | |
c0c3707f | 1479 | GNULIB_CREAT |
18848e28 GF |
1480 | EOVERFLOW_VALUE |
1481 | EOVERFLOW_HIDDEN | |
1482 | ENOLINK_VALUE | |
1483 | ENOLINK_HIDDEN | |
1484 | EMULTIHOP_VALUE | |
1485 | EMULTIHOP_HIDDEN | |
1486 | GL_GENERATE_ERRNO_H_FALSE | |
1487 | GL_GENERATE_ERRNO_H_TRUE | |
1488 | ERRNO_H | |
1489 | NEXT_AS_FIRST_DIRECTIVE_ERRNO_H | |
1490 | NEXT_ERRNO_H | |
e26b6bb0 TT |
1491 | HAVE_DIRENT_H |
1492 | NEXT_AS_FIRST_DIRECTIVE_DIRENT_H | |
1493 | NEXT_DIRENT_H | |
698be2d8 CB |
1494 | NEXT_AS_FIRST_DIRECTIVE_CTYPE_H |
1495 | NEXT_CTYPE_H | |
1496 | HAVE_ISBLANK | |
1497 | GNULIB_ISBLANK | |
e26b6bb0 TT |
1498 | REPLACE_FDOPENDIR |
1499 | REPLACE_DIRFD | |
1500 | REPLACE_CLOSEDIR | |
1501 | REPLACE_OPENDIR | |
1502 | HAVE_ALPHASORT | |
1503 | HAVE_SCANDIR | |
1504 | HAVE_FDOPENDIR | |
1505 | HAVE_DECL_FDOPENDIR | |
1506 | HAVE_DECL_DIRFD | |
1507 | HAVE_CLOSEDIR | |
1508 | HAVE_REWINDDIR | |
1509 | HAVE_READDIR | |
1510 | HAVE_OPENDIR | |
1511 | GNULIB_ALPHASORT | |
1512 | GNULIB_SCANDIR | |
1513 | GNULIB_FDOPENDIR | |
1514 | GNULIB_DIRFD | |
1515 | GNULIB_CLOSEDIR | |
1516 | GNULIB_REWINDDIR | |
1517 | GNULIB_READDIR | |
1518 | GNULIB_OPENDIR | |
6ec2e0f5 SDJ |
1519 | HAVE_WINSOCK2_H |
1520 | HAVE_MSVC_INVALID_PARAMETER_HANDLER | |
9c9d63b1 | 1521 | LIB_CLOCK_GETTIME |
e26b6bb0 TT |
1522 | UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS |
1523 | UNISTD_H_HAVE_WINSOCK2_H | |
698be2d8 | 1524 | UNISTD_H_HAVE_SYS_RANDOM_H |
e26b6bb0 TT |
1525 | REPLACE_WRITE |
1526 | REPLACE_USLEEP | |
1527 | REPLACE_UNLINKAT | |
1528 | REPLACE_UNLINK | |
1529 | REPLACE_TTYNAME_R | |
c0c3707f | 1530 | REPLACE_TRUNCATE |
4a626d0a | 1531 | REPLACE_SYMLINKAT |
e26b6bb0 TT |
1532 | REPLACE_SYMLINK |
1533 | REPLACE_SLEEP | |
1534 | REPLACE_RMDIR | |
4a626d0a | 1535 | REPLACE_READLINKAT |
e26b6bb0 TT |
1536 | REPLACE_READLINK |
1537 | REPLACE_READ | |
1538 | REPLACE_PWRITE | |
1539 | REPLACE_PREAD | |
1540 | REPLACE_LSEEK | |
1541 | REPLACE_LINKAT | |
1542 | REPLACE_LINK | |
1543 | REPLACE_LCHOWN | |
1544 | REPLACE_ISATTY | |
c0c3707f | 1545 | REPLACE_GETPASS |
e26b6bb0 TT |
1546 | REPLACE_GETPAGESIZE |
1547 | REPLACE_GETGROUPS | |
1548 | REPLACE_GETLOGIN_R | |
4a626d0a | 1549 | REPLACE_GETDTABLESIZE |
e26b6bb0 TT |
1550 | REPLACE_GETDOMAINNAME |
1551 | REPLACE_GETCWD | |
1552 | REPLACE_FTRUNCATE | |
1553 | REPLACE_FCHOWNAT | |
c0c3707f | 1554 | REPLACE_FACCESSAT |
9c9d63b1 PM |
1555 | REPLACE_EXECVPE |
1556 | REPLACE_EXECVP | |
1557 | REPLACE_EXECVE | |
1558 | REPLACE_EXECV | |
1559 | REPLACE_EXECLP | |
1560 | REPLACE_EXECLE | |
1561 | REPLACE_EXECL | |
e26b6bb0 TT |
1562 | REPLACE_DUP2 |
1563 | REPLACE_DUP | |
1564 | REPLACE_CLOSE | |
1565 | REPLACE_CHOWN | |
c0c3707f | 1566 | REPLACE_ACCESS |
e26b6bb0 TT |
1567 | HAVE_SYS_PARAM_H |
1568 | HAVE_OS_H | |
1569 | HAVE_DECL_TTYNAME_R | |
c0c3707f | 1570 | HAVE_DECL_TRUNCATE |
e26b6bb0 TT |
1571 | HAVE_DECL_SETHOSTNAME |
1572 | HAVE_DECL_GETUSERSHELL | |
1573 | HAVE_DECL_GETPAGESIZE | |
1574 | HAVE_DECL_GETLOGIN_R | |
c0c3707f | 1575 | HAVE_DECL_GETLOGIN |
e26b6bb0 TT |
1576 | HAVE_DECL_GETDOMAINNAME |
1577 | HAVE_DECL_FDATASYNC | |
1578 | HAVE_DECL_FCHDIR | |
9c9d63b1 | 1579 | HAVE_DECL_EXECVPE |
e26b6bb0 TT |
1580 | HAVE_DECL_ENVIRON |
1581 | HAVE_USLEEP | |
1582 | HAVE_UNLINKAT | |
1583 | HAVE_SYMLINKAT | |
1584 | HAVE_SYMLINK | |
1585 | HAVE_SLEEP | |
1586 | HAVE_SETHOSTNAME | |
1587 | HAVE_READLINKAT | |
1588 | HAVE_READLINK | |
1589 | HAVE_PWRITE | |
1590 | HAVE_PREAD | |
1591 | HAVE_PIPE2 | |
1592 | HAVE_PIPE | |
1593 | HAVE_LINKAT | |
1594 | HAVE_LINK | |
1595 | HAVE_LCHOWN | |
1596 | HAVE_GROUP_MEMBER | |
c0c3707f | 1597 | HAVE_GETPASS |
e26b6bb0 TT |
1598 | HAVE_GETPAGESIZE |
1599 | HAVE_GETLOGIN | |
1600 | HAVE_GETHOSTNAME | |
1601 | HAVE_GETGROUPS | |
698be2d8 | 1602 | HAVE_GETENTROPY |
e26b6bb0 TT |
1603 | HAVE_GETDTABLESIZE |
1604 | HAVE_FTRUNCATE | |
1605 | HAVE_FSYNC | |
1606 | HAVE_FDATASYNC | |
1607 | HAVE_FCHOWNAT | |
1608 | HAVE_FCHDIR | |
1609 | HAVE_FACCESSAT | |
9c9d63b1 | 1610 | HAVE_EXECVPE |
e26b6bb0 TT |
1611 | HAVE_EUIDACCESS |
1612 | HAVE_DUP3 | |
c0c3707f | 1613 | HAVE_COPY_FILE_RANGE |
e26b6bb0 | 1614 | HAVE_CHOWN |
9c9d63b1 PM |
1615 | GNULIB_MDA_WRITE |
1616 | GNULIB_MDA_UNLINK | |
1617 | GNULIB_MDA_SWAB | |
1618 | GNULIB_MDA_RMDIR | |
1619 | GNULIB_MDA_READ | |
1620 | GNULIB_MDA_LSEEK | |
1621 | GNULIB_MDA_ISATTY | |
1622 | GNULIB_MDA_GETPID | |
1623 | GNULIB_MDA_GETCWD | |
1624 | GNULIB_MDA_EXECVPE | |
1625 | GNULIB_MDA_EXECVP | |
1626 | GNULIB_MDA_EXECVE | |
1627 | GNULIB_MDA_EXECV | |
1628 | GNULIB_MDA_EXECLP | |
1629 | GNULIB_MDA_EXECLE | |
1630 | GNULIB_MDA_EXECL | |
1631 | GNULIB_MDA_DUP2 | |
1632 | GNULIB_MDA_DUP | |
1633 | GNULIB_MDA_CLOSE | |
1634 | GNULIB_MDA_CHDIR | |
1635 | GNULIB_MDA_ACCESS | |
e26b6bb0 TT |
1636 | GNULIB_WRITE |
1637 | GNULIB_USLEEP | |
1638 | GNULIB_UNLINKAT | |
1639 | GNULIB_UNLINK | |
1640 | GNULIB_UNISTD_H_SIGPIPE | |
1641 | GNULIB_UNISTD_H_NONBLOCKING | |
1642 | GNULIB_TTYNAME_R | |
c0c3707f | 1643 | GNULIB_TRUNCATE |
e26b6bb0 TT |
1644 | GNULIB_SYMLINKAT |
1645 | GNULIB_SYMLINK | |
1646 | GNULIB_SLEEP | |
1647 | GNULIB_SETHOSTNAME | |
1648 | GNULIB_RMDIR | |
1649 | GNULIB_READLINKAT | |
1650 | GNULIB_READLINK | |
1651 | GNULIB_READ | |
1652 | GNULIB_PWRITE | |
1653 | GNULIB_PREAD | |
1654 | GNULIB_PIPE2 | |
1655 | GNULIB_PIPE | |
1656 | GNULIB_LSEEK | |
1657 | GNULIB_LINKAT | |
1658 | GNULIB_LINK | |
1659 | GNULIB_LCHOWN | |
1660 | GNULIB_ISATTY | |
1661 | GNULIB_GROUP_MEMBER | |
1662 | GNULIB_GETUSERSHELL | |
c0c3707f | 1663 | GNULIB_GETPASS |
e26b6bb0 | 1664 | GNULIB_GETPAGESIZE |
5df4cba6 | 1665 | GNULIB_GETOPT_POSIX |
e26b6bb0 TT |
1666 | GNULIB_GETLOGIN_R |
1667 | GNULIB_GETLOGIN | |
1668 | GNULIB_GETHOSTNAME | |
1669 | GNULIB_GETGROUPS | |
698be2d8 | 1670 | GNULIB_GETENTROPY |
e26b6bb0 TT |
1671 | GNULIB_GETDTABLESIZE |
1672 | GNULIB_GETDOMAINNAME | |
1673 | GNULIB_GETCWD | |
1674 | GNULIB_FTRUNCATE | |
1675 | GNULIB_FSYNC | |
1676 | GNULIB_FDATASYNC | |
1677 | GNULIB_FCHOWNAT | |
1678 | GNULIB_FCHDIR | |
1679 | GNULIB_FACCESSAT | |
9c9d63b1 PM |
1680 | GNULIB_EXECVPE |
1681 | GNULIB_EXECVP | |
1682 | GNULIB_EXECVE | |
1683 | GNULIB_EXECV | |
1684 | GNULIB_EXECLP | |
1685 | GNULIB_EXECLE | |
1686 | GNULIB_EXECL | |
e26b6bb0 TT |
1687 | GNULIB_EUIDACCESS |
1688 | GNULIB_ENVIRON | |
1689 | GNULIB_DUP3 | |
1690 | GNULIB_DUP2 | |
1691 | GNULIB_DUP | |
c0c3707f | 1692 | GNULIB_COPY_FILE_RANGE |
e26b6bb0 TT |
1693 | GNULIB_CLOSE |
1694 | GNULIB_CHOWN | |
1695 | GNULIB_CHDIR | |
c0c3707f | 1696 | GNULIB_ACCESS |
98399780 YQ |
1697 | REPLACE_WCTOMB |
1698 | REPLACE_UNSETENV | |
c0c3707f | 1699 | REPLACE_STRTOLD |
98399780 | 1700 | REPLACE_STRTOD |
c0c3707f | 1701 | REPLACE_SETSTATE |
98399780 YQ |
1702 | REPLACE_SETENV |
1703 | REPLACE_REALPATH | |
1704 | REPLACE_REALLOC | |
1705 | REPLACE_RANDOM_R | |
c0c3707f | 1706 | REPLACE_RANDOM |
4a626d0a | 1707 | REPLACE_QSORT_R |
98399780 YQ |
1708 | REPLACE_PUTENV |
1709 | REPLACE_PTSNAME_R | |
1710 | REPLACE_PTSNAME | |
9c9d63b1 | 1711 | REPLACE_POSIX_MEMALIGN |
98399780 YQ |
1712 | REPLACE_MKSTEMP |
1713 | REPLACE_MBTOWC | |
1714 | REPLACE_MALLOC | |
c0c3707f | 1715 | REPLACE_INITSTATE |
9c9d63b1 | 1716 | REPLACE_FREE |
98399780 YQ |
1717 | REPLACE_CANONICALIZE_FILE_NAME |
1718 | REPLACE_CALLOC | |
9c9d63b1 | 1719 | REPLACE_ALIGNED_ALLOC |
98399780 YQ |
1720 | HAVE_DECL_UNSETENV |
1721 | HAVE_UNLOCKPT | |
1722 | HAVE_SYS_LOADAVG_H | |
1723 | HAVE_STRUCT_RANDOM_DATA | |
1724 | HAVE_STRTOULL | |
1725 | HAVE_STRTOLL | |
c0c3707f | 1726 | HAVE_STRTOLD |
98399780 | 1727 | HAVE_STRTOD |
c0c3707f CB |
1728 | HAVE_DECL_SETSTATE |
1729 | HAVE_SETSTATE | |
98399780 YQ |
1730 | HAVE_DECL_SETENV |
1731 | HAVE_SETENV | |
4a626d0a | 1732 | HAVE_SECURE_GETENV |
98399780 YQ |
1733 | HAVE_RPMATCH |
1734 | HAVE_REALPATH | |
c0c3707f | 1735 | HAVE_REALLOCARRAY |
98399780 YQ |
1736 | HAVE_RANDOM_R |
1737 | HAVE_RANDOM_H | |
1738 | HAVE_RANDOM | |
4c62b19f | 1739 | HAVE_QSORT_R |
98399780 YQ |
1740 | HAVE_PTSNAME_R |
1741 | HAVE_PTSNAME | |
1742 | HAVE_POSIX_OPENPT | |
9c9d63b1 | 1743 | HAVE_POSIX_MEMALIGN |
98399780 YQ |
1744 | HAVE_MKSTEMPS |
1745 | HAVE_MKSTEMP | |
1746 | HAVE_MKOSTEMPS | |
1747 | HAVE_MKOSTEMP | |
1748 | HAVE_MKDTEMP | |
c0c3707f CB |
1749 | HAVE_MBTOWC |
1750 | HAVE_DECL_INITSTATE | |
1751 | HAVE_INITSTATE | |
98399780 YQ |
1752 | HAVE_GRANTPT |
1753 | HAVE_GETSUBOPT | |
1754 | HAVE_DECL_GETLOADAVG | |
9c9d63b1 PM |
1755 | HAVE_DECL_GCVT |
1756 | HAVE_DECL_FCVT | |
1757 | HAVE_DECL_ECVT | |
98399780 YQ |
1758 | HAVE_CANONICALIZE_FILE_NAME |
1759 | HAVE_ATOLL | |
9c9d63b1 | 1760 | HAVE_ALIGNED_ALLOC |
98399780 | 1761 | HAVE__EXIT |
9c9d63b1 PM |
1762 | GNULIB_MDA_PUTENV |
1763 | GNULIB_MDA_MKTEMP | |
1764 | GNULIB_MDA_GCVT | |
1765 | GNULIB_MDA_FCVT | |
1766 | GNULIB_MDA_ECVT | |
98399780 YQ |
1767 | GNULIB_WCTOMB |
1768 | GNULIB_UNSETENV | |
1769 | GNULIB_UNLOCKPT | |
1770 | GNULIB_SYSTEM_POSIX | |
1771 | GNULIB_STRTOULL | |
1772 | GNULIB_STRTOLL | |
c0c3707f | 1773 | GNULIB_STRTOLD |
98399780 YQ |
1774 | GNULIB_STRTOD |
1775 | GNULIB_SETENV | |
4a626d0a | 1776 | GNULIB_SECURE_GETENV |
98399780 YQ |
1777 | GNULIB_RPMATCH |
1778 | GNULIB_REALPATH | |
1779 | GNULIB_REALLOC_POSIX | |
c0c3707f | 1780 | GNULIB_REALLOCARRAY |
98399780 YQ |
1781 | GNULIB_RANDOM_R |
1782 | GNULIB_RANDOM | |
4a626d0a | 1783 | GNULIB_QSORT_R |
98399780 YQ |
1784 | GNULIB_PUTENV |
1785 | GNULIB_PTSNAME_R | |
1786 | GNULIB_PTSNAME | |
1787 | GNULIB_POSIX_OPENPT | |
9c9d63b1 | 1788 | GNULIB_POSIX_MEMALIGN |
98399780 YQ |
1789 | GNULIB_MKSTEMPS |
1790 | GNULIB_MKSTEMP | |
1791 | GNULIB_MKOSTEMPS | |
1792 | GNULIB_MKOSTEMP | |
1793 | GNULIB_MKDTEMP | |
1794 | GNULIB_MBTOWC | |
1795 | GNULIB_MALLOC_POSIX | |
1796 | GNULIB_GRANTPT | |
1797 | GNULIB_GETSUBOPT | |
1798 | GNULIB_GETLOADAVG | |
9c9d63b1 | 1799 | GNULIB_FREE_POSIX |
98399780 YQ |
1800 | GNULIB_CANONICALIZE_FILE_NAME |
1801 | GNULIB_CALLOC_POSIX | |
1802 | GNULIB_ATOLL | |
9c9d63b1 | 1803 | GNULIB_ALIGNED_ALLOC |
98399780 | 1804 | GNULIB__EXIT |
698be2d8 CB |
1805 | LOCALE_FR |
1806 | REPLACE_WCSTOK | |
1807 | REPLACE_WCSFTIME | |
1808 | REPLACE_WCSWIDTH | |
1809 | REPLACE_WCWIDTH | |
1810 | REPLACE_WCSNRTOMBS | |
1811 | REPLACE_WCSRTOMBS | |
1812 | REPLACE_WCRTOMB | |
1813 | REPLACE_MBSNRTOWCS | |
1814 | REPLACE_MBSRTOWCS | |
1815 | REPLACE_MBRLEN | |
1816 | REPLACE_MBRTOWC | |
1817 | REPLACE_MBSINIT | |
1818 | REPLACE_WCTOB | |
1819 | REPLACE_BTOWC | |
1820 | REPLACE_MBSTATE_T | |
1821 | HAVE_DECL_WCWIDTH | |
9c9d63b1 | 1822 | HAVE_DECL_WCSDUP |
698be2d8 CB |
1823 | HAVE_DECL_WCTOB |
1824 | HAVE_WCSFTIME | |
1825 | HAVE_WCSWIDTH | |
1826 | HAVE_WCSTOK | |
1827 | HAVE_WCSSTR | |
1828 | HAVE_WCSPBRK | |
1829 | HAVE_WCSSPN | |
1830 | HAVE_WCSCSPN | |
1831 | HAVE_WCSRCHR | |
1832 | HAVE_WCSCHR | |
1833 | HAVE_WCSDUP | |
1834 | HAVE_WCSXFRM | |
1835 | HAVE_WCSCOLL | |
1836 | HAVE_WCSNCASECMP | |
1837 | HAVE_WCSCASECMP | |
1838 | HAVE_WCSNCMP | |
1839 | HAVE_WCSCMP | |
1840 | HAVE_WCSNCAT | |
1841 | HAVE_WCSCAT | |
1842 | HAVE_WCPNCPY | |
1843 | HAVE_WCSNCPY | |
1844 | HAVE_WCPCPY | |
1845 | HAVE_WCSCPY | |
1846 | HAVE_WCSNLEN | |
1847 | HAVE_WCSLEN | |
1848 | HAVE_WMEMSET | |
1849 | HAVE_WMEMPCPY | |
1850 | HAVE_WMEMMOVE | |
1851 | HAVE_WMEMCPY | |
1852 | HAVE_WMEMCMP | |
1853 | HAVE_WMEMCHR | |
1854 | HAVE_WCSNRTOMBS | |
1855 | HAVE_WCSRTOMBS | |
1856 | HAVE_WCRTOMB | |
1857 | HAVE_MBSNRTOWCS | |
1858 | HAVE_MBSRTOWCS | |
1859 | HAVE_MBRLEN | |
1860 | HAVE_MBRTOWC | |
1861 | HAVE_MBSINIT | |
1862 | HAVE_BTOWC | |
9c9d63b1 | 1863 | GNULIB_MDA_WCSDUP |
698be2d8 CB |
1864 | GNULIB_WCSFTIME |
1865 | GNULIB_WCSWIDTH | |
1866 | GNULIB_WCSTOK | |
1867 | GNULIB_WCSSTR | |
1868 | GNULIB_WCSPBRK | |
1869 | GNULIB_WCSSPN | |
1870 | GNULIB_WCSCSPN | |
1871 | GNULIB_WCSRCHR | |
1872 | GNULIB_WCSCHR | |
1873 | GNULIB_WCSDUP | |
1874 | GNULIB_WCSXFRM | |
1875 | GNULIB_WCSCOLL | |
1876 | GNULIB_WCSNCASECMP | |
1877 | GNULIB_WCSCASECMP | |
1878 | GNULIB_WCSNCMP | |
1879 | GNULIB_WCSCMP | |
1880 | GNULIB_WCSNCAT | |
1881 | GNULIB_WCSCAT | |
1882 | GNULIB_WCPNCPY | |
1883 | GNULIB_WCSNCPY | |
1884 | GNULIB_WCPCPY | |
1885 | GNULIB_WCSCPY | |
1886 | GNULIB_WCSNLEN | |
1887 | GNULIB_WCSLEN | |
1888 | GNULIB_WMEMSET | |
1889 | GNULIB_WMEMPCPY | |
1890 | GNULIB_WMEMMOVE | |
1891 | GNULIB_WMEMCPY | |
1892 | GNULIB_WMEMCMP | |
1893 | GNULIB_WMEMCHR | |
1894 | GNULIB_WCWIDTH | |
1895 | GNULIB_WCSNRTOMBS | |
1896 | GNULIB_WCSRTOMBS | |
1897 | GNULIB_WCRTOMB | |
1898 | GNULIB_MBSNRTOWCS | |
1899 | GNULIB_MBSRTOWCS | |
1900 | GNULIB_MBRLEN | |
1901 | GNULIB_MBRTOWC | |
1902 | GNULIB_MBSINIT | |
1903 | GNULIB_WCTOB | |
1904 | GNULIB_BTOWC | |
725e2999 | 1905 | MKDIR_P |
c0c3707f | 1906 | HAVE_WS2TCPIP_H |
725e2999 JB |
1907 | HAVE_FEATURES_H |
1908 | NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H | |
1909 | NEXT_ARPA_INET_H | |
1910 | PRAGMA_COLUMNS | |
1911 | PRAGMA_SYSTEM_HEADER | |
1912 | INCLUDE_NEXT_AS_FIRST_DIRECTIVE | |
1913 | INCLUDE_NEXT | |
1914 | HAVE_ARPA_INET_H | |
1915 | REPLACE_INET_PTON | |
1916 | REPLACE_INET_NTOP | |
1917 | HAVE_DECL_INET_PTON | |
1918 | HAVE_DECL_INET_NTOP | |
1919 | GNULIB_INET_PTON | |
1920 | GNULIB_INET_NTOP | |
c0c3707f | 1921 | HAVE_ALLOCA_H |
8690e634 JK |
1922 | GL_GENERATE_ALLOCA_H_FALSE |
1923 | GL_GENERATE_ALLOCA_H_TRUE | |
1924 | ALLOCA_H | |
1925 | ALLOCA | |
c971b7fa PA |
1926 | GL_COND_LIBTOOL_FALSE |
1927 | GL_COND_LIBTOOL_TRUE | |
c8693053 RO |
1928 | RANLIB |
1929 | ARFLAGS | |
1930 | AR | |
1931 | LARGEFILE_CPPFLAGS | |
c971b7fa PA |
1932 | target_os |
1933 | target_vendor | |
1934 | target_cpu | |
1935 | target | |
c971b7fa PA |
1936 | host_os |
1937 | host_vendor | |
1938 | host_cpu | |
1939 | host | |
1940 | build_os | |
1941 | build_vendor | |
1942 | build_cpu | |
1943 | build | |
4a626d0a PA |
1944 | EGREP |
1945 | GREP | |
1946 | CPP | |
c971b7fa PA |
1947 | OBJEXT |
1948 | EXEEXT | |
1949 | ac_ct_CC | |
1950 | CPPFLAGS | |
1951 | LDFLAGS | |
1952 | CFLAGS | |
1953 | CC | |
1954 | MAINT | |
1955 | MAINTAINER_MODE_FALSE | |
1956 | MAINTAINER_MODE_TRUE | |
1957 | target_alias | |
1958 | host_alias | |
1959 | build_alias | |
1960 | LIBS | |
1961 | ECHO_T | |
1962 | ECHO_N | |
1963 | ECHO_C | |
1964 | DEFS | |
1965 | mandir | |
1966 | localedir | |
1967 | libdir | |
1968 | psdir | |
1969 | pdfdir | |
1970 | dvidir | |
1971 | htmldir | |
1972 | infodir | |
1973 | docdir | |
1974 | oldincludedir | |
1975 | includedir | |
1976 | localstatedir | |
1977 | sharedstatedir | |
1978 | sysconfdir | |
1979 | datadir | |
1980 | datarootdir | |
1981 | libexecdir | |
1982 | sbindir | |
1983 | bindir | |
1984 | program_transform_name | |
1985 | prefix | |
1986 | exec_prefix | |
1987 | PACKAGE_URL | |
1988 | PACKAGE_BUGREPORT | |
1989 | PACKAGE_STRING | |
1990 | PACKAGE_VERSION | |
1991 | PACKAGE_TARNAME | |
1992 | PACKAGE_NAME | |
1993 | PATH_SEPARATOR | |
1994 | SHELL' | |
1995 | ac_subst_files='' | |
1996 | ac_user_opts=' | |
1997 | enable_option_checking | |
1998 | enable_maintainer_mode | |
c8693053 | 1999 | enable_plugins |
2196f55f | 2000 | enable_largefile |
5abebf3c | 2001 | enable_threads |
c0c3707f | 2002 | enable_cross_guesses |
c971b7fa | 2003 | enable_dependency_tracking |
39be3c7e | 2004 | enable_silent_rules |
c971b7fa PA |
2005 | ' |
2006 | ac_precious_vars='build_alias | |
2007 | host_alias | |
2008 | target_alias | |
2009 | CC | |
2010 | CFLAGS | |
2011 | LDFLAGS | |
2012 | LIBS | |
2013 | CPPFLAGS | |
2014 | CPP' | |
2015 | ||
2016 | ||
2017 | # Initialize some variables set by options. | |
2018 | ac_init_help= | |
2019 | ac_init_version=false | |
2020 | ac_unrecognized_opts= | |
2021 | ac_unrecognized_sep= | |
2022 | # The variables have the same names as the options, with | |
2023 | # dashes changed to underlines. | |
2024 | cache_file=/dev/null | |
2025 | exec_prefix=NONE | |
2026 | no_create= | |
2027 | no_recursion= | |
2028 | prefix=NONE | |
2029 | program_prefix=NONE | |
2030 | program_suffix=NONE | |
2031 | program_transform_name=s,x,x, | |
2032 | silent= | |
2033 | site= | |
2034 | srcdir= | |
2035 | verbose= | |
2036 | x_includes=NONE | |
2037 | x_libraries=NONE | |
2038 | ||
2039 | # Installation directory options. | |
2040 | # These are left unexpanded so users can "make install exec_prefix=/foo" | |
2041 | # and all the variables that are supposed to be based on exec_prefix | |
2042 | # by default will actually change. | |
2043 | # Use braces instead of parens because sh, perl, etc. also accept them. | |
2044 | # (The list follows the same order as the GNU Coding Standards.) | |
2045 | bindir='${exec_prefix}/bin' | |
2046 | sbindir='${exec_prefix}/sbin' | |
2047 | libexecdir='${exec_prefix}/libexec' | |
2048 | datarootdir='${prefix}/share' | |
2049 | datadir='${datarootdir}' | |
2050 | sysconfdir='${prefix}/etc' | |
2051 | sharedstatedir='${prefix}/com' | |
2052 | localstatedir='${prefix}/var' | |
2053 | includedir='${prefix}/include' | |
2054 | oldincludedir='/usr/include' | |
d0ac1c44 | 2055 | docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' |
c971b7fa PA |
2056 | infodir='${datarootdir}/info' |
2057 | htmldir='${docdir}' | |
2058 | dvidir='${docdir}' | |
2059 | pdfdir='${docdir}' | |
2060 | psdir='${docdir}' | |
2061 | libdir='${exec_prefix}/lib' | |
2062 | localedir='${datarootdir}/locale' | |
2063 | mandir='${datarootdir}/man' | |
2064 | ||
2065 | ac_prev= | |
2066 | ac_dashdash= | |
2067 | for ac_option | |
2068 | do | |
2069 | # If the previous option needs an argument, assign it. | |
2070 | if test -n "$ac_prev"; then | |
2071 | eval $ac_prev=\$ac_option | |
2072 | ac_prev= | |
2073 | continue | |
2074 | fi | |
2075 | ||
2076 | case $ac_option in | |
d0ac1c44 SM |
2077 | *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; |
2078 | *=) ac_optarg= ;; | |
2079 | *) ac_optarg=yes ;; | |
c971b7fa PA |
2080 | esac |
2081 | ||
2082 | # Accept the important Cygnus configure options, so we can diagnose typos. | |
2083 | ||
2084 | case $ac_dashdash$ac_option in | |
2085 | --) | |
2086 | ac_dashdash=yes ;; | |
2087 | ||
2088 | -bindir | --bindir | --bindi | --bind | --bin | --bi) | |
2089 | ac_prev=bindir ;; | |
2090 | -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) | |
2091 | bindir=$ac_optarg ;; | |
2092 | ||
2093 | -build | --build | --buil | --bui | --bu) | |
2094 | ac_prev=build_alias ;; | |
2095 | -build=* | --build=* | --buil=* | --bui=* | --bu=*) | |
2096 | build_alias=$ac_optarg ;; | |
2097 | ||
2098 | -cache-file | --cache-file | --cache-fil | --cache-fi \ | |
2099 | | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) | |
2100 | ac_prev=cache_file ;; | |
2101 | -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | |
2102 | | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) | |
2103 | cache_file=$ac_optarg ;; | |
2104 | ||
2105 | --config-cache | -C) | |
2106 | cache_file=config.cache ;; | |
2107 | ||
2108 | -datadir | --datadir | --datadi | --datad) | |
2109 | ac_prev=datadir ;; | |
2110 | -datadir=* | --datadir=* | --datadi=* | --datad=*) | |
2111 | datadir=$ac_optarg ;; | |
2112 | ||
2113 | -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | |
2114 | | --dataroo | --dataro | --datar) | |
2115 | ac_prev=datarootdir ;; | |
2116 | -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | |
2117 | | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) | |
2118 | datarootdir=$ac_optarg ;; | |
2119 | ||
2120 | -disable-* | --disable-*) | |
2121 | ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` | |
2122 | # Reject names that are not valid shell variable names. | |
2123 | expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && | |
d0ac1c44 | 2124 | as_fn_error $? "invalid feature name: $ac_useropt" |
c971b7fa PA |
2125 | ac_useropt_orig=$ac_useropt |
2126 | ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` | |
2127 | case $ac_user_opts in | |
2128 | *" | |
2129 | "enable_$ac_useropt" | |
2130 | "*) ;; | |
2131 | *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" | |
2132 | ac_unrecognized_sep=', ';; | |
2133 | esac | |
2134 | eval enable_$ac_useropt=no ;; | |
2135 | ||
2136 | -docdir | --docdir | --docdi | --doc | --do) | |
2137 | ac_prev=docdir ;; | |
2138 | -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) | |
2139 | docdir=$ac_optarg ;; | |
2140 | ||
2141 | -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) | |
2142 | ac_prev=dvidir ;; | |
2143 | -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) | |
2144 | dvidir=$ac_optarg ;; | |
2145 | ||
2146 | -enable-* | --enable-*) | |
2147 | ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` | |
2148 | # Reject names that are not valid shell variable names. | |
2149 | expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && | |
d0ac1c44 | 2150 | as_fn_error $? "invalid feature name: $ac_useropt" |
c971b7fa PA |
2151 | ac_useropt_orig=$ac_useropt |
2152 | ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` | |
2153 | case $ac_user_opts in | |
2154 | *" | |
2155 | "enable_$ac_useropt" | |
2156 | "*) ;; | |
2157 | *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" | |
2158 | ac_unrecognized_sep=', ';; | |
2159 | esac | |
2160 | eval enable_$ac_useropt=\$ac_optarg ;; | |
2161 | ||
2162 | -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | |
2163 | | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | |
2164 | | --exec | --exe | --ex) | |
2165 | ac_prev=exec_prefix ;; | |
2166 | -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | |
2167 | | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | |
2168 | | --exec=* | --exe=* | --ex=*) | |
2169 | exec_prefix=$ac_optarg ;; | |
2170 | ||
2171 | -gas | --gas | --ga | --g) | |
2172 | # Obsolete; use --with-gas. | |
2173 | with_gas=yes ;; | |
2174 | ||
2175 | -help | --help | --hel | --he | -h) | |
2176 | ac_init_help=long ;; | |
2177 | -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) | |
2178 | ac_init_help=recursive ;; | |
2179 | -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) | |
2180 | ac_init_help=short ;; | |
2181 | ||
2182 | -host | --host | --hos | --ho) | |
2183 | ac_prev=host_alias ;; | |
2184 | -host=* | --host=* | --hos=* | --ho=*) | |
2185 | host_alias=$ac_optarg ;; | |
2186 | ||
2187 | -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) | |
2188 | ac_prev=htmldir ;; | |
2189 | -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | |
2190 | | --ht=*) | |
2191 | htmldir=$ac_optarg ;; | |
2192 | ||
2193 | -includedir | --includedir | --includedi | --included | --include \ | |
2194 | | --includ | --inclu | --incl | --inc) | |
2195 | ac_prev=includedir ;; | |
2196 | -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | |
2197 | | --includ=* | --inclu=* | --incl=* | --inc=*) | |
2198 | includedir=$ac_optarg ;; | |
2199 | ||
2200 | -infodir | --infodir | --infodi | --infod | --info | --inf) | |
2201 | ac_prev=infodir ;; | |
2202 | -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) | |
2203 | infodir=$ac_optarg ;; | |
2204 | ||
2205 | -libdir | --libdir | --libdi | --libd) | |
2206 | ac_prev=libdir ;; | |
2207 | -libdir=* | --libdir=* | --libdi=* | --libd=*) | |
2208 | libdir=$ac_optarg ;; | |
2209 | ||
2210 | -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | |
2211 | | --libexe | --libex | --libe) | |
2212 | ac_prev=libexecdir ;; | |
2213 | -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | |
2214 | | --libexe=* | --libex=* | --libe=*) | |
2215 | libexecdir=$ac_optarg ;; | |
2216 | ||
2217 | -localedir | --localedir | --localedi | --localed | --locale) | |
2218 | ac_prev=localedir ;; | |
2219 | -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) | |
2220 | localedir=$ac_optarg ;; | |
2221 | ||
2222 | -localstatedir | --localstatedir | --localstatedi | --localstated \ | |
2223 | | --localstate | --localstat | --localsta | --localst | --locals) | |
2224 | ac_prev=localstatedir ;; | |
2225 | -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | |
2226 | | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) | |
2227 | localstatedir=$ac_optarg ;; | |
2228 | ||
2229 | -mandir | --mandir | --mandi | --mand | --man | --ma | --m) | |
2230 | ac_prev=mandir ;; | |
2231 | -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) | |
2232 | mandir=$ac_optarg ;; | |
2233 | ||
2234 | -nfp | --nfp | --nf) | |
2235 | # Obsolete; use --without-fp. | |
2236 | with_fp=no ;; | |
2237 | ||
2238 | -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | |
2239 | | --no-cr | --no-c | -n) | |
2240 | no_create=yes ;; | |
2241 | ||
2242 | -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | |
2243 | | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) | |
2244 | no_recursion=yes ;; | |
2245 | ||
2246 | -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | |
2247 | | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | |
2248 | | --oldin | --oldi | --old | --ol | --o) | |
2249 | ac_prev=oldincludedir ;; | |
2250 | -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | |
2251 | | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | |
2252 | | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) | |
2253 | oldincludedir=$ac_optarg ;; | |
2254 | ||
2255 | -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) | |
2256 | ac_prev=prefix ;; | |
2257 | -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) | |
2258 | prefix=$ac_optarg ;; | |
2259 | ||
2260 | -program-prefix | --program-prefix | --program-prefi | --program-pref \ | |
2261 | | --program-pre | --program-pr | --program-p) | |
2262 | ac_prev=program_prefix ;; | |
2263 | -program-prefix=* | --program-prefix=* | --program-prefi=* \ | |
2264 | | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) | |
2265 | program_prefix=$ac_optarg ;; | |
2266 | ||
2267 | -program-suffix | --program-suffix | --program-suffi | --program-suff \ | |
2268 | | --program-suf | --program-su | --program-s) | |
2269 | ac_prev=program_suffix ;; | |
2270 | -program-suffix=* | --program-suffix=* | --program-suffi=* \ | |
2271 | | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) | |
2272 | program_suffix=$ac_optarg ;; | |
2273 | ||
2274 | -program-transform-name | --program-transform-name \ | |
2275 | | --program-transform-nam | --program-transform-na \ | |
2276 | | --program-transform-n | --program-transform- \ | |
2277 | | --program-transform | --program-transfor \ | |
2278 | | --program-transfo | --program-transf \ | |
2279 | | --program-trans | --program-tran \ | |
2280 | | --progr-tra | --program-tr | --program-t) | |
2281 | ac_prev=program_transform_name ;; | |
2282 | -program-transform-name=* | --program-transform-name=* \ | |
2283 | | --program-transform-nam=* | --program-transform-na=* \ | |
2284 | | --program-transform-n=* | --program-transform-=* \ | |
2285 | | --program-transform=* | --program-transfor=* \ | |
2286 | | --program-transfo=* | --program-transf=* \ | |
2287 | | --program-trans=* | --program-tran=* \ | |
2288 | | --progr-tra=* | --program-tr=* | --program-t=*) | |
2289 | program_transform_name=$ac_optarg ;; | |
2290 | ||
2291 | -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) | |
2292 | ac_prev=pdfdir ;; | |
2293 | -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) | |
2294 | pdfdir=$ac_optarg ;; | |
2295 | ||
2296 | -psdir | --psdir | --psdi | --psd | --ps) | |
2297 | ac_prev=psdir ;; | |
2298 | -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) | |
2299 | psdir=$ac_optarg ;; | |
2300 | ||
2301 | -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | |
2302 | | -silent | --silent | --silen | --sile | --sil) | |
2303 | silent=yes ;; | |
2304 | ||
2305 | -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) | |
2306 | ac_prev=sbindir ;; | |
2307 | -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | |
2308 | | --sbi=* | --sb=*) | |
2309 | sbindir=$ac_optarg ;; | |
2310 | ||
2311 | -sharedstatedir | --sharedstatedir | --sharedstatedi \ | |
2312 | | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | |
2313 | | --sharedst | --shareds | --shared | --share | --shar \ | |
2314 | | --sha | --sh) | |
2315 | ac_prev=sharedstatedir ;; | |
2316 | -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | |
2317 | | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | |
2318 | | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | |
2319 | | --sha=* | --sh=*) | |
2320 | sharedstatedir=$ac_optarg ;; | |
2321 | ||
2322 | -site | --site | --sit) | |
2323 | ac_prev=site ;; | |
2324 | -site=* | --site=* | --sit=*) | |
2325 | site=$ac_optarg ;; | |
2326 | ||
2327 | -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) | |
2328 | ac_prev=srcdir ;; | |
2329 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) | |
2330 | srcdir=$ac_optarg ;; | |
2331 | ||
2332 | -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | |
2333 | | --syscon | --sysco | --sysc | --sys | --sy) | |
2334 | ac_prev=sysconfdir ;; | |
2335 | -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | |
2336 | | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) | |
2337 | sysconfdir=$ac_optarg ;; | |
2338 | ||
2339 | -target | --target | --targe | --targ | --tar | --ta | --t) | |
2340 | ac_prev=target_alias ;; | |
2341 | -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) | |
2342 | target_alias=$ac_optarg ;; | |
2343 | ||
2344 | -v | -verbose | --verbose | --verbos | --verbo | --verb) | |
2345 | verbose=yes ;; | |
2346 | ||
2347 | -version | --version | --versio | --versi | --vers | -V) | |
2348 | ac_init_version=: ;; | |
2349 | ||
2350 | -with-* | --with-*) | |
2351 | ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` | |
2352 | # Reject names that are not valid shell variable names. | |
2353 | expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && | |
d0ac1c44 | 2354 | as_fn_error $? "invalid package name: $ac_useropt" |
c971b7fa PA |
2355 | ac_useropt_orig=$ac_useropt |
2356 | ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` | |
2357 | case $ac_user_opts in | |
2358 | *" | |
2359 | "with_$ac_useropt" | |
2360 | "*) ;; | |
2361 | *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" | |
2362 | ac_unrecognized_sep=', ';; | |
2363 | esac | |
2364 | eval with_$ac_useropt=\$ac_optarg ;; | |
2365 | ||
2366 | -without-* | --without-*) | |
2367 | ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` | |
2368 | # Reject names that are not valid shell variable names. | |
2369 | expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && | |
d0ac1c44 | 2370 | as_fn_error $? "invalid package name: $ac_useropt" |
c971b7fa PA |
2371 | ac_useropt_orig=$ac_useropt |
2372 | ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` | |
2373 | case $ac_user_opts in | |
2374 | *" | |
2375 | "with_$ac_useropt" | |
2376 | "*) ;; | |
2377 | *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" | |
2378 | ac_unrecognized_sep=', ';; | |
2379 | esac | |
2380 | eval with_$ac_useropt=no ;; | |
2381 | ||
2382 | --x) | |
2383 | # Obsolete; use --with-x. | |
2384 | with_x=yes ;; | |
2385 | ||
2386 | -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | |
2387 | | --x-incl | --x-inc | --x-in | --x-i) | |
2388 | ac_prev=x_includes ;; | |
2389 | -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | |
2390 | | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) | |
2391 | x_includes=$ac_optarg ;; | |
2392 | ||
2393 | -x-libraries | --x-libraries | --x-librarie | --x-librari \ | |
2394 | | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) | |
2395 | ac_prev=x_libraries ;; | |
2396 | -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | |
2397 | | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) | |
2398 | x_libraries=$ac_optarg ;; | |
2399 | ||
d0ac1c44 SM |
2400 | -*) as_fn_error $? "unrecognized option: \`$ac_option' |
2401 | Try \`$0 --help' for more information" | |
c971b7fa PA |
2402 | ;; |
2403 | ||
2404 | *=*) | |
2405 | ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` | |
2406 | # Reject names that are not valid shell variable names. | |
2407 | case $ac_envvar in #( | |
2408 | '' | [0-9]* | *[!_$as_cr_alnum]* ) | |
d0ac1c44 | 2409 | as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; |
c971b7fa PA |
2410 | esac |
2411 | eval $ac_envvar=\$ac_optarg | |
2412 | export $ac_envvar ;; | |
2413 | ||
2414 | *) | |
2415 | # FIXME: should be removed in autoconf 3.0. | |
2416 | $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 | |
2417 | expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && | |
2418 | $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 | |
d0ac1c44 | 2419 | : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" |
c971b7fa PA |
2420 | ;; |
2421 | ||
2422 | esac | |
2423 | done | |
2424 | ||
2425 | if test -n "$ac_prev"; then | |
2426 | ac_option=--`echo $ac_prev | sed 's/_/-/g'` | |
d0ac1c44 | 2427 | as_fn_error $? "missing argument to $ac_option" |
c971b7fa PA |
2428 | fi |
2429 | ||
2430 | if test -n "$ac_unrecognized_opts"; then | |
2431 | case $enable_option_checking in | |
2432 | no) ;; | |
d0ac1c44 | 2433 | fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; |
c971b7fa PA |
2434 | *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; |
2435 | esac | |
2436 | fi | |
2437 | ||
2438 | # Check all directory arguments for consistency. | |
2439 | for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ | |
2440 | datadir sysconfdir sharedstatedir localstatedir includedir \ | |
2441 | oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ | |
2442 | libdir localedir mandir | |
2443 | do | |
2444 | eval ac_val=\$$ac_var | |
2445 | # Remove trailing slashes. | |
2446 | case $ac_val in | |
2447 | */ ) | |
2448 | ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` | |
2449 | eval $ac_var=\$ac_val;; | |
2450 | esac | |
2451 | # Be sure to have absolute directory names. | |
2452 | case $ac_val in | |
2453 | [\\/$]* | ?:[\\/]* ) continue;; | |
2454 | NONE | '' ) case $ac_var in *prefix ) continue;; esac;; | |
2455 | esac | |
d0ac1c44 | 2456 | as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" |
c971b7fa PA |
2457 | done |
2458 | ||
2459 | # There might be people who depend on the old broken behavior: `$host' | |
2460 | # used to hold the argument of --host etc. | |
2461 | # FIXME: To remove some day. | |
2462 | build=$build_alias | |
2463 | host=$host_alias | |
2464 | target=$target_alias | |
2465 | ||
2466 | # FIXME: To remove some day. | |
2467 | if test "x$host_alias" != x; then | |
2468 | if test "x$build_alias" = x; then | |
2469 | cross_compiling=maybe | |
c971b7fa PA |
2470 | elif test "x$build_alias" != "x$host_alias"; then |
2471 | cross_compiling=yes | |
2472 | fi | |
2473 | fi | |
2474 | ||
2475 | ac_tool_prefix= | |
2476 | test -n "$host_alias" && ac_tool_prefix=$host_alias- | |
2477 | ||
2478 | test "$silent" = yes && exec 6>/dev/null | |
2479 | ||
2480 | ||
2481 | ac_pwd=`pwd` && test -n "$ac_pwd" && | |
2482 | ac_ls_di=`ls -di .` && | |
2483 | ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || | |
d0ac1c44 | 2484 | as_fn_error $? "working directory cannot be determined" |
c971b7fa | 2485 | test "X$ac_ls_di" = "X$ac_pwd_ls_di" || |
d0ac1c44 | 2486 | as_fn_error $? "pwd does not report name of working directory" |
c971b7fa PA |
2487 | |
2488 | ||
2489 | # Find the source files, if location was not specified. | |
2490 | if test -z "$srcdir"; then | |
2491 | ac_srcdir_defaulted=yes | |
2492 | # Try the directory containing this script, then the parent directory. | |
2493 | ac_confdir=`$as_dirname -- "$as_myself" || | |
2494 | $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
2495 | X"$as_myself" : 'X\(//\)[^/]' \| \ | |
2496 | X"$as_myself" : 'X\(//\)$' \| \ | |
2497 | X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || | |
2498 | $as_echo X"$as_myself" | | |
2499 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
2500 | s//\1/ | |
2501 | q | |
2502 | } | |
2503 | /^X\(\/\/\)[^/].*/{ | |
2504 | s//\1/ | |
2505 | q | |
2506 | } | |
2507 | /^X\(\/\/\)$/{ | |
2508 | s//\1/ | |
2509 | q | |
2510 | } | |
2511 | /^X\(\/\).*/{ | |
2512 | s//\1/ | |
2513 | q | |
2514 | } | |
2515 | s/.*/./; q'` | |
2516 | srcdir=$ac_confdir | |
2517 | if test ! -r "$srcdir/$ac_unique_file"; then | |
2518 | srcdir=.. | |
2519 | fi | |
2520 | else | |
2521 | ac_srcdir_defaulted=no | |
2522 | fi | |
2523 | if test ! -r "$srcdir/$ac_unique_file"; then | |
2524 | test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." | |
d0ac1c44 | 2525 | as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" |
c971b7fa PA |
2526 | fi |
2527 | ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" | |
2528 | ac_abs_confdir=`( | |
d0ac1c44 | 2529 | cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" |
c971b7fa PA |
2530 | pwd)` |
2531 | # When building in place, set srcdir=. | |
2532 | if test "$ac_abs_confdir" = "$ac_pwd"; then | |
2533 | srcdir=. | |
2534 | fi | |
2535 | # Remove unnecessary trailing slashes from srcdir. | |
2536 | # Double slashes in file names in object file debugging info | |
2537 | # mess up M-x gdb in Emacs. | |
2538 | case $srcdir in | |
2539 | */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; | |
2540 | esac | |
2541 | for ac_var in $ac_precious_vars; do | |
2542 | eval ac_env_${ac_var}_set=\${${ac_var}+set} | |
2543 | eval ac_env_${ac_var}_value=\$${ac_var} | |
2544 | eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} | |
2545 | eval ac_cv_env_${ac_var}_value=\$${ac_var} | |
2546 | done | |
2547 | ||
2548 | # | |
2549 | # Report the --help message. | |
2550 | # | |
2551 | if test "$ac_init_help" = "long"; then | |
2552 | # Omit some internal or obsolete options to make the list less imposing. | |
2553 | # This message is too long to be a string in the A/UX 3.1 sh. | |
2554 | cat <<_ACEOF | |
d0ac1c44 | 2555 | \`configure' configures libgnu UNUSED-VERSION to adapt to many kinds of systems. |
c971b7fa PA |
2556 | |
2557 | Usage: $0 [OPTION]... [VAR=VALUE]... | |
2558 | ||
2559 | To assign environment variables (e.g., CC, CFLAGS...), specify them as | |
2560 | VAR=VALUE. See below for descriptions of some of the useful variables. | |
2561 | ||
2562 | Defaults for the options are specified in brackets. | |
2563 | ||
2564 | Configuration: | |
2565 | -h, --help display this help and exit | |
2566 | --help=short display options specific to this package | |
2567 | --help=recursive display the short help of all the included packages | |
2568 | -V, --version display version information and exit | |
d0ac1c44 | 2569 | -q, --quiet, --silent do not print \`checking ...' messages |
c971b7fa PA |
2570 | --cache-file=FILE cache test results in FILE [disabled] |
2571 | -C, --config-cache alias for \`--cache-file=config.cache' | |
2572 | -n, --no-create do not create output files | |
2573 | --srcdir=DIR find the sources in DIR [configure dir or \`..'] | |
2574 | ||
2575 | Installation directories: | |
2576 | --prefix=PREFIX install architecture-independent files in PREFIX | |
2577 | [$ac_default_prefix] | |
2578 | --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX | |
2579 | [PREFIX] | |
2580 | ||
2581 | By default, \`make install' will install all the files in | |
2582 | \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify | |
2583 | an installation prefix other than \`$ac_default_prefix' using \`--prefix', | |
2584 | for instance \`--prefix=\$HOME'. | |
2585 | ||
2586 | For better control, use the options below. | |
2587 | ||
2588 | Fine tuning of the installation directories: | |
2589 | --bindir=DIR user executables [EPREFIX/bin] | |
2590 | --sbindir=DIR system admin executables [EPREFIX/sbin] | |
2591 | --libexecdir=DIR program executables [EPREFIX/libexec] | |
2592 | --sysconfdir=DIR read-only single-machine data [PREFIX/etc] | |
2593 | --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] | |
2594 | --localstatedir=DIR modifiable single-machine data [PREFIX/var] | |
2595 | --libdir=DIR object code libraries [EPREFIX/lib] | |
2596 | --includedir=DIR C header files [PREFIX/include] | |
2597 | --oldincludedir=DIR C header files for non-gcc [/usr/include] | |
2598 | --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] | |
2599 | --datadir=DIR read-only architecture-independent data [DATAROOTDIR] | |
2600 | --infodir=DIR info documentation [DATAROOTDIR/info] | |
2601 | --localedir=DIR locale-dependent data [DATAROOTDIR/locale] | |
2602 | --mandir=DIR man documentation [DATAROOTDIR/man] | |
d0ac1c44 | 2603 | --docdir=DIR documentation root [DATAROOTDIR/doc/libgnu] |
c971b7fa PA |
2604 | --htmldir=DIR html documentation [DOCDIR] |
2605 | --dvidir=DIR dvi documentation [DOCDIR] | |
2606 | --pdfdir=DIR pdf documentation [DOCDIR] | |
2607 | --psdir=DIR ps documentation [DOCDIR] | |
2608 | _ACEOF | |
2609 | ||
2610 | cat <<\_ACEOF | |
2611 | ||
2612 | Program names: | |
2613 | --program-prefix=PREFIX prepend PREFIX to installed program names | |
2614 | --program-suffix=SUFFIX append SUFFIX to installed program names | |
2615 | --program-transform-name=PROGRAM run sed PROGRAM on installed program names | |
2616 | ||
2617 | System types: | |
2618 | --build=BUILD configure for building on BUILD [guessed] | |
2619 | --host=HOST cross-compile to build programs to run on HOST [BUILD] | |
2620 | --target=TARGET configure for building compilers for TARGET [HOST] | |
2621 | _ACEOF | |
2622 | fi | |
2623 | ||
2624 | if test -n "$ac_init_help"; then | |
d0ac1c44 SM |
2625 | case $ac_init_help in |
2626 | short | recursive ) echo "Configuration of libgnu UNUSED-VERSION:";; | |
2627 | esac | |
c971b7fa PA |
2628 | cat <<\_ACEOF |
2629 | ||
2630 | Optional Features: | |
2631 | --disable-option-checking ignore unrecognized --enable/--with options | |
2632 | --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) | |
2633 | --enable-FEATURE[=ARG] include FEATURE [ARG=yes] | |
d0ac1c44 SM |
2634 | --enable-maintainer-mode |
2635 | enable make rules and dependencies not useful (and | |
2636 | sometimes confusing) to the casual installer | |
c8693053 | 2637 | --enable-plugins Enable support for plugins |
2196f55f | 2638 | --disable-largefile omit support for large files |
c0c3707f | 2639 | --enable-threads={isoc|posix|isoc+posix|windows} |
5abebf3c CB |
2640 | specify multithreading API |
2641 | --disable-threads build without multithread safety | |
c0c3707f CB |
2642 | --enable-cross-guesses={conservative|risky} |
2643 | specify policy for cross-compilation guesses | |
d0ac1c44 SM |
2644 | --enable-dependency-tracking |
2645 | do not reject slow dependency extractors | |
2646 | --disable-dependency-tracking | |
2647 | speeds up one-time build | |
2648 | --enable-silent-rules less verbose build output (undo: "make V=1") | |
2649 | --disable-silent-rules verbose build output (undo: "make V=0") | |
c971b7fa PA |
2650 | |
2651 | Some influential environment variables: | |
2652 | CC C compiler command | |
2653 | CFLAGS C compiler flags | |
2654 | LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a | |
2655 | nonstandard directory <lib dir> | |
2656 | LIBS libraries to pass to the linker, e.g. -l<library> | |
d0ac1c44 | 2657 | CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if |
c971b7fa PA |
2658 | you have headers in a nonstandard directory <include dir> |
2659 | CPP C preprocessor | |
2660 | ||
2661 | Use these variables to override the choices made by `configure' or to help | |
2662 | it to find libraries and programs with nonstandard names/locations. | |
2663 | ||
2664 | Report bugs to the package provider. | |
2665 | _ACEOF | |
2666 | ac_status=$? | |
2667 | fi | |
2668 | ||
2669 | if test "$ac_init_help" = "recursive"; then | |
2670 | # If there are subdirs, report their specific --help. | |
2671 | for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue | |
2672 | test -d "$ac_dir" || | |
2673 | { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || | |
2674 | continue | |
2675 | ac_builddir=. | |
2676 | ||
2677 | case "$ac_dir" in | |
2678 | .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; | |
2679 | *) | |
2680 | ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` | |
2681 | # A ".." for each directory in $ac_dir_suffix. | |
2682 | ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` | |
2683 | case $ac_top_builddir_sub in | |
2684 | "") ac_top_builddir_sub=. ac_top_build_prefix= ;; | |
2685 | *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; | |
2686 | esac ;; | |
2687 | esac | |
2688 | ac_abs_top_builddir=$ac_pwd | |
2689 | ac_abs_builddir=$ac_pwd$ac_dir_suffix | |
2690 | # for backward compatibility: | |
2691 | ac_top_builddir=$ac_top_build_prefix | |
2692 | ||
2693 | case $srcdir in | |
2694 | .) # We are building in place. | |
2695 | ac_srcdir=. | |
2696 | ac_top_srcdir=$ac_top_builddir_sub | |
2697 | ac_abs_top_srcdir=$ac_pwd ;; | |
2698 | [\\/]* | ?:[\\/]* ) # Absolute name. | |
2699 | ac_srcdir=$srcdir$ac_dir_suffix; | |
2700 | ac_top_srcdir=$srcdir | |
2701 | ac_abs_top_srcdir=$srcdir ;; | |
2702 | *) # Relative name. | |
2703 | ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix | |
2704 | ac_top_srcdir=$ac_top_build_prefix$srcdir | |
2705 | ac_abs_top_srcdir=$ac_pwd/$srcdir ;; | |
2706 | esac | |
2707 | ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix | |
2708 | ||
2709 | cd "$ac_dir" || { ac_status=$?; continue; } | |
2710 | # Check for guested configure. | |
2711 | if test -f "$ac_srcdir/configure.gnu"; then | |
2712 | echo && | |
2713 | $SHELL "$ac_srcdir/configure.gnu" --help=recursive | |
2714 | elif test -f "$ac_srcdir/configure"; then | |
2715 | echo && | |
2716 | $SHELL "$ac_srcdir/configure" --help=recursive | |
2717 | else | |
2718 | $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 | |
2719 | fi || ac_status=$? | |
2720 | cd "$ac_pwd" || { ac_status=$?; break; } | |
2721 | done | |
2722 | fi | |
2723 | ||
2724 | test -n "$ac_init_help" && exit $ac_status | |
2725 | if $ac_init_version; then | |
2726 | cat <<\_ACEOF | |
d0ac1c44 SM |
2727 | libgnu configure UNUSED-VERSION |
2728 | generated by GNU Autoconf 2.69 | |
c971b7fa | 2729 | |
d0ac1c44 | 2730 | Copyright (C) 2012 Free Software Foundation, Inc. |
c971b7fa PA |
2731 | This configure script is free software; the Free Software Foundation |
2732 | gives unlimited permission to copy, distribute and modify it. | |
2733 | _ACEOF | |
2734 | exit | |
2735 | fi | |
2736 | ||
2737 | ## ------------------------ ## | |
2738 | ## Autoconf initialization. ## | |
2739 | ## ------------------------ ## | |
2740 | ||
2741 | # ac_fn_c_try_compile LINENO | |
2742 | # -------------------------- | |
2743 | # Try to compile conftest.$ac_ext, and return whether this succeeded. | |
2744 | ac_fn_c_try_compile () | |
2745 | { | |
2746 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2747 | rm -f conftest.$ac_objext | |
2748 | if { { ac_try="$ac_compile" | |
2749 | case "(($ac_try" in | |
2750 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
2751 | *) ac_try_echo=$ac_try;; | |
2752 | esac | |
2753 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
2754 | $as_echo "$ac_try_echo"; } >&5 | |
2755 | (eval "$ac_compile") 2>conftest.err | |
2756 | ac_status=$? | |
2757 | if test -s conftest.err; then | |
2758 | grep -v '^ *+' conftest.err >conftest.er1 | |
2759 | cat conftest.er1 >&5 | |
2760 | mv -f conftest.er1 conftest.err | |
2761 | fi | |
2762 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
2763 | test $ac_status = 0; } && { | |
2764 | test -z "$ac_c_werror_flag" || | |
2765 | test ! -s conftest.err | |
2766 | } && test -s conftest.$ac_objext; then : | |
2767 | ac_retval=0 | |
2768 | else | |
2769 | $as_echo "$as_me: failed program was:" >&5 | |
2770 | sed 's/^/| /' conftest.$ac_ext >&5 | |
2771 | ||
2772 | ac_retval=1 | |
2773 | fi | |
d0ac1c44 SM |
2774 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
2775 | as_fn_set_status $ac_retval | |
c971b7fa PA |
2776 | |
2777 | } # ac_fn_c_try_compile | |
2778 | ||
9c9d63b1 PM |
2779 | # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES |
2780 | # ------------------------------------------------------- | |
2781 | # Tests whether HEADER exists and can be compiled using the include files in | |
2782 | # INCLUDES, setting the cache variable VAR accordingly. | |
2783 | ac_fn_c_check_header_compile () | |
2784 | { | |
2785 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2786 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 | |
2787 | $as_echo_n "checking for $2... " >&6; } | |
2788 | if eval \${$3+:} false; then : | |
2789 | $as_echo_n "(cached) " >&6 | |
2790 | else | |
2791 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
2792 | /* end confdefs.h. */ | |
2793 | $4 | |
2794 | #include <$2> | |
2795 | _ACEOF | |
2796 | if ac_fn_c_try_compile "$LINENO"; then : | |
2797 | eval "$3=yes" | |
2798 | else | |
2799 | eval "$3=no" | |
2800 | fi | |
2801 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
2802 | fi | |
2803 | eval ac_res=\$$3 | |
2804 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
2805 | $as_echo "$ac_res" >&6; } | |
2806 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
2807 | ||
2808 | } # ac_fn_c_check_header_compile | |
2809 | ||
c971b7fa PA |
2810 | # ac_fn_c_try_cpp LINENO |
2811 | # ---------------------- | |
2812 | # Try to preprocess conftest.$ac_ext, and return whether this succeeded. | |
2813 | ac_fn_c_try_cpp () | |
2814 | { | |
2815 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2816 | if { { ac_try="$ac_cpp conftest.$ac_ext" | |
2817 | case "(($ac_try" in | |
2818 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
2819 | *) ac_try_echo=$ac_try;; | |
2820 | esac | |
2821 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
2822 | $as_echo "$ac_try_echo"; } >&5 | |
2823 | (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err | |
2824 | ac_status=$? | |
2825 | if test -s conftest.err; then | |
2826 | grep -v '^ *+' conftest.err >conftest.er1 | |
2827 | cat conftest.er1 >&5 | |
2828 | mv -f conftest.er1 conftest.err | |
2829 | fi | |
2830 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
d0ac1c44 | 2831 | test $ac_status = 0; } > conftest.i && { |
c971b7fa PA |
2832 | test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || |
2833 | test ! -s conftest.err | |
2834 | }; then : | |
2835 | ac_retval=0 | |
2836 | else | |
2837 | $as_echo "$as_me: failed program was:" >&5 | |
2838 | sed 's/^/| /' conftest.$ac_ext >&5 | |
2839 | ||
2840 | ac_retval=1 | |
2841 | fi | |
d0ac1c44 SM |
2842 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
2843 | as_fn_set_status $ac_retval | |
c971b7fa PA |
2844 | |
2845 | } # ac_fn_c_try_cpp | |
2846 | ||
c971b7fa PA |
2847 | # ac_fn_c_try_run LINENO |
2848 | # ---------------------- | |
2849 | # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes | |
2850 | # that executables *can* be run. | |
2851 | ac_fn_c_try_run () | |
2852 | { | |
2853 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2854 | if { { ac_try="$ac_link" | |
2855 | case "(($ac_try" in | |
2856 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
2857 | *) ac_try_echo=$ac_try;; | |
2858 | esac | |
2859 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
2860 | $as_echo "$ac_try_echo"; } >&5 | |
2861 | (eval "$ac_link") 2>&5 | |
2862 | ac_status=$? | |
2863 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
2864 | test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' | |
2865 | { { case "(($ac_try" in | |
2866 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
2867 | *) ac_try_echo=$ac_try;; | |
2868 | esac | |
2869 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
2870 | $as_echo "$ac_try_echo"; } >&5 | |
2871 | (eval "$ac_try") 2>&5 | |
2872 | ac_status=$? | |
2873 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
2874 | test $ac_status = 0; }; }; then : | |
2875 | ac_retval=0 | |
2876 | else | |
2877 | $as_echo "$as_me: program exited with status $ac_status" >&5 | |
2878 | $as_echo "$as_me: failed program was:" >&5 | |
2879 | sed 's/^/| /' conftest.$ac_ext >&5 | |
2880 | ||
2881 | ac_retval=$ac_status | |
2882 | fi | |
2883 | rm -rf conftest.dSYM conftest_ipa8_conftest.oo | |
d0ac1c44 SM |
2884 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
2885 | as_fn_set_status $ac_retval | |
c971b7fa PA |
2886 | |
2887 | } # ac_fn_c_try_run | |
2888 | ||
73cc7272 TT |
2889 | # ac_fn_c_try_link LINENO |
2890 | # ----------------------- | |
2891 | # Try to link conftest.$ac_ext, and return whether this succeeded. | |
2892 | ac_fn_c_try_link () | |
2893 | { | |
2894 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2895 | rm -f conftest.$ac_objext conftest$ac_exeext | |
2896 | if { { ac_try="$ac_link" | |
2897 | case "(($ac_try" in | |
2898 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
2899 | *) ac_try_echo=$ac_try;; | |
2900 | esac | |
2901 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
2902 | $as_echo "$ac_try_echo"; } >&5 | |
2903 | (eval "$ac_link") 2>conftest.err | |
2904 | ac_status=$? | |
2905 | if test -s conftest.err; then | |
2906 | grep -v '^ *+' conftest.err >conftest.er1 | |
2907 | cat conftest.er1 >&5 | |
2908 | mv -f conftest.er1 conftest.err | |
2909 | fi | |
2910 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
2911 | test $ac_status = 0; } && { | |
2912 | test -z "$ac_c_werror_flag" || | |
2913 | test ! -s conftest.err | |
2914 | } && test -s conftest$ac_exeext && { | |
2915 | test "$cross_compiling" = yes || | |
2916 | test -x conftest$ac_exeext | |
2917 | }; then : | |
2918 | ac_retval=0 | |
2919 | else | |
2920 | $as_echo "$as_me: failed program was:" >&5 | |
2921 | sed 's/^/| /' conftest.$ac_ext >&5 | |
2922 | ||
2923 | ac_retval=1 | |
2924 | fi | |
2925 | # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information | |
2926 | # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would | |
2927 | # interfere with the next link command; also delete a directory that is | |
2928 | # left behind by Apple's compiler. We do this before executing the actions. | |
2929 | rm -rf conftest.dSYM conftest_ipa8_conftest.oo | |
2930 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
2931 | as_fn_set_status $ac_retval | |
2932 | ||
2933 | } # ac_fn_c_try_link | |
2934 | ||
d0ac1c44 SM |
2935 | # ac_fn_c_check_type LINENO TYPE VAR INCLUDES |
2936 | # ------------------------------------------- | |
2937 | # Tests whether TYPE exists after having included INCLUDES, setting cache | |
2938 | # variable VAR accordingly. | |
2939 | ac_fn_c_check_type () | |
2940 | { | |
2941 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2942 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 | |
2943 | $as_echo_n "checking for $2... " >&6; } | |
2944 | if eval \${$3+:} false; then : | |
2945 | $as_echo_n "(cached) " >&6 | |
2946 | else | |
2947 | eval "$3=no" | |
2948 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
2949 | /* end confdefs.h. */ | |
2950 | $4 | |
2951 | int | |
2952 | main () | |
2953 | { | |
2954 | if (sizeof ($2)) | |
2955 | return 0; | |
2956 | ; | |
2957 | return 0; | |
2958 | } | |
2959 | _ACEOF | |
2960 | if ac_fn_c_try_compile "$LINENO"; then : | |
2961 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
2962 | /* end confdefs.h. */ | |
2963 | $4 | |
2964 | int | |
2965 | main () | |
2966 | { | |
2967 | if (sizeof (($2))) | |
2968 | return 0; | |
2969 | ; | |
2970 | return 0; | |
2971 | } | |
2972 | _ACEOF | |
2973 | if ac_fn_c_try_compile "$LINENO"; then : | |
2974 | ||
2975 | else | |
2976 | eval "$3=yes" | |
2977 | fi | |
2978 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
2979 | fi | |
2980 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
2981 | fi | |
2982 | eval ac_res=\$$3 | |
2983 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
2984 | $as_echo "$ac_res" >&6; } | |
2985 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
2986 | ||
2987 | } # ac_fn_c_check_type | |
2988 | ||
9c9d63b1 PM |
2989 | # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES |
2990 | # ------------------------------------------------------- | |
2991 | # Tests whether HEADER exists, giving a warning if it cannot be compiled using | |
2992 | # the include files in INCLUDES and setting the cache variable VAR | |
2993 | # accordingly. | |
2994 | ac_fn_c_check_header_mongrel () | |
2995 | { | |
2996 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2997 | if eval \${$3+:} false; then : | |
2998 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 | |
2999 | $as_echo_n "checking for $2... " >&6; } | |
3000 | if eval \${$3+:} false; then : | |
3001 | $as_echo_n "(cached) " >&6 | |
3002 | fi | |
3003 | eval ac_res=\$$3 | |
3004 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
3005 | $as_echo "$ac_res" >&6; } | |
3006 | else | |
3007 | # Is the header compilable? | |
3008 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 | |
3009 | $as_echo_n "checking $2 usability... " >&6; } | |
3010 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3011 | /* end confdefs.h. */ | |
3012 | $4 | |
3013 | #include <$2> | |
3014 | _ACEOF | |
3015 | if ac_fn_c_try_compile "$LINENO"; then : | |
3016 | ac_header_compiler=yes | |
3017 | else | |
3018 | ac_header_compiler=no | |
3019 | fi | |
3020 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3021 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 | |
3022 | $as_echo "$ac_header_compiler" >&6; } | |
3023 | ||
3024 | # Is the header present? | |
3025 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 | |
3026 | $as_echo_n "checking $2 presence... " >&6; } | |
3027 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3028 | /* end confdefs.h. */ | |
3029 | #include <$2> | |
3030 | _ACEOF | |
3031 | if ac_fn_c_try_cpp "$LINENO"; then : | |
3032 | ac_header_preproc=yes | |
3033 | else | |
3034 | ac_header_preproc=no | |
3035 | fi | |
3036 | rm -f conftest.err conftest.i conftest.$ac_ext | |
3037 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 | |
3038 | $as_echo "$ac_header_preproc" >&6; } | |
3039 | ||
3040 | # So? What about this header? | |
3041 | case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( | |
3042 | yes:no: ) | |
3043 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 | |
3044 | $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} | |
3045 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 | |
3046 | $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} | |
3047 | ;; | |
3048 | no:yes:* ) | |
3049 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 | |
3050 | $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} | |
3051 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 | |
3052 | $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} | |
3053 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 | |
3054 | $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} | |
3055 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 | |
3056 | $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} | |
3057 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 | |
3058 | $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} | |
3059 | ;; | |
3060 | esac | |
3061 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 | |
3062 | $as_echo_n "checking for $2... " >&6; } | |
3063 | if eval \${$3+:} false; then : | |
3064 | $as_echo_n "(cached) " >&6 | |
3065 | else | |
3066 | eval "$3=\$ac_header_compiler" | |
3067 | fi | |
3068 | eval ac_res=\$$3 | |
3069 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
3070 | $as_echo "$ac_res" >&6; } | |
3071 | fi | |
3072 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
3073 | ||
3074 | } # ac_fn_c_check_header_mongrel | |
3075 | ||
8690e634 JK |
3076 | # ac_fn_c_check_func LINENO FUNC VAR |
3077 | # ---------------------------------- | |
3078 | # Tests whether FUNC exists, setting the cache variable VAR accordingly | |
3079 | ac_fn_c_check_func () | |
3080 | { | |
3081 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
3082 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 | |
3083 | $as_echo_n "checking for $2... " >&6; } | |
d0ac1c44 | 3084 | if eval \${$3+:} false; then : |
8690e634 JK |
3085 | $as_echo_n "(cached) " >&6 |
3086 | else | |
3087 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3088 | /* end confdefs.h. */ | |
3089 | /* Define $2 to an innocuous variant, in case <limits.h> declares $2. | |
3090 | For example, HP-UX 11i <limits.h> declares gettimeofday. */ | |
3091 | #define $2 innocuous_$2 | |
3092 | ||
3093 | /* System header to define __stub macros and hopefully few prototypes, | |
3094 | which can conflict with char $2 (); below. | |
3095 | Prefer <limits.h> to <assert.h> if __STDC__ is defined, since | |
3096 | <limits.h> exists even on freestanding compilers. */ | |
3097 | ||
3098 | #ifdef __STDC__ | |
3099 | # include <limits.h> | |
3100 | #else | |
3101 | # include <assert.h> | |
3102 | #endif | |
3103 | ||
3104 | #undef $2 | |
3105 | ||
3106 | /* Override any GCC internal prototype to avoid an error. | |
3107 | Use char because int might match the return type of a GCC | |
3108 | builtin and then its argument prototype would still apply. */ | |
3109 | #ifdef __cplusplus | |
3110 | extern "C" | |
3111 | #endif | |
3112 | char $2 (); | |
3113 | /* The GNU C library defines this for functions which it implements | |
3114 | to always fail with ENOSYS. Some functions are actually named | |
3115 | something starting with __ and the normal name is an alias. */ | |
3116 | #if defined __stub_$2 || defined __stub___$2 | |
3117 | choke me | |
3118 | #endif | |
3119 | ||
3120 | int | |
3121 | main () | |
3122 | { | |
3123 | return $2 (); | |
3124 | ; | |
3125 | return 0; | |
3126 | } | |
3127 | _ACEOF | |
3128 | if ac_fn_c_try_link "$LINENO"; then : | |
3129 | eval "$3=yes" | |
3130 | else | |
3131 | eval "$3=no" | |
3132 | fi | |
3133 | rm -f core conftest.err conftest.$ac_objext \ | |
3134 | conftest$ac_exeext conftest.$ac_ext | |
3135 | fi | |
3136 | eval ac_res=\$$3 | |
3137 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
3138 | $as_echo "$ac_res" >&6; } | |
d0ac1c44 | 3139 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
8690e634 JK |
3140 | |
3141 | } # ac_fn_c_check_func | |
3142 | ||
d0ac1c44 SM |
3143 | # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES |
3144 | # --------------------------------------------- | |
3145 | # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR | |
3146 | # accordingly. | |
8986e351 TT |
3147 | ac_fn_c_check_decl () |
3148 | { | |
5df4cba6 SM |
3149 | ac_save_ac_compile="$ac_compile" |
3150 | if test -n "$ac_compile_for_check_decl"; then | |
3151 | ac_compile="$ac_compile_for_check_decl" | |
3152 | fi | |
8986e351 | 3153 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
d0ac1c44 SM |
3154 | as_decl_name=`echo $2|sed 's/ *(.*//'` |
3155 | as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` | |
3156 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 | |
3157 | $as_echo_n "checking whether $as_decl_name is declared... " >&6; } | |
3158 | if eval \${$3+:} false; then : | |
8986e351 TT |
3159 | $as_echo_n "(cached) " >&6 |
3160 | else | |
3161 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3162 | /* end confdefs.h. */ | |
3163 | $4 | |
3164 | int | |
3165 | main () | |
3166 | { | |
d0ac1c44 SM |
3167 | #ifndef $as_decl_name |
3168 | #ifdef __cplusplus | |
3169 | (void) $as_decl_use; | |
3170 | #else | |
3171 | (void) $as_decl_name; | |
3172 | #endif | |
8986e351 TT |
3173 | #endif |
3174 | ||
3175 | ; | |
3176 | return 0; | |
3177 | } | |
3178 | _ACEOF | |
3179 | if ac_fn_c_try_compile "$LINENO"; then : | |
3180 | eval "$3=yes" | |
3181 | else | |
3182 | eval "$3=no" | |
3183 | fi | |
3184 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3185 | fi | |
3186 | eval ac_res=\$$3 | |
3187 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
3188 | $as_echo "$ac_res" >&6; } | |
d0ac1c44 | 3189 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
5df4cba6 | 3190 | ac_compile="$ac_save_ac_compile" |
8986e351 TT |
3191 | |
3192 | } # ac_fn_c_check_decl | |
3193 | ||
c971b7fa PA |
3194 | # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES |
3195 | # -------------------------------------------- | |
3196 | # Tries to find the compile-time value of EXPR in a program that includes | |
3197 | # INCLUDES, setting VAR accordingly. Returns whether the value could be | |
3198 | # computed | |
3199 | ac_fn_c_compute_int () | |
3200 | { | |
3201 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
3202 | if test "$cross_compiling" = yes; then | |
3203 | # Depending upon the size, compute the lo and hi bounds. | |
3204 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3205 | /* end confdefs.h. */ | |
3206 | $4 | |
3207 | int | |
3208 | main () | |
3209 | { | |
3210 | static int test_array [1 - 2 * !(($2) >= 0)]; | |
d0ac1c44 SM |
3211 | test_array [0] = 0; |
3212 | return test_array [0]; | |
c971b7fa PA |
3213 | |
3214 | ; | |
3215 | return 0; | |
3216 | } | |
3217 | _ACEOF | |
3218 | if ac_fn_c_try_compile "$LINENO"; then : | |
3219 | ac_lo=0 ac_mid=0 | |
3220 | while :; do | |
3221 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3222 | /* end confdefs.h. */ | |
3223 | $4 | |
3224 | int | |
3225 | main () | |
3226 | { | |
3227 | static int test_array [1 - 2 * !(($2) <= $ac_mid)]; | |
d0ac1c44 SM |
3228 | test_array [0] = 0; |
3229 | return test_array [0]; | |
c971b7fa PA |
3230 | |
3231 | ; | |
3232 | return 0; | |
3233 | } | |
3234 | _ACEOF | |
3235 | if ac_fn_c_try_compile "$LINENO"; then : | |
3236 | ac_hi=$ac_mid; break | |
3237 | else | |
3238 | as_fn_arith $ac_mid + 1 && ac_lo=$as_val | |
3239 | if test $ac_lo -le $ac_mid; then | |
3240 | ac_lo= ac_hi= | |
3241 | break | |
3242 | fi | |
3243 | as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val | |
3244 | fi | |
3245 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3246 | done | |
3247 | else | |
3248 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3249 | /* end confdefs.h. */ | |
3250 | $4 | |
3251 | int | |
3252 | main () | |
3253 | { | |
3254 | static int test_array [1 - 2 * !(($2) < 0)]; | |
d0ac1c44 SM |
3255 | test_array [0] = 0; |
3256 | return test_array [0]; | |
c971b7fa PA |
3257 | |
3258 | ; | |
3259 | return 0; | |
3260 | } | |
3261 | _ACEOF | |
3262 | if ac_fn_c_try_compile "$LINENO"; then : | |
3263 | ac_hi=-1 ac_mid=-1 | |
3264 | while :; do | |
3265 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3266 | /* end confdefs.h. */ | |
3267 | $4 | |
3268 | int | |
3269 | main () | |
3270 | { | |
3271 | static int test_array [1 - 2 * !(($2) >= $ac_mid)]; | |
d0ac1c44 SM |
3272 | test_array [0] = 0; |
3273 | return test_array [0]; | |
c971b7fa PA |
3274 | |
3275 | ; | |
3276 | return 0; | |
3277 | } | |
3278 | _ACEOF | |
3279 | if ac_fn_c_try_compile "$LINENO"; then : | |
3280 | ac_lo=$ac_mid; break | |
3281 | else | |
3282 | as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val | |
3283 | if test $ac_mid -le $ac_hi; then | |
3284 | ac_lo= ac_hi= | |
3285 | break | |
3286 | fi | |
3287 | as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val | |
3288 | fi | |
3289 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3290 | done | |
3291 | else | |
3292 | ac_lo= ac_hi= | |
3293 | fi | |
3294 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3295 | fi | |
3296 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3297 | # Binary search between lo and hi bounds. | |
3298 | while test "x$ac_lo" != "x$ac_hi"; do | |
3299 | as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val | |
3300 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3301 | /* end confdefs.h. */ | |
3302 | $4 | |
3303 | int | |
3304 | main () | |
3305 | { | |
3306 | static int test_array [1 - 2 * !(($2) <= $ac_mid)]; | |
d0ac1c44 SM |
3307 | test_array [0] = 0; |
3308 | return test_array [0]; | |
c971b7fa PA |
3309 | |
3310 | ; | |
3311 | return 0; | |
3312 | } | |
3313 | _ACEOF | |
3314 | if ac_fn_c_try_compile "$LINENO"; then : | |
3315 | ac_hi=$ac_mid | |
3316 | else | |
3317 | as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val | |
3318 | fi | |
3319 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3320 | done | |
3321 | case $ac_lo in #(( | |
3322 | ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; | |
3323 | '') ac_retval=1 ;; | |
3324 | esac | |
3325 | else | |
3326 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3327 | /* end confdefs.h. */ | |
3328 | $4 | |
3329 | static long int longval () { return $2; } | |
3330 | static unsigned long int ulongval () { return $2; } | |
3331 | #include <stdio.h> | |
3332 | #include <stdlib.h> | |
3333 | int | |
3334 | main () | |
3335 | { | |
3336 | ||
3337 | FILE *f = fopen ("conftest.val", "w"); | |
3338 | if (! f) | |
3339 | return 1; | |
3340 | if (($2) < 0) | |
3341 | { | |
3342 | long int i = longval (); | |
3343 | if (i != ($2)) | |
3344 | return 1; | |
3345 | fprintf (f, "%ld", i); | |
3346 | } | |
3347 | else | |
3348 | { | |
3349 | unsigned long int i = ulongval (); | |
3350 | if (i != ($2)) | |
3351 | return 1; | |
3352 | fprintf (f, "%lu", i); | |
3353 | } | |
3354 | /* Do not output a trailing newline, as this causes \r\n confusion | |
3355 | on some platforms. */ | |
3356 | return ferror (f) || fclose (f) != 0; | |
3357 | ||
3358 | ; | |
3359 | return 0; | |
3360 | } | |
3361 | _ACEOF | |
3362 | if ac_fn_c_try_run "$LINENO"; then : | |
3363 | echo >>conftest.val; read $3 <conftest.val; ac_retval=0 | |
3364 | else | |
3365 | ac_retval=1 | |
3366 | fi | |
3367 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
3368 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
3369 | rm -f conftest.val | |
3370 | ||
3371 | fi | |
d0ac1c44 SM |
3372 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
3373 | as_fn_set_status $ac_retval | |
c971b7fa PA |
3374 | |
3375 | } # ac_fn_c_compute_int | |
725e2999 JB |
3376 | |
3377 | # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES | |
3378 | # ---------------------------------------------------- | |
3379 | # Tries to find if the field MEMBER exists in type AGGR, after including | |
3380 | # INCLUDES, setting cache variable VAR accordingly. | |
3381 | ac_fn_c_check_member () | |
3382 | { | |
3383 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
3384 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 | |
3385 | $as_echo_n "checking for $2.$3... " >&6; } | |
3386 | if eval \${$4+:} false; then : | |
3387 | $as_echo_n "(cached) " >&6 | |
3388 | else | |
3389 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3390 | /* end confdefs.h. */ | |
3391 | $5 | |
3392 | int | |
3393 | main () | |
3394 | { | |
3395 | static $2 ac_aggr; | |
3396 | if (ac_aggr.$3) | |
3397 | return 0; | |
3398 | ; | |
3399 | return 0; | |
3400 | } | |
3401 | _ACEOF | |
3402 | if ac_fn_c_try_compile "$LINENO"; then : | |
3403 | eval "$4=yes" | |
3404 | else | |
3405 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3406 | /* end confdefs.h. */ | |
3407 | $5 | |
3408 | int | |
3409 | main () | |
3410 | { | |
3411 | static $2 ac_aggr; | |
3412 | if (sizeof ac_aggr.$3) | |
3413 | return 0; | |
3414 | ; | |
3415 | return 0; | |
3416 | } | |
3417 | _ACEOF | |
3418 | if ac_fn_c_try_compile "$LINENO"; then : | |
3419 | eval "$4=yes" | |
3420 | else | |
3421 | eval "$4=no" | |
3422 | fi | |
3423 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3424 | fi | |
3425 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3426 | fi | |
3427 | eval ac_res=\$$4 | |
3428 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
3429 | $as_echo "$ac_res" >&6; } | |
3430 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
3431 | ||
3432 | } # ac_fn_c_check_member | |
c971b7fa PA |
3433 | cat >config.log <<_ACEOF |
3434 | This file contains any messages produced by compilers while | |
3435 | running configure, to aid debugging if configure makes a mistake. | |
3436 | ||
d0ac1c44 SM |
3437 | It was created by libgnu $as_me UNUSED-VERSION, which was |
3438 | generated by GNU Autoconf 2.69. Invocation command line was | |
c971b7fa PA |
3439 | |
3440 | $ $0 $@ | |
3441 | ||
3442 | _ACEOF | |
3443 | exec 5>>config.log | |
3444 | { | |
3445 | cat <<_ASUNAME | |
3446 | ## --------- ## | |
3447 | ## Platform. ## | |
3448 | ## --------- ## | |
3449 | ||
3450 | hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` | |
3451 | uname -m = `(uname -m) 2>/dev/null || echo unknown` | |
3452 | uname -r = `(uname -r) 2>/dev/null || echo unknown` | |
3453 | uname -s = `(uname -s) 2>/dev/null || echo unknown` | |
3454 | uname -v = `(uname -v) 2>/dev/null || echo unknown` | |
3455 | ||
3456 | /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` | |
3457 | /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` | |
3458 | ||
3459 | /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` | |
3460 | /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` | |
3461 | /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` | |
3462 | /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` | |
3463 | /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` | |
3464 | /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` | |
3465 | /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` | |
3466 | ||
3467 | _ASUNAME | |
3468 | ||
3469 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
3470 | for as_dir in $PATH | |
3471 | do | |
3472 | IFS=$as_save_IFS | |
3473 | test -z "$as_dir" && as_dir=. | |
3474 | $as_echo "PATH: $as_dir" | |
3475 | done | |
3476 | IFS=$as_save_IFS | |
3477 | ||
3478 | } >&5 | |
3479 | ||
3480 | cat >&5 <<_ACEOF | |
3481 | ||
3482 | ||
3483 | ## ----------- ## | |
3484 | ## Core tests. ## | |
3485 | ## ----------- ## | |
3486 | ||
3487 | _ACEOF | |
3488 | ||
3489 | ||
3490 | # Keep a trace of the command line. | |
3491 | # Strip out --no-create and --no-recursion so they do not pile up. | |
3492 | # Strip out --silent because we don't want to record it for future runs. | |
3493 | # Also quote any args containing shell meta-characters. | |
3494 | # Make two passes to allow for proper duplicate-argument suppression. | |
3495 | ac_configure_args= | |
3496 | ac_configure_args0= | |
3497 | ac_configure_args1= | |
3498 | ac_must_keep_next=false | |
3499 | for ac_pass in 1 2 | |
3500 | do | |
3501 | for ac_arg | |
3502 | do | |
3503 | case $ac_arg in | |
3504 | -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; | |
3505 | -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | |
3506 | | -silent | --silent | --silen | --sile | --sil) | |
3507 | continue ;; | |
3508 | *\'*) | |
3509 | ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; | |
3510 | esac | |
3511 | case $ac_pass in | |
3512 | 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; | |
3513 | 2) | |
3514 | as_fn_append ac_configure_args1 " '$ac_arg'" | |
3515 | if test $ac_must_keep_next = true; then | |
3516 | ac_must_keep_next=false # Got value, back to normal. | |
3517 | else | |
3518 | case $ac_arg in | |
3519 | *=* | --config-cache | -C | -disable-* | --disable-* \ | |
3520 | | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | |
3521 | | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | |
3522 | | -with-* | --with-* | -without-* | --without-* | --x) | |
3523 | case "$ac_configure_args0 " in | |
3524 | "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; | |
3525 | esac | |
3526 | ;; | |
3527 | -* ) ac_must_keep_next=true ;; | |
3528 | esac | |
3529 | fi | |
3530 | as_fn_append ac_configure_args " '$ac_arg'" | |
3531 | ;; | |
3532 | esac | |
3533 | done | |
3534 | done | |
3535 | { ac_configure_args0=; unset ac_configure_args0;} | |
3536 | { ac_configure_args1=; unset ac_configure_args1;} | |
3537 | ||
3538 | # When interrupted or exit'd, cleanup temporary files, and complete | |
3539 | # config.log. We remove comments because anyway the quotes in there | |
3540 | # would cause problems or look ugly. | |
3541 | # WARNING: Use '\'' to represent an apostrophe within the trap. | |
3542 | # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. | |
3543 | trap 'exit_status=$? | |
3544 | # Save into config.log some information that might help in debugging. | |
3545 | { | |
3546 | echo | |
3547 | ||
d0ac1c44 | 3548 | $as_echo "## ---------------- ## |
c971b7fa | 3549 | ## Cache variables. ## |
d0ac1c44 | 3550 | ## ---------------- ##" |
c971b7fa PA |
3551 | echo |
3552 | # The following way of writing the cache mishandles newlines in values, | |
3553 | ( | |
3554 | for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do | |
3555 | eval ac_val=\$$ac_var | |
3556 | case $ac_val in #( | |
3557 | *${as_nl}*) | |
3558 | case $ac_var in #( | |
3559 | *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 | |
3560 | $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; | |
3561 | esac | |
3562 | case $ac_var in #( | |
3563 | _ | IFS | as_nl) ;; #( | |
3564 | BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( | |
3565 | *) { eval $ac_var=; unset $ac_var;} ;; | |
3566 | esac ;; | |
3567 | esac | |
3568 | done | |
3569 | (set) 2>&1 | | |
3570 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( | |
3571 | *${as_nl}ac_space=\ *) | |
3572 | sed -n \ | |
3573 | "s/'\''/'\''\\\\'\'''\''/g; | |
3574 | s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" | |
3575 | ;; #( | |
3576 | *) | |
3577 | sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" | |
3578 | ;; | |
3579 | esac | | |
3580 | sort | |
3581 | ) | |
3582 | echo | |
3583 | ||
d0ac1c44 | 3584 | $as_echo "## ----------------- ## |
c971b7fa | 3585 | ## Output variables. ## |
d0ac1c44 | 3586 | ## ----------------- ##" |
c971b7fa PA |
3587 | echo |
3588 | for ac_var in $ac_subst_vars | |
3589 | do | |
3590 | eval ac_val=\$$ac_var | |
3591 | case $ac_val in | |
3592 | *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; | |
3593 | esac | |
3594 | $as_echo "$ac_var='\''$ac_val'\''" | |
3595 | done | sort | |
3596 | echo | |
3597 | ||
3598 | if test -n "$ac_subst_files"; then | |
d0ac1c44 | 3599 | $as_echo "## ------------------- ## |
c971b7fa | 3600 | ## File substitutions. ## |
d0ac1c44 | 3601 | ## ------------------- ##" |
c971b7fa PA |
3602 | echo |
3603 | for ac_var in $ac_subst_files | |
3604 | do | |
3605 | eval ac_val=\$$ac_var | |
3606 | case $ac_val in | |
3607 | *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; | |
3608 | esac | |
3609 | $as_echo "$ac_var='\''$ac_val'\''" | |
3610 | done | sort | |
3611 | echo | |
3612 | fi | |
3613 | ||
3614 | if test -s confdefs.h; then | |
d0ac1c44 | 3615 | $as_echo "## ----------- ## |
c971b7fa | 3616 | ## confdefs.h. ## |
d0ac1c44 | 3617 | ## ----------- ##" |
c971b7fa PA |
3618 | echo |
3619 | cat confdefs.h | |
3620 | echo | |
3621 | fi | |
3622 | test "$ac_signal" != 0 && | |
3623 | $as_echo "$as_me: caught signal $ac_signal" | |
3624 | $as_echo "$as_me: exit $exit_status" | |
3625 | } >&5 | |
3626 | rm -f core *.core core.conftest.* && | |
3627 | rm -f -r conftest* confdefs* conf$$* $ac_clean_files && | |
3628 | exit $exit_status | |
3629 | ' 0 | |
3630 | for ac_signal in 1 2 13 15; do | |
3631 | trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal | |
3632 | done | |
3633 | ac_signal=0 | |
3634 | ||
3635 | # confdefs.h avoids OS command line length limits that DEFS can exceed. | |
3636 | rm -f -r conftest* confdefs.h | |
3637 | ||
3638 | $as_echo "/* confdefs.h */" > confdefs.h | |
3639 | ||
3640 | # Predefined preprocessor variables. | |
3641 | ||
3642 | cat >>confdefs.h <<_ACEOF | |
3643 | #define PACKAGE_NAME "$PACKAGE_NAME" | |
3644 | _ACEOF | |
3645 | ||
3646 | cat >>confdefs.h <<_ACEOF | |
3647 | #define PACKAGE_TARNAME "$PACKAGE_TARNAME" | |
3648 | _ACEOF | |
3649 | ||
3650 | cat >>confdefs.h <<_ACEOF | |
3651 | #define PACKAGE_VERSION "$PACKAGE_VERSION" | |
3652 | _ACEOF | |
3653 | ||
3654 | cat >>confdefs.h <<_ACEOF | |
3655 | #define PACKAGE_STRING "$PACKAGE_STRING" | |
3656 | _ACEOF | |
3657 | ||
3658 | cat >>confdefs.h <<_ACEOF | |
3659 | #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" | |
3660 | _ACEOF | |
3661 | ||
3662 | cat >>confdefs.h <<_ACEOF | |
3663 | #define PACKAGE_URL "$PACKAGE_URL" | |
3664 | _ACEOF | |
3665 | ||
3666 | ||
3667 | # Let the site file select an alternate cache file if it wants to. | |
3668 | # Prefer an explicitly selected file to automatically selected ones. | |
3669 | ac_site_file1=NONE | |
3670 | ac_site_file2=NONE | |
3671 | if test -n "$CONFIG_SITE"; then | |
d0ac1c44 SM |
3672 | # We do not want a PATH search for config.site. |
3673 | case $CONFIG_SITE in #(( | |
3674 | -*) ac_site_file1=./$CONFIG_SITE;; | |
3675 | */*) ac_site_file1=$CONFIG_SITE;; | |
3676 | *) ac_site_file1=./$CONFIG_SITE;; | |
3677 | esac | |
c971b7fa PA |
3678 | elif test "x$prefix" != xNONE; then |
3679 | ac_site_file1=$prefix/share/config.site | |
3680 | ac_site_file2=$prefix/etc/config.site | |
3681 | else | |
3682 | ac_site_file1=$ac_default_prefix/share/config.site | |
3683 | ac_site_file2=$ac_default_prefix/etc/config.site | |
3684 | fi | |
3685 | for ac_site_file in "$ac_site_file1" "$ac_site_file2" | |
3686 | do | |
3687 | test "x$ac_site_file" = xNONE && continue | |
d0ac1c44 | 3688 | if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then |
c971b7fa PA |
3689 | { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 |
3690 | $as_echo "$as_me: loading site script $ac_site_file" >&6;} | |
3691 | sed 's/^/| /' "$ac_site_file" >&5 | |
d0ac1c44 SM |
3692 | . "$ac_site_file" \ |
3693 | || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
3694 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
3695 | as_fn_error $? "failed to load site script $ac_site_file | |
3696 | See \`config.log' for more details" "$LINENO" 5; } | |
c971b7fa PA |
3697 | fi |
3698 | done | |
3699 | ||
3700 | if test -r "$cache_file"; then | |
d0ac1c44 SM |
3701 | # Some versions of bash will fail to source /dev/null (special files |
3702 | # actually), so we avoid doing that. DJGPP emulates it as a regular file. | |
3703 | if test /dev/null != "$cache_file" && test -f "$cache_file"; then | |
c971b7fa PA |
3704 | { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 |
3705 | $as_echo "$as_me: loading cache $cache_file" >&6;} | |
3706 | case $cache_file in | |
3707 | [\\/]* | ?:[\\/]* ) . "$cache_file";; | |
3708 | *) . "./$cache_file";; | |
3709 | esac | |
3710 | fi | |
3711 | else | |
3712 | { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 | |
3713 | $as_echo "$as_me: creating cache $cache_file" >&6;} | |
3714 | >$cache_file | |
3715 | fi | |
3716 | ||
9c9d63b1 PM |
3717 | as_fn_append ac_header_list " wchar.h" |
3718 | as_fn_append ac_header_list " minix/config.h" | |
c0c3707f CB |
3719 | as_fn_append ac_header_list " arpa/inet.h" |
3720 | as_fn_append ac_header_list " features.h" | |
3721 | as_fn_append ac_header_list " sys/socket.h" | |
698be2d8 | 3722 | as_fn_append ac_func_list " btowc" |
c0c3707f | 3723 | as_fn_append ac_func_list " canonicalize_file_name" |
9c9d63b1 | 3724 | as_fn_append ac_func_list " faccessat" |
c0c3707f CB |
3725 | as_fn_append ac_func_list " realpath" |
3726 | as_fn_append ac_header_list " sys/param.h" | |
3727 | as_fn_append ac_header_list " unistd.h" | |
64c2e4a5 MF |
3728 | as_fn_append ac_func_list " chown" |
3729 | as_fn_append ac_func_list " fchown" | |
c0c3707f CB |
3730 | as_fn_append ac_func_list " _set_invalid_parameter_handler" |
3731 | as_fn_append ac_func_list " fchdir" | |
3732 | as_fn_append ac_header_list " dirent.h" | |
3733 | as_fn_append ac_func_list " fcntl" | |
3734 | as_fn_append ac_func_list " symlink" | |
3735 | as_fn_append ac_func_list " fdopendir" | |
3736 | as_fn_append ac_func_list " mempcpy" | |
3737 | as_fn_append ac_header_list " fnmatch.h" | |
3738 | as_fn_append ac_func_list " fnmatch" | |
c0c3707f | 3739 | as_fn_append ac_func_list " mbsrtowcs" |
8690e634 | 3740 | gl_fnmatch_required=GNU |
c0c3707f CB |
3741 | as_fn_append ac_header_list " sys/stat.h" |
3742 | as_fn_append ac_func_list " fstatat" | |
c17253b9 | 3743 | as_fn_append ac_func_list " getdelim" |
c0c3707f CB |
3744 | as_fn_append ac_func_list " getdtablesize" |
3745 | as_fn_append ac_func_list " getlogin_r" | |
3746 | as_fn_append ac_func_list " getprogname" | |
3747 | as_fn_append ac_func_list " getexecname" | |
698be2d8 | 3748 | as_fn_append ac_func_list " getrandom" |
c0c3707f CB |
3749 | as_fn_append ac_header_list " sys/time.h" |
3750 | as_fn_append ac_func_list " gettimeofday" | |
3751 | as_fn_append ac_header_list " glob.h" | |
3752 | as_fn_append ac_func_list " glob" | |
3753 | as_fn_append ac_func_list " glob_pattern_p" | |
3754 | as_fn_append ac_func_list " getpwnam_r" | |
5df4cba6 | 3755 | as_fn_append ac_header_list " threads.h" |
c0c3707f CB |
3756 | as_fn_append ac_header_list " netdb.h" |
3757 | as_fn_append ac_header_list " netinet/in.h" | |
3758 | as_fn_append ac_header_list " limits.h" | |
c0c3707f | 3759 | as_fn_append ac_header_list " inttypes.h" |
9c9d63b1 PM |
3760 | as_fn_append ac_header_list " sys/types.h" |
3761 | as_fn_append ac_header_list " stdint.h" | |
698be2d8 | 3762 | as_fn_append ac_func_list " isblank" |
5df4cba6 | 3763 | as_fn_append ac_header_list " xlocale.h" |
c0c3707f CB |
3764 | as_fn_append ac_func_list " lstat" |
3765 | as_fn_append ac_header_list " math.h" | |
3766 | as_fn_append ac_func_list " mbsinit" | |
3767 | as_fn_append ac_func_list " mbrtowc" | |
3768 | as_fn_append ac_header_list " sys/mman.h" | |
3769 | as_fn_append ac_func_list " mprotect" | |
3770 | as_fn_append ac_func_list " mkostemp" | |
3771 | as_fn_append ac_func_list " openat" | |
9c9d63b1 PM |
3772 | as_fn_append ac_func_list " pipe" |
3773 | as_fn_append ac_func_list " readlink" | |
c0c3707f CB |
3774 | as_fn_append ac_func_list " link" |
3775 | as_fn_append ac_func_list " setenv" | |
c0c3707f CB |
3776 | as_fn_append ac_func_list " strerror_r" |
3777 | as_fn_append ac_func_list " __xpg_strerror_r" | |
3778 | as_fn_append ac_func_list " catgets" | |
3779 | as_fn_append ac_func_list " snprintf" | |
32e2770e | 3780 | as_fn_append ac_header_list " strings.h" |
698be2d8 | 3781 | as_fn_append ac_header_list " sys/random.h" |
c0c3707f CB |
3782 | as_fn_append ac_header_list " sys/uio.h" |
3783 | as_fn_append ac_func_list " localtime_r" | |
c0c3707f CB |
3784 | as_fn_append ac_header_list " crtdefs.h" |
3785 | as_fn_append ac_func_list " iswcntrl" | |
698be2d8 CB |
3786 | as_fn_append ac_header_list " wctype.h" |
3787 | as_fn_append ac_func_list " wmempcpy" | |
c971b7fa PA |
3788 | # Check that the precious variables saved in the cache have kept the same |
3789 | # value. | |
3790 | ac_cache_corrupted=false | |
3791 | for ac_var in $ac_precious_vars; do | |
3792 | eval ac_old_set=\$ac_cv_env_${ac_var}_set | |
3793 | eval ac_new_set=\$ac_env_${ac_var}_set | |
3794 | eval ac_old_val=\$ac_cv_env_${ac_var}_value | |
3795 | eval ac_new_val=\$ac_env_${ac_var}_value | |
3796 | case $ac_old_set,$ac_new_set in | |
3797 | set,) | |
3798 | { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 | |
3799 | $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} | |
3800 | ac_cache_corrupted=: ;; | |
3801 | ,set) | |
3802 | { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 | |
3803 | $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} | |
3804 | ac_cache_corrupted=: ;; | |
3805 | ,);; | |
3806 | *) | |
3807 | if test "x$ac_old_val" != "x$ac_new_val"; then | |
3808 | # differences in whitespace do not lead to failure. | |
3809 | ac_old_val_w=`echo x $ac_old_val` | |
3810 | ac_new_val_w=`echo x $ac_new_val` | |
3811 | if test "$ac_old_val_w" != "$ac_new_val_w"; then | |
3812 | { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 | |
3813 | $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} | |
3814 | ac_cache_corrupted=: | |
3815 | else | |
3816 | { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 | |
3817 | $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} | |
3818 | eval $ac_var=\$ac_old_val | |
3819 | fi | |
3820 | { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 | |
3821 | $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} | |
3822 | { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 | |
3823 | $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} | |
3824 | fi;; | |
3825 | esac | |
3826 | # Pass precious variables to config.status. | |
3827 | if test "$ac_new_set" = set; then | |
3828 | case $ac_new_val in | |
3829 | *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; | |
3830 | *) ac_arg=$ac_var=$ac_new_val ;; | |
3831 | esac | |
3832 | case " $ac_configure_args " in | |
3833 | *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. | |
3834 | *) as_fn_append ac_configure_args " '$ac_arg'" ;; | |
3835 | esac | |
3836 | fi | |
3837 | done | |
3838 | if $ac_cache_corrupted; then | |
3839 | { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
3840 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
3841 | { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 | |
3842 | $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} | |
d0ac1c44 | 3843 | as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 |
c971b7fa PA |
3844 | fi |
3845 | ## -------------------- ## | |
3846 | ## Main body of script. ## | |
3847 | ## -------------------- ## | |
3848 | ||
3849 | ac_ext=c | |
3850 | ac_cpp='$CPP $CPPFLAGS' | |
3851 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
3852 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
3853 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
3854 | ||
3855 | ||
d0ac1c44 | 3856 | |
73cc7272 TT |
3857 | |
3858 | ||
3859 | ||
c971b7fa PA |
3860 | ac_config_headers="$ac_config_headers config.h:config.in" |
3861 | ||
3862 | ||
5abebf3c CB |
3863 | |
3864 | ||
c971b7fa PA |
3865 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 |
3866 | $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } | |
3867 | # Check whether --enable-maintainer-mode was given. | |
3868 | if test "${enable_maintainer_mode+set}" = set; then : | |
3869 | enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval | |
3870 | else | |
3871 | USE_MAINTAINER_MODE=no | |
3872 | fi | |
3873 | ||
3874 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 | |
3875 | $as_echo "$USE_MAINTAINER_MODE" >&6; } | |
3876 | if test $USE_MAINTAINER_MODE = yes; then | |
3877 | MAINTAINER_MODE_TRUE= | |
3878 | MAINTAINER_MODE_FALSE='#' | |
3879 | else | |
3880 | MAINTAINER_MODE_TRUE='#' | |
3881 | MAINTAINER_MODE_FALSE= | |
3882 | fi | |
3883 | ||
3884 | MAINT=$MAINTAINER_MODE_TRUE | |
3885 | ||
3886 | ||
3887 | ||
3888 | ac_ext=c | |
3889 | ac_cpp='$CPP $CPPFLAGS' | |
3890 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
3891 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
3892 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
3893 | if test -n "$ac_tool_prefix"; then | |
3894 | # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. | |
3895 | set dummy ${ac_tool_prefix}gcc; ac_word=$2 | |
3896 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
3897 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 3898 | if ${ac_cv_prog_CC+:} false; then : |
c971b7fa PA |
3899 | $as_echo_n "(cached) " >&6 |
3900 | else | |
3901 | if test -n "$CC"; then | |
3902 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
3903 | else | |
3904 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
3905 | for as_dir in $PATH | |
3906 | do | |
3907 | IFS=$as_save_IFS | |
3908 | test -z "$as_dir" && as_dir=. | |
3909 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 3910 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
3911 | ac_cv_prog_CC="${ac_tool_prefix}gcc" |
3912 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
3913 | break 2 | |
3914 | fi | |
3915 | done | |
3916 | done | |
3917 | IFS=$as_save_IFS | |
3918 | ||
3919 | fi | |
3920 | fi | |
3921 | CC=$ac_cv_prog_CC | |
3922 | if test -n "$CC"; then | |
3923 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 | |
3924 | $as_echo "$CC" >&6; } | |
3925 | else | |
3926 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
3927 | $as_echo "no" >&6; } | |
3928 | fi | |
3929 | ||
3930 | ||
3931 | fi | |
3932 | if test -z "$ac_cv_prog_CC"; then | |
3933 | ac_ct_CC=$CC | |
3934 | # Extract the first word of "gcc", so it can be a program name with args. | |
3935 | set dummy gcc; ac_word=$2 | |
3936 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
3937 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 3938 | if ${ac_cv_prog_ac_ct_CC+:} false; then : |
c971b7fa PA |
3939 | $as_echo_n "(cached) " >&6 |
3940 | else | |
3941 | if test -n "$ac_ct_CC"; then | |
3942 | ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. | |
3943 | else | |
3944 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
3945 | for as_dir in $PATH | |
3946 | do | |
3947 | IFS=$as_save_IFS | |
3948 | test -z "$as_dir" && as_dir=. | |
3949 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 3950 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
3951 | ac_cv_prog_ac_ct_CC="gcc" |
3952 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
3953 | break 2 | |
3954 | fi | |
3955 | done | |
3956 | done | |
3957 | IFS=$as_save_IFS | |
3958 | ||
3959 | fi | |
3960 | fi | |
3961 | ac_ct_CC=$ac_cv_prog_ac_ct_CC | |
3962 | if test -n "$ac_ct_CC"; then | |
3963 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 | |
3964 | $as_echo "$ac_ct_CC" >&6; } | |
3965 | else | |
3966 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
3967 | $as_echo "no" >&6; } | |
3968 | fi | |
3969 | ||
3970 | if test "x$ac_ct_CC" = x; then | |
3971 | CC="" | |
3972 | else | |
3973 | case $cross_compiling:$ac_tool_warned in | |
3974 | yes:) | |
3975 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
3976 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
3977 | ac_tool_warned=yes ;; | |
3978 | esac | |
3979 | CC=$ac_ct_CC | |
3980 | fi | |
3981 | else | |
3982 | CC="$ac_cv_prog_CC" | |
3983 | fi | |
3984 | ||
3985 | if test -z "$CC"; then | |
3986 | if test -n "$ac_tool_prefix"; then | |
3987 | # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. | |
3988 | set dummy ${ac_tool_prefix}cc; ac_word=$2 | |
3989 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
3990 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 3991 | if ${ac_cv_prog_CC+:} false; then : |
c971b7fa PA |
3992 | $as_echo_n "(cached) " >&6 |
3993 | else | |
3994 | if test -n "$CC"; then | |
3995 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
3996 | else | |
3997 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
3998 | for as_dir in $PATH | |
3999 | do | |
4000 | IFS=$as_save_IFS | |
4001 | test -z "$as_dir" && as_dir=. | |
4002 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 4003 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
4004 | ac_cv_prog_CC="${ac_tool_prefix}cc" |
4005 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
4006 | break 2 | |
4007 | fi | |
4008 | done | |
4009 | done | |
4010 | IFS=$as_save_IFS | |
4011 | ||
4012 | fi | |
4013 | fi | |
4014 | CC=$ac_cv_prog_CC | |
4015 | if test -n "$CC"; then | |
4016 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 | |
4017 | $as_echo "$CC" >&6; } | |
4018 | else | |
4019 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4020 | $as_echo "no" >&6; } | |
4021 | fi | |
4022 | ||
4023 | ||
4024 | fi | |
4025 | fi | |
4026 | if test -z "$CC"; then | |
4027 | # Extract the first word of "cc", so it can be a program name with args. | |
4028 | set dummy cc; ac_word=$2 | |
4029 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
4030 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 4031 | if ${ac_cv_prog_CC+:} false; then : |
c971b7fa PA |
4032 | $as_echo_n "(cached) " >&6 |
4033 | else | |
4034 | if test -n "$CC"; then | |
4035 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
4036 | else | |
4037 | ac_prog_rejected=no | |
4038 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
4039 | for as_dir in $PATH | |
4040 | do | |
4041 | IFS=$as_save_IFS | |
4042 | test -z "$as_dir" && as_dir=. | |
4043 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 4044 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
4045 | if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then |
4046 | ac_prog_rejected=yes | |
4047 | continue | |
4048 | fi | |
4049 | ac_cv_prog_CC="cc" | |
4050 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
4051 | break 2 | |
4052 | fi | |
4053 | done | |
4054 | done | |
4055 | IFS=$as_save_IFS | |
4056 | ||
4057 | if test $ac_prog_rejected = yes; then | |
4058 | # We found a bogon in the path, so make sure we never use it. | |
4059 | set dummy $ac_cv_prog_CC | |
4060 | shift | |
4061 | if test $# != 0; then | |
4062 | # We chose a different compiler from the bogus one. | |
4063 | # However, it has the same basename, so the bogon will be chosen | |
4064 | # first if we set CC to just the basename; use the full file name. | |
4065 | shift | |
4066 | ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" | |
4067 | fi | |
4068 | fi | |
4069 | fi | |
4070 | fi | |
4071 | CC=$ac_cv_prog_CC | |
4072 | if test -n "$CC"; then | |
4073 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 | |
4074 | $as_echo "$CC" >&6; } | |
4075 | else | |
4076 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4077 | $as_echo "no" >&6; } | |
4078 | fi | |
4079 | ||
4080 | ||
4081 | fi | |
4082 | if test -z "$CC"; then | |
4083 | if test -n "$ac_tool_prefix"; then | |
4084 | for ac_prog in cl.exe | |
4085 | do | |
4086 | # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. | |
4087 | set dummy $ac_tool_prefix$ac_prog; ac_word=$2 | |
4088 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
4089 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 4090 | if ${ac_cv_prog_CC+:} false; then : |
c971b7fa PA |
4091 | $as_echo_n "(cached) " >&6 |
4092 | else | |
4093 | if test -n "$CC"; then | |
4094 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
4095 | else | |
4096 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
4097 | for as_dir in $PATH | |
4098 | do | |
4099 | IFS=$as_save_IFS | |
4100 | test -z "$as_dir" && as_dir=. | |
4101 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 4102 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
4103 | ac_cv_prog_CC="$ac_tool_prefix$ac_prog" |
4104 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
4105 | break 2 | |
4106 | fi | |
4107 | done | |
4108 | done | |
4109 | IFS=$as_save_IFS | |
4110 | ||
4111 | fi | |
4112 | fi | |
4113 | CC=$ac_cv_prog_CC | |
4114 | if test -n "$CC"; then | |
4115 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 | |
4116 | $as_echo "$CC" >&6; } | |
4117 | else | |
4118 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4119 | $as_echo "no" >&6; } | |
4120 | fi | |
4121 | ||
4122 | ||
4123 | test -n "$CC" && break | |
4124 | done | |
4125 | fi | |
4126 | if test -z "$CC"; then | |
4127 | ac_ct_CC=$CC | |
4128 | for ac_prog in cl.exe | |
4129 | do | |
4130 | # Extract the first word of "$ac_prog", so it can be a program name with args. | |
4131 | set dummy $ac_prog; ac_word=$2 | |
4132 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
4133 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 4134 | if ${ac_cv_prog_ac_ct_CC+:} false; then : |
c971b7fa PA |
4135 | $as_echo_n "(cached) " >&6 |
4136 | else | |
4137 | if test -n "$ac_ct_CC"; then | |
4138 | ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. | |
4139 | else | |
4140 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
4141 | for as_dir in $PATH | |
4142 | do | |
4143 | IFS=$as_save_IFS | |
4144 | test -z "$as_dir" && as_dir=. | |
4145 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 4146 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
4147 | ac_cv_prog_ac_ct_CC="$ac_prog" |
4148 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
4149 | break 2 | |
4150 | fi | |
4151 | done | |
4152 | done | |
4153 | IFS=$as_save_IFS | |
4154 | ||
4155 | fi | |
4156 | fi | |
4157 | ac_ct_CC=$ac_cv_prog_ac_ct_CC | |
4158 | if test -n "$ac_ct_CC"; then | |
4159 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 | |
4160 | $as_echo "$ac_ct_CC" >&6; } | |
4161 | else | |
4162 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4163 | $as_echo "no" >&6; } | |
4164 | fi | |
4165 | ||
4166 | ||
4167 | test -n "$ac_ct_CC" && break | |
4168 | done | |
4169 | ||
4170 | if test "x$ac_ct_CC" = x; then | |
4171 | CC="" | |
4172 | else | |
4173 | case $cross_compiling:$ac_tool_warned in | |
4174 | yes:) | |
4175 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
4176 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
4177 | ac_tool_warned=yes ;; | |
4178 | esac | |
4179 | CC=$ac_ct_CC | |
4180 | fi | |
4181 | fi | |
4182 | ||
c0c3707f CB |
4183 | fi |
4184 | if test -z "$CC"; then | |
4185 | if test -n "$ac_tool_prefix"; then | |
4186 | # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. | |
4187 | set dummy ${ac_tool_prefix}clang; ac_word=$2 | |
4188 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
4189 | $as_echo_n "checking for $ac_word... " >&6; } | |
4190 | if ${ac_cv_prog_CC+:} false; then : | |
4191 | $as_echo_n "(cached) " >&6 | |
4192 | else | |
4193 | if test -n "$CC"; then | |
4194 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
4195 | else | |
4196 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
4197 | for as_dir in $PATH | |
4198 | do | |
4199 | IFS=$as_save_IFS | |
4200 | test -z "$as_dir" && as_dir=. | |
4201 | for ac_exec_ext in '' $ac_executable_extensions; do | |
4202 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
4203 | ac_cv_prog_CC="${ac_tool_prefix}clang" | |
4204 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
4205 | break 2 | |
4206 | fi | |
4207 | done | |
4208 | done | |
4209 | IFS=$as_save_IFS | |
4210 | ||
4211 | fi | |
4212 | fi | |
4213 | CC=$ac_cv_prog_CC | |
4214 | if test -n "$CC"; then | |
4215 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 | |
4216 | $as_echo "$CC" >&6; } | |
4217 | else | |
4218 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4219 | $as_echo "no" >&6; } | |
4220 | fi | |
4221 | ||
4222 | ||
4223 | fi | |
4224 | if test -z "$ac_cv_prog_CC"; then | |
4225 | ac_ct_CC=$CC | |
4226 | # Extract the first word of "clang", so it can be a program name with args. | |
4227 | set dummy clang; ac_word=$2 | |
4228 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
4229 | $as_echo_n "checking for $ac_word... " >&6; } | |
4230 | if ${ac_cv_prog_ac_ct_CC+:} false; then : | |
4231 | $as_echo_n "(cached) " >&6 | |
4232 | else | |
4233 | if test -n "$ac_ct_CC"; then | |
4234 | ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. | |
4235 | else | |
4236 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
4237 | for as_dir in $PATH | |
4238 | do | |
4239 | IFS=$as_save_IFS | |
4240 | test -z "$as_dir" && as_dir=. | |
4241 | for ac_exec_ext in '' $ac_executable_extensions; do | |
4242 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
4243 | ac_cv_prog_ac_ct_CC="clang" | |
4244 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
4245 | break 2 | |
4246 | fi | |
4247 | done | |
4248 | done | |
4249 | IFS=$as_save_IFS | |
4250 | ||
4251 | fi | |
4252 | fi | |
4253 | ac_ct_CC=$ac_cv_prog_ac_ct_CC | |
4254 | if test -n "$ac_ct_CC"; then | |
4255 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 | |
4256 | $as_echo "$ac_ct_CC" >&6; } | |
4257 | else | |
4258 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4259 | $as_echo "no" >&6; } | |
4260 | fi | |
4261 | ||
4262 | if test "x$ac_ct_CC" = x; then | |
4263 | CC="" | |
4264 | else | |
4265 | case $cross_compiling:$ac_tool_warned in | |
4266 | yes:) | |
4267 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
4268 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
4269 | ac_tool_warned=yes ;; | |
4270 | esac | |
4271 | CC=$ac_ct_CC | |
4272 | fi | |
4273 | else | |
4274 | CC="$ac_cv_prog_CC" | |
4275 | fi | |
4276 | ||
c971b7fa PA |
4277 | fi |
4278 | ||
4279 | ||
4280 | test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
4281 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
d0ac1c44 SM |
4282 | as_fn_error $? "no acceptable C compiler found in \$PATH |
4283 | See \`config.log' for more details" "$LINENO" 5; } | |
c971b7fa PA |
4284 | |
4285 | # Provide some information about the compiler. | |
4286 | $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 | |
4287 | set X $ac_compile | |
4288 | ac_compiler=$2 | |
c0c3707f | 4289 | for ac_option in --version -v -V -qversion -version; do |
c971b7fa PA |
4290 | { { ac_try="$ac_compiler $ac_option >&5" |
4291 | case "(($ac_try" in | |
4292 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4293 | *) ac_try_echo=$ac_try;; | |
4294 | esac | |
4295 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4296 | $as_echo "$ac_try_echo"; } >&5 | |
4297 | (eval "$ac_compiler $ac_option >&5") 2>conftest.err | |
4298 | ac_status=$? | |
4299 | if test -s conftest.err; then | |
4300 | sed '10a\ | |
4301 | ... rest of stderr output deleted ... | |
4302 | 10q' conftest.err >conftest.er1 | |
4303 | cat conftest.er1 >&5 | |
c971b7fa | 4304 | fi |
d0ac1c44 | 4305 | rm -f conftest.er1 conftest.err |
c971b7fa PA |
4306 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
4307 | test $ac_status = 0; } | |
4308 | done | |
4309 | ||
4310 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4311 | /* end confdefs.h. */ | |
d0ac1c44 | 4312 | |
c971b7fa PA |
4313 | int |
4314 | main () | |
4315 | { | |
c971b7fa PA |
4316 | |
4317 | ; | |
4318 | return 0; | |
4319 | } | |
4320 | _ACEOF | |
4321 | ac_clean_files_save=$ac_clean_files | |
d0ac1c44 | 4322 | ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" |
c971b7fa PA |
4323 | # Try to create an executable without -o first, disregard a.out. |
4324 | # It will help us diagnose broken compilers, and finding out an intuition | |
4325 | # of exeext. | |
d0ac1c44 SM |
4326 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 |
4327 | $as_echo_n "checking whether the C compiler works... " >&6; } | |
c971b7fa PA |
4328 | ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` |
4329 | ||
4330 | # The possible output files: | |
4331 | ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" | |
4332 | ||
4333 | ac_rmfiles= | |
4334 | for ac_file in $ac_files | |
4335 | do | |
4336 | case $ac_file in | |
4337 | *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; | |
4338 | * ) ac_rmfiles="$ac_rmfiles $ac_file";; | |
4339 | esac | |
4340 | done | |
4341 | rm -f $ac_rmfiles | |
4342 | ||
4343 | if { { ac_try="$ac_link_default" | |
4344 | case "(($ac_try" in | |
4345 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4346 | *) ac_try_echo=$ac_try;; | |
4347 | esac | |
4348 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4349 | $as_echo "$ac_try_echo"; } >&5 | |
4350 | (eval "$ac_link_default") 2>&5 | |
4351 | ac_status=$? | |
4352 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
4353 | test $ac_status = 0; }; then : | |
4354 | # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. | |
4355 | # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' | |
4356 | # in a Makefile. We should not override ac_cv_exeext if it was cached, | |
4357 | # so that the user can short-circuit this test for compilers unknown to | |
4358 | # Autoconf. | |
4359 | for ac_file in $ac_files '' | |
4360 | do | |
4361 | test -f "$ac_file" || continue | |
4362 | case $ac_file in | |
4363 | *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) | |
4364 | ;; | |
4365 | [ab].out ) | |
4366 | # We found the default executable, but exeext='' is most | |
4367 | # certainly right. | |
4368 | break;; | |
4369 | *.* ) | |
4370 | if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; | |
4371 | then :; else | |
4372 | ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` | |
4373 | fi | |
4374 | # We set ac_cv_exeext here because the later test for it is not | |
4375 | # safe: cross compilers may not add the suffix if given an `-o' | |
4376 | # argument, so we may need to know it at that point already. | |
4377 | # Even if this section looks crufty: it has the advantage of | |
4378 | # actually working. | |
4379 | break;; | |
4380 | * ) | |
4381 | break;; | |
4382 | esac | |
4383 | done | |
4384 | test "$ac_cv_exeext" = no && ac_cv_exeext= | |
4385 | ||
4386 | else | |
4387 | ac_file='' | |
4388 | fi | |
c971b7fa | 4389 | if test -z "$ac_file"; then : |
d0ac1c44 SM |
4390 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
4391 | $as_echo "no" >&6; } | |
4392 | $as_echo "$as_me: failed program was:" >&5 | |
c971b7fa PA |
4393 | sed 's/^/| /' conftest.$ac_ext >&5 |
4394 | ||
4395 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
4396 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
d0ac1c44 SM |
4397 | as_fn_error 77 "C compiler cannot create executables |
4398 | See \`config.log' for more details" "$LINENO" 5; } | |
4399 | else | |
4400 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
4401 | $as_echo "yes" >&6; } | |
c971b7fa | 4402 | fi |
d0ac1c44 SM |
4403 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 |
4404 | $as_echo_n "checking for C compiler default output file name... " >&6; } | |
4405 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 | |
4406 | $as_echo "$ac_file" >&6; } | |
c971b7fa PA |
4407 | ac_exeext=$ac_cv_exeext |
4408 | ||
d0ac1c44 | 4409 | rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out |
c971b7fa | 4410 | ac_clean_files=$ac_clean_files_save |
c971b7fa PA |
4411 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 |
4412 | $as_echo_n "checking for suffix of executables... " >&6; } | |
4413 | if { { ac_try="$ac_link" | |
4414 | case "(($ac_try" in | |
4415 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4416 | *) ac_try_echo=$ac_try;; | |
4417 | esac | |
4418 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4419 | $as_echo "$ac_try_echo"; } >&5 | |
4420 | (eval "$ac_link") 2>&5 | |
4421 | ac_status=$? | |
4422 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
4423 | test $ac_status = 0; }; then : | |
4424 | # If both `conftest.exe' and `conftest' are `present' (well, observable) | |
4425 | # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will | |
4426 | # work properly (i.e., refer to `conftest.exe'), while it won't with | |
4427 | # `rm'. | |
4428 | for ac_file in conftest.exe conftest conftest.*; do | |
4429 | test -f "$ac_file" || continue | |
4430 | case $ac_file in | |
4431 | *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; | |
4432 | *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` | |
4433 | break;; | |
4434 | * ) break;; | |
4435 | esac | |
4436 | done | |
4437 | else | |
4438 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
4439 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
d0ac1c44 SM |
4440 | as_fn_error $? "cannot compute suffix of executables: cannot compile and link |
4441 | See \`config.log' for more details" "$LINENO" 5; } | |
c971b7fa | 4442 | fi |
d0ac1c44 | 4443 | rm -f conftest conftest$ac_cv_exeext |
c971b7fa PA |
4444 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 |
4445 | $as_echo "$ac_cv_exeext" >&6; } | |
4446 | ||
4447 | rm -f conftest.$ac_ext | |
4448 | EXEEXT=$ac_cv_exeext | |
4449 | ac_exeext=$EXEEXT | |
d0ac1c44 SM |
4450 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
4451 | /* end confdefs.h. */ | |
4452 | #include <stdio.h> | |
4453 | int | |
4454 | main () | |
4455 | { | |
4456 | FILE *f = fopen ("conftest.out", "w"); | |
4457 | return ferror (f) || fclose (f) != 0; | |
4458 | ||
4459 | ; | |
4460 | return 0; | |
4461 | } | |
4462 | _ACEOF | |
4463 | ac_clean_files="$ac_clean_files conftest.out" | |
4464 | # Check that the compiler produces executables we can run. If not, either | |
4465 | # the compiler is broken, or we cross compile. | |
4466 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 | |
4467 | $as_echo_n "checking whether we are cross compiling... " >&6; } | |
4468 | if test "$cross_compiling" != yes; then | |
4469 | { { ac_try="$ac_link" | |
4470 | case "(($ac_try" in | |
4471 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4472 | *) ac_try_echo=$ac_try;; | |
4473 | esac | |
4474 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4475 | $as_echo "$ac_try_echo"; } >&5 | |
4476 | (eval "$ac_link") 2>&5 | |
4477 | ac_status=$? | |
4478 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
4479 | test $ac_status = 0; } | |
4480 | if { ac_try='./conftest$ac_cv_exeext' | |
4481 | { { case "(($ac_try" in | |
4482 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4483 | *) ac_try_echo=$ac_try;; | |
4484 | esac | |
4485 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4486 | $as_echo "$ac_try_echo"; } >&5 | |
4487 | (eval "$ac_try") 2>&5 | |
4488 | ac_status=$? | |
4489 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
4490 | test $ac_status = 0; }; }; then | |
4491 | cross_compiling=no | |
4492 | else | |
4493 | if test "$cross_compiling" = maybe; then | |
4494 | cross_compiling=yes | |
4495 | else | |
4496 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
4497 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
4498 | as_fn_error $? "cannot run C compiled programs. | |
4499 | If you meant to cross compile, use \`--host'. | |
4500 | See \`config.log' for more details" "$LINENO" 5; } | |
4501 | fi | |
4502 | fi | |
4503 | fi | |
4504 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 | |
4505 | $as_echo "$cross_compiling" >&6; } | |
4506 | ||
4507 | rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out | |
4508 | ac_clean_files=$ac_clean_files_save | |
c971b7fa PA |
4509 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 |
4510 | $as_echo_n "checking for suffix of object files... " >&6; } | |
d0ac1c44 | 4511 | if ${ac_cv_objext+:} false; then : |
c971b7fa PA |
4512 | $as_echo_n "(cached) " >&6 |
4513 | else | |
4514 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4515 | /* end confdefs.h. */ | |
4516 | ||
4517 | int | |
4518 | main () | |
4519 | { | |
4520 | ||
4521 | ; | |
4522 | return 0; | |
4523 | } | |
4524 | _ACEOF | |
4525 | rm -f conftest.o conftest.obj | |
4526 | if { { ac_try="$ac_compile" | |
4527 | case "(($ac_try" in | |
4528 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4529 | *) ac_try_echo=$ac_try;; | |
4530 | esac | |
4531 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4532 | $as_echo "$ac_try_echo"; } >&5 | |
4533 | (eval "$ac_compile") 2>&5 | |
4534 | ac_status=$? | |
4535 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
4536 | test $ac_status = 0; }; then : | |
4537 | for ac_file in conftest.o conftest.obj conftest.*; do | |
4538 | test -f "$ac_file" || continue; | |
4539 | case $ac_file in | |
4540 | *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; | |
4541 | *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` | |
4542 | break;; | |
4543 | esac | |
4544 | done | |
4545 | else | |
4546 | $as_echo "$as_me: failed program was:" >&5 | |
4547 | sed 's/^/| /' conftest.$ac_ext >&5 | |
4548 | ||
4549 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
4550 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
d0ac1c44 SM |
4551 | as_fn_error $? "cannot compute suffix of object files: cannot compile |
4552 | See \`config.log' for more details" "$LINENO" 5; } | |
c971b7fa PA |
4553 | fi |
4554 | rm -f conftest.$ac_cv_objext conftest.$ac_ext | |
4555 | fi | |
4556 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 | |
4557 | $as_echo "$ac_cv_objext" >&6; } | |
4558 | OBJEXT=$ac_cv_objext | |
4559 | ac_objext=$OBJEXT | |
4560 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 | |
4561 | $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } | |
d0ac1c44 | 4562 | if ${ac_cv_c_compiler_gnu+:} false; then : |
c971b7fa PA |
4563 | $as_echo_n "(cached) " >&6 |
4564 | else | |
4565 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4566 | /* end confdefs.h. */ | |
4567 | ||
4568 | int | |
4569 | main () | |
4570 | { | |
4571 | #ifndef __GNUC__ | |
4572 | choke me | |
4573 | #endif | |
4574 | ||
4575 | ; | |
4576 | return 0; | |
4577 | } | |
4578 | _ACEOF | |
4579 | if ac_fn_c_try_compile "$LINENO"; then : | |
4580 | ac_compiler_gnu=yes | |
4581 | else | |
4582 | ac_compiler_gnu=no | |
4583 | fi | |
4584 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
4585 | ac_cv_c_compiler_gnu=$ac_compiler_gnu | |
4586 | ||
4587 | fi | |
4588 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 | |
4589 | $as_echo "$ac_cv_c_compiler_gnu" >&6; } | |
4590 | if test $ac_compiler_gnu = yes; then | |
4591 | GCC=yes | |
4592 | else | |
4593 | GCC= | |
4594 | fi | |
4595 | ac_test_CFLAGS=${CFLAGS+set} | |
4596 | ac_save_CFLAGS=$CFLAGS | |
4597 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 | |
4598 | $as_echo_n "checking whether $CC accepts -g... " >&6; } | |
d0ac1c44 | 4599 | if ${ac_cv_prog_cc_g+:} false; then : |
c971b7fa PA |
4600 | $as_echo_n "(cached) " >&6 |
4601 | else | |
4602 | ac_save_c_werror_flag=$ac_c_werror_flag | |
4603 | ac_c_werror_flag=yes | |
4604 | ac_cv_prog_cc_g=no | |
4605 | CFLAGS="-g" | |
4606 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4607 | /* end confdefs.h. */ | |
4608 | ||
4609 | int | |
4610 | main () | |
4611 | { | |
4612 | ||
4613 | ; | |
4614 | return 0; | |
4615 | } | |
4616 | _ACEOF | |
4617 | if ac_fn_c_try_compile "$LINENO"; then : | |
4618 | ac_cv_prog_cc_g=yes | |
4619 | else | |
4620 | CFLAGS="" | |
4621 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4622 | /* end confdefs.h. */ | |
4623 | ||
4624 | int | |
4625 | main () | |
4626 | { | |
4627 | ||
4628 | ; | |
4629 | return 0; | |
4630 | } | |
4631 | _ACEOF | |
4632 | if ac_fn_c_try_compile "$LINENO"; then : | |
4633 | ||
4634 | else | |
4635 | ac_c_werror_flag=$ac_save_c_werror_flag | |
4636 | CFLAGS="-g" | |
4637 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4638 | /* end confdefs.h. */ | |
4639 | ||
4640 | int | |
4641 | main () | |
4642 | { | |
4643 | ||
4644 | ; | |
4645 | return 0; | |
4646 | } | |
4647 | _ACEOF | |
4648 | if ac_fn_c_try_compile "$LINENO"; then : | |
4649 | ac_cv_prog_cc_g=yes | |
4650 | fi | |
4651 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
4652 | fi | |
4653 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
4654 | fi | |
4655 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
4656 | ac_c_werror_flag=$ac_save_c_werror_flag | |
4657 | fi | |
4658 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 | |
4659 | $as_echo "$ac_cv_prog_cc_g" >&6; } | |
4660 | if test "$ac_test_CFLAGS" = set; then | |
4661 | CFLAGS=$ac_save_CFLAGS | |
4662 | elif test $ac_cv_prog_cc_g = yes; then | |
4663 | if test "$GCC" = yes; then | |
4664 | CFLAGS="-g -O2" | |
4665 | else | |
4666 | CFLAGS="-g" | |
4667 | fi | |
4668 | else | |
4669 | if test "$GCC" = yes; then | |
4670 | CFLAGS="-O2" | |
4671 | else | |
4672 | CFLAGS= | |
4673 | fi | |
4674 | fi | |
c0c3707f CB |
4675 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 |
4676 | $as_echo_n "checking for $CC option to enable C11 features... " >&6; } | |
4677 | if ${ac_cv_prog_cc_c11+:} false; then : | |
c971b7fa PA |
4678 | $as_echo_n "(cached) " >&6 |
4679 | else | |
c0c3707f | 4680 | ac_cv_prog_cc_c11=no |
c971b7fa PA |
4681 | ac_save_CC=$CC |
4682 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4683 | /* end confdefs.h. */ | |
4684 | #include <stdarg.h> | |
c0c3707f CB |
4685 | #include <stdbool.h> |
4686 | #include <stddef.h> | |
4687 | #include <stdlib.h> | |
4688 | #include <wchar.h> | |
c971b7fa | 4689 | #include <stdio.h> |
c0c3707f CB |
4690 | |
4691 | // Check varargs macros. These examples are taken from C99 6.10.3.5. | |
4692 | #define debug(...) fprintf (stderr, __VA_ARGS__) | |
4693 | #define showlist(...) puts (#__VA_ARGS__) | |
4694 | #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) | |
4695 | static void | |
4696 | test_varargs_macros (void) | |
7a6dbc2f | 4697 | { |
c0c3707f CB |
4698 | int x = 1234; |
4699 | int y = 5678; | |
4700 | debug ("Flag"); | |
4701 | debug ("X = %d\n", x); | |
4702 | showlist (The first, second, and third items.); | |
4703 | report (x>y, "x is %d but y is %d", x, y); | |
c971b7fa | 4704 | } |
c0c3707f CB |
4705 | |
4706 | // Check long long types. | |
4707 | #define BIG64 18446744073709551615ull | |
4708 | #define BIG32 4294967295ul | |
4709 | #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) | |
4710 | #if !BIG_OK | |
4711 | your preprocessor is broken; | |
4712 | #endif | |
4713 | #if BIG_OK | |
4714 | #else | |
4715 | your preprocessor is broken; | |
4716 | #endif | |
4717 | static long long int bignum = -9223372036854775807LL; | |
4718 | static unsigned long long int ubignum = BIG64; | |
4719 | ||
4720 | struct incomplete_array | |
7a6dbc2f | 4721 | { |
c0c3707f CB |
4722 | int datasize; |
4723 | double data[]; | |
4724 | }; | |
4725 | ||
4726 | struct named_init { | |
4727 | int number; | |
4728 | const wchar_t *name; | |
4729 | double average; | |
4730 | }; | |
4731 | ||
4732 | typedef const char *ccp; | |
4733 | ||
4734 | static inline int | |
4735 | test_restrict (ccp restrict text) | |
4736 | { | |
4737 | // See if C++-style comments work. | |
4738 | // Iterate through items via the restricted pointer. | |
4739 | // Also check for declarations in for loops. | |
4740 | for (unsigned int i = 0; *(text+i) != '\0'; ++i) | |
4741 | continue; | |
4742 | return 0; | |
7a6dbc2f | 4743 | } |
7a6dbc2f | 4744 | |
c0c3707f CB |
4745 | // Check varargs and va_copy. |
4746 | static bool | |
4747 | test_varargs (const char *format, ...) | |
4748 | { | |
4749 | va_list args; | |
4750 | va_start (args, format); | |
4751 | va_list args_copy; | |
4752 | va_copy (args_copy, args); | |
7a6dbc2f | 4753 | |
c0c3707f CB |
4754 | const char *str = ""; |
4755 | int number = 0; | |
4756 | float fnumber = 0; | |
4757 | ||
4758 | while (*format) | |
4759 | { | |
4760 | switch (*format++) | |
4761 | { | |
4762 | case 's': // string | |
4763 | str = va_arg (args_copy, const char *); | |
4764 | break; | |
4765 | case 'd': // int | |
4766 | number = va_arg (args_copy, int); | |
4767 | break; | |
4768 | case 'f': // float | |
4769 | fnumber = va_arg (args_copy, double); | |
4770 | break; | |
4771 | default: | |
4772 | break; | |
4773 | } | |
4774 | } | |
4775 | va_end (args_copy); | |
4776 | va_end (args); | |
4777 | ||
4778 | return *str && number && fnumber; | |
4779 | } | |
4780 | // Check _Alignas. | |
4781 | char _Alignas (double) aligned_as_double; | |
4782 | char _Alignas (0) no_special_alignment; | |
4783 | extern char aligned_as_int; | |
4784 | char _Alignas (0) _Alignas (int) aligned_as_int; | |
4785 | ||
4786 | // Check _Alignof. | |
4787 | enum | |
4788 | { | |
4789 | int_alignment = _Alignof (int), | |
4790 | int_array_alignment = _Alignof (int[100]), | |
4791 | char_alignment = _Alignof (char) | |
4792 | }; | |
4793 | _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); | |
4794 | ||
4795 | // Check _Noreturn. | |
4796 | int _Noreturn does_not_return (void) { for (;;) continue; } | |
4797 | ||
4798 | // Check _Static_assert. | |
4799 | struct test_static_assert | |
4800 | { | |
4801 | int x; | |
4802 | _Static_assert (sizeof (int) <= sizeof (long int), | |
4803 | "_Static_assert does not work in struct"); | |
4804 | long int y; | |
4805 | }; | |
4806 | ||
4807 | // Check UTF-8 literals. | |
4808 | #define u8 syntax error! | |
4809 | char const utf8_literal[] = u8"happens to be ASCII" "another string"; | |
4810 | ||
4811 | // Check duplicate typedefs. | |
4812 | typedef long *long_ptr; | |
4813 | typedef long int *long_ptr; | |
4814 | typedef long_ptr long_ptr; | |
4815 | ||
4816 | // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. | |
4817 | struct anonymous | |
4818 | { | |
4819 | union { | |
4820 | struct { int i; int j; }; | |
4821 | struct { int k; long int l; } w; | |
4822 | }; | |
4823 | int m; | |
4824 | } v1; | |
c971b7fa | 4825 | |
c971b7fa PA |
4826 | int |
4827 | main () | |
4828 | { | |
c0c3707f CB |
4829 | |
4830 | // Check bool. | |
4831 | _Bool success = false; | |
4832 | ||
4833 | // Check restrict. | |
4834 | if (test_restrict ("String literal") == 0) | |
4835 | success = true; | |
4836 | char *restrict newvar = "Another string"; | |
4837 | ||
4838 | // Check varargs. | |
4839 | success &= test_varargs ("s, d' f .", "string", 65, 34.234); | |
4840 | test_varargs_macros (); | |
4841 | ||
4842 | // Check flexible array members. | |
4843 | struct incomplete_array *ia = | |
4844 | malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); | |
4845 | ia->datasize = 10; | |
4846 | for (int i = 0; i < ia->datasize; ++i) | |
4847 | ia->data[i] = i * 1.234; | |
4848 | ||
4849 | // Check named initializers. | |
4850 | struct named_init ni = { | |
4851 | .number = 34, | |
4852 | .name = L"Test wide string", | |
4853 | .average = 543.34343, | |
4854 | }; | |
4855 | ||
4856 | ni.number = 58; | |
4857 | ||
4858 | int dynamic_array[ni.number]; | |
4859 | dynamic_array[ni.number - 1] = 543; | |
4860 | ||
4861 | // work around unused variable warnings | |
4862 | return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' | |
4863 | || dynamic_array[ni.number - 1] != 543); | |
4864 | ||
4865 | v1.i = 2; | |
4866 | v1.w.k = 5; | |
4867 | _Static_assert ((offsetof (struct anonymous, i) | |
4868 | == offsetof (struct anonymous, w.k)), | |
4869 | "Anonymous union alignment botch"); | |
4870 | ||
c971b7fa PA |
4871 | ; |
4872 | return 0; | |
4873 | } | |
4874 | _ACEOF | |
c0c3707f | 4875 | for ac_arg in '' -std=gnu11 |
c971b7fa PA |
4876 | do |
4877 | CC="$ac_save_CC $ac_arg" | |
4878 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 4879 | ac_cv_prog_cc_c11=$ac_arg |
c971b7fa PA |
4880 | fi |
4881 | rm -f core conftest.err conftest.$ac_objext | |
c0c3707f | 4882 | test "x$ac_cv_prog_cc_c11" != "xno" && break |
c971b7fa PA |
4883 | done |
4884 | rm -f conftest.$ac_ext | |
4885 | CC=$ac_save_CC | |
4886 | ||
4887 | fi | |
4888 | # AC_CACHE_VAL | |
c0c3707f CB |
4889 | ac_prog_cc_stdc_options= |
4890 | case "x$ac_cv_prog_cc_c11" in | |
c971b7fa PA |
4891 | x) |
4892 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 | |
4893 | $as_echo "none needed" >&6; } ;; | |
4894 | xno) | |
4895 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 | |
4896 | $as_echo "unsupported" >&6; } ;; | |
4897 | *) | |
c0c3707f CB |
4898 | ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c11" |
4899 | CC=$CC$ac_prog_cc_stdc_options | |
4900 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 | |
4901 | $as_echo "$ac_cv_prog_cc_c11" >&6; } ;; | |
c971b7fa | 4902 | esac |
c0c3707f CB |
4903 | if test "x$ac_cv_prog_cc_c11" != xno; then : |
4904 | ac_prog_cc_stdc=c11 | |
4905 | ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 | |
4906 | else | |
4907 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 | |
4908 | $as_echo_n "checking for $CC option to enable C99 features... " >&6; } | |
4909 | if ${ac_cv_prog_cc_c99+:} false; then : | |
4910 | $as_echo_n "(cached) " >&6 | |
4911 | else | |
4912 | ac_cv_prog_cc_c99=no | |
4913 | ac_save_CC=$CC | |
4914 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4915 | /* end confdefs.h. */ | |
4916 | #include <stdarg.h> | |
4917 | #include <stdbool.h> | |
4918 | #include <stddef.h> | |
4919 | #include <stdlib.h> | |
4920 | #include <wchar.h> | |
4921 | #include <stdio.h> | |
7a6dbc2f | 4922 | |
c0c3707f CB |
4923 | // Check varargs macros. These examples are taken from C99 6.10.3.5. |
4924 | #define debug(...) fprintf (stderr, __VA_ARGS__) | |
4925 | #define showlist(...) puts (#__VA_ARGS__) | |
4926 | #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) | |
4927 | static void | |
4928 | test_varargs_macros (void) | |
4929 | { | |
4930 | int x = 1234; | |
4931 | int y = 5678; | |
4932 | debug ("Flag"); | |
4933 | debug ("X = %d\n", x); | |
4934 | showlist (The first, second, and third items.); | |
4935 | report (x>y, "x is %d but y is %d", x, y); | |
4936 | } | |
7a6dbc2f | 4937 | |
c0c3707f CB |
4938 | // Check long long types. |
4939 | #define BIG64 18446744073709551615ull | |
4940 | #define BIG32 4294967295ul | |
4941 | #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) | |
4942 | #if !BIG_OK | |
4943 | your preprocessor is broken; | |
4944 | #endif | |
4945 | #if BIG_OK | |
4946 | #else | |
4947 | your preprocessor is broken; | |
4948 | #endif | |
4949 | static long long int bignum = -9223372036854775807LL; | |
4950 | static unsigned long long int ubignum = BIG64; | |
7a6dbc2f | 4951 | |
c0c3707f CB |
4952 | struct incomplete_array |
4953 | { | |
4954 | int datasize; | |
4955 | double data[]; | |
4956 | }; | |
7a6dbc2f | 4957 | |
c0c3707f CB |
4958 | struct named_init { |
4959 | int number; | |
4960 | const wchar_t *name; | |
4961 | double average; | |
4962 | }; | |
7a6dbc2f | 4963 | |
c0c3707f | 4964 | typedef const char *ccp; |
7a6dbc2f | 4965 | |
c0c3707f CB |
4966 | static inline int |
4967 | test_restrict (ccp restrict text) | |
4968 | { | |
4969 | // See if C++-style comments work. | |
4970 | // Iterate through items via the restricted pointer. | |
4971 | // Also check for declarations in for loops. | |
4972 | for (unsigned int i = 0; *(text+i) != '\0'; ++i) | |
4973 | continue; | |
4974 | return 0; | |
4975 | } | |
7a6dbc2f | 4976 | |
c0c3707f CB |
4977 | // Check varargs and va_copy. |
4978 | static bool | |
4979 | test_varargs (const char *format, ...) | |
4980 | { | |
4981 | va_list args; | |
4982 | va_start (args, format); | |
4983 | va_list args_copy; | |
4984 | va_copy (args_copy, args); | |
4985 | ||
4986 | const char *str = ""; | |
4987 | int number = 0; | |
4988 | float fnumber = 0; | |
4989 | ||
4990 | while (*format) | |
4991 | { | |
4992 | switch (*format++) | |
4993 | { | |
4994 | case 's': // string | |
4995 | str = va_arg (args_copy, const char *); | |
4996 | break; | |
4997 | case 'd': // int | |
4998 | number = va_arg (args_copy, int); | |
4999 | break; | |
5000 | case 'f': // float | |
5001 | fnumber = va_arg (args_copy, double); | |
5002 | break; | |
5003 | default: | |
5004 | break; | |
5005 | } | |
5006 | } | |
5007 | va_end (args_copy); | |
5008 | va_end (args); | |
5009 | ||
5010 | return *str && number && fnumber; | |
5011 | } | |
5012 | int | |
5013 | main () | |
5014 | { | |
5015 | ||
5016 | // Check bool. | |
5017 | _Bool success = false; | |
5018 | ||
5019 | // Check restrict. | |
5020 | if (test_restrict ("String literal") == 0) | |
5021 | success = true; | |
5022 | char *restrict newvar = "Another string"; | |
5023 | ||
5024 | // Check varargs. | |
5025 | success &= test_varargs ("s, d' f .", "string", 65, 34.234); | |
5026 | test_varargs_macros (); | |
5027 | ||
5028 | // Check flexible array members. | |
5029 | struct incomplete_array *ia = | |
5030 | malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); | |
5031 | ia->datasize = 10; | |
5032 | for (int i = 0; i < ia->datasize; ++i) | |
5033 | ia->data[i] = i * 1.234; | |
5034 | ||
5035 | // Check named initializers. | |
5036 | struct named_init ni = { | |
5037 | .number = 34, | |
5038 | .name = L"Test wide string", | |
5039 | .average = 543.34343, | |
5040 | }; | |
5041 | ||
5042 | ni.number = 58; | |
5043 | ||
5044 | int dynamic_array[ni.number]; | |
5045 | dynamic_array[ni.number - 1] = 543; | |
5046 | ||
5047 | // work around unused variable warnings | |
5048 | return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' | |
5049 | || dynamic_array[ni.number - 1] != 543); | |
5050 | ||
5051 | ; | |
5052 | return 0; | |
5053 | } | |
5054 | _ACEOF | |
5055 | for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99 | |
5056 | do | |
5057 | CC="$ac_save_CC $ac_arg" | |
5058 | if ac_fn_c_try_compile "$LINENO"; then : | |
5059 | ac_cv_prog_cc_c99=$ac_arg | |
5060 | fi | |
5061 | rm -f core conftest.err conftest.$ac_objext | |
5062 | test "x$ac_cv_prog_cc_c99" != "xno" && break | |
5063 | done | |
5064 | rm -f conftest.$ac_ext | |
5065 | CC=$ac_save_CC | |
5066 | ||
5067 | fi | |
5068 | # AC_CACHE_VAL | |
5069 | ac_prog_cc_stdc_options= | |
5070 | case "x$ac_cv_prog_cc_c99" in | |
5071 | x) | |
5072 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 | |
5073 | $as_echo "none needed" >&6; } ;; | |
5074 | xno) | |
5075 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 | |
5076 | $as_echo "unsupported" >&6; } ;; | |
5077 | *) | |
5078 | ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c99" | |
5079 | CC=$CC$ac_prog_cc_stdc_options | |
5080 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 | |
5081 | $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; | |
5082 | esac | |
5083 | if test "x$ac_cv_prog_cc_c99" != xno; then : | |
5084 | ac_prog_cc_stdc=c99 | |
5085 | ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 | |
5086 | else | |
5087 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 | |
5088 | $as_echo_n "checking for $CC option to enable C89 features... " >&6; } | |
5089 | if ${ac_cv_prog_cc_c89+:} false; then : | |
d0ac1c44 SM |
5090 | $as_echo_n "(cached) " >&6 |
5091 | else | |
c0c3707f CB |
5092 | ac_cv_prog_cc_c89=no |
5093 | ac_save_CC=$CC | |
5094 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
d0ac1c44 | 5095 | /* end confdefs.h. */ |
c0c3707f CB |
5096 | #include <stdarg.h> |
5097 | #include <stdio.h> | |
5098 | struct stat; | |
5099 | /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ | |
5100 | struct buf { int x; }; | |
5101 | FILE * (*rcsopen) (struct buf *, struct stat *, int); | |
5102 | static char *e (p, i) | |
5103 | char **p; | |
5104 | int i; | |
5105 | { | |
5106 | return p[i]; | |
5107 | } | |
5108 | static char *f (char * (*g) (char **, int), char **p, ...) | |
5109 | { | |
5110 | char *s; | |
5111 | va_list v; | |
5112 | va_start (v,p); | |
5113 | s = g (p, va_arg (v,int)); | |
5114 | va_end (v); | |
5115 | return s; | |
5116 | } | |
5117 | ||
5118 | /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has | |
5119 | function prototypes and stuff, but not '\xHH' hex character constants. | |
5120 | These don't provoke an error unfortunately, instead are silently treated | |
5121 | as 'x'. The following induces an error, until -std is added to get | |
5122 | proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an | |
5123 | array size at least. It's necessary to write '\x00'==0 to get something | |
5124 | that's true only with -std. */ | |
5125 | int osf4_cc_array ['\x00' == 0 ? 1 : -1]; | |
5126 | ||
5127 | /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters | |
5128 | inside strings and character constants. */ | |
5129 | #define FOO(x) 'x' | |
5130 | int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; | |
d0ac1c44 | 5131 | |
c0c3707f CB |
5132 | int test (int i, double x); |
5133 | struct s1 {int (*f) (int a);}; | |
5134 | struct s2 {int (*f) (double a);}; | |
5135 | int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); | |
5136 | int argc; | |
5137 | char **argv; | |
d0ac1c44 SM |
5138 | int |
5139 | main () | |
5140 | { | |
c0c3707f | 5141 | return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; |
d0ac1c44 SM |
5142 | ; |
5143 | return 0; | |
5144 | } | |
5145 | _ACEOF | |
c0c3707f CB |
5146 | for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ |
5147 | -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" | |
5148 | do | |
5149 | CC="$ac_save_CC $ac_arg" | |
5150 | if ac_fn_c_try_compile "$LINENO"; then : | |
5151 | ac_cv_prog_cc_c89=$ac_arg | |
5152 | fi | |
5153 | rm -f core conftest.err conftest.$ac_objext | |
5154 | test "x$ac_cv_prog_cc_c89" != "xno" && break | |
5155 | done | |
5156 | rm -f conftest.$ac_ext | |
5157 | CC=$ac_save_CC | |
5158 | ||
5159 | fi | |
5160 | # AC_CACHE_VAL | |
5161 | ac_prog_cc_stdc_options= | |
5162 | case "x$ac_cv_prog_cc_c89" in | |
5163 | x) | |
5164 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 | |
5165 | $as_echo "none needed" >&6; } ;; | |
5166 | xno) | |
5167 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 | |
5168 | $as_echo "unsupported" >&6; } ;; | |
5169 | *) | |
5170 | ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c89" | |
5171 | CC=$CC$ac_prog_cc_stdc_options | |
5172 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 | |
5173 | $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; | |
5174 | esac | |
5175 | if test "x$ac_cv_prog_cc_c89" != xno; then : | |
5176 | ac_prog_cc_stdc=c89 | |
5177 | ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 | |
5178 | else | |
5179 | ac_prog_cc_stdc=no | |
5180 | ac_cv_prog_cc_stdc=no | |
5181 | fi | |
5182 | ||
5183 | fi | |
5184 | ||
7a6dbc2f | 5185 | fi |
c0c3707f | 5186 | |
d0ac1c44 SM |
5187 | ac_ext=c |
5188 | ac_cpp='$CPP $CPPFLAGS' | |
5189 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
5190 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
5191 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
5192 | ||
5193 | ||
5df4cba6 SM |
5194 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5 |
5195 | $as_echo_n "checking whether the compiler is clang... " >&6; } | |
5196 | if ${gl_cv_compiler_clang+:} false; then : | |
5197 | $as_echo_n "(cached) " >&6 | |
5198 | else | |
5199 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5200 | /* end confdefs.h. */ | |
5201 | ||
5202 | #ifdef __clang__ | |
5203 | barfbarf | |
5204 | #endif | |
5205 | ||
5206 | int | |
5207 | main () | |
5208 | { | |
5209 | ||
5210 | ; | |
5211 | return 0; | |
5212 | } | |
5213 | ||
5214 | _ACEOF | |
5215 | if ac_fn_c_try_compile "$LINENO"; then : | |
5216 | gl_cv_compiler_clang=no | |
5217 | else | |
5218 | gl_cv_compiler_clang=yes | |
5219 | fi | |
5220 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5221 | ||
5222 | fi | |
5223 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_clang" >&5 | |
5224 | $as_echo "$gl_cv_compiler_clang" >&6; } | |
5225 | ||
5226 | ||
5227 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler option needed when checking for declarations" >&5 | |
5228 | $as_echo_n "checking for compiler option needed when checking for declarations... " >&6; } | |
5229 | if ${gl_cv_compiler_check_decl_option+:} false; then : | |
5230 | $as_echo_n "(cached) " >&6 | |
5231 | else | |
5232 | if test $gl_cv_compiler_clang = yes; then | |
5233 | save_ac_compile="$ac_compile" | |
5234 | ac_compile="$ac_compile -Werror=implicit-function-declaration" | |
5235 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5236 | /* end confdefs.h. */ | |
5237 | ||
5238 | int | |
5239 | main () | |
5240 | { | |
5241 | ||
5242 | ; | |
5243 | return 0; | |
5244 | } | |
5245 | _ACEOF | |
5246 | if ac_fn_c_try_compile "$LINENO"; then : | |
5247 | gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration' | |
5248 | else | |
5249 | gl_cv_compiler_check_decl_option=none | |
5250 | fi | |
5251 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5252 | ac_compile="$save_ac_compile" | |
5253 | else | |
5254 | gl_cv_compiler_check_decl_option=none | |
5255 | fi | |
5256 | ||
5257 | fi | |
5258 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_check_decl_option" >&5 | |
5259 | $as_echo "$gl_cv_compiler_check_decl_option" >&6; } | |
5260 | if test "x$gl_cv_compiler_check_decl_option" != xnone; then | |
5261 | ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option" | |
5262 | else | |
5263 | ac_compile_for_check_decl="$ac_compile" | |
5264 | fi | |
5265 | ||
5266 | ||
5267 | ||
9c9d63b1 | 5268 | |
c971b7fa PA |
5269 | ac_ext=c |
5270 | ac_cpp='$CPP $CPPFLAGS' | |
5271 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
5272 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
5273 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
5274 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 | |
5275 | $as_echo_n "checking how to run the C preprocessor... " >&6; } | |
5276 | # On Suns, sometimes $CPP names a directory. | |
5277 | if test -n "$CPP" && test -d "$CPP"; then | |
5278 | CPP= | |
5279 | fi | |
5280 | if test -z "$CPP"; then | |
d0ac1c44 | 5281 | if ${ac_cv_prog_CPP+:} false; then : |
c971b7fa PA |
5282 | $as_echo_n "(cached) " >&6 |
5283 | else | |
5284 | # Double quotes because CPP needs to be expanded | |
5285 | for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" | |
5286 | do | |
5287 | ac_preproc_ok=false | |
5288 | for ac_c_preproc_warn_flag in '' yes | |
5289 | do | |
5290 | # Use a header file that comes with gcc, so configuring glibc | |
5291 | # with a fresh cross-compiler works. | |
5292 | # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since | |
5293 | # <limits.h> exists even on freestanding compilers. | |
5294 | # On the NeXT, cc -E runs the code through the compiler's parser, | |
5295 | # not just through cpp. "Syntax error" is here to catch this case. | |
5296 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5297 | /* end confdefs.h. */ | |
5298 | #ifdef __STDC__ | |
5299 | # include <limits.h> | |
5300 | #else | |
5301 | # include <assert.h> | |
5302 | #endif | |
5303 | Syntax error | |
5304 | _ACEOF | |
5305 | if ac_fn_c_try_cpp "$LINENO"; then : | |
5306 | ||
5307 | else | |
5308 | # Broken: fails on valid input. | |
5309 | continue | |
5310 | fi | |
d0ac1c44 | 5311 | rm -f conftest.err conftest.i conftest.$ac_ext |
c971b7fa PA |
5312 | |
5313 | # OK, works on sane cases. Now check whether nonexistent headers | |
5314 | # can be detected and how. | |
5315 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5316 | /* end confdefs.h. */ | |
5317 | #include <ac_nonexistent.h> | |
5318 | _ACEOF | |
5319 | if ac_fn_c_try_cpp "$LINENO"; then : | |
5320 | # Broken: success on invalid input. | |
5321 | continue | |
5322 | else | |
5323 | # Passes both tests. | |
5324 | ac_preproc_ok=: | |
5325 | break | |
5326 | fi | |
d0ac1c44 | 5327 | rm -f conftest.err conftest.i conftest.$ac_ext |
c971b7fa PA |
5328 | |
5329 | done | |
5330 | # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. | |
d0ac1c44 | 5331 | rm -f conftest.i conftest.err conftest.$ac_ext |
c971b7fa PA |
5332 | if $ac_preproc_ok; then : |
5333 | break | |
5334 | fi | |
5335 | ||
5336 | done | |
5337 | ac_cv_prog_CPP=$CPP | |
5338 | ||
5339 | fi | |
5340 | CPP=$ac_cv_prog_CPP | |
5341 | else | |
5342 | ac_cv_prog_CPP=$CPP | |
5343 | fi | |
5344 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 | |
5345 | $as_echo "$CPP" >&6; } | |
5346 | ac_preproc_ok=false | |
5347 | for ac_c_preproc_warn_flag in '' yes | |
5348 | do | |
5349 | # Use a header file that comes with gcc, so configuring glibc | |
5350 | # with a fresh cross-compiler works. | |
5351 | # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since | |
5352 | # <limits.h> exists even on freestanding compilers. | |
5353 | # On the NeXT, cc -E runs the code through the compiler's parser, | |
5354 | # not just through cpp. "Syntax error" is here to catch this case. | |
5355 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5356 | /* end confdefs.h. */ | |
5357 | #ifdef __STDC__ | |
5358 | # include <limits.h> | |
5359 | #else | |
5360 | # include <assert.h> | |
5361 | #endif | |
5362 | Syntax error | |
5363 | _ACEOF | |
5364 | if ac_fn_c_try_cpp "$LINENO"; then : | |
5365 | ||
5366 | else | |
5367 | # Broken: fails on valid input. | |
5368 | continue | |
5369 | fi | |
d0ac1c44 | 5370 | rm -f conftest.err conftest.i conftest.$ac_ext |
c971b7fa PA |
5371 | |
5372 | # OK, works on sane cases. Now check whether nonexistent headers | |
5373 | # can be detected and how. | |
5374 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5375 | /* end confdefs.h. */ | |
5376 | #include <ac_nonexistent.h> | |
5377 | _ACEOF | |
5378 | if ac_fn_c_try_cpp "$LINENO"; then : | |
5379 | # Broken: success on invalid input. | |
5380 | continue | |
5381 | else | |
5382 | # Passes both tests. | |
5383 | ac_preproc_ok=: | |
5384 | break | |
5385 | fi | |
d0ac1c44 | 5386 | rm -f conftest.err conftest.i conftest.$ac_ext |
c971b7fa PA |
5387 | |
5388 | done | |
5389 | # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. | |
d0ac1c44 | 5390 | rm -f conftest.i conftest.err conftest.$ac_ext |
c971b7fa PA |
5391 | if $ac_preproc_ok; then : |
5392 | ||
5393 | else | |
5394 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
5395 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
d0ac1c44 SM |
5396 | as_fn_error $? "C preprocessor \"$CPP\" fails sanity check |
5397 | See \`config.log' for more details" "$LINENO" 5; } | |
c971b7fa PA |
5398 | fi |
5399 | ||
5400 | ac_ext=c | |
5401 | ac_cpp='$CPP $CPPFLAGS' | |
5402 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
5403 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
5404 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
5405 | ||
5406 | ||
5407 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 | |
5408 | $as_echo_n "checking for grep that handles long lines and -e... " >&6; } | |
d0ac1c44 | 5409 | if ${ac_cv_path_GREP+:} false; then : |
c971b7fa PA |
5410 | $as_echo_n "(cached) " >&6 |
5411 | else | |
5412 | if test -z "$GREP"; then | |
5413 | ac_path_GREP_found=false | |
5414 | # Loop through the user's path and test for each of PROGNAME-LIST | |
5415 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
5416 | for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin | |
5417 | do | |
5418 | IFS=$as_save_IFS | |
5419 | test -z "$as_dir" && as_dir=. | |
5420 | for ac_prog in grep ggrep; do | |
5421 | for ac_exec_ext in '' $ac_executable_extensions; do | |
5422 | ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" | |
d0ac1c44 | 5423 | as_fn_executable_p "$ac_path_GREP" || continue |
c971b7fa PA |
5424 | # Check for GNU ac_path_GREP and select it if it is found. |
5425 | # Check for GNU $ac_path_GREP | |
5426 | case `"$ac_path_GREP" --version 2>&1` in | |
5427 | *GNU*) | |
5428 | ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; | |
5429 | *) | |
5430 | ac_count=0 | |
5431 | $as_echo_n 0123456789 >"conftest.in" | |
5432 | while : | |
5433 | do | |
5434 | cat "conftest.in" "conftest.in" >"conftest.tmp" | |
5435 | mv "conftest.tmp" "conftest.in" | |
5436 | cp "conftest.in" "conftest.nl" | |
5437 | $as_echo 'GREP' >> "conftest.nl" | |
5438 | "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break | |
5439 | diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break | |
5440 | as_fn_arith $ac_count + 1 && ac_count=$as_val | |
5441 | if test $ac_count -gt ${ac_path_GREP_max-0}; then | |
5442 | # Best one so far, save it but keep looking for a better one | |
5443 | ac_cv_path_GREP="$ac_path_GREP" | |
5444 | ac_path_GREP_max=$ac_count | |
5445 | fi | |
5446 | # 10*(2^10) chars as input seems more than enough | |
5447 | test $ac_count -gt 10 && break | |
5448 | done | |
5449 | rm -f conftest.in conftest.tmp conftest.nl conftest.out;; | |
5450 | esac | |
5451 | ||
5452 | $ac_path_GREP_found && break 3 | |
5453 | done | |
5454 | done | |
5455 | done | |
5456 | IFS=$as_save_IFS | |
5457 | if test -z "$ac_cv_path_GREP"; then | |
d0ac1c44 | 5458 | as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 |
c971b7fa PA |
5459 | fi |
5460 | else | |
5461 | ac_cv_path_GREP=$GREP | |
5462 | fi | |
5463 | ||
5464 | fi | |
5465 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 | |
5466 | $as_echo "$ac_cv_path_GREP" >&6; } | |
5467 | GREP="$ac_cv_path_GREP" | |
5468 | ||
5469 | ||
5470 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 | |
5471 | $as_echo_n "checking for egrep... " >&6; } | |
d0ac1c44 | 5472 | if ${ac_cv_path_EGREP+:} false; then : |
c971b7fa PA |
5473 | $as_echo_n "(cached) " >&6 |
5474 | else | |
5475 | if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 | |
5476 | then ac_cv_path_EGREP="$GREP -E" | |
5477 | else | |
5478 | if test -z "$EGREP"; then | |
5479 | ac_path_EGREP_found=false | |
5480 | # Loop through the user's path and test for each of PROGNAME-LIST | |
5481 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
5482 | for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin | |
5483 | do | |
5484 | IFS=$as_save_IFS | |
5485 | test -z "$as_dir" && as_dir=. | |
5486 | for ac_prog in egrep; do | |
5487 | for ac_exec_ext in '' $ac_executable_extensions; do | |
5488 | ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" | |
d0ac1c44 | 5489 | as_fn_executable_p "$ac_path_EGREP" || continue |
c971b7fa PA |
5490 | # Check for GNU ac_path_EGREP and select it if it is found. |
5491 | # Check for GNU $ac_path_EGREP | |
5492 | case `"$ac_path_EGREP" --version 2>&1` in | |
5493 | *GNU*) | |
5494 | ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; | |
5495 | *) | |
5496 | ac_count=0 | |
5497 | $as_echo_n 0123456789 >"conftest.in" | |
5498 | while : | |
5499 | do | |
5500 | cat "conftest.in" "conftest.in" >"conftest.tmp" | |
5501 | mv "conftest.tmp" "conftest.in" | |
5502 | cp "conftest.in" "conftest.nl" | |
5503 | $as_echo 'EGREP' >> "conftest.nl" | |
5504 | "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break | |
5505 | diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break | |
5506 | as_fn_arith $ac_count + 1 && ac_count=$as_val | |
5507 | if test $ac_count -gt ${ac_path_EGREP_max-0}; then | |
5508 | # Best one so far, save it but keep looking for a better one | |
5509 | ac_cv_path_EGREP="$ac_path_EGREP" | |
5510 | ac_path_EGREP_max=$ac_count | |
5511 | fi | |
5512 | # 10*(2^10) chars as input seems more than enough | |
5513 | test $ac_count -gt 10 && break | |
5514 | done | |
5515 | rm -f conftest.in conftest.tmp conftest.nl conftest.out;; | |
5516 | esac | |
5517 | ||
5518 | $ac_path_EGREP_found && break 3 | |
5519 | done | |
5520 | done | |
5521 | done | |
5522 | IFS=$as_save_IFS | |
5523 | if test -z "$ac_cv_path_EGREP"; then | |
d0ac1c44 | 5524 | as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 |
c971b7fa PA |
5525 | fi |
5526 | else | |
5527 | ac_cv_path_EGREP=$EGREP | |
5528 | fi | |
5529 | ||
5530 | fi | |
5531 | fi | |
5532 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 | |
5533 | $as_echo "$ac_cv_path_EGREP" >&6; } | |
5534 | EGREP="$ac_cv_path_EGREP" | |
5535 | ||
5536 | ||
5537 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 | |
5538 | $as_echo_n "checking for ANSI C header files... " >&6; } | |
d0ac1c44 | 5539 | if ${ac_cv_header_stdc+:} false; then : |
c971b7fa PA |
5540 | $as_echo_n "(cached) " >&6 |
5541 | else | |
5542 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5543 | /* end confdefs.h. */ | |
5544 | #include <stdlib.h> | |
5545 | #include <stdarg.h> | |
5546 | #include <string.h> | |
5547 | #include <float.h> | |
5548 | ||
5549 | int | |
5550 | main () | |
5551 | { | |
5552 | ||
5553 | ; | |
5554 | return 0; | |
5555 | } | |
5556 | _ACEOF | |
5557 | if ac_fn_c_try_compile "$LINENO"; then : | |
5558 | ac_cv_header_stdc=yes | |
5559 | else | |
5560 | ac_cv_header_stdc=no | |
5561 | fi | |
5562 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5563 | ||
5564 | if test $ac_cv_header_stdc = yes; then | |
5565 | # SunOS 4.x string.h does not declare mem*, contrary to ANSI. | |
5566 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5567 | /* end confdefs.h. */ | |
5568 | #include <string.h> | |
5569 | ||
5570 | _ACEOF | |
5571 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
5572 | $EGREP "memchr" >/dev/null 2>&1; then : | |
5573 | ||
5574 | else | |
5575 | ac_cv_header_stdc=no | |
5576 | fi | |
5577 | rm -f conftest* | |
5578 | ||
5579 | fi | |
5580 | ||
5581 | if test $ac_cv_header_stdc = yes; then | |
5582 | # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. | |
5583 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5584 | /* end confdefs.h. */ | |
5585 | #include <stdlib.h> | |
5586 | ||
5587 | _ACEOF | |
5588 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
5589 | $EGREP "free" >/dev/null 2>&1; then : | |
5590 | ||
5591 | else | |
5592 | ac_cv_header_stdc=no | |
5593 | fi | |
5594 | rm -f conftest* | |
5595 | ||
5596 | fi | |
5597 | ||
5598 | if test $ac_cv_header_stdc = yes; then | |
5599 | # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. | |
5600 | if test "$cross_compiling" = yes; then : | |
5601 | : | |
5602 | else | |
5603 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5604 | /* end confdefs.h. */ | |
5605 | #include <ctype.h> | |
5606 | #include <stdlib.h> | |
5607 | #if ((' ' & 0x0FF) == 0x020) | |
5608 | # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') | |
5609 | # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) | |
5610 | #else | |
5611 | # define ISLOWER(c) \ | |
5612 | (('a' <= (c) && (c) <= 'i') \ | |
5613 | || ('j' <= (c) && (c) <= 'r') \ | |
5614 | || ('s' <= (c) && (c) <= 'z')) | |
5615 | # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) | |
5616 | #endif | |
5617 | ||
5618 | #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) | |
5619 | int | |
5620 | main () | |
5621 | { | |
5622 | int i; | |
5623 | for (i = 0; i < 256; i++) | |
5624 | if (XOR (islower (i), ISLOWER (i)) | |
5625 | || toupper (i) != TOUPPER (i)) | |
5626 | return 2; | |
5627 | return 0; | |
5628 | } | |
5629 | _ACEOF | |
5630 | if ac_fn_c_try_run "$LINENO"; then : | |
5631 | ||
5632 | else | |
5633 | ac_cv_header_stdc=no | |
5634 | fi | |
5635 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
5636 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
5637 | fi | |
5638 | ||
5639 | fi | |
5640 | fi | |
5641 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 | |
5642 | $as_echo "$ac_cv_header_stdc" >&6; } | |
5643 | if test $ac_cv_header_stdc = yes; then | |
5644 | ||
5645 | $as_echo "#define STDC_HEADERS 1" >>confdefs.h | |
5646 | ||
5647 | fi | |
5648 | ||
5649 | # On IRIX 5.3, sys/types and inttypes.h are conflicting. | |
5650 | for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ | |
5651 | inttypes.h stdint.h unistd.h | |
5652 | do : | |
5653 | as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` | |
5654 | ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default | |
5655 | " | |
d0ac1c44 | 5656 | if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : |
c971b7fa PA |
5657 | cat >>confdefs.h <<_ACEOF |
5658 | #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 | |
5659 | _ACEOF | |
5660 | ||
5661 | fi | |
5662 | ||
5663 | done | |
5664 | ||
5665 | ||
5666 | ||
c971b7fa PA |
5667 | |
5668 | ||
9c9d63b1 PM |
5669 | for ac_header in $ac_header_list |
5670 | do : | |
5671 | as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` | |
5672 | ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default | |
5673 | " | |
5674 | if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : | |
5675 | cat >>confdefs.h <<_ACEOF | |
5676 | #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 | |
5677 | _ACEOF | |
c971b7fa | 5678 | |
9c9d63b1 PM |
5679 | fi |
5680 | ||
5681 | done | |
c971b7fa PA |
5682 | |
5683 | ||
c971b7fa PA |
5684 | |
5685 | ||
c971b7fa | 5686 | |
c971b7fa | 5687 | |
c971b7fa | 5688 | |
c971b7fa PA |
5689 | |
5690 | ||
5691 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 | |
5692 | $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } | |
d0ac1c44 | 5693 | if ${ac_cv_safe_to_define___extensions__+:} false; then : |
c971b7fa PA |
5694 | $as_echo_n "(cached) " >&6 |
5695 | else | |
5696 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5697 | /* end confdefs.h. */ | |
5698 | ||
5699 | # define __EXTENSIONS__ 1 | |
5700 | $ac_includes_default | |
5701 | int | |
5702 | main () | |
5703 | { | |
5704 | ||
5705 | ; | |
5706 | return 0; | |
5707 | } | |
5708 | _ACEOF | |
5709 | if ac_fn_c_try_compile "$LINENO"; then : | |
5710 | ac_cv_safe_to_define___extensions__=yes | |
5711 | else | |
5712 | ac_cv_safe_to_define___extensions__=no | |
5713 | fi | |
5714 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5715 | fi | |
5716 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 | |
5717 | $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } | |
c971b7fa | 5718 | |
4a626d0a PA |
5719 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 |
5720 | $as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; } | |
d0ac1c44 | 5721 | if ${ac_cv_should_define__xopen_source+:} false; then : |
4a626d0a PA |
5722 | $as_echo_n "(cached) " >&6 |
5723 | else | |
5724 | ac_cv_should_define__xopen_source=no | |
9c9d63b1 PM |
5725 | if test $ac_cv_header_wchar_h = yes; then : |
5726 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4a626d0a PA |
5727 | /* end confdefs.h. */ |
5728 | ||
5729 | #include <wchar.h> | |
5730 | mbstate_t x; | |
5731 | int | |
5732 | main () | |
5733 | { | |
5734 | ||
5735 | ; | |
5736 | return 0; | |
5737 | } | |
5738 | _ACEOF | |
5739 | if ac_fn_c_try_compile "$LINENO"; then : | |
5740 | ||
5741 | else | |
5742 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5743 | /* end confdefs.h. */ | |
5744 | ||
9c9d63b1 PM |
5745 | #define _XOPEN_SOURCE 500 |
5746 | #include <wchar.h> | |
5747 | mbstate_t x; | |
4a626d0a PA |
5748 | int |
5749 | main () | |
5750 | { | |
5751 | ||
5752 | ; | |
5753 | return 0; | |
5754 | } | |
5755 | _ACEOF | |
5756 | if ac_fn_c_try_compile "$LINENO"; then : | |
5757 | ac_cv_should_define__xopen_source=yes | |
5758 | fi | |
d0ac1c44 SM |
5759 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
5760 | fi | |
5761 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5762 | fi | |
9c9d63b1 | 5763 | fi |
d0ac1c44 SM |
5764 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 |
5765 | $as_echo "$ac_cv_should_define__xopen_source" >&6; } | |
9c9d63b1 PM |
5766 | |
5767 | $as_echo "#define _ALL_SOURCE 1" >>confdefs.h | |
5768 | ||
5769 | $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h | |
5770 | ||
5771 | $as_echo "#define _GNU_SOURCE 1" >>confdefs.h | |
d0ac1c44 | 5772 | |
c0c3707f CB |
5773 | $as_echo "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h |
5774 | ||
9c9d63b1 PM |
5775 | $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h |
5776 | ||
5777 | $as_echo "#define _OPENBSD_SOURCE 1" >>confdefs.h | |
5778 | ||
5779 | $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h | |
5780 | ||
5781 | $as_echo "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h | |
5782 | ||
5783 | $as_echo "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h | |
5784 | ||
5785 | $as_echo "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h | |
5786 | ||
5787 | $as_echo "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h | |
5788 | ||
5789 | $as_echo "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h | |
5790 | ||
5791 | $as_echo "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h | |
5792 | ||
5793 | $as_echo "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h | |
5794 | ||
5795 | $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h | |
5796 | ||
5797 | if test $ac_cv_header_minix_config_h = yes; then : | |
5798 | MINIX=yes | |
5799 | $as_echo "#define _MINIX 1" >>confdefs.h | |
5800 | ||
5801 | $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h | |
5802 | ||
5803 | $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h | |
5804 | ||
5805 | else | |
5806 | MINIX= | |
5807 | fi | |
5808 | if test $ac_cv_safe_to_define___extensions__ = yes; then : | |
5809 | $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h | |
5810 | ||
5811 | fi | |
5812 | if test $ac_cv_should_define__xopen_source = yes; then : | |
5813 | $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h | |
5814 | ||
5815 | fi | |
d0ac1c44 | 5816 | |
c8693053 RO |
5817 | # Needs to run before gl_EARLY so it can override AC_SYS_LARGEFILE included |
5818 | # there. | |
c0c3707f CB |
5819 | ac_aux_dir= |
5820 | for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do | |
5821 | if test -f "$ac_dir/install-sh"; then | |
5822 | ac_aux_dir=$ac_dir | |
5823 | ac_install_sh="$ac_aux_dir/install-sh -c" | |
5824 | break | |
5825 | elif test -f "$ac_dir/install.sh"; then | |
5826 | ac_aux_dir=$ac_dir | |
5827 | ac_install_sh="$ac_aux_dir/install.sh -c" | |
5828 | break | |
5829 | elif test -f "$ac_dir/shtool"; then | |
5830 | ac_aux_dir=$ac_dir | |
5831 | ac_install_sh="$ac_aux_dir/shtool install -c" | |
5832 | break | |
5833 | fi | |
5834 | done | |
5835 | if test -z "$ac_aux_dir"; then | |
5836 | as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 | |
5837 | fi | |
5838 | ||
5839 | # These three variables are undocumented and unsupported, | |
5840 | # and are intended to be withdrawn in a future Autoconf release. | |
5841 | # They can cause serious problems if a builder's source tree is in a directory | |
5842 | # whose full name contains unusual characters. | |
5843 | ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. | |
5844 | ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. | |
5845 | ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. | |
5846 | ||
5847 | ||
4a626d0a PA |
5848 | # Make sure we can run config.sub. |
5849 | $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || | |
d0ac1c44 | 5850 | as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 |
4a626d0a PA |
5851 | |
5852 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 | |
5853 | $as_echo_n "checking build system type... " >&6; } | |
d0ac1c44 | 5854 | if ${ac_cv_build+:} false; then : |
4a626d0a PA |
5855 | $as_echo_n "(cached) " >&6 |
5856 | else | |
5857 | ac_build_alias=$build_alias | |
5858 | test "x$ac_build_alias" = x && | |
5859 | ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` | |
5860 | test "x$ac_build_alias" = x && | |
d0ac1c44 | 5861 | as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 |
4a626d0a | 5862 | ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || |
d0ac1c44 | 5863 | as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 |
4a626d0a PA |
5864 | |
5865 | fi | |
5866 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 | |
5867 | $as_echo "$ac_cv_build" >&6; } | |
5868 | case $ac_cv_build in | |
5869 | *-*-*) ;; | |
d0ac1c44 | 5870 | *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; |
4a626d0a PA |
5871 | esac |
5872 | build=$ac_cv_build | |
5873 | ac_save_IFS=$IFS; IFS='-' | |
5874 | set x $ac_cv_build | |
5875 | shift | |
5876 | build_cpu=$1 | |
5877 | build_vendor=$2 | |
5878 | shift; shift | |
5879 | # Remember, the first character of IFS is used to create $*, | |
5880 | # except with old shells: | |
5881 | build_os=$* | |
5882 | IFS=$ac_save_IFS | |
5883 | case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac | |
5884 | ||
5885 | ||
5886 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 | |
5887 | $as_echo_n "checking host system type... " >&6; } | |
d0ac1c44 | 5888 | if ${ac_cv_host+:} false; then : |
4a626d0a PA |
5889 | $as_echo_n "(cached) " >&6 |
5890 | else | |
5891 | if test "x$host_alias" = x; then | |
5892 | ac_cv_host=$ac_cv_build | |
5893 | else | |
5894 | ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || | |
d0ac1c44 | 5895 | as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 |
4a626d0a PA |
5896 | fi |
5897 | ||
5898 | fi | |
5899 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 | |
5900 | $as_echo "$ac_cv_host" >&6; } | |
5901 | case $ac_cv_host in | |
5902 | *-*-*) ;; | |
d0ac1c44 | 5903 | *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; |
4a626d0a PA |
5904 | esac |
5905 | host=$ac_cv_host | |
5906 | ac_save_IFS=$IFS; IFS='-' | |
5907 | set x $ac_cv_host | |
5908 | shift | |
5909 | host_cpu=$1 | |
5910 | host_vendor=$2 | |
5911 | shift; shift | |
5912 | # Remember, the first character of IFS is used to create $*, | |
5913 | # except with old shells: | |
5914 | host_os=$* | |
5915 | IFS=$ac_save_IFS | |
5916 | case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac | |
5917 | ||
5918 | ||
c8693053 RO |
5919 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 |
5920 | $as_echo_n "checking target system type... " >&6; } | |
5921 | if ${ac_cv_target+:} false; then : | |
5922 | $as_echo_n "(cached) " >&6 | |
5923 | else | |
5924 | if test "x$target_alias" = x; then | |
5925 | ac_cv_target=$ac_cv_host | |
5926 | else | |
5927 | ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || | |
5928 | as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 | |
5929 | fi | |
c971b7fa | 5930 | |
c8693053 RO |
5931 | fi |
5932 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 | |
5933 | $as_echo "$ac_cv_target" >&6; } | |
5934 | case $ac_cv_target in | |
5935 | *-*-*) ;; | |
5936 | *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; | |
5937 | esac | |
5938 | target=$ac_cv_target | |
5939 | ac_save_IFS=$IFS; IFS='-' | |
5940 | set x $ac_cv_target | |
5941 | shift | |
5942 | target_cpu=$1 | |
5943 | target_vendor=$2 | |
5944 | shift; shift | |
5945 | # Remember, the first character of IFS is used to create $*, | |
5946 | # except with old shells: | |
5947 | target_os=$* | |
5948 | IFS=$ac_save_IFS | |
5949 | case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac | |
c971b7fa | 5950 | |
88b48903 | 5951 | |
c8693053 RO |
5952 | # The aliases save the names the user supplied, while $host etc. |
5953 | # will get canonicalized. | |
5954 | test -n "$target_alias" && | |
5955 | test "$program_prefix$program_suffix$program_transform_name" = \ | |
5956 | NONENONEs,x,x, && | |
5957 | program_prefix=${target_alias}- | |
5958 | ||
5959 | # The tests for host and target for $enable_largefile require | |
5960 | # canonical names. | |
5961 | ||
5962 | ||
5963 | ||
5964 | # As the $enable_largefile decision depends on --enable-plugins we must set it | |
5965 | # even in directories otherwise not depending on the $plugins option. | |
5966 | ||
5967 | ||
5968 | maybe_plugins=no | |
5969 | for ac_header in dlfcn.h | |
5970 | do : | |
5971 | ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default | |
5972 | " | |
5973 | if test "x$ac_cv_header_dlfcn_h" = xyes; then : | |
5974 | cat >>confdefs.h <<_ACEOF | |
5975 | #define HAVE_DLFCN_H 1 | |
5976 | _ACEOF | |
5977 | maybe_plugins=yes | |
5978 | fi | |
5979 | ||
5980 | done | |
5981 | ||
5982 | for ac_header in windows.h | |
5983 | do : | |
5984 | ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default | |
5985 | " | |
5986 | if test "x$ac_cv_header_windows_h" = xyes; then : | |
5987 | cat >>confdefs.h <<_ACEOF | |
5988 | #define HAVE_WINDOWS_H 1 | |
5989 | _ACEOF | |
5990 | maybe_plugins=yes | |
5991 | fi | |
5992 | ||
5993 | done | |
5994 | ||
5995 | ||
5996 | # Check whether --enable-plugins was given. | |
5997 | if test "${enable_plugins+set}" = set; then : | |
5998 | enableval=$enable_plugins; case "${enableval}" in | |
5999 | no) plugins=no ;; | |
6000 | *) plugins=yes | |
6001 | if test "$maybe_plugins" != "yes" ; then | |
6002 | as_fn_error $? "Building with plugin support requires a host that supports dlopen." "$LINENO" 5 | |
6003 | fi ;; | |
6004 | esac | |
6005 | else | |
6006 | plugins=$maybe_plugins | |
6007 | ||
6008 | fi | |
6009 | ||
6010 | if test "$plugins" = "yes"; then | |
6011 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlsym" >&5 | |
6012 | $as_echo_n "checking for library containing dlsym... " >&6; } | |
6013 | if ${ac_cv_search_dlsym+:} false; then : | |
6014 | $as_echo_n "(cached) " >&6 | |
6015 | else | |
6016 | ac_func_search_save_LIBS=$LIBS | |
6017 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6018 | /* end confdefs.h. */ | |
6019 | ||
6020 | /* Override any GCC internal prototype to avoid an error. | |
6021 | Use char because int might match the return type of a GCC | |
6022 | builtin and then its argument prototype would still apply. */ | |
6023 | #ifdef __cplusplus | |
6024 | extern "C" | |
6025 | #endif | |
6026 | char dlsym (); | |
6027 | int | |
6028 | main () | |
6029 | { | |
6030 | return dlsym (); | |
6031 | ; | |
6032 | return 0; | |
6033 | } | |
6034 | _ACEOF | |
6035 | for ac_lib in '' dl; do | |
6036 | if test -z "$ac_lib"; then | |
6037 | ac_res="none required" | |
6038 | else | |
6039 | ac_res=-l$ac_lib | |
6040 | LIBS="-l$ac_lib $ac_func_search_save_LIBS" | |
6041 | fi | |
6042 | if ac_fn_c_try_link "$LINENO"; then : | |
6043 | ac_cv_search_dlsym=$ac_res | |
6044 | fi | |
6045 | rm -f core conftest.err conftest.$ac_objext \ | |
6046 | conftest$ac_exeext | |
6047 | if ${ac_cv_search_dlsym+:} false; then : | |
6048 | break | |
6049 | fi | |
6050 | done | |
6051 | if ${ac_cv_search_dlsym+:} false; then : | |
6052 | ||
6053 | else | |
6054 | ac_cv_search_dlsym=no | |
6055 | fi | |
6056 | rm conftest.$ac_ext | |
6057 | LIBS=$ac_func_search_save_LIBS | |
6058 | fi | |
6059 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlsym" >&5 | |
6060 | $as_echo "$ac_cv_search_dlsym" >&6; } | |
6061 | ac_res=$ac_cv_search_dlsym | |
6062 | if test "$ac_res" != no; then : | |
6063 | test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" | |
6064 | ||
6065 | fi | |
6066 | ||
6067 | fi | |
6068 | ||
6069 | ||
6070 | case "${host}" in | |
6071 | sparc-*-solaris*|i?86-*-solaris*) | |
6072 | # On native 32-bit Solaris/SPARC and x86, large-file and procfs support | |
6073 | # were mutually exclusive until Solaris 11.3. Without procfs support, | |
6074 | # the bfd/ elf module cannot provide certain routines such as | |
6075 | # elfcore_write_prpsinfo or elfcore_write_prstatus. So unless the user | |
6076 | # explicitly requested large-file support through the | |
6077 | # --enable-largefile switch, disable large-file support in favor of | |
6078 | # procfs support. | |
6079 | # | |
6080 | # Check if <sys/procfs.h> is incompatible with large-file support. | |
6081 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6082 | /* end confdefs.h. */ | |
6083 | #define _FILE_OFFSET_BITS 64 | |
6084 | #define _STRUCTURED_PROC 1 | |
6085 | #include <sys/procfs.h> | |
6086 | int | |
6087 | main () | |
6088 | { | |
6089 | ||
6090 | ; | |
6091 | return 0; | |
6092 | } | |
6093 | _ACEOF | |
6094 | if ac_fn_c_try_compile "$LINENO"; then : | |
6095 | acx_cv_procfs_lfs=yes | |
6096 | else | |
6097 | acx_cv_procfs_lfs=no | |
6098 | fi | |
6099 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6100 | # | |
6101 | # Forcefully disable large-file support only if necessary, gdb is in | |
6102 | # tree and enabled. | |
6103 | if test "${target}" = "${host}" -a "$acx_cv_procfs_lfs" = no \ | |
6104 | -a -d $srcdir/../gdb -a "$enable_gdb" != no; then | |
6105 | : ${enable_largefile="no"} | |
6106 | if test "$plugins" = yes; then | |
6107 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: | |
6108 | plugin support disabled; require large-file support which is incompatible with GDB." >&5 | |
6109 | $as_echo "$as_me: WARNING: | |
6110 | plugin support disabled; require large-file support which is incompatible with GDB." >&2;} | |
6111 | plugins=no | |
88b48903 | 6112 | fi |
c8693053 RO |
6113 | fi |
6114 | # | |
6115 | # Explicitly undef _FILE_OFFSET_BITS if enable_largefile=no for the | |
6116 | # benefit of g++ 9+ which predefines it on Solaris. | |
6117 | if test "$enable_largefile" = no; then | |
6118 | LARGEFILE_CPPFLAGS="-U_FILE_OFFSET_BITS" | |
6119 | ||
6120 | fi | |
6121 | ;; | |
6122 | esac | |
88b48903 | 6123 | |
2196f55f YQ |
6124 | # Check whether --enable-largefile was given. |
6125 | if test "${enable_largefile+set}" = set; then : | |
6126 | enableval=$enable_largefile; | |
6127 | fi | |
6128 | ||
6129 | if test "$enable_largefile" != no; then | |
6130 | ||
6131 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 | |
6132 | $as_echo_n "checking for special C compiler options needed for large files... " >&6; } | |
d0ac1c44 | 6133 | if ${ac_cv_sys_largefile_CC+:} false; then : |
2196f55f YQ |
6134 | $as_echo_n "(cached) " >&6 |
6135 | else | |
6136 | ac_cv_sys_largefile_CC=no | |
6137 | if test "$GCC" != yes; then | |
6138 | ac_save_CC=$CC | |
6139 | while :; do | |
6140 | # IRIX 6.2 and later do not support large files by default, | |
6141 | # so use the C compiler's -n32 option if that helps. | |
6142 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6143 | /* end confdefs.h. */ | |
6144 | #include <sys/types.h> | |
6145 | /* Check that off_t can represent 2**63 - 1 correctly. | |
6146 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | |
6147 | since some C++ compilers masquerading as C compilers | |
6148 | incorrectly reject 9223372036854775807. */ | |
9c9d63b1 | 6149 | #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) |
2196f55f YQ |
6150 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 |
6151 | && LARGE_OFF_T % 2147483647 == 1) | |
6152 | ? 1 : -1]; | |
6153 | int | |
6154 | main () | |
6155 | { | |
6156 | ||
6157 | ; | |
6158 | return 0; | |
6159 | } | |
6160 | _ACEOF | |
6161 | if ac_fn_c_try_compile "$LINENO"; then : | |
6162 | break | |
6163 | fi | |
6164 | rm -f core conftest.err conftest.$ac_objext | |
6165 | CC="$CC -n32" | |
6166 | if ac_fn_c_try_compile "$LINENO"; then : | |
6167 | ac_cv_sys_largefile_CC=' -n32'; break | |
6168 | fi | |
6169 | rm -f core conftest.err conftest.$ac_objext | |
6170 | break | |
6171 | done | |
6172 | CC=$ac_save_CC | |
6173 | rm -f conftest.$ac_ext | |
6174 | fi | |
6175 | fi | |
6176 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 | |
6177 | $as_echo "$ac_cv_sys_largefile_CC" >&6; } | |
6178 | if test "$ac_cv_sys_largefile_CC" != no; then | |
6179 | CC=$CC$ac_cv_sys_largefile_CC | |
6180 | fi | |
6181 | ||
6182 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 | |
6183 | $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } | |
d0ac1c44 | 6184 | if ${ac_cv_sys_file_offset_bits+:} false; then : |
2196f55f YQ |
6185 | $as_echo_n "(cached) " >&6 |
6186 | else | |
6187 | while :; do | |
6188 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6189 | /* end confdefs.h. */ | |
6190 | #include <sys/types.h> | |
6191 | /* Check that off_t can represent 2**63 - 1 correctly. | |
6192 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | |
6193 | since some C++ compilers masquerading as C compilers | |
6194 | incorrectly reject 9223372036854775807. */ | |
9c9d63b1 | 6195 | #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) |
2196f55f YQ |
6196 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 |
6197 | && LARGE_OFF_T % 2147483647 == 1) | |
6198 | ? 1 : -1]; | |
6199 | int | |
6200 | main () | |
6201 | { | |
6202 | ||
6203 | ; | |
6204 | return 0; | |
6205 | } | |
6206 | _ACEOF | |
6207 | if ac_fn_c_try_compile "$LINENO"; then : | |
6208 | ac_cv_sys_file_offset_bits=no; break | |
6209 | fi | |
6210 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6211 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6212 | /* end confdefs.h. */ | |
6213 | #define _FILE_OFFSET_BITS 64 | |
6214 | #include <sys/types.h> | |
6215 | /* Check that off_t can represent 2**63 - 1 correctly. | |
6216 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | |
6217 | since some C++ compilers masquerading as C compilers | |
6218 | incorrectly reject 9223372036854775807. */ | |
9c9d63b1 | 6219 | #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) |
2196f55f YQ |
6220 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 |
6221 | && LARGE_OFF_T % 2147483647 == 1) | |
6222 | ? 1 : -1]; | |
6223 | int | |
6224 | main () | |
6225 | { | |
6226 | ||
6227 | ; | |
6228 | return 0; | |
6229 | } | |
6230 | _ACEOF | |
6231 | if ac_fn_c_try_compile "$LINENO"; then : | |
6232 | ac_cv_sys_file_offset_bits=64; break | |
6233 | fi | |
6234 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6235 | ac_cv_sys_file_offset_bits=unknown | |
6236 | break | |
6237 | done | |
6238 | fi | |
6239 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 | |
6240 | $as_echo "$ac_cv_sys_file_offset_bits" >&6; } | |
6241 | case $ac_cv_sys_file_offset_bits in #( | |
6242 | no | unknown) ;; | |
6243 | *) | |
6244 | cat >>confdefs.h <<_ACEOF | |
6245 | #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits | |
6246 | _ACEOF | |
6247 | ;; | |
6248 | esac | |
6249 | rm -rf conftest* | |
6250 | if test $ac_cv_sys_file_offset_bits = unknown; then | |
6251 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 | |
6252 | $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } | |
d0ac1c44 | 6253 | if ${ac_cv_sys_large_files+:} false; then : |
2196f55f YQ |
6254 | $as_echo_n "(cached) " >&6 |
6255 | else | |
6256 | while :; do | |
6257 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6258 | /* end confdefs.h. */ | |
6259 | #include <sys/types.h> | |
6260 | /* Check that off_t can represent 2**63 - 1 correctly. | |
6261 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | |
6262 | since some C++ compilers masquerading as C compilers | |
6263 | incorrectly reject 9223372036854775807. */ | |
9c9d63b1 | 6264 | #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) |
2196f55f YQ |
6265 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 |
6266 | && LARGE_OFF_T % 2147483647 == 1) | |
6267 | ? 1 : -1]; | |
6268 | int | |
6269 | main () | |
6270 | { | |
6271 | ||
6272 | ; | |
6273 | return 0; | |
6274 | } | |
6275 | _ACEOF | |
6276 | if ac_fn_c_try_compile "$LINENO"; then : | |
6277 | ac_cv_sys_large_files=no; break | |
6278 | fi | |
6279 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6280 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6281 | /* end confdefs.h. */ | |
6282 | #define _LARGE_FILES 1 | |
6283 | #include <sys/types.h> | |
6284 | /* Check that off_t can represent 2**63 - 1 correctly. | |
6285 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | |
6286 | since some C++ compilers masquerading as C compilers | |
6287 | incorrectly reject 9223372036854775807. */ | |
9c9d63b1 | 6288 | #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) |
2196f55f YQ |
6289 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 |
6290 | && LARGE_OFF_T % 2147483647 == 1) | |
6291 | ? 1 : -1]; | |
6292 | int | |
6293 | main () | |
6294 | { | |
6295 | ||
6296 | ; | |
6297 | return 0; | |
6298 | } | |
6299 | _ACEOF | |
6300 | if ac_fn_c_try_compile "$LINENO"; then : | |
6301 | ac_cv_sys_large_files=1; break | |
6302 | fi | |
6303 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6304 | ac_cv_sys_large_files=unknown | |
6305 | break | |
6306 | done | |
6307 | fi | |
6308 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 | |
6309 | $as_echo "$ac_cv_sys_large_files" >&6; } | |
6310 | case $ac_cv_sys_large_files in #( | |
6311 | no | unknown) ;; | |
6312 | *) | |
6313 | cat >>confdefs.h <<_ACEOF | |
6314 | #define _LARGE_FILES $ac_cv_sys_large_files | |
6315 | _ACEOF | |
6316 | ;; | |
6317 | esac | |
6318 | rm -rf conftest* | |
6319 | fi | |
2196f55f YQ |
6320 | fi |
6321 | ||
88b48903 WN |
6322 | |
6323 | ||
5abebf3c CB |
6324 | |
6325 | ||
6326 | ||
9c9d63b1 PM |
6327 | case "$host_os" in |
6328 | openbsd*) | |
6329 | ||
6330 | $as_echo "#define _ISOC11_SOURCE 1" >>confdefs.h | |
c0c3707f | 6331 | |
9c9d63b1 PM |
6332 | ;; |
6333 | esac | |
5abebf3c | 6334 | |
5abebf3c | 6335 | |
c0c3707f CB |
6336 | |
6337 | ||
c8693053 RO |
6338 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5 |
6339 | $as_echo_n "checking for Minix Amsterdam compiler... " >&6; } | |
6340 | if ${gl_cv_c_amsterdam_compiler+:} false; then : | |
6341 | $as_echo_n "(cached) " >&6 | |
6342 | else | |
c0c3707f | 6343 | |
c8693053 RO |
6344 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6345 | /* end confdefs.h. */ | |
5abebf3c | 6346 | |
c8693053 RO |
6347 | #ifdef __ACK__ |
6348 | Amsterdam | |
6349 | #endif | |
5abebf3c | 6350 | |
c8693053 RO |
6351 | _ACEOF |
6352 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
6353 | $EGREP "Amsterdam" >/dev/null 2>&1; then : | |
6354 | gl_cv_c_amsterdam_compiler=yes | |
6355 | else | |
6356 | gl_cv_c_amsterdam_compiler=no | |
6357 | fi | |
6358 | rm -f conftest* | |
5abebf3c CB |
6359 | |
6360 | ||
c8693053 RO |
6361 | fi |
6362 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5 | |
6363 | $as_echo "$gl_cv_c_amsterdam_compiler" >&6; } | |
5abebf3c | 6364 | |
c8693053 RO |
6365 | if test $gl_cv_c_amsterdam_compiler = yes; then |
6366 | if test -z "$AR"; then | |
6367 | AR='cc -c.a' | |
6368 | fi | |
6369 | if test -z "$ARFLAGS"; then | |
6370 | ARFLAGS='-o' | |
6371 | fi | |
6372 | else | |
6373 | : | |
6374 | fi | |
c971b7fa | 6375 | |
c8693053 RO |
6376 | if test -n "$ac_tool_prefix"; then |
6377 | # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. | |
6378 | set dummy ${ac_tool_prefix}ar; ac_word=$2 | |
6379 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
6380 | $as_echo_n "checking for $ac_word... " >&6; } | |
6381 | if ${ac_cv_prog_AR+:} false; then : | |
6382 | $as_echo_n "(cached) " >&6 | |
6383 | else | |
6384 | if test -n "$AR"; then | |
6385 | ac_cv_prog_AR="$AR" # Let the user override the test. | |
6386 | else | |
6387 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
6388 | for as_dir in $PATH | |
6389 | do | |
6390 | IFS=$as_save_IFS | |
6391 | test -z "$as_dir" && as_dir=. | |
6392 | for ac_exec_ext in '' $ac_executable_extensions; do | |
6393 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
6394 | ac_cv_prog_AR="${ac_tool_prefix}ar" | |
6395 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
6396 | break 2 | |
6397 | fi | |
6398 | done | |
6399 | done | |
6400 | IFS=$as_save_IFS | |
c971b7fa | 6401 | |
c8693053 RO |
6402 | fi |
6403 | fi | |
6404 | AR=$ac_cv_prog_AR | |
6405 | if test -n "$AR"; then | |
6406 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 | |
6407 | $as_echo "$AR" >&6; } | |
6408 | else | |
6409 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
6410 | $as_echo "no" >&6; } | |
6411 | fi | |
c971b7fa | 6412 | |
c971b7fa | 6413 | |
c8693053 RO |
6414 | fi |
6415 | if test -z "$ac_cv_prog_AR"; then | |
6416 | ac_ct_AR=$AR | |
6417 | # Extract the first word of "ar", so it can be a program name with args. | |
6418 | set dummy ar; ac_word=$2 | |
6419 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
6420 | $as_echo_n "checking for $ac_word... " >&6; } | |
6421 | if ${ac_cv_prog_ac_ct_AR+:} false; then : | |
c971b7fa PA |
6422 | $as_echo_n "(cached) " >&6 |
6423 | else | |
c8693053 RO |
6424 | if test -n "$ac_ct_AR"; then |
6425 | ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. | |
5e8754f9 | 6426 | else |
c8693053 RO |
6427 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
6428 | for as_dir in $PATH | |
6429 | do | |
6430 | IFS=$as_save_IFS | |
6431 | test -z "$as_dir" && as_dir=. | |
6432 | for ac_exec_ext in '' $ac_executable_extensions; do | |
6433 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
6434 | ac_cv_prog_ac_ct_AR="ar" | |
6435 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
6436 | break 2 | |
6437 | fi | |
6438 | done | |
6439 | done | |
6440 | IFS=$as_save_IFS | |
7a6dbc2f | 6441 | |
c971b7fa | 6442 | fi |
c8693053 RO |
6443 | fi |
6444 | ac_ct_AR=$ac_cv_prog_ac_ct_AR | |
6445 | if test -n "$ac_ct_AR"; then | |
6446 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 | |
6447 | $as_echo "$ac_ct_AR" >&6; } | |
6448 | else | |
6449 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
6450 | $as_echo "no" >&6; } | |
6451 | fi | |
5e8754f9 | 6452 | |
c8693053 RO |
6453 | if test "x$ac_ct_AR" = x; then |
6454 | AR="ar" | |
6455 | else | |
6456 | case $cross_compiling:$ac_tool_warned in | |
6457 | yes:) | |
6458 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
6459 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
6460 | ac_tool_warned=yes ;; | |
6461 | esac | |
6462 | AR=$ac_ct_AR | |
6463 | fi | |
6464 | else | |
6465 | AR="$ac_cv_prog_AR" | |
6466 | fi | |
c0c3707f | 6467 | |
c8693053 RO |
6468 | if test -z "$ARFLAGS"; then |
6469 | ARFLAGS='cr' | |
6470 | fi | |
7a6dbc2f | 6471 | |
7a6dbc2f | 6472 | |
c0c3707f | 6473 | |
c8693053 RO |
6474 | if test -z "$RANLIB"; then |
6475 | if test $gl_cv_c_amsterdam_compiler = yes; then | |
6476 | RANLIB=':' | |
6477 | else | |
6478 | if test -n "$ac_tool_prefix"; then | |
6479 | # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. | |
6480 | set dummy ${ac_tool_prefix}ranlib; ac_word=$2 | |
6481 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
6482 | $as_echo_n "checking for $ac_word... " >&6; } | |
6483 | if ${ac_cv_prog_RANLIB+:} false; then : | |
6484 | $as_echo_n "(cached) " >&6 | |
6485 | else | |
6486 | if test -n "$RANLIB"; then | |
6487 | ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. | |
6488 | else | |
6489 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
6490 | for as_dir in $PATH | |
6491 | do | |
6492 | IFS=$as_save_IFS | |
6493 | test -z "$as_dir" && as_dir=. | |
6494 | for ac_exec_ext in '' $ac_executable_extensions; do | |
6495 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
6496 | ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" | |
6497 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
6498 | break 2 | |
6499 | fi | |
5e8754f9 | 6500 | done |
c8693053 RO |
6501 | done |
6502 | IFS=$as_save_IFS | |
5e8754f9 | 6503 | |
c971b7fa | 6504 | fi |
c8693053 RO |
6505 | fi |
6506 | RANLIB=$ac_cv_prog_RANLIB | |
6507 | if test -n "$RANLIB"; then | |
6508 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 | |
6509 | $as_echo "$RANLIB" >&6; } | |
c0c3707f | 6510 | else |
c8693053 RO |
6511 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
6512 | $as_echo "no" >&6; } | |
5e8754f9 | 6513 | fi |
c0c3707f | 6514 | |
c8693053 RO |
6515 | |
6516 | fi | |
6517 | if test -z "$ac_cv_prog_RANLIB"; then | |
6518 | ac_ct_RANLIB=$RANLIB | |
6519 | # Extract the first word of "ranlib", so it can be a program name with args. | |
6520 | set dummy ranlib; ac_word=$2 | |
6521 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
6522 | $as_echo_n "checking for $ac_word... " >&6; } | |
6523 | if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : | |
c971b7fa PA |
6524 | $as_echo_n "(cached) " >&6 |
6525 | else | |
c8693053 RO |
6526 | if test -n "$ac_ct_RANLIB"; then |
6527 | ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. | |
6528 | else | |
6529 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
6530 | for as_dir in $PATH | |
6531 | do | |
6532 | IFS=$as_save_IFS | |
6533 | test -z "$as_dir" && as_dir=. | |
6534 | for ac_exec_ext in '' $ac_executable_extensions; do | |
6535 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
6536 | ac_cv_prog_ac_ct_RANLIB="ranlib" | |
6537 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
6538 | break 2 | |
5e8754f9 SDJ |
6539 | fi |
6540 | done | |
c8693053 RO |
6541 | done |
6542 | IFS=$as_save_IFS | |
5e8754f9 SDJ |
6543 | |
6544 | fi | |
6545 | fi | |
c8693053 RO |
6546 | ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB |
6547 | if test -n "$ac_ct_RANLIB"; then | |
6548 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 | |
6549 | $as_echo "$ac_ct_RANLIB" >&6; } | |
6550 | else | |
6551 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
6552 | $as_echo "no" >&6; } | |
6553 | fi | |
c0c3707f | 6554 | |
c8693053 RO |
6555 | if test "x$ac_ct_RANLIB" = x; then |
6556 | RANLIB=":" | |
6557 | else | |
6558 | case $cross_compiling:$ac_tool_warned in | |
6559 | yes:) | |
6560 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
6561 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
6562 | ac_tool_warned=yes ;; | |
6563 | esac | |
6564 | RANLIB=$ac_ct_RANLIB | |
6565 | fi | |
6566 | else | |
6567 | RANLIB="$ac_cv_prog_RANLIB" | |
5e8754f9 SDJ |
6568 | fi |
6569 | ||
c8693053 | 6570 | fi |
c0c3707f | 6571 | fi |
5e8754f9 | 6572 | |
5e8754f9 | 6573 | |
5e8754f9 | 6574 | |
5e8754f9 SDJ |
6575 | |
6576 | ||
5e8754f9 | 6577 | |
c8693053 RO |
6578 | # IEEE behaviour is the default on all CPUs except Alpha and SH |
6579 | # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 | |
6580 | # and the GCC 4.1.2 manual). | |
6581 | case "$host_cpu" in | |
6582 | alpha*) | |
6583 | # On Alpha systems, a compiler option provides the behaviour. | |
6584 | # See the ieee(3) manual page, also available at | |
6585 | # <https://backdrift.org/man/tru64/man3/ieee.3.html> | |
6586 | if test -n "$GCC"; then | |
6587 | # GCC has the option -mieee. | |
6588 | # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. | |
6589 | CPPFLAGS="$CPPFLAGS -mieee" | |
6590 | else | |
6591 | # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact. | |
6592 | # For full IEEE compliance (rarely needed), use option -ieee_with_inexact. | |
6593 | CPPFLAGS="$CPPFLAGS -ieee" | |
6594 | fi | |
6595 | ;; | |
6596 | sh*) | |
6597 | if test -n "$GCC"; then | |
6598 | # GCC has the option -mieee. | |
6599 | CPPFLAGS="$CPPFLAGS -mieee" | |
6600 | fi | |
6601 | ;; | |
6602 | esac | |
c0c3707f | 6603 | |
c971b7fa | 6604 | |
c971b7fa | 6605 | |
c8693053 RO |
6606 | |
6607 | ||
6608 | ||
6609 | ||
6610 | # Check whether --enable-threads was given. | |
6611 | if test "${enable_threads+set}" = set; then : | |
6612 | enableval=$enable_threads; gl_use_threads=$enableval | |
5e8754f9 | 6613 | else |
c8693053 RO |
6614 | if test -n "$gl_use_threads_default"; then |
6615 | gl_use_threads="$gl_use_threads_default" | |
6616 | else | |
6617 | case "$host_os" in | |
6618 | osf*) gl_use_threads=no ;; | |
6619 | cygwin*) | |
6620 | case `uname -r` in | |
6621 | 1.[0-5].*) gl_use_threads=no ;; | |
6622 | *) gl_use_threads=yes ;; | |
6623 | esac | |
6624 | ;; | |
6625 | mingw*) | |
6626 | case "$gl_use_winpthreads_default" in | |
6627 | yes) gl_use_threads=posix ;; | |
6628 | no) gl_use_threads=windows ;; | |
6629 | *) gl_use_threads=yes ;; | |
6630 | esac | |
6631 | ;; | |
6632 | *) gl_use_threads=yes ;; | |
6633 | esac | |
6634 | fi | |
c971b7fa | 6635 | |
5e8754f9 | 6636 | fi |
c0c3707f | 6637 | |
c8693053 RO |
6638 | if test "$gl_use_threads" = yes \ |
6639 | || test "$gl_use_threads" = isoc \ | |
6640 | || test "$gl_use_threads" = posix \ | |
6641 | || test "$gl_use_threads" = isoc+posix; then | |
6642 | # For using <threads.h> or <pthread.h>: | |
6643 | ||
6644 | ||
6645 | if test -z "$gl_anythreadlib_early_done"; then | |
6646 | case "$host_os" in | |
6647 | osf*) | |
6648 | # On OSF/1, the compiler needs the flag -D_REENTRANT so that it | |
6649 | # groks <pthread.h>. cc also understands the flag -pthread, but | |
6650 | # we don't use it because 1. gcc-2.95 doesn't understand -pthread, | |
6651 | # 2. putting a flag into CPPFLAGS that has an effect on the linker | |
6652 | # causes the AC_LINK_IFELSE test below to succeed unexpectedly, | |
6653 | # leading to wrong values of LIBTHREAD and LTLIBTHREAD. | |
6654 | CPPFLAGS="$CPPFLAGS -D_REENTRANT" | |
6655 | ;; | |
6656 | esac | |
6657 | # Some systems optimize for single-threaded programs by default, and | |
6658 | # need special flags to disable these optimizations. For example, the | |
6659 | # definition of 'errno' in <errno.h>. | |
6660 | case "$host_os" in | |
6661 | aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;; | |
6662 | solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; | |
6663 | esac | |
6664 | gl_anythreadlib_early_done=done | |
5e8754f9 | 6665 | fi |
c0c3707f | 6666 | |
c8693053 | 6667 | fi |
c0c3707f | 6668 | |
c0c3707f | 6669 | |
c971b7fa | 6670 | |
c8693053 RO |
6671 | # Pre-early section. |
6672 | ||
6673 | ||
6674 | ||
6675 | ||
6676 | # Code from module absolute-header: | |
6677 | # Code from module alloca: | |
6678 | # Code from module alloca-opt: | |
6679 | # Code from module arpa_inet: | |
6680 | # Code from module assure: | |
6681 | # Code from module at-internal: | |
698be2d8 | 6682 | # Code from module attribute: |
9c9d63b1 | 6683 | # Code from module basename-lgpl: |
698be2d8 | 6684 | # Code from module btowc: |
c8693053 RO |
6685 | # Code from module builtin-expect: |
6686 | # Code from module c99: | |
6687 | # Code from module canonicalize-lgpl: | |
6688 | # Code from module chdir: | |
6689 | # Code from module chdir-long: | |
64c2e4a5 | 6690 | # Code from module chown: |
9c9d63b1 | 6691 | # Code from module clock-time: |
c8693053 RO |
6692 | # Code from module cloexec: |
6693 | # Code from module close: | |
6694 | # Code from module closedir: | |
6695 | # Code from module count-one-bits: | |
698be2d8 | 6696 | # Code from module ctype: |
c8693053 RO |
6697 | # Code from module d-ino: |
6698 | # Code from module d-type: | |
6699 | # Code from module dirent: | |
6700 | # Code from module dirfd: | |
6701 | # Code from module dirname-lgpl: | |
c8693053 RO |
6702 | # Code from module double-slash-root: |
6703 | # Code from module dup: | |
6704 | # Code from module dup2: | |
9c9d63b1 | 6705 | # Code from module eloop-threshold: |
c8693053 RO |
6706 | # Code from module environ: |
6707 | # Code from module errno: | |
6708 | # Code from module error: | |
6709 | # Code from module exitfail: | |
6710 | # Code from module extensions: | |
6711 | # Code from module extern-inline: | |
6712 | # Code from module fchdir: | |
6713 | # Code from module fcntl: | |
6714 | # Code from module fcntl-h: | |
6715 | # Code from module fd-hook: | |
6716 | # Code from module fd-safer-flag: | |
6717 | # Code from module fdopendir: | |
32e2770e | 6718 | # Code from module ffs: |
c8693053 RO |
6719 | # Code from module filename: |
6720 | # Code from module filenamecat-lgpl: | |
6721 | # Code from module flexmember: | |
6722 | # Code from module float: | |
6723 | # Code from module fnmatch: | |
6724 | # Code from module fnmatch-gnu: | |
6725 | # Code from module fnmatch-h: | |
6726 | # Code from module fpieee: | |
6727 | ||
6728 | # Code from module fpucw: | |
9c9d63b1 | 6729 | # Code from module free-posix: |
c8693053 RO |
6730 | # Code from module frexp: |
6731 | # Code from module frexpl: | |
6732 | # Code from module fstat: | |
6733 | # Code from module fstatat: | |
4aaaa4e0 | 6734 | # Code from module gendocs: |
c8693053 RO |
6735 | # Code from module getcwd: |
6736 | # Code from module getcwd-lgpl: | |
c17253b9 | 6737 | # Code from module getdelim: |
c8693053 | 6738 | # Code from module getdtablesize: |
c17253b9 | 6739 | # Code from module getline: |
c8693053 RO |
6740 | # Code from module getlogin_r: |
6741 | # Code from module getprogname: | |
698be2d8 | 6742 | # Code from module getrandom: |
c8693053 RO |
6743 | # Code from module gettext-h: |
6744 | # Code from module gettimeofday: | |
0fa6376c | 6745 | # Code from module gitlog-to-changelog: |
c8693053 RO |
6746 | # Code from module glob: |
6747 | # Code from module glob-h: | |
6748 | # Code from module hard-locale: | |
9c9d63b1 | 6749 | # Code from module idx: |
c8693053 RO |
6750 | # Code from module include_next: |
6751 | # Code from module inet_ntop: | |
6752 | # Code from module intprops: | |
6753 | # Code from module inttypes: | |
6754 | # Code from module inttypes-incomplete: | |
698be2d8 | 6755 | # Code from module isblank: |
c8693053 RO |
6756 | # Code from module isnand-nolibm: |
6757 | # Code from module isnanl-nolibm: | |
6758 | # Code from module largefile: | |
6759 | ||
6760 | # Code from module libc-config: | |
6761 | # Code from module limits-h: | |
6762 | # Code from module localcharset: | |
6763 | # Code from module locale: | |
c8693053 RO |
6764 | # Code from module lock: |
6765 | # Code from module lstat: | |
6766 | # Code from module malloc-posix: | |
6767 | # Code from module malloca: | |
6768 | # Code from module math: | |
6769 | # Code from module mbrtowc: | |
6770 | # Code from module mbsinit: | |
6771 | # Code from module mbsrtowcs: | |
698be2d8 | 6772 | # Code from module mbtowc: |
c8693053 RO |
6773 | # Code from module memchr: |
6774 | # Code from module memmem: | |
6775 | # Code from module memmem-simple: | |
6776 | # Code from module mempcpy: | |
6777 | # Code from module memrchr: | |
698be2d8 | 6778 | # Code from module minmax: |
c8693053 RO |
6779 | # Code from module mkdir: |
6780 | # Code from module mkdtemp: | |
6781 | # Code from module mkostemp: | |
6782 | # Code from module msvc-inval: | |
6783 | # Code from module msvc-nothrow: | |
6784 | # Code from module multiarch: | |
6785 | # Code from module netinet_in: | |
6786 | # Code from module nocrash: | |
6787 | # Code from module open: | |
6788 | # Code from module openat: | |
6789 | # Code from module openat-die: | |
6790 | # Code from module openat-h: | |
6791 | # Code from module opendir: | |
6792 | # Code from module pathmax: | |
9c9d63b1 | 6793 | # Code from module pipe-posix: |
c8693053 RO |
6794 | # Code from module rawmemchr: |
6795 | # Code from module readdir: | |
6796 | # Code from module readlink: | |
6797 | # Code from module realloc-posix: | |
6798 | # Code from module rename: | |
6799 | # Code from module rewinddir: | |
6800 | # Code from module rmdir: | |
6801 | # Code from module same-inode: | |
6802 | # Code from module save-cwd: | |
6803 | # Code from module scratch_buffer: | |
6804 | # Code from module setenv: | |
6805 | # Code from module setlocale-null: | |
6806 | # Code from module signal-h: | |
6807 | # Code from module snippet/_Noreturn: | |
6808 | # Code from module snippet/arg-nonnull: | |
6809 | # Code from module snippet/c++defs: | |
6810 | # Code from module snippet/warn-on-use: | |
6811 | # Code from module socklen: | |
6812 | # Code from module ssize_t: | |
6813 | # Code from module stat: | |
6814 | # Code from module stat-time: | |
6815 | # Code from module std-gnu11: | |
6816 | # Code from module stdalign: | |
6817 | # Code from module stdbool: | |
6818 | # Code from module stddef: | |
6819 | # Code from module stdint: | |
6820 | # Code from module stdio: | |
6821 | # Code from module stdlib: | |
6822 | # Code from module strchrnul: | |
6823 | # Code from module strdup-posix: | |
6824 | # Code from module streq: | |
6825 | # Code from module strerror: | |
6826 | # Code from module strerror-override: | |
6827 | # Code from module strerror_r-posix: | |
6828 | # Code from module string: | |
32e2770e | 6829 | # Code from module strings: |
698be2d8 | 6830 | # Code from module strnlen: |
c8693053 RO |
6831 | # Code from module strnlen1: |
6832 | # Code from module strstr: | |
6833 | # Code from module strstr-simple: | |
6834 | # Code from module strtok_r: | |
698be2d8 | 6835 | # Code from module sys_random: |
c8693053 RO |
6836 | # Code from module sys_socket: |
6837 | # Code from module sys_stat: | |
6838 | # Code from module sys_time: | |
6839 | # Code from module sys_types: | |
6840 | # Code from module sys_uio: | |
6841 | # Code from module tempname: | |
6842 | # Code from module threadlib: | |
6843 | ||
6844 | ||
6845 | ||
6846 | # Code from module time: | |
6847 | # Code from module time_r: | |
6848 | # Code from module unistd: | |
6849 | # Code from module unistd-safer: | |
6850 | # Code from module unsetenv: | |
6851 | # Code from module update-copyright: | |
6852 | # Code from module verify: | |
6853 | # Code from module wchar: | |
6854 | # Code from module wctype-h: | |
6855 | # Code from module windows-mutex: | |
6856 | # Code from module windows-once: | |
6857 | # Code from module windows-recmutex: | |
6858 | # Code from module windows-rwlock: | |
698be2d8 CB |
6859 | # Code from module wmemchr: |
6860 | # Code from module wmempcpy: | |
c8693053 RO |
6861 | # Code from module xalloc-oversized: |
6862 | ||
6863 | ||
6864 | am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc | |
c971b7fa PA |
6865 | |
6866 | ||
c0c3707f CB |
6867 | ac_aux_dir= |
6868 | for ac_dir in .. "$srcdir"/..; do | |
6869 | if test -f "$ac_dir/install-sh"; then | |
6870 | ac_aux_dir=$ac_dir | |
6871 | ac_install_sh="$ac_aux_dir/install-sh -c" | |
6872 | break | |
6873 | elif test -f "$ac_dir/install.sh"; then | |
6874 | ac_aux_dir=$ac_dir | |
6875 | ac_install_sh="$ac_aux_dir/install.sh -c" | |
6876 | break | |
6877 | elif test -f "$ac_dir/shtool"; then | |
6878 | ac_aux_dir=$ac_dir | |
6879 | ac_install_sh="$ac_aux_dir/shtool install -c" | |
6880 | break | |
6881 | fi | |
6882 | done | |
6883 | if test -z "$ac_aux_dir"; then | |
6884 | as_fn_error $? "cannot find install-sh, install.sh, or shtool in .. \"$srcdir\"/.." "$LINENO" 5 | |
6885 | fi | |
6886 | ||
6887 | # These three variables are undocumented and unsupported, | |
6888 | # and are intended to be withdrawn in a future Autoconf release. | |
6889 | # They can cause serious problems if a builder's source tree is in a directory | |
6890 | # whose full name contains unusual characters. | |
6891 | ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. | |
6892 | ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. | |
6893 | ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. | |
6894 | ||
6895 | ||
6896 | ||
6897 | ||
6898 | ||
6899 | ||
6900 | ||
6901 | ||
6902 | ||
6903 | ||
698be2d8 | 6904 | |
9c9d63b1 | 6905 | |
c0c3707f CB |
6906 | # Check whether --enable-cross-guesses was given. |
6907 | if test "${enable_cross_guesses+set}" = set; then : | |
6908 | enableval=$enable_cross_guesses; if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then | |
6909 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-cross-guesses" >&5 | |
6910 | $as_echo "$as_me: WARNING: invalid argument supplied to --enable-cross-guesses" >&2;} | |
6911 | enableval=conservative | |
6912 | fi | |
6913 | gl_cross_guesses="$enableval" | |
6914 | else | |
6915 | gl_cross_guesses=conservative | |
6916 | fi | |
6917 | ||
6918 | if test $gl_cross_guesses = risky; then | |
6919 | gl_cross_guess_normal="guessing yes" | |
6920 | gl_cross_guess_inverted="guessing no" | |
6921 | else | |
6922 | gl_cross_guess_normal="guessing no" | |
6923 | gl_cross_guess_inverted="guessing yes" | |
6924 | fi | |
6925 | LIBC_FATAL_STDERR_=1 | |
6926 | export LIBC_FATAL_STDERR_ | |
6927 | ||
5df4cba6 | 6928 | |
c0c3707f CB |
6929 | ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" |
6930 | if test "x$ac_cv_type_size_t" = xyes; then : | |
6931 | ||
6932 | else | |
6933 | ||
6934 | cat >>confdefs.h <<_ACEOF | |
6935 | #define size_t unsigned int | |
6936 | _ACEOF | |
6937 | ||
6938 | fi | |
6939 | ||
6940 | # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works | |
6941 | # for constant arguments. Useless! | |
6942 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 | |
6943 | $as_echo_n "checking for working alloca.h... " >&6; } | |
6944 | if ${ac_cv_working_alloca_h+:} false; then : | |
6945 | $as_echo_n "(cached) " >&6 | |
6946 | else | |
6947 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6948 | /* end confdefs.h. */ | |
6949 | #include <alloca.h> | |
5e8754f9 SDJ |
6950 | int |
6951 | main () | |
6952 | { | |
c0c3707f CB |
6953 | char *p = (char *) alloca (2 * sizeof (int)); |
6954 | if (p) return 0; | |
5e8754f9 SDJ |
6955 | ; |
6956 | return 0; | |
6957 | } | |
6958 | _ACEOF | |
c0c3707f CB |
6959 | if ac_fn_c_try_link "$LINENO"; then : |
6960 | ac_cv_working_alloca_h=yes | |
6961 | else | |
6962 | ac_cv_working_alloca_h=no | |
5e8754f9 | 6963 | fi |
c0c3707f CB |
6964 | rm -f core conftest.err conftest.$ac_objext \ |
6965 | conftest$ac_exeext conftest.$ac_ext | |
5e8754f9 | 6966 | fi |
c0c3707f CB |
6967 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 |
6968 | $as_echo "$ac_cv_working_alloca_h" >&6; } | |
6969 | if test $ac_cv_working_alloca_h = yes; then | |
c971b7fa | 6970 | |
c0c3707f | 6971 | $as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h |
c971b7fa | 6972 | |
c0c3707f | 6973 | fi |
d0ac1c44 | 6974 | |
c0c3707f CB |
6975 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 |
6976 | $as_echo_n "checking for alloca... " >&6; } | |
6977 | if ${ac_cv_func_alloca_works+:} false; then : | |
5e8754f9 SDJ |
6978 | $as_echo_n "(cached) " >&6 |
6979 | else | |
6980 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6981 | /* end confdefs.h. */ | |
c0c3707f CB |
6982 | #ifdef __GNUC__ |
6983 | # define alloca __builtin_alloca | |
6984 | #else | |
6985 | # ifdef _MSC_VER | |
6986 | # include <malloc.h> | |
6987 | # define alloca _alloca | |
6988 | # else | |
6989 | # ifdef HAVE_ALLOCA_H | |
6990 | # include <alloca.h> | |
6991 | # else | |
6992 | # ifdef _AIX | |
6993 | #pragma alloca | |
6994 | # else | |
6995 | # ifndef alloca /* predefined by HP cc +Olibcalls */ | |
6996 | void *alloca (size_t); | |
6997 | # endif | |
6998 | # endif | |
6999 | # endif | |
7000 | # endif | |
7001 | #endif | |
d0ac1c44 | 7002 | |
5e8754f9 SDJ |
7003 | int |
7004 | main () | |
7005 | { | |
c0c3707f CB |
7006 | char *p = (char *) alloca (1); |
7007 | if (p) return 0; | |
5e8754f9 SDJ |
7008 | ; |
7009 | return 0; | |
7010 | } | |
7011 | _ACEOF | |
c0c3707f CB |
7012 | if ac_fn_c_try_link "$LINENO"; then : |
7013 | ac_cv_func_alloca_works=yes | |
7014 | else | |
7015 | ac_cv_func_alloca_works=no | |
5e8754f9 | 7016 | fi |
c0c3707f CB |
7017 | rm -f core conftest.err conftest.$ac_objext \ |
7018 | conftest$ac_exeext conftest.$ac_ext | |
7019 | fi | |
7020 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 | |
7021 | $as_echo "$ac_cv_func_alloca_works" >&6; } | |
7a6dbc2f | 7022 | |
c0c3707f | 7023 | if test $ac_cv_func_alloca_works = yes; then |
7a6dbc2f | 7024 | |
c0c3707f | 7025 | $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h |
7a6dbc2f | 7026 | |
5e8754f9 | 7027 | else |
c0c3707f CB |
7028 | # The SVR3 libPW and SVR4 libucb both contain incompatible functions |
7029 | # that cause trouble. Some versions do not even contain alloca or | |
7030 | # contain a buggy version. If you still want to use their alloca, | |
7031 | # use ar to extract alloca.o from them instead of compiling alloca.c. | |
c971b7fa PA |
7032 | |
7033 | ||
7a6dbc2f | 7034 | |
73cc7272 TT |
7035 | |
7036 | ||
c0c3707f | 7037 | ALLOCA=\${LIBOBJDIR}alloca.$ac_objext |
73cc7272 | 7038 | |
c0c3707f | 7039 | $as_echo "#define C_ALLOCA 1" >>confdefs.h |
73cc7272 TT |
7040 | |
7041 | ||
c0c3707f CB |
7042 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 |
7043 | $as_echo_n "checking stack direction for C alloca... " >&6; } | |
7044 | if ${ac_cv_c_stack_direction+:} false; then : | |
73cc7272 TT |
7045 | $as_echo_n "(cached) " >&6 |
7046 | else | |
c0c3707f CB |
7047 | if test "$cross_compiling" = yes; then : |
7048 | ac_cv_c_stack_direction=0 | |
7049 | else | |
7050 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
73cc7272 | 7051 | /* end confdefs.h. */ |
c0c3707f CB |
7052 | $ac_includes_default |
7053 | int | |
7054 | find_stack_direction (int *addr, int depth) | |
7055 | { | |
7056 | int dir, dummy = 0; | |
7057 | if (! addr) | |
7058 | addr = &dummy; | |
7059 | *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; | |
7060 | dir = depth ? find_stack_direction (addr, depth - 1) : 0; | |
7061 | return dir + dummy; | |
7062 | } | |
73cc7272 | 7063 | |
73cc7272 | 7064 | int |
c0c3707f | 7065 | main (int argc, char **argv) |
73cc7272 | 7066 | { |
c0c3707f | 7067 | return find_stack_direction (0, argc + !argv + 20) < 0; |
73cc7272 TT |
7068 | } |
7069 | _ACEOF | |
c0c3707f CB |
7070 | if ac_fn_c_try_run "$LINENO"; then : |
7071 | ac_cv_c_stack_direction=1 | |
7072 | else | |
7073 | ac_cv_c_stack_direction=-1 | |
73cc7272 | 7074 | fi |
c0c3707f CB |
7075 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
7076 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
73cc7272 | 7077 | fi |
73cc7272 | 7078 | |
73cc7272 | 7079 | fi |
9c9d63b1 PM |
7080 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 |
7081 | $as_echo "$ac_cv_c_stack_direction" >&6; } | |
7082 | cat >>confdefs.h <<_ACEOF | |
7083 | #define STACK_DIRECTION $ac_cv_c_stack_direction | |
c0c3707f CB |
7084 | _ACEOF |
7085 | ||
9c9d63b1 | 7086 | |
73cc7272 TT |
7087 | fi |
7088 | ||
9c9d63b1 PM |
7089 | |
7090 | GNULIB_INET_NTOP=0; | |
7091 | GNULIB_INET_PTON=0; | |
7092 | HAVE_DECL_INET_NTOP=1; | |
7093 | HAVE_DECL_INET_PTON=1; | |
7094 | REPLACE_INET_NTOP=0; | |
7095 | REPLACE_INET_PTON=0; | |
73cc7272 | 7096 | |
c0c3707f CB |
7097 | |
7098 | ||
7099 | ||
7100 | ||
7101 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 | |
7102 | $as_echo_n "checking whether the preprocessor supports include_next... " >&6; } | |
7103 | if ${gl_cv_have_include_next+:} false; then : | |
73cc7272 TT |
7104 | $as_echo_n "(cached) " >&6 |
7105 | else | |
c0c3707f CB |
7106 | rm -rf conftestd1a conftestd1b conftestd2 |
7107 | mkdir conftestd1a conftestd1b conftestd2 | |
7108 | cat <<EOF > conftestd1a/conftest.h | |
7109 | #define DEFINED_IN_CONFTESTD1 | |
7110 | #include_next <conftest.h> | |
7111 | #ifdef DEFINED_IN_CONFTESTD2 | |
7112 | int foo; | |
7113 | #else | |
7114 | #error "include_next doesn't work" | |
7115 | #endif | |
7116 | EOF | |
7117 | cat <<EOF > conftestd1b/conftest.h | |
7118 | #define DEFINED_IN_CONFTESTD1 | |
7119 | #include <stdio.h> | |
7120 | #include_next <conftest.h> | |
7121 | #ifdef DEFINED_IN_CONFTESTD2 | |
7122 | int foo; | |
7123 | #else | |
7124 | #error "include_next doesn't work" | |
7125 | #endif | |
7126 | EOF | |
7127 | cat <<EOF > conftestd2/conftest.h | |
7128 | #ifndef DEFINED_IN_CONFTESTD1 | |
7129 | #error "include_next test doesn't work" | |
7130 | #endif | |
7131 | #define DEFINED_IN_CONFTESTD2 | |
7132 | EOF | |
7133 | gl_save_CPPFLAGS="$CPPFLAGS" | |
7134 | CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" | |
7135 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
73cc7272 | 7136 | /* end confdefs.h. */ |
c0c3707f | 7137 | #include <conftest.h> |
73cc7272 | 7138 | _ACEOF |
c0c3707f CB |
7139 | if ac_fn_c_try_compile "$LINENO"; then : |
7140 | gl_cv_have_include_next=yes | |
7141 | else | |
7142 | CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" | |
7143 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
7144 | /* end confdefs.h. */ | |
7145 | #include <conftest.h> | |
7146 | _ACEOF | |
7147 | if ac_fn_c_try_compile "$LINENO"; then : | |
7148 | gl_cv_have_include_next=buggy | |
7149 | else | |
7150 | gl_cv_have_include_next=no | |
73cc7272 | 7151 | fi |
c0c3707f CB |
7152 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
7153 | ||
73cc7272 | 7154 | fi |
c0c3707f CB |
7155 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
7156 | CPPFLAGS="$gl_save_CPPFLAGS" | |
7157 | rm -rf conftestd1a conftestd1b conftestd2 | |
7158 | ||
73cc7272 | 7159 | fi |
c0c3707f CB |
7160 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 |
7161 | $as_echo "$gl_cv_have_include_next" >&6; } | |
7162 | PRAGMA_SYSTEM_HEADER= | |
7163 | if test $gl_cv_have_include_next = yes; then | |
7164 | INCLUDE_NEXT=include_next | |
7165 | INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next | |
7166 | if test -n "$GCC"; then | |
7167 | PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' | |
7168 | fi | |
7169 | else | |
7170 | if test $gl_cv_have_include_next = buggy; then | |
7171 | INCLUDE_NEXT=include | |
7172 | INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next | |
7173 | else | |
7174 | INCLUDE_NEXT=include | |
7175 | INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include | |
7176 | fi | |
73cc7272 TT |
7177 | fi |
7178 | ||
73cc7272 | 7179 | |
73cc7272 | 7180 | |
9c9d63b1 PM |
7181 | |
7182 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether source code line length is unlimited" >&5 | |
7183 | $as_echo_n "checking whether source code line length is unlimited... " >&6; } | |
7184 | if ${gl_cv_source_line_length_unlimited+:} false; then : | |
73cc7272 TT |
7185 | $as_echo_n "(cached) " >&6 |
7186 | else | |
9c9d63b1 | 7187 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
73cc7272 | 7188 | /* end confdefs.h. */ |
73cc7272 | 7189 | |
c0c3707f CB |
7190 | #ifdef __TANDEM |
7191 | choke me | |
7192 | #endif | |
73cc7272 | 7193 | |
73cc7272 | 7194 | _ACEOF |
c0c3707f CB |
7195 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
7196 | $EGREP "choke me" >/dev/null 2>&1; then : | |
9c9d63b1 | 7197 | gl_cv_source_line_length_unlimited=no |
c0c3707f | 7198 | else |
9c9d63b1 | 7199 | gl_cv_source_line_length_unlimited=yes |
73cc7272 | 7200 | fi |
c0c3707f | 7201 | rm -f conftest* |
73cc7272 | 7202 | |
73cc7272 TT |
7203 | |
7204 | fi | |
9c9d63b1 PM |
7205 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_source_line_length_unlimited" >&5 |
7206 | $as_echo "$gl_cv_source_line_length_unlimited" >&6; } | |
7207 | if test $gl_cv_source_line_length_unlimited = no; then | |
c0c3707f CB |
7208 | PRAGMA_COLUMNS="#pragma COLUMNS 10000" |
7209 | else | |
7210 | PRAGMA_COLUMNS= | |
7211 | fi | |
73cc7272 TT |
7212 | |
7213 | ||
7214 | ||
73cc7272 | 7215 | |
73cc7272 TT |
7216 | |
7217 | ||
c0c3707f CB |
7218 | if test $ac_cv_header_features_h = yes; then |
7219 | HAVE_FEATURES_H=1 | |
7220 | else | |
7221 | HAVE_FEATURES_H=0 | |
7222 | fi | |
73cc7272 | 7223 | |
7a6dbc2f SDJ |
7224 | |
7225 | ||
7226 | ||
7227 | ||
c0c3707f CB |
7228 | if test $ac_cv_header_sys_socket_h = no; then |
7229 | for ac_header in ws2tcpip.h | |
7230 | do : | |
7231 | ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" | |
7232 | if test "x$ac_cv_header_ws2tcpip_h" = xyes; then : | |
7233 | cat >>confdefs.h <<_ACEOF | |
7234 | #define HAVE_WS2TCPIP_H 1 | |
7235 | _ACEOF | |
7a6dbc2f | 7236 | |
c0c3707f | 7237 | fi |
7a6dbc2f | 7238 | |
c0c3707f | 7239 | done |
7a6dbc2f | 7240 | |
c0c3707f | 7241 | fi |
7a6dbc2f | 7242 | |
c0c3707f CB |
7243 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 |
7244 | $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } | |
7245 | if test -z "$MKDIR_P"; then | |
7246 | if ${ac_cv_path_mkdir+:} false; then : | |
7247 | $as_echo_n "(cached) " >&6 | |
5e8754f9 | 7248 | else |
c0c3707f CB |
7249 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
7250 | for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin | |
7251 | do | |
7252 | IFS=$as_save_IFS | |
7253 | test -z "$as_dir" && as_dir=. | |
7254 | for ac_prog in mkdir gmkdir; do | |
7255 | for ac_exec_ext in '' $ac_executable_extensions; do | |
7256 | as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue | |
7257 | case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( | |
7258 | 'mkdir (GNU coreutils) '* | \ | |
7259 | 'mkdir (coreutils) '* | \ | |
7260 | 'mkdir (fileutils) '4.1*) | |
7261 | ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext | |
7262 | break 3;; | |
7263 | esac | |
7264 | done | |
7265 | done | |
7266 | done | |
7267 | IFS=$as_save_IFS | |
7a6dbc2f | 7268 | |
5e8754f9 | 7269 | fi |
7a6dbc2f | 7270 | |
c0c3707f CB |
7271 | test -d ./--version && rmdir ./--version |
7272 | if test "${ac_cv_path_mkdir+set}" = set; then | |
7273 | MKDIR_P="$ac_cv_path_mkdir -p" | |
7274 | else | |
7275 | # As a last resort, use the slow shell script. Don't cache a | |
7276 | # value for MKDIR_P within a source directory, because that will | |
7277 | # break other packages using the cache if that directory is | |
7278 | # removed, or if the value is a relative name. | |
7279 | MKDIR_P="$ac_install_sh -d" | |
7280 | fi | |
5e8754f9 | 7281 | fi |
c0c3707f CB |
7282 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 |
7283 | $as_echo "$MKDIR_P" >&6; } | |
7a6dbc2f | 7284 | |
5e8754f9 | 7285 | |
698be2d8 CB |
7286 | GNULIB_BTOWC=0; |
7287 | GNULIB_WCTOB=0; | |
7288 | GNULIB_MBSINIT=0; | |
7289 | GNULIB_MBRTOWC=0; | |
7290 | GNULIB_MBRLEN=0; | |
7291 | GNULIB_MBSRTOWCS=0; | |
7292 | GNULIB_MBSNRTOWCS=0; | |
7293 | GNULIB_WCRTOMB=0; | |
7294 | GNULIB_WCSRTOMBS=0; | |
7295 | GNULIB_WCSNRTOMBS=0; | |
7296 | GNULIB_WCWIDTH=0; | |
7297 | GNULIB_WMEMCHR=0; | |
7298 | GNULIB_WMEMCMP=0; | |
7299 | GNULIB_WMEMCPY=0; | |
7300 | GNULIB_WMEMMOVE=0; | |
7301 | GNULIB_WMEMPCPY=0; | |
7302 | GNULIB_WMEMSET=0; | |
7303 | GNULIB_WCSLEN=0; | |
7304 | GNULIB_WCSNLEN=0; | |
7305 | GNULIB_WCSCPY=0; | |
7306 | GNULIB_WCPCPY=0; | |
7307 | GNULIB_WCSNCPY=0; | |
7308 | GNULIB_WCPNCPY=0; | |
7309 | GNULIB_WCSCAT=0; | |
7310 | GNULIB_WCSNCAT=0; | |
7311 | GNULIB_WCSCMP=0; | |
7312 | GNULIB_WCSNCMP=0; | |
7313 | GNULIB_WCSCASECMP=0; | |
7314 | GNULIB_WCSNCASECMP=0; | |
7315 | GNULIB_WCSCOLL=0; | |
7316 | GNULIB_WCSXFRM=0; | |
7317 | GNULIB_WCSDUP=0; | |
7318 | GNULIB_WCSCHR=0; | |
7319 | GNULIB_WCSRCHR=0; | |
7320 | GNULIB_WCSCSPN=0; | |
7321 | GNULIB_WCSSPN=0; | |
7322 | GNULIB_WCSPBRK=0; | |
7323 | GNULIB_WCSSTR=0; | |
7324 | GNULIB_WCSTOK=0; | |
7325 | GNULIB_WCSWIDTH=0; | |
7326 | GNULIB_WCSFTIME=0; | |
9c9d63b1 | 7327 | GNULIB_MDA_WCSDUP=1; |
698be2d8 CB |
7328 | HAVE_BTOWC=1; |
7329 | HAVE_MBSINIT=1; | |
7330 | HAVE_MBRTOWC=1; | |
7331 | HAVE_MBRLEN=1; | |
7332 | HAVE_MBSRTOWCS=1; | |
7333 | HAVE_MBSNRTOWCS=1; | |
7334 | HAVE_WCRTOMB=1; | |
7335 | HAVE_WCSRTOMBS=1; | |
7336 | HAVE_WCSNRTOMBS=1; | |
7337 | HAVE_WMEMCHR=1; | |
7338 | HAVE_WMEMCMP=1; | |
7339 | HAVE_WMEMCPY=1; | |
7340 | HAVE_WMEMMOVE=1; | |
7341 | HAVE_WMEMPCPY=1; | |
7342 | HAVE_WMEMSET=1; | |
7343 | HAVE_WCSLEN=1; | |
7344 | HAVE_WCSNLEN=1; | |
7345 | HAVE_WCSCPY=1; | |
7346 | HAVE_WCPCPY=1; | |
7347 | HAVE_WCSNCPY=1; | |
7348 | HAVE_WCPNCPY=1; | |
7349 | HAVE_WCSCAT=1; | |
7350 | HAVE_WCSNCAT=1; | |
7351 | HAVE_WCSCMP=1; | |
7352 | HAVE_WCSNCMP=1; | |
7353 | HAVE_WCSCASECMP=1; | |
7354 | HAVE_WCSNCASECMP=1; | |
7355 | HAVE_WCSCOLL=1; | |
7356 | HAVE_WCSXFRM=1; | |
7357 | HAVE_WCSDUP=1; | |
7358 | HAVE_WCSCHR=1; | |
7359 | HAVE_WCSRCHR=1; | |
7360 | HAVE_WCSCSPN=1; | |
7361 | HAVE_WCSSPN=1; | |
7362 | HAVE_WCSPBRK=1; | |
7363 | HAVE_WCSSTR=1; | |
7364 | HAVE_WCSTOK=1; | |
7365 | HAVE_WCSWIDTH=1; | |
7366 | HAVE_WCSFTIME=1; | |
7367 | HAVE_DECL_WCTOB=1; | |
9c9d63b1 | 7368 | HAVE_DECL_WCSDUP=1; |
698be2d8 CB |
7369 | HAVE_DECL_WCWIDTH=1; |
7370 | REPLACE_MBSTATE_T=0; | |
7371 | REPLACE_BTOWC=0; | |
7372 | REPLACE_WCTOB=0; | |
7373 | REPLACE_MBSINIT=0; | |
7374 | REPLACE_MBRTOWC=0; | |
7375 | REPLACE_MBRLEN=0; | |
7376 | REPLACE_MBSRTOWCS=0; | |
7377 | REPLACE_MBSNRTOWCS=0; | |
7378 | REPLACE_WCRTOMB=0; | |
7379 | REPLACE_WCSRTOMBS=0; | |
7380 | REPLACE_WCSNRTOMBS=0; | |
7381 | REPLACE_WCWIDTH=0; | |
7382 | REPLACE_WCSWIDTH=0; | |
7383 | REPLACE_WCSFTIME=0; | |
7384 | REPLACE_WCSTOK=0; | |
7385 | ||
7386 | ||
9c9d63b1 PM |
7387 | |
7388 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5 | |
698be2d8 CB |
7389 | $as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; } |
7390 | if ${gl_cv_header_wchar_h_correct_inline+:} false; then : | |
7391 | $as_echo_n "(cached) " >&6 | |
7392 | else | |
7393 | gl_cv_header_wchar_h_correct_inline=yes | |
9c9d63b1 PM |
7394 | case "$host_os" in |
7395 | *-gnu* | gnu*) | |
7396 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
698be2d8 CB |
7397 | /* end confdefs.h. */ |
7398 | ||
9c9d63b1 PM |
7399 | |
7400 | #define wcstod renamed_wcstod | |
7401 | #include <wchar.h> | |
7402 | extern int zero (void); | |
7403 | int main () { return zero(); } | |
698be2d8 CB |
7404 | |
7405 | _ACEOF | |
9c9d63b1 PM |
7406 | save_ac_compile="$ac_compile" |
7407 | ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` | |
7408 | if echo '#include "conftest.c"' >conftest1.c \ | |
7409 | && { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 | |
698be2d8 CB |
7410 | (eval $ac_compile) 2>&5 |
7411 | ac_status=$? | |
7412 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
7413 | test $ac_status = 0; }; then | |
9c9d63b1 | 7414 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
698be2d8 CB |
7415 | /* end confdefs.h. */ |
7416 | ||
9c9d63b1 PM |
7417 | |
7418 | #define wcstod renamed_wcstod | |
7419 | #include <wchar.h> | |
7420 | int zero (void) { return 0; } | |
698be2d8 CB |
7421 | |
7422 | _ACEOF | |
9c9d63b1 PM |
7423 | ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` |
7424 | if echo '#include "conftest.c"' >conftest2.c \ | |
7425 | && { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 | |
698be2d8 CB |
7426 | (eval $ac_compile) 2>&5 |
7427 | ac_status=$? | |
7428 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
7429 | test $ac_status = 0; }; then | |
9c9d63b1 PM |
7430 | if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then |
7431 | : | |
7432 | else | |
7433 | gl_cv_header_wchar_h_correct_inline=no | |
7434 | fi | |
7435 | fi | |
698be2d8 | 7436 | fi |
9c9d63b1 PM |
7437 | ac_compile="$save_ac_compile" |
7438 | rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext | |
7439 | ;; | |
7440 | esac | |
698be2d8 CB |
7441 | |
7442 | fi | |
7443 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 | |
7444 | $as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; } | |
7445 | if test $gl_cv_header_wchar_h_correct_inline = no; then | |
7446 | as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). | |
7447 | This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in | |
7448 | C99 mode. You have four options: | |
7449 | - Add the flag -fgnu89-inline to CC and reconfigure, or | |
7450 | - Fix your include files, using parts of | |
7451 | <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or | |
7452 | - Use a gcc version older than 4.3, or | |
7453 | - Don't use the flags -std=c99 or -std=gnu99. | |
7454 | Configuration aborted." "$LINENO" 5 | |
7455 | fi | |
7456 | ||
7457 | ||
7458 | ||
7459 | ||
7460 | for ac_func in $ac_func_list | |
7461 | do : | |
7462 | as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` | |
7463 | ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" | |
7464 | if eval test \"x\$"$as_ac_var"\" = x"yes"; then : | |
7465 | cat >>confdefs.h <<_ACEOF | |
7466 | #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 | |
7467 | _ACEOF | |
7468 | ||
7469 | fi | |
7470 | done | |
7471 | ||
7472 | ||
7473 | ||
7474 | ||
7475 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 | |
7476 | $as_echo_n "checking for nl_langinfo and CODESET... " >&6; } | |
7477 | if ${am_cv_langinfo_codeset+:} false; then : | |
7478 | $as_echo_n "(cached) " >&6 | |
7479 | else | |
7480 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
7481 | /* end confdefs.h. */ | |
7482 | #include <langinfo.h> | |
7483 | int | |
7484 | main () | |
7485 | { | |
7486 | char* cs = nl_langinfo(CODESET); return !cs; | |
7487 | ; | |
7488 | return 0; | |
7489 | } | |
7490 | _ACEOF | |
7491 | if ac_fn_c_try_link "$LINENO"; then : | |
7492 | am_cv_langinfo_codeset=yes | |
7493 | else | |
7494 | am_cv_langinfo_codeset=no | |
7495 | fi | |
7496 | rm -f core conftest.err conftest.$ac_objext \ | |
7497 | conftest$ac_exeext conftest.$ac_ext | |
7498 | ||
7499 | fi | |
7500 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 | |
7501 | $as_echo "$am_cv_langinfo_codeset" >&6; } | |
7502 | if test $am_cv_langinfo_codeset = yes; then | |
7503 | ||
7504 | $as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h | |
7505 | ||
7506 | fi | |
7507 | ||
7508 | ||
7509 | ||
7510 | ||
7511 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 | |
7512 | $as_echo_n "checking for a traditional french locale... " >&6; } | |
7513 | if ${gt_cv_locale_fr+:} false; then : | |
7514 | $as_echo_n "(cached) " >&6 | |
7515 | else | |
7516 | ||
7517 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
7518 | /* end confdefs.h. */ | |
7519 | ||
7520 | #include <locale.h> | |
7521 | #include <time.h> | |
7522 | #if HAVE_LANGINFO_CODESET | |
7523 | # include <langinfo.h> | |
7524 | #endif | |
7525 | #include <stdlib.h> | |
7526 | #include <string.h> | |
7527 | struct tm t; | |
7528 | char buf[16]; | |
7529 | int main () { | |
7530 | /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl | |
7531 | imitates locale dependent behaviour by looking at the environment | |
7532 | variables, and all locales use the UTF-8 encoding. */ | |
7533 | #if defined __BEOS__ || defined __HAIKU__ | |
7534 | return 1; | |
7535 | #else | |
7536 | /* Check whether the given locale name is recognized by the system. */ | |
7537 | # if defined _WIN32 && !defined __CYGWIN__ | |
7538 | /* On native Windows, setlocale(category, "") looks at the system settings, | |
7539 | not at the environment variables. Also, when an encoding suffix such | |
7540 | as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE | |
7541 | category of the locale to "C". */ | |
7542 | if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL | |
7543 | || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) | |
7544 | return 1; | |
7545 | # else | |
7546 | if (setlocale (LC_ALL, "") == NULL) return 1; | |
7547 | # endif | |
7548 | /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". | |
7549 | On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) | |
7550 | is empty, and the behaviour of Tcl 8.4 in this locale is not useful. | |
7551 | On OpenBSD 4.0, when an unsupported locale is specified, setlocale() | |
7552 | succeeds but then nl_langinfo(CODESET) is "646". In this situation, | |
7553 | some unit tests fail. | |
7554 | On MirBSD 10, when an unsupported locale is specified, setlocale() | |
7555 | succeeds but then nl_langinfo(CODESET) is "UTF-8". */ | |
7556 | # if HAVE_LANGINFO_CODESET | |
7557 | { | |
7558 | const char *cs = nl_langinfo (CODESET); | |
7559 | if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 | |
7560 | || strcmp (cs, "UTF-8") == 0) | |
7561 | return 1; | |
7562 | } | |
7563 | # endif | |
7564 | # ifdef __CYGWIN__ | |
7565 | /* On Cygwin, avoid locale names without encoding suffix, because the | |
7566 | locale_charset() function relies on the encoding suffix. Note that | |
7567 | LC_ALL is set on the command line. */ | |
7568 | if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; | |
7569 | # endif | |
7570 | /* Check whether in the abbreviation of the second month, the second | |
7571 | character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only | |
7572 | one byte long. This excludes the UTF-8 encoding. */ | |
7573 | t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; | |
7574 | if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; | |
7575 | # if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ | |
7576 | /* Check whether the decimal separator is a comma. | |
7577 | On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point | |
7578 | are nl_langinfo(RADIXCHAR) are both ".". */ | |
7579 | if (localeconv () ->decimal_point[0] != ',') return 1; | |
7580 | # endif | |
7581 | return 0; | |
7582 | #endif | |
7583 | } | |
7584 | ||
7585 | _ACEOF | |
7586 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 | |
7587 | (eval $ac_link) 2>&5 | |
7588 | ac_status=$? | |
7589 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
7590 | test $ac_status = 0; } && test -s conftest$ac_exeext; then | |
7591 | case "$host_os" in | |
7592 | # Handle native Windows specially, because there setlocale() interprets | |
7593 | # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", | |
7594 | # "fr" or "fra" as "French" or "French_France.1252", | |
7595 | # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", | |
7596 | # "ja" as "Japanese" or "Japanese_Japan.932", | |
7597 | # and similar. | |
7598 | mingw*) | |
7599 | # Test for the native Windows locale name. | |
7600 | if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
7601 | gt_cv_locale_fr=French_France.1252 | |
7602 | else | |
7603 | # None found. | |
7604 | gt_cv_locale_fr=none | |
7605 | fi | |
7606 | ;; | |
7607 | *) | |
7608 | # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because | |
7609 | # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the | |
7610 | # configure script would override the LC_ALL setting. Likewise for | |
7611 | # LC_CTYPE, which is also set at the beginning of the configure script. | |
7612 | # Test for the usual locale name. | |
7613 | if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
7614 | gt_cv_locale_fr=fr_FR | |
7615 | else | |
7616 | # Test for the locale name with explicit encoding suffix. | |
7617 | if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
7618 | gt_cv_locale_fr=fr_FR.ISO-8859-1 | |
7619 | else | |
7620 | # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. | |
7621 | if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
7622 | gt_cv_locale_fr=fr_FR.ISO8859-1 | |
7623 | else | |
7624 | # Test for the HP-UX locale name. | |
7625 | if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
7626 | gt_cv_locale_fr=fr_FR.iso88591 | |
7627 | else | |
7628 | # Test for the Solaris 7 locale name. | |
7629 | if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
7630 | gt_cv_locale_fr=fr | |
7631 | else | |
7632 | # None found. | |
7633 | gt_cv_locale_fr=none | |
7634 | fi | |
7635 | fi | |
7636 | fi | |
7637 | fi | |
7638 | fi | |
7639 | ;; | |
7640 | esac | |
7641 | fi | |
7642 | rm -fr conftest* | |
7643 | ||
7644 | fi | |
7645 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 | |
7646 | $as_echo "$gt_cv_locale_fr" >&6; } | |
7647 | LOCALE_FR=$gt_cv_locale_fr | |
7648 | ||
7649 | ||
7650 | ||
7651 | GNULIB__EXIT=0; | |
9c9d63b1 | 7652 | GNULIB_ALIGNED_ALLOC=0; |
698be2d8 CB |
7653 | GNULIB_ATOLL=0; |
7654 | GNULIB_CALLOC_POSIX=0; | |
7655 | GNULIB_CANONICALIZE_FILE_NAME=0; | |
9c9d63b1 | 7656 | GNULIB_FREE_POSIX=0; |
698be2d8 CB |
7657 | GNULIB_GETLOADAVG=0; |
7658 | GNULIB_GETSUBOPT=0; | |
7659 | GNULIB_GRANTPT=0; | |
7660 | GNULIB_MALLOC_POSIX=0; | |
7661 | GNULIB_MBTOWC=0; | |
7662 | GNULIB_MKDTEMP=0; | |
7663 | GNULIB_MKOSTEMP=0; | |
7664 | GNULIB_MKOSTEMPS=0; | |
7665 | GNULIB_MKSTEMP=0; | |
7666 | GNULIB_MKSTEMPS=0; | |
9c9d63b1 | 7667 | GNULIB_POSIX_MEMALIGN=0; |
698be2d8 CB |
7668 | GNULIB_POSIX_OPENPT=0; |
7669 | GNULIB_PTSNAME=0; | |
7670 | GNULIB_PTSNAME_R=0; | |
7671 | GNULIB_PUTENV=0; | |
7672 | GNULIB_QSORT_R=0; | |
7673 | GNULIB_RANDOM=0; | |
7674 | GNULIB_RANDOM_R=0; | |
7675 | GNULIB_REALLOCARRAY=0; | |
7676 | GNULIB_REALLOC_POSIX=0; | |
7677 | GNULIB_REALPATH=0; | |
7678 | GNULIB_RPMATCH=0; | |
7679 | GNULIB_SECURE_GETENV=0; | |
7680 | GNULIB_SETENV=0; | |
7681 | GNULIB_STRTOD=0; | |
7682 | GNULIB_STRTOLD=0; | |
7683 | GNULIB_STRTOLL=0; | |
7684 | GNULIB_STRTOULL=0; | |
7685 | GNULIB_SYSTEM_POSIX=0; | |
7686 | GNULIB_UNLOCKPT=0; | |
7687 | GNULIB_UNSETENV=0; | |
7688 | GNULIB_WCTOMB=0; | |
9c9d63b1 PM |
7689 | GNULIB_MDA_ECVT=1; |
7690 | GNULIB_MDA_FCVT=1; | |
7691 | GNULIB_MDA_GCVT=1; | |
7692 | GNULIB_MDA_MKTEMP=1; | |
7693 | GNULIB_MDA_PUTENV=1; | |
698be2d8 | 7694 | HAVE__EXIT=1; |
9c9d63b1 | 7695 | HAVE_ALIGNED_ALLOC=1; |
698be2d8 CB |
7696 | HAVE_ATOLL=1; |
7697 | HAVE_CANONICALIZE_FILE_NAME=1; | |
9c9d63b1 PM |
7698 | HAVE_DECL_ECVT=1; |
7699 | HAVE_DECL_FCVT=1; | |
7700 | HAVE_DECL_GCVT=1; | |
698be2d8 CB |
7701 | HAVE_DECL_GETLOADAVG=1; |
7702 | HAVE_GETSUBOPT=1; | |
7703 | HAVE_GRANTPT=1; | |
7704 | HAVE_INITSTATE=1; | |
7705 | HAVE_DECL_INITSTATE=1; | |
7706 | HAVE_MBTOWC=1; | |
7707 | HAVE_MKDTEMP=1; | |
7708 | HAVE_MKOSTEMP=1; | |
7709 | HAVE_MKOSTEMPS=1; | |
7710 | HAVE_MKSTEMP=1; | |
7711 | HAVE_MKSTEMPS=1; | |
9c9d63b1 | 7712 | HAVE_POSIX_MEMALIGN=1; |
698be2d8 CB |
7713 | HAVE_POSIX_OPENPT=1; |
7714 | HAVE_PTSNAME=1; | |
7715 | HAVE_PTSNAME_R=1; | |
c0c3707f CB |
7716 | HAVE_QSORT_R=1; |
7717 | HAVE_RANDOM=1; | |
7718 | HAVE_RANDOM_H=1; | |
7719 | HAVE_RANDOM_R=1; | |
7720 | HAVE_REALLOCARRAY=1; | |
7721 | HAVE_REALPATH=1; | |
7722 | HAVE_RPMATCH=1; | |
7723 | HAVE_SECURE_GETENV=1; | |
7724 | HAVE_SETENV=1; | |
7725 | HAVE_DECL_SETENV=1; | |
7726 | HAVE_SETSTATE=1; | |
7727 | HAVE_DECL_SETSTATE=1; | |
7728 | HAVE_STRTOD=1; | |
7729 | HAVE_STRTOLD=1; | |
7730 | HAVE_STRTOLL=1; | |
7731 | HAVE_STRTOULL=1; | |
7732 | HAVE_STRUCT_RANDOM_DATA=1; | |
7733 | HAVE_SYS_LOADAVG_H=0; | |
7734 | HAVE_UNLOCKPT=1; | |
7735 | HAVE_DECL_UNSETENV=1; | |
9c9d63b1 | 7736 | REPLACE_ALIGNED_ALLOC=0; |
c0c3707f CB |
7737 | REPLACE_CALLOC=0; |
7738 | REPLACE_CANONICALIZE_FILE_NAME=0; | |
9c9d63b1 | 7739 | REPLACE_FREE=0; |
c0c3707f CB |
7740 | REPLACE_INITSTATE=0; |
7741 | REPLACE_MALLOC=0; | |
7742 | REPLACE_MBTOWC=0; | |
7743 | REPLACE_MKSTEMP=0; | |
9c9d63b1 | 7744 | REPLACE_POSIX_MEMALIGN=0; |
c0c3707f CB |
7745 | REPLACE_PTSNAME=0; |
7746 | REPLACE_PTSNAME_R=0; | |
7747 | REPLACE_PUTENV=0; | |
7748 | REPLACE_QSORT_R=0; | |
7749 | REPLACE_RANDOM=0; | |
7750 | REPLACE_RANDOM_R=0; | |
7751 | REPLACE_REALLOC=0; | |
7752 | REPLACE_REALPATH=0; | |
7753 | REPLACE_SETENV=0; | |
7754 | REPLACE_SETSTATE=0; | |
7755 | REPLACE_STRTOD=0; | |
7756 | REPLACE_STRTOLD=0; | |
7757 | REPLACE_UNSETENV=0; | |
7758 | REPLACE_WCTOMB=0; | |
7a6dbc2f | 7759 | |
7a6dbc2f | 7760 | |
9c9d63b1 PM |
7761 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 |
7762 | $as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } | |
7763 | if ${gl_cv_func_lstat_dereferences_slashed_symlink+:} false; then : | |
7764 | $as_echo_n "(cached) " >&6 | |
7765 | else | |
7766 | rm -f conftest.sym conftest.file | |
7767 | echo >conftest.file | |
7768 | if test "$cross_compiling" = yes; then : | |
7769 | case "$host_os" in | |
7770 | linux-* | linux) | |
7771 | # Guess yes on Linux systems. | |
7772 | gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; | |
7773 | *-gnu* | gnu*) | |
7774 | # Guess yes on glibc systems. | |
7775 | gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; | |
7776 | mingw*) | |
7777 | # Guess no on native Windows. | |
7778 | gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; | |
7779 | *) | |
7780 | # If we don't know, obey --enable-cross-guesses. | |
7781 | gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;; | |
7782 | esac | |
7783 | ||
7784 | else | |
7785 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
7786 | /* end confdefs.h. */ | |
7787 | $ac_includes_default | |
7788 | int | |
7789 | main () | |
7790 | { | |
7791 | struct stat sbuf; | |
7792 | if (symlink ("conftest.file", "conftest.sym") != 0) | |
7793 | return 1; | |
7794 | /* Linux will dereference the symlink and fail, as required by | |
7795 | POSIX. That is better in the sense that it means we will not | |
7796 | have to compile and use the lstat wrapper. */ | |
7797 | return lstat ("conftest.sym/", &sbuf) == 0; | |
7798 | ||
7799 | ; | |
7800 | return 0; | |
7801 | } | |
7802 | _ACEOF | |
7803 | if ac_fn_c_try_run "$LINENO"; then : | |
7804 | gl_cv_func_lstat_dereferences_slashed_symlink=yes | |
7805 | else | |
7806 | gl_cv_func_lstat_dereferences_slashed_symlink=no | |
7807 | fi | |
7808 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
7809 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
7810 | fi | |
7811 | ||
7812 | rm -f conftest.sym conftest.file | |
7813 | ||
7814 | fi | |
7815 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5 | |
7816 | $as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; } | |
7817 | case "$gl_cv_func_lstat_dereferences_slashed_symlink" in | |
7818 | *yes) | |
7819 | ||
7820 | cat >>confdefs.h <<_ACEOF | |
7821 | #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 | |
7822 | _ACEOF | |
7823 | ||
7824 | ;; | |
7825 | esac | |
98399780 | 7826 | |
98399780 | 7827 | |
472fa5ee SM |
7828 | |
7829 | ||
7830 | ||
7831 | ||
7832 | ||
c0c3707f CB |
7833 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 |
7834 | $as_echo_n "checking whether // is distinct from /... " >&6; } | |
7835 | if ${gl_cv_double_slash_root+:} false; then : | |
7836 | $as_echo_n "(cached) " >&6 | |
5e8754f9 | 7837 | else |
c0c3707f CB |
7838 | if test x"$cross_compiling" = xyes ; then |
7839 | # When cross-compiling, there is no way to tell whether // is special | |
7840 | # short of a list of hosts. However, the only known hosts to date | |
7841 | # that have a distinct // are Apollo DomainOS (too old to port to), | |
7842 | # Cygwin, and z/OS. If anyone knows of another system for which // has | |
7843 | # special semantics and is distinct from /, please report it to | |
7844 | # <bug-gnulib@gnu.org>. | |
7845 | case $host in | |
7846 | *-cygwin | i370-ibm-openedition) | |
7847 | gl_cv_double_slash_root=yes ;; | |
7848 | *) | |
7849 | # Be optimistic and assume that / and // are the same when we | |
7850 | # don't know. | |
7851 | gl_cv_double_slash_root='unknown, assuming no' ;; | |
7852 | esac | |
7853 | else | |
7854 | set x `ls -di / // 2>/dev/null` | |
7855 | if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then | |
7856 | gl_cv_double_slash_root=no | |
7857 | else | |
7858 | gl_cv_double_slash_root=yes | |
7859 | fi | |
7860 | fi | |
5e8754f9 | 7861 | fi |
c0c3707f CB |
7862 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 |
7863 | $as_echo "$gl_cv_double_slash_root" >&6; } | |
7864 | if test "$gl_cv_double_slash_root" = yes; then | |
472fa5ee | 7865 | |
c0c3707f | 7866 | $as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h |
472fa5ee | 7867 | |
c0c3707f | 7868 | fi |
472fa5ee SM |
7869 | |
7870 | ||
472fa5ee | 7871 | |
c0c3707f CB |
7872 | |
7873 | ||
7874 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether realpath works" >&5 | |
7875 | $as_echo_n "checking whether realpath works... " >&6; } | |
7876 | if ${gl_cv_func_realpath_works+:} false; then : | |
5e8754f9 SDJ |
7877 | $as_echo_n "(cached) " >&6 |
7878 | else | |
c0c3707f | 7879 | |
9c9d63b1 | 7880 | rm -rf conftest.a conftest.d |
c0c3707f CB |
7881 | touch conftest.a |
7882 | mkdir conftest.d | |
7883 | if test "$cross_compiling" = yes; then : | |
7884 | case "$host_os" in | |
7885 | # Guess yes on glibc systems. | |
7886 | *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;; | |
7887 | # Guess yes on musl systems. | |
7888 | *-musl*) gl_cv_func_realpath_works="guessing yes" ;; | |
7889 | # Guess no on native Windows. | |
7890 | mingw*) gl_cv_func_realpath_works="guessing no" ;; | |
7891 | # If we don't know, obey --enable-cross-guesses. | |
7892 | *) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;; | |
7893 | esac | |
7894 | ||
5e8754f9 SDJ |
7895 | else |
7896 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
7897 | /* end confdefs.h. */ | |
c0c3707f CB |
7898 | |
7899 | ||
7900 | ||
7901 | #include <stdlib.h> | |
7902 | #if defined __MACH__ && defined __APPLE__ | |
7903 | /* Avoid a crash on Mac OS X. */ | |
7904 | #include <mach/mach.h> | |
7905 | #include <mach/mach_error.h> | |
7906 | #include <mach/thread_status.h> | |
7907 | #include <mach/exception.h> | |
7908 | #include <mach/task.h> | |
7909 | #include <pthread.h> | |
7910 | /* The exception port on which our thread listens. */ | |
7911 | static mach_port_t our_exception_port; | |
7912 | /* The main function of the thread listening for exceptions of type | |
7913 | EXC_BAD_ACCESS. */ | |
7914 | static void * | |
7915 | mach_exception_thread (void *arg) | |
5e8754f9 | 7916 | { |
c0c3707f CB |
7917 | /* Buffer for a message to be received. */ |
7918 | struct { | |
7919 | mach_msg_header_t head; | |
7920 | mach_msg_body_t msgh_body; | |
7921 | char data[1024]; | |
7922 | } msg; | |
7923 | mach_msg_return_t retval; | |
7924 | /* Wait for a message on the exception port. */ | |
7925 | retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), | |
7926 | our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); | |
7927 | if (retval != MACH_MSG_SUCCESS) | |
7928 | abort (); | |
7929 | exit (1); | |
7930 | } | |
7931 | static void | |
7932 | nocrash_init (void) | |
7933 | { | |
7934 | mach_port_t self = mach_task_self (); | |
7935 | /* Allocate a port on which the thread shall listen for exceptions. */ | |
7936 | if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) | |
7937 | == KERN_SUCCESS) { | |
7938 | /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ | |
7939 | if (mach_port_insert_right (self, our_exception_port, our_exception_port, | |
7940 | MACH_MSG_TYPE_MAKE_SEND) | |
7941 | == KERN_SUCCESS) { | |
7942 | /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting | |
7943 | for us. */ | |
7944 | exception_mask_t mask = EXC_MASK_BAD_ACCESS; | |
7945 | /* Create the thread listening on the exception port. */ | |
7946 | pthread_attr_t attr; | |
7947 | pthread_t thread; | |
7948 | if (pthread_attr_init (&attr) == 0 | |
7949 | && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 | |
7950 | && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { | |
7951 | pthread_attr_destroy (&attr); | |
7952 | /* Replace the exception port info for these exceptions with our own. | |
7953 | Note that we replace the exception port for the entire task, not only | |
7954 | for a particular thread. This has the effect that when our exception | |
7955 | port gets the message, the thread specific exception port has already | |
7956 | been asked, and we don't need to bother about it. | |
7957 | See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ | |
7958 | task_set_exception_ports (self, mask, our_exception_port, | |
7959 | EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); | |
7960 | } | |
7961 | } | |
7962 | } | |
7963 | } | |
7964 | #elif defined _WIN32 && ! defined __CYGWIN__ | |
7965 | /* Avoid a crash on native Windows. */ | |
7966 | #define WIN32_LEAN_AND_MEAN | |
7967 | #include <windows.h> | |
7968 | #include <winerror.h> | |
7969 | static LONG WINAPI | |
7970 | exception_filter (EXCEPTION_POINTERS *ExceptionInfo) | |
7971 | { | |
7972 | switch (ExceptionInfo->ExceptionRecord->ExceptionCode) | |
7973 | { | |
7974 | case EXCEPTION_ACCESS_VIOLATION: | |
7975 | case EXCEPTION_IN_PAGE_ERROR: | |
7976 | case EXCEPTION_STACK_OVERFLOW: | |
7977 | case EXCEPTION_GUARD_PAGE: | |
7978 | case EXCEPTION_PRIV_INSTRUCTION: | |
7979 | case EXCEPTION_ILLEGAL_INSTRUCTION: | |
7980 | case EXCEPTION_DATATYPE_MISALIGNMENT: | |
7981 | case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: | |
7982 | case EXCEPTION_NONCONTINUABLE_EXCEPTION: | |
7983 | exit (1); | |
7984 | } | |
7985 | return EXCEPTION_CONTINUE_SEARCH; | |
7986 | } | |
7987 | static void | |
7988 | nocrash_init (void) | |
7989 | { | |
7990 | SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); | |
7991 | } | |
7992 | #else | |
7993 | /* Avoid a crash on POSIX systems. */ | |
7994 | #include <signal.h> | |
7995 | #include <unistd.h> | |
7996 | /* A POSIX signal handler. */ | |
7997 | static void | |
7998 | exception_handler (int sig) | |
7999 | { | |
8000 | _exit (1); | |
8001 | } | |
8002 | static void | |
8003 | nocrash_init (void) | |
8004 | { | |
8005 | #ifdef SIGSEGV | |
8006 | signal (SIGSEGV, exception_handler); | |
8007 | #endif | |
8008 | #ifdef SIGBUS | |
8009 | signal (SIGBUS, exception_handler); | |
8010 | #endif | |
5e8754f9 | 8011 | } |
c0c3707f CB |
8012 | #endif |
8013 | ||
8014 | #include <stdlib.h> | |
8015 | #include <string.h> | |
472fa5ee | 8016 | |
5e8754f9 | 8017 | int |
c0c3707f | 8018 | main () |
5e8754f9 | 8019 | { |
c0c3707f CB |
8020 | |
8021 | int result = 0; | |
8022 | { | |
8023 | char *name = realpath ("conftest.a", NULL); | |
8024 | if (!(name && *name == '/')) | |
8025 | result |= 1; | |
8026 | free (name); | |
8027 | } | |
8028 | { | |
8029 | char *name = realpath ("conftest.b/../conftest.a", NULL); | |
8030 | if (name != NULL) | |
8031 | result |= 2; | |
8032 | free (name); | |
8033 | } | |
8034 | { | |
8035 | char *name = realpath ("conftest.a/", NULL); | |
8036 | if (name != NULL) | |
8037 | result |= 4; | |
8038 | free (name); | |
8039 | } | |
8040 | { | |
8041 | char *name1 = realpath (".", NULL); | |
8042 | char *name2 = realpath ("conftest.d//./..", NULL); | |
8043 | if (! name1 || ! name2 || strcmp (name1, name2)) | |
8044 | result |= 8; | |
8045 | free (name1); | |
8046 | free (name2); | |
8047 | } | |
8048 | return result; | |
8049 | ||
8050 | ; | |
8051 | return 0; | |
5e8754f9 | 8052 | } |
c0c3707f | 8053 | |
5e8754f9 SDJ |
8054 | _ACEOF |
8055 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 8056 | gl_cv_func_realpath_works=yes |
5e8754f9 | 8057 | else |
c0c3707f | 8058 | gl_cv_func_realpath_works=no |
5e8754f9 SDJ |
8059 | fi |
8060 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
8061 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
8062 | fi | |
472fa5ee | 8063 | |
c0c3707f | 8064 | rm -rf conftest.a conftest.d |
98399780 | 8065 | |
5e8754f9 | 8066 | fi |
c0c3707f CB |
8067 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_realpath_works" >&5 |
8068 | $as_echo "$gl_cv_func_realpath_works" >&6; } | |
8069 | case "$gl_cv_func_realpath_works" in | |
8070 | *yes) | |
98399780 | 8071 | |
c0c3707f | 8072 | $as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h |
98399780 | 8073 | |
c0c3707f CB |
8074 | ;; |
8075 | esac | |
725e2999 JB |
8076 | |
8077 | ||
725e2999 | 8078 | |
725e2999 | 8079 | |
725e2999 JB |
8080 | |
8081 | ||
8082 | ||
8083 | ||
8084 | ||
9c9d63b1 PM |
8085 | case "$host_os" in |
8086 | mingw*) ;; | |
8087 | *) for ac_func in getcwd | |
8088 | do : | |
8089 | ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd" | |
8090 | if test "x$ac_cv_func_getcwd" = xyes; then : | |
8091 | cat >>confdefs.h <<_ACEOF | |
8092 | #define HAVE_GETCWD 1 | |
8093 | _ACEOF | |
8094 | ||
8095 | fi | |
8096 | done | |
8097 | ;; | |
8098 | esac | |
8099 | ||
8100 | ||
8101 | ||
8102 | ||
725e2999 JB |
8103 | |
8104 | ||
c0c3707f CB |
8105 | GNULIB_ACCESS=0; |
8106 | GNULIB_CHDIR=0; | |
8107 | GNULIB_CHOWN=0; | |
8108 | GNULIB_CLOSE=0; | |
8109 | GNULIB_COPY_FILE_RANGE=0; | |
8110 | GNULIB_DUP=0; | |
8111 | GNULIB_DUP2=0; | |
8112 | GNULIB_DUP3=0; | |
8113 | GNULIB_ENVIRON=0; | |
8114 | GNULIB_EUIDACCESS=0; | |
9c9d63b1 PM |
8115 | GNULIB_EXECL=0; |
8116 | GNULIB_EXECLE=0; | |
8117 | GNULIB_EXECLP=0; | |
8118 | GNULIB_EXECV=0; | |
8119 | GNULIB_EXECVE=0; | |
8120 | GNULIB_EXECVP=0; | |
8121 | GNULIB_EXECVPE=0; | |
c0c3707f CB |
8122 | GNULIB_FACCESSAT=0; |
8123 | GNULIB_FCHDIR=0; | |
8124 | GNULIB_FCHOWNAT=0; | |
8125 | GNULIB_FDATASYNC=0; | |
8126 | GNULIB_FSYNC=0; | |
8127 | GNULIB_FTRUNCATE=0; | |
8128 | GNULIB_GETCWD=0; | |
8129 | GNULIB_GETDOMAINNAME=0; | |
8130 | GNULIB_GETDTABLESIZE=0; | |
698be2d8 | 8131 | GNULIB_GETENTROPY=0; |
c0c3707f CB |
8132 | GNULIB_GETGROUPS=0; |
8133 | GNULIB_GETHOSTNAME=0; | |
8134 | GNULIB_GETLOGIN=0; | |
8135 | GNULIB_GETLOGIN_R=0; | |
5df4cba6 | 8136 | GNULIB_GETOPT_POSIX=0; |
c0c3707f CB |
8137 | GNULIB_GETPAGESIZE=0; |
8138 | GNULIB_GETPASS=0; | |
8139 | GNULIB_GETUSERSHELL=0; | |
8140 | GNULIB_GROUP_MEMBER=0; | |
8141 | GNULIB_ISATTY=0; | |
8142 | GNULIB_LCHOWN=0; | |
8143 | GNULIB_LINK=0; | |
8144 | GNULIB_LINKAT=0; | |
8145 | GNULIB_LSEEK=0; | |
8146 | GNULIB_PIPE=0; | |
8147 | GNULIB_PIPE2=0; | |
8148 | GNULIB_PREAD=0; | |
8149 | GNULIB_PWRITE=0; | |
8150 | GNULIB_READ=0; | |
8151 | GNULIB_READLINK=0; | |
8152 | GNULIB_READLINKAT=0; | |
8153 | GNULIB_RMDIR=0; | |
8154 | GNULIB_SETHOSTNAME=0; | |
8155 | GNULIB_SLEEP=0; | |
8156 | GNULIB_SYMLINK=0; | |
8157 | GNULIB_SYMLINKAT=0; | |
8158 | GNULIB_TRUNCATE=0; | |
8159 | GNULIB_TTYNAME_R=0; | |
8160 | GNULIB_UNISTD_H_NONBLOCKING=0; | |
8161 | GNULIB_UNISTD_H_SIGPIPE=0; | |
8162 | GNULIB_UNLINK=0; | |
8163 | GNULIB_UNLINKAT=0; | |
8164 | GNULIB_USLEEP=0; | |
8165 | GNULIB_WRITE=0; | |
9c9d63b1 PM |
8166 | GNULIB_MDA_ACCESS=1; |
8167 | GNULIB_MDA_CHDIR=1; | |
8168 | GNULIB_MDA_CLOSE=1; | |
8169 | GNULIB_MDA_DUP=1; | |
8170 | GNULIB_MDA_DUP2=1; | |
8171 | GNULIB_MDA_EXECL=1; | |
8172 | GNULIB_MDA_EXECLE=1; | |
8173 | GNULIB_MDA_EXECLP=1; | |
8174 | GNULIB_MDA_EXECV=1; | |
8175 | GNULIB_MDA_EXECVE=1; | |
8176 | GNULIB_MDA_EXECVP=1; | |
8177 | GNULIB_MDA_EXECVPE=1; | |
8178 | GNULIB_MDA_GETCWD=1; | |
8179 | GNULIB_MDA_GETPID=1; | |
8180 | GNULIB_MDA_ISATTY=1; | |
8181 | GNULIB_MDA_LSEEK=1; | |
8182 | GNULIB_MDA_READ=1; | |
8183 | GNULIB_MDA_RMDIR=1; | |
8184 | GNULIB_MDA_SWAB=1; | |
8185 | GNULIB_MDA_UNLINK=1; | |
8186 | GNULIB_MDA_WRITE=1; | |
c0c3707f CB |
8187 | HAVE_CHOWN=1; |
8188 | HAVE_COPY_FILE_RANGE=1; | |
c0c3707f CB |
8189 | HAVE_DUP3=1; |
8190 | HAVE_EUIDACCESS=1; | |
9c9d63b1 | 8191 | HAVE_EXECVPE=1; |
c0c3707f CB |
8192 | HAVE_FACCESSAT=1; |
8193 | HAVE_FCHDIR=1; | |
8194 | HAVE_FCHOWNAT=1; | |
8195 | HAVE_FDATASYNC=1; | |
8196 | HAVE_FSYNC=1; | |
8197 | HAVE_FTRUNCATE=1; | |
8198 | HAVE_GETDTABLESIZE=1; | |
698be2d8 | 8199 | HAVE_GETENTROPY=1; |
c0c3707f CB |
8200 | HAVE_GETGROUPS=1; |
8201 | HAVE_GETHOSTNAME=1; | |
8202 | HAVE_GETLOGIN=1; | |
8203 | HAVE_GETPAGESIZE=1; | |
8204 | HAVE_GETPASS=1; | |
8205 | HAVE_GROUP_MEMBER=1; | |
8206 | HAVE_LCHOWN=1; | |
8207 | HAVE_LINK=1; | |
8208 | HAVE_LINKAT=1; | |
8209 | HAVE_PIPE=1; | |
8210 | HAVE_PIPE2=1; | |
8211 | HAVE_PREAD=1; | |
8212 | HAVE_PWRITE=1; | |
8213 | HAVE_READLINK=1; | |
8214 | HAVE_READLINKAT=1; | |
8215 | HAVE_SETHOSTNAME=1; | |
8216 | HAVE_SLEEP=1; | |
8217 | HAVE_SYMLINK=1; | |
8218 | HAVE_SYMLINKAT=1; | |
8219 | HAVE_UNLINKAT=1; | |
8220 | HAVE_USLEEP=1; | |
8221 | HAVE_DECL_ENVIRON=1; | |
9c9d63b1 | 8222 | HAVE_DECL_EXECVPE=1; |
c0c3707f CB |
8223 | HAVE_DECL_FCHDIR=1; |
8224 | HAVE_DECL_FDATASYNC=1; | |
8225 | HAVE_DECL_GETDOMAINNAME=1; | |
8226 | HAVE_DECL_GETLOGIN=1; | |
8227 | HAVE_DECL_GETLOGIN_R=1; | |
8228 | HAVE_DECL_GETPAGESIZE=1; | |
8229 | HAVE_DECL_GETUSERSHELL=1; | |
8230 | HAVE_DECL_SETHOSTNAME=1; | |
8231 | HAVE_DECL_TRUNCATE=1; | |
8232 | HAVE_DECL_TTYNAME_R=1; | |
8233 | HAVE_OS_H=0; | |
8234 | HAVE_SYS_PARAM_H=0; | |
8235 | REPLACE_ACCESS=0; | |
8236 | REPLACE_CHOWN=0; | |
8237 | REPLACE_CLOSE=0; | |
8238 | REPLACE_DUP=0; | |
8239 | REPLACE_DUP2=0; | |
9c9d63b1 PM |
8240 | REPLACE_EXECL=0; |
8241 | REPLACE_EXECLE=0; | |
8242 | REPLACE_EXECLP=0; | |
8243 | REPLACE_EXECV=0; | |
8244 | REPLACE_EXECVE=0; | |
8245 | REPLACE_EXECVP=0; | |
8246 | REPLACE_EXECVPE=0; | |
c0c3707f CB |
8247 | REPLACE_FACCESSAT=0; |
8248 | REPLACE_FCHOWNAT=0; | |
8249 | REPLACE_FTRUNCATE=0; | |
8250 | REPLACE_GETCWD=0; | |
8251 | REPLACE_GETDOMAINNAME=0; | |
8252 | REPLACE_GETDTABLESIZE=0; | |
8253 | REPLACE_GETLOGIN_R=0; | |
8254 | REPLACE_GETGROUPS=0; | |
8255 | REPLACE_GETPAGESIZE=0; | |
8256 | REPLACE_GETPASS=0; | |
8257 | REPLACE_ISATTY=0; | |
8258 | REPLACE_LCHOWN=0; | |
8259 | REPLACE_LINK=0; | |
8260 | REPLACE_LINKAT=0; | |
8261 | REPLACE_LSEEK=0; | |
8262 | REPLACE_PREAD=0; | |
8263 | REPLACE_PWRITE=0; | |
8264 | REPLACE_READ=0; | |
8265 | REPLACE_READLINK=0; | |
8266 | REPLACE_READLINKAT=0; | |
8267 | REPLACE_RMDIR=0; | |
8268 | REPLACE_SLEEP=0; | |
8269 | REPLACE_SYMLINK=0; | |
8270 | REPLACE_SYMLINKAT=0; | |
8271 | REPLACE_TRUNCATE=0; | |
8272 | REPLACE_TTYNAME_R=0; | |
8273 | REPLACE_UNLINK=0; | |
8274 | REPLACE_UNLINKAT=0; | |
8275 | REPLACE_USLEEP=0; | |
8276 | REPLACE_WRITE=0; | |
698be2d8 | 8277 | UNISTD_H_HAVE_SYS_RANDOM_H=0; |
c0c3707f CB |
8278 | UNISTD_H_HAVE_WINSOCK2_H=0; |
8279 | UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; | |
725e2999 | 8280 | |
725e2999 | 8281 | |
725e2999 JB |
8282 | |
8283 | ||
8284 | ||
725e2999 | 8285 | |
725e2999 | 8286 | |
64c2e4a5 MF |
8287 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 |
8288 | $as_echo_n "checking for uid_t in sys/types.h... " >&6; } | |
8289 | if ${ac_cv_type_uid_t+:} false; then : | |
8290 | $as_echo_n "(cached) " >&6 | |
8291 | else | |
8292 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8293 | /* end confdefs.h. */ | |
8294 | #include <sys/types.h> | |
725e2999 | 8295 | |
64c2e4a5 MF |
8296 | _ACEOF |
8297 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
8298 | $EGREP "uid_t" >/dev/null 2>&1; then : | |
8299 | ac_cv_type_uid_t=yes | |
8300 | else | |
8301 | ac_cv_type_uid_t=no | |
8302 | fi | |
8303 | rm -f conftest* | |
725e2999 | 8304 | |
64c2e4a5 MF |
8305 | fi |
8306 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 | |
8307 | $as_echo "$ac_cv_type_uid_t" >&6; } | |
8308 | if test $ac_cv_type_uid_t = no; then | |
c0c3707f | 8309 | |
64c2e4a5 | 8310 | $as_echo "#define uid_t int" >>confdefs.h |
c0c3707f | 8311 | |
698be2d8 | 8312 | |
64c2e4a5 | 8313 | $as_echo "#define gid_t int" >>confdefs.h |
698be2d8 | 8314 | |
64c2e4a5 | 8315 | fi |
725e2999 | 8316 | |
9c9d63b1 PM |
8317 | gl_mda_defines=' |
8318 | #if defined _WIN32 && !defined __CYGWIN__ | |
8319 | #define access _access | |
8320 | #define chdir _chdir | |
8321 | #define chmod _chmod | |
8322 | #define close _close | |
8323 | #define creat _creat | |
8324 | #define dup _dup | |
8325 | #define dup2 _dup2 | |
8326 | #define ecvt _ecvt | |
8327 | #define execl _execl | |
8328 | #define execle _execle | |
8329 | #define execlp _execlp | |
8330 | #define execv _execv | |
8331 | #define execve _execve | |
8332 | #define execvp _execvp | |
8333 | #define execvpe _execvpe | |
8334 | #define fcloseall _fcloseall | |
8335 | #define fcvt _fcvt | |
8336 | #define fdopen _fdopen | |
8337 | #define fileno _fileno | |
8338 | #define gcvt _gcvt | |
8339 | #define getcwd _getcwd | |
8340 | #define getpid _getpid | |
8341 | #define getw _getw | |
8342 | #define isatty _isatty | |
8343 | #define j0 _j0 | |
8344 | #define j1 _j1 | |
8345 | #define jn _jn | |
8346 | #define lfind _lfind | |
8347 | #define lsearch _lsearch | |
8348 | #define lseek _lseek | |
8349 | #define memccpy _memccpy | |
8350 | #define mkdir _mkdir | |
8351 | #define mktemp _mktemp | |
8352 | #define open _open | |
8353 | #define putenv _putenv | |
8354 | #define putw _putw | |
8355 | #define read _read | |
8356 | #define rmdir _rmdir | |
8357 | #define strdup _strdup | |
8358 | #define swab _swab | |
8359 | #define tempnam _tempnam | |
8360 | #define tzset _tzset | |
8361 | #define umask _umask | |
8362 | #define unlink _unlink | |
8363 | #define utime _utime | |
8364 | #define wcsdup _wcsdup | |
8365 | #define write _write | |
8366 | #define y0 _y0 | |
8367 | #define y1 _y1 | |
8368 | #define yn _yn | |
8369 | #endif | |
8370 | ' | |
8371 | ||
725e2999 | 8372 | |
64c2e4a5 MF |
8373 | for ac_header in unistd.h |
8374 | do : | |
8375 | ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" | |
8376 | if test "x$ac_cv_header_unistd_h" = xyes; then : | |
8377 | cat >>confdefs.h <<_ACEOF | |
8378 | #define HAVE_UNISTD_H 1 | |
8379 | _ACEOF | |
8380 | ||
8381 | fi | |
8382 | ||
8383 | done | |
8384 | ||
8385 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5 | |
8386 | $as_echo_n "checking for working chown... " >&6; } | |
8387 | if ${ac_cv_func_chown_works+:} false; then : | |
8388 | $as_echo_n "(cached) " >&6 | |
8389 | else | |
8390 | if test "$cross_compiling" = yes; then : | |
8391 | case "$host_os" in # (( | |
8392 | # Guess yes on Linux systems. | |
8393 | linux-* | linux) ac_cv_func_chown_works="guessing yes" ;; | |
8394 | # Guess yes on glibc systems. | |
8395 | *-gnu* | gnu*) ac_cv_func_chown_works="guessing yes" ;; | |
8396 | # Guess no on native Windows. | |
8397 | mingw*) ac_cv_func_chown_works="guessing no" ;; | |
8398 | # If we don't know, obey --enable-cross-guesses. | |
8399 | *) ac_cv_func_chown_works="$gl_cross_guess_normal" ;; | |
8400 | esac | |
8401 | ||
8402 | else | |
8403 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8404 | /* end confdefs.h. */ | |
8405 | $ac_includes_default | |
8406 | #include <fcntl.h> | |
8407 | ||
8408 | ||
8409 | $gl_mda_defines | |
8410 | ||
8411 | int | |
8412 | main () | |
8413 | { | |
8414 | ||
8415 | char *f = "conftest.chown"; | |
8416 | struct stat before, after; | |
8417 | ||
8418 | if (creat (f, 0600) < 0) | |
8419 | return 1; | |
8420 | if (stat (f, &before) < 0) | |
8421 | return 1; | |
8422 | if (chown (f, (uid_t) -1, (gid_t) -1) == -1) | |
8423 | return 1; | |
8424 | if (stat (f, &after) < 0) | |
8425 | return 1; | |
8426 | return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid); | |
8427 | ||
8428 | ; | |
8429 | return 0; | |
8430 | } | |
8431 | ||
8432 | _ACEOF | |
8433 | if ac_fn_c_try_run "$LINENO"; then : | |
8434 | ac_cv_func_chown_works=yes | |
8435 | else | |
8436 | ac_cv_func_chown_works=no | |
8437 | fi | |
8438 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
8439 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
8440 | fi | |
8441 | ||
8442 | rm -f conftest.chown | |
8443 | ||
8444 | fi | |
8445 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5 | |
8446 | $as_echo "$ac_cv_func_chown_works" >&6; } | |
8447 | case "$ac_cv_func_chown_works" in | |
8448 | *yes) | |
8449 | ||
8450 | $as_echo "#define HAVE_CHOWN 1" >>confdefs.h | |
8451 | ||
8452 | ;; | |
8453 | esac | |
8454 | ||
8455 | ||
8456 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether chown dereferences symlinks" >&5 | |
8457 | $as_echo_n "checking whether chown dereferences symlinks... " >&6; } | |
8458 | if ${gl_cv_func_chown_follows_symlink+:} false; then : | |
8459 | $as_echo_n "(cached) " >&6 | |
8460 | else | |
8461 | ||
8462 | if test "$cross_compiling" = yes; then : | |
8463 | gl_cv_func_chown_follows_symlink="guessing yes" | |
8464 | ||
8465 | else | |
8466 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8467 | /* end confdefs.h. */ | |
8468 | ||
8469 | #include <unistd.h> | |
8470 | #include <stdlib.h> | |
8471 | #include <errno.h> | |
8472 | ||
8473 | ||
8474 | $gl_mda_defines | |
8475 | ||
8476 | int | |
8477 | main () | |
8478 | { | |
8479 | int result = 0; | |
8480 | char const *dangling_symlink = "conftest.dangle"; | |
8481 | ||
8482 | unlink (dangling_symlink); | |
8483 | if (symlink ("conftest.no-such", dangling_symlink)) | |
8484 | abort (); | |
8485 | ||
8486 | /* Exit successfully on a conforming system, | |
8487 | i.e., where chown must fail with ENOENT. */ | |
8488 | if (chown (dangling_symlink, getuid (), getgid ()) == 0) | |
8489 | result |= 1; | |
8490 | if (errno != ENOENT) | |
8491 | result |= 2; | |
8492 | return result; | |
8493 | } | |
8494 | ||
8495 | _ACEOF | |
8496 | if ac_fn_c_try_run "$LINENO"; then : | |
8497 | gl_cv_func_chown_follows_symlink=yes | |
8498 | else | |
8499 | gl_cv_func_chown_follows_symlink=no | |
8500 | fi | |
8501 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
8502 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
8503 | fi | |
8504 | ||
8505 | ||
8506 | ||
8507 | fi | |
8508 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_chown_follows_symlink" >&5 | |
8509 | $as_echo "$gl_cv_func_chown_follows_symlink" >&6; } | |
8510 | ||
8511 | case "$gl_cv_func_chown_follows_symlink" in | |
8512 | *yes) ;; | |
8513 | *) | |
8514 | ||
8515 | $as_echo "#define CHOWN_MODIFIES_SYMLINK 1" >>confdefs.h | |
8516 | ||
8517 | ;; | |
8518 | esac | |
8519 | ||
8520 | ||
8521 | ||
8522 | ||
8523 | ||
8524 | ||
8525 | ||
8526 | ||
8527 | ||
8528 | ||
8529 | ||
8530 | ||
8531 | if test $ac_cv_func_chown = no; then | |
8532 | HAVE_CHOWN=0 | |
8533 | else | |
8534 | case "$gl_cv_func_chown_follows_symlink" in | |
8535 | *yes) ;; | |
8536 | *) REPLACE_CHOWN=1 ;; | |
8537 | esac | |
8538 | ||
8539 | case "$ac_cv_func_chown_works" in | |
8540 | *no) | |
8541 | ||
8542 | $as_echo "#define CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE 1" >>confdefs.h | |
8543 | ||
8544 | REPLACE_CHOWN=1 | |
8545 | ;; | |
8546 | esac | |
8547 | ||
8548 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether chown honors trailing slash" >&5 | |
8549 | $as_echo_n "checking whether chown honors trailing slash... " >&6; } | |
8550 | if ${gl_cv_func_chown_slash_works+:} false; then : | |
8551 | $as_echo_n "(cached) " >&6 | |
8552 | else | |
8553 | touch conftest.file && rm -f conftest.link | |
8554 | if test "$cross_compiling" = yes; then : | |
8555 | case "$host_os" in | |
8556 | # Guess yes on glibc systems. | |
8557 | *-gnu*) gl_cv_func_chown_slash_works="guessing yes" ;; | |
8558 | # Guess yes on musl systems. | |
8559 | *-musl*) gl_cv_func_chown_slash_works="guessing yes" ;; | |
8560 | # If we don't know, obey --enable-cross-guesses. | |
8561 | *) gl_cv_func_chown_slash_works="$gl_cross_guess_normal" ;; | |
8562 | esac | |
8563 | ||
8564 | else | |
8565 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8566 | /* end confdefs.h. */ | |
8567 | ||
8568 | #include <unistd.h> | |
8569 | #include <stdlib.h> | |
8570 | #include <errno.h> | |
8571 | ||
8572 | ||
8573 | $gl_mda_defines | |
8574 | ||
8575 | int | |
8576 | main () | |
8577 | { | |
8578 | if (symlink ("conftest.file", "conftest.link")) return 1; | |
8579 | if (chown ("conftest.link/", getuid (), getgid ()) == 0) return 2; | |
8580 | ||
8581 | ; | |
8582 | return 0; | |
8583 | } | |
8584 | _ACEOF | |
8585 | if ac_fn_c_try_run "$LINENO"; then : | |
8586 | gl_cv_func_chown_slash_works=yes | |
8587 | else | |
8588 | gl_cv_func_chown_slash_works=no | |
8589 | fi | |
8590 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
8591 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
8592 | fi | |
8593 | ||
8594 | rm -f conftest.link conftest.file | |
8595 | fi | |
8596 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_chown_slash_works" >&5 | |
8597 | $as_echo "$gl_cv_func_chown_slash_works" >&6; } | |
8598 | case "$gl_cv_func_chown_slash_works" in | |
8599 | *yes) ;; | |
8600 | *) | |
8601 | ||
8602 | $as_echo "#define CHOWN_TRAILING_SLASH_BUG 1" >>confdefs.h | |
8603 | ||
8604 | REPLACE_CHOWN=1 | |
8605 | ;; | |
8606 | esac | |
8607 | ||
8608 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether chown always updates ctime" >&5 | |
8609 | $as_echo_n "checking whether chown always updates ctime... " >&6; } | |
8610 | if ${gl_cv_func_chown_ctime_works+:} false; then : | |
8611 | $as_echo_n "(cached) " >&6 | |
8612 | else | |
8613 | if test "$cross_compiling" = yes; then : | |
8614 | case "$host_os" in | |
8615 | # Guess yes on glibc systems. | |
8616 | *-gnu*) gl_cv_func_chown_ctime_works="guessing yes" ;; | |
8617 | # Guess yes on musl systems. | |
8618 | *-musl*) gl_cv_func_chown_ctime_works="guessing yes" ;; | |
8619 | # If we don't know, obey --enable-cross-guesses. | |
8620 | *) gl_cv_func_chown_ctime_works="$gl_cross_guess_normal" ;; | |
8621 | esac | |
8622 | ||
8623 | else | |
8624 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8625 | /* end confdefs.h. */ | |
8626 | ||
8627 | #include <unistd.h> | |
8628 | #include <stdlib.h> | |
8629 | #include <errno.h> | |
8630 | #include <fcntl.h> | |
8631 | #include <sys/stat.h> | |
8632 | ||
8633 | ||
8634 | $gl_mda_defines | |
8635 | ||
8636 | int | |
8637 | main () | |
8638 | { | |
8639 | struct stat st1, st2; | |
8640 | if (close (creat ("conftest.file", 0600))) return 1; | |
8641 | if (stat ("conftest.file", &st1)) return 2; | |
8642 | sleep (1); | |
8643 | if (chown ("conftest.file", st1.st_uid, st1.st_gid)) return 3; | |
8644 | if (stat ("conftest.file", &st2)) return 4; | |
8645 | if (st2.st_ctime <= st1.st_ctime) return 5; | |
8646 | ||
8647 | ; | |
8648 | return 0; | |
8649 | } | |
8650 | _ACEOF | |
8651 | if ac_fn_c_try_run "$LINENO"; then : | |
8652 | gl_cv_func_chown_ctime_works=yes | |
8653 | else | |
8654 | gl_cv_func_chown_ctime_works=no | |
8655 | fi | |
8656 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
8657 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
8658 | fi | |
8659 | ||
8660 | rm -f conftest.file | |
8661 | fi | |
8662 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_chown_ctime_works" >&5 | |
8663 | $as_echo "$gl_cv_func_chown_ctime_works" >&6; } | |
8664 | case "$gl_cv_func_chown_ctime_works" in | |
8665 | *yes) ;; | |
8666 | *) | |
8667 | ||
8668 | $as_echo "#define CHOWN_CHANGE_TIME_BUG 1" >>confdefs.h | |
8669 | ||
8670 | REPLACE_CHOWN=1 | |
8671 | ;; | |
8672 | esac | |
8673 | fi | |
8674 | ||
8675 | ||
8676 | ||
8677 | ||
8678 | ||
8679 | if test $ac_cv_func__set_invalid_parameter_handler = yes; then | |
8680 | HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 | |
8681 | ||
8682 | $as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h | |
8683 | ||
8684 | else | |
8685 | HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 | |
8686 | fi | |
8687 | ||
8688 | ||
8689 | ||
8690 | ||
8691 | ||
8692 | GNULIB_OPENDIR=0; | |
8693 | GNULIB_READDIR=0; | |
8694 | GNULIB_REWINDDIR=0; | |
8695 | GNULIB_CLOSEDIR=0; | |
8696 | GNULIB_DIRFD=0; | |
8697 | GNULIB_FDOPENDIR=0; | |
8698 | GNULIB_SCANDIR=0; | |
8699 | GNULIB_ALPHASORT=0; | |
8700 | HAVE_OPENDIR=1; | |
8701 | HAVE_READDIR=1; | |
8702 | HAVE_REWINDDIR=1; | |
8703 | HAVE_CLOSEDIR=1; | |
8704 | HAVE_DECL_DIRFD=1; | |
8705 | HAVE_DECL_FDOPENDIR=1; | |
8706 | HAVE_FDOPENDIR=1; | |
8707 | HAVE_SCANDIR=1; | |
8708 | HAVE_ALPHASORT=1; | |
8709 | REPLACE_OPENDIR=0; | |
8710 | REPLACE_CLOSEDIR=0; | |
8711 | REPLACE_DIRFD=0; | |
8712 | REPLACE_FDOPENDIR=0; | |
8713 | ||
8714 | ||
8715 | GNULIB_ISBLANK=0; | |
8716 | HAVE_ISBLANK=1; | |
8717 | ||
8718 | ||
8719 | ||
8720 | ||
725e2999 JB |
8721 | |
8722 | ||
8723 | ||
8724 | ||
725e2999 JB |
8725 | |
8726 | ||
c0c3707f CB |
8727 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5 |
8728 | $as_echo_n "checking if environ is properly declared... " >&6; } | |
8729 | if ${gt_cv_var_environ_declaration+:} false; then : | |
725e2999 JB |
8730 | $as_echo_n "(cached) " >&6 |
8731 | else | |
c0c3707f CB |
8732 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8733 | /* end confdefs.h. */ | |
8734 | #if HAVE_UNISTD_H | |
8735 | #include <unistd.h> | |
8736 | #endif | |
8737 | /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */ | |
8738 | #include <stdlib.h> | |
725e2999 | 8739 | |
c0c3707f CB |
8740 | extern struct { int foo; } environ; |
8741 | int | |
8742 | main () | |
8743 | { | |
8744 | environ.foo = 1; | |
8745 | ; | |
8746 | return 0; | |
8747 | } | |
8748 | _ACEOF | |
8749 | if ac_fn_c_try_compile "$LINENO"; then : | |
8750 | gt_cv_var_environ_declaration=no | |
8751 | else | |
8752 | gt_cv_var_environ_declaration=yes | |
725e2999 | 8753 | fi |
c0c3707f CB |
8754 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
8755 | fi | |
8756 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5 | |
8757 | $as_echo "$gt_cv_var_environ_declaration" >&6; } | |
8758 | if test $gt_cv_var_environ_declaration = yes; then | |
8759 | ||
8760 | $as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h | |
725e2999 | 8761 | |
725e2999 | 8762 | fi |
725e2999 JB |
8763 | |
8764 | ||
c0c3707f CB |
8765 | if test $gt_cv_var_environ_declaration != yes; then |
8766 | HAVE_DECL_ENVIRON=0 | |
8767 | fi | |
6ec2e0f5 SDJ |
8768 | |
8769 | ||
8770 | ||
c0c3707f CB |
8771 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5 |
8772 | $as_echo_n "checking for complete errno.h... " >&6; } | |
8773 | if ${gl_cv_header_errno_h_complete+:} false; then : | |
8774 | $as_echo_n "(cached) " >&6 | |
8775 | else | |
6ec2e0f5 | 8776 | |
c0c3707f CB |
8777 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8778 | /* end confdefs.h. */ | |
472fa5ee | 8779 | |
c0c3707f CB |
8780 | #include <errno.h> |
8781 | #if !defined ETXTBSY | |
8782 | booboo | |
8783 | #endif | |
8784 | #if !defined ENOMSG | |
8785 | booboo | |
8786 | #endif | |
8787 | #if !defined EIDRM | |
8788 | booboo | |
8789 | #endif | |
8790 | #if !defined ENOLINK | |
8791 | booboo | |
8792 | #endif | |
8793 | #if !defined EPROTO | |
8794 | booboo | |
8795 | #endif | |
8796 | #if !defined EMULTIHOP | |
8797 | booboo | |
8798 | #endif | |
8799 | #if !defined EBADMSG | |
8800 | booboo | |
8801 | #endif | |
8802 | #if !defined EOVERFLOW | |
8803 | booboo | |
8804 | #endif | |
8805 | #if !defined ENOTSUP | |
8806 | booboo | |
8807 | #endif | |
8808 | #if !defined ENETRESET | |
8809 | booboo | |
8810 | #endif | |
8811 | #if !defined ECONNABORTED | |
8812 | booboo | |
8813 | #endif | |
8814 | #if !defined ESTALE | |
8815 | booboo | |
8816 | #endif | |
8817 | #if !defined EDQUOT | |
8818 | booboo | |
8819 | #endif | |
8820 | #if !defined ECANCELED | |
8821 | booboo | |
8822 | #endif | |
8823 | #if !defined EOWNERDEAD | |
8824 | booboo | |
8825 | #endif | |
8826 | #if !defined ENOTRECOVERABLE | |
8827 | booboo | |
8828 | #endif | |
8829 | #if !defined EILSEQ | |
8830 | booboo | |
8831 | #endif | |
472fa5ee | 8832 | |
c0c3707f CB |
8833 | _ACEOF |
8834 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
8835 | $EGREP "booboo" >/dev/null 2>&1; then : | |
8836 | gl_cv_header_errno_h_complete=no | |
8837 | else | |
8838 | gl_cv_header_errno_h_complete=yes | |
5e8754f9 | 8839 | fi |
c0c3707f | 8840 | rm -f conftest* |
472fa5ee SM |
8841 | |
8842 | ||
c0c3707f CB |
8843 | fi |
8844 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5 | |
8845 | $as_echo "$gl_cv_header_errno_h_complete" >&6; } | |
8846 | if test $gl_cv_header_errno_h_complete = yes; then | |
8847 | ERRNO_H='' | |
8848 | else | |
472fa5ee SM |
8849 | |
8850 | ||
8851 | ||
8852 | ||
8853 | ||
472fa5ee SM |
8854 | |
8855 | ||
8856 | ||
c0c3707f CB |
8857 | if test $gl_cv_have_include_next = yes; then |
8858 | gl_cv_next_errno_h='<'errno.h'>' | |
8859 | else | |
8860 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5 | |
8861 | $as_echo_n "checking absolute name of <errno.h>... " >&6; } | |
8862 | if ${gl_cv_next_errno_h+:} false; then : | |
5e8754f9 SDJ |
8863 | $as_echo_n "(cached) " >&6 |
8864 | else | |
6ec2e0f5 | 8865 | |
6ec2e0f5 | 8866 | |
6ec2e0f5 | 8867 | |
c0c3707f CB |
8868 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8869 | /* end confdefs.h. */ | |
8870 | #include <errno.h> | |
8871 | _ACEOF | |
8872 | case "$host_os" in | |
8873 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
8874 | *) gl_absname_cpp="$ac_cpp" ;; | |
8875 | esac | |
6ec2e0f5 | 8876 | |
c0c3707f CB |
8877 | case "$host_os" in |
8878 | mingw*) | |
8879 | gl_dirsep_regex='[/\\]' | |
8880 | ;; | |
8881 | *) | |
8882 | gl_dirsep_regex='\/' | |
8883 | ;; | |
8884 | esac | |
8885 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
8886 | gl_header_literal_regex=`echo 'errno.h' \ | |
8887 | | sed -e "$gl_make_literal_regex_sed"` | |
8888 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
8889 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
8890 | s|^/[^/]|//&| | |
8891 | p | |
8892 | q | |
8893 | }' | |
6ec2e0f5 | 8894 | |
c0c3707f CB |
8895 | gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
8896 | sed -n "$gl_absolute_header_sed"` | |
6ec2e0f5 | 8897 | |
c0c3707f CB |
8898 | gl_header=$gl_cv_absolute_errno_h |
8899 | gl_cv_next_errno_h='"'$gl_header'"' | |
6ec2e0f5 SDJ |
8900 | |
8901 | ||
c0c3707f CB |
8902 | fi |
8903 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5 | |
8904 | $as_echo "$gl_cv_next_errno_h" >&6; } | |
8905 | fi | |
8906 | NEXT_ERRNO_H=$gl_cv_next_errno_h | |
6ec2e0f5 | 8907 | |
c0c3707f CB |
8908 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
8909 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
8910 | gl_next_as_first_directive='<'errno.h'>' | |
8911 | else | |
8912 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
8913 | gl_next_as_first_directive=$gl_cv_next_errno_h | |
8914 | fi | |
8915 | NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive | |
6ec2e0f5 | 8916 | |
472fa5ee SM |
8917 | |
8918 | ||
8919 | ||
c0c3707f CB |
8920 | ERRNO_H='errno.h' |
8921 | fi | |
472fa5ee | 8922 | |
c0c3707f CB |
8923 | if test -n "$ERRNO_H"; then |
8924 | GL_GENERATE_ERRNO_H_TRUE= | |
8925 | GL_GENERATE_ERRNO_H_FALSE='#' | |
5e8754f9 | 8926 | else |
c0c3707f CB |
8927 | GL_GENERATE_ERRNO_H_TRUE='#' |
8928 | GL_GENERATE_ERRNO_H_FALSE= | |
8929 | fi | |
472fa5ee SM |
8930 | |
8931 | ||
c0c3707f CB |
8932 | if test -n "$ERRNO_H"; then |
8933 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5 | |
8934 | $as_echo_n "checking for EMULTIHOP value... " >&6; } | |
8935 | if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then : | |
8936 | $as_echo_n "(cached) " >&6 | |
5e8754f9 | 8937 | else |
e26b6bb0 | 8938 | |
c0c3707f CB |
8939 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8940 | /* end confdefs.h. */ | |
e26b6bb0 | 8941 | |
c0c3707f CB |
8942 | #include <errno.h> |
8943 | #ifdef EMULTIHOP | |
8944 | yes | |
88b48903 | 8945 | #endif |
88b48903 | 8946 | |
c0c3707f CB |
8947 | _ACEOF |
8948 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
8949 | $EGREP "yes" >/dev/null 2>&1; then : | |
8950 | gl_cv_header_errno_h_EMULTIHOP=yes | |
8951 | else | |
8952 | gl_cv_header_errno_h_EMULTIHOP=no | |
8953 | fi | |
8954 | rm -f conftest* | |
88b48903 | 8955 | |
c0c3707f CB |
8956 | if test $gl_cv_header_errno_h_EMULTIHOP = no; then |
8957 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8958 | /* end confdefs.h. */ | |
88b48903 | 8959 | |
c0c3707f CB |
8960 | #define _XOPEN_SOURCE_EXTENDED 1 |
8961 | #include <errno.h> | |
8962 | #ifdef EMULTIHOP | |
8963 | yes | |
8964 | #endif | |
88b48903 WN |
8965 | |
8966 | _ACEOF | |
c0c3707f CB |
8967 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
8968 | $EGREP "yes" >/dev/null 2>&1; then : | |
8969 | gl_cv_header_errno_h_EMULTIHOP=hidden | |
88b48903 | 8970 | fi |
c0c3707f | 8971 | rm -f conftest* |
88b48903 | 8972 | |
c0c3707f CB |
8973 | if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then |
8974 | if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" " | |
8975 | #define _XOPEN_SOURCE_EXTENDED 1 | |
8976 | #include <errno.h> | |
8977 | /* The following two lines are a workaround against an autoconf-2.52 bug. */ | |
8978 | #include <stdio.h> | |
8979 | #include <stdlib.h> | |
8980 | "; then : | |
88b48903 WN |
8981 | |
8982 | fi | |
88b48903 | 8983 | |
c0c3707f CB |
8984 | fi |
8985 | fi | |
88b48903 | 8986 | |
c0c3707f CB |
8987 | fi |
8988 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 | |
8989 | $as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; } | |
8990 | case $gl_cv_header_errno_h_EMULTIHOP in | |
8991 | yes | no) | |
8992 | EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE= | |
8993 | ;; | |
8994 | *) | |
8995 | EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP" | |
8996 | ;; | |
8997 | esac | |
88b48903 | 8998 | |
e26b6bb0 | 8999 | |
c0c3707f | 9000 | fi |
e26b6bb0 | 9001 | |
3d99e817 | 9002 | |
c0c3707f CB |
9003 | if test -n "$ERRNO_H"; then |
9004 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5 | |
9005 | $as_echo_n "checking for ENOLINK value... " >&6; } | |
9006 | if ${gl_cv_header_errno_h_ENOLINK+:} false; then : | |
9007 | $as_echo_n "(cached) " >&6 | |
9008 | else | |
472fa5ee | 9009 | |
c0c3707f CB |
9010 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
9011 | /* end confdefs.h. */ | |
472fa5ee | 9012 | |
c0c3707f CB |
9013 | #include <errno.h> |
9014 | #ifdef ENOLINK | |
9015 | yes | |
9016 | #endif | |
472fa5ee | 9017 | |
c0c3707f CB |
9018 | _ACEOF |
9019 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
9020 | $EGREP "yes" >/dev/null 2>&1; then : | |
9021 | gl_cv_header_errno_h_ENOLINK=yes | |
9022 | else | |
9023 | gl_cv_header_errno_h_ENOLINK=no | |
9024 | fi | |
9025 | rm -f conftest* | |
472fa5ee | 9026 | |
c0c3707f CB |
9027 | if test $gl_cv_header_errno_h_ENOLINK = no; then |
9028 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9029 | /* end confdefs.h. */ | |
3d99e817 | 9030 | |
c0c3707f CB |
9031 | #define _XOPEN_SOURCE_EXTENDED 1 |
9032 | #include <errno.h> | |
9033 | #ifdef ENOLINK | |
9034 | yes | |
9035 | #endif | |
3d99e817 | 9036 | |
c0c3707f CB |
9037 | _ACEOF |
9038 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
9039 | $EGREP "yes" >/dev/null 2>&1; then : | |
9040 | gl_cv_header_errno_h_ENOLINK=hidden | |
9041 | fi | |
9042 | rm -f conftest* | |
3d99e817 | 9043 | |
c0c3707f CB |
9044 | if test $gl_cv_header_errno_h_ENOLINK = hidden; then |
9045 | if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" " | |
9046 | #define _XOPEN_SOURCE_EXTENDED 1 | |
9047 | #include <errno.h> | |
9048 | /* The following two lines are a workaround against an autoconf-2.52 bug. */ | |
9049 | #include <stdio.h> | |
9050 | #include <stdlib.h> | |
9051 | "; then : | |
3d99e817 | 9052 | |
c0c3707f | 9053 | fi |
3d99e817 | 9054 | |
c0c3707f CB |
9055 | fi |
9056 | fi | |
3d99e817 | 9057 | |
c0c3707f CB |
9058 | fi |
9059 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5 | |
9060 | $as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; } | |
9061 | case $gl_cv_header_errno_h_ENOLINK in | |
9062 | yes | no) | |
9063 | ENOLINK_HIDDEN=0; ENOLINK_VALUE= | |
9064 | ;; | |
9065 | *) | |
9066 | ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK" | |
9067 | ;; | |
9068 | esac | |
18848e28 | 9069 | |
18848e28 | 9070 | |
c0c3707f | 9071 | fi |
18848e28 | 9072 | |
18848e28 | 9073 | |
c0c3707f CB |
9074 | if test -n "$ERRNO_H"; then |
9075 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5 | |
9076 | $as_echo_n "checking for EOVERFLOW value... " >&6; } | |
9077 | if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then : | |
9078 | $as_echo_n "(cached) " >&6 | |
9079 | else | |
18848e28 | 9080 | |
c0c3707f CB |
9081 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
9082 | /* end confdefs.h. */ | |
18848e28 | 9083 | |
c0c3707f CB |
9084 | #include <errno.h> |
9085 | #ifdef EOVERFLOW | |
9086 | yes | |
9087 | #endif | |
18848e28 | 9088 | |
c0c3707f CB |
9089 | _ACEOF |
9090 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
9091 | $EGREP "yes" >/dev/null 2>&1; then : | |
9092 | gl_cv_header_errno_h_EOVERFLOW=yes | |
9093 | else | |
9094 | gl_cv_header_errno_h_EOVERFLOW=no | |
9095 | fi | |
9096 | rm -f conftest* | |
18848e28 | 9097 | |
c0c3707f CB |
9098 | if test $gl_cv_header_errno_h_EOVERFLOW = no; then |
9099 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9100 | /* end confdefs.h. */ | |
18848e28 | 9101 | |
c0c3707f CB |
9102 | #define _XOPEN_SOURCE_EXTENDED 1 |
9103 | #include <errno.h> | |
9104 | #ifdef EOVERFLOW | |
9105 | yes | |
9106 | #endif | |
18848e28 | 9107 | |
c0c3707f CB |
9108 | _ACEOF |
9109 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
9110 | $EGREP "yes" >/dev/null 2>&1; then : | |
9111 | gl_cv_header_errno_h_EOVERFLOW=hidden | |
9112 | fi | |
9113 | rm -f conftest* | |
18848e28 | 9114 | |
c0c3707f CB |
9115 | if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then |
9116 | if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" " | |
9117 | #define _XOPEN_SOURCE_EXTENDED 1 | |
9118 | #include <errno.h> | |
9119 | /* The following two lines are a workaround against an autoconf-2.52 bug. */ | |
9120 | #include <stdio.h> | |
9121 | #include <stdlib.h> | |
9122 | "; then : | |
18848e28 | 9123 | |
c0c3707f | 9124 | fi |
18848e28 | 9125 | |
c0c3707f CB |
9126 | fi |
9127 | fi | |
18848e28 | 9128 | |
c0c3707f CB |
9129 | fi |
9130 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 | |
9131 | $as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; } | |
9132 | case $gl_cv_header_errno_h_EOVERFLOW in | |
9133 | yes | no) | |
9134 | EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE= | |
9135 | ;; | |
9136 | *) | |
9137 | EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW" | |
9138 | ;; | |
9139 | esac | |
4a626d0a PA |
9140 | |
9141 | ||
c0c3707f | 9142 | fi |
18848e28 | 9143 | |
4a626d0a | 9144 | |
c0c3707f CB |
9145 | ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" |
9146 | if test "x$ac_cv_have_decl_strerror_r" = xyes; then : | |
9147 | ac_have_decl=1 | |
9148 | else | |
9149 | ac_have_decl=0 | |
9150 | fi | |
4a626d0a | 9151 | |
c0c3707f CB |
9152 | cat >>confdefs.h <<_ACEOF |
9153 | #define HAVE_DECL_STRERROR_R $ac_have_decl | |
9154 | _ACEOF | |
4a626d0a | 9155 | |
c0c3707f CB |
9156 | for ac_func in strerror_r |
9157 | do : | |
9158 | ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" | |
9159 | if test "x$ac_cv_func_strerror_r" = xyes; then : | |
9160 | cat >>confdefs.h <<_ACEOF | |
9161 | #define HAVE_STRERROR_R 1 | |
9162 | _ACEOF | |
4a626d0a | 9163 | |
c0c3707f CB |
9164 | fi |
9165 | done | |
18848e28 | 9166 | |
c0c3707f CB |
9167 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 |
9168 | $as_echo_n "checking whether strerror_r returns char *... " >&6; } | |
9169 | if ${ac_cv_func_strerror_r_char_p+:} false; then : | |
9170 | $as_echo_n "(cached) " >&6 | |
9171 | else | |
18848e28 | 9172 | |
c0c3707f CB |
9173 | ac_cv_func_strerror_r_char_p=no |
9174 | if test $ac_cv_have_decl_strerror_r = yes; then | |
9175 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9176 | /* end confdefs.h. */ | |
9177 | $ac_includes_default | |
9178 | int | |
9179 | main () | |
9180 | { | |
18848e28 | 9181 | |
c0c3707f CB |
9182 | char buf[100]; |
9183 | char x = *strerror_r (0, buf, sizeof buf); | |
9184 | char *p = strerror_r (0, buf, sizeof buf); | |
9185 | return !p || x; | |
18848e28 | 9186 | |
c0c3707f CB |
9187 | ; |
9188 | return 0; | |
9189 | } | |
9190 | _ACEOF | |
9191 | if ac_fn_c_try_compile "$LINENO"; then : | |
9192 | ac_cv_func_strerror_r_char_p=yes | |
9193 | fi | |
9194 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
9195 | else | |
9196 | # strerror_r is not declared. Choose between | |
9197 | # systems that have relatively inaccessible declarations for the | |
9198 | # function. BeOS and DEC UNIX 4.0 fall in this category, but the | |
9199 | # former has a strerror_r that returns char*, while the latter | |
9200 | # has a strerror_r that returns `int'. | |
9201 | # This test should segfault on the DEC system. | |
9202 | if test "$cross_compiling" = yes; then : | |
9203 | : | |
9204 | else | |
9205 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9206 | /* end confdefs.h. */ | |
9207 | $ac_includes_default | |
9208 | extern char *strerror_r (); | |
9209 | int | |
9210 | main () | |
9211 | { | |
9212 | char buf[100]; | |
9213 | char x = *strerror_r (0, buf, sizeof buf); | |
9214 | return ! isalpha (x); | |
9215 | ; | |
9216 | return 0; | |
9217 | } | |
9218 | _ACEOF | |
9219 | if ac_fn_c_try_run "$LINENO"; then : | |
9220 | ac_cv_func_strerror_r_char_p=yes | |
9221 | fi | |
9222 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
9223 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
9224 | fi | |
18848e28 | 9225 | |
c0c3707f | 9226 | fi |
18848e28 | 9227 | |
c0c3707f CB |
9228 | fi |
9229 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 | |
9230 | $as_echo "$ac_cv_func_strerror_r_char_p" >&6; } | |
9231 | if test $ac_cv_func_strerror_r_char_p = yes; then | |
18848e28 | 9232 | |
c0c3707f | 9233 | $as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h |
18848e28 | 9234 | |
c0c3707f | 9235 | fi |
18848e28 | 9236 | |
18848e28 | 9237 | |
18848e28 | 9238 | |
18848e28 | 9239 | |
c0c3707f CB |
9240 | ac_fn_c_check_decl "$LINENO" "fchdir" "ac_cv_have_decl_fchdir" "$ac_includes_default" |
9241 | if test "x$ac_cv_have_decl_fchdir" = xyes; then : | |
9242 | ac_have_decl=1 | |
9243 | else | |
9244 | ac_have_decl=0 | |
9245 | fi | |
18848e28 | 9246 | |
c0c3707f CB |
9247 | cat >>confdefs.h <<_ACEOF |
9248 | #define HAVE_DECL_FCHDIR $ac_have_decl | |
9249 | _ACEOF | |
18848e28 | 9250 | |
18848e28 | 9251 | |
c0c3707f CB |
9252 | GNULIB_CREAT=0; |
9253 | GNULIB_FCNTL=0; | |
9254 | GNULIB_NONBLOCKING=0; | |
9255 | GNULIB_OPEN=0; | |
9256 | GNULIB_OPENAT=0; | |
9c9d63b1 PM |
9257 | GNULIB_MDA_CREAT=1; |
9258 | GNULIB_MDA_OPEN=1; | |
c0c3707f CB |
9259 | HAVE_FCNTL=1; |
9260 | HAVE_OPENAT=1; | |
9261 | REPLACE_CREAT=0; | |
9262 | REPLACE_FCNTL=0; | |
9263 | REPLACE_OPEN=0; | |
9264 | REPLACE_OPENAT=0; | |
18848e28 | 9265 | |
18848e28 | 9266 | |
18848e28 | 9267 | |
18848e28 GF |
9268 | |
9269 | ||
18848e28 GF |
9270 | |
9271 | ||
18848e28 | 9272 | |
18848e28 | 9273 | |
18848e28 | 9274 | |
c0c3707f CB |
9275 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 |
9276 | $as_echo_n "checking for working fcntl.h... " >&6; } | |
9277 | if ${gl_cv_header_working_fcntl_h+:} false; then : | |
9278 | $as_echo_n "(cached) " >&6 | |
9279 | else | |
9280 | if test "$cross_compiling" = yes; then : | |
9281 | case "$host_os" in | |
9282 | # Guess 'no' on native Windows. | |
9283 | mingw*) gl_cv_header_working_fcntl_h='no' ;; | |
9284 | *) gl_cv_header_working_fcntl_h=cross-compiling ;; | |
9285 | esac | |
18848e28 | 9286 | |
c0c3707f CB |
9287 | else |
9288 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9289 | /* end confdefs.h. */ | |
9290 | #include <sys/types.h> | |
9291 | #include <sys/stat.h> | |
9292 | #if HAVE_UNISTD_H | |
9293 | # include <unistd.h> | |
9294 | #else /* on Windows with MSVC */ | |
9295 | # include <io.h> | |
9296 | # include <stdlib.h> | |
9297 | # defined sleep(n) _sleep ((n) * 1000) | |
9298 | #endif | |
9299 | #include <fcntl.h> | |
9c9d63b1 PM |
9300 | |
9301 | ||
9302 | $gl_mda_defines | |
9303 | ||
c0c3707f CB |
9304 | #ifndef O_NOATIME |
9305 | #define O_NOATIME 0 | |
9306 | #endif | |
9307 | #ifndef O_NOFOLLOW | |
9308 | #define O_NOFOLLOW 0 | |
9309 | #endif | |
9310 | static int const constants[] = | |
9311 | { | |
9312 | O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, | |
9313 | O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY | |
9314 | }; | |
18848e28 | 9315 | |
c0c3707f CB |
9316 | int |
9317 | main () | |
9318 | { | |
18848e28 | 9319 | |
c0c3707f CB |
9320 | int result = !constants; |
9321 | #if HAVE_SYMLINK | |
9322 | { | |
9323 | static char const sym[] = "conftest.sym"; | |
9324 | if (symlink ("/dev/null", sym) != 0) | |
9325 | result |= 2; | |
9326 | else | |
9327 | { | |
9328 | int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); | |
9329 | if (fd >= 0) | |
9330 | { | |
9331 | close (fd); | |
9332 | result |= 4; | |
9333 | } | |
9334 | } | |
9335 | if (unlink (sym) != 0 || symlink (".", sym) != 0) | |
9336 | result |= 2; | |
9337 | else | |
9338 | { | |
9339 | int fd = open (sym, O_RDONLY | O_NOFOLLOW); | |
9340 | if (fd >= 0) | |
9341 | { | |
9342 | close (fd); | |
9343 | result |= 4; | |
9344 | } | |
9345 | } | |
9346 | unlink (sym); | |
9347 | } | |
9348 | #endif | |
9349 | { | |
9350 | static char const file[] = "confdefs.h"; | |
9351 | int fd = open (file, O_RDONLY | O_NOATIME); | |
9352 | if (fd < 0) | |
9353 | result |= 8; | |
9354 | else | |
9355 | { | |
9356 | struct stat st0; | |
9357 | if (fstat (fd, &st0) != 0) | |
9358 | result |= 16; | |
9359 | else | |
9360 | { | |
9361 | char c; | |
9362 | sleep (1); | |
9363 | if (read (fd, &c, 1) != 1) | |
9364 | result |= 24; | |
9365 | else | |
9366 | { | |
9367 | if (close (fd) != 0) | |
9368 | result |= 32; | |
9369 | else | |
9370 | { | |
9371 | struct stat st1; | |
9372 | if (stat (file, &st1) != 0) | |
9373 | result |= 40; | |
9374 | else | |
9375 | if (st0.st_atime != st1.st_atime) | |
9376 | result |= 64; | |
9377 | } | |
9378 | } | |
9379 | } | |
9380 | } | |
9381 | } | |
9382 | return result; | |
9383 | ; | |
9384 | return 0; | |
9385 | } | |
9386 | _ACEOF | |
9387 | if ac_fn_c_try_run "$LINENO"; then : | |
9388 | gl_cv_header_working_fcntl_h=yes | |
9389 | else | |
9390 | case $? in #( | |
9391 | 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( | |
9392 | 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( | |
9393 | 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( | |
9394 | *) gl_cv_header_working_fcntl_h='no';; | |
9395 | esac | |
9396 | fi | |
9397 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
9398 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
9399 | fi | |
18848e28 | 9400 | |
18848e28 | 9401 | |
c0c3707f CB |
9402 | fi |
9403 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 | |
9404 | $as_echo "$gl_cv_header_working_fcntl_h" >&6; } | |
18848e28 | 9405 | |
c0c3707f CB |
9406 | case $gl_cv_header_working_fcntl_h in #( |
9407 | *O_NOATIME* | no | cross-compiling) ac_val=0;; #( | |
9408 | *) ac_val=1;; | |
9409 | esac | |
18848e28 | 9410 | |
c0c3707f CB |
9411 | cat >>confdefs.h <<_ACEOF |
9412 | #define HAVE_WORKING_O_NOATIME $ac_val | |
9413 | _ACEOF | |
18848e28 GF |
9414 | |
9415 | ||
c0c3707f CB |
9416 | case $gl_cv_header_working_fcntl_h in #( |
9417 | *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( | |
9418 | *) ac_val=1;; | |
9419 | esac | |
18848e28 | 9420 | |
c0c3707f CB |
9421 | cat >>confdefs.h <<_ACEOF |
9422 | #define HAVE_WORKING_O_NOFOLLOW $ac_val | |
9423 | _ACEOF | |
18848e28 | 9424 | |
63ce7108 | 9425 | |
9c9d63b1 PM |
9426 | |
9427 | ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default | |
9428 | " | |
c0c3707f | 9429 | if test "x$ac_cv_type_pid_t" = xyes; then : |
63ce7108 | 9430 | |
c0c3707f | 9431 | else |
9c9d63b1 PM |
9432 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
9433 | /* end confdefs.h. */ | |
9434 | ||
9435 | #if defined _WIN64 && !defined __CYGWIN__ | |
9436 | LLP64 | |
9437 | #endif | |
9438 | ||
9439 | int | |
9440 | main () | |
9441 | { | |
9442 | ||
9443 | ; | |
9444 | return 0; | |
9445 | } | |
9446 | ||
9447 | _ACEOF | |
9448 | if ac_fn_c_try_compile "$LINENO"; then : | |
9449 | gl_pid_type='int' | |
9450 | else | |
9451 | gl_pid_type='__int64' | |
9452 | fi | |
9453 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
63ce7108 | 9454 | |
c0c3707f | 9455 | cat >>confdefs.h <<_ACEOF |
9c9d63b1 | 9456 | #define pid_t $gl_pid_type |
c0c3707f | 9457 | _ACEOF |
63ce7108 | 9458 | |
9c9d63b1 | 9459 | |
c0c3707f | 9460 | fi |
63ce7108 | 9461 | |
9c9d63b1 | 9462 | |
c0c3707f CB |
9463 | ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" |
9464 | if test "x$ac_cv_type_mode_t" = xyes; then : | |
63ce7108 | 9465 | |
c0c3707f | 9466 | else |
63ce7108 | 9467 | |
c0c3707f CB |
9468 | cat >>confdefs.h <<_ACEOF |
9469 | #define mode_t int | |
9470 | _ACEOF | |
63ce7108 | 9471 | |
c0c3707f | 9472 | fi |
63ce7108 | 9473 | |
472fa5ee SM |
9474 | |
9475 | ||
9476 | ||
32e2770e MF |
9477 | GNULIB_FFS=0; |
9478 | HAVE_FFS=1; | |
9479 | HAVE_STRCASECMP=1; | |
9480 | HAVE_DECL_STRNCASECMP=1; | |
9481 | ||
9482 | ||
472fa5ee SM |
9483 | |
9484 | ||
c0c3707f CB |
9485 | GNULIB_FNMATCH=0; |
9486 | HAVE_FNMATCH=1; | |
9487 | REPLACE_FNMATCH=0; | |
472fa5ee SM |
9488 | |
9489 | ||
9490 | ||
9491 | ||
9492 | ||
9493 | ||
472fa5ee SM |
9494 | |
9495 | ||
472fa5ee SM |
9496 | |
9497 | ||
9498 | ||
9499 | ||
9500 | ||
9501 | ||
9502 | ||
9503 | ||
7a6dbc2f | 9504 | if test $gl_cv_have_include_next = yes; then |
c0c3707f | 9505 | gl_cv_next_fnmatch_h='<'fnmatch.h'>' |
7a6dbc2f | 9506 | else |
c0c3707f CB |
9507 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fnmatch.h>" >&5 |
9508 | $as_echo_n "checking absolute name of <fnmatch.h>... " >&6; } | |
9509 | if ${gl_cv_next_fnmatch_h+:} false; then : | |
7a6dbc2f SDJ |
9510 | $as_echo_n "(cached) " >&6 |
9511 | else | |
472fa5ee | 9512 | |
c0c3707f CB |
9513 | if test $ac_cv_header_fnmatch_h = yes; then |
9514 | ||
9515 | ||
472fa5ee SM |
9516 | |
9517 | ||
7a6dbc2f SDJ |
9518 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
9519 | /* end confdefs.h. */ | |
c0c3707f | 9520 | #include <fnmatch.h> |
7a6dbc2f SDJ |
9521 | _ACEOF |
9522 | case "$host_os" in | |
9523 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
9524 | *) gl_absname_cpp="$ac_cpp" ;; | |
9525 | esac | |
472fa5ee | 9526 | |
7a6dbc2f SDJ |
9527 | case "$host_os" in |
9528 | mingw*) | |
9529 | gl_dirsep_regex='[/\\]' | |
9530 | ;; | |
9531 | *) | |
9532 | gl_dirsep_regex='\/' | |
9533 | ;; | |
9534 | esac | |
9535 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
c0c3707f | 9536 | gl_header_literal_regex=`echo 'fnmatch.h' \ |
7a6dbc2f SDJ |
9537 | | sed -e "$gl_make_literal_regex_sed"` |
9538 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
9539 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
9540 | s|^/[^/]|//&| | |
9541 | p | |
9542 | q | |
9543 | }' | |
9544 | ||
c0c3707f | 9545 | gl_cv_absolute_fnmatch_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
7a6dbc2f SDJ |
9546 | sed -n "$gl_absolute_header_sed"` |
9547 | ||
c0c3707f CB |
9548 | gl_header=$gl_cv_absolute_fnmatch_h |
9549 | gl_cv_next_fnmatch_h='"'$gl_header'"' | |
9550 | else | |
9551 | gl_cv_next_fnmatch_h='<'fnmatch.h'>' | |
9552 | fi | |
7a6dbc2f SDJ |
9553 | |
9554 | ||
9555 | fi | |
c0c3707f CB |
9556 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fnmatch_h" >&5 |
9557 | $as_echo "$gl_cv_next_fnmatch_h" >&6; } | |
7a6dbc2f | 9558 | fi |
c0c3707f | 9559 | NEXT_FNMATCH_H=$gl_cv_next_fnmatch_h |
7a6dbc2f SDJ |
9560 | |
9561 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
9562 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
c0c3707f | 9563 | gl_next_as_first_directive='<'fnmatch.h'>' |
7a6dbc2f SDJ |
9564 | else |
9565 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
c0c3707f | 9566 | gl_next_as_first_directive=$gl_cv_next_fnmatch_h |
7a6dbc2f | 9567 | fi |
c0c3707f | 9568 | NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H=$gl_next_as_first_directive |
7a6dbc2f SDJ |
9569 | |
9570 | ||
9571 | ||
9572 | ||
7a6dbc2f | 9573 | |
7a6dbc2f SDJ |
9574 | |
9575 | ||
c0c3707f CB |
9576 | if test $ac_cv_header_fnmatch_h = yes; then |
9577 | HAVE_FNMATCH_H=1 | |
9578 | else | |
9579 | HAVE_FNMATCH_H=0 | |
9580 | fi | |
7a6dbc2f SDJ |
9581 | |
9582 | ||
c0c3707f CB |
9583 | FNMATCH_H='' |
9584 | if false; then | |
9585 | FNMATCH_H=fnmatch.h | |
9586 | else | |
9587 | if test $ac_cv_header_fnmatch_h != yes; then | |
9588 | FNMATCH_H=fnmatch.h | |
9589 | fi | |
9590 | fi | |
7a6dbc2f | 9591 | |
c0c3707f CB |
9592 | |
9593 | if test -n "$FNMATCH_H"; then | |
9594 | GL_GENERATE_FNMATCH_H_TRUE= | |
9595 | GL_GENERATE_FNMATCH_H_FALSE='#' | |
7a6dbc2f | 9596 | else |
c0c3707f CB |
9597 | GL_GENERATE_FNMATCH_H_TRUE='#' |
9598 | GL_GENERATE_FNMATCH_H_FALSE= | |
7a6dbc2f | 9599 | fi |
7a6dbc2f | 9600 | |
7a6dbc2f | 9601 | |
7a6dbc2f | 9602 | |
7a6dbc2f SDJ |
9603 | |
9604 | ||
9605 | ||
9606 | ||
9607 | ||
9608 | ||
9609 | ||
c0c3707f CB |
9610 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 |
9611 | $as_echo_n "checking for mbstate_t... " >&6; } | |
9612 | if ${ac_cv_type_mbstate_t+:} false; then : | |
5e8754f9 SDJ |
9613 | $as_echo_n "(cached) " >&6 |
9614 | else | |
c0c3707f | 9615 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5e8754f9 | 9616 | /* end confdefs.h. */ |
c0c3707f | 9617 | $ac_includes_default |
9c9d63b1 | 9618 | #include <wchar.h> |
c0c3707f CB |
9619 | int |
9620 | main () | |
9621 | { | |
9622 | mbstate_t x; return sizeof x; | |
9623 | ; | |
9624 | return 0; | |
9625 | } | |
5e8754f9 | 9626 | _ACEOF |
c0c3707f CB |
9627 | if ac_fn_c_try_compile "$LINENO"; then : |
9628 | ac_cv_type_mbstate_t=yes | |
5e8754f9 | 9629 | else |
c0c3707f | 9630 | ac_cv_type_mbstate_t=no |
5e8754f9 | 9631 | fi |
c0c3707f CB |
9632 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
9633 | fi | |
9634 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 | |
9635 | $as_echo "$ac_cv_type_mbstate_t" >&6; } | |
9636 | if test $ac_cv_type_mbstate_t = yes; then | |
5e8754f9 | 9637 | |
c0c3707f | 9638 | $as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h |
5e8754f9 | 9639 | |
c0c3707f | 9640 | else |
5e8754f9 | 9641 | |
c0c3707f | 9642 | $as_echo "#define mbstate_t int" >>confdefs.h |
5e8754f9 | 9643 | |
c0c3707f | 9644 | fi |
5e8754f9 SDJ |
9645 | |
9646 | ||
9647 | ||
9648 | ||
5e8754f9 SDJ |
9649 | GNULIB_ACOSF=0; |
9650 | GNULIB_ACOSL=0; | |
9651 | GNULIB_ASINF=0; | |
9652 | GNULIB_ASINL=0; | |
9653 | GNULIB_ATANF=0; | |
9654 | GNULIB_ATANL=0; | |
9655 | GNULIB_ATAN2F=0; | |
9656 | GNULIB_CBRT=0; | |
9657 | GNULIB_CBRTF=0; | |
9658 | GNULIB_CBRTL=0; | |
9659 | GNULIB_CEIL=0; | |
9660 | GNULIB_CEILF=0; | |
9661 | GNULIB_CEILL=0; | |
9662 | GNULIB_COPYSIGN=0; | |
9663 | GNULIB_COPYSIGNF=0; | |
9664 | GNULIB_COPYSIGNL=0; | |
9665 | GNULIB_COSF=0; | |
9666 | GNULIB_COSL=0; | |
9667 | GNULIB_COSHF=0; | |
9668 | GNULIB_EXPF=0; | |
9669 | GNULIB_EXPL=0; | |
9670 | GNULIB_EXP2=0; | |
9671 | GNULIB_EXP2F=0; | |
9672 | GNULIB_EXP2L=0; | |
9673 | GNULIB_EXPM1=0; | |
9674 | GNULIB_EXPM1F=0; | |
9675 | GNULIB_EXPM1L=0; | |
9676 | GNULIB_FABSF=0; | |
9677 | GNULIB_FABSL=0; | |
9678 | GNULIB_FLOOR=0; | |
9679 | GNULIB_FLOORF=0; | |
9680 | GNULIB_FLOORL=0; | |
9681 | GNULIB_FMA=0; | |
9682 | GNULIB_FMAF=0; | |
9683 | GNULIB_FMAL=0; | |
9684 | GNULIB_FMOD=0; | |
9685 | GNULIB_FMODF=0; | |
9686 | GNULIB_FMODL=0; | |
9687 | GNULIB_FREXPF=0; | |
9688 | GNULIB_FREXP=0; | |
9689 | GNULIB_FREXPL=0; | |
9690 | GNULIB_HYPOT=0; | |
9691 | GNULIB_HYPOTF=0; | |
9692 | GNULIB_HYPOTL=0; | |
9693 | GNULIB_ILOGB=0; | |
9694 | GNULIB_ILOGBF=0; | |
9695 | GNULIB_ILOGBL=0; | |
9696 | GNULIB_ISFINITE=0; | |
9697 | GNULIB_ISINF=0; | |
9698 | GNULIB_ISNAN=0; | |
9699 | GNULIB_ISNANF=0; | |
9700 | GNULIB_ISNAND=0; | |
9701 | GNULIB_ISNANL=0; | |
9702 | GNULIB_LDEXPF=0; | |
9703 | GNULIB_LDEXPL=0; | |
9704 | GNULIB_LOG=0; | |
9705 | GNULIB_LOGF=0; | |
9706 | GNULIB_LOGL=0; | |
9707 | GNULIB_LOG10=0; | |
9708 | GNULIB_LOG10F=0; | |
9709 | GNULIB_LOG10L=0; | |
9710 | GNULIB_LOG1P=0; | |
9711 | GNULIB_LOG1PF=0; | |
9712 | GNULIB_LOG1PL=0; | |
9713 | GNULIB_LOG2=0; | |
9714 | GNULIB_LOG2F=0; | |
9715 | GNULIB_LOG2L=0; | |
9716 | GNULIB_LOGB=0; | |
9717 | GNULIB_LOGBF=0; | |
9718 | GNULIB_LOGBL=0; | |
9719 | GNULIB_MODF=0; | |
9720 | GNULIB_MODFF=0; | |
9721 | GNULIB_MODFL=0; | |
9722 | GNULIB_POWF=0; | |
9723 | GNULIB_REMAINDER=0; | |
9724 | GNULIB_REMAINDERF=0; | |
9725 | GNULIB_REMAINDERL=0; | |
9726 | GNULIB_RINT=0; | |
9727 | GNULIB_RINTF=0; | |
9728 | GNULIB_RINTL=0; | |
9729 | GNULIB_ROUND=0; | |
9730 | GNULIB_ROUNDF=0; | |
9731 | GNULIB_ROUNDL=0; | |
9732 | GNULIB_SIGNBIT=0; | |
9733 | GNULIB_SINF=0; | |
9734 | GNULIB_SINL=0; | |
9735 | GNULIB_SINHF=0; | |
9736 | GNULIB_SQRTF=0; | |
9737 | GNULIB_SQRTL=0; | |
9738 | GNULIB_TANF=0; | |
9739 | GNULIB_TANL=0; | |
9740 | GNULIB_TANHF=0; | |
9741 | GNULIB_TRUNC=0; | |
9742 | GNULIB_TRUNCF=0; | |
9743 | GNULIB_TRUNCL=0; | |
9c9d63b1 PM |
9744 | GNULIB_MDA_J0=1; |
9745 | GNULIB_MDA_J1=1; | |
9746 | GNULIB_MDA_JN=1; | |
9747 | GNULIB_MDA_Y0=1; | |
9748 | GNULIB_MDA_Y1=1; | |
9749 | GNULIB_MDA_YN=1; | |
5e8754f9 SDJ |
9750 | HAVE_ACOSF=1; |
9751 | HAVE_ACOSL=1; | |
9752 | HAVE_ASINF=1; | |
9753 | HAVE_ASINL=1; | |
9754 | HAVE_ATANF=1; | |
9755 | HAVE_ATANL=1; | |
9756 | HAVE_ATAN2F=1; | |
9757 | HAVE_CBRT=1; | |
9758 | HAVE_CBRTF=1; | |
9759 | HAVE_CBRTL=1; | |
9760 | HAVE_COPYSIGN=1; | |
9761 | HAVE_COPYSIGNL=1; | |
9762 | HAVE_COSF=1; | |
9763 | HAVE_COSL=1; | |
9764 | HAVE_COSHF=1; | |
9765 | HAVE_EXPF=1; | |
9766 | HAVE_EXPL=1; | |
9767 | HAVE_EXPM1=1; | |
9768 | HAVE_EXPM1F=1; | |
9769 | HAVE_FABSF=1; | |
9770 | HAVE_FABSL=1; | |
9771 | HAVE_FMA=1; | |
9772 | HAVE_FMAF=1; | |
9773 | HAVE_FMAL=1; | |
9774 | HAVE_FMODF=1; | |
9775 | HAVE_FMODL=1; | |
9776 | HAVE_FREXPF=1; | |
9777 | HAVE_HYPOTF=1; | |
9778 | HAVE_HYPOTL=1; | |
9779 | HAVE_ILOGB=1; | |
9780 | HAVE_ILOGBF=1; | |
9781 | HAVE_ILOGBL=1; | |
9782 | HAVE_ISNANF=1; | |
9783 | HAVE_ISNAND=1; | |
9784 | HAVE_ISNANL=1; | |
9785 | HAVE_LDEXPF=1; | |
9786 | HAVE_LOGF=1; | |
9787 | HAVE_LOGL=1; | |
9788 | HAVE_LOG10F=1; | |
9789 | HAVE_LOG10L=1; | |
9790 | HAVE_LOG1P=1; | |
9791 | HAVE_LOG1PF=1; | |
9792 | HAVE_LOG1PL=1; | |
9793 | HAVE_LOGBF=1; | |
9794 | HAVE_LOGBL=1; | |
9795 | HAVE_MODFF=1; | |
9796 | HAVE_MODFL=1; | |
9797 | HAVE_POWF=1; | |
9798 | HAVE_REMAINDER=1; | |
9799 | HAVE_REMAINDERF=1; | |
9800 | HAVE_RINT=1; | |
9801 | HAVE_RINTL=1; | |
9802 | HAVE_SINF=1; | |
9803 | HAVE_SINL=1; | |
9804 | HAVE_SINHF=1; | |
9805 | HAVE_SQRTF=1; | |
9806 | HAVE_SQRTL=1; | |
9807 | HAVE_TANF=1; | |
9808 | HAVE_TANL=1; | |
9809 | HAVE_TANHF=1; | |
9810 | HAVE_DECL_ACOSL=1; | |
9811 | HAVE_DECL_ASINL=1; | |
9812 | HAVE_DECL_ATANL=1; | |
9813 | HAVE_DECL_CBRTF=1; | |
9814 | HAVE_DECL_CBRTL=1; | |
9815 | HAVE_DECL_CEILF=1; | |
9816 | HAVE_DECL_CEILL=1; | |
9817 | HAVE_DECL_COPYSIGNF=1; | |
9818 | HAVE_DECL_COSL=1; | |
9819 | HAVE_DECL_EXPL=1; | |
9820 | HAVE_DECL_EXP2=1; | |
9821 | HAVE_DECL_EXP2F=1; | |
9822 | HAVE_DECL_EXP2L=1; | |
9823 | HAVE_DECL_EXPM1L=1; | |
9824 | HAVE_DECL_FLOORF=1; | |
9825 | HAVE_DECL_FLOORL=1; | |
9826 | HAVE_DECL_FREXPL=1; | |
9827 | HAVE_DECL_LDEXPL=1; | |
9828 | HAVE_DECL_LOGL=1; | |
9829 | HAVE_DECL_LOG10L=1; | |
9830 | HAVE_DECL_LOG2=1; | |
9831 | HAVE_DECL_LOG2F=1; | |
9832 | HAVE_DECL_LOG2L=1; | |
9833 | HAVE_DECL_LOGB=1; | |
9834 | HAVE_DECL_REMAINDER=1; | |
9835 | HAVE_DECL_REMAINDERL=1; | |
9836 | HAVE_DECL_RINTF=1; | |
9837 | HAVE_DECL_ROUND=1; | |
9838 | HAVE_DECL_ROUNDF=1; | |
9839 | HAVE_DECL_ROUNDL=1; | |
9840 | HAVE_DECL_SINL=1; | |
9841 | HAVE_DECL_SQRTL=1; | |
9842 | HAVE_DECL_TANL=1; | |
9843 | HAVE_DECL_TRUNC=1; | |
9844 | HAVE_DECL_TRUNCF=1; | |
9845 | HAVE_DECL_TRUNCL=1; | |
c0c3707f CB |
9846 | REPLACE_ACOSF=0; |
9847 | REPLACE_ASINF=0; | |
9848 | REPLACE_ATANF=0; | |
9849 | REPLACE_ATAN2F=0; | |
5e8754f9 SDJ |
9850 | REPLACE_CBRTF=0; |
9851 | REPLACE_CBRTL=0; | |
9852 | REPLACE_CEIL=0; | |
9853 | REPLACE_CEILF=0; | |
9854 | REPLACE_CEILL=0; | |
c0c3707f CB |
9855 | REPLACE_COSF=0; |
9856 | REPLACE_COSHF=0; | |
9857 | REPLACE_EXPF=0; | |
9858 | REPLACE_EXPL=0; | |
5e8754f9 SDJ |
9859 | REPLACE_EXPM1=0; |
9860 | REPLACE_EXPM1F=0; | |
c0c3707f | 9861 | REPLACE_EXPM1L=0; |
5e8754f9 SDJ |
9862 | REPLACE_EXP2=0; |
9863 | REPLACE_EXP2L=0; | |
9864 | REPLACE_FABSL=0; | |
9865 | REPLACE_FLOOR=0; | |
9866 | REPLACE_FLOORF=0; | |
9867 | REPLACE_FLOORL=0; | |
9868 | REPLACE_FMA=0; | |
9869 | REPLACE_FMAF=0; | |
9870 | REPLACE_FMAL=0; | |
9871 | REPLACE_FMOD=0; | |
9872 | REPLACE_FMODF=0; | |
9873 | REPLACE_FMODL=0; | |
9874 | REPLACE_FREXPF=0; | |
9875 | REPLACE_FREXP=0; | |
9876 | REPLACE_FREXPL=0; | |
9877 | REPLACE_HUGE_VAL=0; | |
9878 | REPLACE_HYPOT=0; | |
9879 | REPLACE_HYPOTF=0; | |
9880 | REPLACE_HYPOTL=0; | |
9881 | REPLACE_ILOGB=0; | |
9882 | REPLACE_ILOGBF=0; | |
c0c3707f | 9883 | REPLACE_ILOGBL=0; |
5e8754f9 SDJ |
9884 | REPLACE_ISFINITE=0; |
9885 | REPLACE_ISINF=0; | |
9886 | REPLACE_ISNAN=0; | |
9887 | REPLACE_LDEXPL=0; | |
9888 | REPLACE_LOG=0; | |
9889 | REPLACE_LOGF=0; | |
9890 | REPLACE_LOGL=0; | |
9891 | REPLACE_LOG10=0; | |
9892 | REPLACE_LOG10F=0; | |
9893 | REPLACE_LOG10L=0; | |
9894 | REPLACE_LOG1P=0; | |
9895 | REPLACE_LOG1PF=0; | |
9896 | REPLACE_LOG1PL=0; | |
9897 | REPLACE_LOG2=0; | |
9898 | REPLACE_LOG2F=0; | |
9899 | REPLACE_LOG2L=0; | |
9900 | REPLACE_LOGB=0; | |
9901 | REPLACE_LOGBF=0; | |
9902 | REPLACE_LOGBL=0; | |
9903 | REPLACE_MODF=0; | |
9904 | REPLACE_MODFF=0; | |
9905 | REPLACE_MODFL=0; | |
9906 | REPLACE_NAN=0; | |
9907 | REPLACE_REMAINDER=0; | |
9908 | REPLACE_REMAINDERF=0; | |
9909 | REPLACE_REMAINDERL=0; | |
c0c3707f | 9910 | REPLACE_RINTL=0; |
5e8754f9 | 9911 | REPLACE_ROUND=0; |
c0c3707f CB |
9912 | REPLACE_ROUNDF=0; |
9913 | REPLACE_ROUNDL=0; | |
9914 | REPLACE_SIGNBIT=0; | |
9c9d63b1 | 9915 | REPLACE_SIGNBIT_USING_BUILTINS=0; |
c0c3707f CB |
9916 | REPLACE_SINF=0; |
9917 | REPLACE_SINHF=0; | |
9918 | REPLACE_SQRTF=0; | |
9919 | REPLACE_SQRTL=0; | |
9920 | REPLACE_TANF=0; | |
9921 | REPLACE_TANHF=0; | |
9922 | REPLACE_TRUNC=0; | |
9923 | REPLACE_TRUNCF=0; | |
9924 | REPLACE_TRUNCL=0; | |
49e4877c | 9925 | |
49e4877c | 9926 | |
c0c3707f CB |
9927 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5 |
9928 | $as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; } | |
9929 | if ${gl_cv_func_frexp_no_libm+:} false; then : | |
9930 | $as_echo_n "(cached) " >&6 | |
9931 | else | |
8690e634 | 9932 | |
c0c3707f CB |
9933 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
9934 | /* end confdefs.h. */ | |
9935 | #include <math.h> | |
9936 | double x; | |
9937 | int | |
9938 | main () | |
9939 | { | |
9940 | int e; return frexp (x, &e) > 0; | |
9941 | ; | |
9942 | return 0; | |
9943 | } | |
9944 | _ACEOF | |
9945 | if ac_fn_c_try_link "$LINENO"; then : | |
9946 | gl_cv_func_frexp_no_libm=yes | |
9947 | else | |
9948 | gl_cv_func_frexp_no_libm=no | |
9949 | fi | |
9950 | rm -f core conftest.err conftest.$ac_objext \ | |
9951 | conftest$ac_exeext conftest.$ac_ext | |
8690e634 | 9952 | |
c0c3707f CB |
9953 | fi |
9954 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5 | |
9955 | $as_echo "$gl_cv_func_frexp_no_libm" >&6; } | |
8690e634 | 9956 | |
c0c3707f CB |
9957 | ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default" |
9958 | if test "x$ac_cv_have_decl_alarm" = xyes; then : | |
9959 | ac_have_decl=1 | |
9960 | else | |
9961 | ac_have_decl=0 | |
9962 | fi | |
472fa5ee | 9963 | |
c0c3707f CB |
9964 | cat >>confdefs.h <<_ACEOF |
9965 | #define HAVE_DECL_ALARM $ac_have_decl | |
9966 | _ACEOF | |
472fa5ee SM |
9967 | |
9968 | ||
9969 | ||
9970 | ||
c0c3707f CB |
9971 | FREXP_LIBM= |
9972 | if test $gl_cv_func_frexp_no_libm = no; then | |
9973 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used with libm" >&5 | |
9974 | $as_echo_n "checking whether frexp() can be used with libm... " >&6; } | |
9975 | if ${gl_cv_func_frexp_in_libm+:} false; then : | |
9976 | $as_echo_n "(cached) " >&6 | |
9977 | else | |
8690e634 | 9978 | |
c0c3707f CB |
9979 | save_LIBS="$LIBS" |
9980 | LIBS="$LIBS -lm" | |
9981 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9982 | /* end confdefs.h. */ | |
9983 | #include <math.h> | |
9984 | double x; | |
9985 | int | |
9986 | main () | |
9987 | { | |
9988 | int e; return frexp (x, &e) > 0; | |
9989 | ; | |
9990 | return 0; | |
9991 | } | |
9992 | _ACEOF | |
9993 | if ac_fn_c_try_link "$LINENO"; then : | |
9994 | gl_cv_func_frexp_in_libm=yes | |
9995 | else | |
9996 | gl_cv_func_frexp_in_libm=no | |
9997 | fi | |
9998 | rm -f core conftest.err conftest.$ac_objext \ | |
9999 | conftest$ac_exeext conftest.$ac_ext | |
10000 | LIBS="$save_LIBS" | |
8690e634 | 10001 | |
c0c3707f CB |
10002 | fi |
10003 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_in_libm" >&5 | |
10004 | $as_echo "$gl_cv_func_frexp_in_libm" >&6; } | |
10005 | if test $gl_cv_func_frexp_in_libm = yes; then | |
10006 | FREXP_LIBM=-lm | |
10007 | fi | |
6ec2e0f5 | 10008 | fi |
c0c3707f CB |
10009 | if test $gl_cv_func_frexp_no_libm = yes \ |
10010 | || test $gl_cv_func_frexp_in_libm = yes; then | |
10011 | save_LIBS="$LIBS" | |
10012 | LIBS="$LIBS $FREXP_LIBM" | |
8690e634 JK |
10013 | |
10014 | ||
8690e634 | 10015 | |
c0c3707f CB |
10016 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5 |
10017 | $as_echo_n "checking whether frexp works... " >&6; } | |
10018 | if ${gl_cv_func_frexp_works+:} false; then : | |
10019 | $as_echo_n "(cached) " >&6 | |
10020 | else | |
8690e634 | 10021 | |
c0c3707f CB |
10022 | if test "$cross_compiling" = yes; then : |
10023 | case "$host_os" in | |
10024 | netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;; | |
10025 | mingw*) # Guess yes with MSVC, no with mingw. | |
10026 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10027 | /* end confdefs.h. */ | |
8690e634 | 10028 | |
c0c3707f CB |
10029 | #ifdef _MSC_VER |
10030 | Good | |
10031 | #endif | |
8690e634 | 10032 | |
c0c3707f CB |
10033 | _ACEOF |
10034 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
10035 | $EGREP "Good" >/dev/null 2>&1; then : | |
10036 | gl_cv_func_frexp_works="guessing yes" | |
10037 | else | |
10038 | gl_cv_func_frexp_works="guessing no" | |
10039 | fi | |
10040 | rm -f conftest* | |
8690e634 | 10041 | |
c0c3707f CB |
10042 | ;; |
10043 | *) gl_cv_func_frexp_works="guessing yes" ;; | |
10044 | esac | |
8690e634 | 10045 | |
c0c3707f CB |
10046 | else |
10047 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10048 | /* end confdefs.h. */ | |
8690e634 | 10049 | |
c0c3707f CB |
10050 | #include <float.h> |
10051 | #include <math.h> | |
10052 | #include <string.h> | |
10053 | #if HAVE_DECL_ALARM | |
10054 | # include <signal.h> | |
10055 | # include <unistd.h> | |
10056 | #endif | |
10057 | /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. | |
10058 | ICC 10.0 has a bug when optimizing the expression -zero. | |
10059 | The expression -DBL_MIN * DBL_MIN does not work when cross-compiling | |
10060 | to PowerPC on Mac OS X 10.5. */ | |
10061 | #if defined __hpux || defined __sgi || defined __ICC | |
10062 | static double | |
10063 | compute_minus_zero (void) | |
10064 | { | |
10065 | return -DBL_MIN * DBL_MIN; | |
10066 | } | |
10067 | # define minus_zero compute_minus_zero () | |
10068 | #else | |
10069 | double minus_zero = -0.0; | |
10070 | #endif | |
10071 | int main() | |
10072 | { | |
10073 | int result = 0; | |
10074 | int i; | |
10075 | volatile double x; | |
10076 | double zero = 0.0; | |
10077 | #if HAVE_DECL_ALARM | |
10078 | /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite | |
10079 | number. Let the test fail in this case. */ | |
10080 | signal (SIGALRM, SIG_DFL); | |
10081 | alarm (5); | |
10082 | #endif | |
10083 | /* Test on denormalized numbers. */ | |
10084 | for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) | |
10085 | ; | |
10086 | if (x > 0.0) | |
10087 | { | |
10088 | int exp; | |
10089 | double y = frexp (x, &exp); | |
10090 | /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022. | |
10091 | On NetBSD: y = 0.75. Correct: y = 0.5. */ | |
10092 | if (y != 0.5) | |
10093 | result |= 1; | |
10094 | } | |
10095 | /* Test on infinite numbers. */ | |
10096 | x = 1.0 / zero; | |
10097 | { | |
10098 | int exp; | |
10099 | double y = frexp (x, &exp); | |
10100 | if (y != x) | |
10101 | result |= 2; | |
10102 | } | |
10103 | /* Test on negative zero. */ | |
10104 | x = minus_zero; | |
10105 | { | |
10106 | int exp; | |
10107 | double y = frexp (x, &exp); | |
10108 | if (memcmp (&y, &x, sizeof x)) | |
10109 | result |= 4; | |
10110 | } | |
10111 | return result; | |
10112 | } | |
10113 | _ACEOF | |
10114 | if ac_fn_c_try_run "$LINENO"; then : | |
10115 | gl_cv_func_frexp_works=yes | |
10116 | else | |
10117 | gl_cv_func_frexp_works=no | |
10118 | fi | |
10119 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
10120 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
10121 | fi | |
472fa5ee SM |
10122 | |
10123 | ||
c0c3707f CB |
10124 | fi |
10125 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5 | |
10126 | $as_echo "$gl_cv_func_frexp_works" >&6; } | |
472fa5ee | 10127 | |
c0c3707f CB |
10128 | LIBS="$save_LIBS" |
10129 | case "$gl_cv_func_frexp_works" in | |
10130 | *yes) gl_func_frexp=yes ;; | |
10131 | *) gl_func_frexp=no; REPLACE_FREXP=1; FREXP_LIBM= ;; | |
10132 | esac | |
10133 | else | |
10134 | gl_func_frexp=no | |
10135 | fi | |
10136 | if test $gl_func_frexp = yes; then | |
472fa5ee | 10137 | |
c0c3707f | 10138 | $as_echo "#define HAVE_FREXP 1" >>confdefs.h |
472fa5ee | 10139 | |
c0c3707f | 10140 | fi |
8690e634 | 10141 | |
6ec2e0f5 SDJ |
10142 | |
10143 | ||
c0c3707f CB |
10144 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5 |
10145 | $as_echo_n "checking whether long double and double are the same... " >&6; } | |
10146 | if ${gl_cv_long_double_equals_double+:} false; then : | |
8690e634 JK |
10147 | $as_echo_n "(cached) " >&6 |
10148 | else | |
c0c3707f CB |
10149 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
10150 | /* end confdefs.h. */ | |
10151 | #include <float.h> | |
10152 | int | |
10153 | main () | |
10154 | { | |
10155 | typedef int check[sizeof (long double) == sizeof (double) | |
10156 | && LDBL_MANT_DIG == DBL_MANT_DIG | |
10157 | && LDBL_MAX_EXP == DBL_MAX_EXP | |
10158 | && LDBL_MIN_EXP == DBL_MIN_EXP | |
10159 | ? 1 : -1]; | |
8690e634 | 10160 | |
c0c3707f CB |
10161 | ; |
10162 | return 0; | |
10163 | } | |
10164 | _ACEOF | |
10165 | if ac_fn_c_try_compile "$LINENO"; then : | |
10166 | gl_cv_long_double_equals_double=yes | |
10167 | else | |
10168 | gl_cv_long_double_equals_double=no | |
10169 | fi | |
10170 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
8690e634 | 10171 | |
c0c3707f CB |
10172 | fi |
10173 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5 | |
10174 | $as_echo "$gl_cv_long_double_equals_double" >&6; } | |
10175 | if test $gl_cv_long_double_equals_double = yes; then | |
8690e634 | 10176 | |
c0c3707f | 10177 | $as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h |
6ec2e0f5 | 10178 | |
c0c3707f CB |
10179 | HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1 |
10180 | else | |
10181 | HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0 | |
10182 | fi | |
8690e634 | 10183 | |
6ec2e0f5 | 10184 | |
6ec2e0f5 | 10185 | |
6ec2e0f5 SDJ |
10186 | |
10187 | ||
6ec2e0f5 | 10188 | |
8690e634 JK |
10189 | |
10190 | ||
c0c3707f CB |
10191 | ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h> |
10192 | " | |
10193 | if test "x$ac_cv_have_decl_frexpl" = xyes; then : | |
8690e634 | 10194 | |
c0c3707f CB |
10195 | else |
10196 | HAVE_DECL_FREXPL=0 | |
10197 | fi | |
8690e634 | 10198 | |
6ec2e0f5 | 10199 | |
c0c3707f CB |
10200 | FREXPL_LIBM= |
10201 | if test $HAVE_DECL_FREXPL = 1; then | |
6ec2e0f5 | 10202 | |
c0c3707f CB |
10203 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5 |
10204 | $as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; } | |
10205 | if ${gl_cv_func_frexpl_no_libm+:} false; then : | |
8690e634 JK |
10206 | $as_echo_n "(cached) " >&6 |
10207 | else | |
c0c3707f CB |
10208 | |
10209 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 | 10210 | /* end confdefs.h. */ |
c0c3707f CB |
10211 | #include <math.h> |
10212 | long double x; | |
10213 | int | |
10214 | main () | |
10215 | { | |
10216 | int e; return frexpl (x, &e) > 0; | |
10217 | ; | |
10218 | return 0; | |
10219 | } | |
10220 | _ACEOF | |
10221 | if ac_fn_c_try_link "$LINENO"; then : | |
10222 | gl_cv_func_frexpl_no_libm=yes | |
10223 | else | |
10224 | gl_cv_func_frexpl_no_libm=no | |
10225 | fi | |
10226 | rm -f core conftest.err conftest.$ac_objext \ | |
10227 | conftest$ac_exeext conftest.$ac_ext | |
8690e634 | 10228 | |
c0c3707f CB |
10229 | fi |
10230 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5 | |
10231 | $as_echo "$gl_cv_func_frexpl_no_libm" >&6; } | |
6ec2e0f5 | 10232 | |
c0c3707f CB |
10233 | if test $gl_cv_func_frexpl_no_libm = no; then |
10234 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used with libm" >&5 | |
10235 | $as_echo_n "checking whether frexpl() can be used with libm... " >&6; } | |
10236 | if ${gl_cv_func_frexpl_in_libm+:} false; then : | |
10237 | $as_echo_n "(cached) " >&6 | |
10238 | else | |
6ec2e0f5 | 10239 | |
c0c3707f CB |
10240 | save_LIBS="$LIBS" |
10241 | LIBS="$LIBS -lm" | |
10242 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10243 | /* end confdefs.h. */ | |
10244 | #include <math.h> | |
10245 | long double x; | |
10246 | int | |
10247 | main () | |
10248 | { | |
10249 | int e; return frexpl (x, &e) > 0; | |
10250 | ; | |
10251 | return 0; | |
10252 | } | |
10253 | _ACEOF | |
10254 | if ac_fn_c_try_link "$LINENO"; then : | |
10255 | gl_cv_func_frexpl_in_libm=yes | |
10256 | else | |
10257 | gl_cv_func_frexpl_in_libm=no | |
10258 | fi | |
10259 | rm -f core conftest.err conftest.$ac_objext \ | |
10260 | conftest$ac_exeext conftest.$ac_ext | |
10261 | LIBS="$save_LIBS" | |
6ec2e0f5 | 10262 | |
c0c3707f CB |
10263 | fi |
10264 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_in_libm" >&5 | |
10265 | $as_echo "$gl_cv_func_frexpl_in_libm" >&6; } | |
10266 | if test $gl_cv_func_frexpl_in_libm = yes; then | |
10267 | FREXPL_LIBM=-lm | |
10268 | fi | |
10269 | fi | |
10270 | if test $gl_cv_func_frexpl_no_libm = yes \ | |
10271 | || test $gl_cv_func_frexpl_in_libm = yes; then | |
10272 | save_LIBS="$LIBS" | |
10273 | LIBS="$LIBS $FREXPL_LIBM" | |
8690e634 | 10274 | |
8690e634 | 10275 | |
c0c3707f CB |
10276 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5 |
10277 | $as_echo_n "checking whether frexpl works... " >&6; } | |
10278 | if ${gl_cv_func_frexpl_works+:} false; then : | |
10279 | $as_echo_n "(cached) " >&6 | |
10280 | else | |
8690e634 | 10281 | |
c0c3707f | 10282 | if test "$cross_compiling" = yes; then : |
8690e634 | 10283 | |
c0c3707f CB |
10284 | case "$host_os" in |
10285 | aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*) | |
10286 | gl_cv_func_frexpl_works="guessing no";; | |
10287 | *) gl_cv_func_frexpl_works="guessing yes";; | |
10288 | esac | |
8690e634 | 10289 | |
c0c3707f CB |
10290 | else |
10291 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10292 | /* end confdefs.h. */ | |
8690e634 | 10293 | |
c0c3707f CB |
10294 | #include <float.h> |
10295 | #include <math.h> | |
10296 | /* Override the values of <float.h>, like done in float.in.h. */ | |
10297 | #if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) | |
10298 | # undef LDBL_MIN_EXP | |
10299 | # define LDBL_MIN_EXP (-16381) | |
6ec2e0f5 | 10300 | #endif |
c0c3707f CB |
10301 | #if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__) |
10302 | # undef LDBL_MIN_EXP | |
10303 | # define LDBL_MIN_EXP (-16381) | |
6ec2e0f5 | 10304 | #endif |
c0c3707f CB |
10305 | #if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__ |
10306 | # undef LDBL_MIN_EXP | |
10307 | # define LDBL_MIN_EXP DBL_MIN_EXP | |
6ec2e0f5 | 10308 | #endif |
c0c3707f CB |
10309 | #if defined __sgi && (LDBL_MANT_DIG >= 106) |
10310 | # if defined __GNUC__ | |
10311 | # undef LDBL_MIN_EXP | |
10312 | # define LDBL_MIN_EXP DBL_MIN_EXP | |
10313 | # endif | |
6ec2e0f5 | 10314 | #endif |
c0c3707f CB |
10315 | extern |
10316 | #ifdef __cplusplus | |
10317 | "C" | |
10318 | #endif | |
10319 | long double frexpl (long double, int *); | |
9c9d63b1 | 10320 | long double zero = 0.0L; |
c0c3707f | 10321 | int main() |
8690e634 | 10322 | { |
c0c3707f CB |
10323 | int result = 0; |
10324 | volatile long double x; | |
10325 | /* Test on finite numbers that fails on AIX 5.1. */ | |
10326 | x = 16.0L; | |
10327 | { | |
10328 | int exp = -9999; | |
10329 | frexpl (x, &exp); | |
10330 | if (exp != 5) | |
10331 | result |= 1; | |
10332 | } | |
10333 | /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl | |
10334 | function returns an invalid (incorrectly normalized) value: it returns | |
10335 | y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 } | |
10336 | but the correct result is | |
10337 | 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */ | |
10338 | x = 1.01L; | |
10339 | { | |
10340 | int exp = -9999; | |
10341 | long double y = frexpl (x, &exp); | |
10342 | if (!(exp == 1 && y == 0.505L)) | |
10343 | result |= 2; | |
10344 | } | |
10345 | /* Test on large finite numbers. This fails on BeOS at i = 16322, while | |
10346 | LDBL_MAX_EXP = 16384. | |
10347 | In the loop end test, we test x against Infinity, rather than comparing | |
10348 | i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */ | |
10349 | { | |
10350 | int i; | |
10351 | for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L) | |
10352 | { | |
10353 | int exp = -9999; | |
10354 | frexpl (x, &exp); | |
10355 | if (exp != i) | |
10356 | { | |
10357 | result |= 4; | |
10358 | break; | |
10359 | } | |
10360 | } | |
10361 | } | |
10362 | /* Test on denormalized numbers. */ | |
10363 | { | |
10364 | int i; | |
10365 | for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L) | |
10366 | ; | |
10367 | if (x > 0.0L) | |
10368 | { | |
10369 | int exp; | |
10370 | long double y = frexpl (x, &exp); | |
10371 | /* On machines with IEEE854 arithmetic: x = 1.68105e-4932, | |
10372 | exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */ | |
10373 | if (exp != LDBL_MIN_EXP - 1) | |
10374 | result |= 8; | |
10375 | } | |
10376 | } | |
10377 | /* Test on infinite numbers. */ | |
9c9d63b1 PM |
10378 | /* The Microsoft MSVC 14 compiler chokes on the expression 1.0 / 0.0. */ |
10379 | x = 1.0L / zero; | |
c0c3707f CB |
10380 | { |
10381 | int exp; | |
10382 | long double y = frexpl (x, &exp); | |
10383 | if (y != x) | |
10384 | result |= 16; | |
10385 | } | |
10386 | return result; | |
8690e634 JK |
10387 | } |
10388 | _ACEOF | |
c0c3707f CB |
10389 | if ac_fn_c_try_run "$LINENO"; then : |
10390 | gl_cv_func_frexpl_works=yes | |
6ec2e0f5 | 10391 | else |
c0c3707f CB |
10392 | gl_cv_func_frexpl_works=no |
10393 | fi | |
10394 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
10395 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
10396 | fi | |
8690e634 | 10397 | |
8690e634 | 10398 | |
c0c3707f CB |
10399 | fi |
10400 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5 | |
10401 | $as_echo "$gl_cv_func_frexpl_works" >&6; } | |
8690e634 | 10402 | |
c0c3707f CB |
10403 | LIBS="$save_LIBS" |
10404 | case "$gl_cv_func_frexpl_works" in | |
10405 | *yes) gl_func_frexpl=yes ;; | |
10406 | *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;; | |
10407 | esac | |
10408 | else | |
10409 | gl_func_frexpl=no | |
10410 | fi | |
10411 | if test $gl_func_frexpl = yes; then | |
8690e634 | 10412 | |
c0c3707f | 10413 | $as_echo "#define HAVE_FREXPL 1" >>confdefs.h |
8690e634 | 10414 | |
c0c3707f CB |
10415 | fi |
10416 | fi | |
10417 | if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then | |
10418 | if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then | |
8690e634 | 10419 | |
c0c3707f CB |
10420 | FREXPL_LIBM="$FREXP_LIBM" |
10421 | else | |
10422 | FREXPL_LIBM= | |
10423 | fi | |
10424 | fi | |
6ec2e0f5 | 10425 | |
6ec2e0f5 | 10426 | |
6ec2e0f5 | 10427 | |
c0c3707f CB |
10428 | GNULIB_FCHMODAT=0; |
10429 | GNULIB_FSTAT=0; | |
10430 | GNULIB_FSTATAT=0; | |
10431 | GNULIB_FUTIMENS=0; | |
9c9d63b1 | 10432 | GNULIB_GETUMASK=0; |
c0c3707f CB |
10433 | GNULIB_LCHMOD=0; |
10434 | GNULIB_LSTAT=0; | |
9c9d63b1 | 10435 | GNULIB_MKDIR=0; |
c0c3707f CB |
10436 | GNULIB_MKDIRAT=0; |
10437 | GNULIB_MKFIFO=0; | |
10438 | GNULIB_MKFIFOAT=0; | |
10439 | GNULIB_MKNOD=0; | |
10440 | GNULIB_MKNODAT=0; | |
10441 | GNULIB_STAT=0; | |
10442 | GNULIB_UTIMENSAT=0; | |
10443 | GNULIB_OVERRIDES_STRUCT_STAT=0; | |
9c9d63b1 PM |
10444 | GNULIB_MDA_CHMOD=1; |
10445 | GNULIB_MDA_MKDIR=1; | |
10446 | GNULIB_MDA_UMASK=1; | |
c0c3707f CB |
10447 | HAVE_FCHMODAT=1; |
10448 | HAVE_FSTATAT=1; | |
10449 | HAVE_FUTIMENS=1; | |
9c9d63b1 | 10450 | HAVE_GETUMASK=1; |
c0c3707f CB |
10451 | HAVE_LCHMOD=1; |
10452 | HAVE_LSTAT=1; | |
10453 | HAVE_MKDIRAT=1; | |
10454 | HAVE_MKFIFO=1; | |
10455 | HAVE_MKFIFOAT=1; | |
10456 | HAVE_MKNOD=1; | |
10457 | HAVE_MKNODAT=1; | |
10458 | HAVE_UTIMENSAT=1; | |
5df4cba6 | 10459 | REPLACE_FCHMODAT=0; |
c0c3707f CB |
10460 | REPLACE_FSTAT=0; |
10461 | REPLACE_FSTATAT=0; | |
10462 | REPLACE_FUTIMENS=0; | |
10463 | REPLACE_LSTAT=0; | |
10464 | REPLACE_MKDIR=0; | |
10465 | REPLACE_MKFIFO=0; | |
9c9d63b1 | 10466 | REPLACE_MKFIFOAT=0; |
c0c3707f | 10467 | REPLACE_MKNOD=0; |
9c9d63b1 | 10468 | REPLACE_MKNODAT=0; |
c0c3707f CB |
10469 | REPLACE_STAT=0; |
10470 | REPLACE_UTIMENSAT=0; | |
10471 | ||
10472 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 | |
10473 | $as_echo_n "checking whether stat file-mode macros are broken... " >&6; } | |
10474 | if ${ac_cv_header_stat_broken+:} false; then : | |
10475 | $as_echo_n "(cached) " >&6 | |
10476 | else | |
10477 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10478 | /* end confdefs.h. */ | |
10479 | #include <sys/types.h> | |
10480 | #include <sys/stat.h> | |
10481 | ||
10482 | #if defined S_ISBLK && defined S_IFDIR | |
10483 | extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; | |
10484 | #endif | |
10485 | ||
10486 | #if defined S_ISBLK && defined S_IFCHR | |
10487 | extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; | |
10488 | #endif | |
10489 | ||
10490 | #if defined S_ISLNK && defined S_IFREG | |
10491 | extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; | |
10492 | #endif | |
8690e634 | 10493 | |
c0c3707f CB |
10494 | #if defined S_ISSOCK && defined S_IFREG |
10495 | extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; | |
10496 | #endif | |
8690e634 | 10497 | |
c0c3707f CB |
10498 | _ACEOF |
10499 | if ac_fn_c_try_compile "$LINENO"; then : | |
10500 | ac_cv_header_stat_broken=no | |
10501 | else | |
10502 | ac_cv_header_stat_broken=yes | |
6ec2e0f5 SDJ |
10503 | fi |
10504 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6ec2e0f5 | 10505 | fi |
c0c3707f CB |
10506 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 |
10507 | $as_echo "$ac_cv_header_stat_broken" >&6; } | |
10508 | if test $ac_cv_header_stat_broken = yes; then | |
8690e634 | 10509 | |
c0c3707f | 10510 | $as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h |
49e4877c | 10511 | |
c0c3707f | 10512 | fi |
49e4877c PA |
10513 | |
10514 | ||
10515 | ||
10516 | ||
8690e634 | 10517 | |
c0c3707f CB |
10518 | case "$host_os" in |
10519 | mingw*) | |
10520 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5 | |
10521 | $as_echo_n "checking for 64-bit off_t... " >&6; } | |
10522 | if ${gl_cv_type_off_t_64+:} false; then : | |
10523 | $as_echo_n "(cached) " >&6 | |
10524 | else | |
10525 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10526 | /* end confdefs.h. */ | |
10527 | #include <sys/types.h> | |
10528 | int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1]; | |
8690e634 | 10529 | |
6ec2e0f5 SDJ |
10530 | int |
10531 | main () | |
10532 | { | |
8690e634 | 10533 | |
6ec2e0f5 SDJ |
10534 | ; |
10535 | return 0; | |
10536 | } | |
10537 | _ACEOF | |
10538 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f CB |
10539 | gl_cv_type_off_t_64=yes |
10540 | else | |
10541 | gl_cv_type_off_t_64=no | |
6ec2e0f5 SDJ |
10542 | fi |
10543 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
8690e634 | 10544 | |
c0c3707f CB |
10545 | fi |
10546 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5 | |
10547 | $as_echo "$gl_cv_type_off_t_64" >&6; } | |
10548 | if test $gl_cv_type_off_t_64 = no; then | |
10549 | WINDOWS_64_BIT_OFF_T=1 | |
10550 | else | |
10551 | WINDOWS_64_BIT_OFF_T=0 | |
10552 | fi | |
10553 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5 | |
10554 | $as_echo_n "checking for 64-bit st_size... " >&6; } | |
10555 | if ${gl_cv_member_st_size_64+:} false; then : | |
6ec2e0f5 SDJ |
10556 | $as_echo_n "(cached) " >&6 |
10557 | else | |
c0c3707f | 10558 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6ec2e0f5 | 10559 | /* end confdefs.h. */ |
c0c3707f CB |
10560 | #include <sys/types.h> |
10561 | struct stat buf; | |
10562 | int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1]; | |
8690e634 | 10563 | |
6ec2e0f5 SDJ |
10564 | int |
10565 | main () | |
10566 | { | |
8690e634 | 10567 | |
6ec2e0f5 SDJ |
10568 | ; |
10569 | return 0; | |
10570 | } | |
10571 | _ACEOF | |
10572 | if ac_fn_c_try_compile "$LINENO"; then : | |
698be2d8 CB |
10573 | gl_cv_member_st_size_64=yes |
10574 | else | |
10575 | gl_cv_member_st_size_64=no | |
10576 | fi | |
10577 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
10578 | ||
10579 | fi | |
10580 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5 | |
10581 | $as_echo "$gl_cv_member_st_size_64" >&6; } | |
10582 | if test $gl_cv_member_st_size_64 = no; then | |
10583 | WINDOWS_64_BIT_ST_SIZE=1 | |
10584 | else | |
10585 | WINDOWS_64_BIT_ST_SIZE=0 | |
10586 | fi | |
10587 | ;; | |
10588 | *) | |
10589 | WINDOWS_64_BIT_OFF_T=0 | |
10590 | WINDOWS_64_BIT_ST_SIZE=0 | |
10591 | ;; | |
10592 | esac | |
10593 | ||
10594 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 | |
10595 | $as_echo_n "checking for C/C++ restrict keyword... " >&6; } | |
10596 | if ${ac_cv_c_restrict+:} false; then : | |
10597 | $as_echo_n "(cached) " >&6 | |
10598 | else | |
10599 | ac_cv_c_restrict=no | |
9c9d63b1 PM |
10600 | # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see: |
10601 | # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html | |
10602 | # Put 'restrict' last, because C++ lacks it. | |
10603 | for ac_kw in __restrict__ __restrict _Restrict restrict; do | |
698be2d8 CB |
10604 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
10605 | /* end confdefs.h. */ | |
10606 | typedef int *int_ptr; | |
10607 | int foo (int_ptr $ac_kw ip) { return ip[0]; } | |
10608 | int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ | |
10609 | int bar (int ip[$ac_kw]) { return ip[0]; } | |
10610 | ||
10611 | int | |
10612 | main () | |
10613 | { | |
10614 | int s[1]; | |
10615 | int *$ac_kw t = s; | |
10616 | t[0] = 0; | |
10617 | return foo (t) + bar (t); | |
10618 | ||
10619 | ; | |
10620 | return 0; | |
10621 | } | |
10622 | _ACEOF | |
10623 | if ac_fn_c_try_compile "$LINENO"; then : | |
10624 | ac_cv_c_restrict=$ac_kw | |
6ec2e0f5 SDJ |
10625 | fi |
10626 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
698be2d8 CB |
10627 | test "$ac_cv_c_restrict" != no && break |
10628 | done | |
8690e634 | 10629 | |
6ec2e0f5 | 10630 | fi |
698be2d8 CB |
10631 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 |
10632 | $as_echo "$ac_cv_c_restrict" >&6; } | |
10633 | ||
10634 | case $ac_cv_c_restrict in | |
10635 | restrict) ;; | |
10636 | no) $as_echo "#define restrict /**/" >>confdefs.h | |
10637 | ;; | |
10638 | *) cat >>confdefs.h <<_ACEOF | |
10639 | #define restrict $ac_cv_c_restrict | |
10640 | _ACEOF | |
10641 | ;; | |
10642 | esac | |
8690e634 JK |
10643 | |
10644 | ||
10645 | ||
10646 | ||
10647 | ||
10648 | ||
c0c3707f CB |
10649 | |
10650 | ||
10651 | ||
10652 | ||
10653 | ||
10654 | ||
10655 | ||
10656 | ||
10657 | ||
10658 | if test $gl_cv_have_include_next = yes; then | |
10659 | gl_cv_next_sys_stat_h='<'sys/stat.h'>' | |
10660 | else | |
10661 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5 | |
10662 | $as_echo_n "checking absolute name of <sys/stat.h>... " >&6; } | |
10663 | if ${gl_cv_next_sys_stat_h+:} false; then : | |
8690e634 JK |
10664 | $as_echo_n "(cached) " >&6 |
10665 | else | |
10666 | ||
c0c3707f | 10667 | if test $ac_cv_header_sys_stat_h = yes; then |
4a626d0a PA |
10668 | |
10669 | ||
4a626d0a | 10670 | |
c0c3707f CB |
10671 | |
10672 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10673 | /* end confdefs.h. */ | |
10674 | #include <sys/stat.h> | |
6ec2e0f5 | 10675 | _ACEOF |
c0c3707f CB |
10676 | case "$host_os" in |
10677 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
10678 | *) gl_absname_cpp="$ac_cpp" ;; | |
10679 | esac | |
10680 | ||
10681 | case "$host_os" in | |
10682 | mingw*) | |
10683 | gl_dirsep_regex='[/\\]' | |
10684 | ;; | |
10685 | *) | |
10686 | gl_dirsep_regex='\/' | |
10687 | ;; | |
10688 | esac | |
10689 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
10690 | gl_header_literal_regex=`echo 'sys/stat.h' \ | |
10691 | | sed -e "$gl_make_literal_regex_sed"` | |
10692 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
10693 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
10694 | s|^/[^/]|//&| | |
10695 | p | |
10696 | q | |
10697 | }' | |
10698 | ||
10699 | gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
10700 | sed -n "$gl_absolute_header_sed"` | |
10701 | ||
10702 | gl_header=$gl_cv_absolute_sys_stat_h | |
10703 | gl_cv_next_sys_stat_h='"'$gl_header'"' | |
10704 | else | |
10705 | gl_cv_next_sys_stat_h='<'sys/stat.h'>' | |
10706 | fi | |
10707 | ||
10708 | ||
10709 | fi | |
10710 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 | |
10711 | $as_echo "$gl_cv_next_sys_stat_h" >&6; } | |
10712 | fi | |
10713 | NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h | |
10714 | ||
10715 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
10716 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
10717 | gl_next_as_first_directive='<'sys/stat.h'>' | |
10718 | else | |
10719 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
10720 | gl_next_as_first_directive=$gl_cv_next_sys_stat_h | |
10721 | fi | |
10722 | NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive | |
10723 | ||
10724 | ||
10725 | ||
10726 | ||
10727 | ||
10728 | ||
10729 | ||
10730 | ||
10731 | WINDOWS_STAT_TIMESPEC=0 | |
10732 | ||
10733 | ||
10734 | ||
10735 | ||
4a626d0a | 10736 | |
4a626d0a | 10737 | |
8690e634 JK |
10738 | |
10739 | ||
c0c3707f CB |
10740 | ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h> |
10741 | #include <sys/stat.h> | |
10742 | " | |
10743 | if test "x$ac_cv_type_nlink_t" = xyes; then : | |
8690e634 | 10744 | |
6ec2e0f5 | 10745 | else |
8690e634 | 10746 | |
c0c3707f | 10747 | $as_echo "#define nlink_t int" >>confdefs.h |
6ec2e0f5 | 10748 | |
6ec2e0f5 | 10749 | fi |
8690e634 JK |
10750 | |
10751 | ||
10752 | ||
10753 | ||
10754 | ||
10755 | ||
10756 | ||
698be2d8 CB |
10757 | |
10758 | ||
6ec2e0f5 | 10759 | |
9c9d63b1 PM |
10760 | case "$host_os" in |
10761 | mingw*) | |
10762 | for ac_header in sdkddkver.h | |
10763 | do : | |
10764 | ac_fn_c_check_header_mongrel "$LINENO" "sdkddkver.h" "ac_cv_header_sdkddkver_h" "$ac_includes_default" | |
10765 | if test "x$ac_cv_header_sdkddkver_h" = xyes; then : | |
10766 | cat >>confdefs.h <<_ACEOF | |
10767 | #define HAVE_SDKDDKVER_H 1 | |
8690e634 | 10768 | _ACEOF |
6ec2e0f5 | 10769 | |
8690e634 | 10770 | fi |
c0c3707f | 10771 | |
9c9d63b1 | 10772 | done |
8690e634 | 10773 | |
c0c3707f CB |
10774 | ;; |
10775 | esac | |
8690e634 | 10776 | |
8690e634 | 10777 | |
8690e634 | 10778 | |
8690e634 | 10779 | |
c0c3707f CB |
10780 | |
10781 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5 | |
10782 | $as_echo_n "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; } | |
10783 | if ${gl_cv_func_getcwd_null+:} false; then : | |
8690e634 JK |
10784 | $as_echo_n "(cached) " >&6 |
10785 | else | |
c0c3707f CB |
10786 | if test "$cross_compiling" = yes; then : |
10787 | case "$host_os" in | |
10788 | # Guess yes on glibc systems. | |
10789 | *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";; | |
10790 | # Guess yes on musl systems. | |
10791 | *-musl*) gl_cv_func_getcwd_null="guessing yes";; | |
10792 | # Guess yes on Cygwin. | |
10793 | cygwin*) gl_cv_func_getcwd_null="guessing yes";; | |
10794 | # If we don't know, obey --enable-cross-guesses. | |
10795 | *) gl_cv_func_getcwd_null="$gl_cross_guess_normal";; | |
10796 | esac | |
10797 | ||
10798 | else | |
10799 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 JK |
10800 | /* end confdefs.h. */ |
10801 | ||
c0c3707f CB |
10802 | # include <stdlib.h> |
10803 | # if HAVE_UNISTD_H | |
10804 | # include <unistd.h> | |
10805 | # else /* on Windows with MSVC */ | |
10806 | # include <direct.h> | |
10807 | # endif | |
9c9d63b1 PM |
10808 | |
10809 | ||
10810 | $gl_mda_defines | |
10811 | ||
c0c3707f CB |
10812 | # ifndef getcwd |
10813 | char *getcwd (); | |
10814 | # endif | |
8690e634 JK |
10815 | |
10816 | int | |
10817 | main () | |
10818 | { | |
10819 | ||
c0c3707f | 10820 | #if defined _WIN32 && ! defined __CYGWIN__ |
9c9d63b1 | 10821 | /* mingw cwd does not start with '/', but _getcwd does allocate. |
c0c3707f CB |
10822 | However, mingw fails to honor non-zero size. */ |
10823 | #else | |
10824 | if (chdir ("/") != 0) | |
10825 | return 1; | |
10826 | else | |
10827 | { | |
10828 | char *f = getcwd (NULL, 0); | |
10829 | if (! f) | |
10830 | return 2; | |
10831 | if (f[0] != '/') | |
10832 | { free (f); return 3; } | |
10833 | if (f[1] != '\0') | |
10834 | { free (f); return 4; } | |
10835 | free (f); | |
10836 | return 0; | |
10837 | } | |
10838 | #endif | |
10839 | ||
8690e634 JK |
10840 | ; |
10841 | return 0; | |
10842 | } | |
10843 | _ACEOF | |
c0c3707f CB |
10844 | if ac_fn_c_try_run "$LINENO"; then : |
10845 | gl_cv_func_getcwd_null=yes | |
10846 | else | |
10847 | gl_cv_func_getcwd_null=no | |
8690e634 | 10848 | fi |
c0c3707f CB |
10849 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
10850 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
8690e634 | 10851 | fi |
8690e634 | 10852 | |
c0c3707f CB |
10853 | fi |
10854 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5 | |
10855 | $as_echo "$gl_cv_func_getcwd_null" >&6; } | |
8690e634 | 10856 | |
6ec2e0f5 | 10857 | |
c0c3707f CB |
10858 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5 |
10859 | $as_echo_n "checking for getcwd with POSIX signature... " >&6; } | |
10860 | if ${gl_cv_func_getcwd_posix_signature+:} false; then : | |
8690e634 JK |
10861 | $as_echo_n "(cached) " >&6 |
10862 | else | |
c0c3707f | 10863 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8690e634 | 10864 | /* end confdefs.h. */ |
c0c3707f | 10865 | #include <unistd.h> |
9c9d63b1 PM |
10866 | |
10867 | ||
10868 | $gl_mda_defines | |
10869 | ||
88b48903 WN |
10870 | int |
10871 | main () | |
10872 | { | |
c0c3707f CB |
10873 | extern |
10874 | #ifdef __cplusplus | |
10875 | "C" | |
10876 | #endif | |
10877 | char *getcwd (char *, size_t); | |
88b48903 WN |
10878 | |
10879 | ; | |
10880 | return 0; | |
10881 | } | |
c0c3707f | 10882 | |
88b48903 WN |
10883 | _ACEOF |
10884 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f CB |
10885 | gl_cv_func_getcwd_posix_signature=yes |
10886 | else | |
10887 | gl_cv_func_getcwd_posix_signature=no | |
8690e634 | 10888 | fi |
88b48903 | 10889 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
8690e634 | 10890 | |
c0c3707f CB |
10891 | fi |
10892 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5 | |
10893 | $as_echo "$gl_cv_func_getcwd_posix_signature" >&6; } | |
8690e634 | 10894 | |
c0c3707f CB |
10895 | ac_fn_c_check_decl "$LINENO" "getcwd" "ac_cv_have_decl_getcwd" "$ac_includes_default" |
10896 | if test "x$ac_cv_have_decl_getcwd" = xyes; then : | |
10897 | ac_have_decl=1 | |
10898 | else | |
10899 | ac_have_decl=0 | |
10900 | fi | |
8690e634 | 10901 | |
c0c3707f CB |
10902 | cat >>confdefs.h <<_ACEOF |
10903 | #define HAVE_DECL_GETCWD $ac_have_decl | |
10904 | _ACEOF | |
8690e634 JK |
10905 | |
10906 | ||
c17253b9 MF |
10907 | GNULIB_DPRINTF=0; |
10908 | GNULIB_FCLOSE=0; | |
10909 | GNULIB_FDOPEN=0; | |
10910 | GNULIB_FFLUSH=0; | |
10911 | GNULIB_FGETC=0; | |
10912 | GNULIB_FGETS=0; | |
10913 | GNULIB_FOPEN=0; | |
10914 | GNULIB_FPRINTF=0; | |
10915 | GNULIB_FPRINTF_POSIX=0; | |
10916 | GNULIB_FPURGE=0; | |
10917 | GNULIB_FPUTC=0; | |
10918 | GNULIB_FPUTS=0; | |
10919 | GNULIB_FREAD=0; | |
10920 | GNULIB_FREOPEN=0; | |
10921 | GNULIB_FSCANF=0; | |
10922 | GNULIB_FSEEK=0; | |
10923 | GNULIB_FSEEKO=0; | |
10924 | GNULIB_FTELL=0; | |
10925 | GNULIB_FTELLO=0; | |
10926 | GNULIB_FWRITE=0; | |
10927 | GNULIB_GETC=0; | |
10928 | GNULIB_GETCHAR=0; | |
10929 | GNULIB_GETDELIM=0; | |
10930 | GNULIB_GETLINE=0; | |
10931 | GNULIB_OBSTACK_PRINTF=0; | |
10932 | GNULIB_OBSTACK_PRINTF_POSIX=0; | |
10933 | GNULIB_PCLOSE=0; | |
10934 | GNULIB_PERROR=0; | |
10935 | GNULIB_POPEN=0; | |
10936 | GNULIB_PRINTF=0; | |
10937 | GNULIB_PRINTF_POSIX=0; | |
10938 | GNULIB_PUTC=0; | |
10939 | GNULIB_PUTCHAR=0; | |
10940 | GNULIB_PUTS=0; | |
10941 | GNULIB_REMOVE=0; | |
10942 | GNULIB_RENAME=0; | |
10943 | GNULIB_RENAMEAT=0; | |
10944 | GNULIB_SCANF=0; | |
10945 | GNULIB_SNPRINTF=0; | |
10946 | GNULIB_SPRINTF_POSIX=0; | |
10947 | GNULIB_STDIO_H_NONBLOCKING=0; | |
10948 | GNULIB_STDIO_H_SIGPIPE=0; | |
10949 | GNULIB_TMPFILE=0; | |
10950 | GNULIB_VASPRINTF=0; | |
10951 | GNULIB_VFSCANF=0; | |
10952 | GNULIB_VSCANF=0; | |
10953 | GNULIB_VDPRINTF=0; | |
10954 | GNULIB_VFPRINTF=0; | |
10955 | GNULIB_VFPRINTF_POSIX=0; | |
10956 | GNULIB_VPRINTF=0; | |
10957 | GNULIB_VPRINTF_POSIX=0; | |
10958 | GNULIB_VSNPRINTF=0; | |
10959 | GNULIB_VSPRINTF_POSIX=0; | |
10960 | GNULIB_MDA_FCLOSEALL=1; | |
10961 | GNULIB_MDA_FDOPEN=1; | |
10962 | GNULIB_MDA_FILENO=1; | |
10963 | GNULIB_MDA_GETW=1; | |
10964 | GNULIB_MDA_PUTW=1; | |
10965 | GNULIB_MDA_TEMPNAM=1; | |
10966 | HAVE_DECL_FCLOSEALL=1; | |
10967 | HAVE_DECL_FPURGE=1; | |
10968 | HAVE_DECL_FSEEKO=1; | |
10969 | HAVE_DECL_FTELLO=1; | |
10970 | HAVE_DECL_GETDELIM=1; | |
10971 | HAVE_DECL_GETLINE=1; | |
10972 | HAVE_DECL_OBSTACK_PRINTF=1; | |
10973 | HAVE_DECL_SNPRINTF=1; | |
10974 | HAVE_DECL_VSNPRINTF=1; | |
10975 | HAVE_DPRINTF=1; | |
10976 | HAVE_FSEEKO=1; | |
10977 | HAVE_FTELLO=1; | |
10978 | HAVE_PCLOSE=1; | |
10979 | HAVE_POPEN=1; | |
10980 | HAVE_RENAMEAT=1; | |
10981 | HAVE_VASPRINTF=1; | |
10982 | HAVE_VDPRINTF=1; | |
10983 | REPLACE_DPRINTF=0; | |
10984 | REPLACE_FCLOSE=0; | |
10985 | REPLACE_FDOPEN=0; | |
10986 | REPLACE_FFLUSH=0; | |
10987 | REPLACE_FOPEN=0; | |
10988 | REPLACE_FPRINTF=0; | |
10989 | REPLACE_FPURGE=0; | |
10990 | REPLACE_FREOPEN=0; | |
10991 | REPLACE_FSEEK=0; | |
10992 | REPLACE_FSEEKO=0; | |
10993 | REPLACE_FTELL=0; | |
10994 | REPLACE_FTELLO=0; | |
10995 | REPLACE_GETDELIM=0; | |
10996 | REPLACE_GETLINE=0; | |
10997 | REPLACE_OBSTACK_PRINTF=0; | |
10998 | REPLACE_PERROR=0; | |
10999 | REPLACE_POPEN=0; | |
11000 | REPLACE_PRINTF=0; | |
11001 | REPLACE_REMOVE=0; | |
11002 | REPLACE_RENAME=0; | |
11003 | REPLACE_RENAMEAT=0; | |
11004 | REPLACE_SNPRINTF=0; | |
11005 | REPLACE_SPRINTF=0; | |
11006 | REPLACE_STDIO_READ_FUNCS=0; | |
11007 | REPLACE_STDIO_WRITE_FUNCS=0; | |
11008 | REPLACE_TMPFILE=0; | |
11009 | REPLACE_VASPRINTF=0; | |
11010 | REPLACE_VDPRINTF=0; | |
11011 | REPLACE_VFPRINTF=0; | |
11012 | REPLACE_VPRINTF=0; | |
11013 | REPLACE_VSNPRINTF=0; | |
11014 | REPLACE_VSPRINTF=0; | |
11015 | ||
11016 | ac_fn_c_check_decl "$LINENO" "getdelim" "ac_cv_have_decl_getdelim" "$ac_includes_default" | |
11017 | if test "x$ac_cv_have_decl_getdelim" = xyes; then : | |
11018 | ac_have_decl=1 | |
11019 | else | |
11020 | ac_have_decl=0 | |
11021 | fi | |
11022 | ||
11023 | cat >>confdefs.h <<_ACEOF | |
11024 | #define HAVE_DECL_GETDELIM $ac_have_decl | |
11025 | _ACEOF | |
11026 | ||
11027 | ||
11028 | ||
11029 | ||
11030 | ||
11031 | ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default" | |
11032 | if test "x$ac_cv_have_decl_getdtablesize" = xyes; then : | |
11033 | ac_have_decl=1 | |
11034 | else | |
11035 | ac_have_decl=0 | |
11036 | fi | |
11037 | ||
11038 | cat >>confdefs.h <<_ACEOF | |
11039 | #define HAVE_DECL_GETDTABLESIZE $ac_have_decl | |
11040 | _ACEOF | |
11041 | ||
11042 | ac_fn_c_check_decl "$LINENO" "getline" "ac_cv_have_decl_getline" "$ac_includes_default" | |
11043 | if test "x$ac_cv_have_decl_getline" = xyes; then : | |
11044 | ac_have_decl=1 | |
11045 | else | |
11046 | ac_have_decl=0 | |
11047 | fi | |
11048 | ||
11049 | cat >>confdefs.h <<_ACEOF | |
11050 | #define HAVE_DECL_GETLINE $ac_have_decl | |
11051 | _ACEOF | |
11052 | ||
11053 | ac_fn_c_check_decl "$LINENO" "getlogin_r" "ac_cv_have_decl_getlogin_r" "$ac_includes_default" | |
11054 | if test "x$ac_cv_have_decl_getlogin_r" = xyes; then : | |
11055 | ac_have_decl=1 | |
11056 | else | |
11057 | ac_have_decl=0 | |
11058 | fi | |
11059 | ||
11060 | cat >>confdefs.h <<_ACEOF | |
11061 | #define HAVE_DECL_GETLOGIN_R $ac_have_decl | |
11062 | _ACEOF | |
11063 | ||
11064 | ||
11065 | ||
11066 | ac_fn_c_check_decl "$LINENO" "getlogin" "ac_cv_have_decl_getlogin" "$ac_includes_default" | |
11067 | if test "x$ac_cv_have_decl_getlogin" = xyes; then : | |
11068 | ac_have_decl=1 | |
11069 | else | |
11070 | ac_have_decl=0 | |
11071 | fi | |
11072 | ||
11073 | cat >>confdefs.h <<_ACEOF | |
11074 | #define HAVE_DECL_GETLOGIN $ac_have_decl | |
11075 | _ACEOF | |
11076 | ||
11077 | ||
11078 | ||
11079 | case $host_os in | |
11080 | mingw*) | |
c0c3707f CB |
11081 | LIB_GETLOGIN='-ladvapi32' ;; |
11082 | *) | |
11083 | LIB_GETLOGIN= ;; | |
11084 | esac | |
6ec2e0f5 | 11085 | |
472fa5ee SM |
11086 | |
11087 | ||
11088 | ||
6ec2e0f5 SDJ |
11089 | |
11090 | ||
11091 | ||
698be2d8 CB |
11092 | GNULIB_GETRANDOM=0; |
11093 | HAVE_GETRANDOM=1; | |
11094 | REPLACE_GETRANDOM=0; | |
11095 | ||
11096 | ||
11097 | ||
11098 | ||
c0c3707f CB |
11099 | GNULIB_GETTIMEOFDAY=0; |
11100 | HAVE_GETTIMEOFDAY=1; | |
11101 | HAVE_STRUCT_TIMEVAL=1; | |
11102 | HAVE_SYS_TIME_H=1; | |
11103 | REPLACE_GETTIMEOFDAY=0; | |
11104 | REPLACE_STRUCT_TIMEVAL=0; | |
472fa5ee | 11105 | |
472fa5ee | 11106 | |
6ec2e0f5 SDJ |
11107 | |
11108 | ||
11109 | ||
11110 | ||
11111 | ||
11112 | ||
472fa5ee SM |
11113 | |
11114 | ||
11115 | ||
6ec2e0f5 SDJ |
11116 | |
11117 | ||
11118 | ||
11119 | ||
11120 | ||
11121 | if test $gl_cv_have_include_next = yes; then | |
c0c3707f | 11122 | gl_cv_next_sys_time_h='<'sys/time.h'>' |
6ec2e0f5 | 11123 | else |
c0c3707f CB |
11124 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5 |
11125 | $as_echo_n "checking absolute name of <sys/time.h>... " >&6; } | |
11126 | if ${gl_cv_next_sys_time_h+:} false; then : | |
6ec2e0f5 | 11127 | $as_echo_n "(cached) " >&6 |
88b48903 | 11128 | else |
8690e634 | 11129 | |
c0c3707f | 11130 | if test $ac_cv_header_sys_time_h = yes; then |
8690e634 JK |
11131 | |
11132 | ||
8690e634 JK |
11133 | |
11134 | ||
6ec2e0f5 SDJ |
11135 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
11136 | /* end confdefs.h. */ | |
c0c3707f | 11137 | #include <sys/time.h> |
88b48903 | 11138 | _ACEOF |
6ec2e0f5 SDJ |
11139 | case "$host_os" in |
11140 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
11141 | *) gl_absname_cpp="$ac_cpp" ;; | |
11142 | esac | |
8690e634 | 11143 | |
6ec2e0f5 SDJ |
11144 | case "$host_os" in |
11145 | mingw*) | |
11146 | gl_dirsep_regex='[/\\]' | |
11147 | ;; | |
11148 | *) | |
11149 | gl_dirsep_regex='\/' | |
88b48903 WN |
11150 | ;; |
11151 | esac | |
6ec2e0f5 | 11152 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' |
c0c3707f | 11153 | gl_header_literal_regex=`echo 'sys/time.h' \ |
6ec2e0f5 SDJ |
11154 | | sed -e "$gl_make_literal_regex_sed"` |
11155 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
11156 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
11157 | s|^/[^/]|//&| | |
11158 | p | |
11159 | q | |
11160 | }' | |
8690e634 | 11161 | |
c0c3707f | 11162 | gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
6ec2e0f5 | 11163 | sed -n "$gl_absolute_header_sed"` |
8690e634 | 11164 | |
c0c3707f CB |
11165 | gl_header=$gl_cv_absolute_sys_time_h |
11166 | gl_cv_next_sys_time_h='"'$gl_header'"' | |
6ec2e0f5 | 11167 | else |
c0c3707f | 11168 | gl_cv_next_sys_time_h='<'sys/time.h'>' |
6ec2e0f5 | 11169 | fi |
88b48903 | 11170 | |
88b48903 | 11171 | |
88b48903 | 11172 | fi |
c0c3707f CB |
11173 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5 |
11174 | $as_echo "$gl_cv_next_sys_time_h" >&6; } | |
6ec2e0f5 | 11175 | fi |
c0c3707f | 11176 | NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h |
88b48903 | 11177 | |
6ec2e0f5 SDJ |
11178 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
11179 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
c0c3707f | 11180 | gl_next_as_first_directive='<'sys/time.h'>' |
6ec2e0f5 SDJ |
11181 | else |
11182 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
c0c3707f CB |
11183 | gl_next_as_first_directive=$gl_cv_next_sys_time_h |
11184 | fi | |
11185 | NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive | |
6ec2e0f5 | 11186 | |
6ec2e0f5 SDJ |
11187 | |
11188 | ||
11189 | ||
6ec2e0f5 | 11190 | |
c0c3707f CB |
11191 | if test $ac_cv_header_sys_time_h != yes; then |
11192 | HAVE_SYS_TIME_H=0 | |
11193 | fi | |
6ec2e0f5 | 11194 | |
6ec2e0f5 | 11195 | |
6ec2e0f5 | 11196 | |
6ec2e0f5 | 11197 | |
6ec2e0f5 | 11198 | |
c0c3707f CB |
11199 | if test $ac_cv_header_sys_socket_h != yes; then |
11200 | for ac_header in winsock2.h | |
11201 | do : | |
11202 | ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" | |
11203 | if test "x$ac_cv_header_winsock2_h" = xyes; then : | |
11204 | cat >>confdefs.h <<_ACEOF | |
11205 | #define HAVE_WINSOCK2_H 1 | |
6ec2e0f5 | 11206 | _ACEOF |
6ec2e0f5 | 11207 | |
6ec2e0f5 | 11208 | fi |
6ec2e0f5 | 11209 | |
c0c3707f | 11210 | done |
6ec2e0f5 | 11211 | |
c0c3707f CB |
11212 | fi |
11213 | if test "$ac_cv_header_winsock2_h" = yes; then | |
11214 | HAVE_WINSOCK2_H=1 | |
11215 | UNISTD_H_HAVE_WINSOCK2_H=1 | |
11216 | SYS_IOCTL_H_HAVE_WINSOCK2_H=1 | |
11217 | else | |
11218 | HAVE_WINSOCK2_H=0 | |
11219 | fi | |
11220 | ||
11221 | ||
11222 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5 | |
11223 | $as_echo_n "checking for struct timeval... " >&6; } | |
11224 | if ${gl_cv_sys_struct_timeval+:} false; then : | |
11225 | $as_echo_n "(cached) " >&6 | |
11226 | else | |
11227 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 11228 | /* end confdefs.h. */ |
c0c3707f CB |
11229 | #if HAVE_SYS_TIME_H |
11230 | #include <sys/time.h> | |
11231 | #endif | |
11232 | #include <time.h> | |
11233 | #if HAVE_WINSOCK2_H | |
11234 | # include <winsock2.h> | |
11235 | #endif | |
6ec2e0f5 SDJ |
11236 | |
11237 | int | |
11238 | main () | |
11239 | { | |
c0c3707f | 11240 | static struct timeval x; x.tv_sec = x.tv_usec; |
6ec2e0f5 SDJ |
11241 | ; |
11242 | return 0; | |
11243 | } | |
11244 | _ACEOF | |
11245 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 11246 | gl_cv_sys_struct_timeval=yes |
6ec2e0f5 | 11247 | else |
c0c3707f | 11248 | gl_cv_sys_struct_timeval=no |
6ec2e0f5 SDJ |
11249 | fi |
11250 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
88b48903 | 11251 | |
c0c3707f CB |
11252 | fi |
11253 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5 | |
11254 | $as_echo "$gl_cv_sys_struct_timeval" >&6; } | |
11255 | if test $gl_cv_sys_struct_timeval != yes; then | |
11256 | HAVE_STRUCT_TIMEVAL=0 | |
11257 | else | |
11258 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5 | |
11259 | $as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; } | |
11260 | if ${gl_cv_sys_struct_timeval_tv_sec+:} false; then : | |
11261 | $as_echo_n "(cached) " >&6 | |
11262 | else | |
11263 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
88b48903 | 11264 | /* end confdefs.h. */ |
c0c3707f CB |
11265 | #if HAVE_SYS_TIME_H |
11266 | #include <sys/time.h> | |
11267 | #endif | |
11268 | #include <time.h> | |
11269 | #if HAVE_WINSOCK2_H | |
11270 | # include <winsock2.h> | |
11271 | #endif | |
88b48903 WN |
11272 | |
11273 | int | |
11274 | main () | |
11275 | { | |
c0c3707f CB |
11276 | static struct timeval x; |
11277 | typedef int verify_tv_sec_type[ | |
11278 | sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 | |
11279 | ]; | |
88b48903 WN |
11280 | |
11281 | ; | |
11282 | return 0; | |
11283 | } | |
11284 | _ACEOF | |
11285 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 11286 | gl_cv_sys_struct_timeval_tv_sec=yes |
88b48903 | 11287 | else |
c0c3707f | 11288 | gl_cv_sys_struct_timeval_tv_sec=no |
88b48903 WN |
11289 | fi |
11290 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c0c3707f | 11291 | |
88b48903 | 11292 | fi |
c0c3707f CB |
11293 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5 |
11294 | $as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; } | |
11295 | if test $gl_cv_sys_struct_timeval_tv_sec != yes; then | |
11296 | REPLACE_STRUCT_TIMEVAL=1 | |
88b48903 | 11297 | fi |
c0c3707f | 11298 | fi |
88b48903 | 11299 | |
c0c3707f CB |
11300 | |
11301 | ||
11302 | ||
11303 | ||
11304 | ||
11305 | ||
11306 | ||
11307 | ||
11308 | ||
11309 | ||
c0c3707f CB |
11310 | GNULIB_GLOB=0; |
11311 | HAVE_GLOB=1; | |
11312 | HAVE_GLOB_PATTERN_P=1; | |
11313 | REPLACE_GLOB=0; | |
11314 | REPLACE_GLOB_PATTERN_P=0; | |
11315 | ||
11316 | ||
11317 | ||
11318 | ||
11319 | ||
11320 | ||
11321 | ||
11322 | ||
11323 | ||
11324 | ||
11325 | ||
11326 | ||
11327 | ||
11328 | ||
11329 | ||
11330 | ||
11331 | ||
11332 | if test $gl_cv_have_include_next = yes; then | |
11333 | gl_cv_next_glob_h='<'glob.h'>' | |
11334 | else | |
11335 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <glob.h>" >&5 | |
11336 | $as_echo_n "checking absolute name of <glob.h>... " >&6; } | |
11337 | if ${gl_cv_next_glob_h+:} false; then : | |
11338 | $as_echo_n "(cached) " >&6 | |
88b48903 | 11339 | else |
c0c3707f CB |
11340 | |
11341 | if test $ac_cv_header_glob_h = yes; then | |
11342 | ||
11343 | ||
11344 | ||
11345 | ||
88b48903 WN |
11346 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
11347 | /* end confdefs.h. */ | |
c0c3707f CB |
11348 | #include <glob.h> |
11349 | _ACEOF | |
11350 | case "$host_os" in | |
11351 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
11352 | *) gl_absname_cpp="$ac_cpp" ;; | |
11353 | esac | |
88b48903 | 11354 | |
c0c3707f CB |
11355 | case "$host_os" in |
11356 | mingw*) | |
11357 | gl_dirsep_regex='[/\\]' | |
11358 | ;; | |
11359 | *) | |
11360 | gl_dirsep_regex='\/' | |
11361 | ;; | |
11362 | esac | |
11363 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
11364 | gl_header_literal_regex=`echo 'glob.h' \ | |
11365 | | sed -e "$gl_make_literal_regex_sed"` | |
11366 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
11367 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
11368 | s|^/[^/]|//&| | |
11369 | p | |
11370 | q | |
11371 | }' | |
11372 | ||
11373 | gl_cv_absolute_glob_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
11374 | sed -n "$gl_absolute_header_sed"` | |
11375 | ||
11376 | gl_header=$gl_cv_absolute_glob_h | |
11377 | gl_cv_next_glob_h='"'$gl_header'"' | |
11378 | else | |
11379 | gl_cv_next_glob_h='<'glob.h'>' | |
11380 | fi | |
88b48903 | 11381 | |
88b48903 | 11382 | |
88b48903 | 11383 | fi |
c0c3707f CB |
11384 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_glob_h" >&5 |
11385 | $as_echo "$gl_cv_next_glob_h" >&6; } | |
11386 | fi | |
11387 | NEXT_GLOB_H=$gl_cv_next_glob_h | |
88b48903 | 11388 | |
c0c3707f CB |
11389 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
11390 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
11391 | gl_next_as_first_directive='<'glob.h'>' | |
11392 | else | |
11393 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
11394 | gl_next_as_first_directive=$gl_cv_next_glob_h | |
11395 | fi | |
11396 | NEXT_AS_FIRST_DIRECTIVE_GLOB_H=$gl_next_as_first_directive | |
88b48903 | 11397 | |
88b48903 WN |
11398 | |
11399 | ||
11400 | ||
2196f55f | 11401 | |
c0c3707f CB |
11402 | if test $ac_cv_header_glob_h = yes; then |
11403 | HAVE_GLOB_H=1 | |
11404 | else | |
11405 | HAVE_GLOB_H=0 | |
11406 | fi | |
2196f55f | 11407 | |
6ec2e0f5 | 11408 | |
c0c3707f CB |
11409 | GLOB_H='' |
11410 | if false; then | |
11411 | GLOB_H=glob.h | |
11412 | else | |
11413 | if test $ac_cv_header_glob_h != yes; then | |
11414 | GLOB_H=glob.h | |
11415 | fi | |
11416 | fi | |
11417 | ||
11418 | ||
11419 | if test -n "$GLOB_H"; then | |
11420 | GL_GENERATE_GLOB_H_TRUE= | |
11421 | GL_GENERATE_GLOB_H_FALSE='#' | |
88b48903 | 11422 | else |
c0c3707f CB |
11423 | GL_GENERATE_GLOB_H_TRUE='#' |
11424 | GL_GENERATE_GLOB_H_FALSE= | |
6ec2e0f5 SDJ |
11425 | fi |
11426 | ||
88b48903 | 11427 | |
88b48903 | 11428 | |
88b48903 | 11429 | |
88b48903 WN |
11430 | |
11431 | ||
11432 | ||
11433 | ||
11434 | ||
11435 | ||
11436 | ||
11437 | ||
8690e634 | 11438 | |
c0c3707f CB |
11439 | |
11440 | ||
c0c3707f | 11441 | |
5df4cba6 SM |
11442 | if test -z "$gl_pthreadlib_body_done"; then |
11443 | gl_pthread_api=no | |
11444 | LIBPTHREAD= | |
11445 | LIBPMULTITHREAD= | |
11446 | # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that | |
11447 | # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY. | |
11448 | ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" | |
11449 | if test "x$ac_cv_header_pthread_h" = xyes; then : | |
11450 | gl_have_pthread_h=yes | |
c0c3707f | 11451 | else |
5df4cba6 SM |
11452 | gl_have_pthread_h=no |
11453 | fi | |
c0c3707f | 11454 | |
5df4cba6 SM |
11455 | |
11456 | if test "$gl_have_pthread_h" = yes; then | |
11457 | # Other possible tests: | |
11458 | # -lpthreads (FSU threads, PCthreads) | |
11459 | # -lgthreads | |
11460 | # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist | |
11461 | # in libc. IRIX 6.5 has the first one in both libc and libpthread, but | |
11462 | # the second one only in libpthread, and lock.c needs it. | |
11463 | # | |
11464 | # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 | |
11465 | # needs -pthread for some reason. See: | |
11466 | # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html | |
11467 | save_LIBS=$LIBS | |
11468 | for gl_pthread in '' '-pthread'; do | |
11469 | LIBS="$LIBS $gl_pthread" | |
11470 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 11471 | /* end confdefs.h. */ |
5df4cba6 SM |
11472 | #include <pthread.h> |
11473 | pthread_mutex_t m; | |
11474 | pthread_mutexattr_t ma; | |
11475 | ||
8690e634 JK |
11476 | int |
11477 | main () | |
11478 | { | |
5df4cba6 SM |
11479 | pthread_mutex_lock (&m); |
11480 | pthread_mutexattr_init (&ma); | |
8690e634 JK |
11481 | ; |
11482 | return 0; | |
11483 | } | |
11484 | _ACEOF | |
5df4cba6 SM |
11485 | if ac_fn_c_try_link "$LINENO"; then : |
11486 | gl_pthread_api=yes | |
11487 | LIBPTHREAD=$gl_pthread | |
11488 | LIBPMULTITHREAD=$gl_pthread | |
c0c3707f | 11489 | fi |
5df4cba6 SM |
11490 | rm -f core conftest.err conftest.$ac_objext \ |
11491 | conftest$ac_exeext conftest.$ac_ext | |
11492 | LIBS=$save_LIBS | |
11493 | test $gl_pthread_api = yes && break | |
11494 | done | |
6ec2e0f5 | 11495 | |
5df4cba6 SM |
11496 | # Test for libpthread by looking for pthread_kill. (Not pthread_self, |
11497 | # since it is defined as a macro on OSF/1.) | |
11498 | if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then | |
11499 | # The program links fine without libpthread. But it may actually | |
11500 | # need to link with libpthread in order to create multiple threads. | |
11501 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
11502 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
11503 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
c0c3707f CB |
11504 | $as_echo_n "(cached) " >&6 |
11505 | else | |
5df4cba6 SM |
11506 | ac_check_lib_save_LIBS=$LIBS |
11507 | LIBS="-lpthread $LIBS" | |
11508 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 11509 | /* end confdefs.h. */ |
5df4cba6 SM |
11510 | |
11511 | /* Override any GCC internal prototype to avoid an error. | |
11512 | Use char because int might match the return type of a GCC | |
11513 | builtin and then its argument prototype would still apply. */ | |
11514 | #ifdef __cplusplus | |
11515 | extern "C" | |
11516 | #endif | |
11517 | char pthread_kill (); | |
6ec2e0f5 SDJ |
11518 | int |
11519 | main () | |
11520 | { | |
5df4cba6 | 11521 | return pthread_kill (); |
6ec2e0f5 SDJ |
11522 | ; |
11523 | return 0; | |
11524 | } | |
11525 | _ACEOF | |
5df4cba6 SM |
11526 | if ac_fn_c_try_link "$LINENO"; then : |
11527 | ac_cv_lib_pthread_pthread_kill=yes | |
6ec2e0f5 | 11528 | else |
5df4cba6 | 11529 | ac_cv_lib_pthread_pthread_kill=no |
8690e634 | 11530 | fi |
5df4cba6 SM |
11531 | rm -f core conftest.err conftest.$ac_objext \ |
11532 | conftest$ac_exeext conftest.$ac_ext | |
11533 | LIBS=$ac_check_lib_save_LIBS | |
11534 | fi | |
11535 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 | |
11536 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
11537 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
11538 | LIBPMULTITHREAD=-lpthread | |
11539 | # On Solaris and HP-UX, most pthread functions exist also in libc. | |
11540 | # Therefore pthread_in_use() needs to actually try to create a | |
11541 | # thread: pthread_create from libc will fail, whereas | |
11542 | # pthread_create will actually create a thread. | |
11543 | # On Solaris 10 or newer, this test is no longer needed, because | |
11544 | # libc contains the fully functional pthread functions. | |
11545 | case "$host_os" in | |
11546 | solaris | solaris2.1-9 | solaris2.1-9.* | hpux*) | |
11547 | ||
11548 | $as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h | |
11549 | ||
11550 | esac | |
c0c3707f | 11551 | |
6ec2e0f5 | 11552 | fi |
8690e634 | 11553 | |
5df4cba6 SM |
11554 | elif test $gl_pthread_api != yes; then |
11555 | # Some library is needed. Try libpthread and libc_r. | |
11556 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
11557 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
11558 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
11559 | $as_echo_n "(cached) " >&6 | |
11560 | else | |
11561 | ac_check_lib_save_LIBS=$LIBS | |
11562 | LIBS="-lpthread $LIBS" | |
11563 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11564 | /* end confdefs.h. */ | |
c0c3707f | 11565 | |
5df4cba6 SM |
11566 | /* Override any GCC internal prototype to avoid an error. |
11567 | Use char because int might match the return type of a GCC | |
11568 | builtin and then its argument prototype would still apply. */ | |
11569 | #ifdef __cplusplus | |
11570 | extern "C" | |
11571 | #endif | |
11572 | char pthread_kill (); | |
11573 | int | |
11574 | main () | |
11575 | { | |
11576 | return pthread_kill (); | |
11577 | ; | |
11578 | return 0; | |
11579 | } | |
11580 | _ACEOF | |
11581 | if ac_fn_c_try_link "$LINENO"; then : | |
11582 | ac_cv_lib_pthread_pthread_kill=yes | |
11583 | else | |
11584 | ac_cv_lib_pthread_pthread_kill=no | |
11585 | fi | |
11586 | rm -f core conftest.err conftest.$ac_objext \ | |
11587 | conftest$ac_exeext conftest.$ac_ext | |
11588 | LIBS=$ac_check_lib_save_LIBS | |
11589 | fi | |
11590 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 | |
11591 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
11592 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
11593 | gl_pthread_api=yes | |
11594 | LIBPTHREAD=-lpthread | |
11595 | LIBPMULTITHREAD=-lpthread | |
11596 | fi | |
c0c3707f | 11597 | |
5df4cba6 SM |
11598 | if test $gl_pthread_api != yes; then |
11599 | # For FreeBSD 4. | |
11600 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5 | |
11601 | $as_echo_n "checking for pthread_kill in -lc_r... " >&6; } | |
11602 | if ${ac_cv_lib_c_r_pthread_kill+:} false; then : | |
11603 | $as_echo_n "(cached) " >&6 | |
11604 | else | |
11605 | ac_check_lib_save_LIBS=$LIBS | |
11606 | LIBS="-lc_r $LIBS" | |
11607 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11608 | /* end confdefs.h. */ | |
c0c3707f | 11609 | |
5df4cba6 SM |
11610 | /* Override any GCC internal prototype to avoid an error. |
11611 | Use char because int might match the return type of a GCC | |
11612 | builtin and then its argument prototype would still apply. */ | |
11613 | #ifdef __cplusplus | |
11614 | extern "C" | |
11615 | #endif | |
11616 | char pthread_kill (); | |
11617 | int | |
11618 | main () | |
11619 | { | |
11620 | return pthread_kill (); | |
11621 | ; | |
11622 | return 0; | |
11623 | } | |
11624 | _ACEOF | |
11625 | if ac_fn_c_try_link "$LINENO"; then : | |
11626 | ac_cv_lib_c_r_pthread_kill=yes | |
11627 | else | |
11628 | ac_cv_lib_c_r_pthread_kill=no | |
11629 | fi | |
11630 | rm -f core conftest.err conftest.$ac_objext \ | |
11631 | conftest$ac_exeext conftest.$ac_ext | |
11632 | LIBS=$ac_check_lib_save_LIBS | |
11633 | fi | |
11634 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5 | |
11635 | $as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; } | |
11636 | if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then : | |
11637 | gl_pthread_api=yes | |
11638 | LIBPTHREAD=-lc_r | |
11639 | LIBPMULTITHREAD=-lc_r | |
11640 | fi | |
c0c3707f | 11641 | |
5df4cba6 SM |
11642 | fi |
11643 | fi | |
11644 | fi | |
11645 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 | |
11646 | $as_echo_n "checking whether POSIX threads API is available... " >&6; } | |
11647 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5 | |
11648 | $as_echo "$gl_pthread_api" >&6; } | |
c0c3707f CB |
11649 | |
11650 | ||
5df4cba6 | 11651 | if test $gl_pthread_api = yes; then |
c0c3707f | 11652 | |
5df4cba6 | 11653 | $as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h |
c0c3707f | 11654 | |
5df4cba6 | 11655 | fi |
c0c3707f | 11656 | |
5df4cba6 SM |
11657 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
11658 | /* end confdefs.h. */ | |
11659 | #include <sched.h> | |
11660 | int | |
11661 | main () | |
11662 | { | |
11663 | sched_yield (); | |
11664 | ; | |
11665 | return 0; | |
11666 | } | |
11667 | _ACEOF | |
11668 | if ac_fn_c_try_link "$LINENO"; then : | |
11669 | LIB_SCHED_YIELD= | |
c0c3707f | 11670 | |
5df4cba6 SM |
11671 | else |
11672 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 | |
11673 | $as_echo_n "checking for sched_yield in -lrt... " >&6; } | |
11674 | if ${ac_cv_lib_rt_sched_yield+:} false; then : | |
c0c3707f | 11675 | $as_echo_n "(cached) " >&6 |
6ec2e0f5 | 11676 | else |
5df4cba6 SM |
11677 | ac_check_lib_save_LIBS=$LIBS |
11678 | LIBS="-lrt $LIBS" | |
11679 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 11680 | /* end confdefs.h. */ |
6ec2e0f5 | 11681 | |
5df4cba6 SM |
11682 | /* Override any GCC internal prototype to avoid an error. |
11683 | Use char because int might match the return type of a GCC | |
11684 | builtin and then its argument prototype would still apply. */ | |
11685 | #ifdef __cplusplus | |
11686 | extern "C" | |
11687 | #endif | |
11688 | char sched_yield (); | |
11689 | int | |
11690 | main () | |
11691 | { | |
11692 | return sched_yield (); | |
11693 | ; | |
11694 | return 0; | |
11695 | } | |
11696 | _ACEOF | |
11697 | if ac_fn_c_try_link "$LINENO"; then : | |
11698 | ac_cv_lib_rt_sched_yield=yes | |
11699 | else | |
11700 | ac_cv_lib_rt_sched_yield=no | |
11701 | fi | |
11702 | rm -f core conftest.err conftest.$ac_objext \ | |
11703 | conftest$ac_exeext conftest.$ac_ext | |
11704 | LIBS=$ac_check_lib_save_LIBS | |
11705 | fi | |
11706 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 | |
11707 | $as_echo "$ac_cv_lib_rt_sched_yield" >&6; } | |
11708 | if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : | |
11709 | LIB_SCHED_YIELD=-lrt | |
11710 | else | |
11711 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5 | |
11712 | $as_echo_n "checking for sched_yield in -lposix4... " >&6; } | |
11713 | if ${ac_cv_lib_posix4_sched_yield+:} false; then : | |
11714 | $as_echo_n "(cached) " >&6 | |
11715 | else | |
11716 | ac_check_lib_save_LIBS=$LIBS | |
11717 | LIBS="-lposix4 $LIBS" | |
11718 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11719 | /* end confdefs.h. */ | |
6ec2e0f5 | 11720 | |
5df4cba6 SM |
11721 | /* Override any GCC internal prototype to avoid an error. |
11722 | Use char because int might match the return type of a GCC | |
11723 | builtin and then its argument prototype would still apply. */ | |
11724 | #ifdef __cplusplus | |
11725 | extern "C" | |
11726 | #endif | |
11727 | char sched_yield (); | |
11728 | int | |
11729 | main () | |
11730 | { | |
11731 | return sched_yield (); | |
11732 | ; | |
11733 | return 0; | |
11734 | } | |
11735 | _ACEOF | |
11736 | if ac_fn_c_try_link "$LINENO"; then : | |
11737 | ac_cv_lib_posix4_sched_yield=yes | |
11738 | else | |
11739 | ac_cv_lib_posix4_sched_yield=no | |
11740 | fi | |
11741 | rm -f core conftest.err conftest.$ac_objext \ | |
11742 | conftest$ac_exeext conftest.$ac_ext | |
11743 | LIBS=$ac_check_lib_save_LIBS | |
11744 | fi | |
11745 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5 | |
11746 | $as_echo "$ac_cv_lib_posix4_sched_yield" >&6; } | |
11747 | if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then : | |
11748 | LIB_SCHED_YIELD=-lposix4 | |
6ec2e0f5 | 11749 | fi |
8690e634 | 11750 | |
5df4cba6 | 11751 | fi |
8690e634 | 11752 | |
8690e634 | 11753 | |
5df4cba6 SM |
11754 | fi |
11755 | rm -f core conftest.err conftest.$ac_objext \ | |
11756 | conftest$ac_exeext conftest.$ac_ext | |
6ec2e0f5 SDJ |
11757 | |
11758 | ||
5df4cba6 | 11759 | gl_pthreadlib_body_done=done |
c0c3707f | 11760 | fi |
6ec2e0f5 | 11761 | |
6ec2e0f5 | 11762 | |
8690e634 JK |
11763 | |
11764 | ||
472fa5ee | 11765 | |
c0c3707f | 11766 | |
c0c3707f | 11767 | |
c0c3707f | 11768 | |
c0c3707f | 11769 | |
5df4cba6 SM |
11770 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5 |
11771 | $as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; } | |
11772 | if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then : | |
11773 | $as_echo_n "(cached) " >&6 | |
11774 | else | |
11775 | case "$host_os" in | |
11776 | # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin. | |
11777 | *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*) | |
11778 | gl_cv_func_setlocale_null_all_mtsafe=no ;; | |
11779 | # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows. | |
11780 | *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*) | |
11781 | gl_cv_func_setlocale_null_all_mtsafe=yes ;; | |
11782 | # If we don't know, obey --enable-cross-guesses. | |
11783 | *) | |
11784 | gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;; | |
11785 | esac | |
c0c3707f | 11786 | |
5e8754f9 | 11787 | fi |
5df4cba6 SM |
11788 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5 |
11789 | $as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; } | |
11790 | case "$host_os" in | |
11791 | mingw*) ;; | |
11792 | *) | |
11793 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then | |
11794 | gl_cv_func_setlocale_null_all_mtsafe="trivially yes" | |
11795 | fi | |
11796 | ;; | |
11797 | esac | |
11798 | case "$gl_cv_func_setlocale_null_all_mtsafe" in | |
11799 | *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;; | |
11800 | *) SETLOCALE_NULL_ALL_MTSAFE=0 ;; | |
11801 | esac | |
5e8754f9 SDJ |
11802 | |
11803 | cat >>confdefs.h <<_ACEOF | |
5df4cba6 | 11804 | #define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE |
5e8754f9 SDJ |
11805 | _ACEOF |
11806 | ||
11807 | ||
5df4cba6 SM |
11808 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5 |
11809 | $as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; } | |
11810 | if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then : | |
11811 | $as_echo_n "(cached) " >&6 | |
11812 | else | |
11813 | case "$host_os" in | |
11814 | # Guess no on OpenBSD, AIX. | |
11815 | openbsd* | aix*) | |
11816 | gl_cv_func_setlocale_null_one_mtsafe=no ;; | |
11817 | # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows. | |
11818 | *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*) | |
11819 | gl_cv_func_setlocale_null_one_mtsafe=yes ;; | |
11820 | # If we don't know, obey --enable-cross-guesses. | |
11821 | *) | |
11822 | gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;; | |
11823 | esac | |
5abebf3c | 11824 | |
5df4cba6 SM |
11825 | fi |
11826 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5 | |
11827 | $as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; } | |
11828 | case "$host_os" in | |
11829 | mingw*) ;; | |
11830 | *) | |
11831 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then | |
11832 | gl_cv_func_setlocale_null_one_mtsafe="trivially yes" | |
11833 | fi | |
11834 | ;; | |
11835 | esac | |
11836 | case "$gl_cv_func_setlocale_null_one_mtsafe" in | |
11837 | *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;; | |
11838 | *) SETLOCALE_NULL_ONE_MTSAFE=0 ;; | |
11839 | esac | |
5abebf3c | 11840 | |
c0c3707f | 11841 | cat >>confdefs.h <<_ACEOF |
5df4cba6 | 11842 | #define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE |
5abebf3c | 11843 | _ACEOF |
c0c3707f CB |
11844 | |
11845 | ||
5df4cba6 SM |
11846 | if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then |
11847 | case "$host_os" in | |
11848 | mingw*) LIB_SETLOCALE_NULL= ;; | |
11849 | *) | |
11850 | ||
11851 | ||
11852 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 | |
11853 | $as_echo_n "checking whether imported symbols can be declared weak... " >&6; } | |
11854 | if ${gl_cv_have_weak+:} false; then : | |
11855 | $as_echo_n "(cached) " >&6 | |
5abebf3c | 11856 | else |
5df4cba6 SM |
11857 | gl_cv_have_weak=no |
11858 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11859 | /* end confdefs.h. */ | |
11860 | extern void xyzzy (); | |
11861 | #pragma weak xyzzy | |
11862 | int | |
11863 | main () | |
11864 | { | |
11865 | xyzzy(); | |
11866 | ; | |
11867 | return 0; | |
11868 | } | |
11869 | _ACEOF | |
11870 | if ac_fn_c_try_link "$LINENO"; then : | |
11871 | gl_cv_have_weak=maybe | |
5abebf3c | 11872 | fi |
5df4cba6 SM |
11873 | rm -f core conftest.err conftest.$ac_objext \ |
11874 | conftest$ac_exeext conftest.$ac_ext | |
11875 | if test $gl_cv_have_weak = maybe; then | |
11876 | if test "$cross_compiling" = yes; then : | |
11877 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11878 | /* end confdefs.h. */ | |
11879 | #ifdef __ELF__ | |
11880 | Extensible Linking Format | |
11881 | #endif | |
c0c3707f | 11882 | |
5df4cba6 SM |
11883 | _ACEOF |
11884 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
11885 | $EGREP "Extensible Linking Format" >/dev/null 2>&1; then : | |
11886 | gl_cv_have_weak="guessing yes" | |
11887 | else | |
11888 | gl_cv_have_weak="guessing no" | |
11889 | fi | |
11890 | rm -f conftest* | |
5abebf3c CB |
11891 | |
11892 | ||
5df4cba6 SM |
11893 | else |
11894 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11895 | /* end confdefs.h. */ | |
5abebf3c | 11896 | |
5df4cba6 SM |
11897 | #include <stdio.h> |
11898 | #pragma weak fputs | |
11899 | int main () | |
11900 | { | |
11901 | return (fputs == NULL); | |
11902 | } | |
c0c3707f | 11903 | _ACEOF |
5df4cba6 SM |
11904 | if ac_fn_c_try_run "$LINENO"; then : |
11905 | gl_cv_have_weak=yes | |
11906 | else | |
11907 | gl_cv_have_weak=no | |
11908 | fi | |
11909 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
11910 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
11911 | fi | |
11912 | ||
11913 | fi | |
11914 | case " $LDFLAGS " in | |
11915 | *" -static "*) gl_cv_have_weak=no ;; | |
11916 | esac | |
11917 | case "$gl_cv_have_weak" in | |
11918 | *yes) | |
11919 | case "$host_os" in | |
11920 | freebsd* | dragonfly*) | |
11921 | : > conftest1.c | |
11922 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1 | |
11923 | cat <<EOF > conftest2.c | |
11924 | #include <pthread.h> | |
11925 | #pragma weak pthread_mutexattr_gettype | |
11926 | int main () | |
11927 | { | |
11928 | return (pthread_mutexattr_gettype != NULL); | |
11929 | } | |
11930 | EOF | |
11931 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \ | |
11932 | || gl_cv_have_weak=no | |
11933 | rm -f conftest1.c libempty.so conftest2.c conftest | |
11934 | ;; | |
11935 | esac | |
11936 | ;; | |
11937 | esac | |
5abebf3c | 11938 | |
c0c3707f | 11939 | fi |
5df4cba6 SM |
11940 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 |
11941 | $as_echo "$gl_cv_have_weak" >&6; } | |
11942 | case "$gl_cv_have_weak" in | |
11943 | *yes) | |
5abebf3c | 11944 | |
5df4cba6 | 11945 | $as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h |
5abebf3c | 11946 | |
5df4cba6 SM |
11947 | ;; |
11948 | esac | |
11949 | ||
11950 | case "$gl_cv_have_weak" in | |
11951 | *yes) LIB_SETLOCALE_NULL= ;; | |
11952 | *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;; | |
11953 | esac | |
11954 | ;; | |
11955 | esac | |
5abebf3c | 11956 | else |
5df4cba6 | 11957 | LIB_SETLOCALE_NULL= |
5abebf3c | 11958 | fi |
5abebf3c CB |
11959 | |
11960 | ||
11961 | ||
5abebf3c | 11962 | |
5abebf3c | 11963 | |
5df4cba6 SM |
11964 | GNULIB_SOCKET=0; |
11965 | GNULIB_CONNECT=0; | |
11966 | GNULIB_ACCEPT=0; | |
11967 | GNULIB_BIND=0; | |
11968 | GNULIB_GETPEERNAME=0; | |
11969 | GNULIB_GETSOCKNAME=0; | |
11970 | GNULIB_GETSOCKOPT=0; | |
11971 | GNULIB_LISTEN=0; | |
11972 | GNULIB_RECV=0; | |
11973 | GNULIB_SEND=0; | |
11974 | GNULIB_RECVFROM=0; | |
11975 | GNULIB_SENDTO=0; | |
11976 | GNULIB_SETSOCKOPT=0; | |
11977 | GNULIB_SHUTDOWN=0; | |
11978 | GNULIB_ACCEPT4=0; | |
11979 | HAVE_STRUCT_SOCKADDR_STORAGE=1; | |
11980 | HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; | |
11981 | ||
11982 | HAVE_SA_FAMILY_T=1; | |
11983 | HAVE_ACCEPT4=1; | |
c0c3707f CB |
11984 | |
11985 | ||
11986 | ||
11987 | ||
11988 | ||
5df4cba6 SM |
11989 | case "$host_os" in |
11990 | osf*) | |
c0c3707f | 11991 | |
5df4cba6 | 11992 | $as_echo "#define _POSIX_PII_SOCKET 1" >>confdefs.h |
c0c3707f | 11993 | |
5df4cba6 SM |
11994 | ;; |
11995 | esac | |
c0c3707f | 11996 | |
5df4cba6 SM |
11997 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5 |
11998 | $as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; } | |
11999 | if ${gl_cv_header_sys_socket_h_selfcontained+:} false; then : | |
5abebf3c CB |
12000 | $as_echo_n "(cached) " >&6 |
12001 | else | |
5df4cba6 SM |
12002 | |
12003 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 12004 | /* end confdefs.h. */ |
c0c3707f | 12005 | #include <sys/socket.h> |
c0c3707f CB |
12006 | int |
12007 | main () | |
12008 | { | |
5df4cba6 | 12009 | |
c0c3707f CB |
12010 | ; |
12011 | return 0; | |
12012 | } | |
12013 | _ACEOF | |
12014 | if ac_fn_c_try_compile "$LINENO"; then : | |
5df4cba6 | 12015 | gl_cv_header_sys_socket_h_selfcontained=yes |
5abebf3c | 12016 | else |
5df4cba6 | 12017 | gl_cv_header_sys_socket_h_selfcontained=no |
5abebf3c | 12018 | fi |
c0c3707f | 12019 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
5abebf3c | 12020 | |
5df4cba6 SM |
12021 | fi |
12022 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 | |
12023 | $as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; } | |
12024 | if test $gl_cv_header_sys_socket_h_selfcontained = yes; then | |
12025 | for ac_func in shutdown | |
12026 | do : | |
12027 | ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown" | |
12028 | if test "x$ac_cv_func_shutdown" = xyes; then : | |
12029 | cat >>confdefs.h <<_ACEOF | |
12030 | #define HAVE_SHUTDOWN 1 | |
12031 | _ACEOF | |
c0c3707f | 12032 | |
5df4cba6 SM |
12033 | fi |
12034 | done | |
c0c3707f | 12035 | |
5df4cba6 SM |
12036 | if test $ac_cv_func_shutdown = yes; then |
12037 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5 | |
12038 | $as_echo_n "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; } | |
12039 | if ${gl_cv_header_sys_socket_h_shut+:} false; then : | |
5abebf3c CB |
12040 | $as_echo_n "(cached) " >&6 |
12041 | else | |
5df4cba6 SM |
12042 | |
12043 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 12044 | /* end confdefs.h. */ |
c0c3707f | 12045 | #include <sys/socket.h> |
c0c3707f CB |
12046 | int |
12047 | main () | |
12048 | { | |
5df4cba6 | 12049 | int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR }; |
c0c3707f CB |
12050 | ; |
12051 | return 0; | |
12052 | } | |
12053 | _ACEOF | |
12054 | if ac_fn_c_try_compile "$LINENO"; then : | |
5df4cba6 | 12055 | gl_cv_header_sys_socket_h_shut=yes |
c0c3707f | 12056 | else |
5df4cba6 | 12057 | gl_cv_header_sys_socket_h_shut=no |
c0c3707f CB |
12058 | fi |
12059 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5abebf3c | 12060 | |
5df4cba6 SM |
12061 | fi |
12062 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5 | |
12063 | $as_echo "$gl_cv_header_sys_socket_h_shut" >&6; } | |
12064 | if test $gl_cv_header_sys_socket_h_shut = no; then | |
12065 | SYS_SOCKET_H='sys/socket.h' | |
12066 | fi | |
12067 | fi | |
c0c3707f | 12068 | fi |
5df4cba6 | 12069 | # We need to check for ws2tcpip.h now. |
5abebf3c | 12070 | |
5abebf3c | 12071 | |
5abebf3c | 12072 | |
5abebf3c CB |
12073 | |
12074 | ||
12075 | ||
12076 | ||
c0c3707f CB |
12077 | |
12078 | ||
12079 | ||
12080 | ||
12081 | if test $gl_cv_have_include_next = yes; then | |
5df4cba6 | 12082 | gl_cv_next_sys_socket_h='<'sys/socket.h'>' |
c0c3707f | 12083 | else |
5df4cba6 SM |
12084 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5 |
12085 | $as_echo_n "checking absolute name of <sys/socket.h>... " >&6; } | |
12086 | if ${gl_cv_next_sys_socket_h+:} false; then : | |
5abebf3c CB |
12087 | $as_echo_n "(cached) " >&6 |
12088 | else | |
5abebf3c | 12089 | |
5df4cba6 | 12090 | if test $ac_cv_header_sys_socket_h = yes; then |
5abebf3c | 12091 | |
5abebf3c CB |
12092 | |
12093 | ||
c0c3707f CB |
12094 | |
12095 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12096 | /* end confdefs.h. */ | |
5df4cba6 | 12097 | #include <sys/socket.h> |
c0c3707f CB |
12098 | _ACEOF |
12099 | case "$host_os" in | |
12100 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
12101 | *) gl_absname_cpp="$ac_cpp" ;; | |
12102 | esac | |
12103 | ||
12104 | case "$host_os" in | |
12105 | mingw*) | |
12106 | gl_dirsep_regex='[/\\]' | |
5abebf3c CB |
12107 | ;; |
12108 | *) | |
c0c3707f | 12109 | gl_dirsep_regex='\/' |
5abebf3c CB |
12110 | ;; |
12111 | esac | |
c0c3707f | 12112 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' |
5df4cba6 | 12113 | gl_header_literal_regex=`echo 'sys/socket.h' \ |
c0c3707f CB |
12114 | | sed -e "$gl_make_literal_regex_sed"` |
12115 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
12116 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
12117 | s|^/[^/]|//&| | |
12118 | p | |
12119 | q | |
12120 | }' | |
5abebf3c | 12121 | |
5df4cba6 | 12122 | gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
c0c3707f | 12123 | sed -n "$gl_absolute_header_sed"` |
5abebf3c | 12124 | |
5df4cba6 SM |
12125 | gl_header=$gl_cv_absolute_sys_socket_h |
12126 | gl_cv_next_sys_socket_h='"'$gl_header'"' | |
c0c3707f | 12127 | else |
5df4cba6 | 12128 | gl_cv_next_sys_socket_h='<'sys/socket.h'>' |
c0c3707f | 12129 | fi |
5abebf3c | 12130 | |
5abebf3c | 12131 | |
5abebf3c | 12132 | fi |
5df4cba6 SM |
12133 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5 |
12134 | $as_echo "$gl_cv_next_sys_socket_h" >&6; } | |
c0c3707f | 12135 | fi |
5df4cba6 | 12136 | NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h |
c0c3707f CB |
12137 | |
12138 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
12139 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
5df4cba6 | 12140 | gl_next_as_first_directive='<'sys/socket.h'>' |
c0c3707f CB |
12141 | else |
12142 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
5df4cba6 | 12143 | gl_next_as_first_directive=$gl_cv_next_sys_socket_h |
c0c3707f | 12144 | fi |
5df4cba6 | 12145 | NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive |
5abebf3c CB |
12146 | |
12147 | ||
c0c3707f CB |
12148 | |
12149 | ||
5df4cba6 SM |
12150 | if test $ac_cv_header_sys_socket_h = yes; then |
12151 | HAVE_SYS_SOCKET_H=1 | |
12152 | else | |
12153 | HAVE_SYS_SOCKET_H=0 | |
12154 | fi | |
c0c3707f | 12155 | |
5abebf3c | 12156 | |
c0c3707f | 12157 | |
5df4cba6 SM |
12158 | if test $ac_cv_header_sys_socket_h = yes; then |
12159 | HAVE_WS2TCPIP_H=0 | |
12160 | else | |
12161 | if test $ac_cv_header_ws2tcpip_h = yes; then | |
12162 | HAVE_WS2TCPIP_H=1 | |
12163 | else | |
12164 | HAVE_WS2TCPIP_H=0 | |
12165 | fi | |
12166 | fi | |
12167 | ||
12168 | ||
12169 | ||
12170 | ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " | |
12171 | /* sys/types.h is not needed according to POSIX, but the | |
12172 | sys/socket.h in i386-unknown-freebsd4.10 and | |
12173 | powerpc-apple-darwin5.5 required it. */ | |
12174 | #include <sys/types.h> | |
12175 | #ifdef HAVE_SYS_SOCKET_H | |
12176 | #include <sys/socket.h> | |
12177 | #endif | |
12178 | #ifdef HAVE_WS2TCPIP_H | |
12179 | #include <ws2tcpip.h> | |
12180 | #endif | |
12181 | ||
12182 | " | |
12183 | if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then : | |
12184 | ||
12185 | cat >>confdefs.h <<_ACEOF | |
12186 | #define HAVE_STRUCT_SOCKADDR_STORAGE 1 | |
5abebf3c | 12187 | _ACEOF |
5df4cba6 SM |
12188 | |
12189 | ||
5abebf3c | 12190 | fi |
5df4cba6 SM |
12191 | ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" " |
12192 | /* sys/types.h is not needed according to POSIX, but the | |
12193 | sys/socket.h in i386-unknown-freebsd4.10 and | |
12194 | powerpc-apple-darwin5.5 required it. */ | |
12195 | #include <sys/types.h> | |
12196 | #ifdef HAVE_SYS_SOCKET_H | |
12197 | #include <sys/socket.h> | |
12198 | #endif | |
12199 | #ifdef HAVE_WS2TCPIP_H | |
12200 | #include <ws2tcpip.h> | |
12201 | #endif | |
12202 | ||
12203 | " | |
12204 | if test "x$ac_cv_type_sa_family_t" = xyes; then : | |
12205 | ||
12206 | cat >>confdefs.h <<_ACEOF | |
12207 | #define HAVE_SA_FAMILY_T 1 | |
12208 | _ACEOF | |
12209 | ||
12210 | ||
5abebf3c | 12211 | fi |
5df4cba6 SM |
12212 | |
12213 | if test $ac_cv_type_struct_sockaddr_storage = no; then | |
12214 | HAVE_STRUCT_SOCKADDR_STORAGE=0 | |
12215 | fi | |
12216 | if test $ac_cv_type_sa_family_t = no; then | |
12217 | HAVE_SA_FAMILY_T=0 | |
c0c3707f | 12218 | fi |
5df4cba6 SM |
12219 | if test $ac_cv_type_struct_sockaddr_storage != no; then |
12220 | ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h> | |
12221 | #ifdef HAVE_SYS_SOCKET_H | |
12222 | #include <sys/socket.h> | |
12223 | #endif | |
12224 | #ifdef HAVE_WS2TCPIP_H | |
12225 | #include <ws2tcpip.h> | |
12226 | #endif | |
12227 | ||
12228 | " | |
12229 | if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then : | |
12230 | ||
12231 | cat >>confdefs.h <<_ACEOF | |
12232 | #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 | |
12233 | _ACEOF | |
12234 | ||
5abebf3c | 12235 | |
5abebf3c | 12236 | else |
5df4cba6 | 12237 | HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0 |
5abebf3c CB |
12238 | fi |
12239 | ||
5df4cba6 SM |
12240 | fi |
12241 | if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \ | |
12242 | || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then | |
12243 | SYS_SOCKET_H='sys/socket.h' | |
12244 | fi | |
5abebf3c | 12245 | |
5abebf3c | 12246 | |
5df4cba6 SM |
12247 | |
12248 | ||
12249 | if test $ac_cv_header_sys_socket_h != yes; then | |
12250 | for ac_header in winsock2.h | |
12251 | do : | |
12252 | ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" | |
12253 | if test "x$ac_cv_header_winsock2_h" = xyes; then : | |
12254 | cat >>confdefs.h <<_ACEOF | |
12255 | #define HAVE_WINSOCK2_H 1 | |
12256 | _ACEOF | |
12257 | ||
12258 | fi | |
12259 | ||
12260 | done | |
12261 | ||
12262 | fi | |
12263 | if test "$ac_cv_header_winsock2_h" = yes; then | |
12264 | HAVE_WINSOCK2_H=1 | |
12265 | UNISTD_H_HAVE_WINSOCK2_H=1 | |
12266 | SYS_IOCTL_H_HAVE_WINSOCK2_H=1 | |
12267 | else | |
12268 | HAVE_WINSOCK2_H=0 | |
12269 | fi | |
12270 | ||
12271 | ||
12272 | ||
12273 | ||
12274 | ||
12275 | ||
12276 | ||
12277 | ||
12278 | ||
12279 | ||
12280 | ||
12281 | ||
12282 | ||
698be2d8 CB |
12283 | |
12284 | ||
5df4cba6 SM |
12285 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5 |
12286 | $as_echo_n "checking for IPv4 sockets... " >&6; } | |
12287 | if ${gl_cv_socket_ipv4+:} false; then : | |
5abebf3c CB |
12288 | $as_echo_n "(cached) " >&6 |
12289 | else | |
c0c3707f | 12290 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5abebf3c | 12291 | /* end confdefs.h. */ |
5df4cba6 SM |
12292 | #include <sys/types.h> |
12293 | #ifdef HAVE_SYS_SOCKET_H | |
12294 | #include <sys/socket.h> | |
12295 | #endif | |
12296 | #ifdef HAVE_NETINET_IN_H | |
12297 | #include <netinet/in.h> | |
12298 | #endif | |
12299 | #ifdef HAVE_WINSOCK2_H | |
12300 | #include <winsock2.h> | |
12301 | #endif | |
5abebf3c CB |
12302 | int |
12303 | main () | |
12304 | { | |
5df4cba6 SM |
12305 | int x = AF_INET; struct in_addr y; struct sockaddr_in z; |
12306 | if (&x && &y && &z) return 0; | |
5abebf3c CB |
12307 | ; |
12308 | return 0; | |
12309 | } | |
12310 | _ACEOF | |
c0c3707f | 12311 | if ac_fn_c_try_compile "$LINENO"; then : |
5df4cba6 | 12312 | gl_cv_socket_ipv4=yes |
5abebf3c | 12313 | else |
5df4cba6 | 12314 | gl_cv_socket_ipv4=no |
5abebf3c | 12315 | fi |
c0c3707f | 12316 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
5abebf3c | 12317 | fi |
5df4cba6 SM |
12318 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5 |
12319 | $as_echo "$gl_cv_socket_ipv4" >&6; } | |
12320 | if test $gl_cv_socket_ipv4 = yes; then | |
5abebf3c | 12321 | |
5df4cba6 | 12322 | $as_echo "#define HAVE_IPV4 1" >>confdefs.h |
5abebf3c | 12323 | |
5df4cba6 | 12324 | fi |
5abebf3c | 12325 | |
5df4cba6 SM |
12326 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5 |
12327 | $as_echo_n "checking for IPv6 sockets... " >&6; } | |
12328 | if ${gl_cv_socket_ipv6+:} false; then : | |
5abebf3c CB |
12329 | $as_echo_n "(cached) " >&6 |
12330 | else | |
c0c3707f | 12331 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5abebf3c | 12332 | /* end confdefs.h. */ |
5df4cba6 SM |
12333 | #include <sys/types.h> |
12334 | #ifdef HAVE_SYS_SOCKET_H | |
12335 | #include <sys/socket.h> | |
5abebf3c | 12336 | #endif |
5df4cba6 SM |
12337 | #ifdef HAVE_NETINET_IN_H |
12338 | #include <netinet/in.h> | |
12339 | #endif | |
12340 | #ifdef HAVE_WINSOCK2_H | |
12341 | #include <winsock2.h> | |
12342 | #endif | |
12343 | #ifdef HAVE_WS2TCPIP_H | |
12344 | #include <ws2tcpip.h> | |
12345 | #endif | |
12346 | int | |
12347 | main () | |
12348 | { | |
12349 | int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; | |
12350 | if (&x && &y && &z) return 0; | |
12351 | ; | |
12352 | return 0; | |
12353 | } | |
12354 | _ACEOF | |
12355 | if ac_fn_c_try_compile "$LINENO"; then : | |
12356 | gl_cv_socket_ipv6=yes | |
12357 | else | |
12358 | gl_cv_socket_ipv6=no | |
12359 | fi | |
12360 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12361 | fi | |
12362 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5 | |
12363 | $as_echo "$gl_cv_socket_ipv6" >&6; } | |
12364 | if test $gl_cv_socket_ipv6 = yes; then | |
12365 | ||
12366 | $as_echo "#define HAVE_IPV6 1" >>confdefs.h | |
12367 | ||
12368 | fi | |
12369 | ||
12370 | ||
12371 | ||
12372 | ||
12373 | ||
12374 | ||
12375 | ||
12376 | ||
12377 | ||
12378 | ||
12379 | ||
12380 | ||
12381 | ||
12382 | if test $gl_cv_have_include_next = yes; then | |
12383 | gl_cv_next_limits_h='<'limits.h'>' | |
12384 | else | |
12385 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5 | |
12386 | $as_echo_n "checking absolute name of <limits.h>... " >&6; } | |
12387 | if ${gl_cv_next_limits_h+:} false; then : | |
12388 | $as_echo_n "(cached) " >&6 | |
12389 | else | |
12390 | ||
12391 | if test $ac_cv_header_limits_h = yes; then | |
12392 | ||
12393 | ||
12394 | ||
12395 | ||
12396 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12397 | /* end confdefs.h. */ | |
12398 | #include <limits.h> | |
12399 | _ACEOF | |
12400 | case "$host_os" in | |
12401 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
12402 | *) gl_absname_cpp="$ac_cpp" ;; | |
12403 | esac | |
12404 | ||
12405 | case "$host_os" in | |
12406 | mingw*) | |
12407 | gl_dirsep_regex='[/\\]' | |
12408 | ;; | |
12409 | *) | |
12410 | gl_dirsep_regex='\/' | |
12411 | ;; | |
12412 | esac | |
12413 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
12414 | gl_header_literal_regex=`echo 'limits.h' \ | |
12415 | | sed -e "$gl_make_literal_regex_sed"` | |
12416 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
12417 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
12418 | s|^/[^/]|//&| | |
12419 | p | |
12420 | q | |
12421 | }' | |
12422 | ||
12423 | gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
12424 | sed -n "$gl_absolute_header_sed"` | |
12425 | ||
12426 | gl_header=$gl_cv_absolute_limits_h | |
12427 | gl_cv_next_limits_h='"'$gl_header'"' | |
12428 | else | |
12429 | gl_cv_next_limits_h='<'limits.h'>' | |
12430 | fi | |
12431 | ||
12432 | ||
12433 | fi | |
12434 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5 | |
12435 | $as_echo "$gl_cv_next_limits_h" >&6; } | |
12436 | fi | |
12437 | NEXT_LIMITS_H=$gl_cv_next_limits_h | |
12438 | ||
12439 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
12440 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
12441 | gl_next_as_first_directive='<'limits.h'>' | |
12442 | else | |
12443 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
12444 | gl_next_as_first_directive=$gl_cv_next_limits_h | |
12445 | fi | |
12446 | NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive | |
12447 | ||
12448 | ||
12449 | ||
12450 | ||
12451 | ||
12452 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc." >&5 | |
12453 | $as_echo_n "checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... " >&6; } | |
12454 | if ${gl_cv_header_limits_width+:} false; then : | |
12455 | $as_echo_n "(cached) " >&6 | |
12456 | else | |
12457 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12458 | /* end confdefs.h. */ | |
12459 | #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ | |
12460 | #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 | |
12461 | #endif | |
12462 | #include <limits.h> | |
12463 | long long llm = LLONG_MAX; | |
12464 | int wb = WORD_BIT; | |
12465 | int ullw = ULLONG_WIDTH; | |
c0c3707f | 12466 | |
5abebf3c CB |
12467 | int |
12468 | main () | |
12469 | { | |
c0c3707f | 12470 | |
5abebf3c CB |
12471 | ; |
12472 | return 0; | |
12473 | } | |
12474 | _ACEOF | |
c0c3707f | 12475 | if ac_fn_c_try_compile "$LINENO"; then : |
5df4cba6 | 12476 | gl_cv_header_limits_width=yes |
5abebf3c | 12477 | else |
5df4cba6 | 12478 | gl_cv_header_limits_width=no |
5abebf3c | 12479 | fi |
c0c3707f | 12480 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
5abebf3c | 12481 | fi |
5df4cba6 SM |
12482 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5 |
12483 | $as_echo "$gl_cv_header_limits_width" >&6; } | |
12484 | if test "$gl_cv_header_limits_width" = yes; then | |
12485 | LIMITS_H= | |
c0c3707f | 12486 | else |
5df4cba6 | 12487 | LIMITS_H=limits.h |
c0c3707f | 12488 | fi |
5abebf3c | 12489 | |
5df4cba6 SM |
12490 | if test -n "$LIMITS_H"; then |
12491 | GL_GENERATE_LIMITS_H_TRUE= | |
12492 | GL_GENERATE_LIMITS_H_FALSE='#' | |
12493 | else | |
12494 | GL_GENERATE_LIMITS_H_TRUE='#' | |
12495 | GL_GENERATE_LIMITS_H_FALSE= | |
12496 | fi | |
c0c3707f CB |
12497 | |
12498 | ||
5abebf3c | 12499 | |
5df4cba6 SM |
12500 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 |
12501 | $as_echo_n "checking for wint_t... " >&6; } | |
12502 | if ${gt_cv_c_wint_t+:} false; then : | |
c0c3707f | 12503 | $as_echo_n "(cached) " >&6 |
c0c3707f CB |
12504 | else |
12505 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5abebf3c | 12506 | /* end confdefs.h. */ |
5df4cba6 SM |
12507 | #include <wchar.h> |
12508 | wint_t foo = (wchar_t)'\0'; | |
5abebf3c CB |
12509 | int |
12510 | main () | |
12511 | { | |
5df4cba6 | 12512 | |
5abebf3c CB |
12513 | ; |
12514 | return 0; | |
12515 | } | |
12516 | _ACEOF | |
5df4cba6 SM |
12517 | if ac_fn_c_try_compile "$LINENO"; then : |
12518 | gt_cv_c_wint_t=yes | |
c0c3707f | 12519 | else |
5df4cba6 | 12520 | gt_cv_c_wint_t=no |
c0c3707f | 12521 | fi |
5df4cba6 | 12522 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
c0c3707f | 12523 | fi |
5df4cba6 SM |
12524 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 |
12525 | $as_echo "$gt_cv_c_wint_t" >&6; } | |
12526 | if test $gt_cv_c_wint_t = yes; then | |
5abebf3c | 12527 | |
5df4cba6 | 12528 | $as_echo "#define HAVE_WINT_T 1" >>confdefs.h |
5abebf3c CB |
12529 | |
12530 | ||
9c9d63b1 PM |
12531 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is large enough" >&5 |
12532 | $as_echo_n "checking whether wint_t is large enough... " >&6; } | |
12533 | if ${gl_cv_type_wint_t_large_enough+:} false; then : | |
5df4cba6 SM |
12534 | $as_echo_n "(cached) " >&6 |
12535 | else | |
12536 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12537 | /* end confdefs.h. */ | |
5df4cba6 | 12538 | #include <wchar.h> |
9c9d63b1 | 12539 | int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; |
5df4cba6 SM |
12540 | |
12541 | int | |
12542 | main () | |
12543 | { | |
12544 | ||
12545 | ; | |
12546 | return 0; | |
12547 | } | |
12548 | _ACEOF | |
12549 | if ac_fn_c_try_compile "$LINENO"; then : | |
9c9d63b1 | 12550 | gl_cv_type_wint_t_large_enough=yes |
5df4cba6 | 12551 | else |
9c9d63b1 | 12552 | gl_cv_type_wint_t_large_enough=no |
5df4cba6 SM |
12553 | fi |
12554 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12555 | fi | |
9c9d63b1 PM |
12556 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_large_enough" >&5 |
12557 | $as_echo "$gl_cv_type_wint_t_large_enough" >&6; } | |
12558 | if test $gl_cv_type_wint_t_large_enough = no; then | |
5df4cba6 SM |
12559 | GNULIB_OVERRIDES_WINT_T=1 |
12560 | else | |
12561 | GNULIB_OVERRIDES_WINT_T=0 | |
12562 | fi | |
12563 | else | |
12564 | GNULIB_OVERRIDES_WINT_T=0 | |
c0c3707f | 12565 | fi |
5abebf3c | 12566 | |
5abebf3c CB |
12567 | |
12568 | ||
12569 | ||
12570 | ||
12571 | ||
5df4cba6 | 12572 | |
9c9d63b1 PM |
12573 | |
12574 | ||
12575 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler produces multi-arch binaries" >&5 | |
12576 | $as_echo_n "checking whether the compiler produces multi-arch binaries... " >&6; } | |
12577 | if ${gl_cv_c_multiarch+:} false; then : | |
12578 | $as_echo_n "(cached) " >&6 | |
12579 | else | |
12580 | gl_cv_c_multiarch=no | |
12581 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f CB |
12582 | /* end confdefs.h. */ |
12583 | #ifndef __APPLE_CC__ | |
9c9d63b1 PM |
12584 | not a universal capable compiler |
12585 | #endif | |
12586 | typedef int dummy; | |
5abebf3c | 12587 | |
c0c3707f CB |
12588 | _ACEOF |
12589 | if ac_fn_c_try_compile "$LINENO"; then : | |
5abebf3c | 12590 | |
9c9d63b1 PM |
12591 | arch= |
12592 | prev= | |
12593 | for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do | |
12594 | if test -n "$prev"; then | |
12595 | case $word in | |
12596 | i?86 | x86_64 | ppc | ppc64 | arm | arm64) | |
12597 | if test -z "$arch" || test "$arch" = "$word"; then | |
12598 | arch="$word" | |
12599 | else | |
12600 | gl_cv_c_multiarch=yes | |
12601 | fi | |
12602 | ;; | |
12603 | esac | |
12604 | prev= | |
12605 | else | |
12606 | if test "x$word" = "x-arch"; then | |
12607 | prev=arch | |
12608 | fi | |
12609 | fi | |
12610 | done | |
5abebf3c | 12611 | |
c0c3707f CB |
12612 | fi |
12613 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
9c9d63b1 PM |
12614 | |
12615 | fi | |
12616 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_multiarch" >&5 | |
12617 | $as_echo "$gl_cv_c_multiarch" >&6; } | |
c0c3707f CB |
12618 | if test $gl_cv_c_multiarch = yes; then |
12619 | APPLE_UNIVERSAL_BUILD=1 | |
12620 | else | |
12621 | APPLE_UNIVERSAL_BUILD=0 | |
12622 | fi | |
5abebf3c | 12623 | |
5abebf3c | 12624 | |
5abebf3c | 12625 | |
5abebf3c CB |
12626 | |
12627 | ||
5abebf3c | 12628 | |
5abebf3c | 12629 | |
5abebf3c | 12630 | |
5df4cba6 | 12631 | $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h |
5abebf3c | 12632 | |
5abebf3c | 12633 | |
5df4cba6 | 12634 | $as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h |
5abebf3c | 12635 | |
c0c3707f CB |
12636 | |
12637 | ||
12638 | if test $ac_cv_header_wchar_h = yes; then | |
12639 | HAVE_WCHAR_H=1 | |
12640 | else | |
12641 | HAVE_WCHAR_H=0 | |
5abebf3c | 12642 | fi |
c0c3707f CB |
12643 | |
12644 | ||
9c9d63b1 PM |
12645 | |
12646 | if test $ac_cv_header_inttypes_h = yes; then | |
c0c3707f CB |
12647 | HAVE_INTTYPES_H=1 |
12648 | else | |
12649 | HAVE_INTTYPES_H=0 | |
5abebf3c CB |
12650 | fi |
12651 | ||
12652 | ||
9c9d63b1 PM |
12653 | |
12654 | if test $ac_cv_header_sys_types_h = yes; then | |
c0c3707f CB |
12655 | HAVE_SYS_TYPES_H=1 |
12656 | else | |
12657 | HAVE_SYS_TYPES_H=0 | |
12658 | fi | |
12659 | ||
5abebf3c CB |
12660 | |
12661 | ||
12662 | ||
12663 | ||
5abebf3c | 12664 | |
5abebf3c | 12665 | |
5abebf3c | 12666 | |
5abebf3c | 12667 | |
5abebf3c CB |
12668 | |
12669 | ||
c0c3707f CB |
12670 | if test $gl_cv_have_include_next = yes; then |
12671 | gl_cv_next_stdint_h='<'stdint.h'>' | |
12672 | else | |
12673 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5 | |
12674 | $as_echo_n "checking absolute name of <stdint.h>... " >&6; } | |
12675 | if ${gl_cv_next_stdint_h+:} false; then : | |
12676 | $as_echo_n "(cached) " >&6 | |
12677 | else | |
5abebf3c | 12678 | |
c0c3707f | 12679 | if test $ac_cv_header_stdint_h = yes; then |
5abebf3c | 12680 | |
5abebf3c CB |
12681 | |
12682 | ||
12683 | ||
c0c3707f | 12684 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5abebf3c | 12685 | /* end confdefs.h. */ |
c0c3707f | 12686 | #include <stdint.h> |
5abebf3c | 12687 | _ACEOF |
c0c3707f CB |
12688 | case "$host_os" in |
12689 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
12690 | *) gl_absname_cpp="$ac_cpp" ;; | |
12691 | esac | |
5abebf3c | 12692 | |
c0c3707f CB |
12693 | case "$host_os" in |
12694 | mingw*) | |
12695 | gl_dirsep_regex='[/\\]' | |
12696 | ;; | |
12697 | *) | |
12698 | gl_dirsep_regex='\/' | |
12699 | ;; | |
12700 | esac | |
12701 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
12702 | gl_header_literal_regex=`echo 'stdint.h' \ | |
12703 | | sed -e "$gl_make_literal_regex_sed"` | |
12704 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
12705 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
12706 | s|^/[^/]|//&| | |
12707 | p | |
12708 | q | |
12709 | }' | |
5abebf3c | 12710 | |
c0c3707f CB |
12711 | gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
12712 | sed -n "$gl_absolute_header_sed"` | |
5abebf3c | 12713 | |
c0c3707f CB |
12714 | gl_header=$gl_cv_absolute_stdint_h |
12715 | gl_cv_next_stdint_h='"'$gl_header'"' | |
12716 | else | |
12717 | gl_cv_next_stdint_h='<'stdint.h'>' | |
12718 | fi | |
5abebf3c | 12719 | |
5abebf3c | 12720 | |
c0c3707f CB |
12721 | fi |
12722 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 | |
12723 | $as_echo "$gl_cv_next_stdint_h" >&6; } | |
12724 | fi | |
12725 | NEXT_STDINT_H=$gl_cv_next_stdint_h | |
5abebf3c | 12726 | |
c0c3707f CB |
12727 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
12728 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
12729 | gl_next_as_first_directive='<'stdint.h'>' | |
12730 | else | |
12731 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
12732 | gl_next_as_first_directive=$gl_cv_next_stdint_h | |
12733 | fi | |
12734 | NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive | |
5abebf3c | 12735 | |
5e8754f9 | 12736 | |
5e8754f9 | 12737 | |
5e8754f9 | 12738 | |
c0c3707f CB |
12739 | if test $ac_cv_header_stdint_h = yes; then |
12740 | HAVE_STDINT_H=1 | |
12741 | else | |
12742 | HAVE_STDINT_H=0 | |
12743 | fi | |
5e8754f9 SDJ |
12744 | |
12745 | ||
c0c3707f CB |
12746 | if test $ac_cv_header_stdint_h = yes; then |
12747 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 | |
12748 | $as_echo_n "checking whether stdint.h conforms to C99... " >&6; } | |
12749 | if ${gl_cv_header_working_stdint_h+:} false; then : | |
12750 | $as_echo_n "(cached) " >&6 | |
12751 | else | |
12752 | gl_cv_header_working_stdint_h=no | |
12753 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12754 | /* end confdefs.h. */ | |
5e8754f9 | 12755 | |
5e8754f9 | 12756 | |
c0c3707f CB |
12757 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ |
12758 | #define __STDC_CONSTANT_MACROS 1 | |
12759 | #define __STDC_LIMIT_MACROS 1 | |
12760 | #include <stdint.h> | |
12761 | /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ | |
12762 | #if !(defined WCHAR_MIN && defined WCHAR_MAX) | |
12763 | #error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>" | |
12764 | #endif | |
5e8754f9 SDJ |
12765 | |
12766 | ||
c0c3707f CB |
12767 | #include <stddef.h> |
12768 | #include <signal.h> | |
12769 | #if HAVE_WCHAR_H | |
c0c3707f CB |
12770 | # include <wchar.h> |
12771 | #endif | |
f45c62c4 YQ |
12772 | |
12773 | ||
c0c3707f CB |
12774 | #ifdef INT8_MAX |
12775 | int8_t a1 = INT8_MAX; | |
12776 | int8_t a1min = INT8_MIN; | |
12777 | #endif | |
12778 | #ifdef INT16_MAX | |
12779 | int16_t a2 = INT16_MAX; | |
12780 | int16_t a2min = INT16_MIN; | |
12781 | #endif | |
12782 | #ifdef INT32_MAX | |
12783 | int32_t a3 = INT32_MAX; | |
12784 | int32_t a3min = INT32_MIN; | |
12785 | #endif | |
12786 | #ifdef INT64_MAX | |
12787 | int64_t a4 = INT64_MAX; | |
12788 | int64_t a4min = INT64_MIN; | |
12789 | #endif | |
12790 | #ifdef UINT8_MAX | |
12791 | uint8_t b1 = UINT8_MAX; | |
12792 | #else | |
12793 | typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; | |
12794 | #endif | |
12795 | #ifdef UINT16_MAX | |
12796 | uint16_t b2 = UINT16_MAX; | |
12797 | #endif | |
12798 | #ifdef UINT32_MAX | |
12799 | uint32_t b3 = UINT32_MAX; | |
12800 | #endif | |
12801 | #ifdef UINT64_MAX | |
12802 | uint64_t b4 = UINT64_MAX; | |
12803 | #endif | |
12804 | int_least8_t c1 = INT8_C (0x7f); | |
12805 | int_least8_t c1max = INT_LEAST8_MAX; | |
12806 | int_least8_t c1min = INT_LEAST8_MIN; | |
12807 | int_least16_t c2 = INT16_C (0x7fff); | |
12808 | int_least16_t c2max = INT_LEAST16_MAX; | |
12809 | int_least16_t c2min = INT_LEAST16_MIN; | |
12810 | int_least32_t c3 = INT32_C (0x7fffffff); | |
12811 | int_least32_t c3max = INT_LEAST32_MAX; | |
12812 | int_least32_t c3min = INT_LEAST32_MIN; | |
12813 | int_least64_t c4 = INT64_C (0x7fffffffffffffff); | |
12814 | int_least64_t c4max = INT_LEAST64_MAX; | |
12815 | int_least64_t c4min = INT_LEAST64_MIN; | |
12816 | uint_least8_t d1 = UINT8_C (0xff); | |
12817 | uint_least8_t d1max = UINT_LEAST8_MAX; | |
12818 | uint_least16_t d2 = UINT16_C (0xffff); | |
12819 | uint_least16_t d2max = UINT_LEAST16_MAX; | |
12820 | uint_least32_t d3 = UINT32_C (0xffffffff); | |
12821 | uint_least32_t d3max = UINT_LEAST32_MAX; | |
12822 | uint_least64_t d4 = UINT64_C (0xffffffffffffffff); | |
12823 | uint_least64_t d4max = UINT_LEAST64_MAX; | |
12824 | int_fast8_t e1 = INT_FAST8_MAX; | |
12825 | int_fast8_t e1min = INT_FAST8_MIN; | |
12826 | int_fast16_t e2 = INT_FAST16_MAX; | |
12827 | int_fast16_t e2min = INT_FAST16_MIN; | |
12828 | int_fast32_t e3 = INT_FAST32_MAX; | |
12829 | int_fast32_t e3min = INT_FAST32_MIN; | |
12830 | int_fast64_t e4 = INT_FAST64_MAX; | |
12831 | int_fast64_t e4min = INT_FAST64_MIN; | |
12832 | uint_fast8_t f1 = UINT_FAST8_MAX; | |
12833 | uint_fast16_t f2 = UINT_FAST16_MAX; | |
12834 | uint_fast32_t f3 = UINT_FAST32_MAX; | |
12835 | uint_fast64_t f4 = UINT_FAST64_MAX; | |
12836 | #ifdef INTPTR_MAX | |
12837 | intptr_t g = INTPTR_MAX; | |
12838 | intptr_t gmin = INTPTR_MIN; | |
12839 | #endif | |
12840 | #ifdef UINTPTR_MAX | |
12841 | uintptr_t h = UINTPTR_MAX; | |
12842 | #endif | |
12843 | intmax_t i = INTMAX_MAX; | |
12844 | uintmax_t j = UINTMAX_MAX; | |
472fa5ee | 12845 | |
c0c3707f CB |
12846 | /* Check that SIZE_MAX has the correct type, if possible. */ |
12847 | #if 201112 <= __STDC_VERSION__ | |
12848 | int k = _Generic (SIZE_MAX, size_t: 0); | |
9c9d63b1 | 12849 | #elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \ |
c0c3707f CB |
12850 | || (0x5110 <= __SUNPRO_C && !__STDC__)) |
12851 | extern size_t k; | |
12852 | extern __typeof__ (SIZE_MAX) k; | |
12853 | #endif | |
472fa5ee | 12854 | |
c0c3707f CB |
12855 | #include <limits.h> /* for CHAR_BIT */ |
12856 | #define TYPE_MINIMUM(t) \ | |
12857 | ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) | |
12858 | #define TYPE_MAXIMUM(t) \ | |
12859 | ((t) ((t) 0 < (t) -1 \ | |
12860 | ? (t) -1 \ | |
12861 | : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) | |
12862 | struct s { | |
12863 | int check_PTRDIFF: | |
12864 | PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) | |
12865 | && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) | |
12866 | ? 1 : -1; | |
12867 | /* Detect bug in FreeBSD 6.0 / ia64. */ | |
12868 | int check_SIG_ATOMIC: | |
12869 | SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) | |
12870 | && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) | |
12871 | ? 1 : -1; | |
12872 | int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; | |
12873 | int check_WCHAR: | |
12874 | WCHAR_MIN == TYPE_MINIMUM (wchar_t) | |
12875 | && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) | |
12876 | ? 1 : -1; | |
12877 | /* Detect bug in mingw. */ | |
12878 | int check_WINT: | |
12879 | WINT_MIN == TYPE_MINIMUM (wint_t) | |
12880 | && WINT_MAX == TYPE_MAXIMUM (wint_t) | |
12881 | ? 1 : -1; | |
472fa5ee | 12882 | |
c0c3707f CB |
12883 | /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ |
12884 | int check_UINT8_C: | |
12885 | (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; | |
12886 | int check_UINT16_C: | |
12887 | (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; | |
f45c62c4 | 12888 | |
c0c3707f CB |
12889 | /* Detect bugs in OpenBSD 3.9 stdint.h. */ |
12890 | #ifdef UINT8_MAX | |
12891 | int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; | |
12892 | #endif | |
12893 | #ifdef UINT16_MAX | |
12894 | int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; | |
12895 | #endif | |
12896 | #ifdef UINT32_MAX | |
12897 | int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; | |
12898 | #endif | |
12899 | #ifdef UINT64_MAX | |
12900 | int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; | |
12901 | #endif | |
12902 | int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; | |
12903 | int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; | |
12904 | int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; | |
12905 | int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; | |
12906 | int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; | |
12907 | int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; | |
12908 | int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; | |
12909 | int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; | |
12910 | int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; | |
12911 | int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; | |
12912 | int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; | |
12913 | }; | |
6ec2e0f5 | 12914 | |
f45c62c4 YQ |
12915 | int |
12916 | main () | |
12917 | { | |
f45c62c4 YQ |
12918 | |
12919 | ; | |
12920 | return 0; | |
12921 | } | |
12922 | _ACEOF | |
6ec2e0f5 | 12923 | if ac_fn_c_try_compile "$LINENO"; then : |
c0c3707f | 12924 | if test "$cross_compiling" = yes; then : |
6a29c58e | 12925 | case "$host_os" in |
c0c3707f CB |
12926 | # Guess yes on native Windows. |
12927 | mingw*) gl_cv_header_working_stdint_h="guessing yes" ;; | |
12928 | # In general, assume it works. | |
12929 | *) gl_cv_header_working_stdint_h="guessing yes" ;; | |
12930 | esac | |
6a29c58e | 12931 | |
98399780 YQ |
12932 | else |
12933 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12934 | /* end confdefs.h. */ | |
98399780 YQ |
12935 | |
12936 | ||
c0c3707f CB |
12937 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ |
12938 | #define __STDC_CONSTANT_MACROS 1 | |
12939 | #define __STDC_LIMIT_MACROS 1 | |
12940 | #include <stdint.h> | |
98399780 | 12941 | |
88b48903 | 12942 | |
c0c3707f CB |
12943 | #include <stddef.h> |
12944 | #include <signal.h> | |
12945 | #if HAVE_WCHAR_H | |
c0c3707f CB |
12946 | # include <wchar.h> |
12947 | #endif | |
88b48903 | 12948 | |
472fa5ee | 12949 | |
c0c3707f CB |
12950 | #include <stdio.h> |
12951 | #include <string.h> | |
12952 | #define MVAL(macro) MVAL1(macro) | |
12953 | #define MVAL1(expression) #expression | |
12954 | static const char *macro_values[] = | |
12955 | { | |
12956 | #ifdef INT8_MAX | |
12957 | MVAL (INT8_MAX), | |
12958 | #endif | |
12959 | #ifdef INT16_MAX | |
12960 | MVAL (INT16_MAX), | |
12961 | #endif | |
12962 | #ifdef INT32_MAX | |
12963 | MVAL (INT32_MAX), | |
12964 | #endif | |
12965 | #ifdef INT64_MAX | |
12966 | MVAL (INT64_MAX), | |
12967 | #endif | |
12968 | #ifdef UINT8_MAX | |
12969 | MVAL (UINT8_MAX), | |
12970 | #endif | |
12971 | #ifdef UINT16_MAX | |
12972 | MVAL (UINT16_MAX), | |
12973 | #endif | |
12974 | #ifdef UINT32_MAX | |
12975 | MVAL (UINT32_MAX), | |
12976 | #endif | |
12977 | #ifdef UINT64_MAX | |
12978 | MVAL (UINT64_MAX), | |
12979 | #endif | |
12980 | NULL | |
12981 | }; | |
472fa5ee | 12982 | |
c0c3707f CB |
12983 | int |
12984 | main () | |
12985 | { | |
472fa5ee | 12986 | |
c0c3707f CB |
12987 | const char **mv; |
12988 | for (mv = macro_values; *mv != NULL; mv++) | |
12989 | { | |
12990 | const char *value = *mv; | |
12991 | /* Test whether it looks like a cast expression. */ | |
12992 | if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 | |
12993 | || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 | |
12994 | || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 | |
12995 | || strncmp (value, "((int)"/*)*/, 6) == 0 | |
12996 | || strncmp (value, "((signed short)"/*)*/, 15) == 0 | |
12997 | || strncmp (value, "((signed char)"/*)*/, 14) == 0) | |
12998 | return mv - macro_values + 1; | |
12999 | } | |
13000 | return 0; | |
13001 | ||
13002 | ; | |
13003 | return 0; | |
13004 | } | |
13005 | _ACEOF | |
13006 | if ac_fn_c_try_run "$LINENO"; then : | |
13007 | gl_cv_header_working_stdint_h=yes | |
13008 | fi | |
13009 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
13010 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
13011 | fi | |
13012 | ||
13013 | ||
13014 | fi | |
13015 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
8690e634 | 13016 | |
c0c3707f CB |
13017 | fi |
13018 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 | |
13019 | $as_echo "$gl_cv_header_working_stdint_h" >&6; } | |
13020 | fi | |
8690e634 | 13021 | |
c0c3707f CB |
13022 | HAVE_C99_STDINT_H=0 |
13023 | HAVE_SYS_BITYPES_H=0 | |
13024 | HAVE_SYS_INTTYPES_H=0 | |
13025 | STDINT_H=stdint.h | |
13026 | case "$gl_cv_header_working_stdint_h" in | |
13027 | *yes) | |
13028 | HAVE_C99_STDINT_H=1 | |
9c9d63b1 PM |
13029 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h works without ISO C predefines" >&5 |
13030 | $as_echo_n "checking whether stdint.h works without ISO C predefines... " >&6; } | |
13031 | if ${gl_cv_header_stdint_without_STDC_macros+:} false; then : | |
c0c3707f CB |
13032 | $as_echo_n "(cached) " >&6 |
13033 | else | |
9c9d63b1 | 13034 | gl_cv_header_stdint_without_STDC_macros=no |
c0c3707f CB |
13035 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
13036 | /* end confdefs.h. */ | |
8690e634 JK |
13037 | |
13038 | ||
c0c3707f CB |
13039 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ |
13040 | #include <stdint.h> | |
8690e634 JK |
13041 | |
13042 | ||
c0c3707f CB |
13043 | #include <stddef.h> |
13044 | #include <signal.h> | |
13045 | #if HAVE_WCHAR_H | |
c0c3707f CB |
13046 | # include <wchar.h> |
13047 | #endif | |
8690e634 JK |
13048 | |
13049 | ||
c0c3707f CB |
13050 | intmax_t im = INTMAX_MAX; |
13051 | int32_t i32 = INT32_C (0x7fffffff); | |
472fa5ee | 13052 | |
c0c3707f CB |
13053 | int |
13054 | main () | |
13055 | { | |
472fa5ee | 13056 | |
c0c3707f CB |
13057 | ; |
13058 | return 0; | |
13059 | } | |
13060 | _ACEOF | |
13061 | if ac_fn_c_try_compile "$LINENO"; then : | |
9c9d63b1 | 13062 | gl_cv_header_stdint_without_STDC_macros=yes |
c0c3707f CB |
13063 | fi |
13064 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
9c9d63b1 | 13065 | |
c0c3707f | 13066 | fi |
9c9d63b1 PM |
13067 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_without_STDC_macros" >&5 |
13068 | $as_echo "$gl_cv_header_stdint_without_STDC_macros" >&6; } | |
472fa5ee | 13069 | |
9c9d63b1 | 13070 | if test $gl_cv_header_stdint_without_STDC_macros = no; then |
472fa5ee | 13071 | |
c0c3707f | 13072 | $as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h |
472fa5ee SM |
13073 | |
13074 | ||
c0c3707f CB |
13075 | $as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h |
13076 | ||
13077 | fi | |
13078 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5 | |
13079 | $as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; } | |
13080 | if ${gl_cv_header_stdint_width+:} false; then : | |
8690e634 JK |
13081 | $as_echo_n "(cached) " >&6 |
13082 | else | |
c0c3707f CB |
13083 | gl_cv_header_stdint_width=no |
13084 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 JK |
13085 | /* end confdefs.h. */ |
13086 | ||
c0c3707f CB |
13087 | /* Work if build is not clean. */ |
13088 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 | |
13089 | #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ | |
13090 | #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 | |
13091 | #endif | |
13092 | #include <stdint.h> | |
13093 | ||
c0c3707f CB |
13094 | #include <stddef.h> |
13095 | #include <signal.h> | |
13096 | #if HAVE_WCHAR_H | |
c0c3707f CB |
13097 | # include <wchar.h> |
13098 | #endif | |
13099 | ||
13100 | int iw = UINTMAX_WIDTH; | |
13101 | ||
13102 | int | |
13103 | main () | |
8690e634 | 13104 | { |
c0c3707f CB |
13105 | |
13106 | ; | |
8690e634 JK |
13107 | return 0; |
13108 | } | |
8690e634 | 13109 | _ACEOF |
c0c3707f CB |
13110 | if ac_fn_c_try_compile "$LINENO"; then : |
13111 | gl_cv_header_stdint_width=yes | |
13112 | fi | |
13113 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13114 | fi | |
13115 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5 | |
13116 | $as_echo "$gl_cv_header_stdint_width" >&6; } | |
13117 | if test "$gl_cv_header_stdint_width" = yes; then | |
13118 | STDINT_H= | |
13119 | fi | |
13120 | ;; | |
13121 | *) | |
13122 | for ac_header in sys/inttypes.h sys/bitypes.h | |
13123 | do : | |
13124 | as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` | |
13125 | ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" | |
13126 | if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : | |
13127 | cat >>confdefs.h <<_ACEOF | |
13128 | #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 | |
13129 | _ACEOF | |
13130 | ||
13131 | fi | |
13132 | ||
13133 | done | |
13134 | ||
13135 | if test $ac_cv_header_sys_inttypes_h = yes; then | |
13136 | HAVE_SYS_INTTYPES_H=1 | |
13137 | fi | |
13138 | if test $ac_cv_header_sys_bitypes_h = yes; then | |
13139 | HAVE_SYS_BITYPES_H=1 | |
13140 | fi | |
13141 | ||
13142 | ||
13143 | if test $APPLE_UNIVERSAL_BUILD = 0; then | |
13144 | ||
13145 | ||
13146 | for gltype in ptrdiff_t size_t ; do | |
13147 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 | |
13148 | $as_echo_n "checking for bit size of $gltype... " >&6; } | |
13149 | if eval \${gl_cv_bitsizeof_${gltype}+:} false; then : | |
13150 | $as_echo_n "(cached) " >&6 | |
13151 | else | |
13152 | if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " | |
c0c3707f CB |
13153 | #include <stddef.h> |
13154 | #include <signal.h> | |
13155 | #if HAVE_WCHAR_H | |
c0c3707f CB |
13156 | # include <wchar.h> |
13157 | #endif | |
13158 | ||
13159 | #include <limits.h>"; then : | |
13160 | ||
13161 | else | |
13162 | result=unknown | |
13163 | fi | |
13164 | ||
13165 | eval gl_cv_bitsizeof_${gltype}=\$result | |
13166 | ||
13167 | fi | |
13168 | eval ac_res=\$gl_cv_bitsizeof_${gltype} | |
13169 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
13170 | $as_echo "$ac_res" >&6; } | |
13171 | eval result=\$gl_cv_bitsizeof_${gltype} | |
13172 | if test $result = unknown; then | |
13173 | result=0 | |
8690e634 | 13174 | fi |
c0c3707f CB |
13175 | GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` |
13176 | cat >>confdefs.h <<_ACEOF | |
13177 | #define BITSIZEOF_${GLTYPE} $result | |
13178 | _ACEOF | |
8690e634 | 13179 | |
c0c3707f CB |
13180 | eval BITSIZEOF_${GLTYPE}=\$result |
13181 | done | |
8690e634 JK |
13182 | |
13183 | ||
c0c3707f | 13184 | fi |
8690e634 JK |
13185 | |
13186 | ||
c0c3707f CB |
13187 | for gltype in sig_atomic_t wchar_t wint_t ; do |
13188 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 | |
13189 | $as_echo_n "checking for bit size of $gltype... " >&6; } | |
13190 | if eval \${gl_cv_bitsizeof_${gltype}+:} false; then : | |
8690e634 JK |
13191 | $as_echo_n "(cached) " >&6 |
13192 | else | |
c0c3707f | 13193 | if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " |
c0c3707f CB |
13194 | #include <stddef.h> |
13195 | #include <signal.h> | |
13196 | #if HAVE_WCHAR_H | |
c0c3707f CB |
13197 | # include <wchar.h> |
13198 | #endif | |
8690e634 | 13199 | |
c0c3707f | 13200 | #include <limits.h>"; then : |
8690e634 | 13201 | |
c0c3707f CB |
13202 | else |
13203 | result=unknown | |
13204 | fi | |
8690e634 | 13205 | |
c0c3707f | 13206 | eval gl_cv_bitsizeof_${gltype}=\$result |
8690e634 JK |
13207 | |
13208 | fi | |
c0c3707f CB |
13209 | eval ac_res=\$gl_cv_bitsizeof_${gltype} |
13210 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
13211 | $as_echo "$ac_res" >&6; } | |
13212 | eval result=\$gl_cv_bitsizeof_${gltype} | |
13213 | if test $result = unknown; then | |
13214 | result=0 | |
13215 | fi | |
13216 | GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` | |
13217 | cat >>confdefs.h <<_ACEOF | |
13218 | #define BITSIZEOF_${GLTYPE} $result | |
13219 | _ACEOF | |
13220 | ||
13221 | eval BITSIZEOF_${GLTYPE}=\$result | |
13222 | done | |
8690e634 JK |
13223 | |
13224 | ||
13225 | ||
13226 | ||
c0c3707f CB |
13227 | for gltype in sig_atomic_t wchar_t wint_t ; do |
13228 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 | |
13229 | $as_echo_n "checking whether $gltype is signed... " >&6; } | |
13230 | if eval \${gl_cv_type_${gltype}_signed+:} false; then : | |
8690e634 JK |
13231 | $as_echo_n "(cached) " >&6 |
13232 | else | |
c0c3707f | 13233 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8690e634 JK |
13234 | /* end confdefs.h. */ |
13235 | ||
c0c3707f CB |
13236 | #include <stddef.h> |
13237 | #include <signal.h> | |
13238 | #if HAVE_WCHAR_H | |
c0c3707f CB |
13239 | # include <wchar.h> |
13240 | #endif | |
13241 | ||
13242 | int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; | |
13243 | int | |
13244 | main () | |
13245 | { | |
13246 | ||
13247 | ; | |
8690e634 JK |
13248 | return 0; |
13249 | } | |
c0c3707f CB |
13250 | _ACEOF |
13251 | if ac_fn_c_try_compile "$LINENO"; then : | |
13252 | result=yes | |
13253 | else | |
13254 | result=no | |
13255 | fi | |
13256 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13257 | eval gl_cv_type_${gltype}_signed=\$result | |
8690e634 | 13258 | |
c0c3707f CB |
13259 | fi |
13260 | eval ac_res=\$gl_cv_type_${gltype}_signed | |
13261 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
13262 | $as_echo "$ac_res" >&6; } | |
13263 | eval result=\$gl_cv_type_${gltype}_signed | |
13264 | GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` | |
13265 | if test "$result" = yes; then | |
13266 | cat >>confdefs.h <<_ACEOF | |
13267 | #define HAVE_SIGNED_${GLTYPE} 1 | |
8690e634 | 13268 | _ACEOF |
c0c3707f CB |
13269 | |
13270 | eval HAVE_SIGNED_${GLTYPE}=1 | |
13271 | else | |
13272 | eval HAVE_SIGNED_${GLTYPE}=0 | |
8690e634 | 13273 | fi |
c0c3707f CB |
13274 | done |
13275 | ||
13276 | ||
13277 | gl_cv_type_ptrdiff_t_signed=yes | |
13278 | gl_cv_type_size_t_signed=no | |
13279 | if test $APPLE_UNIVERSAL_BUILD = 0; then | |
13280 | ||
13281 | ||
13282 | for gltype in ptrdiff_t size_t ; do | |
13283 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 | |
13284 | $as_echo_n "checking for $gltype integer literal suffix... " >&6; } | |
13285 | if eval \${gl_cv_type_${gltype}_suffix+:} false; then : | |
13286 | $as_echo_n "(cached) " >&6 | |
13287 | else | |
13288 | eval gl_cv_type_${gltype}_suffix=no | |
13289 | eval result=\$gl_cv_type_${gltype}_signed | |
13290 | if test "$result" = yes; then | |
13291 | glsufu= | |
13292 | else | |
13293 | glsufu=u | |
13294 | fi | |
13295 | for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do | |
13296 | case $glsuf in | |
13297 | '') gltype1='int';; | |
13298 | l) gltype1='long int';; | |
13299 | ll) gltype1='long long int';; | |
13300 | i64) gltype1='__int64';; | |
13301 | u) gltype1='unsigned int';; | |
13302 | ul) gltype1='unsigned long int';; | |
13303 | ull) gltype1='unsigned long long int';; | |
13304 | ui64)gltype1='unsigned __int64';; | |
13305 | esac | |
13306 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13307 | /* end confdefs.h. */ | |
13308 | ||
c0c3707f CB |
13309 | #include <stddef.h> |
13310 | #include <signal.h> | |
13311 | #if HAVE_WCHAR_H | |
c0c3707f CB |
13312 | # include <wchar.h> |
13313 | #endif | |
8690e634 | 13314 | |
c0c3707f CB |
13315 | extern $gltype foo; |
13316 | extern $gltype1 foo; | |
13317 | int | |
13318 | main () | |
13319 | { | |
13320 | ||
13321 | ; | |
13322 | return 0; | |
13323 | } | |
13324 | _ACEOF | |
13325 | if ac_fn_c_try_compile "$LINENO"; then : | |
13326 | eval gl_cv_type_${gltype}_suffix=\$glsuf | |
8690e634 | 13327 | fi |
c0c3707f CB |
13328 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
13329 | eval result=\$gl_cv_type_${gltype}_suffix | |
13330 | test "$result" != no && break | |
13331 | done | |
13332 | fi | |
13333 | eval ac_res=\$gl_cv_type_${gltype}_suffix | |
13334 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
13335 | $as_echo "$ac_res" >&6; } | |
13336 | GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` | |
13337 | eval result=\$gl_cv_type_${gltype}_suffix | |
13338 | test "$result" = no && result= | |
13339 | eval ${GLTYPE}_SUFFIX=\$result | |
13340 | cat >>confdefs.h <<_ACEOF | |
13341 | #define ${GLTYPE}_SUFFIX $result | |
13342 | _ACEOF | |
8690e634 | 13343 | |
c0c3707f | 13344 | done |
8690e634 JK |
13345 | |
13346 | ||
c0c3707f | 13347 | fi |
8690e634 JK |
13348 | |
13349 | ||
c0c3707f CB |
13350 | for gltype in sig_atomic_t wchar_t wint_t ; do |
13351 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 | |
13352 | $as_echo_n "checking for $gltype integer literal suffix... " >&6; } | |
13353 | if eval \${gl_cv_type_${gltype}_suffix+:} false; then : | |
8690e634 JK |
13354 | $as_echo_n "(cached) " >&6 |
13355 | else | |
c0c3707f CB |
13356 | eval gl_cv_type_${gltype}_suffix=no |
13357 | eval result=\$gl_cv_type_${gltype}_signed | |
13358 | if test "$result" = yes; then | |
13359 | glsufu= | |
13360 | else | |
13361 | glsufu=u | |
13362 | fi | |
13363 | for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do | |
13364 | case $glsuf in | |
13365 | '') gltype1='int';; | |
13366 | l) gltype1='long int';; | |
13367 | ll) gltype1='long long int';; | |
13368 | i64) gltype1='__int64';; | |
13369 | u) gltype1='unsigned int';; | |
13370 | ul) gltype1='unsigned long int';; | |
13371 | ull) gltype1='unsigned long long int';; | |
13372 | ui64)gltype1='unsigned __int64';; | |
13373 | esac | |
13374 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 JK |
13375 | /* end confdefs.h. */ |
13376 | ||
c0c3707f CB |
13377 | #include <stddef.h> |
13378 | #include <signal.h> | |
13379 | #if HAVE_WCHAR_H | |
c0c3707f CB |
13380 | # include <wchar.h> |
13381 | #endif | |
13382 | ||
13383 | extern $gltype foo; | |
13384 | extern $gltype1 foo; | |
13385 | int | |
13386 | main () | |
13387 | { | |
13388 | ||
13389 | ; | |
5e8754f9 | 13390 | return 0; |
8690e634 | 13391 | } |
c0c3707f CB |
13392 | _ACEOF |
13393 | if ac_fn_c_try_compile "$LINENO"; then : | |
13394 | eval gl_cv_type_${gltype}_suffix=\$glsuf | |
13395 | fi | |
13396 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13397 | eval result=\$gl_cv_type_${gltype}_suffix | |
13398 | test "$result" != no && break | |
13399 | done | |
13400 | fi | |
13401 | eval ac_res=\$gl_cv_type_${gltype}_suffix | |
13402 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
13403 | $as_echo "$ac_res" >&6; } | |
13404 | GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` | |
13405 | eval result=\$gl_cv_type_${gltype}_suffix | |
13406 | test "$result" = no && result= | |
13407 | eval ${GLTYPE}_SUFFIX=\$result | |
13408 | cat >>confdefs.h <<_ACEOF | |
13409 | #define ${GLTYPE}_SUFFIX $result | |
13410 | _ACEOF | |
13411 | ||
13412 | done | |
13413 | ||
13414 | ||
13415 | ||
13416 | if test $GNULIB_OVERRIDES_WINT_T = 1; then | |
13417 | BITSIZEOF_WINT_T=32 | |
13418 | fi | |
13419 | ||
13420 | ;; | |
13421 | esac | |
8690e634 | 13422 | |
8690e634 | 13423 | |
c0c3707f CB |
13424 | |
13425 | LIMITS_H='limits.h' | |
13426 | if test -n "$LIMITS_H"; then | |
13427 | GL_GENERATE_LIMITS_H_TRUE= | |
13428 | GL_GENERATE_LIMITS_H_FALSE='#' | |
13429 | else | |
13430 | GL_GENERATE_LIMITS_H_TRUE='#' | |
13431 | GL_GENERATE_LIMITS_H_FALSE= | |
8690e634 | 13432 | fi |
6ec2e0f5 SDJ |
13433 | |
13434 | ||
13435 | ||
13436 | ||
13437 | ||
13438 | ||
13439 | ||
c0c3707f CB |
13440 | if test -n "$STDINT_H"; then |
13441 | GL_GENERATE_STDINT_H_TRUE= | |
13442 | GL_GENERATE_STDINT_H_FALSE='#' | |
13443 | else | |
13444 | GL_GENERATE_STDINT_H_TRUE='#' | |
13445 | GL_GENERATE_STDINT_H_FALSE= | |
13446 | fi | |
472fa5ee SM |
13447 | |
13448 | ||
13449 | ||
c0c3707f CB |
13450 | GNULIB_IMAXABS=0; |
13451 | GNULIB_IMAXDIV=0; | |
13452 | GNULIB_STRTOIMAX=0; | |
13453 | GNULIB_STRTOUMAX=0; | |
13454 | HAVE_DECL_IMAXABS=1; | |
13455 | HAVE_DECL_IMAXDIV=1; | |
13456 | HAVE_DECL_STRTOIMAX=1; | |
13457 | HAVE_DECL_STRTOUMAX=1; | |
13458 | HAVE_IMAXDIV_T=1; | |
13459 | REPLACE_STRTOIMAX=0; | |
13460 | REPLACE_STRTOUMAX=0; | |
13461 | INT32_MAX_LT_INTMAX_MAX=1; | |
13462 | INT64_MAX_EQ_LONG_MAX='defined _LP64'; | |
c0c3707f CB |
13463 | PRIPTR_PREFIX=__PRIPTR_PREFIX; |
13464 | UINT32_MAX_LT_UINTMAX_MAX=1; | |
13465 | UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; | |
472fa5ee | 13466 | |
6ec2e0f5 SDJ |
13467 | |
13468 | ||
13469 | ||
13470 | ||
13471 | ||
6ec2e0f5 SDJ |
13472 | |
13473 | ||
6ec2e0f5 | 13474 | |
6ec2e0f5 | 13475 | |
6ec2e0f5 | 13476 | |
6ec2e0f5 | 13477 | |
6ec2e0f5 | 13478 | |
c0c3707f CB |
13479 | |
13480 | ||
13481 | if test $gl_cv_have_include_next = yes; then | |
13482 | gl_cv_next_inttypes_h='<'inttypes.h'>' | |
13483 | else | |
13484 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5 | |
13485 | $as_echo_n "checking absolute name of <inttypes.h>... " >&6; } | |
13486 | if ${gl_cv_next_inttypes_h+:} false; then : | |
13487 | $as_echo_n "(cached) " >&6 | |
13488 | else | |
13489 | ||
13490 | if test $ac_cv_header_inttypes_h = yes; then | |
13491 | ||
13492 | ||
13493 | ||
13494 | ||
13495 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13496 | /* end confdefs.h. */ | |
13497 | #include <inttypes.h> | |
6ec2e0f5 | 13498 | _ACEOF |
c0c3707f CB |
13499 | case "$host_os" in |
13500 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
13501 | *) gl_absname_cpp="$ac_cpp" ;; | |
13502 | esac | |
6ec2e0f5 | 13503 | |
c0c3707f CB |
13504 | case "$host_os" in |
13505 | mingw*) | |
13506 | gl_dirsep_regex='[/\\]' | |
13507 | ;; | |
13508 | *) | |
13509 | gl_dirsep_regex='\/' | |
13510 | ;; | |
13511 | esac | |
13512 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
13513 | gl_header_literal_regex=`echo 'inttypes.h' \ | |
13514 | | sed -e "$gl_make_literal_regex_sed"` | |
13515 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
13516 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
13517 | s|^/[^/]|//&| | |
13518 | p | |
13519 | q | |
13520 | }' | |
6ec2e0f5 | 13521 | |
c0c3707f CB |
13522 | gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
13523 | sed -n "$gl_absolute_header_sed"` | |
6ec2e0f5 | 13524 | |
c0c3707f CB |
13525 | gl_header=$gl_cv_absolute_inttypes_h |
13526 | gl_cv_next_inttypes_h='"'$gl_header'"' | |
13527 | else | |
13528 | gl_cv_next_inttypes_h='<'inttypes.h'>' | |
13529 | fi | |
6ec2e0f5 | 13530 | |
6ec2e0f5 | 13531 | |
c0c3707f CB |
13532 | fi |
13533 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5 | |
13534 | $as_echo "$gl_cv_next_inttypes_h" >&6; } | |
13535 | fi | |
13536 | NEXT_INTTYPES_H=$gl_cv_next_inttypes_h | |
6ec2e0f5 | 13537 | |
c0c3707f CB |
13538 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
13539 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
13540 | gl_next_as_first_directive='<'inttypes.h'>' | |
13541 | else | |
13542 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
13543 | gl_next_as_first_directive=$gl_cv_next_inttypes_h | |
13544 | fi | |
13545 | NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive | |
6ec2e0f5 | 13546 | |
472fa5ee SM |
13547 | |
13548 | ||
13549 | ||
13550 | ||
13551 | ||
13552 | ||
472fa5ee SM |
13553 | |
13554 | ||
13555 | ||
13556 | ||
6ec2e0f5 | 13557 | |
698be2d8 CB |
13558 | |
13559 | ||
698be2d8 CB |
13560 | |
13561 | ||
5df4cba6 SM |
13562 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 |
13563 | $as_echo_n "checking where to find the exponent in a 'double'... " >&6; } | |
13564 | if ${gl_cv_cc_double_expbit0+:} false; then : | |
13565 | $as_echo_n "(cached) " >&6 | |
13566 | else | |
13567 | ||
13568 | if test "$cross_compiling" = yes; then : | |
13569 | ||
13570 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13571 | /* end confdefs.h. */ | |
13572 | ||
13573 | #if defined arm || defined __arm || defined __arm__ | |
13574 | mixed_endianness | |
13575 | #endif | |
13576 | ||
13577 | _ACEOF | |
13578 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
13579 | $EGREP "mixed_endianness" >/dev/null 2>&1; then : | |
13580 | gl_cv_cc_double_expbit0="unknown" | |
13581 | else | |
13582 | ||
13583 | : | |
13584 | if ${ac_cv_c_bigendian+:} false; then : | |
13585 | $as_echo_n "(cached) " >&6 | |
13586 | else | |
13587 | ac_cv_c_bigendian=unknown | |
13588 | # See if we're dealing with a universal compiler. | |
13589 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13590 | /* end confdefs.h. */ | |
13591 | #ifndef __APPLE_CC__ | |
13592 | not a universal capable compiler | |
13593 | #endif | |
13594 | typedef int dummy; | |
13595 | ||
13596 | _ACEOF | |
13597 | if ac_fn_c_try_compile "$LINENO"; then : | |
13598 | ||
13599 | # Check for potential -arch flags. It is not universal unless | |
13600 | # there are at least two -arch flags with different values. | |
13601 | ac_arch= | |
13602 | ac_prev= | |
13603 | for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do | |
13604 | if test -n "$ac_prev"; then | |
13605 | case $ac_word in | |
13606 | i?86 | x86_64 | ppc | ppc64) | |
13607 | if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then | |
13608 | ac_arch=$ac_word | |
13609 | else | |
13610 | ac_cv_c_bigendian=universal | |
13611 | break | |
13612 | fi | |
13613 | ;; | |
13614 | esac | |
13615 | ac_prev= | |
13616 | elif test "x$ac_word" = "x-arch"; then | |
13617 | ac_prev=arch | |
13618 | fi | |
13619 | done | |
13620 | fi | |
13621 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13622 | if test $ac_cv_c_bigendian = unknown; then | |
13623 | # See if sys/param.h defines the BYTE_ORDER macro. | |
13624 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13625 | /* end confdefs.h. */ | |
13626 | #include <sys/types.h> | |
13627 | #include <sys/param.h> | |
13628 | ||
13629 | int | |
13630 | main () | |
13631 | { | |
13632 | #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ | |
13633 | && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ | |
13634 | && LITTLE_ENDIAN) | |
13635 | bogus endian macros | |
13636 | #endif | |
13637 | ||
13638 | ; | |
13639 | return 0; | |
13640 | } | |
13641 | _ACEOF | |
13642 | if ac_fn_c_try_compile "$LINENO"; then : | |
13643 | # It does; now see whether it defined to BIG_ENDIAN or not. | |
13644 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13645 | /* end confdefs.h. */ | |
13646 | #include <sys/types.h> | |
13647 | #include <sys/param.h> | |
13648 | ||
13649 | int | |
13650 | main () | |
13651 | { | |
13652 | #if BYTE_ORDER != BIG_ENDIAN | |
13653 | not big endian | |
13654 | #endif | |
13655 | ||
13656 | ; | |
13657 | return 0; | |
13658 | } | |
13659 | _ACEOF | |
13660 | if ac_fn_c_try_compile "$LINENO"; then : | |
13661 | ac_cv_c_bigendian=yes | |
13662 | else | |
13663 | ac_cv_c_bigendian=no | |
13664 | fi | |
13665 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13666 | fi | |
13667 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13668 | fi | |
13669 | if test $ac_cv_c_bigendian = unknown; then | |
13670 | # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). | |
13671 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13672 | /* end confdefs.h. */ | |
13673 | #include <limits.h> | |
13674 | ||
13675 | int | |
13676 | main () | |
13677 | { | |
13678 | #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) | |
13679 | bogus endian macros | |
13680 | #endif | |
13681 | ||
13682 | ; | |
13683 | return 0; | |
13684 | } | |
13685 | _ACEOF | |
13686 | if ac_fn_c_try_compile "$LINENO"; then : | |
13687 | # It does; now see whether it defined to _BIG_ENDIAN or not. | |
13688 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13689 | /* end confdefs.h. */ | |
13690 | #include <limits.h> | |
13691 | ||
13692 | int | |
13693 | main () | |
13694 | { | |
13695 | #ifndef _BIG_ENDIAN | |
13696 | not big endian | |
13697 | #endif | |
13698 | ||
13699 | ; | |
13700 | return 0; | |
13701 | } | |
13702 | _ACEOF | |
13703 | if ac_fn_c_try_compile "$LINENO"; then : | |
13704 | ac_cv_c_bigendian=yes | |
13705 | else | |
13706 | ac_cv_c_bigendian=no | |
13707 | fi | |
13708 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13709 | fi | |
13710 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13711 | fi | |
13712 | if test $ac_cv_c_bigendian = unknown; then | |
13713 | # Compile a test program. | |
13714 | if test "$cross_compiling" = yes; then : | |
13715 | # Try to guess by grepping values from an object file. | |
13716 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13717 | /* end confdefs.h. */ | |
13718 | short int ascii_mm[] = | |
13719 | { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; | |
13720 | short int ascii_ii[] = | |
13721 | { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; | |
13722 | int use_ascii (int i) { | |
13723 | return ascii_mm[i] + ascii_ii[i]; | |
13724 | } | |
13725 | short int ebcdic_ii[] = | |
13726 | { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; | |
13727 | short int ebcdic_mm[] = | |
13728 | { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; | |
13729 | int use_ebcdic (int i) { | |
13730 | return ebcdic_mm[i] + ebcdic_ii[i]; | |
13731 | } | |
13732 | extern int foo; | |
13733 | ||
13734 | int | |
13735 | main () | |
13736 | { | |
13737 | return use_ascii (foo) == use_ebcdic (foo); | |
13738 | ; | |
13739 | return 0; | |
13740 | } | |
13741 | _ACEOF | |
13742 | if ac_fn_c_try_compile "$LINENO"; then : | |
13743 | if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then | |
13744 | ac_cv_c_bigendian=yes | |
13745 | fi | |
13746 | if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then | |
13747 | if test "$ac_cv_c_bigendian" = unknown; then | |
13748 | ac_cv_c_bigendian=no | |
13749 | else | |
13750 | # finding both strings is unlikely to happen, but who knows? | |
13751 | ac_cv_c_bigendian=unknown | |
13752 | fi | |
13753 | fi | |
13754 | fi | |
13755 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13756 | else | |
13757 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13758 | /* end confdefs.h. */ | |
13759 | $ac_includes_default | |
13760 | int | |
13761 | main () | |
13762 | { | |
13763 | ||
13764 | /* Are we little or big endian? From Harbison&Steele. */ | |
13765 | union | |
13766 | { | |
13767 | long int l; | |
13768 | char c[sizeof (long int)]; | |
13769 | } u; | |
13770 | u.l = 1; | |
13771 | return u.c[sizeof (long int) - 1] == 1; | |
13772 | ||
13773 | ; | |
13774 | return 0; | |
13775 | } | |
13776 | _ACEOF | |
13777 | if ac_fn_c_try_run "$LINENO"; then : | |
13778 | ac_cv_c_bigendian=no | |
13779 | else | |
13780 | ac_cv_c_bigendian=yes | |
13781 | fi | |
13782 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
13783 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
13784 | fi | |
13785 | ||
13786 | fi | |
13787 | fi | |
13788 | : | |
13789 | case $ac_cv_c_bigendian in #( | |
13790 | yes) | |
13791 | gl_cv_cc_double_expbit0="word 0 bit 20";; #( | |
13792 | no) | |
13793 | gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( | |
13794 | universal) | |
13795 | ||
13796 | $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h | |
13797 | ||
13798 | ;; #( | |
13799 | *) | |
13800 | gl_cv_cc_double_expbit0="unknown" ;; | |
13801 | esac | |
13802 | ||
13803 | ||
13804 | fi | |
13805 | rm -f conftest* | |
13806 | ||
13807 | ||
13808 | else | |
13809 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13810 | /* end confdefs.h. */ | |
13811 | ||
13812 | #include <float.h> | |
13813 | #include <stddef.h> | |
13814 | #include <stdio.h> | |
13815 | #include <string.h> | |
13816 | #define NWORDS \ | |
13817 | ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) | |
13818 | typedef union { double value; unsigned int word[NWORDS]; } memory_double; | |
13819 | static unsigned int ored_words[NWORDS]; | |
13820 | static unsigned int anded_words[NWORDS]; | |
13821 | static void add_to_ored_words (double x) | |
13822 | { | |
13823 | memory_double m; | |
13824 | size_t i; | |
13825 | /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ | |
13826 | memset (&m, 0, sizeof (memory_double)); | |
13827 | m.value = x; | |
13828 | for (i = 0; i < NWORDS; i++) | |
13829 | { | |
13830 | ored_words[i] |= m.word[i]; | |
13831 | anded_words[i] &= m.word[i]; | |
13832 | } | |
13833 | } | |
13834 | int main () | |
13835 | { | |
13836 | size_t j; | |
13837 | FILE *fp = fopen ("conftest.out", "w"); | |
13838 | if (fp == NULL) | |
13839 | return 1; | |
13840 | for (j = 0; j < NWORDS; j++) | |
13841 | anded_words[j] = ~ (unsigned int) 0; | |
13842 | add_to_ored_words (0.25); | |
13843 | add_to_ored_words (0.5); | |
13844 | add_to_ored_words (1.0); | |
13845 | add_to_ored_words (2.0); | |
13846 | add_to_ored_words (4.0); | |
13847 | /* Remove bits that are common (e.g. if representation of the first mantissa | |
13848 | bit is explicit). */ | |
13849 | for (j = 0; j < NWORDS; j++) | |
13850 | ored_words[j] &= ~anded_words[j]; | |
13851 | /* Now find the nonzero word. */ | |
13852 | for (j = 0; j < NWORDS; j++) | |
13853 | if (ored_words[j] != 0) | |
13854 | break; | |
13855 | if (j < NWORDS) | |
13856 | { | |
13857 | size_t i; | |
13858 | for (i = j + 1; i < NWORDS; i++) | |
13859 | if (ored_words[i] != 0) | |
13860 | { | |
13861 | fprintf (fp, "unknown"); | |
13862 | return (fclose (fp) != 0); | |
13863 | } | |
13864 | for (i = 0; ; i++) | |
13865 | if ((ored_words[j] >> i) & 1) | |
13866 | { | |
13867 | fprintf (fp, "word %d bit %d", (int) j, (int) i); | |
13868 | return (fclose (fp) != 0); | |
13869 | } | |
13870 | } | |
13871 | fprintf (fp, "unknown"); | |
13872 | return (fclose (fp) != 0); | |
13873 | } | |
13874 | ||
13875 | _ACEOF | |
13876 | if ac_fn_c_try_run "$LINENO"; then : | |
13877 | gl_cv_cc_double_expbit0=`cat conftest.out` | |
13878 | else | |
13879 | gl_cv_cc_double_expbit0="unknown" | |
6ec2e0f5 | 13880 | fi |
5df4cba6 SM |
13881 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
13882 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
13883 | fi | |
13884 | ||
13885 | rm -f conftest.out | |
6ec2e0f5 SDJ |
13886 | |
13887 | fi | |
5df4cba6 SM |
13888 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 |
13889 | $as_echo "$gl_cv_cc_double_expbit0" >&6; } | |
13890 | case "$gl_cv_cc_double_expbit0" in | |
13891 | word*bit*) | |
13892 | word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` | |
13893 | bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` | |
6ec2e0f5 SDJ |
13894 | |
13895 | cat >>confdefs.h <<_ACEOF | |
5df4cba6 | 13896 | #define DBL_EXPBIT0_WORD $word |
6ec2e0f5 SDJ |
13897 | _ACEOF |
13898 | ||
c0c3707f | 13899 | |
5df4cba6 SM |
13900 | cat >>confdefs.h <<_ACEOF |
13901 | #define DBL_EXPBIT0_BIT $bit | |
13902 | _ACEOF | |
6ec2e0f5 | 13903 | |
5df4cba6 SM |
13904 | ;; |
13905 | esac | |
6ec2e0f5 | 13906 | |
6ec2e0f5 | 13907 | |
5df4cba6 SM |
13908 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 |
13909 | $as_echo_n "checking whether byte ordering is bigendian... " >&6; } | |
c0c3707f CB |
13910 | if ${ac_cv_c_bigendian+:} false; then : |
13911 | $as_echo_n "(cached) " >&6 | |
6ec2e0f5 | 13912 | else |
c0c3707f CB |
13913 | ac_cv_c_bigendian=unknown |
13914 | # See if we're dealing with a universal compiler. | |
13915 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 13916 | /* end confdefs.h. */ |
c0c3707f CB |
13917 | #ifndef __APPLE_CC__ |
13918 | not a universal capable compiler | |
13919 | #endif | |
13920 | typedef int dummy; | |
6ec2e0f5 | 13921 | |
c0c3707f CB |
13922 | _ACEOF |
13923 | if ac_fn_c_try_compile "$LINENO"; then : | |
13924 | ||
13925 | # Check for potential -arch flags. It is not universal unless | |
13926 | # there are at least two -arch flags with different values. | |
13927 | ac_arch= | |
13928 | ac_prev= | |
13929 | for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do | |
13930 | if test -n "$ac_prev"; then | |
13931 | case $ac_word in | |
13932 | i?86 | x86_64 | ppc | ppc64) | |
13933 | if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then | |
13934 | ac_arch=$ac_word | |
13935 | else | |
13936 | ac_cv_c_bigendian=universal | |
13937 | break | |
13938 | fi | |
13939 | ;; | |
13940 | esac | |
13941 | ac_prev= | |
13942 | elif test "x$ac_word" = "x-arch"; then | |
13943 | ac_prev=arch | |
13944 | fi | |
13945 | done | |
13946 | fi | |
13947 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13948 | if test $ac_cv_c_bigendian = unknown; then | |
13949 | # See if sys/param.h defines the BYTE_ORDER macro. | |
13950 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13951 | /* end confdefs.h. */ | |
13952 | #include <sys/types.h> | |
13953 | #include <sys/param.h> | |
6ec2e0f5 SDJ |
13954 | |
13955 | int | |
13956 | main () | |
13957 | { | |
c0c3707f CB |
13958 | #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ |
13959 | && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ | |
13960 | && LITTLE_ENDIAN) | |
13961 | bogus endian macros | |
13962 | #endif | |
6ec2e0f5 | 13963 | |
c0c3707f CB |
13964 | ; |
13965 | return 0; | |
13966 | } | |
13967 | _ACEOF | |
13968 | if ac_fn_c_try_compile "$LINENO"; then : | |
13969 | # It does; now see whether it defined to BIG_ENDIAN or not. | |
13970 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13971 | /* end confdefs.h. */ | |
13972 | #include <sys/types.h> | |
13973 | #include <sys/param.h> | |
13974 | ||
13975 | int | |
13976 | main () | |
13977 | { | |
13978 | #if BYTE_ORDER != BIG_ENDIAN | |
13979 | not big endian | |
13980 | #endif | |
6ec2e0f5 SDJ |
13981 | |
13982 | ; | |
13983 | return 0; | |
13984 | } | |
13985 | _ACEOF | |
c0c3707f CB |
13986 | if ac_fn_c_try_compile "$LINENO"; then : |
13987 | ac_cv_c_bigendian=yes | |
6ec2e0f5 | 13988 | else |
c0c3707f | 13989 | ac_cv_c_bigendian=no |
6ec2e0f5 | 13990 | fi |
c0c3707f | 13991 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
6ec2e0f5 | 13992 | fi |
c0c3707f CB |
13993 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
13994 | fi | |
13995 | if test $ac_cv_c_bigendian = unknown; then | |
13996 | # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). | |
13997 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13998 | /* end confdefs.h. */ | |
13999 | #include <limits.h> | |
472fa5ee | 14000 | |
c0c3707f CB |
14001 | int |
14002 | main () | |
14003 | { | |
14004 | #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) | |
14005 | bogus endian macros | |
14006 | #endif | |
6ec2e0f5 | 14007 | |
c0c3707f CB |
14008 | ; |
14009 | return 0; | |
14010 | } | |
6ec2e0f5 | 14011 | _ACEOF |
c0c3707f CB |
14012 | if ac_fn_c_try_compile "$LINENO"; then : |
14013 | # It does; now see whether it defined to _BIG_ENDIAN or not. | |
14014 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 14015 | /* end confdefs.h. */ |
c0c3707f CB |
14016 | #include <limits.h> |
14017 | ||
6ec2e0f5 SDJ |
14018 | int |
14019 | main () | |
14020 | { | |
5df4cba6 SM |
14021 | #ifndef _BIG_ENDIAN |
14022 | not big endian | |
14023 | #endif | |
14024 | ||
14025 | ; | |
14026 | return 0; | |
14027 | } | |
14028 | _ACEOF | |
14029 | if ac_fn_c_try_compile "$LINENO"; then : | |
14030 | ac_cv_c_bigendian=yes | |
14031 | else | |
14032 | ac_cv_c_bigendian=no | |
14033 | fi | |
14034 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
14035 | fi | |
14036 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
14037 | fi | |
14038 | if test $ac_cv_c_bigendian = unknown; then | |
14039 | # Compile a test program. | |
14040 | if test "$cross_compiling" = yes; then : | |
14041 | # Try to guess by grepping values from an object file. | |
14042 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14043 | /* end confdefs.h. */ | |
14044 | short int ascii_mm[] = | |
14045 | { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; | |
14046 | short int ascii_ii[] = | |
14047 | { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; | |
14048 | int use_ascii (int i) { | |
14049 | return ascii_mm[i] + ascii_ii[i]; | |
14050 | } | |
14051 | short int ebcdic_ii[] = | |
14052 | { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; | |
14053 | short int ebcdic_mm[] = | |
14054 | { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; | |
14055 | int use_ebcdic (int i) { | |
14056 | return ebcdic_mm[i] + ebcdic_ii[i]; | |
14057 | } | |
14058 | extern int foo; | |
14059 | ||
14060 | int | |
14061 | main () | |
14062 | { | |
14063 | return use_ascii (foo) == use_ebcdic (foo); | |
14064 | ; | |
14065 | return 0; | |
14066 | } | |
14067 | _ACEOF | |
14068 | if ac_fn_c_try_compile "$LINENO"; then : | |
14069 | if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then | |
14070 | ac_cv_c_bigendian=yes | |
14071 | fi | |
14072 | if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then | |
14073 | if test "$ac_cv_c_bigendian" = unknown; then | |
14074 | ac_cv_c_bigendian=no | |
14075 | else | |
14076 | # finding both strings is unlikely to happen, but who knows? | |
14077 | ac_cv_c_bigendian=unknown | |
14078 | fi | |
14079 | fi | |
14080 | fi | |
14081 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
14082 | else | |
14083 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14084 | /* end confdefs.h. */ | |
14085 | $ac_includes_default | |
14086 | int | |
14087 | main () | |
14088 | { | |
14089 | ||
14090 | /* Are we little or big endian? From Harbison&Steele. */ | |
14091 | union | |
14092 | { | |
14093 | long int l; | |
14094 | char c[sizeof (long int)]; | |
14095 | } u; | |
14096 | u.l = 1; | |
14097 | return u.c[sizeof (long int) - 1] == 1; | |
14098 | ||
14099 | ; | |
14100 | return 0; | |
14101 | } | |
14102 | _ACEOF | |
14103 | if ac_fn_c_try_run "$LINENO"; then : | |
14104 | ac_cv_c_bigendian=no | |
14105 | else | |
14106 | ac_cv_c_bigendian=yes | |
14107 | fi | |
14108 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
14109 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
14110 | fi | |
14111 | ||
14112 | fi | |
14113 | fi | |
14114 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 | |
14115 | $as_echo "$ac_cv_c_bigendian" >&6; } | |
14116 | case $ac_cv_c_bigendian in #( | |
14117 | yes) | |
14118 | $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h | |
14119 | ;; #( | |
14120 | no) | |
14121 | ;; #( | |
14122 | universal) | |
14123 | ||
14124 | $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h | |
14125 | ||
14126 | ;; #( | |
14127 | *) | |
14128 | as_fn_error $? "unknown endianness | |
14129 | presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; | |
14130 | esac | |
14131 | ||
14132 | ||
14133 | ||
5df4cba6 SM |
14134 | GNULIB_LOCALECONV=0; |
14135 | GNULIB_SETLOCALE=0; | |
14136 | GNULIB_SETLOCALE_NULL=0; | |
14137 | GNULIB_DUPLOCALE=0; | |
14138 | GNULIB_LOCALENAME=0; | |
14139 | HAVE_NEWLOCALE=1; | |
14140 | HAVE_DUPLOCALE=1; | |
14141 | HAVE_FREELOCALE=1; | |
14142 | REPLACE_LOCALECONV=0; | |
14143 | REPLACE_SETLOCALE=0; | |
14144 | REPLACE_NEWLOCALE=0; | |
14145 | REPLACE_DUPLOCALE=0; | |
14146 | REPLACE_FREELOCALE=0; | |
14147 | REPLACE_STRUCT_LCONV=0; | |
14148 | ||
14149 | ||
14150 | REPLACE_NULL=0; | |
14151 | HAVE_MAX_ALIGN_T=1; | |
14152 | HAVE_WCHAR_T=1; | |
14153 | ||
14154 | ||
14155 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 | |
14156 | $as_echo_n "checking for wchar_t... " >&6; } | |
14157 | if ${gt_cv_c_wchar_t+:} false; then : | |
14158 | $as_echo_n "(cached) " >&6 | |
14159 | else | |
14160 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14161 | /* end confdefs.h. */ | |
14162 | #include <stddef.h> | |
14163 | wchar_t foo = (wchar_t)'\0'; | |
14164 | int | |
14165 | main () | |
14166 | { | |
14167 | ||
14168 | ; | |
14169 | return 0; | |
14170 | } | |
14171 | _ACEOF | |
14172 | if ac_fn_c_try_compile "$LINENO"; then : | |
14173 | gt_cv_c_wchar_t=yes | |
14174 | else | |
14175 | gt_cv_c_wchar_t=no | |
14176 | fi | |
14177 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
14178 | fi | |
14179 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 | |
14180 | $as_echo "$gt_cv_c_wchar_t" >&6; } | |
14181 | if test $gt_cv_c_wchar_t = yes; then | |
14182 | ||
14183 | $as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h | |
14184 | ||
14185 | fi | |
14186 | ||
14187 | ||
14188 | ||
14189 | ||
9c9d63b1 PM |
14190 | |
14191 | ||
14192 | ||
5df4cba6 SM |
14193 | STDDEF_H= |
14194 | ||
14195 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5 | |
14196 | $as_echo_n "checking for good max_align_t... " >&6; } | |
14197 | if ${gl_cv_type_max_align_t+:} false; then : | |
14198 | $as_echo_n "(cached) " >&6 | |
14199 | else | |
14200 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14201 | /* end confdefs.h. */ | |
14202 | #include <stddef.h> | |
14203 | unsigned int s = sizeof (max_align_t); | |
9c9d63b1 | 14204 | #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__ |
5df4cba6 SM |
14205 | int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; |
14206 | int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; | |
14207 | #endif | |
9c9d63b1 PM |
14208 | typedef struct { char a; max_align_t b; } max_helper; |
14209 | typedef struct { char a; long b; } long_helper; | |
14210 | typedef struct { char a; double b; } double_helper; | |
14211 | typedef struct { char a; long double b; } long_double_helper; | |
14212 | int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1]; | |
14213 | int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1]; | |
14214 | int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1]; | |
5df4cba6 SM |
14215 | |
14216 | int | |
14217 | main () | |
14218 | { | |
c0c3707f | 14219 | |
6ec2e0f5 SDJ |
14220 | ; |
14221 | return 0; | |
14222 | } | |
14223 | _ACEOF | |
14224 | if ac_fn_c_try_compile "$LINENO"; then : | |
5df4cba6 | 14225 | gl_cv_type_max_align_t=yes |
6ec2e0f5 | 14226 | else |
5df4cba6 | 14227 | gl_cv_type_max_align_t=no |
6ec2e0f5 | 14228 | fi |
c0c3707f | 14229 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
6ec2e0f5 | 14230 | |
c0c3707f | 14231 | fi |
5df4cba6 SM |
14232 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5 |
14233 | $as_echo "$gl_cv_type_max_align_t" >&6; } | |
14234 | if test $gl_cv_type_max_align_t = no; then | |
14235 | HAVE_MAX_ALIGN_T=0 | |
14236 | STDDEF_H=stddef.h | |
14237 | fi | |
14238 | ||
14239 | if test $gt_cv_c_wchar_t = no; then | |
14240 | HAVE_WCHAR_T=0 | |
14241 | STDDEF_H=stddef.h | |
14242 | fi | |
14243 | ||
14244 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 | |
14245 | $as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; } | |
14246 | if ${gl_cv_decl_null_works+:} false; then : | |
14247 | $as_echo_n "(cached) " >&6 | |
c0c3707f CB |
14248 | else |
14249 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14250 | /* end confdefs.h. */ | |
5df4cba6 SM |
14251 | #include <stddef.h> |
14252 | int test[2 * (sizeof NULL == sizeof (void *)) -1]; | |
14253 | ||
c0c3707f CB |
14254 | int |
14255 | main () | |
14256 | { | |
6ec2e0f5 | 14257 | |
c0c3707f CB |
14258 | ; |
14259 | return 0; | |
14260 | } | |
14261 | _ACEOF | |
5df4cba6 SM |
14262 | if ac_fn_c_try_compile "$LINENO"; then : |
14263 | gl_cv_decl_null_works=yes | |
c0c3707f | 14264 | else |
5df4cba6 | 14265 | gl_cv_decl_null_works=no |
c0c3707f | 14266 | fi |
5df4cba6 | 14267 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
c0c3707f | 14268 | fi |
5df4cba6 SM |
14269 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 |
14270 | $as_echo "$gl_cv_decl_null_works" >&6; } | |
14271 | if test $gl_cv_decl_null_works = no; then | |
14272 | REPLACE_NULL=1 | |
14273 | STDDEF_H=stddef.h | |
14274 | fi | |
6ec2e0f5 | 14275 | |
5df4cba6 SM |
14276 | |
14277 | if test -n "$STDDEF_H"; then | |
14278 | GL_GENERATE_STDDEF_H_TRUE= | |
14279 | GL_GENERATE_STDDEF_H_FALSE='#' | |
14280 | else | |
14281 | GL_GENERATE_STDDEF_H_TRUE='#' | |
14282 | GL_GENERATE_STDDEF_H_FALSE= | |
c0c3707f | 14283 | fi |
6ec2e0f5 | 14284 | |
5df4cba6 | 14285 | if test -n "$STDDEF_H"; then |
6ec2e0f5 | 14286 | |
472fa5ee SM |
14287 | |
14288 | ||
5e8754f9 SDJ |
14289 | |
14290 | ||
5df4cba6 SM |
14291 | |
14292 | ||
14293 | ||
14294 | if test $gl_cv_have_include_next = yes; then | |
14295 | gl_cv_next_stddef_h='<'stddef.h'>' | |
14296 | else | |
14297 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5 | |
14298 | $as_echo_n "checking absolute name of <stddef.h>... " >&6; } | |
14299 | if ${gl_cv_next_stddef_h+:} false; then : | |
14300 | $as_echo_n "(cached) " >&6 | |
c0c3707f | 14301 | else |
5df4cba6 SM |
14302 | |
14303 | ||
14304 | ||
c0c3707f CB |
14305 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
14306 | /* end confdefs.h. */ | |
c0c3707f | 14307 | #include <stddef.h> |
c0c3707f | 14308 | _ACEOF |
5df4cba6 SM |
14309 | case "$host_os" in |
14310 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
14311 | *) gl_absname_cpp="$ac_cpp" ;; | |
14312 | esac | |
14313 | ||
14314 | case "$host_os" in | |
14315 | mingw*) | |
14316 | gl_dirsep_regex='[/\\]' | |
14317 | ;; | |
14318 | *) | |
14319 | gl_dirsep_regex='\/' | |
14320 | ;; | |
14321 | esac | |
14322 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
14323 | gl_header_literal_regex=`echo 'stddef.h' \ | |
14324 | | sed -e "$gl_make_literal_regex_sed"` | |
14325 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
14326 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
14327 | s|^/[^/]|//&| | |
14328 | p | |
14329 | q | |
14330 | }' | |
14331 | ||
14332 | gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
14333 | sed -n "$gl_absolute_header_sed"` | |
14334 | ||
14335 | gl_header=$gl_cv_absolute_stddef_h | |
14336 | gl_cv_next_stddef_h='"'$gl_header'"' | |
5e8754f9 SDJ |
14337 | |
14338 | ||
c0c3707f | 14339 | fi |
5df4cba6 SM |
14340 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 |
14341 | $as_echo "$gl_cv_next_stddef_h" >&6; } | |
14342 | fi | |
14343 | NEXT_STDDEF_H=$gl_cv_next_stddef_h | |
14344 | ||
14345 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
14346 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
14347 | gl_next_as_first_directive='<'stddef.h'>' | |
14348 | else | |
14349 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
14350 | gl_next_as_first_directive=$gl_cv_next_stddef_h | |
14351 | fi | |
14352 | NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive | |
5e8754f9 SDJ |
14353 | |
14354 | ||
14355 | ||
14356 | ||
5df4cba6 | 14357 | fi |
5e8754f9 SDJ |
14358 | |
14359 | ||
14360 | ||
14361 | ||
14362 | ||
14363 | ||
5df4cba6 SM |
14364 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5 |
14365 | $as_echo_n "checking whether locale.h defines locale_t... " >&6; } | |
14366 | if ${gl_cv_header_locale_has_locale_t+:} false; then : | |
14367 | $as_echo_n "(cached) " >&6 | |
14368 | else | |
14369 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 14370 | /* end confdefs.h. */ |
5df4cba6 SM |
14371 | #include <locale.h> |
14372 | locale_t x; | |
c0c3707f CB |
14373 | int |
14374 | main () | |
14375 | { | |
5e8754f9 | 14376 | |
c0c3707f CB |
14377 | ; |
14378 | return 0; | |
14379 | } | |
14380 | _ACEOF | |
14381 | if ac_fn_c_try_compile "$LINENO"; then : | |
5df4cba6 | 14382 | gl_cv_header_locale_has_locale_t=yes |
c0c3707f | 14383 | else |
5df4cba6 | 14384 | gl_cv_header_locale_has_locale_t=no |
c0c3707f CB |
14385 | fi |
14386 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5df4cba6 | 14387 | |
c0c3707f | 14388 | fi |
5df4cba6 SM |
14389 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5 |
14390 | $as_echo "$gl_cv_header_locale_has_locale_t" >&6; } | |
14391 | ||
14392 | ||
14393 | if test $ac_cv_header_xlocale_h = yes; then | |
14394 | HAVE_XLOCALE_H=1 | |
14395 | if test $gl_cv_header_locale_has_locale_t = yes; then | |
14396 | gl_cv_header_locale_h_needs_xlocale_h=no | |
14397 | else | |
14398 | gl_cv_header_locale_h_needs_xlocale_h=yes | |
c0c3707f | 14399 | fi |
5df4cba6 SM |
14400 | HAVE_LOCALE_T=1 |
14401 | else | |
14402 | HAVE_XLOCALE_H=0 | |
14403 | gl_cv_header_locale_h_needs_xlocale_h=no | |
14404 | if test $gl_cv_header_locale_has_locale_t = yes; then | |
14405 | HAVE_LOCALE_T=1 | |
14406 | else | |
14407 | HAVE_LOCALE_T=0 | |
14408 | fi | |
14409 | fi | |
14410 | ||
14411 | ||
5e8754f9 | 14412 | |
5df4cba6 SM |
14413 | |
14414 | gl_threads_api=none | |
14415 | LIBTHREAD= | |
14416 | LTLIBTHREAD= | |
14417 | LIBMULTITHREAD= | |
14418 | LTLIBMULTITHREAD= | |
14419 | if test "$gl_use_threads" != no; then | |
14420 | ||
14421 | ||
14422 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 | |
14423 | $as_echo_n "checking whether imported symbols can be declared weak... " >&6; } | |
14424 | if ${gl_cv_have_weak+:} false; then : | |
14425 | $as_echo_n "(cached) " >&6 | |
14426 | else | |
14427 | gl_cv_have_weak=no | |
14428 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14429 | /* end confdefs.h. */ | |
14430 | extern void xyzzy (); | |
14431 | #pragma weak xyzzy | |
c0c3707f CB |
14432 | int |
14433 | main () | |
14434 | { | |
5df4cba6 | 14435 | xyzzy(); |
c0c3707f CB |
14436 | ; |
14437 | return 0; | |
14438 | } | |
14439 | _ACEOF | |
5df4cba6 SM |
14440 | if ac_fn_c_try_link "$LINENO"; then : |
14441 | gl_cv_have_weak=maybe | |
14442 | fi | |
14443 | rm -f core conftest.err conftest.$ac_objext \ | |
14444 | conftest$ac_exeext conftest.$ac_ext | |
14445 | if test $gl_cv_have_weak = maybe; then | |
14446 | if test "$cross_compiling" = yes; then : | |
14447 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 14448 | /* end confdefs.h. */ |
5df4cba6 SM |
14449 | #ifdef __ELF__ |
14450 | Extensible Linking Format | |
14451 | #endif | |
5e8754f9 | 14452 | |
5df4cba6 SM |
14453 | _ACEOF |
14454 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
14455 | $EGREP "Extensible Linking Format" >/dev/null 2>&1; then : | |
14456 | gl_cv_have_weak="guessing yes" | |
14457 | else | |
14458 | gl_cv_have_weak="guessing no" | |
14459 | fi | |
14460 | rm -f conftest* | |
5e8754f9 | 14461 | |
5df4cba6 SM |
14462 | |
14463 | else | |
14464 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14465 | /* end confdefs.h. */ | |
14466 | ||
14467 | #include <stdio.h> | |
14468 | #pragma weak fputs | |
14469 | int main () | |
14470 | { | |
14471 | return (fputs == NULL); | |
c0c3707f CB |
14472 | } |
14473 | _ACEOF | |
5df4cba6 SM |
14474 | if ac_fn_c_try_run "$LINENO"; then : |
14475 | gl_cv_have_weak=yes | |
c0c3707f | 14476 | else |
5df4cba6 | 14477 | gl_cv_have_weak=no |
c0c3707f | 14478 | fi |
5df4cba6 SM |
14479 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
14480 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c0c3707f | 14481 | fi |
5df4cba6 SM |
14482 | |
14483 | fi | |
14484 | case " $LDFLAGS " in | |
14485 | *" -static "*) gl_cv_have_weak=no ;; | |
14486 | esac | |
14487 | case "$gl_cv_have_weak" in | |
14488 | *yes) | |
14489 | case "$host_os" in | |
14490 | freebsd* | dragonfly*) | |
14491 | : > conftest1.c | |
14492 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1 | |
14493 | cat <<EOF > conftest2.c | |
14494 | #include <pthread.h> | |
14495 | #pragma weak pthread_mutexattr_gettype | |
14496 | int main () | |
14497 | { | |
14498 | return (pthread_mutexattr_gettype != NULL); | |
14499 | } | |
14500 | EOF | |
14501 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \ | |
14502 | || gl_cv_have_weak=no | |
14503 | rm -f conftest1.c libempty.so conftest2.c conftest | |
14504 | ;; | |
14505 | esac | |
14506 | ;; | |
14507 | esac | |
14508 | ||
14509 | fi | |
14510 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 | |
14511 | $as_echo "$gl_cv_have_weak" >&6; } | |
14512 | case "$gl_cv_have_weak" in | |
14513 | *yes) | |
14514 | ||
14515 | $as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h | |
14516 | ||
14517 | ;; | |
14518 | esac | |
14519 | ||
14520 | if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then | |
14521 | ||
14522 | : | |
c0c3707f | 14523 | fi |
5df4cba6 SM |
14524 | if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then |
14525 | ||
14526 | gl_have_isoc_threads="$ac_cv_header_threads_h" | |
14527 | fi | |
14528 | if test "$gl_use_threads" = yes \ | |
14529 | || test "$gl_use_threads" = posix \ | |
14530 | || test "$gl_use_threads" = isoc+posix; then | |
14531 | ||
14532 | ||
14533 | if test -z "$gl_pthreadlib_body_done"; then | |
14534 | gl_pthread_api=no | |
14535 | LIBPTHREAD= | |
14536 | LIBPMULTITHREAD= | |
14537 | # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that | |
14538 | # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY. | |
14539 | ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" | |
14540 | if test "x$ac_cv_header_pthread_h" = xyes; then : | |
14541 | gl_have_pthread_h=yes | |
14542 | else | |
14543 | gl_have_pthread_h=no | |
14544 | fi | |
14545 | ||
14546 | ||
14547 | if test "$gl_have_pthread_h" = yes; then | |
14548 | # Other possible tests: | |
14549 | # -lpthreads (FSU threads, PCthreads) | |
14550 | # -lgthreads | |
14551 | # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist | |
14552 | # in libc. IRIX 6.5 has the first one in both libc and libpthread, but | |
14553 | # the second one only in libpthread, and lock.c needs it. | |
14554 | # | |
14555 | # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 | |
14556 | # needs -pthread for some reason. See: | |
14557 | # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html | |
14558 | save_LIBS=$LIBS | |
14559 | for gl_pthread in '' '-pthread'; do | |
14560 | LIBS="$LIBS $gl_pthread" | |
14561 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14562 | /* end confdefs.h. */ | |
14563 | #include <pthread.h> | |
14564 | pthread_mutex_t m; | |
14565 | pthread_mutexattr_t ma; | |
5e8754f9 | 14566 | |
c0c3707f CB |
14567 | int |
14568 | main () | |
14569 | { | |
5df4cba6 SM |
14570 | pthread_mutex_lock (&m); |
14571 | pthread_mutexattr_init (&ma); | |
c0c3707f CB |
14572 | ; |
14573 | return 0; | |
14574 | } | |
14575 | _ACEOF | |
5df4cba6 SM |
14576 | if ac_fn_c_try_link "$LINENO"; then : |
14577 | gl_pthread_api=yes | |
14578 | LIBPTHREAD=$gl_pthread | |
14579 | LIBPMULTITHREAD=$gl_pthread | |
c0c3707f | 14580 | fi |
5df4cba6 SM |
14581 | rm -f core conftest.err conftest.$ac_objext \ |
14582 | conftest$ac_exeext conftest.$ac_ext | |
14583 | LIBS=$save_LIBS | |
14584 | test $gl_pthread_api = yes && break | |
14585 | done | |
14586 | ||
14587 | # Test for libpthread by looking for pthread_kill. (Not pthread_self, | |
14588 | # since it is defined as a macro on OSF/1.) | |
14589 | if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then | |
14590 | # The program links fine without libpthread. But it may actually | |
14591 | # need to link with libpthread in order to create multiple threads. | |
14592 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
14593 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
14594 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
14595 | $as_echo_n "(cached) " >&6 | |
c0c3707f | 14596 | else |
5df4cba6 SM |
14597 | ac_check_lib_save_LIBS=$LIBS |
14598 | LIBS="-lpthread $LIBS" | |
14599 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 14600 | /* end confdefs.h. */ |
5df4cba6 SM |
14601 | |
14602 | /* Override any GCC internal prototype to avoid an error. | |
14603 | Use char because int might match the return type of a GCC | |
14604 | builtin and then its argument prototype would still apply. */ | |
14605 | #ifdef __cplusplus | |
14606 | extern "C" | |
14607 | #endif | |
14608 | char pthread_kill (); | |
c0c3707f CB |
14609 | int |
14610 | main () | |
14611 | { | |
5df4cba6 | 14612 | return pthread_kill (); |
c0c3707f CB |
14613 | ; |
14614 | return 0; | |
14615 | } | |
14616 | _ACEOF | |
5df4cba6 SM |
14617 | if ac_fn_c_try_link "$LINENO"; then : |
14618 | ac_cv_lib_pthread_pthread_kill=yes | |
6ec2e0f5 | 14619 | else |
5df4cba6 | 14620 | ac_cv_lib_pthread_pthread_kill=no |
6ec2e0f5 | 14621 | fi |
5df4cba6 SM |
14622 | rm -f core conftest.err conftest.$ac_objext \ |
14623 | conftest$ac_exeext conftest.$ac_ext | |
14624 | LIBS=$ac_check_lib_save_LIBS | |
c0c3707f | 14625 | fi |
5df4cba6 SM |
14626 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 |
14627 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
14628 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
14629 | LIBPMULTITHREAD=-lpthread | |
14630 | # On Solaris and HP-UX, most pthread functions exist also in libc. | |
14631 | # Therefore pthread_in_use() needs to actually try to create a | |
14632 | # thread: pthread_create from libc will fail, whereas | |
14633 | # pthread_create will actually create a thread. | |
14634 | # On Solaris 10 or newer, this test is no longer needed, because | |
14635 | # libc contains the fully functional pthread functions. | |
14636 | case "$host_os" in | |
14637 | solaris | solaris2.1-9 | solaris2.1-9.* | hpux*) | |
472fa5ee | 14638 | |
5df4cba6 | 14639 | $as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h |
472fa5ee | 14640 | |
5df4cba6 | 14641 | esac |
472fa5ee | 14642 | |
5df4cba6 | 14643 | fi |
472fa5ee | 14644 | |
5df4cba6 SM |
14645 | elif test $gl_pthread_api != yes; then |
14646 | # Some library is needed. Try libpthread and libc_r. | |
14647 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
14648 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
14649 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
c0c3707f CB |
14650 | $as_echo_n "(cached) " >&6 |
14651 | else | |
5df4cba6 SM |
14652 | ac_check_lib_save_LIBS=$LIBS |
14653 | LIBS="-lpthread $LIBS" | |
14654 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 14655 | /* end confdefs.h. */ |
5df4cba6 SM |
14656 | |
14657 | /* Override any GCC internal prototype to avoid an error. | |
14658 | Use char because int might match the return type of a GCC | |
14659 | builtin and then its argument prototype would still apply. */ | |
14660 | #ifdef __cplusplus | |
14661 | extern "C" | |
14662 | #endif | |
14663 | char pthread_kill (); | |
c0c3707f CB |
14664 | int |
14665 | main () | |
14666 | { | |
5df4cba6 | 14667 | return pthread_kill (); |
c0c3707f CB |
14668 | ; |
14669 | return 0; | |
14670 | } | |
14671 | _ACEOF | |
14672 | if ac_fn_c_try_link "$LINENO"; then : | |
5df4cba6 | 14673 | ac_cv_lib_pthread_pthread_kill=yes |
c0c3707f | 14674 | else |
5df4cba6 | 14675 | ac_cv_lib_pthread_pthread_kill=no |
c0c3707f CB |
14676 | fi |
14677 | rm -f core conftest.err conftest.$ac_objext \ | |
14678 | conftest$ac_exeext conftest.$ac_ext | |
5df4cba6 SM |
14679 | LIBS=$ac_check_lib_save_LIBS |
14680 | fi | |
14681 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 | |
14682 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
14683 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
14684 | gl_pthread_api=yes | |
14685 | LIBPTHREAD=-lpthread | |
14686 | LIBPMULTITHREAD=-lpthread | |
c0c3707f | 14687 | fi |
472fa5ee | 14688 | |
5df4cba6 SM |
14689 | if test $gl_pthread_api != yes; then |
14690 | # For FreeBSD 4. | |
14691 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5 | |
14692 | $as_echo_n "checking for pthread_kill in -lc_r... " >&6; } | |
14693 | if ${ac_cv_lib_c_r_pthread_kill+:} false; then : | |
14694 | $as_echo_n "(cached) " >&6 | |
14695 | else | |
14696 | ac_check_lib_save_LIBS=$LIBS | |
14697 | LIBS="-lc_r $LIBS" | |
14698 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14699 | /* end confdefs.h. */ | |
472fa5ee | 14700 | |
5df4cba6 SM |
14701 | /* Override any GCC internal prototype to avoid an error. |
14702 | Use char because int might match the return type of a GCC | |
14703 | builtin and then its argument prototype would still apply. */ | |
14704 | #ifdef __cplusplus | |
14705 | extern "C" | |
14706 | #endif | |
14707 | char pthread_kill (); | |
14708 | int | |
14709 | main () | |
14710 | { | |
14711 | return pthread_kill (); | |
14712 | ; | |
14713 | return 0; | |
14714 | } | |
14715 | _ACEOF | |
14716 | if ac_fn_c_try_link "$LINENO"; then : | |
14717 | ac_cv_lib_c_r_pthread_kill=yes | |
14718 | else | |
14719 | ac_cv_lib_c_r_pthread_kill=no | |
14720 | fi | |
14721 | rm -f core conftest.err conftest.$ac_objext \ | |
14722 | conftest$ac_exeext conftest.$ac_ext | |
14723 | LIBS=$ac_check_lib_save_LIBS | |
14724 | fi | |
14725 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5 | |
14726 | $as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; } | |
14727 | if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then : | |
14728 | gl_pthread_api=yes | |
14729 | LIBPTHREAD=-lc_r | |
14730 | LIBPMULTITHREAD=-lc_r | |
14731 | fi | |
6ec2e0f5 | 14732 | |
5df4cba6 SM |
14733 | fi |
14734 | fi | |
14735 | fi | |
14736 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 | |
14737 | $as_echo_n "checking whether POSIX threads API is available... " >&6; } | |
14738 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5 | |
14739 | $as_echo "$gl_pthread_api" >&6; } | |
472fa5ee SM |
14740 | |
14741 | ||
5df4cba6 | 14742 | if test $gl_pthread_api = yes; then |
472fa5ee | 14743 | |
5df4cba6 | 14744 | $as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h |
472fa5ee | 14745 | |
5df4cba6 | 14746 | fi |
472fa5ee | 14747 | |
5df4cba6 | 14748 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
c0c3707f | 14749 | /* end confdefs.h. */ |
5df4cba6 | 14750 | #include <sched.h> |
c0c3707f CB |
14751 | int |
14752 | main () | |
14753 | { | |
5df4cba6 | 14754 | sched_yield (); |
c0c3707f CB |
14755 | ; |
14756 | return 0; | |
14757 | } | |
14758 | _ACEOF | |
14759 | if ac_fn_c_try_link "$LINENO"; then : | |
5df4cba6 | 14760 | LIB_SCHED_YIELD= |
6ec2e0f5 | 14761 | |
c0c3707f | 14762 | else |
5df4cba6 SM |
14763 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 |
14764 | $as_echo_n "checking for sched_yield in -lrt... " >&6; } | |
14765 | if ${ac_cv_lib_rt_sched_yield+:} false; then : | |
14766 | $as_echo_n "(cached) " >&6 | |
c0c3707f | 14767 | else |
5df4cba6 SM |
14768 | ac_check_lib_save_LIBS=$LIBS |
14769 | LIBS="-lrt $LIBS" | |
14770 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 14771 | /* end confdefs.h. */ |
6ec2e0f5 | 14772 | |
5df4cba6 SM |
14773 | /* Override any GCC internal prototype to avoid an error. |
14774 | Use char because int might match the return type of a GCC | |
14775 | builtin and then its argument prototype would still apply. */ | |
14776 | #ifdef __cplusplus | |
14777 | extern "C" | |
14778 | #endif | |
14779 | char sched_yield (); | |
14780 | int | |
14781 | main () | |
c0c3707f | 14782 | { |
5df4cba6 SM |
14783 | return sched_yield (); |
14784 | ; | |
14785 | return 0; | |
c0c3707f | 14786 | } |
6ec2e0f5 | 14787 | _ACEOF |
5df4cba6 SM |
14788 | if ac_fn_c_try_link "$LINENO"; then : |
14789 | ac_cv_lib_rt_sched_yield=yes | |
c0c3707f | 14790 | else |
5df4cba6 | 14791 | ac_cv_lib_rt_sched_yield=no |
6ec2e0f5 | 14792 | fi |
5df4cba6 SM |
14793 | rm -f core conftest.err conftest.$ac_objext \ |
14794 | conftest$ac_exeext conftest.$ac_ext | |
14795 | LIBS=$ac_check_lib_save_LIBS | |
6ec2e0f5 | 14796 | fi |
5df4cba6 SM |
14797 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 |
14798 | $as_echo "$ac_cv_lib_rt_sched_yield" >&6; } | |
14799 | if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : | |
14800 | LIB_SCHED_YIELD=-lrt | |
14801 | else | |
14802 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5 | |
14803 | $as_echo_n "checking for sched_yield in -lposix4... " >&6; } | |
14804 | if ${ac_cv_lib_posix4_sched_yield+:} false; then : | |
14805 | $as_echo_n "(cached) " >&6 | |
14806 | else | |
14807 | ac_check_lib_save_LIBS=$LIBS | |
14808 | LIBS="-lposix4 $LIBS" | |
14809 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 14810 | /* end confdefs.h. */ |
6ec2e0f5 | 14811 | |
5df4cba6 SM |
14812 | /* Override any GCC internal prototype to avoid an error. |
14813 | Use char because int might match the return type of a GCC | |
14814 | builtin and then its argument prototype would still apply. */ | |
14815 | #ifdef __cplusplus | |
14816 | extern "C" | |
14817 | #endif | |
14818 | char sched_yield (); | |
c0c3707f CB |
14819 | int |
14820 | main () | |
14821 | { | |
5df4cba6 | 14822 | return sched_yield (); |
c0c3707f CB |
14823 | ; |
14824 | return 0; | |
14825 | } | |
14826 | _ACEOF | |
14827 | if ac_fn_c_try_link "$LINENO"; then : | |
5df4cba6 SM |
14828 | ac_cv_lib_posix4_sched_yield=yes |
14829 | else | |
14830 | ac_cv_lib_posix4_sched_yield=no | |
c0c3707f CB |
14831 | fi |
14832 | rm -f core conftest.err conftest.$ac_objext \ | |
14833 | conftest$ac_exeext conftest.$ac_ext | |
5df4cba6 SM |
14834 | LIBS=$ac_check_lib_save_LIBS |
14835 | fi | |
14836 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5 | |
14837 | $as_echo "$ac_cv_lib_posix4_sched_yield" >&6; } | |
14838 | if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then : | |
14839 | LIB_SCHED_YIELD=-lposix4 | |
14840 | fi | |
14841 | ||
14842 | fi | |
14843 | ||
14844 | ||
14845 | fi | |
14846 | rm -f core conftest.err conftest.$ac_objext \ | |
14847 | conftest$ac_exeext conftest.$ac_ext | |
14848 | ||
14849 | ||
14850 | gl_pthreadlib_body_done=done | |
14851 | fi | |
14852 | ||
14853 | LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD | |
14854 | LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD | |
14855 | if test $gl_pthread_api = yes; then | |
14856 | if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then | |
14857 | gl_threads_api='isoc+posix' | |
14858 | ||
14859 | $as_echo "#define USE_ISOC_AND_POSIX_THREADS 1" >>confdefs.h | |
14860 | ||
14861 | LIBTHREAD= LTLIBTHREAD= | |
14862 | else | |
14863 | gl_threads_api=posix | |
14864 | ||
14865 | $as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h | |
14866 | ||
14867 | if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then | |
14868 | if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then | |
14869 | ||
14870 | $as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h | |
14871 | ||
14872 | LIBTHREAD= LTLIBTHREAD= | |
9c9d63b1 PM |
14873 | else |
14874 | case "$host_os" in | |
14875 | freebsd* | dragonfly*) | |
14876 | if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then | |
14877 | ||
14878 | $as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h | |
14879 | ||
14880 | fi | |
14881 | ;; | |
14882 | esac | |
5df4cba6 SM |
14883 | fi |
14884 | fi | |
14885 | fi | |
c0c3707f CB |
14886 | fi |
14887 | fi | |
5df4cba6 SM |
14888 | if test $gl_threads_api = none; then |
14889 | if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then | |
14890 | ||
14891 | ||
14892 | ||
14893 | if test -z "$gl_stdthreadlib_body_done"; then | |
14894 | ||
14895 | ||
14896 | case "$host_os" in | |
14897 | mingw*) | |
14898 | LIBSTDTHREAD= | |
14899 | ;; | |
14900 | *) | |
c0c3707f CB |
14901 | |
14902 | ||
5df4cba6 | 14903 | if test -z "$gl_pthreadlib_body_done"; then |
c0c3707f CB |
14904 | gl_pthread_api=no |
14905 | LIBPTHREAD= | |
14906 | LIBPMULTITHREAD= | |
14907 | # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that | |
14908 | # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY. | |
14909 | ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" | |
14910 | if test "x$ac_cv_header_pthread_h" = xyes; then : | |
14911 | gl_have_pthread_h=yes | |
14912 | else | |
14913 | gl_have_pthread_h=no | |
14914 | fi | |
6ec2e0f5 | 14915 | |
6ec2e0f5 | 14916 | |
c0c3707f CB |
14917 | if test "$gl_have_pthread_h" = yes; then |
14918 | # Other possible tests: | |
14919 | # -lpthreads (FSU threads, PCthreads) | |
14920 | # -lgthreads | |
14921 | # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist | |
14922 | # in libc. IRIX 6.5 has the first one in both libc and libpthread, but | |
14923 | # the second one only in libpthread, and lock.c needs it. | |
14924 | # | |
14925 | # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 | |
14926 | # needs -pthread for some reason. See: | |
14927 | # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html | |
14928 | save_LIBS=$LIBS | |
14929 | for gl_pthread in '' '-pthread'; do | |
14930 | LIBS="$LIBS $gl_pthread" | |
14931 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14932 | /* end confdefs.h. */ | |
14933 | #include <pthread.h> | |
14934 | pthread_mutex_t m; | |
14935 | pthread_mutexattr_t ma; | |
6ec2e0f5 | 14936 | |
c0c3707f CB |
14937 | int |
14938 | main () | |
14939 | { | |
14940 | pthread_mutex_lock (&m); | |
14941 | pthread_mutexattr_init (&ma); | |
14942 | ; | |
14943 | return 0; | |
14944 | } | |
6ec2e0f5 | 14945 | _ACEOF |
c0c3707f CB |
14946 | if ac_fn_c_try_link "$LINENO"; then : |
14947 | gl_pthread_api=yes | |
14948 | LIBPTHREAD=$gl_pthread | |
14949 | LIBPMULTITHREAD=$gl_pthread | |
6ec2e0f5 | 14950 | fi |
c0c3707f CB |
14951 | rm -f core conftest.err conftest.$ac_objext \ |
14952 | conftest$ac_exeext conftest.$ac_ext | |
14953 | LIBS=$save_LIBS | |
14954 | test $gl_pthread_api = yes && break | |
14955 | done | |
6ec2e0f5 | 14956 | |
c0c3707f CB |
14957 | # Test for libpthread by looking for pthread_kill. (Not pthread_self, |
14958 | # since it is defined as a macro on OSF/1.) | |
14959 | if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then | |
14960 | # The program links fine without libpthread. But it may actually | |
14961 | # need to link with libpthread in order to create multiple threads. | |
14962 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
14963 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
14964 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
6ec2e0f5 SDJ |
14965 | $as_echo_n "(cached) " >&6 |
14966 | else | |
c0c3707f | 14967 | ac_check_lib_save_LIBS=$LIBS |
5df4cba6 SM |
14968 | LIBS="-lpthread $LIBS" |
14969 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14970 | /* end confdefs.h. */ | |
14971 | ||
14972 | /* Override any GCC internal prototype to avoid an error. | |
14973 | Use char because int might match the return type of a GCC | |
14974 | builtin and then its argument prototype would still apply. */ | |
14975 | #ifdef __cplusplus | |
14976 | extern "C" | |
14977 | #endif | |
14978 | char pthread_kill (); | |
14979 | int | |
14980 | main () | |
14981 | { | |
14982 | return pthread_kill (); | |
14983 | ; | |
14984 | return 0; | |
14985 | } | |
14986 | _ACEOF | |
14987 | if ac_fn_c_try_link "$LINENO"; then : | |
14988 | ac_cv_lib_pthread_pthread_kill=yes | |
14989 | else | |
14990 | ac_cv_lib_pthread_pthread_kill=no | |
14991 | fi | |
14992 | rm -f core conftest.err conftest.$ac_objext \ | |
14993 | conftest$ac_exeext conftest.$ac_ext | |
14994 | LIBS=$ac_check_lib_save_LIBS | |
14995 | fi | |
14996 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 | |
14997 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
14998 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
14999 | LIBPMULTITHREAD=-lpthread | |
15000 | # On Solaris and HP-UX, most pthread functions exist also in libc. | |
15001 | # Therefore pthread_in_use() needs to actually try to create a | |
15002 | # thread: pthread_create from libc will fail, whereas | |
15003 | # pthread_create will actually create a thread. | |
15004 | # On Solaris 10 or newer, this test is no longer needed, because | |
15005 | # libc contains the fully functional pthread functions. | |
15006 | case "$host_os" in | |
15007 | solaris | solaris2.1-9 | solaris2.1-9.* | hpux*) | |
15008 | ||
15009 | $as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h | |
15010 | ||
15011 | esac | |
15012 | ||
15013 | fi | |
15014 | ||
15015 | elif test $gl_pthread_api != yes; then | |
15016 | # Some library is needed. Try libpthread and libc_r. | |
15017 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
15018 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
15019 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
15020 | $as_echo_n "(cached) " >&6 | |
15021 | else | |
15022 | ac_check_lib_save_LIBS=$LIBS | |
15023 | LIBS="-lpthread $LIBS" | |
15024 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15025 | /* end confdefs.h. */ | |
15026 | ||
15027 | /* Override any GCC internal prototype to avoid an error. | |
15028 | Use char because int might match the return type of a GCC | |
15029 | builtin and then its argument prototype would still apply. */ | |
15030 | #ifdef __cplusplus | |
15031 | extern "C" | |
15032 | #endif | |
15033 | char pthread_kill (); | |
15034 | int | |
15035 | main () | |
15036 | { | |
15037 | return pthread_kill (); | |
15038 | ; | |
15039 | return 0; | |
15040 | } | |
15041 | _ACEOF | |
15042 | if ac_fn_c_try_link "$LINENO"; then : | |
15043 | ac_cv_lib_pthread_pthread_kill=yes | |
15044 | else | |
15045 | ac_cv_lib_pthread_pthread_kill=no | |
15046 | fi | |
15047 | rm -f core conftest.err conftest.$ac_objext \ | |
15048 | conftest$ac_exeext conftest.$ac_ext | |
15049 | LIBS=$ac_check_lib_save_LIBS | |
15050 | fi | |
15051 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 | |
15052 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
15053 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
15054 | gl_pthread_api=yes | |
15055 | LIBPTHREAD=-lpthread | |
15056 | LIBPMULTITHREAD=-lpthread | |
15057 | fi | |
15058 | ||
15059 | if test $gl_pthread_api != yes; then | |
15060 | # For FreeBSD 4. | |
15061 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5 | |
15062 | $as_echo_n "checking for pthread_kill in -lc_r... " >&6; } | |
15063 | if ${ac_cv_lib_c_r_pthread_kill+:} false; then : | |
15064 | $as_echo_n "(cached) " >&6 | |
15065 | else | |
15066 | ac_check_lib_save_LIBS=$LIBS | |
15067 | LIBS="-lc_r $LIBS" | |
15068 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15069 | /* end confdefs.h. */ | |
15070 | ||
15071 | /* Override any GCC internal prototype to avoid an error. | |
15072 | Use char because int might match the return type of a GCC | |
15073 | builtin and then its argument prototype would still apply. */ | |
15074 | #ifdef __cplusplus | |
15075 | extern "C" | |
15076 | #endif | |
15077 | char pthread_kill (); | |
15078 | int | |
15079 | main () | |
15080 | { | |
15081 | return pthread_kill (); | |
15082 | ; | |
15083 | return 0; | |
15084 | } | |
15085 | _ACEOF | |
15086 | if ac_fn_c_try_link "$LINENO"; then : | |
15087 | ac_cv_lib_c_r_pthread_kill=yes | |
15088 | else | |
15089 | ac_cv_lib_c_r_pthread_kill=no | |
15090 | fi | |
15091 | rm -f core conftest.err conftest.$ac_objext \ | |
15092 | conftest$ac_exeext conftest.$ac_ext | |
15093 | LIBS=$ac_check_lib_save_LIBS | |
15094 | fi | |
15095 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5 | |
15096 | $as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; } | |
15097 | if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then : | |
15098 | gl_pthread_api=yes | |
15099 | LIBPTHREAD=-lc_r | |
15100 | LIBPMULTITHREAD=-lc_r | |
15101 | fi | |
15102 | ||
15103 | fi | |
15104 | fi | |
15105 | fi | |
15106 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 | |
15107 | $as_echo_n "checking whether POSIX threads API is available... " >&6; } | |
15108 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5 | |
15109 | $as_echo "$gl_pthread_api" >&6; } | |
15110 | ||
15111 | ||
15112 | if test $gl_pthread_api = yes; then | |
15113 | ||
15114 | $as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h | |
15115 | ||
15116 | fi | |
15117 | ||
15118 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15119 | /* end confdefs.h. */ | |
15120 | #include <sched.h> | |
15121 | int | |
15122 | main () | |
15123 | { | |
15124 | sched_yield (); | |
15125 | ; | |
15126 | return 0; | |
15127 | } | |
15128 | _ACEOF | |
15129 | if ac_fn_c_try_link "$LINENO"; then : | |
15130 | LIB_SCHED_YIELD= | |
15131 | ||
15132 | else | |
15133 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 | |
15134 | $as_echo_n "checking for sched_yield in -lrt... " >&6; } | |
15135 | if ${ac_cv_lib_rt_sched_yield+:} false; then : | |
15136 | $as_echo_n "(cached) " >&6 | |
15137 | else | |
15138 | ac_check_lib_save_LIBS=$LIBS | |
15139 | LIBS="-lrt $LIBS" | |
c0c3707f | 15140 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6ec2e0f5 | 15141 | /* end confdefs.h. */ |
6ec2e0f5 | 15142 | |
c0c3707f CB |
15143 | /* Override any GCC internal prototype to avoid an error. |
15144 | Use char because int might match the return type of a GCC | |
15145 | builtin and then its argument prototype would still apply. */ | |
15146 | #ifdef __cplusplus | |
15147 | extern "C" | |
15148 | #endif | |
5df4cba6 | 15149 | char sched_yield (); |
c0c3707f CB |
15150 | int |
15151 | main () | |
15152 | { | |
5df4cba6 | 15153 | return sched_yield (); |
c0c3707f CB |
15154 | ; |
15155 | return 0; | |
15156 | } | |
6ec2e0f5 | 15157 | _ACEOF |
c0c3707f | 15158 | if ac_fn_c_try_link "$LINENO"; then : |
5df4cba6 | 15159 | ac_cv_lib_rt_sched_yield=yes |
6ec2e0f5 | 15160 | else |
5df4cba6 | 15161 | ac_cv_lib_rt_sched_yield=no |
6ec2e0f5 | 15162 | fi |
c0c3707f CB |
15163 | rm -f core conftest.err conftest.$ac_objext \ |
15164 | conftest$ac_exeext conftest.$ac_ext | |
15165 | LIBS=$ac_check_lib_save_LIBS | |
6ec2e0f5 | 15166 | fi |
5df4cba6 SM |
15167 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 |
15168 | $as_echo "$ac_cv_lib_rt_sched_yield" >&6; } | |
15169 | if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : | |
15170 | LIB_SCHED_YIELD=-lrt | |
15171 | else | |
15172 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5 | |
15173 | $as_echo_n "checking for sched_yield in -lposix4... " >&6; } | |
15174 | if ${ac_cv_lib_posix4_sched_yield+:} false; then : | |
6ec2e0f5 SDJ |
15175 | $as_echo_n "(cached) " >&6 |
15176 | else | |
c0c3707f | 15177 | ac_check_lib_save_LIBS=$LIBS |
5df4cba6 | 15178 | LIBS="-lposix4 $LIBS" |
c0c3707f | 15179 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6ec2e0f5 SDJ |
15180 | /* end confdefs.h. */ |
15181 | ||
c0c3707f CB |
15182 | /* Override any GCC internal prototype to avoid an error. |
15183 | Use char because int might match the return type of a GCC | |
15184 | builtin and then its argument prototype would still apply. */ | |
15185 | #ifdef __cplusplus | |
15186 | extern "C" | |
15187 | #endif | |
5df4cba6 | 15188 | char sched_yield (); |
6ec2e0f5 SDJ |
15189 | int |
15190 | main () | |
15191 | { | |
5df4cba6 | 15192 | return sched_yield (); |
c0c3707f CB |
15193 | ; |
15194 | return 0; | |
15195 | } | |
15196 | _ACEOF | |
15197 | if ac_fn_c_try_link "$LINENO"; then : | |
5df4cba6 | 15198 | ac_cv_lib_posix4_sched_yield=yes |
c0c3707f | 15199 | else |
5df4cba6 | 15200 | ac_cv_lib_posix4_sched_yield=no |
c0c3707f CB |
15201 | fi |
15202 | rm -f core conftest.err conftest.$ac_objext \ | |
15203 | conftest$ac_exeext conftest.$ac_ext | |
15204 | LIBS=$ac_check_lib_save_LIBS | |
15205 | fi | |
5df4cba6 SM |
15206 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5 |
15207 | $as_echo "$ac_cv_lib_posix4_sched_yield" >&6; } | |
15208 | if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then : | |
15209 | LIB_SCHED_YIELD=-lposix4 | |
c0c3707f | 15210 | fi |
6ec2e0f5 | 15211 | |
5df4cba6 SM |
15212 | fi |
15213 | ||
15214 | ||
15215 | fi | |
15216 | rm -f core conftest.err conftest.$ac_objext \ | |
15217 | conftest$ac_exeext conftest.$ac_ext | |
15218 | ||
15219 | ||
15220 | gl_pthreadlib_body_done=done | |
15221 | fi | |
15222 | ||
15223 | if test $ac_cv_header_threads_h = yes; then | |
15224 | for ac_func in thrd_create | |
15225 | do : | |
15226 | ac_fn_c_check_func "$LINENO" "thrd_create" "ac_cv_func_thrd_create" | |
15227 | if test "x$ac_cv_func_thrd_create" = xyes; then : | |
15228 | cat >>confdefs.h <<_ACEOF | |
15229 | #define HAVE_THRD_CREATE 1 | |
15230 | _ACEOF | |
15231 | ||
15232 | fi | |
15233 | done | |
15234 | ||
15235 | if test $ac_cv_func_thrd_create = yes; then | |
15236 | LIBSTDTHREAD= | |
15237 | else | |
15238 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thrd_create in -lstdthreads" >&5 | |
15239 | $as_echo_n "checking for thrd_create in -lstdthreads... " >&6; } | |
15240 | if ${ac_cv_lib_stdthreads_thrd_create+:} false; then : | |
c0c3707f CB |
15241 | $as_echo_n "(cached) " >&6 |
15242 | else | |
15243 | ac_check_lib_save_LIBS=$LIBS | |
5df4cba6 | 15244 | LIBS="-lstdthreads $LIBS" |
c0c3707f CB |
15245 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
15246 | /* end confdefs.h. */ | |
6ec2e0f5 | 15247 | |
c0c3707f CB |
15248 | /* Override any GCC internal prototype to avoid an error. |
15249 | Use char because int might match the return type of a GCC | |
15250 | builtin and then its argument prototype would still apply. */ | |
15251 | #ifdef __cplusplus | |
15252 | extern "C" | |
15253 | #endif | |
5df4cba6 | 15254 | char thrd_create (); |
c0c3707f CB |
15255 | int |
15256 | main () | |
15257 | { | |
5df4cba6 | 15258 | return thrd_create (); |
6ec2e0f5 SDJ |
15259 | ; |
15260 | return 0; | |
15261 | } | |
15262 | _ACEOF | |
c0c3707f | 15263 | if ac_fn_c_try_link "$LINENO"; then : |
5df4cba6 | 15264 | ac_cv_lib_stdthreads_thrd_create=yes |
6ec2e0f5 | 15265 | else |
5df4cba6 | 15266 | ac_cv_lib_stdthreads_thrd_create=no |
6ec2e0f5 | 15267 | fi |
c0c3707f CB |
15268 | rm -f core conftest.err conftest.$ac_objext \ |
15269 | conftest$ac_exeext conftest.$ac_ext | |
15270 | LIBS=$ac_check_lib_save_LIBS | |
15271 | fi | |
5df4cba6 SM |
15272 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdthreads_thrd_create" >&5 |
15273 | $as_echo "$ac_cv_lib_stdthreads_thrd_create" >&6; } | |
15274 | if test "x$ac_cv_lib_stdthreads_thrd_create" = xyes; then : | |
6ec2e0f5 | 15275 | |
5df4cba6 | 15276 | LIBSTDTHREAD='-lstdthreads -lpthread' |
6ec2e0f5 | 15277 | |
5df4cba6 | 15278 | else |
6ec2e0f5 | 15279 | |
5df4cba6 | 15280 | LIBSTDTHREAD="$LIBPMULTITHREAD" |
6ec2e0f5 | 15281 | |
5df4cba6 | 15282 | fi |
6ec2e0f5 | 15283 | |
5df4cba6 | 15284 | fi |
c0c3707f | 15285 | else |
5df4cba6 SM |
15286 | LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD" |
15287 | fi | |
15288 | ;; | |
15289 | esac | |
c0c3707f | 15290 | |
c0c3707f | 15291 | |
5df4cba6 SM |
15292 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ISO C threads API is available" >&5 |
15293 | $as_echo_n "checking whether ISO C threads API is available... " >&6; } | |
15294 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_threads_h" >&5 | |
15295 | $as_echo "$ac_cv_header_threads_h" >&6; } | |
15296 | gl_stdthreadlib_body_done=done | |
15297 | fi | |
c0c3707f | 15298 | |
5df4cba6 SM |
15299 | LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD |
15300 | LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD | |
c0c3707f CB |
15301 | gl_threads_api=isoc |
15302 | ||
15303 | $as_echo "#define USE_ISOC_THREADS 1" >>confdefs.h | |
15304 | ||
15305 | fi | |
15306 | fi | |
15307 | if test $gl_threads_api = none; then | |
15308 | case "$gl_use_threads" in | |
15309 | yes | windows | win32) # The 'win32' is for backward compatibility. | |
15310 | if { case "$host_os" in | |
15311 | mingw*) true;; | |
15312 | *) false;; | |
15313 | esac | |
15314 | }; then | |
15315 | gl_threads_api=windows | |
15316 | ||
15317 | $as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h | |
15318 | ||
15319 | fi | |
15320 | ;; | |
15321 | esac | |
15322 | fi | |
15323 | fi | |
15324 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5 | |
15325 | $as_echo_n "checking for multithread API to use... " >&6; } | |
15326 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5 | |
15327 | $as_echo "$gl_threads_api" >&6; } | |
15328 | ||
15329 | ||
15330 | ||
15331 | ||
15332 | ||
15333 | ||
15334 | ||
15335 | ||
15336 | ||
15337 | ||
15338 | ||
15339 | ||
15340 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5 | |
15341 | $as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } | |
15342 | if ${gl_cv_func_malloc_posix+:} false; then : | |
6ec2e0f5 SDJ |
15343 | $as_echo_n "(cached) " >&6 |
15344 | else | |
c0c3707f CB |
15345 | |
15346 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 15347 | /* end confdefs.h. */ |
c0c3707f | 15348 | |
6ec2e0f5 SDJ |
15349 | int |
15350 | main () | |
15351 | { | |
c0c3707f CB |
15352 | #if defined _WIN32 && ! defined __CYGWIN__ |
15353 | choke me | |
15354 | #endif | |
6ec2e0f5 SDJ |
15355 | |
15356 | ; | |
15357 | return 0; | |
15358 | } | |
15359 | _ACEOF | |
15360 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 15361 | gl_cv_func_malloc_posix=yes |
6ec2e0f5 | 15362 | else |
c0c3707f | 15363 | gl_cv_func_malloc_posix=no |
6ec2e0f5 SDJ |
15364 | fi |
15365 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
472fa5ee | 15366 | |
c0c3707f CB |
15367 | fi |
15368 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5 | |
15369 | $as_echo "$gl_cv_func_malloc_posix" >&6; } | |
472fa5ee SM |
15370 | |
15371 | ||
6ec2e0f5 | 15372 | |
9c9d63b1 | 15373 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 |
c0c3707f CB |
15374 | $as_echo_n "checking for GNU libc compatible malloc... " >&6; } |
15375 | if ${ac_cv_func_malloc_0_nonnull+:} false; then : | |
6ec2e0f5 SDJ |
15376 | $as_echo_n "(cached) " >&6 |
15377 | else | |
15378 | if test "$cross_compiling" = yes; then : | |
15379 | case "$host_os" in | |
c0c3707f CB |
15380 | # Guess yes on platforms where we know the result. |
15381 | *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \ | |
15382 | | hpux* | solaris* | cygwin* | mingw*) | |
15383 | ac_cv_func_malloc_0_nonnull="guessing yes" ;; | |
15384 | # If we don't know, obey --enable-cross-guesses. | |
15385 | *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;; | |
15386 | esac | |
6ec2e0f5 SDJ |
15387 | |
15388 | else | |
15389 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15390 | /* end confdefs.h. */ | |
9c9d63b1 | 15391 | #include <stdlib.h> |
6ec2e0f5 SDJ |
15392 | |
15393 | int | |
15394 | main () | |
15395 | { | |
c0c3707f CB |
15396 | char *p = malloc (0); |
15397 | int result = !p; | |
15398 | free (p); | |
15399 | return result; | |
6ec2e0f5 SDJ |
15400 | ; |
15401 | return 0; | |
698be2d8 CB |
15402 | } |
15403 | ||
15404 | _ACEOF | |
15405 | if ac_fn_c_try_run "$LINENO"; then : | |
15406 | ac_cv_func_malloc_0_nonnull=yes | |
15407 | else | |
15408 | ac_cv_func_malloc_0_nonnull=no | |
15409 | fi | |
15410 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
15411 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
15412 | fi | |
15413 | ||
15414 | ||
15415 | fi | |
15416 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 | |
15417 | $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } | |
15418 | case "$ac_cv_func_malloc_0_nonnull" in | |
15419 | *yes) | |
15420 | gl_cv_func_malloc_0_nonnull=1 | |
15421 | ;; | |
15422 | *) | |
15423 | gl_cv_func_malloc_0_nonnull=0 | |
15424 | ;; | |
15425 | esac | |
15426 | ||
15427 | ||
15428 | cat >>confdefs.h <<_ACEOF | |
15429 | #define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull | |
15430 | _ACEOF | |
15431 | ||
15432 | ||
15433 | ||
c0c3707f CB |
15434 | |
15435 | ||
6ec2e0f5 SDJ |
15436 | |
15437 | ||
15438 | ||
15439 | ||
15440 | ||
15441 | ||
c0c3707f CB |
15442 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 |
15443 | $as_echo_n "checking for a traditional japanese locale... " >&6; } | |
15444 | if ${gt_cv_locale_ja+:} false; then : | |
15445 | $as_echo_n "(cached) " >&6 | |
15446 | else | |
15447 | ||
15448 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15449 | /* end confdefs.h. */ | |
6ec2e0f5 | 15450 | |
c0c3707f CB |
15451 | #include <locale.h> |
15452 | #include <time.h> | |
15453 | #if HAVE_LANGINFO_CODESET | |
15454 | # include <langinfo.h> | |
15455 | #endif | |
15456 | #include <stdlib.h> | |
15457 | #include <string.h> | |
15458 | struct tm t; | |
15459 | char buf[16]; | |
15460 | int main () | |
15461 | { | |
15462 | /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl | |
15463 | imitates locale dependent behaviour by looking at the environment | |
15464 | variables, and all locales use the UTF-8 encoding. */ | |
15465 | #if defined __BEOS__ || defined __HAIKU__ | |
15466 | return 1; | |
15467 | #else | |
15468 | /* Check whether the given locale name is recognized by the system. */ | |
15469 | # if defined _WIN32 && !defined __CYGWIN__ | |
15470 | /* On native Windows, setlocale(category, "") looks at the system settings, | |
15471 | not at the environment variables. Also, when an encoding suffix such | |
15472 | as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE | |
15473 | category of the locale to "C". */ | |
15474 | if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL | |
15475 | || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) | |
15476 | return 1; | |
15477 | # else | |
15478 | if (setlocale (LC_ALL, "") == NULL) return 1; | |
15479 | # endif | |
15480 | /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". | |
15481 | On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) | |
15482 | is empty, and the behaviour of Tcl 8.4 in this locale is not useful. | |
15483 | On OpenBSD 4.0, when an unsupported locale is specified, setlocale() | |
15484 | succeeds but then nl_langinfo(CODESET) is "646". In this situation, | |
15485 | some unit tests fail. | |
15486 | On MirBSD 10, when an unsupported locale is specified, setlocale() | |
15487 | succeeds but then nl_langinfo(CODESET) is "UTF-8". */ | |
15488 | # if HAVE_LANGINFO_CODESET | |
15489 | { | |
15490 | const char *cs = nl_langinfo (CODESET); | |
15491 | if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 | |
15492 | || strcmp (cs, "UTF-8") == 0) | |
15493 | return 1; | |
15494 | } | |
15495 | # endif | |
15496 | # ifdef __CYGWIN__ | |
15497 | /* On Cygwin, avoid locale names without encoding suffix, because the | |
15498 | locale_charset() function relies on the encoding suffix. Note that | |
15499 | LC_ALL is set on the command line. */ | |
15500 | if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; | |
15501 | # endif | |
15502 | /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales | |
15503 | on Cygwin 1.5.x. */ | |
15504 | if (MB_CUR_MAX == 1) | |
15505 | return 1; | |
15506 | /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. | |
15507 | This excludes the UTF-8 encoding (except on MirBSD). */ | |
15508 | { | |
15509 | const char *p; | |
15510 | t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; | |
15511 | if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; | |
15512 | for (p = buf; *p != '\0'; p++) | |
15513 | if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) | |
15514 | return 1; | |
15515 | } | |
15516 | return 0; | |
15517 | #endif | |
15518 | } | |
6ec2e0f5 | 15519 | |
c0c3707f CB |
15520 | _ACEOF |
15521 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 | |
15522 | (eval $ac_link) 2>&5 | |
15523 | ac_status=$? | |
15524 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
15525 | test $ac_status = 0; } && test -s conftest$ac_exeext; then | |
15526 | case "$host_os" in | |
15527 | # Handle native Windows specially, because there setlocale() interprets | |
15528 | # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", | |
15529 | # "fr" or "fra" as "French" or "French_France.1252", | |
15530 | # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", | |
15531 | # "ja" as "Japanese" or "Japanese_Japan.932", | |
15532 | # and similar. | |
15533 | mingw*) | |
15534 | # Note that on native Windows, the Japanese locale is | |
15535 | # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we | |
15536 | # cannot use it here. | |
15537 | gt_cv_locale_ja=none | |
15538 | ;; | |
15539 | *) | |
15540 | # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because | |
15541 | # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the | |
15542 | # configure script would override the LC_ALL setting. Likewise for | |
15543 | # LC_CTYPE, which is also set at the beginning of the configure script. | |
15544 | # Test for the AIX locale name. | |
15545 | if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15546 | gt_cv_locale_ja=ja_JP | |
15547 | else | |
15548 | # Test for the locale name with explicit encoding suffix. | |
15549 | if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15550 | gt_cv_locale_ja=ja_JP.EUC-JP | |
15551 | else | |
15552 | # Test for the HP-UX, OSF/1, NetBSD locale name. | |
15553 | if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15554 | gt_cv_locale_ja=ja_JP.eucJP | |
15555 | else | |
15556 | # Test for the IRIX, FreeBSD locale name. | |
15557 | if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15558 | gt_cv_locale_ja=ja_JP.EUC | |
15559 | else | |
15560 | # Test for the Solaris 7 locale name. | |
15561 | if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15562 | gt_cv_locale_ja=ja | |
15563 | else | |
15564 | # Special test for NetBSD 1.6. | |
15565 | if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then | |
15566 | gt_cv_locale_ja=ja_JP.eucJP | |
15567 | else | |
15568 | # None found. | |
15569 | gt_cv_locale_ja=none | |
15570 | fi | |
15571 | fi | |
15572 | fi | |
15573 | fi | |
15574 | fi | |
15575 | fi | |
15576 | ;; | |
15577 | esac | |
15578 | fi | |
15579 | rm -fr conftest* | |
5abebf3c CB |
15580 | |
15581 | fi | |
c0c3707f CB |
15582 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 |
15583 | $as_echo "$gt_cv_locale_ja" >&6; } | |
15584 | LOCALE_JA=$gt_cv_locale_ja | |
5abebf3c | 15585 | |
5abebf3c | 15586 | |
5abebf3c | 15587 | |
5abebf3c | 15588 | |
c0c3707f CB |
15589 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 |
15590 | $as_echo_n "checking for a french Unicode locale... " >&6; } | |
15591 | if ${gt_cv_locale_fr_utf8+:} false; then : | |
5abebf3c CB |
15592 | $as_echo_n "(cached) " >&6 |
15593 | else | |
5abebf3c | 15594 | |
c0c3707f | 15595 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5abebf3c | 15596 | /* end confdefs.h. */ |
5abebf3c | 15597 | |
c0c3707f CB |
15598 | #include <locale.h> |
15599 | #include <time.h> | |
15600 | #if HAVE_LANGINFO_CODESET | |
15601 | # include <langinfo.h> | |
15602 | #endif | |
15603 | #include <stdlib.h> | |
15604 | #include <string.h> | |
15605 | struct tm t; | |
15606 | char buf[16]; | |
15607 | int main () { | |
15608 | /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl | |
15609 | imitates locale dependent behaviour by looking at the environment | |
15610 | variables, and all locales use the UTF-8 encoding. */ | |
15611 | #if !(defined __BEOS__ || defined __HAIKU__) | |
15612 | /* Check whether the given locale name is recognized by the system. */ | |
15613 | # if defined _WIN32 && !defined __CYGWIN__ | |
15614 | /* On native Windows, setlocale(category, "") looks at the system settings, | |
15615 | not at the environment variables. Also, when an encoding suffix such | |
15616 | as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE | |
15617 | category of the locale to "C". */ | |
15618 | if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL | |
15619 | || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) | |
15620 | return 1; | |
15621 | # else | |
15622 | if (setlocale (LC_ALL, "") == NULL) return 1; | |
15623 | # endif | |
15624 | /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". | |
15625 | On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) | |
15626 | is empty, and the behaviour of Tcl 8.4 in this locale is not useful. | |
15627 | On OpenBSD 4.0, when an unsupported locale is specified, setlocale() | |
15628 | succeeds but then nl_langinfo(CODESET) is "646". In this situation, | |
15629 | some unit tests fail. */ | |
15630 | # if HAVE_LANGINFO_CODESET | |
15631 | { | |
15632 | const char *cs = nl_langinfo (CODESET); | |
15633 | if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) | |
15634 | return 1; | |
15635 | } | |
15636 | # endif | |
15637 | # ifdef __CYGWIN__ | |
15638 | /* On Cygwin, avoid locale names without encoding suffix, because the | |
15639 | locale_charset() function relies on the encoding suffix. Note that | |
15640 | LC_ALL is set on the command line. */ | |
15641 | if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; | |
15642 | # endif | |
15643 | /* Check whether in the abbreviation of the second month, the second | |
15644 | character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is | |
15645 | two bytes long, with UTF-8 encoding. */ | |
15646 | t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; | |
15647 | if (strftime (buf, sizeof (buf), "%b", &t) < 4 | |
15648 | || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') | |
15649 | return 1; | |
15650 | #endif | |
15651 | #if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ | |
15652 | /* Check whether the decimal separator is a comma. | |
15653 | On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point | |
15654 | are nl_langinfo(RADIXCHAR) are both ".". */ | |
15655 | if (localeconv () ->decimal_point[0] != ',') return 1; | |
15656 | #endif | |
5abebf3c CB |
15657 | return 0; |
15658 | } | |
5abebf3c | 15659 | |
c0c3707f CB |
15660 | _ACEOF |
15661 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 | |
15662 | (eval $ac_link) 2>&5 | |
15663 | ac_status=$? | |
15664 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
15665 | test $ac_status = 0; } && test -s conftest$ac_exeext; then | |
15666 | case "$host_os" in | |
15667 | # Handle native Windows specially, because there setlocale() interprets | |
15668 | # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", | |
15669 | # "fr" or "fra" as "French" or "French_France.1252", | |
15670 | # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", | |
15671 | # "ja" as "Japanese" or "Japanese_Japan.932", | |
15672 | # and similar. | |
15673 | mingw*) | |
15674 | # Test for the hypothetical native Windows locale name. | |
15675 | if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15676 | gt_cv_locale_fr_utf8=French_France.65001 | |
15677 | else | |
15678 | # None found. | |
15679 | gt_cv_locale_fr_utf8=none | |
15680 | fi | |
15681 | ;; | |
15682 | *) | |
15683 | # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because | |
15684 | # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the | |
15685 | # configure script would override the LC_ALL setting. Likewise for | |
15686 | # LC_CTYPE, which is also set at the beginning of the configure script. | |
15687 | # Test for the usual locale name. | |
15688 | if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15689 | gt_cv_locale_fr_utf8=fr_FR | |
15690 | else | |
15691 | # Test for the locale name with explicit encoding suffix. | |
15692 | if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15693 | gt_cv_locale_fr_utf8=fr_FR.UTF-8 | |
15694 | else | |
15695 | # Test for the Solaris 7 locale name. | |
15696 | if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15697 | gt_cv_locale_fr_utf8=fr.UTF-8 | |
15698 | else | |
15699 | # None found. | |
15700 | gt_cv_locale_fr_utf8=none | |
15701 | fi | |
15702 | fi | |
15703 | fi | |
15704 | ;; | |
15705 | esac | |
15706 | fi | |
15707 | rm -fr conftest* | |
5abebf3c CB |
15708 | |
15709 | fi | |
c0c3707f CB |
15710 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 |
15711 | $as_echo "$gt_cv_locale_fr_utf8" >&6; } | |
15712 | LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 | |
5abebf3c CB |
15713 | |
15714 | ||
15715 | ||
15716 | ||
15717 | ||
c0c3707f CB |
15718 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 |
15719 | $as_echo_n "checking for a transitional chinese locale... " >&6; } | |
15720 | if ${gt_cv_locale_zh_CN+:} false; then : | |
5abebf3c CB |
15721 | $as_echo_n "(cached) " >&6 |
15722 | else | |
5abebf3c | 15723 | |
c0c3707f | 15724 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5abebf3c | 15725 | /* end confdefs.h. */ |
5abebf3c | 15726 | |
c0c3707f CB |
15727 | #include <locale.h> |
15728 | #include <stdlib.h> | |
15729 | #include <time.h> | |
15730 | #if HAVE_LANGINFO_CODESET | |
15731 | # include <langinfo.h> | |
15732 | #endif | |
15733 | #include <stdlib.h> | |
15734 | #include <string.h> | |
15735 | struct tm t; | |
15736 | char buf[16]; | |
15737 | int main () | |
5abebf3c | 15738 | { |
c0c3707f CB |
15739 | /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl |
15740 | imitates locale dependent behaviour by looking at the environment | |
15741 | variables, and all locales use the UTF-8 encoding. */ | |
15742 | #if defined __BEOS__ || defined __HAIKU__ | |
15743 | return 1; | |
15744 | #else | |
15745 | /* Check whether the given locale name is recognized by the system. */ | |
15746 | # if defined _WIN32 && !defined __CYGWIN__ | |
15747 | /* On native Windows, setlocale(category, "") looks at the system settings, | |
15748 | not at the environment variables. Also, when an encoding suffix such | |
15749 | as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE | |
15750 | category of the locale to "C". */ | |
15751 | if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL | |
15752 | || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) | |
15753 | return 1; | |
15754 | # else | |
15755 | if (setlocale (LC_ALL, "") == NULL) return 1; | |
15756 | # endif | |
15757 | /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". | |
15758 | On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) | |
15759 | is empty, and the behaviour of Tcl 8.4 in this locale is not useful. | |
15760 | On OpenBSD 4.0, when an unsupported locale is specified, setlocale() | |
15761 | succeeds but then nl_langinfo(CODESET) is "646". In this situation, | |
15762 | some unit tests fail. | |
15763 | On MirBSD 10, when an unsupported locale is specified, setlocale() | |
15764 | succeeds but then nl_langinfo(CODESET) is "UTF-8". */ | |
15765 | # if HAVE_LANGINFO_CODESET | |
15766 | { | |
15767 | const char *cs = nl_langinfo (CODESET); | |
15768 | if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 | |
15769 | || strcmp (cs, "UTF-8") == 0) | |
15770 | return 1; | |
15771 | } | |
15772 | # endif | |
15773 | # ifdef __CYGWIN__ | |
15774 | /* On Cygwin, avoid locale names without encoding suffix, because the | |
15775 | locale_charset() function relies on the encoding suffix. Note that | |
15776 | LC_ALL is set on the command line. */ | |
15777 | if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; | |
15778 | # endif | |
15779 | /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. | |
15780 | This excludes the UTF-8 encoding (except on MirBSD). */ | |
15781 | { | |
15782 | const char *p; | |
15783 | t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; | |
15784 | if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; | |
15785 | for (p = buf; *p != '\0'; p++) | |
15786 | if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) | |
15787 | return 1; | |
15788 | } | |
15789 | /* Check whether a typical GB18030 multibyte sequence is recognized as a | |
15790 | single wide character. This excludes the GB2312 and GBK encodings. */ | |
15791 | if (mblen ("\203\062\332\066", 5) != 4) | |
15792 | return 1; | |
5abebf3c | 15793 | return 0; |
c0c3707f | 15794 | #endif |
5abebf3c | 15795 | } |
c0c3707f | 15796 | |
5abebf3c | 15797 | _ACEOF |
c0c3707f CB |
15798 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 |
15799 | (eval $ac_link) 2>&5 | |
15800 | ac_status=$? | |
15801 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
15802 | test $ac_status = 0; } && test -s conftest$ac_exeext; then | |
15803 | case "$host_os" in | |
15804 | # Handle native Windows specially, because there setlocale() interprets | |
15805 | # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", | |
15806 | # "fr" or "fra" as "French" or "French_France.1252", | |
15807 | # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", | |
15808 | # "ja" as "Japanese" or "Japanese_Japan.932", | |
15809 | # and similar. | |
15810 | mingw*) | |
15811 | # Test for the hypothetical native Windows locale name. | |
15812 | if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15813 | gt_cv_locale_zh_CN=Chinese_China.54936 | |
15814 | else | |
15815 | # None found. | |
15816 | gt_cv_locale_zh_CN=none | |
15817 | fi | |
15818 | ;; | |
15819 | solaris2.8) | |
15820 | # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are | |
15821 | # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. | |
15822 | # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. | |
15823 | gt_cv_locale_zh_CN=none | |
15824 | ;; | |
15825 | *) | |
15826 | # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because | |
15827 | # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the | |
15828 | # configure script would override the LC_ALL setting. Likewise for | |
15829 | # LC_CTYPE, which is also set at the beginning of the configure script. | |
15830 | # Test for the locale name without encoding suffix. | |
15831 | if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15832 | gt_cv_locale_zh_CN=zh_CN | |
15833 | else | |
15834 | # Test for the locale name with explicit encoding suffix. | |
15835 | if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15836 | gt_cv_locale_zh_CN=zh_CN.GB18030 | |
15837 | else | |
15838 | # None found. | |
15839 | gt_cv_locale_zh_CN=none | |
15840 | fi | |
15841 | fi | |
15842 | ;; | |
15843 | esac | |
15844 | else | |
15845 | # If there was a link error, due to mblen(), the system is so old that | |
15846 | # it certainly doesn't have a chinese locale. | |
15847 | gt_cv_locale_zh_CN=none | |
15848 | fi | |
15849 | rm -fr conftest* | |
15850 | ||
5abebf3c | 15851 | fi |
c0c3707f CB |
15852 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 |
15853 | $as_echo "$gt_cv_locale_zh_CN" >&6; } | |
15854 | LOCALE_ZH_CN=$gt_cv_locale_zh_CN | |
15855 | ||
15856 | ||
15857 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 | |
15858 | $as_echo_n "checking for inline... " >&6; } | |
15859 | if ${ac_cv_c_inline+:} false; then : | |
15860 | $as_echo_n "(cached) " >&6 | |
15861 | else | |
15862 | ac_cv_c_inline=no | |
15863 | for ac_kw in inline __inline__ __inline; do | |
15864 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15865 | /* end confdefs.h. */ | |
15866 | #ifndef __cplusplus | |
15867 | typedef int foo_t; | |
15868 | static $ac_kw foo_t static_foo () {return 0; } | |
15869 | $ac_kw foo_t foo () {return 0; } | |
15870 | #endif | |
5abebf3c | 15871 | |
c0c3707f CB |
15872 | _ACEOF |
15873 | if ac_fn_c_try_compile "$LINENO"; then : | |
15874 | ac_cv_c_inline=$ac_kw | |
15875 | fi | |
15876 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
15877 | test "$ac_cv_c_inline" != no && break | |
15878 | done | |
5abebf3c CB |
15879 | |
15880 | fi | |
c0c3707f CB |
15881 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 |
15882 | $as_echo "$ac_cv_c_inline" >&6; } | |
5abebf3c | 15883 | |
c0c3707f CB |
15884 | case $ac_cv_c_inline in |
15885 | inline | yes) ;; | |
15886 | *) | |
15887 | case $ac_cv_c_inline in | |
15888 | no) ac_val=;; | |
15889 | *) ac_val=$ac_cv_c_inline;; | |
15890 | esac | |
15891 | cat >>confdefs.h <<_ACEOF | |
15892 | #ifndef __cplusplus | |
15893 | #define inline $ac_val | |
15894 | #endif | |
15895 | _ACEOF | |
15896 | ;; | |
15897 | esac | |
5abebf3c CB |
15898 | |
15899 | ||
15900 | ||
15901 | ||
5abebf3c CB |
15902 | |
15903 | ||
c0c3707f CB |
15904 | GNULIB_EXPLICIT_BZERO=0; |
15905 | GNULIB_FFSL=0; | |
15906 | GNULIB_FFSLL=0; | |
15907 | GNULIB_MEMCHR=0; | |
15908 | GNULIB_MEMMEM=0; | |
15909 | GNULIB_MEMPCPY=0; | |
15910 | GNULIB_MEMRCHR=0; | |
15911 | GNULIB_RAWMEMCHR=0; | |
15912 | GNULIB_STPCPY=0; | |
15913 | GNULIB_STPNCPY=0; | |
15914 | GNULIB_STRCHRNUL=0; | |
15915 | GNULIB_STRDUP=0; | |
15916 | GNULIB_STRNCAT=0; | |
15917 | GNULIB_STRNDUP=0; | |
15918 | GNULIB_STRNLEN=0; | |
15919 | GNULIB_STRPBRK=0; | |
15920 | GNULIB_STRSEP=0; | |
15921 | GNULIB_STRSTR=0; | |
15922 | GNULIB_STRCASESTR=0; | |
15923 | GNULIB_STRTOK_R=0; | |
15924 | GNULIB_MBSLEN=0; | |
15925 | GNULIB_MBSNLEN=0; | |
15926 | GNULIB_MBSCHR=0; | |
15927 | GNULIB_MBSRCHR=0; | |
15928 | GNULIB_MBSSTR=0; | |
15929 | GNULIB_MBSCASECMP=0; | |
15930 | GNULIB_MBSNCASECMP=0; | |
15931 | GNULIB_MBSPCASECMP=0; | |
15932 | GNULIB_MBSCASESTR=0; | |
15933 | GNULIB_MBSCSPN=0; | |
15934 | GNULIB_MBSPBRK=0; | |
15935 | GNULIB_MBSSPN=0; | |
15936 | GNULIB_MBSSEP=0; | |
15937 | GNULIB_MBSTOK_R=0; | |
15938 | GNULIB_STRERROR=0; | |
15939 | GNULIB_STRERROR_R=0; | |
9c9d63b1 PM |
15940 | GNULIB_STRERRORNAME_NP=0; |
15941 | GNULIB_SIGABBREV_NP=0; | |
15942 | GNULIB_SIGDESCR_NP=0; | |
c0c3707f CB |
15943 | GNULIB_STRSIGNAL=0; |
15944 | GNULIB_STRVERSCMP=0; | |
15945 | HAVE_MBSLEN=0; | |
9c9d63b1 PM |
15946 | GNULIB_MDA_MEMCCPY=1; |
15947 | GNULIB_MDA_STRDUP=1; | |
c0c3707f CB |
15948 | HAVE_EXPLICIT_BZERO=1; |
15949 | HAVE_FFSL=1; | |
15950 | HAVE_FFSLL=1; | |
c0c3707f CB |
15951 | HAVE_DECL_MEMMEM=1; |
15952 | HAVE_MEMPCPY=1; | |
15953 | HAVE_DECL_MEMRCHR=1; | |
15954 | HAVE_RAWMEMCHR=1; | |
15955 | HAVE_STPCPY=1; | |
15956 | HAVE_STPNCPY=1; | |
15957 | HAVE_STRCHRNUL=1; | |
15958 | HAVE_DECL_STRDUP=1; | |
15959 | HAVE_DECL_STRNDUP=1; | |
15960 | HAVE_DECL_STRNLEN=1; | |
15961 | HAVE_STRPBRK=1; | |
15962 | HAVE_STRSEP=1; | |
15963 | HAVE_STRCASESTR=1; | |
15964 | HAVE_DECL_STRTOK_R=1; | |
15965 | HAVE_DECL_STRERROR_R=1; | |
9c9d63b1 PM |
15966 | HAVE_STRERRORNAME_NP=1; |
15967 | HAVE_SIGABBREV_NP=1; | |
15968 | HAVE_SIGDESCR_NP=1; | |
c0c3707f CB |
15969 | HAVE_DECL_STRSIGNAL=1; |
15970 | HAVE_STRVERSCMP=1; | |
9c9d63b1 | 15971 | REPLACE_FFSLL=0; |
c0c3707f CB |
15972 | REPLACE_MEMCHR=0; |
15973 | REPLACE_MEMMEM=0; | |
15974 | REPLACE_STPNCPY=0; | |
15975 | REPLACE_STRCHRNUL=0; | |
15976 | REPLACE_STRDUP=0; | |
15977 | REPLACE_STRNCAT=0; | |
15978 | REPLACE_STRNDUP=0; | |
15979 | REPLACE_STRNLEN=0; | |
15980 | REPLACE_STRSTR=0; | |
15981 | REPLACE_STRCASESTR=0; | |
15982 | REPLACE_STRTOK_R=0; | |
15983 | REPLACE_STRERROR=0; | |
15984 | REPLACE_STRERROR_R=0; | |
9c9d63b1 | 15985 | REPLACE_STRERRORNAME_NP=0; |
c0c3707f CB |
15986 | REPLACE_STRSIGNAL=0; |
15987 | UNDEFINE_STRTOK_R=0; | |
5abebf3c CB |
15988 | |
15989 | ||
15990 | ||
15991 | ||
6ec2e0f5 SDJ |
15992 | |
15993 | ||
c0c3707f CB |
15994 | # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it |
15995 | # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is | |
15996 | # irrelevant for anonymous mappings. | |
15997 | ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" | |
15998 | if test "x$ac_cv_func_mmap" = xyes; then : | |
15999 | gl_have_mmap=yes | |
6ec2e0f5 | 16000 | else |
c0c3707f CB |
16001 | gl_have_mmap=no |
16002 | fi | |
6ec2e0f5 SDJ |
16003 | |
16004 | ||
c0c3707f CB |
16005 | # Try to allow MAP_ANONYMOUS. |
16006 | gl_have_mmap_anonymous=no | |
16007 | if test $gl_have_mmap = yes; then | |
16008 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 | |
16009 | $as_echo_n "checking for MAP_ANONYMOUS... " >&6; } | |
16010 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 16011 | /* end confdefs.h. */ |
6ec2e0f5 | 16012 | |
c0c3707f CB |
16013 | #include <sys/mman.h> |
16014 | #ifdef MAP_ANONYMOUS | |
16015 | I cannot identify this map | |
16016 | #endif | |
6ec2e0f5 | 16017 | |
c0c3707f CB |
16018 | _ACEOF |
16019 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
16020 | $EGREP "I cannot identify this map" >/dev/null 2>&1; then : | |
16021 | gl_have_mmap_anonymous=yes | |
6ec2e0f5 | 16022 | fi |
c0c3707f | 16023 | rm -f conftest* |
6ec2e0f5 | 16024 | |
c0c3707f CB |
16025 | if test $gl_have_mmap_anonymous != yes; then |
16026 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16027 | /* end confdefs.h. */ | |
6ec2e0f5 | 16028 | |
c0c3707f CB |
16029 | #include <sys/mman.h> |
16030 | #ifdef MAP_ANON | |
16031 | I cannot identify this map | |
16032 | #endif | |
6ec2e0f5 | 16033 | |
c0c3707f CB |
16034 | _ACEOF |
16035 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
16036 | $EGREP "I cannot identify this map" >/dev/null 2>&1; then : | |
6ec2e0f5 | 16037 | |
c0c3707f | 16038 | $as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h |
5e8754f9 | 16039 | |
c0c3707f | 16040 | gl_have_mmap_anonymous=yes |
5e8754f9 | 16041 | fi |
c0c3707f CB |
16042 | rm -f conftest* |
16043 | ||
16044 | fi | |
16045 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 | |
16046 | $as_echo "$gl_have_mmap_anonymous" >&6; } | |
16047 | if test $gl_have_mmap_anonymous = yes; then | |
6ec2e0f5 | 16048 | |
c0c3707f | 16049 | $as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h |
6ec2e0f5 | 16050 | |
c0c3707f CB |
16051 | fi |
16052 | fi | |
6ec2e0f5 SDJ |
16053 | |
16054 | ||
16055 | ||
16056 | ||
6ec2e0f5 | 16057 | |
9c9d63b1 PM |
16058 | # Detect platform-specific bugs in some versions of glibc: |
16059 | # memchr should not dereference anything with length 0 | |
16060 | # https://bugzilla.redhat.com/show_bug.cgi?id=499689 | |
16061 | # memchr should not dereference overestimated length after a match | |
16062 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 | |
16063 | # https://sourceware.org/bugzilla/show_bug.cgi?id=10162 | |
16064 | # memchr should cast the second argument to 'unsigned char'. | |
16065 | # This bug exists in Android 4.3. | |
16066 | # Assume that memchr works on platforms that lack mprotect. | |
16067 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5 | |
c0c3707f CB |
16068 | $as_echo_n "checking whether memchr works... " >&6; } |
16069 | if ${gl_cv_func_memchr_works+:} false; then : | |
16070 | $as_echo_n "(cached) " >&6 | |
6ec2e0f5 | 16071 | else |
c0c3707f CB |
16072 | if test "$cross_compiling" = yes; then : |
16073 | case "$host_os" in | |
9c9d63b1 PM |
16074 | # Guess no on Android. |
16075 | linux*-android*) gl_cv_func_memchr_works="guessing no" ;; | |
16076 | # Guess yes on native Windows. | |
16077 | mingw*) gl_cv_func_memchr_works="guessing yes" ;; | |
16078 | # If we don't know, obey --enable-cross-guesses. | |
16079 | *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;; | |
16080 | esac | |
6ec2e0f5 SDJ |
16081 | |
16082 | else | |
16083 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16084 | /* end confdefs.h. */ | |
16085 | ||
c0c3707f CB |
16086 | #include <string.h> |
16087 | #if HAVE_SYS_MMAN_H | |
16088 | # include <fcntl.h> | |
16089 | # include <unistd.h> | |
16090 | # include <sys/types.h> | |
16091 | # include <sys/mman.h> | |
16092 | # ifndef MAP_FILE | |
16093 | # define MAP_FILE 0 | |
16094 | # endif | |
16095 | #endif | |
6ec2e0f5 SDJ |
16096 | |
16097 | int | |
16098 | main () | |
16099 | { | |
c0c3707f CB |
16100 | |
16101 | int result = 0; | |
16102 | char *fence = NULL; | |
16103 | #if HAVE_SYS_MMAN_H && HAVE_MPROTECT | |
16104 | # if HAVE_MAP_ANONYMOUS | |
16105 | const int flags = MAP_ANONYMOUS | MAP_PRIVATE; | |
16106 | const int fd = -1; | |
16107 | # else /* !HAVE_MAP_ANONYMOUS */ | |
16108 | const int flags = MAP_FILE | MAP_PRIVATE; | |
16109 | int fd = open ("/dev/zero", O_RDONLY, 0666); | |
16110 | if (fd >= 0) | |
16111 | # endif | |
16112 | { | |
16113 | int pagesize = getpagesize (); | |
16114 | char *two_pages = | |
16115 | (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, | |
16116 | flags, fd, 0); | |
16117 | if (two_pages != (char *)(-1) | |
16118 | && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) | |
16119 | fence = two_pages + pagesize; | |
16120 | } | |
16121 | #endif | |
16122 | if (fence) | |
16123 | { | |
9c9d63b1 | 16124 | /* Test against bugs on glibc systems. */ |
c0c3707f CB |
16125 | if (memchr (fence, 0, 0)) |
16126 | result |= 1; | |
16127 | strcpy (fence - 9, "12345678"); | |
16128 | if (memchr (fence - 9, 0, 79) != fence - 1) | |
16129 | result |= 2; | |
16130 | if (memchr (fence - 1, 0, 3) != fence - 1) | |
16131 | result |= 4; | |
9c9d63b1 PM |
16132 | /* Test against bug on AIX 7.2. */ |
16133 | if (memchr (fence - 4, '6', 16) != fence - 4) | |
16134 | result |= 8; | |
c0c3707f CB |
16135 | } |
16136 | /* Test against bug on Android 4.3. */ | |
16137 | { | |
16138 | char input[3]; | |
16139 | input[0] = 'a'; | |
16140 | input[1] = 'b'; | |
16141 | input[2] = 'c'; | |
16142 | if (memchr (input, 0x789abc00 | 'b', 3) != input + 1) | |
9c9d63b1 | 16143 | result |= 16; |
c0c3707f CB |
16144 | } |
16145 | return result; | |
6ec2e0f5 SDJ |
16146 | |
16147 | ; | |
16148 | return 0; | |
16149 | } | |
16150 | _ACEOF | |
16151 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 16152 | gl_cv_func_memchr_works=yes |
6ec2e0f5 | 16153 | else |
c0c3707f | 16154 | gl_cv_func_memchr_works=no |
6ec2e0f5 SDJ |
16155 | fi |
16156 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
16157 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
16158 | fi | |
16159 | ||
16160 | ||
16161 | fi | |
c0c3707f CB |
16162 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5 |
16163 | $as_echo "$gl_cv_func_memchr_works" >&6; } | |
9c9d63b1 PM |
16164 | case "$gl_cv_func_memchr_works" in |
16165 | *yes) ;; | |
16166 | *) REPLACE_MEMCHR=1 ;; | |
16167 | esac | |
6ec2e0f5 | 16168 | |
c0c3707f CB |
16169 | ac_fn_c_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$ac_includes_default" |
16170 | if test "x$ac_cv_have_decl_memmem" = xyes; then : | |
6ec2e0f5 SDJ |
16171 | ac_have_decl=1 |
16172 | else | |
16173 | ac_have_decl=0 | |
16174 | fi | |
16175 | ||
16176 | cat >>confdefs.h <<_ACEOF | |
c0c3707f | 16177 | #define HAVE_DECL_MEMMEM $ac_have_decl |
6ec2e0f5 SDJ |
16178 | _ACEOF |
16179 | ||
472fa5ee | 16180 | |
6ec2e0f5 SDJ |
16181 | |
16182 | ||
16183 | ||
c0c3707f CB |
16184 | for ac_func in memmem |
16185 | do : | |
16186 | ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem" | |
16187 | if test "x$ac_cv_func_memmem" = xyes; then : | |
16188 | cat >>confdefs.h <<_ACEOF | |
16189 | #define HAVE_MEMMEM 1 | |
16190 | _ACEOF | |
6ec2e0f5 | 16191 | |
c0c3707f CB |
16192 | fi |
16193 | done | |
6ec2e0f5 | 16194 | |
c0c3707f CB |
16195 | if test $ac_cv_func_memmem = yes; then |
16196 | HAVE_MEMMEM=1 | |
16197 | else | |
16198 | HAVE_MEMMEM=0 | |
16199 | fi | |
6ec2e0f5 | 16200 | |
c0c3707f CB |
16201 | if test $ac_cv_have_decl_memmem = no; then |
16202 | HAVE_DECL_MEMMEM=0 | |
16203 | else | |
16204 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5 | |
16205 | $as_echo_n "checking whether memmem works... " >&6; } | |
16206 | if ${gl_cv_func_memmem_works_always+:} false; then : | |
6ec2e0f5 SDJ |
16207 | $as_echo_n "(cached) " >&6 |
16208 | else | |
c0c3707f CB |
16209 | if test "$cross_compiling" = yes; then : |
16210 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 16211 | /* end confdefs.h. */ |
472fa5ee | 16212 | |
c0c3707f CB |
16213 | #ifdef __GNU_LIBRARY__ |
16214 | #include <features.h> | |
16215 | #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \ | |
16216 | || __GLIBC_MINOR__ > 12)) \ | |
16217 | || (__GLIBC__ > 2)) \ | |
16218 | || defined __UCLIBC__ | |
16219 | Lucky user | |
16220 | #endif | |
16221 | #elif defined __CYGWIN__ | |
16222 | #include <cygwin/version.h> | |
16223 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) | |
16224 | Lucky user | |
16225 | #endif | |
16226 | #else | |
16227 | Lucky user | |
16228 | #endif | |
472fa5ee | 16229 | |
c0c3707f CB |
16230 | _ACEOF |
16231 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
16232 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
16233 | gl_cv_func_memmem_works_always="guessing yes" | |
16234 | else | |
16235 | gl_cv_func_memmem_works_always="$gl_cross_guess_normal" | |
16236 | fi | |
16237 | rm -f conftest* | |
472fa5ee SM |
16238 | |
16239 | ||
6ec2e0f5 SDJ |
16240 | else |
16241 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16242 | /* end confdefs.h. */ | |
c0c3707f CB |
16243 | |
16244 | #include <string.h> /* for memmem */ | |
16245 | #define P "_EF_BF_BD" | |
16246 | #define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P | |
16247 | #define NEEDLE P P P P P | |
6ec2e0f5 SDJ |
16248 | |
16249 | int | |
16250 | main () | |
16251 | { | |
c0c3707f | 16252 | |
698be2d8 CB |
16253 | int result = 0; |
16254 | if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE))) | |
16255 | result |= 1; | |
16256 | /* Check for empty needle behavior. */ | |
16257 | { | |
16258 | const char *haystack = "AAA"; | |
16259 | if (memmem (haystack, 3, (const char *) 1, 0) != haystack) | |
16260 | result |= 2; | |
16261 | } | |
16262 | return result; | |
16263 | ||
16264 | ; | |
16265 | return 0; | |
16266 | } | |
16267 | _ACEOF | |
16268 | if ac_fn_c_try_run "$LINENO"; then : | |
16269 | gl_cv_func_memmem_works_always=yes | |
16270 | else | |
16271 | gl_cv_func_memmem_works_always=no | |
16272 | fi | |
16273 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
16274 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
16275 | fi | |
16276 | ||
16277 | ||
16278 | fi | |
16279 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5 | |
16280 | $as_echo "$gl_cv_func_memmem_works_always" >&6; } | |
16281 | case "$gl_cv_func_memmem_works_always" in | |
16282 | *yes) ;; | |
16283 | *) | |
16284 | REPLACE_MEMMEM=1 | |
16285 | ;; | |
16286 | esac | |
16287 | fi | |
16288 | : | |
16289 | ||
16290 | ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default" | |
16291 | if test "x$ac_cv_have_decl_memrchr" = xyes; then : | |
16292 | ac_have_decl=1 | |
16293 | else | |
16294 | ac_have_decl=0 | |
16295 | fi | |
16296 | ||
16297 | cat >>confdefs.h <<_ACEOF | |
16298 | #define HAVE_DECL_MEMRCHR $ac_have_decl | |
16299 | _ACEOF | |
16300 | ||
16301 | ||
16302 | ||
16303 | ||
16304 | ||
16305 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <limits.h> defines MIN and MAX" >&5 | |
16306 | $as_echo_n "checking whether <limits.h> defines MIN and MAX... " >&6; } | |
16307 | if ${gl_cv_minmax_in_limits_h+:} false; then : | |
16308 | $as_echo_n "(cached) " >&6 | |
16309 | else | |
16310 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16311 | /* end confdefs.h. */ | |
16312 | #include <limits.h> | |
16313 | int x = MIN (42, 17); | |
16314 | int | |
16315 | main () | |
16316 | { | |
16317 | ||
16318 | ; | |
16319 | return 0; | |
16320 | } | |
16321 | _ACEOF | |
16322 | if ac_fn_c_try_compile "$LINENO"; then : | |
16323 | gl_cv_minmax_in_limits_h=yes | |
16324 | else | |
16325 | gl_cv_minmax_in_limits_h=no | |
16326 | fi | |
16327 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
16328 | fi | |
16329 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5 | |
16330 | $as_echo "$gl_cv_minmax_in_limits_h" >&6; } | |
16331 | if test $gl_cv_minmax_in_limits_h = yes; then | |
16332 | ||
16333 | $as_echo "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h | |
16334 | ||
16335 | fi | |
16336 | ||
16337 | ||
16338 | ||
16339 | ||
16340 | ||
16341 | ||
16342 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/param.h> defines MIN and MAX" >&5 | |
16343 | $as_echo_n "checking whether <sys/param.h> defines MIN and MAX... " >&6; } | |
16344 | if ${gl_cv_minmax_in_sys_param_h+:} false; then : | |
16345 | $as_echo_n "(cached) " >&6 | |
16346 | else | |
16347 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16348 | /* end confdefs.h. */ | |
16349 | #include <sys/param.h> | |
16350 | int x = MIN (42, 17); | |
16351 | int | |
16352 | main () | |
16353 | { | |
16354 | ||
6ec2e0f5 SDJ |
16355 | ; |
16356 | return 0; | |
16357 | } | |
16358 | _ACEOF | |
698be2d8 CB |
16359 | if ac_fn_c_try_compile "$LINENO"; then : |
16360 | gl_cv_minmax_in_sys_param_h=yes | |
6ec2e0f5 | 16361 | else |
698be2d8 | 16362 | gl_cv_minmax_in_sys_param_h=no |
6ec2e0f5 | 16363 | fi |
698be2d8 | 16364 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
6ec2e0f5 | 16365 | fi |
698be2d8 CB |
16366 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5 |
16367 | $as_echo "$gl_cv_minmax_in_sys_param_h" >&6; } | |
16368 | if test $gl_cv_minmax_in_sys_param_h = yes; then | |
6ec2e0f5 | 16369 | |
698be2d8 | 16370 | $as_echo "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h |
c0c3707f | 16371 | |
c0c3707f | 16372 | fi |
c0c3707f | 16373 | |
c0c3707f | 16374 | |
698be2d8 | 16375 | |
c0c3707f CB |
16376 | |
16377 | ||
16378 | ||
16379 | ||
16380 | ||
16381 | ||
16382 | ||
16383 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5 | |
16384 | $as_echo_n "checking for O_CLOEXEC... " >&6; } | |
16385 | if ${gl_cv_macro_O_CLOEXEC+:} false; then : | |
6ec2e0f5 SDJ |
16386 | $as_echo_n "(cached) " >&6 |
16387 | else | |
16388 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16389 | /* end confdefs.h. */ | |
c0c3707f CB |
16390 | #include <fcntl.h> |
16391 | #ifndef O_CLOEXEC | |
16392 | choke me; | |
16393 | #endif | |
6ec2e0f5 SDJ |
16394 | |
16395 | int | |
16396 | main () | |
16397 | { | |
c0c3707f | 16398 | return O_CLOEXEC; |
6ec2e0f5 SDJ |
16399 | ; |
16400 | return 0; | |
16401 | } | |
16402 | _ACEOF | |
16403 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 16404 | gl_cv_macro_O_CLOEXEC=yes |
6ec2e0f5 | 16405 | else |
c0c3707f | 16406 | gl_cv_macro_O_CLOEXEC=no |
6ec2e0f5 SDJ |
16407 | fi |
16408 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
16409 | fi | |
c0c3707f CB |
16410 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_macro_O_CLOEXEC" >&5 |
16411 | $as_echo "$gl_cv_macro_O_CLOEXEC" >&6; } | |
16412 | ||
16413 | ||
16414 | ||
16415 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5 | |
16416 | $as_echo_n "checking for promoted mode_t type... " >&6; } | |
16417 | if ${gl_cv_promoted_mode_t+:} false; then : | |
6ec2e0f5 SDJ |
16418 | $as_echo_n "(cached) " >&6 |
16419 | else | |
6ec2e0f5 | 16420 | |
c0c3707f CB |
16421 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
16422 | /* end confdefs.h. */ | |
16423 | #include <sys/types.h> | |
6ec2e0f5 SDJ |
16424 | int |
16425 | main () | |
16426 | { | |
c0c3707f | 16427 | typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1]; |
6ec2e0f5 SDJ |
16428 | ; |
16429 | return 0; | |
16430 | } | |
16431 | _ACEOF | |
16432 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 16433 | gl_cv_promoted_mode_t='int' |
6ec2e0f5 | 16434 | else |
c0c3707f | 16435 | gl_cv_promoted_mode_t='mode_t' |
6ec2e0f5 SDJ |
16436 | fi |
16437 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c0c3707f | 16438 | |
6ec2e0f5 | 16439 | fi |
c0c3707f CB |
16440 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5 |
16441 | $as_echo "$gl_cv_promoted_mode_t" >&6; } | |
6ec2e0f5 | 16442 | |
c0c3707f CB |
16443 | cat >>confdefs.h <<_ACEOF |
16444 | #define PROMOTED_MODE_T $gl_cv_promoted_mode_t | |
6ec2e0f5 | 16445 | _ACEOF |
c0c3707f CB |
16446 | |
16447 | ||
16448 | ||
16449 | ||
16450 | ||
9c9d63b1 PM |
16451 | |
16452 | ||
16453 | ||
16454 | ||
c0c3707f CB |
16455 | |
16456 | ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default" | |
16457 | if test "x$ac_cv_have_decl_setenv" = xyes; then : | |
16458 | ac_have_decl=1 | |
6ec2e0f5 | 16459 | else |
c0c3707f | 16460 | ac_have_decl=0 |
6ec2e0f5 | 16461 | fi |
c0c3707f CB |
16462 | |
16463 | cat >>confdefs.h <<_ACEOF | |
16464 | #define HAVE_DECL_SETENV $ac_have_decl | |
16465 | _ACEOF | |
16466 | ||
16467 | ||
16468 | ||
16469 | ||
16470 | ||
16471 | ||
16472 | if test $ac_cv_have_decl_setenv = no; then | |
16473 | HAVE_DECL_SETENV=0 | |
6ec2e0f5 SDJ |
16474 | fi |
16475 | ||
16476 | ||
16477 | ||
16478 | ||
16479 | ||
c0c3707f CB |
16480 | for ac_header in search.h |
16481 | do : | |
16482 | ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default" | |
16483 | if test "x$ac_cv_header_search_h" = xyes; then : | |
16484 | cat >>confdefs.h <<_ACEOF | |
16485 | #define HAVE_SEARCH_H 1 | |
16486 | _ACEOF | |
6ec2e0f5 | 16487 | |
c0c3707f | 16488 | fi |
6ec2e0f5 | 16489 | |
c0c3707f | 16490 | done |
6ec2e0f5 | 16491 | |
c0c3707f CB |
16492 | for ac_func in tsearch |
16493 | do : | |
16494 | ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch" | |
16495 | if test "x$ac_cv_func_tsearch" = xyes; then : | |
16496 | cat >>confdefs.h <<_ACEOF | |
16497 | #define HAVE_TSEARCH 1 | |
16498 | _ACEOF | |
6ec2e0f5 | 16499 | |
c0c3707f CB |
16500 | fi |
16501 | done | |
6ec2e0f5 SDJ |
16502 | |
16503 | ||
16504 | ||
16505 | ||
c0c3707f CB |
16506 | GNULIB_PTHREAD_SIGMASK=0; |
16507 | GNULIB_RAISE=0; | |
16508 | GNULIB_SIGNAL_H_SIGPIPE=0; | |
16509 | GNULIB_SIGPROCMASK=0; | |
16510 | GNULIB_SIGACTION=0; | |
16511 | HAVE_POSIX_SIGNALBLOCKING=1; | |
16512 | HAVE_PTHREAD_SIGMASK=1; | |
16513 | HAVE_RAISE=1; | |
16514 | HAVE_SIGSET_T=1; | |
16515 | HAVE_SIGINFO_T=1; | |
16516 | HAVE_SIGACTION=1; | |
16517 | HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; | |
6ec2e0f5 | 16518 | |
c0c3707f | 16519 | HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; |
6ec2e0f5 | 16520 | |
c0c3707f CB |
16521 | HAVE_SIGHANDLER_T=1; |
16522 | REPLACE_PTHREAD_SIGMASK=0; | |
16523 | REPLACE_RAISE=0; | |
6ec2e0f5 | 16524 | |
6ec2e0f5 | 16525 | |
c0c3707f CB |
16526 | ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" " |
16527 | #include <signal.h> | |
16528 | /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */ | |
16529 | #include <sys/types.h> | |
16530 | ||
16531 | " | |
16532 | if test "x$ac_cv_type_sigset_t" = xyes; then : | |
16533 | ||
16534 | cat >>confdefs.h <<_ACEOF | |
16535 | #define HAVE_SIGSET_T 1 | |
16536 | _ACEOF | |
16537 | ||
16538 | gl_cv_type_sigset_t=yes | |
16539 | else | |
16540 | gl_cv_type_sigset_t=no | |
16541 | fi | |
6ec2e0f5 | 16542 | |
c0c3707f CB |
16543 | if test $gl_cv_type_sigset_t != yes; then |
16544 | HAVE_SIGSET_T=0 | |
16545 | fi | |
6ec2e0f5 | 16546 | |
c0c3707f CB |
16547 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 |
16548 | $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } | |
16549 | if ${ac_cv_header_stdbool_h+:} false; then : | |
16550 | $as_echo_n "(cached) " >&6 | |
16551 | else | |
16552 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16553 | /* end confdefs.h. */ | |
16554 | ||
16555 | #include <stdbool.h> | |
16556 | ||
16557 | #ifdef __cplusplus | |
16558 | typedef bool Bool; | |
16559 | #else | |
16560 | typedef _Bool Bool; | |
16561 | #ifndef bool | |
16562 | "error: bool is not defined" | |
16563 | #endif | |
16564 | #ifndef false | |
16565 | "error: false is not defined" | |
16566 | #endif | |
16567 | #if false | |
16568 | "error: false is not 0" | |
16569 | #endif | |
16570 | #ifndef true | |
16571 | "error: true is not defined" | |
16572 | #endif | |
16573 | #if true != 1 | |
16574 | "error: true is not 1" | |
16575 | #endif | |
16576 | #endif | |
16577 | ||
16578 | #ifndef __bool_true_false_are_defined | |
16579 | "error: __bool_true_false_are_defined is not defined" | |
16580 | #endif | |
16581 | ||
16582 | struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s; | |
16583 | ||
16584 | char a[true == 1 ? 1 : -1]; | |
16585 | char b[false == 0 ? 1 : -1]; | |
16586 | char c[__bool_true_false_are_defined == 1 ? 1 : -1]; | |
16587 | char d[(bool) 0.5 == true ? 1 : -1]; | |
16588 | /* See body of main program for 'e'. */ | |
16589 | char f[(Bool) 0.0 == false ? 1 : -1]; | |
16590 | char g[true]; | |
16591 | char h[sizeof (Bool)]; | |
16592 | char i[sizeof s.t]; | |
16593 | enum { j = false, k = true, l = false * true, m = true * 256 }; | |
16594 | /* The following fails for | |
16595 | HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ | |
16596 | Bool n[m]; | |
16597 | char o[sizeof n == m * sizeof n[0] ? 1 : -1]; | |
16598 | char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; | |
16599 | /* Catch a bug in an HP-UX C compiler. See | |
16600 | https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html | |
16601 | https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html | |
16602 | */ | |
16603 | Bool q = true; | |
16604 | Bool *pq = &q; | |
16605 | bool *qq = &q; | |
6ec2e0f5 | 16606 | |
c0c3707f CB |
16607 | int |
16608 | main () | |
16609 | { | |
6ec2e0f5 | 16610 | |
c0c3707f CB |
16611 | bool e = &s; |
16612 | *pq |= q; *pq |= ! q; | |
16613 | *qq |= q; *qq |= ! q; | |
16614 | /* Refer to every declared value, to avoid compiler optimizations. */ | |
16615 | return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l | |
16616 | + !m + !n + !o + !p + !q + !pq + !qq); | |
6ec2e0f5 | 16617 | |
c0c3707f CB |
16618 | ; |
16619 | return 0; | |
16620 | } | |
16621 | _ACEOF | |
16622 | if ac_fn_c_try_compile "$LINENO"; then : | |
16623 | ac_cv_header_stdbool_h=yes | |
16624 | else | |
16625 | ac_cv_header_stdbool_h=no | |
16626 | fi | |
16627 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
16628 | fi | |
16629 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 | |
16630 | $as_echo "$ac_cv_header_stdbool_h" >&6; } | |
16631 | ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" | |
16632 | if test "x$ac_cv_type__Bool" = xyes; then : | |
6ec2e0f5 | 16633 | |
c0c3707f CB |
16634 | cat >>confdefs.h <<_ACEOF |
16635 | #define HAVE__BOOL 1 | |
16636 | _ACEOF | |
6ec2e0f5 SDJ |
16637 | |
16638 | ||
c0c3707f | 16639 | fi |
6ec2e0f5 SDJ |
16640 | |
16641 | ||
9c9d63b1 PM |
16642 | ac_fn_c_check_decl "$LINENO" "fcloseall" "ac_cv_have_decl_fcloseall" "$ac_includes_default" |
16643 | if test "x$ac_cv_have_decl_fcloseall" = xyes; then : | |
16644 | ac_have_decl=1 | |
16645 | else | |
16646 | ac_have_decl=0 | |
16647 | fi | |
16648 | ||
16649 | cat >>confdefs.h <<_ACEOF | |
16650 | #define HAVE_DECL_FCLOSEALL $ac_have_decl | |
16651 | _ACEOF | |
16652 | ||
16653 | ac_fn_c_check_decl "$LINENO" "ecvt" "ac_cv_have_decl_ecvt" "$ac_includes_default" | |
16654 | if test "x$ac_cv_have_decl_ecvt" = xyes; then : | |
16655 | ac_have_decl=1 | |
16656 | else | |
16657 | ac_have_decl=0 | |
16658 | fi | |
16659 | ||
16660 | cat >>confdefs.h <<_ACEOF | |
16661 | #define HAVE_DECL_ECVT $ac_have_decl | |
16662 | _ACEOF | |
16663 | ||
16664 | ac_fn_c_check_decl "$LINENO" "fcvt" "ac_cv_have_decl_fcvt" "$ac_includes_default" | |
16665 | if test "x$ac_cv_have_decl_fcvt" = xyes; then : | |
16666 | ac_have_decl=1 | |
16667 | else | |
16668 | ac_have_decl=0 | |
16669 | fi | |
16670 | ||
16671 | cat >>confdefs.h <<_ACEOF | |
16672 | #define HAVE_DECL_FCVT $ac_have_decl | |
16673 | _ACEOF | |
16674 | ||
16675 | ac_fn_c_check_decl "$LINENO" "gcvt" "ac_cv_have_decl_gcvt" "$ac_includes_default" | |
16676 | if test "x$ac_cv_have_decl_gcvt" = xyes; then : | |
16677 | ac_have_decl=1 | |
16678 | else | |
16679 | ac_have_decl=0 | |
16680 | fi | |
472fa5ee | 16681 | |
9c9d63b1 PM |
16682 | cat >>confdefs.h <<_ACEOF |
16683 | #define HAVE_DECL_GCVT $ac_have_decl | |
16684 | _ACEOF | |
f8e27d88 | 16685 | |
c0c3707f CB |
16686 | ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default" |
16687 | if test "x$ac_cv_have_decl_strdup" = xyes; then : | |
6ec2e0f5 SDJ |
16688 | ac_have_decl=1 |
16689 | else | |
16690 | ac_have_decl=0 | |
16691 | fi | |
16692 | ||
16693 | cat >>confdefs.h <<_ACEOF | |
c0c3707f | 16694 | #define HAVE_DECL_STRDUP $ac_have_decl |
6ec2e0f5 SDJ |
16695 | _ACEOF |
16696 | ||
16697 | ||
c0c3707f CB |
16698 | REPLACE_STRERROR_0=0 |
16699 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5 | |
16700 | $as_echo_n "checking whether strerror(0) succeeds... " >&6; } | |
16701 | if ${gl_cv_func_strerror_0_works+:} false; then : | |
6ec2e0f5 SDJ |
16702 | $as_echo_n "(cached) " >&6 |
16703 | else | |
c0c3707f CB |
16704 | if test "$cross_compiling" = yes; then : |
16705 | case "$host_os" in | |
16706 | # Guess yes on glibc systems. | |
16707 | *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; | |
16708 | # Guess yes on musl systems. | |
16709 | *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;; | |
16710 | # Guess yes on native Windows. | |
16711 | mingw*) gl_cv_func_strerror_0_works="guessing yes" ;; | |
16712 | # If we don't know, obey --enable-cross-guesses. | |
16713 | *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;; | |
16714 | esac | |
6ec2e0f5 | 16715 | |
5e8754f9 SDJ |
16716 | else |
16717 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16718 | /* end confdefs.h. */ | |
c0c3707f CB |
16719 | #include <string.h> |
16720 | #include <errno.h> | |
6ec2e0f5 | 16721 | |
5e8754f9 SDJ |
16722 | int |
16723 | main () | |
16724 | { | |
c0c3707f CB |
16725 | int result = 0; |
16726 | char *str; | |
16727 | errno = 0; | |
16728 | str = strerror (0); | |
16729 | if (!*str) result |= 1; | |
16730 | if (errno) result |= 2; | |
16731 | if (strstr (str, "nknown") || strstr (str, "ndefined")) | |
16732 | result |= 4; | |
16733 | return result; | |
5e8754f9 SDJ |
16734 | ; |
16735 | return 0; | |
16736 | } | |
16737 | _ACEOF | |
c0c3707f CB |
16738 | if ac_fn_c_try_run "$LINENO"; then : |
16739 | gl_cv_func_strerror_0_works=yes | |
5e8754f9 | 16740 | else |
c0c3707f | 16741 | gl_cv_func_strerror_0_works=no |
5e8754f9 | 16742 | fi |
c0c3707f CB |
16743 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
16744 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
5e8754f9 | 16745 | fi |
6ec2e0f5 | 16746 | |
6ec2e0f5 | 16747 | |
c0c3707f CB |
16748 | fi |
16749 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5 | |
16750 | $as_echo "$gl_cv_func_strerror_0_works" >&6; } | |
16751 | case "$gl_cv_func_strerror_0_works" in | |
16752 | *yes) ;; | |
16753 | *) | |
16754 | REPLACE_STRERROR_0=1 | |
6ec2e0f5 | 16755 | |
c0c3707f | 16756 | $as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h |
6ec2e0f5 | 16757 | |
c0c3707f CB |
16758 | ;; |
16759 | esac | |
6ec2e0f5 SDJ |
16760 | |
16761 | ||
16762 | ||
16763 | ||
472fa5ee SM |
16764 | |
16765 | ||
16766 | ||
725e2999 | 16767 | |
725e2999 JB |
16768 | |
16769 | ||
c0c3707f CB |
16770 | if test $ac_cv_func_strerror_r = yes; then |
16771 | if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then | |
16772 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5 | |
16773 | $as_echo_n "checking for strerror_r with POSIX signature... " >&6; } | |
16774 | if ${gl_cv_func_strerror_r_posix_signature+:} false; then : | |
16775 | $as_echo_n "(cached) " >&6 | |
16776 | else | |
16777 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16778 | /* end confdefs.h. */ | |
16779 | #include <string.h> | |
16780 | int strerror_r (int, char *, size_t); | |
725e2999 | 16781 | |
c0c3707f CB |
16782 | int |
16783 | main () | |
16784 | { | |
725e2999 | 16785 | |
c0c3707f CB |
16786 | ; |
16787 | return 0; | |
16788 | } | |
16789 | _ACEOF | |
16790 | if ac_fn_c_try_compile "$LINENO"; then : | |
16791 | gl_cv_func_strerror_r_posix_signature=yes | |
16792 | else | |
16793 | gl_cv_func_strerror_r_posix_signature=no | |
16794 | fi | |
16795 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
725e2999 | 16796 | |
c0c3707f CB |
16797 | fi |
16798 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5 | |
16799 | $as_echo "$gl_cv_func_strerror_r_posix_signature" >&6; } | |
16800 | if test $gl_cv_func_strerror_r_posix_signature = yes; then | |
16801 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5 | |
16802 | $as_echo_n "checking whether strerror_r works... " >&6; } | |
16803 | if ${gl_cv_func_strerror_r_works+:} false; then : | |
16804 | $as_echo_n "(cached) " >&6 | |
16805 | else | |
16806 | if test "$cross_compiling" = yes; then : | |
725e2999 | 16807 | |
c0c3707f CB |
16808 | case "$host_os" in |
16809 | # Guess no on AIX. | |
16810 | aix*) gl_cv_func_strerror_r_works="guessing no";; | |
16811 | # Guess no on HP-UX. | |
16812 | hpux*) gl_cv_func_strerror_r_works="guessing no";; | |
16813 | # Guess no on BSD variants. | |
16814 | *bsd*) gl_cv_func_strerror_r_works="guessing no";; | |
16815 | # Guess yes otherwise. | |
16816 | *) gl_cv_func_strerror_r_works="guessing yes";; | |
16817 | esac | |
725e2999 | 16818 | |
c0c3707f CB |
16819 | else |
16820 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16821 | /* end confdefs.h. */ | |
16822 | #include <errno.h> | |
16823 | #include <string.h> | |
725e2999 | 16824 | |
c0c3707f CB |
16825 | int |
16826 | main () | |
16827 | { | |
16828 | int result = 0; | |
16829 | char buf[79]; | |
16830 | if (strerror_r (EACCES, buf, 0) < 0) | |
16831 | result |= 1; | |
16832 | errno = 0; | |
16833 | if (strerror_r (EACCES, buf, sizeof buf) != 0) | |
16834 | result |= 2; | |
16835 | strcpy (buf, "Unknown"); | |
16836 | if (strerror_r (0, buf, sizeof buf) != 0) | |
16837 | result |= 4; | |
16838 | if (errno) | |
16839 | result |= 8; | |
16840 | if (strstr (buf, "nknown") || strstr (buf, "ndefined")) | |
16841 | result |= 0x10; | |
16842 | errno = 0; | |
16843 | *buf = 0; | |
16844 | if (strerror_r (-3, buf, sizeof buf) < 0) | |
16845 | result |= 0x20; | |
16846 | if (errno) | |
16847 | result |= 0x40; | |
16848 | if (!*buf) | |
16849 | result |= 0x80; | |
16850 | return result; | |
725e2999 | 16851 | |
c0c3707f CB |
16852 | ; |
16853 | return 0; | |
16854 | } | |
16855 | _ACEOF | |
16856 | if ac_fn_c_try_run "$LINENO"; then : | |
16857 | gl_cv_func_strerror_r_works=yes | |
16858 | else | |
16859 | gl_cv_func_strerror_r_works=no | |
16860 | fi | |
16861 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
16862 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
16863 | fi | |
725e2999 JB |
16864 | |
16865 | ||
c0c3707f CB |
16866 | fi |
16867 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 | |
16868 | $as_echo "$gl_cv_func_strerror_r_works" >&6; } | |
16869 | else | |
725e2999 | 16870 | |
c0c3707f CB |
16871 | if test $ac_cv_func___xpg_strerror_r = yes; then |
16872 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5 | |
16873 | $as_echo_n "checking whether __xpg_strerror_r works... " >&6; } | |
16874 | if ${gl_cv_func_strerror_r_works+:} false; then : | |
725e2999 JB |
16875 | $as_echo_n "(cached) " >&6 |
16876 | else | |
c0c3707f CB |
16877 | if test "$cross_compiling" = yes; then : |
16878 | gl_cv_func_strerror_r_works="$gl_cross_guess_normal" | |
725e2999 | 16879 | |
c0c3707f CB |
16880 | else |
16881 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
725e2999 | 16882 | /* end confdefs.h. */ |
c0c3707f CB |
16883 | #include <errno.h> |
16884 | #include <string.h> | |
16885 | extern | |
16886 | #ifdef __cplusplus | |
16887 | "C" | |
16888 | #endif | |
16889 | int __xpg_strerror_r(int, char *, size_t); | |
725e2999 | 16890 | |
c0c3707f CB |
16891 | int |
16892 | main () | |
16893 | { | |
16894 | int result = 0; | |
16895 | char buf[256] = "^"; | |
16896 | char copy[256]; | |
16897 | char *str = strerror (-1); | |
16898 | strcpy (copy, str); | |
16899 | if (__xpg_strerror_r (-2, buf, 1) == 0) | |
16900 | result |= 1; | |
16901 | if (*buf) | |
16902 | result |= 2; | |
16903 | __xpg_strerror_r (-2, buf, 256); | |
16904 | if (strcmp (str, copy)) | |
16905 | result |= 4; | |
16906 | return result; | |
725e2999 | 16907 | |
c0c3707f CB |
16908 | ; |
16909 | return 0; | |
16910 | } | |
725e2999 | 16911 | _ACEOF |
c0c3707f CB |
16912 | if ac_fn_c_try_run "$LINENO"; then : |
16913 | gl_cv_func_strerror_r_works=yes | |
725e2999 | 16914 | else |
c0c3707f | 16915 | gl_cv_func_strerror_r_works=no |
725e2999 | 16916 | fi |
c0c3707f CB |
16917 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
16918 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
725e2999 | 16919 | fi |
725e2999 | 16920 | |
725e2999 | 16921 | |
c0c3707f CB |
16922 | fi |
16923 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 | |
16924 | $as_echo "$gl_cv_func_strerror_r_works" >&6; } | |
16925 | fi | |
16926 | fi | |
725e2999 | 16927 | fi |
725e2999 JB |
16928 | fi |
16929 | ||
c0c3707f CB |
16930 | ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" |
16931 | if test "x$ac_cv_have_decl_strerror_r" = xyes; then : | |
16932 | ac_have_decl=1 | |
725e2999 | 16933 | else |
c0c3707f | 16934 | ac_have_decl=0 |
725e2999 JB |
16935 | fi |
16936 | ||
c0c3707f CB |
16937 | cat >>confdefs.h <<_ACEOF |
16938 | #define HAVE_DECL_STRERROR_R $ac_have_decl | |
16939 | _ACEOF | |
725e2999 JB |
16940 | |
16941 | ||
16942 | ||
16943 | ||
16944 | ||
725e2999 JB |
16945 | |
16946 | ||
16947 | ||
725e2999 JB |
16948 | |
16949 | ||
16950 | ||
16951 | ||
16952 | ||
16953 | ||
16954 | ||
725e2999 | 16955 | if test $gl_cv_have_include_next = yes; then |
c0c3707f | 16956 | gl_cv_next_string_h='<'string.h'>' |
725e2999 | 16957 | else |
c0c3707f CB |
16958 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5 |
16959 | $as_echo_n "checking absolute name of <string.h>... " >&6; } | |
16960 | if ${gl_cv_next_string_h+:} false; then : | |
725e2999 JB |
16961 | $as_echo_n "(cached) " >&6 |
16962 | else | |
16963 | ||
725e2999 JB |
16964 | |
16965 | ||
16966 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16967 | /* end confdefs.h. */ | |
c0c3707f | 16968 | #include <string.h> |
725e2999 JB |
16969 | _ACEOF |
16970 | case "$host_os" in | |
16971 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
16972 | *) gl_absname_cpp="$ac_cpp" ;; | |
16973 | esac | |
16974 | ||
16975 | case "$host_os" in | |
16976 | mingw*) | |
16977 | gl_dirsep_regex='[/\\]' | |
16978 | ;; | |
16979 | *) | |
16980 | gl_dirsep_regex='\/' | |
16981 | ;; | |
16982 | esac | |
16983 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
c0c3707f | 16984 | gl_header_literal_regex=`echo 'string.h' \ |
725e2999 JB |
16985 | | sed -e "$gl_make_literal_regex_sed"` |
16986 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
16987 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
16988 | s|^/[^/]|//&| | |
16989 | p | |
16990 | q | |
16991 | }' | |
6ec2e0f5 | 16992 | |
c0c3707f | 16993 | gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
725e2999 | 16994 | sed -n "$gl_absolute_header_sed"` |
6ec2e0f5 | 16995 | |
c0c3707f CB |
16996 | gl_header=$gl_cv_absolute_string_h |
16997 | gl_cv_next_string_h='"'$gl_header'"' | |
6ec2e0f5 SDJ |
16998 | |
16999 | ||
725e2999 | 17000 | fi |
c0c3707f CB |
17001 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 |
17002 | $as_echo "$gl_cv_next_string_h" >&6; } | |
725e2999 | 17003 | fi |
c0c3707f | 17004 | NEXT_STRING_H=$gl_cv_next_string_h |
6ec2e0f5 | 17005 | |
725e2999 JB |
17006 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
17007 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
c0c3707f | 17008 | gl_next_as_first_directive='<'string.h'>' |
725e2999 JB |
17009 | else |
17010 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
c0c3707f | 17011 | gl_next_as_first_directive=$gl_cv_next_string_h |
725e2999 | 17012 | fi |
c0c3707f CB |
17013 | NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive |
17014 | ||
17015 | ||
17016 | ||
6ec2e0f5 SDJ |
17017 | |
17018 | ||
17019 | ||
17020 | ||
17021 | ||
6ec2e0f5 SDJ |
17022 | |
17023 | ||
6ec2e0f5 | 17024 | |
32e2770e MF |
17025 | |
17026 | ||
17027 | ||
17028 | ||
17029 | ||
17030 | ||
17031 | ||
17032 | ||
17033 | ||
17034 | ||
17035 | ||
17036 | ||
17037 | ||
17038 | ||
17039 | if test $gl_cv_have_include_next = yes; then | |
17040 | gl_cv_next_strings_h='<'strings.h'>' | |
17041 | else | |
17042 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <strings.h>" >&5 | |
17043 | $as_echo_n "checking absolute name of <strings.h>... " >&6; } | |
17044 | if ${gl_cv_next_strings_h+:} false; then : | |
17045 | $as_echo_n "(cached) " >&6 | |
17046 | else | |
17047 | ||
17048 | if test $ac_cv_header_strings_h = yes; then | |
17049 | ||
17050 | ||
17051 | ||
17052 | ||
17053 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17054 | /* end confdefs.h. */ | |
17055 | #include <strings.h> | |
17056 | _ACEOF | |
17057 | case "$host_os" in | |
17058 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
17059 | *) gl_absname_cpp="$ac_cpp" ;; | |
17060 | esac | |
17061 | ||
17062 | case "$host_os" in | |
17063 | mingw*) | |
17064 | gl_dirsep_regex='[/\\]' | |
17065 | ;; | |
17066 | *) | |
17067 | gl_dirsep_regex='\/' | |
17068 | ;; | |
17069 | esac | |
17070 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
17071 | gl_header_literal_regex=`echo 'strings.h' \ | |
17072 | | sed -e "$gl_make_literal_regex_sed"` | |
17073 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
17074 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
17075 | s|^/[^/]|//&| | |
17076 | p | |
17077 | q | |
17078 | }' | |
17079 | ||
17080 | gl_cv_absolute_strings_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
17081 | sed -n "$gl_absolute_header_sed"` | |
17082 | ||
17083 | gl_header=$gl_cv_absolute_strings_h | |
17084 | gl_cv_next_strings_h='"'$gl_header'"' | |
17085 | else | |
17086 | gl_cv_next_strings_h='<'strings.h'>' | |
17087 | fi | |
17088 | ||
17089 | ||
17090 | fi | |
17091 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_strings_h" >&5 | |
17092 | $as_echo "$gl_cv_next_strings_h" >&6; } | |
17093 | fi | |
17094 | NEXT_STRINGS_H=$gl_cv_next_strings_h | |
17095 | ||
17096 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
17097 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
17098 | gl_next_as_first_directive='<'strings.h'>' | |
17099 | else | |
17100 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
17101 | gl_next_as_first_directive=$gl_cv_next_strings_h | |
17102 | fi | |
17103 | NEXT_AS_FIRST_DIRECTIVE_STRINGS_H=$gl_next_as_first_directive | |
17104 | ||
17105 | ||
17106 | ||
17107 | ||
17108 | if test $ac_cv_header_strings_h = yes; then | |
17109 | HAVE_STRINGS_H=1 | |
17110 | else | |
17111 | HAVE_STRINGS_H=0 | |
17112 | fi | |
17113 | ||
17114 | ||
17115 | ||
17116 | ||
17117 | ||
17118 | ||
698be2d8 CB |
17119 | ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default" |
17120 | if test "x$ac_cv_have_decl_strnlen" = xyes; then : | |
17121 | ac_have_decl=1 | |
17122 | else | |
17123 | ac_have_decl=0 | |
17124 | fi | |
17125 | ||
17126 | cat >>confdefs.h <<_ACEOF | |
17127 | #define HAVE_DECL_STRNLEN $ac_have_decl | |
17128 | _ACEOF | |
17129 | ||
17130 | ||
17131 | ||
c0c3707f | 17132 | |
9c9d63b1 | 17133 | if test $REPLACE_MEMCHR = 1; then |
c0c3707f CB |
17134 | REPLACE_STRSTR=1 |
17135 | else | |
17136 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5 | |
17137 | $as_echo_n "checking whether strstr works... " >&6; } | |
17138 | if ${gl_cv_func_strstr_works_always+:} false; then : | |
6ec2e0f5 SDJ |
17139 | $as_echo_n "(cached) " >&6 |
17140 | else | |
c0c3707f CB |
17141 | if test "$cross_compiling" = yes; then : |
17142 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 SDJ |
17143 | /* end confdefs.h. */ |
17144 | ||
c0c3707f CB |
17145 | #ifdef __GNU_LIBRARY__ |
17146 | #include <features.h> | |
17147 | #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ | |
17148 | || defined __UCLIBC__ | |
17149 | Lucky user | |
17150 | #endif | |
17151 | #elif defined __CYGWIN__ | |
17152 | #include <cygwin/version.h> | |
17153 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) | |
17154 | Lucky user | |
17155 | #endif | |
17156 | #else | |
17157 | Lucky user | |
6ec2e0f5 | 17158 | #endif |
c0c3707f CB |
17159 | |
17160 | _ACEOF | |
17161 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
17162 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
17163 | gl_cv_func_strstr_works_always="guessing yes" | |
17164 | else | |
17165 | gl_cv_func_strstr_works_always="$gl_cross_guess_normal" | |
17166 | fi | |
17167 | rm -f conftest* | |
17168 | ||
17169 | ||
17170 | else | |
17171 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17172 | /* end confdefs.h. */ | |
17173 | ||
17174 | #include <string.h> /* for strstr */ | |
17175 | #ifdef __GNU_LIBRARY__ | |
17176 | #include <features.h> | |
17177 | #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28 | |
17178 | Unlucky user | |
17179 | #endif | |
725e2999 | 17180 | #endif |
c0c3707f CB |
17181 | #define P "_EF_BF_BD" |
17182 | #define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P | |
17183 | #define NEEDLE P P P P P | |
6ec2e0f5 | 17184 | |
725e2999 JB |
17185 | int |
17186 | main () | |
17187 | { | |
c0c3707f CB |
17188 | return !!strstr (HAYSTACK, NEEDLE); |
17189 | ||
725e2999 JB |
17190 | ; |
17191 | return 0; | |
17192 | } | |
6ec2e0f5 | 17193 | _ACEOF |
c0c3707f CB |
17194 | if ac_fn_c_try_run "$LINENO"; then : |
17195 | gl_cv_func_strstr_works_always=yes | |
6ec2e0f5 | 17196 | else |
c0c3707f | 17197 | gl_cv_func_strstr_works_always=no |
6ec2e0f5 | 17198 | fi |
c0c3707f CB |
17199 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
17200 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
6ec2e0f5 | 17201 | fi |
6ec2e0f5 SDJ |
17202 | |
17203 | ||
c0c3707f CB |
17204 | fi |
17205 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5 | |
17206 | $as_echo "$gl_cv_func_strstr_works_always" >&6; } | |
17207 | case "$gl_cv_func_strstr_works_always" in | |
17208 | *yes) ;; | |
17209 | *) | |
17210 | REPLACE_STRSTR=1 | |
17211 | ;; | |
17212 | esac | |
17213 | fi | |
6ec2e0f5 | 17214 | |
c0c3707f CB |
17215 | ac_fn_c_check_decl "$LINENO" "strtok_r" "ac_cv_have_decl_strtok_r" "$ac_includes_default" |
17216 | if test "x$ac_cv_have_decl_strtok_r" = xyes; then : | |
17217 | ac_have_decl=1 | |
17218 | else | |
17219 | ac_have_decl=0 | |
17220 | fi | |
6ec2e0f5 | 17221 | |
c0c3707f CB |
17222 | cat >>confdefs.h <<_ACEOF |
17223 | #define HAVE_DECL_STRTOK_R $ac_have_decl | |
17224 | _ACEOF | |
6ec2e0f5 SDJ |
17225 | |
17226 | ||
17227 | ||
17228 | ||
6ec2e0f5 SDJ |
17229 | |
17230 | ||
17231 | ||
17232 | ||
17233 | ||
17234 | ||
17235 | ||
698be2d8 CB |
17236 | |
17237 | ||
c0c3707f | 17238 | $as_echo "#define _USE_STD_STAT 1" >>confdefs.h |
6ec2e0f5 | 17239 | |
6ec2e0f5 SDJ |
17240 | |
17241 | ||
17242 | ||
17243 | ||
17244 | ||
6ec2e0f5 SDJ |
17245 | |
17246 | ||
17247 | ||
17248 | ||
17249 | ||
c0c3707f CB |
17250 | if test $gl_cv_have_include_next = yes; then |
17251 | gl_cv_next_sys_types_h='<'sys/types.h'>' | |
17252 | else | |
17253 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5 | |
17254 | $as_echo_n "checking absolute name of <sys/types.h>... " >&6; } | |
17255 | if ${gl_cv_next_sys_types_h+:} false; then : | |
6ec2e0f5 SDJ |
17256 | $as_echo_n "(cached) " >&6 |
17257 | else | |
6ec2e0f5 | 17258 | |
6ec2e0f5 | 17259 | |
c0c3707f CB |
17260 | |
17261 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17262 | /* end confdefs.h. */ | |
17263 | #include <sys/types.h> | |
6ec2e0f5 | 17264 | _ACEOF |
c0c3707f CB |
17265 | case "$host_os" in |
17266 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
17267 | *) gl_absname_cpp="$ac_cpp" ;; | |
17268 | esac | |
6ec2e0f5 | 17269 | |
c0c3707f CB |
17270 | case "$host_os" in |
17271 | mingw*) | |
17272 | gl_dirsep_regex='[/\\]' | |
17273 | ;; | |
17274 | *) | |
17275 | gl_dirsep_regex='\/' | |
17276 | ;; | |
17277 | esac | |
17278 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
17279 | gl_header_literal_regex=`echo 'sys/types.h' \ | |
17280 | | sed -e "$gl_make_literal_regex_sed"` | |
17281 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
17282 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
17283 | s|^/[^/]|//&| | |
17284 | p | |
17285 | q | |
17286 | }' | |
6ec2e0f5 | 17287 | |
c0c3707f CB |
17288 | gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
17289 | sed -n "$gl_absolute_header_sed"` | |
6ec2e0f5 | 17290 | |
c0c3707f CB |
17291 | gl_header=$gl_cv_absolute_sys_types_h |
17292 | gl_cv_next_sys_types_h='"'$gl_header'"' | |
6ec2e0f5 SDJ |
17293 | |
17294 | ||
c0c3707f CB |
17295 | fi |
17296 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5 | |
17297 | $as_echo "$gl_cv_next_sys_types_h" >&6; } | |
17298 | fi | |
17299 | NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h | |
6ec2e0f5 | 17300 | |
c0c3707f CB |
17301 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
17302 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
17303 | gl_next_as_first_directive='<'sys/types.h'>' | |
17304 | else | |
17305 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
17306 | gl_next_as_first_directive=$gl_cv_next_sys_types_h | |
17307 | fi | |
17308 | NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive | |
6ec2e0f5 SDJ |
17309 | |
17310 | ||
17311 | ||
17312 | ||
6ec2e0f5 | 17313 | |
6ec2e0f5 SDJ |
17314 | |
17315 | ||
6ec2e0f5 SDJ |
17316 | |
17317 | ||
17318 | ||
17319 | ||
17320 | ||
c0c3707f | 17321 | WINDOWS_STAT_INODES=0 |
6ec2e0f5 SDJ |
17322 | |
17323 | ||
17324 | ||
17325 | ||
17326 | ||
472fa5ee SM |
17327 | |
17328 | ||
17329 | ||
9c9d63b1 PM |
17330 | GNULIB_CTIME=0; |
17331 | GNULIB_MKTIME=0; | |
17332 | GNULIB_LOCALTIME=0; | |
17333 | GNULIB_NANOSLEEP=0; | |
17334 | GNULIB_STRFTIME=0; | |
17335 | GNULIB_STRPTIME=0; | |
17336 | GNULIB_TIMEGM=0; | |
17337 | GNULIB_TIMESPEC_GET=0; | |
17338 | GNULIB_TIME_R=0; | |
17339 | GNULIB_TIME_RZ=0; | |
17340 | GNULIB_TZSET=0; | |
17341 | GNULIB_MDA_TZSET=1; | |
17342 | HAVE_DECL_LOCALTIME_R=1; | |
17343 | HAVE_NANOSLEEP=1; | |
17344 | HAVE_STRPTIME=1; | |
17345 | HAVE_TIMEGM=1; | |
17346 | HAVE_TIMESPEC_GET=1; | |
17347 | HAVE_TIMEZONE_T=0; | |
17348 | REPLACE_CTIME=GNULIB_PORTCHECK; | |
17349 | REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; | |
17350 | REPLACE_MKTIME=GNULIB_PORTCHECK; | |
17351 | REPLACE_NANOSLEEP=GNULIB_PORTCHECK; | |
17352 | REPLACE_STRFTIME=GNULIB_PORTCHECK; | |
17353 | REPLACE_TIMEGM=GNULIB_PORTCHECK; | |
17354 | REPLACE_TZSET=GNULIB_PORTCHECK; | |
17355 | ||
17356 | : ${GNULIB_GETTIMEOFDAY=0}; | |
17357 | REPLACE_GMTIME=0; | |
17358 | REPLACE_LOCALTIME=0; | |
17359 | ||
17360 | ||
472fa5ee | 17361 | |
c0c3707f CB |
17362 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5 |
17363 | $as_echo_n "checking for struct timespec in <time.h>... " >&6; } | |
17364 | if ${gl_cv_sys_struct_timespec_in_time_h+:} false; then : | |
17365 | $as_echo_n "(cached) " >&6 | |
17366 | else | |
17367 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17368 | /* end confdefs.h. */ | |
17369 | #include <time.h> | |
472fa5ee | 17370 | |
c0c3707f CB |
17371 | int |
17372 | main () | |
17373 | { | |
17374 | static struct timespec x; x.tv_sec = x.tv_nsec; | |
17375 | ; | |
17376 | return 0; | |
17377 | } | |
6ec2e0f5 | 17378 | _ACEOF |
c0c3707f CB |
17379 | if ac_fn_c_try_compile "$LINENO"; then : |
17380 | gl_cv_sys_struct_timespec_in_time_h=yes | |
17381 | else | |
17382 | gl_cv_sys_struct_timespec_in_time_h=no | |
6ec2e0f5 | 17383 | fi |
c0c3707f CB |
17384 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
17385 | fi | |
17386 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5 | |
17387 | $as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; } | |
6ec2e0f5 | 17388 | |
c0c3707f CB |
17389 | TIME_H_DEFINES_STRUCT_TIMESPEC=0 |
17390 | SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 | |
17391 | PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 | |
17392 | UNISTD_H_DEFINES_STRUCT_TIMESPEC=0 | |
17393 | if test $gl_cv_sys_struct_timespec_in_time_h = yes; then | |
17394 | TIME_H_DEFINES_STRUCT_TIMESPEC=1 | |
6ec2e0f5 | 17395 | else |
c0c3707f CB |
17396 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5 |
17397 | $as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; } | |
17398 | if ${gl_cv_sys_struct_timespec_in_sys_time_h+:} false; then : | |
17399 | $as_echo_n "(cached) " >&6 | |
17400 | else | |
17401 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17402 | /* end confdefs.h. */ | |
17403 | #include <sys/time.h> | |
472fa5ee | 17404 | |
c0c3707f CB |
17405 | int |
17406 | main () | |
17407 | { | |
17408 | static struct timespec x; x.tv_sec = x.tv_nsec; | |
17409 | ; | |
17410 | return 0; | |
17411 | } | |
17412 | _ACEOF | |
17413 | if ac_fn_c_try_compile "$LINENO"; then : | |
17414 | gl_cv_sys_struct_timespec_in_sys_time_h=yes | |
17415 | else | |
17416 | gl_cv_sys_struct_timespec_in_sys_time_h=no | |
17417 | fi | |
17418 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
17419 | fi | |
17420 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5 | |
17421 | $as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; } | |
17422 | if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then | |
17423 | SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 | |
17424 | else | |
17425 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5 | |
17426 | $as_echo_n "checking for struct timespec in <pthread.h>... " >&6; } | |
17427 | if ${gl_cv_sys_struct_timespec_in_pthread_h+:} false; then : | |
17428 | $as_echo_n "(cached) " >&6 | |
17429 | else | |
17430 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17431 | /* end confdefs.h. */ | |
17432 | #include <pthread.h> | |
472fa5ee | 17433 | |
c0c3707f CB |
17434 | int |
17435 | main () | |
17436 | { | |
17437 | static struct timespec x; x.tv_sec = x.tv_nsec; | |
17438 | ; | |
17439 | return 0; | |
17440 | } | |
17441 | _ACEOF | |
17442 | if ac_fn_c_try_compile "$LINENO"; then : | |
17443 | gl_cv_sys_struct_timespec_in_pthread_h=yes | |
17444 | else | |
17445 | gl_cv_sys_struct_timespec_in_pthread_h=no | |
17446 | fi | |
17447 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
17448 | fi | |
17449 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5 | |
17450 | $as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; } | |
17451 | if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then | |
17452 | PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 | |
17453 | else | |
17454 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5 | |
17455 | $as_echo_n "checking for struct timespec in <unistd.h>... " >&6; } | |
17456 | if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then : | |
17457 | $as_echo_n "(cached) " >&6 | |
17458 | else | |
17459 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17460 | /* end confdefs.h. */ | |
17461 | #include <unistd.h> | |
6ec2e0f5 | 17462 | |
c0c3707f CB |
17463 | int |
17464 | main () | |
17465 | { | |
17466 | static struct timespec x; x.tv_sec = x.tv_nsec; | |
17467 | ; | |
17468 | return 0; | |
17469 | } | |
17470 | _ACEOF | |
17471 | if ac_fn_c_try_compile "$LINENO"; then : | |
17472 | gl_cv_sys_struct_timespec_in_unistd_h=yes | |
17473 | else | |
17474 | gl_cv_sys_struct_timespec_in_unistd_h=no | |
17475 | fi | |
17476 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
17477 | fi | |
17478 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5 | |
17479 | $as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; } | |
17480 | if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then | |
17481 | UNISTD_H_DEFINES_STRUCT_TIMESPEC=1 | |
17482 | fi | |
6ec2e0f5 SDJ |
17483 | fi |
17484 | fi | |
c0c3707f | 17485 | fi |
6ec2e0f5 SDJ |
17486 | |
17487 | ||
17488 | ||
17489 | ||
17490 | ||
17491 | ||
6ec2e0f5 | 17492 | |
6ec2e0f5 SDJ |
17493 | |
17494 | ||
17495 | ||
17496 | ||
17497 | ||
6ec2e0f5 SDJ |
17498 | |
17499 | ||
17500 | ||
17501 | ||
c0c3707f CB |
17502 | if test $gl_cv_have_include_next = yes; then |
17503 | gl_cv_next_time_h='<'time.h'>' | |
17504 | else | |
17505 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5 | |
17506 | $as_echo_n "checking absolute name of <time.h>... " >&6; } | |
17507 | if ${gl_cv_next_time_h+:} false; then : | |
17508 | $as_echo_n "(cached) " >&6 | |
17509 | else | |
6ec2e0f5 | 17510 | |
6ec2e0f5 SDJ |
17511 | |
17512 | ||
c0c3707f CB |
17513 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
17514 | /* end confdefs.h. */ | |
17515 | #include <time.h> | |
17516 | _ACEOF | |
17517 | case "$host_os" in | |
17518 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
17519 | *) gl_absname_cpp="$ac_cpp" ;; | |
17520 | esac | |
6ec2e0f5 | 17521 | |
c0c3707f CB |
17522 | case "$host_os" in |
17523 | mingw*) | |
17524 | gl_dirsep_regex='[/\\]' | |
17525 | ;; | |
17526 | *) | |
17527 | gl_dirsep_regex='\/' | |
17528 | ;; | |
17529 | esac | |
17530 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
17531 | gl_header_literal_regex=`echo 'time.h' \ | |
17532 | | sed -e "$gl_make_literal_regex_sed"` | |
17533 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
17534 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
17535 | s|^/[^/]|//&| | |
17536 | p | |
17537 | q | |
17538 | }' | |
6ec2e0f5 | 17539 | |
c0c3707f CB |
17540 | gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
17541 | sed -n "$gl_absolute_header_sed"` | |
6ec2e0f5 | 17542 | |
c0c3707f CB |
17543 | gl_header=$gl_cv_absolute_time_h |
17544 | gl_cv_next_time_h='"'$gl_header'"' | |
6ec2e0f5 | 17545 | |
6ec2e0f5 SDJ |
17546 | |
17547 | fi | |
c0c3707f CB |
17548 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5 |
17549 | $as_echo "$gl_cv_next_time_h" >&6; } | |
17550 | fi | |
17551 | NEXT_TIME_H=$gl_cv_next_time_h | |
6ec2e0f5 | 17552 | |
c0c3707f CB |
17553 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
17554 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
17555 | gl_next_as_first_directive='<'time.h'>' | |
17556 | else | |
17557 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
17558 | gl_next_as_first_directive=$gl_cv_next_time_h | |
17559 | fi | |
17560 | NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive | |
6ec2e0f5 | 17561 | |
472fa5ee SM |
17562 | |
17563 | ||
17564 | ||
17565 | ||
17566 | ||
6ec2e0f5 | 17567 | |
6ec2e0f5 | 17568 | |
9c9d63b1 PM |
17569 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIME_UTC in <time.h>" >&5 |
17570 | $as_echo_n "checking for TIME_UTC in <time.h>... " >&6; } | |
17571 | if ${gl_cv_time_h_has_TIME_UTC+:} false; then : | |
17572 | $as_echo_n "(cached) " >&6 | |
17573 | else | |
17574 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17575 | /* end confdefs.h. */ | |
17576 | #include <time.h> | |
17577 | ||
17578 | int | |
17579 | main () | |
17580 | { | |
17581 | static int x = TIME_UTC; x++; | |
17582 | ; | |
17583 | return 0; | |
17584 | } | |
17585 | _ACEOF | |
17586 | if ac_fn_c_try_compile "$LINENO"; then : | |
17587 | gl_cv_time_h_has_TIME_UTC=yes | |
17588 | else | |
17589 | gl_cv_time_h_has_TIME_UTC=no | |
17590 | fi | |
17591 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
17592 | fi | |
17593 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_h_has_TIME_UTC" >&5 | |
17594 | $as_echo "$gl_cv_time_h_has_TIME_UTC" >&6; } | |
17595 | if test $gl_cv_time_h_has_TIME_UTC = yes; then | |
17596 | TIME_H_DEFINES_TIME_UTC=1 | |
17597 | else | |
17598 | TIME_H_DEFINES_TIME_UTC=0 | |
17599 | fi | |
17600 | ||
17601 | ||
6ec2e0f5 | 17602 | |
6ec2e0f5 | 17603 | |
9c9d63b1 PM |
17604 | ac_fn_c_check_decl "$LINENO" "execvpe" "ac_cv_have_decl_execvpe" "$ac_includes_default" |
17605 | if test "x$ac_cv_have_decl_execvpe" = xyes; then : | |
17606 | ac_have_decl=1 | |
17607 | else | |
17608 | ac_have_decl=0 | |
17609 | fi | |
698be2d8 | 17610 | |
9c9d63b1 PM |
17611 | cat >>confdefs.h <<_ACEOF |
17612 | #define HAVE_DECL_EXECVPE $ac_have_decl | |
17613 | _ACEOF | |
698be2d8 | 17614 | |
c0c3707f CB |
17615 | ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default" |
17616 | if test "x$ac_cv_have_decl_unsetenv" = xyes; then : | |
17617 | ac_have_decl=1 | |
17618 | else | |
17619 | ac_have_decl=0 | |
17620 | fi | |
6ec2e0f5 | 17621 | |
c0c3707f CB |
17622 | cat >>confdefs.h <<_ACEOF |
17623 | #define HAVE_DECL_UNSETENV $ac_have_decl | |
17624 | _ACEOF | |
6ec2e0f5 SDJ |
17625 | |
17626 | ||
6ec2e0f5 SDJ |
17627 | |
17628 | ||
17629 | ||
c0c3707f CB |
17630 | if test $ac_cv_header_crtdefs_h = yes; then |
17631 | HAVE_CRTDEFS_H=1 | |
17632 | else | |
17633 | HAVE_CRTDEFS_H=0 | |
5e8754f9 | 17634 | fi |
5e8754f9 | 17635 | |
5e8754f9 | 17636 | |
5e8754f9 | 17637 | |
c0c3707f | 17638 | GNULIB_ISWBLANK=0; |
5df4cba6 SM |
17639 | GNULIB_ISWDIGIT=0; |
17640 | GNULIB_ISWXDIGIT=0; | |
c0c3707f CB |
17641 | GNULIB_WCTYPE=0; |
17642 | GNULIB_ISWCTYPE=0; | |
17643 | GNULIB_WCTRANS=0; | |
17644 | GNULIB_TOWCTRANS=0; | |
17645 | HAVE_ISWBLANK=1; | |
17646 | HAVE_WCTYPE_T=1; | |
17647 | HAVE_WCTRANS_T=1; | |
17648 | REPLACE_ISWBLANK=0; | |
5df4cba6 SM |
17649 | REPLACE_ISWDIGIT=0; |
17650 | REPLACE_ISWXDIGIT=0; | |
5e8754f9 | 17651 | |
5e8754f9 | 17652 | |
5e8754f9 | 17653 | |
5e8754f9 | 17654 | |
698be2d8 CB |
17655 | |
17656 | ||
17657 | ||
17658 | ||
c0c3707f CB |
17659 | if false; then |
17660 | GL_COND_LIBTOOL_TRUE= | |
17661 | GL_COND_LIBTOOL_FALSE='#' | |
17662 | else | |
17663 | GL_COND_LIBTOOL_TRUE='#' | |
17664 | GL_COND_LIBTOOL_FALSE= | |
17665 | fi | |
5e8754f9 | 17666 | |
c0c3707f CB |
17667 | gl_cond_libtool=false |
17668 | gl_libdeps= | |
17669 | gl_ltlibdeps= | |
17670 | gl_m4_base='import/m4' | |
5e8754f9 | 17671 | |
5e8754f9 SDJ |
17672 | |
17673 | ||
6ec2e0f5 | 17674 | |
6ec2e0f5 | 17675 | |
6ec2e0f5 | 17676 | |
6ec2e0f5 | 17677 | |
6ec2e0f5 | 17678 | |
6ec2e0f5 | 17679 | |
5df4cba6 | 17680 | |
c0c3707f CB |
17681 | gl_source_base='import' |
17682 | ||
6ec2e0f5 | 17683 | |
c0c3707f CB |
17684 | if test $ac_cv_func_alloca_works = no; then |
17685 | : | |
17686 | fi | |
6ec2e0f5 | 17687 | |
c0c3707f CB |
17688 | # Define an additional variable used in the Makefile substitution. |
17689 | if test $ac_cv_working_alloca_h = yes; then | |
17690 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5 | |
17691 | $as_echo_n "checking for alloca as a compiler built-in... " >&6; } | |
17692 | if ${gl_cv_rpl_alloca+:} false; then : | |
6ec2e0f5 SDJ |
17693 | $as_echo_n "(cached) " >&6 |
17694 | else | |
c0c3707f CB |
17695 | |
17696 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 SDJ |
17697 | /* end confdefs.h. */ |
17698 | ||
c0c3707f CB |
17699 | #if defined __GNUC__ || defined _AIX || defined _MSC_VER |
17700 | Need own alloca | |
17701 | #endif | |
6ec2e0f5 | 17702 | |
6ec2e0f5 | 17703 | _ACEOF |
c0c3707f CB |
17704 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
17705 | $EGREP "Need own alloca" >/dev/null 2>&1; then : | |
17706 | gl_cv_rpl_alloca=yes | |
6ec2e0f5 | 17707 | else |
c0c3707f | 17708 | gl_cv_rpl_alloca=no |
6ec2e0f5 | 17709 | fi |
c0c3707f | 17710 | rm -f conftest* |
6ec2e0f5 SDJ |
17711 | |
17712 | ||
17713 | fi | |
c0c3707f CB |
17714 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5 |
17715 | $as_echo "$gl_cv_rpl_alloca" >&6; } | |
17716 | if test $gl_cv_rpl_alloca = yes; then | |
6ec2e0f5 | 17717 | |
c0c3707f | 17718 | $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h |
6ec2e0f5 | 17719 | |
c0c3707f CB |
17720 | ALLOCA_H=alloca.h |
17721 | else | |
17722 | ALLOCA_H= | |
17723 | fi | |
17724 | else | |
17725 | ALLOCA_H=alloca.h | |
17726 | fi | |
6ec2e0f5 | 17727 | |
c0c3707f CB |
17728 | if test -n "$ALLOCA_H"; then |
17729 | GL_GENERATE_ALLOCA_H_TRUE= | |
17730 | GL_GENERATE_ALLOCA_H_FALSE='#' | |
17731 | else | |
17732 | GL_GENERATE_ALLOCA_H_TRUE='#' | |
17733 | GL_GENERATE_ALLOCA_H_FALSE= | |
17734 | fi | |
6ec2e0f5 SDJ |
17735 | |
17736 | ||
c0c3707f CB |
17737 | if test $ac_cv_working_alloca_h = yes; then |
17738 | HAVE_ALLOCA_H=1 | |
17739 | else | |
17740 | HAVE_ALLOCA_H=0 | |
17741 | fi | |
6ec2e0f5 SDJ |
17742 | |
17743 | ||
17744 | ||
17745 | ||
17746 | ||
17747 | ||
c0c3707f CB |
17748 | if test $ac_cv_header_arpa_inet_h = yes; then |
17749 | HAVE_ARPA_INET_H=1 | |
17750 | else | |
17751 | HAVE_ARPA_INET_H=0 | |
17752 | fi | |
6ec2e0f5 SDJ |
17753 | |
17754 | ||
472fa5ee SM |
17755 | |
17756 | ||
17757 | ||
17758 | ||
17759 | ||
6ec2e0f5 SDJ |
17760 | |
17761 | ||
17762 | ||
17763 | if test $gl_cv_have_include_next = yes; then | |
c0c3707f | 17764 | gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' |
6ec2e0f5 | 17765 | else |
c0c3707f CB |
17766 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5 |
17767 | $as_echo_n "checking absolute name of <arpa/inet.h>... " >&6; } | |
17768 | if ${gl_cv_next_arpa_inet_h+:} false; then : | |
6ec2e0f5 SDJ |
17769 | $as_echo_n "(cached) " >&6 |
17770 | else | |
17771 | ||
c0c3707f | 17772 | if test $ac_cv_header_arpa_inet_h = yes; then |
6ec2e0f5 SDJ |
17773 | |
17774 | ||
17775 | ||
17776 | ||
17777 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17778 | /* end confdefs.h. */ | |
c0c3707f | 17779 | #include <arpa/inet.h> |
6ec2e0f5 SDJ |
17780 | _ACEOF |
17781 | case "$host_os" in | |
17782 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
17783 | *) gl_absname_cpp="$ac_cpp" ;; | |
17784 | esac | |
17785 | ||
17786 | case "$host_os" in | |
17787 | mingw*) | |
17788 | gl_dirsep_regex='[/\\]' | |
17789 | ;; | |
17790 | *) | |
17791 | gl_dirsep_regex='\/' | |
17792 | ;; | |
17793 | esac | |
17794 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
c0c3707f | 17795 | gl_header_literal_regex=`echo 'arpa/inet.h' \ |
6ec2e0f5 SDJ |
17796 | | sed -e "$gl_make_literal_regex_sed"` |
17797 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
17798 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
17799 | s|^/[^/]|//&| | |
17800 | p | |
17801 | q | |
17802 | }' | |
17803 | ||
c0c3707f | 17804 | gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
6ec2e0f5 SDJ |
17805 | sed -n "$gl_absolute_header_sed"` |
17806 | ||
c0c3707f CB |
17807 | gl_header=$gl_cv_absolute_arpa_inet_h |
17808 | gl_cv_next_arpa_inet_h='"'$gl_header'"' | |
6ec2e0f5 | 17809 | else |
c0c3707f | 17810 | gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' |
6ec2e0f5 SDJ |
17811 | fi |
17812 | ||
c0c3707f | 17813 | |
6ec2e0f5 | 17814 | fi |
c0c3707f CB |
17815 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5 |
17816 | $as_echo "$gl_cv_next_arpa_inet_h" >&6; } | |
17817 | fi | |
17818 | NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h | |
6ec2e0f5 | 17819 | |
c0c3707f CB |
17820 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
17821 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
17822 | gl_next_as_first_directive='<'arpa/inet.h'>' | |
17823 | else | |
17824 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
17825 | gl_next_as_first_directive=$gl_cv_next_arpa_inet_h | |
17826 | fi | |
17827 | NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive | |
6ec2e0f5 SDJ |
17828 | |
17829 | ||
6ec2e0f5 | 17830 | |
6ec2e0f5 | 17831 | |
6ec2e0f5 SDJ |
17832 | |
17833 | ||
6ec2e0f5 SDJ |
17834 | |
17835 | ||
17836 | ||
c0c3707f CB |
17837 | if test $ac_cv_header_sys_socket_h = yes; then |
17838 | HAVE_WS2TCPIP_H=0 | |
17839 | else | |
17840 | if test $ac_cv_header_ws2tcpip_h = yes; then | |
17841 | HAVE_WS2TCPIP_H=1 | |
17842 | else | |
17843 | HAVE_WS2TCPIP_H=0 | |
17844 | fi | |
17845 | fi | |
17846 | ||
17847 | ||
6ec2e0f5 SDJ |
17848 | |
17849 | ||
6ec2e0f5 SDJ |
17850 | |
17851 | ||
17852 | ||
17853 | ||
17854 | ||
698be2d8 CB |
17855 | |
17856 | ||
17857 | ||
17858 | ||
17859 | ||
17860 | ||
17861 | if test $ac_cv_func_btowc = no; then | |
17862 | HAVE_BTOWC=0 | |
17863 | else | |
17864 | ||
17865 | ||
17866 | ||
17867 | ||
17868 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5 | |
17869 | $as_echo_n "checking whether btowc(0) is correct... " >&6; } | |
17870 | if ${gl_cv_func_btowc_nul+:} false; then : | |
17871 | $as_echo_n "(cached) " >&6 | |
17872 | else | |
17873 | ||
17874 | if test "$cross_compiling" = yes; then : | |
17875 | ||
17876 | case "$host_os" in | |
17877 | # Guess no on Cygwin. | |
17878 | cygwin*) gl_cv_func_btowc_nul="guessing no" ;; | |
17879 | # Guess yes on native Windows. | |
17880 | mingw*) gl_cv_func_btowc_nul="guessing yes" ;; | |
17881 | # Guess yes otherwise. | |
17882 | *) gl_cv_func_btowc_nul="guessing yes" ;; | |
17883 | esac | |
17884 | ||
17885 | else | |
17886 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17887 | /* end confdefs.h. */ | |
17888 | ||
698be2d8 CB |
17889 | #include <wchar.h> |
17890 | int main () | |
17891 | { | |
17892 | if (btowc ('\0') != 0) | |
17893 | return 1; | |
17894 | return 0; | |
17895 | } | |
17896 | _ACEOF | |
17897 | if ac_fn_c_try_run "$LINENO"; then : | |
17898 | gl_cv_func_btowc_nul=yes | |
17899 | else | |
17900 | gl_cv_func_btowc_nul=no | |
17901 | fi | |
17902 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
17903 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
17904 | fi | |
17905 | ||
17906 | ||
17907 | fi | |
17908 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5 | |
17909 | $as_echo "$gl_cv_func_btowc_nul" >&6; } | |
17910 | ||
17911 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5 | |
17912 | $as_echo_n "checking whether btowc(EOF) is correct... " >&6; } | |
17913 | if ${gl_cv_func_btowc_eof+:} false; then : | |
17914 | $as_echo_n "(cached) " >&6 | |
17915 | else | |
17916 | ||
17917 | case "$host_os" in | |
17918 | # Guess no on IRIX. | |
17919 | irix*) gl_cv_func_btowc_eof="guessing no" ;; | |
17920 | # Guess yes on native Windows. | |
17921 | mingw*) gl_cv_func_btowc_eof="guessing yes" ;; | |
17922 | # Guess yes otherwise. | |
17923 | *) gl_cv_func_btowc_eof="guessing yes" ;; | |
17924 | esac | |
17925 | if test $LOCALE_FR != none; then | |
17926 | if test "$cross_compiling" = yes; then : | |
17927 | : | |
17928 | else | |
17929 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17930 | /* end confdefs.h. */ | |
17931 | ||
17932 | #include <locale.h> | |
698be2d8 | 17933 | #include <stdio.h> |
698be2d8 CB |
17934 | #include <wchar.h> |
17935 | int main () | |
17936 | { | |
17937 | if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) | |
17938 | { | |
17939 | if (btowc (EOF) != WEOF) | |
17940 | return 1; | |
17941 | } | |
17942 | return 0; | |
17943 | } | |
17944 | _ACEOF | |
17945 | if ac_fn_c_try_run "$LINENO"; then : | |
17946 | gl_cv_func_btowc_eof=yes | |
17947 | else | |
17948 | gl_cv_func_btowc_eof=no | |
17949 | fi | |
17950 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
17951 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
17952 | fi | |
17953 | ||
17954 | fi | |
17955 | ||
17956 | fi | |
17957 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5 | |
17958 | $as_echo "$gl_cv_func_btowc_eof" >&6; } | |
17959 | ||
17960 | case "$gl_cv_func_btowc_nul" in | |
17961 | *yes) ;; | |
17962 | *) REPLACE_BTOWC=1 ;; | |
17963 | esac | |
17964 | case "$gl_cv_func_btowc_eof" in | |
17965 | *yes) ;; | |
17966 | *) REPLACE_BTOWC=1 ;; | |
17967 | esac | |
17968 | fi | |
17969 | ||
17970 | if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then | |
17971 | ||
17972 | ||
17973 | ||
17974 | ||
17975 | ||
17976 | ||
17977 | ||
17978 | ||
17979 | gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext" | |
17980 | ||
17981 | ||
17982 | : | |
17983 | ||
17984 | fi | |
17985 | ||
17986 | ||
17987 | ||
17988 | ||
17989 | ||
17990 | GNULIB_BTOWC=1 | |
17991 | ||
17992 | ||
17993 | ||
17994 | ||
17995 | ||
17996 | $as_echo "#define GNULIB_TEST_BTOWC 1" >>confdefs.h | |
17997 | ||
17998 | ||
17999 | ||
18000 | ||
c0c3707f CB |
18001 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5 |
18002 | $as_echo_n "checking for __builtin_expect... " >&6; } | |
18003 | if ${gl_cv___builtin_expect+:} false; then : | |
6ec2e0f5 SDJ |
18004 | $as_echo_n "(cached) " >&6 |
18005 | else | |
c0c3707f CB |
18006 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
18007 | /* end confdefs.h. */ | |
18008 | ||
18009 | int | |
18010 | main (int argc, char **argv) | |
18011 | { | |
18012 | argc = __builtin_expect (argc, 100); | |
18013 | return argv[argc != 100][0]; | |
18014 | } | |
18015 | _ACEOF | |
18016 | if ac_fn_c_try_link "$LINENO"; then : | |
18017 | gl_cv___builtin_expect=yes | |
18018 | else | |
18019 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18020 | /* end confdefs.h. */ | |
18021 | ||
18022 | #include <builtins.h> | |
18023 | int | |
18024 | main (int argc, char **argv) | |
18025 | { | |
18026 | argc = __builtin_expect (argc, 100); | |
18027 | return argv[argc != 100][0]; | |
18028 | } | |
18029 | _ACEOF | |
18030 | if ac_fn_c_try_link "$LINENO"; then : | |
18031 | gl_cv___builtin_expect="in <builtins.h>" | |
18032 | else | |
18033 | gl_cv___builtin_expect=no | |
6ec2e0f5 | 18034 | fi |
c0c3707f CB |
18035 | rm -f core conftest.err conftest.$ac_objext \ |
18036 | conftest$ac_exeext conftest.$ac_ext | |
18037 | fi | |
18038 | rm -f core conftest.err conftest.$ac_objext \ | |
18039 | conftest$ac_exeext conftest.$ac_ext | |
18040 | fi | |
18041 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5 | |
18042 | $as_echo "$gl_cv___builtin_expect" >&6; } | |
18043 | if test "$gl_cv___builtin_expect" = yes; then | |
18044 | $as_echo "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h | |
8690e634 | 18045 | |
c0c3707f CB |
18046 | elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then |
18047 | $as_echo "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h | |
8690e634 | 18048 | |
6ec2e0f5 | 18049 | fi |
8690e634 JK |
18050 | |
18051 | ||
18052 | ||
18053 | ||
c0c3707f CB |
18054 | |
18055 | if test $ac_cv_func_canonicalize_file_name = no; then | |
18056 | HAVE_CANONICALIZE_FILE_NAME=0 | |
18057 | if test $ac_cv_func_realpath = no; then | |
18058 | HAVE_REALPATH=0 | |
18059 | else | |
18060 | case "$gl_cv_func_realpath_works" in | |
18061 | *yes) ;; | |
18062 | *) REPLACE_REALPATH=1 ;; | |
18063 | esac | |
18064 | fi | |
18065 | else | |
18066 | case "$gl_cv_func_realpath_works" in | |
18067 | *yes) | |
18068 | ;; | |
18069 | *) | |
18070 | REPLACE_CANONICALIZE_FILE_NAME=1 | |
18071 | REPLACE_REALPATH=1 | |
18072 | ;; | |
18073 | esac | |
5e8754f9 | 18074 | fi |
8690e634 | 18075 | |
c0c3707f | 18076 | if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then |
8690e634 JK |
18077 | |
18078 | ||
18079 | ||
472fa5ee SM |
18080 | |
18081 | ||
18082 | ||
18083 | ||
18084 | ||
c0c3707f CB |
18085 | gl_LIBOBJS="$gl_LIBOBJS canonicalize-lgpl.$ac_objext" |
18086 | ||
6ec2e0f5 | 18087 | fi |
8690e634 JK |
18088 | |
18089 | ||
c0c3707f CB |
18090 | cat >>confdefs.h <<_ACEOF |
18091 | #define GNULIB_CANONICALIZE_LGPL 1 | |
18092 | _ACEOF | |
8690e634 | 18093 | |
8690e634 | 18094 | |
8690e634 | 18095 | |
8690e634 | 18096 | |
8690e634 | 18097 | |
8690e634 | 18098 | |
8690e634 | 18099 | |
c0c3707f | 18100 | GNULIB_CANONICALIZE_FILE_NAME=1 |
8690e634 | 18101 | |
8690e634 | 18102 | |
8690e634 | 18103 | |
6ec2e0f5 SDJ |
18104 | |
18105 | ||
c0c3707f | 18106 | $as_echo "#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1" >>confdefs.h |
6ec2e0f5 | 18107 | |
6ec2e0f5 | 18108 | |
8690e634 JK |
18109 | |
18110 | ||
8690e634 JK |
18111 | |
18112 | ||
18113 | ||
18114 | ||
c0c3707f | 18115 | GNULIB_REALPATH=1 |
6ec2e0f5 SDJ |
18116 | |
18117 | ||
18118 | ||
18119 | ||
6ec2e0f5 | 18120 | |
c0c3707f | 18121 | $as_echo "#define GNULIB_TEST_REALPATH 1" >>confdefs.h |
6ec2e0f5 SDJ |
18122 | |
18123 | ||
18124 | ||
18125 | ||
18126 | ||
18127 | ||
18128 | ||
6ec2e0f5 | 18129 | |
c0c3707f | 18130 | GNULIB_CHDIR=1 |
6ec2e0f5 | 18131 | |
8690e634 | 18132 | |
8690e634 | 18133 | |
6ec2e0f5 | 18134 | |
6ec2e0f5 | 18135 | |
c0c3707f CB |
18136 | $as_echo "#define GNULIB_TEST_CHDIR 1" >>confdefs.h |
18137 | ||
18138 | ||
18139 | ||
18140 | ||
18141 | ||
9c9d63b1 PM |
18142 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this system supports file names of any length" >&5 |
18143 | $as_echo_n "checking whether this system supports file names of any length... " >&6; } | |
18144 | if ${gl_cv_have_unlimited_file_name_length+:} false; then : | |
c0c3707f | 18145 | $as_echo_n "(cached) " >&6 |
8690e634 | 18146 | else |
c0c3707f CB |
18147 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
18148 | /* end confdefs.h. */ | |
8690e634 | 18149 | |
c0c3707f CB |
18150 | /* Arrange to define PATH_MAX, like "pathmax.h" does. */ |
18151 | #if HAVE_UNISTD_H | |
18152 | # include <unistd.h> | |
18153 | #endif | |
18154 | #include <limits.h> | |
18155 | #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN | |
18156 | # include <sys/param.h> | |
18157 | #endif | |
18158 | #if !defined PATH_MAX && defined MAXPATHLEN | |
18159 | # define PATH_MAX MAXPATHLEN | |
18160 | #endif | |
18161 | #ifdef __hpux | |
18162 | # undef PATH_MAX | |
18163 | # define PATH_MAX 1024 | |
18164 | #endif | |
18165 | #if defined _WIN32 && ! defined __CYGWIN__ | |
18166 | # undef PATH_MAX | |
18167 | # define PATH_MAX 260 | |
18168 | #endif | |
6ec2e0f5 | 18169 | |
c0c3707f CB |
18170 | #ifdef PATH_MAX |
18171 | have_arbitrary_file_name_length_limit | |
18172 | #endif | |
6ec2e0f5 | 18173 | _ACEOF |
c0c3707f CB |
18174 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
18175 | $EGREP "have_arbitrary_file_name_length_limit" >/dev/null 2>&1; then : | |
9c9d63b1 PM |
18176 | gl_cv_have_unlimited_file_name_length=no |
18177 | else | |
18178 | gl_cv_have_unlimited_file_name_length=yes | |
18179 | fi | |
18180 | rm -f conftest* | |
18181 | ||
18182 | fi | |
18183 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_unlimited_file_name_length" >&5 | |
18184 | $as_echo "$gl_cv_have_unlimited_file_name_length" >&6; } | |
18185 | ||
18186 | if test $gl_cv_have_unlimited_file_name_length = no; then | |
18187 | ||
18188 | ||
18189 | ||
18190 | ||
18191 | ||
18192 | ||
18193 | ||
18194 | ||
18195 | gl_LIBOBJS="$gl_LIBOBJS chdir-long.$ac_objext" | |
18196 | ||
18197 | : | |
18198 | fi | |
18199 | ||
64c2e4a5 MF |
18200 | if test $HAVE_CHOWN = 0 || test $REPLACE_CHOWN = 1; then |
18201 | ||
18202 | ||
18203 | ||
18204 | ||
18205 | ||
18206 | ||
18207 | ||
18208 | ||
18209 | gl_LIBOBJS="$gl_LIBOBJS chown.$ac_objext" | |
18210 | ||
18211 | fi | |
18212 | if test $REPLACE_CHOWN = 1 && test $ac_cv_func_fchown = no; then | |
18213 | ||
18214 | ||
18215 | ||
18216 | ||
18217 | ||
18218 | ||
18219 | ||
18220 | ||
18221 | gl_LIBOBJS="$gl_LIBOBJS fchown-stub.$ac_objext" | |
18222 | ||
18223 | fi | |
18224 | ||
18225 | ||
18226 | ||
18227 | ||
18228 | ||
18229 | GNULIB_CHOWN=1 | |
18230 | ||
18231 | ||
18232 | ||
18233 | ||
18234 | ||
18235 | $as_echo "#define GNULIB_TEST_CHOWN 1" >>confdefs.h | |
18236 | ||
18237 | ||
18238 | ||
18239 | ||
9c9d63b1 PM |
18240 | |
18241 | ||
18242 | # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. | |
18243 | # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. | |
18244 | ||
18245 | # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* | |
18246 | # programs in the package would end up linked with that potentially-shared | |
18247 | # library, inducing unnecessary run-time overhead. | |
18248 | LIB_CLOCK_GETTIME= | |
18249 | ||
18250 | gl_saved_libs=$LIBS | |
18251 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 | |
18252 | $as_echo_n "checking for library containing clock_gettime... " >&6; } | |
18253 | if ${ac_cv_search_clock_gettime+:} false; then : | |
18254 | $as_echo_n "(cached) " >&6 | |
c0c3707f | 18255 | else |
9c9d63b1 PM |
18256 | ac_func_search_save_LIBS=$LIBS |
18257 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18258 | /* end confdefs.h. */ | |
18259 | ||
18260 | /* Override any GCC internal prototype to avoid an error. | |
18261 | Use char because int might match the return type of a GCC | |
18262 | builtin and then its argument prototype would still apply. */ | |
18263 | #ifdef __cplusplus | |
18264 | extern "C" | |
18265 | #endif | |
18266 | char clock_gettime (); | |
18267 | int | |
18268 | main () | |
18269 | { | |
18270 | return clock_gettime (); | |
18271 | ; | |
18272 | return 0; | |
18273 | } | |
18274 | _ACEOF | |
18275 | for ac_lib in '' rt posix4; do | |
18276 | if test -z "$ac_lib"; then | |
18277 | ac_res="none required" | |
18278 | else | |
18279 | ac_res=-l$ac_lib | |
18280 | LIBS="-l$ac_lib $ac_func_search_save_LIBS" | |
18281 | fi | |
18282 | if ac_fn_c_try_link "$LINENO"; then : | |
18283 | ac_cv_search_clock_gettime=$ac_res | |
18284 | fi | |
18285 | rm -f core conftest.err conftest.$ac_objext \ | |
18286 | conftest$ac_exeext | |
18287 | if ${ac_cv_search_clock_gettime+:} false; then : | |
18288 | break | |
c0c3707f | 18289 | fi |
9c9d63b1 PM |
18290 | done |
18291 | if ${ac_cv_search_clock_gettime+:} false; then : | |
6ec2e0f5 | 18292 | |
9c9d63b1 PM |
18293 | else |
18294 | ac_cv_search_clock_gettime=no | |
18295 | fi | |
18296 | rm conftest.$ac_ext | |
18297 | LIBS=$ac_func_search_save_LIBS | |
18298 | fi | |
18299 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 | |
18300 | $as_echo "$ac_cv_search_clock_gettime" >&6; } | |
18301 | ac_res=$ac_cv_search_clock_gettime | |
18302 | if test "$ac_res" != no; then : | |
18303 | test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" | |
18304 | test "$ac_cv_search_clock_gettime" = "none required" || | |
18305 | LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime | |
6ec2e0f5 | 18306 | fi |
472fa5ee | 18307 | |
9c9d63b1 PM |
18308 | for ac_func in clock_gettime clock_settime |
18309 | do : | |
18310 | as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` | |
18311 | ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" | |
18312 | if eval test \"x\$"$as_ac_var"\" = x"yes"; then : | |
18313 | cat >>confdefs.h <<_ACEOF | |
18314 | #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 | |
18315 | _ACEOF | |
472fa5ee | 18316 | |
9c9d63b1 PM |
18317 | fi |
18318 | done | |
472fa5ee | 18319 | |
9c9d63b1 | 18320 | LIBS=$gl_saved_libs |
472fa5ee | 18321 | |
8690e634 | 18322 | |
8690e634 | 18323 | |
c0c3707f | 18324 | $as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h |
8690e634 JK |
18325 | |
18326 | ||
18327 | ||
18328 | ||
18329 | ||
8690e634 | 18330 | |
c0c3707f CB |
18331 | if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then |
18332 | REPLACE_CLOSE=1 | |
18333 | fi | |
8690e634 | 18334 | |
6ec2e0f5 SDJ |
18335 | |
18336 | ||
6ec2e0f5 SDJ |
18337 | |
18338 | ||
8690e634 | 18339 | |
c0c3707f CB |
18340 | if test $ac_cv_header_sys_socket_h != yes; then |
18341 | for ac_header in winsock2.h | |
18342 | do : | |
18343 | ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" | |
18344 | if test "x$ac_cv_header_winsock2_h" = xyes; then : | |
18345 | cat >>confdefs.h <<_ACEOF | |
18346 | #define HAVE_WINSOCK2_H 1 | |
18347 | _ACEOF | |
8690e634 | 18348 | |
c0c3707f | 18349 | fi |
8690e634 | 18350 | |
c0c3707f | 18351 | done |
8690e634 | 18352 | |
c0c3707f CB |
18353 | fi |
18354 | if test "$ac_cv_header_winsock2_h" = yes; then | |
18355 | HAVE_WINSOCK2_H=1 | |
18356 | UNISTD_H_HAVE_WINSOCK2_H=1 | |
18357 | SYS_IOCTL_H_HAVE_WINSOCK2_H=1 | |
18358 | else | |
18359 | HAVE_WINSOCK2_H=0 | |
18360 | fi | |
8690e634 | 18361 | |
6ec2e0f5 | 18362 | |
c0c3707f CB |
18363 | if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then |
18364 | REPLACE_CLOSE=1 | |
18365 | fi | |
6ec2e0f5 SDJ |
18366 | |
18367 | ||
c0c3707f | 18368 | if test $REPLACE_CLOSE = 0; then |
6ec2e0f5 SDJ |
18369 | |
18370 | ||
6ec2e0f5 | 18371 | |
c0c3707f CB |
18372 | if test $ac_cv_func_fchdir = no; then |
18373 | HAVE_FCHDIR=0 | |
18374 | fi | |
6ec2e0f5 | 18375 | |
c0c3707f CB |
18376 | if test $HAVE_FCHDIR = 0; then |
18377 | REPLACE_CLOSE=1 | |
18378 | fi | |
18379 | fi | |
6ec2e0f5 SDJ |
18380 | |
18381 | ||
c0c3707f | 18382 | if test $REPLACE_CLOSE = 1; then |
6ec2e0f5 SDJ |
18383 | |
18384 | ||
18385 | ||
18386 | ||
18387 | ||
6ec2e0f5 SDJ |
18388 | |
18389 | ||
18390 | ||
c0c3707f | 18391 | gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext" |
6ec2e0f5 | 18392 | |
c0c3707f | 18393 | fi |
6ec2e0f5 | 18394 | |
6ec2e0f5 SDJ |
18395 | |
18396 | ||
18397 | ||
18398 | ||
c0c3707f | 18399 | GNULIB_CLOSE=1 |
6ec2e0f5 | 18400 | |
6ec2e0f5 | 18401 | |
6ec2e0f5 SDJ |
18402 | |
18403 | ||
18404 | ||
c0c3707f | 18405 | $as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h |
6ec2e0f5 SDJ |
18406 | |
18407 | ||
18408 | ||
18409 | ||
18410 | ||
c0c3707f CB |
18411 | |
18412 | for ac_func in closedir | |
18413 | do : | |
18414 | ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir" | |
18415 | if test "x$ac_cv_func_closedir" = xyes; then : | |
18416 | cat >>confdefs.h <<_ACEOF | |
18417 | #define HAVE_CLOSEDIR 1 | |
18418 | _ACEOF | |
18419 | ||
18420 | fi | |
18421 | done | |
18422 | ||
18423 | if test $ac_cv_func_closedir = no; then | |
18424 | HAVE_CLOSEDIR=0 | |
18425 | fi | |
6ec2e0f5 | 18426 | |
8690e634 JK |
18427 | |
18428 | ||
8690e634 | 18429 | |
c0c3707f CB |
18430 | if test $ac_cv_func_fchdir = no; then |
18431 | HAVE_FCHDIR=0 | |
6ec2e0f5 | 18432 | fi |
6a29c58e | 18433 | |
c0c3707f CB |
18434 | if test $HAVE_FCHDIR = 0; then |
18435 | if test $HAVE_CLOSEDIR = 1; then | |
18436 | REPLACE_CLOSEDIR=1 | |
18437 | fi | |
18438 | fi | |
6a29c58e | 18439 | |
c0c3707f CB |
18440 | case $host_os,$HAVE_CLOSEDIR in |
18441 | os2*,1) | |
18442 | REPLACE_CLOSEDIR=1;; | |
18443 | esac | |
d0ac1c44 | 18444 | |
c0c3707f | 18445 | if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then |
d0ac1c44 SM |
18446 | |
18447 | ||
d0ac1c44 SM |
18448 | |
18449 | ||
6a29c58e YQ |
18450 | |
18451 | ||
3d99e817 | 18452 | |
6ec2e0f5 | 18453 | |
c0c3707f | 18454 | gl_LIBOBJS="$gl_LIBOBJS closedir.$ac_objext" |
6ec2e0f5 | 18455 | |
6ec2e0f5 SDJ |
18456 | fi |
18457 | ||
18458 | ||
6ec2e0f5 SDJ |
18459 | |
18460 | ||
3d99e817 | 18461 | |
c0c3707f | 18462 | GNULIB_CLOSEDIR=1 |
3d99e817 AK |
18463 | |
18464 | ||
18465 | ||
18466 | ||
18467 | ||
c0c3707f | 18468 | $as_echo "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h |
3d99e817 AK |
18469 | |
18470 | ||
18471 | ||
698be2d8 CB |
18472 | |
18473 | ||
18474 | ||
18475 | ||
18476 | ||
18477 | ||
18478 | ||
18479 | ||
18480 | ||
18481 | ||
18482 | ||
18483 | if test $gl_cv_have_include_next = yes; then | |
18484 | gl_cv_next_ctype_h='<'ctype.h'>' | |
18485 | else | |
18486 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <ctype.h>" >&5 | |
18487 | $as_echo_n "checking absolute name of <ctype.h>... " >&6; } | |
18488 | if ${gl_cv_next_ctype_h+:} false; then : | |
18489 | $as_echo_n "(cached) " >&6 | |
18490 | else | |
18491 | ||
18492 | ||
18493 | ||
18494 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18495 | /* end confdefs.h. */ | |
18496 | #include <ctype.h> | |
18497 | _ACEOF | |
18498 | case "$host_os" in | |
18499 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
18500 | *) gl_absname_cpp="$ac_cpp" ;; | |
18501 | esac | |
18502 | ||
18503 | case "$host_os" in | |
18504 | mingw*) | |
18505 | gl_dirsep_regex='[/\\]' | |
18506 | ;; | |
18507 | *) | |
18508 | gl_dirsep_regex='\/' | |
18509 | ;; | |
18510 | esac | |
18511 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
18512 | gl_header_literal_regex=`echo 'ctype.h' \ | |
18513 | | sed -e "$gl_make_literal_regex_sed"` | |
18514 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
18515 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
18516 | s|^/[^/]|//&| | |
18517 | p | |
18518 | q | |
18519 | }' | |
18520 | ||
18521 | gl_cv_absolute_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
18522 | sed -n "$gl_absolute_header_sed"` | |
18523 | ||
18524 | gl_header=$gl_cv_absolute_ctype_h | |
18525 | gl_cv_next_ctype_h='"'$gl_header'"' | |
18526 | ||
18527 | ||
18528 | fi | |
18529 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5 | |
18530 | $as_echo "$gl_cv_next_ctype_h" >&6; } | |
18531 | fi | |
18532 | NEXT_CTYPE_H=$gl_cv_next_ctype_h | |
18533 | ||
18534 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
18535 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
18536 | gl_next_as_first_directive='<'ctype.h'>' | |
18537 | else | |
18538 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
18539 | gl_next_as_first_directive=$gl_cv_next_ctype_h | |
18540 | fi | |
18541 | NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive | |
18542 | ||
18543 | ||
18544 | ||
18545 | ||
18546 | ||
18547 | ||
18548 | ||
18549 | ||
18550 | ||
c0c3707f CB |
18551 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5 |
18552 | $as_echo_n "checking for d_ino member in directory struct... " >&6; } | |
18553 | if ${gl_cv_struct_dirent_d_ino+:} false; then : | |
6ec2e0f5 SDJ |
18554 | $as_echo_n "(cached) " >&6 |
18555 | else | |
18556 | if test "$cross_compiling" = yes; then : | |
18557 | case "$host_os" in | |
c0c3707f CB |
18558 | # Guess yes on glibc systems with Linux kernel. |
18559 | linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;; | |
18560 | # Guess yes on musl systems with Linux kernel. | |
18561 | linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;; | |
18562 | # Guess no on native Windows. | |
18563 | mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;; | |
18564 | # If we don't know, obey --enable-cross-guesses. | |
18565 | *) gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;; | |
18566 | esac | |
3d99e817 | 18567 | |
6ec2e0f5 SDJ |
18568 | else |
18569 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18570 | /* end confdefs.h. */ | |
c0c3707f CB |
18571 | #include <sys/types.h> |
18572 | #include <sys/stat.h> | |
18573 | #include <dirent.h> | |
3d99e817 | 18574 | |
6ec2e0f5 SDJ |
18575 | int |
18576 | main () | |
18577 | { | |
c0c3707f CB |
18578 | DIR *dp = opendir ("."); |
18579 | struct dirent *e; | |
18580 | struct stat st; | |
18581 | if (! dp) | |
18582 | return 1; | |
18583 | e = readdir (dp); | |
18584 | if (! e) | |
18585 | { closedir (dp); return 2; } | |
18586 | if (lstat (e->d_name, &st) != 0) | |
18587 | { closedir (dp); return 3; } | |
18588 | if (e->d_ino != st.st_ino) | |
18589 | { closedir (dp); return 4; } | |
18590 | closedir (dp); | |
18591 | return 0; | |
18592 | ||
6ec2e0f5 SDJ |
18593 | ; |
18594 | return 0; | |
18595 | } | |
3d99e817 | 18596 | _ACEOF |
6ec2e0f5 | 18597 | if ac_fn_c_try_run "$LINENO"; then : |
c0c3707f CB |
18598 | gl_cv_struct_dirent_d_ino=yes |
18599 | else | |
18600 | gl_cv_struct_dirent_d_ino=no | |
18601 | fi | |
18602 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
18603 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
18604 | fi | |
18605 | ||
18606 | fi | |
18607 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5 | |
18608 | $as_echo "$gl_cv_struct_dirent_d_ino" >&6; } | |
18609 | case "$gl_cv_struct_dirent_d_ino" in | |
18610 | *yes) | |
18611 | ||
18612 | $as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h | |
18613 | ||
18614 | ;; | |
18615 | esac | |
18616 | ||
18617 | ||
18618 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_type member in directory struct" >&5 | |
18619 | $as_echo_n "checking for d_type member in directory struct... " >&6; } | |
18620 | if ${gl_cv_struct_dirent_d_type+:} false; then : | |
18621 | $as_echo_n "(cached) " >&6 | |
18622 | else | |
18623 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18624 | /* end confdefs.h. */ | |
18625 | ||
18626 | #include <sys/types.h> | |
18627 | #include <dirent.h> | |
18628 | ||
18629 | int | |
18630 | main () | |
18631 | { | |
18632 | struct dirent dp; dp.d_type = 0; | |
18633 | ; | |
18634 | return 0; | |
18635 | } | |
18636 | _ACEOF | |
18637 | if ac_fn_c_try_link "$LINENO"; then : | |
18638 | gl_cv_struct_dirent_d_type=yes | |
6ec2e0f5 | 18639 | else |
c0c3707f | 18640 | gl_cv_struct_dirent_d_type=no |
3d99e817 | 18641 | fi |
c0c3707f CB |
18642 | rm -f core conftest.err conftest.$ac_objext \ |
18643 | conftest$ac_exeext conftest.$ac_ext | |
3d99e817 | 18644 | |
3d99e817 | 18645 | |
c0c3707f CB |
18646 | fi |
18647 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_type" >&5 | |
18648 | $as_echo "$gl_cv_struct_dirent_d_type" >&6; } | |
18649 | if test $gl_cv_struct_dirent_d_type = yes; then | |
3d99e817 | 18650 | |
c0c3707f | 18651 | $as_echo "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h |
3d99e817 | 18652 | |
c0c3707f | 18653 | fi |
3d99e817 | 18654 | |
0750520d | 18655 | |
0750520d | 18656 | |
0750520d | 18657 | |
0750520d PA |
18658 | |
18659 | ||
0750520d | 18660 | |
0750520d | 18661 | |
0750520d | 18662 | |
0750520d | 18663 | |
0750520d | 18664 | |
0750520d | 18665 | |
0750520d | 18666 | |
0750520d | 18667 | |
c0c3707f CB |
18668 | if test $gl_cv_have_include_next = yes; then |
18669 | gl_cv_next_dirent_h='<'dirent.h'>' | |
18670 | else | |
18671 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5 | |
18672 | $as_echo_n "checking absolute name of <dirent.h>... " >&6; } | |
18673 | if ${gl_cv_next_dirent_h+:} false; then : | |
18674 | $as_echo_n "(cached) " >&6 | |
18675 | else | |
0750520d | 18676 | |
c0c3707f | 18677 | if test $ac_cv_header_dirent_h = yes; then |
6ec2e0f5 | 18678 | |
472fa5ee SM |
18679 | |
18680 | ||
18681 | ||
c0c3707f CB |
18682 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
18683 | /* end confdefs.h. */ | |
18684 | #include <dirent.h> | |
18685 | _ACEOF | |
18686 | case "$host_os" in | |
18687 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
18688 | *) gl_absname_cpp="$ac_cpp" ;; | |
18689 | esac | |
472fa5ee | 18690 | |
c0c3707f CB |
18691 | case "$host_os" in |
18692 | mingw*) | |
18693 | gl_dirsep_regex='[/\\]' | |
18694 | ;; | |
18695 | *) | |
18696 | gl_dirsep_regex='\/' | |
18697 | ;; | |
18698 | esac | |
18699 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
18700 | gl_header_literal_regex=`echo 'dirent.h' \ | |
18701 | | sed -e "$gl_make_literal_regex_sed"` | |
18702 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
18703 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
18704 | s|^/[^/]|//&| | |
18705 | p | |
18706 | q | |
18707 | }' | |
472fa5ee | 18708 | |
c0c3707f CB |
18709 | gl_cv_absolute_dirent_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
18710 | sed -n "$gl_absolute_header_sed"` | |
6ec2e0f5 | 18711 | |
c0c3707f CB |
18712 | gl_header=$gl_cv_absolute_dirent_h |
18713 | gl_cv_next_dirent_h='"'$gl_header'"' | |
18714 | else | |
18715 | gl_cv_next_dirent_h='<'dirent.h'>' | |
18716 | fi | |
6ec2e0f5 SDJ |
18717 | |
18718 | ||
c0c3707f CB |
18719 | fi |
18720 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5 | |
18721 | $as_echo "$gl_cv_next_dirent_h" >&6; } | |
18722 | fi | |
18723 | NEXT_DIRENT_H=$gl_cv_next_dirent_h | |
472fa5ee | 18724 | |
c0c3707f CB |
18725 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
18726 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
18727 | gl_next_as_first_directive='<'dirent.h'>' | |
18728 | else | |
18729 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
18730 | gl_next_as_first_directive=$gl_cv_next_dirent_h | |
18731 | fi | |
18732 | NEXT_AS_FIRST_DIRECTIVE_DIRENT_H=$gl_next_as_first_directive | |
472fa5ee SM |
18733 | |
18734 | ||
18735 | ||
18736 | ||
c0c3707f CB |
18737 | if test $ac_cv_header_dirent_h = yes; then |
18738 | HAVE_DIRENT_H=1 | |
6ec2e0f5 | 18739 | else |
c0c3707f | 18740 | HAVE_DIRENT_H=0 |
6ec2e0f5 SDJ |
18741 | fi |
18742 | ||
6ec2e0f5 | 18743 | |
0750520d | 18744 | |
0750520d | 18745 | |
0750520d | 18746 | |
472fa5ee SM |
18747 | |
18748 | ||
18749 | ||
18750 | ||
18751 | ||
0750520d | 18752 | |
c0c3707f CB |
18753 | for ac_func in dirfd |
18754 | do : | |
18755 | ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd" | |
18756 | if test "x$ac_cv_func_dirfd" = xyes; then : | |
18757 | cat >>confdefs.h <<_ACEOF | |
18758 | #define HAVE_DIRFD 1 | |
18759 | _ACEOF | |
0750520d | 18760 | |
c0c3707f CB |
18761 | fi |
18762 | done | |
0750520d | 18763 | |
c0c3707f CB |
18764 | ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h> |
18765 | #include <dirent.h> | |
18766 | " | |
18767 | if test "x$ac_cv_have_decl_dirfd" = xyes; then : | |
18768 | ac_have_decl=1 | |
8690e634 | 18769 | else |
c0c3707f CB |
18770 | ac_have_decl=0 |
18771 | fi | |
8690e634 | 18772 | |
c0c3707f CB |
18773 | cat >>confdefs.h <<_ACEOF |
18774 | #define HAVE_DECL_DIRFD $ac_have_decl | |
18775 | _ACEOF | |
49e4877c | 18776 | |
c0c3707f CB |
18777 | if test $ac_cv_have_decl_dirfd = no; then |
18778 | HAVE_DECL_DIRFD=0 | |
18779 | fi | |
8690e634 | 18780 | |
c0c3707f CB |
18781 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5 |
18782 | $as_echo_n "checking whether dirfd is a macro... " >&6; } | |
18783 | if ${gl_cv_func_dirfd_macro+:} false; then : | |
18784 | $as_echo_n "(cached) " >&6 | |
18785 | else | |
6ec2e0f5 SDJ |
18786 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
18787 | /* end confdefs.h. */ | |
8690e634 | 18788 | |
c0c3707f CB |
18789 | #include <sys/types.h> |
18790 | #include <dirent.h> | |
18791 | #ifdef dirfd | |
18792 | dirent_header_defines_dirfd | |
6ec2e0f5 | 18793 | #endif |
8690e634 | 18794 | _ACEOF |
c0c3707f CB |
18795 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
18796 | $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1; then : | |
18797 | gl_cv_func_dirfd_macro=yes | |
6ec2e0f5 | 18798 | else |
c0c3707f | 18799 | gl_cv_func_dirfd_macro=no |
6ec2e0f5 | 18800 | fi |
c0c3707f | 18801 | rm -f conftest* |
472fa5ee | 18802 | |
c0c3707f CB |
18803 | fi |
18804 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5 | |
18805 | $as_echo "$gl_cv_func_dirfd_macro" >&6; } | |
472fa5ee | 18806 | |
c0c3707f CB |
18807 | # Use the replacement if we have no function or macro with that name, |
18808 | # or if OS/2 kLIBC whose dirfd() does not work. | |
18809 | # Replace only if the system declares dirfd already. | |
18810 | case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in | |
18811 | no,no,*,yes | *,*,os2*,yes) | |
18812 | REPLACE_DIRFD=1 | |
472fa5ee | 18813 | |
c0c3707f CB |
18814 | $as_echo "#define REPLACE_DIRFD 1" >>confdefs.h |
18815 | ;; | |
18816 | esac | |
472fa5ee | 18817 | |
c0c3707f CB |
18818 | if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \ |
18819 | || test $REPLACE_DIRFD = 1; then | |
6ec2e0f5 | 18820 | |
6ec2e0f5 SDJ |
18821 | |
18822 | ||
18823 | ||
18824 | ||
472fa5ee SM |
18825 | |
18826 | ||
18827 | ||
c0c3707f | 18828 | gl_LIBOBJS="$gl_LIBOBJS dirfd.$ac_objext" |
472fa5ee SM |
18829 | |
18830 | ||
c0c3707f CB |
18831 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5 |
18832 | $as_echo_n "checking how to get the file descriptor associated with an open DIR*... " >&6; } | |
18833 | if ${gl_cv_sys_dir_fd_member_name+:} false; then : | |
18834 | $as_echo_n "(cached) " >&6 | |
18835 | else | |
6ec2e0f5 | 18836 | |
c0c3707f CB |
18837 | dirfd_save_CFLAGS=$CFLAGS |
18838 | for ac_expr in d_fd dd_fd; do | |
6ec2e0f5 | 18839 | |
c0c3707f CB |
18840 | CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr" |
18841 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18842 | /* end confdefs.h. */ | |
6ec2e0f5 | 18843 | |
c0c3707f CB |
18844 | #include <sys/types.h> |
18845 | #include <dirent.h> | |
18846 | int | |
18847 | main () | |
18848 | { | |
18849 | DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME; | |
18850 | ; | |
18851 | return 0; | |
18852 | } | |
18853 | _ACEOF | |
18854 | if ac_fn_c_try_compile "$LINENO"; then : | |
18855 | dir_fd_found=yes | |
6ec2e0f5 | 18856 | |
c0c3707f CB |
18857 | fi |
18858 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
18859 | CFLAGS=$dirfd_save_CFLAGS | |
18860 | test "$dir_fd_found" = yes && break | |
18861 | done | |
18862 | test "$dir_fd_found" = yes || ac_expr=no_such_member | |
472fa5ee | 18863 | |
c0c3707f | 18864 | gl_cv_sys_dir_fd_member_name=$ac_expr |
472fa5ee SM |
18865 | |
18866 | ||
c0c3707f CB |
18867 | fi |
18868 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5 | |
18869 | $as_echo "$gl_cv_sys_dir_fd_member_name" >&6; } | |
18870 | if test $gl_cv_sys_dir_fd_member_name != no_such_member; then | |
472fa5ee | 18871 | |
c0c3707f CB |
18872 | cat >>confdefs.h <<_ACEOF |
18873 | #define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name | |
18874 | _ACEOF | |
472fa5ee | 18875 | |
6ec2e0f5 SDJ |
18876 | fi |
18877 | ||
6ec2e0f5 | 18878 | |
c0c3707f | 18879 | fi |
6ec2e0f5 SDJ |
18880 | |
18881 | ||
18882 | ||
18883 | ||
18884 | ||
c0c3707f | 18885 | GNULIB_DIRFD=1 |
6ec2e0f5 SDJ |
18886 | |
18887 | ||
18888 | ||
6ec2e0f5 | 18889 | |
8690e634 | 18890 | |
c0c3707f | 18891 | $as_echo "#define GNULIB_TEST_DIRFD 1" >>confdefs.h |
8690e634 JK |
18892 | |
18893 | ||
8690e634 JK |
18894 | |
18895 | ||
18896 | ||
c0c3707f CB |
18897 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 |
18898 | $as_echo_n "checking whether // is distinct from /... " >&6; } | |
18899 | if ${gl_cv_double_slash_root+:} false; then : | |
18900 | $as_echo_n "(cached) " >&6 | |
18901 | else | |
18902 | if test x"$cross_compiling" = xyes ; then | |
18903 | # When cross-compiling, there is no way to tell whether // is special | |
18904 | # short of a list of hosts. However, the only known hosts to date | |
18905 | # that have a distinct // are Apollo DomainOS (too old to port to), | |
18906 | # Cygwin, and z/OS. If anyone knows of another system for which // has | |
18907 | # special semantics and is distinct from /, please report it to | |
18908 | # <bug-gnulib@gnu.org>. | |
18909 | case $host in | |
18910 | *-cygwin | i370-ibm-openedition) | |
18911 | gl_cv_double_slash_root=yes ;; | |
18912 | *) | |
18913 | # Be optimistic and assume that / and // are the same when we | |
18914 | # don't know. | |
18915 | gl_cv_double_slash_root='unknown, assuming no' ;; | |
18916 | esac | |
18917 | else | |
18918 | set x `ls -di / // 2>/dev/null` | |
18919 | if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then | |
18920 | gl_cv_double_slash_root=no | |
18921 | else | |
18922 | gl_cv_double_slash_root=yes | |
18923 | fi | |
18924 | fi | |
18925 | fi | |
18926 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 | |
18927 | $as_echo "$gl_cv_double_slash_root" >&6; } | |
18928 | if test "$gl_cv_double_slash_root" = yes; then | |
6ec2e0f5 | 18929 | |
c0c3707f | 18930 | $as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h |
8690e634 | 18931 | |
c0c3707f | 18932 | fi |
8690e634 | 18933 | |
63ce7108 TT |
18934 | |
18935 | ||
18936 | ||
18937 | ||
c0c3707f CB |
18938 | if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then |
18939 | REPLACE_DUP=1 | |
18940 | fi | |
8690e634 JK |
18941 | |
18942 | ||
18943 | ||
18944 | ||
18945 | ||
c0c3707f CB |
18946 | if test $ac_cv_func_fchdir = no; then |
18947 | HAVE_FCHDIR=0 | |
18948 | fi | |
8690e634 | 18949 | |
c0c3707f CB |
18950 | if test $HAVE_FCHDIR = 0; then |
18951 | REPLACE_DUP=1 | |
18952 | fi | |
8690e634 | 18953 | |
c0c3707f CB |
18954 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup works" >&5 |
18955 | $as_echo_n "checking whether dup works... " >&6; } | |
18956 | if ${gl_cv_func_dup_works+:} false; then : | |
8690e634 JK |
18957 | $as_echo_n "(cached) " >&6 |
18958 | else | |
c0c3707f CB |
18959 | if test "$cross_compiling" = yes; then : |
18960 | case "$host_os" in | |
18961 | # Guess no on native Windows. | |
18962 | mingw*) gl_cv_func_dup_works="guessing no" ;; | |
18963 | *) gl_cv_func_dup_works="guessing yes" ;; | |
18964 | esac | |
8690e634 | 18965 | |
c0c3707f | 18966 | else |
4a626d0a | 18967 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8690e634 | 18968 | /* end confdefs.h. */ |
c0c3707f CB |
18969 | #include <unistd.h> |
18970 | #include <fcntl.h> | |
18971 | #include <errno.h> | |
9c9d63b1 PM |
18972 | |
18973 | ||
18974 | $gl_mda_defines | |
18975 | ||
c0c3707f CB |
18976 | int |
18977 | main () | |
18978 | { | |
18979 | /* On OS/2 kLIBC, dup does not work on a directory fd. */ | |
18980 | int fd = open (".", O_RDONLY); | |
18981 | return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0; | |
8690e634 | 18982 | |
c0c3707f CB |
18983 | ; |
18984 | return 0; | |
18985 | } | |
8690e634 | 18986 | |
c0c3707f CB |
18987 | _ACEOF |
18988 | if ac_fn_c_try_run "$LINENO"; then : | |
18989 | gl_cv_func_dup_works=yes | |
18990 | else | |
18991 | gl_cv_func_dup_works=no | |
18992 | fi | |
18993 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
18994 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
8690e634 | 18995 | fi |
8690e634 | 18996 | |
8690e634 | 18997 | |
c0c3707f CB |
18998 | fi |
18999 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup_works" >&5 | |
19000 | $as_echo "$gl_cv_func_dup_works" >&6; } | |
19001 | case "$gl_cv_func_dup_works" in | |
19002 | *yes) ;; | |
19003 | *) | |
19004 | REPLACE_DUP=1 | |
19005 | ;; | |
19006 | esac | |
8690e634 | 19007 | |
c0c3707f | 19008 | if test $REPLACE_DUP = 1; then |
8690e634 JK |
19009 | |
19010 | ||
19011 | ||
19012 | ||
6ec2e0f5 SDJ |
19013 | |
19014 | ||
19015 | ||
19016 | ||
c0c3707f | 19017 | gl_LIBOBJS="$gl_LIBOBJS dup.$ac_objext" |
8690e634 | 19018 | |
c0c3707f CB |
19019 | : |
19020 | fi | |
8690e634 | 19021 | |
5e8754f9 | 19022 | |
8690e634 JK |
19023 | |
19024 | ||
8839a007 | 19025 | |
c0c3707f | 19026 | GNULIB_DUP=1 |
63ce7108 | 19027 | |
63ce7108 | 19028 | |
63ce7108 | 19029 | |
6ec2e0f5 | 19030 | |
6ec2e0f5 | 19031 | |
c0c3707f | 19032 | $as_echo "#define GNULIB_TEST_DUP 1" >>confdefs.h |
6ec2e0f5 | 19033 | |
63ce7108 TT |
19034 | |
19035 | ||
472fa5ee SM |
19036 | |
19037 | ||
19038 | ||
9c9d63b1 | 19039 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5 |
c0c3707f CB |
19040 | $as_echo_n "checking whether dup2 works... " >&6; } |
19041 | if ${gl_cv_func_dup2_works+:} false; then : | |
6ec2e0f5 SDJ |
19042 | $as_echo_n "(cached) " >&6 |
19043 | else | |
19044 | if test "$cross_compiling" = yes; then : | |
19045 | case "$host_os" in | |
9c9d63b1 PM |
19046 | mingw*) # on this platform, dup2 always returns 0 for success |
19047 | gl_cv_func_dup2_works="guessing no" ;; | |
19048 | cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 | |
19049 | gl_cv_func_dup2_works="guessing no" ;; | |
19050 | aix* | freebsd*) | |
19051 | # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, | |
19052 | # not EBADF. | |
19053 | gl_cv_func_dup2_works="guessing no" ;; | |
19054 | haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. | |
19055 | gl_cv_func_dup2_works="guessing no" ;; | |
19056 | *-android*) # implemented using dup3(), which fails if oldfd == newfd | |
19057 | gl_cv_func_dup2_works="guessing no" ;; | |
19058 | os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. | |
19059 | gl_cv_func_dup2_works="guessing no" ;; | |
19060 | *) gl_cv_func_dup2_works="guessing yes" ;; | |
19061 | esac | |
63ce7108 TT |
19062 | else |
19063 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19064 | /* end confdefs.h. */ | |
19065 | ||
9c9d63b1 PM |
19066 | #include <errno.h> |
19067 | #include <fcntl.h> | |
19068 | #include <limits.h> | |
19069 | #include <sys/resource.h> | |
19070 | #include <unistd.h> | |
19071 | ||
19072 | ||
19073 | $gl_mda_defines | |
19074 | ||
19075 | #ifndef RLIM_SAVED_CUR | |
19076 | # define RLIM_SAVED_CUR RLIM_INFINITY | |
19077 | #endif | |
19078 | #ifndef RLIM_SAVED_MAX | |
19079 | # define RLIM_SAVED_MAX RLIM_INFINITY | |
19080 | #endif | |
63ce7108 TT |
19081 | |
19082 | int | |
19083 | main () | |
19084 | { | |
6ec2e0f5 | 19085 | int result = 0; |
9c9d63b1 PM |
19086 | int bad_fd = INT_MAX; |
19087 | struct rlimit rlim; | |
19088 | if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 | |
19089 | && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX | |
19090 | && rlim.rlim_cur != RLIM_INFINITY | |
19091 | && rlim.rlim_cur != RLIM_SAVED_MAX | |
19092 | && rlim.rlim_cur != RLIM_SAVED_CUR) | |
19093 | bad_fd = rlim.rlim_cur; | |
19094 | #ifdef FD_CLOEXEC | |
19095 | if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) | |
19096 | result |= 1; | |
19097 | #endif | |
19098 | if (dup2 (1, 1) != 1) | |
19099 | result |= 2; | |
19100 | #ifdef FD_CLOEXEC | |
19101 | if (fcntl (1, F_GETFD) != FD_CLOEXEC) | |
19102 | result |= 4; | |
19103 | #endif | |
19104 | close (0); | |
19105 | if (dup2 (0, 0) != -1) | |
19106 | result |= 8; | |
19107 | /* Many gnulib modules require POSIX conformance of EBADF. */ | |
19108 | if (dup2 (2, bad_fd) == -1 && errno != EBADF) | |
19109 | result |= 16; | |
19110 | /* Flush out some cygwin core dumps. */ | |
19111 | if (dup2 (2, -1) != -1 || errno != EBADF) | |
19112 | result |= 32; | |
19113 | dup2 (2, 255); | |
19114 | dup2 (2, 256); | |
19115 | /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ | |
19116 | { | |
19117 | int fd = open (".", O_RDONLY); | |
19118 | if (fd == -1) | |
19119 | result |= 64; | |
19120 | else if (dup2 (fd, fd + 1) == -1) | |
19121 | result |= 128; | |
19122 | close (fd); | |
19123 | } | |
19124 | return result; | |
63ce7108 TT |
19125 | ; |
19126 | return 0; | |
19127 | } | |
c0c3707f | 19128 | |
63ce7108 TT |
19129 | _ACEOF |
19130 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 19131 | gl_cv_func_dup2_works=yes |
63ce7108 | 19132 | else |
c0c3707f | 19133 | gl_cv_func_dup2_works=no |
63ce7108 TT |
19134 | fi |
19135 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
19136 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
19137 | fi | |
19138 | ||
c0c3707f | 19139 | |
63ce7108 | 19140 | fi |
c0c3707f CB |
19141 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5 |
19142 | $as_echo "$gl_cv_func_dup2_works" >&6; } | |
9c9d63b1 PM |
19143 | case "$gl_cv_func_dup2_works" in |
19144 | *yes) ;; | |
19145 | *) | |
19146 | REPLACE_DUP2=1 | |
19147 | for ac_func in setdtablesize | |
c0c3707f CB |
19148 | do : |
19149 | ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize" | |
19150 | if test "x$ac_cv_func_setdtablesize" = xyes; then : | |
19151 | cat >>confdefs.h <<_ACEOF | |
19152 | #define HAVE_SETDTABLESIZE 1 | |
19153 | _ACEOF | |
19154 | ||
19155 | fi | |
19156 | done | |
19157 | ||
9c9d63b1 PM |
19158 | ;; |
19159 | esac | |
63ce7108 | 19160 | |
09607c9e TT |
19161 | |
19162 | ||
19163 | ||
c0c3707f CB |
19164 | if test $ac_cv_func_fchdir = no; then |
19165 | HAVE_FCHDIR=0 | |
19166 | fi | |
4a626d0a | 19167 | |
c0c3707f | 19168 | if test $HAVE_FCHDIR = 0; then |
9c9d63b1 | 19169 | REPLACE_DUP2=1 |
c0c3707f | 19170 | fi |
4a626d0a PA |
19171 | |
19172 | ||
9c9d63b1 | 19173 | if test $REPLACE_DUP2 = 1; then |
4a626d0a PA |
19174 | |
19175 | ||
19176 | ||
19177 | ||
19178 | ||
19179 | ||
4a626d0a | 19180 | |
4a626d0a | 19181 | |
c0c3707f | 19182 | gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" |
4a626d0a PA |
19183 | |
19184 | ||
c0c3707f | 19185 | fi |
4a626d0a PA |
19186 | |
19187 | ||
19188 | ||
19189 | ||
19190 | ||
c0c3707f | 19191 | GNULIB_DUP2=1 |
4a626d0a PA |
19192 | |
19193 | ||
19194 | ||
19195 | ||
09607c9e | 19196 | |
c0c3707f | 19197 | $as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h |
09607c9e TT |
19198 | |
19199 | ||
472fa5ee SM |
19200 | |
19201 | ||
19202 | ||
19203 | ||
19204 | ||
09607c9e | 19205 | |
6ec2e0f5 | 19206 | |
c0c3707f | 19207 | GNULIB_ENVIRON=1 |
6ec2e0f5 | 19208 | |
09607c9e | 19209 | |
09607c9e | 19210 | |
6ec2e0f5 SDJ |
19211 | |
19212 | ||
c0c3707f | 19213 | $as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h |
6ec2e0f5 SDJ |
19214 | |
19215 | ||
6ec2e0f5 | 19216 | |
5e8754f9 | 19217 | |
6ec2e0f5 | 19218 | |
c0c3707f CB |
19219 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 |
19220 | $as_echo_n "checking for error_at_line... " >&6; } | |
19221 | if ${ac_cv_lib_error_at_line+:} false; then : | |
09607c9e | 19222 | $as_echo_n "(cached) " >&6 |
4a626d0a PA |
19223 | else |
19224 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19225 | /* end confdefs.h. */ | |
c0c3707f CB |
19226 | #include <error.h> |
19227 | int | |
19228 | main () | |
19229 | { | |
19230 | error_at_line (0, 0, "", 0, "an error occurred"); | |
19231 | ; | |
4a626d0a PA |
19232 | return 0; |
19233 | } | |
19234 | _ACEOF | |
c0c3707f CB |
19235 | if ac_fn_c_try_link "$LINENO"; then : |
19236 | ac_cv_lib_error_at_line=yes | |
4a626d0a | 19237 | else |
c0c3707f | 19238 | ac_cv_lib_error_at_line=no |
6ec2e0f5 | 19239 | fi |
c0c3707f CB |
19240 | rm -f core conftest.err conftest.$ac_objext \ |
19241 | conftest$ac_exeext conftest.$ac_ext | |
6ec2e0f5 | 19242 | fi |
c0c3707f CB |
19243 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 |
19244 | $as_echo "$ac_cv_lib_error_at_line" >&6; } | |
09607c9e | 19245 | |
c0c3707f | 19246 | if test $ac_cv_lib_error_at_line = no; then |
09607c9e TT |
19247 | |
19248 | ||
19249 | ||
19250 | ||
19251 | ||
19252 | ||
19253 | ||
19254 | ||
c0c3707f | 19255 | gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext" |
09607c9e | 19256 | |
4a626d0a | 19257 | |
09607c9e | 19258 | |
c0c3707f | 19259 | : |
4a626d0a | 19260 | |
c0c3707f | 19261 | fi |
4a626d0a | 19262 | |
4a626d0a | 19263 | |
09607c9e | 19264 | |
09607c9e | 19265 | |
09607c9e TT |
19266 | |
19267 | ||
09607c9e | 19268 | |
c0c3707f CB |
19269 | if test $ac_cv_have_decl_fchdir = no; then |
19270 | HAVE_DECL_FCHDIR=0 | |
19271 | fi | |
09607c9e TT |
19272 | |
19273 | ||
c0c3707f | 19274 | if test $HAVE_FCHDIR = 0; then |
09607c9e TT |
19275 | |
19276 | ||
19277 | ||
c0c3707f CB |
19278 | |
19279 | ||
19280 | ||
19281 | ||
19282 | ||
19283 | gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext" | |
19284 | ||
19285 | : | |
19286 | ||
19287 | $as_echo "#define REPLACE_FCHDIR 1" >>confdefs.h | |
19288 | ||
19289 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open can visit directories" >&5 | |
19290 | $as_echo_n "checking whether open can visit directories... " >&6; } | |
19291 | if ${gl_cv_func_open_directory_works+:} false; then : | |
19292 | $as_echo_n "(cached) " >&6 | |
3d99e817 | 19293 | else |
c0c3707f CB |
19294 | if test "$cross_compiling" = yes; then : |
19295 | case "$host_os" in | |
9c9d63b1 PM |
19296 | # Guess yes on Linux systems. |
19297 | linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;; | |
19298 | # Guess yes on glibc systems. | |
19299 | *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;; | |
19300 | # Guess no on native Windows. | |
19301 | mingw*) gl_cv_func_open_directory_works="guessing no" ;; | |
19302 | # If we don't know, obey --enable-cross-guesses. | |
19303 | *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;; | |
19304 | esac | |
c0c3707f CB |
19305 | |
19306 | else | |
19307 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19308 | /* end confdefs.h. */ | |
19309 | #include <fcntl.h> | |
19310 | ||
9c9d63b1 PM |
19311 | |
19312 | $gl_mda_defines | |
19313 | ||
c0c3707f CB |
19314 | int |
19315 | main () | |
19316 | { | |
19317 | return open(".", O_RDONLY) < 0; | |
19318 | ; | |
19319 | return 0; | |
19320 | } | |
19321 | _ACEOF | |
19322 | if ac_fn_c_try_run "$LINENO"; then : | |
19323 | gl_cv_func_open_directory_works=yes | |
19324 | else | |
19325 | gl_cv_func_open_directory_works=no | |
19326 | fi | |
19327 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
19328 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
3d99e817 AK |
19329 | fi |
19330 | ||
c0c3707f CB |
19331 | fi |
19332 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_directory_works" >&5 | |
19333 | $as_echo "$gl_cv_func_open_directory_works" >&6; } | |
19334 | case "$gl_cv_func_open_directory_works" in | |
19335 | *yes) ;; | |
19336 | *) | |
3d99e817 | 19337 | |
c0c3707f | 19338 | $as_echo "#define REPLACE_OPEN_DIRECTORY 1" >>confdefs.h |
09607c9e | 19339 | |
c0c3707f CB |
19340 | ;; |
19341 | esac | |
19342 | fi | |
8690e634 | 19343 | |
8690e634 | 19344 | |
8690e634 | 19345 | |
8690e634 | 19346 | |
8690e634 | 19347 | |
6ec2e0f5 | 19348 | |
c0c3707f | 19349 | GNULIB_FCHDIR=1 |
6ec2e0f5 SDJ |
19350 | |
19351 | ||
6ec2e0f5 | 19352 | |
8690e634 JK |
19353 | |
19354 | ||
c0c3707f | 19355 | $as_echo "#define GNULIB_TEST_FCHDIR 1" >>confdefs.h |
8690e634 JK |
19356 | |
19357 | ||
19358 | ||
6ec2e0f5 SDJ |
19359 | |
19360 | ||
19361 | ||
6ec2e0f5 | 19362 | |
8690e634 | 19363 | |
c0c3707f | 19364 | if test $ac_cv_func_fcntl = no; then |
8690e634 JK |
19365 | |
19366 | ||
6ec2e0f5 | 19367 | |
c0c3707f CB |
19368 | if test $ac_cv_func_fcntl = no; then |
19369 | HAVE_FCNTL=0 | |
19370 | else | |
19371 | REPLACE_FCNTL=1 | |
19372 | fi | |
5e8754f9 | 19373 | |
c0c3707f CB |
19374 | else |
19375 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5 | |
19376 | $as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; } | |
19377 | if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then : | |
8690e634 | 19378 | $as_echo_n "(cached) " >&6 |
6ec2e0f5 | 19379 | else |
c0c3707f CB |
19380 | if test "$cross_compiling" = yes; then : |
19381 | case $host_os in | |
19382 | aix* | cygwin* | haiku*) | |
19383 | gl_cv_func_fcntl_f_dupfd_works="guessing no" ;; | |
19384 | *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;; | |
19385 | esac | |
19386 | else | |
19387 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19388 | /* end confdefs.h. */ | |
19389 | #include <errno.h> | |
19390 | #include <fcntl.h> | |
19391 | #include <limits.h> | |
19392 | #include <sys/resource.h> | |
19393 | #include <unistd.h> | |
9c9d63b1 PM |
19394 | |
19395 | ||
19396 | $gl_mda_defines | |
19397 | ||
c0c3707f CB |
19398 | #ifndef RLIM_SAVED_CUR |
19399 | # define RLIM_SAVED_CUR RLIM_INFINITY | |
19400 | #endif | |
19401 | #ifndef RLIM_SAVED_MAX | |
19402 | # define RLIM_SAVED_MAX RLIM_INFINITY | |
19403 | #endif | |
19404 | ||
19405 | int | |
19406 | main () | |
19407 | { | |
19408 | int result = 0; | |
19409 | int bad_fd = INT_MAX; | |
19410 | struct rlimit rlim; | |
19411 | if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 | |
19412 | && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX | |
19413 | && rlim.rlim_cur != RLIM_INFINITY | |
19414 | && rlim.rlim_cur != RLIM_SAVED_MAX | |
19415 | && rlim.rlim_cur != RLIM_SAVED_CUR) | |
19416 | bad_fd = rlim.rlim_cur; | |
19417 | if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; | |
19418 | if (errno != EINVAL) result |= 2; | |
19419 | if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; | |
19420 | if (errno != EINVAL) result |= 8; | |
19421 | /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */ | |
19422 | { | |
19423 | int fd; | |
19424 | fd = open (".", O_RDONLY); | |
19425 | if (fd == -1) | |
19426 | result |= 16; | |
19427 | else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1) | |
19428 | result |= 32; | |
19429 | ||
19430 | close (fd); | |
19431 | } | |
19432 | return result; | |
19433 | ; | |
19434 | return 0; | |
19435 | } | |
19436 | _ACEOF | |
19437 | if ac_fn_c_try_run "$LINENO"; then : | |
19438 | gl_cv_func_fcntl_f_dupfd_works=yes | |
19439 | else | |
19440 | gl_cv_func_fcntl_f_dupfd_works=no | |
19441 | fi | |
19442 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
19443 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
19444 | fi | |
19445 | ||
19446 | fi | |
19447 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5 | |
19448 | $as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; } | |
19449 | case $gl_cv_func_fcntl_f_dupfd_works in | |
19450 | *yes) ;; | |
19451 | *) | |
19452 | ||
19453 | ||
19454 | if test $ac_cv_func_fcntl = no; then | |
19455 | HAVE_FCNTL=0 | |
19456 | else | |
19457 | REPLACE_FCNTL=1 | |
19458 | fi | |
19459 | ||
19460 | ||
19461 | $as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h | |
19462 | ;; | |
19463 | esac | |
19464 | ||
9c9d63b1 | 19465 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5 |
c0c3707f CB |
19466 | $as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; } |
19467 | if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then : | |
19468 | $as_echo_n "(cached) " >&6 | |
9c9d63b1 PM |
19469 | else |
19470 | if test "$cross_compiling" = yes; then : | |
19471 | case "$host_os" in | |
19472 | # Guess no on NetBSD. | |
19473 | netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;; | |
19474 | *) gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" ;; | |
19475 | esac | |
19476 | ||
8690e634 JK |
19477 | else |
19478 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19479 | /* end confdefs.h. */ | |
c0c3707f | 19480 | #include <fcntl.h> |
9c9d63b1 PM |
19481 | #include <unistd.h> |
19482 | int main (int argc, char *argv[]) | |
19483 | { | |
19484 | if (argc == 1) | |
19485 | /* parent process */ | |
19486 | { | |
19487 | if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0) | |
19488 | return 1; | |
19489 | return execl ("./conftest", "./conftest", "child", NULL); | |
19490 | } | |
19491 | else | |
19492 | /* child process */ | |
19493 | return (fcntl (10, F_GETFL) < 0 ? 0 : 42); | |
19494 | } | |
c0c3707f | 19495 | |
c0c3707f | 19496 | |
c0c3707f | 19497 | _ACEOF |
9c9d63b1 | 19498 | if ac_fn_c_try_run "$LINENO"; then : |
c0c3707f CB |
19499 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
19500 | /* end confdefs.h. */ | |
19501 | ||
19502 | #ifdef __linux__ | |
19503 | /* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace | |
19504 | it to support the semantics on older kernels that failed with EINVAL. */ | |
19505 | choke me | |
19506 | #endif | |
8690e634 | 19507 | |
8690e634 JK |
19508 | int |
19509 | main () | |
19510 | { | |
19511 | ||
19512 | ; | |
19513 | return 0; | |
19514 | } | |
19515 | _ACEOF | |
c0c3707f CB |
19516 | if ac_fn_c_try_compile "$LINENO"; then : |
19517 | gl_cv_func_fcntl_f_dupfd_cloexec=yes | |
8690e634 | 19518 | else |
c0c3707f | 19519 | gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check" |
8690e634 | 19520 | fi |
c0c3707f | 19521 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
9c9d63b1 | 19522 | |
c0c3707f CB |
19523 | else |
19524 | gl_cv_func_fcntl_f_dupfd_cloexec=no | |
19525 | fi | |
9c9d63b1 PM |
19526 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
19527 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
19528 | fi | |
19529 | ||
19530 | ||
8690e634 | 19531 | fi |
c0c3707f CB |
19532 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5 |
19533 | $as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; } | |
9c9d63b1 PM |
19534 | case "$gl_cv_func_fcntl_f_dupfd_cloexec" in |
19535 | *yes) ;; | |
19536 | *) | |
8690e634 | 19537 | |
c0c3707f CB |
19538 | |
19539 | if test $ac_cv_func_fcntl = no; then | |
19540 | HAVE_FCNTL=0 | |
5e8754f9 | 19541 | else |
c0c3707f CB |
19542 | REPLACE_FCNTL=1 |
19543 | fi | |
19544 | ||
9c9d63b1 PM |
19545 | ;; |
19546 | esac | |
8690e634 JK |
19547 | fi |
19548 | ||
19549 | ||
8690e634 | 19550 | |
8690e634 | 19551 | |
c0c3707f CB |
19552 | if test $ac_cv_func_fchdir = no; then |
19553 | HAVE_FCHDIR=0 | |
19554 | fi | |
6ec2e0f5 | 19555 | |
c0c3707f | 19556 | if test $HAVE_FCHDIR = 0; then |
6ec2e0f5 SDJ |
19557 | |
19558 | ||
19559 | ||
c0c3707f CB |
19560 | if test $ac_cv_func_fcntl = no; then |
19561 | HAVE_FCNTL=0 | |
19562 | else | |
19563 | REPLACE_FCNTL=1 | |
19564 | fi | |
6ec2e0f5 | 19565 | |
c0c3707f | 19566 | fi |
6ec2e0f5 SDJ |
19567 | |
19568 | ||
c0c3707f | 19569 | if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then |
6ec2e0f5 | 19570 | |
6ec2e0f5 SDJ |
19571 | |
19572 | ||
5e8754f9 SDJ |
19573 | |
19574 | ||
8690e634 | 19575 | |
8690e634 JK |
19576 | |
19577 | ||
c0c3707f | 19578 | gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext" |
472fa5ee | 19579 | |
c0c3707f | 19580 | fi |
472fa5ee SM |
19581 | |
19582 | ||
19583 | ||
19584 | ||
19585 | ||
c0c3707f | 19586 | GNULIB_FCNTL=1 |
472fa5ee SM |
19587 | |
19588 | ||
19589 | ||
19590 | ||
19591 | ||
c0c3707f | 19592 | $as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h |
472fa5ee SM |
19593 | |
19594 | ||
19595 | ||
19596 | ||
19597 | ||
19598 | ||
19599 | ||
19600 | ||
19601 | ||
19602 | ||
19603 | ||
19604 | ||
19605 | ||
19606 | ||
c0c3707f CB |
19607 | if test $gl_cv_have_include_next = yes; then |
19608 | gl_cv_next_fcntl_h='<'fcntl.h'>' | |
19609 | else | |
19610 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5 | |
19611 | $as_echo_n "checking absolute name of <fcntl.h>... " >&6; } | |
19612 | if ${gl_cv_next_fcntl_h+:} false; then : | |
19613 | $as_echo_n "(cached) " >&6 | |
19614 | else | |
472fa5ee SM |
19615 | |
19616 | ||
472fa5ee | 19617 | |
c0c3707f CB |
19618 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
19619 | /* end confdefs.h. */ | |
19620 | #include <fcntl.h> | |
19621 | _ACEOF | |
19622 | case "$host_os" in | |
19623 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
19624 | *) gl_absname_cpp="$ac_cpp" ;; | |
19625 | esac | |
472fa5ee | 19626 | |
c0c3707f CB |
19627 | case "$host_os" in |
19628 | mingw*) | |
19629 | gl_dirsep_regex='[/\\]' | |
19630 | ;; | |
19631 | *) | |
19632 | gl_dirsep_regex='\/' | |
19633 | ;; | |
19634 | esac | |
19635 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
19636 | gl_header_literal_regex=`echo 'fcntl.h' \ | |
19637 | | sed -e "$gl_make_literal_regex_sed"` | |
19638 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
19639 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
19640 | s|^/[^/]|//&| | |
19641 | p | |
19642 | q | |
19643 | }' | |
472fa5ee | 19644 | |
c0c3707f CB |
19645 | gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
19646 | sed -n "$gl_absolute_header_sed"` | |
472fa5ee | 19647 | |
c0c3707f CB |
19648 | gl_header=$gl_cv_absolute_fcntl_h |
19649 | gl_cv_next_fcntl_h='"'$gl_header'"' | |
8690e634 JK |
19650 | |
19651 | ||
c0c3707f CB |
19652 | fi |
19653 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5 | |
19654 | $as_echo "$gl_cv_next_fcntl_h" >&6; } | |
19655 | fi | |
19656 | NEXT_FCNTL_H=$gl_cv_next_fcntl_h | |
8690e634 | 19657 | |
c0c3707f CB |
19658 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
19659 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
19660 | gl_next_as_first_directive='<'fcntl.h'>' | |
19661 | else | |
19662 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
19663 | gl_next_as_first_directive=$gl_cv_next_fcntl_h | |
19664 | fi | |
19665 | NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive | |
8690e634 JK |
19666 | |
19667 | ||
19668 | ||
19669 | ||
5e8754f9 SDJ |
19670 | |
19671 | ||
19672 | ||
19673 | ||
472fa5ee SM |
19674 | |
19675 | ||
19676 | ||
19677 | ||
19678 | ||
19679 | ||
19680 | ||
5e8754f9 | 19681 | cat >>confdefs.h <<_ACEOF |
c0c3707f | 19682 | #define GNULIB_FD_SAFER_FLAG 1 |
5e8754f9 | 19683 | _ACEOF |
472fa5ee SM |
19684 | |
19685 | ||
c0c3707f CB |
19686 | |
19687 | ||
19688 | ||
19689 | ||
19690 | ||
19691 | ac_fn_c_check_decl "$LINENO" "fdopendir" "ac_cv_have_decl_fdopendir" " | |
19692 | #include <dirent.h> | |
19693 | ||
5e8754f9 | 19694 | " |
c0c3707f | 19695 | if test "x$ac_cv_have_decl_fdopendir" = xyes; then : |
5e8754f9 SDJ |
19696 | ac_have_decl=1 |
19697 | else | |
19698 | ac_have_decl=0 | |
19699 | fi | |
472fa5ee | 19700 | |
5e8754f9 | 19701 | cat >>confdefs.h <<_ACEOF |
c0c3707f | 19702 | #define HAVE_DECL_FDOPENDIR $ac_have_decl |
5e8754f9 | 19703 | _ACEOF |
c0c3707f | 19704 | if test $ac_have_decl = 1; then : |
472fa5ee | 19705 | |
c0c3707f CB |
19706 | else |
19707 | HAVE_DECL_FDOPENDIR=0 | |
19708 | fi | |
472fa5ee SM |
19709 | |
19710 | ||
c0c3707f CB |
19711 | if test $ac_cv_func_fdopendir = no; then |
19712 | HAVE_FDOPENDIR=0 | |
19713 | else | |
19714 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fdopendir works" >&5 | |
19715 | $as_echo_n "checking whether fdopendir works... " >&6; } | |
19716 | if ${gl_cv_func_fdopendir_works+:} false; then : | |
19717 | $as_echo_n "(cached) " >&6 | |
19718 | else | |
19719 | if test "$cross_compiling" = yes; then : | |
19720 | case "$host_os" in | |
19721 | # Guess yes on glibc systems. | |
19722 | *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;; | |
19723 | # Guess yes on musl systems. | |
19724 | *-musl*) gl_cv_func_fdopendir_works="guessing yes" ;; | |
19725 | # If we don't know, obey --enable-cross-guesses. | |
19726 | *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;; | |
19727 | esac | |
472fa5ee | 19728 | |
c0c3707f CB |
19729 | else |
19730 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19731 | /* end confdefs.h. */ | |
472fa5ee | 19732 | |
c0c3707f CB |
19733 | #include <dirent.h> |
19734 | #include <fcntl.h> | |
19735 | #include <unistd.h> | |
9c9d63b1 PM |
19736 | |
19737 | ||
19738 | $gl_mda_defines | |
19739 | ||
c0c3707f CB |
19740 | #if !HAVE_DECL_FDOPENDIR |
19741 | extern | |
19742 | # ifdef __cplusplus | |
19743 | "C" | |
19744 | # endif | |
19745 | DIR *fdopendir (int); | |
19746 | #endif | |
472fa5ee | 19747 | |
c0c3707f CB |
19748 | int |
19749 | main () | |
19750 | { | |
19751 | int result = 0; | |
9c9d63b1 PM |
19752 | int fd = open ("conftest.c", O_RDONLY); |
19753 | if (fd < 0) result |= 1; | |
19754 | if (fdopendir (fd)) result |= 2; | |
19755 | if (close (fd)) result |= 4; | |
19756 | return result; | |
19757 | ||
c0c3707f CB |
19758 | ; |
19759 | return 0; | |
19760 | } | |
19761 | _ACEOF | |
19762 | if ac_fn_c_try_run "$LINENO"; then : | |
19763 | gl_cv_func_fdopendir_works=yes | |
19764 | else | |
19765 | gl_cv_func_fdopendir_works=no | |
19766 | fi | |
19767 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
19768 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
19769 | fi | |
472fa5ee | 19770 | |
c0c3707f CB |
19771 | fi |
19772 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopendir_works" >&5 | |
19773 | $as_echo "$gl_cv_func_fdopendir_works" >&6; } | |
19774 | case "$gl_cv_func_fdopendir_works" in | |
19775 | *yes) ;; | |
19776 | *) | |
19777 | REPLACE_FDOPENDIR=1 | |
19778 | ;; | |
19779 | esac | |
19780 | fi | |
472fa5ee | 19781 | |
c0c3707f | 19782 | if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then |
472fa5ee SM |
19783 | |
19784 | ||
19785 | ||
19786 | ||
19787 | ||
98399780 | 19788 | |
5e8754f9 SDJ |
19789 | |
19790 | ||
c0c3707f | 19791 | gl_LIBOBJS="$gl_LIBOBJS fdopendir.$ac_objext" |
5e8754f9 | 19792 | |
c0c3707f | 19793 | fi |
5e8754f9 SDJ |
19794 | |
19795 | ||
19796 | ||
19797 | ||
19798 | ||
c0c3707f | 19799 | GNULIB_FDOPENDIR=1 |
5e8754f9 SDJ |
19800 | |
19801 | ||
19802 | ||
19803 | ||
19804 | ||
c0c3707f | 19805 | $as_echo "#define GNULIB_TEST_FDOPENDIR 1" >>confdefs.h |
5e8754f9 SDJ |
19806 | |
19807 | ||
5e8754f9 SDJ |
19808 | |
19809 | ||
19810 | ||
c0c3707f CB |
19811 | cat >>confdefs.h <<_ACEOF |
19812 | #define GNULIB_FDOPENDIR 1 | |
19813 | _ACEOF | |
5e8754f9 SDJ |
19814 | |
19815 | ||
19816 | ||
5e8754f9 SDJ |
19817 | |
19818 | ||
32e2770e MF |
19819 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ffs" >&5 |
19820 | $as_echo_n "checking for ffs... " >&6; } | |
19821 | if ${gl_cv_func_ffs+:} false; then : | |
19822 | $as_echo_n "(cached) " >&6 | |
19823 | else | |
19824 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19825 | /* end confdefs.h. */ | |
19826 | #include <strings.h> | |
19827 | int x; | |
19828 | ||
19829 | int | |
19830 | main () | |
19831 | { | |
19832 | int (*func) (int) = ffs; | |
19833 | return func (x); | |
19834 | ||
19835 | ; | |
19836 | return 0; | |
19837 | } | |
19838 | ||
19839 | _ACEOF | |
19840 | if ac_fn_c_try_link "$LINENO"; then : | |
19841 | gl_cv_func_ffs=yes | |
19842 | else | |
19843 | gl_cv_func_ffs=no | |
19844 | fi | |
19845 | rm -f core conftest.err conftest.$ac_objext \ | |
19846 | conftest$ac_exeext conftest.$ac_ext | |
19847 | ||
19848 | fi | |
19849 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ffs" >&5 | |
19850 | $as_echo "$gl_cv_func_ffs" >&6; } | |
19851 | if test $gl_cv_func_ffs = no; then | |
19852 | HAVE_FFS=0 | |
19853 | fi | |
19854 | ||
19855 | if test $HAVE_FFS = 0; then | |
19856 | ||
19857 | ||
19858 | ||
19859 | ||
19860 | ||
19861 | ||
19862 | ||
19863 | ||
19864 | gl_LIBOBJS="$gl_LIBOBJS ffs.$ac_objext" | |
19865 | ||
19866 | fi | |
19867 | ||
19868 | ||
19869 | ||
19870 | ||
19871 | ||
19872 | GNULIB_FFS=1 | |
19873 | ||
19874 | ||
19875 | ||
19876 | ||
19877 | ||
19878 | ||
19879 | ||
5e8754f9 | 19880 | |
c0c3707f CB |
19881 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5 |
19882 | $as_echo_n "checking for flexible array member... " >&6; } | |
19883 | if ${ac_cv_c_flexmember+:} false; then : | |
5e8754f9 | 19884 | $as_echo_n "(cached) " >&6 |
6ec2e0f5 | 19885 | else |
c0c3707f | 19886 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5e8754f9 | 19887 | /* end confdefs.h. */ |
c0c3707f CB |
19888 | #include <stdlib.h> |
19889 | #include <stdio.h> | |
19890 | #include <stddef.h> | |
19891 | struct m { struct m *next, **list; char name[]; }; | |
19892 | struct s { struct s *p; struct m *m; int n; double d[]; }; | |
5e8754f9 SDJ |
19893 | int |
19894 | main () | |
19895 | { | |
c0c3707f CB |
19896 | int m = getchar (); |
19897 | size_t nbytes = offsetof (struct s, d) + m * sizeof (double); | |
19898 | nbytes += sizeof (struct s) - 1; | |
19899 | nbytes -= nbytes % sizeof (struct s); | |
19900 | struct s *p = malloc (nbytes); | |
19901 | p->p = p; | |
19902 | p->m = NULL; | |
19903 | p->d[0] = 0.0; | |
19904 | return p->d != (double *) NULL; | |
5e8754f9 SDJ |
19905 | ; |
19906 | return 0; | |
19907 | } | |
7a6dbc2f | 19908 | _ACEOF |
c0c3707f CB |
19909 | if ac_fn_c_try_compile "$LINENO"; then : |
19910 | ac_cv_c_flexmember=yes | |
5e8754f9 | 19911 | else |
c0c3707f | 19912 | ac_cv_c_flexmember=no |
5e8754f9 | 19913 | fi |
c0c3707f | 19914 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
5e8754f9 | 19915 | fi |
c0c3707f CB |
19916 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5 |
19917 | $as_echo "$ac_cv_c_flexmember" >&6; } | |
19918 | if test $ac_cv_c_flexmember = yes; then | |
19919 | ||
19920 | $as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h | |
5e8754f9 | 19921 | |
c0c3707f CB |
19922 | else |
19923 | $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h | |
98399780 | 19924 | |
c0c3707f | 19925 | fi |
98399780 | 19926 | |
472fa5ee SM |
19927 | |
19928 | ||
19929 | ||
c0c3707f CB |
19930 | FLOAT_H= |
19931 | REPLACE_FLOAT_LDBL=0 | |
19932 | case "$host_os" in | |
19933 | aix* | beos* | openbsd* | mirbsd* | irix*) | |
19934 | FLOAT_H=float.h | |
19935 | ;; | |
19936 | freebsd* | dragonfly*) | |
19937 | case "$host_cpu" in | |
19938 | i[34567]86 ) | |
19939 | FLOAT_H=float.h | |
19940 | ;; | |
19941 | x86_64 ) | |
19942 | # On x86_64 systems, the C compiler may still be generating | |
19943 | # 32-bit code. | |
19944 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19945 | /* end confdefs.h. */ | |
19946 | #if defined __LP64__ || defined __x86_64__ || defined __amd64__ | |
19947 | int ok; | |
19948 | #else | |
19949 | error fail | |
19950 | #endif | |
472fa5ee | 19951 | |
c0c3707f CB |
19952 | _ACEOF |
19953 | if ac_fn_c_try_compile "$LINENO"; then : | |
472fa5ee | 19954 | |
c0c3707f CB |
19955 | else |
19956 | FLOAT_H=float.h | |
19957 | fi | |
19958 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
19959 | ;; | |
19960 | esac | |
19961 | ;; | |
19962 | linux*) | |
19963 | case "$host_cpu" in | |
19964 | powerpc*) | |
19965 | FLOAT_H=float.h | |
19966 | ;; | |
19967 | esac | |
19968 | ;; | |
19969 | esac | |
19970 | case "$host_os" in | |
19971 | aix* | freebsd* | dragonfly* | linux*) | |
19972 | if test -n "$FLOAT_H"; then | |
19973 | REPLACE_FLOAT_LDBL=1 | |
19974 | fi | |
19975 | ;; | |
19976 | esac | |
19977 | ||
19978 | REPLACE_ITOLD=0 | |
19979 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5 | |
19980 | $as_echo_n "checking whether conversion from 'int' to 'long double' works... " >&6; } | |
19981 | if ${gl_cv_func_itold_works+:} false; then : | |
5e8754f9 SDJ |
19982 | $as_echo_n "(cached) " >&6 |
19983 | else | |
19984 | ||
19985 | if test "$cross_compiling" = yes; then : | |
c0c3707f CB |
19986 | case "$host" in |
19987 | sparc*-*-linux*) | |
19988 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19989 | /* end confdefs.h. */ | |
19990 | #if defined __LP64__ || defined __arch64__ | |
19991 | int ok; | |
19992 | #else | |
19993 | error fail | |
19994 | #endif | |
19995 | ||
19996 | _ACEOF | |
19997 | if ac_fn_c_try_compile "$LINENO"; then : | |
19998 | gl_cv_func_itold_works="guessing no" | |
19999 | else | |
20000 | gl_cv_func_itold_works="guessing yes" | |
20001 | fi | |
20002 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
20003 | ;; | |
20004 | # Guess yes on native Windows. | |
20005 | mingw*) gl_cv_func_itold_works="guessing yes" ;; | |
20006 | *) gl_cv_func_itold_works="guessing yes" ;; | |
5e8754f9 SDJ |
20007 | esac |
20008 | ||
20009 | else | |
20010 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20011 | /* end confdefs.h. */ | |
20012 | ||
c0c3707f CB |
20013 | int i = -1; |
20014 | volatile long double ld; | |
20015 | int main () | |
5e8754f9 | 20016 | { |
c0c3707f CB |
20017 | ld += i * 1.0L; |
20018 | if (ld > 0) | |
20019 | return 1; | |
20020 | return 0; | |
5e8754f9 SDJ |
20021 | } |
20022 | _ACEOF | |
20023 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 20024 | gl_cv_func_itold_works=yes |
5e8754f9 | 20025 | else |
c0c3707f | 20026 | gl_cv_func_itold_works=no |
5e8754f9 SDJ |
20027 | fi |
20028 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
20029 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
20030 | fi | |
20031 | ||
98399780 | 20032 | |
5e8754f9 | 20033 | fi |
c0c3707f CB |
20034 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5 |
20035 | $as_echo "$gl_cv_func_itold_works" >&6; } | |
20036 | case "$gl_cv_func_itold_works" in | |
20037 | *no) | |
20038 | REPLACE_ITOLD=1 | |
20039 | FLOAT_H=float.h | |
20040 | ;; | |
20041 | esac | |
98399780 | 20042 | |
c0c3707f | 20043 | if test -n "$FLOAT_H"; then |
98399780 YQ |
20044 | |
20045 | ||
20046 | ||
20047 | ||
6a29c58e YQ |
20048 | |
20049 | ||
20050 | ||
20051 | ||
c0c3707f CB |
20052 | if test $gl_cv_have_include_next = yes; then |
20053 | gl_cv_next_float_h='<'float.h'>' | |
20054 | else | |
20055 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5 | |
20056 | $as_echo_n "checking absolute name of <float.h>... " >&6; } | |
20057 | if ${gl_cv_next_float_h+:} false; then : | |
20058 | $as_echo_n "(cached) " >&6 | |
20059 | else | |
20060 | ||
20061 | ||
20062 | ||
20063 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20064 | /* end confdefs.h. */ | |
20065 | #include <float.h> | |
20066 | _ACEOF | |
20067 | case "$host_os" in | |
20068 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
20069 | *) gl_absname_cpp="$ac_cpp" ;; | |
20070 | esac | |
20071 | ||
20072 | case "$host_os" in | |
20073 | mingw*) | |
20074 | gl_dirsep_regex='[/\\]' | |
20075 | ;; | |
20076 | *) | |
20077 | gl_dirsep_regex='\/' | |
20078 | ;; | |
20079 | esac | |
20080 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
20081 | gl_header_literal_regex=`echo 'float.h' \ | |
20082 | | sed -e "$gl_make_literal_regex_sed"` | |
20083 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
20084 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
20085 | s|^/[^/]|//&| | |
20086 | p | |
20087 | q | |
20088 | }' | |
20089 | ||
20090 | gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
20091 | sed -n "$gl_absolute_header_sed"` | |
20092 | ||
20093 | gl_header=$gl_cv_absolute_float_h | |
20094 | gl_cv_next_float_h='"'$gl_header'"' | |
20095 | ||
20096 | ||
20097 | fi | |
20098 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5 | |
20099 | $as_echo "$gl_cv_next_float_h" >&6; } | |
20100 | fi | |
20101 | NEXT_FLOAT_H=$gl_cv_next_float_h | |
20102 | ||
20103 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
20104 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
20105 | gl_next_as_first_directive='<'float.h'>' | |
20106 | else | |
20107 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
20108 | gl_next_as_first_directive=$gl_cv_next_float_h | |
20109 | fi | |
20110 | NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive | |
20111 | ||
20112 | ||
20113 | ||
6a29c58e | 20114 | |
c0c3707f | 20115 | fi |
6a29c58e | 20116 | |
c0c3707f CB |
20117 | if test -n "$FLOAT_H"; then |
20118 | GL_GENERATE_FLOAT_H_TRUE= | |
20119 | GL_GENERATE_FLOAT_H_FALSE='#' | |
20120 | else | |
20121 | GL_GENERATE_FLOAT_H_TRUE='#' | |
20122 | GL_GENERATE_FLOAT_H_FALSE= | |
20123 | fi | |
6a29c58e YQ |
20124 | |
20125 | ||
8690e634 | 20126 | |
c0c3707f | 20127 | if test $REPLACE_FLOAT_LDBL = 1; then |
8690e634 | 20128 | |
8690e634 | 20129 | |
8690e634 | 20130 | |
8690e634 | 20131 | |
8690e634 | 20132 | |
8690e634 | 20133 | |
8690e634 | 20134 | |
4a626d0a | 20135 | |
c0c3707f | 20136 | gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext" |
8690e634 | 20137 | |
c0c3707f CB |
20138 | fi |
20139 | if test $REPLACE_ITOLD = 1; then | |
8690e634 JK |
20140 | |
20141 | ||
20142 | ||
20143 | ||
20144 | ||
20145 | ||
63ce7108 | 20146 | |
e26b6bb0 | 20147 | |
c0c3707f | 20148 | gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext" |
e26b6bb0 | 20149 | |
c0c3707f | 20150 | fi |
e26b6bb0 TT |
20151 | |
20152 | ||
20153 | ||
20154 | ||
c0c3707f CB |
20155 | gl_fnmatch_required_lowercase=` |
20156 | echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]' | |
20157 | ` | |
e26b6bb0 | 20158 | |
c0c3707f CB |
20159 | if test $ac_cv_func_fnmatch = no; then |
20160 | HAVE_FNMATCH=0 | |
20161 | else | |
20162 | gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" | |
20163 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5 | |
20164 | $as_echo_n "checking for working $gl_fnmatch_required fnmatch... " >&6; } | |
20165 | if eval \${$gl_fnmatch_cache_var+:} false; then : | |
5e8754f9 SDJ |
20166 | $as_echo_n "(cached) " >&6 |
20167 | else | |
c0c3707f CB |
20168 | if test $gl_fnmatch_required = GNU; then |
20169 | gl_fnmatch_gnu_start= | |
20170 | gl_fnmatch_gnu_end= | |
20171 | else | |
20172 | gl_fnmatch_gnu_start='#if 0' | |
20173 | gl_fnmatch_gnu_end='#endif' | |
20174 | fi | |
20175 | if test "$cross_compiling" = yes; then : | |
20176 | case "$host_os" in | |
20177 | # Guess yes on musl systems. | |
20178 | *-musl*) eval "$gl_fnmatch_cache_var=\"guessing yes\"" ;; | |
20179 | # Guess no otherwise, even on glibc systems. | |
20180 | *) eval "$gl_fnmatch_cache_var=\"guessing no\"" ;; | |
20181 | esac | |
e26b6bb0 | 20182 | |
c0c3707f CB |
20183 | else |
20184 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5e8754f9 | 20185 | /* end confdefs.h. */ |
c0c3707f CB |
20186 | #include <fnmatch.h> |
20187 | static int | |
20188 | y (char const *pattern, char const *string, int flags) | |
20189 | { | |
20190 | return fnmatch (pattern, string, flags) == 0; | |
20191 | } | |
20192 | static int | |
20193 | n (char const *pattern, char const *string, int flags) | |
20194 | { | |
20195 | return fnmatch (pattern, string, flags) == FNM_NOMATCH; | |
20196 | } | |
20197 | ||
5e8754f9 SDJ |
20198 | int |
20199 | main () | |
20200 | { | |
c0c3707f CB |
20201 | char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]"; |
20202 | char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; | |
20203 | static char const A_1[] = { 'A' - 1, 0 }; | |
20204 | static char const A01[] = { 'A' + 1, 0 }; | |
20205 | static char const a_1[] = { 'a' - 1, 0 }; | |
20206 | static char const a01[] = { 'a' + 1, 0 }; | |
20207 | static char const bs_1[] = { '\\\\' - 1, 0 }; | |
20208 | static char const bs01[] = { '\\\\' + 1, 0 }; | |
20209 | int result = 0; | |
20210 | if (!n ("a*", "", 0)) | |
20211 | return 1; | |
20212 | if (!y ("a*", "abc", 0)) | |
20213 | return 1; | |
20214 | if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ | |
20215 | return 1; | |
20216 | if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) | |
20217 | return 2; | |
20218 | if (!y ("a\\\\bc", "abc", 0)) | |
20219 | return 3; | |
20220 | if (!n ("a\\\\bc", "abc", FNM_NOESCAPE)) | |
20221 | return 3; | |
20222 | if (!y ("*x", ".x", 0)) | |
20223 | return 4; | |
20224 | if (!n ("*x", ".x", FNM_PERIOD)) | |
20225 | return 4; | |
20226 | if (!y (Apat, "\\\\", 0)) | |
20227 | return 5; | |
20228 | if (!y (Apat, "A", 0)) | |
20229 | return 5; | |
20230 | if (!y (apat, "\\\\", 0)) | |
20231 | return 5; | |
20232 | if (!y (apat, "a", 0)) | |
20233 | return 5; | |
20234 | if (!(n (Apat, A_1, 0) == ('A' < '\\\\'))) | |
20235 | return 5; | |
20236 | if (!(n (apat, a_1, 0) == ('a' < '\\\\'))) | |
20237 | return 5; | |
20238 | if (!(y (Apat, A01, 0) == ('A' < '\\\\'))) | |
20239 | return 5; | |
20240 | if (!(y (apat, a01, 0) == ('a' < '\\\\'))) | |
20241 | return 5; | |
20242 | if (!(y (Apat, bs_1, 0) == ('A' < '\\\\'))) | |
20243 | return 5; | |
20244 | if (!(y (apat, bs_1, 0) == ('a' < '\\\\'))) | |
20245 | return 5; | |
20246 | if (!(n (Apat, bs01, 0) == ('A' < '\\\\'))) | |
20247 | return 5; | |
20248 | if (!(n (apat, bs01, 0) == ('a' < '\\\\'))) | |
20249 | return 5; | |
20250 | $gl_fnmatch_gnu_start | |
20251 | if (!y ("xxXX", "xXxX", FNM_CASEFOLD)) | |
20252 | result |= 8; | |
20253 | if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)) | |
20254 | result |= 16; | |
20255 | if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME)) | |
20256 | result |= 32; | |
20257 | if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)) | |
20258 | result |= 64; | |
20259 | if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)) | |
20260 | result |= 64; | |
20261 | if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)) | |
20262 | result |= 64; | |
20263 | $gl_fnmatch_gnu_end | |
20264 | return result; | |
20265 | ||
5e8754f9 SDJ |
20266 | ; |
20267 | return 0; | |
20268 | } | |
20269 | _ACEOF | |
c0c3707f CB |
20270 | if ac_fn_c_try_run "$LINENO"; then : |
20271 | eval "$gl_fnmatch_cache_var=yes" | |
5e8754f9 | 20272 | else |
c0c3707f CB |
20273 | eval "$gl_fnmatch_cache_var=no" |
20274 | fi | |
20275 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
20276 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
5e8754f9 | 20277 | fi |
c0c3707f | 20278 | |
e26b6bb0 | 20279 | |
5e8754f9 | 20280 | fi |
c0c3707f CB |
20281 | eval ac_res=\$$gl_fnmatch_cache_var |
20282 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
20283 | $as_echo "$ac_res" >&6; } | |
20284 | eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" | |
20285 | case "$gl_fnmatch_result" in | |
20286 | *yes) ;; | |
20287 | *) REPLACE_FNMATCH=1 ;; | |
20288 | esac | |
20289 | fi | |
20290 | if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then | |
e26b6bb0 | 20291 | |
e26b6bb0 | 20292 | |
c0c3707f CB |
20293 | FNMATCH_H='fnmatch.h' |
20294 | if test -n "$FNMATCH_H"; then | |
20295 | GL_GENERATE_FNMATCH_H_TRUE= | |
20296 | GL_GENERATE_FNMATCH_H_FALSE='#' | |
5e8754f9 | 20297 | else |
c0c3707f CB |
20298 | GL_GENERATE_FNMATCH_H_TRUE='#' |
20299 | GL_GENERATE_FNMATCH_H_FALSE= | |
5e8754f9 | 20300 | fi |
e26b6bb0 | 20301 | |
18848e28 | 20302 | |
c0c3707f | 20303 | fi |
18848e28 | 20304 | |
c0c3707f | 20305 | if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then |
18848e28 | 20306 | |
18848e28 | 20307 | |
18848e28 | 20308 | |
c0c3707f CB |
20309 | |
20310 | ||
20311 | ||
20312 | ||
20313 | ||
20314 | gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" | |
20315 | ||
20316 | ||
20317 | ||
c0c3707f CB |
20318 | |
20319 | ||
20320 | fi | |
20321 | ||
20322 | ||
20323 | ||
20324 | ||
20325 | ||
20326 | GNULIB_FNMATCH=1 | |
20327 | ||
20328 | ||
20329 | ||
20330 | ||
20331 | ||
20332 | $as_echo "#define GNULIB_TEST_FNMATCH 1" >>confdefs.h | |
20333 | ||
20334 | ||
20335 | ||
20336 | ||
20337 | ||
20338 | ||
20339 | ||
20340 | ||
20341 | if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then | |
20342 | ||
20343 | ||
20344 | ||
20345 | ||
20346 | ||
20347 | ||
20348 | ||
20349 | ||
20350 | gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" | |
20351 | ||
20352 | ||
20353 | ||
18848e28 | 20354 | |
18848e28 | 20355 | |
5e8754f9 | 20356 | fi |
18848e28 | 20357 | |
18848e28 | 20358 | |
c0c3707f CB |
20359 | cat >>confdefs.h <<_ACEOF |
20360 | #define GNULIB_FNMATCH_GNU 1 | |
20361 | _ACEOF | |
18848e28 | 20362 | |
18848e28 | 20363 | |
18848e28 | 20364 | |
18848e28 | 20365 | |
9c9d63b1 PM |
20366 | |
20367 | ||
20368 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether free is known to preserve errno" >&5 | |
20369 | $as_echo_n "checking whether free is known to preserve errno... " >&6; } | |
20370 | if ${gl_cv_func_free_preserves_errno+:} false; then : | |
20371 | $as_echo_n "(cached) " >&6 | |
20372 | else | |
20373 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20374 | /* end confdefs.h. */ | |
20375 | #include <stdlib.h> | |
20376 | ||
20377 | int | |
20378 | main () | |
20379 | { | |
20380 | #if 2 < __GLIBC__ + (33 <= __GLIBC_MINOR__) | |
20381 | #elif defined __OpenBSD__ | |
20382 | #elif defined __sun | |
20383 | #else | |
20384 | #error "'free' is not known to preserve errno" | |
20385 | #endif | |
20386 | ||
20387 | ; | |
20388 | return 0; | |
20389 | } | |
20390 | _ACEOF | |
20391 | if ac_fn_c_try_compile "$LINENO"; then : | |
20392 | gl_cv_func_free_preserves_errno=yes | |
20393 | else | |
20394 | gl_cv_func_free_preserves_errno=no | |
20395 | fi | |
20396 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
20397 | ||
20398 | fi | |
20399 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_free_preserves_errno" >&5 | |
20400 | $as_echo "$gl_cv_func_free_preserves_errno" >&6; } | |
20401 | ||
20402 | case $gl_cv_func_free_preserves_errno in | |
20403 | *yes) ;; | |
20404 | *) REPLACE_FREE=1 ;; | |
20405 | esac | |
20406 | ||
20407 | if test $REPLACE_FREE = 1; then | |
20408 | ||
20409 | ||
20410 | ||
20411 | ||
20412 | ||
20413 | ||
20414 | ||
20415 | ||
20416 | gl_LIBOBJS="$gl_LIBOBJS free.$ac_objext" | |
20417 | ||
20418 | : | |
20419 | fi | |
20420 | ||
20421 | ||
20422 | ||
20423 | ||
20424 | ||
20425 | GNULIB_FREE_POSIX=1 | |
20426 | ||
20427 | ||
20428 | ||
20429 | ||
20430 | ||
20431 | $as_echo "#define GNULIB_TEST_FREE_POSIX 1" >>confdefs.h | |
20432 | ||
20433 | ||
20434 | ||
20435 | ||
c0c3707f CB |
20436 | if test $gl_func_frexp != yes; then |
20437 | ||
20438 | ||
18848e28 GF |
20439 | |
20440 | ||
18848e28 | 20441 | |
18848e28 | 20442 | |
18848e28 | 20443 | |
c0c3707f CB |
20444 | |
20445 | gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext" | |
18848e28 GF |
20446 | |
20447 | fi | |
20448 | ||
20449 | ||
20450 | ||
20451 | ||
20452 | ||
c0c3707f | 20453 | GNULIB_FREXP=1 |
18848e28 GF |
20454 | |
20455 | ||
20456 | ||
20457 | ||
20458 | ||
c0c3707f | 20459 | $as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h |
18848e28 GF |
20460 | |
20461 | ||
20462 | ||
20463 | ||
c0c3707f CB |
20464 | if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then |
20465 | ||
20466 | ||
20467 | ||
18848e28 GF |
20468 | |
20469 | ||
20470 | ||
5e8754f9 SDJ |
20471 | |
20472 | ||
c0c3707f CB |
20473 | gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext" |
20474 | ||
5e8754f9 | 20475 | fi |
18848e28 | 20476 | |
6a29c58e | 20477 | |
6a29c58e | 20478 | |
6a29c58e | 20479 | |
6ec2e0f5 | 20480 | |
c0c3707f CB |
20481 | GNULIB_FREXPL=1 |
20482 | ||
20483 | ||
20484 | ||
20485 | ||
20486 | ||
20487 | $as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h | |
20488 | ||
20489 | ||
20490 | ||
20491 | ||
20492 | ||
20493 | ||
20494 | ||
20495 | case "$host_os" in | |
20496 | mingw* | solaris*) | |
20497 | REPLACE_FSTAT=1 | |
20498 | ;; | |
20499 | esac | |
472fa5ee SM |
20500 | |
20501 | ||
20502 | ||
20503 | ||
20504 | ||
6ec2e0f5 SDJ |
20505 | if test $ac_cv_func_fchdir = no; then |
20506 | HAVE_FCHDIR=0 | |
6a29c58e YQ |
20507 | fi |
20508 | ||
6ec2e0f5 SDJ |
20509 | if test $HAVE_FCHDIR = 0; then |
20510 | case "$gl_cv_func_open_directory_works" in | |
20511 | *yes) ;; | |
20512 | *) | |
20513 | REPLACE_FSTAT=1 | |
20514 | ;; | |
20515 | esac | |
20516 | fi | |
6a29c58e YQ |
20517 | |
20518 | ||
6ec2e0f5 | 20519 | if test $REPLACE_FSTAT = 1; then |
6a29c58e | 20520 | |
3d99e817 AK |
20521 | |
20522 | ||
20523 | ||
3d99e817 AK |
20524 | |
20525 | ||
20526 | ||
20527 | ||
6ec2e0f5 | 20528 | gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext" |
3d99e817 | 20529 | |
c0c3707f CB |
20530 | case "$host_os" in |
20531 | mingw*) | |
3d99e817 AK |
20532 | |
20533 | ||
20534 | ||
20535 | ||
20536 | ||
20537 | ||
49e4877c | 20538 | |
49e4877c | 20539 | |
c0c3707f | 20540 | gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" |
49e4877c | 20541 | |
c0c3707f CB |
20542 | ;; |
20543 | esac | |
49e4877c PA |
20544 | |
20545 | ||
9c9d63b1 | 20546 | |
c0c3707f CB |
20547 | : |
20548 | ||
20549 | fi | |
6a29c58e YQ |
20550 | |
20551 | ||
88b48903 | 20552 | |
8690e634 | 20553 | |
a512b375 | 20554 | |
c0c3707f CB |
20555 | GNULIB_FSTAT=1 |
20556 | ||
20557 | ||
20558 | ||
20559 | ||
20560 | ||
20561 | $as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h | |
20562 | ||
20563 | ||
88b48903 | 20564 | |
88b48903 | 20565 | |
472fa5ee SM |
20566 | |
20567 | ||
20568 | ||
20569 | ||
20570 | ||
6ec2e0f5 SDJ |
20571 | |
20572 | if test $ac_cv_func_fstatat = no; then | |
20573 | HAVE_FSTATAT=0 | |
20574 | else | |
20575 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fstatat (..., 0) works" >&5 | |
20576 | $as_echo_n "checking whether fstatat (..., 0) works... " >&6; } | |
d0ac1c44 | 20577 | if ${gl_cv_func_fstatat_zero_flag+:} false; then : |
6ec2e0f5 SDJ |
20578 | $as_echo_n "(cached) " >&6 |
20579 | else | |
20580 | if test "$cross_compiling" = yes; then : | |
20581 | case "$host_os" in | |
20582 | aix*) gl_cv_func_fstatat_zero_flag="guessing no";; | |
20583 | *) gl_cv_func_fstatat_zero_flag="guessing yes";; | |
20584 | esac | |
88b48903 | 20585 | |
8690e634 JK |
20586 | else |
20587 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20588 | /* end confdefs.h. */ | |
8690e634 | 20589 | |
6ec2e0f5 SDJ |
20590 | #include <fcntl.h> |
20591 | #include <sys/stat.h> | |
20592 | int | |
20593 | main (void) | |
20594 | { | |
20595 | struct stat a; | |
20596 | return fstatat (AT_FDCWD, ".", &a, 0) != 0; | |
20597 | } | |
20598 | ||
88b48903 WN |
20599 | _ACEOF |
20600 | if ac_fn_c_try_run "$LINENO"; then : | |
6ec2e0f5 | 20601 | gl_cv_func_fstatat_zero_flag=yes |
88b48903 | 20602 | else |
6ec2e0f5 | 20603 | gl_cv_func_fstatat_zero_flag=no |
88b48903 WN |
20604 | fi |
20605 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
20606 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
20607 | fi | |
20608 | ||
20609 | ||
20610 | fi | |
6ec2e0f5 SDJ |
20611 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fstatat_zero_flag" >&5 |
20612 | $as_echo "$gl_cv_func_fstatat_zero_flag" >&6; } | |
88b48903 | 20613 | |
6ec2e0f5 SDJ |
20614 | case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in |
20615 | *yes+*yes) ;; | |
c0c3707f CB |
20616 | *) REPLACE_FSTATAT=1 ;; |
20617 | esac | |
20618 | ||
20619 | case $host_os in | |
20620 | solaris*) | |
20621 | REPLACE_FSTATAT=1 ;; | |
20622 | esac | |
20623 | ||
20624 | case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in | |
20625 | 1,*yes) | |
88b48903 | 20626 | |
6ec2e0f5 | 20627 | $as_echo "#define HAVE_WORKING_FSTATAT_ZERO_FLAG 1" >>confdefs.h |
88b48903 | 20628 | |
7a6dbc2f | 20629 | ;; |
6ec2e0f5 SDJ |
20630 | esac |
20631 | fi | |
88b48903 | 20632 | |
6ec2e0f5 | 20633 | if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then |
88b48903 WN |
20634 | |
20635 | ||
20636 | ||
20637 | ||
20638 | ||
88b48903 | 20639 | |
4a626d0a PA |
20640 | |
20641 | ||
6ec2e0f5 SDJ |
20642 | gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext" |
20643 | ||
20644 | fi | |
20645 | ||
20646 | ||
20647 | ||
4a626d0a | 20648 | |
6ec2e0f5 SDJ |
20649 | |
20650 | GNULIB_FSTATAT=1 | |
20651 | ||
20652 | ||
20653 | ||
20654 | ||
20655 | ||
20656 | $as_echo "#define GNULIB_TEST_FSTATAT 1" >>confdefs.h | |
20657 | ||
20658 | ||
20659 | ||
20660 | ||
20661 | ||
20662 | ||
20663 | ||
20664 | ||
20665 | gl_abort_bug=no | |
4a626d0a PA |
20666 | case "$host_os" in |
20667 | mingw*) | |
6ec2e0f5 | 20668 | gl_cv_func_getcwd_path_max=yes |
4a626d0a PA |
20669 | ;; |
20670 | *) | |
88b48903 | 20671 | |
88b48903 | 20672 | |
88b48903 WN |
20673 | |
20674 | ||
88b48903 | 20675 | |
6ec2e0f5 SDJ |
20676 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd handles long file names properly" >&5 |
20677 | $as_echo_n "checking whether getcwd handles long file names properly... " >&6; } | |
d0ac1c44 | 20678 | if ${gl_cv_func_getcwd_path_max+:} false; then : |
6ec2e0f5 SDJ |
20679 | $as_echo_n "(cached) " >&6 |
20680 | else | |
20681 | # Arrange for deletion of the temporary directory this test creates. | |
20682 | ac_clean_files="$ac_clean_files confdir3" | |
20683 | if test "$cross_compiling" = yes; then : | |
b567ca63 | 20684 | # Cross-compilation guesses: |
c0c3707f CB |
20685 | case "$host_os" in |
20686 | aix*) # On AIX, it has the AIX bug. | |
20687 | gl_cv_func_getcwd_path_max='guessing no, it has the AIX bug' ;; | |
20688 | gnu*) # On Hurd, it is 'yes'. | |
20689 | gl_cv_func_getcwd_path_max='guessing yes' ;; | |
20690 | linux* | kfreebsd*) | |
20691 | # On older Linux+glibc it's 'no, but it is partly working', | |
20692 | # on newer Linux+glibc it's 'yes'. | |
20693 | # On Linux+musl libc, it's 'no, but it is partly working'. | |
20694 | # On kFreeBSD+glibc, it's 'no, but it is partly working'. | |
20695 | gl_cv_func_getcwd_path_max='guessing no, but it is partly working' ;; | |
20696 | *) # If we don't know, obey --enable-cross-guesses. | |
20697 | gl_cv_func_getcwd_path_max="$gl_cross_guess_normal" ;; | |
20698 | esac | |
b567ca63 | 20699 | |
6ec2e0f5 SDJ |
20700 | else |
20701 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20702 | /* end confdefs.h. */ | |
88b48903 | 20703 | |
6ec2e0f5 SDJ |
20704 | #include <errno.h> |
20705 | #include <stdlib.h> | |
20706 | #if HAVE_UNISTD_H | |
20707 | # include <unistd.h> | |
20708 | #else | |
20709 | # include <direct.h> | |
20710 | #endif | |
20711 | #include <string.h> | |
20712 | #include <limits.h> | |
20713 | #include <sys/stat.h> | |
20714 | #include <sys/types.h> | |
20715 | #include <fcntl.h> | |
88b48903 WN |
20716 | |
20717 | ||
6ec2e0f5 SDJ |
20718 | /* Arrange to define PATH_MAX, like "pathmax.h" does. */ |
20719 | #if HAVE_UNISTD_H | |
20720 | # include <unistd.h> | |
20721 | #endif | |
20722 | #include <limits.h> | |
20723 | #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN | |
20724 | # include <sys/param.h> | |
20725 | #endif | |
20726 | #if !defined PATH_MAX && defined MAXPATHLEN | |
20727 | # define PATH_MAX MAXPATHLEN | |
20728 | #endif | |
20729 | #ifdef __hpux | |
20730 | # undef PATH_MAX | |
20731 | # define PATH_MAX 1024 | |
20732 | #endif | |
c0c3707f | 20733 | #if defined _WIN32 && ! defined __CYGWIN__ |
6ec2e0f5 SDJ |
20734 | # undef PATH_MAX |
20735 | # define PATH_MAX 260 | |
20736 | #endif | |
88b48903 | 20737 | |
88b48903 | 20738 | |
6ec2e0f5 SDJ |
20739 | #ifndef AT_FDCWD |
20740 | # define AT_FDCWD 0 | |
20741 | #endif | |
20742 | #ifdef ENAMETOOLONG | |
20743 | # define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG) | |
20744 | #else | |
20745 | # define is_ENAMETOOLONG(x) 0 | |
20746 | #endif | |
88b48903 | 20747 | |
6ec2e0f5 SDJ |
20748 | /* Use the getcwd function, not any macro. */ |
20749 | #undef getcwd | |
88b48903 | 20750 | |
9c9d63b1 PM |
20751 | |
20752 | ||
20753 | $gl_mda_defines | |
20754 | ||
88b48903 | 20755 | |
6ec2e0f5 SDJ |
20756 | #ifndef S_IRWXU |
20757 | # define S_IRWXU 0700 | |
20758 | #endif | |
88b48903 | 20759 | |
6ec2e0f5 SDJ |
20760 | /* The length of this name must be 8. */ |
20761 | #define DIR_NAME "confdir3" | |
20762 | #define DIR_NAME_LEN 8 | |
20763 | #define DIR_NAME_SIZE (DIR_NAME_LEN + 1) | |
88b48903 | 20764 | |
6ec2e0f5 SDJ |
20765 | /* The length of "../". */ |
20766 | #define DOTDOTSLASH_LEN 3 | |
88b48903 | 20767 | |
6ec2e0f5 SDJ |
20768 | /* Leftover bytes in the buffer, to work around library or OS bugs. */ |
20769 | #define BUF_SLOP 20 | |
88b48903 | 20770 | |
6ec2e0f5 SDJ |
20771 | int |
20772 | main () | |
20773 | { | |
20774 | #ifndef PATH_MAX | |
20775 | /* The Hurd doesn't define this, so getcwd can't exhibit the bug -- | |
20776 | at least not on a local file system. And if we were to start worrying | |
20777 | about remote file systems, we'd have to enable the wrapper function | |
20778 | all of the time, just to be safe. That's not worth the cost. */ | |
20779 | exit (0); | |
20780 | #elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \ | |
20781 | - DIR_NAME_SIZE - BUF_SLOP) \ | |
20782 | <= PATH_MAX) | |
20783 | /* FIXME: Assuming there's a system for which this is true, | |
20784 | this should be done in a compile test. */ | |
20785 | exit (0); | |
20786 | #else | |
20787 | char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) | |
20788 | + DIR_NAME_SIZE + BUF_SLOP]; | |
20789 | char *cwd = getcwd (buf, PATH_MAX); | |
20790 | size_t initial_cwd_len; | |
20791 | size_t cwd_len; | |
20792 | int fail = 0; | |
20793 | size_t n_chdirs = 0; | |
88b48903 | 20794 | |
6ec2e0f5 SDJ |
20795 | if (cwd == NULL) |
20796 | exit (10); | |
88b48903 | 20797 | |
6ec2e0f5 | 20798 | cwd_len = initial_cwd_len = strlen (cwd); |
88b48903 | 20799 | |
6ec2e0f5 SDJ |
20800 | while (1) |
20801 | { | |
20802 | size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN); | |
20803 | char *c = NULL; | |
20804 | ||
20805 | cwd_len += DIR_NAME_SIZE; | |
20806 | /* If mkdir or chdir fails, it could be that this system cannot create | |
20807 | any file with an absolute name longer than PATH_MAX, such as cygwin. | |
20808 | If so, leave fail as 0, because the current working directory can't | |
c0c3707f CB |
20809 | be too long for getcwd if it can't even be created. On Linux with |
20810 | the 9p file system, mkdir fails with error EINVAL when cwd_len gets | |
20811 | too long; ignore this failure because the getcwd() system call | |
20812 | produces good results whereas the gnulib substitute calls getdents64 | |
20813 | which fails with error EPROTO. | |
20814 | For other errors, be pessimistic and consider that as a failure, | |
20815 | too. */ | |
6ec2e0f5 SDJ |
20816 | if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0) |
20817 | { | |
20818 | if (! (errno == ERANGE || is_ENAMETOOLONG (errno))) | |
c0c3707f CB |
20819 | #ifdef __linux__ |
20820 | if (! (errno == EINVAL)) | |
20821 | #endif | |
20822 | fail = 20; | |
6ec2e0f5 SDJ |
20823 | break; |
20824 | } | |
88b48903 | 20825 | |
6ec2e0f5 SDJ |
20826 | if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE) |
20827 | { | |
20828 | struct stat sb; | |
88b48903 | 20829 | |
6ec2e0f5 SDJ |
20830 | c = getcwd (buf, PATH_MAX); |
20831 | if (!c && errno == ENOENT) | |
20832 | { | |
20833 | fail = 11; | |
20834 | break; | |
20835 | } | |
20836 | if (c) | |
20837 | { | |
20838 | fail = 31; | |
20839 | break; | |
20840 | } | |
20841 | if (! (errno == ERANGE || is_ENAMETOOLONG (errno))) | |
20842 | { | |
20843 | fail = 21; | |
20844 | break; | |
20845 | } | |
88b48903 | 20846 | |
6ec2e0f5 SDJ |
20847 | /* Our replacement needs to be able to stat() long ../../paths, |
20848 | so generate a path larger than PATH_MAX to check, | |
20849 | avoiding the replacement if we can't stat(). */ | |
20850 | c = getcwd (buf, cwd_len + 1); | |
20851 | if (c && !AT_FDCWD && stat (c, &sb) != 0 && is_ENAMETOOLONG (errno)) | |
20852 | { | |
20853 | fail = 32; | |
20854 | break; | |
20855 | } | |
20856 | } | |
88b48903 | 20857 | |
6ec2e0f5 SDJ |
20858 | if (dotdot_max <= cwd_len - initial_cwd_len) |
20859 | { | |
20860 | if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len) | |
20861 | break; | |
20862 | c = getcwd (buf, cwd_len + 1); | |
20863 | if (!c) | |
20864 | { | |
20865 | if (! (errno == ERANGE || errno == ENOENT | |
20866 | || is_ENAMETOOLONG (errno))) | |
20867 | { | |
20868 | fail = 22; | |
20869 | break; | |
20870 | } | |
20871 | if (AT_FDCWD || errno == ERANGE || errno == ENOENT) | |
20872 | { | |
20873 | fail = 12; | |
20874 | break; | |
20875 | } | |
20876 | } | |
20877 | } | |
88b48903 | 20878 | |
6ec2e0f5 SDJ |
20879 | if (c && strlen (c) != cwd_len) |
20880 | { | |
20881 | fail = 23; | |
20882 | break; | |
20883 | } | |
20884 | ++n_chdirs; | |
20885 | } | |
88b48903 | 20886 | |
6ec2e0f5 SDJ |
20887 | /* Leaving behind such a deep directory is not polite. |
20888 | So clean up here, right away, even though the driving | |
20889 | shell script would also clean up. */ | |
20890 | { | |
20891 | size_t i; | |
88b48903 | 20892 | |
6ec2e0f5 SDJ |
20893 | /* Try rmdir first, in case the chdir failed. */ |
20894 | rmdir (DIR_NAME); | |
20895 | for (i = 0; i <= n_chdirs; i++) | |
20896 | { | |
20897 | if (chdir ("..") < 0) | |
20898 | break; | |
20899 | if (rmdir (DIR_NAME) != 0) | |
20900 | break; | |
20901 | } | |
20902 | } | |
88b48903 | 20903 | |
6ec2e0f5 SDJ |
20904 | exit (fail); |
20905 | #endif | |
20906 | } | |
88b48903 | 20907 | |
6ec2e0f5 SDJ |
20908 | _ACEOF |
20909 | if ac_fn_c_try_run "$LINENO"; then : | |
20910 | gl_cv_func_getcwd_path_max=yes | |
20911 | else | |
20912 | case $? in | |
c0c3707f CB |
20913 | 10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';; |
20914 | 31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';; | |
20915 | 32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';; | |
20916 | *) gl_cv_func_getcwd_path_max=no;; | |
20917 | esac | |
6ec2e0f5 SDJ |
20918 | fi |
20919 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
20920 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
20921 | fi | |
88b48903 | 20922 | |
88b48903 | 20923 | |
6ec2e0f5 SDJ |
20924 | fi |
20925 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_path_max" >&5 | |
20926 | $as_echo "$gl_cv_func_getcwd_path_max" >&6; } | |
88b48903 | 20927 | |
6ec2e0f5 SDJ |
20928 | case "$gl_cv_func_getcwd_null" in |
20929 | *yes) | |
88b48903 WN |
20930 | |
20931 | ||
472fa5ee SM |
20932 | |
20933 | ||
20934 | ||
472fa5ee | 20935 | |
c0c3707f CB |
20936 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5 |
20937 | $as_echo_n "checking for getpagesize... " >&6; } | |
20938 | if ${gl_cv_func_getpagesize+:} false; then : | |
20939 | $as_echo_n "(cached) " >&6 | |
20940 | else | |
20941 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20942 | /* end confdefs.h. */ | |
20943 | #include <unistd.h> | |
20944 | int | |
20945 | main () | |
20946 | { | |
20947 | return getpagesize(); | |
20948 | ; | |
20949 | return 0; | |
20950 | } | |
472fa5ee | 20951 | |
c0c3707f CB |
20952 | _ACEOF |
20953 | if ac_fn_c_try_link "$LINENO"; then : | |
20954 | gl_cv_func_getpagesize=yes | |
20955 | else | |
20956 | gl_cv_func_getpagesize=no | |
20957 | fi | |
20958 | rm -f core conftest.err conftest.$ac_objext \ | |
20959 | conftest$ac_exeext conftest.$ac_ext | |
472fa5ee | 20960 | |
c0c3707f CB |
20961 | fi |
20962 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5 | |
20963 | $as_echo "$gl_cv_func_getpagesize" >&6; } | |
88b48903 | 20964 | |
c0c3707f | 20965 | if test $gl_cv_func_getpagesize = yes; then |
88b48903 | 20966 | |
c0c3707f | 20967 | cat >>confdefs.h <<_ACEOF |
7a6dbc2f SDJ |
20968 | #define HAVE_GETPAGESIZE 1 |
20969 | _ACEOF | |
20970 | ||
c0c3707f | 20971 | fi |
6ec2e0f5 | 20972 | |
9c9d63b1 PM |
20973 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd succeeds when 4k < cwd_length < 16k" >&5 |
20974 | $as_echo_n "checking whether getcwd succeeds when 4k < cwd_length < 16k... " >&6; } | |
20975 | if ${gl_cv_func_getcwd_succeeds_beyond_4k+:} false; then : | |
88b48903 WN |
20976 | $as_echo_n "(cached) " >&6 |
20977 | else | |
6ec2e0f5 SDJ |
20978 | # Remove any remnants of a previous test. |
20979 | rm -rf confdir-14B--- | |
20980 | # Arrange for deletion of the temporary directory this test creates. | |
20981 | ac_clean_files="$ac_clean_files confdir-14B---" | |
20982 | if test "$cross_compiling" = yes; then : | |
c0c3707f | 20983 | case "$host_os" in |
9c9d63b1 PM |
20984 | # Guess yes on musl systems. |
20985 | *-musl*) gl_cv_func_getcwd_succeeds_beyond_4k="guessing yes" ;; | |
20986 | # Guess no otherwise, even on glibc systems. | |
20987 | *) gl_cv_func_getcwd_succeeds_beyond_4k="guessing no" | |
c0c3707f CB |
20988 | esac |
20989 | ||
88b48903 WN |
20990 | else |
20991 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20992 | /* end confdefs.h. */ | |
6ec2e0f5 SDJ |
20993 | |
20994 | #include <errno.h> | |
20995 | #include <stdlib.h> | |
20996 | #if HAVE_UNISTD_H | |
20997 | # include <unistd.h> | |
20998 | #else /* on Windows with MSVC */ | |
20999 | # include <direct.h> | |
21000 | #endif | |
21001 | #include <string.h> | |
21002 | #include <sys/stat.h> | |
21003 | ||
21004 | ||
21005 | /* Arrange to define PATH_MAX, like "pathmax.h" does. */ | |
21006 | #if HAVE_UNISTD_H | |
21007 | # include <unistd.h> | |
21008 | #endif | |
21009 | #include <limits.h> | |
21010 | #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN | |
21011 | # include <sys/param.h> | |
21012 | #endif | |
21013 | #if !defined PATH_MAX && defined MAXPATHLEN | |
21014 | # define PATH_MAX MAXPATHLEN | |
21015 | #endif | |
21016 | #ifdef __hpux | |
21017 | # undef PATH_MAX | |
21018 | # define PATH_MAX 1024 | |
21019 | #endif | |
c0c3707f | 21020 | #if defined _WIN32 && ! defined __CYGWIN__ |
6ec2e0f5 SDJ |
21021 | # undef PATH_MAX |
21022 | # define PATH_MAX 260 | |
21023 | #endif | |
21024 | ||
21025 | ||
9c9d63b1 PM |
21026 | |
21027 | $gl_mda_defines | |
21028 | ||
6ec2e0f5 SDJ |
21029 | |
21030 | #ifndef S_IRWXU | |
21031 | # define S_IRWXU 0700 | |
21032 | #endif | |
21033 | ||
21034 | /* FIXME: skip the run-test altogether on systems without getpagesize. */ | |
21035 | #if ! HAVE_GETPAGESIZE | |
21036 | # define getpagesize() 0 | |
21037 | #endif | |
21038 | ||
21039 | /* This size is chosen to be larger than PATH_MAX (4k), yet smaller than | |
21040 | the 16kB pagesize on ia64 linux. Those conditions make the code below | |
21041 | trigger a bug in glibc's getcwd implementation before 2.4.90-10. */ | |
21042 | #define TARGET_LEN (5 * 1024) | |
88b48903 WN |
21043 | |
21044 | int | |
21045 | main () | |
21046 | { | |
6ec2e0f5 SDJ |
21047 | char *cwd; |
21048 | size_t initial_cwd_len; | |
21049 | int fail = 0; | |
21050 | ||
21051 | /* The bug is triggered when PATH_MAX < getpagesize (), so skip | |
21052 | this relatively expensive and invasive test if that's not true. */ | |
21053 | #ifdef PATH_MAX | |
21054 | int bug_possible = PATH_MAX < getpagesize (); | |
21055 | #else | |
21056 | int bug_possible = 0; | |
21057 | #endif | |
21058 | if (! bug_possible) | |
21059 | return 0; | |
8690e634 | 21060 | |
6ec2e0f5 SDJ |
21061 | cwd = getcwd (NULL, 0); |
21062 | if (cwd == NULL) | |
21063 | return 2; | |
21064 | ||
21065 | initial_cwd_len = strlen (cwd); | |
21066 | free (cwd); | |
21067 | ||
21068 | if (1) | |
21069 | { | |
21070 | static char const dir_name[] = "confdir-14B---"; | |
21071 | size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len) | |
21072 | / sizeof dir_name); | |
21073 | size_t d; | |
21074 | for (d = 0; d < desired_depth; d++) | |
21075 | { | |
21076 | if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0) | |
21077 | { | |
21078 | if (! (errno == ERANGE || errno == ENAMETOOLONG | |
21079 | || errno == ENOENT)) | |
21080 | fail = 3; /* Unable to construct deep hierarchy. */ | |
21081 | break; | |
21082 | } | |
21083 | } | |
21084 | ||
21085 | /* If libc has the bug in question, this invocation of getcwd | |
21086 | results in a failed assertion. */ | |
21087 | cwd = getcwd (NULL, 0); | |
21088 | if (cwd == NULL) | |
21089 | fail = 4; /* getcwd didn't assert, but it failed for a long name | |
21090 | where the answer could have been learned. */ | |
21091 | free (cwd); | |
21092 | ||
21093 | /* Call rmdir first, in case the above chdir failed. */ | |
21094 | rmdir (dir_name); | |
21095 | while (0 < d--) | |
21096 | { | |
21097 | if (chdir ("..") < 0) | |
21098 | { | |
21099 | fail = 5; | |
21100 | break; | |
21101 | } | |
21102 | rmdir (dir_name); | |
21103 | } | |
21104 | } | |
21105 | ||
21106 | return fail; | |
8690e634 | 21107 | } |
6ec2e0f5 | 21108 | |
8690e634 JK |
21109 | _ACEOF |
21110 | if ac_fn_c_try_run "$LINENO"; then : | |
9c9d63b1 | 21111 | gl_cv_func_getcwd_succeeds_beyond_4k=yes |
8690e634 | 21112 | else |
c0c3707f CB |
21113 | ret=$? |
21114 | if test $ret -ge 128 || test $ret = 4; then | |
9c9d63b1 | 21115 | gl_cv_func_getcwd_succeeds_beyond_4k=no |
c0c3707f | 21116 | else |
9c9d63b1 | 21117 | gl_cv_func_getcwd_succeeds_beyond_4k=yes |
c0c3707f CB |
21118 | fi |
21119 | ||
8690e634 JK |
21120 | fi |
21121 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
21122 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
21123 | fi | |
21124 | ||
21125 | ||
21126 | fi | |
9c9d63b1 PM |
21127 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_succeeds_beyond_4k" >&5 |
21128 | $as_echo "$gl_cv_func_getcwd_succeeds_beyond_4k" >&6; } | |
21129 | case "$gl_cv_func_getcwd_succeeds_beyond_4k" in | |
21130 | *no) | |
c0c3707f CB |
21131 | gl_abort_bug=yes |
21132 | ;; | |
21133 | *) | |
21134 | ||
21135 | ;; | |
21136 | esac | |
6ec2e0f5 SDJ |
21137 | |
21138 | ;; | |
21139 | esac | |
21140 | ;; | |
21141 | esac | |
21142 | case "$gl_cv_func_getcwd_path_max" in | |
c0c3707f | 21143 | *"no" | *"no, it has the AIX bug") ;; |
6ec2e0f5 SDJ |
21144 | *) |
21145 | ||
21146 | $as_echo "#define HAVE_MINIMALLY_WORKING_GETCWD 1" >>confdefs.h | |
21147 | ||
21148 | ;; | |
21149 | esac | |
21150 | case "$gl_cv_func_getcwd_path_max" in | |
c0c3707f | 21151 | *"no, but it is partly working") |
6ec2e0f5 SDJ |
21152 | |
21153 | $as_echo "#define HAVE_PARTLY_WORKING_GETCWD 1" >>confdefs.h | |
21154 | ||
21155 | ;; | |
c0c3707f | 21156 | *"yes, but with shorter paths") |
6ec2e0f5 SDJ |
21157 | |
21158 | $as_echo "#define HAVE_GETCWD_SHORTER 1" >>confdefs.h | |
21159 | ||
21160 | ;; | |
21161 | esac | |
21162 | ||
21163 | if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \ | |
21164 | || test $gl_cv_func_getcwd_posix_signature != yes \ | |
21165 | || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \ | |
21166 | || test $gl_abort_bug = yes; then | |
21167 | REPLACE_GETCWD=1 | |
8690e634 JK |
21168 | fi |
21169 | ||
6ec2e0f5 | 21170 | if test $REPLACE_GETCWD = 1; then |
8690e634 JK |
21171 | |
21172 | ||
8690e634 JK |
21173 | |
21174 | ||
21175 | ||
21176 | ||
21177 | ||
21178 | ||
6ec2e0f5 | 21179 | gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext" |
8690e634 JK |
21180 | |
21181 | ||
8690e634 JK |
21182 | |
21183 | ||
6ec2e0f5 SDJ |
21184 | : |
21185 | ||
21186 | fi | |
21187 | ||
8690e634 JK |
21188 | |
21189 | cat >>confdefs.h <<_ACEOF | |
6ec2e0f5 | 21190 | #define GNULIB_GETCWD 1 |
8690e634 JK |
21191 | _ACEOF |
21192 | ||
21193 | ||
8690e634 | 21194 | |
8690e634 JK |
21195 | |
21196 | ||
c971b7fa | 21197 | |
c971b7fa | 21198 | |
6ec2e0f5 SDJ |
21199 | GNULIB_GETCWD=1 |
21200 | ||
21201 | ||
21202 | ||
21203 | ||
21204 | ||
21205 | $as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h | |
21206 | ||
c971b7fa | 21207 | |
c971b7fa | 21208 | |
c971b7fa | 21209 | |
c971b7fa | 21210 | |
c971b7fa | 21211 | |
c971b7fa | 21212 | |
c971b7fa | 21213 | |
6ec2e0f5 SDJ |
21214 | case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in |
21215 | *yes,yes) ;; | |
21216 | *) | |
21217 | REPLACE_GETCWD=1 | |
21218 | ;; | |
21219 | esac | |
c971b7fa | 21220 | |
6ec2e0f5 | 21221 | if test $REPLACE_GETCWD = 1; then |
c971b7fa | 21222 | |
c971b7fa PA |
21223 | |
21224 | ||
c971b7fa PA |
21225 | |
21226 | ||
c971b7fa | 21227 | |
c971b7fa | 21228 | |
c971b7fa | 21229 | |
6ec2e0f5 | 21230 | gl_LIBOBJS="$gl_LIBOBJS getcwd-lgpl.$ac_objext" |
c971b7fa | 21231 | |
6ec2e0f5 | 21232 | fi |
c971b7fa | 21233 | |
c971b7fa | 21234 | |
c971b7fa | 21235 | |
c971b7fa | 21236 | |
8690e634 | 21237 | |
6ec2e0f5 | 21238 | GNULIB_GETCWD=1 |
c971b7fa | 21239 | |
88b48903 WN |
21240 | |
21241 | ||
21242 | ||
88b48903 | 21243 | |
6ec2e0f5 | 21244 | $as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h |
88b48903 | 21245 | |
88b48903 WN |
21246 | |
21247 | ||
21248 | ||
6ec2e0f5 SDJ |
21249 | |
21250 | ||
21251 | ||
21252 | ||
c17253b9 MF |
21253 | |
21254 | ||
21255 | ||
21256 | if test $ac_cv_func_getdelim = yes; then | |
21257 | HAVE_GETDELIM=1 | |
21258 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getdelim function" >&5 | |
21259 | $as_echo_n "checking for working getdelim function... " >&6; } | |
21260 | if ${gl_cv_func_working_getdelim+:} false; then : | |
21261 | $as_echo_n "(cached) " >&6 | |
21262 | else | |
21263 | echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data | |
21264 | if test "$cross_compiling" = yes; then : | |
21265 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21266 | /* end confdefs.h. */ | |
21267 | ||
21268 | #include <features.h> | |
21269 | #ifdef __GNU_LIBRARY__ | |
21270 | #if (__GLIBC__ >= 2) && !defined __UCLIBC__ | |
21271 | Lucky GNU user | |
21272 | #endif | |
21273 | #endif | |
21274 | ||
21275 | _ACEOF | |
21276 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
21277 | $EGREP "Lucky GNU user" >/dev/null 2>&1; then : | |
21278 | gl_cv_func_working_getdelim="guessing yes" | |
21279 | else | |
21280 | case "$host_os" in | |
21281 | *-musl*) gl_cv_func_working_getdelim="guessing yes" ;; | |
21282 | *) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;; | |
21283 | esac | |
21284 | ||
21285 | fi | |
21286 | rm -f conftest* | |
21287 | ||
21288 | ||
21289 | else | |
21290 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21291 | /* end confdefs.h. */ | |
21292 | ||
21293 | # include <stdio.h> | |
21294 | # include <stdlib.h> | |
21295 | # include <string.h> | |
21296 | int main () | |
21297 | { | |
21298 | FILE *in = fopen ("./conftest.data", "r"); | |
21299 | if (!in) | |
21300 | return 1; | |
21301 | { | |
21302 | /* Test result for a NULL buffer and a zero size. | |
21303 | Based on a test program from Karl Heuer. */ | |
21304 | char *line = NULL; | |
21305 | size_t siz = 0; | |
21306 | int len = getdelim (&line, &siz, '\n', in); | |
21307 | if (!(len == 4 && line && strcmp (line, "foo\n") == 0)) | |
21308 | { free (line); fclose (in); return 2; } | |
21309 | free (line); | |
21310 | } | |
21311 | { | |
21312 | /* Test result for a NULL buffer and a non-zero size. | |
21313 | This crashes on FreeBSD 8.0. */ | |
21314 | char *line = NULL; | |
21315 | size_t siz = (size_t)(~0) / 4; | |
21316 | if (getdelim (&line, &siz, '\n', in) == -1) | |
21317 | { fclose (in); return 3; } | |
21318 | free (line); | |
21319 | } | |
21320 | fclose (in); | |
21321 | return 0; | |
21322 | } | |
21323 | ||
21324 | _ACEOF | |
21325 | if ac_fn_c_try_run "$LINENO"; then : | |
21326 | gl_cv_func_working_getdelim=yes | |
21327 | else | |
21328 | gl_cv_func_working_getdelim=no | |
21329 | fi | |
21330 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
21331 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
21332 | fi | |
21333 | ||
21334 | ||
21335 | fi | |
21336 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_getdelim" >&5 | |
21337 | $as_echo "$gl_cv_func_working_getdelim" >&6; } | |
21338 | case "$gl_cv_func_working_getdelim" in | |
21339 | *yes) ;; | |
21340 | *) REPLACE_GETDELIM=1 ;; | |
21341 | esac | |
21342 | else | |
21343 | HAVE_GETDELIM=0 | |
21344 | fi | |
21345 | ||
21346 | if test $ac_cv_have_decl_getdelim = no; then | |
21347 | HAVE_DECL_GETDELIM=0 | |
21348 | fi | |
21349 | ||
21350 | if test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1; then | |
21351 | ||
21352 | ||
21353 | ||
21354 | ||
21355 | ||
21356 | ||
21357 | ||
21358 | ||
21359 | gl_LIBOBJS="$gl_LIBOBJS getdelim.$ac_objext" | |
21360 | ||
21361 | ||
21362 | for ac_func in flockfile funlockfile | |
21363 | do : | |
21364 | as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` | |
21365 | ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" | |
21366 | if eval test \"x\$"$as_ac_var"\" = x"yes"; then : | |
21367 | cat >>confdefs.h <<_ACEOF | |
21368 | #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 | |
21369 | _ACEOF | |
21370 | ||
21371 | fi | |
21372 | done | |
21373 | ||
21374 | ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" | |
21375 | if test "x$ac_cv_have_decl_getc_unlocked" = xyes; then : | |
21376 | ac_have_decl=1 | |
21377 | else | |
21378 | ac_have_decl=0 | |
21379 | fi | |
21380 | ||
21381 | cat >>confdefs.h <<_ACEOF | |
21382 | #define HAVE_DECL_GETC_UNLOCKED $ac_have_decl | |
21383 | _ACEOF | |
21384 | ||
21385 | ||
21386 | fi | |
21387 | ||
21388 | ||
21389 | ||
21390 | ||
21391 | ||
21392 | GNULIB_GETDELIM=1 | |
21393 | ||
21394 | ||
21395 | ||
21396 | ||
21397 | ||
21398 | $as_echo "#define GNULIB_TEST_GETDELIM 1" >>confdefs.h | |
21399 | ||
21400 | ||
21401 | ||
21402 | ||
21403 | ||
21404 | ||
21405 | ||
21406 | ||
6ec2e0f5 SDJ |
21407 | if test $ac_cv_func_getdtablesize = yes && |
21408 | test $ac_cv_have_decl_getdtablesize = yes; then | |
6ec2e0f5 SDJ |
21409 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5 |
21410 | $as_echo_n "checking whether getdtablesize works... " >&6; } | |
d0ac1c44 | 21411 | if ${gl_cv_func_getdtablesize_works+:} false; then : |
88b48903 WN |
21412 | $as_echo_n "(cached) " >&6 |
21413 | else | |
c0c3707f CB |
21414 | case "$host_os" in |
21415 | vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;; | |
21416 | *) | |
21417 | if test "$cross_compiling" = yes; then : | |
88b48903 | 21418 | case "$host_os" in |
c0c3707f CB |
21419 | cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows |
21420 | gl_cv_func_getdtablesize_works="guessing no" ;; | |
21421 | *) gl_cv_func_getdtablesize_works="guessing yes" ;; | |
21422 | esac | |
21423 | ||
88b48903 WN |
21424 | else |
21425 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21426 | /* end confdefs.h. */ | |
21427 | ||
c0c3707f | 21428 | #include <unistd.h> |
9c9d63b1 PM |
21429 | |
21430 | ||
21431 | $gl_mda_defines | |
21432 | ||
21433 | ||
6ec2e0f5 SDJ |
21434 | int |
21435 | main () | |
88b48903 | 21436 | { |
6ec2e0f5 | 21437 | int size = getdtablesize(); |
9c9d63b1 PM |
21438 | if (dup2 (0, getdtablesize()) != -1) |
21439 | return 1; | |
21440 | if (size != getdtablesize()) | |
21441 | return 2; | |
6ec2e0f5 SDJ |
21442 | |
21443 | ; | |
21444 | return 0; | |
88b48903 WN |
21445 | } |
21446 | _ACEOF | |
21447 | if ac_fn_c_try_run "$LINENO"; then : | |
6ec2e0f5 | 21448 | gl_cv_func_getdtablesize_works=yes |
88b48903 | 21449 | else |
6ec2e0f5 | 21450 | gl_cv_func_getdtablesize_works=no |
88b48903 WN |
21451 | fi |
21452 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
21453 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
21454 | fi | |
21455 | ||
c0c3707f CB |
21456 | ;; |
21457 | esac | |
88b48903 WN |
21458 | |
21459 | fi | |
6ec2e0f5 SDJ |
21460 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5 |
21461 | $as_echo "$gl_cv_func_getdtablesize_works" >&6; } | |
21462 | case "$gl_cv_func_getdtablesize_works" in | |
c0c3707f | 21463 | *yes | "no (limitation)") ;; |
6ec2e0f5 | 21464 | *) REPLACE_GETDTABLESIZE=1 ;; |
88b48903 WN |
21465 | esac |
21466 | else | |
6ec2e0f5 | 21467 | HAVE_GETDTABLESIZE=0 |
88b48903 WN |
21468 | fi |
21469 | ||
6ec2e0f5 | 21470 | if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then |
88b48903 WN |
21471 | |
21472 | ||
21473 | ||
21474 | ||
21475 | ||
21476 | ||
21477 | ||
21478 | ||
6ec2e0f5 | 21479 | gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext" |
88b48903 | 21480 | |
6ec2e0f5 | 21481 | : |
88b48903 WN |
21482 | fi |
21483 | ||
21484 | ||
21485 | ||
21486 | ||
21487 | ||
6ec2e0f5 | 21488 | GNULIB_GETDTABLESIZE=1 |
88b48903 WN |
21489 | |
21490 | ||
21491 | ||
88b48903 | 21492 | |
88b48903 | 21493 | |
6ec2e0f5 | 21494 | $as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h |
88b48903 | 21495 | |
88b48903 | 21496 | |
88b48903 | 21497 | |
88b48903 | 21498 | |
88b48903 | 21499 | |
88b48903 | 21500 | |
88b48903 | 21501 | |
88b48903 WN |
21502 | |
21503 | ||
c17253b9 MF |
21504 | |
21505 | gl_getline_needs_run_time_check=no | |
21506 | ac_fn_c_check_func "$LINENO" "getline" "ac_cv_func_getline" | |
21507 | if test "x$ac_cv_func_getline" = xyes; then : | |
21508 | gl_getline_needs_run_time_check=yes | |
21509 | else | |
21510 | am_cv_func_working_getline=no | |
21511 | fi | |
21512 | ||
21513 | if test $gl_getline_needs_run_time_check = yes; then | |
21514 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getline function" >&5 | |
21515 | $as_echo_n "checking for working getline function... " >&6; } | |
21516 | if ${am_cv_func_working_getline+:} false; then : | |
21517 | $as_echo_n "(cached) " >&6 | |
21518 | else | |
21519 | echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data | |
21520 | if test "$cross_compiling" = yes; then : | |
21521 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21522 | /* end confdefs.h. */ | |
21523 | ||
21524 | #include <features.h> | |
21525 | #ifdef __GNU_LIBRARY__ | |
21526 | #if (__GLIBC__ >= 2) && !defined __UCLIBC__ | |
21527 | Lucky GNU user | |
21528 | #endif | |
21529 | #endif | |
21530 | ||
21531 | _ACEOF | |
21532 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
21533 | $EGREP "Lucky GNU user" >/dev/null 2>&1; then : | |
21534 | am_cv_func_working_getline="guessing yes" | |
21535 | else | |
21536 | case "$host_os" in | |
21537 | *-musl*) am_cv_func_working_getline="guessing yes" ;; | |
21538 | *) am_cv_func_working_getline="$gl_cross_guess_normal" ;; | |
21539 | esac | |
21540 | ||
21541 | fi | |
21542 | rm -f conftest* | |
21543 | ||
21544 | ||
21545 | else | |
21546 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21547 | /* end confdefs.h. */ | |
21548 | ||
21549 | # include <stdio.h> | |
21550 | # include <stdlib.h> | |
21551 | # include <string.h> | |
21552 | int main () | |
21553 | { | |
21554 | FILE *in = fopen ("./conftest.data", "r"); | |
21555 | if (!in) | |
21556 | return 1; | |
21557 | { | |
21558 | /* Test result for a NULL buffer and a zero size. | |
21559 | Based on a test program from Karl Heuer. */ | |
21560 | char *line = NULL; | |
21561 | size_t siz = 0; | |
21562 | int len = getline (&line, &siz, in); | |
21563 | if (!(len == 4 && line && strcmp (line, "foo\n") == 0)) | |
21564 | { free (line); fclose (in); return 2; } | |
21565 | free (line); | |
21566 | } | |
21567 | { | |
21568 | /* Test result for a NULL buffer and a non-zero size. | |
21569 | This crashes on FreeBSD 8.0. */ | |
21570 | char *line = NULL; | |
21571 | size_t siz = (size_t)(~0) / 4; | |
21572 | if (getline (&line, &siz, in) == -1) | |
21573 | { fclose (in); return 3; } | |
21574 | free (line); | |
21575 | } | |
21576 | fclose (in); | |
21577 | return 0; | |
21578 | } | |
21579 | ||
21580 | _ACEOF | |
21581 | if ac_fn_c_try_run "$LINENO"; then : | |
21582 | am_cv_func_working_getline=yes | |
21583 | else | |
21584 | am_cv_func_working_getline=no | |
21585 | fi | |
21586 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
21587 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
21588 | fi | |
21589 | ||
21590 | ||
21591 | fi | |
21592 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_working_getline" >&5 | |
21593 | $as_echo "$am_cv_func_working_getline" >&6; } | |
21594 | fi | |
21595 | ||
21596 | if test $ac_cv_have_decl_getline = no; then | |
21597 | HAVE_DECL_GETLINE=0 | |
21598 | fi | |
21599 | ||
21600 | case "$am_cv_func_working_getline" in | |
21601 | *yes) ;; | |
21602 | *) | |
21603 | REPLACE_GETLINE=1 | |
21604 | ;; | |
21605 | esac | |
21606 | ||
21607 | if test $REPLACE_GETLINE = 1; then | |
21608 | ||
21609 | ||
21610 | ||
21611 | ||
21612 | ||
21613 | ||
21614 | ||
21615 | ||
21616 | gl_LIBOBJS="$gl_LIBOBJS getline.$ac_objext" | |
21617 | ||
21618 | ||
21619 | : | |
21620 | ||
21621 | fi | |
21622 | ||
21623 | ||
21624 | ||
21625 | ||
21626 | ||
21627 | GNULIB_GETLINE=1 | |
21628 | ||
21629 | ||
21630 | ||
21631 | ||
21632 | ||
21633 | $as_echo "#define GNULIB_TEST_GETLINE 1" >>confdefs.h | |
21634 | ||
21635 | ||
21636 | ||
21637 | ||
21638 | ||
21639 | ||
21640 | ||
21641 | ||
21642 | ||
6ec2e0f5 SDJ |
21643 | if test $ac_cv_have_decl_getlogin_r = no; then |
21644 | HAVE_DECL_GETLOGIN_R=0 | |
21645 | fi | |
88b48903 | 21646 | |
88b48903 | 21647 | |
6ec2e0f5 SDJ |
21648 | if test $ac_cv_func_getlogin_r = no; then |
21649 | HAVE_GETLOGIN_R=0 | |
21650 | else | |
21651 | HAVE_GETLOGIN_R=1 | |
21652 | ||
21653 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getlogin_r works with small buffers" >&5 | |
21654 | $as_echo_n "checking whether getlogin_r works with small buffers... " >&6; } | |
d0ac1c44 | 21655 | if ${gl_cv_func_getlogin_r_works+:} false; then : |
6ec2e0f5 SDJ |
21656 | $as_echo_n "(cached) " >&6 |
21657 | else | |
88b48903 | 21658 | |
6ec2e0f5 | 21659 | case "$host_os" in |
c0c3707f CB |
21660 | # Guess no on Mac OS X, OSF/1. |
21661 | darwin* | osf*) gl_cv_func_getlogin_r_works="guessing no" ;; | |
21662 | # Guess yes otherwise. | |
21663 | *) gl_cv_func_getlogin_r_works="guessing yes" ;; | |
6ec2e0f5 SDJ |
21664 | esac |
21665 | if test "$cross_compiling" = yes; then : | |
21666 | : | |
88b48903 WN |
21667 | else |
21668 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21669 | /* end confdefs.h. */ | |
21670 | ||
6ec2e0f5 | 21671 | #include <stddef.h> |
c0c3707f | 21672 | #include <string.h> |
6ec2e0f5 SDJ |
21673 | #include <unistd.h> |
21674 | #if !HAVE_DECL_GETLOGIN_R | |
88b48903 | 21675 | extern |
6ec2e0f5 | 21676 | # ifdef __cplusplus |
88b48903 | 21677 | "C" |
6ec2e0f5 SDJ |
21678 | # endif |
21679 | int getlogin_r (char *, size_t); | |
88b48903 | 21680 | #endif |
6ec2e0f5 SDJ |
21681 | int |
21682 | main (void) | |
88b48903 WN |
21683 | { |
21684 | int result = 0; | |
6ec2e0f5 SDJ |
21685 | char buf[100]; |
21686 | ||
21687 | if (getlogin_r (buf, 0) == 0) | |
c0c3707f | 21688 | result |= 1; |
6ec2e0f5 | 21689 | if (getlogin_r (buf, 1) == 0) |
c0c3707f CB |
21690 | result |= 2; |
21691 | if (getlogin_r (buf, 100) == 0) | |
21692 | { | |
21693 | size_t n = strlen (buf); | |
21694 | if (getlogin_r (buf, n) == 0) | |
21695 | result |= 4; | |
21696 | } | |
88b48903 WN |
21697 | return result; |
21698 | } | |
21699 | _ACEOF | |
21700 | if ac_fn_c_try_run "$LINENO"; then : | |
6ec2e0f5 | 21701 | gl_cv_func_getlogin_r_works=yes |
88b48903 | 21702 | else |
c0c3707f | 21703 | gl_cv_func_getlogin_r_works=no |
88b48903 WN |
21704 | fi |
21705 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
21706 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
21707 | fi | |
21708 | ||
21709 | ||
4a626d0a | 21710 | fi |
6ec2e0f5 SDJ |
21711 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getlogin_r_works" >&5 |
21712 | $as_echo "$gl_cv_func_getlogin_r_works" >&6; } | |
21713 | case "$gl_cv_func_getlogin_r_works" in | |
21714 | *yes) ;; | |
21715 | *) REPLACE_GETLOGIN_R=1 ;; | |
21716 | esac | |
21717 | fi | |
21718 | ||
21719 | if test $HAVE_GETLOGIN_R = 0 || test $REPLACE_GETLOGIN_R = 1; then | |
21720 | ||
21721 | ||
21722 | ||
21723 | ||
21724 | ||
21725 | ||
21726 | ||
21727 | ||
21728 | gl_LIBOBJS="$gl_LIBOBJS getlogin_r.$ac_objext" | |
4a626d0a | 21729 | |
4a626d0a | 21730 | |
4a626d0a | 21731 | |
4a626d0a | 21732 | |
4a626d0a PA |
21733 | fi |
21734 | ||
21735 | ||
4a626d0a PA |
21736 | |
21737 | ||
21738 | ||
6ec2e0f5 | 21739 | GNULIB_GETLOGIN_R=1 |
4a626d0a PA |
21740 | |
21741 | ||
21742 | ||
21743 | ||
21744 | ||
6ec2e0f5 | 21745 | $as_echo "#define GNULIB_TEST_GETLOGIN_R 1" >>confdefs.h |
4a626d0a | 21746 | |
4a626d0a PA |
21747 | |
21748 | ||
21749 | ||
21750 | ||
472fa5ee | 21751 | |
4a626d0a | 21752 | |
6ec2e0f5 SDJ |
21753 | ac_found=0 |
21754 | ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h> | |
21755 | " | |
d0ac1c44 | 21756 | if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then : |
6ec2e0f5 SDJ |
21757 | ac_have_decl=1 |
21758 | else | |
21759 | ac_have_decl=0 | |
21760 | fi | |
21761 | ||
21762 | cat >>confdefs.h <<_ACEOF | |
21763 | #define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl | |
21764 | _ACEOF | |
21765 | if test $ac_have_decl = 1; then : | |
21766 | ac_found=1 | |
21767 | fi | |
21768 | ||
21769 | ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h> | |
21770 | " | |
d0ac1c44 | 21771 | if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then : |
6ec2e0f5 SDJ |
21772 | ac_have_decl=1 |
21773 | else | |
21774 | ac_have_decl=0 | |
21775 | fi | |
21776 | ||
21777 | cat >>confdefs.h <<_ACEOF | |
21778 | #define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl | |
21779 | _ACEOF | |
21780 | if test $ac_have_decl = 1; then : | |
21781 | ac_found=1 | |
21782 | fi | |
4a626d0a | 21783 | |
6ec2e0f5 SDJ |
21784 | ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h> |
21785 | " | |
d0ac1c44 | 21786 | if test "x$ac_cv_have_decl___argv" = xyes; then : |
6ec2e0f5 SDJ |
21787 | ac_have_decl=1 |
21788 | else | |
21789 | ac_have_decl=0 | |
21790 | fi | |
4a626d0a | 21791 | |
6ec2e0f5 SDJ |
21792 | cat >>confdefs.h <<_ACEOF |
21793 | #define HAVE_DECL___ARGV $ac_have_decl | |
21794 | _ACEOF | |
21795 | if test $ac_have_decl = 1; then : | |
21796 | ac_found=1 | |
21797 | fi | |
4a626d0a PA |
21798 | |
21799 | ||
6ec2e0f5 SDJ |
21800 | # Incur the cost of this test only if none of the above worked. |
21801 | if test $ac_found = 0; then | |
21802 | # On OpenBSD 5.1, using the global __progname variable appears to be | |
21803 | # the only way to implement getprogname. | |
21804 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5 | |
21805 | $as_echo_n "checking whether __progname is defined in default libraries... " >&6; } | |
d0ac1c44 | 21806 | if ${gl_cv_var___progname+:} false; then : |
6ec2e0f5 SDJ |
21807 | $as_echo_n "(cached) " >&6 |
21808 | else | |
4a626d0a | 21809 | |
6ec2e0f5 SDJ |
21810 | gl_cv_var___progname= |
21811 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21812 | /* end confdefs.h. */ | |
21813 | extern char *__progname; | |
21814 | int | |
21815 | main () | |
21816 | { | |
21817 | return *__progname; | |
21818 | ||
21819 | ; | |
21820 | return 0; | |
21821 | } | |
21822 | _ACEOF | |
21823 | if ac_fn_c_try_link "$LINENO"; then : | |
21824 | gl_cv_var___progname=yes | |
21825 | ||
21826 | fi | |
21827 | rm -f core conftest.err conftest.$ac_objext \ | |
21828 | conftest$ac_exeext conftest.$ac_ext | |
21829 | ||
21830 | ||
21831 | fi | |
21832 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5 | |
21833 | $as_echo "$gl_cv_var___progname" >&6; } | |
21834 | if test "$gl_cv_var___progname" = yes; then | |
21835 | ||
21836 | $as_echo "#define HAVE_VAR___PROGNAME 1" >>confdefs.h | |
21837 | ||
21838 | fi | |
21839 | fi | |
4a626d0a PA |
21840 | |
21841 | ||
21842 | ||
21843 | ||
21844 | ||
698be2d8 CB |
21845 | if test "$ac_cv_func_getrandom" != yes; then |
21846 | HAVE_GETRANDOM=0 | |
21847 | else | |
21848 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getrandom is compatible with its GNU+BSD signature" >&5 | |
21849 | $as_echo_n "checking whether getrandom is compatible with its GNU+BSD signature... " >&6; } | |
21850 | if ${gl_cv_func_getrandom_ok+:} false; then : | |
21851 | $as_echo_n "(cached) " >&6 | |
21852 | else | |
21853 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21854 | /* end confdefs.h. */ | |
9c9d63b1 PM |
21855 | /* Additional includes are needed before <sys/random.h> on uClibc |
21856 | and Mac OS X. */ | |
698be2d8 CB |
21857 | #include <sys/types.h> |
21858 | #include <stdlib.h> | |
21859 | #include <sys/random.h> | |
21860 | ssize_t getrandom (void *, size_t, unsigned int); | |
21861 | ||
21862 | int | |
21863 | main () | |
21864 | { | |
21865 | ||
21866 | ; | |
21867 | return 0; | |
21868 | } | |
21869 | ||
21870 | _ACEOF | |
21871 | if ac_fn_c_try_compile "$LINENO"; then : | |
21872 | gl_cv_func_getrandom_ok=yes | |
21873 | else | |
21874 | gl_cv_func_getrandom_ok=no | |
21875 | fi | |
21876 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21877 | ||
21878 | fi | |
21879 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getrandom_ok" >&5 | |
21880 | $as_echo "$gl_cv_func_getrandom_ok" >&6; } | |
21881 | if test $gl_cv_func_getrandom_ok = no; then | |
21882 | REPLACE_GETRANDOM=1 | |
21883 | fi | |
21884 | fi | |
21885 | ||
21886 | case "$host_os" in | |
21887 | mingw*) | |
21888 | for ac_header in bcrypt.h | |
21889 | do : | |
9c9d63b1 PM |
21890 | ac_fn_c_check_header_compile "$LINENO" "bcrypt.h" "ac_cv_header_bcrypt_h" "#include <windows.h> |
21891 | ||
21892 | " | |
698be2d8 CB |
21893 | if test "x$ac_cv_header_bcrypt_h" = xyes; then : |
21894 | cat >>confdefs.h <<_ACEOF | |
21895 | #define HAVE_BCRYPT_H 1 | |
21896 | _ACEOF | |
21897 | ||
21898 | fi | |
21899 | ||
21900 | done | |
21901 | ||
21902 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the bcrypt library is guaranteed to be present" >&5 | |
21903 | $as_echo_n "checking whether the bcrypt library is guaranteed to be present... " >&6; } | |
21904 | if ${gl_cv_lib_assume_bcrypt+:} false; then : | |
21905 | $as_echo_n "(cached) " >&6 | |
21906 | else | |
21907 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21908 | /* end confdefs.h. */ | |
21909 | #include <windows.h> | |
21910 | int | |
21911 | main () | |
21912 | { | |
21913 | #if !(_WIN32_WINNT >= _WIN32_WINNT_WIN7) | |
21914 | cannot assume it | |
21915 | #endif | |
21916 | ||
21917 | ; | |
21918 | return 0; | |
21919 | } | |
21920 | ||
21921 | _ACEOF | |
21922 | if ac_fn_c_try_compile "$LINENO"; then : | |
21923 | gl_cv_lib_assume_bcrypt=yes | |
21924 | else | |
21925 | gl_cv_lib_assume_bcrypt=no | |
21926 | fi | |
21927 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21928 | ||
21929 | fi | |
21930 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_assume_bcrypt" >&5 | |
21931 | $as_echo "$gl_cv_lib_assume_bcrypt" >&6; } | |
21932 | if test $gl_cv_lib_assume_bcrypt = yes; then | |
21933 | ||
21934 | $as_echo "#define HAVE_LIB_BCRYPT 1" >>confdefs.h | |
21935 | ||
21936 | LIB_GETRANDOM='-lbcrypt' | |
21937 | else | |
21938 | LIB_GETRANDOM='-ladvapi32' | |
21939 | fi | |
21940 | ;; | |
21941 | *) | |
21942 | LIB_GETRANDOM= ;; | |
21943 | esac | |
21944 | ||
21945 | ||
21946 | if test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1; then | |
21947 | ||
21948 | ||
21949 | ||
21950 | ||
21951 | ||
21952 | ||
21953 | ||
21954 | ||
21955 | gl_LIBOBJS="$gl_LIBOBJS getrandom.$ac_objext" | |
21956 | ||
21957 | fi | |
21958 | ||
21959 | ||
21960 | ||
21961 | ||
21962 | ||
21963 | GNULIB_GETRANDOM=1 | |
21964 | ||
21965 | ||
21966 | ||
21967 | ||
21968 | ||
21969 | $as_echo "#define GNULIB_TEST_GETRANDOM 1" >>confdefs.h | |
21970 | ||
21971 | ||
21972 | ||
21973 | ||
21974 | ||
21975 | ||
21976 | ||
4a626d0a PA |
21977 | |
21978 | ||
21979 | ||
472fa5ee | 21980 | |
4a626d0a PA |
21981 | |
21982 | gl_gettimeofday_timezone=void | |
21983 | if test $ac_cv_func_gettimeofday != yes; then | |
21984 | HAVE_GETTIMEOFDAY=0 | |
21985 | else | |
4a626d0a PA |
21986 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5 |
21987 | $as_echo_n "checking for gettimeofday with POSIX signature... " >&6; } | |
d0ac1c44 | 21988 | if ${gl_cv_func_gettimeofday_posix_signature+:} false; then : |
4a626d0a PA |
21989 | $as_echo_n "(cached) " >&6 |
21990 | else | |
21991 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21992 | /* end confdefs.h. */ | |
21993 | #include <sys/time.h> | |
21994 | struct timeval c; | |
21995 | int gettimeofday (struct timeval *restrict, void *restrict); | |
21996 | ||
21997 | int | |
21998 | main () | |
21999 | { | |
22000 | /* glibc uses struct timezone * rather than the POSIX void * | |
22001 | if _GNU_SOURCE is defined. However, since the only portable | |
22002 | use of gettimeofday uses NULL as the second parameter, and | |
22003 | since the glibc definition is actually more typesafe, it is | |
22004 | not worth wrapping this to get a compliant signature. */ | |
22005 | int (*f) (struct timeval *restrict, void *restrict) | |
22006 | = gettimeofday; | |
22007 | int x = f (&c, 0); | |
22008 | return !(x | c.tv_sec | c.tv_usec); | |
22009 | ||
22010 | ; | |
22011 | return 0; | |
22012 | } | |
22013 | _ACEOF | |
22014 | if ac_fn_c_try_compile "$LINENO"; then : | |
22015 | gl_cv_func_gettimeofday_posix_signature=yes | |
22016 | else | |
22017 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22018 | /* end confdefs.h. */ | |
22019 | #include <sys/time.h> | |
22020 | int gettimeofday (struct timeval *restrict, struct timezone *restrict); | |
22021 | ||
22022 | int | |
22023 | main () | |
22024 | { | |
22025 | ||
22026 | ; | |
22027 | return 0; | |
22028 | } | |
22029 | _ACEOF | |
22030 | if ac_fn_c_try_compile "$LINENO"; then : | |
22031 | gl_cv_func_gettimeofday_posix_signature=almost | |
22032 | else | |
22033 | gl_cv_func_gettimeofday_posix_signature=no | |
22034 | fi | |
22035 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
22036 | fi | |
22037 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
22038 | fi | |
22039 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5 | |
22040 | $as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; } | |
22041 | if test $gl_cv_func_gettimeofday_posix_signature = almost; then | |
22042 | gl_gettimeofday_timezone='struct timezone' | |
22043 | elif test $gl_cv_func_gettimeofday_posix_signature != yes; then | |
22044 | REPLACE_GETTIMEOFDAY=1 | |
22045 | fi | |
22046 | if test $REPLACE_STRUCT_TIMEVAL = 1; then | |
22047 | REPLACE_GETTIMEOFDAY=1 | |
22048 | fi | |
c0c3707f CB |
22049 | case "$host_os" in |
22050 | mingw*) REPLACE_GETTIMEOFDAY=1 ;; | |
22051 | esac | |
4a626d0a PA |
22052 | fi |
22053 | ||
22054 | cat >>confdefs.h <<_ACEOF | |
c0c3707f CB |
22055 | #define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone |
22056 | _ACEOF | |
88b48903 WN |
22057 | |
22058 | ||
c0c3707f | 22059 | if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then |
88b48903 | 22060 | |
6ec2e0f5 | 22061 | |
6ec2e0f5 | 22062 | |
6ec2e0f5 | 22063 | |
6ec2e0f5 | 22064 | |
6ec2e0f5 SDJ |
22065 | |
22066 | ||
6ec2e0f5 | 22067 | |
c0c3707f | 22068 | gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" |
6ec2e0f5 | 22069 | |
c0c3707f | 22070 | : |
5e8754f9 | 22071 | fi |
6ec2e0f5 SDJ |
22072 | |
22073 | ||
22074 | ||
6ec2e0f5 SDJ |
22075 | |
22076 | ||
5e8754f9 | 22077 | GNULIB_GETTIMEOFDAY=1 |
6ec2e0f5 SDJ |
22078 | |
22079 | ||
22080 | ||
7a6dbc2f SDJ |
22081 | |
22082 | ||
5e8754f9 | 22083 | $as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h |
6ec2e0f5 SDJ |
22084 | |
22085 | ||
22086 | ||
6ec2e0f5 | 22087 | |
6ec2e0f5 | 22088 | |
6ec2e0f5 SDJ |
22089 | |
22090 | ||
c0c3707f CB |
22091 | if test $ac_cv_func_glob = no; then |
22092 | HAVE_GLOB=0 | |
22093 | else | |
22094 | ||
22095 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU glob interface version 1 or 2" >&5 | |
22096 | $as_echo_n "checking for GNU glob interface version 1 or 2... " >&6; } | |
22097 | if ${gl_cv_gnu_glob_interface_version_1_2+:} false; then : | |
6ec2e0f5 SDJ |
22098 | $as_echo_n "(cached) " >&6 |
22099 | else | |
22100 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22101 | /* end confdefs.h. */ | |
22102 | #include <gnu-versions.h> | |
c0c3707f | 22103 | char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1 : -1]; |
6ec2e0f5 SDJ |
22104 | _ACEOF |
22105 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 22106 | gl_cv_gnu_glob_interface_version_1_2=yes |
6ec2e0f5 | 22107 | else |
c0c3707f | 22108 | gl_cv_gnu_glob_interface_version_1_2=no |
6ec2e0f5 SDJ |
22109 | fi |
22110 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
22111 | fi | |
c0c3707f CB |
22112 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_gnu_glob_interface_version_1_2" >&5 |
22113 | $as_echo "$gl_cv_gnu_glob_interface_version_1_2" >&6; } | |
22114 | if test "$gl_cv_gnu_glob_interface_version_1_2" = "no"; then | |
22115 | REPLACE_GLOB=1 | |
6ec2e0f5 | 22116 | fi |
6ec2e0f5 | 22117 | |
c0c3707f CB |
22118 | if test $REPLACE_GLOB = 0; then |
22119 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether glob lists broken symlinks" >&5 | |
6ec2e0f5 | 22120 | $as_echo_n "checking whether glob lists broken symlinks... " >&6; } |
d0ac1c44 | 22121 | if ${gl_cv_glob_lists_symlinks+:} false; then : |
6ec2e0f5 SDJ |
22122 | $as_echo_n "(cached) " >&6 |
22123 | else | |
c0c3707f CB |
22124 | if test $cross_compiling != yes; then |
22125 | if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then | |
22126 | gl_cv_glob_lists_symlinks=maybe | |
22127 | else | |
22128 | # If we can't make a symlink, then we cannot test this issue. Be | |
22129 | # pessimistic about this. | |
22130 | gl_cv_glob_lists_symlinks=no | |
22131 | fi | |
22132 | if test $gl_cv_glob_lists_symlinks = maybe; then | |
22133 | if test "$cross_compiling" = yes; then : | |
22134 | : | |
5e8754f9 | 22135 | |
6ec2e0f5 SDJ |
22136 | else |
22137 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22138 | /* end confdefs.h. */ | |
6ec2e0f5 | 22139 | #include <stddef.h> |
c0c3707f | 22140 | #include <glob.h> |
6ec2e0f5 SDJ |
22141 | int |
22142 | main () | |
22143 | { | |
22144 | glob_t found; | |
c0c3707f CB |
22145 | if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH) |
22146 | return 1; | |
698be2d8 | 22147 | globfree (&found); |
c0c3707f | 22148 | |
6ec2e0f5 SDJ |
22149 | ; |
22150 | return 0; | |
22151 | } | |
4a626d0a | 22152 | _ACEOF |
6ec2e0f5 SDJ |
22153 | if ac_fn_c_try_run "$LINENO"; then : |
22154 | gl_cv_glob_lists_symlinks=yes | |
22155 | else | |
22156 | gl_cv_glob_lists_symlinks=no | |
22157 | fi | |
22158 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
22159 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
22160 | fi | |
88b48903 | 22161 | |
c0c3707f CB |
22162 | fi |
22163 | rm -f conf$$-globtest | |
22164 | else | |
22165 | gl_cv_glob_lists_symlinks="$gl_cross_guess_normal" | |
22166 | fi | |
22167 | ||
4a626d0a | 22168 | fi |
6ec2e0f5 SDJ |
22169 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_glob_lists_symlinks" >&5 |
22170 | $as_echo "$gl_cv_glob_lists_symlinks" >&6; } | |
c0c3707f CB |
22171 | case "$gl_cv_glob_lists_symlinks" in |
22172 | *yes) ;; | |
22173 | *) REPLACE_GLOB=1 ;; | |
22174 | esac | |
22175 | fi | |
22176 | ||
22177 | fi | |
88b48903 | 22178 | |
c0c3707f CB |
22179 | if test $ac_cv_func_glob_pattern_p = no; then |
22180 | HAVE_GLOB_PATTERN_P=0 | |
22181 | else | |
22182 | if test $REPLACE_GLOB = 1; then | |
22183 | REPLACE_GLOB_PATTERN_P=1 | |
6ec2e0f5 SDJ |
22184 | fi |
22185 | fi | |
4a626d0a | 22186 | |
c0c3707f | 22187 | if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then |
4a626d0a | 22188 | |
88b48903 | 22189 | |
c0c3707f | 22190 | GLOB_H='glob.h' |
6ec2e0f5 SDJ |
22191 | if test -n "$GLOB_H"; then |
22192 | GL_GENERATE_GLOB_H_TRUE= | |
22193 | GL_GENERATE_GLOB_H_FALSE='#' | |
22194 | else | |
22195 | GL_GENERATE_GLOB_H_TRUE='#' | |
22196 | GL_GENERATE_GLOB_H_FALSE= | |
22197 | fi | |
88b48903 | 22198 | |
88b48903 | 22199 | |
c0c3707f CB |
22200 | fi |
22201 | ||
22202 | if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then | |
472fa5ee SM |
22203 | |
22204 | ||
22205 | ||
22206 | ||
22207 | ||
22208 | ||
22209 | ||
22210 | ||
22211 | gl_LIBOBJS="$gl_LIBOBJS glob.$ac_objext" | |
22212 | ||
22213 | ||
22214 | ||
7a6dbc2f SDJ |
22215 | |
22216 | ||
22217 | ||
472fa5ee | 22218 | |
472fa5ee | 22219 | |
88b48903 | 22220 | |
c0c3707f | 22221 | gl_LIBOBJS="$gl_LIBOBJS globfree.$ac_objext" |
88b48903 WN |
22222 | |
22223 | ||
22224 | ||
725e2999 JB |
22225 | |
22226 | ||
22227 | ||
c0c3707f CB |
22228 | fi |
22229 | if test $HAVE_GLOB_PATTERN_P = 0 || test $REPLACE_GLOB_PATTERN_P = 1; then | |
22230 | ||
725e2999 JB |
22231 | |
22232 | ||
22233 | ||
22234 | ||
22235 | ||
22236 | ||
22237 | ||
c0c3707f | 22238 | gl_LIBOBJS="$gl_LIBOBJS glob_pattern_p.$ac_objext" |
725e2999 JB |
22239 | |
22240 | fi | |
22241 | ||
725e2999 JB |
22242 | |
22243 | ||
22244 | ||
22245 | ||
c0c3707f CB |
22246 | GNULIB_GLOB=1 |
22247 | ||
22248 | ||
22249 | ||
22250 | ||
22251 | ||
22252 | $as_echo "#define GNULIB_TEST_GLOB 1" >>confdefs.h | |
22253 | ||
22254 | ||
725e2999 JB |
22255 | |
22256 | ||
22257 | ||
5df4cba6 SM |
22258 | LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL" |
22259 | ||
22260 | ||
725e2999 | 22261 | |
725e2999 JB |
22262 | |
22263 | ||
22264 | ||
22265 | ||
725e2999 | 22266 | |
c0c3707f CB |
22267 | HAVE_INET_NTOP=1 |
22268 | INET_NTOP_LIB= | |
725e2999 JB |
22269 | |
22270 | ||
22271 | ||
22272 | ||
22273 | if test $ac_cv_header_sys_socket_h != yes; then | |
22274 | for ac_header in winsock2.h | |
22275 | do : | |
22276 | ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" | |
22277 | if test "x$ac_cv_header_winsock2_h" = xyes; then : | |
22278 | cat >>confdefs.h <<_ACEOF | |
22279 | #define HAVE_WINSOCK2_H 1 | |
22280 | _ACEOF | |
22281 | ||
22282 | fi | |
22283 | ||
22284 | done | |
22285 | ||
22286 | fi | |
22287 | if test "$ac_cv_header_winsock2_h" = yes; then | |
22288 | HAVE_WINSOCK2_H=1 | |
22289 | UNISTD_H_HAVE_WINSOCK2_H=1 | |
22290 | SYS_IOCTL_H_HAVE_WINSOCK2_H=1 | |
22291 | else | |
22292 | HAVE_WINSOCK2_H=0 | |
22293 | fi | |
22294 | ||
22295 | ||
22296 | if test $HAVE_WINSOCK2_H = 1; then | |
c0c3707f | 22297 | REPLACE_INET_NTOP=1 |
725e2999 JB |
22298 | ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <ws2tcpip.h> |
22299 | " | |
22300 | if test "x$ac_cv_have_decl_inet_ntop" = xyes; then : | |
22301 | ac_have_decl=1 | |
22302 | else | |
22303 | ac_have_decl=0 | |
22304 | fi | |
22305 | ||
22306 | cat >>confdefs.h <<_ACEOF | |
22307 | #define HAVE_DECL_INET_NTOP $ac_have_decl | |
22308 | _ACEOF | |
22309 | ||
22310 | if test $ac_cv_have_decl_inet_ntop = yes; then | |
725e2999 JB |
22311 | INET_NTOP_LIB="-lws2_32" |
22312 | else | |
22313 | HAVE_DECL_INET_NTOP=0 | |
725e2999 JB |
22314 | fi |
22315 | else | |
22316 | gl_save_LIBS=$LIBS | |
22317 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 | |
22318 | $as_echo_n "checking for library containing inet_ntop... " >&6; } | |
22319 | if ${ac_cv_search_inet_ntop+:} false; then : | |
22320 | $as_echo_n "(cached) " >&6 | |
22321 | else | |
22322 | ac_func_search_save_LIBS=$LIBS | |
22323 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22324 | /* end confdefs.h. */ | |
22325 | ||
22326 | /* Override any GCC internal prototype to avoid an error. | |
22327 | Use char because int might match the return type of a GCC | |
22328 | builtin and then its argument prototype would still apply. */ | |
22329 | #ifdef __cplusplus | |
22330 | extern "C" | |
22331 | #endif | |
22332 | char inet_ntop (); | |
22333 | int | |
22334 | main () | |
22335 | { | |
22336 | return inet_ntop (); | |
22337 | ; | |
22338 | return 0; | |
22339 | } | |
22340 | _ACEOF | |
c0c3707f | 22341 | for ac_lib in '' nsl resolv network; do |
725e2999 JB |
22342 | if test -z "$ac_lib"; then |
22343 | ac_res="none required" | |
22344 | else | |
22345 | ac_res=-l$ac_lib | |
22346 | LIBS="-l$ac_lib $ac_func_search_save_LIBS" | |
22347 | fi | |
22348 | if ac_fn_c_try_link "$LINENO"; then : | |
22349 | ac_cv_search_inet_ntop=$ac_res | |
22350 | fi | |
22351 | rm -f core conftest.err conftest.$ac_objext \ | |
22352 | conftest$ac_exeext | |
22353 | if ${ac_cv_search_inet_ntop+:} false; then : | |
22354 | break | |
22355 | fi | |
22356 | done | |
22357 | if ${ac_cv_search_inet_ntop+:} false; then : | |
22358 | ||
22359 | else | |
22360 | ac_cv_search_inet_ntop=no | |
22361 | fi | |
22362 | rm conftest.$ac_ext | |
22363 | LIBS=$ac_func_search_save_LIBS | |
22364 | fi | |
22365 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 | |
22366 | $as_echo "$ac_cv_search_inet_ntop" >&6; } | |
22367 | ac_res=$ac_cv_search_inet_ntop | |
22368 | if test "$ac_res" != no; then : | |
22369 | test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" | |
22370 | ||
22371 | else | |
22372 | for ac_func in inet_ntop | |
22373 | do : | |
22374 | ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop" | |
22375 | if test "x$ac_cv_func_inet_ntop" = xyes; then : | |
22376 | cat >>confdefs.h <<_ACEOF | |
22377 | #define HAVE_INET_NTOP 1 | |
22378 | _ACEOF | |
22379 | ||
22380 | fi | |
22381 | done | |
22382 | ||
22383 | if test $ac_cv_func_inet_ntop = no; then | |
22384 | HAVE_INET_NTOP=0 | |
22385 | fi | |
22386 | ||
22387 | fi | |
22388 | ||
22389 | LIBS=$gl_save_LIBS | |
22390 | ||
22391 | if test "$ac_cv_search_inet_ntop" != "no" \ | |
22392 | && test "$ac_cv_search_inet_ntop" != "none required"; then | |
22393 | INET_NTOP_LIB="$ac_cv_search_inet_ntop" | |
22394 | fi | |
22395 | ||
22396 | ||
725e2999 JB |
22397 | ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <arpa/inet.h> |
22398 | #if HAVE_NETDB_H | |
22399 | # include <netdb.h> | |
22400 | #endif | |
22401 | ||
22402 | " | |
22403 | if test "x$ac_cv_have_decl_inet_ntop" = xyes; then : | |
22404 | ac_have_decl=1 | |
22405 | else | |
22406 | ac_have_decl=0 | |
22407 | fi | |
22408 | ||
22409 | cat >>confdefs.h <<_ACEOF | |
22410 | #define HAVE_DECL_INET_NTOP $ac_have_decl | |
22411 | _ACEOF | |
22412 | ||
22413 | if test $ac_cv_have_decl_inet_ntop = no; then | |
22414 | HAVE_DECL_INET_NTOP=0 | |
22415 | fi | |
22416 | fi | |
22417 | ||
22418 | ||
22419 | if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then | |
22420 | ||
22421 | ||
22422 | ||
22423 | ||
22424 | ||
22425 | ||
22426 | ||
7a6dbc2f | 22427 | |
725e2999 | 22428 | gl_LIBOBJS="$gl_LIBOBJS inet_ntop.$ac_objext" |
7a6dbc2f SDJ |
22429 | |
22430 | ||
22431 | ||
7a6dbc2f | 22432 | |
725e2999 | 22433 | fi |
7a6dbc2f SDJ |
22434 | |
22435 | ||
22436 | ||
22437 | ||
7a6dbc2f | 22438 | |
725e2999 JB |
22439 | GNULIB_INET_NTOP=1 |
22440 | ||
7a6dbc2f SDJ |
22441 | |
22442 | ||
49e4877c PA |
22443 | |
22444 | ||
88b48903 WN |
22445 | |
22446 | ||
88b48903 WN |
22447 | PRIPTR_PREFIX= |
22448 | if test -n "$STDINT_H"; then | |
9c9d63b1 PM |
22449 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
22450 | /* end confdefs.h. */ | |
22451 | ||
22452 | #ifdef _WIN64 | |
22453 | LLP64 | |
22454 | #endif | |
22455 | ||
22456 | int | |
22457 | main () | |
22458 | { | |
22459 | ||
22460 | ; | |
22461 | return 0; | |
22462 | } | |
22463 | ||
22464 | _ACEOF | |
22465 | if ac_fn_c_try_compile "$LINENO"; then : | |
22466 | PRIPTR_PREFIX='"l"' | |
22467 | else | |
22468 | PRIPTR_PREFIX='"ll"' | |
22469 | fi | |
22470 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
88b48903 WN |
22471 | else |
22472 | for glpfx in '' l ll I64; do | |
22473 | case $glpfx in | |
22474 | '') gltype1='int';; | |
22475 | l) gltype1='long int';; | |
22476 | ll) gltype1='long long int';; | |
22477 | I64) gltype1='__int64';; | |
22478 | esac | |
22479 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22480 | /* end confdefs.h. */ | |
22481 | #include <stdint.h> | |
22482 | extern intptr_t foo; | |
22483 | extern $gltype1 foo; | |
22484 | int | |
22485 | main () | |
22486 | { | |
22487 | ||
22488 | ; | |
22489 | return 0; | |
22490 | } | |
22491 | _ACEOF | |
22492 | if ac_fn_c_try_compile "$LINENO"; then : | |
22493 | PRIPTR_PREFIX='"'$glpfx'"' | |
22494 | fi | |
22495 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
22496 | test -n "$PRIPTR_PREFIX" && break | |
22497 | done | |
22498 | fi | |
22499 | ||
22500 | ||
22501 | ||
22502 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5 | |
22503 | $as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; } | |
d0ac1c44 | 22504 | if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then : |
88b48903 WN |
22505 | $as_echo_n "(cached) " >&6 |
22506 | else | |
22507 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22508 | /* end confdefs.h. */ | |
22509 | /* Work also in C++ mode. */ | |
22510 | #define __STDC_LIMIT_MACROS 1 | |
22511 | ||
22512 | /* Work if build is not clean. */ | |
22513 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H | |
22514 | ||
22515 | #include <limits.h> | |
22516 | #if HAVE_STDINT_H | |
22517 | #include <stdint.h> | |
22518 | #endif | |
22519 | ||
22520 | #if defined INT32_MAX && defined INTMAX_MAX | |
22521 | #define CONDITION (INT32_MAX < INTMAX_MAX) | |
88b48903 | 22522 | #else |
5df4cba6 | 22523 | #define CONDITION (sizeof (int) < sizeof (long long int)) |
88b48903 WN |
22524 | #endif |
22525 | int test[CONDITION ? 1 : -1]; | |
22526 | int | |
22527 | main () | |
22528 | { | |
22529 | ||
22530 | ; | |
22531 | return 0; | |
22532 | } | |
22533 | _ACEOF | |
22534 | if ac_fn_c_try_compile "$LINENO"; then : | |
22535 | gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes | |
22536 | else | |
22537 | gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no | |
22538 | fi | |
22539 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
22540 | fi | |
22541 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5 | |
22542 | $as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; } | |
22543 | if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then | |
22544 | INT32_MAX_LT_INTMAX_MAX=1; | |
22545 | else | |
22546 | INT32_MAX_LT_INTMAX_MAX=0; | |
22547 | fi | |
22548 | ||
22549 | ||
22550 | if test $APPLE_UNIVERSAL_BUILD = 0; then | |
22551 | ||
22552 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5 | |
22553 | $as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; } | |
d0ac1c44 | 22554 | if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then : |
88b48903 WN |
22555 | $as_echo_n "(cached) " >&6 |
22556 | else | |
22557 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22558 | /* end confdefs.h. */ | |
22559 | /* Work also in C++ mode. */ | |
22560 | #define __STDC_LIMIT_MACROS 1 | |
22561 | ||
22562 | /* Work if build is not clean. */ | |
22563 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H | |
22564 | ||
22565 | #include <limits.h> | |
22566 | #if HAVE_STDINT_H | |
22567 | #include <stdint.h> | |
22568 | #endif | |
22569 | ||
22570 | #if defined INT64_MAX | |
22571 | #define CONDITION (INT64_MAX == LONG_MAX) | |
88b48903 | 22572 | #else |
5df4cba6 | 22573 | #define CONDITION (sizeof (long long int) == sizeof (long int)) |
88b48903 WN |
22574 | #endif |
22575 | int test[CONDITION ? 1 : -1]; | |
22576 | int | |
22577 | main () | |
22578 | { | |
22579 | ||
22580 | ; | |
22581 | return 0; | |
22582 | } | |
22583 | _ACEOF | |
22584 | if ac_fn_c_try_compile "$LINENO"; then : | |
22585 | gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes | |
22586 | else | |
22587 | gl_cv_test_INT64_MAX_EQ_LONG_MAX=no | |
22588 | fi | |
22589 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
22590 | fi | |
22591 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5 | |
22592 | $as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; } | |
22593 | if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then | |
22594 | INT64_MAX_EQ_LONG_MAX=1; | |
22595 | else | |
22596 | INT64_MAX_EQ_LONG_MAX=0; | |
22597 | fi | |
22598 | ||
22599 | ||
22600 | else | |
22601 | INT64_MAX_EQ_LONG_MAX=-1 | |
22602 | fi | |
22603 | ||
22604 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5 | |
22605 | $as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; } | |
d0ac1c44 | 22606 | if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then : |
88b48903 WN |
22607 | $as_echo_n "(cached) " >&6 |
22608 | else | |
22609 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22610 | /* end confdefs.h. */ | |
22611 | /* Work also in C++ mode. */ | |
22612 | #define __STDC_LIMIT_MACROS 1 | |
22613 | ||
22614 | /* Work if build is not clean. */ | |
22615 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H | |
22616 | ||
22617 | #include <limits.h> | |
22618 | #if HAVE_STDINT_H | |
22619 | #include <stdint.h> | |
22620 | #endif | |
22621 | ||
22622 | #if defined UINT32_MAX && defined UINTMAX_MAX | |
22623 | #define CONDITION (UINT32_MAX < UINTMAX_MAX) | |
88b48903 | 22624 | #else |
5df4cba6 | 22625 | #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int)) |
88b48903 WN |
22626 | #endif |
22627 | int test[CONDITION ? 1 : -1]; | |
22628 | int | |
22629 | main () | |
22630 | { | |
22631 | ||
22632 | ; | |
22633 | return 0; | |
22634 | } | |
22635 | _ACEOF | |
22636 | if ac_fn_c_try_compile "$LINENO"; then : | |
22637 | gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes | |
22638 | else | |
22639 | gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no | |
22640 | fi | |
22641 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
22642 | fi | |
22643 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5 | |
22644 | $as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; } | |
22645 | if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then | |
22646 | UINT32_MAX_LT_UINTMAX_MAX=1; | |
22647 | else | |
22648 | UINT32_MAX_LT_UINTMAX_MAX=0; | |
22649 | fi | |
22650 | ||
22651 | ||
22652 | if test $APPLE_UNIVERSAL_BUILD = 0; then | |
22653 | ||
22654 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5 | |
22655 | $as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; } | |
d0ac1c44 | 22656 | if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then : |
88b48903 WN |
22657 | $as_echo_n "(cached) " >&6 |
22658 | else | |
22659 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22660 | /* end confdefs.h. */ | |
22661 | /* Work also in C++ mode. */ | |
22662 | #define __STDC_LIMIT_MACROS 1 | |
22663 | ||
22664 | /* Work if build is not clean. */ | |
22665 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H | |
22666 | ||
22667 | #include <limits.h> | |
22668 | #if HAVE_STDINT_H | |
22669 | #include <stdint.h> | |
22670 | #endif | |
22671 | ||
22672 | #if defined UINT64_MAX | |
22673 | #define CONDITION (UINT64_MAX == ULONG_MAX) | |
88b48903 | 22674 | #else |
5df4cba6 | 22675 | #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int)) |
88b48903 WN |
22676 | #endif |
22677 | int test[CONDITION ? 1 : -1]; | |
22678 | int | |
22679 | main () | |
22680 | { | |
22681 | ||
22682 | ; | |
22683 | return 0; | |
22684 | } | |
22685 | _ACEOF | |
22686 | if ac_fn_c_try_compile "$LINENO"; then : | |
22687 | gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes | |
22688 | else | |
22689 | gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no | |
22690 | fi | |
22691 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
22692 | fi | |
22693 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5 | |
22694 | $as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; } | |
22695 | if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then | |
22696 | UINT64_MAX_EQ_ULONG_MAX=1; | |
22697 | else | |
22698 | UINT64_MAX_EQ_ULONG_MAX=0; | |
22699 | fi | |
22700 | ||
22701 | ||
22702 | else | |
22703 | UINT64_MAX_EQ_ULONG_MAX=-1 | |
22704 | fi | |
22705 | ||
22706 | ||
22707 | ||
22708 | ||
22709 | ||
698be2d8 CB |
22710 | |
22711 | ||
22712 | ||
22713 | if test $ac_cv_func_isblank = no; then | |
22714 | HAVE_ISBLANK=0 | |
22715 | fi | |
22716 | ||
22717 | if test $HAVE_ISBLANK = 0; then | |
22718 | ||
22719 | ||
22720 | ||
22721 | ||
22722 | ||
22723 | ||
22724 | ||
22725 | ||
22726 | gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext" | |
22727 | ||
22728 | fi | |
22729 | ||
22730 | ||
22731 | cat >>confdefs.h <<_ACEOF | |
22732 | #define GNULIB_ISBLANK 1 | |
22733 | _ACEOF | |
22734 | ||
22735 | ||
22736 | ||
22737 | ||
22738 | ||
22739 | ||
22740 | ||
22741 | GNULIB_ISBLANK=1 | |
22742 | ||
22743 | ||
22744 | ||
22745 | ||
22746 | ||
22747 | ||
88b48903 WN |
22748 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5 |
22749 | $as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; } | |
d0ac1c44 | 22750 | if ${gl_cv_func_isnand_no_libm+:} false; then : |
88b48903 WN |
22751 | $as_echo_n "(cached) " >&6 |
22752 | else | |
22753 | ||
22754 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22755 | /* end confdefs.h. */ | |
22756 | #include <math.h> | |
9c9d63b1 | 22757 | #if (__GNUC__ >= 4) || (__clang_major__ >= 4) |
88b48903 WN |
22758 | # undef isnand |
22759 | # define isnand(x) __builtin_isnan ((double)(x)) | |
22760 | #else | |
22761 | # undef isnand | |
22762 | # define isnand(x) isnan ((double)(x)) | |
22763 | #endif | |
22764 | double x; | |
22765 | int | |
22766 | main () | |
22767 | { | |
22768 | return isnand (x); | |
22769 | ; | |
22770 | return 0; | |
22771 | } | |
22772 | _ACEOF | |
22773 | if ac_fn_c_try_link "$LINENO"; then : | |
22774 | gl_cv_func_isnand_no_libm=yes | |
22775 | else | |
22776 | gl_cv_func_isnand_no_libm=no | |
22777 | fi | |
22778 | rm -f core conftest.err conftest.$ac_objext \ | |
22779 | conftest$ac_exeext conftest.$ac_ext | |
22780 | ||
22781 | fi | |
22782 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5 | |
22783 | $as_echo "$gl_cv_func_isnand_no_libm" >&6; } | |
22784 | ||
22785 | gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm | |
22786 | if test $gl_cv_func_isnand_no_libm = yes; then | |
22787 | ||
22788 | $as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h | |
22789 | ||
22790 | fi | |
22791 | ||
22792 | if test $gl_func_isnand_no_libm != yes; then | |
22793 | ||
22794 | ||
22795 | ||
22796 | ||
22797 | ||
22798 | ||
22799 | ||
22800 | ||
22801 | gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext" | |
22802 | ||
22803 | ||
22804 | ||
22805 | ||
22806 | fi | |
22807 | ||
22808 | ||
22809 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5 | |
22810 | $as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; } | |
d0ac1c44 | 22811 | if ${gl_cv_func_isnanl_no_libm+:} false; then : |
88b48903 WN |
22812 | $as_echo_n "(cached) " >&6 |
22813 | else | |
22814 | ||
22815 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22816 | /* end confdefs.h. */ | |
22817 | #include <math.h> | |
9c9d63b1 | 22818 | #if (__GNUC__ >= 4) || (__clang_major__ >= 4) |
88b48903 | 22819 | # undef isnanl |
9c9d63b1 | 22820 | # define isnanl(x) __builtin_isnan ((long double)(x)) |
88b48903 WN |
22821 | #elif defined isnan |
22822 | # undef isnanl | |
22823 | # define isnanl(x) isnan ((long double)(x)) | |
22824 | #endif | |
22825 | long double x; | |
22826 | int | |
22827 | main () | |
22828 | { | |
22829 | return isnanl (x); | |
22830 | ; | |
22831 | return 0; | |
22832 | } | |
22833 | _ACEOF | |
22834 | if ac_fn_c_try_link "$LINENO"; then : | |
22835 | gl_cv_func_isnanl_no_libm=yes | |
22836 | else | |
22837 | gl_cv_func_isnanl_no_libm=no | |
22838 | fi | |
22839 | rm -f core conftest.err conftest.$ac_objext \ | |
22840 | conftest$ac_exeext conftest.$ac_ext | |
22841 | ||
22842 | fi | |
22843 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5 | |
22844 | $as_echo "$gl_cv_func_isnanl_no_libm" >&6; } | |
22845 | ||
22846 | gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm | |
22847 | if test $gl_func_isnanl_no_libm = yes; then | |
22848 | ||
22849 | ||
22850 | ||
22851 | ||
22852 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5 | |
22853 | $as_echo_n "checking whether isnanl works... " >&6; } | |
d0ac1c44 | 22854 | if ${gl_cv_func_isnanl_works+:} false; then : |
88b48903 WN |
22855 | $as_echo_n "(cached) " >&6 |
22856 | else | |
22857 | ||
22858 | if test "$cross_compiling" = yes; then : | |
c0c3707f CB |
22859 | case "$host_os" in |
22860 | mingw*) # Guess yes on mingw, no on MSVC. | |
22861 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22862 | /* end confdefs.h. */ | |
22863 | ||
22864 | #ifdef __MINGW32__ | |
22865 | Known | |
22866 | #endif | |
22867 | ||
22868 | _ACEOF | |
22869 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
22870 | $EGREP "Known" >/dev/null 2>&1; then : | |
4a626d0a | 22871 | gl_cv_func_isnanl_works="guessing yes" |
c0c3707f CB |
22872 | else |
22873 | gl_cv_func_isnanl_works="guessing no" | |
22874 | fi | |
22875 | rm -f conftest* | |
22876 | ||
22877 | ;; | |
22878 | *) gl_cv_func_isnanl_works="guessing yes" ;; | |
22879 | esac | |
22880 | ||
88b48903 WN |
22881 | else |
22882 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22883 | /* end confdefs.h. */ | |
22884 | ||
22885 | #include <float.h> | |
22886 | #include <limits.h> | |
22887 | #include <math.h> | |
9c9d63b1 | 22888 | #if (__GNUC__ >= 4) || (__clang_major__ >= 4) |
88b48903 | 22889 | # undef isnanl |
9c9d63b1 | 22890 | # define isnanl(x) __builtin_isnan ((long double)(x)) |
88b48903 WN |
22891 | #elif defined isnan |
22892 | # undef isnanl | |
22893 | # define isnanl(x) isnan ((long double)(x)) | |
22894 | #endif | |
22895 | #define NWORDS \ | |
22896 | ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) | |
22897 | typedef union { unsigned int word[NWORDS]; long double value; } | |
22898 | memory_long_double; | |
22899 | /* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the | |
22900 | runtime type conversion. */ | |
22901 | #ifdef __sgi | |
22902 | static long double NaNl () | |
22903 | { | |
22904 | double zero = 0.0; | |
22905 | return zero / zero; | |
22906 | } | |
22907 | #else | |
22908 | # define NaNl() (0.0L / 0.0L) | |
22909 | #endif | |
22910 | int main () | |
22911 | { | |
22912 | int result = 0; | |
22913 | ||
22914 | if (!isnanl (NaNl ())) | |
22915 | result |= 1; | |
22916 | ||
22917 | { | |
22918 | memory_long_double m; | |
22919 | unsigned int i; | |
22920 | ||
22921 | /* The isnanl function should be immune against changes in the sign bit and | |
22922 | in the mantissa bits. The xor operation twiddles a bit that can only be | |
22923 | a sign bit or a mantissa bit (since the exponent never extends to | |
22924 | bit 31). */ | |
22925 | m.value = NaNl (); | |
22926 | m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); | |
22927 | for (i = 0; i < NWORDS; i++) | |
22928 | m.word[i] |= 1; | |
22929 | if (!isnanl (m.value)) | |
22930 | result |= 1; | |
22931 | } | |
22932 | ||
22933 | #if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE | |
22934 | /* Representation of an 80-bit 'long double' as an initializer for a sequence | |
22935 | of 'unsigned int' words. */ | |
22936 | # ifdef WORDS_BIGENDIAN | |
22937 | # define LDBL80_WORDS(exponent,manthi,mantlo) \ | |
22938 | { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ | |
4a626d0a | 22939 | ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ |
88b48903 WN |
22940 | (unsigned int) (mantlo) << 16 \ |
22941 | } | |
22942 | # else | |
22943 | # define LDBL80_WORDS(exponent,manthi,mantlo) \ | |
22944 | { mantlo, manthi, exponent } | |
22945 | # endif | |
22946 | { /* Quiet NaN. */ | |
22947 | static memory_long_double x = | |
22948 | { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; | |
22949 | if (!isnanl (x.value)) | |
22950 | result |= 2; | |
22951 | } | |
22952 | { | |
22953 | /* Signalling NaN. */ | |
22954 | static memory_long_double x = | |
22955 | { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; | |
22956 | if (!isnanl (x.value)) | |
22957 | result |= 2; | |
22958 | } | |
4a626d0a | 22959 | /* isnanl should return something even for noncanonical values. */ |
88b48903 WN |
22960 | { /* Pseudo-NaN. */ |
22961 | static memory_long_double x = | |
22962 | { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; | |
4a626d0a | 22963 | if (isnanl (x.value) && !isnanl (x.value)) |
88b48903 WN |
22964 | result |= 4; |
22965 | } | |
22966 | { /* Pseudo-Infinity. */ | |
22967 | static memory_long_double x = | |
22968 | { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; | |
4a626d0a | 22969 | if (isnanl (x.value) && !isnanl (x.value)) |
88b48903 WN |
22970 | result |= 8; |
22971 | } | |
22972 | { /* Pseudo-Zero. */ | |
22973 | static memory_long_double x = | |
22974 | { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; | |
4a626d0a | 22975 | if (isnanl (x.value) && !isnanl (x.value)) |
88b48903 WN |
22976 | result |= 16; |
22977 | } | |
22978 | { /* Unnormalized number. */ | |
22979 | static memory_long_double x = | |
22980 | { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; | |
4a626d0a | 22981 | if (isnanl (x.value) && !isnanl (x.value)) |
88b48903 WN |
22982 | result |= 32; |
22983 | } | |
22984 | { /* Pseudo-Denormal. */ | |
22985 | static memory_long_double x = | |
22986 | { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; | |
4a626d0a | 22987 | if (isnanl (x.value) && !isnanl (x.value)) |
88b48903 WN |
22988 | result |= 64; |
22989 | } | |
22990 | #endif | |
22991 | ||
22992 | return result; | |
22993 | } | |
22994 | _ACEOF | |
22995 | if ac_fn_c_try_run "$LINENO"; then : | |
22996 | gl_cv_func_isnanl_works=yes | |
22997 | else | |
22998 | gl_cv_func_isnanl_works=no | |
22999 | fi | |
23000 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23001 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23002 | fi | |
23003 | ||
23004 | ||
23005 | fi | |
23006 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5 | |
23007 | $as_echo "$gl_cv_func_isnanl_works" >&6; } | |
23008 | ||
23009 | case "$gl_cv_func_isnanl_works" in | |
23010 | *yes) ;; | |
23011 | *) gl_func_isnanl_no_libm=no ;; | |
23012 | esac | |
23013 | fi | |
23014 | if test $gl_func_isnanl_no_libm = yes; then | |
23015 | ||
23016 | $as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h | |
23017 | ||
23018 | fi | |
23019 | ||
23020 | if test $gl_func_isnanl_no_libm != yes; then | |
23021 | ||
23022 | ||
23023 | ||
23024 | ||
23025 | ||
23026 | ||
23027 | ||
23028 | ||
23029 | gl_LIBOBJS="$gl_LIBOBJS isnanl.$ac_objext" | |
23030 | ||
23031 | ||
23032 | ||
23033 | ||
c0c3707f | 23034 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5 |
88b48903 | 23035 | $as_echo_n "checking where to find the exponent in a 'long double'... " >&6; } |
d0ac1c44 | 23036 | if ${gl_cv_cc_long_double_expbit0+:} false; then : |
88b48903 WN |
23037 | $as_echo_n "(cached) " >&6 |
23038 | else | |
23039 | ||
23040 | if test "$cross_compiling" = yes; then : | |
23041 | ||
23042 | gl_cv_cc_long_double_expbit0="unknown" | |
c0c3707f CB |
23043 | case "$host_os" in |
23044 | mingw*) # On native Windows (little-endian), we know the result | |
23045 | # in two cases: mingw, MSVC. | |
23046 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23047 | /* end confdefs.h. */ | |
23048 | ||
23049 | #ifdef __MINGW32__ | |
23050 | Known | |
23051 | #endif | |
23052 | ||
23053 | _ACEOF | |
23054 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
23055 | $EGREP "Known" >/dev/null 2>&1; then : | |
23056 | gl_cv_cc_long_double_expbit0="word 2 bit 0" | |
23057 | fi | |
23058 | rm -f conftest* | |
23059 | ||
23060 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23061 | /* end confdefs.h. */ | |
23062 | ||
23063 | #ifdef _MSC_VER | |
23064 | Known | |
23065 | #endif | |
23066 | ||
23067 | _ACEOF | |
23068 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
23069 | $EGREP "Known" >/dev/null 2>&1; then : | |
23070 | gl_cv_cc_long_double_expbit0="word 1 bit 20" | |
23071 | fi | |
23072 | rm -f conftest* | |
23073 | ||
23074 | ;; | |
23075 | esac | |
88b48903 WN |
23076 | |
23077 | else | |
23078 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23079 | /* end confdefs.h. */ | |
23080 | ||
23081 | #include <float.h> | |
23082 | #include <stddef.h> | |
23083 | #include <stdio.h> | |
23084 | #include <string.h> | |
23085 | #define NWORDS \ | |
23086 | ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) | |
23087 | typedef union { long double value; unsigned int word[NWORDS]; } | |
23088 | memory_long_double; | |
23089 | static unsigned int ored_words[NWORDS]; | |
23090 | static unsigned int anded_words[NWORDS]; | |
698be2d8 | 23091 | static void add_to_ored_words (long double *x) |
88b48903 WN |
23092 | { |
23093 | memory_long_double m; | |
23094 | size_t i; | |
23095 | /* Clear it first, in case | |
23096 | sizeof (long double) < sizeof (memory_long_double). */ | |
23097 | memset (&m, 0, sizeof (memory_long_double)); | |
698be2d8 | 23098 | m.value = *x; |
88b48903 WN |
23099 | for (i = 0; i < NWORDS; i++) |
23100 | { | |
23101 | ored_words[i] |= m.word[i]; | |
23102 | anded_words[i] &= m.word[i]; | |
23103 | } | |
23104 | } | |
23105 | int main () | |
23106 | { | |
698be2d8 | 23107 | static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L }; |
88b48903 WN |
23108 | size_t j; |
23109 | FILE *fp = fopen ("conftest.out", "w"); | |
23110 | if (fp == NULL) | |
23111 | return 1; | |
23112 | for (j = 0; j < NWORDS; j++) | |
23113 | anded_words[j] = ~ (unsigned int) 0; | |
698be2d8 CB |
23114 | for (j = 0; j < 5; j++) |
23115 | add_to_ored_words (&samples[j]); | |
88b48903 WN |
23116 | /* Remove bits that are common (e.g. if representation of the first mantissa |
23117 | bit is explicit). */ | |
23118 | for (j = 0; j < NWORDS; j++) | |
23119 | ored_words[j] &= ~anded_words[j]; | |
23120 | /* Now find the nonzero word. */ | |
23121 | for (j = 0; j < NWORDS; j++) | |
23122 | if (ored_words[j] != 0) | |
23123 | break; | |
23124 | if (j < NWORDS) | |
23125 | { | |
23126 | size_t i; | |
23127 | for (i = j + 1; i < NWORDS; i++) | |
23128 | if (ored_words[i] != 0) | |
23129 | { | |
23130 | fprintf (fp, "unknown"); | |
23131 | return (fclose (fp) != 0); | |
23132 | } | |
23133 | for (i = 0; ; i++) | |
23134 | if ((ored_words[j] >> i) & 1) | |
23135 | { | |
23136 | fprintf (fp, "word %d bit %d", (int) j, (int) i); | |
23137 | return (fclose (fp) != 0); | |
23138 | } | |
23139 | } | |
23140 | fprintf (fp, "unknown"); | |
23141 | return (fclose (fp) != 0); | |
23142 | } | |
23143 | ||
23144 | _ACEOF | |
23145 | if ac_fn_c_try_run "$LINENO"; then : | |
23146 | gl_cv_cc_long_double_expbit0=`cat conftest.out` | |
23147 | else | |
23148 | gl_cv_cc_long_double_expbit0="unknown" | |
23149 | fi | |
23150 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23151 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23152 | fi | |
23153 | ||
23154 | rm -f conftest.out | |
23155 | ||
23156 | fi | |
23157 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5 | |
23158 | $as_echo "$gl_cv_cc_long_double_expbit0" >&6; } | |
23159 | case "$gl_cv_cc_long_double_expbit0" in | |
23160 | word*bit*) | |
23161 | word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` | |
23162 | bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'` | |
23163 | ||
23164 | cat >>confdefs.h <<_ACEOF | |
23165 | #define LDBL_EXPBIT0_WORD $word | |
23166 | _ACEOF | |
23167 | ||
23168 | ||
23169 | cat >>confdefs.h <<_ACEOF | |
23170 | #define LDBL_EXPBIT0_BIT $bit | |
23171 | _ACEOF | |
23172 | ||
23173 | ;; | |
23174 | esac | |
23175 | ||
23176 | ||
23177 | ||
23178 | fi | |
23179 | ||
23180 | ||
5df4cba6 SM |
23181 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the __inline keyword" >&5 |
23182 | $as_echo_n "checking whether the compiler supports the __inline keyword... " >&6; } | |
23183 | if ${gl_cv_c___inline+:} false; then : | |
23184 | $as_echo_n "(cached) " >&6 | |
23185 | else | |
23186 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23187 | /* end confdefs.h. */ | |
23188 | typedef int foo_t; | |
23189 | static __inline foo_t foo (void) { return 0; } | |
23190 | int | |
23191 | main () | |
23192 | { | |
23193 | return foo (); | |
23194 | ; | |
23195 | return 0; | |
23196 | } | |
23197 | _ACEOF | |
23198 | if ac_fn_c_try_compile "$LINENO"; then : | |
23199 | gl_cv_c___inline=yes | |
23200 | else | |
23201 | gl_cv_c___inline=no | |
23202 | fi | |
23203 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
23204 | fi | |
23205 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c___inline" >&5 | |
23206 | $as_echo "$gl_cv_c___inline" >&6; } | |
23207 | if test $gl_cv_c___inline = yes; then | |
23208 | ||
23209 | $as_echo "#define HAVE___INLINE 1" >>confdefs.h | |
23210 | ||
23211 | fi | |
23212 | ||
23213 | ||
23214 | ||
23215 | ||
23216 | ||
23217 | LOCALCHARSET_TESTS_ENVIRONMENT= | |
23218 | ||
23219 | ||
23220 | ||
23221 | ||
23222 | ||
23223 | ||
23224 | ||
23225 | ||
23226 | ||
23227 | ||
23228 | ||
23229 | case "$host_os" in | |
23230 | solaris*) | |
23231 | ||
23232 | $as_echo "#define _LCONV_C99 1" >>confdefs.h | |
23233 | ||
23234 | ;; | |
23235 | esac | |
23236 | ||
23237 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5 | |
23238 | $as_echo_n "checking whether locale.h conforms to POSIX:2001... " >&6; } | |
23239 | if ${gl_cv_header_locale_h_posix2001+:} false; then : | |
23240 | $as_echo_n "(cached) " >&6 | |
23241 | else | |
23242 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23243 | /* end confdefs.h. */ | |
23244 | #include <locale.h> | |
23245 | int x = LC_MESSAGES; | |
23246 | int y = sizeof (((struct lconv *) 0)->decimal_point); | |
23247 | int | |
23248 | main () | |
23249 | { | |
23250 | ||
23251 | ; | |
23252 | return 0; | |
23253 | } | |
23254 | _ACEOF | |
23255 | if ac_fn_c_try_compile "$LINENO"; then : | |
23256 | gl_cv_header_locale_h_posix2001=yes | |
23257 | else | |
23258 | gl_cv_header_locale_h_posix2001=no | |
23259 | fi | |
23260 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
23261 | fi | |
23262 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5 | |
23263 | $as_echo "$gl_cv_header_locale_h_posix2001" >&6; } | |
23264 | ||
23265 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5 | |
23266 | $as_echo_n "checking whether struct lconv is properly defined... " >&6; } | |
23267 | if ${gl_cv_sys_struct_lconv_ok+:} false; then : | |
c0c3707f CB |
23268 | $as_echo_n "(cached) " >&6 |
23269 | else | |
23270 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23271 | /* end confdefs.h. */ | |
5df4cba6 SM |
23272 | #include <locale.h> |
23273 | struct lconv l; | |
23274 | int x = sizeof (l.decimal_point); | |
23275 | int y = sizeof (l.int_p_cs_precedes); | |
c0c3707f CB |
23276 | int |
23277 | main () | |
23278 | { | |
5df4cba6 | 23279 | |
c0c3707f CB |
23280 | ; |
23281 | return 0; | |
23282 | } | |
23283 | _ACEOF | |
23284 | if ac_fn_c_try_compile "$LINENO"; then : | |
5df4cba6 | 23285 | gl_cv_sys_struct_lconv_ok=yes |
c0c3707f | 23286 | else |
5df4cba6 | 23287 | gl_cv_sys_struct_lconv_ok=no |
c0c3707f CB |
23288 | fi |
23289 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5df4cba6 | 23290 | |
c0c3707f | 23291 | fi |
5df4cba6 SM |
23292 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5 |
23293 | $as_echo "$gl_cv_sys_struct_lconv_ok" >&6; } | |
23294 | if test $gl_cv_sys_struct_lconv_ok = no; then | |
23295 | case "$host_os" in | |
23296 | mingw*) | |
23297 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23298 | /* end confdefs.h. */ | |
c0c3707f | 23299 | |
5df4cba6 SM |
23300 | #ifdef _MSC_VER |
23301 | Special | |
23302 | #endif | |
23303 | ||
23304 | _ACEOF | |
23305 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
23306 | $EGREP "Special" >/dev/null 2>&1; then : | |
23307 | ||
23308 | else | |
23309 | REPLACE_STRUCT_LCONV=1 | |
23310 | fi | |
23311 | rm -f conftest* | |
c0c3707f | 23312 | |
5df4cba6 SM |
23313 | ;; |
23314 | *) REPLACE_STRUCT_LCONV=1 ;; | |
23315 | esac | |
c0c3707f | 23316 | fi |
88b48903 WN |
23317 | |
23318 | ||
88b48903 WN |
23319 | |
23320 | ||
472fa5ee | 23321 | |
5df4cba6 SM |
23322 | |
23323 | ||
23324 | ||
23325 | ||
23326 | if test $gl_cv_have_include_next = yes; then | |
23327 | gl_cv_next_locale_h='<'locale.h'>' | |
23328 | else | |
23329 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5 | |
23330 | $as_echo_n "checking absolute name of <locale.h>... " >&6; } | |
23331 | if ${gl_cv_next_locale_h+:} false; then : | |
23332 | $as_echo_n "(cached) " >&6 | |
23333 | else | |
23334 | ||
23335 | ||
23336 | ||
23337 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23338 | /* end confdefs.h. */ | |
23339 | #include <locale.h> | |
23340 | _ACEOF | |
23341 | case "$host_os" in | |
23342 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
23343 | *) gl_absname_cpp="$ac_cpp" ;; | |
23344 | esac | |
23345 | ||
23346 | case "$host_os" in | |
23347 | mingw*) | |
23348 | gl_dirsep_regex='[/\\]' | |
23349 | ;; | |
23350 | *) | |
23351 | gl_dirsep_regex='\/' | |
23352 | ;; | |
23353 | esac | |
23354 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
23355 | gl_header_literal_regex=`echo 'locale.h' \ | |
23356 | | sed -e "$gl_make_literal_regex_sed"` | |
23357 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
23358 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
23359 | s|^/[^/]|//&| | |
23360 | p | |
23361 | q | |
23362 | }' | |
23363 | ||
23364 | gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
23365 | sed -n "$gl_absolute_header_sed"` | |
23366 | ||
23367 | gl_header=$gl_cv_absolute_locale_h | |
23368 | gl_cv_next_locale_h='"'$gl_header'"' | |
23369 | ||
23370 | ||
23371 | fi | |
23372 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5 | |
23373 | $as_echo "$gl_cv_next_locale_h" >&6; } | |
23374 | fi | |
23375 | NEXT_LOCALE_H=$gl_cv_next_locale_h | |
23376 | ||
23377 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
23378 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
23379 | gl_next_as_first_directive='<'locale.h'>' | |
23380 | else | |
23381 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
23382 | gl_next_as_first_directive=$gl_cv_next_locale_h | |
23383 | fi | |
23384 | NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive | |
23385 | ||
23386 | ||
23387 | ||
23388 | ||
23389 | ||
23390 | ||
23391 | ||
23392 | ||
472fa5ee SM |
23393 | |
23394 | ||
23395 | ||
5abebf3c CB |
23396 | if test "$gl_threads_api" = posix; then |
23397 | # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the | |
23398 | # pthread_rwlock_* functions. | |
c0c3707f | 23399 | has_rwlock=false |
5abebf3c CB |
23400 | ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h> |
23401 | " | |
23402 | if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then : | |
c0c3707f | 23403 | has_rwlock=true |
5abebf3c CB |
23404 | |
23405 | $as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h | |
23406 | ||
23407 | fi | |
23408 | ||
c0c3707f CB |
23409 | if $has_rwlock; then |
23410 | ||
23411 | ||
23412 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5 | |
23413 | $as_echo_n "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; } | |
23414 | if ${gl_cv_pthread_rwlock_rdlock_prefer_writer+:} false; then : | |
23415 | $as_echo_n "(cached) " >&6 | |
23416 | else | |
23417 | save_LIBS="$LIBS" | |
23418 | LIBS="$LIBS $LIBMULTITHREAD" | |
23419 | if test "$cross_compiling" = yes; then : | |
23420 | case "$host_os" in | |
23421 | # Guess no on glibc systems. | |
23422 | *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; | |
23423 | # Guess no on musl systems. | |
23424 | *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; | |
23425 | # Guess no on bionic systems. | |
23426 | *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; | |
23427 | # Guess yes on native Windows with the mingw-w64 winpthreads library. | |
23428 | # Guess no on native Windows with the gnulib windows-rwlock module. | |
23429 | mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then | |
23430 | gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes" | |
23431 | else | |
23432 | gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" | |
23433 | fi | |
23434 | ;; | |
23435 | # If we don't know, obey --enable-cross-guesses. | |
23436 | *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;; | |
23437 | esac | |
23438 | ||
23439 | else | |
23440 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23441 | /* end confdefs.h. */ | |
23442 | ||
23443 | #include <errno.h> | |
23444 | #include <pthread.h> | |
23445 | #include <stdlib.h> | |
23446 | #include <unistd.h> | |
23447 | ||
23448 | #define SUCCEED() exit (0) | |
23449 | #define FAILURE() exit (1) | |
23450 | #define UNEXPECTED(n) (exit (10 + (n))) | |
23451 | ||
23452 | /* The main thread creates the waiting writer and the requesting reader threads | |
23453 | in the default way; this guarantees that they have the same priority. | |
23454 | We can reuse the main thread as first reader thread. */ | |
23455 | ||
23456 | static pthread_rwlock_t lock; | |
23457 | static pthread_t reader1; | |
23458 | static pthread_t writer; | |
23459 | static pthread_t reader2; | |
23460 | static pthread_t timer; | |
23461 | /* Used to pass control from writer to reader2 and from reader2 to timer, | |
23462 | as in a relay race. | |
23463 | Passing control from one running thread to another running thread | |
23464 | is most likely faster than to create the second thread. */ | |
23465 | static pthread_mutex_t baton; | |
23466 | ||
23467 | static void * | |
23468 | timer_func (void *ignored) | |
23469 | { | |
23470 | /* Step 13 (can be before or after step 12): | |
23471 | The timer thread takes the baton, then waits a moment to make sure | |
23472 | it can tell whether the second reader thread is blocked at step 12. */ | |
23473 | if (pthread_mutex_lock (&baton)) | |
23474 | UNEXPECTED (13); | |
23475 | usleep (100000); | |
23476 | /* By the time we get here, it's clear that the second reader thread is | |
23477 | blocked at step 12. This is the desired behaviour. */ | |
23478 | SUCCEED (); | |
23479 | } | |
23480 | ||
23481 | static void * | |
23482 | reader2_func (void *ignored) | |
23483 | { | |
23484 | int err; | |
23485 | ||
23486 | /* Step 8 (can be before or after step 7): | |
23487 | The second reader thread takes the baton, then waits a moment to make sure | |
23488 | the writer thread has reached step 7. */ | |
23489 | if (pthread_mutex_lock (&baton)) | |
23490 | UNEXPECTED (8); | |
23491 | usleep (100000); | |
23492 | /* Step 9: The second reader thread requests the lock. */ | |
23493 | err = pthread_rwlock_tryrdlock (&lock); | |
23494 | if (err == 0) | |
23495 | FAILURE (); | |
23496 | else if (err != EBUSY) | |
23497 | UNEXPECTED (9); | |
23498 | /* Step 10: Launch a timer, to test whether the next call blocks. */ | |
23499 | if (pthread_create (&timer, NULL, timer_func, NULL)) | |
23500 | UNEXPECTED (10); | |
23501 | /* Step 11: Release the baton. */ | |
23502 | if (pthread_mutex_unlock (&baton)) | |
23503 | UNEXPECTED (11); | |
23504 | /* Step 12: The second reader thread requests the lock. */ | |
23505 | err = pthread_rwlock_rdlock (&lock); | |
23506 | if (err == 0) | |
23507 | FAILURE (); | |
23508 | else | |
23509 | UNEXPECTED (12); | |
23510 | } | |
23511 | ||
23512 | static void * | |
23513 | writer_func (void *ignored) | |
23514 | { | |
23515 | /* Step 4: Take the baton, so that the second reader thread does not go ahead | |
23516 | too early. */ | |
23517 | if (pthread_mutex_lock (&baton)) | |
23518 | UNEXPECTED (4); | |
23519 | /* Step 5: Create the second reader thread. */ | |
23520 | if (pthread_create (&reader2, NULL, reader2_func, NULL)) | |
23521 | UNEXPECTED (5); | |
23522 | /* Step 6: Release the baton. */ | |
23523 | if (pthread_mutex_unlock (&baton)) | |
23524 | UNEXPECTED (6); | |
23525 | /* Step 7: The writer thread requests the lock. */ | |
23526 | if (pthread_rwlock_wrlock (&lock)) | |
23527 | UNEXPECTED (7); | |
23528 | return NULL; | |
23529 | } | |
23530 | ||
23531 | int | |
23532 | main () | |
23533 | { | |
23534 | reader1 = pthread_self (); | |
23535 | ||
23536 | /* Step 1: The main thread initializes the lock and the baton. */ | |
23537 | if (pthread_rwlock_init (&lock, NULL)) | |
23538 | UNEXPECTED (1); | |
23539 | if (pthread_mutex_init (&baton, NULL)) | |
23540 | UNEXPECTED (1); | |
23541 | /* Step 2: The main thread acquires the lock as a reader. */ | |
23542 | if (pthread_rwlock_rdlock (&lock)) | |
23543 | UNEXPECTED (2); | |
23544 | /* Step 3: Create the writer thread. */ | |
23545 | if (pthread_create (&writer, NULL, writer_func, NULL)) | |
23546 | UNEXPECTED (3); | |
23547 | /* Job done. Go to sleep. */ | |
23548 | for (;;) | |
23549 | { | |
23550 | sleep (1); | |
23551 | } | |
23552 | } | |
23553 | ||
23554 | _ACEOF | |
23555 | if ac_fn_c_try_run "$LINENO"; then : | |
23556 | gl_cv_pthread_rwlock_rdlock_prefer_writer=yes | |
23557 | else | |
23558 | gl_cv_pthread_rwlock_rdlock_prefer_writer=no | |
23559 | fi | |
23560 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23561 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23562 | fi | |
23563 | ||
23564 | LIBS="$save_LIBS" | |
23565 | ||
23566 | fi | |
23567 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5 | |
23568 | $as_echo "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; } | |
23569 | case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in | |
23570 | *yes) | |
23571 | ||
23572 | $as_echo "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h | |
23573 | ||
23574 | ;; | |
23575 | esac | |
23576 | ||
23577 | fi | |
5abebf3c CB |
23578 | # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. |
23579 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23580 | /* end confdefs.h. */ | |
23581 | ||
23582 | #include <pthread.h> | |
23583 | int | |
23584 | main () | |
23585 | { | |
23586 | ||
23587 | #if __FreeBSD__ == 4 | |
23588 | error "No, in FreeBSD 4.0 recursive mutexes actually don't work." | |
23589 | #elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \ | |
23590 | && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070) | |
23591 | error "No, in Mac OS X < 10.7 recursive mutexes actually don't work." | |
23592 | #else | |
23593 | int x = (int)PTHREAD_MUTEX_RECURSIVE; | |
23594 | return !x; | |
23595 | #endif | |
23596 | ||
23597 | ; | |
23598 | return 0; | |
23599 | } | |
23600 | _ACEOF | |
23601 | if ac_fn_c_try_compile "$LINENO"; then : | |
23602 | ||
23603 | $as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h | |
23604 | ||
23605 | fi | |
23606 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
23607 | fi | |
23608 | : | |
23609 | ||
23610 | ||
23611 | ||
23612 | cat >>confdefs.h <<_ACEOF | |
23613 | #define GNULIB_LOCK 1 | |
23614 | _ACEOF | |
23615 | ||
23616 | ||
23617 | ||
23618 | ||
88b48903 | 23619 | |
472fa5ee | 23620 | |
f45c62c4 YQ |
23621 | if test $ac_cv_func_lstat = yes; then |
23622 | ||
c0c3707f CB |
23623 | case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in |
23624 | solaris* | *no) | |
f45c62c4 YQ |
23625 | REPLACE_LSTAT=1 |
23626 | ;; | |
23627 | esac | |
23628 | else | |
23629 | HAVE_LSTAT=0 | |
23630 | fi | |
23631 | ||
23632 | if test $REPLACE_LSTAT = 1; then | |
23633 | ||
23634 | ||
23635 | ||
23636 | ||
23637 | ||
23638 | ||
23639 | ||
23640 | ||
23641 | gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext" | |
23642 | ||
23643 | : | |
23644 | fi | |
23645 | ||
23646 | ||
23647 | ||
23648 | ||
23649 | ||
23650 | GNULIB_LSTAT=1 | |
23651 | ||
23652 | ||
23653 | ||
23654 | ||
23655 | ||
23656 | $as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h | |
23657 | ||
23658 | ||
23659 | ||
23660 | ||
23661 | ||
23662 | ||
6a29c58e YQ |
23663 | if test $gl_cv_func_malloc_posix = yes; then |
23664 | ||
23665 | $as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h | |
23666 | ||
23667 | else | |
23668 | REPLACE_MALLOC=1 | |
23669 | fi | |
23670 | ||
23671 | if test $REPLACE_MALLOC = 1; then | |
23672 | ||
23673 | ||
23674 | ||
23675 | ||
23676 | ||
23677 | ||
23678 | ||
23679 | ||
23680 | gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" | |
23681 | ||
23682 | fi | |
23683 | ||
23684 | ||
23685 | ||
23686 | ||
23687 | ||
23688 | GNULIB_MALLOC_POSIX=1 | |
23689 | ||
23690 | ||
23691 | ||
23692 | ||
23693 | ||
23694 | $as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h | |
23695 | ||
23696 | ||
23697 | ||
23698 | ||
23699 | ||
23700 | ||
88b48903 WN |
23701 | |
23702 | ||
23703 | ||
23704 | ||
23705 | ||
88b48903 | 23706 | |
c971b7fa | 23707 | |
c971b7fa | 23708 | |
98399780 YQ |
23709 | |
23710 | ||
23711 | ||
88b48903 WN |
23712 | if test $gl_cv_have_include_next = yes; then |
23713 | gl_cv_next_math_h='<'math.h'>' | |
23714 | else | |
23715 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5 | |
23716 | $as_echo_n "checking absolute name of <math.h>... " >&6; } | |
d0ac1c44 | 23717 | if ${gl_cv_next_math_h+:} false; then : |
88b48903 WN |
23718 | $as_echo_n "(cached) " >&6 |
23719 | else | |
c971b7fa | 23720 | |
88b48903 | 23721 | if test $ac_cv_header_math_h = yes; then |
c971b7fa PA |
23722 | |
23723 | ||
4a626d0a PA |
23724 | |
23725 | ||
23726 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 | 23727 | /* end confdefs.h. */ |
88b48903 | 23728 | #include <math.h> |
8690e634 | 23729 | _ACEOF |
4a626d0a PA |
23730 | case "$host_os" in |
23731 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
23732 | *) gl_absname_cpp="$ac_cpp" ;; | |
23733 | esac | |
23734 | ||
23735 | case "$host_os" in | |
23736 | mingw*) | |
23737 | gl_dirsep_regex='[/\\]' | |
23738 | ;; | |
23739 | *) | |
23740 | gl_dirsep_regex='\/' | |
23741 | ;; | |
23742 | esac | |
23743 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
23744 | gl_header_literal_regex=`echo 'math.h' \ | |
23745 | | sed -e "$gl_make_literal_regex_sed"` | |
23746 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
23747 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
23748 | s|^/[^/]|//&| | |
23749 | p | |
23750 | q | |
23751 | }' | |
23752 | ||
23753 | gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
23754 | sed -n "$gl_absolute_header_sed"` | |
23755 | ||
23756 | gl_header=$gl_cv_absolute_math_h | |
23757 | gl_cv_next_math_h='"'$gl_header'"' | |
88b48903 WN |
23758 | else |
23759 | gl_cv_next_math_h='<'math.h'>' | |
23760 | fi | |
8690e634 | 23761 | |
c971b7fa | 23762 | |
88b48903 WN |
23763 | fi |
23764 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5 | |
23765 | $as_echo "$gl_cv_next_math_h" >&6; } | |
23766 | fi | |
23767 | NEXT_MATH_H=$gl_cv_next_math_h | |
c971b7fa | 23768 | |
88b48903 WN |
23769 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
23770 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
23771 | gl_next_as_first_directive='<'math.h'>' | |
23772 | else | |
23773 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
23774 | gl_next_as_first_directive=$gl_cv_next_math_h | |
23775 | fi | |
23776 | NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive | |
8690e634 | 23777 | |
c971b7fa | 23778 | |
c971b7fa PA |
23779 | |
23780 | ||
c971b7fa | 23781 | |
88b48903 WN |
23782 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5 |
23783 | $as_echo_n "checking whether NAN macro works... " >&6; } | |
d0ac1c44 | 23784 | if ${gl_cv_header_math_nan_works+:} false; then : |
c971b7fa PA |
23785 | $as_echo_n "(cached) " >&6 |
23786 | else | |
8690e634 JK |
23787 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
23788 | /* end confdefs.h. */ | |
88b48903 | 23789 | #include <math.h> |
c971b7fa PA |
23790 | int |
23791 | main () | |
23792 | { | |
88b48903 WN |
23793 | /* Solaris 10 has a broken definition of NAN. Other platforms |
23794 | fail to provide NAN, or provide it only in C99 mode; this | |
23795 | test only needs to fail when NAN is provided but wrong. */ | |
23796 | float f = 1.0f; | |
23797 | #ifdef NAN | |
23798 | f = NAN; | |
23799 | #endif | |
23800 | return f == 0; | |
c971b7fa PA |
23801 | ; |
23802 | return 0; | |
23803 | } | |
23804 | _ACEOF | |
23805 | if ac_fn_c_try_compile "$LINENO"; then : | |
88b48903 | 23806 | gl_cv_header_math_nan_works=yes |
8690e634 | 23807 | else |
88b48903 | 23808 | gl_cv_header_math_nan_works=no |
c971b7fa PA |
23809 | fi |
23810 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c971b7fa | 23811 | fi |
88b48903 WN |
23812 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5 |
23813 | $as_echo "$gl_cv_header_math_nan_works" >&6; } | |
23814 | if test $gl_cv_header_math_nan_works = no; then | |
23815 | REPLACE_NAN=1 | |
c971b7fa | 23816 | fi |
88b48903 WN |
23817 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5 |
23818 | $as_echo_n "checking whether HUGE_VAL works... " >&6; } | |
d0ac1c44 | 23819 | if ${gl_cv_header_math_huge_val_works+:} false; then : |
c971b7fa PA |
23820 | $as_echo_n "(cached) " >&6 |
23821 | else | |
8690e634 | 23822 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
c971b7fa | 23823 | /* end confdefs.h. */ |
88b48903 | 23824 | #include <math.h> |
c971b7fa PA |
23825 | int |
23826 | main () | |
23827 | { | |
88b48903 WN |
23828 | /* Solaris 10 has a broken definition of HUGE_VAL. */ |
23829 | double d = HUGE_VAL; | |
23830 | return d == 0; | |
c971b7fa PA |
23831 | ; |
23832 | return 0; | |
23833 | } | |
23834 | _ACEOF | |
23835 | if ac_fn_c_try_compile "$LINENO"; then : | |
88b48903 | 23836 | gl_cv_header_math_huge_val_works=yes |
8690e634 | 23837 | else |
88b48903 | 23838 | gl_cv_header_math_huge_val_works=no |
c971b7fa PA |
23839 | fi |
23840 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c971b7fa | 23841 | fi |
88b48903 WN |
23842 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5 |
23843 | $as_echo "$gl_cv_header_math_huge_val_works" >&6; } | |
23844 | if test $gl_cv_header_math_huge_val_works = no; then | |
23845 | REPLACE_HUGE_VAL=1 | |
8690e634 | 23846 | fi |
c971b7fa | 23847 | |
c971b7fa | 23848 | |
c971b7fa PA |
23849 | |
23850 | ||
23851 | ||
23852 | ||
23853 | ||
23854 | ||
c971b7fa | 23855 | |
c971b7fa | 23856 | |
c971b7fa | 23857 | |
c971b7fa PA |
23858 | |
23859 | ||
c971b7fa | 23860 | |
472fa5ee | 23861 | |
5df4cba6 SM |
23862 | |
23863 | ||
23864 | ||
23865 | if case "$host_os" in | |
23866 | mingw*) true ;; | |
23867 | *) test $ac_cv_func_mbsinit = yes ;; | |
23868 | esac \ | |
23869 | && test $ac_cv_func_mbrtowc = yes; then | |
472fa5ee SM |
23870 | |
23871 | ||
23872 | ||
23873 | ||
c0c3707f CB |
23874 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 |
23875 | $as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } | |
23876 | if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then : | |
23877 | $as_echo_n "(cached) " >&6 | |
23878 | else | |
472fa5ee | 23879 | |
c0c3707f CB |
23880 | case "$host_os" in |
23881 | # Guess no on AIX and OSF/1. | |
23882 | aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; | |
23883 | # Guess yes otherwise. | |
23884 | *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; | |
23885 | esac | |
23886 | if test $LOCALE_JA != none; then | |
23887 | if test "$cross_compiling" = yes; then : | |
472fa5ee | 23888 | : |
c0c3707f CB |
23889 | else |
23890 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23891 | /* end confdefs.h. */ | |
472fa5ee | 23892 | |
c0c3707f CB |
23893 | #include <locale.h> |
23894 | #include <string.h> | |
c0c3707f CB |
23895 | #include <wchar.h> |
23896 | int main () | |
23897 | { | |
23898 | if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) | |
23899 | { | |
23900 | const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ | |
23901 | mbstate_t state; | |
23902 | wchar_t wc; | |
472fa5ee | 23903 | |
c0c3707f CB |
23904 | memset (&state, '\0', sizeof (mbstate_t)); |
23905 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
23906 | if (mbsinit (&state)) | |
23907 | return 2; | |
23908 | } | |
23909 | return 0; | |
23910 | } | |
23911 | _ACEOF | |
23912 | if ac_fn_c_try_run "$LINENO"; then : | |
23913 | gl_cv_func_mbrtowc_incomplete_state=yes | |
c971b7fa | 23914 | else |
c0c3707f CB |
23915 | gl_cv_func_mbrtowc_incomplete_state=no |
23916 | fi | |
23917 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23918 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23919 | fi | |
8690e634 | 23920 | |
c0c3707f CB |
23921 | else |
23922 | if test $LOCALE_FR_UTF8 != none; then | |
23923 | if test "$cross_compiling" = yes; then : | |
8690e634 JK |
23924 | : |
23925 | else | |
c971b7fa PA |
23926 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
23927 | /* end confdefs.h. */ | |
c971b7fa | 23928 | |
8690e634 JK |
23929 | #include <locale.h> |
23930 | #include <string.h> | |
8690e634 JK |
23931 | #include <wchar.h> |
23932 | int main () | |
c971b7fa | 23933 | { |
c0c3707f | 23934 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) |
8690e634 | 23935 | { |
c0c3707f | 23936 | const char input[] = "B\303\274\303\237er"; /* "Büßer" */ |
8690e634 JK |
23937 | mbstate_t state; |
23938 | wchar_t wc; | |
23939 | ||
23940 | memset (&state, '\0', sizeof (mbstate_t)); | |
23941 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
23942 | if (mbsinit (&state)) | |
c0c3707f | 23943 | return 2; |
8690e634 | 23944 | } |
c971b7fa PA |
23945 | return 0; |
23946 | } | |
23947 | _ACEOF | |
8690e634 JK |
23948 | if ac_fn_c_try_run "$LINENO"; then : |
23949 | gl_cv_func_mbrtowc_incomplete_state=yes | |
c971b7fa | 23950 | else |
8690e634 | 23951 | gl_cv_func_mbrtowc_incomplete_state=no |
c971b7fa | 23952 | fi |
8690e634 JK |
23953 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
23954 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c971b7fa | 23955 | fi |
c971b7fa | 23956 | |
c0c3707f | 23957 | fi |
8690e634 | 23958 | fi |
c971b7fa | 23959 | |
8690e634 JK |
23960 | fi |
23961 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 | |
23962 | $as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } | |
c971b7fa | 23963 | |
c971b7fa | 23964 | |
c971b7fa | 23965 | |
c971b7fa | 23966 | |
8690e634 JK |
23967 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 |
23968 | $as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } | |
d0ac1c44 | 23969 | if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then : |
c971b7fa PA |
23970 | $as_echo_n "(cached) " >&6 |
23971 | else | |
23972 | ||
8690e634 JK |
23973 | case "$host_os" in |
23974 | # Guess no on Solaris 8. | |
23975 | solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; | |
23976 | # Guess yes otherwise. | |
23977 | *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; | |
23978 | esac | |
23979 | if test $LOCALE_ZH_CN != none; then | |
23980 | if test "$cross_compiling" = yes; then : | |
23981 | : | |
23982 | else | |
23983 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c971b7fa PA |
23984 | /* end confdefs.h. */ |
23985 | ||
8690e634 JK |
23986 | #include <locale.h> |
23987 | #include <stdlib.h> | |
23988 | #include <string.h> | |
8690e634 JK |
23989 | #include <wchar.h> |
23990 | int main () | |
c971b7fa | 23991 | { |
8690e634 JK |
23992 | /* This fails on Solaris 8: |
23993 | mbrtowc returns 2, and sets wc to 0x00F0. | |
23994 | mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ | |
23995 | if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) | |
23996 | { | |
23997 | char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ | |
23998 | mbstate_t state; | |
23999 | wchar_t wc; | |
24000 | ||
24001 | memset (&state, '\0', sizeof (mbstate_t)); | |
24002 | if (mbrtowc (&wc, input + 3, 6, &state) != 4 | |
24003 | && mbtowc (&wc, input + 3, 6) == 4) | |
c0c3707f | 24004 | return 2; |
8690e634 | 24005 | } |
c971b7fa PA |
24006 | return 0; |
24007 | } | |
24008 | _ACEOF | |
8690e634 JK |
24009 | if ac_fn_c_try_run "$LINENO"; then : |
24010 | gl_cv_func_mbrtowc_sanitycheck=yes | |
c971b7fa | 24011 | else |
8690e634 | 24012 | gl_cv_func_mbrtowc_sanitycheck=no |
c971b7fa | 24013 | fi |
8690e634 JK |
24014 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
24015 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c971b7fa | 24016 | fi |
c971b7fa | 24017 | |
8690e634 | 24018 | fi |
c971b7fa | 24019 | |
8690e634 JK |
24020 | fi |
24021 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 | |
24022 | $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } | |
24023 | ||
24024 | REPLACE_MBSTATE_T=0 | |
24025 | case "$gl_cv_func_mbrtowc_incomplete_state" in | |
24026 | *yes) ;; | |
24027 | *) REPLACE_MBSTATE_T=1 ;; | |
24028 | esac | |
24029 | case "$gl_cv_func_mbrtowc_sanitycheck" in | |
24030 | *yes) ;; | |
24031 | *) REPLACE_MBSTATE_T=1 ;; | |
24032 | esac | |
c971b7fa | 24033 | else |
8690e634 | 24034 | REPLACE_MBSTATE_T=1 |
c971b7fa PA |
24035 | fi |
24036 | ||
24037 | ||
24038 | ||
8690e634 JK |
24039 | if test $ac_cv_func_mbrtowc = no; then |
24040 | HAVE_MBRTOWC=0 | |
24041 | ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" " | |
9c9d63b1 | 24042 | #include <wchar.h> |
c971b7fa | 24043 | |
8690e634 | 24044 | " |
d0ac1c44 | 24045 | if test "x$ac_cv_have_decl_mbrtowc" = xyes; then : |
8690e634 JK |
24046 | ac_have_decl=1 |
24047 | else | |
24048 | ac_have_decl=0 | |
c971b7fa | 24049 | fi |
c971b7fa | 24050 | |
8690e634 JK |
24051 | cat >>confdefs.h <<_ACEOF |
24052 | #define HAVE_DECL_MBRTOWC $ac_have_decl | |
24053 | _ACEOF | |
c971b7fa | 24054 | |
8690e634 JK |
24055 | if test $ac_cv_have_decl_mbrtowc = yes; then |
24056 | REPLACE_MBRTOWC=1 | |
24057 | fi | |
24058 | else | |
24059 | if test $REPLACE_MBSTATE_T = 1; then | |
24060 | REPLACE_MBRTOWC=1 | |
24061 | else | |
c971b7fa PA |
24062 | |
24063 | ||
24064 | ||
8690e634 JK |
24065 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5 |
24066 | $as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; } | |
d0ac1c44 | 24067 | if ${gl_cv_func_mbrtowc_null_arg1+:} false; then : |
8690e634 | 24068 | $as_echo_n "(cached) " >&6 |
c971b7fa | 24069 | else |
c971b7fa | 24070 | |
8690e634 JK |
24071 | case "$host_os" in |
24072 | # Guess no on Solaris. | |
24073 | solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; | |
24074 | # Guess yes otherwise. | |
24075 | *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; | |
24076 | esac | |
24077 | if test $LOCALE_FR_UTF8 != none; then | |
24078 | if test "$cross_compiling" = yes; then : | |
24079 | : | |
24080 | else | |
24081 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c971b7fa PA |
24082 | /* end confdefs.h. */ |
24083 | ||
8690e634 JK |
24084 | #include <locale.h> |
24085 | #include <stdlib.h> | |
24086 | #include <string.h> | |
8690e634 JK |
24087 | #include <wchar.h> |
24088 | int main () | |
24089 | { | |
24090 | int result = 0; | |
24091 | ||
24092 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
24093 | { | |
24094 | char input[] = "\303\237er"; | |
24095 | mbstate_t state; | |
24096 | wchar_t wc; | |
24097 | size_t ret; | |
24098 | ||
24099 | memset (&state, '\0', sizeof (mbstate_t)); | |
24100 | wc = (wchar_t) 0xBADFACE; | |
24101 | ret = mbrtowc (&wc, input, 5, &state); | |
24102 | if (ret != 2) | |
24103 | result |= 1; | |
24104 | if (!mbsinit (&state)) | |
24105 | result |= 2; | |
c971b7fa | 24106 | |
8690e634 JK |
24107 | memset (&state, '\0', sizeof (mbstate_t)); |
24108 | ret = mbrtowc (NULL, input, 5, &state); | |
24109 | if (ret != 2) /* Solaris 7 fails here: ret is -1. */ | |
24110 | result |= 4; | |
24111 | if (!mbsinit (&state)) | |
24112 | result |= 8; | |
24113 | } | |
24114 | return result; | |
24115 | } | |
c971b7fa | 24116 | _ACEOF |
8690e634 JK |
24117 | if ac_fn_c_try_run "$LINENO"; then : |
24118 | gl_cv_func_mbrtowc_null_arg1=yes | |
24119 | else | |
24120 | gl_cv_func_mbrtowc_null_arg1=no | |
24121 | fi | |
24122 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24123 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24124 | fi | |
c971b7fa | 24125 | |
8690e634 | 24126 | fi |
c971b7fa | 24127 | |
c971b7fa | 24128 | fi |
8690e634 JK |
24129 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5 |
24130 | $as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; } | |
c971b7fa | 24131 | |
c971b7fa | 24132 | |
c971b7fa | 24133 | |
c971b7fa | 24134 | |
8690e634 JK |
24135 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 |
24136 | $as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; } | |
d0ac1c44 | 24137 | if ${gl_cv_func_mbrtowc_null_arg2+:} false; then : |
8690e634 JK |
24138 | $as_echo_n "(cached) " >&6 |
24139 | else | |
c971b7fa | 24140 | |
8690e634 JK |
24141 | case "$host_os" in |
24142 | # Guess no on OSF/1. | |
24143 | osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; | |
24144 | # Guess yes otherwise. | |
24145 | *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; | |
24146 | esac | |
24147 | if test $LOCALE_FR_UTF8 != none; then | |
24148 | if test "$cross_compiling" = yes; then : | |
c971b7fa | 24149 | : |
8690e634 JK |
24150 | else |
24151 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24152 | /* end confdefs.h. */ | |
24153 | ||
24154 | #include <locale.h> | |
24155 | #include <string.h> | |
8690e634 JK |
24156 | #include <wchar.h> |
24157 | int main () | |
24158 | { | |
24159 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
24160 | { | |
24161 | mbstate_t state; | |
24162 | wchar_t wc; | |
24163 | int ret; | |
24164 | ||
24165 | memset (&state, '\0', sizeof (mbstate_t)); | |
24166 | wc = (wchar_t) 0xBADFACE; | |
24167 | mbrtowc (&wc, NULL, 5, &state); | |
24168 | /* Check that wc was not modified. */ | |
24169 | if (wc != (wchar_t) 0xBADFACE) | |
c0c3707f | 24170 | return 2; |
8690e634 JK |
24171 | } |
24172 | return 0; | |
24173 | } | |
24174 | _ACEOF | |
24175 | if ac_fn_c_try_run "$LINENO"; then : | |
24176 | gl_cv_func_mbrtowc_null_arg2=yes | |
24177 | else | |
24178 | gl_cv_func_mbrtowc_null_arg2=no | |
24179 | fi | |
24180 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24181 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24182 | fi | |
24183 | ||
24184 | fi | |
24185 | ||
24186 | fi | |
24187 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5 | |
24188 | $as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; } | |
c971b7fa PA |
24189 | |
24190 | ||
24191 | ||
24192 | ||
24193 | ||
24194 | ||
8690e634 JK |
24195 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 |
24196 | $as_echo_n "checking whether mbrtowc has a correct return value... " >&6; } | |
d0ac1c44 | 24197 | if ${gl_cv_func_mbrtowc_retval+:} false; then : |
8690e634 JK |
24198 | $as_echo_n "(cached) " >&6 |
24199 | else | |
24200 | ||
24201 | case "$host_os" in | |
24202 | # Guess no on HP-UX, Solaris, native Windows. | |
24203 | hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; | |
24204 | # Guess yes otherwise. | |
24205 | *) gl_cv_func_mbrtowc_retval="guessing yes" ;; | |
24206 | esac | |
24207 | if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ | |
24208 | || { case "$host_os" in mingw*) true;; *) false;; esac; }; then | |
24209 | if test "$cross_compiling" = yes; then : | |
c971b7fa | 24210 | : |
8690e634 JK |
24211 | else |
24212 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24213 | /* end confdefs.h. */ | |
c971b7fa | 24214 | |
8690e634 JK |
24215 | #include <locale.h> |
24216 | #include <string.h> | |
8690e634 JK |
24217 | #include <wchar.h> |
24218 | int main () | |
24219 | { | |
24220 | int result = 0; | |
24221 | int found_some_locale = 0; | |
24222 | /* This fails on Solaris. */ | |
24223 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
24224 | { | |
24225 | char input[] = "B\303\274\303\237er"; /* "Büßer" */ | |
24226 | mbstate_t state; | |
24227 | wchar_t wc; | |
24228 | ||
24229 | memset (&state, '\0', sizeof (mbstate_t)); | |
24230 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
24231 | { | |
24232 | input[1] = '\0'; | |
24233 | if (mbrtowc (&wc, input + 2, 5, &state) != 1) | |
24234 | result |= 1; | |
24235 | } | |
24236 | found_some_locale = 1; | |
24237 | } | |
24238 | /* This fails on HP-UX 11.11. */ | |
24239 | if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) | |
24240 | { | |
24241 | char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ | |
24242 | mbstate_t state; | |
24243 | wchar_t wc; | |
24244 | ||
24245 | memset (&state, '\0', sizeof (mbstate_t)); | |
24246 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
24247 | { | |
24248 | input[1] = '\0'; | |
24249 | if (mbrtowc (&wc, input + 2, 5, &state) != 2) | |
24250 | result |= 2; | |
24251 | } | |
24252 | found_some_locale = 1; | |
24253 | } | |
5df4cba6 SM |
24254 | /* This fails on native Windows. */ |
24255 | if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) | |
24256 | { | |
24257 | char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ | |
24258 | mbstate_t state; | |
24259 | wchar_t wc; | |
24260 | ||
24261 | memset (&state, '\0', sizeof (mbstate_t)); | |
24262 | if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) | |
24263 | { | |
24264 | input[3] = '\0'; | |
24265 | if (mbrtowc (&wc, input + 4, 4, &state) != 1) | |
24266 | result |= 4; | |
24267 | } | |
24268 | found_some_locale = 1; | |
24269 | } | |
24270 | if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) | |
24271 | { | |
24272 | char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ | |
24273 | mbstate_t state; | |
24274 | wchar_t wc; | |
24275 | ||
24276 | memset (&state, '\0', sizeof (mbstate_t)); | |
24277 | if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) | |
24278 | { | |
24279 | input[3] = '\0'; | |
24280 | if (mbrtowc (&wc, input + 4, 4, &state) != 1) | |
24281 | result |= 8; | |
24282 | } | |
24283 | found_some_locale = 1; | |
24284 | } | |
24285 | if (setlocale (LC_ALL, "Chinese_China.936") != NULL) | |
24286 | { | |
24287 | char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ | |
24288 | mbstate_t state; | |
24289 | wchar_t wc; | |
24290 | ||
24291 | memset (&state, '\0', sizeof (mbstate_t)); | |
24292 | if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) | |
24293 | { | |
24294 | input[3] = '\0'; | |
24295 | if (mbrtowc (&wc, input + 4, 4, &state) != 1) | |
24296 | result |= 16; | |
24297 | } | |
24298 | found_some_locale = 1; | |
24299 | } | |
24300 | return (found_some_locale ? result : 77); | |
24301 | } | |
24302 | _ACEOF | |
24303 | if ac_fn_c_try_run "$LINENO"; then : | |
24304 | gl_cv_func_mbrtowc_retval=yes | |
24305 | else | |
24306 | if test $? != 77; then | |
24307 | gl_cv_func_mbrtowc_retval=no | |
24308 | fi | |
24309 | ||
24310 | fi | |
24311 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24312 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24313 | fi | |
24314 | ||
24315 | fi | |
24316 | ||
24317 | fi | |
24318 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 | |
24319 | $as_echo "$gl_cv_func_mbrtowc_retval" >&6; } | |
24320 | ||
24321 | ||
24322 | ||
24323 | ||
24324 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 | |
24325 | $as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } | |
24326 | if ${gl_cv_func_mbrtowc_nul_retval+:} false; then : | |
24327 | $as_echo_n "(cached) " >&6 | |
24328 | else | |
24329 | ||
24330 | case "$host_os" in | |
24331 | # Guess no on Solaris 8 and 9. | |
24332 | solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; | |
24333 | # Guess yes otherwise. | |
24334 | *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; | |
24335 | esac | |
24336 | if test $LOCALE_ZH_CN != none; then | |
24337 | if test "$cross_compiling" = yes; then : | |
24338 | : | |
24339 | else | |
24340 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24341 | /* end confdefs.h. */ | |
24342 | ||
24343 | #include <locale.h> | |
24344 | #include <string.h> | |
5df4cba6 SM |
24345 | #include <wchar.h> |
24346 | int main () | |
24347 | { | |
24348 | /* This fails on Solaris 8 and 9. */ | |
24349 | if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) | |
24350 | { | |
24351 | mbstate_t state; | |
24352 | wchar_t wc; | |
24353 | ||
24354 | memset (&state, '\0', sizeof (mbstate_t)); | |
24355 | if (mbrtowc (&wc, "", 1, &state) != 0) | |
24356 | return 2; | |
24357 | } | |
24358 | return 0; | |
24359 | } | |
24360 | _ACEOF | |
24361 | if ac_fn_c_try_run "$LINENO"; then : | |
24362 | gl_cv_func_mbrtowc_nul_retval=yes | |
24363 | else | |
24364 | gl_cv_func_mbrtowc_nul_retval=no | |
24365 | fi | |
24366 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24367 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24368 | fi | |
24369 | ||
24370 | fi | |
24371 | ||
24372 | fi | |
24373 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 | |
24374 | $as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; } | |
24375 | ||
24376 | ||
24377 | ||
24378 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc stores incomplete characters" >&5 | |
24379 | $as_echo_n "checking whether mbrtowc stores incomplete characters... " >&6; } | |
24380 | if ${gl_cv_func_mbrtowc_stores_incomplete+:} false; then : | |
24381 | $as_echo_n "(cached) " >&6 | |
24382 | else | |
24383 | ||
24384 | case "$host_os" in | |
24385 | # Guess yes on native Windows. | |
24386 | mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;; | |
24387 | *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;; | |
24388 | esac | |
24389 | case "$host_os" in | |
24390 | mingw*) | |
24391 | if test "$cross_compiling" = yes; then : | |
24392 | : | |
24393 | else | |
24394 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24395 | /* end confdefs.h. */ | |
24396 | ||
24397 | #include <locale.h> | |
24398 | #include <string.h> | |
5df4cba6 SM |
24399 | #include <wchar.h> |
24400 | int main () | |
24401 | { | |
24402 | int result = 0; | |
24403 | if (setlocale (LC_ALL, "French_France.65001") != NULL) | |
24404 | { | |
24405 | wchar_t wc = (wchar_t) 0xBADFACE; | |
24406 | mbstate_t state; | |
24407 | ||
24408 | memset (&state, '\0', sizeof (mbstate_t)); | |
24409 | if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2) | |
24410 | && wc != (wchar_t) 0xBADFACE) | |
24411 | result |= 1; | |
24412 | } | |
8690e634 JK |
24413 | if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) |
24414 | { | |
5df4cba6 | 24415 | wchar_t wc = (wchar_t) 0xBADFACE; |
8690e634 | 24416 | mbstate_t state; |
8690e634 JK |
24417 | |
24418 | memset (&state, '\0', sizeof (mbstate_t)); | |
5df4cba6 SM |
24419 | if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2) |
24420 | && wc != (wchar_t) 0xBADFACE) | |
24421 | result |= 2; | |
8690e634 JK |
24422 | } |
24423 | if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) | |
24424 | { | |
5df4cba6 | 24425 | wchar_t wc = (wchar_t) 0xBADFACE; |
8690e634 | 24426 | mbstate_t state; |
8690e634 JK |
24427 | |
24428 | memset (&state, '\0', sizeof (mbstate_t)); | |
5df4cba6 SM |
24429 | if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2) |
24430 | && wc != (wchar_t) 0xBADFACE) | |
24431 | result |= 4; | |
8690e634 JK |
24432 | } |
24433 | if (setlocale (LC_ALL, "Chinese_China.936") != NULL) | |
24434 | { | |
5df4cba6 | 24435 | wchar_t wc = (wchar_t) 0xBADFACE; |
8690e634 | 24436 | mbstate_t state; |
8690e634 JK |
24437 | |
24438 | memset (&state, '\0', sizeof (mbstate_t)); | |
5df4cba6 SM |
24439 | if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2) |
24440 | && wc != (wchar_t) 0xBADFACE) | |
24441 | result |= 8; | |
8690e634 | 24442 | } |
5df4cba6 | 24443 | return result; |
8690e634 JK |
24444 | } |
24445 | _ACEOF | |
24446 | if ac_fn_c_try_run "$LINENO"; then : | |
5df4cba6 | 24447 | gl_cv_func_mbrtowc_stores_incomplete=no |
8690e634 | 24448 | else |
5df4cba6 | 24449 | gl_cv_func_mbrtowc_stores_incomplete=yes |
8690e634 JK |
24450 | fi |
24451 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24452 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24453 | fi | |
c971b7fa | 24454 | |
5df4cba6 SM |
24455 | ;; |
24456 | *) | |
8690e634 | 24457 | |
5df4cba6 SM |
24458 | if test $LOCALE_FR_UTF8 != none; then |
24459 | if test "$cross_compiling" = yes; then : | |
8690e634 | 24460 | : |
c971b7fa PA |
24461 | else |
24462 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24463 | /* end confdefs.h. */ | |
24464 | ||
8690e634 | 24465 | #include <locale.h> |
c971b7fa | 24466 | #include <string.h> |
8690e634 JK |
24467 | #include <wchar.h> |
24468 | int main () | |
c971b7fa | 24469 | { |
5df4cba6 | 24470 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) |
c971b7fa | 24471 | { |
5df4cba6 | 24472 | wchar_t wc = (wchar_t) 0xBADFACE; |
8690e634 | 24473 | mbstate_t state; |
c971b7fa | 24474 | |
8690e634 | 24475 | memset (&state, '\0', sizeof (mbstate_t)); |
5df4cba6 SM |
24476 | if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2) |
24477 | && wc != (wchar_t) 0xBADFACE) | |
24478 | return 1; | |
8690e634 | 24479 | } |
c971b7fa PA |
24480 | return 0; |
24481 | } | |
24482 | _ACEOF | |
24483 | if ac_fn_c_try_run "$LINENO"; then : | |
5df4cba6 | 24484 | gl_cv_func_mbrtowc_stores_incomplete=no |
c971b7fa | 24485 | else |
5df4cba6 | 24486 | gl_cv_func_mbrtowc_stores_incomplete=yes |
c971b7fa PA |
24487 | fi |
24488 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24489 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24490 | fi | |
24491 | ||
5df4cba6 SM |
24492 | fi |
24493 | ;; | |
24494 | esac | |
8690e634 | 24495 | |
c971b7fa | 24496 | fi |
5df4cba6 SM |
24497 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_stores_incomplete" >&5 |
24498 | $as_echo "$gl_cv_func_mbrtowc_stores_incomplete" >&6; } | |
8690e634 | 24499 | |
4a626d0a PA |
24500 | |
24501 | ||
24502 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5 | |
24503 | $as_echo_n "checking whether mbrtowc works on empty input... " >&6; } | |
d0ac1c44 | 24504 | if ${gl_cv_func_mbrtowc_empty_input+:} false; then : |
4a626d0a PA |
24505 | $as_echo_n "(cached) " >&6 |
24506 | else | |
24507 | ||
24508 | case "$host_os" in | |
c0c3707f CB |
24509 | # Guess no on AIX and glibc systems. |
24510 | aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;; | |
24511 | # Guess yes on native Windows. | |
24512 | mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; | |
24513 | *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; | |
4a626d0a PA |
24514 | esac |
24515 | if test "$cross_compiling" = yes; then : | |
24516 | : | |
24517 | else | |
24518 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24519 | /* end confdefs.h. */ | |
24520 | ||
24521 | #include <wchar.h> | |
24522 | static wchar_t wc; | |
24523 | static mbstate_t mbs; | |
24524 | int | |
24525 | main (void) | |
24526 | { | |
49e4877c | 24527 | return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2; |
4a626d0a PA |
24528 | } |
24529 | _ACEOF | |
24530 | if ac_fn_c_try_run "$LINENO"; then : | |
4a626d0a | 24531 | gl_cv_func_mbrtowc_empty_input=yes |
49e4877c PA |
24532 | else |
24533 | gl_cv_func_mbrtowc_empty_input=no | |
4a626d0a PA |
24534 | fi |
24535 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24536 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24537 | fi | |
24538 | ||
24539 | ||
24540 | fi | |
24541 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5 | |
24542 | $as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; } | |
24543 | ||
49e4877c | 24544 | |
c0c3707f | 24545 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5 |
49e4877c | 24546 | $as_echo_n "checking whether the C locale is free of encoding errors... " >&6; } |
5df4cba6 | 24547 | if ${gl_cv_func_mbrtowc_C_locale_sans_EILSEQ+:} false; then : |
49e4877c PA |
24548 | $as_echo_n "(cached) " >&6 |
24549 | else | |
24550 | ||
5df4cba6 | 24551 | gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal" |
49e4877c PA |
24552 | |
24553 | if test "$cross_compiling" = yes; then : | |
c0c3707f CB |
24554 | case "$host_os" in |
24555 | # Guess yes on native Windows. | |
5df4cba6 | 24556 | mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;; |
c0c3707f CB |
24557 | esac |
24558 | ||
49e4877c PA |
24559 | else |
24560 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24561 | /* end confdefs.h. */ | |
24562 | #include <limits.h> | |
24563 | #include <locale.h> | |
24564 | #include <wchar.h> | |
24565 | ||
24566 | int | |
24567 | main () | |
24568 | { | |
24569 | ||
24570 | int i; | |
24571 | char *locale = setlocale (LC_ALL, "C"); | |
24572 | if (! locale) | |
c0c3707f | 24573 | return 2; |
49e4877c PA |
24574 | for (i = CHAR_MIN; i <= CHAR_MAX; i++) |
24575 | { | |
24576 | char c = i; | |
24577 | wchar_t wc; | |
24578 | mbstate_t mbs = { 0, }; | |
24579 | size_t ss = mbrtowc (&wc, &c, 1, &mbs); | |
24580 | if (1 < ss) | |
c0c3707f | 24581 | return 3; |
49e4877c PA |
24582 | } |
24583 | return 0; | |
24584 | ||
6ec2e0f5 SDJ |
24585 | ; |
24586 | return 0; | |
24587 | } | |
24588 | _ACEOF | |
24589 | if ac_fn_c_try_run "$LINENO"; then : | |
5df4cba6 | 24590 | gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes |
6ec2e0f5 | 24591 | else |
5df4cba6 | 24592 | gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no |
6ec2e0f5 SDJ |
24593 | fi |
24594 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24595 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24596 | fi | |
24597 | ||
c0c3707f | 24598 | |
6ec2e0f5 | 24599 | fi |
5df4cba6 SM |
24600 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&5 |
24601 | $as_echo "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&6; } | |
6ec2e0f5 SDJ |
24602 | |
24603 | case "$gl_cv_func_mbrtowc_null_arg1" in | |
24604 | *yes) ;; | |
24605 | *) | |
24606 | $as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h | |
24607 | ||
24608 | REPLACE_MBRTOWC=1 | |
24609 | ;; | |
24610 | esac | |
24611 | case "$gl_cv_func_mbrtowc_null_arg2" in | |
24612 | *yes) ;; | |
24613 | *) | |
24614 | $as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h | |
24615 | ||
24616 | REPLACE_MBRTOWC=1 | |
24617 | ;; | |
24618 | esac | |
24619 | case "$gl_cv_func_mbrtowc_retval" in | |
24620 | *yes) ;; | |
24621 | *) | |
24622 | $as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h | |
24623 | ||
24624 | REPLACE_MBRTOWC=1 | |
24625 | ;; | |
24626 | esac | |
24627 | case "$gl_cv_func_mbrtowc_nul_retval" in | |
24628 | *yes) ;; | |
24629 | *) | |
24630 | $as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h | |
24631 | ||
5df4cba6 SM |
24632 | REPLACE_MBRTOWC=1 |
24633 | ;; | |
24634 | esac | |
24635 | case "$gl_cv_func_mbrtowc_stores_incomplete" in | |
24636 | *no) ;; | |
24637 | *) | |
24638 | $as_echo "#define MBRTOWC_STORES_INCOMPLETE_BUG 1" >>confdefs.h | |
24639 | ||
24640 | REPLACE_MBRTOWC=1 | |
24641 | ;; | |
24642 | esac | |
24643 | case "$gl_cv_func_mbrtowc_empty_input" in | |
24644 | *yes) ;; | |
24645 | *) | |
24646 | $as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h | |
24647 | ||
24648 | REPLACE_MBRTOWC=1 | |
24649 | ;; | |
24650 | esac | |
24651 | case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in | |
24652 | *yes) ;; | |
24653 | *) | |
24654 | $as_echo "#define MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h | |
24655 | ||
24656 | REPLACE_MBRTOWC=1 | |
24657 | ;; | |
24658 | esac | |
24659 | fi | |
24660 | fi | |
24661 | if test $REPLACE_MBSTATE_T = 1; then | |
24662 | case "$host_os" in | |
24663 | mingw*) LIB_MBRTOWC= ;; | |
24664 | *) | |
24665 | ||
24666 | ||
24667 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 | |
24668 | $as_echo_n "checking whether imported symbols can be declared weak... " >&6; } | |
24669 | if ${gl_cv_have_weak+:} false; then : | |
24670 | $as_echo_n "(cached) " >&6 | |
24671 | else | |
24672 | gl_cv_have_weak=no | |
24673 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24674 | /* end confdefs.h. */ | |
24675 | extern void xyzzy (); | |
24676 | #pragma weak xyzzy | |
24677 | int | |
24678 | main () | |
24679 | { | |
24680 | xyzzy(); | |
24681 | ; | |
24682 | return 0; | |
24683 | } | |
24684 | _ACEOF | |
24685 | if ac_fn_c_try_link "$LINENO"; then : | |
24686 | gl_cv_have_weak=maybe | |
24687 | fi | |
24688 | rm -f core conftest.err conftest.$ac_objext \ | |
24689 | conftest$ac_exeext conftest.$ac_ext | |
24690 | if test $gl_cv_have_weak = maybe; then | |
24691 | if test "$cross_compiling" = yes; then : | |
24692 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24693 | /* end confdefs.h. */ | |
24694 | #ifdef __ELF__ | |
24695 | Extensible Linking Format | |
24696 | #endif | |
24697 | ||
24698 | _ACEOF | |
24699 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
24700 | $EGREP "Extensible Linking Format" >/dev/null 2>&1; then : | |
24701 | gl_cv_have_weak="guessing yes" | |
24702 | else | |
24703 | gl_cv_have_weak="guessing no" | |
24704 | fi | |
24705 | rm -f conftest* | |
24706 | ||
24707 | ||
24708 | else | |
24709 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24710 | /* end confdefs.h. */ | |
24711 | ||
24712 | #include <stdio.h> | |
24713 | #pragma weak fputs | |
24714 | int main () | |
24715 | { | |
24716 | return (fputs == NULL); | |
24717 | } | |
24718 | _ACEOF | |
24719 | if ac_fn_c_try_run "$LINENO"; then : | |
24720 | gl_cv_have_weak=yes | |
24721 | else | |
24722 | gl_cv_have_weak=no | |
24723 | fi | |
24724 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24725 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24726 | fi | |
24727 | ||
24728 | fi | |
24729 | case " $LDFLAGS " in | |
24730 | *" -static "*) gl_cv_have_weak=no ;; | |
24731 | esac | |
24732 | case "$gl_cv_have_weak" in | |
24733 | *yes) | |
24734 | case "$host_os" in | |
24735 | freebsd* | dragonfly*) | |
24736 | : > conftest1.c | |
24737 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1 | |
24738 | cat <<EOF > conftest2.c | |
24739 | #include <pthread.h> | |
24740 | #pragma weak pthread_mutexattr_gettype | |
24741 | int main () | |
24742 | { | |
24743 | return (pthread_mutexattr_gettype != NULL); | |
24744 | } | |
24745 | EOF | |
24746 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \ | |
24747 | || gl_cv_have_weak=no | |
24748 | rm -f conftest1.c libempty.so conftest2.c conftest | |
24749 | ;; | |
24750 | esac | |
24751 | ;; | |
24752 | esac | |
24753 | ||
24754 | fi | |
24755 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 | |
24756 | $as_echo "$gl_cv_have_weak" >&6; } | |
24757 | case "$gl_cv_have_weak" in | |
24758 | *yes) | |
24759 | ||
24760 | $as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h | |
24761 | ||
24762 | ;; | |
24763 | esac | |
24764 | ||
24765 | case "$gl_cv_have_weak" in | |
24766 | *yes) LIB_MBRTOWC= ;; | |
24767 | *) LIB_MBRTOWC="$LIBPTHREAD" ;; | |
24768 | esac | |
24769 | ;; | |
24770 | esac | |
24771 | else | |
24772 | LIB_MBRTOWC= | |
24773 | fi | |
24774 | ||
24775 | ||
24776 | if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then | |
24777 | ||
24778 | ||
24779 | ||
24780 | ||
24781 | ||
24782 | ||
24783 | ||
24784 | ||
24785 | gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext" | |
24786 | ||
24787 | if test $REPLACE_MBSTATE_T = 1; then | |
24788 | ||
24789 | ||
24790 | ||
24791 | ||
24792 | ||
24793 | ||
24794 | ||
24795 | ||
24796 | gl_LIBOBJS="$gl_LIBOBJS lc-charset-dispatch.$ac_objext" | |
24797 | ||
24798 | ||
24799 | ||
24800 | ||
24801 | ||
24802 | ||
24803 | ||
24804 | ||
24805 | ||
24806 | gl_LIBOBJS="$gl_LIBOBJS mbtowc-lock.$ac_objext" | |
24807 | ||
24808 | ||
24809 | ||
24810 | ||
24811 | CFLAG_VISIBILITY= | |
24812 | HAVE_VISIBILITY=0 | |
24813 | if test -n "$GCC"; then | |
24814 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5 | |
24815 | $as_echo_n "checking whether the -Werror option is usable... " >&6; } | |
24816 | if ${gl_cv_cc_vis_werror+:} false; then : | |
24817 | $as_echo_n "(cached) " >&6 | |
24818 | else | |
24819 | gl_save_CFLAGS="$CFLAGS" | |
24820 | CFLAGS="$CFLAGS -Werror" | |
24821 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24822 | /* end confdefs.h. */ | |
24823 | ||
24824 | int | |
24825 | main () | |
24826 | { | |
24827 | ||
24828 | ; | |
24829 | return 0; | |
24830 | } | |
24831 | _ACEOF | |
24832 | if ac_fn_c_try_compile "$LINENO"; then : | |
24833 | gl_cv_cc_vis_werror=yes | |
24834 | else | |
24835 | gl_cv_cc_vis_werror=no | |
24836 | fi | |
24837 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
24838 | CFLAGS="$gl_save_CFLAGS" | |
24839 | ||
24840 | fi | |
24841 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5 | |
24842 | $as_echo "$gl_cv_cc_vis_werror" >&6; } | |
24843 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5 | |
24844 | $as_echo_n "checking for simple visibility declarations... " >&6; } | |
24845 | if ${gl_cv_cc_visibility+:} false; then : | |
24846 | $as_echo_n "(cached) " >&6 | |
24847 | else | |
24848 | gl_save_CFLAGS="$CFLAGS" | |
24849 | CFLAGS="$CFLAGS -fvisibility=hidden" | |
24850 | if test $gl_cv_cc_vis_werror = yes; then | |
24851 | CFLAGS="$CFLAGS -Werror" | |
24852 | fi | |
24853 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24854 | /* end confdefs.h. */ | |
24855 | extern __attribute__((__visibility__("hidden"))) int hiddenvar; | |
24856 | extern __attribute__((__visibility__("default"))) int exportedvar; | |
24857 | extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); | |
24858 | extern __attribute__((__visibility__("default"))) int exportedfunc (void); | |
24859 | void dummyfunc (void) {} | |
24860 | ||
24861 | int | |
24862 | main () | |
24863 | { | |
6ec2e0f5 | 24864 | |
5df4cba6 SM |
24865 | ; |
24866 | return 0; | |
24867 | } | |
24868 | _ACEOF | |
24869 | if ac_fn_c_try_compile "$LINENO"; then : | |
24870 | gl_cv_cc_visibility=yes | |
24871 | else | |
24872 | gl_cv_cc_visibility=no | |
24873 | fi | |
24874 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
24875 | CFLAGS="$gl_save_CFLAGS" | |
6ec2e0f5 | 24876 | |
5df4cba6 SM |
24877 | fi |
24878 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5 | |
24879 | $as_echo "$gl_cv_cc_visibility" >&6; } | |
24880 | if test $gl_cv_cc_visibility = yes; then | |
24881 | CFLAG_VISIBILITY="-fvisibility=hidden" | |
24882 | HAVE_VISIBILITY=1 | |
6ec2e0f5 SDJ |
24883 | fi |
24884 | fi | |
24885 | ||
6ec2e0f5 SDJ |
24886 | |
24887 | ||
5df4cba6 SM |
24888 | cat >>confdefs.h <<_ACEOF |
24889 | #define HAVE_VISIBILITY $HAVE_VISIBILITY | |
24890 | _ACEOF | |
6ec2e0f5 SDJ |
24891 | |
24892 | ||
6ec2e0f5 | 24893 | |
5df4cba6 | 24894 | fi |
6ec2e0f5 | 24895 | |
c0c3707f | 24896 | |
6ec2e0f5 SDJ |
24897 | : |
24898 | ||
24899 | fi | |
24900 | ||
24901 | ||
24902 | ||
24903 | ||
24904 | ||
24905 | GNULIB_MBRTOWC=1 | |
24906 | ||
24907 | ||
24908 | ||
24909 | ||
24910 | ||
24911 | $as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h | |
24912 | ||
24913 | ||
24914 | ||
24915 | ||
24916 | ||
24917 | ||
24918 | ||
24919 | ||
24920 | ||
24921 | ||
24922 | ||
24923 | ||
24924 | ||
24925 | ||
5df4cba6 SM |
24926 | |
24927 | if case "$host_os" in | |
24928 | mingw*) true ;; | |
24929 | *) test $ac_cv_func_mbsinit = yes ;; | |
24930 | esac \ | |
24931 | && test $ac_cv_func_mbrtowc = yes; then | |
6ec2e0f5 SDJ |
24932 | |
24933 | ||
24934 | ||
c0c3707f | 24935 | |
6ec2e0f5 SDJ |
24936 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 |
24937 | $as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } | |
d0ac1c44 | 24938 | if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then : |
6ec2e0f5 SDJ |
24939 | $as_echo_n "(cached) " >&6 |
24940 | else | |
24941 | ||
24942 | case "$host_os" in | |
24943 | # Guess no on AIX and OSF/1. | |
24944 | aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; | |
24945 | # Guess yes otherwise. | |
24946 | *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; | |
24947 | esac | |
24948 | if test $LOCALE_JA != none; then | |
24949 | if test "$cross_compiling" = yes; then : | |
24950 | : | |
24951 | else | |
24952 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24953 | /* end confdefs.h. */ | |
24954 | ||
24955 | #include <locale.h> | |
24956 | #include <string.h> | |
6ec2e0f5 SDJ |
24957 | #include <wchar.h> |
24958 | int main () | |
24959 | { | |
24960 | if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) | |
24961 | { | |
24962 | const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ | |
24963 | mbstate_t state; | |
24964 | wchar_t wc; | |
24965 | ||
24966 | memset (&state, '\0', sizeof (mbstate_t)); | |
24967 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
24968 | if (mbsinit (&state)) | |
c0c3707f CB |
24969 | return 2; |
24970 | } | |
24971 | return 0; | |
24972 | } | |
24973 | _ACEOF | |
24974 | if ac_fn_c_try_run "$LINENO"; then : | |
24975 | gl_cv_func_mbrtowc_incomplete_state=yes | |
24976 | else | |
24977 | gl_cv_func_mbrtowc_incomplete_state=no | |
24978 | fi | |
24979 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24980 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24981 | fi | |
24982 | ||
24983 | else | |
24984 | if test $LOCALE_FR_UTF8 != none; then | |
24985 | if test "$cross_compiling" = yes; then : | |
24986 | : | |
24987 | else | |
24988 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24989 | /* end confdefs.h. */ | |
24990 | ||
24991 | #include <locale.h> | |
24992 | #include <string.h> | |
c0c3707f CB |
24993 | #include <wchar.h> |
24994 | int main () | |
24995 | { | |
24996 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
24997 | { | |
24998 | const char input[] = "B\303\274\303\237er"; /* "Büßer" */ | |
24999 | mbstate_t state; | |
25000 | wchar_t wc; | |
25001 | ||
25002 | memset (&state, '\0', sizeof (mbstate_t)); | |
25003 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
25004 | if (mbsinit (&state)) | |
25005 | return 2; | |
6ec2e0f5 SDJ |
25006 | } |
25007 | return 0; | |
25008 | } | |
25009 | _ACEOF | |
25010 | if ac_fn_c_try_run "$LINENO"; then : | |
25011 | gl_cv_func_mbrtowc_incomplete_state=yes | |
25012 | else | |
25013 | gl_cv_func_mbrtowc_incomplete_state=no | |
25014 | fi | |
25015 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25016 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25017 | fi | |
25018 | ||
c0c3707f | 25019 | fi |
6ec2e0f5 SDJ |
25020 | fi |
25021 | ||
25022 | fi | |
25023 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 | |
25024 | $as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } | |
25025 | ||
25026 | ||
25027 | ||
25028 | ||
25029 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 | |
25030 | $as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } | |
d0ac1c44 | 25031 | if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then : |
6ec2e0f5 SDJ |
25032 | $as_echo_n "(cached) " >&6 |
25033 | else | |
25034 | ||
25035 | case "$host_os" in | |
25036 | # Guess no on Solaris 8. | |
25037 | solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; | |
25038 | # Guess yes otherwise. | |
25039 | *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; | |
25040 | esac | |
25041 | if test $LOCALE_ZH_CN != none; then | |
25042 | if test "$cross_compiling" = yes; then : | |
25043 | : | |
25044 | else | |
25045 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25046 | /* end confdefs.h. */ | |
25047 | ||
25048 | #include <locale.h> | |
25049 | #include <stdlib.h> | |
25050 | #include <string.h> | |
6ec2e0f5 SDJ |
25051 | #include <wchar.h> |
25052 | int main () | |
25053 | { | |
25054 | /* This fails on Solaris 8: | |
25055 | mbrtowc returns 2, and sets wc to 0x00F0. | |
25056 | mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ | |
25057 | if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) | |
25058 | { | |
25059 | char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ | |
25060 | mbstate_t state; | |
25061 | wchar_t wc; | |
25062 | ||
25063 | memset (&state, '\0', sizeof (mbstate_t)); | |
25064 | if (mbrtowc (&wc, input + 3, 6, &state) != 4 | |
25065 | && mbtowc (&wc, input + 3, 6) == 4) | |
c0c3707f | 25066 | return 2; |
6ec2e0f5 | 25067 | } |
49e4877c PA |
25068 | return 0; |
25069 | } | |
25070 | _ACEOF | |
25071 | if ac_fn_c_try_run "$LINENO"; then : | |
6ec2e0f5 | 25072 | gl_cv_func_mbrtowc_sanitycheck=yes |
49e4877c | 25073 | else |
6ec2e0f5 | 25074 | gl_cv_func_mbrtowc_sanitycheck=no |
49e4877c PA |
25075 | fi |
25076 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25077 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25078 | fi | |
25079 | ||
6ec2e0f5 SDJ |
25080 | fi |
25081 | ||
49e4877c | 25082 | fi |
6ec2e0f5 SDJ |
25083 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 |
25084 | $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } | |
49e4877c | 25085 | |
6ec2e0f5 SDJ |
25086 | REPLACE_MBSTATE_T=0 |
25087 | case "$gl_cv_func_mbrtowc_incomplete_state" in | |
25088 | *yes) ;; | |
25089 | *) REPLACE_MBSTATE_T=1 ;; | |
25090 | esac | |
25091 | case "$gl_cv_func_mbrtowc_sanitycheck" in | |
25092 | *yes) ;; | |
25093 | *) REPLACE_MBSTATE_T=1 ;; | |
25094 | esac | |
25095 | else | |
25096 | REPLACE_MBSTATE_T=1 | |
25097 | fi | |
8690e634 | 25098 | |
8690e634 | 25099 | |
8690e634 | 25100 | |
6ec2e0f5 SDJ |
25101 | if test $ac_cv_func_mbsinit = no; then |
25102 | HAVE_MBSINIT=0 | |
25103 | ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" " | |
9c9d63b1 | 25104 | #include <wchar.h> |
8690e634 | 25105 | |
6ec2e0f5 | 25106 | " |
d0ac1c44 | 25107 | if test "x$ac_cv_have_decl_mbsinit" = xyes; then : |
6ec2e0f5 SDJ |
25108 | ac_have_decl=1 |
25109 | else | |
25110 | ac_have_decl=0 | |
25111 | fi | |
4a626d0a | 25112 | |
6ec2e0f5 SDJ |
25113 | cat >>confdefs.h <<_ACEOF |
25114 | #define HAVE_DECL_MBSINIT $ac_have_decl | |
25115 | _ACEOF | |
49e4877c | 25116 | |
6ec2e0f5 SDJ |
25117 | if test $ac_cv_have_decl_mbsinit = yes; then |
25118 | REPLACE_MBSINIT=1 | |
25119 | fi | |
25120 | else | |
25121 | if test $REPLACE_MBSTATE_T = 1; then | |
25122 | REPLACE_MBSINIT=1 | |
25123 | else | |
25124 | case "$host_os" in | |
25125 | mingw*) REPLACE_MBSINIT=1 ;; | |
8690e634 | 25126 | esac |
c971b7fa PA |
25127 | fi |
25128 | fi | |
25129 | ||
6ec2e0f5 | 25130 | if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then |
c971b7fa | 25131 | |
c971b7fa | 25132 | |
c971b7fa PA |
25133 | |
25134 | ||
25135 | ||
25136 | ||
25137 | ||
25138 | ||
6ec2e0f5 | 25139 | gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext" |
8690e634 JK |
25140 | |
25141 | ||
25142 | : | |
c971b7fa | 25143 | |
a512b375 | 25144 | fi |
c971b7fa | 25145 | |
8690e634 JK |
25146 | |
25147 | ||
25148 | ||
25149 | ||
6ec2e0f5 | 25150 | GNULIB_MBSINIT=1 |
8690e634 JK |
25151 | |
25152 | ||
25153 | ||
25154 | ||
8690e634 | 25155 | |
6ec2e0f5 | 25156 | $as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h |
8690e634 JK |
25157 | |
25158 | ||
25159 | ||
25160 | ||
25161 | ||
25162 | ||
25163 | ||
25164 | ||
25165 | ||
25166 | ||
25167 | ||
c971b7fa | 25168 | |
c971b7fa | 25169 | |
5df4cba6 SM |
25170 | |
25171 | if case "$host_os" in | |
25172 | mingw*) true ;; | |
25173 | *) test $ac_cv_func_mbsinit = yes ;; | |
25174 | esac \ | |
25175 | && test $ac_cv_func_mbrtowc = yes; then | |
c971b7fa | 25176 | |
8690e634 JK |
25177 | |
25178 | ||
c0c3707f | 25179 | |
8690e634 JK |
25180 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 |
25181 | $as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } | |
d0ac1c44 | 25182 | if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then : |
8690e634 JK |
25183 | $as_echo_n "(cached) " >&6 |
25184 | else | |
25185 | ||
25186 | case "$host_os" in | |
25187 | # Guess no on AIX and OSF/1. | |
25188 | aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; | |
25189 | # Guess yes otherwise. | |
25190 | *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; | |
25191 | esac | |
25192 | if test $LOCALE_JA != none; then | |
25193 | if test "$cross_compiling" = yes; then : | |
25194 | : | |
c971b7fa PA |
25195 | else |
25196 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25197 | /* end confdefs.h. */ | |
25198 | ||
8690e634 JK |
25199 | #include <locale.h> |
25200 | #include <string.h> | |
8690e634 JK |
25201 | #include <wchar.h> |
25202 | int main () | |
c971b7fa | 25203 | { |
8690e634 | 25204 | if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) |
c971b7fa | 25205 | { |
8690e634 JK |
25206 | const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ |
25207 | mbstate_t state; | |
25208 | wchar_t wc; | |
25209 | ||
25210 | memset (&state, '\0', sizeof (mbstate_t)); | |
25211 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
25212 | if (mbsinit (&state)) | |
c0c3707f CB |
25213 | return 2; |
25214 | } | |
25215 | return 0; | |
25216 | } | |
25217 | _ACEOF | |
25218 | if ac_fn_c_try_run "$LINENO"; then : | |
25219 | gl_cv_func_mbrtowc_incomplete_state=yes | |
25220 | else | |
25221 | gl_cv_func_mbrtowc_incomplete_state=no | |
25222 | fi | |
25223 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25224 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25225 | fi | |
25226 | ||
25227 | else | |
25228 | if test $LOCALE_FR_UTF8 != none; then | |
25229 | if test "$cross_compiling" = yes; then : | |
25230 | : | |
25231 | else | |
25232 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25233 | /* end confdefs.h. */ | |
25234 | ||
25235 | #include <locale.h> | |
25236 | #include <string.h> | |
c0c3707f CB |
25237 | #include <wchar.h> |
25238 | int main () | |
25239 | { | |
25240 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
25241 | { | |
25242 | const char input[] = "B\303\274\303\237er"; /* "Büßer" */ | |
25243 | mbstate_t state; | |
25244 | wchar_t wc; | |
25245 | ||
25246 | memset (&state, '\0', sizeof (mbstate_t)); | |
25247 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
25248 | if (mbsinit (&state)) | |
25249 | return 2; | |
c971b7fa | 25250 | } |
c971b7fa PA |
25251 | return 0; |
25252 | } | |
25253 | _ACEOF | |
25254 | if ac_fn_c_try_run "$LINENO"; then : | |
8690e634 | 25255 | gl_cv_func_mbrtowc_incomplete_state=yes |
c971b7fa | 25256 | else |
8690e634 | 25257 | gl_cv_func_mbrtowc_incomplete_state=no |
c971b7fa PA |
25258 | fi |
25259 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25260 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25261 | fi | |
25262 | ||
c0c3707f | 25263 | fi |
8690e634 | 25264 | fi |
c971b7fa PA |
25265 | |
25266 | fi | |
8690e634 JK |
25267 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 |
25268 | $as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } | |
c971b7fa PA |
25269 | |
25270 | ||
c971b7fa PA |
25271 | |
25272 | ||
8690e634 JK |
25273 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 |
25274 | $as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } | |
d0ac1c44 | 25275 | if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then : |
c971b7fa PA |
25276 | $as_echo_n "(cached) " >&6 |
25277 | else | |
8690e634 JK |
25278 | |
25279 | case "$host_os" in | |
25280 | # Guess no on Solaris 8. | |
25281 | solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; | |
25282 | # Guess yes otherwise. | |
25283 | *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; | |
25284 | esac | |
25285 | if test $LOCALE_ZH_CN != none; then | |
25286 | if test "$cross_compiling" = yes; then : | |
25287 | : | |
25288 | else | |
c971b7fa PA |
25289 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
25290 | /* end confdefs.h. */ | |
8690e634 JK |
25291 | |
25292 | #include <locale.h> | |
25293 | #include <stdlib.h> | |
25294 | #include <string.h> | |
8690e634 JK |
25295 | #include <wchar.h> |
25296 | int main () | |
c971b7fa | 25297 | { |
8690e634 JK |
25298 | /* This fails on Solaris 8: |
25299 | mbrtowc returns 2, and sets wc to 0x00F0. | |
25300 | mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ | |
25301 | if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) | |
25302 | { | |
25303 | char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ | |
25304 | mbstate_t state; | |
25305 | wchar_t wc; | |
25306 | ||
25307 | memset (&state, '\0', sizeof (mbstate_t)); | |
25308 | if (mbrtowc (&wc, input + 3, 6, &state) != 4 | |
25309 | && mbtowc (&wc, input + 3, 6) == 4) | |
c0c3707f | 25310 | return 2; |
8690e634 | 25311 | } |
c971b7fa PA |
25312 | return 0; |
25313 | } | |
25314 | _ACEOF | |
8690e634 JK |
25315 | if ac_fn_c_try_run "$LINENO"; then : |
25316 | gl_cv_func_mbrtowc_sanitycheck=yes | |
c971b7fa | 25317 | else |
8690e634 | 25318 | gl_cv_func_mbrtowc_sanitycheck=no |
c971b7fa | 25319 | fi |
8690e634 JK |
25320 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
25321 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c971b7fa | 25322 | fi |
c971b7fa | 25323 | |
8690e634 JK |
25324 | fi |
25325 | ||
25326 | fi | |
25327 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 | |
25328 | $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } | |
c971b7fa | 25329 | |
8690e634 JK |
25330 | REPLACE_MBSTATE_T=0 |
25331 | case "$gl_cv_func_mbrtowc_incomplete_state" in | |
25332 | *yes) ;; | |
25333 | *) REPLACE_MBSTATE_T=1 ;; | |
25334 | esac | |
25335 | case "$gl_cv_func_mbrtowc_sanitycheck" in | |
25336 | *yes) ;; | |
25337 | *) REPLACE_MBSTATE_T=1 ;; | |
25338 | esac | |
25339 | else | |
25340 | REPLACE_MBSTATE_T=1 | |
c971b7fa PA |
25341 | fi |
25342 | ||
c971b7fa | 25343 | |
8690e634 | 25344 | |
6ec2e0f5 SDJ |
25345 | if test $ac_cv_func_mbsrtowcs = no; then |
25346 | HAVE_MBSRTOWCS=0 | |
25347 | ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" " | |
9c9d63b1 | 25348 | #include <wchar.h> |
8690e634 JK |
25349 | |
25350 | " | |
d0ac1c44 | 25351 | if test "x$ac_cv_have_decl_mbsrtowcs" = xyes; then : |
8690e634 JK |
25352 | ac_have_decl=1 |
25353 | else | |
25354 | ac_have_decl=0 | |
c971b7fa | 25355 | fi |
c971b7fa | 25356 | |
8690e634 | 25357 | cat >>confdefs.h <<_ACEOF |
6ec2e0f5 | 25358 | #define HAVE_DECL_MBSRTOWCS $ac_have_decl |
c971b7fa | 25359 | _ACEOF |
c971b7fa | 25360 | |
6ec2e0f5 SDJ |
25361 | if test $ac_cv_have_decl_mbsrtowcs = yes; then |
25362 | REPLACE_MBSRTOWCS=1 | |
8690e634 JK |
25363 | fi |
25364 | else | |
25365 | if test $REPLACE_MBSTATE_T = 1; then | |
6ec2e0f5 | 25366 | REPLACE_MBSRTOWCS=1 |
8690e634 | 25367 | else |
6ec2e0f5 SDJ |
25368 | |
25369 | ||
25370 | ||
25371 | ||
25372 | ||
25373 | ||
25374 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5 | |
25375 | $as_echo_n "checking whether mbsrtowcs works... " >&6; } | |
d0ac1c44 | 25376 | if ${gl_cv_func_mbsrtowcs_works+:} false; then : |
6ec2e0f5 SDJ |
25377 | $as_echo_n "(cached) " >&6 |
25378 | else | |
25379 | ||
25380 | case "$host_os" in | |
25381 | # Guess no on HP-UX, Solaris, mingw. | |
25382 | hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;; | |
25383 | # Guess yes otherwise. | |
25384 | *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; | |
25385 | esac | |
25386 | if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then | |
25387 | if test "$cross_compiling" = yes; then : | |
25388 | : | |
25389 | else | |
25390 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25391 | /* end confdefs.h. */ | |
25392 | ||
25393 | #include <locale.h> | |
25394 | #include <string.h> | |
6ec2e0f5 SDJ |
25395 | #include <wchar.h> |
25396 | int main () | |
25397 | { | |
25398 | int result = 0; | |
25399 | /* Test whether the function supports a NULL destination argument. | |
25400 | This fails on native Windows. */ | |
25401 | if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) | |
25402 | { | |
25403 | const char input[] = "\337er"; | |
25404 | const char *src = input; | |
25405 | mbstate_t state; | |
25406 | ||
25407 | memset (&state, '\0', sizeof (mbstate_t)); | |
25408 | if (mbsrtowcs (NULL, &src, 1, &state) != 3 | |
25409 | || src != input) | |
25410 | result |= 1; | |
25411 | } | |
25412 | /* Test whether the function works when started with a conversion state | |
25413 | in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ | |
25414 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
25415 | { | |
25416 | const char input[] = "B\303\274\303\237er"; | |
25417 | mbstate_t state; | |
25418 | ||
25419 | memset (&state, '\0', sizeof (mbstate_t)); | |
25420 | if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) | |
25421 | if (!mbsinit (&state)) | |
25422 | { | |
25423 | const char *src = input + 2; | |
25424 | if (mbsrtowcs (NULL, &src, 10, &state) != 4) | |
25425 | result |= 2; | |
25426 | } | |
25427 | } | |
25428 | if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) | |
25429 | { | |
25430 | const char input[] = "<\306\374\313\334\270\354>"; | |
25431 | mbstate_t state; | |
25432 | ||
25433 | memset (&state, '\0', sizeof (mbstate_t)); | |
25434 | if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) | |
25435 | if (!mbsinit (&state)) | |
25436 | { | |
25437 | const char *src = input + 4; | |
25438 | if (mbsrtowcs (NULL, &src, 10, &state) != 3) | |
25439 | result |= 4; | |
25440 | } | |
25441 | } | |
25442 | if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) | |
25443 | { | |
25444 | const char input[] = "B\250\271\201\060\211\070er"; | |
25445 | mbstate_t state; | |
25446 | ||
25447 | memset (&state, '\0', sizeof (mbstate_t)); | |
25448 | if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) | |
25449 | if (!mbsinit (&state)) | |
25450 | { | |
25451 | const char *src = input + 2; | |
25452 | if (mbsrtowcs (NULL, &src, 10, &state) != 4) | |
25453 | result |= 8; | |
25454 | } | |
25455 | } | |
25456 | return result; | |
25457 | } | |
25458 | _ACEOF | |
25459 | if ac_fn_c_try_run "$LINENO"; then : | |
25460 | gl_cv_func_mbsrtowcs_works=yes | |
25461 | else | |
25462 | gl_cv_func_mbsrtowcs_works=no | |
25463 | fi | |
25464 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25465 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25466 | fi | |
25467 | ||
25468 | fi | |
25469 | ||
25470 | fi | |
25471 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5 | |
25472 | $as_echo "$gl_cv_func_mbsrtowcs_works" >&6; } | |
25473 | ||
25474 | case "$gl_cv_func_mbsrtowcs_works" in | |
25475 | *yes) ;; | |
25476 | *) REPLACE_MBSRTOWCS=1 ;; | |
8690e634 JK |
25477 | esac |
25478 | fi | |
25479 | fi | |
c971b7fa | 25480 | |
6ec2e0f5 | 25481 | if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then |
c971b7fa PA |
25482 | |
25483 | ||
25484 | ||
25485 | ||
25486 | ||
25487 | ||
25488 | ||
25489 | ||
698be2d8 CB |
25490 | gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext" |
25491 | ||
25492 | ||
25493 | ||
25494 | ||
25495 | ||
25496 | ||
25497 | ||
25498 | ||
25499 | ||
25500 | gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext" | |
25501 | ||
25502 | ||
25503 | : | |
25504 | ||
25505 | fi | |
25506 | ||
25507 | ||
25508 | ||
25509 | ||
25510 | ||
25511 | GNULIB_MBSRTOWCS=1 | |
25512 | ||
25513 | ||
25514 | ||
25515 | ||
25516 | ||
25517 | $as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h | |
25518 | ||
25519 | ||
25520 | ||
25521 | ||
25522 | ||
25523 | ||
25524 | for ac_func in mbtowc | |
25525 | do : | |
25526 | ac_fn_c_check_func "$LINENO" "mbtowc" "ac_cv_func_mbtowc" | |
25527 | if test "x$ac_cv_func_mbtowc" = xyes; then : | |
25528 | cat >>confdefs.h <<_ACEOF | |
25529 | #define HAVE_MBTOWC 1 | |
25530 | _ACEOF | |
25531 | ||
25532 | fi | |
25533 | done | |
25534 | ||
25535 | if test $ac_cv_func_mbtowc = no; then | |
25536 | HAVE_MBTOWC=0 | |
25537 | else | |
25538 | if false; then | |
25539 | REPLACE_MBTOWC=1 | |
25540 | fi | |
25541 | fi | |
6ec2e0f5 | 25542 | |
698be2d8 | 25543 | if test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1; then |
6ec2e0f5 SDJ |
25544 | |
25545 | ||
25546 | ||
25547 | ||
25548 | ||
25549 | ||
25550 | ||
25551 | ||
698be2d8 | 25552 | gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext" |
c971b7fa PA |
25553 | |
25554 | ||
8690e634 | 25555 | : |
c971b7fa | 25556 | |
a512b375 | 25557 | fi |
c971b7fa | 25558 | |
c971b7fa | 25559 | |
c971b7fa | 25560 | |
c971b7fa PA |
25561 | |
25562 | ||
698be2d8 | 25563 | GNULIB_MBTOWC=1 |
c971b7fa | 25564 | |
c971b7fa PA |
25565 | |
25566 | ||
25567 | ||
25568 | ||
698be2d8 | 25569 | $as_echo "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h |
c971b7fa PA |
25570 | |
25571 | ||
c971b7fa | 25572 | |
c971b7fa | 25573 | |
9c9d63b1 | 25574 | if test $REPLACE_MEMCHR = 1; then |
c971b7fa PA |
25575 | |
25576 | ||
25577 | ||
c971b7fa | 25578 | |
c971b7fa PA |
25579 | |
25580 | ||
25581 | ||
25582 | ||
6ec2e0f5 | 25583 | gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext" |
8690e634 | 25584 | |
c971b7fa | 25585 | |
6ec2e0f5 SDJ |
25586 | for ac_header in bp-sym.h |
25587 | do : | |
25588 | ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default" | |
d0ac1c44 | 25589 | if test "x$ac_cv_header_bp_sym_h" = xyes; then : |
6ec2e0f5 SDJ |
25590 | cat >>confdefs.h <<_ACEOF |
25591 | #define HAVE_BP_SYM_H 1 | |
25592 | _ACEOF | |
c971b7fa | 25593 | |
6ec2e0f5 | 25594 | fi |
c971b7fa | 25595 | |
6ec2e0f5 SDJ |
25596 | done |
25597 | ||
25598 | ||
25599 | fi | |
25600 | ||
25601 | ||
25602 | ||
25603 | ||
25604 | ||
25605 | GNULIB_MEMCHR=1 | |
25606 | ||
25607 | ||
25608 | ||
25609 | ||
25610 | ||
25611 | $as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h | |
25612 | ||
25613 | ||
25614 | ||
25615 | ||
25616 | ||
25617 | if test $HAVE_DECL_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then | |
25618 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works in linear time" >&5 | |
25619 | $as_echo_n "checking whether memmem works in linear time... " >&6; } | |
d0ac1c44 | 25620 | if ${gl_cv_func_memmem_works_fast+:} false; then : |
8690e634 JK |
25621 | $as_echo_n "(cached) " >&6 |
25622 | else | |
6ec2e0f5 SDJ |
25623 | if test "$cross_compiling" = yes; then : |
25624 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25625 | /* end confdefs.h. */ | |
25626 | ||
25627 | #include <features.h> | |
25628 | #ifdef __GNU_LIBRARY__ | |
25629 | #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)) \ | |
25630 | && !defined __UCLIBC__ | |
25631 | Lucky user | |
25632 | #endif | |
25633 | #endif | |
25634 | #ifdef __CYGWIN__ | |
25635 | #include <cygwin/version.h> | |
25636 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 0) | |
25637 | Lucky user | |
25638 | #endif | |
25639 | #endif | |
25640 | ||
25641 | _ACEOF | |
25642 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
25643 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
25644 | gl_cv_func_memmem_works_fast="guessing yes" | |
25645 | else | |
c0c3707f | 25646 | gl_cv_func_memmem_works_fast="$gl_cross_guess_normal" |
6ec2e0f5 SDJ |
25647 | fi |
25648 | rm -f conftest* | |
25649 | ||
c971b7fa | 25650 | |
8690e634 JK |
25651 | else |
25652 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c971b7fa | 25653 | /* end confdefs.h. */ |
c971b7fa | 25654 | |
6ec2e0f5 SDJ |
25655 | #include <signal.h> /* for signal */ |
25656 | #include <string.h> /* for memmem */ | |
25657 | #include <stdlib.h> /* for malloc */ | |
25658 | #include <unistd.h> /* for alarm */ | |
25659 | static void quit (int sig) { _exit (sig + 128); } | |
25660 | ||
25661 | int | |
25662 | main () | |
8690e634 | 25663 | { |
8690e634 | 25664 | |
6ec2e0f5 SDJ |
25665 | int result = 0; |
25666 | size_t m = 1000000; | |
25667 | char *haystack = (char *) malloc (2 * m + 1); | |
25668 | char *needle = (char *) malloc (m + 1); | |
25669 | /* Failure to compile this test due to missing alarm is okay, | |
25670 | since all such platforms (mingw) also lack memmem. */ | |
25671 | signal (SIGALRM, quit); | |
25672 | alarm (5); | |
25673 | /* Check for quadratic performance. */ | |
25674 | if (haystack && needle) | |
25675 | { | |
25676 | memset (haystack, 'A', 2 * m); | |
25677 | haystack[2 * m] = 'B'; | |
25678 | memset (needle, 'A', m); | |
25679 | needle[m] = 'B'; | |
25680 | if (!memmem (haystack, 2 * m + 1, needle, m + 1)) | |
25681 | result |= 1; | |
25682 | } | |
c0c3707f CB |
25683 | /* Free allocated memory, in case some sanitizer is watching. */ |
25684 | free (haystack); | |
25685 | free (needle); | |
6ec2e0f5 SDJ |
25686 | return result; |
25687 | ||
25688 | ; | |
c971b7fa PA |
25689 | return 0; |
25690 | } | |
25691 | _ACEOF | |
8690e634 | 25692 | if ac_fn_c_try_run "$LINENO"; then : |
6ec2e0f5 | 25693 | gl_cv_func_memmem_works_fast=yes |
8690e634 | 25694 | else |
6ec2e0f5 | 25695 | gl_cv_func_memmem_works_fast=no |
8690e634 JK |
25696 | fi |
25697 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25698 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c971b7fa | 25699 | fi |
c971b7fa PA |
25700 | |
25701 | ||
8690e634 | 25702 | fi |
6ec2e0f5 SDJ |
25703 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_fast" >&5 |
25704 | $as_echo "$gl_cv_func_memmem_works_fast" >&6; } | |
25705 | case "$gl_cv_func_memmem_works_fast" in | |
25706 | *yes) ;; | |
25707 | *) | |
25708 | REPLACE_MEMMEM=1 | |
25709 | ;; | |
25710 | esac | |
25711 | fi | |
c971b7fa | 25712 | |
6ec2e0f5 | 25713 | if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then |
8690e634 JK |
25714 | |
25715 | ||
25716 | ||
6ec2e0f5 SDJ |
25717 | |
25718 | ||
25719 | ||
25720 | ||
25721 | ||
25722 | gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext" | |
25723 | ||
25724 | fi | |
25725 | ||
25726 | ||
25727 | ||
25728 | ||
25729 | for ac_func in memmem | |
25730 | do : | |
25731 | ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem" | |
d0ac1c44 | 25732 | if test "x$ac_cv_func_memmem" = xyes; then : |
6ec2e0f5 SDJ |
25733 | cat >>confdefs.h <<_ACEOF |
25734 | #define HAVE_MEMMEM 1 | |
25735 | _ACEOF | |
25736 | ||
25737 | fi | |
25738 | done | |
25739 | ||
25740 | if test $ac_cv_func_memmem = yes; then | |
25741 | HAVE_MEMMEM=1 | |
25742 | else | |
25743 | HAVE_MEMMEM=0 | |
25744 | fi | |
25745 | ||
25746 | if test $ac_cv_have_decl_memmem = no; then | |
25747 | HAVE_DECL_MEMMEM=0 | |
25748 | else | |
25749 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5 | |
25750 | $as_echo_n "checking whether memmem works... " >&6; } | |
d0ac1c44 | 25751 | if ${gl_cv_func_memmem_works_always+:} false; then : |
c971b7fa PA |
25752 | $as_echo_n "(cached) " >&6 |
25753 | else | |
6ec2e0f5 SDJ |
25754 | if test "$cross_compiling" = yes; then : |
25755 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25756 | /* end confdefs.h. */ | |
25757 | ||
25758 | #ifdef __GNU_LIBRARY__ | |
25759 | #include <features.h> | |
25760 | #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \ | |
25761 | || __GLIBC_MINOR__ > 12)) \ | |
25762 | || (__GLIBC__ > 2)) \ | |
25763 | || defined __UCLIBC__ | |
25764 | Lucky user | |
25765 | #endif | |
25766 | #elif defined __CYGWIN__ | |
25767 | #include <cygwin/version.h> | |
25768 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) | |
25769 | Lucky user | |
25770 | #endif | |
25771 | #else | |
25772 | Lucky user | |
25773 | #endif | |
25774 | ||
25775 | _ACEOF | |
25776 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
25777 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
25778 | gl_cv_func_memmem_works_always="guessing yes" | |
25779 | else | |
c0c3707f | 25780 | gl_cv_func_memmem_works_always="$gl_cross_guess_normal" |
6ec2e0f5 SDJ |
25781 | fi |
25782 | rm -f conftest* | |
25783 | ||
8690e634 | 25784 | |
8690e634 | 25785 | else |
c971b7fa PA |
25786 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
25787 | /* end confdefs.h. */ | |
c971b7fa | 25788 | |
6ec2e0f5 SDJ |
25789 | #include <string.h> /* for memmem */ |
25790 | #define P "_EF_BF_BD" | |
25791 | #define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P | |
25792 | #define NEEDLE P P P P P | |
25793 | ||
25794 | int | |
25795 | main () | |
c971b7fa | 25796 | { |
8690e634 | 25797 | |
6ec2e0f5 SDJ |
25798 | int result = 0; |
25799 | if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE))) | |
25800 | result |= 1; | |
25801 | /* Check for empty needle behavior. */ | |
25802 | { | |
25803 | const char *haystack = "AAA"; | |
698be2d8 | 25804 | if (memmem (haystack, 3, (const char *) 1, 0) != haystack) |
6ec2e0f5 | 25805 | result |= 2; |
8690e634 | 25806 | } |
6ec2e0f5 SDJ |
25807 | return result; |
25808 | ||
25809 | ; | |
c971b7fa PA |
25810 | return 0; |
25811 | } | |
25812 | _ACEOF | |
8690e634 | 25813 | if ac_fn_c_try_run "$LINENO"; then : |
6ec2e0f5 | 25814 | gl_cv_func_memmem_works_always=yes |
c971b7fa | 25815 | else |
6ec2e0f5 | 25816 | gl_cv_func_memmem_works_always=no |
c971b7fa | 25817 | fi |
8690e634 JK |
25818 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
25819 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c971b7fa | 25820 | fi |
8690e634 | 25821 | |
8690e634 JK |
25822 | |
25823 | fi | |
6ec2e0f5 SDJ |
25824 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5 |
25825 | $as_echo "$gl_cv_func_memmem_works_always" >&6; } | |
25826 | case "$gl_cv_func_memmem_works_always" in | |
8690e634 | 25827 | *yes) ;; |
6ec2e0f5 SDJ |
25828 | *) |
25829 | REPLACE_MEMMEM=1 | |
25830 | ;; | |
8690e634 | 25831 | esac |
c971b7fa | 25832 | fi |
6ec2e0f5 | 25833 | : |
c971b7fa | 25834 | |
6ec2e0f5 | 25835 | if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then |
c971b7fa | 25836 | |
c971b7fa | 25837 | |
8690e634 | 25838 | |
c971b7fa | 25839 | |
6ec2e0f5 SDJ |
25840 | |
25841 | ||
25842 | ||
25843 | ||
25844 | gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext" | |
25845 | ||
25846 | fi | |
25847 | ||
25848 | ||
25849 | ||
25850 | ||
25851 | ||
25852 | GNULIB_MEMMEM=1 | |
25853 | ||
25854 | ||
25855 | ||
25856 | ||
25857 | ||
25858 | $as_echo "#define GNULIB_TEST_MEMMEM 1" >>confdefs.h | |
25859 | ||
25860 | ||
25861 | ||
25862 | ||
25863 | ||
25864 | ||
25865 | ||
25866 | ||
25867 | ||
25868 | for ac_func in mempcpy | |
25869 | do : | |
25870 | ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy" | |
d0ac1c44 | 25871 | if test "x$ac_cv_func_mempcpy" = xyes; then : |
6ec2e0f5 SDJ |
25872 | cat >>confdefs.h <<_ACEOF |
25873 | #define HAVE_MEMPCPY 1 | |
8690e634 | 25874 | _ACEOF |
c971b7fa | 25875 | |
6ec2e0f5 SDJ |
25876 | fi |
25877 | done | |
c971b7fa | 25878 | |
6ec2e0f5 SDJ |
25879 | if test $ac_cv_func_mempcpy = no; then |
25880 | HAVE_MEMPCPY=0 | |
25881 | fi | |
8690e634 | 25882 | |
6ec2e0f5 | 25883 | if test $HAVE_MEMPCPY = 0; then |
8690e634 JK |
25884 | |
25885 | ||
25886 | ||
25887 | ||
8690e634 | 25888 | |
6ec2e0f5 SDJ |
25889 | |
25890 | ||
25891 | ||
25892 | gl_LIBOBJS="$gl_LIBOBJS mempcpy.$ac_objext" | |
25893 | ||
25894 | ||
8690e634 | 25895 | : |
c971b7fa | 25896 | |
6ec2e0f5 | 25897 | fi |
c971b7fa | 25898 | |
8690e634 | 25899 | |
8690e634 | 25900 | |
8690e634 | 25901 | |
6ec2e0f5 SDJ |
25902 | |
25903 | GNULIB_MEMPCPY=1 | |
25904 | ||
25905 | ||
25906 | ||
25907 | ||
25908 | ||
25909 | $as_echo "#define GNULIB_TEST_MEMPCPY 1" >>confdefs.h | |
25910 | ||
25911 | ||
25912 | ||
25913 | ||
25914 | ||
25915 | ||
25916 | ||
25917 | ||
25918 | if test $ac_cv_have_decl_memrchr = no; then | |
25919 | HAVE_DECL_MEMRCHR=0 | |
25920 | fi | |
25921 | ||
25922 | for ac_func in memrchr | |
25923 | do : | |
25924 | ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr" | |
d0ac1c44 | 25925 | if test "x$ac_cv_func_memrchr" = xyes; then : |
6ec2e0f5 SDJ |
25926 | cat >>confdefs.h <<_ACEOF |
25927 | #define HAVE_MEMRCHR 1 | |
c971b7fa | 25928 | _ACEOF |
6ec2e0f5 | 25929 | |
c971b7fa | 25930 | fi |
6ec2e0f5 | 25931 | done |
8690e634 | 25932 | |
8690e634 | 25933 | |
6ec2e0f5 | 25934 | if test $ac_cv_func_memrchr = no; then |
8690e634 | 25935 | |
6ec2e0f5 SDJ |
25936 | |
25937 | ||
25938 | ||
25939 | ||
25940 | ||
25941 | ||
25942 | ||
25943 | gl_LIBOBJS="$gl_LIBOBJS memrchr.$ac_objext" | |
25944 | ||
25945 | : | |
c971b7fa PA |
25946 | fi |
25947 | ||
25948 | ||
c971b7fa | 25949 | |
c971b7fa | 25950 | |
c971b7fa | 25951 | |
6ec2e0f5 SDJ |
25952 | GNULIB_MEMRCHR=1 |
25953 | ||
25954 | ||
25955 | ||
25956 | ||
25957 | ||
25958 | $as_echo "#define GNULIB_TEST_MEMRCHR 1" >>confdefs.h | |
25959 | ||
25960 | ||
25961 | ||
25962 | ||
2d8adcbd | 25963 | |
698be2d8 CB |
25964 | |
25965 | ||
25966 | ||
8a99096f SM |
25967 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing slash" >&5 |
25968 | $as_echo_n "checking whether mkdir handles trailing slash... " >&6; } | |
25969 | if ${gl_cv_func_mkdir_trailing_slash_works+:} false; then : | |
25970 | $as_echo_n "(cached) " >&6 | |
25971 | else | |
25972 | rm -rf conftest.dir | |
9c9d63b1 | 25973 | if test "$cross_compiling" = yes; then : |
8a99096f | 25974 | case "$host_os" in |
9c9d63b1 PM |
25975 | # Guess yes on Linux systems. |
25976 | linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; | |
25977 | # Guess yes on glibc systems. | |
25978 | *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; | |
25979 | # Guess yes on MSVC, no on mingw. | |
25980 | mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f CB |
25981 | /* end confdefs.h. */ |
25982 | ||
25983 | #ifdef _MSC_VER | |
25984 | Known | |
25985 | #endif | |
25986 | ||
25987 | _ACEOF | |
25988 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
25989 | $EGREP "Known" >/dev/null 2>&1; then : | |
25990 | gl_cv_func_mkdir_trailing_slash_works="guessing yes" | |
25991 | else | |
25992 | gl_cv_func_mkdir_trailing_slash_works="guessing no" | |
25993 | fi | |
25994 | rm -f conftest* | |
25995 | ||
9c9d63b1 PM |
25996 | ;; |
25997 | # If we don't know, obey --enable-cross-guesses. | |
25998 | *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;; | |
25999 | esac | |
8a99096f SM |
26000 | |
26001 | else | |
26002 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26003 | /* end confdefs.h. */ | |
26004 | ||
9c9d63b1 PM |
26005 | #include <sys/types.h> |
26006 | #include <sys/stat.h> | |
26007 | ||
26008 | ||
26009 | $gl_mda_defines | |
8a99096f SM |
26010 | |
26011 | int | |
26012 | main () | |
26013 | { | |
26014 | return mkdir ("conftest.dir/", 0700); | |
26015 | ; | |
26016 | return 0; | |
26017 | } | |
26018 | _ACEOF | |
26019 | if ac_fn_c_try_run "$LINENO"; then : | |
26020 | gl_cv_func_mkdir_trailing_slash_works=yes | |
26021 | else | |
26022 | gl_cv_func_mkdir_trailing_slash_works=no | |
26023 | fi | |
26024 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
26025 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
26026 | fi | |
26027 | ||
9c9d63b1 | 26028 | rm -rf conftest.dir |
8a99096f SM |
26029 | |
26030 | fi | |
26031 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_slash_works" >&5 | |
26032 | $as_echo "$gl_cv_func_mkdir_trailing_slash_works" >&6; } | |
26033 | case "$gl_cv_func_mkdir_trailing_slash_works" in | |
26034 | *yes) ;; | |
26035 | *) | |
26036 | REPLACE_MKDIR=1 | |
26037 | ;; | |
26038 | esac | |
26039 | ||
26040 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing dot" >&5 | |
26041 | $as_echo_n "checking whether mkdir handles trailing dot... " >&6; } | |
26042 | if ${gl_cv_func_mkdir_trailing_dot_works+:} false; then : | |
26043 | $as_echo_n "(cached) " >&6 | |
26044 | else | |
26045 | rm -rf conftest.dir | |
9c9d63b1 | 26046 | if test "$cross_compiling" = yes; then : |
8a99096f | 26047 | case "$host_os" in |
9c9d63b1 PM |
26048 | # Guess yes on glibc systems. |
26049 | *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;; | |
26050 | # Guess yes on musl systems. | |
26051 | *-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;; | |
26052 | # Guess no on native Windows. | |
26053 | mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;; | |
26054 | # If we don't know, obey --enable-cross-guesses. | |
26055 | *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;; | |
26056 | esac | |
8a99096f SM |
26057 | |
26058 | else | |
26059 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26060 | /* end confdefs.h. */ | |
26061 | ||
9c9d63b1 PM |
26062 | #include <sys/types.h> |
26063 | #include <sys/stat.h> | |
26064 | ||
26065 | ||
26066 | $gl_mda_defines | |
8a99096f SM |
26067 | |
26068 | int | |
26069 | main () | |
26070 | { | |
26071 | return !mkdir ("conftest.dir/./", 0700); | |
26072 | ; | |
26073 | return 0; | |
26074 | } | |
26075 | _ACEOF | |
26076 | if ac_fn_c_try_run "$LINENO"; then : | |
26077 | gl_cv_func_mkdir_trailing_dot_works=yes | |
26078 | else | |
26079 | gl_cv_func_mkdir_trailing_dot_works=no | |
26080 | fi | |
26081 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
26082 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
26083 | fi | |
26084 | ||
9c9d63b1 | 26085 | rm -rf conftest.dir |
8a99096f SM |
26086 | |
26087 | ||
26088 | fi | |
26089 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_dot_works" >&5 | |
26090 | $as_echo "$gl_cv_func_mkdir_trailing_dot_works" >&6; } | |
26091 | case "$gl_cv_func_mkdir_trailing_dot_works" in | |
26092 | *yes) ;; | |
26093 | *) | |
26094 | REPLACE_MKDIR=1 | |
26095 | ||
26096 | $as_echo "#define FUNC_MKDIR_DOT_BUG 1" >>confdefs.h | |
26097 | ||
26098 | ;; | |
26099 | esac | |
26100 | ||
26101 | if test $REPLACE_MKDIR = 1; then | |
26102 | ||
26103 | ||
26104 | ||
26105 | ||
26106 | ||
26107 | ||
26108 | ||
26109 | ||
26110 | gl_LIBOBJS="$gl_LIBOBJS mkdir.$ac_objext" | |
26111 | ||
26112 | fi | |
26113 | ||
26114 | ||
9c9d63b1 PM |
26115 | |
26116 | ||
26117 | ||
26118 | GNULIB_MKDIR=1 | |
26119 | ||
26120 | ||
26121 | ||
26122 | ||
26123 | ||
26124 | $as_echo "#define GNULIB_TEST_MKDIR 1" >>confdefs.h | |
26125 | ||
26126 | ||
26127 | ||
26128 | ||
26129 | ||
e8d8cce6 SM |
26130 | for ac_func in mkdtemp |
26131 | do : | |
26132 | ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp" | |
26133 | if test "x$ac_cv_func_mkdtemp" = xyes; then : | |
26134 | cat >>confdefs.h <<_ACEOF | |
26135 | #define HAVE_MKDTEMP 1 | |
26136 | _ACEOF | |
26137 | ||
26138 | fi | |
26139 | done | |
26140 | ||
26141 | if test $ac_cv_func_mkdtemp = no; then | |
26142 | HAVE_MKDTEMP=0 | |
26143 | fi | |
26144 | ||
26145 | if test $HAVE_MKDTEMP = 0; then | |
26146 | ||
26147 | ||
26148 | ||
26149 | ||
26150 | ||
26151 | ||
26152 | ||
26153 | ||
26154 | gl_LIBOBJS="$gl_LIBOBJS mkdtemp.$ac_objext" | |
26155 | ||
26156 | : | |
26157 | ||
26158 | fi | |
26159 | ||
26160 | ||
26161 | ||
26162 | ||
26163 | ||
26164 | GNULIB_MKDTEMP=1 | |
26165 | ||
26166 | ||
26167 | ||
26168 | ||
26169 | ||
26170 | $as_echo "#define GNULIB_TEST_MKDTEMP 1" >>confdefs.h | |
26171 | ||
26172 | ||
26173 | ||
26174 | ||
26175 | ||
2d8adcbd MM |
26176 | |
26177 | ||
b3279b60 TT |
26178 | |
26179 | ||
b3279b60 TT |
26180 | if test $ac_cv_func_mkostemp != yes; then |
26181 | HAVE_MKOSTEMP=0 | |
26182 | fi | |
2d8adcbd | 26183 | |
b3279b60 | 26184 | if test $HAVE_MKOSTEMP = 0; then |
2d8adcbd | 26185 | |
2d8adcbd | 26186 | |
2d8adcbd | 26187 | |
2d8adcbd | 26188 | |
2d8adcbd MM |
26189 | |
26190 | ||
26191 | ||
26192 | ||
b3279b60 | 26193 | gl_LIBOBJS="$gl_LIBOBJS mkostemp.$ac_objext" |
2d8adcbd MM |
26194 | |
26195 | ||
26196 | ||
b3279b60 | 26197 | fi |
2d8adcbd | 26198 | |
2d8adcbd | 26199 | |
b3279b60 TT |
26200 | cat >>confdefs.h <<_ACEOF |
26201 | #define GNULIB_MKOSTEMP 1 | |
26202 | _ACEOF | |
2d8adcbd MM |
26203 | |
26204 | ||
2d8adcbd MM |
26205 | |
26206 | ||
26207 | ||
26208 | ||
26209 | ||
b3279b60 | 26210 | GNULIB_MKOSTEMP=1 |
2d8adcbd MM |
26211 | |
26212 | ||
26213 | ||
26214 | ||
26215 | ||
b3279b60 | 26216 | $as_echo "#define GNULIB_TEST_MKOSTEMP 1" >>confdefs.h |
2d8adcbd MM |
26217 | |
26218 | ||
26219 | ||
26220 | ||
6ec2e0f5 SDJ |
26221 | if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then |
26222 | ||
26223 | ||
26224 | ||
c971b7fa | 26225 | |
c971b7fa | 26226 | |
c971b7fa PA |
26227 | |
26228 | ||
8690e634 | 26229 | |
6ec2e0f5 | 26230 | gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext" |
8690e634 | 26231 | |
6ec2e0f5 | 26232 | fi |
8690e634 | 26233 | |
6ec2e0f5 | 26234 | if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then |
8690e634 JK |
26235 | |
26236 | ||
26237 | ||
26238 | ||
26239 | ||
26240 | ||
8690e634 JK |
26241 | |
26242 | ||
6ec2e0f5 | 26243 | gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext" |
8690e634 | 26244 | |
a512b375 | 26245 | fi |
8690e634 JK |
26246 | |
26247 | ||
c0c3707f CB |
26248 | cat >>confdefs.h <<_ACEOF |
26249 | #define GNULIB_MSVC_NOTHROW 1 | |
26250 | _ACEOF | |
26251 | ||
26252 | ||
26253 | ||
26254 | ||
725e2999 JB |
26255 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5 |
26256 | $as_echo_n "checking whether <netinet/in.h> is self-contained... " >&6; } | |
26257 | if ${gl_cv_header_netinet_in_h_selfcontained+:} false; then : | |
26258 | $as_echo_n "(cached) " >&6 | |
26259 | else | |
26260 | ||
26261 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26262 | /* end confdefs.h. */ | |
26263 | #include <netinet/in.h> | |
26264 | int | |
26265 | main () | |
26266 | { | |
26267 | ||
26268 | ; | |
26269 | return 0; | |
26270 | } | |
26271 | _ACEOF | |
26272 | if ac_fn_c_try_compile "$LINENO"; then : | |
26273 | gl_cv_header_netinet_in_h_selfcontained=yes | |
26274 | else | |
26275 | gl_cv_header_netinet_in_h_selfcontained=no | |
26276 | fi | |
26277 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
26278 | ||
26279 | fi | |
26280 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5 | |
26281 | $as_echo "$gl_cv_header_netinet_in_h_selfcontained" >&6; } | |
26282 | if test $gl_cv_header_netinet_in_h_selfcontained = yes; then | |
26283 | NETINET_IN_H='' | |
26284 | else | |
26285 | NETINET_IN_H='netinet/in.h' | |
26286 | for ac_header in netinet/in.h | |
26287 | do : | |
26288 | ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" | |
26289 | if test "x$ac_cv_header_netinet_in_h" = xyes; then : | |
26290 | cat >>confdefs.h <<_ACEOF | |
26291 | #define HAVE_NETINET_IN_H 1 | |
26292 | _ACEOF | |
26293 | ||
26294 | fi | |
26295 | ||
26296 | done | |
26297 | ||
26298 | ||
26299 | ||
26300 | ||
26301 | ||
26302 | ||
26303 | ||
725e2999 JB |
26304 | |
26305 | ||
26306 | ||
26307 | if test $gl_cv_have_include_next = yes; then | |
26308 | gl_cv_next_netinet_in_h='<'netinet/in.h'>' | |
26309 | else | |
26310 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5 | |
26311 | $as_echo_n "checking absolute name of <netinet/in.h>... " >&6; } | |
26312 | if ${gl_cv_next_netinet_in_h+:} false; then : | |
26313 | $as_echo_n "(cached) " >&6 | |
26314 | else | |
26315 | ||
26316 | if test $ac_cv_header_netinet_in_h = yes; then | |
26317 | ||
26318 | ||
26319 | ||
26320 | ||
26321 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26322 | /* end confdefs.h. */ | |
26323 | #include <netinet/in.h> | |
26324 | _ACEOF | |
26325 | case "$host_os" in | |
26326 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
26327 | *) gl_absname_cpp="$ac_cpp" ;; | |
26328 | esac | |
26329 | ||
26330 | case "$host_os" in | |
26331 | mingw*) | |
26332 | gl_dirsep_regex='[/\\]' | |
26333 | ;; | |
26334 | *) | |
26335 | gl_dirsep_regex='\/' | |
26336 | ;; | |
26337 | esac | |
26338 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
26339 | gl_header_literal_regex=`echo 'netinet/in.h' \ | |
26340 | | sed -e "$gl_make_literal_regex_sed"` | |
26341 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
26342 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
26343 | s|^/[^/]|//&| | |
26344 | p | |
26345 | q | |
26346 | }' | |
26347 | ||
26348 | gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
26349 | sed -n "$gl_absolute_header_sed"` | |
26350 | ||
26351 | gl_header=$gl_cv_absolute_netinet_in_h | |
26352 | gl_cv_next_netinet_in_h='"'$gl_header'"' | |
26353 | else | |
26354 | gl_cv_next_netinet_in_h='<'netinet/in.h'>' | |
26355 | fi | |
26356 | ||
26357 | ||
26358 | fi | |
26359 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5 | |
26360 | $as_echo "$gl_cv_next_netinet_in_h" >&6; } | |
26361 | fi | |
26362 | NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h | |
26363 | ||
26364 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
26365 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
26366 | gl_next_as_first_directive='<'netinet/in.h'>' | |
26367 | else | |
26368 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
26369 | gl_next_as_first_directive=$gl_cv_next_netinet_in_h | |
26370 | fi | |
26371 | NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive | |
26372 | ||
26373 | ||
26374 | ||
26375 | ||
26376 | if test $ac_cv_header_netinet_in_h = yes; then | |
26377 | HAVE_NETINET_IN_H=1 | |
26378 | else | |
26379 | HAVE_NETINET_IN_H=0 | |
26380 | fi | |
26381 | ||
26382 | fi | |
26383 | ||
26384 | if test -n "$NETINET_IN_H"; then | |
26385 | GL_GENERATE_NETINET_IN_H_TRUE= | |
26386 | GL_GENERATE_NETINET_IN_H_FALSE='#' | |
26387 | else | |
26388 | GL_GENERATE_NETINET_IN_H_TRUE='#' | |
26389 | GL_GENERATE_NETINET_IN_H_FALSE= | |
26390 | fi | |
26391 | ||
26392 | ||
26393 | ||
26394 | ||
8690e634 | 26395 | |
c0c3707f | 26396 | |
6ec2e0f5 SDJ |
26397 | case "$host_os" in |
26398 | mingw* | pw*) | |
26399 | REPLACE_OPEN=1 | |
26400 | ;; | |
26401 | *) | |
26402 | ||
c0c3707f CB |
26403 | if test "$gl_cv_macro_O_CLOEXEC" != yes; then |
26404 | REPLACE_OPEN=1 | |
26405 | fi | |
472fa5ee SM |
26406 | |
26407 | ||
c0c3707f | 26408 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5 |
6ec2e0f5 | 26409 | $as_echo_n "checking whether open recognizes a trailing slash... " >&6; } |
d0ac1c44 | 26410 | if ${gl_cv_func_open_slash+:} false; then : |
6ec2e0f5 SDJ |
26411 | $as_echo_n "(cached) " >&6 |
26412 | else | |
26413 | # Assume that if we have lstat, we can also check symlinks. | |
c0c3707f CB |
26414 | if test $ac_cv_func_lstat = yes; then |
26415 | touch conftest.tmp | |
26416 | ln -s conftest.tmp conftest.lnk | |
26417 | fi | |
26418 | if test "$cross_compiling" = yes; then : | |
8690e634 | 26419 | |
c0c3707f CB |
26420 | case "$host_os" in |
26421 | freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) | |
26422 | gl_cv_func_open_slash="guessing no" ;; | |
26423 | *) | |
26424 | gl_cv_func_open_slash="guessing yes" ;; | |
26425 | esac | |
8690e634 | 26426 | |
6ec2e0f5 SDJ |
26427 | else |
26428 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26429 | /* end confdefs.h. */ | |
26430 | ||
26431 | #include <fcntl.h> | |
26432 | #if HAVE_UNISTD_H | |
26433 | # include <unistd.h> | |
26434 | #endif | |
9c9d63b1 PM |
26435 | |
26436 | ||
26437 | $gl_mda_defines | |
26438 | ||
6ec2e0f5 SDJ |
26439 | int main () |
26440 | { | |
26441 | int result = 0; | |
26442 | #if HAVE_LSTAT | |
26443 | if (open ("conftest.lnk/", O_RDONLY) != -1) | |
26444 | result |= 1; | |
26445 | #endif | |
26446 | if (open ("conftest.sl/", O_CREAT, 0600) >= 0) | |
26447 | result |= 2; | |
26448 | return result; | |
26449 | } | |
26450 | _ACEOF | |
26451 | if ac_fn_c_try_run "$LINENO"; then : | |
26452 | gl_cv_func_open_slash=yes | |
26453 | else | |
26454 | gl_cv_func_open_slash=no | |
26455 | fi | |
26456 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
26457 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
26458 | fi | |
8690e634 | 26459 | |
c0c3707f | 26460 | rm -f conftest.sl conftest.tmp conftest.lnk |
8690e634 | 26461 | |
6ec2e0f5 SDJ |
26462 | fi |
26463 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5 | |
26464 | $as_echo "$gl_cv_func_open_slash" >&6; } | |
c0c3707f CB |
26465 | case "$gl_cv_func_open_slash" in |
26466 | *no) | |
8690e634 | 26467 | |
6ec2e0f5 | 26468 | $as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h |
8690e634 | 26469 | |
6ec2e0f5 SDJ |
26470 | ;; |
26471 | esac | |
8690e634 | 26472 | |
c0c3707f CB |
26473 | case "$gl_cv_func_open_slash" in |
26474 | *no) | |
26475 | REPLACE_OPEN=1 | |
26476 | ;; | |
26477 | esac | |
26478 | ;; | |
26479 | esac | |
472fa5ee | 26480 | |
c0c3707f | 26481 | if test $REPLACE_OPEN = 0; then |
472fa5ee SM |
26482 | |
26483 | ||
26484 | ||
6ec2e0f5 SDJ |
26485 | if test $ac_cv_func_fchdir = no; then |
26486 | HAVE_FCHDIR=0 | |
26487 | fi | |
c971b7fa | 26488 | |
6ec2e0f5 SDJ |
26489 | if test $HAVE_FCHDIR = 0; then |
26490 | REPLACE_OPEN=1 | |
26491 | fi | |
26492 | fi | |
c971b7fa PA |
26493 | |
26494 | ||
26495 | ||
6ec2e0f5 | 26496 | if test $REPLACE_OPEN = 1; then |
c971b7fa PA |
26497 | |
26498 | ||
26499 | ||
26500 | ||
26501 | ||
c971b7fa PA |
26502 | |
26503 | ||
c971b7fa | 26504 | |
6ec2e0f5 | 26505 | gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" |
c971b7fa | 26506 | |
c971b7fa PA |
26507 | |
26508 | ||
6ec2e0f5 SDJ |
26509 | : |
26510 | ||
a512b375 | 26511 | fi |
c971b7fa PA |
26512 | |
26513 | ||
26514 | ||
26515 | ||
26516 | ||
6ec2e0f5 | 26517 | GNULIB_OPEN=1 |
c971b7fa PA |
26518 | |
26519 | ||
26520 | ||
26521 | ||
26522 | ||
6ec2e0f5 | 26523 | $as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h |
c971b7fa PA |
26524 | |
26525 | ||
26526 | ||
26527 | ||
26528 | ||
c971b7fa | 26529 | |
c971b7fa | 26530 | |
472fa5ee | 26531 | |
63ce7108 | 26532 | |
c0c3707f CB |
26533 | case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in |
26534 | yes+*yes+yes) | |
6ec2e0f5 SDJ |
26535 | ;; |
26536 | yes+*) | |
c0c3707f | 26537 | # Solaris 10 lacks O_CLOEXEC. |
6ec2e0f5 SDJ |
26538 | # Solaris 9 has *at functions, but uniformly mishandles trailing |
26539 | # slash in all of them. | |
26540 | REPLACE_OPENAT=1 | |
26541 | ;; | |
26542 | *) | |
26543 | HAVE_OPENAT=0 | |
26544 | ;; | |
26545 | esac | |
63ce7108 | 26546 | |
6ec2e0f5 | 26547 | if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then |
63ce7108 | 26548 | |
63ce7108 | 26549 | |
63ce7108 | 26550 | |
63ce7108 | 26551 | |
63ce7108 TT |
26552 | |
26553 | ||
63ce7108 | 26554 | |
63ce7108 | 26555 | |
6ec2e0f5 | 26556 | gl_LIBOBJS="$gl_LIBOBJS openat.$ac_objext" |
63ce7108 TT |
26557 | |
26558 | ||
26559 | ||
6ec2e0f5 | 26560 | : |
63ce7108 | 26561 | |
6ec2e0f5 | 26562 | fi |
63ce7108 TT |
26563 | |
26564 | ||
6ec2e0f5 SDJ |
26565 | cat >>confdefs.h <<_ACEOF |
26566 | #define GNULIB_OPENAT 1 | |
26567 | _ACEOF | |
63ce7108 | 26568 | |
63ce7108 | 26569 | |
63ce7108 TT |
26570 | |
26571 | ||
26572 | ||
26573 | ||
6ec2e0f5 | 26574 | GNULIB_OPENAT=1 |
63ce7108 | 26575 | |
63ce7108 | 26576 | |
63ce7108 | 26577 | |
63ce7108 | 26578 | |
63ce7108 | 26579 | |
6ec2e0f5 | 26580 | $as_echo "#define GNULIB_TEST_OPENAT 1" >>confdefs.h |
63ce7108 TT |
26581 | |
26582 | ||
63ce7108 | 26583 | |
63ce7108 | 26584 | |
63ce7108 | 26585 | |
63ce7108 | 26586 | |
6ec2e0f5 SDJ |
26587 | for ac_func in opendir |
26588 | do : | |
26589 | ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir" | |
d0ac1c44 | 26590 | if test "x$ac_cv_func_opendir" = xyes; then : |
6ec2e0f5 SDJ |
26591 | cat >>confdefs.h <<_ACEOF |
26592 | #define HAVE_OPENDIR 1 | |
63ce7108 | 26593 | _ACEOF |
6ec2e0f5 | 26594 | |
63ce7108 | 26595 | fi |
6ec2e0f5 | 26596 | done |
63ce7108 | 26597 | |
6ec2e0f5 SDJ |
26598 | if test $ac_cv_func_opendir = no; then |
26599 | HAVE_OPENDIR=0 | |
26600 | fi | |
63ce7108 | 26601 | |
6ec2e0f5 SDJ |
26602 | |
26603 | ||
26604 | ||
26605 | if test $ac_cv_func_fchdir = no; then | |
26606 | HAVE_FCHDIR=0 | |
63ce7108 | 26607 | fi |
63ce7108 | 26608 | |
6ec2e0f5 SDJ |
26609 | if test $HAVE_FCHDIR = 0; then |
26610 | if test $HAVE_OPENDIR = 1; then | |
26611 | REPLACE_OPENDIR=1 | |
26612 | fi | |
26613 | fi | |
26614 | ||
26615 | case $host_os,$HAVE_OPENDIR in | |
26616 | os2*,1) | |
26617 | REPLACE_OPENDIR=1;; | |
26618 | esac | |
26619 | ||
26620 | if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then | |
63ce7108 TT |
26621 | |
26622 | ||
26623 | ||
26624 | ||
26625 | ||
26626 | ||
26627 | ||
26628 | ||
6ec2e0f5 | 26629 | gl_LIBOBJS="$gl_LIBOBJS opendir.$ac_objext" |
63ce7108 TT |
26630 | |
26631 | fi | |
26632 | ||
26633 | ||
26634 | ||
26635 | ||
26636 | ||
6ec2e0f5 | 26637 | GNULIB_OPENDIR=1 |
63ce7108 TT |
26638 | |
26639 | ||
26640 | ||
26641 | ||
63ce7108 | 26642 | |
6ec2e0f5 | 26643 | $as_echo "#define GNULIB_TEST_OPENDIR 1" >>confdefs.h |
63ce7108 TT |
26644 | |
26645 | ||
26646 | ||
26647 | ||
26648 | ||
26649 | ||
26650 | ||
2196f55f YQ |
26651 | |
26652 | ||
8424cc97 | 26653 | |
9c9d63b1 PM |
26654 | if test $ac_cv_func_pipe != yes; then |
26655 | HAVE_PIPE=0 | |
26656 | fi | |
26657 | ||
26658 | if test $HAVE_PIPE = 0; then | |
26659 | ||
26660 | ||
26661 | ||
26662 | ||
26663 | ||
26664 | ||
26665 | ||
26666 | ||
26667 | gl_LIBOBJS="$gl_LIBOBJS pipe.$ac_objext" | |
26668 | ||
26669 | fi | |
26670 | ||
26671 | ||
26672 | ||
26673 | ||
26674 | ||
26675 | GNULIB_PIPE=1 | |
26676 | ||
26677 | ||
26678 | ||
26679 | ||
26680 | ||
26681 | $as_echo "#define GNULIB_TEST_PIPE 1" >>confdefs.h | |
26682 | ||
26683 | ||
26684 | ||
26685 | ||
26686 | ||
26687 | ||
26688 | ||
8424cc97 SM |
26689 | for ac_func in rawmemchr |
26690 | do : | |
26691 | ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr" | |
d0ac1c44 | 26692 | if test "x$ac_cv_func_rawmemchr" = xyes; then : |
8424cc97 SM |
26693 | cat >>confdefs.h <<_ACEOF |
26694 | #define HAVE_RAWMEMCHR 1 | |
26695 | _ACEOF | |
26696 | ||
26697 | fi | |
26698 | done | |
26699 | ||
26700 | if test $ac_cv_func_rawmemchr = no; then | |
26701 | HAVE_RAWMEMCHR=0 | |
26702 | fi | |
26703 | ||
26704 | if test $HAVE_RAWMEMCHR = 0; then | |
26705 | ||
26706 | ||
26707 | ||
26708 | ||
26709 | ||
26710 | ||
26711 | ||
26712 | ||
26713 | gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext" | |
26714 | ||
26715 | : | |
26716 | fi | |
26717 | ||
26718 | ||
26719 | ||
26720 | ||
26721 | ||
26722 | GNULIB_RAWMEMCHR=1 | |
26723 | ||
26724 | ||
26725 | ||
26726 | ||
26727 | ||
26728 | $as_echo "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h | |
26729 | ||
26730 | ||
26731 | ||
26732 | ||
26733 | ||
26734 | ||
6ec2e0f5 SDJ |
26735 | for ac_func in readdir |
26736 | do : | |
26737 | ac_fn_c_check_func "$LINENO" "readdir" "ac_cv_func_readdir" | |
d0ac1c44 | 26738 | if test "x$ac_cv_func_readdir" = xyes; then : |
6ec2e0f5 SDJ |
26739 | cat >>confdefs.h <<_ACEOF |
26740 | #define HAVE_READDIR 1 | |
26741 | _ACEOF | |
26742 | ||
26743 | fi | |
26744 | done | |
26745 | ||
26746 | if test $ac_cv_func_readdir = no; then | |
26747 | HAVE_READDIR=0 | |
26748 | fi | |
26749 | ||
26750 | if test $HAVE_READDIR = 0; then | |
26751 | ||
26752 | ||
26753 | ||
26754 | ||
26755 | ||
26756 | ||
26757 | ||
26758 | ||
26759 | gl_LIBOBJS="$gl_LIBOBJS readdir.$ac_objext" | |
26760 | ||
26761 | fi | |
26762 | ||
26763 | ||
26764 | ||
26765 | ||
26766 | ||
26767 | GNULIB_READDIR=1 | |
26768 | ||
26769 | ||
26770 | ||
26771 | ||
26772 | ||
26773 | $as_echo "#define GNULIB_TEST_READDIR 1" >>confdefs.h | |
26774 | ||
26775 | ||
26776 | ||
26777 | ||
26778 | ||
26779 | ||
2196f55f YQ |
26780 | if test $ac_cv_func_readlink = no; then |
26781 | HAVE_READLINK=0 | |
26782 | else | |
26783 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5 | |
26784 | $as_echo_n "checking whether readlink signature is correct... " >&6; } | |
d0ac1c44 | 26785 | if ${gl_cv_decl_readlink_works+:} false; then : |
2196f55f YQ |
26786 | $as_echo_n "(cached) " >&6 |
26787 | else | |
26788 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26789 | /* end confdefs.h. */ | |
26790 | #include <unistd.h> | |
26791 | /* Cause compilation failure if original declaration has wrong type. */ | |
26792 | ssize_t readlink (const char *, char *, size_t); | |
26793 | int | |
26794 | main () | |
26795 | { | |
26796 | ||
26797 | ; | |
26798 | return 0; | |
26799 | } | |
26800 | _ACEOF | |
26801 | if ac_fn_c_try_compile "$LINENO"; then : | |
26802 | gl_cv_decl_readlink_works=yes | |
26803 | else | |
26804 | gl_cv_decl_readlink_works=no | |
26805 | fi | |
26806 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
26807 | fi | |
26808 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5 | |
26809 | $as_echo "$gl_cv_decl_readlink_works" >&6; } | |
26810 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5 | |
26811 | $as_echo_n "checking whether readlink handles trailing slash correctly... " >&6; } | |
9c9d63b1 | 26812 | if ${gl_cv_func_readlink_trailing_slash+:} false; then : |
2196f55f YQ |
26813 | $as_echo_n "(cached) " >&6 |
26814 | else | |
26815 | # We have readlink, so assume ln -s works. | |
26816 | ln -s conftest.no-such conftest.link | |
26817 | ln -s conftest.link conftest.lnk2 | |
26818 | if test "$cross_compiling" = yes; then : | |
26819 | case "$host_os" in | |
9c9d63b1 PM |
26820 | # Guess yes on Linux or glibc systems. |
26821 | linux-* | linux | *-gnu* | gnu*) | |
26822 | gl_cv_func_readlink_trailing_slash="guessing yes" ;; | |
26823 | # Guess no on AIX or HP-UX. | |
26824 | aix* | hpux*) | |
26825 | gl_cv_func_readlink_trailing_slash="guessing no" ;; | |
26826 | # If we don't know, obey --enable-cross-guesses. | |
26827 | *) | |
26828 | gl_cv_func_readlink_trailing_slash="$gl_cross_guess_normal" ;; | |
2196f55f YQ |
26829 | esac |
26830 | ||
26831 | else | |
26832 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26833 | /* end confdefs.h. */ | |
26834 | #include <unistd.h> | |
26835 | ||
26836 | int | |
26837 | main () | |
26838 | { | |
26839 | char buf[20]; | |
26840 | return readlink ("conftest.lnk2/", buf, sizeof buf) != -1; | |
26841 | ; | |
26842 | return 0; | |
26843 | } | |
26844 | _ACEOF | |
26845 | if ac_fn_c_try_run "$LINENO"; then : | |
9c9d63b1 | 26846 | gl_cv_func_readlink_trailing_slash=yes |
2196f55f | 26847 | else |
9c9d63b1 | 26848 | gl_cv_func_readlink_trailing_slash=no |
2196f55f YQ |
26849 | fi |
26850 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
26851 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
26852 | fi | |
26853 | ||
26854 | rm -f conftest.link conftest.lnk2 | |
26855 | fi | |
9c9d63b1 PM |
26856 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_trailing_slash" >&5 |
26857 | $as_echo "$gl_cv_func_readlink_trailing_slash" >&6; } | |
26858 | case "$gl_cv_func_readlink_trailing_slash" in | |
2196f55f YQ |
26859 | *yes) |
26860 | if test "$gl_cv_decl_readlink_works" != yes; then | |
26861 | REPLACE_READLINK=1 | |
26862 | fi | |
26863 | ;; | |
26864 | *) | |
26865 | ||
26866 | $as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h | |
26867 | ||
26868 | REPLACE_READLINK=1 | |
26869 | ;; | |
26870 | esac | |
9c9d63b1 PM |
26871 | |
26872 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink truncates results correctly" >&5 | |
26873 | $as_echo_n "checking whether readlink truncates results correctly... " >&6; } | |
26874 | if ${gl_cv_func_readlink_truncate+:} false; then : | |
26875 | $as_echo_n "(cached) " >&6 | |
26876 | else | |
26877 | # We have readlink, so assume ln -s works. | |
26878 | ln -s ab conftest.link | |
26879 | if test "$cross_compiling" = yes; then : | |
26880 | case "$host_os" in | |
26881 | # Guess yes on Linux or glibc systems. | |
26882 | linux-* | linux | *-gnu* | gnu*) | |
26883 | gl_cv_func_readlink_truncate="guessing yes" ;; | |
26884 | # Guess no on AIX or HP-UX. | |
26885 | aix* | hpux*) | |
26886 | gl_cv_func_readlink_truncate="guessing no" ;; | |
26887 | # If we don't know, obey --enable-cross-guesses. | |
26888 | *) | |
26889 | gl_cv_func_readlink_truncate="$gl_cross_guess_normal" ;; | |
26890 | esac | |
26891 | ||
26892 | else | |
26893 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26894 | /* end confdefs.h. */ | |
26895 | #include <unistd.h> | |
26896 | ||
26897 | int | |
26898 | main () | |
26899 | { | |
26900 | char c; | |
26901 | return readlink ("conftest.link", &c, 1) != 1; | |
26902 | ; | |
26903 | return 0; | |
26904 | } | |
26905 | _ACEOF | |
26906 | if ac_fn_c_try_run "$LINENO"; then : | |
26907 | gl_cv_func_readlink_truncate=yes | |
26908 | else | |
26909 | gl_cv_func_readlink_truncate=no | |
26910 | fi | |
26911 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
26912 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
26913 | fi | |
26914 | ||
26915 | rm -f conftest.link conftest.lnk2 | |
26916 | fi | |
26917 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_truncate" >&5 | |
26918 | $as_echo "$gl_cv_func_readlink_truncate" >&6; } | |
26919 | case $gl_cv_func_readlink_truncate in | |
26920 | *yes) | |
26921 | if test "$gl_cv_decl_readlink_works" != yes; then | |
26922 | REPLACE_READLINK=1 | |
26923 | fi | |
26924 | ;; | |
26925 | *) | |
26926 | ||
26927 | $as_echo "#define READLINK_TRUNCATE_BUG 1" >>confdefs.h | |
26928 | ||
26929 | REPLACE_READLINK=1 | |
26930 | ;; | |
26931 | esac | |
2196f55f YQ |
26932 | fi |
26933 | ||
26934 | if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then | |
26935 | ||
26936 | ||
26937 | ||
26938 | ||
26939 | ||
26940 | ||
26941 | ||
26942 | ||
26943 | gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext" | |
26944 | ||
26945 | ||
26946 | : | |
26947 | ||
26948 | fi | |
26949 | ||
26950 | ||
26951 | ||
26952 | ||
26953 | ||
26954 | GNULIB_READLINK=1 | |
26955 | ||
26956 | ||
26957 | ||
26958 | ||
26959 | ||
26960 | $as_echo "#define GNULIB_TEST_READLINK 1" >>confdefs.h | |
26961 | ||
26962 | ||
26963 | ||
26964 | ||
6a29c58e YQ |
26965 | |
26966 | ||
6ec2e0f5 SDJ |
26967 | if test $gl_cv_func_malloc_posix = yes; then |
26968 | ||
26969 | $as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h | |
26970 | ||
26971 | else | |
26972 | REPLACE_REALLOC=1 | |
26973 | fi | |
26974 | ||
26975 | if test $REPLACE_REALLOC = 1; then | |
26976 | ||
26977 | ||
26978 | ||
26979 | ||
26980 | ||
26981 | ||
26982 | ||
26983 | ||
26984 | gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext" | |
26985 | ||
26986 | fi | |
26987 | ||
26988 | ||
26989 | ||
26990 | ||
26991 | ||
26992 | GNULIB_REALLOC_POSIX=1 | |
26993 | ||
26994 | ||
26995 | ||
26996 | ||
26997 | ||
26998 | $as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h | |
26999 | ||
27000 | ||
27001 | ||
27002 | ||
27003 | ||
27004 | ||
6a29c58e YQ |
27005 | |
27006 | ||
27007 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on destination" >&5 | |
27008 | $as_echo_n "checking whether rename honors trailing slash on destination... " >&6; } | |
d0ac1c44 | 27009 | if ${gl_cv_func_rename_slash_dst_works+:} false; then : |
6a29c58e YQ |
27010 | $as_echo_n "(cached) " >&6 |
27011 | else | |
27012 | rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk | |
27013 | touch conftest.f && touch conftest.f1 && mkdir conftest.d1 || | |
d0ac1c44 | 27014 | as_fn_error $? "cannot create temporary files" "$LINENO" 5 |
6a29c58e YQ |
27015 | # Assume that if we have lstat, we can also check symlinks. |
27016 | if test $ac_cv_func_lstat = yes; then | |
27017 | ln -s conftest.f conftest.lnk | |
27018 | fi | |
27019 | if test "$cross_compiling" = yes; then : | |
27020 | case "$host_os" in | |
c0c3707f CB |
27021 | # Guess yes on Linux systems. |
27022 | linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;; | |
27023 | # Guess yes on glibc systems. | |
27024 | *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;; | |
27025 | # Guess no on native Windows. | |
27026 | mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;; | |
27027 | # If we don't know, obey --enable-cross-guesses. | |
27028 | *) gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;; | |
6a29c58e YQ |
27029 | esac |
27030 | ||
27031 | else | |
27032 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27033 | /* end confdefs.h. */ | |
27034 | ||
27035 | # include <stdio.h> | |
27036 | # include <stdlib.h> | |
27037 | ||
27038 | int | |
27039 | main () | |
27040 | { | |
27041 | int result = 0; | |
27042 | if (rename ("conftest.f1", "conftest.f2/") == 0) | |
27043 | result |= 1; | |
27044 | if (rename ("conftest.d1", "conftest.d2/") != 0) | |
27045 | result |= 2; | |
27046 | #if HAVE_LSTAT | |
27047 | if (rename ("conftest.f", "conftest.lnk/") == 0) | |
27048 | result |= 4; | |
27049 | #endif | |
27050 | return result; | |
27051 | ||
27052 | ; | |
27053 | return 0; | |
27054 | } | |
27055 | _ACEOF | |
27056 | if ac_fn_c_try_run "$LINENO"; then : | |
27057 | gl_cv_func_rename_slash_dst_works=yes | |
27058 | else | |
27059 | gl_cv_func_rename_slash_dst_works=no | |
27060 | fi | |
27061 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
27062 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
27063 | fi | |
27064 | ||
27065 | rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk | |
27066 | ||
27067 | fi | |
27068 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_dst_works" >&5 | |
27069 | $as_echo "$gl_cv_func_rename_slash_dst_works" >&6; } | |
27070 | case "$gl_cv_func_rename_slash_dst_works" in | |
27071 | *yes) ;; | |
27072 | *) | |
27073 | REPLACE_RENAME=1 | |
27074 | ||
27075 | $as_echo "#define RENAME_TRAILING_SLASH_DEST_BUG 1" >>confdefs.h | |
27076 | ||
27077 | ;; | |
27078 | esac | |
27079 | ||
27080 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on source" >&5 | |
27081 | $as_echo_n "checking whether rename honors trailing slash on source... " >&6; } | |
d0ac1c44 | 27082 | if ${gl_cv_func_rename_slash_src_works+:} false; then : |
6a29c58e YQ |
27083 | $as_echo_n "(cached) " >&6 |
27084 | else | |
27085 | rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk | |
27086 | touch conftest.f && touch conftest.f1 && mkdir conftest.d1 || | |
d0ac1c44 | 27087 | as_fn_error $? "cannot create temporary files" "$LINENO" 5 |
6a29c58e YQ |
27088 | # Assume that if we have lstat, we can also check symlinks. |
27089 | if test $ac_cv_func_lstat = yes; then | |
27090 | ln -s conftest.f conftest.lnk | |
27091 | fi | |
27092 | if test "$cross_compiling" = yes; then : | |
27093 | case "$host_os" in | |
c0c3707f CB |
27094 | # Guess yes on Linux systems. |
27095 | linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;; | |
27096 | # Guess yes on glibc systems. | |
27097 | *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;; | |
27098 | # Guess yes on native Windows. | |
27099 | mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;; | |
27100 | # If we don't know, obey --enable-cross-guesses. | |
27101 | *) gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;; | |
6a29c58e YQ |
27102 | esac |
27103 | ||
27104 | else | |
27105 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27106 | /* end confdefs.h. */ | |
27107 | ||
27108 | # include <stdio.h> | |
27109 | # include <stdlib.h> | |
27110 | ||
27111 | int | |
27112 | main () | |
27113 | { | |
27114 | int result = 0; | |
27115 | if (rename ("conftest.f1/", "conftest.d3") == 0) | |
27116 | result |= 1; | |
27117 | if (rename ("conftest.d1/", "conftest.d2") != 0) | |
27118 | result |= 2; | |
27119 | #if HAVE_LSTAT | |
27120 | if (rename ("conftest.lnk/", "conftest.f") == 0) | |
27121 | result |= 4; | |
27122 | #endif | |
27123 | return result; | |
27124 | ||
27125 | ; | |
27126 | return 0; | |
27127 | } | |
27128 | _ACEOF | |
27129 | if ac_fn_c_try_run "$LINENO"; then : | |
27130 | gl_cv_func_rename_slash_src_works=yes | |
27131 | else | |
27132 | gl_cv_func_rename_slash_src_works=no | |
27133 | fi | |
27134 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
27135 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
27136 | fi | |
27137 | ||
27138 | rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk | |
27139 | ||
27140 | fi | |
27141 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_src_works" >&5 | |
27142 | $as_echo "$gl_cv_func_rename_slash_src_works" >&6; } | |
27143 | case "$gl_cv_func_rename_slash_src_works" in | |
27144 | *yes) ;; | |
27145 | *) | |
27146 | REPLACE_RENAME=1 | |
27147 | ||
27148 | $as_echo "#define RENAME_TRAILING_SLASH_SOURCE_BUG 1" >>confdefs.h | |
27149 | ||
27150 | ;; | |
27151 | esac | |
27152 | ||
27153 | ||
27154 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages hard links correctly" >&5 | |
27155 | $as_echo_n "checking whether rename manages hard links correctly... " >&6; } | |
d0ac1c44 | 27156 | if ${gl_cv_func_rename_link_works+:} false; then : |
6a29c58e YQ |
27157 | $as_echo_n "(cached) " >&6 |
27158 | else | |
27159 | if test $ac_cv_func_link = yes; then | |
c0c3707f CB |
27160 | if test $cross_compiling != yes; then |
27161 | rm -rf conftest.f conftest.f1 conftest.f2 | |
27162 | if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 && | |
27163 | set x `ls -i conftest.f conftest.f1` && test "" = ""; then | |
27164 | if test "$cross_compiling" = yes; then : | |
27165 | : | |
6a29c58e YQ |
27166 | |
27167 | else | |
27168 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27169 | /* end confdefs.h. */ | |
27170 | ||
c0c3707f CB |
27171 | # include <errno.h> |
27172 | # include <stdio.h> | |
27173 | # include <stdlib.h> | |
27174 | # include <unistd.h> | |
6a29c58e | 27175 | |
9c9d63b1 PM |
27176 | |
27177 | $gl_mda_defines | |
27178 | ||
6a29c58e YQ |
27179 | int |
27180 | main () | |
27181 | { | |
27182 | int result = 0; | |
c0c3707f CB |
27183 | if (rename ("conftest.f", "conftest.f1")) |
27184 | result |= 1; | |
27185 | if (unlink ("conftest.f1")) | |
27186 | result |= 2; | |
27187 | ||
27188 | /* Allow either the POSIX-required behavior, where the | |
27189 | previous rename kept conftest.f, or the (better) NetBSD | |
27190 | behavior, where it removed conftest.f. */ | |
27191 | if (rename ("conftest.f", "conftest.f") != 0 | |
27192 | && errno != ENOENT) | |
27193 | result |= 4; | |
27194 | ||
27195 | if (rename ("conftest.f1", "conftest.f1") == 0) | |
27196 | result |= 8; | |
27197 | if (rename ("conftest.f2", "conftest.f2") != 0) | |
27198 | result |= 16; | |
27199 | return result; | |
6a29c58e YQ |
27200 | |
27201 | ; | |
27202 | return 0; | |
27203 | } | |
27204 | _ACEOF | |
27205 | if ac_fn_c_try_run "$LINENO"; then : | |
27206 | gl_cv_func_rename_link_works=yes | |
27207 | else | |
27208 | gl_cv_func_rename_link_works=no | |
27209 | fi | |
27210 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
27211 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
27212 | fi | |
27213 | ||
c0c3707f CB |
27214 | else |
27215 | gl_cv_func_rename_link_works="guessing no" | |
27216 | fi | |
27217 | rm -rf conftest.f conftest.f1 conftest.f2 | |
6a29c58e | 27218 | else |
c0c3707f CB |
27219 | case "$host_os" in |
27220 | # Guess yes on Linux systems. | |
27221 | linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;; | |
27222 | # Guess yes on glibc systems. | |
27223 | *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;; | |
27224 | # Guess yes on native Windows. | |
27225 | mingw*) gl_cv_func_rename_link_works="guessing yes" ;; | |
27226 | # If we don't know, obey --enable-cross-guesses. | |
27227 | *) gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;; | |
27228 | esac | |
6a29c58e | 27229 | fi |
6a29c58e YQ |
27230 | else |
27231 | gl_cv_func_rename_link_works=yes | |
27232 | fi | |
27233 | ||
27234 | fi | |
27235 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_link_works" >&5 | |
27236 | $as_echo "$gl_cv_func_rename_link_works" >&6; } | |
27237 | case "$gl_cv_func_rename_link_works" in | |
27238 | *yes) ;; | |
27239 | *) | |
27240 | REPLACE_RENAME=1 | |
27241 | ||
27242 | $as_echo "#define RENAME_HARD_LINK_BUG 1" >>confdefs.h | |
27243 | ||
27244 | ;; | |
27245 | esac | |
27246 | ||
27247 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages existing destinations correctly" >&5 | |
27248 | $as_echo_n "checking whether rename manages existing destinations correctly... " >&6; } | |
d0ac1c44 | 27249 | if ${gl_cv_func_rename_dest_works+:} false; then : |
6a29c58e YQ |
27250 | $as_echo_n "(cached) " >&6 |
27251 | else | |
27252 | rm -rf conftest.f conftest.d1 conftest.d2 | |
27253 | touch conftest.f && mkdir conftest.d1 conftest.d2 || | |
d0ac1c44 | 27254 | as_fn_error $? "cannot create temporary files" "$LINENO" 5 |
6a29c58e YQ |
27255 | if test "$cross_compiling" = yes; then : |
27256 | case "$host_os" in | |
c0c3707f CB |
27257 | # Guess yes on Linux systems. |
27258 | linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;; | |
27259 | # Guess yes on glibc systems. | |
27260 | *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;; | |
27261 | # Guess no on native Windows. | |
27262 | mingw*) gl_cv_func_rename_dest_works="guessing no" ;; | |
27263 | # If we don't know, obey --enable-cross-guesses. | |
27264 | *) gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;; | |
6a29c58e YQ |
27265 | esac |
27266 | ||
27267 | else | |
27268 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27269 | /* end confdefs.h. */ | |
27270 | ||
27271 | # include <stdio.h> | |
27272 | # include <stdlib.h> | |
27273 | ||
27274 | int | |
27275 | main () | |
27276 | { | |
27277 | int result = 0; | |
27278 | if (rename ("conftest.d1", "conftest.d2") != 0) | |
27279 | result |= 1; | |
27280 | if (rename ("conftest.d2", "conftest.f") == 0) | |
27281 | result |= 2; | |
27282 | return result; | |
27283 | ||
27284 | ; | |
27285 | return 0; | |
27286 | } | |
27287 | _ACEOF | |
27288 | if ac_fn_c_try_run "$LINENO"; then : | |
27289 | gl_cv_func_rename_dest_works=yes | |
27290 | else | |
27291 | gl_cv_func_rename_dest_works=no | |
27292 | fi | |
27293 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
27294 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
27295 | fi | |
27296 | ||
27297 | rm -rf conftest.f conftest.d1 conftest.d2 | |
27298 | ||
27299 | fi | |
27300 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_dest_works" >&5 | |
27301 | $as_echo "$gl_cv_func_rename_dest_works" >&6; } | |
27302 | case "$gl_cv_func_rename_dest_works" in | |
27303 | *yes) ;; | |
27304 | *) | |
27305 | REPLACE_RENAME=1 | |
27306 | ||
27307 | $as_echo "#define RENAME_DEST_EXISTS_BUG 1" >>confdefs.h | |
27308 | ||
27309 | ;; | |
27310 | esac | |
27311 | ||
27312 | if test $REPLACE_RENAME = 1; then | |
27313 | ||
27314 | ||
27315 | ||
27316 | ||
27317 | ||
27318 | ||
27319 | ||
27320 | ||
27321 | gl_LIBOBJS="$gl_LIBOBJS rename.$ac_objext" | |
27322 | ||
27323 | fi | |
27324 | ||
27325 | ||
27326 | ||
27327 | ||
27328 | ||
27329 | GNULIB_RENAME=1 | |
27330 | ||
27331 | ||
27332 | ||
27333 | ||
27334 | ||
27335 | $as_echo "#define GNULIB_TEST_RENAME 1" >>confdefs.h | |
27336 | ||
27337 | ||
27338 | ||
27339 | ||
27340 | ||
27341 | ||
6ec2e0f5 SDJ |
27342 | for ac_func in rewinddir |
27343 | do : | |
27344 | ac_fn_c_check_func "$LINENO" "rewinddir" "ac_cv_func_rewinddir" | |
d0ac1c44 | 27345 | if test "x$ac_cv_func_rewinddir" = xyes; then : |
6ec2e0f5 SDJ |
27346 | cat >>confdefs.h <<_ACEOF |
27347 | #define HAVE_REWINDDIR 1 | |
27348 | _ACEOF | |
27349 | ||
27350 | fi | |
27351 | done | |
27352 | ||
27353 | if test $ac_cv_func_rewinddir = no; then | |
27354 | HAVE_REWINDDIR=0 | |
27355 | fi | |
27356 | ||
27357 | if test $HAVE_REWINDDIR = 0; then | |
27358 | ||
27359 | ||
27360 | ||
27361 | ||
27362 | ||
27363 | ||
27364 | ||
27365 | ||
27366 | gl_LIBOBJS="$gl_LIBOBJS rewinddir.$ac_objext" | |
27367 | ||
27368 | fi | |
27369 | ||
27370 | ||
27371 | ||
27372 | ||
27373 | ||
27374 | GNULIB_REWINDDIR=1 | |
27375 | ||
27376 | ||
27377 | ||
27378 | ||
27379 | ||
27380 | $as_echo "#define GNULIB_TEST_REWINDDIR 1" >>confdefs.h | |
27381 | ||
27382 | ||
27383 | ||
27384 | ||
27385 | ||
27386 | ||
6a29c58e YQ |
27387 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rmdir works" >&5 |
27388 | $as_echo_n "checking whether rmdir works... " >&6; } | |
d0ac1c44 | 27389 | if ${gl_cv_func_rmdir_works+:} false; then : |
6a29c58e YQ |
27390 | $as_echo_n "(cached) " >&6 |
27391 | else | |
27392 | mkdir conftest.dir | |
27393 | touch conftest.file | |
27394 | if test "$cross_compiling" = yes; then : | |
27395 | case "$host_os" in | |
c0c3707f CB |
27396 | # Guess yes on Linux systems. |
27397 | linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;; | |
27398 | # Guess yes on glibc systems. | |
27399 | *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;; | |
27400 | # Guess no on native Windows. | |
27401 | mingw*) gl_cv_func_rmdir_works="guessing no" ;; | |
27402 | # If we don't know, obey --enable-cross-guesses. | |
27403 | *) gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;; | |
6a29c58e YQ |
27404 | esac |
27405 | ||
27406 | else | |
27407 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27408 | /* end confdefs.h. */ | |
27409 | #include <stdio.h> | |
27410 | #include <errno.h> | |
27411 | #if HAVE_UNISTD_H | |
27412 | # include <unistd.h> | |
27413 | #else /* on Windows with MSVC */ | |
27414 | # include <direct.h> | |
27415 | #endif | |
27416 | ||
9c9d63b1 PM |
27417 | |
27418 | $gl_mda_defines | |
27419 | ||
6a29c58e YQ |
27420 | int |
27421 | main () | |
27422 | { | |
27423 | int result = 0; | |
9c9d63b1 PM |
27424 | if (!rmdir ("conftest.file/")) |
27425 | result |= 1; | |
27426 | else if (errno != ENOTDIR) | |
27427 | result |= 2; | |
27428 | if (!rmdir ("conftest.dir/./")) | |
27429 | result |= 4; | |
27430 | return result; | |
6a29c58e YQ |
27431 | |
27432 | ; | |
27433 | return 0; | |
27434 | } | |
27435 | _ACEOF | |
27436 | if ac_fn_c_try_run "$LINENO"; then : | |
27437 | gl_cv_func_rmdir_works=yes | |
27438 | else | |
27439 | gl_cv_func_rmdir_works=no | |
27440 | fi | |
27441 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
27442 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
27443 | fi | |
27444 | ||
27445 | rm -rf conftest.dir conftest.file | |
27446 | fi | |
27447 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_works" >&5 | |
27448 | $as_echo "$gl_cv_func_rmdir_works" >&6; } | |
27449 | case "$gl_cv_func_rmdir_works" in | |
27450 | *yes) ;; | |
27451 | *) | |
27452 | REPLACE_RMDIR=1 | |
27453 | ;; | |
27454 | esac | |
27455 | ||
27456 | if test $REPLACE_RMDIR = 1; then | |
27457 | ||
27458 | ||
27459 | ||
27460 | ||
27461 | ||
27462 | ||
27463 | ||
27464 | ||
27465 | gl_LIBOBJS="$gl_LIBOBJS rmdir.$ac_objext" | |
27466 | ||
27467 | fi | |
27468 | ||
27469 | ||
27470 | ||
27471 | ||
27472 | ||
27473 | GNULIB_RMDIR=1 | |
27474 | ||
27475 | ||
27476 | ||
27477 | ||
27478 | ||
27479 | $as_echo "#define GNULIB_TEST_RMDIR 1" >>confdefs.h | |
27480 | ||
27481 | ||
27482 | ||
27483 | ||
0750520d | 27484 | |
5e8754f9 SDJ |
27485 | |
27486 | ||
27487 | ||
3d99e817 AK |
27488 | if test $ac_cv_func_setenv = no; then |
27489 | HAVE_SETENV=0 | |
27490 | else | |
27491 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5 | |
27492 | $as_echo_n "checking whether setenv validates arguments... " >&6; } | |
d0ac1c44 | 27493 | if ${gl_cv_func_setenv_works+:} false; then : |
3d99e817 AK |
27494 | $as_echo_n "(cached) " >&6 |
27495 | else | |
27496 | if test "$cross_compiling" = yes; then : | |
27497 | case "$host_os" in | |
c0c3707f CB |
27498 | # Guess yes on glibc systems. |
27499 | *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;; | |
27500 | # Guess yes on musl systems. | |
27501 | *-musl*) gl_cv_func_setenv_works="guessing yes" ;; | |
27502 | # If we don't know, obey --enable-cross-guesses. | |
27503 | *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;; | |
3d99e817 AK |
27504 | esac |
27505 | ||
27506 | else | |
27507 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27508 | /* end confdefs.h. */ | |
27509 | ||
27510 | #include <stdlib.h> | |
27511 | #include <errno.h> | |
27512 | #include <string.h> | |
27513 | ||
27514 | int | |
27515 | main () | |
27516 | { | |
27517 | ||
27518 | int result = 0; | |
27519 | { | |
27520 | if (setenv ("", "", 0) != -1) | |
27521 | result |= 1; | |
27522 | else if (errno != EINVAL) | |
27523 | result |= 2; | |
27524 | } | |
27525 | { | |
27526 | if (setenv ("a", "=", 1) != 0) | |
27527 | result |= 4; | |
27528 | else if (strcmp (getenv ("a"), "=") != 0) | |
27529 | result |= 8; | |
27530 | } | |
27531 | return result; | |
27532 | ||
27533 | ; | |
27534 | return 0; | |
27535 | } | |
27536 | _ACEOF | |
27537 | if ac_fn_c_try_run "$LINENO"; then : | |
27538 | gl_cv_func_setenv_works=yes | |
27539 | else | |
27540 | gl_cv_func_setenv_works=no | |
27541 | fi | |
27542 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
27543 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
27544 | fi | |
27545 | ||
27546 | fi | |
27547 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5 | |
27548 | $as_echo "$gl_cv_func_setenv_works" >&6; } | |
27549 | case "$gl_cv_func_setenv_works" in | |
27550 | *yes) ;; | |
27551 | *) | |
27552 | REPLACE_SETENV=1 | |
27553 | ;; | |
27554 | esac | |
27555 | fi | |
27556 | ||
27557 | if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then | |
27558 | ||
27559 | ||
27560 | ||
27561 | ||
27562 | ||
27563 | ||
27564 | ||
27565 | ||
27566 | gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext" | |
27567 | ||
27568 | fi | |
27569 | ||
27570 | ||
27571 | ||
27572 | ||
27573 | ||
27574 | GNULIB_SETENV=1 | |
27575 | ||
27576 | ||
27577 | ||
27578 | ||
27579 | ||
27580 | $as_echo "#define GNULIB_TEST_SETENV 1" >>confdefs.h | |
27581 | ||
27582 | ||
27583 | ||
27584 | ||
27585 | ||
0750520d PA |
27586 | |
27587 | ||
27588 | ||
5df4cba6 SM |
27589 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5 |
27590 | $as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; } | |
27591 | if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then : | |
27592 | $as_echo_n "(cached) " >&6 | |
27593 | else | |
27594 | case "$host_os" in | |
27595 | # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin. | |
27596 | *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*) | |
27597 | gl_cv_func_setlocale_null_all_mtsafe=no ;; | |
27598 | # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows. | |
27599 | *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*) | |
27600 | gl_cv_func_setlocale_null_all_mtsafe=yes ;; | |
27601 | # If we don't know, obey --enable-cross-guesses. | |
27602 | *) | |
27603 | gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;; | |
27604 | esac | |
27605 | ||
27606 | fi | |
27607 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5 | |
27608 | $as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; } | |
27609 | case "$host_os" in | |
27610 | mingw*) ;; | |
27611 | *) | |
27612 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then | |
27613 | gl_cv_func_setlocale_null_all_mtsafe="trivially yes" | |
27614 | fi | |
27615 | ;; | |
27616 | esac | |
27617 | case "$gl_cv_func_setlocale_null_all_mtsafe" in | |
27618 | *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;; | |
27619 | *) SETLOCALE_NULL_ALL_MTSAFE=0 ;; | |
27620 | esac | |
27621 | ||
27622 | cat >>confdefs.h <<_ACEOF | |
27623 | #define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE | |
27624 | _ACEOF | |
27625 | ||
27626 | ||
27627 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5 | |
27628 | $as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; } | |
27629 | if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then : | |
27630 | $as_echo_n "(cached) " >&6 | |
27631 | else | |
27632 | case "$host_os" in | |
27633 | # Guess no on OpenBSD, AIX. | |
27634 | openbsd* | aix*) | |
27635 | gl_cv_func_setlocale_null_one_mtsafe=no ;; | |
27636 | # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows. | |
27637 | *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*) | |
27638 | gl_cv_func_setlocale_null_one_mtsafe=yes ;; | |
27639 | # If we don't know, obey --enable-cross-guesses. | |
27640 | *) | |
27641 | gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;; | |
27642 | esac | |
27643 | ||
27644 | fi | |
27645 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5 | |
27646 | $as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; } | |
27647 | case "$host_os" in | |
27648 | mingw*) ;; | |
27649 | *) | |
27650 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then | |
27651 | gl_cv_func_setlocale_null_one_mtsafe="trivially yes" | |
27652 | fi | |
27653 | ;; | |
27654 | esac | |
27655 | case "$gl_cv_func_setlocale_null_one_mtsafe" in | |
27656 | *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;; | |
27657 | *) SETLOCALE_NULL_ONE_MTSAFE=0 ;; | |
27658 | esac | |
27659 | ||
27660 | cat >>confdefs.h <<_ACEOF | |
27661 | #define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE | |
27662 | _ACEOF | |
27663 | ||
27664 | ||
27665 | if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then | |
27666 | case "$host_os" in | |
27667 | mingw*) LIB_SETLOCALE_NULL= ;; | |
27668 | *) | |
27669 | ||
27670 | ||
27671 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 | |
27672 | $as_echo_n "checking whether imported symbols can be declared weak... " >&6; } | |
27673 | if ${gl_cv_have_weak+:} false; then : | |
27674 | $as_echo_n "(cached) " >&6 | |
27675 | else | |
27676 | gl_cv_have_weak=no | |
27677 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27678 | /* end confdefs.h. */ | |
27679 | extern void xyzzy (); | |
27680 | #pragma weak xyzzy | |
27681 | int | |
27682 | main () | |
27683 | { | |
27684 | xyzzy(); | |
27685 | ; | |
27686 | return 0; | |
27687 | } | |
27688 | _ACEOF | |
27689 | if ac_fn_c_try_link "$LINENO"; then : | |
27690 | gl_cv_have_weak=maybe | |
27691 | fi | |
27692 | rm -f core conftest.err conftest.$ac_objext \ | |
27693 | conftest$ac_exeext conftest.$ac_ext | |
27694 | if test $gl_cv_have_weak = maybe; then | |
27695 | if test "$cross_compiling" = yes; then : | |
27696 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27697 | /* end confdefs.h. */ | |
27698 | #ifdef __ELF__ | |
27699 | Extensible Linking Format | |
27700 | #endif | |
27701 | ||
27702 | _ACEOF | |
27703 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
27704 | $EGREP "Extensible Linking Format" >/dev/null 2>&1; then : | |
27705 | gl_cv_have_weak="guessing yes" | |
27706 | else | |
27707 | gl_cv_have_weak="guessing no" | |
27708 | fi | |
27709 | rm -f conftest* | |
27710 | ||
27711 | ||
27712 | else | |
27713 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27714 | /* end confdefs.h. */ | |
27715 | ||
27716 | #include <stdio.h> | |
27717 | #pragma weak fputs | |
27718 | int main () | |
27719 | { | |
27720 | return (fputs == NULL); | |
27721 | } | |
27722 | _ACEOF | |
27723 | if ac_fn_c_try_run "$LINENO"; then : | |
27724 | gl_cv_have_weak=yes | |
27725 | else | |
27726 | gl_cv_have_weak=no | |
27727 | fi | |
27728 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
27729 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
27730 | fi | |
27731 | ||
27732 | fi | |
27733 | case " $LDFLAGS " in | |
27734 | *" -static "*) gl_cv_have_weak=no ;; | |
27735 | esac | |
27736 | case "$gl_cv_have_weak" in | |
27737 | *yes) | |
27738 | case "$host_os" in | |
27739 | freebsd* | dragonfly*) | |
27740 | : > conftest1.c | |
27741 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1 | |
27742 | cat <<EOF > conftest2.c | |
27743 | #include <pthread.h> | |
27744 | #pragma weak pthread_mutexattr_gettype | |
27745 | int main () | |
27746 | { | |
27747 | return (pthread_mutexattr_gettype != NULL); | |
27748 | } | |
27749 | EOF | |
27750 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \ | |
27751 | || gl_cv_have_weak=no | |
27752 | rm -f conftest1.c libempty.so conftest2.c conftest | |
27753 | ;; | |
27754 | esac | |
27755 | ;; | |
27756 | esac | |
27757 | ||
27758 | fi | |
27759 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 | |
27760 | $as_echo "$gl_cv_have_weak" >&6; } | |
27761 | case "$gl_cv_have_weak" in | |
27762 | *yes) | |
27763 | ||
27764 | $as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h | |
27765 | ||
27766 | ;; | |
27767 | esac | |
27768 | ||
27769 | case "$gl_cv_have_weak" in | |
27770 | *yes) LIB_SETLOCALE_NULL= ;; | |
27771 | *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;; | |
27772 | esac | |
27773 | ;; | |
27774 | esac | |
27775 | else | |
27776 | LIB_SETLOCALE_NULL= | |
27777 | fi | |
27778 | ||
27779 | ||
27780 | if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then | |
27781 | ||
27782 | ||
27783 | ||
27784 | ||
27785 | ||
27786 | ||
27787 | ||
27788 | ||
27789 | gl_LIBOBJS="$gl_LIBOBJS setlocale-lock.$ac_objext" | |
27790 | ||
27791 | ||
27792 | ||
27793 | ||
27794 | CFLAG_VISIBILITY= | |
27795 | HAVE_VISIBILITY=0 | |
27796 | if test -n "$GCC"; then | |
27797 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5 | |
27798 | $as_echo_n "checking whether the -Werror option is usable... " >&6; } | |
27799 | if ${gl_cv_cc_vis_werror+:} false; then : | |
27800 | $as_echo_n "(cached) " >&6 | |
27801 | else | |
27802 | gl_save_CFLAGS="$CFLAGS" | |
27803 | CFLAGS="$CFLAGS -Werror" | |
27804 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27805 | /* end confdefs.h. */ | |
27806 | ||
27807 | int | |
27808 | main () | |
27809 | { | |
27810 | ||
27811 | ; | |
27812 | return 0; | |
27813 | } | |
27814 | _ACEOF | |
27815 | if ac_fn_c_try_compile "$LINENO"; then : | |
27816 | gl_cv_cc_vis_werror=yes | |
27817 | else | |
27818 | gl_cv_cc_vis_werror=no | |
27819 | fi | |
27820 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
27821 | CFLAGS="$gl_save_CFLAGS" | |
27822 | ||
27823 | fi | |
27824 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5 | |
27825 | $as_echo "$gl_cv_cc_vis_werror" >&6; } | |
27826 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5 | |
27827 | $as_echo_n "checking for simple visibility declarations... " >&6; } | |
27828 | if ${gl_cv_cc_visibility+:} false; then : | |
27829 | $as_echo_n "(cached) " >&6 | |
27830 | else | |
27831 | gl_save_CFLAGS="$CFLAGS" | |
27832 | CFLAGS="$CFLAGS -fvisibility=hidden" | |
27833 | if test $gl_cv_cc_vis_werror = yes; then | |
27834 | CFLAGS="$CFLAGS -Werror" | |
27835 | fi | |
27836 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27837 | /* end confdefs.h. */ | |
27838 | extern __attribute__((__visibility__("hidden"))) int hiddenvar; | |
27839 | extern __attribute__((__visibility__("default"))) int exportedvar; | |
27840 | extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); | |
27841 | extern __attribute__((__visibility__("default"))) int exportedfunc (void); | |
27842 | void dummyfunc (void) {} | |
27843 | ||
27844 | int | |
27845 | main () | |
27846 | { | |
27847 | ||
27848 | ; | |
27849 | return 0; | |
27850 | } | |
27851 | _ACEOF | |
27852 | if ac_fn_c_try_compile "$LINENO"; then : | |
27853 | gl_cv_cc_visibility=yes | |
27854 | else | |
27855 | gl_cv_cc_visibility=no | |
27856 | fi | |
27857 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
27858 | CFLAGS="$gl_save_CFLAGS" | |
27859 | ||
27860 | fi | |
27861 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5 | |
27862 | $as_echo "$gl_cv_cc_visibility" >&6; } | |
27863 | if test $gl_cv_cc_visibility = yes; then | |
27864 | CFLAG_VISIBILITY="-fvisibility=hidden" | |
27865 | HAVE_VISIBILITY=1 | |
27866 | fi | |
27867 | fi | |
27868 | ||
27869 | ||
27870 | ||
27871 | cat >>confdefs.h <<_ACEOF | |
27872 | #define HAVE_VISIBILITY $HAVE_VISIBILITY | |
27873 | _ACEOF | |
27874 | ||
27875 | ||
27876 | ||
27877 | fi | |
27878 | ||
27879 | ||
27880 | ||
27881 | ||
27882 | ||
27883 | GNULIB_SETLOCALE_NULL=1 | |
27884 | ||
27885 | ||
27886 | ||
27887 | ||
27888 | ||
27889 | $as_echo "#define GNULIB_TEST_SETLOCALE_NULL 1" >>confdefs.h | |
27890 | ||
27891 | ||
27892 | ||
27893 | ||
27894 | ||
27895 | ||
27896 | ||
27897 | ||
0750520d PA |
27898 | |
27899 | ||
27900 | ||
27901 | ||
27902 | ||
27903 | ||
27904 | if test $gl_cv_have_include_next = yes; then | |
27905 | gl_cv_next_signal_h='<'signal.h'>' | |
27906 | else | |
27907 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5 | |
27908 | $as_echo_n "checking absolute name of <signal.h>... " >&6; } | |
d0ac1c44 | 27909 | if ${gl_cv_next_signal_h+:} false; then : |
0750520d PA |
27910 | $as_echo_n "(cached) " >&6 |
27911 | else | |
27912 | ||
27913 | ||
27914 | ||
27915 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27916 | /* end confdefs.h. */ | |
27917 | #include <signal.h> | |
27918 | _ACEOF | |
27919 | case "$host_os" in | |
27920 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
27921 | *) gl_absname_cpp="$ac_cpp" ;; | |
27922 | esac | |
27923 | ||
27924 | case "$host_os" in | |
27925 | mingw*) | |
27926 | gl_dirsep_regex='[/\\]' | |
27927 | ;; | |
27928 | *) | |
27929 | gl_dirsep_regex='\/' | |
27930 | ;; | |
27931 | esac | |
27932 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
27933 | gl_header_literal_regex=`echo 'signal.h' \ | |
27934 | | sed -e "$gl_make_literal_regex_sed"` | |
27935 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
27936 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
27937 | s|^/[^/]|//&| | |
27938 | p | |
27939 | q | |
27940 | }' | |
27941 | ||
27942 | gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
27943 | sed -n "$gl_absolute_header_sed"` | |
27944 | ||
27945 | gl_header=$gl_cv_absolute_signal_h | |
27946 | gl_cv_next_signal_h='"'$gl_header'"' | |
27947 | ||
27948 | ||
27949 | fi | |
27950 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5 | |
27951 | $as_echo "$gl_cv_next_signal_h" >&6; } | |
27952 | fi | |
27953 | NEXT_SIGNAL_H=$gl_cv_next_signal_h | |
27954 | ||
27955 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
27956 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
27957 | gl_next_as_first_directive='<'signal.h'>' | |
27958 | else | |
27959 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
27960 | gl_next_as_first_directive=$gl_cv_next_signal_h | |
27961 | fi | |
27962 | NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive | |
27963 | ||
27964 | ||
27965 | ||
27966 | ||
27967 | ||
27968 | # AIX declares sig_atomic_t to already include volatile, and C89 compilers | |
27969 | # then choke on 'volatile sig_atomic_t'. C99 requires that it compile. | |
27970 | ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" " | |
27971 | #include <signal.h> | |
27972 | ||
27973 | " | |
d0ac1c44 | 27974 | if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes; then : |
0750520d PA |
27975 | |
27976 | else | |
27977 | HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0 | |
27978 | fi | |
27979 | ||
27980 | ||
27981 | ||
27982 | ||
27983 | ||
27984 | ||
27985 | ||
27986 | ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" " | |
27987 | #include <signal.h> | |
27988 | ||
27989 | " | |
d0ac1c44 | 27990 | if test "x$ac_cv_type_sighandler_t" = xyes; then : |
0750520d PA |
27991 | |
27992 | else | |
27993 | HAVE_SIGHANDLER_T=0 | |
27994 | fi | |
27995 | ||
27996 | ||
27997 | ||
0750520d | 27998 | |
0750520d PA |
27999 | |
28000 | ||
698be2d8 CB |
28001 | |
28002 | ||
725e2999 JB |
28003 | ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " |
28004 | /* <sys/types.h> is not needed according to POSIX, but the | |
28005 | <sys/socket.h> in i386-unknown-freebsd4.10 and | |
28006 | powerpc-apple-darwin5.5 required it. */ | |
28007 | #include <sys/types.h> | |
28008 | #if HAVE_SYS_SOCKET_H | |
28009 | # include <sys/socket.h> | |
28010 | #elif HAVE_WS2TCPIP_H | |
28011 | # include <ws2tcpip.h> | |
28012 | #endif | |
28013 | ||
28014 | " | |
28015 | if test "x$ac_cv_type_socklen_t" = xyes; then : | |
28016 | ||
28017 | else | |
28018 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 | |
28019 | $as_echo_n "checking for socklen_t equivalent... " >&6; } | |
c0c3707f | 28020 | if ${gl_cv_socklen_t_equiv+:} false; then : |
725e2999 JB |
28021 | $as_echo_n "(cached) " >&6 |
28022 | else | |
28023 | # Systems have either "struct sockaddr *" or | |
28024 | # "void *" as the second argument to getpeername | |
28025 | gl_cv_socklen_t_equiv= | |
28026 | for arg2 in "struct sockaddr" void; do | |
28027 | for t in int size_t "unsigned int" "long int" "unsigned long int"; do | |
28028 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28029 | /* end confdefs.h. */ | |
28030 | #include <sys/types.h> | |
28031 | #include <sys/socket.h> | |
28032 | ||
28033 | int getpeername (int, $arg2 *, $t *); | |
28034 | int | |
28035 | main () | |
28036 | { | |
28037 | $t len; | |
28038 | getpeername (0, 0, &len); | |
28039 | ; | |
28040 | return 0; | |
28041 | } | |
28042 | _ACEOF | |
28043 | if ac_fn_c_try_compile "$LINENO"; then : | |
28044 | gl_cv_socklen_t_equiv="$t" | |
28045 | fi | |
28046 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
28047 | test "$gl_cv_socklen_t_equiv" != "" && break | |
28048 | done | |
28049 | test "$gl_cv_socklen_t_equiv" != "" && break | |
28050 | done | |
c0c3707f CB |
28051 | if test "$gl_cv_socklen_t_equiv" = ""; then |
28052 | as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5 | |
28053 | fi | |
725e2999 JB |
28054 | |
28055 | fi | |
c0c3707f | 28056 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5 |
725e2999 JB |
28057 | $as_echo "$gl_cv_socklen_t_equiv" >&6; } |
28058 | ||
28059 | cat >>confdefs.h <<_ACEOF | |
28060 | #define socklen_t $gl_cv_socklen_t_equiv | |
28061 | _ACEOF | |
28062 | ||
28063 | fi | |
28064 | ||
0750520d | 28065 | |
63ce7108 TT |
28066 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 |
28067 | $as_echo_n "checking for ssize_t... " >&6; } | |
d0ac1c44 | 28068 | if ${gt_cv_ssize_t+:} false; then : |
63ce7108 TT |
28069 | $as_echo_n "(cached) " >&6 |
28070 | else | |
28071 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28072 | /* end confdefs.h. */ | |
28073 | #include <sys/types.h> | |
28074 | int | |
28075 | main () | |
28076 | { | |
28077 | int x = sizeof (ssize_t *) + sizeof (ssize_t); | |
28078 | return !x; | |
28079 | ; | |
28080 | return 0; | |
28081 | } | |
28082 | _ACEOF | |
28083 | if ac_fn_c_try_compile "$LINENO"; then : | |
28084 | gt_cv_ssize_t=yes | |
28085 | else | |
28086 | gt_cv_ssize_t=no | |
28087 | fi | |
28088 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
28089 | fi | |
28090 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 | |
28091 | $as_echo "$gt_cv_ssize_t" >&6; } | |
28092 | if test $gt_cv_ssize_t = no; then | |
28093 | ||
28094 | $as_echo "#define ssize_t int" >>confdefs.h | |
28095 | ||
28096 | fi | |
28097 | ||
28098 | ||
28099 | ||
28100 | ||
472fa5ee | 28101 | |
c0c3707f CB |
28102 | case "$host_os" in |
28103 | mingw*) | |
d706b69e | 28104 | ;; |
c0c3707f CB |
28105 | *) |
28106 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 | |
28107 | $as_echo_n "checking whether stat handles trailing slashes on files... " >&6; } | |
28108 | if ${gl_cv_func_stat_file_slash+:} false; then : | |
2196f55f YQ |
28109 | $as_echo_n "(cached) " >&6 |
28110 | else | |
c0c3707f CB |
28111 | touch conftest.tmp |
28112 | # Assume that if we have lstat, we can also check symlinks. | |
28113 | if test $ac_cv_func_lstat = yes; then | |
28114 | ln -s conftest.tmp conftest.lnk | |
28115 | fi | |
28116 | if test "$cross_compiling" = yes; then : | |
28117 | case "$host_os" in | |
28118 | # Guess yes on Linux systems. | |
28119 | linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;; | |
28120 | # Guess yes on glibc systems. | |
28121 | *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; | |
28122 | # If we don't know, obey --enable-cross-guesses. | |
28123 | *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;; | |
28124 | esac | |
28125 | ||
2196f55f YQ |
28126 | else |
28127 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28128 | /* end confdefs.h. */ | |
28129 | #include <sys/stat.h> | |
28130 | ||
28131 | int | |
28132 | main () | |
28133 | { | |
c0c3707f CB |
28134 | int result = 0; |
28135 | struct stat st; | |
28136 | if (!stat ("conftest.tmp/", &st)) | |
28137 | result |= 1; | |
28138 | #if HAVE_LSTAT | |
28139 | if (!stat ("conftest.lnk/", &st)) | |
28140 | result |= 2; | |
28141 | #endif | |
28142 | return result; | |
28143 | ||
2196f55f YQ |
28144 | ; |
28145 | return 0; | |
28146 | } | |
28147 | _ACEOF | |
28148 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 28149 | gl_cv_func_stat_file_slash=yes |
2196f55f | 28150 | else |
c0c3707f | 28151 | gl_cv_func_stat_file_slash=no |
2196f55f YQ |
28152 | fi |
28153 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
28154 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
28155 | fi | |
28156 | ||
c0c3707f | 28157 | rm -f conftest.tmp conftest.lnk |
2196f55f | 28158 | fi |
c0c3707f CB |
28159 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5 |
28160 | $as_echo "$gl_cv_func_stat_file_slash" >&6; } | |
28161 | case $gl_cv_func_stat_file_slash in | |
28162 | *no) | |
28163 | REPLACE_STAT=1 | |
28164 | ||
28165 | $as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h | |
28166 | ;; | |
28167 | esac | |
28168 | case $host_os in | |
28169 | solaris*) | |
28170 | REPLACE_FSTAT=1 ;; | |
28171 | esac | |
28172 | ;; | |
28173 | esac | |
28174 | ||
28175 | if test $REPLACE_STAT = 1; then | |
28176 | ||
28177 | ||
28178 | ||
28179 | ||
28180 | ||
28181 | ||
28182 | ||
28183 | ||
28184 | gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext" | |
28185 | ||
28186 | case "$host_os" in | |
28187 | mingw*) | |
28188 | ||
28189 | ||
28190 | ||
28191 | ||
28192 | ||
28193 | ||
28194 | ||
28195 | ||
28196 | gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" | |
28197 | ||
28198 | ;; | |
28199 | esac | |
28200 | ||
28201 | ||
9c9d63b1 | 28202 | |
c0c3707f CB |
28203 | : |
28204 | ||
28205 | fi | |
28206 | ||
28207 | ||
28208 | ||
28209 | ||
28210 | ||
28211 | GNULIB_STAT=1 | |
28212 | ||
28213 | ||
28214 | ||
28215 | ||
28216 | ||
28217 | $as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h | |
28218 | ||
28219 | ||
28220 | ||
28221 | ||
7a6dbc2f | 28222 | |
c0c3707f CB |
28223 | |
28224 | ||
28225 | ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include <sys/types.h> | |
28226 | #include <sys/stat.h> | |
28227 | " | |
28228 | if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then : | |
28229 | ||
28230 | cat >>confdefs.h <<_ACEOF | |
28231 | #define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1 | |
28232 | _ACEOF | |
28233 | ||
28234 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5 | |
28235 | $as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; } | |
28236 | if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then : | |
28237 | $as_echo_n "(cached) " >&6 | |
2196f55f | 28238 | else |
5e8754f9 SDJ |
28239 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
28240 | /* end confdefs.h. */ | |
c0c3707f CB |
28241 | |
28242 | #include <sys/types.h> | |
28243 | #include <sys/stat.h> | |
28244 | #if HAVE_SYS_TIME_H | |
28245 | # include <sys/time.h> | |
28246 | #endif | |
28247 | #include <time.h> | |
28248 | struct timespec ts; | |
28249 | struct stat st; | |
7a6dbc2f | 28250 | |
5e8754f9 SDJ |
28251 | int |
28252 | main () | |
28253 | { | |
c0c3707f CB |
28254 | |
28255 | st.st_atim = ts; | |
7a6dbc2f | 28256 | |
5e8754f9 SDJ |
28257 | ; |
28258 | return 0; | |
28259 | } | |
28260 | _ACEOF | |
c0c3707f CB |
28261 | if ac_fn_c_try_compile "$LINENO"; then : |
28262 | ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes | |
5e8754f9 | 28263 | else |
c0c3707f | 28264 | ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no |
2196f55f | 28265 | fi |
c0c3707f | 28266 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
2196f55f | 28267 | fi |
c0c3707f CB |
28268 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5 |
28269 | $as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; } | |
28270 | if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then | |
2196f55f | 28271 | |
c0c3707f | 28272 | $as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h |
2196f55f | 28273 | |
c0c3707f CB |
28274 | fi |
28275 | else | |
28276 | ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include <sys/types.h> | |
28277 | #include <sys/stat.h> | |
28278 | " | |
28279 | if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then : | |
2196f55f | 28280 | |
c0c3707f CB |
28281 | cat >>confdefs.h <<_ACEOF |
28282 | #define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1 | |
28283 | _ACEOF | |
2196f55f | 28284 | |
c0c3707f CB |
28285 | |
28286 | else | |
28287 | ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h> | |
28288 | #include <sys/stat.h> | |
28289 | " | |
28290 | if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then : | |
28291 | ||
28292 | cat >>confdefs.h <<_ACEOF | |
28293 | #define HAVE_STRUCT_STAT_ST_ATIMENSEC 1 | |
28294 | _ACEOF | |
2196f55f YQ |
28295 | |
28296 | ||
c0c3707f CB |
28297 | else |
28298 | ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include <sys/types.h> | |
28299 | #include <sys/stat.h> | |
28300 | " | |
28301 | if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then : | |
2196f55f | 28302 | |
c0c3707f CB |
28303 | cat >>confdefs.h <<_ACEOF |
28304 | #define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1 | |
28305 | _ACEOF | |
2196f55f YQ |
28306 | |
28307 | ||
c0c3707f | 28308 | fi |
2196f55f | 28309 | |
c0c3707f | 28310 | fi |
2196f55f | 28311 | |
c0c3707f | 28312 | fi |
2196f55f | 28313 | |
c0c3707f | 28314 | fi |
2196f55f YQ |
28315 | |
28316 | ||
28317 | ||
28318 | ||
28319 | ||
c0c3707f CB |
28320 | ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include <sys/types.h> |
28321 | #include <sys/stat.h> | |
28322 | " | |
28323 | if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes; then : | |
2196f55f | 28324 | |
c0c3707f CB |
28325 | cat >>confdefs.h <<_ACEOF |
28326 | #define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1 | |
28327 | _ACEOF | |
2196f55f YQ |
28328 | |
28329 | ||
c0c3707f CB |
28330 | else |
28331 | ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h> | |
28332 | #include <sys/stat.h> | |
28333 | " | |
28334 | if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes; then : | |
2196f55f | 28335 | |
c0c3707f CB |
28336 | cat >>confdefs.h <<_ACEOF |
28337 | #define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1 | |
28338 | _ACEOF | |
2196f55f | 28339 | |
2196f55f | 28340 | |
c0c3707f CB |
28341 | else |
28342 | ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include <sys/types.h> | |
28343 | #include <sys/stat.h> | |
28344 | " | |
28345 | if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes; then : | |
28346 | ||
28347 | cat >>confdefs.h <<_ACEOF | |
28348 | #define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1 | |
28349 | _ACEOF | |
28350 | ||
28351 | ||
28352 | fi | |
28353 | ||
28354 | fi | |
5e8754f9 | 28355 | |
c0c3707f | 28356 | fi |
2196f55f YQ |
28357 | |
28358 | ||
28359 | ||
725e2999 JB |
28360 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5 |
28361 | $as_echo_n "checking for working stdalign.h... " >&6; } | |
28362 | if ${gl_cv_header_working_stdalign_h+:} false; then : | |
28363 | $as_echo_n "(cached) " >&6 | |
28364 | else | |
28365 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28366 | /* end confdefs.h. */ | |
28367 | #include <stdalign.h> | |
28368 | #include <stddef.h> | |
28369 | ||
28370 | /* Test that alignof yields a result consistent with offsetof. | |
28371 | This catches GCC bug 52023 | |
c0c3707f | 28372 | <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */ |
725e2999 JB |
28373 | #ifdef __cplusplus |
28374 | template <class t> struct alignof_helper { char a; t b; }; | |
28375 | # define ao(type) offsetof (alignof_helper<type>, b) | |
28376 | #else | |
28377 | # define ao(type) offsetof (struct { char a; type b; }, b) | |
28378 | #endif | |
28379 | char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1]; | |
28380 | char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1]; | |
28381 | char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1]; | |
28382 | ||
28383 | /* Test _Alignas only on platforms where gnulib can help. */ | |
28384 | #if \ | |
28385 | ((defined __cplusplus && 201103 <= __cplusplus) \ | |
28386 | || (defined __APPLE__ && defined __MACH__ \ | |
28387 | ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ | |
28388 | : __GNUC__) \ | |
c0c3707f CB |
28389 | || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ |
28390 | || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \ | |
725e2999 JB |
28391 | || 1300 <= _MSC_VER) |
28392 | struct alignas_test { char c; char alignas (8) alignas_8; }; | |
28393 | char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 | |
28394 | ? 1 : -1]; | |
28395 | #endif | |
28396 | ||
28397 | int | |
28398 | main () | |
28399 | { | |
28400 | ||
28401 | ; | |
28402 | return 0; | |
28403 | } | |
28404 | _ACEOF | |
28405 | if ac_fn_c_try_compile "$LINENO"; then : | |
28406 | gl_cv_header_working_stdalign_h=yes | |
28407 | else | |
28408 | gl_cv_header_working_stdalign_h=no | |
28409 | fi | |
28410 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
28411 | fi | |
28412 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5 | |
28413 | $as_echo "$gl_cv_header_working_stdalign_h" >&6; } | |
28414 | ||
28415 | if test $gl_cv_header_working_stdalign_h = yes; then | |
28416 | STDALIGN_H='' | |
28417 | else | |
28418 | STDALIGN_H='stdalign.h' | |
28419 | fi | |
28420 | ||
28421 | ||
28422 | if test -n "$STDALIGN_H"; then | |
28423 | GL_GENERATE_STDALIGN_H_TRUE= | |
28424 | GL_GENERATE_STDALIGN_H_FALSE='#' | |
28425 | else | |
28426 | GL_GENERATE_STDALIGN_H_TRUE='#' | |
28427 | GL_GENERATE_STDALIGN_H_FALSE= | |
28428 | fi | |
28429 | ||
28430 | ||
28431 | ||
2196f55f YQ |
28432 | |
28433 | ||
63ce7108 | 28434 | |
c0c3707f CB |
28435 | if test "$ac_cv_header_stdbool_h" = yes; then |
28436 | case "$host_os" in | |
28437 | solaris*) | |
28438 | if test -z "$GCC"; then | |
28439 | STDBOOL_H='stdbool.h' | |
28440 | else | |
28441 | STDBOOL_H='' | |
28442 | fi | |
28443 | ;; | |
28444 | *) | |
28445 | STDBOOL_H='' | |
28446 | ;; | |
28447 | esac | |
63ce7108 TT |
28448 | else |
28449 | STDBOOL_H='stdbool.h' | |
28450 | fi | |
28451 | ||
28452 | if test -n "$STDBOOL_H"; then | |
28453 | GL_GENERATE_STDBOOL_H_TRUE= | |
28454 | GL_GENERATE_STDBOOL_H_FALSE='#' | |
28455 | else | |
28456 | GL_GENERATE_STDBOOL_H_TRUE='#' | |
28457 | GL_GENERATE_STDBOOL_H_FALSE= | |
28458 | fi | |
28459 | ||
28460 | ||
28461 | if test "$ac_cv_type__Bool" = yes; then | |
28462 | HAVE__BOOL=1 | |
28463 | else | |
28464 | HAVE__BOOL=0 | |
28465 | fi | |
28466 | ||
28467 | ||
28468 | ||
28469 | ||
28470 | ||
9c9d63b1 PM |
28471 | |
28472 | ||
28473 | ||
63ce7108 | 28474 | STDDEF_H= |
4a626d0a | 28475 | |
c0c3707f CB |
28476 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5 |
28477 | $as_echo_n "checking for good max_align_t... " >&6; } | |
28478 | if ${gl_cv_type_max_align_t+:} false; then : | |
28479 | $as_echo_n "(cached) " >&6 | |
28480 | else | |
28481 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28482 | /* end confdefs.h. */ | |
28483 | #include <stddef.h> | |
28484 | unsigned int s = sizeof (max_align_t); | |
9c9d63b1 | 28485 | #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__ |
c0c3707f CB |
28486 | int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; |
28487 | int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; | |
28488 | #endif | |
9c9d63b1 PM |
28489 | typedef struct { char a; max_align_t b; } max_helper; |
28490 | typedef struct { char a; long b; } long_helper; | |
28491 | typedef struct { char a; double b; } double_helper; | |
28492 | typedef struct { char a; long double b; } long_double_helper; | |
28493 | int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1]; | |
28494 | int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1]; | |
28495 | int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1]; | |
c0c3707f CB |
28496 | |
28497 | int | |
28498 | main () | |
28499 | { | |
4a626d0a | 28500 | |
c0c3707f CB |
28501 | ; |
28502 | return 0; | |
28503 | } | |
28504 | _ACEOF | |
28505 | if ac_fn_c_try_compile "$LINENO"; then : | |
28506 | gl_cv_type_max_align_t=yes | |
4a626d0a | 28507 | else |
c0c3707f | 28508 | gl_cv_type_max_align_t=no |
4a626d0a | 28509 | fi |
c0c3707f CB |
28510 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
28511 | ||
28512 | fi | |
28513 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5 | |
28514 | $as_echo "$gl_cv_type_max_align_t" >&6; } | |
28515 | if test $gl_cv_type_max_align_t = no; then | |
28516 | HAVE_MAX_ALIGN_T=0 | |
28517 | STDDEF_H=stddef.h | |
28518 | fi | |
4a626d0a | 28519 | |
63ce7108 TT |
28520 | if test $gt_cv_c_wchar_t = no; then |
28521 | HAVE_WCHAR_T=0 | |
28522 | STDDEF_H=stddef.h | |
28523 | fi | |
c0c3707f | 28524 | |
63ce7108 TT |
28525 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 |
28526 | $as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; } | |
d0ac1c44 | 28527 | if ${gl_cv_decl_null_works+:} false; then : |
63ce7108 TT |
28528 | $as_echo_n "(cached) " >&6 |
28529 | else | |
28530 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28531 | /* end confdefs.h. */ | |
28532 | #include <stddef.h> | |
28533 | int test[2 * (sizeof NULL == sizeof (void *)) -1]; | |
28534 | ||
28535 | int | |
28536 | main () | |
28537 | { | |
28538 | ||
28539 | ; | |
28540 | return 0; | |
28541 | } | |
28542 | _ACEOF | |
28543 | if ac_fn_c_try_compile "$LINENO"; then : | |
28544 | gl_cv_decl_null_works=yes | |
28545 | else | |
28546 | gl_cv_decl_null_works=no | |
28547 | fi | |
28548 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
28549 | fi | |
28550 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 | |
28551 | $as_echo "$gl_cv_decl_null_works" >&6; } | |
28552 | if test $gl_cv_decl_null_works = no; then | |
28553 | REPLACE_NULL=1 | |
28554 | STDDEF_H=stddef.h | |
28555 | fi | |
28556 | ||
c0c3707f | 28557 | |
63ce7108 TT |
28558 | if test -n "$STDDEF_H"; then |
28559 | GL_GENERATE_STDDEF_H_TRUE= | |
28560 | GL_GENERATE_STDDEF_H_FALSE='#' | |
28561 | else | |
28562 | GL_GENERATE_STDDEF_H_TRUE='#' | |
28563 | GL_GENERATE_STDDEF_H_FALSE= | |
28564 | fi | |
28565 | ||
28566 | if test -n "$STDDEF_H"; then | |
28567 | ||
28568 | ||
28569 | ||
28570 | ||
28571 | ||
28572 | ||
28573 | ||
28574 | ||
28575 | if test $gl_cv_have_include_next = yes; then | |
28576 | gl_cv_next_stddef_h='<'stddef.h'>' | |
28577 | else | |
28578 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5 | |
28579 | $as_echo_n "checking absolute name of <stddef.h>... " >&6; } | |
d0ac1c44 | 28580 | if ${gl_cv_next_stddef_h+:} false; then : |
63ce7108 TT |
28581 | $as_echo_n "(cached) " >&6 |
28582 | else | |
28583 | ||
4a626d0a PA |
28584 | |
28585 | ||
28586 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
63ce7108 TT |
28587 | /* end confdefs.h. */ |
28588 | #include <stddef.h> | |
63ce7108 | 28589 | _ACEOF |
4a626d0a PA |
28590 | case "$host_os" in |
28591 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
28592 | *) gl_absname_cpp="$ac_cpp" ;; | |
28593 | esac | |
63ce7108 | 28594 | |
4a626d0a PA |
28595 | case "$host_os" in |
28596 | mingw*) | |
28597 | gl_dirsep_regex='[/\\]' | |
28598 | ;; | |
28599 | *) | |
28600 | gl_dirsep_regex='\/' | |
28601 | ;; | |
28602 | esac | |
28603 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
28604 | gl_header_literal_regex=`echo 'stddef.h' \ | |
28605 | | sed -e "$gl_make_literal_regex_sed"` | |
28606 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
28607 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
28608 | s|^/[^/]|//&| | |
28609 | p | |
28610 | q | |
28611 | }' | |
63ce7108 | 28612 | |
4a626d0a PA |
28613 | gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
28614 | sed -n "$gl_absolute_header_sed"` | |
28615 | ||
28616 | gl_header=$gl_cv_absolute_stddef_h | |
28617 | gl_cv_next_stddef_h='"'$gl_header'"' | |
63ce7108 TT |
28618 | |
28619 | ||
28620 | fi | |
28621 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 | |
28622 | $as_echo "$gl_cv_next_stddef_h" >&6; } | |
28623 | fi | |
28624 | NEXT_STDDEF_H=$gl_cv_next_stddef_h | |
28625 | ||
28626 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
28627 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
28628 | gl_next_as_first_directive='<'stddef.h'>' | |
28629 | else | |
28630 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
28631 | gl_next_as_first_directive=$gl_cv_next_stddef_h | |
28632 | fi | |
28633 | NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive | |
28634 | ||
28635 | ||
28636 | ||
28637 | ||
28638 | fi | |
28639 | ||
28640 | ||
28641 | ||
28642 | ||
49e4877c | 28643 | $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h |
63ce7108 TT |
28644 | |
28645 | ||
28646 | ||
98399780 YQ |
28647 | |
28648 | ||
28649 | ||
28650 | ||
28651 | ||
4a626d0a PA |
28652 | |
28653 | ||
6a29c58e YQ |
28654 | if test $gl_cv_have_include_next = yes; then |
28655 | gl_cv_next_stdio_h='<'stdio.h'>' | |
28656 | else | |
28657 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5 | |
28658 | $as_echo_n "checking absolute name of <stdio.h>... " >&6; } | |
d0ac1c44 | 28659 | if ${gl_cv_next_stdio_h+:} false; then : |
6a29c58e YQ |
28660 | $as_echo_n "(cached) " >&6 |
28661 | else | |
28662 | ||
4a626d0a PA |
28663 | |
28664 | ||
28665 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6a29c58e YQ |
28666 | /* end confdefs.h. */ |
28667 | #include <stdio.h> | |
6a29c58e | 28668 | _ACEOF |
4a626d0a PA |
28669 | case "$host_os" in |
28670 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
28671 | *) gl_absname_cpp="$ac_cpp" ;; | |
28672 | esac | |
28673 | ||
28674 | case "$host_os" in | |
28675 | mingw*) | |
28676 | gl_dirsep_regex='[/\\]' | |
28677 | ;; | |
28678 | *) | |
28679 | gl_dirsep_regex='\/' | |
28680 | ;; | |
28681 | esac | |
28682 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
28683 | gl_header_literal_regex=`echo 'stdio.h' \ | |
28684 | | sed -e "$gl_make_literal_regex_sed"` | |
28685 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
28686 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
28687 | s|^/[^/]|//&| | |
28688 | p | |
28689 | q | |
28690 | }' | |
6a29c58e | 28691 | |
4a626d0a PA |
28692 | gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
28693 | sed -n "$gl_absolute_header_sed"` | |
6a29c58e | 28694 | |
4a626d0a PA |
28695 | gl_header=$gl_cv_absolute_stdio_h |
28696 | gl_cv_next_stdio_h='"'$gl_header'"' | |
6a29c58e YQ |
28697 | |
28698 | ||
28699 | fi | |
28700 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5 | |
28701 | $as_echo "$gl_cv_next_stdio_h" >&6; } | |
28702 | fi | |
28703 | NEXT_STDIO_H=$gl_cv_next_stdio_h | |
28704 | ||
28705 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
28706 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
28707 | gl_next_as_first_directive='<'stdio.h'>' | |
28708 | else | |
28709 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
28710 | gl_next_as_first_directive=$gl_cv_next_stdio_h | |
28711 | fi | |
28712 | NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive | |
28713 | ||
28714 | ||
28715 | ||
28716 | ||
28717 | ||
4a626d0a PA |
28718 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5 |
28719 | $as_echo_n "checking which flavor of printf attribute matches inttypes macros... " >&6; } | |
d0ac1c44 | 28720 | if ${gl_cv_func_printf_attribute_flavor+:} false; then : |
4a626d0a PA |
28721 | $as_echo_n "(cached) " >&6 |
28722 | else | |
28723 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28724 | /* end confdefs.h. */ | |
28725 | ||
28726 | #define __STDC_FORMAT_MACROS 1 | |
28727 | #include <stdio.h> | |
28728 | #include <inttypes.h> | |
28729 | /* For non-mingw systems, compilation will trivially succeed. | |
28730 | For mingw, compilation will succeed for older mingw (system | |
28731 | printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ | |
c0c3707f | 28732 | #if (defined _WIN32 && ! defined __CYGWIN__) && \ |
4a626d0a PA |
28733 | (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) |
28734 | extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; | |
28735 | #endif | |
28736 | ||
28737 | int | |
28738 | main () | |
28739 | { | |
28740 | ||
28741 | ; | |
28742 | return 0; | |
28743 | } | |
28744 | _ACEOF | |
28745 | if ac_fn_c_try_compile "$LINENO"; then : | |
28746 | gl_cv_func_printf_attribute_flavor=system | |
28747 | else | |
28748 | gl_cv_func_printf_attribute_flavor=gnu | |
28749 | fi | |
28750 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
28751 | fi | |
28752 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5 | |
28753 | $as_echo "$gl_cv_func_printf_attribute_flavor" >&6; } | |
28754 | if test "$gl_cv_func_printf_attribute_flavor" = gnu; then | |
28755 | ||
28756 | $as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h | |
28757 | ||
28758 | fi | |
28759 | ||
6a29c58e YQ |
28760 | GNULIB_FSCANF=1 |
28761 | ||
28762 | ||
28763 | cat >>confdefs.h <<_ACEOF | |
28764 | #define GNULIB_FSCANF 1 | |
28765 | _ACEOF | |
28766 | ||
28767 | ||
28768 | GNULIB_SCANF=1 | |
28769 | ||
28770 | ||
28771 | cat >>confdefs.h <<_ACEOF | |
28772 | #define GNULIB_SCANF 1 | |
28773 | _ACEOF | |
28774 | ||
28775 | ||
28776 | GNULIB_FGETC=1 | |
28777 | GNULIB_GETC=1 | |
28778 | GNULIB_GETCHAR=1 | |
28779 | GNULIB_FGETS=1 | |
28780 | GNULIB_FREAD=1 | |
28781 | ||
28782 | ||
28783 | GNULIB_FPRINTF=1 | |
28784 | GNULIB_PRINTF=1 | |
28785 | GNULIB_VFPRINTF=1 | |
28786 | GNULIB_VPRINTF=1 | |
28787 | GNULIB_FPUTC=1 | |
28788 | GNULIB_PUTC=1 | |
28789 | GNULIB_PUTCHAR=1 | |
28790 | GNULIB_FPUTS=1 | |
28791 | GNULIB_PUTS=1 | |
28792 | GNULIB_FWRITE=1 | |
28793 | ||
28794 | ||
28795 | ||
28796 | ||
6a29c58e | 28797 | |
6a29c58e YQ |
28798 | |
28799 | ||
28800 | ||
28801 | ||
28802 | ||
9c9d63b1 PM |
28803 | if test $ac_cv_have_decl_fcloseall = no; then |
28804 | HAVE_DECL_FCLOSEALL=0 | |
28805 | fi | |
28806 | ||
28807 | ||
6a29c58e YQ |
28808 | |
28809 | ||
28810 | ||
28811 | ||
28812 | ||
28813 | ||
28814 | ||
698be2d8 CB |
28815 | |
28816 | ||
98399780 YQ |
28817 | if test $gl_cv_have_include_next = yes; then |
28818 | gl_cv_next_stdlib_h='<'stdlib.h'>' | |
28819 | else | |
28820 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5 | |
28821 | $as_echo_n "checking absolute name of <stdlib.h>... " >&6; } | |
d0ac1c44 | 28822 | if ${gl_cv_next_stdlib_h+:} false; then : |
98399780 YQ |
28823 | $as_echo_n "(cached) " >&6 |
28824 | else | |
28825 | ||
4a626d0a PA |
28826 | |
28827 | ||
28828 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
98399780 YQ |
28829 | /* end confdefs.h. */ |
28830 | #include <stdlib.h> | |
98399780 | 28831 | _ACEOF |
4a626d0a PA |
28832 | case "$host_os" in |
28833 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
28834 | *) gl_absname_cpp="$ac_cpp" ;; | |
28835 | esac | |
28836 | ||
28837 | case "$host_os" in | |
28838 | mingw*) | |
28839 | gl_dirsep_regex='[/\\]' | |
28840 | ;; | |
28841 | *) | |
28842 | gl_dirsep_regex='\/' | |
28843 | ;; | |
28844 | esac | |
28845 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
28846 | gl_header_literal_regex=`echo 'stdlib.h' \ | |
28847 | | sed -e "$gl_make_literal_regex_sed"` | |
28848 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
28849 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
28850 | s|^/[^/]|//&| | |
28851 | p | |
28852 | q | |
28853 | }' | |
98399780 | 28854 | |
4a626d0a PA |
28855 | gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
28856 | sed -n "$gl_absolute_header_sed"` | |
98399780 | 28857 | |
4a626d0a PA |
28858 | gl_header=$gl_cv_absolute_stdlib_h |
28859 | gl_cv_next_stdlib_h='"'$gl_header'"' | |
98399780 YQ |
28860 | |
28861 | ||
28862 | fi | |
28863 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5 | |
28864 | $as_echo "$gl_cv_next_stdlib_h" >&6; } | |
28865 | fi | |
28866 | NEXT_STDLIB_H=$gl_cv_next_stdlib_h | |
28867 | ||
28868 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
28869 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
28870 | gl_next_as_first_directive='<'stdlib.h'>' | |
28871 | else | |
28872 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
28873 | gl_next_as_first_directive=$gl_cv_next_stdlib_h | |
28874 | fi | |
28875 | NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive | |
28876 | ||
28877 | ||
28878 | ||
28879 | ||
28880 | ||
28881 | ||
98399780 | 28882 | |
98399780 YQ |
28883 | |
28884 | ||
28885 | ||
28886 | ||
28887 | ||
9c9d63b1 PM |
28888 | if test $ac_cv_have_decl_ecvt = no; then |
28889 | HAVE_DECL_ECVT=0 | |
28890 | fi | |
28891 | ||
28892 | if test $ac_cv_have_decl_fcvt = no; then | |
28893 | HAVE_DECL_FCVT=0 | |
28894 | fi | |
28895 | ||
28896 | if test $ac_cv_have_decl_gcvt = no; then | |
28897 | HAVE_DECL_GCVT=0 | |
28898 | fi | |
28899 | ||
28900 | ||
98399780 | 28901 | |
698be2d8 CB |
28902 | |
28903 | ||
8424cc97 SM |
28904 | for ac_func in strchrnul |
28905 | do : | |
28906 | ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul" | |
d0ac1c44 | 28907 | if test "x$ac_cv_func_strchrnul" = xyes; then : |
8424cc97 SM |
28908 | cat >>confdefs.h <<_ACEOF |
28909 | #define HAVE_STRCHRNUL 1 | |
28910 | _ACEOF | |
28911 | ||
28912 | fi | |
28913 | done | |
28914 | ||
28915 | if test $ac_cv_func_strchrnul = no; then | |
28916 | HAVE_STRCHRNUL=0 | |
28917 | else | |
28918 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strchrnul works" >&5 | |
28919 | $as_echo_n "checking whether strchrnul works... " >&6; } | |
d0ac1c44 | 28920 | if ${gl_cv_func_strchrnul_works+:} false; then : |
8424cc97 SM |
28921 | $as_echo_n "(cached) " >&6 |
28922 | else | |
28923 | if test "$cross_compiling" = yes; then : | |
28924 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28925 | /* end confdefs.h. */ | |
28926 | ||
28927 | #if defined __CYGWIN__ | |
28928 | #include <cygwin/version.h> | |
28929 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9) | |
28930 | Lucky user | |
28931 | #endif | |
28932 | #else | |
28933 | Lucky user | |
28934 | #endif | |
28935 | ||
28936 | _ACEOF | |
28937 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
28938 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
28939 | gl_cv_func_strchrnul_works="guessing yes" | |
28940 | else | |
28941 | gl_cv_func_strchrnul_works="guessing no" | |
28942 | fi | |
28943 | rm -f conftest* | |
28944 | ||
28945 | ||
28946 | else | |
28947 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28948 | /* end confdefs.h. */ | |
28949 | ||
28950 | #include <string.h> /* for strchrnul */ | |
28951 | ||
28952 | int | |
28953 | main () | |
28954 | { | |
28955 | const char *buf = "a"; | |
28956 | return strchrnul (buf, 'b') != buf + 1; | |
28957 | ||
28958 | ; | |
28959 | return 0; | |
28960 | } | |
28961 | _ACEOF | |
28962 | if ac_fn_c_try_run "$LINENO"; then : | |
28963 | gl_cv_func_strchrnul_works=yes | |
28964 | else | |
28965 | gl_cv_func_strchrnul_works=no | |
28966 | fi | |
28967 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
28968 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
28969 | fi | |
28970 | ||
28971 | ||
28972 | fi | |
28973 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strchrnul_works" >&5 | |
28974 | $as_echo "$gl_cv_func_strchrnul_works" >&6; } | |
28975 | case "$gl_cv_func_strchrnul_works" in | |
28976 | *yes) ;; | |
28977 | *) REPLACE_STRCHRNUL=1 ;; | |
28978 | esac | |
28979 | fi | |
28980 | ||
28981 | if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then | |
28982 | ||
28983 | ||
28984 | ||
28985 | ||
28986 | ||
28987 | ||
28988 | ||
28989 | ||
28990 | gl_LIBOBJS="$gl_LIBOBJS strchrnul.$ac_objext" | |
28991 | ||
28992 | : | |
28993 | fi | |
28994 | ||
28995 | ||
28996 | ||
28997 | ||
28998 | ||
28999 | GNULIB_STRCHRNUL=1 | |
29000 | ||
29001 | ||
29002 | ||
29003 | ||
29004 | ||
29005 | $as_echo "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h | |
29006 | ||
29007 | ||
29008 | ||
29009 | ||
29010 | ||
29011 | ||
9c9d63b1 PM |
29012 | if test $gl_cv_func_malloc_posix != yes; then |
29013 | REPLACE_STRDUP=1 | |
6ec2e0f5 SDJ |
29014 | fi |
29015 | ||
29016 | if test $ac_cv_have_decl_strdup = no; then | |
29017 | HAVE_DECL_STRDUP=0 | |
29018 | fi | |
29019 | ||
9c9d63b1 | 29020 | if test $REPLACE_STRDUP = 1; then |
6ec2e0f5 SDJ |
29021 | |
29022 | ||
29023 | ||
29024 | ||
29025 | ||
29026 | ||
29027 | ||
29028 | ||
29029 | gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext" | |
29030 | ||
29031 | : | |
29032 | fi | |
29033 | ||
29034 | ||
29035 | ||
29036 | ||
29037 | ||
29038 | GNULIB_STRDUP=1 | |
29039 | ||
29040 | ||
29041 | ||
29042 | ||
29043 | ||
29044 | $as_echo "#define GNULIB_TEST_STRDUP 1" >>confdefs.h | |
29045 | ||
29046 | ||
29047 | ||
29048 | ||
29049 | ||
29050 | ||
29051 | ||
29052 | ||
5abebf3c CB |
29053 | |
29054 | ||
6ec2e0f5 SDJ |
29055 | if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then |
29056 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5 | |
29057 | $as_echo_n "checking for working strerror function... " >&6; } | |
d0ac1c44 | 29058 | if ${gl_cv_func_working_strerror+:} false; then : |
6ec2e0f5 SDJ |
29059 | $as_echo_n "(cached) " >&6 |
29060 | else | |
29061 | if test "$cross_compiling" = yes; then : | |
29062 | case "$host_os" in | |
c0c3707f CB |
29063 | # Guess yes on glibc systems. |
29064 | *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;; | |
29065 | # Guess yes on musl systems. | |
29066 | *-musl*) gl_cv_func_working_strerror="guessing yes" ;; | |
29067 | # If we don't know, obey --enable-cross-guesses. | |
29068 | *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;; | |
6ec2e0f5 SDJ |
29069 | esac |
29070 | ||
29071 | else | |
29072 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29073 | /* end confdefs.h. */ | |
29074 | #include <string.h> | |
29075 | ||
29076 | int | |
29077 | main () | |
29078 | { | |
29079 | if (!*strerror (-2)) return 1; | |
29080 | ; | |
29081 | return 0; | |
29082 | } | |
29083 | _ACEOF | |
29084 | if ac_fn_c_try_run "$LINENO"; then : | |
29085 | gl_cv_func_working_strerror=yes | |
29086 | else | |
29087 | gl_cv_func_working_strerror=no | |
29088 | fi | |
29089 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
29090 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
29091 | fi | |
29092 | ||
29093 | ||
29094 | fi | |
29095 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5 | |
29096 | $as_echo "$gl_cv_func_working_strerror" >&6; } | |
29097 | case "$gl_cv_func_working_strerror" in | |
29098 | *yes) ;; | |
29099 | *) | |
29100 | REPLACE_STRERROR=1 | |
29101 | ;; | |
29102 | esac | |
29103 | ||
5abebf3c CB |
29104 | case "$gl_cv_func_strerror_r_works" in |
29105 | *no) REPLACE_STRERROR=1 ;; | |
29106 | esac | |
29107 | ||
6ec2e0f5 SDJ |
29108 | else |
29109 | REPLACE_STRERROR=1 | |
29110 | fi | |
29111 | ||
29112 | if test $REPLACE_STRERROR = 1; then | |
29113 | ||
29114 | ||
29115 | ||
29116 | ||
29117 | ||
29118 | ||
29119 | ||
29120 | ||
29121 | gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext" | |
29122 | ||
29123 | fi | |
29124 | ||
29125 | ||
29126 | cat >>confdefs.h <<_ACEOF | |
29127 | #define GNULIB_STRERROR 1 | |
29128 | _ACEOF | |
29129 | ||
29130 | ||
29131 | ||
29132 | ||
29133 | ||
29134 | ||
29135 | ||
29136 | GNULIB_STRERROR=1 | |
29137 | ||
29138 | ||
29139 | ||
29140 | ||
29141 | ||
29142 | $as_echo "#define GNULIB_TEST_STRERROR 1" >>confdefs.h | |
29143 | ||
29144 | ||
29145 | ||
29146 | ||
29147 | ||
29148 | if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then | |
29149 | ||
29150 | ||
29151 | ||
29152 | ||
29153 | ||
29154 | ||
29155 | ||
29156 | ||
29157 | gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext" | |
29158 | ||
29159 | ||
29160 | ||
29161 | ||
29162 | ||
29163 | if test $ac_cv_header_sys_socket_h != yes; then | |
29164 | for ac_header in winsock2.h | |
29165 | do : | |
29166 | ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" | |
d0ac1c44 | 29167 | if test "x$ac_cv_header_winsock2_h" = xyes; then : |
6ec2e0f5 SDJ |
29168 | cat >>confdefs.h <<_ACEOF |
29169 | #define HAVE_WINSOCK2_H 1 | |
29170 | _ACEOF | |
29171 | ||
29172 | fi | |
29173 | ||
29174 | done | |
29175 | ||
29176 | fi | |
29177 | if test "$ac_cv_header_winsock2_h" = yes; then | |
29178 | HAVE_WINSOCK2_H=1 | |
29179 | UNISTD_H_HAVE_WINSOCK2_H=1 | |
29180 | SYS_IOCTL_H_HAVE_WINSOCK2_H=1 | |
29181 | else | |
29182 | HAVE_WINSOCK2_H=0 | |
29183 | fi | |
29184 | ||
29185 | ||
29186 | fi | |
29187 | ||
29188 | ||
29189 | ||
29190 | ||
98399780 | 29191 | |
5abebf3c | 29192 | |
5abebf3c | 29193 | |
c0c3707f CB |
29194 | if test $ac_cv_have_decl_strerror_r = no; then |
29195 | HAVE_DECL_STRERROR_R=0 | |
29196 | fi | |
5abebf3c CB |
29197 | |
29198 | if test $ac_cv_func_strerror_r = yes; then | |
29199 | if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then | |
29200 | if test $gl_cv_func_strerror_r_posix_signature = yes; then | |
29201 | case "$gl_cv_func_strerror_r_works" in | |
29202 | *no) REPLACE_STRERROR_R=1 ;; | |
29203 | esac | |
29204 | else | |
29205 | REPLACE_STRERROR_R=1 | |
29206 | fi | |
29207 | else | |
29208 | REPLACE_STRERROR_R=1 | |
29209 | fi | |
29210 | fi | |
29211 | ||
5abebf3c CB |
29212 | if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then |
29213 | ||
29214 | ||
29215 | ||
29216 | ||
29217 | ||
29218 | ||
29219 | ||
29220 | ||
29221 | gl_LIBOBJS="$gl_LIBOBJS strerror_r.$ac_objext" | |
29222 | ||
29223 | ||
29224 | ||
5abebf3c CB |
29225 | |
29226 | ||
29227 | ||
c0c3707f | 29228 | fi |
5abebf3c CB |
29229 | |
29230 | ||
29231 | ||
29232 | ||
5abebf3c | 29233 | |
c0c3707f | 29234 | GNULIB_STRERROR_R=1 |
5abebf3c CB |
29235 | |
29236 | ||
29237 | ||
29238 | ||
5abebf3c | 29239 | |
c0c3707f | 29240 | $as_echo "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h |
5abebf3c CB |
29241 | |
29242 | ||
29243 | ||
29244 | ||
5abebf3c | 29245 | |
c0c3707f CB |
29246 | cat >>confdefs.h <<_ACEOF |
29247 | #define GNULIB_STRERROR_R_POSIX 1 | |
29248 | _ACEOF | |
5abebf3c CB |
29249 | |
29250 | ||
29251 | ||
29252 | ||
29253 | ||
29254 | ||
29255 | ||
698be2d8 CB |
29256 | |
29257 | ||
29258 | ||
29259 | ||
32e2770e MF |
29260 | |
29261 | ||
29262 | ||
698be2d8 CB |
29263 | if test $ac_cv_have_decl_strnlen = no; then |
29264 | HAVE_DECL_STRNLEN=0 | |
29265 | else | |
29266 | ||
29267 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5 | |
29268 | $as_echo_n "checking for working strnlen... " >&6; } | |
29269 | if ${ac_cv_func_strnlen_working+:} false; then : | |
29270 | $as_echo_n "(cached) " >&6 | |
29271 | else | |
29272 | if test "$cross_compiling" = yes; then : | |
29273 | # Guess no on AIX systems, yes otherwise. | |
29274 | case "$host_os" in | |
29275 | aix*) ac_cv_func_strnlen_working=no;; | |
29276 | *) ac_cv_func_strnlen_working=yes;; | |
29277 | esac | |
29278 | else | |
29279 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29280 | /* end confdefs.h. */ | |
29281 | $ac_includes_default | |
29282 | int | |
29283 | main () | |
29284 | { | |
29285 | ||
29286 | #define S "foobar" | |
29287 | #define S_LEN (sizeof S - 1) | |
29288 | ||
29289 | /* At least one implementation is buggy: that of AIX 4.3 would | |
29290 | give strnlen (S, 1) == 3. */ | |
29291 | ||
29292 | int i; | |
29293 | for (i = 0; i < S_LEN + 1; ++i) | |
29294 | { | |
29295 | int expected = i <= S_LEN ? i : S_LEN; | |
29296 | if (strnlen (S, i) != expected) | |
29297 | return 1; | |
29298 | } | |
29299 | return 0; | |
29300 | ||
29301 | ; | |
29302 | return 0; | |
29303 | } | |
29304 | _ACEOF | |
29305 | if ac_fn_c_try_run "$LINENO"; then : | |
29306 | ac_cv_func_strnlen_working=yes | |
29307 | else | |
29308 | ac_cv_func_strnlen_working=no | |
29309 | fi | |
29310 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
29311 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
29312 | fi | |
29313 | ||
29314 | fi | |
29315 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5 | |
29316 | $as_echo "$ac_cv_func_strnlen_working" >&6; } | |
29317 | test $ac_cv_func_strnlen_working = no && : | |
29318 | ||
29319 | ||
29320 | if test $ac_cv_func_strnlen_working = no; then | |
29321 | REPLACE_STRNLEN=1 | |
29322 | fi | |
29323 | fi | |
29324 | ||
29325 | if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then | |
29326 | ||
29327 | ||
29328 | ||
29329 | ||
29330 | ||
29331 | ||
29332 | ||
29333 | ||
29334 | gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext" | |
29335 | ||
29336 | : | |
29337 | fi | |
29338 | ||
29339 | ||
29340 | ||
29341 | ||
29342 | ||
29343 | GNULIB_STRNLEN=1 | |
29344 | ||
29345 | ||
29346 | ||
29347 | ||
29348 | ||
29349 | $as_echo "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h | |
29350 | ||
29351 | ||
29352 | ||
29353 | ||
29354 | ||
63ce7108 TT |
29355 | if test $REPLACE_STRSTR = 0; then |
29356 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works in linear time" >&5 | |
29357 | $as_echo_n "checking whether strstr works in linear time... " >&6; } | |
d0ac1c44 | 29358 | if ${gl_cv_func_strstr_linear+:} false; then : |
63ce7108 TT |
29359 | $as_echo_n "(cached) " >&6 |
29360 | else | |
29361 | if test "$cross_compiling" = yes; then : | |
29362 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29363 | /* end confdefs.h. */ | |
29364 | ||
29365 | #include <features.h> | |
29366 | #ifdef __GNU_LIBRARY__ | |
29367 | #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ | |
29368 | && !(defined __i386__ || defined __x86_64__) \ | |
29369 | && !defined __UCLIBC__ | |
29370 | Lucky user | |
29371 | #endif | |
29372 | #endif | |
29373 | #ifdef __CYGWIN__ | |
29374 | #include <cygwin/version.h> | |
29375 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) | |
29376 | Lucky user | |
29377 | #endif | |
29378 | #endif | |
29379 | ||
29380 | _ACEOF | |
29381 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
29382 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
29383 | gl_cv_func_strstr_linear="guessing yes" | |
c971b7fa | 29384 | else |
c0c3707f | 29385 | gl_cv_func_strstr_linear="$gl_cross_guess_normal" |
c971b7fa PA |
29386 | fi |
29387 | rm -f conftest* | |
29388 | ||
29389 | ||
29390 | else | |
29391 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29392 | /* end confdefs.h. */ | |
29393 | ||
49e4877c PA |
29394 | #ifdef __MVS__ |
29395 | /* z/OS does not deliver signals while strstr() is running (thanks to | |
29396 | restrictions on its LE runtime), which prevents us from limiting the | |
29397 | running time of this test. */ | |
29398 | # error "This test does not work properly on z/OS" | |
29399 | #endif | |
c971b7fa | 29400 | #include <signal.h> /* for signal */ |
63ce7108 | 29401 | #include <string.h> /* for strstr */ |
c971b7fa PA |
29402 | #include <stdlib.h> /* for malloc */ |
29403 | #include <unistd.h> /* for alarm */ | |
49e4877c | 29404 | static void quit (int sig) { _exit (sig + 128); } |
c971b7fa PA |
29405 | |
29406 | int | |
29407 | main () | |
29408 | { | |
29409 | ||
29410 | int result = 0; | |
29411 | size_t m = 1000000; | |
63ce7108 TT |
29412 | char *haystack = (char *) malloc (2 * m + 2); |
29413 | char *needle = (char *) malloc (m + 2); | |
c971b7fa | 29414 | /* Failure to compile this test due to missing alarm is okay, |
63ce7108 | 29415 | since all such platforms (mingw) also have quadratic strstr. */ |
c971b7fa PA |
29416 | signal (SIGALRM, quit); |
29417 | alarm (5); | |
29418 | /* Check for quadratic performance. */ | |
29419 | if (haystack && needle) | |
29420 | { | |
29421 | memset (haystack, 'A', 2 * m); | |
29422 | haystack[2 * m] = 'B'; | |
63ce7108 | 29423 | haystack[2 * m + 1] = 0; |
c971b7fa PA |
29424 | memset (needle, 'A', m); |
29425 | needle[m] = 'B'; | |
63ce7108 TT |
29426 | needle[m + 1] = 0; |
29427 | if (!strstr (haystack, needle)) | |
c971b7fa PA |
29428 | result |= 1; |
29429 | } | |
c0c3707f CB |
29430 | /* Free allocated memory, in case some sanitizer is watching. */ |
29431 | free (haystack); | |
29432 | free (needle); | |
c971b7fa PA |
29433 | return result; |
29434 | ||
29435 | ; | |
29436 | return 0; | |
29437 | } | |
29438 | _ACEOF | |
29439 | if ac_fn_c_try_run "$LINENO"; then : | |
63ce7108 | 29440 | gl_cv_func_strstr_linear=yes |
c971b7fa | 29441 | else |
63ce7108 | 29442 | gl_cv_func_strstr_linear=no |
c971b7fa PA |
29443 | fi |
29444 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
29445 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
29446 | fi | |
29447 | ||
29448 | ||
29449 | fi | |
63ce7108 TT |
29450 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_linear" >&5 |
29451 | $as_echo "$gl_cv_func_strstr_linear" >&6; } | |
29452 | case "$gl_cv_func_strstr_linear" in | |
40a73391 JK |
29453 | *yes) ;; |
29454 | *) | |
63ce7108 | 29455 | REPLACE_STRSTR=1 |
40a73391 JK |
29456 | ;; |
29457 | esac | |
c971b7fa PA |
29458 | fi |
29459 | ||
63ce7108 | 29460 | if test $REPLACE_STRSTR = 1; then |
c971b7fa PA |
29461 | |
29462 | ||
29463 | ||
29464 | ||
29465 | ||
29466 | ||
29467 | ||
29468 | ||
63ce7108 | 29469 | gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext" |
c971b7fa | 29470 | |
a512b375 | 29471 | fi |
c971b7fa PA |
29472 | |
29473 | ||
29474 | ||
9c9d63b1 | 29475 | if test $REPLACE_MEMCHR = 1; then |
63ce7108 | 29476 | REPLACE_STRSTR=1 |
c971b7fa | 29477 | else |
c0c3707f | 29478 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5 |
63ce7108 | 29479 | $as_echo_n "checking whether strstr works... " >&6; } |
d0ac1c44 | 29480 | if ${gl_cv_func_strstr_works_always+:} false; then : |
c971b7fa PA |
29481 | $as_echo_n "(cached) " >&6 |
29482 | else | |
29483 | if test "$cross_compiling" = yes; then : | |
c0c3707f | 29484 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
c971b7fa PA |
29485 | /* end confdefs.h. */ |
29486 | ||
29487 | #ifdef __GNU_LIBRARY__ | |
29488 | #include <features.h> | |
63ce7108 | 29489 | #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ |
c971b7fa PA |
29490 | || defined __UCLIBC__ |
29491 | Lucky user | |
29492 | #endif | |
29493 | #elif defined __CYGWIN__ | |
29494 | #include <cygwin/version.h> | |
29495 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) | |
29496 | Lucky user | |
29497 | #endif | |
29498 | #else | |
29499 | Lucky user | |
29500 | #endif | |
29501 | ||
29502 | _ACEOF | |
29503 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
29504 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
63ce7108 | 29505 | gl_cv_func_strstr_works_always="guessing yes" |
c971b7fa | 29506 | else |
c0c3707f | 29507 | gl_cv_func_strstr_works_always="$gl_cross_guess_normal" |
c971b7fa PA |
29508 | fi |
29509 | rm -f conftest* | |
29510 | ||
29511 | ||
29512 | else | |
29513 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29514 | /* end confdefs.h. */ | |
29515 | ||
63ce7108 | 29516 | #include <string.h> /* for strstr */ |
c0c3707f CB |
29517 | #ifdef __GNU_LIBRARY__ |
29518 | #include <features.h> | |
29519 | #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28 | |
29520 | Unlucky user | |
29521 | #endif | |
29522 | #endif | |
c971b7fa PA |
29523 | #define P "_EF_BF_BD" |
29524 | #define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P | |
29525 | #define NEEDLE P P P P P | |
29526 | ||
29527 | int | |
29528 | main () | |
29529 | { | |
63ce7108 | 29530 | return !!strstr (HAYSTACK, NEEDLE); |
c971b7fa PA |
29531 | |
29532 | ; | |
29533 | return 0; | |
29534 | } | |
29535 | _ACEOF | |
29536 | if ac_fn_c_try_run "$LINENO"; then : | |
63ce7108 | 29537 | gl_cv_func_strstr_works_always=yes |
c971b7fa | 29538 | else |
63ce7108 | 29539 | gl_cv_func_strstr_works_always=no |
c971b7fa PA |
29540 | fi |
29541 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
29542 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
29543 | fi | |
29544 | ||
29545 | ||
29546 | fi | |
63ce7108 TT |
29547 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5 |
29548 | $as_echo "$gl_cv_func_strstr_works_always" >&6; } | |
29549 | case "$gl_cv_func_strstr_works_always" in | |
40a73391 JK |
29550 | *yes) ;; |
29551 | *) | |
63ce7108 | 29552 | REPLACE_STRSTR=1 |
40a73391 JK |
29553 | ;; |
29554 | esac | |
c971b7fa | 29555 | fi |
8839a007 | 29556 | |
63ce7108 | 29557 | if test $REPLACE_STRSTR = 1; then |
8839a007 | 29558 | |
8690e634 JK |
29559 | |
29560 | ||
8690e634 JK |
29561 | |
29562 | ||
29563 | ||
29564 | ||
29565 | ||
63ce7108 | 29566 | gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext" |
8690e634 | 29567 | |
8690e634 JK |
29568 | fi |
29569 | ||
8690e634 JK |
29570 | |
29571 | ||
8690e634 | 29572 | |
8690e634 | 29573 | |
63ce7108 | 29574 | GNULIB_STRSTR=1 |
8690e634 JK |
29575 | |
29576 | ||
29577 | ||
8690e634 JK |
29578 | |
29579 | ||
63ce7108 | 29580 | $as_echo "#define GNULIB_TEST_STRSTR 1" >>confdefs.h |
8690e634 JK |
29581 | |
29582 | ||
29583 | ||
29584 | ||
29585 | ||
29586 | ||
29587 | ||
421693b0 PA |
29588 | for ac_func in strtok_r |
29589 | do : | |
29590 | ac_fn_c_check_func "$LINENO" "strtok_r" "ac_cv_func_strtok_r" | |
d0ac1c44 | 29591 | if test "x$ac_cv_func_strtok_r" = xyes; then : |
421693b0 PA |
29592 | cat >>confdefs.h <<_ACEOF |
29593 | #define HAVE_STRTOK_R 1 | |
29594 | _ACEOF | |
29595 | ||
29596 | fi | |
29597 | done | |
29598 | ||
29599 | if test $ac_cv_func_strtok_r = yes; then | |
29600 | HAVE_STRTOK_R=1 | |
29601 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtok_r works" >&5 | |
29602 | $as_echo_n "checking whether strtok_r works... " >&6; } | |
d0ac1c44 | 29603 | if ${gl_cv_func_strtok_r_works+:} false; then : |
421693b0 PA |
29604 | $as_echo_n "(cached) " >&6 |
29605 | else | |
29606 | if test "$cross_compiling" = yes; then : | |
c0c3707f CB |
29607 | case "$host_os" in |
29608 | # Guess no on glibc systems. | |
29609 | *-gnu* | gnu*) gl_cv_func_strtok_r_works="guessing no" ;; | |
29610 | # Guess yes on native Windows. | |
29611 | mingw*) gl_cv_func_strtok_r_works="guessing yes" ;; | |
29612 | *) gl_cv_func_strtok_r_works="guessing yes" ;; | |
421693b0 PA |
29613 | esac |
29614 | ||
29615 | else | |
29616 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29617 | /* end confdefs.h. */ | |
29618 | ||
29619 | #ifndef __OPTIMIZE__ | |
29620 | # define __OPTIMIZE__ 1 | |
29621 | #endif | |
29622 | #undef __OPTIMIZE_SIZE__ | |
29623 | #undef __NO_INLINE__ | |
29624 | #include <stdlib.h> | |
29625 | #include <string.h> | |
29626 | ||
29627 | int | |
29628 | main () | |
29629 | { | |
29630 | static const char dummy[] = "\177\01a"; | |
29631 | char delimiters[] = "xxxxxxxx"; | |
29632 | char *save_ptr = (char *) dummy; | |
29633 | strtok_r (delimiters, "x", &save_ptr); | |
29634 | strtok_r (NULL, "x", &save_ptr); | |
29635 | return 0; | |
29636 | ||
29637 | ; | |
29638 | return 0; | |
29639 | } | |
29640 | ||
29641 | _ACEOF | |
29642 | if ac_fn_c_try_run "$LINENO"; then : | |
29643 | gl_cv_func_strtok_r_works=yes | |
29644 | else | |
29645 | gl_cv_func_strtok_r_works=no | |
29646 | fi | |
29647 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
29648 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
29649 | fi | |
29650 | ||
29651 | ||
29652 | fi | |
29653 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtok_r_works" >&5 | |
29654 | $as_echo "$gl_cv_func_strtok_r_works" >&6; } | |
29655 | case "$gl_cv_func_strtok_r_works" in | |
29656 | *no) | |
29657 | UNDEFINE_STRTOK_R=1 | |
29658 | ;; | |
29659 | esac | |
29660 | else | |
29661 | HAVE_STRTOK_R=0 | |
29662 | fi | |
29663 | ||
29664 | if test $ac_cv_have_decl_strtok_r = no; then | |
29665 | HAVE_DECL_STRTOK_R=0 | |
29666 | fi | |
29667 | ||
29668 | if test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1; then | |
29669 | ||
29670 | ||
29671 | ||
29672 | ||
29673 | ||
29674 | ||
29675 | ||
29676 | ||
29677 | gl_LIBOBJS="$gl_LIBOBJS strtok_r.$ac_objext" | |
29678 | ||
29679 | ||
29680 | : | |
29681 | ||
29682 | fi | |
29683 | ||
29684 | ||
29685 | ||
29686 | ||
29687 | ||
29688 | GNULIB_STRTOK_R=1 | |
29689 | ||
29690 | ||
29691 | ||
29692 | ||
29693 | ||
29694 | $as_echo "#define GNULIB_TEST_STRTOK_R 1" >>confdefs.h | |
29695 | ||
29696 | ||
29697 | ||
29698 | ||
29699 | ||
29700 | ||
29701 | ||
8690e634 JK |
29702 | |
29703 | ||
29704 | ||
29705 | ||
29706 | ||
8690e634 | 29707 | |
09607c9e | 29708 | |
698be2d8 CB |
29709 | if test $gl_cv_have_include_next = yes; then |
29710 | gl_cv_next_sys_random_h='<'sys/random.h'>' | |
29711 | else | |
29712 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/random.h>" >&5 | |
29713 | $as_echo_n "checking absolute name of <sys/random.h>... " >&6; } | |
29714 | if ${gl_cv_next_sys_random_h+:} false; then : | |
29715 | $as_echo_n "(cached) " >&6 | |
29716 | else | |
29717 | ||
29718 | if test $ac_cv_header_sys_random_h = yes; then | |
29719 | ||
29720 | ||
29721 | ||
29722 | ||
29723 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29724 | /* end confdefs.h. */ | |
29725 | #include <sys/random.h> | |
29726 | _ACEOF | |
29727 | case "$host_os" in | |
29728 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
29729 | *) gl_absname_cpp="$ac_cpp" ;; | |
29730 | esac | |
29731 | ||
29732 | case "$host_os" in | |
29733 | mingw*) | |
29734 | gl_dirsep_regex='[/\\]' | |
29735 | ;; | |
29736 | *) | |
29737 | gl_dirsep_regex='\/' | |
29738 | ;; | |
29739 | esac | |
29740 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
29741 | gl_header_literal_regex=`echo 'sys/random.h' \ | |
29742 | | sed -e "$gl_make_literal_regex_sed"` | |
29743 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
29744 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
29745 | s|^/[^/]|//&| | |
29746 | p | |
29747 | q | |
29748 | }' | |
29749 | ||
29750 | gl_cv_absolute_sys_random_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
29751 | sed -n "$gl_absolute_header_sed"` | |
29752 | ||
29753 | gl_header=$gl_cv_absolute_sys_random_h | |
29754 | gl_cv_next_sys_random_h='"'$gl_header'"' | |
29755 | else | |
29756 | gl_cv_next_sys_random_h='<'sys/random.h'>' | |
29757 | fi | |
29758 | ||
29759 | ||
29760 | fi | |
29761 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_random_h" >&5 | |
29762 | $as_echo "$gl_cv_next_sys_random_h" >&6; } | |
29763 | fi | |
29764 | NEXT_SYS_RANDOM_H=$gl_cv_next_sys_random_h | |
29765 | ||
29766 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
29767 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
29768 | gl_next_as_first_directive='<'sys/random.h'>' | |
29769 | else | |
29770 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
29771 | gl_next_as_first_directive=$gl_cv_next_sys_random_h | |
29772 | fi | |
29773 | NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H=$gl_next_as_first_directive | |
29774 | ||
29775 | ||
29776 | ||
29777 | ||
29778 | if test $ac_cv_header_sys_random_h = yes; then | |
29779 | HAVE_SYS_RANDOM_H=1 | |
29780 | else | |
29781 | HAVE_SYS_RANDOM_H=0 | |
29782 | fi | |
29783 | ||
29784 | ||
29785 | ||
29786 | if test $ac_cv_header_sys_random_h = yes; then | |
29787 | UNISTD_H_HAVE_SYS_RANDOM_H=1 | |
29788 | fi | |
29789 | ||
29790 | ||
29791 | ||
29792 | ||
29793 | ||
29794 | ||
29795 | ||
29796 | ||
29797 | ||
29798 | ||
29799 | ||
29800 | ||
29801 | ||
29802 | ||
29803 | ||
29804 | ||
29805 | ||
725e2999 JB |
29806 | |
29807 | ||
09607c9e TT |
29808 | |
29809 | ||
29810 | ||
29811 | if test $gl_cv_have_include_next = yes; then | |
29812 | gl_cv_next_sys_stat_h='<'sys/stat.h'>' | |
29813 | else | |
29814 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5 | |
29815 | $as_echo_n "checking absolute name of <sys/stat.h>... " >&6; } | |
d0ac1c44 | 29816 | if ${gl_cv_next_sys_stat_h+:} false; then : |
09607c9e TT |
29817 | $as_echo_n "(cached) " >&6 |
29818 | else | |
29819 | ||
29820 | if test $ac_cv_header_sys_stat_h = yes; then | |
29821 | ||
29822 | ||
4a626d0a PA |
29823 | |
29824 | ||
29825 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
09607c9e TT |
29826 | /* end confdefs.h. */ |
29827 | #include <sys/stat.h> | |
09607c9e | 29828 | _ACEOF |
4a626d0a PA |
29829 | case "$host_os" in |
29830 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
29831 | *) gl_absname_cpp="$ac_cpp" ;; | |
29832 | esac | |
29833 | ||
29834 | case "$host_os" in | |
29835 | mingw*) | |
29836 | gl_dirsep_regex='[/\\]' | |
29837 | ;; | |
29838 | *) | |
29839 | gl_dirsep_regex='\/' | |
29840 | ;; | |
29841 | esac | |
29842 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
29843 | gl_header_literal_regex=`echo 'sys/stat.h' \ | |
29844 | | sed -e "$gl_make_literal_regex_sed"` | |
29845 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
29846 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
29847 | s|^/[^/]|//&| | |
29848 | p | |
29849 | q | |
29850 | }' | |
29851 | ||
29852 | gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
29853 | sed -n "$gl_absolute_header_sed"` | |
29854 | ||
29855 | gl_header=$gl_cv_absolute_sys_stat_h | |
29856 | gl_cv_next_sys_stat_h='"'$gl_header'"' | |
09607c9e TT |
29857 | else |
29858 | gl_cv_next_sys_stat_h='<'sys/stat.h'>' | |
29859 | fi | |
29860 | ||
29861 | ||
29862 | fi | |
29863 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 | |
29864 | $as_echo "$gl_cv_next_sys_stat_h" >&6; } | |
29865 | fi | |
29866 | NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h | |
29867 | ||
29868 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
29869 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
29870 | gl_next_as_first_directive='<'sys/stat.h'>' | |
29871 | else | |
29872 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
29873 | gl_next_as_first_directive=$gl_cv_next_sys_stat_h | |
29874 | fi | |
29875 | NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive | |
29876 | ||
29877 | ||
29878 | ||
29879 | ||
29880 | ||
29881 | ||
29882 | ||
29883 | ||
c0c3707f CB |
29884 | WINDOWS_STAT_TIMESPEC=0 |
29885 | ||
29886 | ||
2196f55f | 29887 | |
09607c9e TT |
29888 | |
29889 | ||
09607c9e | 29890 | |
09607c9e | 29891 | |
09607c9e TT |
29892 | |
29893 | ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h> | |
29894 | #include <sys/stat.h> | |
29895 | " | |
d0ac1c44 | 29896 | if test "x$ac_cv_type_nlink_t" = xyes; then : |
09607c9e TT |
29897 | |
29898 | else | |
29899 | ||
c0c3707f | 29900 | $as_echo "#define nlink_t int" >>confdefs.h |
09607c9e | 29901 | |
c0c3707f | 29902 | fi |
09607c9e TT |
29903 | |
29904 | ||
29905 | ||
29906 | ||
29907 | ||
29908 | ||
29909 | ||
29910 | ||
29911 | ||
29912 | ||
725e2999 JB |
29913 | |
29914 | ||
29915 | ||
29916 | ||
29917 | ||
29918 | ||
725e2999 JB |
29919 | |
29920 | ||
29921 | ||
29922 | ||
29923 | ||
698be2d8 CB |
29924 | |
29925 | ||
725e2999 JB |
29926 | |
29927 | ||
29928 | ||
29929 | if test $gl_cv_have_include_next = yes; then | |
29930 | gl_cv_next_sys_uio_h='<'sys/uio.h'>' | |
29931 | else | |
29932 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5 | |
29933 | $as_echo_n "checking absolute name of <sys/uio.h>... " >&6; } | |
29934 | if ${gl_cv_next_sys_uio_h+:} false; then : | |
29935 | $as_echo_n "(cached) " >&6 | |
29936 | else | |
29937 | ||
29938 | if test $ac_cv_header_sys_uio_h = yes; then | |
29939 | ||
29940 | ||
29941 | ||
29942 | ||
29943 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29944 | /* end confdefs.h. */ | |
29945 | #include <sys/uio.h> | |
29946 | _ACEOF | |
29947 | case "$host_os" in | |
29948 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
29949 | *) gl_absname_cpp="$ac_cpp" ;; | |
29950 | esac | |
29951 | ||
29952 | case "$host_os" in | |
29953 | mingw*) | |
29954 | gl_dirsep_regex='[/\\]' | |
29955 | ;; | |
29956 | *) | |
29957 | gl_dirsep_regex='\/' | |
29958 | ;; | |
29959 | esac | |
29960 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
29961 | gl_header_literal_regex=`echo 'sys/uio.h' \ | |
29962 | | sed -e "$gl_make_literal_regex_sed"` | |
29963 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
29964 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
29965 | s|^/[^/]|//&| | |
29966 | p | |
29967 | q | |
29968 | }' | |
29969 | ||
29970 | gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
29971 | sed -n "$gl_absolute_header_sed"` | |
29972 | ||
29973 | gl_header=$gl_cv_absolute_sys_uio_h | |
29974 | gl_cv_next_sys_uio_h='"'$gl_header'"' | |
29975 | else | |
29976 | gl_cv_next_sys_uio_h='<'sys/uio.h'>' | |
29977 | fi | |
29978 | ||
29979 | ||
29980 | fi | |
29981 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5 | |
29982 | $as_echo "$gl_cv_next_sys_uio_h" >&6; } | |
29983 | fi | |
29984 | NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h | |
29985 | ||
29986 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
29987 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
29988 | gl_next_as_first_directive='<'sys/uio.h'>' | |
29989 | else | |
29990 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
29991 | gl_next_as_first_directive=$gl_cv_next_sys_uio_h | |
29992 | fi | |
29993 | NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive | |
29994 | ||
29995 | ||
29996 | ||
29997 | ||
29998 | if test $ac_cv_header_sys_uio_h = yes; then | |
29999 | HAVE_SYS_UIO_H=1 | |
30000 | else | |
30001 | HAVE_SYS_UIO_H=0 | |
30002 | fi | |
30003 | ||
30004 | ||
30005 | ||
30006 | ||
30007 | ||
2d8adcbd MM |
30008 | : |
30009 | ||
30010 | ||
30011 | ||
30012 | ||
9c9d63b1 PM |
30013 | cat >>confdefs.h <<_ACEOF |
30014 | #define GNULIB_TEMPNAME 1 | |
30015 | _ACEOF | |
30016 | ||
30017 | ||
30018 | ||
30019 | ||
09607c9e TT |
30020 | |
30021 | ||
30022 | ||
8839a007 PA |
30023 | |
30024 | ||
30025 | ||
30026 | ||
09607c9e | 30027 | |
c0c3707f CB |
30028 | ac_fn_c_check_decl "$LINENO" "localtime_r" "ac_cv_have_decl_localtime_r" "/* mingw's <time.h> provides the functions asctime_r, ctime_r, |
30029 | gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has | |
30030 | been included before. */ | |
30031 | #if defined __MINGW32__ | |
30032 | # include <unistd.h> | |
30033 | #endif | |
30034 | #include <time.h> | |
09607c9e | 30035 | |
f8e27d88 CB |
30036 | " |
30037 | if test "x$ac_cv_have_decl_localtime_r" = xyes; then : | |
30038 | ac_have_decl=1 | |
30039 | else | |
30040 | ac_have_decl=0 | |
30041 | fi | |
30042 | ||
30043 | cat >>confdefs.h <<_ACEOF | |
30044 | #define HAVE_DECL_LOCALTIME_R $ac_have_decl | |
30045 | _ACEOF | |
30046 | ||
30047 | if test $ac_cv_have_decl_localtime_r = no; then | |
30048 | HAVE_DECL_LOCALTIME_R=0 | |
30049 | fi | |
30050 | ||
30051 | ||
f8e27d88 CB |
30052 | if test $ac_cv_func_localtime_r = yes; then |
30053 | HAVE_LOCALTIME_R=1 | |
30054 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5 | |
30055 | $as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; } | |
30056 | if ${gl_cv_time_r_posix+:} false; then : | |
30057 | $as_echo_n "(cached) " >&6 | |
30058 | else | |
30059 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
30060 | /* end confdefs.h. */ | |
c0c3707f CB |
30061 | /* mingw's <time.h> provides the functions asctime_r, ctime_r, |
30062 | gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has | |
30063 | been included before. */ | |
30064 | #if defined __MINGW32__ | |
30065 | # include <unistd.h> | |
30066 | #endif | |
30067 | #include <time.h> | |
30068 | ||
f8e27d88 CB |
30069 | int |
30070 | main () | |
30071 | { | |
30072 | /* We don't need to append 'restrict's to the argument types, | |
30073 | even though the POSIX signature has the 'restrict's, | |
30074 | since C99 says they can't affect type compatibility. */ | |
30075 | struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; | |
30076 | if (ptr) return 0; | |
30077 | /* Check the return type is a pointer. | |
30078 | On HP-UX 10 it is 'int'. */ | |
30079 | *localtime_r (0, 0); | |
30080 | ; | |
30081 | return 0; | |
30082 | } | |
30083 | ||
30084 | _ACEOF | |
30085 | if ac_fn_c_try_compile "$LINENO"; then : | |
30086 | gl_cv_time_r_posix=yes | |
30087 | else | |
30088 | gl_cv_time_r_posix=no | |
30089 | fi | |
30090 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
30091 | ||
30092 | fi | |
30093 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5 | |
30094 | $as_echo "$gl_cv_time_r_posix" >&6; } | |
30095 | if test $gl_cv_time_r_posix = yes; then | |
30096 | REPLACE_LOCALTIME_R=0 | |
30097 | else | |
30098 | REPLACE_LOCALTIME_R=1 | |
30099 | fi | |
30100 | else | |
30101 | HAVE_LOCALTIME_R=0 | |
c0c3707f CB |
30102 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r exists as an inline function" >&5 |
30103 | $as_echo_n "checking whether localtime_r exists as an inline function... " >&6; } | |
30104 | if ${gl_cv_func_localtime_r_inline+:} false; then : | |
30105 | $as_echo_n "(cached) " >&6 | |
30106 | else | |
30107 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
30108 | /* end confdefs.h. */ | |
30109 | /* mingw's <time.h> provides the functions asctime_r, ctime_r, | |
30110 | gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has | |
30111 | been included before. */ | |
30112 | #if defined __MINGW32__ | |
30113 | # include <unistd.h> | |
30114 | #endif | |
30115 | #include <time.h> | |
30116 | ||
30117 | int | |
30118 | main () | |
30119 | { | |
30120 | time_t a; | |
30121 | struct tm r; | |
30122 | localtime_r (&a, &r); | |
30123 | ||
30124 | ; | |
30125 | return 0; | |
30126 | } | |
30127 | ||
30128 | _ACEOF | |
30129 | if ac_fn_c_try_link "$LINENO"; then : | |
30130 | gl_cv_func_localtime_r_inline=yes | |
30131 | else | |
30132 | gl_cv_func_localtime_r_inline=no | |
30133 | fi | |
30134 | rm -f core conftest.err conftest.$ac_objext \ | |
30135 | conftest$ac_exeext conftest.$ac_ext | |
30136 | ||
30137 | fi | |
30138 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_localtime_r_inline" >&5 | |
30139 | $as_echo "$gl_cv_func_localtime_r_inline" >&6; } | |
30140 | if test $gl_cv_func_localtime_r_inline = yes; then | |
30141 | REPLACE_LOCALTIME_R=1 | |
30142 | fi | |
f8e27d88 CB |
30143 | fi |
30144 | ||
30145 | if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then | |
30146 | ||
30147 | ||
30148 | ||
30149 | ||
30150 | ||
30151 | ||
30152 | ||
30153 | ||
30154 | gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext" | |
30155 | ||
30156 | ||
30157 | : | |
30158 | ||
30159 | fi | |
30160 | ||
30161 | ||
30162 | ||
30163 | ||
30164 | ||
30165 | GNULIB_TIME_R=1 | |
30166 | ||
30167 | ||
30168 | ||
30169 | ||
30170 | ||
30171 | $as_echo "#define GNULIB_TEST_TIME_R 1" >>confdefs.h | |
30172 | ||
30173 | ||
30174 | ||
30175 | ||
30176 | ||
30177 | ||
30178 | ||
30179 | ||
30180 | ||
5abebf3c CB |
30181 | |
30182 | ||
30183 | ||
8839a007 PA |
30184 | |
30185 | ||
30186 | ||
30187 | if test $gl_cv_have_include_next = yes; then | |
30188 | gl_cv_next_unistd_h='<'unistd.h'>' | |
30189 | else | |
30190 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5 | |
30191 | $as_echo_n "checking absolute name of <unistd.h>... " >&6; } | |
d0ac1c44 | 30192 | if ${gl_cv_next_unistd_h+:} false; then : |
8839a007 PA |
30193 | $as_echo_n "(cached) " >&6 |
30194 | else | |
30195 | ||
30196 | if test $ac_cv_header_unistd_h = yes; then | |
30197 | ||
30198 | ||
4a626d0a PA |
30199 | |
30200 | ||
30201 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8839a007 PA |
30202 | /* end confdefs.h. */ |
30203 | #include <unistd.h> | |
8839a007 | 30204 | _ACEOF |
4a626d0a PA |
30205 | case "$host_os" in |
30206 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
30207 | *) gl_absname_cpp="$ac_cpp" ;; | |
30208 | esac | |
30209 | ||
30210 | case "$host_os" in | |
30211 | mingw*) | |
30212 | gl_dirsep_regex='[/\\]' | |
30213 | ;; | |
30214 | *) | |
30215 | gl_dirsep_regex='\/' | |
30216 | ;; | |
30217 | esac | |
30218 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
30219 | gl_header_literal_regex=`echo 'unistd.h' \ | |
30220 | | sed -e "$gl_make_literal_regex_sed"` | |
30221 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
30222 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
30223 | s|^/[^/]|//&| | |
30224 | p | |
30225 | q | |
30226 | }' | |
30227 | ||
30228 | gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
30229 | sed -n "$gl_absolute_header_sed"` | |
30230 | ||
30231 | gl_header=$gl_cv_absolute_unistd_h | |
30232 | gl_cv_next_unistd_h='"'$gl_header'"' | |
8839a007 PA |
30233 | else |
30234 | gl_cv_next_unistd_h='<'unistd.h'>' | |
30235 | fi | |
30236 | ||
30237 | ||
30238 | fi | |
30239 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5 | |
30240 | $as_echo "$gl_cv_next_unistd_h" >&6; } | |
30241 | fi | |
30242 | NEXT_UNISTD_H=$gl_cv_next_unistd_h | |
30243 | ||
30244 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
30245 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
30246 | gl_next_as_first_directive='<'unistd.h'>' | |
30247 | else | |
30248 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
30249 | gl_next_as_first_directive=$gl_cv_next_unistd_h | |
30250 | fi | |
30251 | NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive | |
30252 | ||
30253 | ||
30254 | ||
30255 | ||
30256 | if test $ac_cv_header_unistd_h = yes; then | |
30257 | HAVE_UNISTD_H=1 | |
30258 | else | |
30259 | HAVE_UNISTD_H=0 | |
30260 | fi | |
30261 | ||
30262 | ||
30263 | ||
30264 | ||
30265 | ||
30266 | ||
30267 | ||
472fa5ee SM |
30268 | |
30269 | ||
30270 | ||
30271 | ||
30272 | ||
8839a007 | 30273 | |
9c9d63b1 PM |
30274 | if test $ac_cv_have_decl_execvpe = no; then |
30275 | HAVE_DECL_EXECVPE=0 | |
30276 | fi | |
30277 | ||
30278 | ||
6ec2e0f5 SDJ |
30279 | |
30280 | ||
30281 | ||
698be2d8 CB |
30282 | |
30283 | ||
3d99e817 AK |
30284 | if test $ac_cv_have_decl_unsetenv = no; then |
30285 | HAVE_DECL_UNSETENV=0 | |
30286 | fi | |
30287 | for ac_func in unsetenv | |
30288 | do : | |
30289 | ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" | |
d0ac1c44 | 30290 | if test "x$ac_cv_func_unsetenv" = xyes; then : |
3d99e817 AK |
30291 | cat >>confdefs.h <<_ACEOF |
30292 | #define HAVE_UNSETENV 1 | |
30293 | _ACEOF | |
30294 | ||
30295 | fi | |
30296 | done | |
30297 | ||
30298 | if test $ac_cv_func_unsetenv = no; then | |
30299 | HAVE_UNSETENV=0 | |
30300 | else | |
30301 | HAVE_UNSETENV=1 | |
30302 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5 | |
30303 | $as_echo_n "checking for unsetenv() return type... " >&6; } | |
d0ac1c44 | 30304 | if ${gt_cv_func_unsetenv_ret+:} false; then : |
3d99e817 AK |
30305 | $as_echo_n "(cached) " >&6 |
30306 | else | |
30307 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
30308 | /* end confdefs.h. */ | |
30309 | ||
30310 | #undef _BSD | |
30311 | #define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */ | |
30312 | #include <stdlib.h> | |
30313 | extern | |
30314 | #ifdef __cplusplus | |
30315 | "C" | |
30316 | #endif | |
30317 | int unsetenv (const char *name); | |
30318 | ||
30319 | int | |
30320 | main () | |
30321 | { | |
30322 | ||
30323 | ; | |
30324 | return 0; | |
30325 | } | |
30326 | _ACEOF | |
30327 | if ac_fn_c_try_compile "$LINENO"; then : | |
30328 | gt_cv_func_unsetenv_ret='int' | |
30329 | else | |
30330 | gt_cv_func_unsetenv_ret='void' | |
30331 | fi | |
30332 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
30333 | fi | |
30334 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5 | |
30335 | $as_echo "$gt_cv_func_unsetenv_ret" >&6; } | |
30336 | if test $gt_cv_func_unsetenv_ret = 'void'; then | |
30337 | ||
30338 | $as_echo "#define VOID_UNSETENV 1" >>confdefs.h | |
30339 | ||
30340 | REPLACE_UNSETENV=1 | |
30341 | fi | |
30342 | ||
30343 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5 | |
30344 | $as_echo_n "checking whether unsetenv obeys POSIX... " >&6; } | |
d0ac1c44 | 30345 | if ${gl_cv_func_unsetenv_works+:} false; then : |
3d99e817 AK |
30346 | $as_echo_n "(cached) " >&6 |
30347 | else | |
30348 | if test "$cross_compiling" = yes; then : | |
30349 | case "$host_os" in | |
9c9d63b1 PM |
30350 | # Guess yes on glibc systems. |
30351 | *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;; | |
30352 | # If we don't know, obey --enable-cross-guesses. | |
30353 | *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;; | |
30354 | esac | |
3d99e817 AK |
30355 | |
30356 | else | |
30357 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
30358 | /* end confdefs.h. */ | |
30359 | ||
9c9d63b1 PM |
30360 | #include <stdlib.h> |
30361 | #include <errno.h> | |
30362 | extern char **environ; | |
30363 | ||
30364 | ||
30365 | $gl_mda_defines | |
3d99e817 AK |
30366 | |
30367 | int | |
30368 | main () | |
30369 | { | |
30370 | ||
9c9d63b1 PM |
30371 | char entry1[] = "a=1"; |
30372 | char entry2[] = "b=2"; | |
30373 | char *env[] = { entry1, entry2, NULL }; | |
30374 | if (putenv ((char *) "a=1")) return 1; | |
30375 | if (putenv (entry2)) return 2; | |
30376 | entry2[0] = 'a'; | |
30377 | unsetenv ("a"); | |
30378 | if (getenv ("a")) return 3; | |
30379 | if (!unsetenv ("") || errno != EINVAL) return 4; | |
30380 | entry2[0] = 'b'; | |
30381 | environ = env; | |
30382 | if (!getenv ("a")) return 5; | |
30383 | entry2[0] = 'a'; | |
30384 | unsetenv ("a"); | |
30385 | if (getenv ("a")) return 6; | |
3d99e817 AK |
30386 | |
30387 | ; | |
30388 | return 0; | |
30389 | } | |
30390 | _ACEOF | |
30391 | if ac_fn_c_try_run "$LINENO"; then : | |
30392 | gl_cv_func_unsetenv_works=yes | |
30393 | else | |
30394 | gl_cv_func_unsetenv_works=no | |
30395 | fi | |
30396 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
30397 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
30398 | fi | |
30399 | ||
9c9d63b1 | 30400 | |
3d99e817 AK |
30401 | fi |
30402 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5 | |
30403 | $as_echo "$gl_cv_func_unsetenv_works" >&6; } | |
30404 | case "$gl_cv_func_unsetenv_works" in | |
30405 | *yes) ;; | |
30406 | *) | |
30407 | REPLACE_UNSETENV=1 | |
30408 | ;; | |
30409 | esac | |
30410 | fi | |
30411 | ||
30412 | if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then | |
30413 | ||
30414 | ||
30415 | ||
30416 | ||
30417 | ||
30418 | ||
30419 | ||
30420 | ||
30421 | gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext" | |
30422 | ||
30423 | ||
30424 | ||
30425 | ||
30426 | ||
30427 | fi | |
30428 | ||
30429 | ||
30430 | ||
30431 | ||
30432 | ||
30433 | GNULIB_UNSETENV=1 | |
30434 | ||
30435 | ||
30436 | ||
30437 | ||
30438 | ||
30439 | $as_echo "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h | |
30440 | ||
30441 | ||
30442 | ||
30443 | ||
30444 | ||
30445 | ||
8839a007 PA |
30446 | |
30447 | ||
30448 | ||
30449 | ||
30450 | ||
30451 | ||
30452 | ||
8690e634 JK |
30453 | |
30454 | ||
30455 | if test $gl_cv_have_include_next = yes; then | |
30456 | gl_cv_next_wchar_h='<'wchar.h'>' | |
30457 | else | |
30458 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5 | |
30459 | $as_echo_n "checking absolute name of <wchar.h>... " >&6; } | |
d0ac1c44 | 30460 | if ${gl_cv_next_wchar_h+:} false; then : |
8690e634 JK |
30461 | $as_echo_n "(cached) " >&6 |
30462 | else | |
30463 | ||
30464 | if test $ac_cv_header_wchar_h = yes; then | |
30465 | ||
30466 | ||
4a626d0a PA |
30467 | |
30468 | ||
30469 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 JK |
30470 | /* end confdefs.h. */ |
30471 | #include <wchar.h> | |
8690e634 | 30472 | _ACEOF |
4a626d0a PA |
30473 | case "$host_os" in |
30474 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
30475 | *) gl_absname_cpp="$ac_cpp" ;; | |
30476 | esac | |
30477 | ||
30478 | case "$host_os" in | |
30479 | mingw*) | |
30480 | gl_dirsep_regex='[/\\]' | |
30481 | ;; | |
30482 | *) | |
30483 | gl_dirsep_regex='\/' | |
30484 | ;; | |
30485 | esac | |
30486 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
30487 | gl_header_literal_regex=`echo 'wchar.h' \ | |
30488 | | sed -e "$gl_make_literal_regex_sed"` | |
30489 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
30490 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
30491 | s|^/[^/]|//&| | |
30492 | p | |
30493 | q | |
30494 | }' | |
30495 | ||
30496 | gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
30497 | sed -n "$gl_absolute_header_sed"` | |
30498 | ||
30499 | gl_header=$gl_cv_absolute_wchar_h | |
30500 | gl_cv_next_wchar_h='"'$gl_header'"' | |
8690e634 JK |
30501 | else |
30502 | gl_cv_next_wchar_h='<'wchar.h'>' | |
30503 | fi | |
30504 | ||
30505 | ||
30506 | fi | |
30507 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5 | |
30508 | $as_echo "$gl_cv_next_wchar_h" >&6; } | |
30509 | fi | |
30510 | NEXT_WCHAR_H=$gl_cv_next_wchar_h | |
30511 | ||
30512 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
30513 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
30514 | gl_next_as_first_directive='<'wchar.h'>' | |
30515 | else | |
30516 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
30517 | gl_next_as_first_directive=$gl_cv_next_wchar_h | |
30518 | fi | |
30519 | NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive | |
30520 | ||
30521 | ||
30522 | ||
30523 | ||
30524 | if test $ac_cv_header_wchar_h = yes; then | |
30525 | HAVE_WCHAR_H=1 | |
30526 | else | |
30527 | HAVE_WCHAR_H=0 | |
30528 | fi | |
30529 | ||
c971b7fa PA |
30530 | |
30531 | ||
30532 | ||
30533 | ||
8690e634 JK |
30534 | if test $gt_cv_c_wint_t = yes; then |
30535 | HAVE_WINT_T=1 | |
30536 | else | |
30537 | HAVE_WINT_T=0 | |
30538 | fi | |
c971b7fa PA |
30539 | |
30540 | ||
30541 | ||
8690e634 JK |
30542 | |
30543 | ||
30544 | ||
30545 | ||
30546 | ||
472fa5ee SM |
30547 | |
30548 | ||
9c9d63b1 PM |
30549 | ac_fn_c_check_decl "$LINENO" "wcsdup" "ac_cv_have_decl_wcsdup" " |
30550 | #include <wchar.h> | |
30551 | ||
30552 | " | |
30553 | if test "x$ac_cv_have_decl_wcsdup" = xyes; then : | |
30554 | ac_have_decl=1 | |
30555 | else | |
30556 | ac_have_decl=0 | |
30557 | fi | |
30558 | ||
30559 | cat >>confdefs.h <<_ACEOF | |
30560 | #define HAVE_DECL_WCSDUP $ac_have_decl | |
30561 | _ACEOF | |
30562 | ||
30563 | if test $ac_cv_have_decl_wcsdup = no; then | |
30564 | HAVE_DECL_WCSDUP=0 | |
30565 | fi | |
30566 | ||
472fa5ee SM |
30567 | |
30568 | ||
30569 | ||
698be2d8 CB |
30570 | |
30571 | ||
8690e634 JK |
30572 | if test $ac_cv_func_iswcntrl = yes; then |
30573 | HAVE_ISWCNTRL=1 | |
30574 | else | |
30575 | HAVE_ISWCNTRL=0 | |
30576 | fi | |
30577 | ||
30578 | ||
30579 | ||
8690e634 JK |
30580 | if test $gt_cv_c_wint_t = yes; then |
30581 | HAVE_WINT_T=1 | |
30582 | else | |
30583 | HAVE_WINT_T=0 | |
30584 | fi | |
30585 | ||
30586 | ||
30587 | ||
30588 | ||
30589 | ||
30590 | ||
c971b7fa | 30591 | |
8690e634 | 30592 | |
472fa5ee SM |
30593 | |
30594 | ||
c971b7fa PA |
30595 | |
30596 | ||
30597 | ||
30598 | if test $gl_cv_have_include_next = yes; then | |
8690e634 | 30599 | gl_cv_next_wctype_h='<'wctype.h'>' |
c971b7fa | 30600 | else |
8690e634 JK |
30601 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5 |
30602 | $as_echo_n "checking absolute name of <wctype.h>... " >&6; } | |
d0ac1c44 | 30603 | if ${gl_cv_next_wctype_h+:} false; then : |
c971b7fa PA |
30604 | $as_echo_n "(cached) " >&6 |
30605 | else | |
30606 | ||
8690e634 JK |
30607 | if test $ac_cv_header_wctype_h = yes; then |
30608 | ||
30609 | ||
4a626d0a PA |
30610 | |
30611 | ||
30612 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c971b7fa | 30613 | /* end confdefs.h. */ |
8690e634 | 30614 | #include <wctype.h> |
c971b7fa | 30615 | _ACEOF |
4a626d0a PA |
30616 | case "$host_os" in |
30617 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
30618 | *) gl_absname_cpp="$ac_cpp" ;; | |
30619 | esac | |
30620 | ||
30621 | case "$host_os" in | |
30622 | mingw*) | |
30623 | gl_dirsep_regex='[/\\]' | |
30624 | ;; | |
30625 | *) | |
30626 | gl_dirsep_regex='\/' | |
30627 | ;; | |
30628 | esac | |
30629 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
30630 | gl_header_literal_regex=`echo 'wctype.h' \ | |
30631 | | sed -e "$gl_make_literal_regex_sed"` | |
30632 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
30633 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
30634 | s|^/[^/]|//&| | |
30635 | p | |
30636 | q | |
30637 | }' | |
30638 | ||
30639 | gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
30640 | sed -n "$gl_absolute_header_sed"` | |
30641 | ||
30642 | gl_header=$gl_cv_absolute_wctype_h | |
30643 | gl_cv_next_wctype_h='"'$gl_header'"' | |
8690e634 JK |
30644 | else |
30645 | gl_cv_next_wctype_h='<'wctype.h'>' | |
30646 | fi | |
c971b7fa PA |
30647 | |
30648 | ||
30649 | fi | |
8690e634 JK |
30650 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 |
30651 | $as_echo "$gl_cv_next_wctype_h" >&6; } | |
c971b7fa | 30652 | fi |
8690e634 | 30653 | NEXT_WCTYPE_H=$gl_cv_next_wctype_h |
c971b7fa PA |
30654 | |
30655 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
30656 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
8690e634 | 30657 | gl_next_as_first_directive='<'wctype.h'>' |
c971b7fa PA |
30658 | else |
30659 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
8690e634 | 30660 | gl_next_as_first_directive=$gl_cv_next_wctype_h |
c971b7fa | 30661 | fi |
8690e634 JK |
30662 | NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive |
30663 | ||
30664 | ||
30665 | ||
30666 | ||
30667 | if test $ac_cv_header_wctype_h = yes; then | |
30668 | if test $ac_cv_func_iswcntrl = yes; then | |
30669 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 | |
30670 | $as_echo_n "checking whether iswcntrl works... " >&6; } | |
d0ac1c44 | 30671 | if ${gl_cv_func_iswcntrl_works+:} false; then : |
8690e634 JK |
30672 | $as_echo_n "(cached) " >&6 |
30673 | else | |
30674 | ||
30675 | if test "$cross_compiling" = yes; then : | |
c0c3707f | 30676 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8690e634 JK |
30677 | /* end confdefs.h. */ |
30678 | #include <stdlib.h> | |
30679 | #if __GNU_LIBRARY__ == 1 | |
30680 | Linux libc5 i18n is broken. | |
30681 | #endif | |
30682 | int | |
30683 | main () | |
30684 | { | |
30685 | ||
30686 | ; | |
30687 | return 0; | |
30688 | } | |
30689 | _ACEOF | |
30690 | if ac_fn_c_try_compile "$LINENO"; then : | |
30691 | gl_cv_func_iswcntrl_works="guessing yes" | |
30692 | else | |
30693 | gl_cv_func_iswcntrl_works="guessing no" | |
30694 | fi | |
30695 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
30696 | ||
30697 | else | |
30698 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
30699 | /* end confdefs.h. */ | |
30700 | ||
8690e634 JK |
30701 | #include <wchar.h> |
30702 | #include <wctype.h> | |
30703 | int main () { return iswprint ('x') == 0; } | |
30704 | ||
30705 | _ACEOF | |
30706 | if ac_fn_c_try_run "$LINENO"; then : | |
30707 | gl_cv_func_iswcntrl_works=yes | |
30708 | else | |
30709 | gl_cv_func_iswcntrl_works=no | |
30710 | fi | |
30711 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
30712 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
30713 | fi | |
30714 | ||
30715 | ||
30716 | fi | |
30717 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 | |
30718 | $as_echo "$gl_cv_func_iswcntrl_works" >&6; } | |
30719 | fi | |
30720 | HAVE_WCTYPE_H=1 | |
30721 | else | |
30722 | HAVE_WCTYPE_H=0 | |
30723 | fi | |
30724 | ||
30725 | ||
c0c3707f CB |
30726 | if test $GNULIB_OVERRIDES_WINT_T = 1; then |
30727 | REPLACE_ISWCNTRL=1 | |
30728 | else | |
30729 | case "$gl_cv_func_iswcntrl_works" in | |
30730 | *yes) REPLACE_ISWCNTRL=0 ;; | |
30731 | *) REPLACE_ISWCNTRL=1 ;; | |
30732 | esac | |
30733 | fi | |
8690e634 JK |
30734 | |
30735 | ||
30736 | if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then | |
30737 | : | |
30738 | fi | |
30739 | ||
30740 | if test $REPLACE_ISWCNTRL = 1; then | |
30741 | REPLACE_TOWLOWER=1 | |
30742 | else | |
30743 | for ac_func in towlower | |
30744 | do : | |
30745 | ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" | |
d0ac1c44 | 30746 | if test "x$ac_cv_func_towlower" = xyes; then : |
8690e634 JK |
30747 | cat >>confdefs.h <<_ACEOF |
30748 | #define HAVE_TOWLOWER 1 | |
30749 | _ACEOF | |
30750 | ||
30751 | fi | |
30752 | done | |
30753 | ||
30754 | if test $ac_cv_func_towlower = yes; then | |
30755 | REPLACE_TOWLOWER=0 | |
30756 | else | |
9c9d63b1 | 30757 | ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "#include <wchar.h> |
8690e634 JK |
30758 | #if HAVE_WCTYPE_H |
30759 | # include <wctype.h> | |
30760 | #endif | |
30761 | ||
30762 | " | |
d0ac1c44 | 30763 | if test "x$ac_cv_have_decl_towlower" = xyes; then : |
8690e634 JK |
30764 | ac_have_decl=1 |
30765 | else | |
30766 | ac_have_decl=0 | |
30767 | fi | |
30768 | ||
30769 | cat >>confdefs.h <<_ACEOF | |
30770 | #define HAVE_DECL_TOWLOWER $ac_have_decl | |
30771 | _ACEOF | |
30772 | ||
30773 | if test $ac_cv_have_decl_towlower = yes; then | |
30774 | REPLACE_TOWLOWER=1 | |
30775 | else | |
30776 | REPLACE_TOWLOWER=0 | |
30777 | fi | |
30778 | fi | |
30779 | fi | |
30780 | ||
30781 | ||
30782 | if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then | |
30783 | : | |
30784 | fi | |
30785 | ||
30786 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 | |
30787 | $as_echo_n "checking for wctype_t... " >&6; } | |
d0ac1c44 | 30788 | if ${gl_cv_type_wctype_t+:} false; then : |
8690e634 JK |
30789 | $as_echo_n "(cached) " >&6 |
30790 | else | |
30791 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
30792 | /* end confdefs.h. */ | |
9c9d63b1 | 30793 | #include <wchar.h> |
8690e634 JK |
30794 | #if HAVE_WCTYPE_H |
30795 | # include <wctype.h> | |
30796 | #endif | |
30797 | wctype_t a; | |
30798 | ||
30799 | int | |
30800 | main () | |
30801 | { | |
30802 | ||
30803 | ; | |
30804 | return 0; | |
30805 | } | |
30806 | _ACEOF | |
30807 | if ac_fn_c_try_compile "$LINENO"; then : | |
30808 | gl_cv_type_wctype_t=yes | |
30809 | else | |
30810 | gl_cv_type_wctype_t=no | |
30811 | fi | |
30812 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c971b7fa | 30813 | |
8690e634 JK |
30814 | fi |
30815 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 | |
30816 | $as_echo "$gl_cv_type_wctype_t" >&6; } | |
30817 | if test $gl_cv_type_wctype_t = no; then | |
30818 | HAVE_WCTYPE_T=0 | |
30819 | fi | |
30820 | ||
30821 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 | |
30822 | $as_echo_n "checking for wctrans_t... " >&6; } | |
d0ac1c44 | 30823 | if ${gl_cv_type_wctrans_t+:} false; then : |
8690e634 JK |
30824 | $as_echo_n "(cached) " >&6 |
30825 | else | |
30826 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
30827 | /* end confdefs.h. */ | |
9c9d63b1 | 30828 | #include <wchar.h> |
8690e634 JK |
30829 | #include <wctype.h> |
30830 | wctrans_t a; | |
c971b7fa | 30831 | |
8690e634 JK |
30832 | int |
30833 | main () | |
30834 | { | |
c971b7fa | 30835 | |
8690e634 JK |
30836 | ; |
30837 | return 0; | |
30838 | } | |
30839 | _ACEOF | |
30840 | if ac_fn_c_try_compile "$LINENO"; then : | |
30841 | gl_cv_type_wctrans_t=yes | |
30842 | else | |
30843 | gl_cv_type_wctrans_t=no | |
30844 | fi | |
30845 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c971b7fa | 30846 | |
8690e634 JK |
30847 | fi |
30848 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 | |
30849 | $as_echo "$gl_cv_type_wctrans_t" >&6; } | |
30850 | if test $gl_cv_type_wctrans_t = no; then | |
30851 | HAVE_WCTRANS_T=0 | |
c971b7fa PA |
30852 | fi |
30853 | ||
30854 | ||
5e8754f9 | 30855 | |
5e8754f9 | 30856 | |
c971b7fa | 30857 | |
c0c3707f CB |
30858 | |
30859 | case "$host_os" in | |
30860 | mingw*) | |
30861 | ||
30862 | ||
30863 | ||
30864 | ||
30865 | ||
30866 | ||
30867 | ||
30868 | ||
30869 | gl_LIBOBJS="$gl_LIBOBJS windows-mutex.$ac_objext" | |
30870 | ||
30871 | ;; | |
30872 | esac | |
30873 | ||
30874 | case "$host_os" in | |
30875 | mingw*) | |
30876 | ||
30877 | ||
30878 | ||
30879 | ||
30880 | ||
30881 | ||
30882 | ||
30883 | ||
30884 | gl_LIBOBJS="$gl_LIBOBJS windows-once.$ac_objext" | |
30885 | ||
30886 | ;; | |
30887 | esac | |
30888 | ||
30889 | case "$host_os" in | |
30890 | mingw*) | |
30891 | ||
30892 | ||
c971b7fa PA |
30893 | |
30894 | ||
c0c3707f CB |
30895 | |
30896 | ||
30897 | ||
30898 | ||
30899 | gl_LIBOBJS="$gl_LIBOBJS windows-recmutex.$ac_objext" | |
30900 | ||
30901 | ;; | |
30902 | esac | |
30903 | ||
30904 | case "$host_os" in | |
30905 | mingw*) | |
30906 | ||
30907 | ||
30908 | ||
30909 | ||
30910 | ||
30911 | ||
30912 | ||
30913 | ||
30914 | gl_LIBOBJS="$gl_LIBOBJS windows-rwlock.$ac_objext" | |
30915 | ||
30916 | ;; | |
30917 | esac | |
698be2d8 CB |
30918 | |
30919 | ||
30920 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wmemchr" >&5 | |
30921 | $as_echo_n "checking for wmemchr... " >&6; } | |
30922 | if ${gl_cv_func_wmemchr+:} false; then : | |
30923 | $as_echo_n "(cached) " >&6 | |
30924 | else | |
30925 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
30926 | /* end confdefs.h. */ | |
698be2d8 CB |
30927 | #include <wchar.h> |
30928 | ||
30929 | int | |
30930 | main () | |
30931 | { | |
30932 | return ! wmemchr ((const wchar_t *) 0, (wchar_t) ' ', 0); | |
30933 | ; | |
30934 | return 0; | |
30935 | } | |
30936 | ||
30937 | _ACEOF | |
30938 | if ac_fn_c_try_link "$LINENO"; then : | |
30939 | gl_cv_func_wmemchr=yes | |
30940 | else | |
30941 | gl_cv_func_wmemchr=no | |
30942 | fi | |
30943 | rm -f core conftest.err conftest.$ac_objext \ | |
30944 | conftest$ac_exeext conftest.$ac_ext | |
30945 | ||
30946 | fi | |
30947 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wmemchr" >&5 | |
30948 | $as_echo "$gl_cv_func_wmemchr" >&6; } | |
30949 | if test $gl_cv_func_wmemchr = no; then | |
30950 | HAVE_WMEMCHR=0 | |
30951 | fi | |
30952 | ||
30953 | if test $HAVE_WMEMCHR = 0; then | |
30954 | ||
30955 | ||
30956 | ||
30957 | ||
30958 | ||
30959 | ||
30960 | ||
30961 | ||
30962 | gl_LIBOBJS="$gl_LIBOBJS wmemchr.$ac_objext" | |
30963 | ||
30964 | fi | |
30965 | ||
30966 | ||
30967 | ||
30968 | ||
30969 | ||
30970 | GNULIB_WMEMCHR=1 | |
30971 | ||
30972 | ||
30973 | ||
30974 | ||
30975 | ||
30976 | $as_echo "#define GNULIB_TEST_WMEMCHR 1" >>confdefs.h | |
30977 | ||
30978 | ||
30979 | ||
30980 | ||
30981 | ||
30982 | ||
30983 | ||
30984 | ||
30985 | ||
30986 | ||
30987 | ||
30988 | if test $ac_cv_func_wmempcpy = no; then | |
30989 | HAVE_WMEMPCPY=0 | |
30990 | fi | |
30991 | ||
30992 | if test $HAVE_WMEMPCPY = 0; then | |
30993 | ||
30994 | ||
30995 | ||
30996 | ||
30997 | ||
30998 | ||
30999 | ||
31000 | ||
31001 | gl_LIBOBJS="$gl_LIBOBJS wmempcpy.$ac_objext" | |
31002 | ||
31003 | fi | |
31004 | ||
31005 | ||
31006 | ||
31007 | ||
31008 | ||
31009 | GNULIB_WMEMPCPY=1 | |
31010 | ||
31011 | ||
31012 | ||
31013 | ||
31014 | ||
31015 | $as_echo "#define GNULIB_TEST_WMEMPCPY 1" >>confdefs.h | |
31016 | ||
31017 | ||
31018 | ||
c971b7fa PA |
31019 | # End of code from modules |
31020 | ||
31021 | ||
31022 | ||
31023 | ||
31024 | ||
31025 | ||
31026 | ||
31027 | ||
31028 | ||
31029 | gltests_libdeps= | |
31030 | gltests_ltlibdeps= | |
31031 | ||
31032 | ||
31033 | ||
31034 | ||
31035 | ||
31036 | ||
31037 | ||
31038 | ||
31039 | ||
5df4cba6 | 31040 | |
c971b7fa PA |
31041 | gl_source_base='tests' |
31042 | gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS | |
31043 | ||
31044 | gl_module_indicator_condition=$gltests_WITNESS | |
31045 | ||
31046 | ||
31047 | ||
31048 | ||
31049 | ||
31050 | ||
31051 | ||
31052 | ||
31053 | ||
31054 | LIBGNU_LIBDEPS="$gl_libdeps" | |
31055 | ||
31056 | LIBGNU_LTLIBDEPS="$gl_ltlibdeps" | |
31057 | ||
31058 | ||
31059 | ||
d0ac1c44 | 31060 | am__api_version='1.15' |
c971b7fa PA |
31061 | |
31062 | # Find a good install program. We prefer a C program (faster), | |
31063 | # so one script is as good as another. But avoid the broken or | |
31064 | # incompatible versions: | |
31065 | # SysV /etc/install, /usr/sbin/install | |
31066 | # SunOS /usr/etc/install | |
31067 | # IRIX /sbin/install | |
31068 | # AIX /bin/install | |
31069 | # AmigaOS /C/install, which installs bootblocks on floppy discs | |
31070 | # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag | |
31071 | # AFS /usr/afsws/bin/install, which mishandles nonexistent args | |
31072 | # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" | |
31073 | # OS/2's system install, which has a completely different semantic | |
31074 | # ./install, which can be erroneously created by make from ./install.sh. | |
31075 | # Reject install programs that cannot install multiple files. | |
31076 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 | |
31077 | $as_echo_n "checking for a BSD-compatible install... " >&6; } | |
31078 | if test -z "$INSTALL"; then | |
d0ac1c44 | 31079 | if ${ac_cv_path_install+:} false; then : |
c971b7fa PA |
31080 | $as_echo_n "(cached) " >&6 |
31081 | else | |
31082 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
31083 | for as_dir in $PATH | |
31084 | do | |
31085 | IFS=$as_save_IFS | |
31086 | test -z "$as_dir" && as_dir=. | |
31087 | # Account for people who put trailing slashes in PATH elements. | |
31088 | case $as_dir/ in #(( | |
31089 | ./ | .// | /[cC]/* | \ | |
31090 | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ | |
31091 | ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ | |
31092 | /usr/ucb/* ) ;; | |
31093 | *) | |
31094 | # OSF1 and SCO ODT 3.0 have their own names for install. | |
31095 | # Don't use installbsd from OSF since it installs stuff as root | |
31096 | # by default. | |
31097 | for ac_prog in ginstall scoinst install; do | |
31098 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 31099 | if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then |
c971b7fa PA |
31100 | if test $ac_prog = install && |
31101 | grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then | |
31102 | # AIX install. It has an incompatible calling convention. | |
31103 | : | |
31104 | elif test $ac_prog = install && | |
31105 | grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then | |
31106 | # program-specific install script used by HP pwplus--don't use. | |
31107 | : | |
31108 | else | |
31109 | rm -rf conftest.one conftest.two conftest.dir | |
31110 | echo one > conftest.one | |
31111 | echo two > conftest.two | |
31112 | mkdir conftest.dir | |
31113 | if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && | |
31114 | test -s conftest.one && test -s conftest.two && | |
31115 | test -s conftest.dir/conftest.one && | |
31116 | test -s conftest.dir/conftest.two | |
31117 | then | |
31118 | ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" | |
31119 | break 3 | |
31120 | fi | |
31121 | fi | |
31122 | fi | |
31123 | done | |
31124 | done | |
31125 | ;; | |
31126 | esac | |
31127 | ||
31128 | done | |
31129 | IFS=$as_save_IFS | |
31130 | ||
31131 | rm -rf conftest.one conftest.two conftest.dir | |
31132 | ||
31133 | fi | |
31134 | if test "${ac_cv_path_install+set}" = set; then | |
31135 | INSTALL=$ac_cv_path_install | |
31136 | else | |
31137 | # As a last resort, use the slow shell script. Don't cache a | |
31138 | # value for INSTALL within a source directory, because that will | |
31139 | # break other packages using the cache if that directory is | |
31140 | # removed, or if the value is a relative name. | |
31141 | INSTALL=$ac_install_sh | |
31142 | fi | |
31143 | fi | |
31144 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 | |
31145 | $as_echo "$INSTALL" >&6; } | |
31146 | ||
31147 | # Use test -z because SunOS4 sh mishandles braces in ${var-val}. | |
31148 | # It thinks the first close brace ends the variable substitution. | |
31149 | test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' | |
31150 | ||
31151 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' | |
31152 | ||
31153 | test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' | |
31154 | ||
31155 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 | |
31156 | $as_echo_n "checking whether build environment is sane... " >&6; } | |
c971b7fa PA |
31157 | # Reject unsafe characters in $srcdir or the absolute working directory |
31158 | # name. Accept space and tab only in the latter. | |
31159 | am_lf=' | |
31160 | ' | |
31161 | case `pwd` in | |
31162 | *[\\\"\#\$\&\'\`$am_lf]*) | |
d0ac1c44 | 31163 | as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; |
c971b7fa PA |
31164 | esac |
31165 | case $srcdir in | |
31166 | *[\\\"\#\$\&\'\`$am_lf\ \ ]*) | |
d0ac1c44 | 31167 | as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; |
c971b7fa PA |
31168 | esac |
31169 | ||
d0ac1c44 | 31170 | # Do 'set' in a subshell so we don't clobber the current shell's |
c971b7fa PA |
31171 | # arguments. Must try -L first in case configure is actually a |
31172 | # symlink; some systems play weird games with the mod time of symlinks | |
31173 | # (eg FreeBSD returns the mod time of the symlink's containing | |
31174 | # directory). | |
31175 | if ( | |
d0ac1c44 SM |
31176 | am_has_slept=no |
31177 | for am_try in 1 2; do | |
31178 | echo "timestamp, slept: $am_has_slept" > conftest.file | |
31179 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` | |
31180 | if test "$*" = "X"; then | |
31181 | # -L didn't work. | |
31182 | set X `ls -t "$srcdir/configure" conftest.file` | |
31183 | fi | |
31184 | if test "$*" != "X $srcdir/configure conftest.file" \ | |
31185 | && test "$*" != "X conftest.file $srcdir/configure"; then | |
31186 | ||
31187 | # If neither matched, then we have a broken ls. This can happen | |
31188 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
31189 | # broken ls alias from the environment. This has actually | |
31190 | # happened. Such a system could not be considered "sane". | |
31191 | as_fn_error $? "ls -t appears to fail. Make sure there is not a broken | |
31192 | alias in your environment" "$LINENO" 5 | |
31193 | fi | |
31194 | if test "$2" = conftest.file || test $am_try -eq 2; then | |
31195 | break | |
31196 | fi | |
31197 | # Just in case. | |
31198 | sleep 1 | |
31199 | am_has_slept=yes | |
31200 | done | |
c971b7fa PA |
31201 | test "$2" = conftest.file |
31202 | ) | |
31203 | then | |
31204 | # Ok. | |
31205 | : | |
31206 | else | |
d0ac1c44 | 31207 | as_fn_error $? "newly created file is older than distributed files! |
c971b7fa PA |
31208 | Check your system clock" "$LINENO" 5 |
31209 | fi | |
31210 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
31211 | $as_echo "yes" >&6; } | |
d0ac1c44 SM |
31212 | # If we didn't sleep, we still need to ensure time stamps of config.status and |
31213 | # generated files are strictly newer. | |
31214 | am_sleep_pid= | |
31215 | if grep 'slept: no' conftest.file >/dev/null 2>&1; then | |
31216 | ( sleep 1 ) & | |
31217 | am_sleep_pid=$! | |
31218 | fi | |
31219 | ||
31220 | rm -f conftest.file | |
31221 | ||
c971b7fa PA |
31222 | test "$program_prefix" != NONE && |
31223 | program_transform_name="s&^&$program_prefix&;$program_transform_name" | |
31224 | # Use a double $ so make ignores it. | |
31225 | test "$program_suffix" != NONE && | |
31226 | program_transform_name="s&\$&$program_suffix&;$program_transform_name" | |
31227 | # Double any \ or $. | |
31228 | # By default was `s,x,x', remove it if useless. | |
31229 | ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' | |
31230 | program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` | |
31231 | ||
c0c3707f CB |
31232 | # Expand $ac_aux_dir to an absolute path. |
31233 | am_aux_dir=`cd "$ac_aux_dir" && pwd` | |
31234 | ||
c971b7fa PA |
31235 | if test x"${MISSING+set}" != xset; then |
31236 | case $am_aux_dir in | |
31237 | *\ * | *\ *) | |
31238 | MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; | |
31239 | *) | |
31240 | MISSING="\${SHELL} $am_aux_dir/missing" ;; | |
31241 | esac | |
31242 | fi | |
31243 | # Use eval to expand $SHELL | |
d0ac1c44 SM |
31244 | if eval "$MISSING --is-lightweight"; then |
31245 | am_missing_run="$MISSING " | |
c971b7fa PA |
31246 | else |
31247 | am_missing_run= | |
d0ac1c44 SM |
31248 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 |
31249 | $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} | |
c971b7fa PA |
31250 | fi |
31251 | ||
d0ac1c44 | 31252 | if test x"${install_sh+set}" != xset; then |
c971b7fa PA |
31253 | case $am_aux_dir in |
31254 | *\ * | *\ *) | |
31255 | install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; | |
31256 | *) | |
31257 | install_sh="\${SHELL} $am_aux_dir/install-sh" | |
31258 | esac | |
31259 | fi | |
31260 | ||
d0ac1c44 SM |
31261 | # Installed binaries are usually stripped using 'strip' when the user |
31262 | # run "make install-strip". However 'strip' might not be the right | |
c971b7fa | 31263 | # tool to use in cross-compilation environments, therefore Automake |
d0ac1c44 | 31264 | # will honor the 'STRIP' environment variable to overrule this program. |
c971b7fa PA |
31265 | if test "$cross_compiling" != no; then |
31266 | if test -n "$ac_tool_prefix"; then | |
31267 | # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. | |
31268 | set dummy ${ac_tool_prefix}strip; ac_word=$2 | |
31269 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
31270 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 31271 | if ${ac_cv_prog_STRIP+:} false; then : |
c971b7fa PA |
31272 | $as_echo_n "(cached) " >&6 |
31273 | else | |
31274 | if test -n "$STRIP"; then | |
31275 | ac_cv_prog_STRIP="$STRIP" # Let the user override the test. | |
31276 | else | |
31277 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
31278 | for as_dir in $PATH | |
31279 | do | |
31280 | IFS=$as_save_IFS | |
31281 | test -z "$as_dir" && as_dir=. | |
31282 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 31283 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
31284 | ac_cv_prog_STRIP="${ac_tool_prefix}strip" |
31285 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
31286 | break 2 | |
31287 | fi | |
31288 | done | |
31289 | done | |
31290 | IFS=$as_save_IFS | |
31291 | ||
31292 | fi | |
31293 | fi | |
31294 | STRIP=$ac_cv_prog_STRIP | |
31295 | if test -n "$STRIP"; then | |
31296 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 | |
31297 | $as_echo "$STRIP" >&6; } | |
31298 | else | |
31299 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
31300 | $as_echo "no" >&6; } | |
31301 | fi | |
31302 | ||
31303 | ||
31304 | fi | |
31305 | if test -z "$ac_cv_prog_STRIP"; then | |
31306 | ac_ct_STRIP=$STRIP | |
31307 | # Extract the first word of "strip", so it can be a program name with args. | |
31308 | set dummy strip; ac_word=$2 | |
31309 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
31310 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 31311 | if ${ac_cv_prog_ac_ct_STRIP+:} false; then : |
c971b7fa PA |
31312 | $as_echo_n "(cached) " >&6 |
31313 | else | |
31314 | if test -n "$ac_ct_STRIP"; then | |
31315 | ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. | |
31316 | else | |
31317 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
31318 | for as_dir in $PATH | |
31319 | do | |
31320 | IFS=$as_save_IFS | |
31321 | test -z "$as_dir" && as_dir=. | |
31322 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 31323 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
31324 | ac_cv_prog_ac_ct_STRIP="strip" |
31325 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
31326 | break 2 | |
31327 | fi | |
31328 | done | |
31329 | done | |
31330 | IFS=$as_save_IFS | |
31331 | ||
31332 | fi | |
31333 | fi | |
31334 | ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP | |
31335 | if test -n "$ac_ct_STRIP"; then | |
31336 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 | |
31337 | $as_echo "$ac_ct_STRIP" >&6; } | |
31338 | else | |
31339 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
31340 | $as_echo "no" >&6; } | |
31341 | fi | |
31342 | ||
31343 | if test "x$ac_ct_STRIP" = x; then | |
31344 | STRIP=":" | |
31345 | else | |
31346 | case $cross_compiling:$ac_tool_warned in | |
31347 | yes:) | |
31348 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
31349 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
31350 | ac_tool_warned=yes ;; | |
31351 | esac | |
31352 | STRIP=$ac_ct_STRIP | |
31353 | fi | |
31354 | else | |
31355 | STRIP="$ac_cv_prog_STRIP" | |
31356 | fi | |
31357 | ||
31358 | fi | |
31359 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" | |
31360 | ||
c971b7fa PA |
31361 | for ac_prog in gawk mawk nawk awk |
31362 | do | |
31363 | # Extract the first word of "$ac_prog", so it can be a program name with args. | |
31364 | set dummy $ac_prog; ac_word=$2 | |
31365 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
31366 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 31367 | if ${ac_cv_prog_AWK+:} false; then : |
c971b7fa PA |
31368 | $as_echo_n "(cached) " >&6 |
31369 | else | |
31370 | if test -n "$AWK"; then | |
31371 | ac_cv_prog_AWK="$AWK" # Let the user override the test. | |
31372 | else | |
31373 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
31374 | for as_dir in $PATH | |
31375 | do | |
31376 | IFS=$as_save_IFS | |
31377 | test -z "$as_dir" && as_dir=. | |
31378 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 31379 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
31380 | ac_cv_prog_AWK="$ac_prog" |
31381 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
31382 | break 2 | |
31383 | fi | |
31384 | done | |
31385 | done | |
31386 | IFS=$as_save_IFS | |
31387 | ||
31388 | fi | |
31389 | fi | |
31390 | AWK=$ac_cv_prog_AWK | |
31391 | if test -n "$AWK"; then | |
31392 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 | |
31393 | $as_echo "$AWK" >&6; } | |
31394 | else | |
31395 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
31396 | $as_echo "no" >&6; } | |
31397 | fi | |
31398 | ||
31399 | ||
31400 | test -n "$AWK" && break | |
31401 | done | |
31402 | ||
31403 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 | |
31404 | $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } | |
31405 | set x ${MAKE-make} | |
31406 | ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` | |
d0ac1c44 | 31407 | if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : |
c971b7fa PA |
31408 | $as_echo_n "(cached) " >&6 |
31409 | else | |
31410 | cat >conftest.make <<\_ACEOF | |
31411 | SHELL = /bin/sh | |
31412 | all: | |
31413 | @echo '@@@%%%=$(MAKE)=@@@%%%' | |
31414 | _ACEOF | |
d0ac1c44 | 31415 | # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. |
c971b7fa PA |
31416 | case `${MAKE-make} -f conftest.make 2>/dev/null` in |
31417 | *@@@%%%=?*=@@@%%%*) | |
31418 | eval ac_cv_prog_make_${ac_make}_set=yes;; | |
31419 | *) | |
31420 | eval ac_cv_prog_make_${ac_make}_set=no;; | |
31421 | esac | |
31422 | rm -f conftest.make | |
31423 | fi | |
31424 | if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then | |
31425 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
31426 | $as_echo "yes" >&6; } | |
31427 | SET_MAKE= | |
31428 | else | |
31429 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
31430 | $as_echo "no" >&6; } | |
31431 | SET_MAKE="MAKE=${MAKE-make}" | |
31432 | fi | |
31433 | ||
31434 | rm -rf .tst 2>/dev/null | |
31435 | mkdir .tst 2>/dev/null | |
31436 | if test -d .tst; then | |
31437 | am__leading_dot=. | |
31438 | else | |
31439 | am__leading_dot=_ | |
31440 | fi | |
31441 | rmdir .tst 2>/dev/null | |
31442 | ||
31443 | DEPDIR="${am__leading_dot}deps" | |
31444 | ||
31445 | ac_config_commands="$ac_config_commands depfiles" | |
31446 | ||
31447 | ||
31448 | am_make=${MAKE-make} | |
31449 | cat > confinc << 'END' | |
31450 | am__doit: | |
31451 | @echo this is the am__doit target | |
31452 | .PHONY: am__doit | |
31453 | END | |
31454 | # If we don't find an include directive, just comment out the code. | |
31455 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 | |
31456 | $as_echo_n "checking for style of include used by $am_make... " >&6; } | |
31457 | am__include="#" | |
31458 | am__quote= | |
31459 | _am_result=none | |
31460 | # First try GNU make style include. | |
31461 | echo "include confinc" > confmf | |
d0ac1c44 | 31462 | # Ignore all kinds of additional output from 'make'. |
c971b7fa PA |
31463 | case `$am_make -s -f confmf 2> /dev/null` in #( |
31464 | *the\ am__doit\ target*) | |
31465 | am__include=include | |
31466 | am__quote= | |
31467 | _am_result=GNU | |
31468 | ;; | |
31469 | esac | |
31470 | # Now try BSD make style include. | |
31471 | if test "$am__include" = "#"; then | |
31472 | echo '.include "confinc"' > confmf | |
31473 | case `$am_make -s -f confmf 2> /dev/null` in #( | |
31474 | *the\ am__doit\ target*) | |
31475 | am__include=.include | |
31476 | am__quote="\"" | |
31477 | _am_result=BSD | |
31478 | ;; | |
31479 | esac | |
31480 | fi | |
31481 | ||
31482 | ||
31483 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 | |
31484 | $as_echo "$_am_result" >&6; } | |
31485 | rm -f confinc confmf | |
31486 | ||
31487 | # Check whether --enable-dependency-tracking was given. | |
31488 | if test "${enable_dependency_tracking+set}" = set; then : | |
31489 | enableval=$enable_dependency_tracking; | |
31490 | fi | |
31491 | ||
31492 | if test "x$enable_dependency_tracking" != xno; then | |
31493 | am_depcomp="$ac_aux_dir/depcomp" | |
31494 | AMDEPBACKSLASH='\' | |
d0ac1c44 | 31495 | am__nodep='_no' |
c971b7fa PA |
31496 | fi |
31497 | if test "x$enable_dependency_tracking" != xno; then | |
31498 | AMDEP_TRUE= | |
31499 | AMDEP_FALSE='#' | |
31500 | else | |
31501 | AMDEP_TRUE='#' | |
31502 | AMDEP_FALSE= | |
31503 | fi | |
31504 | ||
31505 | ||
d0ac1c44 SM |
31506 | # Check whether --enable-silent-rules was given. |
31507 | if test "${enable_silent_rules+set}" = set; then : | |
31508 | enableval=$enable_silent_rules; | |
31509 | fi | |
31510 | ||
31511 | case $enable_silent_rules in # ((( | |
31512 | yes) AM_DEFAULT_VERBOSITY=0;; | |
31513 | no) AM_DEFAULT_VERBOSITY=1;; | |
31514 | *) AM_DEFAULT_VERBOSITY=1;; | |
31515 | esac | |
31516 | am_make=${MAKE-make} | |
31517 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 | |
31518 | $as_echo_n "checking whether $am_make supports nested variables... " >&6; } | |
31519 | if ${am_cv_make_support_nested_variables+:} false; then : | |
31520 | $as_echo_n "(cached) " >&6 | |
31521 | else | |
31522 | if $as_echo 'TRUE=$(BAR$(V)) | |
31523 | BAR0=false | |
31524 | BAR1=true | |
31525 | V=1 | |
31526 | am__doit: | |
31527 | @$(TRUE) | |
31528 | .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then | |
31529 | am_cv_make_support_nested_variables=yes | |
31530 | else | |
31531 | am_cv_make_support_nested_variables=no | |
31532 | fi | |
31533 | fi | |
31534 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 | |
31535 | $as_echo "$am_cv_make_support_nested_variables" >&6; } | |
31536 | if test $am_cv_make_support_nested_variables = yes; then | |
31537 | AM_V='$(V)' | |
31538 | AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' | |
31539 | else | |
31540 | AM_V=$AM_DEFAULT_VERBOSITY | |
31541 | AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY | |
31542 | fi | |
31543 | AM_BACKSLASH='\' | |
31544 | ||
c971b7fa PA |
31545 | if test "`cd $srcdir && pwd`" != "`pwd`"; then |
31546 | # Use -I$(srcdir) only when $(srcdir) != ., so that make's output | |
31547 | # is not polluted with repeated "-I." | |
31548 | am__isrc=' -I$(srcdir)' | |
31549 | # test to see if srcdir already configured | |
31550 | if test -f $srcdir/config.status; then | |
d0ac1c44 | 31551 | as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 |
c971b7fa PA |
31552 | fi |
31553 | fi | |
31554 | ||
31555 | # test whether we have cygpath | |
31556 | if test -z "$CYGPATH_W"; then | |
31557 | if (cygpath --version) >/dev/null 2>/dev/null; then | |
31558 | CYGPATH_W='cygpath -w' | |
31559 | else | |
31560 | CYGPATH_W=echo | |
31561 | fi | |
31562 | fi | |
31563 | ||
31564 | ||
31565 | # Define the identity of the package. | |
d0ac1c44 SM |
31566 | PACKAGE='libgnu' |
31567 | VERSION='UNUSED-VERSION' | |
c971b7fa PA |
31568 | |
31569 | ||
31570 | # Some tools Automake needs. | |
31571 | ||
31572 | ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} | |
31573 | ||
31574 | ||
31575 | AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} | |
31576 | ||
31577 | ||
31578 | AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} | |
31579 | ||
31580 | ||
31581 | AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} | |
31582 | ||
31583 | ||
31584 | MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} | |
31585 | ||
d0ac1c44 SM |
31586 | # For better backward compatibility. To be removed once Automake 1.9.x |
31587 | # dies out for good. For more background, see: | |
31588 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> | |
31589 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> | |
31590 | mkdir_p='$(MKDIR_P)' | |
31591 | ||
31592 | # We need awk for the "check" target (and possibly the TAP driver). The | |
31593 | # system "awk" is bad on some platforms. | |
31594 | # Always define AMTAR for backward compatibility. Yes, it's still used | |
31595 | # in the wild :-( We should find a proper way to deprecate it ... | |
31596 | AMTAR='$${TAR-tar}' | |
31597 | ||
31598 | ||
31599 | # We'll loop over all known methods to create a tar archive until one works. | |
31600 | _am_tools='gnutar pax cpio none' | |
c971b7fa | 31601 | |
d0ac1c44 | 31602 | am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' |
c971b7fa | 31603 | |
c971b7fa PA |
31604 | |
31605 | ||
31606 | ||
31607 | ||
31608 | depcc="$CC" am_compiler_list= | |
31609 | ||
31610 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 | |
31611 | $as_echo_n "checking dependency style of $depcc... " >&6; } | |
d0ac1c44 | 31612 | if ${am_cv_CC_dependencies_compiler_type+:} false; then : |
c971b7fa PA |
31613 | $as_echo_n "(cached) " >&6 |
31614 | else | |
31615 | if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then | |
31616 | # We make a subdir and do the tests there. Otherwise we can end up | |
31617 | # making bogus files that we don't know about and never remove. For | |
31618 | # instance it was reported that on HP-UX the gcc test will end up | |
d0ac1c44 SM |
31619 | # making a dummy file named 'D' -- because '-MD' means "put the output |
31620 | # in D". | |
31621 | rm -rf conftest.dir | |
c971b7fa PA |
31622 | mkdir conftest.dir |
31623 | # Copy depcomp to subdir because otherwise we won't find it if we're | |
31624 | # using a relative directory. | |
31625 | cp "$am_depcomp" conftest.dir | |
31626 | cd conftest.dir | |
31627 | # We will build objects and dependencies in a subdirectory because | |
31628 | # it helps to detect inapplicable dependency modes. For instance | |
31629 | # both Tru64's cc and ICC support -MD to output dependencies as a | |
31630 | # side effect of compilation, but ICC will put the dependencies in | |
31631 | # the current directory while Tru64 will put them in the object | |
31632 | # directory. | |
31633 | mkdir sub | |
31634 | ||
31635 | am_cv_CC_dependencies_compiler_type=none | |
31636 | if test "$am_compiler_list" = ""; then | |
31637 | am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` | |
31638 | fi | |
31639 | am__universal=false | |
31640 | case " $depcc " in #( | |
31641 | *\ -arch\ *\ -arch\ *) am__universal=true ;; | |
31642 | esac | |
31643 | ||
31644 | for depmode in $am_compiler_list; do | |
31645 | # Setup a source with many dependencies, because some compilers | |
31646 | # like to wrap large dependency lists on column 80 (with \), and | |
31647 | # we should not choose a depcomp mode which is confused by this. | |
31648 | # | |
31649 | # We need to recreate these files for each test, as the compiler may | |
31650 | # overwrite some of them when testing with obscure command lines. | |
31651 | # This happens at least with the AIX C compiler. | |
31652 | : > sub/conftest.c | |
31653 | for i in 1 2 3 4 5 6; do | |
31654 | echo '#include "conftst'$i'.h"' >> sub/conftest.c | |
d0ac1c44 SM |
31655 | # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with |
31656 | # Solaris 10 /bin/sh. | |
31657 | echo '/* dummy */' > sub/conftst$i.h | |
c971b7fa PA |
31658 | done |
31659 | echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf | |
31660 | ||
d0ac1c44 | 31661 | # We check with '-c' and '-o' for the sake of the "dashmstdout" |
c971b7fa | 31662 | # mode. It turns out that the SunPro C++ compiler does not properly |
d0ac1c44 SM |
31663 | # handle '-M -o', and we need to detect this. Also, some Intel |
31664 | # versions had trouble with output in subdirs. | |
c971b7fa PA |
31665 | am__obj=sub/conftest.${OBJEXT-o} |
31666 | am__minus_obj="-o $am__obj" | |
31667 | case $depmode in | |
31668 | gcc) | |
31669 | # This depmode causes a compiler race in universal mode. | |
31670 | test "$am__universal" = false || continue | |
31671 | ;; | |
31672 | nosideeffect) | |
d0ac1c44 SM |
31673 | # After this tag, mechanisms are not by side-effect, so they'll |
31674 | # only be used when explicitly requested. | |
c971b7fa PA |
31675 | if test "x$enable_dependency_tracking" = xyes; then |
31676 | continue | |
31677 | else | |
31678 | break | |
31679 | fi | |
31680 | ;; | |
d0ac1c44 SM |
31681 | msvc7 | msvc7msys | msvisualcpp | msvcmsys) |
31682 | # This compiler won't grok '-c -o', but also, the minuso test has | |
c971b7fa PA |
31683 | # not run yet. These depmodes are late enough in the game, and |
31684 | # so weak that their functioning should not be impacted. | |
31685 | am__obj=conftest.${OBJEXT-o} | |
31686 | am__minus_obj= | |
31687 | ;; | |
31688 | none) break ;; | |
31689 | esac | |
31690 | if depmode=$depmode \ | |
31691 | source=sub/conftest.c object=$am__obj \ | |
31692 | depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ | |
31693 | $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ | |
31694 | >/dev/null 2>conftest.err && | |
31695 | grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && | |
31696 | grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && | |
31697 | grep $am__obj sub/conftest.Po > /dev/null 2>&1 && | |
31698 | ${MAKE-make} -s -f confmf > /dev/null 2>&1; then | |
31699 | # icc doesn't choke on unknown options, it will just issue warnings | |
31700 | # or remarks (even with -Werror). So we grep stderr for any message | |
31701 | # that says an option was ignored or not supported. | |
31702 | # When given -MP, icc 7.0 and 7.1 complain thusly: | |
31703 | # icc: Command line warning: ignoring option '-M'; no argument required | |
31704 | # The diagnosis changed in icc 8.0: | |
31705 | # icc: Command line remark: option '-MP' not supported | |
31706 | if (grep 'ignoring option' conftest.err || | |
31707 | grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else | |
31708 | am_cv_CC_dependencies_compiler_type=$depmode | |
31709 | break | |
31710 | fi | |
31711 | fi | |
31712 | done | |
31713 | ||
31714 | cd .. | |
31715 | rm -rf conftest.dir | |
31716 | else | |
31717 | am_cv_CC_dependencies_compiler_type=none | |
31718 | fi | |
31719 | ||
31720 | fi | |
31721 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 | |
31722 | $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } | |
31723 | CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type | |
31724 | ||
31725 | if | |
31726 | test "x$enable_dependency_tracking" != xno \ | |
31727 | && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then | |
31728 | am__fastdepCC_TRUE= | |
31729 | am__fastdepCC_FALSE='#' | |
31730 | else | |
31731 | am__fastdepCC_TRUE='#' | |
31732 | am__fastdepCC_FALSE= | |
31733 | fi | |
31734 | ||
31735 | ||
31736 | ||
d0ac1c44 SM |
31737 | # POSIX will say in a future version that running "rm -f" with no argument |
31738 | # is OK; and we want to be able to make that assumption in our Makefile | |
31739 | # recipes. So use an aggressive probe to check that the usage we want is | |
31740 | # actually supported "in the wild" to an acceptable degree. | |
31741 | # See automake bug#10828. | |
31742 | # To make any issue more visible, cause the running configure to be aborted | |
31743 | # by default if the 'rm' program in use doesn't match our expectations; the | |
31744 | # user can still override this though. | |
31745 | if rm -f && rm -fr && rm -rf; then : OK; else | |
31746 | cat >&2 <<'END' | |
31747 | Oops! | |
31748 | ||
31749 | Your 'rm' program seems unable to run without file operands specified | |
31750 | on the command line, even when the '-f' option is present. This is contrary | |
31751 | to the behaviour of most rm programs out there, and not conforming with | |
31752 | the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> | |
31753 | ||
31754 | Please tell bug-automake@gnu.org about your system, including the value | |
31755 | of your $PATH and any error possibly output before this message. This | |
31756 | can help us improve future automake versions. | |
31757 | ||
31758 | END | |
31759 | if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then | |
31760 | echo 'Configuration will proceed anyway, since you have set the' >&2 | |
31761 | echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 | |
31762 | echo >&2 | |
31763 | else | |
31764 | cat >&2 <<'END' | |
31765 | Aborting the configuration process, to ensure you take notice of the issue. | |
31766 | ||
31767 | You can download and install GNU coreutils to get an 'rm' implementation | |
31768 | that behaves properly: <http://www.gnu.org/software/coreutils/>. | |
31769 | ||
31770 | If you want to complete the configuration process using your problematic | |
31771 | 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM | |
31772 | to "yes", and re-run configure. | |
31773 | ||
31774 | END | |
31775 | as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 | |
31776 | fi | |
31777 | fi | |
31778 | ||
c971b7fa | 31779 | |
39be3c7e SM |
31780 | # Check whether --enable-silent-rules was given. |
31781 | if test "${enable_silent_rules+set}" = set; then : | |
31782 | enableval=$enable_silent_rules; | |
31783 | fi | |
31784 | ||
d0ac1c44 SM |
31785 | case $enable_silent_rules in # ((( |
31786 | yes) AM_DEFAULT_VERBOSITY=0;; | |
31787 | no) AM_DEFAULT_VERBOSITY=1;; | |
31788 | *) AM_DEFAULT_VERBOSITY=0;; | |
39be3c7e | 31789 | esac |
d0ac1c44 SM |
31790 | am_make=${MAKE-make} |
31791 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 | |
31792 | $as_echo_n "checking whether $am_make supports nested variables... " >&6; } | |
31793 | if ${am_cv_make_support_nested_variables+:} false; then : | |
31794 | $as_echo_n "(cached) " >&6 | |
31795 | else | |
31796 | if $as_echo 'TRUE=$(BAR$(V)) | |
31797 | BAR0=false | |
31798 | BAR1=true | |
31799 | V=1 | |
31800 | am__doit: | |
31801 | @$(TRUE) | |
31802 | .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then | |
31803 | am_cv_make_support_nested_variables=yes | |
31804 | else | |
31805 | am_cv_make_support_nested_variables=no | |
31806 | fi | |
31807 | fi | |
31808 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 | |
31809 | $as_echo "$am_cv_make_support_nested_variables" >&6; } | |
31810 | if test $am_cv_make_support_nested_variables = yes; then | |
31811 | AM_V='$(V)' | |
31812 | AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' | |
31813 | else | |
31814 | AM_V=$AM_DEFAULT_VERBOSITY | |
31815 | AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY | |
31816 | fi | |
39be3c7e SM |
31817 | AM_BACKSLASH='\' |
31818 | ||
31819 | ||
c971b7fa PA |
31820 | # --------------------- # |
31821 | # Checks for programs. # | |
31822 | # --------------------- # | |
31823 | ||
31824 | ||
31825 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 | |
31826 | $as_echo_n "checking whether ln -s works... " >&6; } | |
31827 | LN_S=$as_ln_s | |
31828 | if test "$LN_S" = "ln -s"; then | |
31829 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
31830 | $as_echo "yes" >&6; } | |
31831 | else | |
31832 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 | |
31833 | $as_echo "no, using $LN_S" >&6; } | |
31834 | fi | |
31835 | ||
31836 | if test -n "$ac_tool_prefix"; then | |
31837 | # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. | |
31838 | set dummy ${ac_tool_prefix}ranlib; ac_word=$2 | |
31839 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
31840 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 31841 | if ${ac_cv_prog_RANLIB+:} false; then : |
c971b7fa PA |
31842 | $as_echo_n "(cached) " >&6 |
31843 | else | |
31844 | if test -n "$RANLIB"; then | |
31845 | ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. | |
31846 | else | |
31847 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
31848 | for as_dir in $PATH | |
31849 | do | |
31850 | IFS=$as_save_IFS | |
31851 | test -z "$as_dir" && as_dir=. | |
31852 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 31853 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
31854 | ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" |
31855 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
31856 | break 2 | |
31857 | fi | |
31858 | done | |
31859 | done | |
31860 | IFS=$as_save_IFS | |
31861 | ||
31862 | fi | |
31863 | fi | |
31864 | RANLIB=$ac_cv_prog_RANLIB | |
31865 | if test -n "$RANLIB"; then | |
31866 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 | |
31867 | $as_echo "$RANLIB" >&6; } | |
31868 | else | |
31869 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
31870 | $as_echo "no" >&6; } | |
31871 | fi | |
31872 | ||
31873 | ||
31874 | fi | |
31875 | if test -z "$ac_cv_prog_RANLIB"; then | |
31876 | ac_ct_RANLIB=$RANLIB | |
31877 | # Extract the first word of "ranlib", so it can be a program name with args. | |
31878 | set dummy ranlib; ac_word=$2 | |
31879 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
31880 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 31881 | if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : |
c971b7fa PA |
31882 | $as_echo_n "(cached) " >&6 |
31883 | else | |
31884 | if test -n "$ac_ct_RANLIB"; then | |
31885 | ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. | |
31886 | else | |
31887 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
31888 | for as_dir in $PATH | |
31889 | do | |
31890 | IFS=$as_save_IFS | |
31891 | test -z "$as_dir" && as_dir=. | |
31892 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 31893 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
31894 | ac_cv_prog_ac_ct_RANLIB="ranlib" |
31895 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
31896 | break 2 | |
31897 | fi | |
31898 | done | |
31899 | done | |
31900 | IFS=$as_save_IFS | |
31901 | ||
31902 | fi | |
31903 | fi | |
31904 | ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB | |
31905 | if test -n "$ac_ct_RANLIB"; then | |
31906 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 | |
31907 | $as_echo "$ac_ct_RANLIB" >&6; } | |
31908 | else | |
31909 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
31910 | $as_echo "no" >&6; } | |
31911 | fi | |
31912 | ||
31913 | if test "x$ac_ct_RANLIB" = x; then | |
31914 | RANLIB=":" | |
31915 | else | |
31916 | case $cross_compiling:$ac_tool_warned in | |
31917 | yes:) | |
31918 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
31919 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
31920 | ac_tool_warned=yes ;; | |
31921 | esac | |
31922 | RANLIB=$ac_ct_RANLIB | |
31923 | fi | |
31924 | else | |
31925 | RANLIB="$ac_cv_prog_RANLIB" | |
31926 | fi | |
31927 | ||
31928 | ||
31929 | if test -n "$ac_tool_prefix"; then | |
31930 | # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. | |
31931 | set dummy ${ac_tool_prefix}ar; ac_word=$2 | |
31932 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
31933 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 31934 | if ${ac_cv_prog_AR+:} false; then : |
c971b7fa PA |
31935 | $as_echo_n "(cached) " >&6 |
31936 | else | |
31937 | if test -n "$AR"; then | |
31938 | ac_cv_prog_AR="$AR" # Let the user override the test. | |
31939 | else | |
31940 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
31941 | for as_dir in $PATH | |
31942 | do | |
31943 | IFS=$as_save_IFS | |
31944 | test -z "$as_dir" && as_dir=. | |
31945 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 31946 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
31947 | ac_cv_prog_AR="${ac_tool_prefix}ar" |
31948 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
31949 | break 2 | |
31950 | fi | |
31951 | done | |
31952 | done | |
31953 | IFS=$as_save_IFS | |
31954 | ||
31955 | fi | |
31956 | fi | |
31957 | AR=$ac_cv_prog_AR | |
31958 | if test -n "$AR"; then | |
31959 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 | |
31960 | $as_echo "$AR" >&6; } | |
31961 | else | |
31962 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
31963 | $as_echo "no" >&6; } | |
31964 | fi | |
31965 | ||
31966 | ||
31967 | fi | |
31968 | if test -z "$ac_cv_prog_AR"; then | |
31969 | ac_ct_AR=$AR | |
31970 | # Extract the first word of "ar", so it can be a program name with args. | |
31971 | set dummy ar; ac_word=$2 | |
31972 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
31973 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 31974 | if ${ac_cv_prog_ac_ct_AR+:} false; then : |
c971b7fa PA |
31975 | $as_echo_n "(cached) " >&6 |
31976 | else | |
31977 | if test -n "$ac_ct_AR"; then | |
31978 | ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. | |
31979 | else | |
31980 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
31981 | for as_dir in $PATH | |
31982 | do | |
31983 | IFS=$as_save_IFS | |
31984 | test -z "$as_dir" && as_dir=. | |
31985 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 31986 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
31987 | ac_cv_prog_ac_ct_AR="ar" |
31988 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
31989 | break 2 | |
31990 | fi | |
31991 | done | |
31992 | done | |
31993 | IFS=$as_save_IFS | |
31994 | ||
31995 | fi | |
31996 | fi | |
31997 | ac_ct_AR=$ac_cv_prog_ac_ct_AR | |
31998 | if test -n "$ac_ct_AR"; then | |
31999 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 | |
32000 | $as_echo "$ac_ct_AR" >&6; } | |
32001 | else | |
32002 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
32003 | $as_echo "no" >&6; } | |
32004 | fi | |
32005 | ||
32006 | if test "x$ac_ct_AR" = x; then | |
32007 | AR="" | |
32008 | else | |
32009 | case $cross_compiling:$ac_tool_warned in | |
32010 | yes:) | |
32011 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
32012 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
32013 | ac_tool_warned=yes ;; | |
32014 | esac | |
32015 | AR=$ac_ct_AR | |
32016 | fi | |
32017 | else | |
32018 | AR="$ac_cv_prog_AR" | |
32019 | fi | |
32020 | ||
32021 | ||
32022 | # ---------------------- # | |
32023 | # Checks for libraries. # | |
32024 | # ---------------------- # | |
32025 | ||
361cb219 AB |
32026 | ac_config_files="$ac_config_files Makefile.gnulib.inc" |
32027 | ||
32028 | ||
c971b7fa PA |
32029 | ac_config_files="$ac_config_files Makefile import/Makefile" |
32030 | ||
32031 | ac_config_commands="$ac_config_commands default" | |
32032 | ||
32033 | cat >confcache <<\_ACEOF | |
32034 | # This file is a shell script that caches the results of configure | |
32035 | # tests run on this system so they can be shared between configure | |
32036 | # scripts and configure runs, see configure's option --config-cache. | |
32037 | # It is not useful on other systems. If it contains results you don't | |
32038 | # want to keep, you may remove or edit it. | |
32039 | # | |
32040 | # config.status only pays attention to the cache file if you give it | |
32041 | # the --recheck option to rerun configure. | |
32042 | # | |
32043 | # `ac_cv_env_foo' variables (set or unset) will be overridden when | |
32044 | # loading this file, other *unset* `ac_cv_foo' will be assigned the | |
32045 | # following values. | |
32046 | ||
32047 | _ACEOF | |
32048 | ||
32049 | # The following way of writing the cache mishandles newlines in values, | |
32050 | # but we know of no workaround that is simple, portable, and efficient. | |
32051 | # So, we kill variables containing newlines. | |
32052 | # Ultrix sh set writes to stderr and can't be redirected directly, | |
32053 | # and sets the high bit in the cache file unless we assign to the vars. | |
32054 | ( | |
32055 | for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do | |
32056 | eval ac_val=\$$ac_var | |
32057 | case $ac_val in #( | |
32058 | *${as_nl}*) | |
32059 | case $ac_var in #( | |
32060 | *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 | |
32061 | $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; | |
32062 | esac | |
32063 | case $ac_var in #( | |
32064 | _ | IFS | as_nl) ;; #( | |
32065 | BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( | |
32066 | *) { eval $ac_var=; unset $ac_var;} ;; | |
32067 | esac ;; | |
32068 | esac | |
32069 | done | |
32070 | ||
32071 | (set) 2>&1 | | |
32072 | case $as_nl`(ac_space=' '; set) 2>&1` in #( | |
32073 | *${as_nl}ac_space=\ *) | |
32074 | # `set' does not quote correctly, so add quotes: double-quote | |
32075 | # substitution turns \\\\ into \\, and sed turns \\ into \. | |
32076 | sed -n \ | |
32077 | "s/'/'\\\\''/g; | |
32078 | s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" | |
32079 | ;; #( | |
32080 | *) | |
32081 | # `set' quotes correctly as required by POSIX, so do not add quotes. | |
32082 | sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" | |
32083 | ;; | |
32084 | esac | | |
32085 | sort | |
32086 | ) | | |
32087 | sed ' | |
32088 | /^ac_cv_env_/b end | |
32089 | t clear | |
32090 | :clear | |
32091 | s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ | |
32092 | t end | |
32093 | s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ | |
32094 | :end' >>confcache | |
32095 | if diff "$cache_file" confcache >/dev/null 2>&1; then :; else | |
32096 | if test -w "$cache_file"; then | |
d0ac1c44 | 32097 | if test "x$cache_file" != "x/dev/null"; then |
c971b7fa PA |
32098 | { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 |
32099 | $as_echo "$as_me: updating cache $cache_file" >&6;} | |
d0ac1c44 SM |
32100 | if test ! -f "$cache_file" || test -h "$cache_file"; then |
32101 | cat confcache >"$cache_file" | |
32102 | else | |
32103 | case $cache_file in #( | |
32104 | */* | ?:*) | |
32105 | mv -f confcache "$cache_file"$$ && | |
32106 | mv -f "$cache_file"$$ "$cache_file" ;; #( | |
32107 | *) | |
32108 | mv -f confcache "$cache_file" ;; | |
32109 | esac | |
32110 | fi | |
32111 | fi | |
c971b7fa PA |
32112 | else |
32113 | { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 | |
32114 | $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} | |
32115 | fi | |
32116 | fi | |
32117 | rm -f confcache | |
32118 | ||
32119 | test "x$prefix" = xNONE && prefix=$ac_default_prefix | |
32120 | # Let make expand exec_prefix. | |
32121 | test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' | |
32122 | ||
32123 | DEFS=-DHAVE_CONFIG_H | |
32124 | ||
32125 | ac_libobjs= | |
32126 | ac_ltlibobjs= | |
32127 | for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue | |
32128 | # 1. Remove the extension, and $U if already installed. | |
32129 | ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' | |
32130 | ac_i=`$as_echo "$ac_i" | sed "$ac_script"` | |
32131 | # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR | |
32132 | # will be set to the directory where LIBOBJS objects are built. | |
32133 | as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" | |
32134 | as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' | |
32135 | done | |
32136 | LIBOBJS=$ac_libobjs | |
32137 | ||
32138 | LTLIBOBJS=$ac_ltlibobjs | |
32139 | ||
32140 | ||
32141 | if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then | |
d0ac1c44 | 32142 | as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. |
c971b7fa PA |
32143 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
32144 | fi | |
32145 | if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then | |
d0ac1c44 | 32146 | as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined. |
c971b7fa PA |
32147 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
32148 | fi | |
8690e634 | 32149 | if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then |
d0ac1c44 | 32150 | as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined. |
8690e634 JK |
32151 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
32152 | fi | |
18848e28 | 32153 | if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then |
d0ac1c44 | 32154 | as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined. |
18848e28 GF |
32155 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
32156 | fi | |
88b48903 | 32157 | if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then |
d0ac1c44 | 32158 | as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined. |
88b48903 WN |
32159 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
32160 | fi | |
8690e634 | 32161 | if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then |
d0ac1c44 | 32162 | as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined. |
8690e634 JK |
32163 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
32164 | fi | |
c0c3707f CB |
32165 | if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then |
32166 | as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined. | |
32167 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
32168 | fi | |
32169 | if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then | |
32170 | as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined. | |
32171 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
32172 | fi | |
6ec2e0f5 | 32173 | if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then |
d0ac1c44 | 32174 | as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined. |
6ec2e0f5 SDJ |
32175 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
32176 | fi | |
49e4877c | 32177 | if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then |
d0ac1c44 | 32178 | as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. |
49e4877c PA |
32179 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
32180 | fi | |
32181 | if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then | |
d0ac1c44 | 32182 | as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. |
49e4877c PA |
32183 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
32184 | fi | |
c971b7fa | 32185 | if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then |
d0ac1c44 | 32186 | as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined. |
c971b7fa PA |
32187 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
32188 | fi | |
88b48903 WN |
32189 | |
32190 | ||
5df4cba6 SM |
32191 | if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then |
32192 | as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. | |
32193 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
32194 | fi | |
725e2999 JB |
32195 | if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then |
32196 | as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined. | |
32197 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
32198 | fi | |
32199 | if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then | |
32200 | as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined. | |
32201 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
32202 | fi | |
8690e634 | 32203 | if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then |
d0ac1c44 | 32204 | as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined. |
8690e634 JK |
32205 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
32206 | fi | |
c971b7fa | 32207 | if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then |
d0ac1c44 | 32208 | as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. |
c971b7fa PA |
32209 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
32210 | fi | |
32211 | ||
32212 | gl_libobjs= | |
32213 | gl_ltlibobjs= | |
32214 | if test -n "$gl_LIBOBJS"; then | |
32215 | # Remove the extension. | |
32216 | sed_drop_objext='s/\.o$//;s/\.obj$//' | |
32217 | for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do | |
32218 | gl_libobjs="$gl_libobjs $i.$ac_objext" | |
32219 | gl_ltlibobjs="$gl_ltlibobjs $i.lo" | |
32220 | done | |
32221 | fi | |
32222 | gl_LIBOBJS=$gl_libobjs | |
32223 | ||
32224 | gl_LTLIBOBJS=$gl_ltlibobjs | |
32225 | ||
32226 | ||
32227 | ||
32228 | gltests_libobjs= | |
32229 | gltests_ltlibobjs= | |
32230 | if test -n "$gltests_LIBOBJS"; then | |
32231 | # Remove the extension. | |
32232 | sed_drop_objext='s/\.o$//;s/\.obj$//' | |
32233 | for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do | |
32234 | gltests_libobjs="$gltests_libobjs $i.$ac_objext" | |
32235 | gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" | |
32236 | done | |
32237 | fi | |
32238 | gltests_LIBOBJS=$gltests_libobjs | |
32239 | ||
32240 | gltests_LTLIBOBJS=$gltests_ltlibobjs | |
32241 | ||
32242 | ||
d0ac1c44 SM |
32243 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 |
32244 | $as_echo_n "checking that generated files are newer than configure... " >&6; } | |
32245 | if test -n "$am_sleep_pid"; then | |
32246 | # Hide warnings about reused PIDs. | |
32247 | wait $am_sleep_pid 2>/dev/null | |
32248 | fi | |
32249 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 | |
32250 | $as_echo "done" >&6; } | |
c971b7fa | 32251 | if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then |
d0ac1c44 | 32252 | as_fn_error $? "conditional \"AMDEP\" was never defined. |
c971b7fa PA |
32253 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
32254 | fi | |
32255 | if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then | |
d0ac1c44 | 32256 | as_fn_error $? "conditional \"am__fastdepCC\" was never defined. |
c971b7fa PA |
32257 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
32258 | fi | |
32259 | if test -n "$EXEEXT"; then | |
32260 | am__EXEEXT_TRUE= | |
32261 | am__EXEEXT_FALSE='#' | |
32262 | else | |
32263 | am__EXEEXT_TRUE='#' | |
32264 | am__EXEEXT_FALSE= | |
32265 | fi | |
32266 | ||
32267 | ||
d0ac1c44 | 32268 | : "${CONFIG_STATUS=./config.status}" |
c971b7fa PA |
32269 | ac_write_fail=0 |
32270 | ac_clean_files_save=$ac_clean_files | |
32271 | ac_clean_files="$ac_clean_files $CONFIG_STATUS" | |
32272 | { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 | |
32273 | $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} | |
32274 | as_write_fail=0 | |
32275 | cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 | |
32276 | #! $SHELL | |
32277 | # Generated by $as_me. | |
32278 | # Run this file to recreate the current configuration. | |
32279 | # Compiler output produced by configure, useful for debugging | |
32280 | # configure, is in config.log if it exists. | |
32281 | ||
32282 | debug=false | |
32283 | ac_cs_recheck=false | |
32284 | ac_cs_silent=false | |
32285 | ||
32286 | SHELL=\${CONFIG_SHELL-$SHELL} | |
32287 | export SHELL | |
32288 | _ASEOF | |
32289 | cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 | |
32290 | ## -------------------- ## | |
32291 | ## M4sh Initialization. ## | |
32292 | ## -------------------- ## | |
32293 | ||
32294 | # Be more Bourne compatible | |
32295 | DUALCASE=1; export DUALCASE # for MKS sh | |
32296 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : | |
32297 | emulate sh | |
32298 | NULLCMD=: | |
32299 | # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which | |
32300 | # is contrary to our usage. Disable this feature. | |
32301 | alias -g '${1+"$@"}'='"$@"' | |
32302 | setopt NO_GLOB_SUBST | |
32303 | else | |
32304 | case `(set -o) 2>/dev/null` in #( | |
32305 | *posix*) : | |
32306 | set -o posix ;; #( | |
32307 | *) : | |
32308 | ;; | |
32309 | esac | |
32310 | fi | |
32311 | ||
32312 | ||
32313 | as_nl=' | |
32314 | ' | |
32315 | export as_nl | |
32316 | # Printing a long string crashes Solaris 7 /usr/bin/printf. | |
32317 | as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' | |
32318 | as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo | |
32319 | as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo | |
32320 | # Prefer a ksh shell builtin over an external printf program on Solaris, | |
32321 | # but without wasting forks for bash or zsh. | |
32322 | if test -z "$BASH_VERSION$ZSH_VERSION" \ | |
32323 | && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then | |
32324 | as_echo='print -r --' | |
32325 | as_echo_n='print -rn --' | |
32326 | elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then | |
32327 | as_echo='printf %s\n' | |
32328 | as_echo_n='printf %s' | |
32329 | else | |
32330 | if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then | |
32331 | as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' | |
32332 | as_echo_n='/usr/ucb/echo -n' | |
32333 | else | |
32334 | as_echo_body='eval expr "X$1" : "X\\(.*\\)"' | |
32335 | as_echo_n_body='eval | |
32336 | arg=$1; | |
32337 | case $arg in #( | |
32338 | *"$as_nl"*) | |
32339 | expr "X$arg" : "X\\(.*\\)$as_nl"; | |
32340 | arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; | |
32341 | esac; | |
32342 | expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" | |
32343 | ' | |
32344 | export as_echo_n_body | |
32345 | as_echo_n='sh -c $as_echo_n_body as_echo' | |
32346 | fi | |
32347 | export as_echo_body | |
32348 | as_echo='sh -c $as_echo_body as_echo' | |
32349 | fi | |
32350 | ||
32351 | # The user is always right. | |
32352 | if test "${PATH_SEPARATOR+set}" != set; then | |
32353 | PATH_SEPARATOR=: | |
32354 | (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { | |
32355 | (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || | |
32356 | PATH_SEPARATOR=';' | |
32357 | } | |
32358 | fi | |
32359 | ||
32360 | ||
32361 | # IFS | |
32362 | # We need space, tab and new line, in precisely that order. Quoting is | |
32363 | # there to prevent editors from complaining about space-tab. | |
32364 | # (If _AS_PATH_WALK were called with IFS unset, it would disable word | |
32365 | # splitting by setting IFS to empty value.) | |
32366 | IFS=" "" $as_nl" | |
32367 | ||
32368 | # Find who we are. Look in the path if we contain no directory separator. | |
d0ac1c44 | 32369 | as_myself= |
c971b7fa PA |
32370 | case $0 in #(( |
32371 | *[\\/]* ) as_myself=$0 ;; | |
32372 | *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
32373 | for as_dir in $PATH | |
32374 | do | |
32375 | IFS=$as_save_IFS | |
32376 | test -z "$as_dir" && as_dir=. | |
32377 | test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break | |
32378 | done | |
32379 | IFS=$as_save_IFS | |
32380 | ||
32381 | ;; | |
32382 | esac | |
32383 | # We did not find ourselves, most probably we were run as `sh COMMAND' | |
32384 | # in which case we are not to be found in the path. | |
32385 | if test "x$as_myself" = x; then | |
32386 | as_myself=$0 | |
32387 | fi | |
32388 | if test ! -f "$as_myself"; then | |
32389 | $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 | |
32390 | exit 1 | |
32391 | fi | |
32392 | ||
32393 | # Unset variables that we do not need and which cause bugs (e.g. in | |
32394 | # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" | |
32395 | # suppresses any "Segmentation fault" message there. '((' could | |
32396 | # trigger a bug in pdksh 5.2.14. | |
32397 | for as_var in BASH_ENV ENV MAIL MAILPATH | |
32398 | do eval test x\${$as_var+set} = xset \ | |
32399 | && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : | |
32400 | done | |
32401 | PS1='$ ' | |
32402 | PS2='> ' | |
32403 | PS4='+ ' | |
32404 | ||
32405 | # NLS nuisances. | |
32406 | LC_ALL=C | |
32407 | export LC_ALL | |
32408 | LANGUAGE=C | |
32409 | export LANGUAGE | |
32410 | ||
32411 | # CDPATH. | |
32412 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH | |
32413 | ||
32414 | ||
d0ac1c44 SM |
32415 | # as_fn_error STATUS ERROR [LINENO LOG_FD] |
32416 | # ---------------------------------------- | |
c971b7fa PA |
32417 | # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are |
32418 | # provided, also output the error to LOG_FD, referencing LINENO. Then exit the | |
d0ac1c44 | 32419 | # script with STATUS, using 1 if that was 0. |
c971b7fa PA |
32420 | as_fn_error () |
32421 | { | |
d0ac1c44 SM |
32422 | as_status=$1; test $as_status -eq 0 && as_status=1 |
32423 | if test "$4"; then | |
32424 | as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
32425 | $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 | |
c971b7fa | 32426 | fi |
d0ac1c44 | 32427 | $as_echo "$as_me: error: $2" >&2 |
c971b7fa PA |
32428 | as_fn_exit $as_status |
32429 | } # as_fn_error | |
32430 | ||
32431 | ||
32432 | # as_fn_set_status STATUS | |
32433 | # ----------------------- | |
32434 | # Set $? to STATUS, without forking. | |
32435 | as_fn_set_status () | |
32436 | { | |
32437 | return $1 | |
32438 | } # as_fn_set_status | |
32439 | ||
32440 | # as_fn_exit STATUS | |
32441 | # ----------------- | |
32442 | # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. | |
32443 | as_fn_exit () | |
32444 | { | |
32445 | set +e | |
32446 | as_fn_set_status $1 | |
32447 | exit $1 | |
32448 | } # as_fn_exit | |
32449 | ||
32450 | # as_fn_unset VAR | |
32451 | # --------------- | |
32452 | # Portably unset VAR. | |
32453 | as_fn_unset () | |
32454 | { | |
32455 | { eval $1=; unset $1;} | |
32456 | } | |
32457 | as_unset=as_fn_unset | |
32458 | # as_fn_append VAR VALUE | |
32459 | # ---------------------- | |
32460 | # Append the text in VALUE to the end of the definition contained in VAR. Take | |
32461 | # advantage of any shell optimizations that allow amortized linear growth over | |
32462 | # repeated appends, instead of the typical quadratic growth present in naive | |
32463 | # implementations. | |
32464 | if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : | |
32465 | eval 'as_fn_append () | |
32466 | { | |
32467 | eval $1+=\$2 | |
32468 | }' | |
32469 | else | |
32470 | as_fn_append () | |
32471 | { | |
32472 | eval $1=\$$1\$2 | |
32473 | } | |
32474 | fi # as_fn_append | |
32475 | ||
32476 | # as_fn_arith ARG... | |
32477 | # ------------------ | |
32478 | # Perform arithmetic evaluation on the ARGs, and store the result in the | |
32479 | # global $as_val. Take advantage of shells that can avoid forks. The arguments | |
32480 | # must be portable across $(()) and expr. | |
32481 | if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : | |
32482 | eval 'as_fn_arith () | |
32483 | { | |
32484 | as_val=$(( $* )) | |
32485 | }' | |
32486 | else | |
32487 | as_fn_arith () | |
32488 | { | |
32489 | as_val=`expr "$@" || test $? -eq 1` | |
32490 | } | |
32491 | fi # as_fn_arith | |
32492 | ||
32493 | ||
32494 | if expr a : '\(a\)' >/dev/null 2>&1 && | |
32495 | test "X`expr 00001 : '.*\(...\)'`" = X001; then | |
32496 | as_expr=expr | |
32497 | else | |
32498 | as_expr=false | |
32499 | fi | |
32500 | ||
32501 | if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then | |
32502 | as_basename=basename | |
32503 | else | |
32504 | as_basename=false | |
32505 | fi | |
32506 | ||
32507 | if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then | |
32508 | as_dirname=dirname | |
32509 | else | |
32510 | as_dirname=false | |
32511 | fi | |
32512 | ||
32513 | as_me=`$as_basename -- "$0" || | |
32514 | $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ | |
32515 | X"$0" : 'X\(//\)$' \| \ | |
32516 | X"$0" : 'X\(/\)' \| . 2>/dev/null || | |
32517 | $as_echo X/"$0" | | |
32518 | sed '/^.*\/\([^/][^/]*\)\/*$/{ | |
32519 | s//\1/ | |
32520 | q | |
32521 | } | |
32522 | /^X\/\(\/\/\)$/{ | |
32523 | s//\1/ | |
32524 | q | |
32525 | } | |
32526 | /^X\/\(\/\).*/{ | |
32527 | s//\1/ | |
32528 | q | |
32529 | } | |
32530 | s/.*/./; q'` | |
32531 | ||
32532 | # Avoid depending upon Character Ranges. | |
32533 | as_cr_letters='abcdefghijklmnopqrstuvwxyz' | |
32534 | as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
32535 | as_cr_Letters=$as_cr_letters$as_cr_LETTERS | |
32536 | as_cr_digits='0123456789' | |
32537 | as_cr_alnum=$as_cr_Letters$as_cr_digits | |
32538 | ||
32539 | ECHO_C= ECHO_N= ECHO_T= | |
32540 | case `echo -n x` in #((((( | |
32541 | -n*) | |
32542 | case `echo 'xy\c'` in | |
32543 | *c*) ECHO_T=' ';; # ECHO_T is single tab character. | |
32544 | xy) ECHO_C='\c';; | |
32545 | *) echo `echo ksh88 bug on AIX 6.1` > /dev/null | |
32546 | ECHO_T=' ';; | |
32547 | esac;; | |
32548 | *) | |
32549 | ECHO_N='-n';; | |
32550 | esac | |
32551 | ||
32552 | rm -f conf$$ conf$$.exe conf$$.file | |
32553 | if test -d conf$$.dir; then | |
32554 | rm -f conf$$.dir/conf$$.file | |
32555 | else | |
32556 | rm -f conf$$.dir | |
32557 | mkdir conf$$.dir 2>/dev/null | |
32558 | fi | |
32559 | if (echo >conf$$.file) 2>/dev/null; then | |
32560 | if ln -s conf$$.file conf$$ 2>/dev/null; then | |
32561 | as_ln_s='ln -s' | |
32562 | # ... but there are two gotchas: | |
32563 | # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. | |
32564 | # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. | |
d0ac1c44 | 32565 | # In both cases, we have to default to `cp -pR'. |
c971b7fa | 32566 | ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || |
d0ac1c44 | 32567 | as_ln_s='cp -pR' |
c971b7fa PA |
32568 | elif ln conf$$.file conf$$ 2>/dev/null; then |
32569 | as_ln_s=ln | |
32570 | else | |
d0ac1c44 | 32571 | as_ln_s='cp -pR' |
c971b7fa PA |
32572 | fi |
32573 | else | |
d0ac1c44 | 32574 | as_ln_s='cp -pR' |
c971b7fa PA |
32575 | fi |
32576 | rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file | |
32577 | rmdir conf$$.dir 2>/dev/null | |
32578 | ||
32579 | ||
32580 | # as_fn_mkdir_p | |
32581 | # ------------- | |
32582 | # Create "$as_dir" as a directory, including parents if necessary. | |
32583 | as_fn_mkdir_p () | |
32584 | { | |
32585 | ||
32586 | case $as_dir in #( | |
32587 | -*) as_dir=./$as_dir;; | |
32588 | esac | |
32589 | test -d "$as_dir" || eval $as_mkdir_p || { | |
32590 | as_dirs= | |
32591 | while :; do | |
32592 | case $as_dir in #( | |
32593 | *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( | |
32594 | *) as_qdir=$as_dir;; | |
32595 | esac | |
32596 | as_dirs="'$as_qdir' $as_dirs" | |
32597 | as_dir=`$as_dirname -- "$as_dir" || | |
32598 | $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
32599 | X"$as_dir" : 'X\(//\)[^/]' \| \ | |
32600 | X"$as_dir" : 'X\(//\)$' \| \ | |
32601 | X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || | |
32602 | $as_echo X"$as_dir" | | |
32603 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
32604 | s//\1/ | |
32605 | q | |
32606 | } | |
32607 | /^X\(\/\/\)[^/].*/{ | |
32608 | s//\1/ | |
32609 | q | |
32610 | } | |
32611 | /^X\(\/\/\)$/{ | |
32612 | s//\1/ | |
32613 | q | |
32614 | } | |
32615 | /^X\(\/\).*/{ | |
32616 | s//\1/ | |
32617 | q | |
32618 | } | |
32619 | s/.*/./; q'` | |
32620 | test -d "$as_dir" && break | |
32621 | done | |
32622 | test -z "$as_dirs" || eval "mkdir $as_dirs" | |
d0ac1c44 | 32623 | } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" |
c971b7fa PA |
32624 | |
32625 | ||
32626 | } # as_fn_mkdir_p | |
32627 | if mkdir -p . 2>/dev/null; then | |
32628 | as_mkdir_p='mkdir -p "$as_dir"' | |
32629 | else | |
32630 | test -d ./-p && rmdir ./-p | |
32631 | as_mkdir_p=false | |
32632 | fi | |
32633 | ||
d0ac1c44 SM |
32634 | |
32635 | # as_fn_executable_p FILE | |
32636 | # ----------------------- | |
32637 | # Test if FILE is an executable regular file. | |
32638 | as_fn_executable_p () | |
32639 | { | |
32640 | test -f "$1" && test -x "$1" | |
32641 | } # as_fn_executable_p | |
32642 | as_test_x='test -x' | |
32643 | as_executable_p=as_fn_executable_p | |
c971b7fa PA |
32644 | |
32645 | # Sed expression to map a string onto a valid CPP name. | |
32646 | as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" | |
32647 | ||
32648 | # Sed expression to map a string onto a valid variable name. | |
32649 | as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" | |
32650 | ||
32651 | ||
32652 | exec 6>&1 | |
32653 | ## ----------------------------------- ## | |
32654 | ## Main body of $CONFIG_STATUS script. ## | |
32655 | ## ----------------------------------- ## | |
32656 | _ASEOF | |
32657 | test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 | |
32658 | ||
32659 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
32660 | # Save the log message, to keep $0 and so on meaningful, and to | |
32661 | # report actual input values of CONFIG_FILES etc. instead of their | |
32662 | # values after options handling. | |
32663 | ac_log=" | |
d0ac1c44 SM |
32664 | This file was extended by libgnu $as_me UNUSED-VERSION, which was |
32665 | generated by GNU Autoconf 2.69. Invocation command line was | |
c971b7fa PA |
32666 | |
32667 | CONFIG_FILES = $CONFIG_FILES | |
32668 | CONFIG_HEADERS = $CONFIG_HEADERS | |
32669 | CONFIG_LINKS = $CONFIG_LINKS | |
32670 | CONFIG_COMMANDS = $CONFIG_COMMANDS | |
32671 | $ $0 $@ | |
32672 | ||
32673 | on `(hostname || uname -n) 2>/dev/null | sed 1q` | |
32674 | " | |
32675 | ||
32676 | _ACEOF | |
32677 | ||
32678 | case $ac_config_files in *" | |
32679 | "*) set x $ac_config_files; shift; ac_config_files=$*;; | |
32680 | esac | |
32681 | ||
32682 | case $ac_config_headers in *" | |
32683 | "*) set x $ac_config_headers; shift; ac_config_headers=$*;; | |
32684 | esac | |
32685 | ||
32686 | ||
32687 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
32688 | # Files that config.status was made for. | |
32689 | config_files="$ac_config_files" | |
32690 | config_headers="$ac_config_headers" | |
32691 | config_commands="$ac_config_commands" | |
32692 | ||
32693 | _ACEOF | |
32694 | ||
32695 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
32696 | ac_cs_usage="\ | |
32697 | \`$as_me' instantiates files and other configuration actions | |
32698 | from templates according to the current configuration. Unless the files | |
32699 | and actions are specified as TAGs, all are instantiated by default. | |
32700 | ||
32701 | Usage: $0 [OPTION]... [TAG]... | |
32702 | ||
32703 | -h, --help print this help, then exit | |
32704 | -V, --version print version number and configuration settings, then exit | |
d0ac1c44 | 32705 | --config print configuration, then exit |
c971b7fa PA |
32706 | -q, --quiet, --silent |
32707 | do not print progress messages | |
32708 | -d, --debug don't remove temporary files | |
32709 | --recheck update $as_me by reconfiguring in the same conditions | |
32710 | --file=FILE[:TEMPLATE] | |
32711 | instantiate the configuration file FILE | |
32712 | --header=FILE[:TEMPLATE] | |
32713 | instantiate the configuration header FILE | |
32714 | ||
32715 | Configuration files: | |
32716 | $config_files | |
32717 | ||
32718 | Configuration headers: | |
32719 | $config_headers | |
32720 | ||
32721 | Configuration commands: | |
32722 | $config_commands | |
32723 | ||
32724 | Report bugs to the package provider." | |
32725 | ||
32726 | _ACEOF | |
32727 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
d0ac1c44 | 32728 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
c971b7fa | 32729 | ac_cs_version="\\ |
d0ac1c44 SM |
32730 | libgnu config.status UNUSED-VERSION |
32731 | configured by $0, generated by GNU Autoconf 2.69, | |
32732 | with options \\"\$ac_cs_config\\" | |
c971b7fa | 32733 | |
d0ac1c44 | 32734 | Copyright (C) 2012 Free Software Foundation, Inc. |
c971b7fa PA |
32735 | This config.status script is free software; the Free Software Foundation |
32736 | gives unlimited permission to copy, distribute and modify it." | |
32737 | ||
32738 | ac_pwd='$ac_pwd' | |
32739 | srcdir='$srcdir' | |
32740 | INSTALL='$INSTALL' | |
32741 | MKDIR_P='$MKDIR_P' | |
32742 | AWK='$AWK' | |
32743 | test -n "\$AWK" || AWK=awk | |
32744 | _ACEOF | |
32745 | ||
32746 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
32747 | # The default lists apply if the user does not specify any file. | |
32748 | ac_need_defaults=: | |
32749 | while test $# != 0 | |
32750 | do | |
32751 | case $1 in | |
d0ac1c44 | 32752 | --*=?*) |
c971b7fa PA |
32753 | ac_option=`expr "X$1" : 'X\([^=]*\)='` |
32754 | ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` | |
32755 | ac_shift=: | |
32756 | ;; | |
d0ac1c44 SM |
32757 | --*=) |
32758 | ac_option=`expr "X$1" : 'X\([^=]*\)='` | |
32759 | ac_optarg= | |
32760 | ac_shift=: | |
32761 | ;; | |
c971b7fa PA |
32762 | *) |
32763 | ac_option=$1 | |
32764 | ac_optarg=$2 | |
32765 | ac_shift=shift | |
32766 | ;; | |
32767 | esac | |
32768 | ||
32769 | case $ac_option in | |
32770 | # Handling of the options. | |
32771 | -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) | |
32772 | ac_cs_recheck=: ;; | |
32773 | --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) | |
32774 | $as_echo "$ac_cs_version"; exit ;; | |
d0ac1c44 SM |
32775 | --config | --confi | --conf | --con | --co | --c ) |
32776 | $as_echo "$ac_cs_config"; exit ;; | |
c971b7fa PA |
32777 | --debug | --debu | --deb | --de | --d | -d ) |
32778 | debug=: ;; | |
32779 | --file | --fil | --fi | --f ) | |
32780 | $ac_shift | |
32781 | case $ac_optarg in | |
32782 | *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; | |
d0ac1c44 | 32783 | '') as_fn_error $? "missing file argument" ;; |
c971b7fa PA |
32784 | esac |
32785 | as_fn_append CONFIG_FILES " '$ac_optarg'" | |
32786 | ac_need_defaults=false;; | |
32787 | --header | --heade | --head | --hea ) | |
32788 | $ac_shift | |
32789 | case $ac_optarg in | |
32790 | *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; | |
32791 | esac | |
32792 | as_fn_append CONFIG_HEADERS " '$ac_optarg'" | |
32793 | ac_need_defaults=false;; | |
32794 | --he | --h) | |
32795 | # Conflict between --help and --header | |
d0ac1c44 | 32796 | as_fn_error $? "ambiguous option: \`$1' |
c971b7fa PA |
32797 | Try \`$0 --help' for more information.";; |
32798 | --help | --hel | -h ) | |
32799 | $as_echo "$ac_cs_usage"; exit ;; | |
32800 | -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | |
32801 | | -silent | --silent | --silen | --sile | --sil | --si | --s) | |
32802 | ac_cs_silent=: ;; | |
32803 | ||
32804 | # This is an error. | |
d0ac1c44 | 32805 | -*) as_fn_error $? "unrecognized option: \`$1' |
c971b7fa PA |
32806 | Try \`$0 --help' for more information." ;; |
32807 | ||
32808 | *) as_fn_append ac_config_targets " $1" | |
32809 | ac_need_defaults=false ;; | |
32810 | ||
32811 | esac | |
32812 | shift | |
32813 | done | |
32814 | ||
32815 | ac_configure_extra_args= | |
32816 | ||
32817 | if $ac_cs_silent; then | |
32818 | exec 6>/dev/null | |
32819 | ac_configure_extra_args="$ac_configure_extra_args --silent" | |
32820 | fi | |
32821 | ||
32822 | _ACEOF | |
32823 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
32824 | if \$ac_cs_recheck; then | |
d0ac1c44 | 32825 | set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion |
c971b7fa PA |
32826 | shift |
32827 | \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 | |
32828 | CONFIG_SHELL='$SHELL' | |
32829 | export CONFIG_SHELL | |
32830 | exec "\$@" | |
32831 | fi | |
32832 | ||
32833 | _ACEOF | |
32834 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
32835 | exec 5>>config.log | |
32836 | { | |
32837 | echo | |
32838 | sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX | |
32839 | ## Running $as_me. ## | |
32840 | _ASBOX | |
32841 | $as_echo "$ac_log" | |
32842 | } >&5 | |
32843 | ||
32844 | _ACEOF | |
32845 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
32846 | # | |
32847 | # INIT-COMMANDS | |
32848 | # | |
32849 | AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" | |
32850 | ||
32851 | _ACEOF | |
32852 | ||
32853 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
32854 | ||
32855 | # Handling of arguments. | |
32856 | for ac_config_target in $ac_config_targets | |
32857 | do | |
32858 | case $ac_config_target in | |
32859 | "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; | |
32860 | "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; | |
361cb219 | 32861 | "Makefile.gnulib.inc") CONFIG_FILES="$CONFIG_FILES Makefile.gnulib.inc" ;; |
c971b7fa PA |
32862 | "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; |
32863 | "import/Makefile") CONFIG_FILES="$CONFIG_FILES import/Makefile" ;; | |
32864 | "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; | |
32865 | ||
d0ac1c44 | 32866 | *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; |
c971b7fa PA |
32867 | esac |
32868 | done | |
32869 | ||
32870 | ||
32871 | # If the user did not use the arguments to specify the items to instantiate, | |
32872 | # then the envvar interface is used. Set only those that are not. | |
32873 | # We use the long form for the default assignment because of an extremely | |
32874 | # bizarre bug on SunOS 4.1.3. | |
32875 | if $ac_need_defaults; then | |
32876 | test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files | |
32877 | test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers | |
32878 | test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands | |
32879 | fi | |
32880 | ||
32881 | # Have a temporary directory for convenience. Make it in the build tree | |
32882 | # simply because there is no reason against having it here, and in addition, | |
32883 | # creating and moving files from /tmp can sometimes cause problems. | |
32884 | # Hook for its removal unless debugging. | |
32885 | # Note that there is a small window in which the directory will not be cleaned: | |
32886 | # after its creation but before its name has been assigned to `$tmp'. | |
32887 | $debug || | |
32888 | { | |
d0ac1c44 | 32889 | tmp= ac_tmp= |
c971b7fa | 32890 | trap 'exit_status=$? |
d0ac1c44 SM |
32891 | : "${ac_tmp:=$tmp}" |
32892 | { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status | |
c971b7fa PA |
32893 | ' 0 |
32894 | trap 'as_fn_exit 1' 1 2 13 15 | |
32895 | } | |
32896 | # Create a (secure) tmp directory for tmp files. | |
32897 | ||
32898 | { | |
32899 | tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && | |
d0ac1c44 | 32900 | test -d "$tmp" |
c971b7fa PA |
32901 | } || |
32902 | { | |
32903 | tmp=./conf$$-$RANDOM | |
32904 | (umask 077 && mkdir "$tmp") | |
d0ac1c44 SM |
32905 | } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 |
32906 | ac_tmp=$tmp | |
c971b7fa PA |
32907 | |
32908 | # Set up the scripts for CONFIG_FILES section. | |
32909 | # No need to generate them if there are no CONFIG_FILES. | |
32910 | # This happens for instance with `./config.status config.h'. | |
32911 | if test -n "$CONFIG_FILES"; then | |
32912 | ||
32913 | ||
32914 | ac_cr=`echo X | tr X '\015'` | |
32915 | # On cygwin, bash can eat \r inside `` if the user requested igncr. | |
32916 | # But we know of no other shell where ac_cr would be empty at this | |
32917 | # point, so we can use a bashism as a fallback. | |
32918 | if test "x$ac_cr" = x; then | |
32919 | eval ac_cr=\$\'\\r\' | |
32920 | fi | |
32921 | ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` | |
32922 | if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then | |
d0ac1c44 | 32923 | ac_cs_awk_cr='\\r' |
c971b7fa PA |
32924 | else |
32925 | ac_cs_awk_cr=$ac_cr | |
32926 | fi | |
32927 | ||
d0ac1c44 | 32928 | echo 'BEGIN {' >"$ac_tmp/subs1.awk" && |
c971b7fa PA |
32929 | _ACEOF |
32930 | ||
32931 | ||
32932 | { | |
32933 | echo "cat >conf$$subs.awk <<_ACEOF" && | |
32934 | echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && | |
32935 | echo "_ACEOF" | |
32936 | } >conf$$subs.sh || | |
d0ac1c44 SM |
32937 | as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 |
32938 | ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` | |
c971b7fa PA |
32939 | ac_delim='%!_!# ' |
32940 | for ac_last_try in false false false false false :; do | |
32941 | . ./conf$$subs.sh || | |
d0ac1c44 | 32942 | as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 |
c971b7fa PA |
32943 | |
32944 | ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` | |
32945 | if test $ac_delim_n = $ac_delim_num; then | |
32946 | break | |
32947 | elif $ac_last_try; then | |
d0ac1c44 | 32948 | as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 |
c971b7fa PA |
32949 | else |
32950 | ac_delim="$ac_delim!$ac_delim _$ac_delim!! " | |
32951 | fi | |
32952 | done | |
32953 | rm -f conf$$subs.sh | |
32954 | ||
32955 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
d0ac1c44 | 32956 | cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && |
c971b7fa PA |
32957 | _ACEOF |
32958 | sed -n ' | |
32959 | h | |
32960 | s/^/S["/; s/!.*/"]=/ | |
32961 | p | |
32962 | g | |
32963 | s/^[^!]*!// | |
32964 | :repl | |
32965 | t repl | |
32966 | s/'"$ac_delim"'$// | |
32967 | t delim | |
32968 | :nl | |
32969 | h | |
d0ac1c44 | 32970 | s/\(.\{148\}\)..*/\1/ |
c971b7fa PA |
32971 | t more1 |
32972 | s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ | |
32973 | p | |
32974 | n | |
32975 | b repl | |
32976 | :more1 | |
32977 | s/["\\]/\\&/g; s/^/"/; s/$/"\\/ | |
32978 | p | |
32979 | g | |
32980 | s/.\{148\}// | |
32981 | t nl | |
32982 | :delim | |
32983 | h | |
d0ac1c44 | 32984 | s/\(.\{148\}\)..*/\1/ |
c971b7fa PA |
32985 | t more2 |
32986 | s/["\\]/\\&/g; s/^/"/; s/$/"/ | |
32987 | p | |
32988 | b | |
32989 | :more2 | |
32990 | s/["\\]/\\&/g; s/^/"/; s/$/"\\/ | |
32991 | p | |
32992 | g | |
32993 | s/.\{148\}// | |
32994 | t delim | |
32995 | ' <conf$$subs.awk | sed ' | |
32996 | /^[^""]/{ | |
32997 | N | |
32998 | s/\n// | |
32999 | } | |
33000 | ' >>$CONFIG_STATUS || ac_write_fail=1 | |
33001 | rm -f conf$$subs.awk | |
33002 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
33003 | _ACAWK | |
d0ac1c44 | 33004 | cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && |
c971b7fa PA |
33005 | for (key in S) S_is_set[key] = 1 |
33006 | FS = "\a" | |
33007 | ||
33008 | } | |
33009 | { | |
33010 | line = $ 0 | |
33011 | nfields = split(line, field, "@") | |
33012 | substed = 0 | |
33013 | len = length(field[1]) | |
33014 | for (i = 2; i < nfields; i++) { | |
33015 | key = field[i] | |
33016 | keylen = length(key) | |
33017 | if (S_is_set[key]) { | |
33018 | value = S[key] | |
33019 | line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) | |
33020 | len += length(value) + length(field[++i]) | |
33021 | substed = 1 | |
33022 | } else | |
33023 | len += 1 + keylen | |
33024 | } | |
33025 | ||
33026 | print line | |
33027 | } | |
33028 | ||
33029 | _ACAWK | |
33030 | _ACEOF | |
33031 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
33032 | if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then | |
33033 | sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" | |
33034 | else | |
33035 | cat | |
d0ac1c44 SM |
33036 | fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ |
33037 | || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 | |
c971b7fa PA |
33038 | _ACEOF |
33039 | ||
d0ac1c44 SM |
33040 | # VPATH may cause trouble with some makes, so we remove sole $(srcdir), |
33041 | # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and | |
c971b7fa PA |
33042 | # trailing colons and then remove the whole line if VPATH becomes empty |
33043 | # (actually we leave an empty line to preserve line numbers). | |
33044 | if test "x$srcdir" = x.; then | |
d0ac1c44 SM |
33045 | ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ |
33046 | h | |
33047 | s/// | |
33048 | s/^/:/ | |
33049 | s/[ ]*$/:/ | |
33050 | s/:\$(srcdir):/:/g | |
33051 | s/:\${srcdir}:/:/g | |
33052 | s/:@srcdir@:/:/g | |
33053 | s/^:*// | |
c971b7fa | 33054 | s/:*$// |
d0ac1c44 SM |
33055 | x |
33056 | s/\(=[ ]*\).*/\1/ | |
33057 | G | |
33058 | s/\n// | |
c971b7fa PA |
33059 | s/^[^=]*=[ ]*$// |
33060 | }' | |
33061 | fi | |
33062 | ||
33063 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
33064 | fi # test -n "$CONFIG_FILES" | |
33065 | ||
33066 | # Set up the scripts for CONFIG_HEADERS section. | |
33067 | # No need to generate them if there are no CONFIG_HEADERS. | |
33068 | # This happens for instance with `./config.status Makefile'. | |
33069 | if test -n "$CONFIG_HEADERS"; then | |
d0ac1c44 | 33070 | cat >"$ac_tmp/defines.awk" <<\_ACAWK || |
c971b7fa PA |
33071 | BEGIN { |
33072 | _ACEOF | |
33073 | ||
33074 | # Transform confdefs.h into an awk script `defines.awk', embedded as | |
33075 | # here-document in config.status, that substitutes the proper values into | |
33076 | # config.h.in to produce config.h. | |
33077 | ||
33078 | # Create a delimiter string that does not exist in confdefs.h, to ease | |
33079 | # handling of long lines. | |
33080 | ac_delim='%!_!# ' | |
33081 | for ac_last_try in false false :; do | |
d0ac1c44 SM |
33082 | ac_tt=`sed -n "/$ac_delim/p" confdefs.h` |
33083 | if test -z "$ac_tt"; then | |
c971b7fa PA |
33084 | break |
33085 | elif $ac_last_try; then | |
d0ac1c44 | 33086 | as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 |
c971b7fa PA |
33087 | else |
33088 | ac_delim="$ac_delim!$ac_delim _$ac_delim!! " | |
33089 | fi | |
33090 | done | |
33091 | ||
33092 | # For the awk script, D is an array of macro values keyed by name, | |
33093 | # likewise P contains macro parameters if any. Preserve backslash | |
33094 | # newline sequences. | |
33095 | ||
33096 | ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* | |
33097 | sed -n ' | |
33098 | s/.\{148\}/&'"$ac_delim"'/g | |
33099 | t rset | |
33100 | :rset | |
33101 | s/^[ ]*#[ ]*define[ ][ ]*/ / | |
33102 | t def | |
33103 | d | |
33104 | :def | |
33105 | s/\\$// | |
33106 | t bsnl | |
33107 | s/["\\]/\\&/g | |
33108 | s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ | |
33109 | D["\1"]=" \3"/p | |
33110 | s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p | |
33111 | d | |
33112 | :bsnl | |
33113 | s/["\\]/\\&/g | |
33114 | s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ | |
33115 | D["\1"]=" \3\\\\\\n"\\/p | |
33116 | t cont | |
33117 | s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p | |
33118 | t cont | |
33119 | d | |
33120 | :cont | |
33121 | n | |
33122 | s/.\{148\}/&'"$ac_delim"'/g | |
33123 | t clear | |
33124 | :clear | |
33125 | s/\\$// | |
33126 | t bsnlc | |
33127 | s/["\\]/\\&/g; s/^/"/; s/$/"/p | |
33128 | d | |
33129 | :bsnlc | |
33130 | s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p | |
33131 | b cont | |
33132 | ' <confdefs.h | sed ' | |
33133 | s/'"$ac_delim"'/"\\\ | |
33134 | "/g' >>$CONFIG_STATUS || ac_write_fail=1 | |
33135 | ||
33136 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
33137 | for (key in D) D_is_set[key] = 1 | |
33138 | FS = "\a" | |
33139 | } | |
33140 | /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { | |
33141 | line = \$ 0 | |
33142 | split(line, arg, " ") | |
33143 | if (arg[1] == "#") { | |
33144 | defundef = arg[2] | |
33145 | mac1 = arg[3] | |
33146 | } else { | |
33147 | defundef = substr(arg[1], 2) | |
33148 | mac1 = arg[2] | |
33149 | } | |
33150 | split(mac1, mac2, "(") #) | |
33151 | macro = mac2[1] | |
33152 | prefix = substr(line, 1, index(line, defundef) - 1) | |
33153 | if (D_is_set[macro]) { | |
33154 | # Preserve the white space surrounding the "#". | |
33155 | print prefix "define", macro P[macro] D[macro] | |
33156 | next | |
33157 | } else { | |
33158 | # Replace #undef with comments. This is necessary, for example, | |
33159 | # in the case of _POSIX_SOURCE, which is predefined and required | |
33160 | # on some systems where configure will not decide to define it. | |
33161 | if (defundef == "undef") { | |
33162 | print "/*", prefix defundef, macro, "*/" | |
33163 | next | |
33164 | } | |
33165 | } | |
33166 | } | |
33167 | { print } | |
33168 | _ACAWK | |
33169 | _ACEOF | |
33170 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
d0ac1c44 | 33171 | as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 |
c971b7fa PA |
33172 | fi # test -n "$CONFIG_HEADERS" |
33173 | ||
33174 | ||
33175 | eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" | |
33176 | shift | |
33177 | for ac_tag | |
33178 | do | |
33179 | case $ac_tag in | |
33180 | :[FHLC]) ac_mode=$ac_tag; continue;; | |
33181 | esac | |
33182 | case $ac_mode$ac_tag in | |
33183 | :[FHL]*:*);; | |
d0ac1c44 | 33184 | :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; |
c971b7fa PA |
33185 | :[FH]-) ac_tag=-:-;; |
33186 | :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; | |
33187 | esac | |
33188 | ac_save_IFS=$IFS | |
33189 | IFS=: | |
33190 | set x $ac_tag | |
33191 | IFS=$ac_save_IFS | |
33192 | shift | |
33193 | ac_file=$1 | |
33194 | shift | |
33195 | ||
33196 | case $ac_mode in | |
33197 | :L) ac_source=$1;; | |
33198 | :[FH]) | |
33199 | ac_file_inputs= | |
33200 | for ac_f | |
33201 | do | |
33202 | case $ac_f in | |
d0ac1c44 | 33203 | -) ac_f="$ac_tmp/stdin";; |
c971b7fa PA |
33204 | *) # Look for the file first in the build tree, then in the source tree |
33205 | # (if the path is not absolute). The absolute path cannot be DOS-style, | |
33206 | # because $ac_f cannot contain `:'. | |
33207 | test -f "$ac_f" || | |
33208 | case $ac_f in | |
33209 | [\\/$]*) false;; | |
33210 | *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; | |
33211 | esac || | |
d0ac1c44 | 33212 | as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; |
c971b7fa PA |
33213 | esac |
33214 | case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac | |
33215 | as_fn_append ac_file_inputs " '$ac_f'" | |
33216 | done | |
33217 | ||
33218 | # Let's still pretend it is `configure' which instantiates (i.e., don't | |
33219 | # use $as_me), people would be surprised to read: | |
33220 | # /* config.h. Generated by config.status. */ | |
33221 | configure_input='Generated from '` | |
33222 | $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' | |
33223 | `' by configure.' | |
33224 | if test x"$ac_file" != x-; then | |
33225 | configure_input="$ac_file. $configure_input" | |
33226 | { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 | |
33227 | $as_echo "$as_me: creating $ac_file" >&6;} | |
33228 | fi | |
33229 | # Neutralize special characters interpreted by sed in replacement strings. | |
33230 | case $configure_input in #( | |
33231 | *\&* | *\|* | *\\* ) | |
33232 | ac_sed_conf_input=`$as_echo "$configure_input" | | |
33233 | sed 's/[\\\\&|]/\\\\&/g'`;; #( | |
33234 | *) ac_sed_conf_input=$configure_input;; | |
33235 | esac | |
33236 | ||
33237 | case $ac_tag in | |
d0ac1c44 SM |
33238 | *:-:* | *:-) cat >"$ac_tmp/stdin" \ |
33239 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; | |
c971b7fa PA |
33240 | esac |
33241 | ;; | |
33242 | esac | |
33243 | ||
33244 | ac_dir=`$as_dirname -- "$ac_file" || | |
33245 | $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
33246 | X"$ac_file" : 'X\(//\)[^/]' \| \ | |
33247 | X"$ac_file" : 'X\(//\)$' \| \ | |
33248 | X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || | |
33249 | $as_echo X"$ac_file" | | |
33250 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
33251 | s//\1/ | |
33252 | q | |
33253 | } | |
33254 | /^X\(\/\/\)[^/].*/{ | |
33255 | s//\1/ | |
33256 | q | |
33257 | } | |
33258 | /^X\(\/\/\)$/{ | |
33259 | s//\1/ | |
33260 | q | |
33261 | } | |
33262 | /^X\(\/\).*/{ | |
33263 | s//\1/ | |
33264 | q | |
33265 | } | |
33266 | s/.*/./; q'` | |
33267 | as_dir="$ac_dir"; as_fn_mkdir_p | |
33268 | ac_builddir=. | |
33269 | ||
33270 | case "$ac_dir" in | |
33271 | .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; | |
33272 | *) | |
33273 | ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` | |
33274 | # A ".." for each directory in $ac_dir_suffix. | |
33275 | ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` | |
33276 | case $ac_top_builddir_sub in | |
33277 | "") ac_top_builddir_sub=. ac_top_build_prefix= ;; | |
33278 | *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; | |
33279 | esac ;; | |
33280 | esac | |
33281 | ac_abs_top_builddir=$ac_pwd | |
33282 | ac_abs_builddir=$ac_pwd$ac_dir_suffix | |
33283 | # for backward compatibility: | |
33284 | ac_top_builddir=$ac_top_build_prefix | |
33285 | ||
33286 | case $srcdir in | |
33287 | .) # We are building in place. | |
33288 | ac_srcdir=. | |
33289 | ac_top_srcdir=$ac_top_builddir_sub | |
33290 | ac_abs_top_srcdir=$ac_pwd ;; | |
33291 | [\\/]* | ?:[\\/]* ) # Absolute name. | |
33292 | ac_srcdir=$srcdir$ac_dir_suffix; | |
33293 | ac_top_srcdir=$srcdir | |
33294 | ac_abs_top_srcdir=$srcdir ;; | |
33295 | *) # Relative name. | |
33296 | ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix | |
33297 | ac_top_srcdir=$ac_top_build_prefix$srcdir | |
33298 | ac_abs_top_srcdir=$ac_pwd/$srcdir ;; | |
33299 | esac | |
33300 | ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix | |
33301 | ||
33302 | ||
33303 | case $ac_mode in | |
33304 | :F) | |
33305 | # | |
33306 | # CONFIG_FILE | |
33307 | # | |
33308 | ||
33309 | case $INSTALL in | |
33310 | [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; | |
33311 | *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; | |
33312 | esac | |
33313 | ac_MKDIR_P=$MKDIR_P | |
33314 | case $MKDIR_P in | |
33315 | [\\/$]* | ?:[\\/]* ) ;; | |
33316 | */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; | |
33317 | esac | |
33318 | _ACEOF | |
33319 | ||
33320 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
33321 | # If the template does not know about datarootdir, expand it. | |
33322 | # FIXME: This hack should be removed a few years after 2.60. | |
33323 | ac_datarootdir_hack=; ac_datarootdir_seen= | |
33324 | ac_sed_dataroot=' | |
33325 | /datarootdir/ { | |
33326 | p | |
33327 | q | |
33328 | } | |
33329 | /@datadir@/p | |
33330 | /@docdir@/p | |
33331 | /@infodir@/p | |
33332 | /@localedir@/p | |
33333 | /@mandir@/p' | |
33334 | case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in | |
33335 | *datarootdir*) ac_datarootdir_seen=yes;; | |
33336 | *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) | |
33337 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 | |
33338 | $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} | |
33339 | _ACEOF | |
33340 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
33341 | ac_datarootdir_hack=' | |
33342 | s&@datadir@&$datadir&g | |
33343 | s&@docdir@&$docdir&g | |
33344 | s&@infodir@&$infodir&g | |
33345 | s&@localedir@&$localedir&g | |
33346 | s&@mandir@&$mandir&g | |
33347 | s&\\\${datarootdir}&$datarootdir&g' ;; | |
33348 | esac | |
33349 | _ACEOF | |
33350 | ||
33351 | # Neutralize VPATH when `$srcdir' = `.'. | |
33352 | # Shell code in configure.ac might set extrasub. | |
33353 | # FIXME: do we really want to maintain this feature? | |
33354 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
33355 | ac_sed_extra="$ac_vpsub | |
33356 | $extrasub | |
33357 | _ACEOF | |
33358 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
33359 | :t | |
33360 | /@[a-zA-Z_][a-zA-Z_0-9]*@/!b | |
33361 | s|@configure_input@|$ac_sed_conf_input|;t t | |
33362 | s&@top_builddir@&$ac_top_builddir_sub&;t t | |
33363 | s&@top_build_prefix@&$ac_top_build_prefix&;t t | |
33364 | s&@srcdir@&$ac_srcdir&;t t | |
33365 | s&@abs_srcdir@&$ac_abs_srcdir&;t t | |
33366 | s&@top_srcdir@&$ac_top_srcdir&;t t | |
33367 | s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t | |
33368 | s&@builddir@&$ac_builddir&;t t | |
33369 | s&@abs_builddir@&$ac_abs_builddir&;t t | |
33370 | s&@abs_top_builddir@&$ac_abs_top_builddir&;t t | |
33371 | s&@INSTALL@&$ac_INSTALL&;t t | |
33372 | s&@MKDIR_P@&$ac_MKDIR_P&;t t | |
33373 | $ac_datarootdir_hack | |
33374 | " | |
d0ac1c44 SM |
33375 | eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ |
33376 | >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 | |
c971b7fa PA |
33377 | |
33378 | test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && | |
d0ac1c44 SM |
33379 | { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && |
33380 | { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ | |
33381 | "$ac_tmp/out"`; test -z "$ac_out"; } && | |
c971b7fa | 33382 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' |
d0ac1c44 | 33383 | which seems to be undefined. Please make sure it is defined" >&5 |
c971b7fa | 33384 | $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' |
d0ac1c44 | 33385 | which seems to be undefined. Please make sure it is defined" >&2;} |
c971b7fa | 33386 | |
d0ac1c44 | 33387 | rm -f "$ac_tmp/stdin" |
c971b7fa | 33388 | case $ac_file in |
d0ac1c44 SM |
33389 | -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; |
33390 | *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; | |
c971b7fa | 33391 | esac \ |
d0ac1c44 | 33392 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 |
c971b7fa PA |
33393 | ;; |
33394 | :H) | |
33395 | # | |
33396 | # CONFIG_HEADER | |
33397 | # | |
33398 | if test x"$ac_file" != x-; then | |
33399 | { | |
33400 | $as_echo "/* $configure_input */" \ | |
d0ac1c44 SM |
33401 | && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" |
33402 | } >"$ac_tmp/config.h" \ | |
33403 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 | |
33404 | if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then | |
c971b7fa PA |
33405 | { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 |
33406 | $as_echo "$as_me: $ac_file is unchanged" >&6;} | |
33407 | else | |
33408 | rm -f "$ac_file" | |
d0ac1c44 SM |
33409 | mv "$ac_tmp/config.h" "$ac_file" \ |
33410 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 | |
c971b7fa PA |
33411 | fi |
33412 | else | |
33413 | $as_echo "/* $configure_input */" \ | |
d0ac1c44 SM |
33414 | && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ |
33415 | || as_fn_error $? "could not create -" "$LINENO" 5 | |
c971b7fa PA |
33416 | fi |
33417 | # Compute "$ac_file"'s index in $config_headers. | |
33418 | _am_arg="$ac_file" | |
33419 | _am_stamp_count=1 | |
33420 | for _am_header in $config_headers :; do | |
33421 | case $_am_header in | |
33422 | $_am_arg | $_am_arg:* ) | |
33423 | break ;; | |
33424 | * ) | |
33425 | _am_stamp_count=`expr $_am_stamp_count + 1` ;; | |
33426 | esac | |
33427 | done | |
33428 | echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || | |
33429 | $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
33430 | X"$_am_arg" : 'X\(//\)[^/]' \| \ | |
33431 | X"$_am_arg" : 'X\(//\)$' \| \ | |
33432 | X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || | |
33433 | $as_echo X"$_am_arg" | | |
33434 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
33435 | s//\1/ | |
33436 | q | |
33437 | } | |
33438 | /^X\(\/\/\)[^/].*/{ | |
33439 | s//\1/ | |
33440 | q | |
33441 | } | |
33442 | /^X\(\/\/\)$/{ | |
33443 | s//\1/ | |
33444 | q | |
33445 | } | |
33446 | /^X\(\/\).*/{ | |
33447 | s//\1/ | |
33448 | q | |
33449 | } | |
33450 | s/.*/./; q'`/stamp-h$_am_stamp_count | |
33451 | ;; | |
33452 | ||
33453 | :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 | |
33454 | $as_echo "$as_me: executing $ac_file commands" >&6;} | |
33455 | ;; | |
33456 | esac | |
33457 | ||
33458 | ||
33459 | case $ac_file$ac_mode in | |
33460 | "depfiles":C) test x"$AMDEP_TRUE" != x"" || { | |
d0ac1c44 | 33461 | # Older Autoconf quotes --file arguments for eval, but not when files |
c971b7fa PA |
33462 | # are listed without --file. Let's play safe and only enable the eval |
33463 | # if we detect the quoting. | |
33464 | case $CONFIG_FILES in | |
33465 | *\'*) eval set x "$CONFIG_FILES" ;; | |
33466 | *) set x $CONFIG_FILES ;; | |
33467 | esac | |
33468 | shift | |
33469 | for mf | |
33470 | do | |
33471 | # Strip MF so we end up with the name of the file. | |
33472 | mf=`echo "$mf" | sed -e 's/:.*$//'` | |
33473 | # Check whether this is an Automake generated Makefile or not. | |
d0ac1c44 | 33474 | # We used to match only the files named 'Makefile.in', but |
c971b7fa PA |
33475 | # some people rename them; so instead we look at the file content. |
33476 | # Grep'ing the first line is not enough: some people post-process | |
33477 | # each Makefile.in and add a new line on top of each file to say so. | |
33478 | # Grep'ing the whole file is not good either: AIX grep has a line | |
33479 | # limit of 2048, but all sed's we know have understand at least 4000. | |
33480 | if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then | |
33481 | dirpart=`$as_dirname -- "$mf" || | |
33482 | $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
33483 | X"$mf" : 'X\(//\)[^/]' \| \ | |
33484 | X"$mf" : 'X\(//\)$' \| \ | |
33485 | X"$mf" : 'X\(/\)' \| . 2>/dev/null || | |
33486 | $as_echo X"$mf" | | |
33487 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
33488 | s//\1/ | |
33489 | q | |
33490 | } | |
33491 | /^X\(\/\/\)[^/].*/{ | |
33492 | s//\1/ | |
33493 | q | |
33494 | } | |
33495 | /^X\(\/\/\)$/{ | |
33496 | s//\1/ | |
33497 | q | |
33498 | } | |
33499 | /^X\(\/\).*/{ | |
33500 | s//\1/ | |
33501 | q | |
33502 | } | |
33503 | s/.*/./; q'` | |
33504 | else | |
33505 | continue | |
33506 | fi | |
33507 | # Extract the definition of DEPDIR, am__include, and am__quote | |
d0ac1c44 | 33508 | # from the Makefile without running 'make'. |
c971b7fa PA |
33509 | DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` |
33510 | test -z "$DEPDIR" && continue | |
33511 | am__include=`sed -n 's/^am__include = //p' < "$mf"` | |
d0ac1c44 | 33512 | test -z "$am__include" && continue |
c971b7fa | 33513 | am__quote=`sed -n 's/^am__quote = //p' < "$mf"` |
c971b7fa PA |
33514 | # Find all dependency output files, they are included files with |
33515 | # $(DEPDIR) in their names. We invoke sed twice because it is the | |
33516 | # simplest approach to changing $(DEPDIR) to its actual value in the | |
33517 | # expansion. | |
33518 | for file in `sed -n " | |
33519 | s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ | |
d0ac1c44 | 33520 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do |
c971b7fa PA |
33521 | # Make sure the directory exists. |
33522 | test -f "$dirpart/$file" && continue | |
33523 | fdir=`$as_dirname -- "$file" || | |
33524 | $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
33525 | X"$file" : 'X\(//\)[^/]' \| \ | |
33526 | X"$file" : 'X\(//\)$' \| \ | |
33527 | X"$file" : 'X\(/\)' \| . 2>/dev/null || | |
33528 | $as_echo X"$file" | | |
33529 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
33530 | s//\1/ | |
33531 | q | |
33532 | } | |
33533 | /^X\(\/\/\)[^/].*/{ | |
33534 | s//\1/ | |
33535 | q | |
33536 | } | |
33537 | /^X\(\/\/\)$/{ | |
33538 | s//\1/ | |
33539 | q | |
33540 | } | |
33541 | /^X\(\/\).*/{ | |
33542 | s//\1/ | |
33543 | q | |
33544 | } | |
33545 | s/.*/./; q'` | |
33546 | as_dir=$dirpart/$fdir; as_fn_mkdir_p | |
33547 | # echo "creating $dirpart/$file" | |
33548 | echo '# dummy' > "$dirpart/$file" | |
33549 | done | |
33550 | done | |
33551 | } | |
33552 | ;; | |
33553 | "default":C) | |
33554 | case x$CONFIG_HEADERS in | |
33555 | xconfig.h:config.in) | |
33556 | echo > stamp-h ;; | |
33557 | esac | |
33558 | ;; | |
33559 | ||
33560 | esac | |
33561 | done # for ac_tag | |
33562 | ||
33563 | ||
33564 | as_fn_exit 0 | |
33565 | _ACEOF | |
33566 | ac_clean_files=$ac_clean_files_save | |
33567 | ||
33568 | test $ac_write_fail = 0 || | |
d0ac1c44 | 33569 | as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 |
c971b7fa PA |
33570 | |
33571 | ||
33572 | # configure is writing to config.log, and then calls config.status. | |
33573 | # config.status does its own redirection, appending to config.log. | |
33574 | # Unfortunately, on DOS this fails, as config.log is still kept open | |
33575 | # by configure, so config.status won't be able to write to it; its | |
33576 | # output is simply discarded. So we exec the FD to /dev/null, | |
33577 | # effectively closing config.log, so it can be properly (re)opened and | |
33578 | # appended to by config.status. When coming back to configure, we | |
33579 | # need to make the FD available again. | |
33580 | if test "$no_create" != yes; then | |
33581 | ac_cs_success=: | |
33582 | ac_config_status_args= | |
33583 | test "$silent" = yes && | |
33584 | ac_config_status_args="$ac_config_status_args --quiet" | |
33585 | exec 5>/dev/null | |
33586 | $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false | |
33587 | exec 5>>config.log | |
33588 | # Use ||, not &&, to avoid exiting from the if with $? = 1, which | |
33589 | # would make configure fail if this is the last instruction. | |
d0ac1c44 | 33590 | $ac_cs_success || as_fn_exit 1 |
c971b7fa PA |
33591 | fi |
33592 | if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then | |
33593 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 | |
33594 | $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} | |
33595 | fi | |
33596 | ||
33597 | ||
33598 | exit 0 |