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 | |
2196f55f YQ |
745 | NEXT_AS_FIRST_DIRECTIVE_STRING_H |
746 | NEXT_STRING_H | |
98399780 YQ |
747 | NEXT_AS_FIRST_DIRECTIVE_STDLIB_H |
748 | NEXT_STDLIB_H | |
6a29c58e YQ |
749 | NEXT_AS_FIRST_DIRECTIVE_STDIO_H |
750 | NEXT_STDIO_H | |
2196f55f YQ |
751 | HAVE__BOOL |
752 | GL_GENERATE_STDBOOL_H_FALSE | |
753 | GL_GENERATE_STDBOOL_H_TRUE | |
754 | STDBOOL_H | |
725e2999 JB |
755 | GL_GENERATE_STDALIGN_H_FALSE |
756 | GL_GENERATE_STDALIGN_H_TRUE | |
757 | STDALIGN_H | |
0750520d PA |
758 | NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H |
759 | NEXT_SIGNAL_H | |
760 | REPLACE_RAISE | |
761 | REPLACE_PTHREAD_SIGMASK | |
762 | HAVE_SIGHANDLER_T | |
763 | HAVE_TYPE_VOLATILE_SIG_ATOMIC_T | |
764 | HAVE_STRUCT_SIGACTION_SA_SIGACTION | |
765 | HAVE_SIGACTION | |
766 | HAVE_SIGINFO_T | |
767 | HAVE_SIGSET_T | |
768 | HAVE_RAISE | |
769 | HAVE_PTHREAD_SIGMASK | |
770 | HAVE_POSIX_SIGNALBLOCKING | |
771 | GNULIB_SIGACTION | |
772 | GNULIB_SIGPROCMASK | |
773 | GNULIB_SIGNAL_H_SIGPIPE | |
774 | GNULIB_RAISE | |
775 | GNULIB_PTHREAD_SIGMASK | |
6a29c58e YQ |
776 | REPLACE_VSPRINTF |
777 | REPLACE_VSNPRINTF | |
778 | REPLACE_VPRINTF | |
779 | REPLACE_VFPRINTF | |
780 | REPLACE_VDPRINTF | |
781 | REPLACE_VASPRINTF | |
782 | REPLACE_TMPFILE | |
783 | REPLACE_STDIO_WRITE_FUNCS | |
784 | REPLACE_STDIO_READ_FUNCS | |
785 | REPLACE_SPRINTF | |
786 | REPLACE_SNPRINTF | |
787 | REPLACE_RENAMEAT | |
788 | REPLACE_RENAME | |
789 | REPLACE_REMOVE | |
790 | REPLACE_PRINTF | |
791 | REPLACE_POPEN | |
792 | REPLACE_PERROR | |
793 | REPLACE_OBSTACK_PRINTF | |
794 | REPLACE_GETLINE | |
795 | REPLACE_GETDELIM | |
796 | REPLACE_FTELLO | |
797 | REPLACE_FTELL | |
798 | REPLACE_FSEEKO | |
799 | REPLACE_FSEEK | |
800 | REPLACE_FREOPEN | |
801 | REPLACE_FPURGE | |
802 | REPLACE_FPRINTF | |
803 | REPLACE_FOPEN | |
804 | REPLACE_FFLUSH | |
805 | REPLACE_FDOPEN | |
806 | REPLACE_FCLOSE | |
807 | REPLACE_DPRINTF | |
808 | HAVE_VDPRINTF | |
809 | HAVE_VASPRINTF | |
810 | HAVE_RENAMEAT | |
811 | HAVE_POPEN | |
812 | HAVE_PCLOSE | |
813 | HAVE_FTELLO | |
814 | HAVE_FSEEKO | |
815 | HAVE_DPRINTF | |
816 | HAVE_DECL_VSNPRINTF | |
817 | HAVE_DECL_SNPRINTF | |
818 | HAVE_DECL_OBSTACK_PRINTF | |
819 | HAVE_DECL_GETLINE | |
820 | HAVE_DECL_GETDELIM | |
821 | HAVE_DECL_FTELLO | |
822 | HAVE_DECL_FSEEKO | |
823 | HAVE_DECL_FPURGE | |
9c9d63b1 PM |
824 | HAVE_DECL_FCLOSEALL |
825 | GNULIB_MDA_TEMPNAM | |
826 | GNULIB_MDA_PUTW | |
827 | GNULIB_MDA_GETW | |
828 | GNULIB_MDA_FILENO | |
829 | GNULIB_MDA_FDOPEN | |
830 | GNULIB_MDA_FCLOSEALL | |
6a29c58e YQ |
831 | GNULIB_VSPRINTF_POSIX |
832 | GNULIB_VSNPRINTF | |
833 | GNULIB_VPRINTF_POSIX | |
834 | GNULIB_VPRINTF | |
835 | GNULIB_VFPRINTF_POSIX | |
836 | GNULIB_VFPRINTF | |
837 | GNULIB_VDPRINTF | |
838 | GNULIB_VSCANF | |
839 | GNULIB_VFSCANF | |
840 | GNULIB_VASPRINTF | |
841 | GNULIB_TMPFILE | |
842 | GNULIB_STDIO_H_SIGPIPE | |
843 | GNULIB_STDIO_H_NONBLOCKING | |
844 | GNULIB_SPRINTF_POSIX | |
845 | GNULIB_SNPRINTF | |
846 | GNULIB_SCANF | |
847 | GNULIB_RENAMEAT | |
848 | GNULIB_RENAME | |
849 | GNULIB_REMOVE | |
850 | GNULIB_PUTS | |
851 | GNULIB_PUTCHAR | |
852 | GNULIB_PUTC | |
853 | GNULIB_PRINTF_POSIX | |
854 | GNULIB_PRINTF | |
855 | GNULIB_POPEN | |
856 | GNULIB_PERROR | |
857 | GNULIB_PCLOSE | |
858 | GNULIB_OBSTACK_PRINTF_POSIX | |
859 | GNULIB_OBSTACK_PRINTF | |
860 | GNULIB_GETLINE | |
861 | GNULIB_GETDELIM | |
862 | GNULIB_GETCHAR | |
863 | GNULIB_GETC | |
864 | GNULIB_FWRITE | |
865 | GNULIB_FTELLO | |
866 | GNULIB_FTELL | |
867 | GNULIB_FSEEKO | |
868 | GNULIB_FSEEK | |
869 | GNULIB_FSCANF | |
870 | GNULIB_FREOPEN | |
871 | GNULIB_FREAD | |
872 | GNULIB_FPUTS | |
873 | GNULIB_FPUTC | |
874 | GNULIB_FPURGE | |
875 | GNULIB_FPRINTF_POSIX | |
876 | GNULIB_FPRINTF | |
877 | GNULIB_FOPEN | |
878 | GNULIB_FGETS | |
879 | GNULIB_FGETC | |
880 | GNULIB_FFLUSH | |
881 | GNULIB_FDOPEN | |
882 | GNULIB_FCLOSE | |
883 | GNULIB_DPRINTF | |
725e2999 JB |
884 | GL_GENERATE_NETINET_IN_H_FALSE |
885 | GL_GENERATE_NETINET_IN_H_TRUE | |
886 | NETINET_IN_H | |
887 | HAVE_NETINET_IN_H | |
888 | NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H | |
889 | NEXT_NETINET_IN_H | |
c971b7fa | 890 | UNDEFINE_STRTOK_R |
c971b7fa | 891 | REPLACE_STRSIGNAL |
9c9d63b1 | 892 | REPLACE_STRERRORNAME_NP |
c971b7fa PA |
893 | REPLACE_STRERROR_R |
894 | REPLACE_STRERROR | |
c0c3707f | 895 | REPLACE_STRTOK_R |
c971b7fa PA |
896 | REPLACE_STRCASESTR |
897 | REPLACE_STRSTR | |
c0c3707f CB |
898 | REPLACE_STRNLEN |
899 | REPLACE_STRNDUP | |
900 | REPLACE_STRNCAT | |
c971b7fa | 901 | REPLACE_STRDUP |
c0c3707f | 902 | REPLACE_STRCHRNUL |
c971b7fa PA |
903 | REPLACE_STPNCPY |
904 | REPLACE_MEMMEM | |
905 | REPLACE_MEMCHR | |
9c9d63b1 | 906 | REPLACE_FFSLL |
c971b7fa PA |
907 | HAVE_STRVERSCMP |
908 | HAVE_DECL_STRSIGNAL | |
9c9d63b1 PM |
909 | HAVE_SIGDESCR_NP |
910 | HAVE_SIGABBREV_NP | |
911 | HAVE_STRERRORNAME_NP | |
c971b7fa PA |
912 | HAVE_DECL_STRERROR_R |
913 | HAVE_DECL_STRTOK_R | |
914 | HAVE_STRCASESTR | |
915 | HAVE_STRSEP | |
916 | HAVE_STRPBRK | |
917 | HAVE_DECL_STRNLEN | |
918 | HAVE_DECL_STRNDUP | |
919 | HAVE_DECL_STRDUP | |
920 | HAVE_STRCHRNUL | |
921 | HAVE_STPNCPY | |
922 | HAVE_STPCPY | |
923 | HAVE_RAWMEMCHR | |
924 | HAVE_DECL_MEMRCHR | |
925 | HAVE_MEMPCPY | |
926 | HAVE_DECL_MEMMEM | |
c971b7fa PA |
927 | HAVE_FFSLL |
928 | HAVE_FFSL | |
c0c3707f | 929 | HAVE_EXPLICIT_BZERO |
9c9d63b1 PM |
930 | GNULIB_MDA_STRDUP |
931 | GNULIB_MDA_MEMCCPY | |
c971b7fa PA |
932 | HAVE_MBSLEN |
933 | GNULIB_STRVERSCMP | |
934 | GNULIB_STRSIGNAL | |
9c9d63b1 PM |
935 | GNULIB_SIGDESCR_NP |
936 | GNULIB_SIGABBREV_NP | |
937 | GNULIB_STRERRORNAME_NP | |
c971b7fa PA |
938 | GNULIB_STRERROR_R |
939 | GNULIB_STRERROR | |
940 | GNULIB_MBSTOK_R | |
941 | GNULIB_MBSSEP | |
942 | GNULIB_MBSSPN | |
943 | GNULIB_MBSPBRK | |
944 | GNULIB_MBSCSPN | |
945 | GNULIB_MBSCASESTR | |
946 | GNULIB_MBSPCASECMP | |
947 | GNULIB_MBSNCASECMP | |
948 | GNULIB_MBSCASECMP | |
949 | GNULIB_MBSSTR | |
950 | GNULIB_MBSRCHR | |
951 | GNULIB_MBSCHR | |
952 | GNULIB_MBSNLEN | |
953 | GNULIB_MBSLEN | |
954 | GNULIB_STRTOK_R | |
955 | GNULIB_STRCASESTR | |
956 | GNULIB_STRSTR | |
957 | GNULIB_STRSEP | |
958 | GNULIB_STRPBRK | |
959 | GNULIB_STRNLEN | |
960 | GNULIB_STRNDUP | |
961 | GNULIB_STRNCAT | |
962 | GNULIB_STRDUP | |
963 | GNULIB_STRCHRNUL | |
964 | GNULIB_STPNCPY | |
965 | GNULIB_STPCPY | |
966 | GNULIB_RAWMEMCHR | |
967 | GNULIB_MEMRCHR | |
968 | GNULIB_MEMPCPY | |
969 | GNULIB_MEMMEM | |
970 | GNULIB_MEMCHR | |
971 | GNULIB_FFSLL | |
972 | GNULIB_FFSL | |
c0c3707f | 973 | GNULIB_EXPLICIT_BZERO |
5df4cba6 SM |
974 | HAVE_VISIBILITY |
975 | CFLAG_VISIBILITY | |
976 | LIB_MBRTOWC | |
8690e634 | 977 | LOCALE_ZH_CN |
c0c3707f | 978 | LOCALE_FR_UTF8 |
8690e634 | 979 | LOCALE_JA |
88b48903 WN |
980 | NEXT_AS_FIRST_DIRECTIVE_MATH_H |
981 | NEXT_MATH_H | |
5abebf3c CB |
982 | LTLIBMULTITHREAD |
983 | LIBMULTITHREAD | |
984 | LTLIBTHREAD | |
985 | LIBTHREAD | |
5df4cba6 SM |
986 | LIBSTDTHREAD |
987 | NEXT_AS_FIRST_DIRECTIVE_LOCALE_H | |
988 | NEXT_LOCALE_H | |
989 | HAVE_XLOCALE_H | |
990 | NEXT_AS_FIRST_DIRECTIVE_STDDEF_H | |
991 | NEXT_STDDEF_H | |
992 | GL_GENERATE_STDDEF_H_FALSE | |
993 | GL_GENERATE_STDDEF_H_TRUE | |
994 | STDDEF_H | |
995 | HAVE_WCHAR_T | |
996 | HAVE_MAX_ALIGN_T | |
997 | REPLACE_NULL | |
998 | REPLACE_STRUCT_LCONV | |
999 | REPLACE_FREELOCALE | |
1000 | REPLACE_DUPLOCALE | |
1001 | REPLACE_NEWLOCALE | |
1002 | REPLACE_SETLOCALE | |
1003 | REPLACE_LOCALECONV | |
1004 | HAVE_FREELOCALE | |
1005 | HAVE_DUPLOCALE | |
1006 | HAVE_NEWLOCALE | |
1007 | GNULIB_LOCALENAME | |
1008 | GNULIB_DUPLOCALE | |
1009 | GNULIB_SETLOCALE_NULL | |
1010 | GNULIB_SETLOCALE | |
1011 | GNULIB_LOCALECONV | |
8690e634 | 1012 | LOCALCHARSET_TESTS_ENVIRONMENT |
c971b7fa PA |
1013 | NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H |
1014 | NEXT_INTTYPES_H | |
1015 | UINT64_MAX_EQ_ULONG_MAX | |
1016 | UINT32_MAX_LT_UINTMAX_MAX | |
1017 | PRIPTR_PREFIX | |
c971b7fa PA |
1018 | INT64_MAX_EQ_LONG_MAX |
1019 | INT32_MAX_LT_INTMAX_MAX | |
4a626d0a | 1020 | REPLACE_STRTOUMAX |
c971b7fa | 1021 | REPLACE_STRTOIMAX |
c0c3707f | 1022 | HAVE_IMAXDIV_T |
c971b7fa PA |
1023 | HAVE_DECL_STRTOUMAX |
1024 | HAVE_DECL_STRTOIMAX | |
1025 | HAVE_DECL_IMAXDIV | |
1026 | HAVE_DECL_IMAXABS | |
1027 | GNULIB_STRTOUMAX | |
1028 | GNULIB_STRTOIMAX | |
1029 | GNULIB_IMAXDIV | |
1030 | GNULIB_IMAXABS | |
1031 | GL_GENERATE_STDINT_H_FALSE | |
1032 | GL_GENERATE_STDINT_H_TRUE | |
1033 | STDINT_H | |
49e4877c PA |
1034 | HAVE_SYS_INTTYPES_H |
1035 | HAVE_SYS_BITYPES_H | |
1036 | HAVE_C99_STDINT_H | |
c971b7fa PA |
1037 | WINT_T_SUFFIX |
1038 | WCHAR_T_SUFFIX | |
1039 | SIG_ATOMIC_T_SUFFIX | |
1040 | SIZE_T_SUFFIX | |
1041 | PTRDIFF_T_SUFFIX | |
1042 | HAVE_SIGNED_WINT_T | |
1043 | HAVE_SIGNED_WCHAR_T | |
1044 | HAVE_SIGNED_SIG_ATOMIC_T | |
1045 | BITSIZEOF_WINT_T | |
1046 | BITSIZEOF_WCHAR_T | |
1047 | BITSIZEOF_SIG_ATOMIC_T | |
1048 | BITSIZEOF_SIZE_T | |
1049 | BITSIZEOF_PTRDIFF_T | |
1050 | APPLE_UNIVERSAL_BUILD | |
c971b7fa PA |
1051 | HAVE_STDINT_H |
1052 | NEXT_AS_FIRST_DIRECTIVE_STDINT_H | |
1053 | NEXT_STDINT_H | |
c971b7fa PA |
1054 | HAVE_SYS_TYPES_H |
1055 | HAVE_INTTYPES_H | |
1056 | HAVE_WCHAR_H | |
c0c3707f | 1057 | GNULIB_OVERRIDES_WINT_T |
49e4877c PA |
1058 | GL_GENERATE_LIMITS_H_FALSE |
1059 | GL_GENERATE_LIMITS_H_TRUE | |
1060 | LIMITS_H | |
1061 | NEXT_AS_FIRST_DIRECTIVE_LIMITS_H | |
1062 | NEXT_LIMITS_H | |
725e2999 JB |
1063 | HAVE_SYS_SOCKET_H |
1064 | NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H | |
1065 | NEXT_SYS_SOCKET_H | |
1066 | HAVE_ACCEPT4 | |
1067 | HAVE_SA_FAMILY_T | |
1068 | HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY | |
1069 | HAVE_STRUCT_SOCKADDR_STORAGE | |
1070 | GNULIB_ACCEPT4 | |
1071 | GNULIB_SHUTDOWN | |
1072 | GNULIB_SETSOCKOPT | |
1073 | GNULIB_SENDTO | |
1074 | GNULIB_RECVFROM | |
1075 | GNULIB_SEND | |
1076 | GNULIB_RECV | |
1077 | GNULIB_LISTEN | |
1078 | GNULIB_GETSOCKOPT | |
1079 | GNULIB_GETSOCKNAME | |
1080 | GNULIB_GETPEERNAME | |
1081 | GNULIB_BIND | |
1082 | GNULIB_ACCEPT | |
1083 | GNULIB_CONNECT | |
1084 | GNULIB_SOCKET | |
1085 | INET_NTOP_LIB | |
5df4cba6 SM |
1086 | LIB_HARD_LOCALE |
1087 | LIB_SETLOCALE_NULL | |
1088 | LIB_SCHED_YIELD | |
1089 | LIBPMULTITHREAD | |
1090 | LIBPTHREAD | |
6ec2e0f5 SDJ |
1091 | GL_GENERATE_GLOB_H_FALSE |
1092 | GL_GENERATE_GLOB_H_TRUE | |
1093 | GLOB_H | |
c0c3707f CB |
1094 | HAVE_GLOB_H |
1095 | NEXT_AS_FIRST_DIRECTIVE_GLOB_H | |
1096 | NEXT_GLOB_H | |
1097 | REPLACE_GLOB_PATTERN_P | |
1098 | REPLACE_GLOB | |
1099 | HAVE_GLOB_PATTERN_P | |
1100 | HAVE_GLOB | |
1101 | GNULIB_GLOB | |
4a626d0a PA |
1102 | NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H |
1103 | NEXT_SYS_TIME_H | |
1104 | REPLACE_STRUCT_TIMEVAL | |
1105 | REPLACE_GETTIMEOFDAY | |
4a626d0a PA |
1106 | HAVE_SYS_TIME_H |
1107 | HAVE_STRUCT_TIMEVAL | |
1108 | HAVE_GETTIMEOFDAY | |
1109 | GNULIB_GETTIMEOFDAY | |
6ec2e0f5 SDJ |
1110 | LTLIBINTL |
1111 | LIBINTL | |
698be2d8 CB |
1112 | LIB_GETRANDOM |
1113 | REPLACE_GETRANDOM | |
1114 | HAVE_GETRANDOM | |
1115 | GNULIB_GETRANDOM | |
c0c3707f | 1116 | LIB_GETLOGIN |
6ec2e0f5 | 1117 | WINDOWS_64_BIT_ST_SIZE |
c0c3707f | 1118 | WINDOWS_STAT_TIMESPEC |
6ec2e0f5 SDJ |
1119 | NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H |
1120 | NEXT_SYS_STAT_H | |
1121 | REPLACE_UTIMENSAT | |
1122 | REPLACE_STAT | |
9c9d63b1 | 1123 | REPLACE_MKNODAT |
6ec2e0f5 | 1124 | REPLACE_MKNOD |
9c9d63b1 | 1125 | REPLACE_MKFIFOAT |
6ec2e0f5 SDJ |
1126 | REPLACE_MKFIFO |
1127 | REPLACE_MKDIR | |
1128 | REPLACE_LSTAT | |
1129 | REPLACE_FUTIMENS | |
1130 | REPLACE_FSTATAT | |
1131 | REPLACE_FSTAT | |
5df4cba6 | 1132 | REPLACE_FCHMODAT |
6ec2e0f5 SDJ |
1133 | HAVE_UTIMENSAT |
1134 | HAVE_MKNODAT | |
1135 | HAVE_MKNOD | |
1136 | HAVE_MKFIFOAT | |
1137 | HAVE_MKFIFO | |
1138 | HAVE_MKDIRAT | |
1139 | HAVE_LSTAT | |
1140 | HAVE_LCHMOD | |
9c9d63b1 | 1141 | HAVE_GETUMASK |
6ec2e0f5 SDJ |
1142 | HAVE_FUTIMENS |
1143 | HAVE_FSTATAT | |
1144 | HAVE_FCHMODAT | |
9c9d63b1 PM |
1145 | GNULIB_MDA_UMASK |
1146 | GNULIB_MDA_MKDIR | |
1147 | GNULIB_MDA_CHMOD | |
c0c3707f | 1148 | GNULIB_OVERRIDES_STRUCT_STAT |
6ec2e0f5 SDJ |
1149 | GNULIB_UTIMENSAT |
1150 | GNULIB_STAT | |
1151 | GNULIB_MKNODAT | |
1152 | GNULIB_MKNOD | |
1153 | GNULIB_MKFIFOAT | |
1154 | GNULIB_MKFIFO | |
1155 | GNULIB_MKDIRAT | |
9c9d63b1 | 1156 | GNULIB_MKDIR |
6ec2e0f5 SDJ |
1157 | GNULIB_LSTAT |
1158 | GNULIB_LCHMOD | |
9c9d63b1 | 1159 | GNULIB_GETUMASK |
6ec2e0f5 SDJ |
1160 | GNULIB_FUTIMENS |
1161 | GNULIB_FSTATAT | |
1162 | GNULIB_FSTAT | |
1163 | GNULIB_FCHMODAT | |
88b48903 WN |
1164 | FREXPL_LIBM |
1165 | HAVE_SAME_LONG_DOUBLE_AS_DOUBLE | |
1166 | FREXP_LIBM | |
1167 | REPLACE_TRUNCL | |
1168 | REPLACE_TRUNCF | |
1169 | REPLACE_TRUNC | |
c0c3707f CB |
1170 | REPLACE_TANHF |
1171 | REPLACE_TANF | |
88b48903 | 1172 | REPLACE_SQRTL |
c0c3707f CB |
1173 | REPLACE_SQRTF |
1174 | REPLACE_SINHF | |
1175 | REPLACE_SINF | |
9c9d63b1 | 1176 | REPLACE_SIGNBIT_USING_BUILTINS |
88b48903 WN |
1177 | REPLACE_SIGNBIT |
1178 | REPLACE_ROUNDL | |
1179 | REPLACE_ROUNDF | |
1180 | REPLACE_ROUND | |
c0c3707f | 1181 | REPLACE_RINTL |
88b48903 WN |
1182 | REPLACE_REMAINDERL |
1183 | REPLACE_REMAINDERF | |
1184 | REPLACE_REMAINDER | |
1185 | REPLACE_NAN | |
1186 | REPLACE_MODFL | |
1187 | REPLACE_MODFF | |
1188 | REPLACE_MODF | |
1189 | REPLACE_LOGBL | |
1190 | REPLACE_LOGBF | |
1191 | REPLACE_LOGB | |
1192 | REPLACE_LOG2L | |
1193 | REPLACE_LOG2F | |
1194 | REPLACE_LOG2 | |
1195 | REPLACE_LOG1PL | |
1196 | REPLACE_LOG1PF | |
1197 | REPLACE_LOG1P | |
1198 | REPLACE_LOG10L | |
1199 | REPLACE_LOG10F | |
1200 | REPLACE_LOG10 | |
1201 | REPLACE_LOGL | |
1202 | REPLACE_LOGF | |
1203 | REPLACE_LOG | |
1204 | REPLACE_LDEXPL | |
1205 | REPLACE_ISNAN | |
1206 | REPLACE_ISINF | |
1207 | REPLACE_ISFINITE | |
c0c3707f | 1208 | REPLACE_ILOGBL |
88b48903 WN |
1209 | REPLACE_ILOGBF |
1210 | REPLACE_ILOGB | |
1211 | REPLACE_HYPOTL | |
1212 | REPLACE_HYPOTF | |
1213 | REPLACE_HYPOT | |
1214 | REPLACE_HUGE_VAL | |
1215 | REPLACE_FREXPL | |
1216 | REPLACE_FREXP | |
1217 | REPLACE_FREXPF | |
1218 | REPLACE_FMODL | |
1219 | REPLACE_FMODF | |
1220 | REPLACE_FMOD | |
1221 | REPLACE_FMAL | |
1222 | REPLACE_FMAF | |
1223 | REPLACE_FMA | |
1224 | REPLACE_FLOORL | |
1225 | REPLACE_FLOORF | |
1226 | REPLACE_FLOOR | |
1227 | REPLACE_FABSL | |
1228 | REPLACE_EXP2L | |
1229 | REPLACE_EXP2 | |
c0c3707f | 1230 | REPLACE_EXPM1L |
88b48903 WN |
1231 | REPLACE_EXPM1F |
1232 | REPLACE_EXPM1 | |
c0c3707f CB |
1233 | REPLACE_EXPL |
1234 | REPLACE_EXPF | |
1235 | REPLACE_COSHF | |
1236 | REPLACE_COSF | |
88b48903 WN |
1237 | REPLACE_CEILL |
1238 | REPLACE_CEILF | |
1239 | REPLACE_CEIL | |
1240 | REPLACE_CBRTL | |
1241 | REPLACE_CBRTF | |
c0c3707f CB |
1242 | REPLACE_ATAN2F |
1243 | REPLACE_ATANF | |
1244 | REPLACE_ASINF | |
1245 | REPLACE_ACOSF | |
88b48903 WN |
1246 | HAVE_DECL_TRUNCL |
1247 | HAVE_DECL_TRUNCF | |
1248 | HAVE_DECL_TRUNC | |
1249 | HAVE_DECL_TANL | |
1250 | HAVE_DECL_SQRTL | |
1251 | HAVE_DECL_SINL | |
1252 | HAVE_DECL_ROUNDL | |
1253 | HAVE_DECL_ROUNDF | |
1254 | HAVE_DECL_ROUND | |
1255 | HAVE_DECL_RINTF | |
1256 | HAVE_DECL_REMAINDERL | |
1257 | HAVE_DECL_REMAINDER | |
1258 | HAVE_DECL_LOGB | |
1259 | HAVE_DECL_LOG2L | |
1260 | HAVE_DECL_LOG2F | |
1261 | HAVE_DECL_LOG2 | |
1262 | HAVE_DECL_LOG10L | |
1263 | HAVE_DECL_LOGL | |
1264 | HAVE_DECL_LDEXPL | |
1265 | HAVE_DECL_FREXPL | |
1266 | HAVE_DECL_FLOORL | |
1267 | HAVE_DECL_FLOORF | |
1268 | HAVE_DECL_EXPM1L | |
1269 | HAVE_DECL_EXP2L | |
1270 | HAVE_DECL_EXP2F | |
1271 | HAVE_DECL_EXP2 | |
1272 | HAVE_DECL_EXPL | |
1273 | HAVE_DECL_COSL | |
1274 | HAVE_DECL_COPYSIGNF | |
1275 | HAVE_DECL_CEILL | |
1276 | HAVE_DECL_CEILF | |
1277 | HAVE_DECL_CBRTL | |
1278 | HAVE_DECL_CBRTF | |
1279 | HAVE_DECL_ATANL | |
1280 | HAVE_DECL_ASINL | |
1281 | HAVE_DECL_ACOSL | |
1282 | HAVE_TANHF | |
1283 | HAVE_TANL | |
1284 | HAVE_TANF | |
1285 | HAVE_SQRTL | |
1286 | HAVE_SQRTF | |
1287 | HAVE_SINHF | |
1288 | HAVE_SINL | |
1289 | HAVE_SINF | |
1290 | HAVE_RINTL | |
1291 | HAVE_RINT | |
1292 | HAVE_REMAINDERF | |
1293 | HAVE_REMAINDER | |
1294 | HAVE_POWF | |
1295 | HAVE_MODFL | |
1296 | HAVE_MODFF | |
1297 | HAVE_LOGBL | |
1298 | HAVE_LOGBF | |
1299 | HAVE_LOG1PL | |
1300 | HAVE_LOG1PF | |
1301 | HAVE_LOG1P | |
1302 | HAVE_LOG10L | |
1303 | HAVE_LOG10F | |
1304 | HAVE_LOGL | |
1305 | HAVE_LOGF | |
1306 | HAVE_LDEXPF | |
1307 | HAVE_ISNANL | |
1308 | HAVE_ISNAND | |
1309 | HAVE_ISNANF | |
1310 | HAVE_ILOGBL | |
1311 | HAVE_ILOGBF | |
1312 | HAVE_ILOGB | |
1313 | HAVE_HYPOTL | |
1314 | HAVE_HYPOTF | |
1315 | HAVE_FREXPF | |
1316 | HAVE_FMODL | |
1317 | HAVE_FMODF | |
1318 | HAVE_FMAL | |
1319 | HAVE_FMAF | |
1320 | HAVE_FMA | |
1321 | HAVE_FABSL | |
1322 | HAVE_FABSF | |
1323 | HAVE_EXPM1F | |
1324 | HAVE_EXPM1 | |
1325 | HAVE_EXPL | |
1326 | HAVE_EXPF | |
1327 | HAVE_COSHF | |
1328 | HAVE_COSL | |
1329 | HAVE_COSF | |
1330 | HAVE_COPYSIGNL | |
1331 | HAVE_COPYSIGN | |
1332 | HAVE_CBRTL | |
1333 | HAVE_CBRTF | |
1334 | HAVE_CBRT | |
1335 | HAVE_ATAN2F | |
1336 | HAVE_ATANL | |
1337 | HAVE_ATANF | |
1338 | HAVE_ASINL | |
1339 | HAVE_ASINF | |
1340 | HAVE_ACOSL | |
1341 | HAVE_ACOSF | |
9c9d63b1 PM |
1342 | GNULIB_MDA_YN |
1343 | GNULIB_MDA_Y1 | |
1344 | GNULIB_MDA_Y0 | |
1345 | GNULIB_MDA_JN | |
1346 | GNULIB_MDA_J1 | |
1347 | GNULIB_MDA_J0 | |
88b48903 WN |
1348 | GNULIB_TRUNCL |
1349 | GNULIB_TRUNCF | |
1350 | GNULIB_TRUNC | |
1351 | GNULIB_TANHF | |
1352 | GNULIB_TANL | |
1353 | GNULIB_TANF | |
1354 | GNULIB_SQRTL | |
1355 | GNULIB_SQRTF | |
1356 | GNULIB_SINHF | |
1357 | GNULIB_SINL | |
1358 | GNULIB_SINF | |
1359 | GNULIB_SIGNBIT | |
1360 | GNULIB_ROUNDL | |
1361 | GNULIB_ROUNDF | |
1362 | GNULIB_ROUND | |
1363 | GNULIB_RINTL | |
1364 | GNULIB_RINTF | |
1365 | GNULIB_RINT | |
1366 | GNULIB_REMAINDERL | |
1367 | GNULIB_REMAINDERF | |
1368 | GNULIB_REMAINDER | |
1369 | GNULIB_POWF | |
1370 | GNULIB_MODFL | |
1371 | GNULIB_MODFF | |
1372 | GNULIB_MODF | |
1373 | GNULIB_LOGBL | |
1374 | GNULIB_LOGBF | |
1375 | GNULIB_LOGB | |
1376 | GNULIB_LOG2L | |
1377 | GNULIB_LOG2F | |
1378 | GNULIB_LOG2 | |
1379 | GNULIB_LOG1PL | |
1380 | GNULIB_LOG1PF | |
1381 | GNULIB_LOG1P | |
1382 | GNULIB_LOG10L | |
1383 | GNULIB_LOG10F | |
1384 | GNULIB_LOG10 | |
1385 | GNULIB_LOGL | |
1386 | GNULIB_LOGF | |
1387 | GNULIB_LOG | |
1388 | GNULIB_LDEXPL | |
1389 | GNULIB_LDEXPF | |
1390 | GNULIB_ISNANL | |
1391 | GNULIB_ISNAND | |
1392 | GNULIB_ISNANF | |
1393 | GNULIB_ISNAN | |
1394 | GNULIB_ISINF | |
1395 | GNULIB_ISFINITE | |
1396 | GNULIB_ILOGBL | |
1397 | GNULIB_ILOGBF | |
1398 | GNULIB_ILOGB | |
1399 | GNULIB_HYPOTL | |
1400 | GNULIB_HYPOTF | |
1401 | GNULIB_HYPOT | |
1402 | GNULIB_FREXPL | |
1403 | GNULIB_FREXP | |
1404 | GNULIB_FREXPF | |
1405 | GNULIB_FMODL | |
1406 | GNULIB_FMODF | |
1407 | GNULIB_FMOD | |
1408 | GNULIB_FMAL | |
1409 | GNULIB_FMAF | |
1410 | GNULIB_FMA | |
1411 | GNULIB_FLOORL | |
1412 | GNULIB_FLOORF | |
1413 | GNULIB_FLOOR | |
1414 | GNULIB_FABSL | |
1415 | GNULIB_FABSF | |
1416 | GNULIB_EXPM1L | |
1417 | GNULIB_EXPM1F | |
1418 | GNULIB_EXPM1 | |
1419 | GNULIB_EXP2L | |
1420 | GNULIB_EXP2F | |
1421 | GNULIB_EXP2 | |
1422 | GNULIB_EXPL | |
1423 | GNULIB_EXPF | |
1424 | GNULIB_COSHF | |
1425 | GNULIB_COSL | |
1426 | GNULIB_COSF | |
1427 | GNULIB_COPYSIGNL | |
1428 | GNULIB_COPYSIGNF | |
1429 | GNULIB_COPYSIGN | |
1430 | GNULIB_CEILL | |
1431 | GNULIB_CEILF | |
1432 | GNULIB_CEIL | |
1433 | GNULIB_CBRTL | |
1434 | GNULIB_CBRTF | |
1435 | GNULIB_CBRT | |
1436 | GNULIB_ATAN2F | |
1437 | GNULIB_ATANL | |
1438 | GNULIB_ATANF | |
1439 | GNULIB_ASINL | |
1440 | GNULIB_ASINF | |
1441 | GNULIB_ACOSL | |
1442 | GNULIB_ACOSF | |
8690e634 JK |
1443 | GL_GENERATE_FNMATCH_H_FALSE |
1444 | GL_GENERATE_FNMATCH_H_TRUE | |
1445 | FNMATCH_H | |
c0c3707f CB |
1446 | HAVE_FNMATCH_H |
1447 | NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H | |
1448 | NEXT_FNMATCH_H | |
1449 | REPLACE_FNMATCH | |
1450 | HAVE_FNMATCH | |
1451 | GNULIB_FNMATCH | |
88b48903 WN |
1452 | REPLACE_ITOLD |
1453 | GL_GENERATE_FLOAT_H_FALSE | |
1454 | GL_GENERATE_FLOAT_H_TRUE | |
1455 | FLOAT_H | |
1456 | NEXT_AS_FIRST_DIRECTIVE_FLOAT_H | |
1457 | NEXT_FLOAT_H | |
6ec2e0f5 SDJ |
1458 | NEXT_AS_FIRST_DIRECTIVE_FCNTL_H |
1459 | NEXT_FCNTL_H | |
1460 | REPLACE_OPENAT | |
1461 | REPLACE_OPEN | |
1462 | REPLACE_FCNTL | |
c0c3707f | 1463 | REPLACE_CREAT |
6ec2e0f5 SDJ |
1464 | HAVE_OPENAT |
1465 | HAVE_FCNTL | |
9c9d63b1 PM |
1466 | GNULIB_MDA_OPEN |
1467 | GNULIB_MDA_CREAT | |
6ec2e0f5 SDJ |
1468 | GNULIB_OPENAT |
1469 | GNULIB_OPEN | |
1470 | GNULIB_NONBLOCKING | |
1471 | GNULIB_FCNTL | |
c0c3707f | 1472 | GNULIB_CREAT |
18848e28 GF |
1473 | EOVERFLOW_VALUE |
1474 | EOVERFLOW_HIDDEN | |
1475 | ENOLINK_VALUE | |
1476 | ENOLINK_HIDDEN | |
1477 | EMULTIHOP_VALUE | |
1478 | EMULTIHOP_HIDDEN | |
1479 | GL_GENERATE_ERRNO_H_FALSE | |
1480 | GL_GENERATE_ERRNO_H_TRUE | |
1481 | ERRNO_H | |
1482 | NEXT_AS_FIRST_DIRECTIVE_ERRNO_H | |
1483 | NEXT_ERRNO_H | |
e26b6bb0 TT |
1484 | HAVE_DIRENT_H |
1485 | NEXT_AS_FIRST_DIRECTIVE_DIRENT_H | |
1486 | NEXT_DIRENT_H | |
698be2d8 CB |
1487 | NEXT_AS_FIRST_DIRECTIVE_CTYPE_H |
1488 | NEXT_CTYPE_H | |
1489 | HAVE_ISBLANK | |
1490 | GNULIB_ISBLANK | |
e26b6bb0 TT |
1491 | REPLACE_FDOPENDIR |
1492 | REPLACE_DIRFD | |
1493 | REPLACE_CLOSEDIR | |
1494 | REPLACE_OPENDIR | |
1495 | HAVE_ALPHASORT | |
1496 | HAVE_SCANDIR | |
1497 | HAVE_FDOPENDIR | |
1498 | HAVE_DECL_FDOPENDIR | |
1499 | HAVE_DECL_DIRFD | |
1500 | HAVE_CLOSEDIR | |
1501 | HAVE_REWINDDIR | |
1502 | HAVE_READDIR | |
1503 | HAVE_OPENDIR | |
1504 | GNULIB_ALPHASORT | |
1505 | GNULIB_SCANDIR | |
1506 | GNULIB_FDOPENDIR | |
1507 | GNULIB_DIRFD | |
1508 | GNULIB_CLOSEDIR | |
1509 | GNULIB_REWINDDIR | |
1510 | GNULIB_READDIR | |
1511 | GNULIB_OPENDIR | |
6ec2e0f5 SDJ |
1512 | HAVE_WINSOCK2_H |
1513 | HAVE_MSVC_INVALID_PARAMETER_HANDLER | |
9c9d63b1 | 1514 | LIB_CLOCK_GETTIME |
e26b6bb0 TT |
1515 | UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS |
1516 | UNISTD_H_HAVE_WINSOCK2_H | |
698be2d8 | 1517 | UNISTD_H_HAVE_SYS_RANDOM_H |
e26b6bb0 TT |
1518 | REPLACE_WRITE |
1519 | REPLACE_USLEEP | |
1520 | REPLACE_UNLINKAT | |
1521 | REPLACE_UNLINK | |
1522 | REPLACE_TTYNAME_R | |
c0c3707f | 1523 | REPLACE_TRUNCATE |
4a626d0a | 1524 | REPLACE_SYMLINKAT |
e26b6bb0 TT |
1525 | REPLACE_SYMLINK |
1526 | REPLACE_SLEEP | |
1527 | REPLACE_RMDIR | |
4a626d0a | 1528 | REPLACE_READLINKAT |
e26b6bb0 TT |
1529 | REPLACE_READLINK |
1530 | REPLACE_READ | |
1531 | REPLACE_PWRITE | |
1532 | REPLACE_PREAD | |
1533 | REPLACE_LSEEK | |
1534 | REPLACE_LINKAT | |
1535 | REPLACE_LINK | |
1536 | REPLACE_LCHOWN | |
1537 | REPLACE_ISATTY | |
c0c3707f | 1538 | REPLACE_GETPASS |
e26b6bb0 TT |
1539 | REPLACE_GETPAGESIZE |
1540 | REPLACE_GETGROUPS | |
1541 | REPLACE_GETLOGIN_R | |
4a626d0a | 1542 | REPLACE_GETDTABLESIZE |
e26b6bb0 TT |
1543 | REPLACE_GETDOMAINNAME |
1544 | REPLACE_GETCWD | |
1545 | REPLACE_FTRUNCATE | |
1546 | REPLACE_FCHOWNAT | |
c0c3707f | 1547 | REPLACE_FACCESSAT |
9c9d63b1 PM |
1548 | REPLACE_EXECVPE |
1549 | REPLACE_EXECVP | |
1550 | REPLACE_EXECVE | |
1551 | REPLACE_EXECV | |
1552 | REPLACE_EXECLP | |
1553 | REPLACE_EXECLE | |
1554 | REPLACE_EXECL | |
e26b6bb0 TT |
1555 | REPLACE_DUP2 |
1556 | REPLACE_DUP | |
1557 | REPLACE_CLOSE | |
1558 | REPLACE_CHOWN | |
c0c3707f | 1559 | REPLACE_ACCESS |
e26b6bb0 TT |
1560 | HAVE_SYS_PARAM_H |
1561 | HAVE_OS_H | |
1562 | HAVE_DECL_TTYNAME_R | |
c0c3707f | 1563 | HAVE_DECL_TRUNCATE |
e26b6bb0 TT |
1564 | HAVE_DECL_SETHOSTNAME |
1565 | HAVE_DECL_GETUSERSHELL | |
1566 | HAVE_DECL_GETPAGESIZE | |
1567 | HAVE_DECL_GETLOGIN_R | |
c0c3707f | 1568 | HAVE_DECL_GETLOGIN |
e26b6bb0 TT |
1569 | HAVE_DECL_GETDOMAINNAME |
1570 | HAVE_DECL_FDATASYNC | |
1571 | HAVE_DECL_FCHDIR | |
9c9d63b1 | 1572 | HAVE_DECL_EXECVPE |
e26b6bb0 TT |
1573 | HAVE_DECL_ENVIRON |
1574 | HAVE_USLEEP | |
1575 | HAVE_UNLINKAT | |
1576 | HAVE_SYMLINKAT | |
1577 | HAVE_SYMLINK | |
1578 | HAVE_SLEEP | |
1579 | HAVE_SETHOSTNAME | |
1580 | HAVE_READLINKAT | |
1581 | HAVE_READLINK | |
1582 | HAVE_PWRITE | |
1583 | HAVE_PREAD | |
1584 | HAVE_PIPE2 | |
1585 | HAVE_PIPE | |
1586 | HAVE_LINKAT | |
1587 | HAVE_LINK | |
1588 | HAVE_LCHOWN | |
1589 | HAVE_GROUP_MEMBER | |
c0c3707f | 1590 | HAVE_GETPASS |
e26b6bb0 TT |
1591 | HAVE_GETPAGESIZE |
1592 | HAVE_GETLOGIN | |
1593 | HAVE_GETHOSTNAME | |
1594 | HAVE_GETGROUPS | |
698be2d8 | 1595 | HAVE_GETENTROPY |
e26b6bb0 TT |
1596 | HAVE_GETDTABLESIZE |
1597 | HAVE_FTRUNCATE | |
1598 | HAVE_FSYNC | |
1599 | HAVE_FDATASYNC | |
1600 | HAVE_FCHOWNAT | |
1601 | HAVE_FCHDIR | |
1602 | HAVE_FACCESSAT | |
9c9d63b1 | 1603 | HAVE_EXECVPE |
e26b6bb0 TT |
1604 | HAVE_EUIDACCESS |
1605 | HAVE_DUP3 | |
c0c3707f | 1606 | HAVE_COPY_FILE_RANGE |
e26b6bb0 | 1607 | HAVE_CHOWN |
9c9d63b1 PM |
1608 | GNULIB_MDA_WRITE |
1609 | GNULIB_MDA_UNLINK | |
1610 | GNULIB_MDA_SWAB | |
1611 | GNULIB_MDA_RMDIR | |
1612 | GNULIB_MDA_READ | |
1613 | GNULIB_MDA_LSEEK | |
1614 | GNULIB_MDA_ISATTY | |
1615 | GNULIB_MDA_GETPID | |
1616 | GNULIB_MDA_GETCWD | |
1617 | GNULIB_MDA_EXECVPE | |
1618 | GNULIB_MDA_EXECVP | |
1619 | GNULIB_MDA_EXECVE | |
1620 | GNULIB_MDA_EXECV | |
1621 | GNULIB_MDA_EXECLP | |
1622 | GNULIB_MDA_EXECLE | |
1623 | GNULIB_MDA_EXECL | |
1624 | GNULIB_MDA_DUP2 | |
1625 | GNULIB_MDA_DUP | |
1626 | GNULIB_MDA_CLOSE | |
1627 | GNULIB_MDA_CHDIR | |
1628 | GNULIB_MDA_ACCESS | |
e26b6bb0 TT |
1629 | GNULIB_WRITE |
1630 | GNULIB_USLEEP | |
1631 | GNULIB_UNLINKAT | |
1632 | GNULIB_UNLINK | |
1633 | GNULIB_UNISTD_H_SIGPIPE | |
1634 | GNULIB_UNISTD_H_NONBLOCKING | |
1635 | GNULIB_TTYNAME_R | |
c0c3707f | 1636 | GNULIB_TRUNCATE |
e26b6bb0 TT |
1637 | GNULIB_SYMLINKAT |
1638 | GNULIB_SYMLINK | |
1639 | GNULIB_SLEEP | |
1640 | GNULIB_SETHOSTNAME | |
1641 | GNULIB_RMDIR | |
1642 | GNULIB_READLINKAT | |
1643 | GNULIB_READLINK | |
1644 | GNULIB_READ | |
1645 | GNULIB_PWRITE | |
1646 | GNULIB_PREAD | |
1647 | GNULIB_PIPE2 | |
1648 | GNULIB_PIPE | |
1649 | GNULIB_LSEEK | |
1650 | GNULIB_LINKAT | |
1651 | GNULIB_LINK | |
1652 | GNULIB_LCHOWN | |
1653 | GNULIB_ISATTY | |
1654 | GNULIB_GROUP_MEMBER | |
1655 | GNULIB_GETUSERSHELL | |
c0c3707f | 1656 | GNULIB_GETPASS |
e26b6bb0 | 1657 | GNULIB_GETPAGESIZE |
5df4cba6 | 1658 | GNULIB_GETOPT_POSIX |
e26b6bb0 TT |
1659 | GNULIB_GETLOGIN_R |
1660 | GNULIB_GETLOGIN | |
1661 | GNULIB_GETHOSTNAME | |
1662 | GNULIB_GETGROUPS | |
698be2d8 | 1663 | GNULIB_GETENTROPY |
e26b6bb0 TT |
1664 | GNULIB_GETDTABLESIZE |
1665 | GNULIB_GETDOMAINNAME | |
1666 | GNULIB_GETCWD | |
1667 | GNULIB_FTRUNCATE | |
1668 | GNULIB_FSYNC | |
1669 | GNULIB_FDATASYNC | |
1670 | GNULIB_FCHOWNAT | |
1671 | GNULIB_FCHDIR | |
1672 | GNULIB_FACCESSAT | |
9c9d63b1 PM |
1673 | GNULIB_EXECVPE |
1674 | GNULIB_EXECVP | |
1675 | GNULIB_EXECVE | |
1676 | GNULIB_EXECV | |
1677 | GNULIB_EXECLP | |
1678 | GNULIB_EXECLE | |
1679 | GNULIB_EXECL | |
e26b6bb0 TT |
1680 | GNULIB_EUIDACCESS |
1681 | GNULIB_ENVIRON | |
1682 | GNULIB_DUP3 | |
1683 | GNULIB_DUP2 | |
1684 | GNULIB_DUP | |
c0c3707f | 1685 | GNULIB_COPY_FILE_RANGE |
e26b6bb0 TT |
1686 | GNULIB_CLOSE |
1687 | GNULIB_CHOWN | |
1688 | GNULIB_CHDIR | |
c0c3707f | 1689 | GNULIB_ACCESS |
98399780 YQ |
1690 | REPLACE_WCTOMB |
1691 | REPLACE_UNSETENV | |
c0c3707f | 1692 | REPLACE_STRTOLD |
98399780 | 1693 | REPLACE_STRTOD |
c0c3707f | 1694 | REPLACE_SETSTATE |
98399780 YQ |
1695 | REPLACE_SETENV |
1696 | REPLACE_REALPATH | |
1697 | REPLACE_REALLOC | |
1698 | REPLACE_RANDOM_R | |
c0c3707f | 1699 | REPLACE_RANDOM |
4a626d0a | 1700 | REPLACE_QSORT_R |
98399780 YQ |
1701 | REPLACE_PUTENV |
1702 | REPLACE_PTSNAME_R | |
1703 | REPLACE_PTSNAME | |
9c9d63b1 | 1704 | REPLACE_POSIX_MEMALIGN |
98399780 YQ |
1705 | REPLACE_MKSTEMP |
1706 | REPLACE_MBTOWC | |
1707 | REPLACE_MALLOC | |
c0c3707f | 1708 | REPLACE_INITSTATE |
9c9d63b1 | 1709 | REPLACE_FREE |
98399780 YQ |
1710 | REPLACE_CANONICALIZE_FILE_NAME |
1711 | REPLACE_CALLOC | |
9c9d63b1 | 1712 | REPLACE_ALIGNED_ALLOC |
98399780 YQ |
1713 | HAVE_DECL_UNSETENV |
1714 | HAVE_UNLOCKPT | |
1715 | HAVE_SYS_LOADAVG_H | |
1716 | HAVE_STRUCT_RANDOM_DATA | |
1717 | HAVE_STRTOULL | |
1718 | HAVE_STRTOLL | |
c0c3707f | 1719 | HAVE_STRTOLD |
98399780 | 1720 | HAVE_STRTOD |
c0c3707f CB |
1721 | HAVE_DECL_SETSTATE |
1722 | HAVE_SETSTATE | |
98399780 YQ |
1723 | HAVE_DECL_SETENV |
1724 | HAVE_SETENV | |
4a626d0a | 1725 | HAVE_SECURE_GETENV |
98399780 YQ |
1726 | HAVE_RPMATCH |
1727 | HAVE_REALPATH | |
c0c3707f | 1728 | HAVE_REALLOCARRAY |
98399780 YQ |
1729 | HAVE_RANDOM_R |
1730 | HAVE_RANDOM_H | |
1731 | HAVE_RANDOM | |
4c62b19f | 1732 | HAVE_QSORT_R |
98399780 YQ |
1733 | HAVE_PTSNAME_R |
1734 | HAVE_PTSNAME | |
1735 | HAVE_POSIX_OPENPT | |
9c9d63b1 | 1736 | HAVE_POSIX_MEMALIGN |
98399780 YQ |
1737 | HAVE_MKSTEMPS |
1738 | HAVE_MKSTEMP | |
1739 | HAVE_MKOSTEMPS | |
1740 | HAVE_MKOSTEMP | |
1741 | HAVE_MKDTEMP | |
c0c3707f CB |
1742 | HAVE_MBTOWC |
1743 | HAVE_DECL_INITSTATE | |
1744 | HAVE_INITSTATE | |
98399780 YQ |
1745 | HAVE_GRANTPT |
1746 | HAVE_GETSUBOPT | |
1747 | HAVE_DECL_GETLOADAVG | |
9c9d63b1 PM |
1748 | HAVE_DECL_GCVT |
1749 | HAVE_DECL_FCVT | |
1750 | HAVE_DECL_ECVT | |
98399780 YQ |
1751 | HAVE_CANONICALIZE_FILE_NAME |
1752 | HAVE_ATOLL | |
9c9d63b1 | 1753 | HAVE_ALIGNED_ALLOC |
98399780 | 1754 | HAVE__EXIT |
9c9d63b1 PM |
1755 | GNULIB_MDA_PUTENV |
1756 | GNULIB_MDA_MKTEMP | |
1757 | GNULIB_MDA_GCVT | |
1758 | GNULIB_MDA_FCVT | |
1759 | GNULIB_MDA_ECVT | |
98399780 YQ |
1760 | GNULIB_WCTOMB |
1761 | GNULIB_UNSETENV | |
1762 | GNULIB_UNLOCKPT | |
1763 | GNULIB_SYSTEM_POSIX | |
1764 | GNULIB_STRTOULL | |
1765 | GNULIB_STRTOLL | |
c0c3707f | 1766 | GNULIB_STRTOLD |
98399780 YQ |
1767 | GNULIB_STRTOD |
1768 | GNULIB_SETENV | |
4a626d0a | 1769 | GNULIB_SECURE_GETENV |
98399780 YQ |
1770 | GNULIB_RPMATCH |
1771 | GNULIB_REALPATH | |
1772 | GNULIB_REALLOC_POSIX | |
c0c3707f | 1773 | GNULIB_REALLOCARRAY |
98399780 YQ |
1774 | GNULIB_RANDOM_R |
1775 | GNULIB_RANDOM | |
4a626d0a | 1776 | GNULIB_QSORT_R |
98399780 YQ |
1777 | GNULIB_PUTENV |
1778 | GNULIB_PTSNAME_R | |
1779 | GNULIB_PTSNAME | |
1780 | GNULIB_POSIX_OPENPT | |
9c9d63b1 | 1781 | GNULIB_POSIX_MEMALIGN |
98399780 YQ |
1782 | GNULIB_MKSTEMPS |
1783 | GNULIB_MKSTEMP | |
1784 | GNULIB_MKOSTEMPS | |
1785 | GNULIB_MKOSTEMP | |
1786 | GNULIB_MKDTEMP | |
1787 | GNULIB_MBTOWC | |
1788 | GNULIB_MALLOC_POSIX | |
1789 | GNULIB_GRANTPT | |
1790 | GNULIB_GETSUBOPT | |
1791 | GNULIB_GETLOADAVG | |
9c9d63b1 | 1792 | GNULIB_FREE_POSIX |
98399780 YQ |
1793 | GNULIB_CANONICALIZE_FILE_NAME |
1794 | GNULIB_CALLOC_POSIX | |
1795 | GNULIB_ATOLL | |
9c9d63b1 | 1796 | GNULIB_ALIGNED_ALLOC |
98399780 | 1797 | GNULIB__EXIT |
698be2d8 CB |
1798 | LOCALE_FR |
1799 | REPLACE_WCSTOK | |
1800 | REPLACE_WCSFTIME | |
1801 | REPLACE_WCSWIDTH | |
1802 | REPLACE_WCWIDTH | |
1803 | REPLACE_WCSNRTOMBS | |
1804 | REPLACE_WCSRTOMBS | |
1805 | REPLACE_WCRTOMB | |
1806 | REPLACE_MBSNRTOWCS | |
1807 | REPLACE_MBSRTOWCS | |
1808 | REPLACE_MBRLEN | |
1809 | REPLACE_MBRTOWC | |
1810 | REPLACE_MBSINIT | |
1811 | REPLACE_WCTOB | |
1812 | REPLACE_BTOWC | |
1813 | REPLACE_MBSTATE_T | |
1814 | HAVE_DECL_WCWIDTH | |
9c9d63b1 | 1815 | HAVE_DECL_WCSDUP |
698be2d8 CB |
1816 | HAVE_DECL_WCTOB |
1817 | HAVE_WCSFTIME | |
1818 | HAVE_WCSWIDTH | |
1819 | HAVE_WCSTOK | |
1820 | HAVE_WCSSTR | |
1821 | HAVE_WCSPBRK | |
1822 | HAVE_WCSSPN | |
1823 | HAVE_WCSCSPN | |
1824 | HAVE_WCSRCHR | |
1825 | HAVE_WCSCHR | |
1826 | HAVE_WCSDUP | |
1827 | HAVE_WCSXFRM | |
1828 | HAVE_WCSCOLL | |
1829 | HAVE_WCSNCASECMP | |
1830 | HAVE_WCSCASECMP | |
1831 | HAVE_WCSNCMP | |
1832 | HAVE_WCSCMP | |
1833 | HAVE_WCSNCAT | |
1834 | HAVE_WCSCAT | |
1835 | HAVE_WCPNCPY | |
1836 | HAVE_WCSNCPY | |
1837 | HAVE_WCPCPY | |
1838 | HAVE_WCSCPY | |
1839 | HAVE_WCSNLEN | |
1840 | HAVE_WCSLEN | |
1841 | HAVE_WMEMSET | |
1842 | HAVE_WMEMPCPY | |
1843 | HAVE_WMEMMOVE | |
1844 | HAVE_WMEMCPY | |
1845 | HAVE_WMEMCMP | |
1846 | HAVE_WMEMCHR | |
1847 | HAVE_WCSNRTOMBS | |
1848 | HAVE_WCSRTOMBS | |
1849 | HAVE_WCRTOMB | |
1850 | HAVE_MBSNRTOWCS | |
1851 | HAVE_MBSRTOWCS | |
1852 | HAVE_MBRLEN | |
1853 | HAVE_MBRTOWC | |
1854 | HAVE_MBSINIT | |
1855 | HAVE_BTOWC | |
9c9d63b1 | 1856 | GNULIB_MDA_WCSDUP |
698be2d8 CB |
1857 | GNULIB_WCSFTIME |
1858 | GNULIB_WCSWIDTH | |
1859 | GNULIB_WCSTOK | |
1860 | GNULIB_WCSSTR | |
1861 | GNULIB_WCSPBRK | |
1862 | GNULIB_WCSSPN | |
1863 | GNULIB_WCSCSPN | |
1864 | GNULIB_WCSRCHR | |
1865 | GNULIB_WCSCHR | |
1866 | GNULIB_WCSDUP | |
1867 | GNULIB_WCSXFRM | |
1868 | GNULIB_WCSCOLL | |
1869 | GNULIB_WCSNCASECMP | |
1870 | GNULIB_WCSCASECMP | |
1871 | GNULIB_WCSNCMP | |
1872 | GNULIB_WCSCMP | |
1873 | GNULIB_WCSNCAT | |
1874 | GNULIB_WCSCAT | |
1875 | GNULIB_WCPNCPY | |
1876 | GNULIB_WCSNCPY | |
1877 | GNULIB_WCPCPY | |
1878 | GNULIB_WCSCPY | |
1879 | GNULIB_WCSNLEN | |
1880 | GNULIB_WCSLEN | |
1881 | GNULIB_WMEMSET | |
1882 | GNULIB_WMEMPCPY | |
1883 | GNULIB_WMEMMOVE | |
1884 | GNULIB_WMEMCPY | |
1885 | GNULIB_WMEMCMP | |
1886 | GNULIB_WMEMCHR | |
1887 | GNULIB_WCWIDTH | |
1888 | GNULIB_WCSNRTOMBS | |
1889 | GNULIB_WCSRTOMBS | |
1890 | GNULIB_WCRTOMB | |
1891 | GNULIB_MBSNRTOWCS | |
1892 | GNULIB_MBSRTOWCS | |
1893 | GNULIB_MBRLEN | |
1894 | GNULIB_MBRTOWC | |
1895 | GNULIB_MBSINIT | |
1896 | GNULIB_WCTOB | |
1897 | GNULIB_BTOWC | |
725e2999 | 1898 | MKDIR_P |
c0c3707f | 1899 | HAVE_WS2TCPIP_H |
725e2999 JB |
1900 | HAVE_FEATURES_H |
1901 | NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H | |
1902 | NEXT_ARPA_INET_H | |
1903 | PRAGMA_COLUMNS | |
1904 | PRAGMA_SYSTEM_HEADER | |
1905 | INCLUDE_NEXT_AS_FIRST_DIRECTIVE | |
1906 | INCLUDE_NEXT | |
1907 | HAVE_ARPA_INET_H | |
1908 | REPLACE_INET_PTON | |
1909 | REPLACE_INET_NTOP | |
1910 | HAVE_DECL_INET_PTON | |
1911 | HAVE_DECL_INET_NTOP | |
1912 | GNULIB_INET_PTON | |
1913 | GNULIB_INET_NTOP | |
c0c3707f | 1914 | HAVE_ALLOCA_H |
8690e634 JK |
1915 | GL_GENERATE_ALLOCA_H_FALSE |
1916 | GL_GENERATE_ALLOCA_H_TRUE | |
1917 | ALLOCA_H | |
1918 | ALLOCA | |
c971b7fa PA |
1919 | GL_COND_LIBTOOL_FALSE |
1920 | GL_COND_LIBTOOL_TRUE | |
c8693053 RO |
1921 | RANLIB |
1922 | ARFLAGS | |
1923 | AR | |
1924 | LARGEFILE_CPPFLAGS | |
c971b7fa PA |
1925 | target_os |
1926 | target_vendor | |
1927 | target_cpu | |
1928 | target | |
c971b7fa PA |
1929 | host_os |
1930 | host_vendor | |
1931 | host_cpu | |
1932 | host | |
1933 | build_os | |
1934 | build_vendor | |
1935 | build_cpu | |
1936 | build | |
4a626d0a PA |
1937 | EGREP |
1938 | GREP | |
1939 | CPP | |
c971b7fa PA |
1940 | OBJEXT |
1941 | EXEEXT | |
1942 | ac_ct_CC | |
1943 | CPPFLAGS | |
1944 | LDFLAGS | |
1945 | CFLAGS | |
1946 | CC | |
1947 | MAINT | |
1948 | MAINTAINER_MODE_FALSE | |
1949 | MAINTAINER_MODE_TRUE | |
1950 | target_alias | |
1951 | host_alias | |
1952 | build_alias | |
1953 | LIBS | |
1954 | ECHO_T | |
1955 | ECHO_N | |
1956 | ECHO_C | |
1957 | DEFS | |
1958 | mandir | |
1959 | localedir | |
1960 | libdir | |
1961 | psdir | |
1962 | pdfdir | |
1963 | dvidir | |
1964 | htmldir | |
1965 | infodir | |
1966 | docdir | |
1967 | oldincludedir | |
1968 | includedir | |
1969 | localstatedir | |
1970 | sharedstatedir | |
1971 | sysconfdir | |
1972 | datadir | |
1973 | datarootdir | |
1974 | libexecdir | |
1975 | sbindir | |
1976 | bindir | |
1977 | program_transform_name | |
1978 | prefix | |
1979 | exec_prefix | |
1980 | PACKAGE_URL | |
1981 | PACKAGE_BUGREPORT | |
1982 | PACKAGE_STRING | |
1983 | PACKAGE_VERSION | |
1984 | PACKAGE_TARNAME | |
1985 | PACKAGE_NAME | |
1986 | PATH_SEPARATOR | |
1987 | SHELL' | |
1988 | ac_subst_files='' | |
1989 | ac_user_opts=' | |
1990 | enable_option_checking | |
1991 | enable_maintainer_mode | |
c8693053 | 1992 | enable_plugins |
2196f55f | 1993 | enable_largefile |
5abebf3c | 1994 | enable_threads |
c0c3707f | 1995 | enable_cross_guesses |
c971b7fa | 1996 | enable_dependency_tracking |
39be3c7e | 1997 | enable_silent_rules |
c971b7fa PA |
1998 | ' |
1999 | ac_precious_vars='build_alias | |
2000 | host_alias | |
2001 | target_alias | |
2002 | CC | |
2003 | CFLAGS | |
2004 | LDFLAGS | |
2005 | LIBS | |
2006 | CPPFLAGS | |
2007 | CPP' | |
2008 | ||
2009 | ||
2010 | # Initialize some variables set by options. | |
2011 | ac_init_help= | |
2012 | ac_init_version=false | |
2013 | ac_unrecognized_opts= | |
2014 | ac_unrecognized_sep= | |
2015 | # The variables have the same names as the options, with | |
2016 | # dashes changed to underlines. | |
2017 | cache_file=/dev/null | |
2018 | exec_prefix=NONE | |
2019 | no_create= | |
2020 | no_recursion= | |
2021 | prefix=NONE | |
2022 | program_prefix=NONE | |
2023 | program_suffix=NONE | |
2024 | program_transform_name=s,x,x, | |
2025 | silent= | |
2026 | site= | |
2027 | srcdir= | |
2028 | verbose= | |
2029 | x_includes=NONE | |
2030 | x_libraries=NONE | |
2031 | ||
2032 | # Installation directory options. | |
2033 | # These are left unexpanded so users can "make install exec_prefix=/foo" | |
2034 | # and all the variables that are supposed to be based on exec_prefix | |
2035 | # by default will actually change. | |
2036 | # Use braces instead of parens because sh, perl, etc. also accept them. | |
2037 | # (The list follows the same order as the GNU Coding Standards.) | |
2038 | bindir='${exec_prefix}/bin' | |
2039 | sbindir='${exec_prefix}/sbin' | |
2040 | libexecdir='${exec_prefix}/libexec' | |
2041 | datarootdir='${prefix}/share' | |
2042 | datadir='${datarootdir}' | |
2043 | sysconfdir='${prefix}/etc' | |
2044 | sharedstatedir='${prefix}/com' | |
2045 | localstatedir='${prefix}/var' | |
2046 | includedir='${prefix}/include' | |
2047 | oldincludedir='/usr/include' | |
d0ac1c44 | 2048 | docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' |
c971b7fa PA |
2049 | infodir='${datarootdir}/info' |
2050 | htmldir='${docdir}' | |
2051 | dvidir='${docdir}' | |
2052 | pdfdir='${docdir}' | |
2053 | psdir='${docdir}' | |
2054 | libdir='${exec_prefix}/lib' | |
2055 | localedir='${datarootdir}/locale' | |
2056 | mandir='${datarootdir}/man' | |
2057 | ||
2058 | ac_prev= | |
2059 | ac_dashdash= | |
2060 | for ac_option | |
2061 | do | |
2062 | # If the previous option needs an argument, assign it. | |
2063 | if test -n "$ac_prev"; then | |
2064 | eval $ac_prev=\$ac_option | |
2065 | ac_prev= | |
2066 | continue | |
2067 | fi | |
2068 | ||
2069 | case $ac_option in | |
d0ac1c44 SM |
2070 | *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; |
2071 | *=) ac_optarg= ;; | |
2072 | *) ac_optarg=yes ;; | |
c971b7fa PA |
2073 | esac |
2074 | ||
2075 | # Accept the important Cygnus configure options, so we can diagnose typos. | |
2076 | ||
2077 | case $ac_dashdash$ac_option in | |
2078 | --) | |
2079 | ac_dashdash=yes ;; | |
2080 | ||
2081 | -bindir | --bindir | --bindi | --bind | --bin | --bi) | |
2082 | ac_prev=bindir ;; | |
2083 | -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) | |
2084 | bindir=$ac_optarg ;; | |
2085 | ||
2086 | -build | --build | --buil | --bui | --bu) | |
2087 | ac_prev=build_alias ;; | |
2088 | -build=* | --build=* | --buil=* | --bui=* | --bu=*) | |
2089 | build_alias=$ac_optarg ;; | |
2090 | ||
2091 | -cache-file | --cache-file | --cache-fil | --cache-fi \ | |
2092 | | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) | |
2093 | ac_prev=cache_file ;; | |
2094 | -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | |
2095 | | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) | |
2096 | cache_file=$ac_optarg ;; | |
2097 | ||
2098 | --config-cache | -C) | |
2099 | cache_file=config.cache ;; | |
2100 | ||
2101 | -datadir | --datadir | --datadi | --datad) | |
2102 | ac_prev=datadir ;; | |
2103 | -datadir=* | --datadir=* | --datadi=* | --datad=*) | |
2104 | datadir=$ac_optarg ;; | |
2105 | ||
2106 | -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | |
2107 | | --dataroo | --dataro | --datar) | |
2108 | ac_prev=datarootdir ;; | |
2109 | -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | |
2110 | | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) | |
2111 | datarootdir=$ac_optarg ;; | |
2112 | ||
2113 | -disable-* | --disable-*) | |
2114 | ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` | |
2115 | # Reject names that are not valid shell variable names. | |
2116 | expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && | |
d0ac1c44 | 2117 | as_fn_error $? "invalid feature name: $ac_useropt" |
c971b7fa PA |
2118 | ac_useropt_orig=$ac_useropt |
2119 | ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` | |
2120 | case $ac_user_opts in | |
2121 | *" | |
2122 | "enable_$ac_useropt" | |
2123 | "*) ;; | |
2124 | *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" | |
2125 | ac_unrecognized_sep=', ';; | |
2126 | esac | |
2127 | eval enable_$ac_useropt=no ;; | |
2128 | ||
2129 | -docdir | --docdir | --docdi | --doc | --do) | |
2130 | ac_prev=docdir ;; | |
2131 | -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) | |
2132 | docdir=$ac_optarg ;; | |
2133 | ||
2134 | -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) | |
2135 | ac_prev=dvidir ;; | |
2136 | -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) | |
2137 | dvidir=$ac_optarg ;; | |
2138 | ||
2139 | -enable-* | --enable-*) | |
2140 | ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` | |
2141 | # Reject names that are not valid shell variable names. | |
2142 | expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && | |
d0ac1c44 | 2143 | as_fn_error $? "invalid feature name: $ac_useropt" |
c971b7fa PA |
2144 | ac_useropt_orig=$ac_useropt |
2145 | ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` | |
2146 | case $ac_user_opts in | |
2147 | *" | |
2148 | "enable_$ac_useropt" | |
2149 | "*) ;; | |
2150 | *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" | |
2151 | ac_unrecognized_sep=', ';; | |
2152 | esac | |
2153 | eval enable_$ac_useropt=\$ac_optarg ;; | |
2154 | ||
2155 | -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | |
2156 | | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | |
2157 | | --exec | --exe | --ex) | |
2158 | ac_prev=exec_prefix ;; | |
2159 | -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | |
2160 | | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | |
2161 | | --exec=* | --exe=* | --ex=*) | |
2162 | exec_prefix=$ac_optarg ;; | |
2163 | ||
2164 | -gas | --gas | --ga | --g) | |
2165 | # Obsolete; use --with-gas. | |
2166 | with_gas=yes ;; | |
2167 | ||
2168 | -help | --help | --hel | --he | -h) | |
2169 | ac_init_help=long ;; | |
2170 | -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) | |
2171 | ac_init_help=recursive ;; | |
2172 | -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) | |
2173 | ac_init_help=short ;; | |
2174 | ||
2175 | -host | --host | --hos | --ho) | |
2176 | ac_prev=host_alias ;; | |
2177 | -host=* | --host=* | --hos=* | --ho=*) | |
2178 | host_alias=$ac_optarg ;; | |
2179 | ||
2180 | -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) | |
2181 | ac_prev=htmldir ;; | |
2182 | -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | |
2183 | | --ht=*) | |
2184 | htmldir=$ac_optarg ;; | |
2185 | ||
2186 | -includedir | --includedir | --includedi | --included | --include \ | |
2187 | | --includ | --inclu | --incl | --inc) | |
2188 | ac_prev=includedir ;; | |
2189 | -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | |
2190 | | --includ=* | --inclu=* | --incl=* | --inc=*) | |
2191 | includedir=$ac_optarg ;; | |
2192 | ||
2193 | -infodir | --infodir | --infodi | --infod | --info | --inf) | |
2194 | ac_prev=infodir ;; | |
2195 | -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) | |
2196 | infodir=$ac_optarg ;; | |
2197 | ||
2198 | -libdir | --libdir | --libdi | --libd) | |
2199 | ac_prev=libdir ;; | |
2200 | -libdir=* | --libdir=* | --libdi=* | --libd=*) | |
2201 | libdir=$ac_optarg ;; | |
2202 | ||
2203 | -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | |
2204 | | --libexe | --libex | --libe) | |
2205 | ac_prev=libexecdir ;; | |
2206 | -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | |
2207 | | --libexe=* | --libex=* | --libe=*) | |
2208 | libexecdir=$ac_optarg ;; | |
2209 | ||
2210 | -localedir | --localedir | --localedi | --localed | --locale) | |
2211 | ac_prev=localedir ;; | |
2212 | -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) | |
2213 | localedir=$ac_optarg ;; | |
2214 | ||
2215 | -localstatedir | --localstatedir | --localstatedi | --localstated \ | |
2216 | | --localstate | --localstat | --localsta | --localst | --locals) | |
2217 | ac_prev=localstatedir ;; | |
2218 | -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | |
2219 | | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) | |
2220 | localstatedir=$ac_optarg ;; | |
2221 | ||
2222 | -mandir | --mandir | --mandi | --mand | --man | --ma | --m) | |
2223 | ac_prev=mandir ;; | |
2224 | -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) | |
2225 | mandir=$ac_optarg ;; | |
2226 | ||
2227 | -nfp | --nfp | --nf) | |
2228 | # Obsolete; use --without-fp. | |
2229 | with_fp=no ;; | |
2230 | ||
2231 | -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | |
2232 | | --no-cr | --no-c | -n) | |
2233 | no_create=yes ;; | |
2234 | ||
2235 | -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | |
2236 | | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) | |
2237 | no_recursion=yes ;; | |
2238 | ||
2239 | -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | |
2240 | | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | |
2241 | | --oldin | --oldi | --old | --ol | --o) | |
2242 | ac_prev=oldincludedir ;; | |
2243 | -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | |
2244 | | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | |
2245 | | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) | |
2246 | oldincludedir=$ac_optarg ;; | |
2247 | ||
2248 | -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) | |
2249 | ac_prev=prefix ;; | |
2250 | -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) | |
2251 | prefix=$ac_optarg ;; | |
2252 | ||
2253 | -program-prefix | --program-prefix | --program-prefi | --program-pref \ | |
2254 | | --program-pre | --program-pr | --program-p) | |
2255 | ac_prev=program_prefix ;; | |
2256 | -program-prefix=* | --program-prefix=* | --program-prefi=* \ | |
2257 | | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) | |
2258 | program_prefix=$ac_optarg ;; | |
2259 | ||
2260 | -program-suffix | --program-suffix | --program-suffi | --program-suff \ | |
2261 | | --program-suf | --program-su | --program-s) | |
2262 | ac_prev=program_suffix ;; | |
2263 | -program-suffix=* | --program-suffix=* | --program-suffi=* \ | |
2264 | | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) | |
2265 | program_suffix=$ac_optarg ;; | |
2266 | ||
2267 | -program-transform-name | --program-transform-name \ | |
2268 | | --program-transform-nam | --program-transform-na \ | |
2269 | | --program-transform-n | --program-transform- \ | |
2270 | | --program-transform | --program-transfor \ | |
2271 | | --program-transfo | --program-transf \ | |
2272 | | --program-trans | --program-tran \ | |
2273 | | --progr-tra | --program-tr | --program-t) | |
2274 | ac_prev=program_transform_name ;; | |
2275 | -program-transform-name=* | --program-transform-name=* \ | |
2276 | | --program-transform-nam=* | --program-transform-na=* \ | |
2277 | | --program-transform-n=* | --program-transform-=* \ | |
2278 | | --program-transform=* | --program-transfor=* \ | |
2279 | | --program-transfo=* | --program-transf=* \ | |
2280 | | --program-trans=* | --program-tran=* \ | |
2281 | | --progr-tra=* | --program-tr=* | --program-t=*) | |
2282 | program_transform_name=$ac_optarg ;; | |
2283 | ||
2284 | -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) | |
2285 | ac_prev=pdfdir ;; | |
2286 | -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) | |
2287 | pdfdir=$ac_optarg ;; | |
2288 | ||
2289 | -psdir | --psdir | --psdi | --psd | --ps) | |
2290 | ac_prev=psdir ;; | |
2291 | -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) | |
2292 | psdir=$ac_optarg ;; | |
2293 | ||
2294 | -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | |
2295 | | -silent | --silent | --silen | --sile | --sil) | |
2296 | silent=yes ;; | |
2297 | ||
2298 | -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) | |
2299 | ac_prev=sbindir ;; | |
2300 | -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | |
2301 | | --sbi=* | --sb=*) | |
2302 | sbindir=$ac_optarg ;; | |
2303 | ||
2304 | -sharedstatedir | --sharedstatedir | --sharedstatedi \ | |
2305 | | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | |
2306 | | --sharedst | --shareds | --shared | --share | --shar \ | |
2307 | | --sha | --sh) | |
2308 | ac_prev=sharedstatedir ;; | |
2309 | -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | |
2310 | | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | |
2311 | | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | |
2312 | | --sha=* | --sh=*) | |
2313 | sharedstatedir=$ac_optarg ;; | |
2314 | ||
2315 | -site | --site | --sit) | |
2316 | ac_prev=site ;; | |
2317 | -site=* | --site=* | --sit=*) | |
2318 | site=$ac_optarg ;; | |
2319 | ||
2320 | -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) | |
2321 | ac_prev=srcdir ;; | |
2322 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) | |
2323 | srcdir=$ac_optarg ;; | |
2324 | ||
2325 | -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | |
2326 | | --syscon | --sysco | --sysc | --sys | --sy) | |
2327 | ac_prev=sysconfdir ;; | |
2328 | -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | |
2329 | | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) | |
2330 | sysconfdir=$ac_optarg ;; | |
2331 | ||
2332 | -target | --target | --targe | --targ | --tar | --ta | --t) | |
2333 | ac_prev=target_alias ;; | |
2334 | -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) | |
2335 | target_alias=$ac_optarg ;; | |
2336 | ||
2337 | -v | -verbose | --verbose | --verbos | --verbo | --verb) | |
2338 | verbose=yes ;; | |
2339 | ||
2340 | -version | --version | --versio | --versi | --vers | -V) | |
2341 | ac_init_version=: ;; | |
2342 | ||
2343 | -with-* | --with-*) | |
2344 | ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` | |
2345 | # Reject names that are not valid shell variable names. | |
2346 | expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && | |
d0ac1c44 | 2347 | as_fn_error $? "invalid package name: $ac_useropt" |
c971b7fa PA |
2348 | ac_useropt_orig=$ac_useropt |
2349 | ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` | |
2350 | case $ac_user_opts in | |
2351 | *" | |
2352 | "with_$ac_useropt" | |
2353 | "*) ;; | |
2354 | *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" | |
2355 | ac_unrecognized_sep=', ';; | |
2356 | esac | |
2357 | eval with_$ac_useropt=\$ac_optarg ;; | |
2358 | ||
2359 | -without-* | --without-*) | |
2360 | ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` | |
2361 | # Reject names that are not valid shell variable names. | |
2362 | expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && | |
d0ac1c44 | 2363 | as_fn_error $? "invalid package name: $ac_useropt" |
c971b7fa PA |
2364 | ac_useropt_orig=$ac_useropt |
2365 | ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` | |
2366 | case $ac_user_opts in | |
2367 | *" | |
2368 | "with_$ac_useropt" | |
2369 | "*) ;; | |
2370 | *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" | |
2371 | ac_unrecognized_sep=', ';; | |
2372 | esac | |
2373 | eval with_$ac_useropt=no ;; | |
2374 | ||
2375 | --x) | |
2376 | # Obsolete; use --with-x. | |
2377 | with_x=yes ;; | |
2378 | ||
2379 | -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | |
2380 | | --x-incl | --x-inc | --x-in | --x-i) | |
2381 | ac_prev=x_includes ;; | |
2382 | -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | |
2383 | | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) | |
2384 | x_includes=$ac_optarg ;; | |
2385 | ||
2386 | -x-libraries | --x-libraries | --x-librarie | --x-librari \ | |
2387 | | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) | |
2388 | ac_prev=x_libraries ;; | |
2389 | -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | |
2390 | | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) | |
2391 | x_libraries=$ac_optarg ;; | |
2392 | ||
d0ac1c44 SM |
2393 | -*) as_fn_error $? "unrecognized option: \`$ac_option' |
2394 | Try \`$0 --help' for more information" | |
c971b7fa PA |
2395 | ;; |
2396 | ||
2397 | *=*) | |
2398 | ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` | |
2399 | # Reject names that are not valid shell variable names. | |
2400 | case $ac_envvar in #( | |
2401 | '' | [0-9]* | *[!_$as_cr_alnum]* ) | |
d0ac1c44 | 2402 | as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; |
c971b7fa PA |
2403 | esac |
2404 | eval $ac_envvar=\$ac_optarg | |
2405 | export $ac_envvar ;; | |
2406 | ||
2407 | *) | |
2408 | # FIXME: should be removed in autoconf 3.0. | |
2409 | $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 | |
2410 | expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && | |
2411 | $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 | |
d0ac1c44 | 2412 | : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" |
c971b7fa PA |
2413 | ;; |
2414 | ||
2415 | esac | |
2416 | done | |
2417 | ||
2418 | if test -n "$ac_prev"; then | |
2419 | ac_option=--`echo $ac_prev | sed 's/_/-/g'` | |
d0ac1c44 | 2420 | as_fn_error $? "missing argument to $ac_option" |
c971b7fa PA |
2421 | fi |
2422 | ||
2423 | if test -n "$ac_unrecognized_opts"; then | |
2424 | case $enable_option_checking in | |
2425 | no) ;; | |
d0ac1c44 | 2426 | fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; |
c971b7fa PA |
2427 | *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; |
2428 | esac | |
2429 | fi | |
2430 | ||
2431 | # Check all directory arguments for consistency. | |
2432 | for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ | |
2433 | datadir sysconfdir sharedstatedir localstatedir includedir \ | |
2434 | oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ | |
2435 | libdir localedir mandir | |
2436 | do | |
2437 | eval ac_val=\$$ac_var | |
2438 | # Remove trailing slashes. | |
2439 | case $ac_val in | |
2440 | */ ) | |
2441 | ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` | |
2442 | eval $ac_var=\$ac_val;; | |
2443 | esac | |
2444 | # Be sure to have absolute directory names. | |
2445 | case $ac_val in | |
2446 | [\\/$]* | ?:[\\/]* ) continue;; | |
2447 | NONE | '' ) case $ac_var in *prefix ) continue;; esac;; | |
2448 | esac | |
d0ac1c44 | 2449 | as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" |
c971b7fa PA |
2450 | done |
2451 | ||
2452 | # There might be people who depend on the old broken behavior: `$host' | |
2453 | # used to hold the argument of --host etc. | |
2454 | # FIXME: To remove some day. | |
2455 | build=$build_alias | |
2456 | host=$host_alias | |
2457 | target=$target_alias | |
2458 | ||
2459 | # FIXME: To remove some day. | |
2460 | if test "x$host_alias" != x; then | |
2461 | if test "x$build_alias" = x; then | |
2462 | cross_compiling=maybe | |
c971b7fa PA |
2463 | elif test "x$build_alias" != "x$host_alias"; then |
2464 | cross_compiling=yes | |
2465 | fi | |
2466 | fi | |
2467 | ||
2468 | ac_tool_prefix= | |
2469 | test -n "$host_alias" && ac_tool_prefix=$host_alias- | |
2470 | ||
2471 | test "$silent" = yes && exec 6>/dev/null | |
2472 | ||
2473 | ||
2474 | ac_pwd=`pwd` && test -n "$ac_pwd" && | |
2475 | ac_ls_di=`ls -di .` && | |
2476 | ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || | |
d0ac1c44 | 2477 | as_fn_error $? "working directory cannot be determined" |
c971b7fa | 2478 | test "X$ac_ls_di" = "X$ac_pwd_ls_di" || |
d0ac1c44 | 2479 | as_fn_error $? "pwd does not report name of working directory" |
c971b7fa PA |
2480 | |
2481 | ||
2482 | # Find the source files, if location was not specified. | |
2483 | if test -z "$srcdir"; then | |
2484 | ac_srcdir_defaulted=yes | |
2485 | # Try the directory containing this script, then the parent directory. | |
2486 | ac_confdir=`$as_dirname -- "$as_myself" || | |
2487 | $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
2488 | X"$as_myself" : 'X\(//\)[^/]' \| \ | |
2489 | X"$as_myself" : 'X\(//\)$' \| \ | |
2490 | X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || | |
2491 | $as_echo X"$as_myself" | | |
2492 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
2493 | s//\1/ | |
2494 | q | |
2495 | } | |
2496 | /^X\(\/\/\)[^/].*/{ | |
2497 | s//\1/ | |
2498 | q | |
2499 | } | |
2500 | /^X\(\/\/\)$/{ | |
2501 | s//\1/ | |
2502 | q | |
2503 | } | |
2504 | /^X\(\/\).*/{ | |
2505 | s//\1/ | |
2506 | q | |
2507 | } | |
2508 | s/.*/./; q'` | |
2509 | srcdir=$ac_confdir | |
2510 | if test ! -r "$srcdir/$ac_unique_file"; then | |
2511 | srcdir=.. | |
2512 | fi | |
2513 | else | |
2514 | ac_srcdir_defaulted=no | |
2515 | fi | |
2516 | if test ! -r "$srcdir/$ac_unique_file"; then | |
2517 | test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." | |
d0ac1c44 | 2518 | as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" |
c971b7fa PA |
2519 | fi |
2520 | ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" | |
2521 | ac_abs_confdir=`( | |
d0ac1c44 | 2522 | cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" |
c971b7fa PA |
2523 | pwd)` |
2524 | # When building in place, set srcdir=. | |
2525 | if test "$ac_abs_confdir" = "$ac_pwd"; then | |
2526 | srcdir=. | |
2527 | fi | |
2528 | # Remove unnecessary trailing slashes from srcdir. | |
2529 | # Double slashes in file names in object file debugging info | |
2530 | # mess up M-x gdb in Emacs. | |
2531 | case $srcdir in | |
2532 | */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; | |
2533 | esac | |
2534 | for ac_var in $ac_precious_vars; do | |
2535 | eval ac_env_${ac_var}_set=\${${ac_var}+set} | |
2536 | eval ac_env_${ac_var}_value=\$${ac_var} | |
2537 | eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} | |
2538 | eval ac_cv_env_${ac_var}_value=\$${ac_var} | |
2539 | done | |
2540 | ||
2541 | # | |
2542 | # Report the --help message. | |
2543 | # | |
2544 | if test "$ac_init_help" = "long"; then | |
2545 | # Omit some internal or obsolete options to make the list less imposing. | |
2546 | # This message is too long to be a string in the A/UX 3.1 sh. | |
2547 | cat <<_ACEOF | |
d0ac1c44 | 2548 | \`configure' configures libgnu UNUSED-VERSION to adapt to many kinds of systems. |
c971b7fa PA |
2549 | |
2550 | Usage: $0 [OPTION]... [VAR=VALUE]... | |
2551 | ||
2552 | To assign environment variables (e.g., CC, CFLAGS...), specify them as | |
2553 | VAR=VALUE. See below for descriptions of some of the useful variables. | |
2554 | ||
2555 | Defaults for the options are specified in brackets. | |
2556 | ||
2557 | Configuration: | |
2558 | -h, --help display this help and exit | |
2559 | --help=short display options specific to this package | |
2560 | --help=recursive display the short help of all the included packages | |
2561 | -V, --version display version information and exit | |
d0ac1c44 | 2562 | -q, --quiet, --silent do not print \`checking ...' messages |
c971b7fa PA |
2563 | --cache-file=FILE cache test results in FILE [disabled] |
2564 | -C, --config-cache alias for \`--cache-file=config.cache' | |
2565 | -n, --no-create do not create output files | |
2566 | --srcdir=DIR find the sources in DIR [configure dir or \`..'] | |
2567 | ||
2568 | Installation directories: | |
2569 | --prefix=PREFIX install architecture-independent files in PREFIX | |
2570 | [$ac_default_prefix] | |
2571 | --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX | |
2572 | [PREFIX] | |
2573 | ||
2574 | By default, \`make install' will install all the files in | |
2575 | \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify | |
2576 | an installation prefix other than \`$ac_default_prefix' using \`--prefix', | |
2577 | for instance \`--prefix=\$HOME'. | |
2578 | ||
2579 | For better control, use the options below. | |
2580 | ||
2581 | Fine tuning of the installation directories: | |
2582 | --bindir=DIR user executables [EPREFIX/bin] | |
2583 | --sbindir=DIR system admin executables [EPREFIX/sbin] | |
2584 | --libexecdir=DIR program executables [EPREFIX/libexec] | |
2585 | --sysconfdir=DIR read-only single-machine data [PREFIX/etc] | |
2586 | --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] | |
2587 | --localstatedir=DIR modifiable single-machine data [PREFIX/var] | |
2588 | --libdir=DIR object code libraries [EPREFIX/lib] | |
2589 | --includedir=DIR C header files [PREFIX/include] | |
2590 | --oldincludedir=DIR C header files for non-gcc [/usr/include] | |
2591 | --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] | |
2592 | --datadir=DIR read-only architecture-independent data [DATAROOTDIR] | |
2593 | --infodir=DIR info documentation [DATAROOTDIR/info] | |
2594 | --localedir=DIR locale-dependent data [DATAROOTDIR/locale] | |
2595 | --mandir=DIR man documentation [DATAROOTDIR/man] | |
d0ac1c44 | 2596 | --docdir=DIR documentation root [DATAROOTDIR/doc/libgnu] |
c971b7fa PA |
2597 | --htmldir=DIR html documentation [DOCDIR] |
2598 | --dvidir=DIR dvi documentation [DOCDIR] | |
2599 | --pdfdir=DIR pdf documentation [DOCDIR] | |
2600 | --psdir=DIR ps documentation [DOCDIR] | |
2601 | _ACEOF | |
2602 | ||
2603 | cat <<\_ACEOF | |
2604 | ||
2605 | Program names: | |
2606 | --program-prefix=PREFIX prepend PREFIX to installed program names | |
2607 | --program-suffix=SUFFIX append SUFFIX to installed program names | |
2608 | --program-transform-name=PROGRAM run sed PROGRAM on installed program names | |
2609 | ||
2610 | System types: | |
2611 | --build=BUILD configure for building on BUILD [guessed] | |
2612 | --host=HOST cross-compile to build programs to run on HOST [BUILD] | |
2613 | --target=TARGET configure for building compilers for TARGET [HOST] | |
2614 | _ACEOF | |
2615 | fi | |
2616 | ||
2617 | if test -n "$ac_init_help"; then | |
d0ac1c44 SM |
2618 | case $ac_init_help in |
2619 | short | recursive ) echo "Configuration of libgnu UNUSED-VERSION:";; | |
2620 | esac | |
c971b7fa PA |
2621 | cat <<\_ACEOF |
2622 | ||
2623 | Optional Features: | |
2624 | --disable-option-checking ignore unrecognized --enable/--with options | |
2625 | --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) | |
2626 | --enable-FEATURE[=ARG] include FEATURE [ARG=yes] | |
d0ac1c44 SM |
2627 | --enable-maintainer-mode |
2628 | enable make rules and dependencies not useful (and | |
2629 | sometimes confusing) to the casual installer | |
c8693053 | 2630 | --enable-plugins Enable support for plugins |
2196f55f | 2631 | --disable-largefile omit support for large files |
c0c3707f | 2632 | --enable-threads={isoc|posix|isoc+posix|windows} |
5abebf3c CB |
2633 | specify multithreading API |
2634 | --disable-threads build without multithread safety | |
c0c3707f CB |
2635 | --enable-cross-guesses={conservative|risky} |
2636 | specify policy for cross-compilation guesses | |
d0ac1c44 SM |
2637 | --enable-dependency-tracking |
2638 | do not reject slow dependency extractors | |
2639 | --disable-dependency-tracking | |
2640 | speeds up one-time build | |
2641 | --enable-silent-rules less verbose build output (undo: "make V=1") | |
2642 | --disable-silent-rules verbose build output (undo: "make V=0") | |
c971b7fa PA |
2643 | |
2644 | Some influential environment variables: | |
2645 | CC C compiler command | |
2646 | CFLAGS C compiler flags | |
2647 | LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a | |
2648 | nonstandard directory <lib dir> | |
2649 | LIBS libraries to pass to the linker, e.g. -l<library> | |
d0ac1c44 | 2650 | CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if |
c971b7fa PA |
2651 | you have headers in a nonstandard directory <include dir> |
2652 | CPP C preprocessor | |
2653 | ||
2654 | Use these variables to override the choices made by `configure' or to help | |
2655 | it to find libraries and programs with nonstandard names/locations. | |
2656 | ||
2657 | Report bugs to the package provider. | |
2658 | _ACEOF | |
2659 | ac_status=$? | |
2660 | fi | |
2661 | ||
2662 | if test "$ac_init_help" = "recursive"; then | |
2663 | # If there are subdirs, report their specific --help. | |
2664 | for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue | |
2665 | test -d "$ac_dir" || | |
2666 | { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || | |
2667 | continue | |
2668 | ac_builddir=. | |
2669 | ||
2670 | case "$ac_dir" in | |
2671 | .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; | |
2672 | *) | |
2673 | ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` | |
2674 | # A ".." for each directory in $ac_dir_suffix. | |
2675 | ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` | |
2676 | case $ac_top_builddir_sub in | |
2677 | "") ac_top_builddir_sub=. ac_top_build_prefix= ;; | |
2678 | *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; | |
2679 | esac ;; | |
2680 | esac | |
2681 | ac_abs_top_builddir=$ac_pwd | |
2682 | ac_abs_builddir=$ac_pwd$ac_dir_suffix | |
2683 | # for backward compatibility: | |
2684 | ac_top_builddir=$ac_top_build_prefix | |
2685 | ||
2686 | case $srcdir in | |
2687 | .) # We are building in place. | |
2688 | ac_srcdir=. | |
2689 | ac_top_srcdir=$ac_top_builddir_sub | |
2690 | ac_abs_top_srcdir=$ac_pwd ;; | |
2691 | [\\/]* | ?:[\\/]* ) # Absolute name. | |
2692 | ac_srcdir=$srcdir$ac_dir_suffix; | |
2693 | ac_top_srcdir=$srcdir | |
2694 | ac_abs_top_srcdir=$srcdir ;; | |
2695 | *) # Relative name. | |
2696 | ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix | |
2697 | ac_top_srcdir=$ac_top_build_prefix$srcdir | |
2698 | ac_abs_top_srcdir=$ac_pwd/$srcdir ;; | |
2699 | esac | |
2700 | ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix | |
2701 | ||
2702 | cd "$ac_dir" || { ac_status=$?; continue; } | |
2703 | # Check for guested configure. | |
2704 | if test -f "$ac_srcdir/configure.gnu"; then | |
2705 | echo && | |
2706 | $SHELL "$ac_srcdir/configure.gnu" --help=recursive | |
2707 | elif test -f "$ac_srcdir/configure"; then | |
2708 | echo && | |
2709 | $SHELL "$ac_srcdir/configure" --help=recursive | |
2710 | else | |
2711 | $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 | |
2712 | fi || ac_status=$? | |
2713 | cd "$ac_pwd" || { ac_status=$?; break; } | |
2714 | done | |
2715 | fi | |
2716 | ||
2717 | test -n "$ac_init_help" && exit $ac_status | |
2718 | if $ac_init_version; then | |
2719 | cat <<\_ACEOF | |
d0ac1c44 SM |
2720 | libgnu configure UNUSED-VERSION |
2721 | generated by GNU Autoconf 2.69 | |
c971b7fa | 2722 | |
d0ac1c44 | 2723 | Copyright (C) 2012 Free Software Foundation, Inc. |
c971b7fa PA |
2724 | This configure script is free software; the Free Software Foundation |
2725 | gives unlimited permission to copy, distribute and modify it. | |
2726 | _ACEOF | |
2727 | exit | |
2728 | fi | |
2729 | ||
2730 | ## ------------------------ ## | |
2731 | ## Autoconf initialization. ## | |
2732 | ## ------------------------ ## | |
2733 | ||
2734 | # ac_fn_c_try_compile LINENO | |
2735 | # -------------------------- | |
2736 | # Try to compile conftest.$ac_ext, and return whether this succeeded. | |
2737 | ac_fn_c_try_compile () | |
2738 | { | |
2739 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2740 | rm -f conftest.$ac_objext | |
2741 | if { { ac_try="$ac_compile" | |
2742 | case "(($ac_try" in | |
2743 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
2744 | *) ac_try_echo=$ac_try;; | |
2745 | esac | |
2746 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
2747 | $as_echo "$ac_try_echo"; } >&5 | |
2748 | (eval "$ac_compile") 2>conftest.err | |
2749 | ac_status=$? | |
2750 | if test -s conftest.err; then | |
2751 | grep -v '^ *+' conftest.err >conftest.er1 | |
2752 | cat conftest.er1 >&5 | |
2753 | mv -f conftest.er1 conftest.err | |
2754 | fi | |
2755 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
2756 | test $ac_status = 0; } && { | |
2757 | test -z "$ac_c_werror_flag" || | |
2758 | test ! -s conftest.err | |
2759 | } && test -s conftest.$ac_objext; then : | |
2760 | ac_retval=0 | |
2761 | else | |
2762 | $as_echo "$as_me: failed program was:" >&5 | |
2763 | sed 's/^/| /' conftest.$ac_ext >&5 | |
2764 | ||
2765 | ac_retval=1 | |
2766 | fi | |
d0ac1c44 SM |
2767 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
2768 | as_fn_set_status $ac_retval | |
c971b7fa PA |
2769 | |
2770 | } # ac_fn_c_try_compile | |
2771 | ||
9c9d63b1 PM |
2772 | # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES |
2773 | # ------------------------------------------------------- | |
2774 | # Tests whether HEADER exists and can be compiled using the include files in | |
2775 | # INCLUDES, setting the cache variable VAR accordingly. | |
2776 | ac_fn_c_check_header_compile () | |
2777 | { | |
2778 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2779 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 | |
2780 | $as_echo_n "checking for $2... " >&6; } | |
2781 | if eval \${$3+:} false; then : | |
2782 | $as_echo_n "(cached) " >&6 | |
2783 | else | |
2784 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
2785 | /* end confdefs.h. */ | |
2786 | $4 | |
2787 | #include <$2> | |
2788 | _ACEOF | |
2789 | if ac_fn_c_try_compile "$LINENO"; then : | |
2790 | eval "$3=yes" | |
2791 | else | |
2792 | eval "$3=no" | |
2793 | fi | |
2794 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
2795 | fi | |
2796 | eval ac_res=\$$3 | |
2797 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
2798 | $as_echo "$ac_res" >&6; } | |
2799 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
2800 | ||
2801 | } # ac_fn_c_check_header_compile | |
2802 | ||
c971b7fa PA |
2803 | # ac_fn_c_try_cpp LINENO |
2804 | # ---------------------- | |
2805 | # Try to preprocess conftest.$ac_ext, and return whether this succeeded. | |
2806 | ac_fn_c_try_cpp () | |
2807 | { | |
2808 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2809 | if { { ac_try="$ac_cpp conftest.$ac_ext" | |
2810 | case "(($ac_try" in | |
2811 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
2812 | *) ac_try_echo=$ac_try;; | |
2813 | esac | |
2814 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
2815 | $as_echo "$ac_try_echo"; } >&5 | |
2816 | (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err | |
2817 | ac_status=$? | |
2818 | if test -s conftest.err; then | |
2819 | grep -v '^ *+' conftest.err >conftest.er1 | |
2820 | cat conftest.er1 >&5 | |
2821 | mv -f conftest.er1 conftest.err | |
2822 | fi | |
2823 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
d0ac1c44 | 2824 | test $ac_status = 0; } > conftest.i && { |
c971b7fa PA |
2825 | test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || |
2826 | test ! -s conftest.err | |
2827 | }; then : | |
2828 | ac_retval=0 | |
2829 | else | |
2830 | $as_echo "$as_me: failed program was:" >&5 | |
2831 | sed 's/^/| /' conftest.$ac_ext >&5 | |
2832 | ||
2833 | ac_retval=1 | |
2834 | fi | |
d0ac1c44 SM |
2835 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
2836 | as_fn_set_status $ac_retval | |
c971b7fa PA |
2837 | |
2838 | } # ac_fn_c_try_cpp | |
2839 | ||
c971b7fa PA |
2840 | # ac_fn_c_try_run LINENO |
2841 | # ---------------------- | |
2842 | # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes | |
2843 | # that executables *can* be run. | |
2844 | ac_fn_c_try_run () | |
2845 | { | |
2846 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2847 | if { { ac_try="$ac_link" | |
2848 | case "(($ac_try" in | |
2849 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
2850 | *) ac_try_echo=$ac_try;; | |
2851 | esac | |
2852 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
2853 | $as_echo "$ac_try_echo"; } >&5 | |
2854 | (eval "$ac_link") 2>&5 | |
2855 | ac_status=$? | |
2856 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
2857 | test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' | |
2858 | { { case "(($ac_try" in | |
2859 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
2860 | *) ac_try_echo=$ac_try;; | |
2861 | esac | |
2862 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
2863 | $as_echo "$ac_try_echo"; } >&5 | |
2864 | (eval "$ac_try") 2>&5 | |
2865 | ac_status=$? | |
2866 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
2867 | test $ac_status = 0; }; }; then : | |
2868 | ac_retval=0 | |
2869 | else | |
2870 | $as_echo "$as_me: program exited with status $ac_status" >&5 | |
2871 | $as_echo "$as_me: failed program was:" >&5 | |
2872 | sed 's/^/| /' conftest.$ac_ext >&5 | |
2873 | ||
2874 | ac_retval=$ac_status | |
2875 | fi | |
2876 | rm -rf conftest.dSYM conftest_ipa8_conftest.oo | |
d0ac1c44 SM |
2877 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
2878 | as_fn_set_status $ac_retval | |
c971b7fa PA |
2879 | |
2880 | } # ac_fn_c_try_run | |
2881 | ||
73cc7272 TT |
2882 | # ac_fn_c_try_link LINENO |
2883 | # ----------------------- | |
2884 | # Try to link conftest.$ac_ext, and return whether this succeeded. | |
2885 | ac_fn_c_try_link () | |
2886 | { | |
2887 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2888 | rm -f conftest.$ac_objext conftest$ac_exeext | |
2889 | if { { ac_try="$ac_link" | |
2890 | case "(($ac_try" in | |
2891 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
2892 | *) ac_try_echo=$ac_try;; | |
2893 | esac | |
2894 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
2895 | $as_echo "$ac_try_echo"; } >&5 | |
2896 | (eval "$ac_link") 2>conftest.err | |
2897 | ac_status=$? | |
2898 | if test -s conftest.err; then | |
2899 | grep -v '^ *+' conftest.err >conftest.er1 | |
2900 | cat conftest.er1 >&5 | |
2901 | mv -f conftest.er1 conftest.err | |
2902 | fi | |
2903 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
2904 | test $ac_status = 0; } && { | |
2905 | test -z "$ac_c_werror_flag" || | |
2906 | test ! -s conftest.err | |
2907 | } && test -s conftest$ac_exeext && { | |
2908 | test "$cross_compiling" = yes || | |
2909 | test -x conftest$ac_exeext | |
2910 | }; then : | |
2911 | ac_retval=0 | |
2912 | else | |
2913 | $as_echo "$as_me: failed program was:" >&5 | |
2914 | sed 's/^/| /' conftest.$ac_ext >&5 | |
2915 | ||
2916 | ac_retval=1 | |
2917 | fi | |
2918 | # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information | |
2919 | # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would | |
2920 | # interfere with the next link command; also delete a directory that is | |
2921 | # left behind by Apple's compiler. We do this before executing the actions. | |
2922 | rm -rf conftest.dSYM conftest_ipa8_conftest.oo | |
2923 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
2924 | as_fn_set_status $ac_retval | |
2925 | ||
2926 | } # ac_fn_c_try_link | |
2927 | ||
d0ac1c44 SM |
2928 | # ac_fn_c_check_type LINENO TYPE VAR INCLUDES |
2929 | # ------------------------------------------- | |
2930 | # Tests whether TYPE exists after having included INCLUDES, setting cache | |
2931 | # variable VAR accordingly. | |
2932 | ac_fn_c_check_type () | |
2933 | { | |
2934 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2935 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 | |
2936 | $as_echo_n "checking for $2... " >&6; } | |
2937 | if eval \${$3+:} false; then : | |
2938 | $as_echo_n "(cached) " >&6 | |
2939 | else | |
2940 | eval "$3=no" | |
2941 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
2942 | /* end confdefs.h. */ | |
2943 | $4 | |
2944 | int | |
2945 | main () | |
2946 | { | |
2947 | if (sizeof ($2)) | |
2948 | return 0; | |
2949 | ; | |
2950 | return 0; | |
2951 | } | |
2952 | _ACEOF | |
2953 | if ac_fn_c_try_compile "$LINENO"; then : | |
2954 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
2955 | /* end confdefs.h. */ | |
2956 | $4 | |
2957 | int | |
2958 | main () | |
2959 | { | |
2960 | if (sizeof (($2))) | |
2961 | return 0; | |
2962 | ; | |
2963 | return 0; | |
2964 | } | |
2965 | _ACEOF | |
2966 | if ac_fn_c_try_compile "$LINENO"; then : | |
2967 | ||
2968 | else | |
2969 | eval "$3=yes" | |
2970 | fi | |
2971 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
2972 | fi | |
2973 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
2974 | fi | |
2975 | eval ac_res=\$$3 | |
2976 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
2977 | $as_echo "$ac_res" >&6; } | |
2978 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
2979 | ||
2980 | } # ac_fn_c_check_type | |
2981 | ||
9c9d63b1 PM |
2982 | # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES |
2983 | # ------------------------------------------------------- | |
2984 | # Tests whether HEADER exists, giving a warning if it cannot be compiled using | |
2985 | # the include files in INCLUDES and setting the cache variable VAR | |
2986 | # accordingly. | |
2987 | ac_fn_c_check_header_mongrel () | |
2988 | { | |
2989 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2990 | if eval \${$3+:} false; then : | |
2991 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 | |
2992 | $as_echo_n "checking for $2... " >&6; } | |
2993 | if eval \${$3+:} false; then : | |
2994 | $as_echo_n "(cached) " >&6 | |
2995 | fi | |
2996 | eval ac_res=\$$3 | |
2997 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
2998 | $as_echo "$ac_res" >&6; } | |
2999 | else | |
3000 | # Is the header compilable? | |
3001 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 | |
3002 | $as_echo_n "checking $2 usability... " >&6; } | |
3003 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3004 | /* end confdefs.h. */ | |
3005 | $4 | |
3006 | #include <$2> | |
3007 | _ACEOF | |
3008 | if ac_fn_c_try_compile "$LINENO"; then : | |
3009 | ac_header_compiler=yes | |
3010 | else | |
3011 | ac_header_compiler=no | |
3012 | fi | |
3013 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3014 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 | |
3015 | $as_echo "$ac_header_compiler" >&6; } | |
3016 | ||
3017 | # Is the header present? | |
3018 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 | |
3019 | $as_echo_n "checking $2 presence... " >&6; } | |
3020 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3021 | /* end confdefs.h. */ | |
3022 | #include <$2> | |
3023 | _ACEOF | |
3024 | if ac_fn_c_try_cpp "$LINENO"; then : | |
3025 | ac_header_preproc=yes | |
3026 | else | |
3027 | ac_header_preproc=no | |
3028 | fi | |
3029 | rm -f conftest.err conftest.i conftest.$ac_ext | |
3030 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 | |
3031 | $as_echo "$ac_header_preproc" >&6; } | |
3032 | ||
3033 | # So? What about this header? | |
3034 | case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( | |
3035 | yes:no: ) | |
3036 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 | |
3037 | $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} | |
3038 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 | |
3039 | $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} | |
3040 | ;; | |
3041 | no:yes:* ) | |
3042 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 | |
3043 | $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} | |
3044 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 | |
3045 | $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} | |
3046 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 | |
3047 | $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} | |
3048 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 | |
3049 | $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} | |
3050 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 | |
3051 | $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} | |
3052 | ;; | |
3053 | esac | |
3054 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 | |
3055 | $as_echo_n "checking for $2... " >&6; } | |
3056 | if eval \${$3+:} false; then : | |
3057 | $as_echo_n "(cached) " >&6 | |
3058 | else | |
3059 | eval "$3=\$ac_header_compiler" | |
3060 | fi | |
3061 | eval ac_res=\$$3 | |
3062 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
3063 | $as_echo "$ac_res" >&6; } | |
3064 | fi | |
3065 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
3066 | ||
3067 | } # ac_fn_c_check_header_mongrel | |
3068 | ||
8690e634 JK |
3069 | # ac_fn_c_check_func LINENO FUNC VAR |
3070 | # ---------------------------------- | |
3071 | # Tests whether FUNC exists, setting the cache variable VAR accordingly | |
3072 | ac_fn_c_check_func () | |
3073 | { | |
3074 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
3075 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 | |
3076 | $as_echo_n "checking for $2... " >&6; } | |
d0ac1c44 | 3077 | if eval \${$3+:} false; then : |
8690e634 JK |
3078 | $as_echo_n "(cached) " >&6 |
3079 | else | |
3080 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3081 | /* end confdefs.h. */ | |
3082 | /* Define $2 to an innocuous variant, in case <limits.h> declares $2. | |
3083 | For example, HP-UX 11i <limits.h> declares gettimeofday. */ | |
3084 | #define $2 innocuous_$2 | |
3085 | ||
3086 | /* System header to define __stub macros and hopefully few prototypes, | |
3087 | which can conflict with char $2 (); below. | |
3088 | Prefer <limits.h> to <assert.h> if __STDC__ is defined, since | |
3089 | <limits.h> exists even on freestanding compilers. */ | |
3090 | ||
3091 | #ifdef __STDC__ | |
3092 | # include <limits.h> | |
3093 | #else | |
3094 | # include <assert.h> | |
3095 | #endif | |
3096 | ||
3097 | #undef $2 | |
3098 | ||
3099 | /* Override any GCC internal prototype to avoid an error. | |
3100 | Use char because int might match the return type of a GCC | |
3101 | builtin and then its argument prototype would still apply. */ | |
3102 | #ifdef __cplusplus | |
3103 | extern "C" | |
3104 | #endif | |
3105 | char $2 (); | |
3106 | /* The GNU C library defines this for functions which it implements | |
3107 | to always fail with ENOSYS. Some functions are actually named | |
3108 | something starting with __ and the normal name is an alias. */ | |
3109 | #if defined __stub_$2 || defined __stub___$2 | |
3110 | choke me | |
3111 | #endif | |
3112 | ||
3113 | int | |
3114 | main () | |
3115 | { | |
3116 | return $2 (); | |
3117 | ; | |
3118 | return 0; | |
3119 | } | |
3120 | _ACEOF | |
3121 | if ac_fn_c_try_link "$LINENO"; then : | |
3122 | eval "$3=yes" | |
3123 | else | |
3124 | eval "$3=no" | |
3125 | fi | |
3126 | rm -f core conftest.err conftest.$ac_objext \ | |
3127 | conftest$ac_exeext conftest.$ac_ext | |
3128 | fi | |
3129 | eval ac_res=\$$3 | |
3130 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
3131 | $as_echo "$ac_res" >&6; } | |
d0ac1c44 | 3132 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
8690e634 JK |
3133 | |
3134 | } # ac_fn_c_check_func | |
3135 | ||
d0ac1c44 SM |
3136 | # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES |
3137 | # --------------------------------------------- | |
3138 | # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR | |
3139 | # accordingly. | |
8986e351 TT |
3140 | ac_fn_c_check_decl () |
3141 | { | |
5df4cba6 SM |
3142 | ac_save_ac_compile="$ac_compile" |
3143 | if test -n "$ac_compile_for_check_decl"; then | |
3144 | ac_compile="$ac_compile_for_check_decl" | |
3145 | fi | |
8986e351 | 3146 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
d0ac1c44 SM |
3147 | as_decl_name=`echo $2|sed 's/ *(.*//'` |
3148 | as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` | |
3149 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 | |
3150 | $as_echo_n "checking whether $as_decl_name is declared... " >&6; } | |
3151 | if eval \${$3+:} false; then : | |
8986e351 TT |
3152 | $as_echo_n "(cached) " >&6 |
3153 | else | |
3154 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3155 | /* end confdefs.h. */ | |
3156 | $4 | |
3157 | int | |
3158 | main () | |
3159 | { | |
d0ac1c44 SM |
3160 | #ifndef $as_decl_name |
3161 | #ifdef __cplusplus | |
3162 | (void) $as_decl_use; | |
3163 | #else | |
3164 | (void) $as_decl_name; | |
3165 | #endif | |
8986e351 TT |
3166 | #endif |
3167 | ||
3168 | ; | |
3169 | return 0; | |
3170 | } | |
3171 | _ACEOF | |
3172 | if ac_fn_c_try_compile "$LINENO"; then : | |
3173 | eval "$3=yes" | |
3174 | else | |
3175 | eval "$3=no" | |
3176 | fi | |
3177 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3178 | fi | |
3179 | eval ac_res=\$$3 | |
3180 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
3181 | $as_echo "$ac_res" >&6; } | |
d0ac1c44 | 3182 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
5df4cba6 | 3183 | ac_compile="$ac_save_ac_compile" |
8986e351 TT |
3184 | |
3185 | } # ac_fn_c_check_decl | |
3186 | ||
c971b7fa PA |
3187 | # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES |
3188 | # -------------------------------------------- | |
3189 | # Tries to find the compile-time value of EXPR in a program that includes | |
3190 | # INCLUDES, setting VAR accordingly. Returns whether the value could be | |
3191 | # computed | |
3192 | ac_fn_c_compute_int () | |
3193 | { | |
3194 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
3195 | if test "$cross_compiling" = yes; then | |
3196 | # Depending upon the size, compute the lo and hi bounds. | |
3197 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3198 | /* end confdefs.h. */ | |
3199 | $4 | |
3200 | int | |
3201 | main () | |
3202 | { | |
3203 | static int test_array [1 - 2 * !(($2) >= 0)]; | |
d0ac1c44 SM |
3204 | test_array [0] = 0; |
3205 | return test_array [0]; | |
c971b7fa PA |
3206 | |
3207 | ; | |
3208 | return 0; | |
3209 | } | |
3210 | _ACEOF | |
3211 | if ac_fn_c_try_compile "$LINENO"; then : | |
3212 | ac_lo=0 ac_mid=0 | |
3213 | while :; do | |
3214 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3215 | /* end confdefs.h. */ | |
3216 | $4 | |
3217 | int | |
3218 | main () | |
3219 | { | |
3220 | static int test_array [1 - 2 * !(($2) <= $ac_mid)]; | |
d0ac1c44 SM |
3221 | test_array [0] = 0; |
3222 | return test_array [0]; | |
c971b7fa PA |
3223 | |
3224 | ; | |
3225 | return 0; | |
3226 | } | |
3227 | _ACEOF | |
3228 | if ac_fn_c_try_compile "$LINENO"; then : | |
3229 | ac_hi=$ac_mid; break | |
3230 | else | |
3231 | as_fn_arith $ac_mid + 1 && ac_lo=$as_val | |
3232 | if test $ac_lo -le $ac_mid; then | |
3233 | ac_lo= ac_hi= | |
3234 | break | |
3235 | fi | |
3236 | as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val | |
3237 | fi | |
3238 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3239 | done | |
3240 | else | |
3241 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3242 | /* end confdefs.h. */ | |
3243 | $4 | |
3244 | int | |
3245 | main () | |
3246 | { | |
3247 | static int test_array [1 - 2 * !(($2) < 0)]; | |
d0ac1c44 SM |
3248 | test_array [0] = 0; |
3249 | return test_array [0]; | |
c971b7fa PA |
3250 | |
3251 | ; | |
3252 | return 0; | |
3253 | } | |
3254 | _ACEOF | |
3255 | if ac_fn_c_try_compile "$LINENO"; then : | |
3256 | ac_hi=-1 ac_mid=-1 | |
3257 | while :; do | |
3258 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3259 | /* end confdefs.h. */ | |
3260 | $4 | |
3261 | int | |
3262 | main () | |
3263 | { | |
3264 | static int test_array [1 - 2 * !(($2) >= $ac_mid)]; | |
d0ac1c44 SM |
3265 | test_array [0] = 0; |
3266 | return test_array [0]; | |
c971b7fa PA |
3267 | |
3268 | ; | |
3269 | return 0; | |
3270 | } | |
3271 | _ACEOF | |
3272 | if ac_fn_c_try_compile "$LINENO"; then : | |
3273 | ac_lo=$ac_mid; break | |
3274 | else | |
3275 | as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val | |
3276 | if test $ac_mid -le $ac_hi; then | |
3277 | ac_lo= ac_hi= | |
3278 | break | |
3279 | fi | |
3280 | as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val | |
3281 | fi | |
3282 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3283 | done | |
3284 | else | |
3285 | ac_lo= ac_hi= | |
3286 | fi | |
3287 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3288 | fi | |
3289 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3290 | # Binary search between lo and hi bounds. | |
3291 | while test "x$ac_lo" != "x$ac_hi"; do | |
3292 | as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val | |
3293 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3294 | /* end confdefs.h. */ | |
3295 | $4 | |
3296 | int | |
3297 | main () | |
3298 | { | |
3299 | static int test_array [1 - 2 * !(($2) <= $ac_mid)]; | |
d0ac1c44 SM |
3300 | test_array [0] = 0; |
3301 | return test_array [0]; | |
c971b7fa PA |
3302 | |
3303 | ; | |
3304 | return 0; | |
3305 | } | |
3306 | _ACEOF | |
3307 | if ac_fn_c_try_compile "$LINENO"; then : | |
3308 | ac_hi=$ac_mid | |
3309 | else | |
3310 | as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val | |
3311 | fi | |
3312 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3313 | done | |
3314 | case $ac_lo in #(( | |
3315 | ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; | |
3316 | '') ac_retval=1 ;; | |
3317 | esac | |
3318 | else | |
3319 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3320 | /* end confdefs.h. */ | |
3321 | $4 | |
3322 | static long int longval () { return $2; } | |
3323 | static unsigned long int ulongval () { return $2; } | |
3324 | #include <stdio.h> | |
3325 | #include <stdlib.h> | |
3326 | int | |
3327 | main () | |
3328 | { | |
3329 | ||
3330 | FILE *f = fopen ("conftest.val", "w"); | |
3331 | if (! f) | |
3332 | return 1; | |
3333 | if (($2) < 0) | |
3334 | { | |
3335 | long int i = longval (); | |
3336 | if (i != ($2)) | |
3337 | return 1; | |
3338 | fprintf (f, "%ld", i); | |
3339 | } | |
3340 | else | |
3341 | { | |
3342 | unsigned long int i = ulongval (); | |
3343 | if (i != ($2)) | |
3344 | return 1; | |
3345 | fprintf (f, "%lu", i); | |
3346 | } | |
3347 | /* Do not output a trailing newline, as this causes \r\n confusion | |
3348 | on some platforms. */ | |
3349 | return ferror (f) || fclose (f) != 0; | |
3350 | ||
3351 | ; | |
3352 | return 0; | |
3353 | } | |
3354 | _ACEOF | |
3355 | if ac_fn_c_try_run "$LINENO"; then : | |
3356 | echo >>conftest.val; read $3 <conftest.val; ac_retval=0 | |
3357 | else | |
3358 | ac_retval=1 | |
3359 | fi | |
3360 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
3361 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
3362 | rm -f conftest.val | |
3363 | ||
3364 | fi | |
d0ac1c44 SM |
3365 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
3366 | as_fn_set_status $ac_retval | |
c971b7fa PA |
3367 | |
3368 | } # ac_fn_c_compute_int | |
725e2999 JB |
3369 | |
3370 | # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES | |
3371 | # ---------------------------------------------------- | |
3372 | # Tries to find if the field MEMBER exists in type AGGR, after including | |
3373 | # INCLUDES, setting cache variable VAR accordingly. | |
3374 | ac_fn_c_check_member () | |
3375 | { | |
3376 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
3377 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 | |
3378 | $as_echo_n "checking for $2.$3... " >&6; } | |
3379 | if eval \${$4+:} false; then : | |
3380 | $as_echo_n "(cached) " >&6 | |
3381 | else | |
3382 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3383 | /* end confdefs.h. */ | |
3384 | $5 | |
3385 | int | |
3386 | main () | |
3387 | { | |
3388 | static $2 ac_aggr; | |
3389 | if (ac_aggr.$3) | |
3390 | return 0; | |
3391 | ; | |
3392 | return 0; | |
3393 | } | |
3394 | _ACEOF | |
3395 | if ac_fn_c_try_compile "$LINENO"; then : | |
3396 | eval "$4=yes" | |
3397 | else | |
3398 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3399 | /* end confdefs.h. */ | |
3400 | $5 | |
3401 | int | |
3402 | main () | |
3403 | { | |
3404 | static $2 ac_aggr; | |
3405 | if (sizeof ac_aggr.$3) | |
3406 | return 0; | |
3407 | ; | |
3408 | return 0; | |
3409 | } | |
3410 | _ACEOF | |
3411 | if ac_fn_c_try_compile "$LINENO"; then : | |
3412 | eval "$4=yes" | |
3413 | else | |
3414 | eval "$4=no" | |
3415 | fi | |
3416 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3417 | fi | |
3418 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3419 | fi | |
3420 | eval ac_res=\$$4 | |
3421 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
3422 | $as_echo "$ac_res" >&6; } | |
3423 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
3424 | ||
3425 | } # ac_fn_c_check_member | |
c971b7fa PA |
3426 | cat >config.log <<_ACEOF |
3427 | This file contains any messages produced by compilers while | |
3428 | running configure, to aid debugging if configure makes a mistake. | |
3429 | ||
d0ac1c44 SM |
3430 | It was created by libgnu $as_me UNUSED-VERSION, which was |
3431 | generated by GNU Autoconf 2.69. Invocation command line was | |
c971b7fa PA |
3432 | |
3433 | $ $0 $@ | |
3434 | ||
3435 | _ACEOF | |
3436 | exec 5>>config.log | |
3437 | { | |
3438 | cat <<_ASUNAME | |
3439 | ## --------- ## | |
3440 | ## Platform. ## | |
3441 | ## --------- ## | |
3442 | ||
3443 | hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` | |
3444 | uname -m = `(uname -m) 2>/dev/null || echo unknown` | |
3445 | uname -r = `(uname -r) 2>/dev/null || echo unknown` | |
3446 | uname -s = `(uname -s) 2>/dev/null || echo unknown` | |
3447 | uname -v = `(uname -v) 2>/dev/null || echo unknown` | |
3448 | ||
3449 | /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` | |
3450 | /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` | |
3451 | ||
3452 | /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` | |
3453 | /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` | |
3454 | /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` | |
3455 | /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` | |
3456 | /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` | |
3457 | /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` | |
3458 | /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` | |
3459 | ||
3460 | _ASUNAME | |
3461 | ||
3462 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
3463 | for as_dir in $PATH | |
3464 | do | |
3465 | IFS=$as_save_IFS | |
3466 | test -z "$as_dir" && as_dir=. | |
3467 | $as_echo "PATH: $as_dir" | |
3468 | done | |
3469 | IFS=$as_save_IFS | |
3470 | ||
3471 | } >&5 | |
3472 | ||
3473 | cat >&5 <<_ACEOF | |
3474 | ||
3475 | ||
3476 | ## ----------- ## | |
3477 | ## Core tests. ## | |
3478 | ## ----------- ## | |
3479 | ||
3480 | _ACEOF | |
3481 | ||
3482 | ||
3483 | # Keep a trace of the command line. | |
3484 | # Strip out --no-create and --no-recursion so they do not pile up. | |
3485 | # Strip out --silent because we don't want to record it for future runs. | |
3486 | # Also quote any args containing shell meta-characters. | |
3487 | # Make two passes to allow for proper duplicate-argument suppression. | |
3488 | ac_configure_args= | |
3489 | ac_configure_args0= | |
3490 | ac_configure_args1= | |
3491 | ac_must_keep_next=false | |
3492 | for ac_pass in 1 2 | |
3493 | do | |
3494 | for ac_arg | |
3495 | do | |
3496 | case $ac_arg in | |
3497 | -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; | |
3498 | -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | |
3499 | | -silent | --silent | --silen | --sile | --sil) | |
3500 | continue ;; | |
3501 | *\'*) | |
3502 | ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; | |
3503 | esac | |
3504 | case $ac_pass in | |
3505 | 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; | |
3506 | 2) | |
3507 | as_fn_append ac_configure_args1 " '$ac_arg'" | |
3508 | if test $ac_must_keep_next = true; then | |
3509 | ac_must_keep_next=false # Got value, back to normal. | |
3510 | else | |
3511 | case $ac_arg in | |
3512 | *=* | --config-cache | -C | -disable-* | --disable-* \ | |
3513 | | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | |
3514 | | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | |
3515 | | -with-* | --with-* | -without-* | --without-* | --x) | |
3516 | case "$ac_configure_args0 " in | |
3517 | "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; | |
3518 | esac | |
3519 | ;; | |
3520 | -* ) ac_must_keep_next=true ;; | |
3521 | esac | |
3522 | fi | |
3523 | as_fn_append ac_configure_args " '$ac_arg'" | |
3524 | ;; | |
3525 | esac | |
3526 | done | |
3527 | done | |
3528 | { ac_configure_args0=; unset ac_configure_args0;} | |
3529 | { ac_configure_args1=; unset ac_configure_args1;} | |
3530 | ||
3531 | # When interrupted or exit'd, cleanup temporary files, and complete | |
3532 | # config.log. We remove comments because anyway the quotes in there | |
3533 | # would cause problems or look ugly. | |
3534 | # WARNING: Use '\'' to represent an apostrophe within the trap. | |
3535 | # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. | |
3536 | trap 'exit_status=$? | |
3537 | # Save into config.log some information that might help in debugging. | |
3538 | { | |
3539 | echo | |
3540 | ||
d0ac1c44 | 3541 | $as_echo "## ---------------- ## |
c971b7fa | 3542 | ## Cache variables. ## |
d0ac1c44 | 3543 | ## ---------------- ##" |
c971b7fa PA |
3544 | echo |
3545 | # The following way of writing the cache mishandles newlines in values, | |
3546 | ( | |
3547 | for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do | |
3548 | eval ac_val=\$$ac_var | |
3549 | case $ac_val in #( | |
3550 | *${as_nl}*) | |
3551 | case $ac_var in #( | |
3552 | *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 | |
3553 | $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; | |
3554 | esac | |
3555 | case $ac_var in #( | |
3556 | _ | IFS | as_nl) ;; #( | |
3557 | BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( | |
3558 | *) { eval $ac_var=; unset $ac_var;} ;; | |
3559 | esac ;; | |
3560 | esac | |
3561 | done | |
3562 | (set) 2>&1 | | |
3563 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( | |
3564 | *${as_nl}ac_space=\ *) | |
3565 | sed -n \ | |
3566 | "s/'\''/'\''\\\\'\'''\''/g; | |
3567 | s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" | |
3568 | ;; #( | |
3569 | *) | |
3570 | sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" | |
3571 | ;; | |
3572 | esac | | |
3573 | sort | |
3574 | ) | |
3575 | echo | |
3576 | ||
d0ac1c44 | 3577 | $as_echo "## ----------------- ## |
c971b7fa | 3578 | ## Output variables. ## |
d0ac1c44 | 3579 | ## ----------------- ##" |
c971b7fa PA |
3580 | echo |
3581 | for ac_var in $ac_subst_vars | |
3582 | do | |
3583 | eval ac_val=\$$ac_var | |
3584 | case $ac_val in | |
3585 | *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; | |
3586 | esac | |
3587 | $as_echo "$ac_var='\''$ac_val'\''" | |
3588 | done | sort | |
3589 | echo | |
3590 | ||
3591 | if test -n "$ac_subst_files"; then | |
d0ac1c44 | 3592 | $as_echo "## ------------------- ## |
c971b7fa | 3593 | ## File substitutions. ## |
d0ac1c44 | 3594 | ## ------------------- ##" |
c971b7fa PA |
3595 | echo |
3596 | for ac_var in $ac_subst_files | |
3597 | do | |
3598 | eval ac_val=\$$ac_var | |
3599 | case $ac_val in | |
3600 | *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; | |
3601 | esac | |
3602 | $as_echo "$ac_var='\''$ac_val'\''" | |
3603 | done | sort | |
3604 | echo | |
3605 | fi | |
3606 | ||
3607 | if test -s confdefs.h; then | |
d0ac1c44 | 3608 | $as_echo "## ----------- ## |
c971b7fa | 3609 | ## confdefs.h. ## |
d0ac1c44 | 3610 | ## ----------- ##" |
c971b7fa PA |
3611 | echo |
3612 | cat confdefs.h | |
3613 | echo | |
3614 | fi | |
3615 | test "$ac_signal" != 0 && | |
3616 | $as_echo "$as_me: caught signal $ac_signal" | |
3617 | $as_echo "$as_me: exit $exit_status" | |
3618 | } >&5 | |
3619 | rm -f core *.core core.conftest.* && | |
3620 | rm -f -r conftest* confdefs* conf$$* $ac_clean_files && | |
3621 | exit $exit_status | |
3622 | ' 0 | |
3623 | for ac_signal in 1 2 13 15; do | |
3624 | trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal | |
3625 | done | |
3626 | ac_signal=0 | |
3627 | ||
3628 | # confdefs.h avoids OS command line length limits that DEFS can exceed. | |
3629 | rm -f -r conftest* confdefs.h | |
3630 | ||
3631 | $as_echo "/* confdefs.h */" > confdefs.h | |
3632 | ||
3633 | # Predefined preprocessor variables. | |
3634 | ||
3635 | cat >>confdefs.h <<_ACEOF | |
3636 | #define PACKAGE_NAME "$PACKAGE_NAME" | |
3637 | _ACEOF | |
3638 | ||
3639 | cat >>confdefs.h <<_ACEOF | |
3640 | #define PACKAGE_TARNAME "$PACKAGE_TARNAME" | |
3641 | _ACEOF | |
3642 | ||
3643 | cat >>confdefs.h <<_ACEOF | |
3644 | #define PACKAGE_VERSION "$PACKAGE_VERSION" | |
3645 | _ACEOF | |
3646 | ||
3647 | cat >>confdefs.h <<_ACEOF | |
3648 | #define PACKAGE_STRING "$PACKAGE_STRING" | |
3649 | _ACEOF | |
3650 | ||
3651 | cat >>confdefs.h <<_ACEOF | |
3652 | #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" | |
3653 | _ACEOF | |
3654 | ||
3655 | cat >>confdefs.h <<_ACEOF | |
3656 | #define PACKAGE_URL "$PACKAGE_URL" | |
3657 | _ACEOF | |
3658 | ||
3659 | ||
3660 | # Let the site file select an alternate cache file if it wants to. | |
3661 | # Prefer an explicitly selected file to automatically selected ones. | |
3662 | ac_site_file1=NONE | |
3663 | ac_site_file2=NONE | |
3664 | if test -n "$CONFIG_SITE"; then | |
d0ac1c44 SM |
3665 | # We do not want a PATH search for config.site. |
3666 | case $CONFIG_SITE in #(( | |
3667 | -*) ac_site_file1=./$CONFIG_SITE;; | |
3668 | */*) ac_site_file1=$CONFIG_SITE;; | |
3669 | *) ac_site_file1=./$CONFIG_SITE;; | |
3670 | esac | |
c971b7fa PA |
3671 | elif test "x$prefix" != xNONE; then |
3672 | ac_site_file1=$prefix/share/config.site | |
3673 | ac_site_file2=$prefix/etc/config.site | |
3674 | else | |
3675 | ac_site_file1=$ac_default_prefix/share/config.site | |
3676 | ac_site_file2=$ac_default_prefix/etc/config.site | |
3677 | fi | |
3678 | for ac_site_file in "$ac_site_file1" "$ac_site_file2" | |
3679 | do | |
3680 | test "x$ac_site_file" = xNONE && continue | |
d0ac1c44 | 3681 | if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then |
c971b7fa PA |
3682 | { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 |
3683 | $as_echo "$as_me: loading site script $ac_site_file" >&6;} | |
3684 | sed 's/^/| /' "$ac_site_file" >&5 | |
d0ac1c44 SM |
3685 | . "$ac_site_file" \ |
3686 | || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
3687 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
3688 | as_fn_error $? "failed to load site script $ac_site_file | |
3689 | See \`config.log' for more details" "$LINENO" 5; } | |
c971b7fa PA |
3690 | fi |
3691 | done | |
3692 | ||
3693 | if test -r "$cache_file"; then | |
d0ac1c44 SM |
3694 | # Some versions of bash will fail to source /dev/null (special files |
3695 | # actually), so we avoid doing that. DJGPP emulates it as a regular file. | |
3696 | if test /dev/null != "$cache_file" && test -f "$cache_file"; then | |
c971b7fa PA |
3697 | { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 |
3698 | $as_echo "$as_me: loading cache $cache_file" >&6;} | |
3699 | case $cache_file in | |
3700 | [\\/]* | ?:[\\/]* ) . "$cache_file";; | |
3701 | *) . "./$cache_file";; | |
3702 | esac | |
3703 | fi | |
3704 | else | |
3705 | { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 | |
3706 | $as_echo "$as_me: creating cache $cache_file" >&6;} | |
3707 | >$cache_file | |
3708 | fi | |
3709 | ||
9c9d63b1 PM |
3710 | as_fn_append ac_header_list " wchar.h" |
3711 | as_fn_append ac_header_list " minix/config.h" | |
c0c3707f CB |
3712 | as_fn_append ac_header_list " arpa/inet.h" |
3713 | as_fn_append ac_header_list " features.h" | |
3714 | as_fn_append ac_header_list " sys/socket.h" | |
698be2d8 | 3715 | as_fn_append ac_func_list " btowc" |
c0c3707f | 3716 | as_fn_append ac_func_list " canonicalize_file_name" |
9c9d63b1 | 3717 | as_fn_append ac_func_list " faccessat" |
c0c3707f CB |
3718 | as_fn_append ac_func_list " realpath" |
3719 | as_fn_append ac_header_list " sys/param.h" | |
3720 | as_fn_append ac_header_list " unistd.h" | |
3721 | as_fn_append ac_func_list " _set_invalid_parameter_handler" | |
3722 | as_fn_append ac_func_list " fchdir" | |
3723 | as_fn_append ac_header_list " dirent.h" | |
3724 | as_fn_append ac_func_list " fcntl" | |
3725 | as_fn_append ac_func_list " symlink" | |
3726 | as_fn_append ac_func_list " fdopendir" | |
3727 | as_fn_append ac_func_list " mempcpy" | |
3728 | as_fn_append ac_header_list " fnmatch.h" | |
3729 | as_fn_append ac_func_list " fnmatch" | |
c0c3707f | 3730 | as_fn_append ac_func_list " mbsrtowcs" |
8690e634 | 3731 | gl_fnmatch_required=GNU |
c0c3707f CB |
3732 | as_fn_append ac_header_list " sys/stat.h" |
3733 | as_fn_append ac_func_list " fstatat" | |
3734 | as_fn_append ac_func_list " getdtablesize" | |
3735 | as_fn_append ac_func_list " getlogin_r" | |
3736 | as_fn_append ac_func_list " getprogname" | |
3737 | as_fn_append ac_func_list " getexecname" | |
698be2d8 | 3738 | as_fn_append ac_func_list " getrandom" |
c0c3707f CB |
3739 | as_fn_append ac_header_list " sys/time.h" |
3740 | as_fn_append ac_func_list " gettimeofday" | |
3741 | as_fn_append ac_header_list " glob.h" | |
3742 | as_fn_append ac_func_list " glob" | |
3743 | as_fn_append ac_func_list " glob_pattern_p" | |
3744 | as_fn_append ac_func_list " getpwnam_r" | |
5df4cba6 | 3745 | as_fn_append ac_header_list " threads.h" |
c0c3707f CB |
3746 | as_fn_append ac_header_list " netdb.h" |
3747 | as_fn_append ac_header_list " netinet/in.h" | |
3748 | as_fn_append ac_header_list " limits.h" | |
c0c3707f | 3749 | as_fn_append ac_header_list " inttypes.h" |
9c9d63b1 PM |
3750 | as_fn_append ac_header_list " sys/types.h" |
3751 | as_fn_append ac_header_list " stdint.h" | |
698be2d8 | 3752 | as_fn_append ac_func_list " isblank" |
5df4cba6 | 3753 | as_fn_append ac_header_list " xlocale.h" |
c0c3707f CB |
3754 | as_fn_append ac_func_list " lstat" |
3755 | as_fn_append ac_header_list " math.h" | |
3756 | as_fn_append ac_func_list " mbsinit" | |
3757 | as_fn_append ac_func_list " mbrtowc" | |
3758 | as_fn_append ac_header_list " sys/mman.h" | |
3759 | as_fn_append ac_func_list " mprotect" | |
3760 | as_fn_append ac_func_list " mkostemp" | |
3761 | as_fn_append ac_func_list " openat" | |
9c9d63b1 PM |
3762 | as_fn_append ac_func_list " pipe" |
3763 | as_fn_append ac_func_list " readlink" | |
c0c3707f CB |
3764 | as_fn_append ac_func_list " link" |
3765 | as_fn_append ac_func_list " setenv" | |
c0c3707f CB |
3766 | as_fn_append ac_func_list " strerror_r" |
3767 | as_fn_append ac_func_list " __xpg_strerror_r" | |
3768 | as_fn_append ac_func_list " catgets" | |
3769 | as_fn_append ac_func_list " snprintf" | |
698be2d8 | 3770 | as_fn_append ac_header_list " sys/random.h" |
c0c3707f CB |
3771 | as_fn_append ac_header_list " sys/uio.h" |
3772 | as_fn_append ac_func_list " localtime_r" | |
c0c3707f CB |
3773 | as_fn_append ac_header_list " crtdefs.h" |
3774 | as_fn_append ac_func_list " iswcntrl" | |
698be2d8 CB |
3775 | as_fn_append ac_header_list " wctype.h" |
3776 | as_fn_append ac_func_list " wmempcpy" | |
c971b7fa PA |
3777 | # Check that the precious variables saved in the cache have kept the same |
3778 | # value. | |
3779 | ac_cache_corrupted=false | |
3780 | for ac_var in $ac_precious_vars; do | |
3781 | eval ac_old_set=\$ac_cv_env_${ac_var}_set | |
3782 | eval ac_new_set=\$ac_env_${ac_var}_set | |
3783 | eval ac_old_val=\$ac_cv_env_${ac_var}_value | |
3784 | eval ac_new_val=\$ac_env_${ac_var}_value | |
3785 | case $ac_old_set,$ac_new_set in | |
3786 | set,) | |
3787 | { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 | |
3788 | $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} | |
3789 | ac_cache_corrupted=: ;; | |
3790 | ,set) | |
3791 | { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 | |
3792 | $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} | |
3793 | ac_cache_corrupted=: ;; | |
3794 | ,);; | |
3795 | *) | |
3796 | if test "x$ac_old_val" != "x$ac_new_val"; then | |
3797 | # differences in whitespace do not lead to failure. | |
3798 | ac_old_val_w=`echo x $ac_old_val` | |
3799 | ac_new_val_w=`echo x $ac_new_val` | |
3800 | if test "$ac_old_val_w" != "$ac_new_val_w"; then | |
3801 | { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 | |
3802 | $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} | |
3803 | ac_cache_corrupted=: | |
3804 | else | |
3805 | { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 | |
3806 | $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} | |
3807 | eval $ac_var=\$ac_old_val | |
3808 | fi | |
3809 | { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 | |
3810 | $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} | |
3811 | { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 | |
3812 | $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} | |
3813 | fi;; | |
3814 | esac | |
3815 | # Pass precious variables to config.status. | |
3816 | if test "$ac_new_set" = set; then | |
3817 | case $ac_new_val in | |
3818 | *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; | |
3819 | *) ac_arg=$ac_var=$ac_new_val ;; | |
3820 | esac | |
3821 | case " $ac_configure_args " in | |
3822 | *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. | |
3823 | *) as_fn_append ac_configure_args " '$ac_arg'" ;; | |
3824 | esac | |
3825 | fi | |
3826 | done | |
3827 | if $ac_cache_corrupted; then | |
3828 | { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
3829 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
3830 | { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 | |
3831 | $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} | |
d0ac1c44 | 3832 | as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 |
c971b7fa PA |
3833 | fi |
3834 | ## -------------------- ## | |
3835 | ## Main body of script. ## | |
3836 | ## -------------------- ## | |
3837 | ||
3838 | ac_ext=c | |
3839 | ac_cpp='$CPP $CPPFLAGS' | |
3840 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
3841 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
3842 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
3843 | ||
3844 | ||
d0ac1c44 | 3845 | |
73cc7272 TT |
3846 | |
3847 | ||
3848 | ||
c971b7fa PA |
3849 | ac_config_headers="$ac_config_headers config.h:config.in" |
3850 | ||
3851 | ||
5abebf3c CB |
3852 | |
3853 | ||
c971b7fa PA |
3854 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 |
3855 | $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } | |
3856 | # Check whether --enable-maintainer-mode was given. | |
3857 | if test "${enable_maintainer_mode+set}" = set; then : | |
3858 | enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval | |
3859 | else | |
3860 | USE_MAINTAINER_MODE=no | |
3861 | fi | |
3862 | ||
3863 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 | |
3864 | $as_echo "$USE_MAINTAINER_MODE" >&6; } | |
3865 | if test $USE_MAINTAINER_MODE = yes; then | |
3866 | MAINTAINER_MODE_TRUE= | |
3867 | MAINTAINER_MODE_FALSE='#' | |
3868 | else | |
3869 | MAINTAINER_MODE_TRUE='#' | |
3870 | MAINTAINER_MODE_FALSE= | |
3871 | fi | |
3872 | ||
3873 | MAINT=$MAINTAINER_MODE_TRUE | |
3874 | ||
3875 | ||
3876 | ||
3877 | ac_ext=c | |
3878 | ac_cpp='$CPP $CPPFLAGS' | |
3879 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
3880 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
3881 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
3882 | if test -n "$ac_tool_prefix"; then | |
3883 | # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. | |
3884 | set dummy ${ac_tool_prefix}gcc; ac_word=$2 | |
3885 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
3886 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 3887 | if ${ac_cv_prog_CC+:} false; then : |
c971b7fa PA |
3888 | $as_echo_n "(cached) " >&6 |
3889 | else | |
3890 | if test -n "$CC"; then | |
3891 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
3892 | else | |
3893 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
3894 | for as_dir in $PATH | |
3895 | do | |
3896 | IFS=$as_save_IFS | |
3897 | test -z "$as_dir" && as_dir=. | |
3898 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 3899 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
3900 | ac_cv_prog_CC="${ac_tool_prefix}gcc" |
3901 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
3902 | break 2 | |
3903 | fi | |
3904 | done | |
3905 | done | |
3906 | IFS=$as_save_IFS | |
3907 | ||
3908 | fi | |
3909 | fi | |
3910 | CC=$ac_cv_prog_CC | |
3911 | if test -n "$CC"; then | |
3912 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 | |
3913 | $as_echo "$CC" >&6; } | |
3914 | else | |
3915 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
3916 | $as_echo "no" >&6; } | |
3917 | fi | |
3918 | ||
3919 | ||
3920 | fi | |
3921 | if test -z "$ac_cv_prog_CC"; then | |
3922 | ac_ct_CC=$CC | |
3923 | # Extract the first word of "gcc", so it can be a program name with args. | |
3924 | set dummy gcc; ac_word=$2 | |
3925 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
3926 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 3927 | if ${ac_cv_prog_ac_ct_CC+:} false; then : |
c971b7fa PA |
3928 | $as_echo_n "(cached) " >&6 |
3929 | else | |
3930 | if test -n "$ac_ct_CC"; then | |
3931 | ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. | |
3932 | else | |
3933 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
3934 | for as_dir in $PATH | |
3935 | do | |
3936 | IFS=$as_save_IFS | |
3937 | test -z "$as_dir" && as_dir=. | |
3938 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 3939 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
3940 | ac_cv_prog_ac_ct_CC="gcc" |
3941 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
3942 | break 2 | |
3943 | fi | |
3944 | done | |
3945 | done | |
3946 | IFS=$as_save_IFS | |
3947 | ||
3948 | fi | |
3949 | fi | |
3950 | ac_ct_CC=$ac_cv_prog_ac_ct_CC | |
3951 | if test -n "$ac_ct_CC"; then | |
3952 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 | |
3953 | $as_echo "$ac_ct_CC" >&6; } | |
3954 | else | |
3955 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
3956 | $as_echo "no" >&6; } | |
3957 | fi | |
3958 | ||
3959 | if test "x$ac_ct_CC" = x; then | |
3960 | CC="" | |
3961 | else | |
3962 | case $cross_compiling:$ac_tool_warned in | |
3963 | yes:) | |
3964 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
3965 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
3966 | ac_tool_warned=yes ;; | |
3967 | esac | |
3968 | CC=$ac_ct_CC | |
3969 | fi | |
3970 | else | |
3971 | CC="$ac_cv_prog_CC" | |
3972 | fi | |
3973 | ||
3974 | if test -z "$CC"; then | |
3975 | if test -n "$ac_tool_prefix"; then | |
3976 | # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. | |
3977 | set dummy ${ac_tool_prefix}cc; ac_word=$2 | |
3978 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
3979 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 3980 | if ${ac_cv_prog_CC+:} false; then : |
c971b7fa PA |
3981 | $as_echo_n "(cached) " >&6 |
3982 | else | |
3983 | if test -n "$CC"; then | |
3984 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
3985 | else | |
3986 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
3987 | for as_dir in $PATH | |
3988 | do | |
3989 | IFS=$as_save_IFS | |
3990 | test -z "$as_dir" && as_dir=. | |
3991 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 3992 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
3993 | ac_cv_prog_CC="${ac_tool_prefix}cc" |
3994 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
3995 | break 2 | |
3996 | fi | |
3997 | done | |
3998 | done | |
3999 | IFS=$as_save_IFS | |
4000 | ||
4001 | fi | |
4002 | fi | |
4003 | CC=$ac_cv_prog_CC | |
4004 | if test -n "$CC"; then | |
4005 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 | |
4006 | $as_echo "$CC" >&6; } | |
4007 | else | |
4008 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4009 | $as_echo "no" >&6; } | |
4010 | fi | |
4011 | ||
4012 | ||
4013 | fi | |
4014 | fi | |
4015 | if test -z "$CC"; then | |
4016 | # Extract the first word of "cc", so it can be a program name with args. | |
4017 | set dummy cc; ac_word=$2 | |
4018 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
4019 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 4020 | if ${ac_cv_prog_CC+:} false; then : |
c971b7fa PA |
4021 | $as_echo_n "(cached) " >&6 |
4022 | else | |
4023 | if test -n "$CC"; then | |
4024 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
4025 | else | |
4026 | ac_prog_rejected=no | |
4027 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
4028 | for as_dir in $PATH | |
4029 | do | |
4030 | IFS=$as_save_IFS | |
4031 | test -z "$as_dir" && as_dir=. | |
4032 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 4033 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
4034 | if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then |
4035 | ac_prog_rejected=yes | |
4036 | continue | |
4037 | fi | |
4038 | ac_cv_prog_CC="cc" | |
4039 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
4040 | break 2 | |
4041 | fi | |
4042 | done | |
4043 | done | |
4044 | IFS=$as_save_IFS | |
4045 | ||
4046 | if test $ac_prog_rejected = yes; then | |
4047 | # We found a bogon in the path, so make sure we never use it. | |
4048 | set dummy $ac_cv_prog_CC | |
4049 | shift | |
4050 | if test $# != 0; then | |
4051 | # We chose a different compiler from the bogus one. | |
4052 | # However, it has the same basename, so the bogon will be chosen | |
4053 | # first if we set CC to just the basename; use the full file name. | |
4054 | shift | |
4055 | ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" | |
4056 | fi | |
4057 | fi | |
4058 | fi | |
4059 | fi | |
4060 | CC=$ac_cv_prog_CC | |
4061 | if test -n "$CC"; then | |
4062 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 | |
4063 | $as_echo "$CC" >&6; } | |
4064 | else | |
4065 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4066 | $as_echo "no" >&6; } | |
4067 | fi | |
4068 | ||
4069 | ||
4070 | fi | |
4071 | if test -z "$CC"; then | |
4072 | if test -n "$ac_tool_prefix"; then | |
4073 | for ac_prog in cl.exe | |
4074 | do | |
4075 | # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. | |
4076 | set dummy $ac_tool_prefix$ac_prog; ac_word=$2 | |
4077 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
4078 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 4079 | if ${ac_cv_prog_CC+:} false; then : |
c971b7fa PA |
4080 | $as_echo_n "(cached) " >&6 |
4081 | else | |
4082 | if test -n "$CC"; then | |
4083 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
4084 | else | |
4085 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
4086 | for as_dir in $PATH | |
4087 | do | |
4088 | IFS=$as_save_IFS | |
4089 | test -z "$as_dir" && as_dir=. | |
4090 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 4091 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
4092 | ac_cv_prog_CC="$ac_tool_prefix$ac_prog" |
4093 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
4094 | break 2 | |
4095 | fi | |
4096 | done | |
4097 | done | |
4098 | IFS=$as_save_IFS | |
4099 | ||
4100 | fi | |
4101 | fi | |
4102 | CC=$ac_cv_prog_CC | |
4103 | if test -n "$CC"; then | |
4104 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 | |
4105 | $as_echo "$CC" >&6; } | |
4106 | else | |
4107 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4108 | $as_echo "no" >&6; } | |
4109 | fi | |
4110 | ||
4111 | ||
4112 | test -n "$CC" && break | |
4113 | done | |
4114 | fi | |
4115 | if test -z "$CC"; then | |
4116 | ac_ct_CC=$CC | |
4117 | for ac_prog in cl.exe | |
4118 | do | |
4119 | # Extract the first word of "$ac_prog", so it can be a program name with args. | |
4120 | set dummy $ac_prog; ac_word=$2 | |
4121 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
4122 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 4123 | if ${ac_cv_prog_ac_ct_CC+:} false; then : |
c971b7fa PA |
4124 | $as_echo_n "(cached) " >&6 |
4125 | else | |
4126 | if test -n "$ac_ct_CC"; then | |
4127 | ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. | |
4128 | else | |
4129 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
4130 | for as_dir in $PATH | |
4131 | do | |
4132 | IFS=$as_save_IFS | |
4133 | test -z "$as_dir" && as_dir=. | |
4134 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 4135 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
4136 | ac_cv_prog_ac_ct_CC="$ac_prog" |
4137 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
4138 | break 2 | |
4139 | fi | |
4140 | done | |
4141 | done | |
4142 | IFS=$as_save_IFS | |
4143 | ||
4144 | fi | |
4145 | fi | |
4146 | ac_ct_CC=$ac_cv_prog_ac_ct_CC | |
4147 | if test -n "$ac_ct_CC"; then | |
4148 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 | |
4149 | $as_echo "$ac_ct_CC" >&6; } | |
4150 | else | |
4151 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4152 | $as_echo "no" >&6; } | |
4153 | fi | |
4154 | ||
4155 | ||
4156 | test -n "$ac_ct_CC" && break | |
4157 | done | |
4158 | ||
4159 | if test "x$ac_ct_CC" = x; then | |
4160 | CC="" | |
4161 | else | |
4162 | case $cross_compiling:$ac_tool_warned in | |
4163 | yes:) | |
4164 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
4165 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
4166 | ac_tool_warned=yes ;; | |
4167 | esac | |
4168 | CC=$ac_ct_CC | |
4169 | fi | |
4170 | fi | |
4171 | ||
c0c3707f CB |
4172 | fi |
4173 | if test -z "$CC"; then | |
4174 | if test -n "$ac_tool_prefix"; then | |
4175 | # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. | |
4176 | set dummy ${ac_tool_prefix}clang; ac_word=$2 | |
4177 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
4178 | $as_echo_n "checking for $ac_word... " >&6; } | |
4179 | if ${ac_cv_prog_CC+:} false; then : | |
4180 | $as_echo_n "(cached) " >&6 | |
4181 | else | |
4182 | if test -n "$CC"; then | |
4183 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
4184 | else | |
4185 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
4186 | for as_dir in $PATH | |
4187 | do | |
4188 | IFS=$as_save_IFS | |
4189 | test -z "$as_dir" && as_dir=. | |
4190 | for ac_exec_ext in '' $ac_executable_extensions; do | |
4191 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
4192 | ac_cv_prog_CC="${ac_tool_prefix}clang" | |
4193 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
4194 | break 2 | |
4195 | fi | |
4196 | done | |
4197 | done | |
4198 | IFS=$as_save_IFS | |
4199 | ||
4200 | fi | |
4201 | fi | |
4202 | CC=$ac_cv_prog_CC | |
4203 | if test -n "$CC"; then | |
4204 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 | |
4205 | $as_echo "$CC" >&6; } | |
4206 | else | |
4207 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4208 | $as_echo "no" >&6; } | |
4209 | fi | |
4210 | ||
4211 | ||
4212 | fi | |
4213 | if test -z "$ac_cv_prog_CC"; then | |
4214 | ac_ct_CC=$CC | |
4215 | # Extract the first word of "clang", so it can be a program name with args. | |
4216 | set dummy clang; ac_word=$2 | |
4217 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
4218 | $as_echo_n "checking for $ac_word... " >&6; } | |
4219 | if ${ac_cv_prog_ac_ct_CC+:} false; then : | |
4220 | $as_echo_n "(cached) " >&6 | |
4221 | else | |
4222 | if test -n "$ac_ct_CC"; then | |
4223 | ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. | |
4224 | else | |
4225 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
4226 | for as_dir in $PATH | |
4227 | do | |
4228 | IFS=$as_save_IFS | |
4229 | test -z "$as_dir" && as_dir=. | |
4230 | for ac_exec_ext in '' $ac_executable_extensions; do | |
4231 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
4232 | ac_cv_prog_ac_ct_CC="clang" | |
4233 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
4234 | break 2 | |
4235 | fi | |
4236 | done | |
4237 | done | |
4238 | IFS=$as_save_IFS | |
4239 | ||
4240 | fi | |
4241 | fi | |
4242 | ac_ct_CC=$ac_cv_prog_ac_ct_CC | |
4243 | if test -n "$ac_ct_CC"; then | |
4244 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 | |
4245 | $as_echo "$ac_ct_CC" >&6; } | |
4246 | else | |
4247 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4248 | $as_echo "no" >&6; } | |
4249 | fi | |
4250 | ||
4251 | if test "x$ac_ct_CC" = x; then | |
4252 | CC="" | |
4253 | else | |
4254 | case $cross_compiling:$ac_tool_warned in | |
4255 | yes:) | |
4256 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
4257 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
4258 | ac_tool_warned=yes ;; | |
4259 | esac | |
4260 | CC=$ac_ct_CC | |
4261 | fi | |
4262 | else | |
4263 | CC="$ac_cv_prog_CC" | |
4264 | fi | |
4265 | ||
c971b7fa PA |
4266 | fi |
4267 | ||
4268 | ||
4269 | test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
4270 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
d0ac1c44 SM |
4271 | as_fn_error $? "no acceptable C compiler found in \$PATH |
4272 | See \`config.log' for more details" "$LINENO" 5; } | |
c971b7fa PA |
4273 | |
4274 | # Provide some information about the compiler. | |
4275 | $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 | |
4276 | set X $ac_compile | |
4277 | ac_compiler=$2 | |
c0c3707f | 4278 | for ac_option in --version -v -V -qversion -version; do |
c971b7fa PA |
4279 | { { ac_try="$ac_compiler $ac_option >&5" |
4280 | case "(($ac_try" in | |
4281 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4282 | *) ac_try_echo=$ac_try;; | |
4283 | esac | |
4284 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4285 | $as_echo "$ac_try_echo"; } >&5 | |
4286 | (eval "$ac_compiler $ac_option >&5") 2>conftest.err | |
4287 | ac_status=$? | |
4288 | if test -s conftest.err; then | |
4289 | sed '10a\ | |
4290 | ... rest of stderr output deleted ... | |
4291 | 10q' conftest.err >conftest.er1 | |
4292 | cat conftest.er1 >&5 | |
c971b7fa | 4293 | fi |
d0ac1c44 | 4294 | rm -f conftest.er1 conftest.err |
c971b7fa PA |
4295 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
4296 | test $ac_status = 0; } | |
4297 | done | |
4298 | ||
4299 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4300 | /* end confdefs.h. */ | |
d0ac1c44 | 4301 | |
c971b7fa PA |
4302 | int |
4303 | main () | |
4304 | { | |
c971b7fa PA |
4305 | |
4306 | ; | |
4307 | return 0; | |
4308 | } | |
4309 | _ACEOF | |
4310 | ac_clean_files_save=$ac_clean_files | |
d0ac1c44 | 4311 | ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" |
c971b7fa PA |
4312 | # Try to create an executable without -o first, disregard a.out. |
4313 | # It will help us diagnose broken compilers, and finding out an intuition | |
4314 | # of exeext. | |
d0ac1c44 SM |
4315 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 |
4316 | $as_echo_n "checking whether the C compiler works... " >&6; } | |
c971b7fa PA |
4317 | ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` |
4318 | ||
4319 | # The possible output files: | |
4320 | ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" | |
4321 | ||
4322 | ac_rmfiles= | |
4323 | for ac_file in $ac_files | |
4324 | do | |
4325 | case $ac_file in | |
4326 | *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; | |
4327 | * ) ac_rmfiles="$ac_rmfiles $ac_file";; | |
4328 | esac | |
4329 | done | |
4330 | rm -f $ac_rmfiles | |
4331 | ||
4332 | if { { ac_try="$ac_link_default" | |
4333 | case "(($ac_try" in | |
4334 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4335 | *) ac_try_echo=$ac_try;; | |
4336 | esac | |
4337 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4338 | $as_echo "$ac_try_echo"; } >&5 | |
4339 | (eval "$ac_link_default") 2>&5 | |
4340 | ac_status=$? | |
4341 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
4342 | test $ac_status = 0; }; then : | |
4343 | # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. | |
4344 | # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' | |
4345 | # in a Makefile. We should not override ac_cv_exeext if it was cached, | |
4346 | # so that the user can short-circuit this test for compilers unknown to | |
4347 | # Autoconf. | |
4348 | for ac_file in $ac_files '' | |
4349 | do | |
4350 | test -f "$ac_file" || continue | |
4351 | case $ac_file in | |
4352 | *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) | |
4353 | ;; | |
4354 | [ab].out ) | |
4355 | # We found the default executable, but exeext='' is most | |
4356 | # certainly right. | |
4357 | break;; | |
4358 | *.* ) | |
4359 | if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; | |
4360 | then :; else | |
4361 | ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` | |
4362 | fi | |
4363 | # We set ac_cv_exeext here because the later test for it is not | |
4364 | # safe: cross compilers may not add the suffix if given an `-o' | |
4365 | # argument, so we may need to know it at that point already. | |
4366 | # Even if this section looks crufty: it has the advantage of | |
4367 | # actually working. | |
4368 | break;; | |
4369 | * ) | |
4370 | break;; | |
4371 | esac | |
4372 | done | |
4373 | test "$ac_cv_exeext" = no && ac_cv_exeext= | |
4374 | ||
4375 | else | |
4376 | ac_file='' | |
4377 | fi | |
c971b7fa | 4378 | if test -z "$ac_file"; then : |
d0ac1c44 SM |
4379 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
4380 | $as_echo "no" >&6; } | |
4381 | $as_echo "$as_me: failed program was:" >&5 | |
c971b7fa PA |
4382 | sed 's/^/| /' conftest.$ac_ext >&5 |
4383 | ||
4384 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
4385 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
d0ac1c44 SM |
4386 | as_fn_error 77 "C compiler cannot create executables |
4387 | See \`config.log' for more details" "$LINENO" 5; } | |
4388 | else | |
4389 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
4390 | $as_echo "yes" >&6; } | |
c971b7fa | 4391 | fi |
d0ac1c44 SM |
4392 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 |
4393 | $as_echo_n "checking for C compiler default output file name... " >&6; } | |
4394 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 | |
4395 | $as_echo "$ac_file" >&6; } | |
c971b7fa PA |
4396 | ac_exeext=$ac_cv_exeext |
4397 | ||
d0ac1c44 | 4398 | rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out |
c971b7fa | 4399 | ac_clean_files=$ac_clean_files_save |
c971b7fa PA |
4400 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 |
4401 | $as_echo_n "checking for suffix of executables... " >&6; } | |
4402 | if { { ac_try="$ac_link" | |
4403 | case "(($ac_try" in | |
4404 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4405 | *) ac_try_echo=$ac_try;; | |
4406 | esac | |
4407 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4408 | $as_echo "$ac_try_echo"; } >&5 | |
4409 | (eval "$ac_link") 2>&5 | |
4410 | ac_status=$? | |
4411 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
4412 | test $ac_status = 0; }; then : | |
4413 | # If both `conftest.exe' and `conftest' are `present' (well, observable) | |
4414 | # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will | |
4415 | # work properly (i.e., refer to `conftest.exe'), while it won't with | |
4416 | # `rm'. | |
4417 | for ac_file in conftest.exe conftest conftest.*; do | |
4418 | test -f "$ac_file" || continue | |
4419 | case $ac_file in | |
4420 | *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; | |
4421 | *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` | |
4422 | break;; | |
4423 | * ) break;; | |
4424 | esac | |
4425 | done | |
4426 | else | |
4427 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
4428 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
d0ac1c44 SM |
4429 | as_fn_error $? "cannot compute suffix of executables: cannot compile and link |
4430 | See \`config.log' for more details" "$LINENO" 5; } | |
c971b7fa | 4431 | fi |
d0ac1c44 | 4432 | rm -f conftest conftest$ac_cv_exeext |
c971b7fa PA |
4433 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 |
4434 | $as_echo "$ac_cv_exeext" >&6; } | |
4435 | ||
4436 | rm -f conftest.$ac_ext | |
4437 | EXEEXT=$ac_cv_exeext | |
4438 | ac_exeext=$EXEEXT | |
d0ac1c44 SM |
4439 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
4440 | /* end confdefs.h. */ | |
4441 | #include <stdio.h> | |
4442 | int | |
4443 | main () | |
4444 | { | |
4445 | FILE *f = fopen ("conftest.out", "w"); | |
4446 | return ferror (f) || fclose (f) != 0; | |
4447 | ||
4448 | ; | |
4449 | return 0; | |
4450 | } | |
4451 | _ACEOF | |
4452 | ac_clean_files="$ac_clean_files conftest.out" | |
4453 | # Check that the compiler produces executables we can run. If not, either | |
4454 | # the compiler is broken, or we cross compile. | |
4455 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 | |
4456 | $as_echo_n "checking whether we are cross compiling... " >&6; } | |
4457 | if test "$cross_compiling" != yes; then | |
4458 | { { ac_try="$ac_link" | |
4459 | case "(($ac_try" in | |
4460 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4461 | *) ac_try_echo=$ac_try;; | |
4462 | esac | |
4463 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4464 | $as_echo "$ac_try_echo"; } >&5 | |
4465 | (eval "$ac_link") 2>&5 | |
4466 | ac_status=$? | |
4467 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
4468 | test $ac_status = 0; } | |
4469 | if { ac_try='./conftest$ac_cv_exeext' | |
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_try") 2>&5 | |
4477 | ac_status=$? | |
4478 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
4479 | test $ac_status = 0; }; }; then | |
4480 | cross_compiling=no | |
4481 | else | |
4482 | if test "$cross_compiling" = maybe; then | |
4483 | cross_compiling=yes | |
4484 | else | |
4485 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
4486 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
4487 | as_fn_error $? "cannot run C compiled programs. | |
4488 | If you meant to cross compile, use \`--host'. | |
4489 | See \`config.log' for more details" "$LINENO" 5; } | |
4490 | fi | |
4491 | fi | |
4492 | fi | |
4493 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 | |
4494 | $as_echo "$cross_compiling" >&6; } | |
4495 | ||
4496 | rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out | |
4497 | ac_clean_files=$ac_clean_files_save | |
c971b7fa PA |
4498 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 |
4499 | $as_echo_n "checking for suffix of object files... " >&6; } | |
d0ac1c44 | 4500 | if ${ac_cv_objext+:} false; then : |
c971b7fa PA |
4501 | $as_echo_n "(cached) " >&6 |
4502 | else | |
4503 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4504 | /* end confdefs.h. */ | |
4505 | ||
4506 | int | |
4507 | main () | |
4508 | { | |
4509 | ||
4510 | ; | |
4511 | return 0; | |
4512 | } | |
4513 | _ACEOF | |
4514 | rm -f conftest.o conftest.obj | |
4515 | if { { ac_try="$ac_compile" | |
4516 | case "(($ac_try" in | |
4517 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4518 | *) ac_try_echo=$ac_try;; | |
4519 | esac | |
4520 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4521 | $as_echo "$ac_try_echo"; } >&5 | |
4522 | (eval "$ac_compile") 2>&5 | |
4523 | ac_status=$? | |
4524 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
4525 | test $ac_status = 0; }; then : | |
4526 | for ac_file in conftest.o conftest.obj conftest.*; do | |
4527 | test -f "$ac_file" || continue; | |
4528 | case $ac_file in | |
4529 | *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; | |
4530 | *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` | |
4531 | break;; | |
4532 | esac | |
4533 | done | |
4534 | else | |
4535 | $as_echo "$as_me: failed program was:" >&5 | |
4536 | sed 's/^/| /' conftest.$ac_ext >&5 | |
4537 | ||
4538 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
4539 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
d0ac1c44 SM |
4540 | as_fn_error $? "cannot compute suffix of object files: cannot compile |
4541 | See \`config.log' for more details" "$LINENO" 5; } | |
c971b7fa PA |
4542 | fi |
4543 | rm -f conftest.$ac_cv_objext conftest.$ac_ext | |
4544 | fi | |
4545 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 | |
4546 | $as_echo "$ac_cv_objext" >&6; } | |
4547 | OBJEXT=$ac_cv_objext | |
4548 | ac_objext=$OBJEXT | |
4549 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 | |
4550 | $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } | |
d0ac1c44 | 4551 | if ${ac_cv_c_compiler_gnu+:} false; then : |
c971b7fa PA |
4552 | $as_echo_n "(cached) " >&6 |
4553 | else | |
4554 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4555 | /* end confdefs.h. */ | |
4556 | ||
4557 | int | |
4558 | main () | |
4559 | { | |
4560 | #ifndef __GNUC__ | |
4561 | choke me | |
4562 | #endif | |
4563 | ||
4564 | ; | |
4565 | return 0; | |
4566 | } | |
4567 | _ACEOF | |
4568 | if ac_fn_c_try_compile "$LINENO"; then : | |
4569 | ac_compiler_gnu=yes | |
4570 | else | |
4571 | ac_compiler_gnu=no | |
4572 | fi | |
4573 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
4574 | ac_cv_c_compiler_gnu=$ac_compiler_gnu | |
4575 | ||
4576 | fi | |
4577 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 | |
4578 | $as_echo "$ac_cv_c_compiler_gnu" >&6; } | |
4579 | if test $ac_compiler_gnu = yes; then | |
4580 | GCC=yes | |
4581 | else | |
4582 | GCC= | |
4583 | fi | |
4584 | ac_test_CFLAGS=${CFLAGS+set} | |
4585 | ac_save_CFLAGS=$CFLAGS | |
4586 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 | |
4587 | $as_echo_n "checking whether $CC accepts -g... " >&6; } | |
d0ac1c44 | 4588 | if ${ac_cv_prog_cc_g+:} false; then : |
c971b7fa PA |
4589 | $as_echo_n "(cached) " >&6 |
4590 | else | |
4591 | ac_save_c_werror_flag=$ac_c_werror_flag | |
4592 | ac_c_werror_flag=yes | |
4593 | ac_cv_prog_cc_g=no | |
4594 | CFLAGS="-g" | |
4595 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4596 | /* end confdefs.h. */ | |
4597 | ||
4598 | int | |
4599 | main () | |
4600 | { | |
4601 | ||
4602 | ; | |
4603 | return 0; | |
4604 | } | |
4605 | _ACEOF | |
4606 | if ac_fn_c_try_compile "$LINENO"; then : | |
4607 | ac_cv_prog_cc_g=yes | |
4608 | else | |
4609 | CFLAGS="" | |
4610 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4611 | /* end confdefs.h. */ | |
4612 | ||
4613 | int | |
4614 | main () | |
4615 | { | |
4616 | ||
4617 | ; | |
4618 | return 0; | |
4619 | } | |
4620 | _ACEOF | |
4621 | if ac_fn_c_try_compile "$LINENO"; then : | |
4622 | ||
4623 | else | |
4624 | ac_c_werror_flag=$ac_save_c_werror_flag | |
4625 | CFLAGS="-g" | |
4626 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4627 | /* end confdefs.h. */ | |
4628 | ||
4629 | int | |
4630 | main () | |
4631 | { | |
4632 | ||
4633 | ; | |
4634 | return 0; | |
4635 | } | |
4636 | _ACEOF | |
4637 | if ac_fn_c_try_compile "$LINENO"; then : | |
4638 | ac_cv_prog_cc_g=yes | |
4639 | fi | |
4640 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
4641 | fi | |
4642 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
4643 | fi | |
4644 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
4645 | ac_c_werror_flag=$ac_save_c_werror_flag | |
4646 | fi | |
4647 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 | |
4648 | $as_echo "$ac_cv_prog_cc_g" >&6; } | |
4649 | if test "$ac_test_CFLAGS" = set; then | |
4650 | CFLAGS=$ac_save_CFLAGS | |
4651 | elif test $ac_cv_prog_cc_g = yes; then | |
4652 | if test "$GCC" = yes; then | |
4653 | CFLAGS="-g -O2" | |
4654 | else | |
4655 | CFLAGS="-g" | |
4656 | fi | |
4657 | else | |
4658 | if test "$GCC" = yes; then | |
4659 | CFLAGS="-O2" | |
4660 | else | |
4661 | CFLAGS= | |
4662 | fi | |
4663 | fi | |
c0c3707f CB |
4664 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 |
4665 | $as_echo_n "checking for $CC option to enable C11 features... " >&6; } | |
4666 | if ${ac_cv_prog_cc_c11+:} false; then : | |
c971b7fa PA |
4667 | $as_echo_n "(cached) " >&6 |
4668 | else | |
c0c3707f | 4669 | ac_cv_prog_cc_c11=no |
c971b7fa PA |
4670 | ac_save_CC=$CC |
4671 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4672 | /* end confdefs.h. */ | |
4673 | #include <stdarg.h> | |
c0c3707f CB |
4674 | #include <stdbool.h> |
4675 | #include <stddef.h> | |
4676 | #include <stdlib.h> | |
4677 | #include <wchar.h> | |
c971b7fa | 4678 | #include <stdio.h> |
c0c3707f CB |
4679 | |
4680 | // Check varargs macros. These examples are taken from C99 6.10.3.5. | |
4681 | #define debug(...) fprintf (stderr, __VA_ARGS__) | |
4682 | #define showlist(...) puts (#__VA_ARGS__) | |
4683 | #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) | |
4684 | static void | |
4685 | test_varargs_macros (void) | |
7a6dbc2f | 4686 | { |
c0c3707f CB |
4687 | int x = 1234; |
4688 | int y = 5678; | |
4689 | debug ("Flag"); | |
4690 | debug ("X = %d\n", x); | |
4691 | showlist (The first, second, and third items.); | |
4692 | report (x>y, "x is %d but y is %d", x, y); | |
c971b7fa | 4693 | } |
c0c3707f CB |
4694 | |
4695 | // Check long long types. | |
4696 | #define BIG64 18446744073709551615ull | |
4697 | #define BIG32 4294967295ul | |
4698 | #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) | |
4699 | #if !BIG_OK | |
4700 | your preprocessor is broken; | |
4701 | #endif | |
4702 | #if BIG_OK | |
4703 | #else | |
4704 | your preprocessor is broken; | |
4705 | #endif | |
4706 | static long long int bignum = -9223372036854775807LL; | |
4707 | static unsigned long long int ubignum = BIG64; | |
4708 | ||
4709 | struct incomplete_array | |
7a6dbc2f | 4710 | { |
c0c3707f CB |
4711 | int datasize; |
4712 | double data[]; | |
4713 | }; | |
4714 | ||
4715 | struct named_init { | |
4716 | int number; | |
4717 | const wchar_t *name; | |
4718 | double average; | |
4719 | }; | |
4720 | ||
4721 | typedef const char *ccp; | |
4722 | ||
4723 | static inline int | |
4724 | test_restrict (ccp restrict text) | |
4725 | { | |
4726 | // See if C++-style comments work. | |
4727 | // Iterate through items via the restricted pointer. | |
4728 | // Also check for declarations in for loops. | |
4729 | for (unsigned int i = 0; *(text+i) != '\0'; ++i) | |
4730 | continue; | |
4731 | return 0; | |
7a6dbc2f | 4732 | } |
7a6dbc2f | 4733 | |
c0c3707f CB |
4734 | // Check varargs and va_copy. |
4735 | static bool | |
4736 | test_varargs (const char *format, ...) | |
4737 | { | |
4738 | va_list args; | |
4739 | va_start (args, format); | |
4740 | va_list args_copy; | |
4741 | va_copy (args_copy, args); | |
7a6dbc2f | 4742 | |
c0c3707f CB |
4743 | const char *str = ""; |
4744 | int number = 0; | |
4745 | float fnumber = 0; | |
4746 | ||
4747 | while (*format) | |
4748 | { | |
4749 | switch (*format++) | |
4750 | { | |
4751 | case 's': // string | |
4752 | str = va_arg (args_copy, const char *); | |
4753 | break; | |
4754 | case 'd': // int | |
4755 | number = va_arg (args_copy, int); | |
4756 | break; | |
4757 | case 'f': // float | |
4758 | fnumber = va_arg (args_copy, double); | |
4759 | break; | |
4760 | default: | |
4761 | break; | |
4762 | } | |
4763 | } | |
4764 | va_end (args_copy); | |
4765 | va_end (args); | |
4766 | ||
4767 | return *str && number && fnumber; | |
4768 | } | |
4769 | // Check _Alignas. | |
4770 | char _Alignas (double) aligned_as_double; | |
4771 | char _Alignas (0) no_special_alignment; | |
4772 | extern char aligned_as_int; | |
4773 | char _Alignas (0) _Alignas (int) aligned_as_int; | |
4774 | ||
4775 | // Check _Alignof. | |
4776 | enum | |
4777 | { | |
4778 | int_alignment = _Alignof (int), | |
4779 | int_array_alignment = _Alignof (int[100]), | |
4780 | char_alignment = _Alignof (char) | |
4781 | }; | |
4782 | _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); | |
4783 | ||
4784 | // Check _Noreturn. | |
4785 | int _Noreturn does_not_return (void) { for (;;) continue; } | |
4786 | ||
4787 | // Check _Static_assert. | |
4788 | struct test_static_assert | |
4789 | { | |
4790 | int x; | |
4791 | _Static_assert (sizeof (int) <= sizeof (long int), | |
4792 | "_Static_assert does not work in struct"); | |
4793 | long int y; | |
4794 | }; | |
4795 | ||
4796 | // Check UTF-8 literals. | |
4797 | #define u8 syntax error! | |
4798 | char const utf8_literal[] = u8"happens to be ASCII" "another string"; | |
4799 | ||
4800 | // Check duplicate typedefs. | |
4801 | typedef long *long_ptr; | |
4802 | typedef long int *long_ptr; | |
4803 | typedef long_ptr long_ptr; | |
4804 | ||
4805 | // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. | |
4806 | struct anonymous | |
4807 | { | |
4808 | union { | |
4809 | struct { int i; int j; }; | |
4810 | struct { int k; long int l; } w; | |
4811 | }; | |
4812 | int m; | |
4813 | } v1; | |
c971b7fa | 4814 | |
c971b7fa PA |
4815 | int |
4816 | main () | |
4817 | { | |
c0c3707f CB |
4818 | |
4819 | // Check bool. | |
4820 | _Bool success = false; | |
4821 | ||
4822 | // Check restrict. | |
4823 | if (test_restrict ("String literal") == 0) | |
4824 | success = true; | |
4825 | char *restrict newvar = "Another string"; | |
4826 | ||
4827 | // Check varargs. | |
4828 | success &= test_varargs ("s, d' f .", "string", 65, 34.234); | |
4829 | test_varargs_macros (); | |
4830 | ||
4831 | // Check flexible array members. | |
4832 | struct incomplete_array *ia = | |
4833 | malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); | |
4834 | ia->datasize = 10; | |
4835 | for (int i = 0; i < ia->datasize; ++i) | |
4836 | ia->data[i] = i * 1.234; | |
4837 | ||
4838 | // Check named initializers. | |
4839 | struct named_init ni = { | |
4840 | .number = 34, | |
4841 | .name = L"Test wide string", | |
4842 | .average = 543.34343, | |
4843 | }; | |
4844 | ||
4845 | ni.number = 58; | |
4846 | ||
4847 | int dynamic_array[ni.number]; | |
4848 | dynamic_array[ni.number - 1] = 543; | |
4849 | ||
4850 | // work around unused variable warnings | |
4851 | return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' | |
4852 | || dynamic_array[ni.number - 1] != 543); | |
4853 | ||
4854 | v1.i = 2; | |
4855 | v1.w.k = 5; | |
4856 | _Static_assert ((offsetof (struct anonymous, i) | |
4857 | == offsetof (struct anonymous, w.k)), | |
4858 | "Anonymous union alignment botch"); | |
4859 | ||
c971b7fa PA |
4860 | ; |
4861 | return 0; | |
4862 | } | |
4863 | _ACEOF | |
c0c3707f | 4864 | for ac_arg in '' -std=gnu11 |
c971b7fa PA |
4865 | do |
4866 | CC="$ac_save_CC $ac_arg" | |
4867 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 4868 | ac_cv_prog_cc_c11=$ac_arg |
c971b7fa PA |
4869 | fi |
4870 | rm -f core conftest.err conftest.$ac_objext | |
c0c3707f | 4871 | test "x$ac_cv_prog_cc_c11" != "xno" && break |
c971b7fa PA |
4872 | done |
4873 | rm -f conftest.$ac_ext | |
4874 | CC=$ac_save_CC | |
4875 | ||
4876 | fi | |
4877 | # AC_CACHE_VAL | |
c0c3707f CB |
4878 | ac_prog_cc_stdc_options= |
4879 | case "x$ac_cv_prog_cc_c11" in | |
c971b7fa PA |
4880 | x) |
4881 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 | |
4882 | $as_echo "none needed" >&6; } ;; | |
4883 | xno) | |
4884 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 | |
4885 | $as_echo "unsupported" >&6; } ;; | |
4886 | *) | |
c0c3707f CB |
4887 | ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c11" |
4888 | CC=$CC$ac_prog_cc_stdc_options | |
4889 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 | |
4890 | $as_echo "$ac_cv_prog_cc_c11" >&6; } ;; | |
c971b7fa | 4891 | esac |
c0c3707f CB |
4892 | if test "x$ac_cv_prog_cc_c11" != xno; then : |
4893 | ac_prog_cc_stdc=c11 | |
4894 | ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 | |
4895 | else | |
4896 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 | |
4897 | $as_echo_n "checking for $CC option to enable C99 features... " >&6; } | |
4898 | if ${ac_cv_prog_cc_c99+:} false; then : | |
4899 | $as_echo_n "(cached) " >&6 | |
4900 | else | |
4901 | ac_cv_prog_cc_c99=no | |
4902 | ac_save_CC=$CC | |
4903 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4904 | /* end confdefs.h. */ | |
4905 | #include <stdarg.h> | |
4906 | #include <stdbool.h> | |
4907 | #include <stddef.h> | |
4908 | #include <stdlib.h> | |
4909 | #include <wchar.h> | |
4910 | #include <stdio.h> | |
7a6dbc2f | 4911 | |
c0c3707f CB |
4912 | // Check varargs macros. These examples are taken from C99 6.10.3.5. |
4913 | #define debug(...) fprintf (stderr, __VA_ARGS__) | |
4914 | #define showlist(...) puts (#__VA_ARGS__) | |
4915 | #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) | |
4916 | static void | |
4917 | test_varargs_macros (void) | |
4918 | { | |
4919 | int x = 1234; | |
4920 | int y = 5678; | |
4921 | debug ("Flag"); | |
4922 | debug ("X = %d\n", x); | |
4923 | showlist (The first, second, and third items.); | |
4924 | report (x>y, "x is %d but y is %d", x, y); | |
4925 | } | |
7a6dbc2f | 4926 | |
c0c3707f CB |
4927 | // Check long long types. |
4928 | #define BIG64 18446744073709551615ull | |
4929 | #define BIG32 4294967295ul | |
4930 | #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) | |
4931 | #if !BIG_OK | |
4932 | your preprocessor is broken; | |
4933 | #endif | |
4934 | #if BIG_OK | |
4935 | #else | |
4936 | your preprocessor is broken; | |
4937 | #endif | |
4938 | static long long int bignum = -9223372036854775807LL; | |
4939 | static unsigned long long int ubignum = BIG64; | |
7a6dbc2f | 4940 | |
c0c3707f CB |
4941 | struct incomplete_array |
4942 | { | |
4943 | int datasize; | |
4944 | double data[]; | |
4945 | }; | |
7a6dbc2f | 4946 | |
c0c3707f CB |
4947 | struct named_init { |
4948 | int number; | |
4949 | const wchar_t *name; | |
4950 | double average; | |
4951 | }; | |
7a6dbc2f | 4952 | |
c0c3707f | 4953 | typedef const char *ccp; |
7a6dbc2f | 4954 | |
c0c3707f CB |
4955 | static inline int |
4956 | test_restrict (ccp restrict text) | |
4957 | { | |
4958 | // See if C++-style comments work. | |
4959 | // Iterate through items via the restricted pointer. | |
4960 | // Also check for declarations in for loops. | |
4961 | for (unsigned int i = 0; *(text+i) != '\0'; ++i) | |
4962 | continue; | |
4963 | return 0; | |
4964 | } | |
7a6dbc2f | 4965 | |
c0c3707f CB |
4966 | // Check varargs and va_copy. |
4967 | static bool | |
4968 | test_varargs (const char *format, ...) | |
4969 | { | |
4970 | va_list args; | |
4971 | va_start (args, format); | |
4972 | va_list args_copy; | |
4973 | va_copy (args_copy, args); | |
4974 | ||
4975 | const char *str = ""; | |
4976 | int number = 0; | |
4977 | float fnumber = 0; | |
4978 | ||
4979 | while (*format) | |
4980 | { | |
4981 | switch (*format++) | |
4982 | { | |
4983 | case 's': // string | |
4984 | str = va_arg (args_copy, const char *); | |
4985 | break; | |
4986 | case 'd': // int | |
4987 | number = va_arg (args_copy, int); | |
4988 | break; | |
4989 | case 'f': // float | |
4990 | fnumber = va_arg (args_copy, double); | |
4991 | break; | |
4992 | default: | |
4993 | break; | |
4994 | } | |
4995 | } | |
4996 | va_end (args_copy); | |
4997 | va_end (args); | |
4998 | ||
4999 | return *str && number && fnumber; | |
5000 | } | |
5001 | int | |
5002 | main () | |
5003 | { | |
5004 | ||
5005 | // Check bool. | |
5006 | _Bool success = false; | |
5007 | ||
5008 | // Check restrict. | |
5009 | if (test_restrict ("String literal") == 0) | |
5010 | success = true; | |
5011 | char *restrict newvar = "Another string"; | |
5012 | ||
5013 | // Check varargs. | |
5014 | success &= test_varargs ("s, d' f .", "string", 65, 34.234); | |
5015 | test_varargs_macros (); | |
5016 | ||
5017 | // Check flexible array members. | |
5018 | struct incomplete_array *ia = | |
5019 | malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); | |
5020 | ia->datasize = 10; | |
5021 | for (int i = 0; i < ia->datasize; ++i) | |
5022 | ia->data[i] = i * 1.234; | |
5023 | ||
5024 | // Check named initializers. | |
5025 | struct named_init ni = { | |
5026 | .number = 34, | |
5027 | .name = L"Test wide string", | |
5028 | .average = 543.34343, | |
5029 | }; | |
5030 | ||
5031 | ni.number = 58; | |
5032 | ||
5033 | int dynamic_array[ni.number]; | |
5034 | dynamic_array[ni.number - 1] = 543; | |
5035 | ||
5036 | // work around unused variable warnings | |
5037 | return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' | |
5038 | || dynamic_array[ni.number - 1] != 543); | |
5039 | ||
5040 | ; | |
5041 | return 0; | |
5042 | } | |
5043 | _ACEOF | |
5044 | for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99 | |
5045 | do | |
5046 | CC="$ac_save_CC $ac_arg" | |
5047 | if ac_fn_c_try_compile "$LINENO"; then : | |
5048 | ac_cv_prog_cc_c99=$ac_arg | |
5049 | fi | |
5050 | rm -f core conftest.err conftest.$ac_objext | |
5051 | test "x$ac_cv_prog_cc_c99" != "xno" && break | |
5052 | done | |
5053 | rm -f conftest.$ac_ext | |
5054 | CC=$ac_save_CC | |
5055 | ||
5056 | fi | |
5057 | # AC_CACHE_VAL | |
5058 | ac_prog_cc_stdc_options= | |
5059 | case "x$ac_cv_prog_cc_c99" in | |
5060 | x) | |
5061 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 | |
5062 | $as_echo "none needed" >&6; } ;; | |
5063 | xno) | |
5064 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 | |
5065 | $as_echo "unsupported" >&6; } ;; | |
5066 | *) | |
5067 | ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c99" | |
5068 | CC=$CC$ac_prog_cc_stdc_options | |
5069 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 | |
5070 | $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; | |
5071 | esac | |
5072 | if test "x$ac_cv_prog_cc_c99" != xno; then : | |
5073 | ac_prog_cc_stdc=c99 | |
5074 | ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 | |
5075 | else | |
5076 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 | |
5077 | $as_echo_n "checking for $CC option to enable C89 features... " >&6; } | |
5078 | if ${ac_cv_prog_cc_c89+:} false; then : | |
d0ac1c44 SM |
5079 | $as_echo_n "(cached) " >&6 |
5080 | else | |
c0c3707f CB |
5081 | ac_cv_prog_cc_c89=no |
5082 | ac_save_CC=$CC | |
5083 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
d0ac1c44 | 5084 | /* end confdefs.h. */ |
c0c3707f CB |
5085 | #include <stdarg.h> |
5086 | #include <stdio.h> | |
5087 | struct stat; | |
5088 | /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ | |
5089 | struct buf { int x; }; | |
5090 | FILE * (*rcsopen) (struct buf *, struct stat *, int); | |
5091 | static char *e (p, i) | |
5092 | char **p; | |
5093 | int i; | |
5094 | { | |
5095 | return p[i]; | |
5096 | } | |
5097 | static char *f (char * (*g) (char **, int), char **p, ...) | |
5098 | { | |
5099 | char *s; | |
5100 | va_list v; | |
5101 | va_start (v,p); | |
5102 | s = g (p, va_arg (v,int)); | |
5103 | va_end (v); | |
5104 | return s; | |
5105 | } | |
5106 | ||
5107 | /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has | |
5108 | function prototypes and stuff, but not '\xHH' hex character constants. | |
5109 | These don't provoke an error unfortunately, instead are silently treated | |
5110 | as 'x'. The following induces an error, until -std is added to get | |
5111 | proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an | |
5112 | array size at least. It's necessary to write '\x00'==0 to get something | |
5113 | that's true only with -std. */ | |
5114 | int osf4_cc_array ['\x00' == 0 ? 1 : -1]; | |
5115 | ||
5116 | /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters | |
5117 | inside strings and character constants. */ | |
5118 | #define FOO(x) 'x' | |
5119 | int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; | |
d0ac1c44 | 5120 | |
c0c3707f CB |
5121 | int test (int i, double x); |
5122 | struct s1 {int (*f) (int a);}; | |
5123 | struct s2 {int (*f) (double a);}; | |
5124 | int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); | |
5125 | int argc; | |
5126 | char **argv; | |
d0ac1c44 SM |
5127 | int |
5128 | main () | |
5129 | { | |
c0c3707f | 5130 | return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; |
d0ac1c44 SM |
5131 | ; |
5132 | return 0; | |
5133 | } | |
5134 | _ACEOF | |
c0c3707f CB |
5135 | for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ |
5136 | -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" | |
5137 | do | |
5138 | CC="$ac_save_CC $ac_arg" | |
5139 | if ac_fn_c_try_compile "$LINENO"; then : | |
5140 | ac_cv_prog_cc_c89=$ac_arg | |
5141 | fi | |
5142 | rm -f core conftest.err conftest.$ac_objext | |
5143 | test "x$ac_cv_prog_cc_c89" != "xno" && break | |
5144 | done | |
5145 | rm -f conftest.$ac_ext | |
5146 | CC=$ac_save_CC | |
5147 | ||
5148 | fi | |
5149 | # AC_CACHE_VAL | |
5150 | ac_prog_cc_stdc_options= | |
5151 | case "x$ac_cv_prog_cc_c89" in | |
5152 | x) | |
5153 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 | |
5154 | $as_echo "none needed" >&6; } ;; | |
5155 | xno) | |
5156 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 | |
5157 | $as_echo "unsupported" >&6; } ;; | |
5158 | *) | |
5159 | ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c89" | |
5160 | CC=$CC$ac_prog_cc_stdc_options | |
5161 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 | |
5162 | $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; | |
5163 | esac | |
5164 | if test "x$ac_cv_prog_cc_c89" != xno; then : | |
5165 | ac_prog_cc_stdc=c89 | |
5166 | ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 | |
5167 | else | |
5168 | ac_prog_cc_stdc=no | |
5169 | ac_cv_prog_cc_stdc=no | |
5170 | fi | |
5171 | ||
5172 | fi | |
5173 | ||
7a6dbc2f | 5174 | fi |
c0c3707f | 5175 | |
d0ac1c44 SM |
5176 | ac_ext=c |
5177 | ac_cpp='$CPP $CPPFLAGS' | |
5178 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
5179 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
5180 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
5181 | ||
5182 | ||
5df4cba6 SM |
5183 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5 |
5184 | $as_echo_n "checking whether the compiler is clang... " >&6; } | |
5185 | if ${gl_cv_compiler_clang+:} false; then : | |
5186 | $as_echo_n "(cached) " >&6 | |
5187 | else | |
5188 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5189 | /* end confdefs.h. */ | |
5190 | ||
5191 | #ifdef __clang__ | |
5192 | barfbarf | |
5193 | #endif | |
5194 | ||
5195 | int | |
5196 | main () | |
5197 | { | |
5198 | ||
5199 | ; | |
5200 | return 0; | |
5201 | } | |
5202 | ||
5203 | _ACEOF | |
5204 | if ac_fn_c_try_compile "$LINENO"; then : | |
5205 | gl_cv_compiler_clang=no | |
5206 | else | |
5207 | gl_cv_compiler_clang=yes | |
5208 | fi | |
5209 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5210 | ||
5211 | fi | |
5212 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_clang" >&5 | |
5213 | $as_echo "$gl_cv_compiler_clang" >&6; } | |
5214 | ||
5215 | ||
5216 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler option needed when checking for declarations" >&5 | |
5217 | $as_echo_n "checking for compiler option needed when checking for declarations... " >&6; } | |
5218 | if ${gl_cv_compiler_check_decl_option+:} false; then : | |
5219 | $as_echo_n "(cached) " >&6 | |
5220 | else | |
5221 | if test $gl_cv_compiler_clang = yes; then | |
5222 | save_ac_compile="$ac_compile" | |
5223 | ac_compile="$ac_compile -Werror=implicit-function-declaration" | |
5224 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5225 | /* end confdefs.h. */ | |
5226 | ||
5227 | int | |
5228 | main () | |
5229 | { | |
5230 | ||
5231 | ; | |
5232 | return 0; | |
5233 | } | |
5234 | _ACEOF | |
5235 | if ac_fn_c_try_compile "$LINENO"; then : | |
5236 | gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration' | |
5237 | else | |
5238 | gl_cv_compiler_check_decl_option=none | |
5239 | fi | |
5240 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5241 | ac_compile="$save_ac_compile" | |
5242 | else | |
5243 | gl_cv_compiler_check_decl_option=none | |
5244 | fi | |
5245 | ||
5246 | fi | |
5247 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_check_decl_option" >&5 | |
5248 | $as_echo "$gl_cv_compiler_check_decl_option" >&6; } | |
5249 | if test "x$gl_cv_compiler_check_decl_option" != xnone; then | |
5250 | ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option" | |
5251 | else | |
5252 | ac_compile_for_check_decl="$ac_compile" | |
5253 | fi | |
5254 | ||
5255 | ||
5256 | ||
9c9d63b1 | 5257 | |
c971b7fa PA |
5258 | ac_ext=c |
5259 | ac_cpp='$CPP $CPPFLAGS' | |
5260 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
5261 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
5262 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
5263 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 | |
5264 | $as_echo_n "checking how to run the C preprocessor... " >&6; } | |
5265 | # On Suns, sometimes $CPP names a directory. | |
5266 | if test -n "$CPP" && test -d "$CPP"; then | |
5267 | CPP= | |
5268 | fi | |
5269 | if test -z "$CPP"; then | |
d0ac1c44 | 5270 | if ${ac_cv_prog_CPP+:} false; then : |
c971b7fa PA |
5271 | $as_echo_n "(cached) " >&6 |
5272 | else | |
5273 | # Double quotes because CPP needs to be expanded | |
5274 | for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" | |
5275 | do | |
5276 | ac_preproc_ok=false | |
5277 | for ac_c_preproc_warn_flag in '' yes | |
5278 | do | |
5279 | # Use a header file that comes with gcc, so configuring glibc | |
5280 | # with a fresh cross-compiler works. | |
5281 | # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since | |
5282 | # <limits.h> exists even on freestanding compilers. | |
5283 | # On the NeXT, cc -E runs the code through the compiler's parser, | |
5284 | # not just through cpp. "Syntax error" is here to catch this case. | |
5285 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5286 | /* end confdefs.h. */ | |
5287 | #ifdef __STDC__ | |
5288 | # include <limits.h> | |
5289 | #else | |
5290 | # include <assert.h> | |
5291 | #endif | |
5292 | Syntax error | |
5293 | _ACEOF | |
5294 | if ac_fn_c_try_cpp "$LINENO"; then : | |
5295 | ||
5296 | else | |
5297 | # Broken: fails on valid input. | |
5298 | continue | |
5299 | fi | |
d0ac1c44 | 5300 | rm -f conftest.err conftest.i conftest.$ac_ext |
c971b7fa PA |
5301 | |
5302 | # OK, works on sane cases. Now check whether nonexistent headers | |
5303 | # can be detected and how. | |
5304 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5305 | /* end confdefs.h. */ | |
5306 | #include <ac_nonexistent.h> | |
5307 | _ACEOF | |
5308 | if ac_fn_c_try_cpp "$LINENO"; then : | |
5309 | # Broken: success on invalid input. | |
5310 | continue | |
5311 | else | |
5312 | # Passes both tests. | |
5313 | ac_preproc_ok=: | |
5314 | break | |
5315 | fi | |
d0ac1c44 | 5316 | rm -f conftest.err conftest.i conftest.$ac_ext |
c971b7fa PA |
5317 | |
5318 | done | |
5319 | # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. | |
d0ac1c44 | 5320 | rm -f conftest.i conftest.err conftest.$ac_ext |
c971b7fa PA |
5321 | if $ac_preproc_ok; then : |
5322 | break | |
5323 | fi | |
5324 | ||
5325 | done | |
5326 | ac_cv_prog_CPP=$CPP | |
5327 | ||
5328 | fi | |
5329 | CPP=$ac_cv_prog_CPP | |
5330 | else | |
5331 | ac_cv_prog_CPP=$CPP | |
5332 | fi | |
5333 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 | |
5334 | $as_echo "$CPP" >&6; } | |
5335 | ac_preproc_ok=false | |
5336 | for ac_c_preproc_warn_flag in '' yes | |
5337 | do | |
5338 | # Use a header file that comes with gcc, so configuring glibc | |
5339 | # with a fresh cross-compiler works. | |
5340 | # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since | |
5341 | # <limits.h> exists even on freestanding compilers. | |
5342 | # On the NeXT, cc -E runs the code through the compiler's parser, | |
5343 | # not just through cpp. "Syntax error" is here to catch this case. | |
5344 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5345 | /* end confdefs.h. */ | |
5346 | #ifdef __STDC__ | |
5347 | # include <limits.h> | |
5348 | #else | |
5349 | # include <assert.h> | |
5350 | #endif | |
5351 | Syntax error | |
5352 | _ACEOF | |
5353 | if ac_fn_c_try_cpp "$LINENO"; then : | |
5354 | ||
5355 | else | |
5356 | # Broken: fails on valid input. | |
5357 | continue | |
5358 | fi | |
d0ac1c44 | 5359 | rm -f conftest.err conftest.i conftest.$ac_ext |
c971b7fa PA |
5360 | |
5361 | # OK, works on sane cases. Now check whether nonexistent headers | |
5362 | # can be detected and how. | |
5363 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5364 | /* end confdefs.h. */ | |
5365 | #include <ac_nonexistent.h> | |
5366 | _ACEOF | |
5367 | if ac_fn_c_try_cpp "$LINENO"; then : | |
5368 | # Broken: success on invalid input. | |
5369 | continue | |
5370 | else | |
5371 | # Passes both tests. | |
5372 | ac_preproc_ok=: | |
5373 | break | |
5374 | fi | |
d0ac1c44 | 5375 | rm -f conftest.err conftest.i conftest.$ac_ext |
c971b7fa PA |
5376 | |
5377 | done | |
5378 | # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. | |
d0ac1c44 | 5379 | rm -f conftest.i conftest.err conftest.$ac_ext |
c971b7fa PA |
5380 | if $ac_preproc_ok; then : |
5381 | ||
5382 | else | |
5383 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
5384 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
d0ac1c44 SM |
5385 | as_fn_error $? "C preprocessor \"$CPP\" fails sanity check |
5386 | See \`config.log' for more details" "$LINENO" 5; } | |
c971b7fa PA |
5387 | fi |
5388 | ||
5389 | ac_ext=c | |
5390 | ac_cpp='$CPP $CPPFLAGS' | |
5391 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
5392 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
5393 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
5394 | ||
5395 | ||
5396 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 | |
5397 | $as_echo_n "checking for grep that handles long lines and -e... " >&6; } | |
d0ac1c44 | 5398 | if ${ac_cv_path_GREP+:} false; then : |
c971b7fa PA |
5399 | $as_echo_n "(cached) " >&6 |
5400 | else | |
5401 | if test -z "$GREP"; then | |
5402 | ac_path_GREP_found=false | |
5403 | # Loop through the user's path and test for each of PROGNAME-LIST | |
5404 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
5405 | for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin | |
5406 | do | |
5407 | IFS=$as_save_IFS | |
5408 | test -z "$as_dir" && as_dir=. | |
5409 | for ac_prog in grep ggrep; do | |
5410 | for ac_exec_ext in '' $ac_executable_extensions; do | |
5411 | ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" | |
d0ac1c44 | 5412 | as_fn_executable_p "$ac_path_GREP" || continue |
c971b7fa PA |
5413 | # Check for GNU ac_path_GREP and select it if it is found. |
5414 | # Check for GNU $ac_path_GREP | |
5415 | case `"$ac_path_GREP" --version 2>&1` in | |
5416 | *GNU*) | |
5417 | ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; | |
5418 | *) | |
5419 | ac_count=0 | |
5420 | $as_echo_n 0123456789 >"conftest.in" | |
5421 | while : | |
5422 | do | |
5423 | cat "conftest.in" "conftest.in" >"conftest.tmp" | |
5424 | mv "conftest.tmp" "conftest.in" | |
5425 | cp "conftest.in" "conftest.nl" | |
5426 | $as_echo 'GREP' >> "conftest.nl" | |
5427 | "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break | |
5428 | diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break | |
5429 | as_fn_arith $ac_count + 1 && ac_count=$as_val | |
5430 | if test $ac_count -gt ${ac_path_GREP_max-0}; then | |
5431 | # Best one so far, save it but keep looking for a better one | |
5432 | ac_cv_path_GREP="$ac_path_GREP" | |
5433 | ac_path_GREP_max=$ac_count | |
5434 | fi | |
5435 | # 10*(2^10) chars as input seems more than enough | |
5436 | test $ac_count -gt 10 && break | |
5437 | done | |
5438 | rm -f conftest.in conftest.tmp conftest.nl conftest.out;; | |
5439 | esac | |
5440 | ||
5441 | $ac_path_GREP_found && break 3 | |
5442 | done | |
5443 | done | |
5444 | done | |
5445 | IFS=$as_save_IFS | |
5446 | if test -z "$ac_cv_path_GREP"; then | |
d0ac1c44 | 5447 | as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 |
c971b7fa PA |
5448 | fi |
5449 | else | |
5450 | ac_cv_path_GREP=$GREP | |
5451 | fi | |
5452 | ||
5453 | fi | |
5454 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 | |
5455 | $as_echo "$ac_cv_path_GREP" >&6; } | |
5456 | GREP="$ac_cv_path_GREP" | |
5457 | ||
5458 | ||
5459 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 | |
5460 | $as_echo_n "checking for egrep... " >&6; } | |
d0ac1c44 | 5461 | if ${ac_cv_path_EGREP+:} false; then : |
c971b7fa PA |
5462 | $as_echo_n "(cached) " >&6 |
5463 | else | |
5464 | if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 | |
5465 | then ac_cv_path_EGREP="$GREP -E" | |
5466 | else | |
5467 | if test -z "$EGREP"; then | |
5468 | ac_path_EGREP_found=false | |
5469 | # Loop through the user's path and test for each of PROGNAME-LIST | |
5470 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
5471 | for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin | |
5472 | do | |
5473 | IFS=$as_save_IFS | |
5474 | test -z "$as_dir" && as_dir=. | |
5475 | for ac_prog in egrep; do | |
5476 | for ac_exec_ext in '' $ac_executable_extensions; do | |
5477 | ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" | |
d0ac1c44 | 5478 | as_fn_executable_p "$ac_path_EGREP" || continue |
c971b7fa PA |
5479 | # Check for GNU ac_path_EGREP and select it if it is found. |
5480 | # Check for GNU $ac_path_EGREP | |
5481 | case `"$ac_path_EGREP" --version 2>&1` in | |
5482 | *GNU*) | |
5483 | ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; | |
5484 | *) | |
5485 | ac_count=0 | |
5486 | $as_echo_n 0123456789 >"conftest.in" | |
5487 | while : | |
5488 | do | |
5489 | cat "conftest.in" "conftest.in" >"conftest.tmp" | |
5490 | mv "conftest.tmp" "conftest.in" | |
5491 | cp "conftest.in" "conftest.nl" | |
5492 | $as_echo 'EGREP' >> "conftest.nl" | |
5493 | "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break | |
5494 | diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break | |
5495 | as_fn_arith $ac_count + 1 && ac_count=$as_val | |
5496 | if test $ac_count -gt ${ac_path_EGREP_max-0}; then | |
5497 | # Best one so far, save it but keep looking for a better one | |
5498 | ac_cv_path_EGREP="$ac_path_EGREP" | |
5499 | ac_path_EGREP_max=$ac_count | |
5500 | fi | |
5501 | # 10*(2^10) chars as input seems more than enough | |
5502 | test $ac_count -gt 10 && break | |
5503 | done | |
5504 | rm -f conftest.in conftest.tmp conftest.nl conftest.out;; | |
5505 | esac | |
5506 | ||
5507 | $ac_path_EGREP_found && break 3 | |
5508 | done | |
5509 | done | |
5510 | done | |
5511 | IFS=$as_save_IFS | |
5512 | if test -z "$ac_cv_path_EGREP"; then | |
d0ac1c44 | 5513 | as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 |
c971b7fa PA |
5514 | fi |
5515 | else | |
5516 | ac_cv_path_EGREP=$EGREP | |
5517 | fi | |
5518 | ||
5519 | fi | |
5520 | fi | |
5521 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 | |
5522 | $as_echo "$ac_cv_path_EGREP" >&6; } | |
5523 | EGREP="$ac_cv_path_EGREP" | |
5524 | ||
5525 | ||
5526 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 | |
5527 | $as_echo_n "checking for ANSI C header files... " >&6; } | |
d0ac1c44 | 5528 | if ${ac_cv_header_stdc+:} false; then : |
c971b7fa PA |
5529 | $as_echo_n "(cached) " >&6 |
5530 | else | |
5531 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5532 | /* end confdefs.h. */ | |
5533 | #include <stdlib.h> | |
5534 | #include <stdarg.h> | |
5535 | #include <string.h> | |
5536 | #include <float.h> | |
5537 | ||
5538 | int | |
5539 | main () | |
5540 | { | |
5541 | ||
5542 | ; | |
5543 | return 0; | |
5544 | } | |
5545 | _ACEOF | |
5546 | if ac_fn_c_try_compile "$LINENO"; then : | |
5547 | ac_cv_header_stdc=yes | |
5548 | else | |
5549 | ac_cv_header_stdc=no | |
5550 | fi | |
5551 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5552 | ||
5553 | if test $ac_cv_header_stdc = yes; then | |
5554 | # SunOS 4.x string.h does not declare mem*, contrary to ANSI. | |
5555 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5556 | /* end confdefs.h. */ | |
5557 | #include <string.h> | |
5558 | ||
5559 | _ACEOF | |
5560 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
5561 | $EGREP "memchr" >/dev/null 2>&1; then : | |
5562 | ||
5563 | else | |
5564 | ac_cv_header_stdc=no | |
5565 | fi | |
5566 | rm -f conftest* | |
5567 | ||
5568 | fi | |
5569 | ||
5570 | if test $ac_cv_header_stdc = yes; then | |
5571 | # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. | |
5572 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5573 | /* end confdefs.h. */ | |
5574 | #include <stdlib.h> | |
5575 | ||
5576 | _ACEOF | |
5577 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
5578 | $EGREP "free" >/dev/null 2>&1; then : | |
5579 | ||
5580 | else | |
5581 | ac_cv_header_stdc=no | |
5582 | fi | |
5583 | rm -f conftest* | |
5584 | ||
5585 | fi | |
5586 | ||
5587 | if test $ac_cv_header_stdc = yes; then | |
5588 | # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. | |
5589 | if test "$cross_compiling" = yes; then : | |
5590 | : | |
5591 | else | |
5592 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5593 | /* end confdefs.h. */ | |
5594 | #include <ctype.h> | |
5595 | #include <stdlib.h> | |
5596 | #if ((' ' & 0x0FF) == 0x020) | |
5597 | # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') | |
5598 | # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) | |
5599 | #else | |
5600 | # define ISLOWER(c) \ | |
5601 | (('a' <= (c) && (c) <= 'i') \ | |
5602 | || ('j' <= (c) && (c) <= 'r') \ | |
5603 | || ('s' <= (c) && (c) <= 'z')) | |
5604 | # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) | |
5605 | #endif | |
5606 | ||
5607 | #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) | |
5608 | int | |
5609 | main () | |
5610 | { | |
5611 | int i; | |
5612 | for (i = 0; i < 256; i++) | |
5613 | if (XOR (islower (i), ISLOWER (i)) | |
5614 | || toupper (i) != TOUPPER (i)) | |
5615 | return 2; | |
5616 | return 0; | |
5617 | } | |
5618 | _ACEOF | |
5619 | if ac_fn_c_try_run "$LINENO"; then : | |
5620 | ||
5621 | else | |
5622 | ac_cv_header_stdc=no | |
5623 | fi | |
5624 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
5625 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
5626 | fi | |
5627 | ||
5628 | fi | |
5629 | fi | |
5630 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 | |
5631 | $as_echo "$ac_cv_header_stdc" >&6; } | |
5632 | if test $ac_cv_header_stdc = yes; then | |
5633 | ||
5634 | $as_echo "#define STDC_HEADERS 1" >>confdefs.h | |
5635 | ||
5636 | fi | |
5637 | ||
5638 | # On IRIX 5.3, sys/types and inttypes.h are conflicting. | |
5639 | for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ | |
5640 | inttypes.h stdint.h unistd.h | |
5641 | do : | |
5642 | as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` | |
5643 | ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default | |
5644 | " | |
d0ac1c44 | 5645 | if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : |
c971b7fa PA |
5646 | cat >>confdefs.h <<_ACEOF |
5647 | #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 | |
5648 | _ACEOF | |
5649 | ||
5650 | fi | |
5651 | ||
5652 | done | |
5653 | ||
5654 | ||
5655 | ||
c971b7fa PA |
5656 | |
5657 | ||
9c9d63b1 PM |
5658 | for ac_header in $ac_header_list |
5659 | do : | |
5660 | as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` | |
5661 | ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default | |
5662 | " | |
5663 | if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : | |
5664 | cat >>confdefs.h <<_ACEOF | |
5665 | #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 | |
5666 | _ACEOF | |
c971b7fa | 5667 | |
9c9d63b1 PM |
5668 | fi |
5669 | ||
5670 | done | |
c971b7fa PA |
5671 | |
5672 | ||
c971b7fa PA |
5673 | |
5674 | ||
c971b7fa | 5675 | |
c971b7fa | 5676 | |
c971b7fa | 5677 | |
c971b7fa PA |
5678 | |
5679 | ||
5680 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 | |
5681 | $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } | |
d0ac1c44 | 5682 | if ${ac_cv_safe_to_define___extensions__+:} false; then : |
c971b7fa PA |
5683 | $as_echo_n "(cached) " >&6 |
5684 | else | |
5685 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5686 | /* end confdefs.h. */ | |
5687 | ||
5688 | # define __EXTENSIONS__ 1 | |
5689 | $ac_includes_default | |
5690 | int | |
5691 | main () | |
5692 | { | |
5693 | ||
5694 | ; | |
5695 | return 0; | |
5696 | } | |
5697 | _ACEOF | |
5698 | if ac_fn_c_try_compile "$LINENO"; then : | |
5699 | ac_cv_safe_to_define___extensions__=yes | |
5700 | else | |
5701 | ac_cv_safe_to_define___extensions__=no | |
5702 | fi | |
5703 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5704 | fi | |
5705 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 | |
5706 | $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } | |
c971b7fa | 5707 | |
4a626d0a PA |
5708 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 |
5709 | $as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; } | |
d0ac1c44 | 5710 | if ${ac_cv_should_define__xopen_source+:} false; then : |
4a626d0a PA |
5711 | $as_echo_n "(cached) " >&6 |
5712 | else | |
5713 | ac_cv_should_define__xopen_source=no | |
9c9d63b1 PM |
5714 | if test $ac_cv_header_wchar_h = yes; then : |
5715 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4a626d0a PA |
5716 | /* end confdefs.h. */ |
5717 | ||
5718 | #include <wchar.h> | |
5719 | mbstate_t x; | |
5720 | int | |
5721 | main () | |
5722 | { | |
5723 | ||
5724 | ; | |
5725 | return 0; | |
5726 | } | |
5727 | _ACEOF | |
5728 | if ac_fn_c_try_compile "$LINENO"; then : | |
5729 | ||
5730 | else | |
5731 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5732 | /* end confdefs.h. */ | |
5733 | ||
9c9d63b1 PM |
5734 | #define _XOPEN_SOURCE 500 |
5735 | #include <wchar.h> | |
5736 | mbstate_t x; | |
4a626d0a PA |
5737 | int |
5738 | main () | |
5739 | { | |
5740 | ||
5741 | ; | |
5742 | return 0; | |
5743 | } | |
5744 | _ACEOF | |
5745 | if ac_fn_c_try_compile "$LINENO"; then : | |
5746 | ac_cv_should_define__xopen_source=yes | |
5747 | fi | |
d0ac1c44 SM |
5748 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
5749 | fi | |
5750 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5751 | fi | |
9c9d63b1 | 5752 | fi |
d0ac1c44 SM |
5753 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 |
5754 | $as_echo "$ac_cv_should_define__xopen_source" >&6; } | |
9c9d63b1 PM |
5755 | |
5756 | $as_echo "#define _ALL_SOURCE 1" >>confdefs.h | |
5757 | ||
5758 | $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h | |
5759 | ||
5760 | $as_echo "#define _GNU_SOURCE 1" >>confdefs.h | |
d0ac1c44 | 5761 | |
c0c3707f CB |
5762 | $as_echo "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h |
5763 | ||
9c9d63b1 PM |
5764 | $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h |
5765 | ||
5766 | $as_echo "#define _OPENBSD_SOURCE 1" >>confdefs.h | |
5767 | ||
5768 | $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h | |
5769 | ||
5770 | $as_echo "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h | |
5771 | ||
5772 | $as_echo "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h | |
5773 | ||
5774 | $as_echo "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h | |
5775 | ||
5776 | $as_echo "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h | |
5777 | ||
5778 | $as_echo "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h | |
5779 | ||
5780 | $as_echo "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h | |
5781 | ||
5782 | $as_echo "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h | |
5783 | ||
5784 | $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h | |
5785 | ||
5786 | if test $ac_cv_header_minix_config_h = yes; then : | |
5787 | MINIX=yes | |
5788 | $as_echo "#define _MINIX 1" >>confdefs.h | |
5789 | ||
5790 | $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h | |
5791 | ||
5792 | $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h | |
5793 | ||
5794 | else | |
5795 | MINIX= | |
5796 | fi | |
5797 | if test $ac_cv_safe_to_define___extensions__ = yes; then : | |
5798 | $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h | |
5799 | ||
5800 | fi | |
5801 | if test $ac_cv_should_define__xopen_source = yes; then : | |
5802 | $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h | |
5803 | ||
5804 | fi | |
d0ac1c44 | 5805 | |
c8693053 RO |
5806 | # Needs to run before gl_EARLY so it can override AC_SYS_LARGEFILE included |
5807 | # there. | |
c0c3707f CB |
5808 | ac_aux_dir= |
5809 | for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do | |
5810 | if test -f "$ac_dir/install-sh"; then | |
5811 | ac_aux_dir=$ac_dir | |
5812 | ac_install_sh="$ac_aux_dir/install-sh -c" | |
5813 | break | |
5814 | elif test -f "$ac_dir/install.sh"; then | |
5815 | ac_aux_dir=$ac_dir | |
5816 | ac_install_sh="$ac_aux_dir/install.sh -c" | |
5817 | break | |
5818 | elif test -f "$ac_dir/shtool"; then | |
5819 | ac_aux_dir=$ac_dir | |
5820 | ac_install_sh="$ac_aux_dir/shtool install -c" | |
5821 | break | |
5822 | fi | |
5823 | done | |
5824 | if test -z "$ac_aux_dir"; then | |
5825 | as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 | |
5826 | fi | |
5827 | ||
5828 | # These three variables are undocumented and unsupported, | |
5829 | # and are intended to be withdrawn in a future Autoconf release. | |
5830 | # They can cause serious problems if a builder's source tree is in a directory | |
5831 | # whose full name contains unusual characters. | |
5832 | ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. | |
5833 | ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. | |
5834 | ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. | |
5835 | ||
5836 | ||
4a626d0a PA |
5837 | # Make sure we can run config.sub. |
5838 | $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || | |
d0ac1c44 | 5839 | as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 |
4a626d0a PA |
5840 | |
5841 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 | |
5842 | $as_echo_n "checking build system type... " >&6; } | |
d0ac1c44 | 5843 | if ${ac_cv_build+:} false; then : |
4a626d0a PA |
5844 | $as_echo_n "(cached) " >&6 |
5845 | else | |
5846 | ac_build_alias=$build_alias | |
5847 | test "x$ac_build_alias" = x && | |
5848 | ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` | |
5849 | test "x$ac_build_alias" = x && | |
d0ac1c44 | 5850 | as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 |
4a626d0a | 5851 | ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || |
d0ac1c44 | 5852 | as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 |
4a626d0a PA |
5853 | |
5854 | fi | |
5855 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 | |
5856 | $as_echo "$ac_cv_build" >&6; } | |
5857 | case $ac_cv_build in | |
5858 | *-*-*) ;; | |
d0ac1c44 | 5859 | *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; |
4a626d0a PA |
5860 | esac |
5861 | build=$ac_cv_build | |
5862 | ac_save_IFS=$IFS; IFS='-' | |
5863 | set x $ac_cv_build | |
5864 | shift | |
5865 | build_cpu=$1 | |
5866 | build_vendor=$2 | |
5867 | shift; shift | |
5868 | # Remember, the first character of IFS is used to create $*, | |
5869 | # except with old shells: | |
5870 | build_os=$* | |
5871 | IFS=$ac_save_IFS | |
5872 | case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac | |
5873 | ||
5874 | ||
5875 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 | |
5876 | $as_echo_n "checking host system type... " >&6; } | |
d0ac1c44 | 5877 | if ${ac_cv_host+:} false; then : |
4a626d0a PA |
5878 | $as_echo_n "(cached) " >&6 |
5879 | else | |
5880 | if test "x$host_alias" = x; then | |
5881 | ac_cv_host=$ac_cv_build | |
5882 | else | |
5883 | ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || | |
d0ac1c44 | 5884 | as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 |
4a626d0a PA |
5885 | fi |
5886 | ||
5887 | fi | |
5888 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 | |
5889 | $as_echo "$ac_cv_host" >&6; } | |
5890 | case $ac_cv_host in | |
5891 | *-*-*) ;; | |
d0ac1c44 | 5892 | *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; |
4a626d0a PA |
5893 | esac |
5894 | host=$ac_cv_host | |
5895 | ac_save_IFS=$IFS; IFS='-' | |
5896 | set x $ac_cv_host | |
5897 | shift | |
5898 | host_cpu=$1 | |
5899 | host_vendor=$2 | |
5900 | shift; shift | |
5901 | # Remember, the first character of IFS is used to create $*, | |
5902 | # except with old shells: | |
5903 | host_os=$* | |
5904 | IFS=$ac_save_IFS | |
5905 | case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac | |
5906 | ||
5907 | ||
c8693053 RO |
5908 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 |
5909 | $as_echo_n "checking target system type... " >&6; } | |
5910 | if ${ac_cv_target+:} false; then : | |
5911 | $as_echo_n "(cached) " >&6 | |
5912 | else | |
5913 | if test "x$target_alias" = x; then | |
5914 | ac_cv_target=$ac_cv_host | |
5915 | else | |
5916 | ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || | |
5917 | as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 | |
5918 | fi | |
c971b7fa | 5919 | |
c8693053 RO |
5920 | fi |
5921 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 | |
5922 | $as_echo "$ac_cv_target" >&6; } | |
5923 | case $ac_cv_target in | |
5924 | *-*-*) ;; | |
5925 | *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; | |
5926 | esac | |
5927 | target=$ac_cv_target | |
5928 | ac_save_IFS=$IFS; IFS='-' | |
5929 | set x $ac_cv_target | |
5930 | shift | |
5931 | target_cpu=$1 | |
5932 | target_vendor=$2 | |
5933 | shift; shift | |
5934 | # Remember, the first character of IFS is used to create $*, | |
5935 | # except with old shells: | |
5936 | target_os=$* | |
5937 | IFS=$ac_save_IFS | |
5938 | case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac | |
c971b7fa | 5939 | |
88b48903 | 5940 | |
c8693053 RO |
5941 | # The aliases save the names the user supplied, while $host etc. |
5942 | # will get canonicalized. | |
5943 | test -n "$target_alias" && | |
5944 | test "$program_prefix$program_suffix$program_transform_name" = \ | |
5945 | NONENONEs,x,x, && | |
5946 | program_prefix=${target_alias}- | |
5947 | ||
5948 | # The tests for host and target for $enable_largefile require | |
5949 | # canonical names. | |
5950 | ||
5951 | ||
5952 | ||
5953 | # As the $enable_largefile decision depends on --enable-plugins we must set it | |
5954 | # even in directories otherwise not depending on the $plugins option. | |
5955 | ||
5956 | ||
5957 | maybe_plugins=no | |
5958 | for ac_header in dlfcn.h | |
5959 | do : | |
5960 | ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default | |
5961 | " | |
5962 | if test "x$ac_cv_header_dlfcn_h" = xyes; then : | |
5963 | cat >>confdefs.h <<_ACEOF | |
5964 | #define HAVE_DLFCN_H 1 | |
5965 | _ACEOF | |
5966 | maybe_plugins=yes | |
5967 | fi | |
5968 | ||
5969 | done | |
5970 | ||
5971 | for ac_header in windows.h | |
5972 | do : | |
5973 | ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default | |
5974 | " | |
5975 | if test "x$ac_cv_header_windows_h" = xyes; then : | |
5976 | cat >>confdefs.h <<_ACEOF | |
5977 | #define HAVE_WINDOWS_H 1 | |
5978 | _ACEOF | |
5979 | maybe_plugins=yes | |
5980 | fi | |
5981 | ||
5982 | done | |
5983 | ||
5984 | ||
5985 | # Check whether --enable-plugins was given. | |
5986 | if test "${enable_plugins+set}" = set; then : | |
5987 | enableval=$enable_plugins; case "${enableval}" in | |
5988 | no) plugins=no ;; | |
5989 | *) plugins=yes | |
5990 | if test "$maybe_plugins" != "yes" ; then | |
5991 | as_fn_error $? "Building with plugin support requires a host that supports dlopen." "$LINENO" 5 | |
5992 | fi ;; | |
5993 | esac | |
5994 | else | |
5995 | plugins=$maybe_plugins | |
5996 | ||
5997 | fi | |
5998 | ||
5999 | if test "$plugins" = "yes"; then | |
6000 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlsym" >&5 | |
6001 | $as_echo_n "checking for library containing dlsym... " >&6; } | |
6002 | if ${ac_cv_search_dlsym+:} false; then : | |
6003 | $as_echo_n "(cached) " >&6 | |
6004 | else | |
6005 | ac_func_search_save_LIBS=$LIBS | |
6006 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6007 | /* end confdefs.h. */ | |
6008 | ||
6009 | /* Override any GCC internal prototype to avoid an error. | |
6010 | Use char because int might match the return type of a GCC | |
6011 | builtin and then its argument prototype would still apply. */ | |
6012 | #ifdef __cplusplus | |
6013 | extern "C" | |
6014 | #endif | |
6015 | char dlsym (); | |
6016 | int | |
6017 | main () | |
6018 | { | |
6019 | return dlsym (); | |
6020 | ; | |
6021 | return 0; | |
6022 | } | |
6023 | _ACEOF | |
6024 | for ac_lib in '' dl; do | |
6025 | if test -z "$ac_lib"; then | |
6026 | ac_res="none required" | |
6027 | else | |
6028 | ac_res=-l$ac_lib | |
6029 | LIBS="-l$ac_lib $ac_func_search_save_LIBS" | |
6030 | fi | |
6031 | if ac_fn_c_try_link "$LINENO"; then : | |
6032 | ac_cv_search_dlsym=$ac_res | |
6033 | fi | |
6034 | rm -f core conftest.err conftest.$ac_objext \ | |
6035 | conftest$ac_exeext | |
6036 | if ${ac_cv_search_dlsym+:} false; then : | |
6037 | break | |
6038 | fi | |
6039 | done | |
6040 | if ${ac_cv_search_dlsym+:} false; then : | |
6041 | ||
6042 | else | |
6043 | ac_cv_search_dlsym=no | |
6044 | fi | |
6045 | rm conftest.$ac_ext | |
6046 | LIBS=$ac_func_search_save_LIBS | |
6047 | fi | |
6048 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlsym" >&5 | |
6049 | $as_echo "$ac_cv_search_dlsym" >&6; } | |
6050 | ac_res=$ac_cv_search_dlsym | |
6051 | if test "$ac_res" != no; then : | |
6052 | test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" | |
6053 | ||
6054 | fi | |
6055 | ||
6056 | fi | |
6057 | ||
6058 | ||
6059 | case "${host}" in | |
6060 | sparc-*-solaris*|i?86-*-solaris*) | |
6061 | # On native 32-bit Solaris/SPARC and x86, large-file and procfs support | |
6062 | # were mutually exclusive until Solaris 11.3. Without procfs support, | |
6063 | # the bfd/ elf module cannot provide certain routines such as | |
6064 | # elfcore_write_prpsinfo or elfcore_write_prstatus. So unless the user | |
6065 | # explicitly requested large-file support through the | |
6066 | # --enable-largefile switch, disable large-file support in favor of | |
6067 | # procfs support. | |
6068 | # | |
6069 | # Check if <sys/procfs.h> is incompatible with large-file support. | |
6070 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6071 | /* end confdefs.h. */ | |
6072 | #define _FILE_OFFSET_BITS 64 | |
6073 | #define _STRUCTURED_PROC 1 | |
6074 | #include <sys/procfs.h> | |
6075 | int | |
6076 | main () | |
6077 | { | |
6078 | ||
6079 | ; | |
6080 | return 0; | |
6081 | } | |
6082 | _ACEOF | |
6083 | if ac_fn_c_try_compile "$LINENO"; then : | |
6084 | acx_cv_procfs_lfs=yes | |
6085 | else | |
6086 | acx_cv_procfs_lfs=no | |
6087 | fi | |
6088 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6089 | # | |
6090 | # Forcefully disable large-file support only if necessary, gdb is in | |
6091 | # tree and enabled. | |
6092 | if test "${target}" = "${host}" -a "$acx_cv_procfs_lfs" = no \ | |
6093 | -a -d $srcdir/../gdb -a "$enable_gdb" != no; then | |
6094 | : ${enable_largefile="no"} | |
6095 | if test "$plugins" = yes; then | |
6096 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: | |
6097 | plugin support disabled; require large-file support which is incompatible with GDB." >&5 | |
6098 | $as_echo "$as_me: WARNING: | |
6099 | plugin support disabled; require large-file support which is incompatible with GDB." >&2;} | |
6100 | plugins=no | |
88b48903 | 6101 | fi |
c8693053 RO |
6102 | fi |
6103 | # | |
6104 | # Explicitly undef _FILE_OFFSET_BITS if enable_largefile=no for the | |
6105 | # benefit of g++ 9+ which predefines it on Solaris. | |
6106 | if test "$enable_largefile" = no; then | |
6107 | LARGEFILE_CPPFLAGS="-U_FILE_OFFSET_BITS" | |
6108 | ||
6109 | fi | |
6110 | ;; | |
6111 | esac | |
88b48903 | 6112 | |
2196f55f YQ |
6113 | # Check whether --enable-largefile was given. |
6114 | if test "${enable_largefile+set}" = set; then : | |
6115 | enableval=$enable_largefile; | |
6116 | fi | |
6117 | ||
6118 | if test "$enable_largefile" != no; then | |
6119 | ||
6120 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 | |
6121 | $as_echo_n "checking for special C compiler options needed for large files... " >&6; } | |
d0ac1c44 | 6122 | if ${ac_cv_sys_largefile_CC+:} false; then : |
2196f55f YQ |
6123 | $as_echo_n "(cached) " >&6 |
6124 | else | |
6125 | ac_cv_sys_largefile_CC=no | |
6126 | if test "$GCC" != yes; then | |
6127 | ac_save_CC=$CC | |
6128 | while :; do | |
6129 | # IRIX 6.2 and later do not support large files by default, | |
6130 | # so use the C compiler's -n32 option if that helps. | |
6131 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6132 | /* end confdefs.h. */ | |
6133 | #include <sys/types.h> | |
6134 | /* Check that off_t can represent 2**63 - 1 correctly. | |
6135 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | |
6136 | since some C++ compilers masquerading as C compilers | |
6137 | incorrectly reject 9223372036854775807. */ | |
9c9d63b1 | 6138 | #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) |
2196f55f YQ |
6139 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 |
6140 | && LARGE_OFF_T % 2147483647 == 1) | |
6141 | ? 1 : -1]; | |
6142 | int | |
6143 | main () | |
6144 | { | |
6145 | ||
6146 | ; | |
6147 | return 0; | |
6148 | } | |
6149 | _ACEOF | |
6150 | if ac_fn_c_try_compile "$LINENO"; then : | |
6151 | break | |
6152 | fi | |
6153 | rm -f core conftest.err conftest.$ac_objext | |
6154 | CC="$CC -n32" | |
6155 | if ac_fn_c_try_compile "$LINENO"; then : | |
6156 | ac_cv_sys_largefile_CC=' -n32'; break | |
6157 | fi | |
6158 | rm -f core conftest.err conftest.$ac_objext | |
6159 | break | |
6160 | done | |
6161 | CC=$ac_save_CC | |
6162 | rm -f conftest.$ac_ext | |
6163 | fi | |
6164 | fi | |
6165 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 | |
6166 | $as_echo "$ac_cv_sys_largefile_CC" >&6; } | |
6167 | if test "$ac_cv_sys_largefile_CC" != no; then | |
6168 | CC=$CC$ac_cv_sys_largefile_CC | |
6169 | fi | |
6170 | ||
6171 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 | |
6172 | $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } | |
d0ac1c44 | 6173 | if ${ac_cv_sys_file_offset_bits+:} false; then : |
2196f55f YQ |
6174 | $as_echo_n "(cached) " >&6 |
6175 | else | |
6176 | while :; do | |
6177 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6178 | /* end confdefs.h. */ | |
6179 | #include <sys/types.h> | |
6180 | /* Check that off_t can represent 2**63 - 1 correctly. | |
6181 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | |
6182 | since some C++ compilers masquerading as C compilers | |
6183 | incorrectly reject 9223372036854775807. */ | |
9c9d63b1 | 6184 | #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) |
2196f55f YQ |
6185 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 |
6186 | && LARGE_OFF_T % 2147483647 == 1) | |
6187 | ? 1 : -1]; | |
6188 | int | |
6189 | main () | |
6190 | { | |
6191 | ||
6192 | ; | |
6193 | return 0; | |
6194 | } | |
6195 | _ACEOF | |
6196 | if ac_fn_c_try_compile "$LINENO"; then : | |
6197 | ac_cv_sys_file_offset_bits=no; break | |
6198 | fi | |
6199 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6200 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6201 | /* end confdefs.h. */ | |
6202 | #define _FILE_OFFSET_BITS 64 | |
6203 | #include <sys/types.h> | |
6204 | /* Check that off_t can represent 2**63 - 1 correctly. | |
6205 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | |
6206 | since some C++ compilers masquerading as C compilers | |
6207 | incorrectly reject 9223372036854775807. */ | |
9c9d63b1 | 6208 | #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) |
2196f55f YQ |
6209 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 |
6210 | && LARGE_OFF_T % 2147483647 == 1) | |
6211 | ? 1 : -1]; | |
6212 | int | |
6213 | main () | |
6214 | { | |
6215 | ||
6216 | ; | |
6217 | return 0; | |
6218 | } | |
6219 | _ACEOF | |
6220 | if ac_fn_c_try_compile "$LINENO"; then : | |
6221 | ac_cv_sys_file_offset_bits=64; break | |
6222 | fi | |
6223 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6224 | ac_cv_sys_file_offset_bits=unknown | |
6225 | break | |
6226 | done | |
6227 | fi | |
6228 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 | |
6229 | $as_echo "$ac_cv_sys_file_offset_bits" >&6; } | |
6230 | case $ac_cv_sys_file_offset_bits in #( | |
6231 | no | unknown) ;; | |
6232 | *) | |
6233 | cat >>confdefs.h <<_ACEOF | |
6234 | #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits | |
6235 | _ACEOF | |
6236 | ;; | |
6237 | esac | |
6238 | rm -rf conftest* | |
6239 | if test $ac_cv_sys_file_offset_bits = unknown; then | |
6240 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 | |
6241 | $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } | |
d0ac1c44 | 6242 | if ${ac_cv_sys_large_files+:} false; then : |
2196f55f YQ |
6243 | $as_echo_n "(cached) " >&6 |
6244 | else | |
6245 | while :; do | |
6246 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6247 | /* end confdefs.h. */ | |
6248 | #include <sys/types.h> | |
6249 | /* Check that off_t can represent 2**63 - 1 correctly. | |
6250 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | |
6251 | since some C++ compilers masquerading as C compilers | |
6252 | incorrectly reject 9223372036854775807. */ | |
9c9d63b1 | 6253 | #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) |
2196f55f YQ |
6254 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 |
6255 | && LARGE_OFF_T % 2147483647 == 1) | |
6256 | ? 1 : -1]; | |
6257 | int | |
6258 | main () | |
6259 | { | |
6260 | ||
6261 | ; | |
6262 | return 0; | |
6263 | } | |
6264 | _ACEOF | |
6265 | if ac_fn_c_try_compile "$LINENO"; then : | |
6266 | ac_cv_sys_large_files=no; break | |
6267 | fi | |
6268 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6269 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6270 | /* end confdefs.h. */ | |
6271 | #define _LARGE_FILES 1 | |
6272 | #include <sys/types.h> | |
6273 | /* Check that off_t can represent 2**63 - 1 correctly. | |
6274 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | |
6275 | since some C++ compilers masquerading as C compilers | |
6276 | incorrectly reject 9223372036854775807. */ | |
9c9d63b1 | 6277 | #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) |
2196f55f YQ |
6278 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 |
6279 | && LARGE_OFF_T % 2147483647 == 1) | |
6280 | ? 1 : -1]; | |
6281 | int | |
6282 | main () | |
6283 | { | |
6284 | ||
6285 | ; | |
6286 | return 0; | |
6287 | } | |
6288 | _ACEOF | |
6289 | if ac_fn_c_try_compile "$LINENO"; then : | |
6290 | ac_cv_sys_large_files=1; break | |
6291 | fi | |
6292 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6293 | ac_cv_sys_large_files=unknown | |
6294 | break | |
6295 | done | |
6296 | fi | |
6297 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 | |
6298 | $as_echo "$ac_cv_sys_large_files" >&6; } | |
6299 | case $ac_cv_sys_large_files in #( | |
6300 | no | unknown) ;; | |
6301 | *) | |
6302 | cat >>confdefs.h <<_ACEOF | |
6303 | #define _LARGE_FILES $ac_cv_sys_large_files | |
6304 | _ACEOF | |
6305 | ;; | |
6306 | esac | |
6307 | rm -rf conftest* | |
6308 | fi | |
2196f55f YQ |
6309 | fi |
6310 | ||
88b48903 WN |
6311 | |
6312 | ||
5abebf3c CB |
6313 | |
6314 | ||
6315 | ||
9c9d63b1 PM |
6316 | case "$host_os" in |
6317 | openbsd*) | |
6318 | ||
6319 | $as_echo "#define _ISOC11_SOURCE 1" >>confdefs.h | |
c0c3707f | 6320 | |
9c9d63b1 PM |
6321 | ;; |
6322 | esac | |
5abebf3c | 6323 | |
5abebf3c | 6324 | |
c0c3707f CB |
6325 | |
6326 | ||
c8693053 RO |
6327 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5 |
6328 | $as_echo_n "checking for Minix Amsterdam compiler... " >&6; } | |
6329 | if ${gl_cv_c_amsterdam_compiler+:} false; then : | |
6330 | $as_echo_n "(cached) " >&6 | |
6331 | else | |
c0c3707f | 6332 | |
c8693053 RO |
6333 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6334 | /* end confdefs.h. */ | |
5abebf3c | 6335 | |
c8693053 RO |
6336 | #ifdef __ACK__ |
6337 | Amsterdam | |
6338 | #endif | |
5abebf3c | 6339 | |
c8693053 RO |
6340 | _ACEOF |
6341 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
6342 | $EGREP "Amsterdam" >/dev/null 2>&1; then : | |
6343 | gl_cv_c_amsterdam_compiler=yes | |
6344 | else | |
6345 | gl_cv_c_amsterdam_compiler=no | |
6346 | fi | |
6347 | rm -f conftest* | |
5abebf3c CB |
6348 | |
6349 | ||
c8693053 RO |
6350 | fi |
6351 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5 | |
6352 | $as_echo "$gl_cv_c_amsterdam_compiler" >&6; } | |
5abebf3c | 6353 | |
c8693053 RO |
6354 | if test $gl_cv_c_amsterdam_compiler = yes; then |
6355 | if test -z "$AR"; then | |
6356 | AR='cc -c.a' | |
6357 | fi | |
6358 | if test -z "$ARFLAGS"; then | |
6359 | ARFLAGS='-o' | |
6360 | fi | |
6361 | else | |
6362 | : | |
6363 | fi | |
c971b7fa | 6364 | |
c8693053 RO |
6365 | if test -n "$ac_tool_prefix"; then |
6366 | # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. | |
6367 | set dummy ${ac_tool_prefix}ar; ac_word=$2 | |
6368 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
6369 | $as_echo_n "checking for $ac_word... " >&6; } | |
6370 | if ${ac_cv_prog_AR+:} false; then : | |
6371 | $as_echo_n "(cached) " >&6 | |
6372 | else | |
6373 | if test -n "$AR"; then | |
6374 | ac_cv_prog_AR="$AR" # Let the user override the test. | |
6375 | else | |
6376 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
6377 | for as_dir in $PATH | |
6378 | do | |
6379 | IFS=$as_save_IFS | |
6380 | test -z "$as_dir" && as_dir=. | |
6381 | for ac_exec_ext in '' $ac_executable_extensions; do | |
6382 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
6383 | ac_cv_prog_AR="${ac_tool_prefix}ar" | |
6384 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
6385 | break 2 | |
6386 | fi | |
6387 | done | |
6388 | done | |
6389 | IFS=$as_save_IFS | |
c971b7fa | 6390 | |
c8693053 RO |
6391 | fi |
6392 | fi | |
6393 | AR=$ac_cv_prog_AR | |
6394 | if test -n "$AR"; then | |
6395 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 | |
6396 | $as_echo "$AR" >&6; } | |
6397 | else | |
6398 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
6399 | $as_echo "no" >&6; } | |
6400 | fi | |
c971b7fa | 6401 | |
c971b7fa | 6402 | |
c8693053 RO |
6403 | fi |
6404 | if test -z "$ac_cv_prog_AR"; then | |
6405 | ac_ct_AR=$AR | |
6406 | # Extract the first word of "ar", so it can be a program name with args. | |
6407 | set dummy ar; ac_word=$2 | |
6408 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
6409 | $as_echo_n "checking for $ac_word... " >&6; } | |
6410 | if ${ac_cv_prog_ac_ct_AR+:} false; then : | |
c971b7fa PA |
6411 | $as_echo_n "(cached) " >&6 |
6412 | else | |
c8693053 RO |
6413 | if test -n "$ac_ct_AR"; then |
6414 | ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. | |
5e8754f9 | 6415 | else |
c8693053 RO |
6416 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
6417 | for as_dir in $PATH | |
6418 | do | |
6419 | IFS=$as_save_IFS | |
6420 | test -z "$as_dir" && as_dir=. | |
6421 | for ac_exec_ext in '' $ac_executable_extensions; do | |
6422 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
6423 | ac_cv_prog_ac_ct_AR="ar" | |
6424 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
6425 | break 2 | |
6426 | fi | |
6427 | done | |
6428 | done | |
6429 | IFS=$as_save_IFS | |
7a6dbc2f | 6430 | |
c971b7fa | 6431 | fi |
c8693053 RO |
6432 | fi |
6433 | ac_ct_AR=$ac_cv_prog_ac_ct_AR | |
6434 | if test -n "$ac_ct_AR"; then | |
6435 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 | |
6436 | $as_echo "$ac_ct_AR" >&6; } | |
6437 | else | |
6438 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
6439 | $as_echo "no" >&6; } | |
6440 | fi | |
5e8754f9 | 6441 | |
c8693053 RO |
6442 | if test "x$ac_ct_AR" = x; then |
6443 | AR="ar" | |
6444 | else | |
6445 | case $cross_compiling:$ac_tool_warned in | |
6446 | yes:) | |
6447 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
6448 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
6449 | ac_tool_warned=yes ;; | |
6450 | esac | |
6451 | AR=$ac_ct_AR | |
6452 | fi | |
6453 | else | |
6454 | AR="$ac_cv_prog_AR" | |
6455 | fi | |
c0c3707f | 6456 | |
c8693053 RO |
6457 | if test -z "$ARFLAGS"; then |
6458 | ARFLAGS='cr' | |
6459 | fi | |
7a6dbc2f | 6460 | |
7a6dbc2f | 6461 | |
c0c3707f | 6462 | |
c8693053 RO |
6463 | if test -z "$RANLIB"; then |
6464 | if test $gl_cv_c_amsterdam_compiler = yes; then | |
6465 | RANLIB=':' | |
6466 | else | |
6467 | if test -n "$ac_tool_prefix"; then | |
6468 | # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. | |
6469 | set dummy ${ac_tool_prefix}ranlib; ac_word=$2 | |
6470 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
6471 | $as_echo_n "checking for $ac_word... " >&6; } | |
6472 | if ${ac_cv_prog_RANLIB+:} false; then : | |
6473 | $as_echo_n "(cached) " >&6 | |
6474 | else | |
6475 | if test -n "$RANLIB"; then | |
6476 | ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. | |
6477 | else | |
6478 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
6479 | for as_dir in $PATH | |
6480 | do | |
6481 | IFS=$as_save_IFS | |
6482 | test -z "$as_dir" && as_dir=. | |
6483 | for ac_exec_ext in '' $ac_executable_extensions; do | |
6484 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
6485 | ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" | |
6486 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
6487 | break 2 | |
6488 | fi | |
5e8754f9 | 6489 | done |
c8693053 RO |
6490 | done |
6491 | IFS=$as_save_IFS | |
5e8754f9 | 6492 | |
c971b7fa | 6493 | fi |
c8693053 RO |
6494 | fi |
6495 | RANLIB=$ac_cv_prog_RANLIB | |
6496 | if test -n "$RANLIB"; then | |
6497 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 | |
6498 | $as_echo "$RANLIB" >&6; } | |
c0c3707f | 6499 | else |
c8693053 RO |
6500 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
6501 | $as_echo "no" >&6; } | |
5e8754f9 | 6502 | fi |
c0c3707f | 6503 | |
c8693053 RO |
6504 | |
6505 | fi | |
6506 | if test -z "$ac_cv_prog_RANLIB"; then | |
6507 | ac_ct_RANLIB=$RANLIB | |
6508 | # Extract the first word of "ranlib", so it can be a program name with args. | |
6509 | set dummy ranlib; ac_word=$2 | |
6510 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
6511 | $as_echo_n "checking for $ac_word... " >&6; } | |
6512 | if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : | |
c971b7fa PA |
6513 | $as_echo_n "(cached) " >&6 |
6514 | else | |
c8693053 RO |
6515 | if test -n "$ac_ct_RANLIB"; then |
6516 | ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. | |
6517 | else | |
6518 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
6519 | for as_dir in $PATH | |
6520 | do | |
6521 | IFS=$as_save_IFS | |
6522 | test -z "$as_dir" && as_dir=. | |
6523 | for ac_exec_ext in '' $ac_executable_extensions; do | |
6524 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
6525 | ac_cv_prog_ac_ct_RANLIB="ranlib" | |
6526 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
6527 | break 2 | |
5e8754f9 SDJ |
6528 | fi |
6529 | done | |
c8693053 RO |
6530 | done |
6531 | IFS=$as_save_IFS | |
5e8754f9 SDJ |
6532 | |
6533 | fi | |
6534 | fi | |
c8693053 RO |
6535 | ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB |
6536 | if test -n "$ac_ct_RANLIB"; then | |
6537 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 | |
6538 | $as_echo "$ac_ct_RANLIB" >&6; } | |
6539 | else | |
6540 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
6541 | $as_echo "no" >&6; } | |
6542 | fi | |
c0c3707f | 6543 | |
c8693053 RO |
6544 | if test "x$ac_ct_RANLIB" = x; then |
6545 | RANLIB=":" | |
6546 | else | |
6547 | case $cross_compiling:$ac_tool_warned in | |
6548 | yes:) | |
6549 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
6550 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
6551 | ac_tool_warned=yes ;; | |
6552 | esac | |
6553 | RANLIB=$ac_ct_RANLIB | |
6554 | fi | |
6555 | else | |
6556 | RANLIB="$ac_cv_prog_RANLIB" | |
5e8754f9 SDJ |
6557 | fi |
6558 | ||
c8693053 | 6559 | fi |
c0c3707f | 6560 | fi |
5e8754f9 | 6561 | |
5e8754f9 | 6562 | |
5e8754f9 | 6563 | |
5e8754f9 SDJ |
6564 | |
6565 | ||
5e8754f9 | 6566 | |
c8693053 RO |
6567 | # IEEE behaviour is the default on all CPUs except Alpha and SH |
6568 | # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 | |
6569 | # and the GCC 4.1.2 manual). | |
6570 | case "$host_cpu" in | |
6571 | alpha*) | |
6572 | # On Alpha systems, a compiler option provides the behaviour. | |
6573 | # See the ieee(3) manual page, also available at | |
6574 | # <https://backdrift.org/man/tru64/man3/ieee.3.html> | |
6575 | if test -n "$GCC"; then | |
6576 | # GCC has the option -mieee. | |
6577 | # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. | |
6578 | CPPFLAGS="$CPPFLAGS -mieee" | |
6579 | else | |
6580 | # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact. | |
6581 | # For full IEEE compliance (rarely needed), use option -ieee_with_inexact. | |
6582 | CPPFLAGS="$CPPFLAGS -ieee" | |
6583 | fi | |
6584 | ;; | |
6585 | sh*) | |
6586 | if test -n "$GCC"; then | |
6587 | # GCC has the option -mieee. | |
6588 | CPPFLAGS="$CPPFLAGS -mieee" | |
6589 | fi | |
6590 | ;; | |
6591 | esac | |
c0c3707f | 6592 | |
c971b7fa | 6593 | |
c971b7fa | 6594 | |
c8693053 RO |
6595 | |
6596 | ||
6597 | ||
6598 | ||
6599 | # Check whether --enable-threads was given. | |
6600 | if test "${enable_threads+set}" = set; then : | |
6601 | enableval=$enable_threads; gl_use_threads=$enableval | |
5e8754f9 | 6602 | else |
c8693053 RO |
6603 | if test -n "$gl_use_threads_default"; then |
6604 | gl_use_threads="$gl_use_threads_default" | |
6605 | else | |
6606 | case "$host_os" in | |
6607 | osf*) gl_use_threads=no ;; | |
6608 | cygwin*) | |
6609 | case `uname -r` in | |
6610 | 1.[0-5].*) gl_use_threads=no ;; | |
6611 | *) gl_use_threads=yes ;; | |
6612 | esac | |
6613 | ;; | |
6614 | mingw*) | |
6615 | case "$gl_use_winpthreads_default" in | |
6616 | yes) gl_use_threads=posix ;; | |
6617 | no) gl_use_threads=windows ;; | |
6618 | *) gl_use_threads=yes ;; | |
6619 | esac | |
6620 | ;; | |
6621 | *) gl_use_threads=yes ;; | |
6622 | esac | |
6623 | fi | |
c971b7fa | 6624 | |
5e8754f9 | 6625 | fi |
c0c3707f | 6626 | |
c8693053 RO |
6627 | if test "$gl_use_threads" = yes \ |
6628 | || test "$gl_use_threads" = isoc \ | |
6629 | || test "$gl_use_threads" = posix \ | |
6630 | || test "$gl_use_threads" = isoc+posix; then | |
6631 | # For using <threads.h> or <pthread.h>: | |
6632 | ||
6633 | ||
6634 | if test -z "$gl_anythreadlib_early_done"; then | |
6635 | case "$host_os" in | |
6636 | osf*) | |
6637 | # On OSF/1, the compiler needs the flag -D_REENTRANT so that it | |
6638 | # groks <pthread.h>. cc also understands the flag -pthread, but | |
6639 | # we don't use it because 1. gcc-2.95 doesn't understand -pthread, | |
6640 | # 2. putting a flag into CPPFLAGS that has an effect on the linker | |
6641 | # causes the AC_LINK_IFELSE test below to succeed unexpectedly, | |
6642 | # leading to wrong values of LIBTHREAD and LTLIBTHREAD. | |
6643 | CPPFLAGS="$CPPFLAGS -D_REENTRANT" | |
6644 | ;; | |
6645 | esac | |
6646 | # Some systems optimize for single-threaded programs by default, and | |
6647 | # need special flags to disable these optimizations. For example, the | |
6648 | # definition of 'errno' in <errno.h>. | |
6649 | case "$host_os" in | |
6650 | aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;; | |
6651 | solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; | |
6652 | esac | |
6653 | gl_anythreadlib_early_done=done | |
5e8754f9 | 6654 | fi |
c0c3707f | 6655 | |
c8693053 | 6656 | fi |
c0c3707f | 6657 | |
c0c3707f | 6658 | |
c971b7fa | 6659 | |
c8693053 RO |
6660 | # Pre-early section. |
6661 | ||
6662 | ||
6663 | ||
6664 | ||
6665 | # Code from module absolute-header: | |
6666 | # Code from module alloca: | |
6667 | # Code from module alloca-opt: | |
6668 | # Code from module arpa_inet: | |
6669 | # Code from module assure: | |
6670 | # Code from module at-internal: | |
698be2d8 | 6671 | # Code from module attribute: |
9c9d63b1 | 6672 | # Code from module basename-lgpl: |
698be2d8 | 6673 | # Code from module btowc: |
c8693053 RO |
6674 | # Code from module builtin-expect: |
6675 | # Code from module c99: | |
6676 | # Code from module canonicalize-lgpl: | |
6677 | # Code from module chdir: | |
6678 | # Code from module chdir-long: | |
9c9d63b1 | 6679 | # Code from module clock-time: |
c8693053 RO |
6680 | # Code from module cloexec: |
6681 | # Code from module close: | |
6682 | # Code from module closedir: | |
6683 | # Code from module count-one-bits: | |
698be2d8 | 6684 | # Code from module ctype: |
c8693053 RO |
6685 | # Code from module d-ino: |
6686 | # Code from module d-type: | |
6687 | # Code from module dirent: | |
6688 | # Code from module dirfd: | |
6689 | # Code from module dirname-lgpl: | |
c8693053 RO |
6690 | # Code from module double-slash-root: |
6691 | # Code from module dup: | |
6692 | # Code from module dup2: | |
9c9d63b1 | 6693 | # Code from module eloop-threshold: |
c8693053 RO |
6694 | # Code from module environ: |
6695 | # Code from module errno: | |
6696 | # Code from module error: | |
6697 | # Code from module exitfail: | |
6698 | # Code from module extensions: | |
6699 | # Code from module extern-inline: | |
6700 | # Code from module fchdir: | |
6701 | # Code from module fcntl: | |
6702 | # Code from module fcntl-h: | |
6703 | # Code from module fd-hook: | |
6704 | # Code from module fd-safer-flag: | |
6705 | # Code from module fdopendir: | |
6706 | # Code from module filename: | |
6707 | # Code from module filenamecat-lgpl: | |
6708 | # Code from module flexmember: | |
6709 | # Code from module float: | |
6710 | # Code from module fnmatch: | |
6711 | # Code from module fnmatch-gnu: | |
6712 | # Code from module fnmatch-h: | |
6713 | # Code from module fpieee: | |
6714 | ||
6715 | # Code from module fpucw: | |
9c9d63b1 | 6716 | # Code from module free-posix: |
c8693053 RO |
6717 | # Code from module frexp: |
6718 | # Code from module frexpl: | |
6719 | # Code from module fstat: | |
6720 | # Code from module fstatat: | |
6721 | # Code from module getcwd: | |
6722 | # Code from module getcwd-lgpl: | |
6723 | # Code from module getdtablesize: | |
6724 | # Code from module getlogin_r: | |
6725 | # Code from module getprogname: | |
698be2d8 | 6726 | # Code from module getrandom: |
c8693053 RO |
6727 | # Code from module gettext-h: |
6728 | # Code from module gettimeofday: | |
0fa6376c | 6729 | # Code from module gitlog-to-changelog: |
c8693053 RO |
6730 | # Code from module glob: |
6731 | # Code from module glob-h: | |
6732 | # Code from module hard-locale: | |
9c9d63b1 | 6733 | # Code from module idx: |
c8693053 RO |
6734 | # Code from module include_next: |
6735 | # Code from module inet_ntop: | |
6736 | # Code from module intprops: | |
6737 | # Code from module inttypes: | |
6738 | # Code from module inttypes-incomplete: | |
698be2d8 | 6739 | # Code from module isblank: |
c8693053 RO |
6740 | # Code from module isnand-nolibm: |
6741 | # Code from module isnanl-nolibm: | |
6742 | # Code from module largefile: | |
6743 | ||
6744 | # Code from module libc-config: | |
6745 | # Code from module limits-h: | |
6746 | # Code from module localcharset: | |
6747 | # Code from module locale: | |
c8693053 RO |
6748 | # Code from module lock: |
6749 | # Code from module lstat: | |
6750 | # Code from module malloc-posix: | |
6751 | # Code from module malloca: | |
6752 | # Code from module math: | |
6753 | # Code from module mbrtowc: | |
6754 | # Code from module mbsinit: | |
6755 | # Code from module mbsrtowcs: | |
698be2d8 | 6756 | # Code from module mbtowc: |
c8693053 RO |
6757 | # Code from module memchr: |
6758 | # Code from module memmem: | |
6759 | # Code from module memmem-simple: | |
6760 | # Code from module mempcpy: | |
6761 | # Code from module memrchr: | |
698be2d8 | 6762 | # Code from module minmax: |
c8693053 RO |
6763 | # Code from module mkdir: |
6764 | # Code from module mkdtemp: | |
6765 | # Code from module mkostemp: | |
6766 | # Code from module msvc-inval: | |
6767 | # Code from module msvc-nothrow: | |
6768 | # Code from module multiarch: | |
6769 | # Code from module netinet_in: | |
6770 | # Code from module nocrash: | |
6771 | # Code from module open: | |
6772 | # Code from module openat: | |
6773 | # Code from module openat-die: | |
6774 | # Code from module openat-h: | |
6775 | # Code from module opendir: | |
6776 | # Code from module pathmax: | |
9c9d63b1 | 6777 | # Code from module pipe-posix: |
c8693053 RO |
6778 | # Code from module rawmemchr: |
6779 | # Code from module readdir: | |
6780 | # Code from module readlink: | |
6781 | # Code from module realloc-posix: | |
6782 | # Code from module rename: | |
6783 | # Code from module rewinddir: | |
6784 | # Code from module rmdir: | |
6785 | # Code from module same-inode: | |
6786 | # Code from module save-cwd: | |
6787 | # Code from module scratch_buffer: | |
6788 | # Code from module setenv: | |
6789 | # Code from module setlocale-null: | |
6790 | # Code from module signal-h: | |
6791 | # Code from module snippet/_Noreturn: | |
6792 | # Code from module snippet/arg-nonnull: | |
6793 | # Code from module snippet/c++defs: | |
6794 | # Code from module snippet/warn-on-use: | |
6795 | # Code from module socklen: | |
6796 | # Code from module ssize_t: | |
6797 | # Code from module stat: | |
6798 | # Code from module stat-time: | |
6799 | # Code from module std-gnu11: | |
6800 | # Code from module stdalign: | |
6801 | # Code from module stdbool: | |
6802 | # Code from module stddef: | |
6803 | # Code from module stdint: | |
6804 | # Code from module stdio: | |
6805 | # Code from module stdlib: | |
6806 | # Code from module strchrnul: | |
6807 | # Code from module strdup-posix: | |
6808 | # Code from module streq: | |
6809 | # Code from module strerror: | |
6810 | # Code from module strerror-override: | |
6811 | # Code from module strerror_r-posix: | |
6812 | # Code from module string: | |
698be2d8 | 6813 | # Code from module strnlen: |
c8693053 RO |
6814 | # Code from module strnlen1: |
6815 | # Code from module strstr: | |
6816 | # Code from module strstr-simple: | |
6817 | # Code from module strtok_r: | |
698be2d8 | 6818 | # Code from module sys_random: |
c8693053 RO |
6819 | # Code from module sys_socket: |
6820 | # Code from module sys_stat: | |
6821 | # Code from module sys_time: | |
6822 | # Code from module sys_types: | |
6823 | # Code from module sys_uio: | |
6824 | # Code from module tempname: | |
6825 | # Code from module threadlib: | |
6826 | ||
6827 | ||
6828 | ||
6829 | # Code from module time: | |
6830 | # Code from module time_r: | |
6831 | # Code from module unistd: | |
6832 | # Code from module unistd-safer: | |
6833 | # Code from module unsetenv: | |
6834 | # Code from module update-copyright: | |
6835 | # Code from module verify: | |
6836 | # Code from module wchar: | |
6837 | # Code from module wctype-h: | |
6838 | # Code from module windows-mutex: | |
6839 | # Code from module windows-once: | |
6840 | # Code from module windows-recmutex: | |
6841 | # Code from module windows-rwlock: | |
698be2d8 CB |
6842 | # Code from module wmemchr: |
6843 | # Code from module wmempcpy: | |
c8693053 RO |
6844 | # Code from module xalloc-oversized: |
6845 | ||
6846 | ||
6847 | am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc | |
c971b7fa PA |
6848 | |
6849 | ||
c0c3707f CB |
6850 | ac_aux_dir= |
6851 | for ac_dir in .. "$srcdir"/..; do | |
6852 | if test -f "$ac_dir/install-sh"; then | |
6853 | ac_aux_dir=$ac_dir | |
6854 | ac_install_sh="$ac_aux_dir/install-sh -c" | |
6855 | break | |
6856 | elif test -f "$ac_dir/install.sh"; then | |
6857 | ac_aux_dir=$ac_dir | |
6858 | ac_install_sh="$ac_aux_dir/install.sh -c" | |
6859 | break | |
6860 | elif test -f "$ac_dir/shtool"; then | |
6861 | ac_aux_dir=$ac_dir | |
6862 | ac_install_sh="$ac_aux_dir/shtool install -c" | |
6863 | break | |
6864 | fi | |
6865 | done | |
6866 | if test -z "$ac_aux_dir"; then | |
6867 | as_fn_error $? "cannot find install-sh, install.sh, or shtool in .. \"$srcdir\"/.." "$LINENO" 5 | |
6868 | fi | |
6869 | ||
6870 | # These three variables are undocumented and unsupported, | |
6871 | # and are intended to be withdrawn in a future Autoconf release. | |
6872 | # They can cause serious problems if a builder's source tree is in a directory | |
6873 | # whose full name contains unusual characters. | |
6874 | ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. | |
6875 | ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. | |
6876 | ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. | |
6877 | ||
6878 | ||
6879 | ||
6880 | ||
6881 | ||
6882 | ||
6883 | ||
6884 | ||
6885 | ||
6886 | ||
698be2d8 | 6887 | |
9c9d63b1 | 6888 | |
c0c3707f CB |
6889 | # Check whether --enable-cross-guesses was given. |
6890 | if test "${enable_cross_guesses+set}" = set; then : | |
6891 | enableval=$enable_cross_guesses; if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then | |
6892 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-cross-guesses" >&5 | |
6893 | $as_echo "$as_me: WARNING: invalid argument supplied to --enable-cross-guesses" >&2;} | |
6894 | enableval=conservative | |
6895 | fi | |
6896 | gl_cross_guesses="$enableval" | |
6897 | else | |
6898 | gl_cross_guesses=conservative | |
6899 | fi | |
6900 | ||
6901 | if test $gl_cross_guesses = risky; then | |
6902 | gl_cross_guess_normal="guessing yes" | |
6903 | gl_cross_guess_inverted="guessing no" | |
6904 | else | |
6905 | gl_cross_guess_normal="guessing no" | |
6906 | gl_cross_guess_inverted="guessing yes" | |
6907 | fi | |
6908 | LIBC_FATAL_STDERR_=1 | |
6909 | export LIBC_FATAL_STDERR_ | |
6910 | ||
5df4cba6 | 6911 | |
c0c3707f CB |
6912 | ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" |
6913 | if test "x$ac_cv_type_size_t" = xyes; then : | |
6914 | ||
6915 | else | |
6916 | ||
6917 | cat >>confdefs.h <<_ACEOF | |
6918 | #define size_t unsigned int | |
6919 | _ACEOF | |
6920 | ||
6921 | fi | |
6922 | ||
6923 | # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works | |
6924 | # for constant arguments. Useless! | |
6925 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 | |
6926 | $as_echo_n "checking for working alloca.h... " >&6; } | |
6927 | if ${ac_cv_working_alloca_h+:} false; then : | |
6928 | $as_echo_n "(cached) " >&6 | |
6929 | else | |
6930 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6931 | /* end confdefs.h. */ | |
6932 | #include <alloca.h> | |
5e8754f9 SDJ |
6933 | int |
6934 | main () | |
6935 | { | |
c0c3707f CB |
6936 | char *p = (char *) alloca (2 * sizeof (int)); |
6937 | if (p) return 0; | |
5e8754f9 SDJ |
6938 | ; |
6939 | return 0; | |
6940 | } | |
6941 | _ACEOF | |
c0c3707f CB |
6942 | if ac_fn_c_try_link "$LINENO"; then : |
6943 | ac_cv_working_alloca_h=yes | |
6944 | else | |
6945 | ac_cv_working_alloca_h=no | |
5e8754f9 | 6946 | fi |
c0c3707f CB |
6947 | rm -f core conftest.err conftest.$ac_objext \ |
6948 | conftest$ac_exeext conftest.$ac_ext | |
5e8754f9 | 6949 | fi |
c0c3707f CB |
6950 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 |
6951 | $as_echo "$ac_cv_working_alloca_h" >&6; } | |
6952 | if test $ac_cv_working_alloca_h = yes; then | |
c971b7fa | 6953 | |
c0c3707f | 6954 | $as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h |
c971b7fa | 6955 | |
c0c3707f | 6956 | fi |
d0ac1c44 | 6957 | |
c0c3707f CB |
6958 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 |
6959 | $as_echo_n "checking for alloca... " >&6; } | |
6960 | if ${ac_cv_func_alloca_works+:} false; then : | |
5e8754f9 SDJ |
6961 | $as_echo_n "(cached) " >&6 |
6962 | else | |
6963 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6964 | /* end confdefs.h. */ | |
c0c3707f CB |
6965 | #ifdef __GNUC__ |
6966 | # define alloca __builtin_alloca | |
6967 | #else | |
6968 | # ifdef _MSC_VER | |
6969 | # include <malloc.h> | |
6970 | # define alloca _alloca | |
6971 | # else | |
6972 | # ifdef HAVE_ALLOCA_H | |
6973 | # include <alloca.h> | |
6974 | # else | |
6975 | # ifdef _AIX | |
6976 | #pragma alloca | |
6977 | # else | |
6978 | # ifndef alloca /* predefined by HP cc +Olibcalls */ | |
6979 | void *alloca (size_t); | |
6980 | # endif | |
6981 | # endif | |
6982 | # endif | |
6983 | # endif | |
6984 | #endif | |
d0ac1c44 | 6985 | |
5e8754f9 SDJ |
6986 | int |
6987 | main () | |
6988 | { | |
c0c3707f CB |
6989 | char *p = (char *) alloca (1); |
6990 | if (p) return 0; | |
5e8754f9 SDJ |
6991 | ; |
6992 | return 0; | |
6993 | } | |
6994 | _ACEOF | |
c0c3707f CB |
6995 | if ac_fn_c_try_link "$LINENO"; then : |
6996 | ac_cv_func_alloca_works=yes | |
6997 | else | |
6998 | ac_cv_func_alloca_works=no | |
5e8754f9 | 6999 | fi |
c0c3707f CB |
7000 | rm -f core conftest.err conftest.$ac_objext \ |
7001 | conftest$ac_exeext conftest.$ac_ext | |
7002 | fi | |
7003 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 | |
7004 | $as_echo "$ac_cv_func_alloca_works" >&6; } | |
7a6dbc2f | 7005 | |
c0c3707f | 7006 | if test $ac_cv_func_alloca_works = yes; then |
7a6dbc2f | 7007 | |
c0c3707f | 7008 | $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h |
7a6dbc2f | 7009 | |
5e8754f9 | 7010 | else |
c0c3707f CB |
7011 | # The SVR3 libPW and SVR4 libucb both contain incompatible functions |
7012 | # that cause trouble. Some versions do not even contain alloca or | |
7013 | # contain a buggy version. If you still want to use their alloca, | |
7014 | # use ar to extract alloca.o from them instead of compiling alloca.c. | |
c971b7fa PA |
7015 | |
7016 | ||
7a6dbc2f | 7017 | |
73cc7272 TT |
7018 | |
7019 | ||
c0c3707f | 7020 | ALLOCA=\${LIBOBJDIR}alloca.$ac_objext |
73cc7272 | 7021 | |
c0c3707f | 7022 | $as_echo "#define C_ALLOCA 1" >>confdefs.h |
73cc7272 TT |
7023 | |
7024 | ||
c0c3707f CB |
7025 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 |
7026 | $as_echo_n "checking stack direction for C alloca... " >&6; } | |
7027 | if ${ac_cv_c_stack_direction+:} false; then : | |
73cc7272 TT |
7028 | $as_echo_n "(cached) " >&6 |
7029 | else | |
c0c3707f CB |
7030 | if test "$cross_compiling" = yes; then : |
7031 | ac_cv_c_stack_direction=0 | |
7032 | else | |
7033 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
73cc7272 | 7034 | /* end confdefs.h. */ |
c0c3707f CB |
7035 | $ac_includes_default |
7036 | int | |
7037 | find_stack_direction (int *addr, int depth) | |
7038 | { | |
7039 | int dir, dummy = 0; | |
7040 | if (! addr) | |
7041 | addr = &dummy; | |
7042 | *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; | |
7043 | dir = depth ? find_stack_direction (addr, depth - 1) : 0; | |
7044 | return dir + dummy; | |
7045 | } | |
73cc7272 | 7046 | |
73cc7272 | 7047 | int |
c0c3707f | 7048 | main (int argc, char **argv) |
73cc7272 | 7049 | { |
c0c3707f | 7050 | return find_stack_direction (0, argc + !argv + 20) < 0; |
73cc7272 TT |
7051 | } |
7052 | _ACEOF | |
c0c3707f CB |
7053 | if ac_fn_c_try_run "$LINENO"; then : |
7054 | ac_cv_c_stack_direction=1 | |
7055 | else | |
7056 | ac_cv_c_stack_direction=-1 | |
73cc7272 | 7057 | fi |
c0c3707f CB |
7058 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
7059 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
73cc7272 | 7060 | fi |
73cc7272 | 7061 | |
73cc7272 | 7062 | fi |
9c9d63b1 PM |
7063 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 |
7064 | $as_echo "$ac_cv_c_stack_direction" >&6; } | |
7065 | cat >>confdefs.h <<_ACEOF | |
7066 | #define STACK_DIRECTION $ac_cv_c_stack_direction | |
c0c3707f CB |
7067 | _ACEOF |
7068 | ||
9c9d63b1 | 7069 | |
73cc7272 TT |
7070 | fi |
7071 | ||
9c9d63b1 PM |
7072 | |
7073 | GNULIB_INET_NTOP=0; | |
7074 | GNULIB_INET_PTON=0; | |
7075 | HAVE_DECL_INET_NTOP=1; | |
7076 | HAVE_DECL_INET_PTON=1; | |
7077 | REPLACE_INET_NTOP=0; | |
7078 | REPLACE_INET_PTON=0; | |
73cc7272 | 7079 | |
c0c3707f CB |
7080 | |
7081 | ||
7082 | ||
7083 | ||
7084 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 | |
7085 | $as_echo_n "checking whether the preprocessor supports include_next... " >&6; } | |
7086 | if ${gl_cv_have_include_next+:} false; then : | |
73cc7272 TT |
7087 | $as_echo_n "(cached) " >&6 |
7088 | else | |
c0c3707f CB |
7089 | rm -rf conftestd1a conftestd1b conftestd2 |
7090 | mkdir conftestd1a conftestd1b conftestd2 | |
7091 | cat <<EOF > conftestd1a/conftest.h | |
7092 | #define DEFINED_IN_CONFTESTD1 | |
7093 | #include_next <conftest.h> | |
7094 | #ifdef DEFINED_IN_CONFTESTD2 | |
7095 | int foo; | |
7096 | #else | |
7097 | #error "include_next doesn't work" | |
7098 | #endif | |
7099 | EOF | |
7100 | cat <<EOF > conftestd1b/conftest.h | |
7101 | #define DEFINED_IN_CONFTESTD1 | |
7102 | #include <stdio.h> | |
7103 | #include_next <conftest.h> | |
7104 | #ifdef DEFINED_IN_CONFTESTD2 | |
7105 | int foo; | |
7106 | #else | |
7107 | #error "include_next doesn't work" | |
7108 | #endif | |
7109 | EOF | |
7110 | cat <<EOF > conftestd2/conftest.h | |
7111 | #ifndef DEFINED_IN_CONFTESTD1 | |
7112 | #error "include_next test doesn't work" | |
7113 | #endif | |
7114 | #define DEFINED_IN_CONFTESTD2 | |
7115 | EOF | |
7116 | gl_save_CPPFLAGS="$CPPFLAGS" | |
7117 | CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" | |
7118 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
73cc7272 | 7119 | /* end confdefs.h. */ |
c0c3707f | 7120 | #include <conftest.h> |
73cc7272 | 7121 | _ACEOF |
c0c3707f CB |
7122 | if ac_fn_c_try_compile "$LINENO"; then : |
7123 | gl_cv_have_include_next=yes | |
7124 | else | |
7125 | CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" | |
7126 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
7127 | /* end confdefs.h. */ | |
7128 | #include <conftest.h> | |
7129 | _ACEOF | |
7130 | if ac_fn_c_try_compile "$LINENO"; then : | |
7131 | gl_cv_have_include_next=buggy | |
7132 | else | |
7133 | gl_cv_have_include_next=no | |
73cc7272 | 7134 | fi |
c0c3707f CB |
7135 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
7136 | ||
73cc7272 | 7137 | fi |
c0c3707f CB |
7138 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
7139 | CPPFLAGS="$gl_save_CPPFLAGS" | |
7140 | rm -rf conftestd1a conftestd1b conftestd2 | |
7141 | ||
73cc7272 | 7142 | fi |
c0c3707f CB |
7143 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 |
7144 | $as_echo "$gl_cv_have_include_next" >&6; } | |
7145 | PRAGMA_SYSTEM_HEADER= | |
7146 | if test $gl_cv_have_include_next = yes; then | |
7147 | INCLUDE_NEXT=include_next | |
7148 | INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next | |
7149 | if test -n "$GCC"; then | |
7150 | PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' | |
7151 | fi | |
7152 | else | |
7153 | if test $gl_cv_have_include_next = buggy; then | |
7154 | INCLUDE_NEXT=include | |
7155 | INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next | |
7156 | else | |
7157 | INCLUDE_NEXT=include | |
7158 | INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include | |
7159 | fi | |
73cc7272 TT |
7160 | fi |
7161 | ||
73cc7272 | 7162 | |
73cc7272 | 7163 | |
9c9d63b1 PM |
7164 | |
7165 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether source code line length is unlimited" >&5 | |
7166 | $as_echo_n "checking whether source code line length is unlimited... " >&6; } | |
7167 | if ${gl_cv_source_line_length_unlimited+:} false; then : | |
73cc7272 TT |
7168 | $as_echo_n "(cached) " >&6 |
7169 | else | |
9c9d63b1 | 7170 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
73cc7272 | 7171 | /* end confdefs.h. */ |
73cc7272 | 7172 | |
c0c3707f CB |
7173 | #ifdef __TANDEM |
7174 | choke me | |
7175 | #endif | |
73cc7272 | 7176 | |
73cc7272 | 7177 | _ACEOF |
c0c3707f CB |
7178 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
7179 | $EGREP "choke me" >/dev/null 2>&1; then : | |
9c9d63b1 | 7180 | gl_cv_source_line_length_unlimited=no |
c0c3707f | 7181 | else |
9c9d63b1 | 7182 | gl_cv_source_line_length_unlimited=yes |
73cc7272 | 7183 | fi |
c0c3707f | 7184 | rm -f conftest* |
73cc7272 | 7185 | |
73cc7272 TT |
7186 | |
7187 | fi | |
9c9d63b1 PM |
7188 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_source_line_length_unlimited" >&5 |
7189 | $as_echo "$gl_cv_source_line_length_unlimited" >&6; } | |
7190 | if test $gl_cv_source_line_length_unlimited = no; then | |
c0c3707f CB |
7191 | PRAGMA_COLUMNS="#pragma COLUMNS 10000" |
7192 | else | |
7193 | PRAGMA_COLUMNS= | |
7194 | fi | |
73cc7272 TT |
7195 | |
7196 | ||
7197 | ||
73cc7272 | 7198 | |
73cc7272 TT |
7199 | |
7200 | ||
c0c3707f CB |
7201 | if test $ac_cv_header_features_h = yes; then |
7202 | HAVE_FEATURES_H=1 | |
7203 | else | |
7204 | HAVE_FEATURES_H=0 | |
7205 | fi | |
73cc7272 | 7206 | |
7a6dbc2f SDJ |
7207 | |
7208 | ||
7209 | ||
7210 | ||
c0c3707f CB |
7211 | if test $ac_cv_header_sys_socket_h = no; then |
7212 | for ac_header in ws2tcpip.h | |
7213 | do : | |
7214 | ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" | |
7215 | if test "x$ac_cv_header_ws2tcpip_h" = xyes; then : | |
7216 | cat >>confdefs.h <<_ACEOF | |
7217 | #define HAVE_WS2TCPIP_H 1 | |
7218 | _ACEOF | |
7a6dbc2f | 7219 | |
c0c3707f | 7220 | fi |
7a6dbc2f | 7221 | |
c0c3707f | 7222 | done |
7a6dbc2f | 7223 | |
c0c3707f | 7224 | fi |
7a6dbc2f | 7225 | |
c0c3707f CB |
7226 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 |
7227 | $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } | |
7228 | if test -z "$MKDIR_P"; then | |
7229 | if ${ac_cv_path_mkdir+:} false; then : | |
7230 | $as_echo_n "(cached) " >&6 | |
5e8754f9 | 7231 | else |
c0c3707f CB |
7232 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
7233 | for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin | |
7234 | do | |
7235 | IFS=$as_save_IFS | |
7236 | test -z "$as_dir" && as_dir=. | |
7237 | for ac_prog in mkdir gmkdir; do | |
7238 | for ac_exec_ext in '' $ac_executable_extensions; do | |
7239 | as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue | |
7240 | case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( | |
7241 | 'mkdir (GNU coreutils) '* | \ | |
7242 | 'mkdir (coreutils) '* | \ | |
7243 | 'mkdir (fileutils) '4.1*) | |
7244 | ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext | |
7245 | break 3;; | |
7246 | esac | |
7247 | done | |
7248 | done | |
7249 | done | |
7250 | IFS=$as_save_IFS | |
7a6dbc2f | 7251 | |
5e8754f9 | 7252 | fi |
7a6dbc2f | 7253 | |
c0c3707f CB |
7254 | test -d ./--version && rmdir ./--version |
7255 | if test "${ac_cv_path_mkdir+set}" = set; then | |
7256 | MKDIR_P="$ac_cv_path_mkdir -p" | |
7257 | else | |
7258 | # As a last resort, use the slow shell script. Don't cache a | |
7259 | # value for MKDIR_P within a source directory, because that will | |
7260 | # break other packages using the cache if that directory is | |
7261 | # removed, or if the value is a relative name. | |
7262 | MKDIR_P="$ac_install_sh -d" | |
7263 | fi | |
5e8754f9 | 7264 | fi |
c0c3707f CB |
7265 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 |
7266 | $as_echo "$MKDIR_P" >&6; } | |
7a6dbc2f | 7267 | |
5e8754f9 | 7268 | |
698be2d8 CB |
7269 | GNULIB_BTOWC=0; |
7270 | GNULIB_WCTOB=0; | |
7271 | GNULIB_MBSINIT=0; | |
7272 | GNULIB_MBRTOWC=0; | |
7273 | GNULIB_MBRLEN=0; | |
7274 | GNULIB_MBSRTOWCS=0; | |
7275 | GNULIB_MBSNRTOWCS=0; | |
7276 | GNULIB_WCRTOMB=0; | |
7277 | GNULIB_WCSRTOMBS=0; | |
7278 | GNULIB_WCSNRTOMBS=0; | |
7279 | GNULIB_WCWIDTH=0; | |
7280 | GNULIB_WMEMCHR=0; | |
7281 | GNULIB_WMEMCMP=0; | |
7282 | GNULIB_WMEMCPY=0; | |
7283 | GNULIB_WMEMMOVE=0; | |
7284 | GNULIB_WMEMPCPY=0; | |
7285 | GNULIB_WMEMSET=0; | |
7286 | GNULIB_WCSLEN=0; | |
7287 | GNULIB_WCSNLEN=0; | |
7288 | GNULIB_WCSCPY=0; | |
7289 | GNULIB_WCPCPY=0; | |
7290 | GNULIB_WCSNCPY=0; | |
7291 | GNULIB_WCPNCPY=0; | |
7292 | GNULIB_WCSCAT=0; | |
7293 | GNULIB_WCSNCAT=0; | |
7294 | GNULIB_WCSCMP=0; | |
7295 | GNULIB_WCSNCMP=0; | |
7296 | GNULIB_WCSCASECMP=0; | |
7297 | GNULIB_WCSNCASECMP=0; | |
7298 | GNULIB_WCSCOLL=0; | |
7299 | GNULIB_WCSXFRM=0; | |
7300 | GNULIB_WCSDUP=0; | |
7301 | GNULIB_WCSCHR=0; | |
7302 | GNULIB_WCSRCHR=0; | |
7303 | GNULIB_WCSCSPN=0; | |
7304 | GNULIB_WCSSPN=0; | |
7305 | GNULIB_WCSPBRK=0; | |
7306 | GNULIB_WCSSTR=0; | |
7307 | GNULIB_WCSTOK=0; | |
7308 | GNULIB_WCSWIDTH=0; | |
7309 | GNULIB_WCSFTIME=0; | |
9c9d63b1 | 7310 | GNULIB_MDA_WCSDUP=1; |
698be2d8 CB |
7311 | HAVE_BTOWC=1; |
7312 | HAVE_MBSINIT=1; | |
7313 | HAVE_MBRTOWC=1; | |
7314 | HAVE_MBRLEN=1; | |
7315 | HAVE_MBSRTOWCS=1; | |
7316 | HAVE_MBSNRTOWCS=1; | |
7317 | HAVE_WCRTOMB=1; | |
7318 | HAVE_WCSRTOMBS=1; | |
7319 | HAVE_WCSNRTOMBS=1; | |
7320 | HAVE_WMEMCHR=1; | |
7321 | HAVE_WMEMCMP=1; | |
7322 | HAVE_WMEMCPY=1; | |
7323 | HAVE_WMEMMOVE=1; | |
7324 | HAVE_WMEMPCPY=1; | |
7325 | HAVE_WMEMSET=1; | |
7326 | HAVE_WCSLEN=1; | |
7327 | HAVE_WCSNLEN=1; | |
7328 | HAVE_WCSCPY=1; | |
7329 | HAVE_WCPCPY=1; | |
7330 | HAVE_WCSNCPY=1; | |
7331 | HAVE_WCPNCPY=1; | |
7332 | HAVE_WCSCAT=1; | |
7333 | HAVE_WCSNCAT=1; | |
7334 | HAVE_WCSCMP=1; | |
7335 | HAVE_WCSNCMP=1; | |
7336 | HAVE_WCSCASECMP=1; | |
7337 | HAVE_WCSNCASECMP=1; | |
7338 | HAVE_WCSCOLL=1; | |
7339 | HAVE_WCSXFRM=1; | |
7340 | HAVE_WCSDUP=1; | |
7341 | HAVE_WCSCHR=1; | |
7342 | HAVE_WCSRCHR=1; | |
7343 | HAVE_WCSCSPN=1; | |
7344 | HAVE_WCSSPN=1; | |
7345 | HAVE_WCSPBRK=1; | |
7346 | HAVE_WCSSTR=1; | |
7347 | HAVE_WCSTOK=1; | |
7348 | HAVE_WCSWIDTH=1; | |
7349 | HAVE_WCSFTIME=1; | |
7350 | HAVE_DECL_WCTOB=1; | |
9c9d63b1 | 7351 | HAVE_DECL_WCSDUP=1; |
698be2d8 CB |
7352 | HAVE_DECL_WCWIDTH=1; |
7353 | REPLACE_MBSTATE_T=0; | |
7354 | REPLACE_BTOWC=0; | |
7355 | REPLACE_WCTOB=0; | |
7356 | REPLACE_MBSINIT=0; | |
7357 | REPLACE_MBRTOWC=0; | |
7358 | REPLACE_MBRLEN=0; | |
7359 | REPLACE_MBSRTOWCS=0; | |
7360 | REPLACE_MBSNRTOWCS=0; | |
7361 | REPLACE_WCRTOMB=0; | |
7362 | REPLACE_WCSRTOMBS=0; | |
7363 | REPLACE_WCSNRTOMBS=0; | |
7364 | REPLACE_WCWIDTH=0; | |
7365 | REPLACE_WCSWIDTH=0; | |
7366 | REPLACE_WCSFTIME=0; | |
7367 | REPLACE_WCSTOK=0; | |
7368 | ||
7369 | ||
9c9d63b1 PM |
7370 | |
7371 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5 | |
698be2d8 CB |
7372 | $as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; } |
7373 | if ${gl_cv_header_wchar_h_correct_inline+:} false; then : | |
7374 | $as_echo_n "(cached) " >&6 | |
7375 | else | |
7376 | gl_cv_header_wchar_h_correct_inline=yes | |
9c9d63b1 PM |
7377 | case "$host_os" in |
7378 | *-gnu* | gnu*) | |
7379 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
698be2d8 CB |
7380 | /* end confdefs.h. */ |
7381 | ||
9c9d63b1 PM |
7382 | |
7383 | #define wcstod renamed_wcstod | |
7384 | #include <wchar.h> | |
7385 | extern int zero (void); | |
7386 | int main () { return zero(); } | |
698be2d8 CB |
7387 | |
7388 | _ACEOF | |
9c9d63b1 PM |
7389 | save_ac_compile="$ac_compile" |
7390 | ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` | |
7391 | if echo '#include "conftest.c"' >conftest1.c \ | |
7392 | && { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 | |
698be2d8 CB |
7393 | (eval $ac_compile) 2>&5 |
7394 | ac_status=$? | |
7395 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
7396 | test $ac_status = 0; }; then | |
9c9d63b1 | 7397 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
698be2d8 CB |
7398 | /* end confdefs.h. */ |
7399 | ||
9c9d63b1 PM |
7400 | |
7401 | #define wcstod renamed_wcstod | |
7402 | #include <wchar.h> | |
7403 | int zero (void) { return 0; } | |
698be2d8 CB |
7404 | |
7405 | _ACEOF | |
9c9d63b1 PM |
7406 | ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` |
7407 | if echo '#include "conftest.c"' >conftest2.c \ | |
7408 | && { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 | |
698be2d8 CB |
7409 | (eval $ac_compile) 2>&5 |
7410 | ac_status=$? | |
7411 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
7412 | test $ac_status = 0; }; then | |
9c9d63b1 PM |
7413 | if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then |
7414 | : | |
7415 | else | |
7416 | gl_cv_header_wchar_h_correct_inline=no | |
7417 | fi | |
7418 | fi | |
698be2d8 | 7419 | fi |
9c9d63b1 PM |
7420 | ac_compile="$save_ac_compile" |
7421 | rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext | |
7422 | ;; | |
7423 | esac | |
698be2d8 CB |
7424 | |
7425 | fi | |
7426 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 | |
7427 | $as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; } | |
7428 | if test $gl_cv_header_wchar_h_correct_inline = no; then | |
7429 | as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). | |
7430 | This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in | |
7431 | C99 mode. You have four options: | |
7432 | - Add the flag -fgnu89-inline to CC and reconfigure, or | |
7433 | - Fix your include files, using parts of | |
7434 | <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or | |
7435 | - Use a gcc version older than 4.3, or | |
7436 | - Don't use the flags -std=c99 or -std=gnu99. | |
7437 | Configuration aborted." "$LINENO" 5 | |
7438 | fi | |
7439 | ||
7440 | ||
7441 | ||
7442 | ||
7443 | for ac_func in $ac_func_list | |
7444 | do : | |
7445 | as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` | |
7446 | ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" | |
7447 | if eval test \"x\$"$as_ac_var"\" = x"yes"; then : | |
7448 | cat >>confdefs.h <<_ACEOF | |
7449 | #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 | |
7450 | _ACEOF | |
7451 | ||
7452 | fi | |
7453 | done | |
7454 | ||
7455 | ||
7456 | ||
7457 | ||
7458 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 | |
7459 | $as_echo_n "checking for nl_langinfo and CODESET... " >&6; } | |
7460 | if ${am_cv_langinfo_codeset+:} false; then : | |
7461 | $as_echo_n "(cached) " >&6 | |
7462 | else | |
7463 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
7464 | /* end confdefs.h. */ | |
7465 | #include <langinfo.h> | |
7466 | int | |
7467 | main () | |
7468 | { | |
7469 | char* cs = nl_langinfo(CODESET); return !cs; | |
7470 | ; | |
7471 | return 0; | |
7472 | } | |
7473 | _ACEOF | |
7474 | if ac_fn_c_try_link "$LINENO"; then : | |
7475 | am_cv_langinfo_codeset=yes | |
7476 | else | |
7477 | am_cv_langinfo_codeset=no | |
7478 | fi | |
7479 | rm -f core conftest.err conftest.$ac_objext \ | |
7480 | conftest$ac_exeext conftest.$ac_ext | |
7481 | ||
7482 | fi | |
7483 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 | |
7484 | $as_echo "$am_cv_langinfo_codeset" >&6; } | |
7485 | if test $am_cv_langinfo_codeset = yes; then | |
7486 | ||
7487 | $as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h | |
7488 | ||
7489 | fi | |
7490 | ||
7491 | ||
7492 | ||
7493 | ||
7494 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 | |
7495 | $as_echo_n "checking for a traditional french locale... " >&6; } | |
7496 | if ${gt_cv_locale_fr+:} false; then : | |
7497 | $as_echo_n "(cached) " >&6 | |
7498 | else | |
7499 | ||
7500 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
7501 | /* end confdefs.h. */ | |
7502 | ||
7503 | #include <locale.h> | |
7504 | #include <time.h> | |
7505 | #if HAVE_LANGINFO_CODESET | |
7506 | # include <langinfo.h> | |
7507 | #endif | |
7508 | #include <stdlib.h> | |
7509 | #include <string.h> | |
7510 | struct tm t; | |
7511 | char buf[16]; | |
7512 | int main () { | |
7513 | /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl | |
7514 | imitates locale dependent behaviour by looking at the environment | |
7515 | variables, and all locales use the UTF-8 encoding. */ | |
7516 | #if defined __BEOS__ || defined __HAIKU__ | |
7517 | return 1; | |
7518 | #else | |
7519 | /* Check whether the given locale name is recognized by the system. */ | |
7520 | # if defined _WIN32 && !defined __CYGWIN__ | |
7521 | /* On native Windows, setlocale(category, "") looks at the system settings, | |
7522 | not at the environment variables. Also, when an encoding suffix such | |
7523 | as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE | |
7524 | category of the locale to "C". */ | |
7525 | if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL | |
7526 | || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) | |
7527 | return 1; | |
7528 | # else | |
7529 | if (setlocale (LC_ALL, "") == NULL) return 1; | |
7530 | # endif | |
7531 | /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". | |
7532 | On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) | |
7533 | is empty, and the behaviour of Tcl 8.4 in this locale is not useful. | |
7534 | On OpenBSD 4.0, when an unsupported locale is specified, setlocale() | |
7535 | succeeds but then nl_langinfo(CODESET) is "646". In this situation, | |
7536 | some unit tests fail. | |
7537 | On MirBSD 10, when an unsupported locale is specified, setlocale() | |
7538 | succeeds but then nl_langinfo(CODESET) is "UTF-8". */ | |
7539 | # if HAVE_LANGINFO_CODESET | |
7540 | { | |
7541 | const char *cs = nl_langinfo (CODESET); | |
7542 | if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 | |
7543 | || strcmp (cs, "UTF-8") == 0) | |
7544 | return 1; | |
7545 | } | |
7546 | # endif | |
7547 | # ifdef __CYGWIN__ | |
7548 | /* On Cygwin, avoid locale names without encoding suffix, because the | |
7549 | locale_charset() function relies on the encoding suffix. Note that | |
7550 | LC_ALL is set on the command line. */ | |
7551 | if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; | |
7552 | # endif | |
7553 | /* Check whether in the abbreviation of the second month, the second | |
7554 | character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only | |
7555 | one byte long. This excludes the UTF-8 encoding. */ | |
7556 | t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; | |
7557 | if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; | |
7558 | # if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ | |
7559 | /* Check whether the decimal separator is a comma. | |
7560 | On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point | |
7561 | are nl_langinfo(RADIXCHAR) are both ".". */ | |
7562 | if (localeconv () ->decimal_point[0] != ',') return 1; | |
7563 | # endif | |
7564 | return 0; | |
7565 | #endif | |
7566 | } | |
7567 | ||
7568 | _ACEOF | |
7569 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 | |
7570 | (eval $ac_link) 2>&5 | |
7571 | ac_status=$? | |
7572 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
7573 | test $ac_status = 0; } && test -s conftest$ac_exeext; then | |
7574 | case "$host_os" in | |
7575 | # Handle native Windows specially, because there setlocale() interprets | |
7576 | # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", | |
7577 | # "fr" or "fra" as "French" or "French_France.1252", | |
7578 | # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", | |
7579 | # "ja" as "Japanese" or "Japanese_Japan.932", | |
7580 | # and similar. | |
7581 | mingw*) | |
7582 | # Test for the native Windows locale name. | |
7583 | if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
7584 | gt_cv_locale_fr=French_France.1252 | |
7585 | else | |
7586 | # None found. | |
7587 | gt_cv_locale_fr=none | |
7588 | fi | |
7589 | ;; | |
7590 | *) | |
7591 | # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because | |
7592 | # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the | |
7593 | # configure script would override the LC_ALL setting. Likewise for | |
7594 | # LC_CTYPE, which is also set at the beginning of the configure script. | |
7595 | # Test for the usual locale name. | |
7596 | if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
7597 | gt_cv_locale_fr=fr_FR | |
7598 | else | |
7599 | # Test for the locale name with explicit encoding suffix. | |
7600 | if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
7601 | gt_cv_locale_fr=fr_FR.ISO-8859-1 | |
7602 | else | |
7603 | # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. | |
7604 | if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
7605 | gt_cv_locale_fr=fr_FR.ISO8859-1 | |
7606 | else | |
7607 | # Test for the HP-UX locale name. | |
7608 | if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
7609 | gt_cv_locale_fr=fr_FR.iso88591 | |
7610 | else | |
7611 | # Test for the Solaris 7 locale name. | |
7612 | if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
7613 | gt_cv_locale_fr=fr | |
7614 | else | |
7615 | # None found. | |
7616 | gt_cv_locale_fr=none | |
7617 | fi | |
7618 | fi | |
7619 | fi | |
7620 | fi | |
7621 | fi | |
7622 | ;; | |
7623 | esac | |
7624 | fi | |
7625 | rm -fr conftest* | |
7626 | ||
7627 | fi | |
7628 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 | |
7629 | $as_echo "$gt_cv_locale_fr" >&6; } | |
7630 | LOCALE_FR=$gt_cv_locale_fr | |
7631 | ||
7632 | ||
7633 | ||
7634 | GNULIB__EXIT=0; | |
9c9d63b1 | 7635 | GNULIB_ALIGNED_ALLOC=0; |
698be2d8 CB |
7636 | GNULIB_ATOLL=0; |
7637 | GNULIB_CALLOC_POSIX=0; | |
7638 | GNULIB_CANONICALIZE_FILE_NAME=0; | |
9c9d63b1 | 7639 | GNULIB_FREE_POSIX=0; |
698be2d8 CB |
7640 | GNULIB_GETLOADAVG=0; |
7641 | GNULIB_GETSUBOPT=0; | |
7642 | GNULIB_GRANTPT=0; | |
7643 | GNULIB_MALLOC_POSIX=0; | |
7644 | GNULIB_MBTOWC=0; | |
7645 | GNULIB_MKDTEMP=0; | |
7646 | GNULIB_MKOSTEMP=0; | |
7647 | GNULIB_MKOSTEMPS=0; | |
7648 | GNULIB_MKSTEMP=0; | |
7649 | GNULIB_MKSTEMPS=0; | |
9c9d63b1 | 7650 | GNULIB_POSIX_MEMALIGN=0; |
698be2d8 CB |
7651 | GNULIB_POSIX_OPENPT=0; |
7652 | GNULIB_PTSNAME=0; | |
7653 | GNULIB_PTSNAME_R=0; | |
7654 | GNULIB_PUTENV=0; | |
7655 | GNULIB_QSORT_R=0; | |
7656 | GNULIB_RANDOM=0; | |
7657 | GNULIB_RANDOM_R=0; | |
7658 | GNULIB_REALLOCARRAY=0; | |
7659 | GNULIB_REALLOC_POSIX=0; | |
7660 | GNULIB_REALPATH=0; | |
7661 | GNULIB_RPMATCH=0; | |
7662 | GNULIB_SECURE_GETENV=0; | |
7663 | GNULIB_SETENV=0; | |
7664 | GNULIB_STRTOD=0; | |
7665 | GNULIB_STRTOLD=0; | |
7666 | GNULIB_STRTOLL=0; | |
7667 | GNULIB_STRTOULL=0; | |
7668 | GNULIB_SYSTEM_POSIX=0; | |
7669 | GNULIB_UNLOCKPT=0; | |
7670 | GNULIB_UNSETENV=0; | |
7671 | GNULIB_WCTOMB=0; | |
9c9d63b1 PM |
7672 | GNULIB_MDA_ECVT=1; |
7673 | GNULIB_MDA_FCVT=1; | |
7674 | GNULIB_MDA_GCVT=1; | |
7675 | GNULIB_MDA_MKTEMP=1; | |
7676 | GNULIB_MDA_PUTENV=1; | |
698be2d8 | 7677 | HAVE__EXIT=1; |
9c9d63b1 | 7678 | HAVE_ALIGNED_ALLOC=1; |
698be2d8 CB |
7679 | HAVE_ATOLL=1; |
7680 | HAVE_CANONICALIZE_FILE_NAME=1; | |
9c9d63b1 PM |
7681 | HAVE_DECL_ECVT=1; |
7682 | HAVE_DECL_FCVT=1; | |
7683 | HAVE_DECL_GCVT=1; | |
698be2d8 CB |
7684 | HAVE_DECL_GETLOADAVG=1; |
7685 | HAVE_GETSUBOPT=1; | |
7686 | HAVE_GRANTPT=1; | |
7687 | HAVE_INITSTATE=1; | |
7688 | HAVE_DECL_INITSTATE=1; | |
7689 | HAVE_MBTOWC=1; | |
7690 | HAVE_MKDTEMP=1; | |
7691 | HAVE_MKOSTEMP=1; | |
7692 | HAVE_MKOSTEMPS=1; | |
7693 | HAVE_MKSTEMP=1; | |
7694 | HAVE_MKSTEMPS=1; | |
9c9d63b1 | 7695 | HAVE_POSIX_MEMALIGN=1; |
698be2d8 CB |
7696 | HAVE_POSIX_OPENPT=1; |
7697 | HAVE_PTSNAME=1; | |
7698 | HAVE_PTSNAME_R=1; | |
c0c3707f CB |
7699 | HAVE_QSORT_R=1; |
7700 | HAVE_RANDOM=1; | |
7701 | HAVE_RANDOM_H=1; | |
7702 | HAVE_RANDOM_R=1; | |
7703 | HAVE_REALLOCARRAY=1; | |
7704 | HAVE_REALPATH=1; | |
7705 | HAVE_RPMATCH=1; | |
7706 | HAVE_SECURE_GETENV=1; | |
7707 | HAVE_SETENV=1; | |
7708 | HAVE_DECL_SETENV=1; | |
7709 | HAVE_SETSTATE=1; | |
7710 | HAVE_DECL_SETSTATE=1; | |
7711 | HAVE_STRTOD=1; | |
7712 | HAVE_STRTOLD=1; | |
7713 | HAVE_STRTOLL=1; | |
7714 | HAVE_STRTOULL=1; | |
7715 | HAVE_STRUCT_RANDOM_DATA=1; | |
7716 | HAVE_SYS_LOADAVG_H=0; | |
7717 | HAVE_UNLOCKPT=1; | |
7718 | HAVE_DECL_UNSETENV=1; | |
9c9d63b1 | 7719 | REPLACE_ALIGNED_ALLOC=0; |
c0c3707f CB |
7720 | REPLACE_CALLOC=0; |
7721 | REPLACE_CANONICALIZE_FILE_NAME=0; | |
9c9d63b1 | 7722 | REPLACE_FREE=0; |
c0c3707f CB |
7723 | REPLACE_INITSTATE=0; |
7724 | REPLACE_MALLOC=0; | |
7725 | REPLACE_MBTOWC=0; | |
7726 | REPLACE_MKSTEMP=0; | |
9c9d63b1 | 7727 | REPLACE_POSIX_MEMALIGN=0; |
c0c3707f CB |
7728 | REPLACE_PTSNAME=0; |
7729 | REPLACE_PTSNAME_R=0; | |
7730 | REPLACE_PUTENV=0; | |
7731 | REPLACE_QSORT_R=0; | |
7732 | REPLACE_RANDOM=0; | |
7733 | REPLACE_RANDOM_R=0; | |
7734 | REPLACE_REALLOC=0; | |
7735 | REPLACE_REALPATH=0; | |
7736 | REPLACE_SETENV=0; | |
7737 | REPLACE_SETSTATE=0; | |
7738 | REPLACE_STRTOD=0; | |
7739 | REPLACE_STRTOLD=0; | |
7740 | REPLACE_UNSETENV=0; | |
7741 | REPLACE_WCTOMB=0; | |
7a6dbc2f | 7742 | |
7a6dbc2f | 7743 | |
9c9d63b1 PM |
7744 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 |
7745 | $as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } | |
7746 | if ${gl_cv_func_lstat_dereferences_slashed_symlink+:} false; then : | |
7747 | $as_echo_n "(cached) " >&6 | |
7748 | else | |
7749 | rm -f conftest.sym conftest.file | |
7750 | echo >conftest.file | |
7751 | if test "$cross_compiling" = yes; then : | |
7752 | case "$host_os" in | |
7753 | linux-* | linux) | |
7754 | # Guess yes on Linux systems. | |
7755 | gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; | |
7756 | *-gnu* | gnu*) | |
7757 | # Guess yes on glibc systems. | |
7758 | gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; | |
7759 | mingw*) | |
7760 | # Guess no on native Windows. | |
7761 | gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; | |
7762 | *) | |
7763 | # If we don't know, obey --enable-cross-guesses. | |
7764 | gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;; | |
7765 | esac | |
7766 | ||
7767 | else | |
7768 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
7769 | /* end confdefs.h. */ | |
7770 | $ac_includes_default | |
7771 | int | |
7772 | main () | |
7773 | { | |
7774 | struct stat sbuf; | |
7775 | if (symlink ("conftest.file", "conftest.sym") != 0) | |
7776 | return 1; | |
7777 | /* Linux will dereference the symlink and fail, as required by | |
7778 | POSIX. That is better in the sense that it means we will not | |
7779 | have to compile and use the lstat wrapper. */ | |
7780 | return lstat ("conftest.sym/", &sbuf) == 0; | |
7781 | ||
7782 | ; | |
7783 | return 0; | |
7784 | } | |
7785 | _ACEOF | |
7786 | if ac_fn_c_try_run "$LINENO"; then : | |
7787 | gl_cv_func_lstat_dereferences_slashed_symlink=yes | |
7788 | else | |
7789 | gl_cv_func_lstat_dereferences_slashed_symlink=no | |
7790 | fi | |
7791 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
7792 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
7793 | fi | |
7794 | ||
7795 | rm -f conftest.sym conftest.file | |
7796 | ||
7797 | fi | |
7798 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5 | |
7799 | $as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; } | |
7800 | case "$gl_cv_func_lstat_dereferences_slashed_symlink" in | |
7801 | *yes) | |
7802 | ||
7803 | cat >>confdefs.h <<_ACEOF | |
7804 | #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 | |
7805 | _ACEOF | |
7806 | ||
7807 | ;; | |
7808 | esac | |
98399780 | 7809 | |
98399780 | 7810 | |
472fa5ee SM |
7811 | |
7812 | ||
7813 | ||
7814 | ||
7815 | ||
c0c3707f CB |
7816 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 |
7817 | $as_echo_n "checking whether // is distinct from /... " >&6; } | |
7818 | if ${gl_cv_double_slash_root+:} false; then : | |
7819 | $as_echo_n "(cached) " >&6 | |
5e8754f9 | 7820 | else |
c0c3707f CB |
7821 | if test x"$cross_compiling" = xyes ; then |
7822 | # When cross-compiling, there is no way to tell whether // is special | |
7823 | # short of a list of hosts. However, the only known hosts to date | |
7824 | # that have a distinct // are Apollo DomainOS (too old to port to), | |
7825 | # Cygwin, and z/OS. If anyone knows of another system for which // has | |
7826 | # special semantics and is distinct from /, please report it to | |
7827 | # <bug-gnulib@gnu.org>. | |
7828 | case $host in | |
7829 | *-cygwin | i370-ibm-openedition) | |
7830 | gl_cv_double_slash_root=yes ;; | |
7831 | *) | |
7832 | # Be optimistic and assume that / and // are the same when we | |
7833 | # don't know. | |
7834 | gl_cv_double_slash_root='unknown, assuming no' ;; | |
7835 | esac | |
7836 | else | |
7837 | set x `ls -di / // 2>/dev/null` | |
7838 | if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then | |
7839 | gl_cv_double_slash_root=no | |
7840 | else | |
7841 | gl_cv_double_slash_root=yes | |
7842 | fi | |
7843 | fi | |
5e8754f9 | 7844 | fi |
c0c3707f CB |
7845 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 |
7846 | $as_echo "$gl_cv_double_slash_root" >&6; } | |
7847 | if test "$gl_cv_double_slash_root" = yes; then | |
472fa5ee | 7848 | |
c0c3707f | 7849 | $as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h |
472fa5ee | 7850 | |
c0c3707f | 7851 | fi |
472fa5ee SM |
7852 | |
7853 | ||
472fa5ee | 7854 | |
c0c3707f CB |
7855 | |
7856 | ||
7857 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether realpath works" >&5 | |
7858 | $as_echo_n "checking whether realpath works... " >&6; } | |
7859 | if ${gl_cv_func_realpath_works+:} false; then : | |
5e8754f9 SDJ |
7860 | $as_echo_n "(cached) " >&6 |
7861 | else | |
c0c3707f | 7862 | |
9c9d63b1 | 7863 | rm -rf conftest.a conftest.d |
c0c3707f CB |
7864 | touch conftest.a |
7865 | mkdir conftest.d | |
7866 | if test "$cross_compiling" = yes; then : | |
7867 | case "$host_os" in | |
7868 | # Guess yes on glibc systems. | |
7869 | *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;; | |
7870 | # Guess yes on musl systems. | |
7871 | *-musl*) gl_cv_func_realpath_works="guessing yes" ;; | |
7872 | # Guess no on native Windows. | |
7873 | mingw*) gl_cv_func_realpath_works="guessing no" ;; | |
7874 | # If we don't know, obey --enable-cross-guesses. | |
7875 | *) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;; | |
7876 | esac | |
7877 | ||
5e8754f9 SDJ |
7878 | else |
7879 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
7880 | /* end confdefs.h. */ | |
c0c3707f CB |
7881 | |
7882 | ||
7883 | ||
7884 | #include <stdlib.h> | |
7885 | #if defined __MACH__ && defined __APPLE__ | |
7886 | /* Avoid a crash on Mac OS X. */ | |
7887 | #include <mach/mach.h> | |
7888 | #include <mach/mach_error.h> | |
7889 | #include <mach/thread_status.h> | |
7890 | #include <mach/exception.h> | |
7891 | #include <mach/task.h> | |
7892 | #include <pthread.h> | |
7893 | /* The exception port on which our thread listens. */ | |
7894 | static mach_port_t our_exception_port; | |
7895 | /* The main function of the thread listening for exceptions of type | |
7896 | EXC_BAD_ACCESS. */ | |
7897 | static void * | |
7898 | mach_exception_thread (void *arg) | |
5e8754f9 | 7899 | { |
c0c3707f CB |
7900 | /* Buffer for a message to be received. */ |
7901 | struct { | |
7902 | mach_msg_header_t head; | |
7903 | mach_msg_body_t msgh_body; | |
7904 | char data[1024]; | |
7905 | } msg; | |
7906 | mach_msg_return_t retval; | |
7907 | /* Wait for a message on the exception port. */ | |
7908 | retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), | |
7909 | our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); | |
7910 | if (retval != MACH_MSG_SUCCESS) | |
7911 | abort (); | |
7912 | exit (1); | |
7913 | } | |
7914 | static void | |
7915 | nocrash_init (void) | |
7916 | { | |
7917 | mach_port_t self = mach_task_self (); | |
7918 | /* Allocate a port on which the thread shall listen for exceptions. */ | |
7919 | if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) | |
7920 | == KERN_SUCCESS) { | |
7921 | /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ | |
7922 | if (mach_port_insert_right (self, our_exception_port, our_exception_port, | |
7923 | MACH_MSG_TYPE_MAKE_SEND) | |
7924 | == KERN_SUCCESS) { | |
7925 | /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting | |
7926 | for us. */ | |
7927 | exception_mask_t mask = EXC_MASK_BAD_ACCESS; | |
7928 | /* Create the thread listening on the exception port. */ | |
7929 | pthread_attr_t attr; | |
7930 | pthread_t thread; | |
7931 | if (pthread_attr_init (&attr) == 0 | |
7932 | && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 | |
7933 | && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { | |
7934 | pthread_attr_destroy (&attr); | |
7935 | /* Replace the exception port info for these exceptions with our own. | |
7936 | Note that we replace the exception port for the entire task, not only | |
7937 | for a particular thread. This has the effect that when our exception | |
7938 | port gets the message, the thread specific exception port has already | |
7939 | been asked, and we don't need to bother about it. | |
7940 | See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ | |
7941 | task_set_exception_ports (self, mask, our_exception_port, | |
7942 | EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); | |
7943 | } | |
7944 | } | |
7945 | } | |
7946 | } | |
7947 | #elif defined _WIN32 && ! defined __CYGWIN__ | |
7948 | /* Avoid a crash on native Windows. */ | |
7949 | #define WIN32_LEAN_AND_MEAN | |
7950 | #include <windows.h> | |
7951 | #include <winerror.h> | |
7952 | static LONG WINAPI | |
7953 | exception_filter (EXCEPTION_POINTERS *ExceptionInfo) | |
7954 | { | |
7955 | switch (ExceptionInfo->ExceptionRecord->ExceptionCode) | |
7956 | { | |
7957 | case EXCEPTION_ACCESS_VIOLATION: | |
7958 | case EXCEPTION_IN_PAGE_ERROR: | |
7959 | case EXCEPTION_STACK_OVERFLOW: | |
7960 | case EXCEPTION_GUARD_PAGE: | |
7961 | case EXCEPTION_PRIV_INSTRUCTION: | |
7962 | case EXCEPTION_ILLEGAL_INSTRUCTION: | |
7963 | case EXCEPTION_DATATYPE_MISALIGNMENT: | |
7964 | case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: | |
7965 | case EXCEPTION_NONCONTINUABLE_EXCEPTION: | |
7966 | exit (1); | |
7967 | } | |
7968 | return EXCEPTION_CONTINUE_SEARCH; | |
7969 | } | |
7970 | static void | |
7971 | nocrash_init (void) | |
7972 | { | |
7973 | SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); | |
7974 | } | |
7975 | #else | |
7976 | /* Avoid a crash on POSIX systems. */ | |
7977 | #include <signal.h> | |
7978 | #include <unistd.h> | |
7979 | /* A POSIX signal handler. */ | |
7980 | static void | |
7981 | exception_handler (int sig) | |
7982 | { | |
7983 | _exit (1); | |
7984 | } | |
7985 | static void | |
7986 | nocrash_init (void) | |
7987 | { | |
7988 | #ifdef SIGSEGV | |
7989 | signal (SIGSEGV, exception_handler); | |
7990 | #endif | |
7991 | #ifdef SIGBUS | |
7992 | signal (SIGBUS, exception_handler); | |
7993 | #endif | |
5e8754f9 | 7994 | } |
c0c3707f CB |
7995 | #endif |
7996 | ||
7997 | #include <stdlib.h> | |
7998 | #include <string.h> | |
472fa5ee | 7999 | |
5e8754f9 | 8000 | int |
c0c3707f | 8001 | main () |
5e8754f9 | 8002 | { |
c0c3707f CB |
8003 | |
8004 | int result = 0; | |
8005 | { | |
8006 | char *name = realpath ("conftest.a", NULL); | |
8007 | if (!(name && *name == '/')) | |
8008 | result |= 1; | |
8009 | free (name); | |
8010 | } | |
8011 | { | |
8012 | char *name = realpath ("conftest.b/../conftest.a", NULL); | |
8013 | if (name != NULL) | |
8014 | result |= 2; | |
8015 | free (name); | |
8016 | } | |
8017 | { | |
8018 | char *name = realpath ("conftest.a/", NULL); | |
8019 | if (name != NULL) | |
8020 | result |= 4; | |
8021 | free (name); | |
8022 | } | |
8023 | { | |
8024 | char *name1 = realpath (".", NULL); | |
8025 | char *name2 = realpath ("conftest.d//./..", NULL); | |
8026 | if (! name1 || ! name2 || strcmp (name1, name2)) | |
8027 | result |= 8; | |
8028 | free (name1); | |
8029 | free (name2); | |
8030 | } | |
8031 | return result; | |
8032 | ||
8033 | ; | |
8034 | return 0; | |
5e8754f9 | 8035 | } |
c0c3707f | 8036 | |
5e8754f9 SDJ |
8037 | _ACEOF |
8038 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 8039 | gl_cv_func_realpath_works=yes |
5e8754f9 | 8040 | else |
c0c3707f | 8041 | gl_cv_func_realpath_works=no |
5e8754f9 SDJ |
8042 | fi |
8043 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
8044 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
8045 | fi | |
472fa5ee | 8046 | |
c0c3707f | 8047 | rm -rf conftest.a conftest.d |
98399780 | 8048 | |
5e8754f9 | 8049 | fi |
c0c3707f CB |
8050 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_realpath_works" >&5 |
8051 | $as_echo "$gl_cv_func_realpath_works" >&6; } | |
8052 | case "$gl_cv_func_realpath_works" in | |
8053 | *yes) | |
98399780 | 8054 | |
c0c3707f | 8055 | $as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h |
98399780 | 8056 | |
c0c3707f CB |
8057 | ;; |
8058 | esac | |
725e2999 JB |
8059 | |
8060 | ||
725e2999 | 8061 | |
725e2999 | 8062 | |
725e2999 JB |
8063 | |
8064 | ||
8065 | ||
8066 | ||
8067 | ||
9c9d63b1 PM |
8068 | case "$host_os" in |
8069 | mingw*) ;; | |
8070 | *) for ac_func in getcwd | |
8071 | do : | |
8072 | ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd" | |
8073 | if test "x$ac_cv_func_getcwd" = xyes; then : | |
8074 | cat >>confdefs.h <<_ACEOF | |
8075 | #define HAVE_GETCWD 1 | |
8076 | _ACEOF | |
8077 | ||
8078 | fi | |
8079 | done | |
8080 | ;; | |
8081 | esac | |
8082 | ||
8083 | ||
8084 | ||
8085 | ||
725e2999 JB |
8086 | |
8087 | ||
c0c3707f CB |
8088 | GNULIB_ACCESS=0; |
8089 | GNULIB_CHDIR=0; | |
8090 | GNULIB_CHOWN=0; | |
8091 | GNULIB_CLOSE=0; | |
8092 | GNULIB_COPY_FILE_RANGE=0; | |
8093 | GNULIB_DUP=0; | |
8094 | GNULIB_DUP2=0; | |
8095 | GNULIB_DUP3=0; | |
8096 | GNULIB_ENVIRON=0; | |
8097 | GNULIB_EUIDACCESS=0; | |
9c9d63b1 PM |
8098 | GNULIB_EXECL=0; |
8099 | GNULIB_EXECLE=0; | |
8100 | GNULIB_EXECLP=0; | |
8101 | GNULIB_EXECV=0; | |
8102 | GNULIB_EXECVE=0; | |
8103 | GNULIB_EXECVP=0; | |
8104 | GNULIB_EXECVPE=0; | |
c0c3707f CB |
8105 | GNULIB_FACCESSAT=0; |
8106 | GNULIB_FCHDIR=0; | |
8107 | GNULIB_FCHOWNAT=0; | |
8108 | GNULIB_FDATASYNC=0; | |
8109 | GNULIB_FSYNC=0; | |
8110 | GNULIB_FTRUNCATE=0; | |
8111 | GNULIB_GETCWD=0; | |
8112 | GNULIB_GETDOMAINNAME=0; | |
8113 | GNULIB_GETDTABLESIZE=0; | |
698be2d8 | 8114 | GNULIB_GETENTROPY=0; |
c0c3707f CB |
8115 | GNULIB_GETGROUPS=0; |
8116 | GNULIB_GETHOSTNAME=0; | |
8117 | GNULIB_GETLOGIN=0; | |
8118 | GNULIB_GETLOGIN_R=0; | |
5df4cba6 | 8119 | GNULIB_GETOPT_POSIX=0; |
c0c3707f CB |
8120 | GNULIB_GETPAGESIZE=0; |
8121 | GNULIB_GETPASS=0; | |
8122 | GNULIB_GETUSERSHELL=0; | |
8123 | GNULIB_GROUP_MEMBER=0; | |
8124 | GNULIB_ISATTY=0; | |
8125 | GNULIB_LCHOWN=0; | |
8126 | GNULIB_LINK=0; | |
8127 | GNULIB_LINKAT=0; | |
8128 | GNULIB_LSEEK=0; | |
8129 | GNULIB_PIPE=0; | |
8130 | GNULIB_PIPE2=0; | |
8131 | GNULIB_PREAD=0; | |
8132 | GNULIB_PWRITE=0; | |
8133 | GNULIB_READ=0; | |
8134 | GNULIB_READLINK=0; | |
8135 | GNULIB_READLINKAT=0; | |
8136 | GNULIB_RMDIR=0; | |
8137 | GNULIB_SETHOSTNAME=0; | |
8138 | GNULIB_SLEEP=0; | |
8139 | GNULIB_SYMLINK=0; | |
8140 | GNULIB_SYMLINKAT=0; | |
8141 | GNULIB_TRUNCATE=0; | |
8142 | GNULIB_TTYNAME_R=0; | |
8143 | GNULIB_UNISTD_H_NONBLOCKING=0; | |
8144 | GNULIB_UNISTD_H_SIGPIPE=0; | |
8145 | GNULIB_UNLINK=0; | |
8146 | GNULIB_UNLINKAT=0; | |
8147 | GNULIB_USLEEP=0; | |
8148 | GNULIB_WRITE=0; | |
9c9d63b1 PM |
8149 | GNULIB_MDA_ACCESS=1; |
8150 | GNULIB_MDA_CHDIR=1; | |
8151 | GNULIB_MDA_CLOSE=1; | |
8152 | GNULIB_MDA_DUP=1; | |
8153 | GNULIB_MDA_DUP2=1; | |
8154 | GNULIB_MDA_EXECL=1; | |
8155 | GNULIB_MDA_EXECLE=1; | |
8156 | GNULIB_MDA_EXECLP=1; | |
8157 | GNULIB_MDA_EXECV=1; | |
8158 | GNULIB_MDA_EXECVE=1; | |
8159 | GNULIB_MDA_EXECVP=1; | |
8160 | GNULIB_MDA_EXECVPE=1; | |
8161 | GNULIB_MDA_GETCWD=1; | |
8162 | GNULIB_MDA_GETPID=1; | |
8163 | GNULIB_MDA_ISATTY=1; | |
8164 | GNULIB_MDA_LSEEK=1; | |
8165 | GNULIB_MDA_READ=1; | |
8166 | GNULIB_MDA_RMDIR=1; | |
8167 | GNULIB_MDA_SWAB=1; | |
8168 | GNULIB_MDA_UNLINK=1; | |
8169 | GNULIB_MDA_WRITE=1; | |
c0c3707f CB |
8170 | HAVE_CHOWN=1; |
8171 | HAVE_COPY_FILE_RANGE=1; | |
c0c3707f CB |
8172 | HAVE_DUP3=1; |
8173 | HAVE_EUIDACCESS=1; | |
9c9d63b1 | 8174 | HAVE_EXECVPE=1; |
c0c3707f CB |
8175 | HAVE_FACCESSAT=1; |
8176 | HAVE_FCHDIR=1; | |
8177 | HAVE_FCHOWNAT=1; | |
8178 | HAVE_FDATASYNC=1; | |
8179 | HAVE_FSYNC=1; | |
8180 | HAVE_FTRUNCATE=1; | |
8181 | HAVE_GETDTABLESIZE=1; | |
698be2d8 | 8182 | HAVE_GETENTROPY=1; |
c0c3707f CB |
8183 | HAVE_GETGROUPS=1; |
8184 | HAVE_GETHOSTNAME=1; | |
8185 | HAVE_GETLOGIN=1; | |
8186 | HAVE_GETPAGESIZE=1; | |
8187 | HAVE_GETPASS=1; | |
8188 | HAVE_GROUP_MEMBER=1; | |
8189 | HAVE_LCHOWN=1; | |
8190 | HAVE_LINK=1; | |
8191 | HAVE_LINKAT=1; | |
8192 | HAVE_PIPE=1; | |
8193 | HAVE_PIPE2=1; | |
8194 | HAVE_PREAD=1; | |
8195 | HAVE_PWRITE=1; | |
8196 | HAVE_READLINK=1; | |
8197 | HAVE_READLINKAT=1; | |
8198 | HAVE_SETHOSTNAME=1; | |
8199 | HAVE_SLEEP=1; | |
8200 | HAVE_SYMLINK=1; | |
8201 | HAVE_SYMLINKAT=1; | |
8202 | HAVE_UNLINKAT=1; | |
8203 | HAVE_USLEEP=1; | |
8204 | HAVE_DECL_ENVIRON=1; | |
9c9d63b1 | 8205 | HAVE_DECL_EXECVPE=1; |
c0c3707f CB |
8206 | HAVE_DECL_FCHDIR=1; |
8207 | HAVE_DECL_FDATASYNC=1; | |
8208 | HAVE_DECL_GETDOMAINNAME=1; | |
8209 | HAVE_DECL_GETLOGIN=1; | |
8210 | HAVE_DECL_GETLOGIN_R=1; | |
8211 | HAVE_DECL_GETPAGESIZE=1; | |
8212 | HAVE_DECL_GETUSERSHELL=1; | |
8213 | HAVE_DECL_SETHOSTNAME=1; | |
8214 | HAVE_DECL_TRUNCATE=1; | |
8215 | HAVE_DECL_TTYNAME_R=1; | |
8216 | HAVE_OS_H=0; | |
8217 | HAVE_SYS_PARAM_H=0; | |
8218 | REPLACE_ACCESS=0; | |
8219 | REPLACE_CHOWN=0; | |
8220 | REPLACE_CLOSE=0; | |
8221 | REPLACE_DUP=0; | |
8222 | REPLACE_DUP2=0; | |
9c9d63b1 PM |
8223 | REPLACE_EXECL=0; |
8224 | REPLACE_EXECLE=0; | |
8225 | REPLACE_EXECLP=0; | |
8226 | REPLACE_EXECV=0; | |
8227 | REPLACE_EXECVE=0; | |
8228 | REPLACE_EXECVP=0; | |
8229 | REPLACE_EXECVPE=0; | |
c0c3707f CB |
8230 | REPLACE_FACCESSAT=0; |
8231 | REPLACE_FCHOWNAT=0; | |
8232 | REPLACE_FTRUNCATE=0; | |
8233 | REPLACE_GETCWD=0; | |
8234 | REPLACE_GETDOMAINNAME=0; | |
8235 | REPLACE_GETDTABLESIZE=0; | |
8236 | REPLACE_GETLOGIN_R=0; | |
8237 | REPLACE_GETGROUPS=0; | |
8238 | REPLACE_GETPAGESIZE=0; | |
8239 | REPLACE_GETPASS=0; | |
8240 | REPLACE_ISATTY=0; | |
8241 | REPLACE_LCHOWN=0; | |
8242 | REPLACE_LINK=0; | |
8243 | REPLACE_LINKAT=0; | |
8244 | REPLACE_LSEEK=0; | |
8245 | REPLACE_PREAD=0; | |
8246 | REPLACE_PWRITE=0; | |
8247 | REPLACE_READ=0; | |
8248 | REPLACE_READLINK=0; | |
8249 | REPLACE_READLINKAT=0; | |
8250 | REPLACE_RMDIR=0; | |
8251 | REPLACE_SLEEP=0; | |
8252 | REPLACE_SYMLINK=0; | |
8253 | REPLACE_SYMLINKAT=0; | |
8254 | REPLACE_TRUNCATE=0; | |
8255 | REPLACE_TTYNAME_R=0; | |
8256 | REPLACE_UNLINK=0; | |
8257 | REPLACE_UNLINKAT=0; | |
8258 | REPLACE_USLEEP=0; | |
8259 | REPLACE_WRITE=0; | |
698be2d8 | 8260 | UNISTD_H_HAVE_SYS_RANDOM_H=0; |
c0c3707f CB |
8261 | UNISTD_H_HAVE_WINSOCK2_H=0; |
8262 | UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; | |
725e2999 | 8263 | |
725e2999 | 8264 | |
725e2999 JB |
8265 | |
8266 | ||
8267 | ||
725e2999 | 8268 | |
725e2999 | 8269 | |
725e2999 JB |
8270 | |
8271 | ||
c0c3707f CB |
8272 | |
8273 | ||
8274 | if test $ac_cv_func__set_invalid_parameter_handler = yes; then | |
8275 | HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 | |
8276 | ||
8277 | $as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h | |
8278 | ||
725e2999 | 8279 | else |
c0c3707f | 8280 | HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 |
725e2999 JB |
8281 | fi |
8282 | ||
8283 | ||
8284 | ||
8285 | ||
8286 | ||
c0c3707f CB |
8287 | GNULIB_OPENDIR=0; |
8288 | GNULIB_READDIR=0; | |
8289 | GNULIB_REWINDDIR=0; | |
8290 | GNULIB_CLOSEDIR=0; | |
8291 | GNULIB_DIRFD=0; | |
8292 | GNULIB_FDOPENDIR=0; | |
8293 | GNULIB_SCANDIR=0; | |
8294 | GNULIB_ALPHASORT=0; | |
8295 | HAVE_OPENDIR=1; | |
8296 | HAVE_READDIR=1; | |
8297 | HAVE_REWINDDIR=1; | |
8298 | HAVE_CLOSEDIR=1; | |
8299 | HAVE_DECL_DIRFD=1; | |
8300 | HAVE_DECL_FDOPENDIR=1; | |
8301 | HAVE_FDOPENDIR=1; | |
8302 | HAVE_SCANDIR=1; | |
8303 | HAVE_ALPHASORT=1; | |
8304 | REPLACE_OPENDIR=0; | |
8305 | REPLACE_CLOSEDIR=0; | |
8306 | REPLACE_DIRFD=0; | |
8307 | REPLACE_FDOPENDIR=0; | |
725e2999 JB |
8308 | |
8309 | ||
698be2d8 CB |
8310 | GNULIB_ISBLANK=0; |
8311 | HAVE_ISBLANK=1; | |
8312 | ||
8313 | ||
725e2999 | 8314 | |
9c9d63b1 PM |
8315 | gl_mda_defines=' |
8316 | #if defined _WIN32 && !defined __CYGWIN__ | |
8317 | #define access _access | |
8318 | #define chdir _chdir | |
8319 | #define chmod _chmod | |
8320 | #define close _close | |
8321 | #define creat _creat | |
8322 | #define dup _dup | |
8323 | #define dup2 _dup2 | |
8324 | #define ecvt _ecvt | |
8325 | #define execl _execl | |
8326 | #define execle _execle | |
8327 | #define execlp _execlp | |
8328 | #define execv _execv | |
8329 | #define execve _execve | |
8330 | #define execvp _execvp | |
8331 | #define execvpe _execvpe | |
8332 | #define fcloseall _fcloseall | |
8333 | #define fcvt _fcvt | |
8334 | #define fdopen _fdopen | |
8335 | #define fileno _fileno | |
8336 | #define gcvt _gcvt | |
8337 | #define getcwd _getcwd | |
8338 | #define getpid _getpid | |
8339 | #define getw _getw | |
8340 | #define isatty _isatty | |
8341 | #define j0 _j0 | |
8342 | #define j1 _j1 | |
8343 | #define jn _jn | |
8344 | #define lfind _lfind | |
8345 | #define lsearch _lsearch | |
8346 | #define lseek _lseek | |
8347 | #define memccpy _memccpy | |
8348 | #define mkdir _mkdir | |
8349 | #define mktemp _mktemp | |
8350 | #define open _open | |
8351 | #define putenv _putenv | |
8352 | #define putw _putw | |
8353 | #define read _read | |
8354 | #define rmdir _rmdir | |
8355 | #define strdup _strdup | |
8356 | #define swab _swab | |
8357 | #define tempnam _tempnam | |
8358 | #define tzset _tzset | |
8359 | #define umask _umask | |
8360 | #define unlink _unlink | |
8361 | #define utime _utime | |
8362 | #define wcsdup _wcsdup | |
8363 | #define write _write | |
8364 | #define y0 _y0 | |
8365 | #define y1 _y1 | |
8366 | #define yn _yn | |
8367 | #endif | |
8368 | ' | |
8369 | ||
725e2999 | 8370 | |
725e2999 JB |
8371 | |
8372 | ||
8373 | ||
8374 | ||
725e2999 JB |
8375 | |
8376 | ||
c0c3707f CB |
8377 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5 |
8378 | $as_echo_n "checking if environ is properly declared... " >&6; } | |
8379 | if ${gt_cv_var_environ_declaration+:} false; then : | |
725e2999 JB |
8380 | $as_echo_n "(cached) " >&6 |
8381 | else | |
c0c3707f CB |
8382 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8383 | /* end confdefs.h. */ | |
8384 | #if HAVE_UNISTD_H | |
8385 | #include <unistd.h> | |
8386 | #endif | |
8387 | /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */ | |
8388 | #include <stdlib.h> | |
725e2999 | 8389 | |
c0c3707f CB |
8390 | extern struct { int foo; } environ; |
8391 | int | |
8392 | main () | |
8393 | { | |
8394 | environ.foo = 1; | |
8395 | ; | |
8396 | return 0; | |
8397 | } | |
8398 | _ACEOF | |
8399 | if ac_fn_c_try_compile "$LINENO"; then : | |
8400 | gt_cv_var_environ_declaration=no | |
8401 | else | |
8402 | gt_cv_var_environ_declaration=yes | |
725e2999 | 8403 | fi |
c0c3707f CB |
8404 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
8405 | fi | |
8406 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5 | |
8407 | $as_echo "$gt_cv_var_environ_declaration" >&6; } | |
8408 | if test $gt_cv_var_environ_declaration = yes; then | |
8409 | ||
8410 | $as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h | |
725e2999 | 8411 | |
725e2999 | 8412 | fi |
725e2999 JB |
8413 | |
8414 | ||
c0c3707f CB |
8415 | if test $gt_cv_var_environ_declaration != yes; then |
8416 | HAVE_DECL_ENVIRON=0 | |
8417 | fi | |
6ec2e0f5 SDJ |
8418 | |
8419 | ||
8420 | ||
c0c3707f CB |
8421 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5 |
8422 | $as_echo_n "checking for complete errno.h... " >&6; } | |
8423 | if ${gl_cv_header_errno_h_complete+:} false; then : | |
8424 | $as_echo_n "(cached) " >&6 | |
8425 | else | |
6ec2e0f5 | 8426 | |
c0c3707f CB |
8427 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8428 | /* end confdefs.h. */ | |
472fa5ee | 8429 | |
c0c3707f CB |
8430 | #include <errno.h> |
8431 | #if !defined ETXTBSY | |
8432 | booboo | |
8433 | #endif | |
8434 | #if !defined ENOMSG | |
8435 | booboo | |
8436 | #endif | |
8437 | #if !defined EIDRM | |
8438 | booboo | |
8439 | #endif | |
8440 | #if !defined ENOLINK | |
8441 | booboo | |
8442 | #endif | |
8443 | #if !defined EPROTO | |
8444 | booboo | |
8445 | #endif | |
8446 | #if !defined EMULTIHOP | |
8447 | booboo | |
8448 | #endif | |
8449 | #if !defined EBADMSG | |
8450 | booboo | |
8451 | #endif | |
8452 | #if !defined EOVERFLOW | |
8453 | booboo | |
8454 | #endif | |
8455 | #if !defined ENOTSUP | |
8456 | booboo | |
8457 | #endif | |
8458 | #if !defined ENETRESET | |
8459 | booboo | |
8460 | #endif | |
8461 | #if !defined ECONNABORTED | |
8462 | booboo | |
8463 | #endif | |
8464 | #if !defined ESTALE | |
8465 | booboo | |
8466 | #endif | |
8467 | #if !defined EDQUOT | |
8468 | booboo | |
8469 | #endif | |
8470 | #if !defined ECANCELED | |
8471 | booboo | |
8472 | #endif | |
8473 | #if !defined EOWNERDEAD | |
8474 | booboo | |
8475 | #endif | |
8476 | #if !defined ENOTRECOVERABLE | |
8477 | booboo | |
8478 | #endif | |
8479 | #if !defined EILSEQ | |
8480 | booboo | |
8481 | #endif | |
472fa5ee | 8482 | |
c0c3707f CB |
8483 | _ACEOF |
8484 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
8485 | $EGREP "booboo" >/dev/null 2>&1; then : | |
8486 | gl_cv_header_errno_h_complete=no | |
8487 | else | |
8488 | gl_cv_header_errno_h_complete=yes | |
5e8754f9 | 8489 | fi |
c0c3707f | 8490 | rm -f conftest* |
472fa5ee SM |
8491 | |
8492 | ||
c0c3707f CB |
8493 | fi |
8494 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5 | |
8495 | $as_echo "$gl_cv_header_errno_h_complete" >&6; } | |
8496 | if test $gl_cv_header_errno_h_complete = yes; then | |
8497 | ERRNO_H='' | |
8498 | else | |
472fa5ee SM |
8499 | |
8500 | ||
8501 | ||
8502 | ||
8503 | ||
472fa5ee SM |
8504 | |
8505 | ||
8506 | ||
c0c3707f CB |
8507 | if test $gl_cv_have_include_next = yes; then |
8508 | gl_cv_next_errno_h='<'errno.h'>' | |
8509 | else | |
8510 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5 | |
8511 | $as_echo_n "checking absolute name of <errno.h>... " >&6; } | |
8512 | if ${gl_cv_next_errno_h+:} false; then : | |
5e8754f9 SDJ |
8513 | $as_echo_n "(cached) " >&6 |
8514 | else | |
6ec2e0f5 | 8515 | |
6ec2e0f5 | 8516 | |
6ec2e0f5 | 8517 | |
c0c3707f CB |
8518 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8519 | /* end confdefs.h. */ | |
8520 | #include <errno.h> | |
8521 | _ACEOF | |
8522 | case "$host_os" in | |
8523 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
8524 | *) gl_absname_cpp="$ac_cpp" ;; | |
8525 | esac | |
6ec2e0f5 | 8526 | |
c0c3707f CB |
8527 | case "$host_os" in |
8528 | mingw*) | |
8529 | gl_dirsep_regex='[/\\]' | |
8530 | ;; | |
8531 | *) | |
8532 | gl_dirsep_regex='\/' | |
8533 | ;; | |
8534 | esac | |
8535 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
8536 | gl_header_literal_regex=`echo 'errno.h' \ | |
8537 | | sed -e "$gl_make_literal_regex_sed"` | |
8538 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
8539 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
8540 | s|^/[^/]|//&| | |
8541 | p | |
8542 | q | |
8543 | }' | |
6ec2e0f5 | 8544 | |
c0c3707f CB |
8545 | gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
8546 | sed -n "$gl_absolute_header_sed"` | |
6ec2e0f5 | 8547 | |
c0c3707f CB |
8548 | gl_header=$gl_cv_absolute_errno_h |
8549 | gl_cv_next_errno_h='"'$gl_header'"' | |
6ec2e0f5 SDJ |
8550 | |
8551 | ||
c0c3707f CB |
8552 | fi |
8553 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5 | |
8554 | $as_echo "$gl_cv_next_errno_h" >&6; } | |
8555 | fi | |
8556 | NEXT_ERRNO_H=$gl_cv_next_errno_h | |
6ec2e0f5 | 8557 | |
c0c3707f CB |
8558 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
8559 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
8560 | gl_next_as_first_directive='<'errno.h'>' | |
8561 | else | |
8562 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
8563 | gl_next_as_first_directive=$gl_cv_next_errno_h | |
8564 | fi | |
8565 | NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive | |
6ec2e0f5 | 8566 | |
472fa5ee SM |
8567 | |
8568 | ||
8569 | ||
c0c3707f CB |
8570 | ERRNO_H='errno.h' |
8571 | fi | |
472fa5ee | 8572 | |
c0c3707f CB |
8573 | if test -n "$ERRNO_H"; then |
8574 | GL_GENERATE_ERRNO_H_TRUE= | |
8575 | GL_GENERATE_ERRNO_H_FALSE='#' | |
5e8754f9 | 8576 | else |
c0c3707f CB |
8577 | GL_GENERATE_ERRNO_H_TRUE='#' |
8578 | GL_GENERATE_ERRNO_H_FALSE= | |
8579 | fi | |
472fa5ee SM |
8580 | |
8581 | ||
c0c3707f CB |
8582 | if test -n "$ERRNO_H"; then |
8583 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5 | |
8584 | $as_echo_n "checking for EMULTIHOP value... " >&6; } | |
8585 | if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then : | |
8586 | $as_echo_n "(cached) " >&6 | |
5e8754f9 | 8587 | else |
e26b6bb0 | 8588 | |
c0c3707f CB |
8589 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8590 | /* end confdefs.h. */ | |
e26b6bb0 | 8591 | |
c0c3707f CB |
8592 | #include <errno.h> |
8593 | #ifdef EMULTIHOP | |
8594 | yes | |
88b48903 | 8595 | #endif |
88b48903 | 8596 | |
c0c3707f CB |
8597 | _ACEOF |
8598 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
8599 | $EGREP "yes" >/dev/null 2>&1; then : | |
8600 | gl_cv_header_errno_h_EMULTIHOP=yes | |
8601 | else | |
8602 | gl_cv_header_errno_h_EMULTIHOP=no | |
8603 | fi | |
8604 | rm -f conftest* | |
88b48903 | 8605 | |
c0c3707f CB |
8606 | if test $gl_cv_header_errno_h_EMULTIHOP = no; then |
8607 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8608 | /* end confdefs.h. */ | |
88b48903 | 8609 | |
c0c3707f CB |
8610 | #define _XOPEN_SOURCE_EXTENDED 1 |
8611 | #include <errno.h> | |
8612 | #ifdef EMULTIHOP | |
8613 | yes | |
8614 | #endif | |
88b48903 WN |
8615 | |
8616 | _ACEOF | |
c0c3707f CB |
8617 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
8618 | $EGREP "yes" >/dev/null 2>&1; then : | |
8619 | gl_cv_header_errno_h_EMULTIHOP=hidden | |
88b48903 | 8620 | fi |
c0c3707f | 8621 | rm -f conftest* |
88b48903 | 8622 | |
c0c3707f CB |
8623 | if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then |
8624 | if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" " | |
8625 | #define _XOPEN_SOURCE_EXTENDED 1 | |
8626 | #include <errno.h> | |
8627 | /* The following two lines are a workaround against an autoconf-2.52 bug. */ | |
8628 | #include <stdio.h> | |
8629 | #include <stdlib.h> | |
8630 | "; then : | |
88b48903 WN |
8631 | |
8632 | fi | |
88b48903 | 8633 | |
c0c3707f CB |
8634 | fi |
8635 | fi | |
88b48903 | 8636 | |
c0c3707f CB |
8637 | fi |
8638 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 | |
8639 | $as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; } | |
8640 | case $gl_cv_header_errno_h_EMULTIHOP in | |
8641 | yes | no) | |
8642 | EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE= | |
8643 | ;; | |
8644 | *) | |
8645 | EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP" | |
8646 | ;; | |
8647 | esac | |
88b48903 | 8648 | |
e26b6bb0 | 8649 | |
c0c3707f | 8650 | fi |
e26b6bb0 | 8651 | |
3d99e817 | 8652 | |
c0c3707f CB |
8653 | if test -n "$ERRNO_H"; then |
8654 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5 | |
8655 | $as_echo_n "checking for ENOLINK value... " >&6; } | |
8656 | if ${gl_cv_header_errno_h_ENOLINK+:} false; then : | |
8657 | $as_echo_n "(cached) " >&6 | |
8658 | else | |
472fa5ee | 8659 | |
c0c3707f CB |
8660 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8661 | /* end confdefs.h. */ | |
472fa5ee | 8662 | |
c0c3707f CB |
8663 | #include <errno.h> |
8664 | #ifdef ENOLINK | |
8665 | yes | |
8666 | #endif | |
472fa5ee | 8667 | |
c0c3707f CB |
8668 | _ACEOF |
8669 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
8670 | $EGREP "yes" >/dev/null 2>&1; then : | |
8671 | gl_cv_header_errno_h_ENOLINK=yes | |
8672 | else | |
8673 | gl_cv_header_errno_h_ENOLINK=no | |
8674 | fi | |
8675 | rm -f conftest* | |
472fa5ee | 8676 | |
c0c3707f CB |
8677 | if test $gl_cv_header_errno_h_ENOLINK = no; then |
8678 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8679 | /* end confdefs.h. */ | |
3d99e817 | 8680 | |
c0c3707f CB |
8681 | #define _XOPEN_SOURCE_EXTENDED 1 |
8682 | #include <errno.h> | |
8683 | #ifdef ENOLINK | |
8684 | yes | |
8685 | #endif | |
3d99e817 | 8686 | |
c0c3707f CB |
8687 | _ACEOF |
8688 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
8689 | $EGREP "yes" >/dev/null 2>&1; then : | |
8690 | gl_cv_header_errno_h_ENOLINK=hidden | |
8691 | fi | |
8692 | rm -f conftest* | |
3d99e817 | 8693 | |
c0c3707f CB |
8694 | if test $gl_cv_header_errno_h_ENOLINK = hidden; then |
8695 | if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" " | |
8696 | #define _XOPEN_SOURCE_EXTENDED 1 | |
8697 | #include <errno.h> | |
8698 | /* The following two lines are a workaround against an autoconf-2.52 bug. */ | |
8699 | #include <stdio.h> | |
8700 | #include <stdlib.h> | |
8701 | "; then : | |
3d99e817 | 8702 | |
c0c3707f | 8703 | fi |
3d99e817 | 8704 | |
c0c3707f CB |
8705 | fi |
8706 | fi | |
3d99e817 | 8707 | |
c0c3707f CB |
8708 | fi |
8709 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5 | |
8710 | $as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; } | |
8711 | case $gl_cv_header_errno_h_ENOLINK in | |
8712 | yes | no) | |
8713 | ENOLINK_HIDDEN=0; ENOLINK_VALUE= | |
8714 | ;; | |
8715 | *) | |
8716 | ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK" | |
8717 | ;; | |
8718 | esac | |
18848e28 | 8719 | |
18848e28 | 8720 | |
c0c3707f | 8721 | fi |
18848e28 | 8722 | |
18848e28 | 8723 | |
c0c3707f CB |
8724 | if test -n "$ERRNO_H"; then |
8725 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5 | |
8726 | $as_echo_n "checking for EOVERFLOW value... " >&6; } | |
8727 | if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then : | |
8728 | $as_echo_n "(cached) " >&6 | |
8729 | else | |
18848e28 | 8730 | |
c0c3707f CB |
8731 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8732 | /* end confdefs.h. */ | |
18848e28 | 8733 | |
c0c3707f CB |
8734 | #include <errno.h> |
8735 | #ifdef EOVERFLOW | |
8736 | yes | |
8737 | #endif | |
18848e28 | 8738 | |
c0c3707f CB |
8739 | _ACEOF |
8740 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
8741 | $EGREP "yes" >/dev/null 2>&1; then : | |
8742 | gl_cv_header_errno_h_EOVERFLOW=yes | |
8743 | else | |
8744 | gl_cv_header_errno_h_EOVERFLOW=no | |
8745 | fi | |
8746 | rm -f conftest* | |
18848e28 | 8747 | |
c0c3707f CB |
8748 | if test $gl_cv_header_errno_h_EOVERFLOW = no; then |
8749 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8750 | /* end confdefs.h. */ | |
18848e28 | 8751 | |
c0c3707f CB |
8752 | #define _XOPEN_SOURCE_EXTENDED 1 |
8753 | #include <errno.h> | |
8754 | #ifdef EOVERFLOW | |
8755 | yes | |
8756 | #endif | |
18848e28 | 8757 | |
c0c3707f CB |
8758 | _ACEOF |
8759 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
8760 | $EGREP "yes" >/dev/null 2>&1; then : | |
8761 | gl_cv_header_errno_h_EOVERFLOW=hidden | |
8762 | fi | |
8763 | rm -f conftest* | |
18848e28 | 8764 | |
c0c3707f CB |
8765 | if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then |
8766 | if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" " | |
8767 | #define _XOPEN_SOURCE_EXTENDED 1 | |
8768 | #include <errno.h> | |
8769 | /* The following two lines are a workaround against an autoconf-2.52 bug. */ | |
8770 | #include <stdio.h> | |
8771 | #include <stdlib.h> | |
8772 | "; then : | |
18848e28 | 8773 | |
c0c3707f | 8774 | fi |
18848e28 | 8775 | |
c0c3707f CB |
8776 | fi |
8777 | fi | |
18848e28 | 8778 | |
c0c3707f CB |
8779 | fi |
8780 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 | |
8781 | $as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; } | |
8782 | case $gl_cv_header_errno_h_EOVERFLOW in | |
8783 | yes | no) | |
8784 | EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE= | |
8785 | ;; | |
8786 | *) | |
8787 | EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW" | |
8788 | ;; | |
8789 | esac | |
4a626d0a PA |
8790 | |
8791 | ||
c0c3707f | 8792 | fi |
18848e28 | 8793 | |
4a626d0a | 8794 | |
c0c3707f CB |
8795 | ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" |
8796 | if test "x$ac_cv_have_decl_strerror_r" = xyes; then : | |
8797 | ac_have_decl=1 | |
8798 | else | |
8799 | ac_have_decl=0 | |
8800 | fi | |
4a626d0a | 8801 | |
c0c3707f CB |
8802 | cat >>confdefs.h <<_ACEOF |
8803 | #define HAVE_DECL_STRERROR_R $ac_have_decl | |
8804 | _ACEOF | |
4a626d0a | 8805 | |
c0c3707f CB |
8806 | for ac_func in strerror_r |
8807 | do : | |
8808 | ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" | |
8809 | if test "x$ac_cv_func_strerror_r" = xyes; then : | |
8810 | cat >>confdefs.h <<_ACEOF | |
8811 | #define HAVE_STRERROR_R 1 | |
8812 | _ACEOF | |
4a626d0a | 8813 | |
c0c3707f CB |
8814 | fi |
8815 | done | |
18848e28 | 8816 | |
c0c3707f CB |
8817 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 |
8818 | $as_echo_n "checking whether strerror_r returns char *... " >&6; } | |
8819 | if ${ac_cv_func_strerror_r_char_p+:} false; then : | |
8820 | $as_echo_n "(cached) " >&6 | |
8821 | else | |
18848e28 | 8822 | |
c0c3707f CB |
8823 | ac_cv_func_strerror_r_char_p=no |
8824 | if test $ac_cv_have_decl_strerror_r = yes; then | |
8825 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8826 | /* end confdefs.h. */ | |
8827 | $ac_includes_default | |
8828 | int | |
8829 | main () | |
8830 | { | |
18848e28 | 8831 | |
c0c3707f CB |
8832 | char buf[100]; |
8833 | char x = *strerror_r (0, buf, sizeof buf); | |
8834 | char *p = strerror_r (0, buf, sizeof buf); | |
8835 | return !p || x; | |
18848e28 | 8836 | |
c0c3707f CB |
8837 | ; |
8838 | return 0; | |
8839 | } | |
8840 | _ACEOF | |
8841 | if ac_fn_c_try_compile "$LINENO"; then : | |
8842 | ac_cv_func_strerror_r_char_p=yes | |
8843 | fi | |
8844 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
8845 | else | |
8846 | # strerror_r is not declared. Choose between | |
8847 | # systems that have relatively inaccessible declarations for the | |
8848 | # function. BeOS and DEC UNIX 4.0 fall in this category, but the | |
8849 | # former has a strerror_r that returns char*, while the latter | |
8850 | # has a strerror_r that returns `int'. | |
8851 | # This test should segfault on the DEC system. | |
8852 | if test "$cross_compiling" = yes; then : | |
8853 | : | |
8854 | else | |
8855 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8856 | /* end confdefs.h. */ | |
8857 | $ac_includes_default | |
8858 | extern char *strerror_r (); | |
8859 | int | |
8860 | main () | |
8861 | { | |
8862 | char buf[100]; | |
8863 | char x = *strerror_r (0, buf, sizeof buf); | |
8864 | return ! isalpha (x); | |
8865 | ; | |
8866 | return 0; | |
8867 | } | |
8868 | _ACEOF | |
8869 | if ac_fn_c_try_run "$LINENO"; then : | |
8870 | ac_cv_func_strerror_r_char_p=yes | |
8871 | fi | |
8872 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
8873 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
8874 | fi | |
18848e28 | 8875 | |
c0c3707f | 8876 | fi |
18848e28 | 8877 | |
c0c3707f CB |
8878 | fi |
8879 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 | |
8880 | $as_echo "$ac_cv_func_strerror_r_char_p" >&6; } | |
8881 | if test $ac_cv_func_strerror_r_char_p = yes; then | |
18848e28 | 8882 | |
c0c3707f | 8883 | $as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h |
18848e28 | 8884 | |
c0c3707f | 8885 | fi |
18848e28 | 8886 | |
18848e28 | 8887 | |
18848e28 | 8888 | |
18848e28 | 8889 | |
c0c3707f CB |
8890 | ac_fn_c_check_decl "$LINENO" "fchdir" "ac_cv_have_decl_fchdir" "$ac_includes_default" |
8891 | if test "x$ac_cv_have_decl_fchdir" = xyes; then : | |
8892 | ac_have_decl=1 | |
8893 | else | |
8894 | ac_have_decl=0 | |
8895 | fi | |
18848e28 | 8896 | |
c0c3707f CB |
8897 | cat >>confdefs.h <<_ACEOF |
8898 | #define HAVE_DECL_FCHDIR $ac_have_decl | |
8899 | _ACEOF | |
18848e28 | 8900 | |
18848e28 | 8901 | |
c0c3707f CB |
8902 | GNULIB_CREAT=0; |
8903 | GNULIB_FCNTL=0; | |
8904 | GNULIB_NONBLOCKING=0; | |
8905 | GNULIB_OPEN=0; | |
8906 | GNULIB_OPENAT=0; | |
9c9d63b1 PM |
8907 | GNULIB_MDA_CREAT=1; |
8908 | GNULIB_MDA_OPEN=1; | |
c0c3707f CB |
8909 | HAVE_FCNTL=1; |
8910 | HAVE_OPENAT=1; | |
8911 | REPLACE_CREAT=0; | |
8912 | REPLACE_FCNTL=0; | |
8913 | REPLACE_OPEN=0; | |
8914 | REPLACE_OPENAT=0; | |
18848e28 | 8915 | |
18848e28 | 8916 | |
18848e28 | 8917 | |
18848e28 GF |
8918 | |
8919 | ||
18848e28 GF |
8920 | |
8921 | ||
18848e28 | 8922 | |
18848e28 | 8923 | |
18848e28 | 8924 | |
c0c3707f CB |
8925 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 |
8926 | $as_echo_n "checking for working fcntl.h... " >&6; } | |
8927 | if ${gl_cv_header_working_fcntl_h+:} false; then : | |
8928 | $as_echo_n "(cached) " >&6 | |
8929 | else | |
8930 | if test "$cross_compiling" = yes; then : | |
8931 | case "$host_os" in | |
8932 | # Guess 'no' on native Windows. | |
8933 | mingw*) gl_cv_header_working_fcntl_h='no' ;; | |
8934 | *) gl_cv_header_working_fcntl_h=cross-compiling ;; | |
8935 | esac | |
18848e28 | 8936 | |
c0c3707f CB |
8937 | else |
8938 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8939 | /* end confdefs.h. */ | |
8940 | #include <sys/types.h> | |
8941 | #include <sys/stat.h> | |
8942 | #if HAVE_UNISTD_H | |
8943 | # include <unistd.h> | |
8944 | #else /* on Windows with MSVC */ | |
8945 | # include <io.h> | |
8946 | # include <stdlib.h> | |
8947 | # defined sleep(n) _sleep ((n) * 1000) | |
8948 | #endif | |
8949 | #include <fcntl.h> | |
9c9d63b1 PM |
8950 | |
8951 | ||
8952 | $gl_mda_defines | |
8953 | ||
c0c3707f CB |
8954 | #ifndef O_NOATIME |
8955 | #define O_NOATIME 0 | |
8956 | #endif | |
8957 | #ifndef O_NOFOLLOW | |
8958 | #define O_NOFOLLOW 0 | |
8959 | #endif | |
8960 | static int const constants[] = | |
8961 | { | |
8962 | O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, | |
8963 | O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY | |
8964 | }; | |
18848e28 | 8965 | |
c0c3707f CB |
8966 | int |
8967 | main () | |
8968 | { | |
18848e28 | 8969 | |
c0c3707f CB |
8970 | int result = !constants; |
8971 | #if HAVE_SYMLINK | |
8972 | { | |
8973 | static char const sym[] = "conftest.sym"; | |
8974 | if (symlink ("/dev/null", sym) != 0) | |
8975 | result |= 2; | |
8976 | else | |
8977 | { | |
8978 | int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); | |
8979 | if (fd >= 0) | |
8980 | { | |
8981 | close (fd); | |
8982 | result |= 4; | |
8983 | } | |
8984 | } | |
8985 | if (unlink (sym) != 0 || symlink (".", sym) != 0) | |
8986 | result |= 2; | |
8987 | else | |
8988 | { | |
8989 | int fd = open (sym, O_RDONLY | O_NOFOLLOW); | |
8990 | if (fd >= 0) | |
8991 | { | |
8992 | close (fd); | |
8993 | result |= 4; | |
8994 | } | |
8995 | } | |
8996 | unlink (sym); | |
8997 | } | |
8998 | #endif | |
8999 | { | |
9000 | static char const file[] = "confdefs.h"; | |
9001 | int fd = open (file, O_RDONLY | O_NOATIME); | |
9002 | if (fd < 0) | |
9003 | result |= 8; | |
9004 | else | |
9005 | { | |
9006 | struct stat st0; | |
9007 | if (fstat (fd, &st0) != 0) | |
9008 | result |= 16; | |
9009 | else | |
9010 | { | |
9011 | char c; | |
9012 | sleep (1); | |
9013 | if (read (fd, &c, 1) != 1) | |
9014 | result |= 24; | |
9015 | else | |
9016 | { | |
9017 | if (close (fd) != 0) | |
9018 | result |= 32; | |
9019 | else | |
9020 | { | |
9021 | struct stat st1; | |
9022 | if (stat (file, &st1) != 0) | |
9023 | result |= 40; | |
9024 | else | |
9025 | if (st0.st_atime != st1.st_atime) | |
9026 | result |= 64; | |
9027 | } | |
9028 | } | |
9029 | } | |
9030 | } | |
9031 | } | |
9032 | return result; | |
9033 | ; | |
9034 | return 0; | |
9035 | } | |
9036 | _ACEOF | |
9037 | if ac_fn_c_try_run "$LINENO"; then : | |
9038 | gl_cv_header_working_fcntl_h=yes | |
9039 | else | |
9040 | case $? in #( | |
9041 | 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( | |
9042 | 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( | |
9043 | 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( | |
9044 | *) gl_cv_header_working_fcntl_h='no';; | |
9045 | esac | |
9046 | fi | |
9047 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
9048 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
9049 | fi | |
18848e28 | 9050 | |
18848e28 | 9051 | |
c0c3707f CB |
9052 | fi |
9053 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 | |
9054 | $as_echo "$gl_cv_header_working_fcntl_h" >&6; } | |
18848e28 | 9055 | |
c0c3707f CB |
9056 | case $gl_cv_header_working_fcntl_h in #( |
9057 | *O_NOATIME* | no | cross-compiling) ac_val=0;; #( | |
9058 | *) ac_val=1;; | |
9059 | esac | |
18848e28 | 9060 | |
c0c3707f CB |
9061 | cat >>confdefs.h <<_ACEOF |
9062 | #define HAVE_WORKING_O_NOATIME $ac_val | |
9063 | _ACEOF | |
18848e28 GF |
9064 | |
9065 | ||
c0c3707f CB |
9066 | case $gl_cv_header_working_fcntl_h in #( |
9067 | *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( | |
9068 | *) ac_val=1;; | |
9069 | esac | |
18848e28 | 9070 | |
c0c3707f CB |
9071 | cat >>confdefs.h <<_ACEOF |
9072 | #define HAVE_WORKING_O_NOFOLLOW $ac_val | |
9073 | _ACEOF | |
18848e28 | 9074 | |
63ce7108 | 9075 | |
9c9d63b1 PM |
9076 | |
9077 | ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default | |
9078 | " | |
c0c3707f | 9079 | if test "x$ac_cv_type_pid_t" = xyes; then : |
63ce7108 | 9080 | |
c0c3707f | 9081 | else |
9c9d63b1 PM |
9082 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
9083 | /* end confdefs.h. */ | |
9084 | ||
9085 | #if defined _WIN64 && !defined __CYGWIN__ | |
9086 | LLP64 | |
9087 | #endif | |
9088 | ||
9089 | int | |
9090 | main () | |
9091 | { | |
9092 | ||
9093 | ; | |
9094 | return 0; | |
9095 | } | |
9096 | ||
9097 | _ACEOF | |
9098 | if ac_fn_c_try_compile "$LINENO"; then : | |
9099 | gl_pid_type='int' | |
9100 | else | |
9101 | gl_pid_type='__int64' | |
9102 | fi | |
9103 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
63ce7108 | 9104 | |
c0c3707f | 9105 | cat >>confdefs.h <<_ACEOF |
9c9d63b1 | 9106 | #define pid_t $gl_pid_type |
c0c3707f | 9107 | _ACEOF |
63ce7108 | 9108 | |
9c9d63b1 | 9109 | |
c0c3707f | 9110 | fi |
63ce7108 | 9111 | |
9c9d63b1 | 9112 | |
c0c3707f CB |
9113 | ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" |
9114 | if test "x$ac_cv_type_mode_t" = xyes; then : | |
63ce7108 | 9115 | |
c0c3707f | 9116 | else |
63ce7108 | 9117 | |
c0c3707f CB |
9118 | cat >>confdefs.h <<_ACEOF |
9119 | #define mode_t int | |
9120 | _ACEOF | |
63ce7108 | 9121 | |
c0c3707f | 9122 | fi |
63ce7108 | 9123 | |
472fa5ee SM |
9124 | |
9125 | ||
9126 | ||
9127 | ||
9128 | ||
c0c3707f CB |
9129 | GNULIB_FNMATCH=0; |
9130 | HAVE_FNMATCH=1; | |
9131 | REPLACE_FNMATCH=0; | |
472fa5ee SM |
9132 | |
9133 | ||
9134 | ||
9135 | ||
9136 | ||
9137 | ||
472fa5ee SM |
9138 | |
9139 | ||
472fa5ee SM |
9140 | |
9141 | ||
9142 | ||
9143 | ||
9144 | ||
9145 | ||
9146 | ||
9147 | ||
7a6dbc2f | 9148 | if test $gl_cv_have_include_next = yes; then |
c0c3707f | 9149 | gl_cv_next_fnmatch_h='<'fnmatch.h'>' |
7a6dbc2f | 9150 | else |
c0c3707f CB |
9151 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fnmatch.h>" >&5 |
9152 | $as_echo_n "checking absolute name of <fnmatch.h>... " >&6; } | |
9153 | if ${gl_cv_next_fnmatch_h+:} false; then : | |
7a6dbc2f SDJ |
9154 | $as_echo_n "(cached) " >&6 |
9155 | else | |
472fa5ee | 9156 | |
c0c3707f CB |
9157 | if test $ac_cv_header_fnmatch_h = yes; then |
9158 | ||
9159 | ||
472fa5ee SM |
9160 | |
9161 | ||
7a6dbc2f SDJ |
9162 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
9163 | /* end confdefs.h. */ | |
c0c3707f | 9164 | #include <fnmatch.h> |
7a6dbc2f SDJ |
9165 | _ACEOF |
9166 | case "$host_os" in | |
9167 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
9168 | *) gl_absname_cpp="$ac_cpp" ;; | |
9169 | esac | |
472fa5ee | 9170 | |
7a6dbc2f SDJ |
9171 | case "$host_os" in |
9172 | mingw*) | |
9173 | gl_dirsep_regex='[/\\]' | |
9174 | ;; | |
9175 | *) | |
9176 | gl_dirsep_regex='\/' | |
9177 | ;; | |
9178 | esac | |
9179 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
c0c3707f | 9180 | gl_header_literal_regex=`echo 'fnmatch.h' \ |
7a6dbc2f SDJ |
9181 | | sed -e "$gl_make_literal_regex_sed"` |
9182 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
9183 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
9184 | s|^/[^/]|//&| | |
9185 | p | |
9186 | q | |
9187 | }' | |
9188 | ||
c0c3707f | 9189 | gl_cv_absolute_fnmatch_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
7a6dbc2f SDJ |
9190 | sed -n "$gl_absolute_header_sed"` |
9191 | ||
c0c3707f CB |
9192 | gl_header=$gl_cv_absolute_fnmatch_h |
9193 | gl_cv_next_fnmatch_h='"'$gl_header'"' | |
9194 | else | |
9195 | gl_cv_next_fnmatch_h='<'fnmatch.h'>' | |
9196 | fi | |
7a6dbc2f SDJ |
9197 | |
9198 | ||
9199 | fi | |
c0c3707f CB |
9200 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fnmatch_h" >&5 |
9201 | $as_echo "$gl_cv_next_fnmatch_h" >&6; } | |
7a6dbc2f | 9202 | fi |
c0c3707f | 9203 | NEXT_FNMATCH_H=$gl_cv_next_fnmatch_h |
7a6dbc2f SDJ |
9204 | |
9205 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
9206 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
c0c3707f | 9207 | gl_next_as_first_directive='<'fnmatch.h'>' |
7a6dbc2f SDJ |
9208 | else |
9209 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
c0c3707f | 9210 | gl_next_as_first_directive=$gl_cv_next_fnmatch_h |
7a6dbc2f | 9211 | fi |
c0c3707f | 9212 | NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H=$gl_next_as_first_directive |
7a6dbc2f SDJ |
9213 | |
9214 | ||
9215 | ||
9216 | ||
7a6dbc2f | 9217 | |
7a6dbc2f SDJ |
9218 | |
9219 | ||
c0c3707f CB |
9220 | if test $ac_cv_header_fnmatch_h = yes; then |
9221 | HAVE_FNMATCH_H=1 | |
9222 | else | |
9223 | HAVE_FNMATCH_H=0 | |
9224 | fi | |
7a6dbc2f SDJ |
9225 | |
9226 | ||
c0c3707f CB |
9227 | FNMATCH_H='' |
9228 | if false; then | |
9229 | FNMATCH_H=fnmatch.h | |
9230 | else | |
9231 | if test $ac_cv_header_fnmatch_h != yes; then | |
9232 | FNMATCH_H=fnmatch.h | |
9233 | fi | |
9234 | fi | |
7a6dbc2f | 9235 | |
c0c3707f CB |
9236 | |
9237 | if test -n "$FNMATCH_H"; then | |
9238 | GL_GENERATE_FNMATCH_H_TRUE= | |
9239 | GL_GENERATE_FNMATCH_H_FALSE='#' | |
7a6dbc2f | 9240 | else |
c0c3707f CB |
9241 | GL_GENERATE_FNMATCH_H_TRUE='#' |
9242 | GL_GENERATE_FNMATCH_H_FALSE= | |
7a6dbc2f | 9243 | fi |
7a6dbc2f | 9244 | |
7a6dbc2f | 9245 | |
7a6dbc2f | 9246 | |
7a6dbc2f SDJ |
9247 | |
9248 | ||
9249 | ||
9250 | ||
9251 | ||
9252 | ||
9253 | ||
c0c3707f CB |
9254 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 |
9255 | $as_echo_n "checking for mbstate_t... " >&6; } | |
9256 | if ${ac_cv_type_mbstate_t+:} false; then : | |
5e8754f9 SDJ |
9257 | $as_echo_n "(cached) " >&6 |
9258 | else | |
c0c3707f | 9259 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5e8754f9 | 9260 | /* end confdefs.h. */ |
c0c3707f | 9261 | $ac_includes_default |
9c9d63b1 | 9262 | #include <wchar.h> |
c0c3707f CB |
9263 | int |
9264 | main () | |
9265 | { | |
9266 | mbstate_t x; return sizeof x; | |
9267 | ; | |
9268 | return 0; | |
9269 | } | |
5e8754f9 | 9270 | _ACEOF |
c0c3707f CB |
9271 | if ac_fn_c_try_compile "$LINENO"; then : |
9272 | ac_cv_type_mbstate_t=yes | |
5e8754f9 | 9273 | else |
c0c3707f | 9274 | ac_cv_type_mbstate_t=no |
5e8754f9 | 9275 | fi |
c0c3707f CB |
9276 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
9277 | fi | |
9278 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 | |
9279 | $as_echo "$ac_cv_type_mbstate_t" >&6; } | |
9280 | if test $ac_cv_type_mbstate_t = yes; then | |
5e8754f9 | 9281 | |
c0c3707f | 9282 | $as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h |
5e8754f9 | 9283 | |
c0c3707f | 9284 | else |
5e8754f9 | 9285 | |
c0c3707f | 9286 | $as_echo "#define mbstate_t int" >>confdefs.h |
5e8754f9 | 9287 | |
c0c3707f | 9288 | fi |
5e8754f9 SDJ |
9289 | |
9290 | ||
9291 | ||
9292 | ||
5e8754f9 SDJ |
9293 | GNULIB_ACOSF=0; |
9294 | GNULIB_ACOSL=0; | |
9295 | GNULIB_ASINF=0; | |
9296 | GNULIB_ASINL=0; | |
9297 | GNULIB_ATANF=0; | |
9298 | GNULIB_ATANL=0; | |
9299 | GNULIB_ATAN2F=0; | |
9300 | GNULIB_CBRT=0; | |
9301 | GNULIB_CBRTF=0; | |
9302 | GNULIB_CBRTL=0; | |
9303 | GNULIB_CEIL=0; | |
9304 | GNULIB_CEILF=0; | |
9305 | GNULIB_CEILL=0; | |
9306 | GNULIB_COPYSIGN=0; | |
9307 | GNULIB_COPYSIGNF=0; | |
9308 | GNULIB_COPYSIGNL=0; | |
9309 | GNULIB_COSF=0; | |
9310 | GNULIB_COSL=0; | |
9311 | GNULIB_COSHF=0; | |
9312 | GNULIB_EXPF=0; | |
9313 | GNULIB_EXPL=0; | |
9314 | GNULIB_EXP2=0; | |
9315 | GNULIB_EXP2F=0; | |
9316 | GNULIB_EXP2L=0; | |
9317 | GNULIB_EXPM1=0; | |
9318 | GNULIB_EXPM1F=0; | |
9319 | GNULIB_EXPM1L=0; | |
9320 | GNULIB_FABSF=0; | |
9321 | GNULIB_FABSL=0; | |
9322 | GNULIB_FLOOR=0; | |
9323 | GNULIB_FLOORF=0; | |
9324 | GNULIB_FLOORL=0; | |
9325 | GNULIB_FMA=0; | |
9326 | GNULIB_FMAF=0; | |
9327 | GNULIB_FMAL=0; | |
9328 | GNULIB_FMOD=0; | |
9329 | GNULIB_FMODF=0; | |
9330 | GNULIB_FMODL=0; | |
9331 | GNULIB_FREXPF=0; | |
9332 | GNULIB_FREXP=0; | |
9333 | GNULIB_FREXPL=0; | |
9334 | GNULIB_HYPOT=0; | |
9335 | GNULIB_HYPOTF=0; | |
9336 | GNULIB_HYPOTL=0; | |
9337 | GNULIB_ILOGB=0; | |
9338 | GNULIB_ILOGBF=0; | |
9339 | GNULIB_ILOGBL=0; | |
9340 | GNULIB_ISFINITE=0; | |
9341 | GNULIB_ISINF=0; | |
9342 | GNULIB_ISNAN=0; | |
9343 | GNULIB_ISNANF=0; | |
9344 | GNULIB_ISNAND=0; | |
9345 | GNULIB_ISNANL=0; | |
9346 | GNULIB_LDEXPF=0; | |
9347 | GNULIB_LDEXPL=0; | |
9348 | GNULIB_LOG=0; | |
9349 | GNULIB_LOGF=0; | |
9350 | GNULIB_LOGL=0; | |
9351 | GNULIB_LOG10=0; | |
9352 | GNULIB_LOG10F=0; | |
9353 | GNULIB_LOG10L=0; | |
9354 | GNULIB_LOG1P=0; | |
9355 | GNULIB_LOG1PF=0; | |
9356 | GNULIB_LOG1PL=0; | |
9357 | GNULIB_LOG2=0; | |
9358 | GNULIB_LOG2F=0; | |
9359 | GNULIB_LOG2L=0; | |
9360 | GNULIB_LOGB=0; | |
9361 | GNULIB_LOGBF=0; | |
9362 | GNULIB_LOGBL=0; | |
9363 | GNULIB_MODF=0; | |
9364 | GNULIB_MODFF=0; | |
9365 | GNULIB_MODFL=0; | |
9366 | GNULIB_POWF=0; | |
9367 | GNULIB_REMAINDER=0; | |
9368 | GNULIB_REMAINDERF=0; | |
9369 | GNULIB_REMAINDERL=0; | |
9370 | GNULIB_RINT=0; | |
9371 | GNULIB_RINTF=0; | |
9372 | GNULIB_RINTL=0; | |
9373 | GNULIB_ROUND=0; | |
9374 | GNULIB_ROUNDF=0; | |
9375 | GNULIB_ROUNDL=0; | |
9376 | GNULIB_SIGNBIT=0; | |
9377 | GNULIB_SINF=0; | |
9378 | GNULIB_SINL=0; | |
9379 | GNULIB_SINHF=0; | |
9380 | GNULIB_SQRTF=0; | |
9381 | GNULIB_SQRTL=0; | |
9382 | GNULIB_TANF=0; | |
9383 | GNULIB_TANL=0; | |
9384 | GNULIB_TANHF=0; | |
9385 | GNULIB_TRUNC=0; | |
9386 | GNULIB_TRUNCF=0; | |
9387 | GNULIB_TRUNCL=0; | |
9c9d63b1 PM |
9388 | GNULIB_MDA_J0=1; |
9389 | GNULIB_MDA_J1=1; | |
9390 | GNULIB_MDA_JN=1; | |
9391 | GNULIB_MDA_Y0=1; | |
9392 | GNULIB_MDA_Y1=1; | |
9393 | GNULIB_MDA_YN=1; | |
5e8754f9 SDJ |
9394 | HAVE_ACOSF=1; |
9395 | HAVE_ACOSL=1; | |
9396 | HAVE_ASINF=1; | |
9397 | HAVE_ASINL=1; | |
9398 | HAVE_ATANF=1; | |
9399 | HAVE_ATANL=1; | |
9400 | HAVE_ATAN2F=1; | |
9401 | HAVE_CBRT=1; | |
9402 | HAVE_CBRTF=1; | |
9403 | HAVE_CBRTL=1; | |
9404 | HAVE_COPYSIGN=1; | |
9405 | HAVE_COPYSIGNL=1; | |
9406 | HAVE_COSF=1; | |
9407 | HAVE_COSL=1; | |
9408 | HAVE_COSHF=1; | |
9409 | HAVE_EXPF=1; | |
9410 | HAVE_EXPL=1; | |
9411 | HAVE_EXPM1=1; | |
9412 | HAVE_EXPM1F=1; | |
9413 | HAVE_FABSF=1; | |
9414 | HAVE_FABSL=1; | |
9415 | HAVE_FMA=1; | |
9416 | HAVE_FMAF=1; | |
9417 | HAVE_FMAL=1; | |
9418 | HAVE_FMODF=1; | |
9419 | HAVE_FMODL=1; | |
9420 | HAVE_FREXPF=1; | |
9421 | HAVE_HYPOTF=1; | |
9422 | HAVE_HYPOTL=1; | |
9423 | HAVE_ILOGB=1; | |
9424 | HAVE_ILOGBF=1; | |
9425 | HAVE_ILOGBL=1; | |
9426 | HAVE_ISNANF=1; | |
9427 | HAVE_ISNAND=1; | |
9428 | HAVE_ISNANL=1; | |
9429 | HAVE_LDEXPF=1; | |
9430 | HAVE_LOGF=1; | |
9431 | HAVE_LOGL=1; | |
9432 | HAVE_LOG10F=1; | |
9433 | HAVE_LOG10L=1; | |
9434 | HAVE_LOG1P=1; | |
9435 | HAVE_LOG1PF=1; | |
9436 | HAVE_LOG1PL=1; | |
9437 | HAVE_LOGBF=1; | |
9438 | HAVE_LOGBL=1; | |
9439 | HAVE_MODFF=1; | |
9440 | HAVE_MODFL=1; | |
9441 | HAVE_POWF=1; | |
9442 | HAVE_REMAINDER=1; | |
9443 | HAVE_REMAINDERF=1; | |
9444 | HAVE_RINT=1; | |
9445 | HAVE_RINTL=1; | |
9446 | HAVE_SINF=1; | |
9447 | HAVE_SINL=1; | |
9448 | HAVE_SINHF=1; | |
9449 | HAVE_SQRTF=1; | |
9450 | HAVE_SQRTL=1; | |
9451 | HAVE_TANF=1; | |
9452 | HAVE_TANL=1; | |
9453 | HAVE_TANHF=1; | |
9454 | HAVE_DECL_ACOSL=1; | |
9455 | HAVE_DECL_ASINL=1; | |
9456 | HAVE_DECL_ATANL=1; | |
9457 | HAVE_DECL_CBRTF=1; | |
9458 | HAVE_DECL_CBRTL=1; | |
9459 | HAVE_DECL_CEILF=1; | |
9460 | HAVE_DECL_CEILL=1; | |
9461 | HAVE_DECL_COPYSIGNF=1; | |
9462 | HAVE_DECL_COSL=1; | |
9463 | HAVE_DECL_EXPL=1; | |
9464 | HAVE_DECL_EXP2=1; | |
9465 | HAVE_DECL_EXP2F=1; | |
9466 | HAVE_DECL_EXP2L=1; | |
9467 | HAVE_DECL_EXPM1L=1; | |
9468 | HAVE_DECL_FLOORF=1; | |
9469 | HAVE_DECL_FLOORL=1; | |
9470 | HAVE_DECL_FREXPL=1; | |
9471 | HAVE_DECL_LDEXPL=1; | |
9472 | HAVE_DECL_LOGL=1; | |
9473 | HAVE_DECL_LOG10L=1; | |
9474 | HAVE_DECL_LOG2=1; | |
9475 | HAVE_DECL_LOG2F=1; | |
9476 | HAVE_DECL_LOG2L=1; | |
9477 | HAVE_DECL_LOGB=1; | |
9478 | HAVE_DECL_REMAINDER=1; | |
9479 | HAVE_DECL_REMAINDERL=1; | |
9480 | HAVE_DECL_RINTF=1; | |
9481 | HAVE_DECL_ROUND=1; | |
9482 | HAVE_DECL_ROUNDF=1; | |
9483 | HAVE_DECL_ROUNDL=1; | |
9484 | HAVE_DECL_SINL=1; | |
9485 | HAVE_DECL_SQRTL=1; | |
9486 | HAVE_DECL_TANL=1; | |
9487 | HAVE_DECL_TRUNC=1; | |
9488 | HAVE_DECL_TRUNCF=1; | |
9489 | HAVE_DECL_TRUNCL=1; | |
c0c3707f CB |
9490 | REPLACE_ACOSF=0; |
9491 | REPLACE_ASINF=0; | |
9492 | REPLACE_ATANF=0; | |
9493 | REPLACE_ATAN2F=0; | |
5e8754f9 SDJ |
9494 | REPLACE_CBRTF=0; |
9495 | REPLACE_CBRTL=0; | |
9496 | REPLACE_CEIL=0; | |
9497 | REPLACE_CEILF=0; | |
9498 | REPLACE_CEILL=0; | |
c0c3707f CB |
9499 | REPLACE_COSF=0; |
9500 | REPLACE_COSHF=0; | |
9501 | REPLACE_EXPF=0; | |
9502 | REPLACE_EXPL=0; | |
5e8754f9 SDJ |
9503 | REPLACE_EXPM1=0; |
9504 | REPLACE_EXPM1F=0; | |
c0c3707f | 9505 | REPLACE_EXPM1L=0; |
5e8754f9 SDJ |
9506 | REPLACE_EXP2=0; |
9507 | REPLACE_EXP2L=0; | |
9508 | REPLACE_FABSL=0; | |
9509 | REPLACE_FLOOR=0; | |
9510 | REPLACE_FLOORF=0; | |
9511 | REPLACE_FLOORL=0; | |
9512 | REPLACE_FMA=0; | |
9513 | REPLACE_FMAF=0; | |
9514 | REPLACE_FMAL=0; | |
9515 | REPLACE_FMOD=0; | |
9516 | REPLACE_FMODF=0; | |
9517 | REPLACE_FMODL=0; | |
9518 | REPLACE_FREXPF=0; | |
9519 | REPLACE_FREXP=0; | |
9520 | REPLACE_FREXPL=0; | |
9521 | REPLACE_HUGE_VAL=0; | |
9522 | REPLACE_HYPOT=0; | |
9523 | REPLACE_HYPOTF=0; | |
9524 | REPLACE_HYPOTL=0; | |
9525 | REPLACE_ILOGB=0; | |
9526 | REPLACE_ILOGBF=0; | |
c0c3707f | 9527 | REPLACE_ILOGBL=0; |
5e8754f9 SDJ |
9528 | REPLACE_ISFINITE=0; |
9529 | REPLACE_ISINF=0; | |
9530 | REPLACE_ISNAN=0; | |
9531 | REPLACE_LDEXPL=0; | |
9532 | REPLACE_LOG=0; | |
9533 | REPLACE_LOGF=0; | |
9534 | REPLACE_LOGL=0; | |
9535 | REPLACE_LOG10=0; | |
9536 | REPLACE_LOG10F=0; | |
9537 | REPLACE_LOG10L=0; | |
9538 | REPLACE_LOG1P=0; | |
9539 | REPLACE_LOG1PF=0; | |
9540 | REPLACE_LOG1PL=0; | |
9541 | REPLACE_LOG2=0; | |
9542 | REPLACE_LOG2F=0; | |
9543 | REPLACE_LOG2L=0; | |
9544 | REPLACE_LOGB=0; | |
9545 | REPLACE_LOGBF=0; | |
9546 | REPLACE_LOGBL=0; | |
9547 | REPLACE_MODF=0; | |
9548 | REPLACE_MODFF=0; | |
9549 | REPLACE_MODFL=0; | |
9550 | REPLACE_NAN=0; | |
9551 | REPLACE_REMAINDER=0; | |
9552 | REPLACE_REMAINDERF=0; | |
9553 | REPLACE_REMAINDERL=0; | |
c0c3707f | 9554 | REPLACE_RINTL=0; |
5e8754f9 | 9555 | REPLACE_ROUND=0; |
c0c3707f CB |
9556 | REPLACE_ROUNDF=0; |
9557 | REPLACE_ROUNDL=0; | |
9558 | REPLACE_SIGNBIT=0; | |
9c9d63b1 | 9559 | REPLACE_SIGNBIT_USING_BUILTINS=0; |
c0c3707f CB |
9560 | REPLACE_SINF=0; |
9561 | REPLACE_SINHF=0; | |
9562 | REPLACE_SQRTF=0; | |
9563 | REPLACE_SQRTL=0; | |
9564 | REPLACE_TANF=0; | |
9565 | REPLACE_TANHF=0; | |
9566 | REPLACE_TRUNC=0; | |
9567 | REPLACE_TRUNCF=0; | |
9568 | REPLACE_TRUNCL=0; | |
49e4877c | 9569 | |
49e4877c | 9570 | |
c0c3707f CB |
9571 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5 |
9572 | $as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; } | |
9573 | if ${gl_cv_func_frexp_no_libm+:} false; then : | |
9574 | $as_echo_n "(cached) " >&6 | |
9575 | else | |
8690e634 | 9576 | |
c0c3707f CB |
9577 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
9578 | /* end confdefs.h. */ | |
9579 | #include <math.h> | |
9580 | double x; | |
9581 | int | |
9582 | main () | |
9583 | { | |
9584 | int e; return frexp (x, &e) > 0; | |
9585 | ; | |
9586 | return 0; | |
9587 | } | |
9588 | _ACEOF | |
9589 | if ac_fn_c_try_link "$LINENO"; then : | |
9590 | gl_cv_func_frexp_no_libm=yes | |
9591 | else | |
9592 | gl_cv_func_frexp_no_libm=no | |
9593 | fi | |
9594 | rm -f core conftest.err conftest.$ac_objext \ | |
9595 | conftest$ac_exeext conftest.$ac_ext | |
8690e634 | 9596 | |
c0c3707f CB |
9597 | fi |
9598 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5 | |
9599 | $as_echo "$gl_cv_func_frexp_no_libm" >&6; } | |
8690e634 | 9600 | |
c0c3707f CB |
9601 | ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default" |
9602 | if test "x$ac_cv_have_decl_alarm" = xyes; then : | |
9603 | ac_have_decl=1 | |
9604 | else | |
9605 | ac_have_decl=0 | |
9606 | fi | |
472fa5ee | 9607 | |
c0c3707f CB |
9608 | cat >>confdefs.h <<_ACEOF |
9609 | #define HAVE_DECL_ALARM $ac_have_decl | |
9610 | _ACEOF | |
472fa5ee SM |
9611 | |
9612 | ||
9613 | ||
9614 | ||
c0c3707f CB |
9615 | FREXP_LIBM= |
9616 | if test $gl_cv_func_frexp_no_libm = no; then | |
9617 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used with libm" >&5 | |
9618 | $as_echo_n "checking whether frexp() can be used with libm... " >&6; } | |
9619 | if ${gl_cv_func_frexp_in_libm+:} false; then : | |
9620 | $as_echo_n "(cached) " >&6 | |
9621 | else | |
8690e634 | 9622 | |
c0c3707f CB |
9623 | save_LIBS="$LIBS" |
9624 | LIBS="$LIBS -lm" | |
9625 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9626 | /* end confdefs.h. */ | |
9627 | #include <math.h> | |
9628 | double x; | |
9629 | int | |
9630 | main () | |
9631 | { | |
9632 | int e; return frexp (x, &e) > 0; | |
9633 | ; | |
9634 | return 0; | |
9635 | } | |
9636 | _ACEOF | |
9637 | if ac_fn_c_try_link "$LINENO"; then : | |
9638 | gl_cv_func_frexp_in_libm=yes | |
9639 | else | |
9640 | gl_cv_func_frexp_in_libm=no | |
9641 | fi | |
9642 | rm -f core conftest.err conftest.$ac_objext \ | |
9643 | conftest$ac_exeext conftest.$ac_ext | |
9644 | LIBS="$save_LIBS" | |
8690e634 | 9645 | |
c0c3707f CB |
9646 | fi |
9647 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_in_libm" >&5 | |
9648 | $as_echo "$gl_cv_func_frexp_in_libm" >&6; } | |
9649 | if test $gl_cv_func_frexp_in_libm = yes; then | |
9650 | FREXP_LIBM=-lm | |
9651 | fi | |
6ec2e0f5 | 9652 | fi |
c0c3707f CB |
9653 | if test $gl_cv_func_frexp_no_libm = yes \ |
9654 | || test $gl_cv_func_frexp_in_libm = yes; then | |
9655 | save_LIBS="$LIBS" | |
9656 | LIBS="$LIBS $FREXP_LIBM" | |
8690e634 JK |
9657 | |
9658 | ||
8690e634 | 9659 | |
c0c3707f CB |
9660 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5 |
9661 | $as_echo_n "checking whether frexp works... " >&6; } | |
9662 | if ${gl_cv_func_frexp_works+:} false; then : | |
9663 | $as_echo_n "(cached) " >&6 | |
9664 | else | |
8690e634 | 9665 | |
c0c3707f CB |
9666 | if test "$cross_compiling" = yes; then : |
9667 | case "$host_os" in | |
9668 | netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;; | |
9669 | mingw*) # Guess yes with MSVC, no with mingw. | |
9670 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9671 | /* end confdefs.h. */ | |
8690e634 | 9672 | |
c0c3707f CB |
9673 | #ifdef _MSC_VER |
9674 | Good | |
9675 | #endif | |
8690e634 | 9676 | |
c0c3707f CB |
9677 | _ACEOF |
9678 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
9679 | $EGREP "Good" >/dev/null 2>&1; then : | |
9680 | gl_cv_func_frexp_works="guessing yes" | |
9681 | else | |
9682 | gl_cv_func_frexp_works="guessing no" | |
9683 | fi | |
9684 | rm -f conftest* | |
8690e634 | 9685 | |
c0c3707f CB |
9686 | ;; |
9687 | *) gl_cv_func_frexp_works="guessing yes" ;; | |
9688 | esac | |
8690e634 | 9689 | |
c0c3707f CB |
9690 | else |
9691 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9692 | /* end confdefs.h. */ | |
8690e634 | 9693 | |
c0c3707f CB |
9694 | #include <float.h> |
9695 | #include <math.h> | |
9696 | #include <string.h> | |
9697 | #if HAVE_DECL_ALARM | |
9698 | # include <signal.h> | |
9699 | # include <unistd.h> | |
9700 | #endif | |
9701 | /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. | |
9702 | ICC 10.0 has a bug when optimizing the expression -zero. | |
9703 | The expression -DBL_MIN * DBL_MIN does not work when cross-compiling | |
9704 | to PowerPC on Mac OS X 10.5. */ | |
9705 | #if defined __hpux || defined __sgi || defined __ICC | |
9706 | static double | |
9707 | compute_minus_zero (void) | |
9708 | { | |
9709 | return -DBL_MIN * DBL_MIN; | |
9710 | } | |
9711 | # define minus_zero compute_minus_zero () | |
9712 | #else | |
9713 | double minus_zero = -0.0; | |
9714 | #endif | |
9715 | int main() | |
9716 | { | |
9717 | int result = 0; | |
9718 | int i; | |
9719 | volatile double x; | |
9720 | double zero = 0.0; | |
9721 | #if HAVE_DECL_ALARM | |
9722 | /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite | |
9723 | number. Let the test fail in this case. */ | |
9724 | signal (SIGALRM, SIG_DFL); | |
9725 | alarm (5); | |
9726 | #endif | |
9727 | /* Test on denormalized numbers. */ | |
9728 | for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) | |
9729 | ; | |
9730 | if (x > 0.0) | |
9731 | { | |
9732 | int exp; | |
9733 | double y = frexp (x, &exp); | |
9734 | /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022. | |
9735 | On NetBSD: y = 0.75. Correct: y = 0.5. */ | |
9736 | if (y != 0.5) | |
9737 | result |= 1; | |
9738 | } | |
9739 | /* Test on infinite numbers. */ | |
9740 | x = 1.0 / zero; | |
9741 | { | |
9742 | int exp; | |
9743 | double y = frexp (x, &exp); | |
9744 | if (y != x) | |
9745 | result |= 2; | |
9746 | } | |
9747 | /* Test on negative zero. */ | |
9748 | x = minus_zero; | |
9749 | { | |
9750 | int exp; | |
9751 | double y = frexp (x, &exp); | |
9752 | if (memcmp (&y, &x, sizeof x)) | |
9753 | result |= 4; | |
9754 | } | |
9755 | return result; | |
9756 | } | |
9757 | _ACEOF | |
9758 | if ac_fn_c_try_run "$LINENO"; then : | |
9759 | gl_cv_func_frexp_works=yes | |
9760 | else | |
9761 | gl_cv_func_frexp_works=no | |
9762 | fi | |
9763 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
9764 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
9765 | fi | |
472fa5ee SM |
9766 | |
9767 | ||
c0c3707f CB |
9768 | fi |
9769 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5 | |
9770 | $as_echo "$gl_cv_func_frexp_works" >&6; } | |
472fa5ee | 9771 | |
c0c3707f CB |
9772 | LIBS="$save_LIBS" |
9773 | case "$gl_cv_func_frexp_works" in | |
9774 | *yes) gl_func_frexp=yes ;; | |
9775 | *) gl_func_frexp=no; REPLACE_FREXP=1; FREXP_LIBM= ;; | |
9776 | esac | |
9777 | else | |
9778 | gl_func_frexp=no | |
9779 | fi | |
9780 | if test $gl_func_frexp = yes; then | |
472fa5ee | 9781 | |
c0c3707f | 9782 | $as_echo "#define HAVE_FREXP 1" >>confdefs.h |
472fa5ee | 9783 | |
c0c3707f | 9784 | fi |
8690e634 | 9785 | |
6ec2e0f5 SDJ |
9786 | |
9787 | ||
c0c3707f CB |
9788 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5 |
9789 | $as_echo_n "checking whether long double and double are the same... " >&6; } | |
9790 | if ${gl_cv_long_double_equals_double+:} false; then : | |
8690e634 JK |
9791 | $as_echo_n "(cached) " >&6 |
9792 | else | |
c0c3707f CB |
9793 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
9794 | /* end confdefs.h. */ | |
9795 | #include <float.h> | |
9796 | int | |
9797 | main () | |
9798 | { | |
9799 | typedef int check[sizeof (long double) == sizeof (double) | |
9800 | && LDBL_MANT_DIG == DBL_MANT_DIG | |
9801 | && LDBL_MAX_EXP == DBL_MAX_EXP | |
9802 | && LDBL_MIN_EXP == DBL_MIN_EXP | |
9803 | ? 1 : -1]; | |
8690e634 | 9804 | |
c0c3707f CB |
9805 | ; |
9806 | return 0; | |
9807 | } | |
9808 | _ACEOF | |
9809 | if ac_fn_c_try_compile "$LINENO"; then : | |
9810 | gl_cv_long_double_equals_double=yes | |
9811 | else | |
9812 | gl_cv_long_double_equals_double=no | |
9813 | fi | |
9814 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
8690e634 | 9815 | |
c0c3707f CB |
9816 | fi |
9817 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5 | |
9818 | $as_echo "$gl_cv_long_double_equals_double" >&6; } | |
9819 | if test $gl_cv_long_double_equals_double = yes; then | |
8690e634 | 9820 | |
c0c3707f | 9821 | $as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h |
6ec2e0f5 | 9822 | |
c0c3707f CB |
9823 | HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1 |
9824 | else | |
9825 | HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0 | |
9826 | fi | |
8690e634 | 9827 | |
6ec2e0f5 | 9828 | |
6ec2e0f5 | 9829 | |
6ec2e0f5 SDJ |
9830 | |
9831 | ||
6ec2e0f5 | 9832 | |
8690e634 JK |
9833 | |
9834 | ||
c0c3707f CB |
9835 | ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h> |
9836 | " | |
9837 | if test "x$ac_cv_have_decl_frexpl" = xyes; then : | |
8690e634 | 9838 | |
c0c3707f CB |
9839 | else |
9840 | HAVE_DECL_FREXPL=0 | |
9841 | fi | |
8690e634 | 9842 | |
6ec2e0f5 | 9843 | |
c0c3707f CB |
9844 | FREXPL_LIBM= |
9845 | if test $HAVE_DECL_FREXPL = 1; then | |
6ec2e0f5 | 9846 | |
c0c3707f CB |
9847 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5 |
9848 | $as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; } | |
9849 | if ${gl_cv_func_frexpl_no_libm+:} false; then : | |
8690e634 JK |
9850 | $as_echo_n "(cached) " >&6 |
9851 | else | |
c0c3707f CB |
9852 | |
9853 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 | 9854 | /* end confdefs.h. */ |
c0c3707f CB |
9855 | #include <math.h> |
9856 | long double x; | |
9857 | int | |
9858 | main () | |
9859 | { | |
9860 | int e; return frexpl (x, &e) > 0; | |
9861 | ; | |
9862 | return 0; | |
9863 | } | |
9864 | _ACEOF | |
9865 | if ac_fn_c_try_link "$LINENO"; then : | |
9866 | gl_cv_func_frexpl_no_libm=yes | |
9867 | else | |
9868 | gl_cv_func_frexpl_no_libm=no | |
9869 | fi | |
9870 | rm -f core conftest.err conftest.$ac_objext \ | |
9871 | conftest$ac_exeext conftest.$ac_ext | |
8690e634 | 9872 | |
c0c3707f CB |
9873 | fi |
9874 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5 | |
9875 | $as_echo "$gl_cv_func_frexpl_no_libm" >&6; } | |
6ec2e0f5 | 9876 | |
c0c3707f CB |
9877 | if test $gl_cv_func_frexpl_no_libm = no; then |
9878 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used with libm" >&5 | |
9879 | $as_echo_n "checking whether frexpl() can be used with libm... " >&6; } | |
9880 | if ${gl_cv_func_frexpl_in_libm+:} false; then : | |
9881 | $as_echo_n "(cached) " >&6 | |
9882 | else | |
6ec2e0f5 | 9883 | |
c0c3707f CB |
9884 | save_LIBS="$LIBS" |
9885 | LIBS="$LIBS -lm" | |
9886 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9887 | /* end confdefs.h. */ | |
9888 | #include <math.h> | |
9889 | long double x; | |
9890 | int | |
9891 | main () | |
9892 | { | |
9893 | int e; return frexpl (x, &e) > 0; | |
9894 | ; | |
9895 | return 0; | |
9896 | } | |
9897 | _ACEOF | |
9898 | if ac_fn_c_try_link "$LINENO"; then : | |
9899 | gl_cv_func_frexpl_in_libm=yes | |
9900 | else | |
9901 | gl_cv_func_frexpl_in_libm=no | |
9902 | fi | |
9903 | rm -f core conftest.err conftest.$ac_objext \ | |
9904 | conftest$ac_exeext conftest.$ac_ext | |
9905 | LIBS="$save_LIBS" | |
6ec2e0f5 | 9906 | |
c0c3707f CB |
9907 | fi |
9908 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_in_libm" >&5 | |
9909 | $as_echo "$gl_cv_func_frexpl_in_libm" >&6; } | |
9910 | if test $gl_cv_func_frexpl_in_libm = yes; then | |
9911 | FREXPL_LIBM=-lm | |
9912 | fi | |
9913 | fi | |
9914 | if test $gl_cv_func_frexpl_no_libm = yes \ | |
9915 | || test $gl_cv_func_frexpl_in_libm = yes; then | |
9916 | save_LIBS="$LIBS" | |
9917 | LIBS="$LIBS $FREXPL_LIBM" | |
8690e634 | 9918 | |
8690e634 | 9919 | |
c0c3707f CB |
9920 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5 |
9921 | $as_echo_n "checking whether frexpl works... " >&6; } | |
9922 | if ${gl_cv_func_frexpl_works+:} false; then : | |
9923 | $as_echo_n "(cached) " >&6 | |
9924 | else | |
8690e634 | 9925 | |
c0c3707f | 9926 | if test "$cross_compiling" = yes; then : |
8690e634 | 9927 | |
c0c3707f CB |
9928 | case "$host_os" in |
9929 | aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*) | |
9930 | gl_cv_func_frexpl_works="guessing no";; | |
9931 | *) gl_cv_func_frexpl_works="guessing yes";; | |
9932 | esac | |
8690e634 | 9933 | |
c0c3707f CB |
9934 | else |
9935 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9936 | /* end confdefs.h. */ | |
8690e634 | 9937 | |
c0c3707f CB |
9938 | #include <float.h> |
9939 | #include <math.h> | |
9940 | /* Override the values of <float.h>, like done in float.in.h. */ | |
9941 | #if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) | |
9942 | # undef LDBL_MIN_EXP | |
9943 | # define LDBL_MIN_EXP (-16381) | |
6ec2e0f5 | 9944 | #endif |
c0c3707f CB |
9945 | #if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__) |
9946 | # undef LDBL_MIN_EXP | |
9947 | # define LDBL_MIN_EXP (-16381) | |
6ec2e0f5 | 9948 | #endif |
c0c3707f CB |
9949 | #if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__ |
9950 | # undef LDBL_MIN_EXP | |
9951 | # define LDBL_MIN_EXP DBL_MIN_EXP | |
6ec2e0f5 | 9952 | #endif |
c0c3707f CB |
9953 | #if defined __sgi && (LDBL_MANT_DIG >= 106) |
9954 | # if defined __GNUC__ | |
9955 | # undef LDBL_MIN_EXP | |
9956 | # define LDBL_MIN_EXP DBL_MIN_EXP | |
9957 | # endif | |
6ec2e0f5 | 9958 | #endif |
c0c3707f CB |
9959 | extern |
9960 | #ifdef __cplusplus | |
9961 | "C" | |
9962 | #endif | |
9963 | long double frexpl (long double, int *); | |
9c9d63b1 | 9964 | long double zero = 0.0L; |
c0c3707f | 9965 | int main() |
8690e634 | 9966 | { |
c0c3707f CB |
9967 | int result = 0; |
9968 | volatile long double x; | |
9969 | /* Test on finite numbers that fails on AIX 5.1. */ | |
9970 | x = 16.0L; | |
9971 | { | |
9972 | int exp = -9999; | |
9973 | frexpl (x, &exp); | |
9974 | if (exp != 5) | |
9975 | result |= 1; | |
9976 | } | |
9977 | /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl | |
9978 | function returns an invalid (incorrectly normalized) value: it returns | |
9979 | y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 } | |
9980 | but the correct result is | |
9981 | 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */ | |
9982 | x = 1.01L; | |
9983 | { | |
9984 | int exp = -9999; | |
9985 | long double y = frexpl (x, &exp); | |
9986 | if (!(exp == 1 && y == 0.505L)) | |
9987 | result |= 2; | |
9988 | } | |
9989 | /* Test on large finite numbers. This fails on BeOS at i = 16322, while | |
9990 | LDBL_MAX_EXP = 16384. | |
9991 | In the loop end test, we test x against Infinity, rather than comparing | |
9992 | i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */ | |
9993 | { | |
9994 | int i; | |
9995 | for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L) | |
9996 | { | |
9997 | int exp = -9999; | |
9998 | frexpl (x, &exp); | |
9999 | if (exp != i) | |
10000 | { | |
10001 | result |= 4; | |
10002 | break; | |
10003 | } | |
10004 | } | |
10005 | } | |
10006 | /* Test on denormalized numbers. */ | |
10007 | { | |
10008 | int i; | |
10009 | for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L) | |
10010 | ; | |
10011 | if (x > 0.0L) | |
10012 | { | |
10013 | int exp; | |
10014 | long double y = frexpl (x, &exp); | |
10015 | /* On machines with IEEE854 arithmetic: x = 1.68105e-4932, | |
10016 | exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */ | |
10017 | if (exp != LDBL_MIN_EXP - 1) | |
10018 | result |= 8; | |
10019 | } | |
10020 | } | |
10021 | /* Test on infinite numbers. */ | |
9c9d63b1 PM |
10022 | /* The Microsoft MSVC 14 compiler chokes on the expression 1.0 / 0.0. */ |
10023 | x = 1.0L / zero; | |
c0c3707f CB |
10024 | { |
10025 | int exp; | |
10026 | long double y = frexpl (x, &exp); | |
10027 | if (y != x) | |
10028 | result |= 16; | |
10029 | } | |
10030 | return result; | |
8690e634 JK |
10031 | } |
10032 | _ACEOF | |
c0c3707f CB |
10033 | if ac_fn_c_try_run "$LINENO"; then : |
10034 | gl_cv_func_frexpl_works=yes | |
6ec2e0f5 | 10035 | else |
c0c3707f CB |
10036 | gl_cv_func_frexpl_works=no |
10037 | fi | |
10038 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
10039 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
10040 | fi | |
8690e634 | 10041 | |
8690e634 | 10042 | |
c0c3707f CB |
10043 | fi |
10044 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5 | |
10045 | $as_echo "$gl_cv_func_frexpl_works" >&6; } | |
8690e634 | 10046 | |
c0c3707f CB |
10047 | LIBS="$save_LIBS" |
10048 | case "$gl_cv_func_frexpl_works" in | |
10049 | *yes) gl_func_frexpl=yes ;; | |
10050 | *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;; | |
10051 | esac | |
10052 | else | |
10053 | gl_func_frexpl=no | |
10054 | fi | |
10055 | if test $gl_func_frexpl = yes; then | |
8690e634 | 10056 | |
c0c3707f | 10057 | $as_echo "#define HAVE_FREXPL 1" >>confdefs.h |
8690e634 | 10058 | |
c0c3707f CB |
10059 | fi |
10060 | fi | |
10061 | if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then | |
10062 | if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then | |
8690e634 | 10063 | |
c0c3707f CB |
10064 | FREXPL_LIBM="$FREXP_LIBM" |
10065 | else | |
10066 | FREXPL_LIBM= | |
10067 | fi | |
10068 | fi | |
6ec2e0f5 | 10069 | |
6ec2e0f5 | 10070 | |
6ec2e0f5 | 10071 | |
c0c3707f CB |
10072 | GNULIB_FCHMODAT=0; |
10073 | GNULIB_FSTAT=0; | |
10074 | GNULIB_FSTATAT=0; | |
10075 | GNULIB_FUTIMENS=0; | |
9c9d63b1 | 10076 | GNULIB_GETUMASK=0; |
c0c3707f CB |
10077 | GNULIB_LCHMOD=0; |
10078 | GNULIB_LSTAT=0; | |
9c9d63b1 | 10079 | GNULIB_MKDIR=0; |
c0c3707f CB |
10080 | GNULIB_MKDIRAT=0; |
10081 | GNULIB_MKFIFO=0; | |
10082 | GNULIB_MKFIFOAT=0; | |
10083 | GNULIB_MKNOD=0; | |
10084 | GNULIB_MKNODAT=0; | |
10085 | GNULIB_STAT=0; | |
10086 | GNULIB_UTIMENSAT=0; | |
10087 | GNULIB_OVERRIDES_STRUCT_STAT=0; | |
9c9d63b1 PM |
10088 | GNULIB_MDA_CHMOD=1; |
10089 | GNULIB_MDA_MKDIR=1; | |
10090 | GNULIB_MDA_UMASK=1; | |
c0c3707f CB |
10091 | HAVE_FCHMODAT=1; |
10092 | HAVE_FSTATAT=1; | |
10093 | HAVE_FUTIMENS=1; | |
9c9d63b1 | 10094 | HAVE_GETUMASK=1; |
c0c3707f CB |
10095 | HAVE_LCHMOD=1; |
10096 | HAVE_LSTAT=1; | |
10097 | HAVE_MKDIRAT=1; | |
10098 | HAVE_MKFIFO=1; | |
10099 | HAVE_MKFIFOAT=1; | |
10100 | HAVE_MKNOD=1; | |
10101 | HAVE_MKNODAT=1; | |
10102 | HAVE_UTIMENSAT=1; | |
5df4cba6 | 10103 | REPLACE_FCHMODAT=0; |
c0c3707f CB |
10104 | REPLACE_FSTAT=0; |
10105 | REPLACE_FSTATAT=0; | |
10106 | REPLACE_FUTIMENS=0; | |
10107 | REPLACE_LSTAT=0; | |
10108 | REPLACE_MKDIR=0; | |
10109 | REPLACE_MKFIFO=0; | |
9c9d63b1 | 10110 | REPLACE_MKFIFOAT=0; |
c0c3707f | 10111 | REPLACE_MKNOD=0; |
9c9d63b1 | 10112 | REPLACE_MKNODAT=0; |
c0c3707f CB |
10113 | REPLACE_STAT=0; |
10114 | REPLACE_UTIMENSAT=0; | |
10115 | ||
10116 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 | |
10117 | $as_echo_n "checking whether stat file-mode macros are broken... " >&6; } | |
10118 | if ${ac_cv_header_stat_broken+:} false; then : | |
10119 | $as_echo_n "(cached) " >&6 | |
10120 | else | |
10121 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10122 | /* end confdefs.h. */ | |
10123 | #include <sys/types.h> | |
10124 | #include <sys/stat.h> | |
10125 | ||
10126 | #if defined S_ISBLK && defined S_IFDIR | |
10127 | extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; | |
10128 | #endif | |
10129 | ||
10130 | #if defined S_ISBLK && defined S_IFCHR | |
10131 | extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; | |
10132 | #endif | |
10133 | ||
10134 | #if defined S_ISLNK && defined S_IFREG | |
10135 | extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; | |
10136 | #endif | |
8690e634 | 10137 | |
c0c3707f CB |
10138 | #if defined S_ISSOCK && defined S_IFREG |
10139 | extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; | |
10140 | #endif | |
8690e634 | 10141 | |
c0c3707f CB |
10142 | _ACEOF |
10143 | if ac_fn_c_try_compile "$LINENO"; then : | |
10144 | ac_cv_header_stat_broken=no | |
10145 | else | |
10146 | ac_cv_header_stat_broken=yes | |
6ec2e0f5 SDJ |
10147 | fi |
10148 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6ec2e0f5 | 10149 | fi |
c0c3707f CB |
10150 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 |
10151 | $as_echo "$ac_cv_header_stat_broken" >&6; } | |
10152 | if test $ac_cv_header_stat_broken = yes; then | |
8690e634 | 10153 | |
c0c3707f | 10154 | $as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h |
49e4877c | 10155 | |
c0c3707f | 10156 | fi |
49e4877c PA |
10157 | |
10158 | ||
10159 | ||
10160 | ||
8690e634 | 10161 | |
c0c3707f CB |
10162 | case "$host_os" in |
10163 | mingw*) | |
10164 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5 | |
10165 | $as_echo_n "checking for 64-bit off_t... " >&6; } | |
10166 | if ${gl_cv_type_off_t_64+:} false; then : | |
10167 | $as_echo_n "(cached) " >&6 | |
10168 | else | |
10169 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10170 | /* end confdefs.h. */ | |
10171 | #include <sys/types.h> | |
10172 | int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1]; | |
8690e634 | 10173 | |
6ec2e0f5 SDJ |
10174 | int |
10175 | main () | |
10176 | { | |
8690e634 | 10177 | |
6ec2e0f5 SDJ |
10178 | ; |
10179 | return 0; | |
10180 | } | |
10181 | _ACEOF | |
10182 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f CB |
10183 | gl_cv_type_off_t_64=yes |
10184 | else | |
10185 | gl_cv_type_off_t_64=no | |
6ec2e0f5 SDJ |
10186 | fi |
10187 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
8690e634 | 10188 | |
c0c3707f CB |
10189 | fi |
10190 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5 | |
10191 | $as_echo "$gl_cv_type_off_t_64" >&6; } | |
10192 | if test $gl_cv_type_off_t_64 = no; then | |
10193 | WINDOWS_64_BIT_OFF_T=1 | |
10194 | else | |
10195 | WINDOWS_64_BIT_OFF_T=0 | |
10196 | fi | |
10197 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5 | |
10198 | $as_echo_n "checking for 64-bit st_size... " >&6; } | |
10199 | if ${gl_cv_member_st_size_64+:} false; then : | |
6ec2e0f5 SDJ |
10200 | $as_echo_n "(cached) " >&6 |
10201 | else | |
c0c3707f | 10202 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6ec2e0f5 | 10203 | /* end confdefs.h. */ |
c0c3707f CB |
10204 | #include <sys/types.h> |
10205 | struct stat buf; | |
10206 | int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1]; | |
8690e634 | 10207 | |
6ec2e0f5 SDJ |
10208 | int |
10209 | main () | |
10210 | { | |
8690e634 | 10211 | |
6ec2e0f5 SDJ |
10212 | ; |
10213 | return 0; | |
10214 | } | |
10215 | _ACEOF | |
10216 | if ac_fn_c_try_compile "$LINENO"; then : | |
698be2d8 CB |
10217 | gl_cv_member_st_size_64=yes |
10218 | else | |
10219 | gl_cv_member_st_size_64=no | |
10220 | fi | |
10221 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
10222 | ||
10223 | fi | |
10224 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5 | |
10225 | $as_echo "$gl_cv_member_st_size_64" >&6; } | |
10226 | if test $gl_cv_member_st_size_64 = no; then | |
10227 | WINDOWS_64_BIT_ST_SIZE=1 | |
10228 | else | |
10229 | WINDOWS_64_BIT_ST_SIZE=0 | |
10230 | fi | |
10231 | ;; | |
10232 | *) | |
10233 | WINDOWS_64_BIT_OFF_T=0 | |
10234 | WINDOWS_64_BIT_ST_SIZE=0 | |
10235 | ;; | |
10236 | esac | |
10237 | ||
10238 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 | |
10239 | $as_echo_n "checking for C/C++ restrict keyword... " >&6; } | |
10240 | if ${ac_cv_c_restrict+:} false; then : | |
10241 | $as_echo_n "(cached) " >&6 | |
10242 | else | |
10243 | ac_cv_c_restrict=no | |
9c9d63b1 PM |
10244 | # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see: |
10245 | # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html | |
10246 | # Put 'restrict' last, because C++ lacks it. | |
10247 | for ac_kw in __restrict__ __restrict _Restrict restrict; do | |
698be2d8 CB |
10248 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
10249 | /* end confdefs.h. */ | |
10250 | typedef int *int_ptr; | |
10251 | int foo (int_ptr $ac_kw ip) { return ip[0]; } | |
10252 | int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ | |
10253 | int bar (int ip[$ac_kw]) { return ip[0]; } | |
10254 | ||
10255 | int | |
10256 | main () | |
10257 | { | |
10258 | int s[1]; | |
10259 | int *$ac_kw t = s; | |
10260 | t[0] = 0; | |
10261 | return foo (t) + bar (t); | |
10262 | ||
10263 | ; | |
10264 | return 0; | |
10265 | } | |
10266 | _ACEOF | |
10267 | if ac_fn_c_try_compile "$LINENO"; then : | |
10268 | ac_cv_c_restrict=$ac_kw | |
6ec2e0f5 SDJ |
10269 | fi |
10270 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
698be2d8 CB |
10271 | test "$ac_cv_c_restrict" != no && break |
10272 | done | |
8690e634 | 10273 | |
6ec2e0f5 | 10274 | fi |
698be2d8 CB |
10275 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 |
10276 | $as_echo "$ac_cv_c_restrict" >&6; } | |
10277 | ||
10278 | case $ac_cv_c_restrict in | |
10279 | restrict) ;; | |
10280 | no) $as_echo "#define restrict /**/" >>confdefs.h | |
10281 | ;; | |
10282 | *) cat >>confdefs.h <<_ACEOF | |
10283 | #define restrict $ac_cv_c_restrict | |
10284 | _ACEOF | |
10285 | ;; | |
10286 | esac | |
8690e634 JK |
10287 | |
10288 | ||
10289 | ||
10290 | ||
10291 | ||
10292 | ||
c0c3707f CB |
10293 | |
10294 | ||
10295 | ||
10296 | ||
10297 | ||
10298 | ||
10299 | ||
10300 | ||
10301 | ||
10302 | if test $gl_cv_have_include_next = yes; then | |
10303 | gl_cv_next_sys_stat_h='<'sys/stat.h'>' | |
10304 | else | |
10305 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5 | |
10306 | $as_echo_n "checking absolute name of <sys/stat.h>... " >&6; } | |
10307 | if ${gl_cv_next_sys_stat_h+:} false; then : | |
8690e634 JK |
10308 | $as_echo_n "(cached) " >&6 |
10309 | else | |
10310 | ||
c0c3707f | 10311 | if test $ac_cv_header_sys_stat_h = yes; then |
4a626d0a PA |
10312 | |
10313 | ||
4a626d0a | 10314 | |
c0c3707f CB |
10315 | |
10316 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10317 | /* end confdefs.h. */ | |
10318 | #include <sys/stat.h> | |
6ec2e0f5 | 10319 | _ACEOF |
c0c3707f CB |
10320 | case "$host_os" in |
10321 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
10322 | *) gl_absname_cpp="$ac_cpp" ;; | |
10323 | esac | |
10324 | ||
10325 | case "$host_os" in | |
10326 | mingw*) | |
10327 | gl_dirsep_regex='[/\\]' | |
10328 | ;; | |
10329 | *) | |
10330 | gl_dirsep_regex='\/' | |
10331 | ;; | |
10332 | esac | |
10333 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
10334 | gl_header_literal_regex=`echo 'sys/stat.h' \ | |
10335 | | sed -e "$gl_make_literal_regex_sed"` | |
10336 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
10337 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
10338 | s|^/[^/]|//&| | |
10339 | p | |
10340 | q | |
10341 | }' | |
10342 | ||
10343 | gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
10344 | sed -n "$gl_absolute_header_sed"` | |
10345 | ||
10346 | gl_header=$gl_cv_absolute_sys_stat_h | |
10347 | gl_cv_next_sys_stat_h='"'$gl_header'"' | |
10348 | else | |
10349 | gl_cv_next_sys_stat_h='<'sys/stat.h'>' | |
10350 | fi | |
10351 | ||
10352 | ||
10353 | fi | |
10354 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 | |
10355 | $as_echo "$gl_cv_next_sys_stat_h" >&6; } | |
10356 | fi | |
10357 | NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h | |
10358 | ||
10359 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
10360 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
10361 | gl_next_as_first_directive='<'sys/stat.h'>' | |
10362 | else | |
10363 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
10364 | gl_next_as_first_directive=$gl_cv_next_sys_stat_h | |
10365 | fi | |
10366 | NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive | |
10367 | ||
10368 | ||
10369 | ||
10370 | ||
10371 | ||
10372 | ||
10373 | ||
10374 | ||
10375 | WINDOWS_STAT_TIMESPEC=0 | |
10376 | ||
10377 | ||
10378 | ||
10379 | ||
4a626d0a | 10380 | |
4a626d0a | 10381 | |
8690e634 JK |
10382 | |
10383 | ||
c0c3707f CB |
10384 | ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h> |
10385 | #include <sys/stat.h> | |
10386 | " | |
10387 | if test "x$ac_cv_type_nlink_t" = xyes; then : | |
8690e634 | 10388 | |
6ec2e0f5 | 10389 | else |
8690e634 | 10390 | |
c0c3707f | 10391 | $as_echo "#define nlink_t int" >>confdefs.h |
6ec2e0f5 | 10392 | |
6ec2e0f5 | 10393 | fi |
8690e634 JK |
10394 | |
10395 | ||
10396 | ||
10397 | ||
10398 | ||
10399 | ||
10400 | ||
698be2d8 CB |
10401 | |
10402 | ||
6ec2e0f5 | 10403 | |
9c9d63b1 PM |
10404 | case "$host_os" in |
10405 | mingw*) | |
10406 | for ac_header in sdkddkver.h | |
10407 | do : | |
10408 | ac_fn_c_check_header_mongrel "$LINENO" "sdkddkver.h" "ac_cv_header_sdkddkver_h" "$ac_includes_default" | |
10409 | if test "x$ac_cv_header_sdkddkver_h" = xyes; then : | |
10410 | cat >>confdefs.h <<_ACEOF | |
10411 | #define HAVE_SDKDDKVER_H 1 | |
8690e634 | 10412 | _ACEOF |
6ec2e0f5 | 10413 | |
8690e634 | 10414 | fi |
c0c3707f | 10415 | |
9c9d63b1 | 10416 | done |
8690e634 | 10417 | |
c0c3707f CB |
10418 | ;; |
10419 | esac | |
8690e634 | 10420 | |
8690e634 | 10421 | |
8690e634 | 10422 | |
8690e634 | 10423 | |
c0c3707f CB |
10424 | |
10425 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5 | |
10426 | $as_echo_n "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; } | |
10427 | if ${gl_cv_func_getcwd_null+:} false; then : | |
8690e634 JK |
10428 | $as_echo_n "(cached) " >&6 |
10429 | else | |
c0c3707f CB |
10430 | if test "$cross_compiling" = yes; then : |
10431 | case "$host_os" in | |
10432 | # Guess yes on glibc systems. | |
10433 | *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";; | |
10434 | # Guess yes on musl systems. | |
10435 | *-musl*) gl_cv_func_getcwd_null="guessing yes";; | |
10436 | # Guess yes on Cygwin. | |
10437 | cygwin*) gl_cv_func_getcwd_null="guessing yes";; | |
10438 | # If we don't know, obey --enable-cross-guesses. | |
10439 | *) gl_cv_func_getcwd_null="$gl_cross_guess_normal";; | |
10440 | esac | |
10441 | ||
10442 | else | |
10443 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 JK |
10444 | /* end confdefs.h. */ |
10445 | ||
c0c3707f CB |
10446 | # include <stdlib.h> |
10447 | # if HAVE_UNISTD_H | |
10448 | # include <unistd.h> | |
10449 | # else /* on Windows with MSVC */ | |
10450 | # include <direct.h> | |
10451 | # endif | |
9c9d63b1 PM |
10452 | |
10453 | ||
10454 | $gl_mda_defines | |
10455 | ||
c0c3707f CB |
10456 | # ifndef getcwd |
10457 | char *getcwd (); | |
10458 | # endif | |
8690e634 JK |
10459 | |
10460 | int | |
10461 | main () | |
10462 | { | |
10463 | ||
c0c3707f | 10464 | #if defined _WIN32 && ! defined __CYGWIN__ |
9c9d63b1 | 10465 | /* mingw cwd does not start with '/', but _getcwd does allocate. |
c0c3707f CB |
10466 | However, mingw fails to honor non-zero size. */ |
10467 | #else | |
10468 | if (chdir ("/") != 0) | |
10469 | return 1; | |
10470 | else | |
10471 | { | |
10472 | char *f = getcwd (NULL, 0); | |
10473 | if (! f) | |
10474 | return 2; | |
10475 | if (f[0] != '/') | |
10476 | { free (f); return 3; } | |
10477 | if (f[1] != '\0') | |
10478 | { free (f); return 4; } | |
10479 | free (f); | |
10480 | return 0; | |
10481 | } | |
10482 | #endif | |
10483 | ||
8690e634 JK |
10484 | ; |
10485 | return 0; | |
10486 | } | |
10487 | _ACEOF | |
c0c3707f CB |
10488 | if ac_fn_c_try_run "$LINENO"; then : |
10489 | gl_cv_func_getcwd_null=yes | |
10490 | else | |
10491 | gl_cv_func_getcwd_null=no | |
8690e634 | 10492 | fi |
c0c3707f CB |
10493 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
10494 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
8690e634 | 10495 | fi |
8690e634 | 10496 | |
c0c3707f CB |
10497 | fi |
10498 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5 | |
10499 | $as_echo "$gl_cv_func_getcwd_null" >&6; } | |
8690e634 | 10500 | |
6ec2e0f5 | 10501 | |
c0c3707f CB |
10502 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5 |
10503 | $as_echo_n "checking for getcwd with POSIX signature... " >&6; } | |
10504 | if ${gl_cv_func_getcwd_posix_signature+:} false; then : | |
8690e634 JK |
10505 | $as_echo_n "(cached) " >&6 |
10506 | else | |
c0c3707f | 10507 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8690e634 | 10508 | /* end confdefs.h. */ |
c0c3707f | 10509 | #include <unistd.h> |
9c9d63b1 PM |
10510 | |
10511 | ||
10512 | $gl_mda_defines | |
10513 | ||
88b48903 WN |
10514 | int |
10515 | main () | |
10516 | { | |
c0c3707f CB |
10517 | extern |
10518 | #ifdef __cplusplus | |
10519 | "C" | |
10520 | #endif | |
10521 | char *getcwd (char *, size_t); | |
88b48903 WN |
10522 | |
10523 | ; | |
10524 | return 0; | |
10525 | } | |
c0c3707f | 10526 | |
88b48903 WN |
10527 | _ACEOF |
10528 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f CB |
10529 | gl_cv_func_getcwd_posix_signature=yes |
10530 | else | |
10531 | gl_cv_func_getcwd_posix_signature=no | |
8690e634 | 10532 | fi |
88b48903 | 10533 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
8690e634 | 10534 | |
c0c3707f CB |
10535 | fi |
10536 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5 | |
10537 | $as_echo "$gl_cv_func_getcwd_posix_signature" >&6; } | |
8690e634 | 10538 | |
c0c3707f CB |
10539 | ac_fn_c_check_decl "$LINENO" "getcwd" "ac_cv_have_decl_getcwd" "$ac_includes_default" |
10540 | if test "x$ac_cv_have_decl_getcwd" = xyes; then : | |
10541 | ac_have_decl=1 | |
10542 | else | |
10543 | ac_have_decl=0 | |
10544 | fi | |
8690e634 | 10545 | |
c0c3707f CB |
10546 | cat >>confdefs.h <<_ACEOF |
10547 | #define HAVE_DECL_GETCWD $ac_have_decl | |
10548 | _ACEOF | |
8690e634 JK |
10549 | |
10550 | ||
7a6dbc2f | 10551 | |
c0c3707f CB |
10552 | ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default" |
10553 | if test "x$ac_cv_have_decl_getdtablesize" = xyes; then : | |
10554 | ac_have_decl=1 | |
88b48903 | 10555 | else |
c0c3707f | 10556 | ac_have_decl=0 |
88b48903 | 10557 | fi |
8690e634 | 10558 | |
c0c3707f CB |
10559 | cat >>confdefs.h <<_ACEOF |
10560 | #define HAVE_DECL_GETDTABLESIZE $ac_have_decl | |
10561 | _ACEOF | |
8690e634 | 10562 | |
c0c3707f CB |
10563 | ac_fn_c_check_decl "$LINENO" "getlogin_r" "ac_cv_have_decl_getlogin_r" "$ac_includes_default" |
10564 | if test "x$ac_cv_have_decl_getlogin_r" = xyes; then : | |
10565 | ac_have_decl=1 | |
10566 | else | |
10567 | ac_have_decl=0 | |
10568 | fi | |
8690e634 | 10569 | |
c0c3707f CB |
10570 | cat >>confdefs.h <<_ACEOF |
10571 | #define HAVE_DECL_GETLOGIN_R $ac_have_decl | |
10572 | _ACEOF | |
8690e634 JK |
10573 | |
10574 | ||
6ec2e0f5 | 10575 | |
c0c3707f CB |
10576 | ac_fn_c_check_decl "$LINENO" "getlogin" "ac_cv_have_decl_getlogin" "$ac_includes_default" |
10577 | if test "x$ac_cv_have_decl_getlogin" = xyes; then : | |
10578 | ac_have_decl=1 | |
6ec2e0f5 | 10579 | else |
c0c3707f | 10580 | ac_have_decl=0 |
88b48903 | 10581 | fi |
8690e634 | 10582 | |
c0c3707f CB |
10583 | cat >>confdefs.h <<_ACEOF |
10584 | #define HAVE_DECL_GETLOGIN $ac_have_decl | |
10585 | _ACEOF | |
8690e634 JK |
10586 | |
10587 | ||
10588 | ||
c0c3707f CB |
10589 | case $host_os in |
10590 | mingw*) | |
10591 | LIB_GETLOGIN='-ladvapi32' ;; | |
10592 | *) | |
10593 | LIB_GETLOGIN= ;; | |
10594 | esac | |
6ec2e0f5 | 10595 | |
472fa5ee SM |
10596 | |
10597 | ||
10598 | ||
6ec2e0f5 SDJ |
10599 | |
10600 | ||
10601 | ||
698be2d8 CB |
10602 | GNULIB_GETRANDOM=0; |
10603 | HAVE_GETRANDOM=1; | |
10604 | REPLACE_GETRANDOM=0; | |
10605 | ||
10606 | ||
10607 | ||
10608 | ||
c0c3707f CB |
10609 | GNULIB_GETTIMEOFDAY=0; |
10610 | HAVE_GETTIMEOFDAY=1; | |
10611 | HAVE_STRUCT_TIMEVAL=1; | |
10612 | HAVE_SYS_TIME_H=1; | |
10613 | REPLACE_GETTIMEOFDAY=0; | |
10614 | REPLACE_STRUCT_TIMEVAL=0; | |
472fa5ee | 10615 | |
472fa5ee | 10616 | |
6ec2e0f5 SDJ |
10617 | |
10618 | ||
10619 | ||
10620 | ||
10621 | ||
10622 | ||
472fa5ee SM |
10623 | |
10624 | ||
10625 | ||
6ec2e0f5 SDJ |
10626 | |
10627 | ||
10628 | ||
10629 | ||
10630 | ||
10631 | if test $gl_cv_have_include_next = yes; then | |
c0c3707f | 10632 | gl_cv_next_sys_time_h='<'sys/time.h'>' |
6ec2e0f5 | 10633 | else |
c0c3707f CB |
10634 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5 |
10635 | $as_echo_n "checking absolute name of <sys/time.h>... " >&6; } | |
10636 | if ${gl_cv_next_sys_time_h+:} false; then : | |
6ec2e0f5 | 10637 | $as_echo_n "(cached) " >&6 |
88b48903 | 10638 | else |
8690e634 | 10639 | |
c0c3707f | 10640 | if test $ac_cv_header_sys_time_h = yes; then |
8690e634 JK |
10641 | |
10642 | ||
8690e634 JK |
10643 | |
10644 | ||
6ec2e0f5 SDJ |
10645 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
10646 | /* end confdefs.h. */ | |
c0c3707f | 10647 | #include <sys/time.h> |
88b48903 | 10648 | _ACEOF |
6ec2e0f5 SDJ |
10649 | case "$host_os" in |
10650 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
10651 | *) gl_absname_cpp="$ac_cpp" ;; | |
10652 | esac | |
8690e634 | 10653 | |
6ec2e0f5 SDJ |
10654 | case "$host_os" in |
10655 | mingw*) | |
10656 | gl_dirsep_regex='[/\\]' | |
10657 | ;; | |
10658 | *) | |
10659 | gl_dirsep_regex='\/' | |
88b48903 WN |
10660 | ;; |
10661 | esac | |
6ec2e0f5 | 10662 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' |
c0c3707f | 10663 | gl_header_literal_regex=`echo 'sys/time.h' \ |
6ec2e0f5 SDJ |
10664 | | sed -e "$gl_make_literal_regex_sed"` |
10665 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
10666 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
10667 | s|^/[^/]|//&| | |
10668 | p | |
10669 | q | |
10670 | }' | |
8690e634 | 10671 | |
c0c3707f | 10672 | gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
6ec2e0f5 | 10673 | sed -n "$gl_absolute_header_sed"` |
8690e634 | 10674 | |
c0c3707f CB |
10675 | gl_header=$gl_cv_absolute_sys_time_h |
10676 | gl_cv_next_sys_time_h='"'$gl_header'"' | |
6ec2e0f5 | 10677 | else |
c0c3707f | 10678 | gl_cv_next_sys_time_h='<'sys/time.h'>' |
6ec2e0f5 | 10679 | fi |
88b48903 | 10680 | |
88b48903 | 10681 | |
88b48903 | 10682 | fi |
c0c3707f CB |
10683 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5 |
10684 | $as_echo "$gl_cv_next_sys_time_h" >&6; } | |
6ec2e0f5 | 10685 | fi |
c0c3707f | 10686 | NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h |
88b48903 | 10687 | |
6ec2e0f5 SDJ |
10688 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
10689 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
c0c3707f | 10690 | gl_next_as_first_directive='<'sys/time.h'>' |
6ec2e0f5 SDJ |
10691 | else |
10692 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
c0c3707f CB |
10693 | gl_next_as_first_directive=$gl_cv_next_sys_time_h |
10694 | fi | |
10695 | NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive | |
6ec2e0f5 | 10696 | |
6ec2e0f5 SDJ |
10697 | |
10698 | ||
10699 | ||
6ec2e0f5 | 10700 | |
c0c3707f CB |
10701 | if test $ac_cv_header_sys_time_h != yes; then |
10702 | HAVE_SYS_TIME_H=0 | |
10703 | fi | |
6ec2e0f5 | 10704 | |
6ec2e0f5 | 10705 | |
6ec2e0f5 | 10706 | |
6ec2e0f5 | 10707 | |
6ec2e0f5 | 10708 | |
c0c3707f CB |
10709 | if test $ac_cv_header_sys_socket_h != yes; then |
10710 | for ac_header in winsock2.h | |
10711 | do : | |
10712 | ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" | |
10713 | if test "x$ac_cv_header_winsock2_h" = xyes; then : | |
10714 | cat >>confdefs.h <<_ACEOF | |
10715 | #define HAVE_WINSOCK2_H 1 | |
6ec2e0f5 | 10716 | _ACEOF |
6ec2e0f5 | 10717 | |
6ec2e0f5 | 10718 | fi |
6ec2e0f5 | 10719 | |
c0c3707f | 10720 | done |
6ec2e0f5 | 10721 | |
c0c3707f CB |
10722 | fi |
10723 | if test "$ac_cv_header_winsock2_h" = yes; then | |
10724 | HAVE_WINSOCK2_H=1 | |
10725 | UNISTD_H_HAVE_WINSOCK2_H=1 | |
10726 | SYS_IOCTL_H_HAVE_WINSOCK2_H=1 | |
10727 | else | |
10728 | HAVE_WINSOCK2_H=0 | |
10729 | fi | |
10730 | ||
10731 | ||
10732 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5 | |
10733 | $as_echo_n "checking for struct timeval... " >&6; } | |
10734 | if ${gl_cv_sys_struct_timeval+:} false; then : | |
10735 | $as_echo_n "(cached) " >&6 | |
10736 | else | |
10737 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 10738 | /* end confdefs.h. */ |
c0c3707f CB |
10739 | #if HAVE_SYS_TIME_H |
10740 | #include <sys/time.h> | |
10741 | #endif | |
10742 | #include <time.h> | |
10743 | #if HAVE_WINSOCK2_H | |
10744 | # include <winsock2.h> | |
10745 | #endif | |
6ec2e0f5 SDJ |
10746 | |
10747 | int | |
10748 | main () | |
10749 | { | |
c0c3707f | 10750 | static struct timeval x; x.tv_sec = x.tv_usec; |
6ec2e0f5 SDJ |
10751 | ; |
10752 | return 0; | |
10753 | } | |
10754 | _ACEOF | |
10755 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 10756 | gl_cv_sys_struct_timeval=yes |
6ec2e0f5 | 10757 | else |
c0c3707f | 10758 | gl_cv_sys_struct_timeval=no |
6ec2e0f5 SDJ |
10759 | fi |
10760 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
88b48903 | 10761 | |
c0c3707f CB |
10762 | fi |
10763 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5 | |
10764 | $as_echo "$gl_cv_sys_struct_timeval" >&6; } | |
10765 | if test $gl_cv_sys_struct_timeval != yes; then | |
10766 | HAVE_STRUCT_TIMEVAL=0 | |
10767 | else | |
10768 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5 | |
10769 | $as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; } | |
10770 | if ${gl_cv_sys_struct_timeval_tv_sec+:} false; then : | |
10771 | $as_echo_n "(cached) " >&6 | |
10772 | else | |
10773 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
88b48903 | 10774 | /* end confdefs.h. */ |
c0c3707f CB |
10775 | #if HAVE_SYS_TIME_H |
10776 | #include <sys/time.h> | |
10777 | #endif | |
10778 | #include <time.h> | |
10779 | #if HAVE_WINSOCK2_H | |
10780 | # include <winsock2.h> | |
10781 | #endif | |
88b48903 WN |
10782 | |
10783 | int | |
10784 | main () | |
10785 | { | |
c0c3707f CB |
10786 | static struct timeval x; |
10787 | typedef int verify_tv_sec_type[ | |
10788 | sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 | |
10789 | ]; | |
88b48903 WN |
10790 | |
10791 | ; | |
10792 | return 0; | |
10793 | } | |
10794 | _ACEOF | |
10795 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 10796 | gl_cv_sys_struct_timeval_tv_sec=yes |
88b48903 | 10797 | else |
c0c3707f | 10798 | gl_cv_sys_struct_timeval_tv_sec=no |
88b48903 WN |
10799 | fi |
10800 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c0c3707f | 10801 | |
88b48903 | 10802 | fi |
c0c3707f CB |
10803 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5 |
10804 | $as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; } | |
10805 | if test $gl_cv_sys_struct_timeval_tv_sec != yes; then | |
10806 | REPLACE_STRUCT_TIMEVAL=1 | |
88b48903 | 10807 | fi |
c0c3707f | 10808 | fi |
88b48903 | 10809 | |
c0c3707f CB |
10810 | |
10811 | ||
10812 | ||
10813 | ||
10814 | ||
10815 | ||
10816 | ||
10817 | ||
10818 | ||
10819 | ||
c0c3707f CB |
10820 | GNULIB_GLOB=0; |
10821 | HAVE_GLOB=1; | |
10822 | HAVE_GLOB_PATTERN_P=1; | |
10823 | REPLACE_GLOB=0; | |
10824 | REPLACE_GLOB_PATTERN_P=0; | |
10825 | ||
10826 | ||
10827 | ||
10828 | ||
10829 | ||
10830 | ||
10831 | ||
10832 | ||
10833 | ||
10834 | ||
10835 | ||
10836 | ||
10837 | ||
10838 | ||
10839 | ||
10840 | ||
10841 | ||
10842 | if test $gl_cv_have_include_next = yes; then | |
10843 | gl_cv_next_glob_h='<'glob.h'>' | |
10844 | else | |
10845 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <glob.h>" >&5 | |
10846 | $as_echo_n "checking absolute name of <glob.h>... " >&6; } | |
10847 | if ${gl_cv_next_glob_h+:} false; then : | |
10848 | $as_echo_n "(cached) " >&6 | |
88b48903 | 10849 | else |
c0c3707f CB |
10850 | |
10851 | if test $ac_cv_header_glob_h = yes; then | |
10852 | ||
10853 | ||
10854 | ||
10855 | ||
88b48903 WN |
10856 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
10857 | /* end confdefs.h. */ | |
c0c3707f CB |
10858 | #include <glob.h> |
10859 | _ACEOF | |
10860 | case "$host_os" in | |
10861 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
10862 | *) gl_absname_cpp="$ac_cpp" ;; | |
10863 | esac | |
88b48903 | 10864 | |
c0c3707f CB |
10865 | case "$host_os" in |
10866 | mingw*) | |
10867 | gl_dirsep_regex='[/\\]' | |
10868 | ;; | |
10869 | *) | |
10870 | gl_dirsep_regex='\/' | |
10871 | ;; | |
10872 | esac | |
10873 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
10874 | gl_header_literal_regex=`echo 'glob.h' \ | |
10875 | | sed -e "$gl_make_literal_regex_sed"` | |
10876 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
10877 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
10878 | s|^/[^/]|//&| | |
10879 | p | |
10880 | q | |
10881 | }' | |
10882 | ||
10883 | gl_cv_absolute_glob_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
10884 | sed -n "$gl_absolute_header_sed"` | |
10885 | ||
10886 | gl_header=$gl_cv_absolute_glob_h | |
10887 | gl_cv_next_glob_h='"'$gl_header'"' | |
10888 | else | |
10889 | gl_cv_next_glob_h='<'glob.h'>' | |
10890 | fi | |
88b48903 | 10891 | |
88b48903 | 10892 | |
88b48903 | 10893 | fi |
c0c3707f CB |
10894 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_glob_h" >&5 |
10895 | $as_echo "$gl_cv_next_glob_h" >&6; } | |
10896 | fi | |
10897 | NEXT_GLOB_H=$gl_cv_next_glob_h | |
88b48903 | 10898 | |
c0c3707f CB |
10899 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
10900 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
10901 | gl_next_as_first_directive='<'glob.h'>' | |
10902 | else | |
10903 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
10904 | gl_next_as_first_directive=$gl_cv_next_glob_h | |
10905 | fi | |
10906 | NEXT_AS_FIRST_DIRECTIVE_GLOB_H=$gl_next_as_first_directive | |
88b48903 | 10907 | |
88b48903 WN |
10908 | |
10909 | ||
10910 | ||
2196f55f | 10911 | |
c0c3707f CB |
10912 | if test $ac_cv_header_glob_h = yes; then |
10913 | HAVE_GLOB_H=1 | |
10914 | else | |
10915 | HAVE_GLOB_H=0 | |
10916 | fi | |
2196f55f | 10917 | |
6ec2e0f5 | 10918 | |
c0c3707f CB |
10919 | GLOB_H='' |
10920 | if false; then | |
10921 | GLOB_H=glob.h | |
10922 | else | |
10923 | if test $ac_cv_header_glob_h != yes; then | |
10924 | GLOB_H=glob.h | |
10925 | fi | |
10926 | fi | |
10927 | ||
10928 | ||
10929 | if test -n "$GLOB_H"; then | |
10930 | GL_GENERATE_GLOB_H_TRUE= | |
10931 | GL_GENERATE_GLOB_H_FALSE='#' | |
88b48903 | 10932 | else |
c0c3707f CB |
10933 | GL_GENERATE_GLOB_H_TRUE='#' |
10934 | GL_GENERATE_GLOB_H_FALSE= | |
6ec2e0f5 SDJ |
10935 | fi |
10936 | ||
88b48903 | 10937 | |
88b48903 | 10938 | |
88b48903 | 10939 | |
88b48903 WN |
10940 | |
10941 | ||
10942 | ||
10943 | ||
10944 | ||
10945 | ||
10946 | ||
10947 | ||
8690e634 | 10948 | |
c0c3707f CB |
10949 | |
10950 | ||
c0c3707f | 10951 | |
5df4cba6 SM |
10952 | if test -z "$gl_pthreadlib_body_done"; then |
10953 | gl_pthread_api=no | |
10954 | LIBPTHREAD= | |
10955 | LIBPMULTITHREAD= | |
10956 | # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that | |
10957 | # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY. | |
10958 | ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" | |
10959 | if test "x$ac_cv_header_pthread_h" = xyes; then : | |
10960 | gl_have_pthread_h=yes | |
c0c3707f | 10961 | else |
5df4cba6 SM |
10962 | gl_have_pthread_h=no |
10963 | fi | |
c0c3707f | 10964 | |
5df4cba6 SM |
10965 | |
10966 | if test "$gl_have_pthread_h" = yes; then | |
10967 | # Other possible tests: | |
10968 | # -lpthreads (FSU threads, PCthreads) | |
10969 | # -lgthreads | |
10970 | # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist | |
10971 | # in libc. IRIX 6.5 has the first one in both libc and libpthread, but | |
10972 | # the second one only in libpthread, and lock.c needs it. | |
10973 | # | |
10974 | # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 | |
10975 | # needs -pthread for some reason. See: | |
10976 | # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html | |
10977 | save_LIBS=$LIBS | |
10978 | for gl_pthread in '' '-pthread'; do | |
10979 | LIBS="$LIBS $gl_pthread" | |
10980 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 10981 | /* end confdefs.h. */ |
5df4cba6 SM |
10982 | #include <pthread.h> |
10983 | pthread_mutex_t m; | |
10984 | pthread_mutexattr_t ma; | |
10985 | ||
8690e634 JK |
10986 | int |
10987 | main () | |
10988 | { | |
5df4cba6 SM |
10989 | pthread_mutex_lock (&m); |
10990 | pthread_mutexattr_init (&ma); | |
8690e634 JK |
10991 | ; |
10992 | return 0; | |
10993 | } | |
10994 | _ACEOF | |
5df4cba6 SM |
10995 | if ac_fn_c_try_link "$LINENO"; then : |
10996 | gl_pthread_api=yes | |
10997 | LIBPTHREAD=$gl_pthread | |
10998 | LIBPMULTITHREAD=$gl_pthread | |
c0c3707f | 10999 | fi |
5df4cba6 SM |
11000 | rm -f core conftest.err conftest.$ac_objext \ |
11001 | conftest$ac_exeext conftest.$ac_ext | |
11002 | LIBS=$save_LIBS | |
11003 | test $gl_pthread_api = yes && break | |
11004 | done | |
6ec2e0f5 | 11005 | |
5df4cba6 SM |
11006 | # Test for libpthread by looking for pthread_kill. (Not pthread_self, |
11007 | # since it is defined as a macro on OSF/1.) | |
11008 | if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then | |
11009 | # The program links fine without libpthread. But it may actually | |
11010 | # need to link with libpthread in order to create multiple threads. | |
11011 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
11012 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
11013 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
c0c3707f CB |
11014 | $as_echo_n "(cached) " >&6 |
11015 | else | |
5df4cba6 SM |
11016 | ac_check_lib_save_LIBS=$LIBS |
11017 | LIBS="-lpthread $LIBS" | |
11018 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 11019 | /* end confdefs.h. */ |
5df4cba6 SM |
11020 | |
11021 | /* Override any GCC internal prototype to avoid an error. | |
11022 | Use char because int might match the return type of a GCC | |
11023 | builtin and then its argument prototype would still apply. */ | |
11024 | #ifdef __cplusplus | |
11025 | extern "C" | |
11026 | #endif | |
11027 | char pthread_kill (); | |
6ec2e0f5 SDJ |
11028 | int |
11029 | main () | |
11030 | { | |
5df4cba6 | 11031 | return pthread_kill (); |
6ec2e0f5 SDJ |
11032 | ; |
11033 | return 0; | |
11034 | } | |
11035 | _ACEOF | |
5df4cba6 SM |
11036 | if ac_fn_c_try_link "$LINENO"; then : |
11037 | ac_cv_lib_pthread_pthread_kill=yes | |
6ec2e0f5 | 11038 | else |
5df4cba6 | 11039 | ac_cv_lib_pthread_pthread_kill=no |
8690e634 | 11040 | fi |
5df4cba6 SM |
11041 | rm -f core conftest.err conftest.$ac_objext \ |
11042 | conftest$ac_exeext conftest.$ac_ext | |
11043 | LIBS=$ac_check_lib_save_LIBS | |
11044 | fi | |
11045 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 | |
11046 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
11047 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
11048 | LIBPMULTITHREAD=-lpthread | |
11049 | # On Solaris and HP-UX, most pthread functions exist also in libc. | |
11050 | # Therefore pthread_in_use() needs to actually try to create a | |
11051 | # thread: pthread_create from libc will fail, whereas | |
11052 | # pthread_create will actually create a thread. | |
11053 | # On Solaris 10 or newer, this test is no longer needed, because | |
11054 | # libc contains the fully functional pthread functions. | |
11055 | case "$host_os" in | |
11056 | solaris | solaris2.1-9 | solaris2.1-9.* | hpux*) | |
11057 | ||
11058 | $as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h | |
11059 | ||
11060 | esac | |
c0c3707f | 11061 | |
6ec2e0f5 | 11062 | fi |
8690e634 | 11063 | |
5df4cba6 SM |
11064 | elif test $gl_pthread_api != yes; then |
11065 | # Some library is needed. Try libpthread and libc_r. | |
11066 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
11067 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
11068 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
11069 | $as_echo_n "(cached) " >&6 | |
11070 | else | |
11071 | ac_check_lib_save_LIBS=$LIBS | |
11072 | LIBS="-lpthread $LIBS" | |
11073 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11074 | /* end confdefs.h. */ | |
c0c3707f | 11075 | |
5df4cba6 SM |
11076 | /* Override any GCC internal prototype to avoid an error. |
11077 | Use char because int might match the return type of a GCC | |
11078 | builtin and then its argument prototype would still apply. */ | |
11079 | #ifdef __cplusplus | |
11080 | extern "C" | |
11081 | #endif | |
11082 | char pthread_kill (); | |
11083 | int | |
11084 | main () | |
11085 | { | |
11086 | return pthread_kill (); | |
11087 | ; | |
11088 | return 0; | |
11089 | } | |
11090 | _ACEOF | |
11091 | if ac_fn_c_try_link "$LINENO"; then : | |
11092 | ac_cv_lib_pthread_pthread_kill=yes | |
11093 | else | |
11094 | ac_cv_lib_pthread_pthread_kill=no | |
11095 | fi | |
11096 | rm -f core conftest.err conftest.$ac_objext \ | |
11097 | conftest$ac_exeext conftest.$ac_ext | |
11098 | LIBS=$ac_check_lib_save_LIBS | |
11099 | fi | |
11100 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 | |
11101 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
11102 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
11103 | gl_pthread_api=yes | |
11104 | LIBPTHREAD=-lpthread | |
11105 | LIBPMULTITHREAD=-lpthread | |
11106 | fi | |
c0c3707f | 11107 | |
5df4cba6 SM |
11108 | if test $gl_pthread_api != yes; then |
11109 | # For FreeBSD 4. | |
11110 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5 | |
11111 | $as_echo_n "checking for pthread_kill in -lc_r... " >&6; } | |
11112 | if ${ac_cv_lib_c_r_pthread_kill+:} false; then : | |
11113 | $as_echo_n "(cached) " >&6 | |
11114 | else | |
11115 | ac_check_lib_save_LIBS=$LIBS | |
11116 | LIBS="-lc_r $LIBS" | |
11117 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11118 | /* end confdefs.h. */ | |
c0c3707f | 11119 | |
5df4cba6 SM |
11120 | /* Override any GCC internal prototype to avoid an error. |
11121 | Use char because int might match the return type of a GCC | |
11122 | builtin and then its argument prototype would still apply. */ | |
11123 | #ifdef __cplusplus | |
11124 | extern "C" | |
11125 | #endif | |
11126 | char pthread_kill (); | |
11127 | int | |
11128 | main () | |
11129 | { | |
11130 | return pthread_kill (); | |
11131 | ; | |
11132 | return 0; | |
11133 | } | |
11134 | _ACEOF | |
11135 | if ac_fn_c_try_link "$LINENO"; then : | |
11136 | ac_cv_lib_c_r_pthread_kill=yes | |
11137 | else | |
11138 | ac_cv_lib_c_r_pthread_kill=no | |
11139 | fi | |
11140 | rm -f core conftest.err conftest.$ac_objext \ | |
11141 | conftest$ac_exeext conftest.$ac_ext | |
11142 | LIBS=$ac_check_lib_save_LIBS | |
11143 | fi | |
11144 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5 | |
11145 | $as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; } | |
11146 | if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then : | |
11147 | gl_pthread_api=yes | |
11148 | LIBPTHREAD=-lc_r | |
11149 | LIBPMULTITHREAD=-lc_r | |
11150 | fi | |
c0c3707f | 11151 | |
5df4cba6 SM |
11152 | fi |
11153 | fi | |
11154 | fi | |
11155 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 | |
11156 | $as_echo_n "checking whether POSIX threads API is available... " >&6; } | |
11157 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5 | |
11158 | $as_echo "$gl_pthread_api" >&6; } | |
c0c3707f CB |
11159 | |
11160 | ||
5df4cba6 | 11161 | if test $gl_pthread_api = yes; then |
c0c3707f | 11162 | |
5df4cba6 | 11163 | $as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h |
c0c3707f | 11164 | |
5df4cba6 | 11165 | fi |
c0c3707f | 11166 | |
5df4cba6 SM |
11167 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
11168 | /* end confdefs.h. */ | |
11169 | #include <sched.h> | |
11170 | int | |
11171 | main () | |
11172 | { | |
11173 | sched_yield (); | |
11174 | ; | |
11175 | return 0; | |
11176 | } | |
11177 | _ACEOF | |
11178 | if ac_fn_c_try_link "$LINENO"; then : | |
11179 | LIB_SCHED_YIELD= | |
c0c3707f | 11180 | |
5df4cba6 SM |
11181 | else |
11182 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 | |
11183 | $as_echo_n "checking for sched_yield in -lrt... " >&6; } | |
11184 | if ${ac_cv_lib_rt_sched_yield+:} false; then : | |
c0c3707f | 11185 | $as_echo_n "(cached) " >&6 |
6ec2e0f5 | 11186 | else |
5df4cba6 SM |
11187 | ac_check_lib_save_LIBS=$LIBS |
11188 | LIBS="-lrt $LIBS" | |
11189 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 11190 | /* end confdefs.h. */ |
6ec2e0f5 | 11191 | |
5df4cba6 SM |
11192 | /* Override any GCC internal prototype to avoid an error. |
11193 | Use char because int might match the return type of a GCC | |
11194 | builtin and then its argument prototype would still apply. */ | |
11195 | #ifdef __cplusplus | |
11196 | extern "C" | |
11197 | #endif | |
11198 | char sched_yield (); | |
11199 | int | |
11200 | main () | |
11201 | { | |
11202 | return sched_yield (); | |
11203 | ; | |
11204 | return 0; | |
11205 | } | |
11206 | _ACEOF | |
11207 | if ac_fn_c_try_link "$LINENO"; then : | |
11208 | ac_cv_lib_rt_sched_yield=yes | |
11209 | else | |
11210 | ac_cv_lib_rt_sched_yield=no | |
11211 | fi | |
11212 | rm -f core conftest.err conftest.$ac_objext \ | |
11213 | conftest$ac_exeext conftest.$ac_ext | |
11214 | LIBS=$ac_check_lib_save_LIBS | |
11215 | fi | |
11216 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 | |
11217 | $as_echo "$ac_cv_lib_rt_sched_yield" >&6; } | |
11218 | if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : | |
11219 | LIB_SCHED_YIELD=-lrt | |
11220 | else | |
11221 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5 | |
11222 | $as_echo_n "checking for sched_yield in -lposix4... " >&6; } | |
11223 | if ${ac_cv_lib_posix4_sched_yield+:} false; then : | |
11224 | $as_echo_n "(cached) " >&6 | |
11225 | else | |
11226 | ac_check_lib_save_LIBS=$LIBS | |
11227 | LIBS="-lposix4 $LIBS" | |
11228 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11229 | /* end confdefs.h. */ | |
6ec2e0f5 | 11230 | |
5df4cba6 SM |
11231 | /* Override any GCC internal prototype to avoid an error. |
11232 | Use char because int might match the return type of a GCC | |
11233 | builtin and then its argument prototype would still apply. */ | |
11234 | #ifdef __cplusplus | |
11235 | extern "C" | |
11236 | #endif | |
11237 | char sched_yield (); | |
11238 | int | |
11239 | main () | |
11240 | { | |
11241 | return sched_yield (); | |
11242 | ; | |
11243 | return 0; | |
11244 | } | |
11245 | _ACEOF | |
11246 | if ac_fn_c_try_link "$LINENO"; then : | |
11247 | ac_cv_lib_posix4_sched_yield=yes | |
11248 | else | |
11249 | ac_cv_lib_posix4_sched_yield=no | |
11250 | fi | |
11251 | rm -f core conftest.err conftest.$ac_objext \ | |
11252 | conftest$ac_exeext conftest.$ac_ext | |
11253 | LIBS=$ac_check_lib_save_LIBS | |
11254 | fi | |
11255 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5 | |
11256 | $as_echo "$ac_cv_lib_posix4_sched_yield" >&6; } | |
11257 | if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then : | |
11258 | LIB_SCHED_YIELD=-lposix4 | |
6ec2e0f5 | 11259 | fi |
8690e634 | 11260 | |
5df4cba6 | 11261 | fi |
8690e634 | 11262 | |
8690e634 | 11263 | |
5df4cba6 SM |
11264 | fi |
11265 | rm -f core conftest.err conftest.$ac_objext \ | |
11266 | conftest$ac_exeext conftest.$ac_ext | |
6ec2e0f5 SDJ |
11267 | |
11268 | ||
5df4cba6 | 11269 | gl_pthreadlib_body_done=done |
c0c3707f | 11270 | fi |
6ec2e0f5 | 11271 | |
6ec2e0f5 | 11272 | |
8690e634 JK |
11273 | |
11274 | ||
472fa5ee | 11275 | |
c0c3707f | 11276 | |
c0c3707f | 11277 | |
c0c3707f | 11278 | |
c0c3707f | 11279 | |
5df4cba6 SM |
11280 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5 |
11281 | $as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; } | |
11282 | if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then : | |
11283 | $as_echo_n "(cached) " >&6 | |
11284 | else | |
11285 | case "$host_os" in | |
11286 | # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin. | |
11287 | *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*) | |
11288 | gl_cv_func_setlocale_null_all_mtsafe=no ;; | |
11289 | # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows. | |
11290 | *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*) | |
11291 | gl_cv_func_setlocale_null_all_mtsafe=yes ;; | |
11292 | # If we don't know, obey --enable-cross-guesses. | |
11293 | *) | |
11294 | gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;; | |
11295 | esac | |
c0c3707f | 11296 | |
5e8754f9 | 11297 | fi |
5df4cba6 SM |
11298 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5 |
11299 | $as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; } | |
11300 | case "$host_os" in | |
11301 | mingw*) ;; | |
11302 | *) | |
11303 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then | |
11304 | gl_cv_func_setlocale_null_all_mtsafe="trivially yes" | |
11305 | fi | |
11306 | ;; | |
11307 | esac | |
11308 | case "$gl_cv_func_setlocale_null_all_mtsafe" in | |
11309 | *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;; | |
11310 | *) SETLOCALE_NULL_ALL_MTSAFE=0 ;; | |
11311 | esac | |
5e8754f9 SDJ |
11312 | |
11313 | cat >>confdefs.h <<_ACEOF | |
5df4cba6 | 11314 | #define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE |
5e8754f9 SDJ |
11315 | _ACEOF |
11316 | ||
11317 | ||
5df4cba6 SM |
11318 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5 |
11319 | $as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; } | |
11320 | if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then : | |
11321 | $as_echo_n "(cached) " >&6 | |
11322 | else | |
11323 | case "$host_os" in | |
11324 | # Guess no on OpenBSD, AIX. | |
11325 | openbsd* | aix*) | |
11326 | gl_cv_func_setlocale_null_one_mtsafe=no ;; | |
11327 | # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows. | |
11328 | *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*) | |
11329 | gl_cv_func_setlocale_null_one_mtsafe=yes ;; | |
11330 | # If we don't know, obey --enable-cross-guesses. | |
11331 | *) | |
11332 | gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;; | |
11333 | esac | |
5abebf3c | 11334 | |
5df4cba6 SM |
11335 | fi |
11336 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5 | |
11337 | $as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; } | |
11338 | case "$host_os" in | |
11339 | mingw*) ;; | |
11340 | *) | |
11341 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then | |
11342 | gl_cv_func_setlocale_null_one_mtsafe="trivially yes" | |
11343 | fi | |
11344 | ;; | |
11345 | esac | |
11346 | case "$gl_cv_func_setlocale_null_one_mtsafe" in | |
11347 | *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;; | |
11348 | *) SETLOCALE_NULL_ONE_MTSAFE=0 ;; | |
11349 | esac | |
5abebf3c | 11350 | |
c0c3707f | 11351 | cat >>confdefs.h <<_ACEOF |
5df4cba6 | 11352 | #define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE |
5abebf3c | 11353 | _ACEOF |
c0c3707f CB |
11354 | |
11355 | ||
5df4cba6 SM |
11356 | if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then |
11357 | case "$host_os" in | |
11358 | mingw*) LIB_SETLOCALE_NULL= ;; | |
11359 | *) | |
11360 | ||
11361 | ||
11362 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 | |
11363 | $as_echo_n "checking whether imported symbols can be declared weak... " >&6; } | |
11364 | if ${gl_cv_have_weak+:} false; then : | |
11365 | $as_echo_n "(cached) " >&6 | |
5abebf3c | 11366 | else |
5df4cba6 SM |
11367 | gl_cv_have_weak=no |
11368 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11369 | /* end confdefs.h. */ | |
11370 | extern void xyzzy (); | |
11371 | #pragma weak xyzzy | |
11372 | int | |
11373 | main () | |
11374 | { | |
11375 | xyzzy(); | |
11376 | ; | |
11377 | return 0; | |
11378 | } | |
11379 | _ACEOF | |
11380 | if ac_fn_c_try_link "$LINENO"; then : | |
11381 | gl_cv_have_weak=maybe | |
5abebf3c | 11382 | fi |
5df4cba6 SM |
11383 | rm -f core conftest.err conftest.$ac_objext \ |
11384 | conftest$ac_exeext conftest.$ac_ext | |
11385 | if test $gl_cv_have_weak = maybe; then | |
11386 | if test "$cross_compiling" = yes; then : | |
11387 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11388 | /* end confdefs.h. */ | |
11389 | #ifdef __ELF__ | |
11390 | Extensible Linking Format | |
11391 | #endif | |
c0c3707f | 11392 | |
5df4cba6 SM |
11393 | _ACEOF |
11394 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
11395 | $EGREP "Extensible Linking Format" >/dev/null 2>&1; then : | |
11396 | gl_cv_have_weak="guessing yes" | |
11397 | else | |
11398 | gl_cv_have_weak="guessing no" | |
11399 | fi | |
11400 | rm -f conftest* | |
5abebf3c CB |
11401 | |
11402 | ||
5df4cba6 SM |
11403 | else |
11404 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11405 | /* end confdefs.h. */ | |
5abebf3c | 11406 | |
5df4cba6 SM |
11407 | #include <stdio.h> |
11408 | #pragma weak fputs | |
11409 | int main () | |
11410 | { | |
11411 | return (fputs == NULL); | |
11412 | } | |
c0c3707f | 11413 | _ACEOF |
5df4cba6 SM |
11414 | if ac_fn_c_try_run "$LINENO"; then : |
11415 | gl_cv_have_weak=yes | |
11416 | else | |
11417 | gl_cv_have_weak=no | |
11418 | fi | |
11419 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
11420 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
11421 | fi | |
11422 | ||
11423 | fi | |
11424 | case " $LDFLAGS " in | |
11425 | *" -static "*) gl_cv_have_weak=no ;; | |
11426 | esac | |
11427 | case "$gl_cv_have_weak" in | |
11428 | *yes) | |
11429 | case "$host_os" in | |
11430 | freebsd* | dragonfly*) | |
11431 | : > conftest1.c | |
11432 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1 | |
11433 | cat <<EOF > conftest2.c | |
11434 | #include <pthread.h> | |
11435 | #pragma weak pthread_mutexattr_gettype | |
11436 | int main () | |
11437 | { | |
11438 | return (pthread_mutexattr_gettype != NULL); | |
11439 | } | |
11440 | EOF | |
11441 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \ | |
11442 | || gl_cv_have_weak=no | |
11443 | rm -f conftest1.c libempty.so conftest2.c conftest | |
11444 | ;; | |
11445 | esac | |
11446 | ;; | |
11447 | esac | |
5abebf3c | 11448 | |
c0c3707f | 11449 | fi |
5df4cba6 SM |
11450 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 |
11451 | $as_echo "$gl_cv_have_weak" >&6; } | |
11452 | case "$gl_cv_have_weak" in | |
11453 | *yes) | |
5abebf3c | 11454 | |
5df4cba6 | 11455 | $as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h |
5abebf3c | 11456 | |
5df4cba6 SM |
11457 | ;; |
11458 | esac | |
11459 | ||
11460 | case "$gl_cv_have_weak" in | |
11461 | *yes) LIB_SETLOCALE_NULL= ;; | |
11462 | *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;; | |
11463 | esac | |
11464 | ;; | |
11465 | esac | |
5abebf3c | 11466 | else |
5df4cba6 | 11467 | LIB_SETLOCALE_NULL= |
5abebf3c | 11468 | fi |
5abebf3c CB |
11469 | |
11470 | ||
11471 | ||
5abebf3c | 11472 | |
5abebf3c | 11473 | |
5df4cba6 SM |
11474 | GNULIB_SOCKET=0; |
11475 | GNULIB_CONNECT=0; | |
11476 | GNULIB_ACCEPT=0; | |
11477 | GNULIB_BIND=0; | |
11478 | GNULIB_GETPEERNAME=0; | |
11479 | GNULIB_GETSOCKNAME=0; | |
11480 | GNULIB_GETSOCKOPT=0; | |
11481 | GNULIB_LISTEN=0; | |
11482 | GNULIB_RECV=0; | |
11483 | GNULIB_SEND=0; | |
11484 | GNULIB_RECVFROM=0; | |
11485 | GNULIB_SENDTO=0; | |
11486 | GNULIB_SETSOCKOPT=0; | |
11487 | GNULIB_SHUTDOWN=0; | |
11488 | GNULIB_ACCEPT4=0; | |
11489 | HAVE_STRUCT_SOCKADDR_STORAGE=1; | |
11490 | HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; | |
11491 | ||
11492 | HAVE_SA_FAMILY_T=1; | |
11493 | HAVE_ACCEPT4=1; | |
c0c3707f CB |
11494 | |
11495 | ||
11496 | ||
11497 | ||
11498 | ||
5df4cba6 SM |
11499 | case "$host_os" in |
11500 | osf*) | |
c0c3707f | 11501 | |
5df4cba6 | 11502 | $as_echo "#define _POSIX_PII_SOCKET 1" >>confdefs.h |
c0c3707f | 11503 | |
5df4cba6 SM |
11504 | ;; |
11505 | esac | |
c0c3707f | 11506 | |
5df4cba6 SM |
11507 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5 |
11508 | $as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; } | |
11509 | if ${gl_cv_header_sys_socket_h_selfcontained+:} false; then : | |
5abebf3c CB |
11510 | $as_echo_n "(cached) " >&6 |
11511 | else | |
5df4cba6 SM |
11512 | |
11513 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 11514 | /* end confdefs.h. */ |
c0c3707f | 11515 | #include <sys/socket.h> |
c0c3707f CB |
11516 | int |
11517 | main () | |
11518 | { | |
5df4cba6 | 11519 | |
c0c3707f CB |
11520 | ; |
11521 | return 0; | |
11522 | } | |
11523 | _ACEOF | |
11524 | if ac_fn_c_try_compile "$LINENO"; then : | |
5df4cba6 | 11525 | gl_cv_header_sys_socket_h_selfcontained=yes |
5abebf3c | 11526 | else |
5df4cba6 | 11527 | gl_cv_header_sys_socket_h_selfcontained=no |
5abebf3c | 11528 | fi |
c0c3707f | 11529 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
5abebf3c | 11530 | |
5df4cba6 SM |
11531 | fi |
11532 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 | |
11533 | $as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; } | |
11534 | if test $gl_cv_header_sys_socket_h_selfcontained = yes; then | |
11535 | for ac_func in shutdown | |
11536 | do : | |
11537 | ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown" | |
11538 | if test "x$ac_cv_func_shutdown" = xyes; then : | |
11539 | cat >>confdefs.h <<_ACEOF | |
11540 | #define HAVE_SHUTDOWN 1 | |
11541 | _ACEOF | |
c0c3707f | 11542 | |
5df4cba6 SM |
11543 | fi |
11544 | done | |
c0c3707f | 11545 | |
5df4cba6 SM |
11546 | if test $ac_cv_func_shutdown = yes; then |
11547 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5 | |
11548 | $as_echo_n "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; } | |
11549 | if ${gl_cv_header_sys_socket_h_shut+:} false; then : | |
5abebf3c CB |
11550 | $as_echo_n "(cached) " >&6 |
11551 | else | |
5df4cba6 SM |
11552 | |
11553 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 11554 | /* end confdefs.h. */ |
c0c3707f | 11555 | #include <sys/socket.h> |
c0c3707f CB |
11556 | int |
11557 | main () | |
11558 | { | |
5df4cba6 | 11559 | int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR }; |
c0c3707f CB |
11560 | ; |
11561 | return 0; | |
11562 | } | |
11563 | _ACEOF | |
11564 | if ac_fn_c_try_compile "$LINENO"; then : | |
5df4cba6 | 11565 | gl_cv_header_sys_socket_h_shut=yes |
c0c3707f | 11566 | else |
5df4cba6 | 11567 | gl_cv_header_sys_socket_h_shut=no |
c0c3707f CB |
11568 | fi |
11569 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5abebf3c | 11570 | |
5df4cba6 SM |
11571 | fi |
11572 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5 | |
11573 | $as_echo "$gl_cv_header_sys_socket_h_shut" >&6; } | |
11574 | if test $gl_cv_header_sys_socket_h_shut = no; then | |
11575 | SYS_SOCKET_H='sys/socket.h' | |
11576 | fi | |
11577 | fi | |
c0c3707f | 11578 | fi |
5df4cba6 | 11579 | # We need to check for ws2tcpip.h now. |
5abebf3c | 11580 | |
5abebf3c | 11581 | |
5abebf3c | 11582 | |
5abebf3c CB |
11583 | |
11584 | ||
11585 | ||
11586 | ||
c0c3707f CB |
11587 | |
11588 | ||
11589 | ||
11590 | ||
11591 | if test $gl_cv_have_include_next = yes; then | |
5df4cba6 | 11592 | gl_cv_next_sys_socket_h='<'sys/socket.h'>' |
c0c3707f | 11593 | else |
5df4cba6 SM |
11594 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5 |
11595 | $as_echo_n "checking absolute name of <sys/socket.h>... " >&6; } | |
11596 | if ${gl_cv_next_sys_socket_h+:} false; then : | |
5abebf3c CB |
11597 | $as_echo_n "(cached) " >&6 |
11598 | else | |
5abebf3c | 11599 | |
5df4cba6 | 11600 | if test $ac_cv_header_sys_socket_h = yes; then |
5abebf3c | 11601 | |
5abebf3c CB |
11602 | |
11603 | ||
c0c3707f CB |
11604 | |
11605 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11606 | /* end confdefs.h. */ | |
5df4cba6 | 11607 | #include <sys/socket.h> |
c0c3707f CB |
11608 | _ACEOF |
11609 | case "$host_os" in | |
11610 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
11611 | *) gl_absname_cpp="$ac_cpp" ;; | |
11612 | esac | |
11613 | ||
11614 | case "$host_os" in | |
11615 | mingw*) | |
11616 | gl_dirsep_regex='[/\\]' | |
5abebf3c CB |
11617 | ;; |
11618 | *) | |
c0c3707f | 11619 | gl_dirsep_regex='\/' |
5abebf3c CB |
11620 | ;; |
11621 | esac | |
c0c3707f | 11622 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' |
5df4cba6 | 11623 | gl_header_literal_regex=`echo 'sys/socket.h' \ |
c0c3707f CB |
11624 | | sed -e "$gl_make_literal_regex_sed"` |
11625 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
11626 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
11627 | s|^/[^/]|//&| | |
11628 | p | |
11629 | q | |
11630 | }' | |
5abebf3c | 11631 | |
5df4cba6 | 11632 | gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
c0c3707f | 11633 | sed -n "$gl_absolute_header_sed"` |
5abebf3c | 11634 | |
5df4cba6 SM |
11635 | gl_header=$gl_cv_absolute_sys_socket_h |
11636 | gl_cv_next_sys_socket_h='"'$gl_header'"' | |
c0c3707f | 11637 | else |
5df4cba6 | 11638 | gl_cv_next_sys_socket_h='<'sys/socket.h'>' |
c0c3707f | 11639 | fi |
5abebf3c | 11640 | |
5abebf3c | 11641 | |
5abebf3c | 11642 | fi |
5df4cba6 SM |
11643 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5 |
11644 | $as_echo "$gl_cv_next_sys_socket_h" >&6; } | |
c0c3707f | 11645 | fi |
5df4cba6 | 11646 | NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h |
c0c3707f CB |
11647 | |
11648 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
11649 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
5df4cba6 | 11650 | gl_next_as_first_directive='<'sys/socket.h'>' |
c0c3707f CB |
11651 | else |
11652 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
5df4cba6 | 11653 | gl_next_as_first_directive=$gl_cv_next_sys_socket_h |
c0c3707f | 11654 | fi |
5df4cba6 | 11655 | NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive |
5abebf3c CB |
11656 | |
11657 | ||
c0c3707f CB |
11658 | |
11659 | ||
5df4cba6 SM |
11660 | if test $ac_cv_header_sys_socket_h = yes; then |
11661 | HAVE_SYS_SOCKET_H=1 | |
11662 | else | |
11663 | HAVE_SYS_SOCKET_H=0 | |
11664 | fi | |
c0c3707f | 11665 | |
5abebf3c | 11666 | |
c0c3707f | 11667 | |
5df4cba6 SM |
11668 | if test $ac_cv_header_sys_socket_h = yes; then |
11669 | HAVE_WS2TCPIP_H=0 | |
11670 | else | |
11671 | if test $ac_cv_header_ws2tcpip_h = yes; then | |
11672 | HAVE_WS2TCPIP_H=1 | |
11673 | else | |
11674 | HAVE_WS2TCPIP_H=0 | |
11675 | fi | |
11676 | fi | |
11677 | ||
11678 | ||
11679 | ||
11680 | ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " | |
11681 | /* sys/types.h is not needed according to POSIX, but the | |
11682 | sys/socket.h in i386-unknown-freebsd4.10 and | |
11683 | powerpc-apple-darwin5.5 required it. */ | |
11684 | #include <sys/types.h> | |
11685 | #ifdef HAVE_SYS_SOCKET_H | |
11686 | #include <sys/socket.h> | |
11687 | #endif | |
11688 | #ifdef HAVE_WS2TCPIP_H | |
11689 | #include <ws2tcpip.h> | |
11690 | #endif | |
11691 | ||
11692 | " | |
11693 | if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then : | |
11694 | ||
11695 | cat >>confdefs.h <<_ACEOF | |
11696 | #define HAVE_STRUCT_SOCKADDR_STORAGE 1 | |
5abebf3c | 11697 | _ACEOF |
5df4cba6 SM |
11698 | |
11699 | ||
5abebf3c | 11700 | fi |
5df4cba6 SM |
11701 | ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" " |
11702 | /* sys/types.h is not needed according to POSIX, but the | |
11703 | sys/socket.h in i386-unknown-freebsd4.10 and | |
11704 | powerpc-apple-darwin5.5 required it. */ | |
11705 | #include <sys/types.h> | |
11706 | #ifdef HAVE_SYS_SOCKET_H | |
11707 | #include <sys/socket.h> | |
11708 | #endif | |
11709 | #ifdef HAVE_WS2TCPIP_H | |
11710 | #include <ws2tcpip.h> | |
11711 | #endif | |
11712 | ||
11713 | " | |
11714 | if test "x$ac_cv_type_sa_family_t" = xyes; then : | |
11715 | ||
11716 | cat >>confdefs.h <<_ACEOF | |
11717 | #define HAVE_SA_FAMILY_T 1 | |
11718 | _ACEOF | |
11719 | ||
11720 | ||
5abebf3c | 11721 | fi |
5df4cba6 SM |
11722 | |
11723 | if test $ac_cv_type_struct_sockaddr_storage = no; then | |
11724 | HAVE_STRUCT_SOCKADDR_STORAGE=0 | |
11725 | fi | |
11726 | if test $ac_cv_type_sa_family_t = no; then | |
11727 | HAVE_SA_FAMILY_T=0 | |
c0c3707f | 11728 | fi |
5df4cba6 SM |
11729 | if test $ac_cv_type_struct_sockaddr_storage != no; then |
11730 | ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h> | |
11731 | #ifdef HAVE_SYS_SOCKET_H | |
11732 | #include <sys/socket.h> | |
11733 | #endif | |
11734 | #ifdef HAVE_WS2TCPIP_H | |
11735 | #include <ws2tcpip.h> | |
11736 | #endif | |
11737 | ||
11738 | " | |
11739 | if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then : | |
11740 | ||
11741 | cat >>confdefs.h <<_ACEOF | |
11742 | #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 | |
11743 | _ACEOF | |
11744 | ||
5abebf3c | 11745 | |
5abebf3c | 11746 | else |
5df4cba6 | 11747 | HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0 |
5abebf3c CB |
11748 | fi |
11749 | ||
5df4cba6 SM |
11750 | fi |
11751 | if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \ | |
11752 | || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then | |
11753 | SYS_SOCKET_H='sys/socket.h' | |
11754 | fi | |
5abebf3c | 11755 | |
5abebf3c | 11756 | |
5df4cba6 SM |
11757 | |
11758 | ||
11759 | if test $ac_cv_header_sys_socket_h != yes; then | |
11760 | for ac_header in winsock2.h | |
11761 | do : | |
11762 | ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" | |
11763 | if test "x$ac_cv_header_winsock2_h" = xyes; then : | |
11764 | cat >>confdefs.h <<_ACEOF | |
11765 | #define HAVE_WINSOCK2_H 1 | |
11766 | _ACEOF | |
11767 | ||
11768 | fi | |
11769 | ||
11770 | done | |
11771 | ||
11772 | fi | |
11773 | if test "$ac_cv_header_winsock2_h" = yes; then | |
11774 | HAVE_WINSOCK2_H=1 | |
11775 | UNISTD_H_HAVE_WINSOCK2_H=1 | |
11776 | SYS_IOCTL_H_HAVE_WINSOCK2_H=1 | |
11777 | else | |
11778 | HAVE_WINSOCK2_H=0 | |
11779 | fi | |
11780 | ||
11781 | ||
11782 | ||
11783 | ||
11784 | ||
11785 | ||
11786 | ||
11787 | ||
11788 | ||
11789 | ||
11790 | ||
11791 | ||
11792 | ||
698be2d8 CB |
11793 | |
11794 | ||
5df4cba6 SM |
11795 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5 |
11796 | $as_echo_n "checking for IPv4 sockets... " >&6; } | |
11797 | if ${gl_cv_socket_ipv4+:} false; then : | |
5abebf3c CB |
11798 | $as_echo_n "(cached) " >&6 |
11799 | else | |
c0c3707f | 11800 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5abebf3c | 11801 | /* end confdefs.h. */ |
5df4cba6 SM |
11802 | #include <sys/types.h> |
11803 | #ifdef HAVE_SYS_SOCKET_H | |
11804 | #include <sys/socket.h> | |
11805 | #endif | |
11806 | #ifdef HAVE_NETINET_IN_H | |
11807 | #include <netinet/in.h> | |
11808 | #endif | |
11809 | #ifdef HAVE_WINSOCK2_H | |
11810 | #include <winsock2.h> | |
11811 | #endif | |
5abebf3c CB |
11812 | int |
11813 | main () | |
11814 | { | |
5df4cba6 SM |
11815 | int x = AF_INET; struct in_addr y; struct sockaddr_in z; |
11816 | if (&x && &y && &z) return 0; | |
5abebf3c CB |
11817 | ; |
11818 | return 0; | |
11819 | } | |
11820 | _ACEOF | |
c0c3707f | 11821 | if ac_fn_c_try_compile "$LINENO"; then : |
5df4cba6 | 11822 | gl_cv_socket_ipv4=yes |
5abebf3c | 11823 | else |
5df4cba6 | 11824 | gl_cv_socket_ipv4=no |
5abebf3c | 11825 | fi |
c0c3707f | 11826 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
5abebf3c | 11827 | fi |
5df4cba6 SM |
11828 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5 |
11829 | $as_echo "$gl_cv_socket_ipv4" >&6; } | |
11830 | if test $gl_cv_socket_ipv4 = yes; then | |
5abebf3c | 11831 | |
5df4cba6 | 11832 | $as_echo "#define HAVE_IPV4 1" >>confdefs.h |
5abebf3c | 11833 | |
5df4cba6 | 11834 | fi |
5abebf3c | 11835 | |
5df4cba6 SM |
11836 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5 |
11837 | $as_echo_n "checking for IPv6 sockets... " >&6; } | |
11838 | if ${gl_cv_socket_ipv6+:} false; then : | |
5abebf3c CB |
11839 | $as_echo_n "(cached) " >&6 |
11840 | else | |
c0c3707f | 11841 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5abebf3c | 11842 | /* end confdefs.h. */ |
5df4cba6 SM |
11843 | #include <sys/types.h> |
11844 | #ifdef HAVE_SYS_SOCKET_H | |
11845 | #include <sys/socket.h> | |
5abebf3c | 11846 | #endif |
5df4cba6 SM |
11847 | #ifdef HAVE_NETINET_IN_H |
11848 | #include <netinet/in.h> | |
11849 | #endif | |
11850 | #ifdef HAVE_WINSOCK2_H | |
11851 | #include <winsock2.h> | |
11852 | #endif | |
11853 | #ifdef HAVE_WS2TCPIP_H | |
11854 | #include <ws2tcpip.h> | |
11855 | #endif | |
11856 | int | |
11857 | main () | |
11858 | { | |
11859 | int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; | |
11860 | if (&x && &y && &z) return 0; | |
11861 | ; | |
11862 | return 0; | |
11863 | } | |
11864 | _ACEOF | |
11865 | if ac_fn_c_try_compile "$LINENO"; then : | |
11866 | gl_cv_socket_ipv6=yes | |
11867 | else | |
11868 | gl_cv_socket_ipv6=no | |
11869 | fi | |
11870 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
11871 | fi | |
11872 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5 | |
11873 | $as_echo "$gl_cv_socket_ipv6" >&6; } | |
11874 | if test $gl_cv_socket_ipv6 = yes; then | |
11875 | ||
11876 | $as_echo "#define HAVE_IPV6 1" >>confdefs.h | |
11877 | ||
11878 | fi | |
11879 | ||
11880 | ||
11881 | ||
11882 | ||
11883 | ||
11884 | ||
11885 | ||
11886 | ||
11887 | ||
11888 | ||
11889 | ||
11890 | ||
11891 | ||
11892 | if test $gl_cv_have_include_next = yes; then | |
11893 | gl_cv_next_limits_h='<'limits.h'>' | |
11894 | else | |
11895 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5 | |
11896 | $as_echo_n "checking absolute name of <limits.h>... " >&6; } | |
11897 | if ${gl_cv_next_limits_h+:} false; then : | |
11898 | $as_echo_n "(cached) " >&6 | |
11899 | else | |
11900 | ||
11901 | if test $ac_cv_header_limits_h = yes; then | |
11902 | ||
11903 | ||
11904 | ||
11905 | ||
11906 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11907 | /* end confdefs.h. */ | |
11908 | #include <limits.h> | |
11909 | _ACEOF | |
11910 | case "$host_os" in | |
11911 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
11912 | *) gl_absname_cpp="$ac_cpp" ;; | |
11913 | esac | |
11914 | ||
11915 | case "$host_os" in | |
11916 | mingw*) | |
11917 | gl_dirsep_regex='[/\\]' | |
11918 | ;; | |
11919 | *) | |
11920 | gl_dirsep_regex='\/' | |
11921 | ;; | |
11922 | esac | |
11923 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
11924 | gl_header_literal_regex=`echo 'limits.h' \ | |
11925 | | sed -e "$gl_make_literal_regex_sed"` | |
11926 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
11927 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
11928 | s|^/[^/]|//&| | |
11929 | p | |
11930 | q | |
11931 | }' | |
11932 | ||
11933 | gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
11934 | sed -n "$gl_absolute_header_sed"` | |
11935 | ||
11936 | gl_header=$gl_cv_absolute_limits_h | |
11937 | gl_cv_next_limits_h='"'$gl_header'"' | |
11938 | else | |
11939 | gl_cv_next_limits_h='<'limits.h'>' | |
11940 | fi | |
11941 | ||
11942 | ||
11943 | fi | |
11944 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5 | |
11945 | $as_echo "$gl_cv_next_limits_h" >&6; } | |
11946 | fi | |
11947 | NEXT_LIMITS_H=$gl_cv_next_limits_h | |
11948 | ||
11949 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
11950 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
11951 | gl_next_as_first_directive='<'limits.h'>' | |
11952 | else | |
11953 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
11954 | gl_next_as_first_directive=$gl_cv_next_limits_h | |
11955 | fi | |
11956 | NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive | |
11957 | ||
11958 | ||
11959 | ||
11960 | ||
11961 | ||
11962 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc." >&5 | |
11963 | $as_echo_n "checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... " >&6; } | |
11964 | if ${gl_cv_header_limits_width+:} false; then : | |
11965 | $as_echo_n "(cached) " >&6 | |
11966 | else | |
11967 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11968 | /* end confdefs.h. */ | |
11969 | #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ | |
11970 | #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 | |
11971 | #endif | |
11972 | #include <limits.h> | |
11973 | long long llm = LLONG_MAX; | |
11974 | int wb = WORD_BIT; | |
11975 | int ullw = ULLONG_WIDTH; | |
c0c3707f | 11976 | |
5abebf3c CB |
11977 | int |
11978 | main () | |
11979 | { | |
c0c3707f | 11980 | |
5abebf3c CB |
11981 | ; |
11982 | return 0; | |
11983 | } | |
11984 | _ACEOF | |
c0c3707f | 11985 | if ac_fn_c_try_compile "$LINENO"; then : |
5df4cba6 | 11986 | gl_cv_header_limits_width=yes |
5abebf3c | 11987 | else |
5df4cba6 | 11988 | gl_cv_header_limits_width=no |
5abebf3c | 11989 | fi |
c0c3707f | 11990 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
5abebf3c | 11991 | fi |
5df4cba6 SM |
11992 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5 |
11993 | $as_echo "$gl_cv_header_limits_width" >&6; } | |
11994 | if test "$gl_cv_header_limits_width" = yes; then | |
11995 | LIMITS_H= | |
c0c3707f | 11996 | else |
5df4cba6 | 11997 | LIMITS_H=limits.h |
c0c3707f | 11998 | fi |
5abebf3c | 11999 | |
5df4cba6 SM |
12000 | if test -n "$LIMITS_H"; then |
12001 | GL_GENERATE_LIMITS_H_TRUE= | |
12002 | GL_GENERATE_LIMITS_H_FALSE='#' | |
12003 | else | |
12004 | GL_GENERATE_LIMITS_H_TRUE='#' | |
12005 | GL_GENERATE_LIMITS_H_FALSE= | |
12006 | fi | |
c0c3707f CB |
12007 | |
12008 | ||
5abebf3c | 12009 | |
5df4cba6 SM |
12010 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 |
12011 | $as_echo_n "checking for wint_t... " >&6; } | |
12012 | if ${gt_cv_c_wint_t+:} false; then : | |
c0c3707f | 12013 | $as_echo_n "(cached) " >&6 |
c0c3707f CB |
12014 | else |
12015 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5abebf3c | 12016 | /* end confdefs.h. */ |
5df4cba6 SM |
12017 | #include <wchar.h> |
12018 | wint_t foo = (wchar_t)'\0'; | |
5abebf3c CB |
12019 | int |
12020 | main () | |
12021 | { | |
5df4cba6 | 12022 | |
5abebf3c CB |
12023 | ; |
12024 | return 0; | |
12025 | } | |
12026 | _ACEOF | |
5df4cba6 SM |
12027 | if ac_fn_c_try_compile "$LINENO"; then : |
12028 | gt_cv_c_wint_t=yes | |
c0c3707f | 12029 | else |
5df4cba6 | 12030 | gt_cv_c_wint_t=no |
c0c3707f | 12031 | fi |
5df4cba6 | 12032 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
c0c3707f | 12033 | fi |
5df4cba6 SM |
12034 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 |
12035 | $as_echo "$gt_cv_c_wint_t" >&6; } | |
12036 | if test $gt_cv_c_wint_t = yes; then | |
5abebf3c | 12037 | |
5df4cba6 | 12038 | $as_echo "#define HAVE_WINT_T 1" >>confdefs.h |
5abebf3c CB |
12039 | |
12040 | ||
9c9d63b1 PM |
12041 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is large enough" >&5 |
12042 | $as_echo_n "checking whether wint_t is large enough... " >&6; } | |
12043 | if ${gl_cv_type_wint_t_large_enough+:} false; then : | |
5df4cba6 SM |
12044 | $as_echo_n "(cached) " >&6 |
12045 | else | |
12046 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12047 | /* end confdefs.h. */ | |
5df4cba6 | 12048 | #include <wchar.h> |
9c9d63b1 | 12049 | int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; |
5df4cba6 SM |
12050 | |
12051 | int | |
12052 | main () | |
12053 | { | |
12054 | ||
12055 | ; | |
12056 | return 0; | |
12057 | } | |
12058 | _ACEOF | |
12059 | if ac_fn_c_try_compile "$LINENO"; then : | |
9c9d63b1 | 12060 | gl_cv_type_wint_t_large_enough=yes |
5df4cba6 | 12061 | else |
9c9d63b1 | 12062 | gl_cv_type_wint_t_large_enough=no |
5df4cba6 SM |
12063 | fi |
12064 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12065 | fi | |
9c9d63b1 PM |
12066 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_large_enough" >&5 |
12067 | $as_echo "$gl_cv_type_wint_t_large_enough" >&6; } | |
12068 | if test $gl_cv_type_wint_t_large_enough = no; then | |
5df4cba6 SM |
12069 | GNULIB_OVERRIDES_WINT_T=1 |
12070 | else | |
12071 | GNULIB_OVERRIDES_WINT_T=0 | |
12072 | fi | |
12073 | else | |
12074 | GNULIB_OVERRIDES_WINT_T=0 | |
c0c3707f | 12075 | fi |
5abebf3c | 12076 | |
5abebf3c CB |
12077 | |
12078 | ||
12079 | ||
12080 | ||
12081 | ||
5df4cba6 | 12082 | |
9c9d63b1 PM |
12083 | |
12084 | ||
12085 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler produces multi-arch binaries" >&5 | |
12086 | $as_echo_n "checking whether the compiler produces multi-arch binaries... " >&6; } | |
12087 | if ${gl_cv_c_multiarch+:} false; then : | |
12088 | $as_echo_n "(cached) " >&6 | |
12089 | else | |
12090 | gl_cv_c_multiarch=no | |
12091 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f CB |
12092 | /* end confdefs.h. */ |
12093 | #ifndef __APPLE_CC__ | |
9c9d63b1 PM |
12094 | not a universal capable compiler |
12095 | #endif | |
12096 | typedef int dummy; | |
5abebf3c | 12097 | |
c0c3707f CB |
12098 | _ACEOF |
12099 | if ac_fn_c_try_compile "$LINENO"; then : | |
5abebf3c | 12100 | |
9c9d63b1 PM |
12101 | arch= |
12102 | prev= | |
12103 | for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do | |
12104 | if test -n "$prev"; then | |
12105 | case $word in | |
12106 | i?86 | x86_64 | ppc | ppc64 | arm | arm64) | |
12107 | if test -z "$arch" || test "$arch" = "$word"; then | |
12108 | arch="$word" | |
12109 | else | |
12110 | gl_cv_c_multiarch=yes | |
12111 | fi | |
12112 | ;; | |
12113 | esac | |
12114 | prev= | |
12115 | else | |
12116 | if test "x$word" = "x-arch"; then | |
12117 | prev=arch | |
12118 | fi | |
12119 | fi | |
12120 | done | |
5abebf3c | 12121 | |
c0c3707f CB |
12122 | fi |
12123 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
9c9d63b1 PM |
12124 | |
12125 | fi | |
12126 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_multiarch" >&5 | |
12127 | $as_echo "$gl_cv_c_multiarch" >&6; } | |
c0c3707f CB |
12128 | if test $gl_cv_c_multiarch = yes; then |
12129 | APPLE_UNIVERSAL_BUILD=1 | |
12130 | else | |
12131 | APPLE_UNIVERSAL_BUILD=0 | |
12132 | fi | |
5abebf3c | 12133 | |
5abebf3c | 12134 | |
5abebf3c | 12135 | |
5abebf3c CB |
12136 | |
12137 | ||
5abebf3c | 12138 | |
5abebf3c | 12139 | |
5abebf3c | 12140 | |
5df4cba6 | 12141 | $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h |
5abebf3c | 12142 | |
5abebf3c | 12143 | |
5df4cba6 | 12144 | $as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h |
5abebf3c | 12145 | |
c0c3707f CB |
12146 | |
12147 | ||
12148 | if test $ac_cv_header_wchar_h = yes; then | |
12149 | HAVE_WCHAR_H=1 | |
12150 | else | |
12151 | HAVE_WCHAR_H=0 | |
5abebf3c | 12152 | fi |
c0c3707f CB |
12153 | |
12154 | ||
9c9d63b1 PM |
12155 | |
12156 | if test $ac_cv_header_inttypes_h = yes; then | |
c0c3707f CB |
12157 | HAVE_INTTYPES_H=1 |
12158 | else | |
12159 | HAVE_INTTYPES_H=0 | |
5abebf3c CB |
12160 | fi |
12161 | ||
12162 | ||
9c9d63b1 PM |
12163 | |
12164 | if test $ac_cv_header_sys_types_h = yes; then | |
c0c3707f CB |
12165 | HAVE_SYS_TYPES_H=1 |
12166 | else | |
12167 | HAVE_SYS_TYPES_H=0 | |
12168 | fi | |
12169 | ||
5abebf3c CB |
12170 | |
12171 | ||
12172 | ||
12173 | ||
5abebf3c | 12174 | |
5abebf3c | 12175 | |
5abebf3c | 12176 | |
5abebf3c | 12177 | |
5abebf3c CB |
12178 | |
12179 | ||
c0c3707f CB |
12180 | if test $gl_cv_have_include_next = yes; then |
12181 | gl_cv_next_stdint_h='<'stdint.h'>' | |
12182 | else | |
12183 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5 | |
12184 | $as_echo_n "checking absolute name of <stdint.h>... " >&6; } | |
12185 | if ${gl_cv_next_stdint_h+:} false; then : | |
12186 | $as_echo_n "(cached) " >&6 | |
12187 | else | |
5abebf3c | 12188 | |
c0c3707f | 12189 | if test $ac_cv_header_stdint_h = yes; then |
5abebf3c | 12190 | |
5abebf3c CB |
12191 | |
12192 | ||
12193 | ||
c0c3707f | 12194 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5abebf3c | 12195 | /* end confdefs.h. */ |
c0c3707f | 12196 | #include <stdint.h> |
5abebf3c | 12197 | _ACEOF |
c0c3707f CB |
12198 | case "$host_os" in |
12199 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
12200 | *) gl_absname_cpp="$ac_cpp" ;; | |
12201 | esac | |
5abebf3c | 12202 | |
c0c3707f CB |
12203 | case "$host_os" in |
12204 | mingw*) | |
12205 | gl_dirsep_regex='[/\\]' | |
12206 | ;; | |
12207 | *) | |
12208 | gl_dirsep_regex='\/' | |
12209 | ;; | |
12210 | esac | |
12211 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
12212 | gl_header_literal_regex=`echo 'stdint.h' \ | |
12213 | | sed -e "$gl_make_literal_regex_sed"` | |
12214 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
12215 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
12216 | s|^/[^/]|//&| | |
12217 | p | |
12218 | q | |
12219 | }' | |
5abebf3c | 12220 | |
c0c3707f CB |
12221 | gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
12222 | sed -n "$gl_absolute_header_sed"` | |
5abebf3c | 12223 | |
c0c3707f CB |
12224 | gl_header=$gl_cv_absolute_stdint_h |
12225 | gl_cv_next_stdint_h='"'$gl_header'"' | |
12226 | else | |
12227 | gl_cv_next_stdint_h='<'stdint.h'>' | |
12228 | fi | |
5abebf3c | 12229 | |
5abebf3c | 12230 | |
c0c3707f CB |
12231 | fi |
12232 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 | |
12233 | $as_echo "$gl_cv_next_stdint_h" >&6; } | |
12234 | fi | |
12235 | NEXT_STDINT_H=$gl_cv_next_stdint_h | |
5abebf3c | 12236 | |
c0c3707f CB |
12237 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
12238 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
12239 | gl_next_as_first_directive='<'stdint.h'>' | |
12240 | else | |
12241 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
12242 | gl_next_as_first_directive=$gl_cv_next_stdint_h | |
12243 | fi | |
12244 | NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive | |
5abebf3c | 12245 | |
5e8754f9 | 12246 | |
5e8754f9 | 12247 | |
5e8754f9 | 12248 | |
c0c3707f CB |
12249 | if test $ac_cv_header_stdint_h = yes; then |
12250 | HAVE_STDINT_H=1 | |
12251 | else | |
12252 | HAVE_STDINT_H=0 | |
12253 | fi | |
5e8754f9 SDJ |
12254 | |
12255 | ||
c0c3707f CB |
12256 | if test $ac_cv_header_stdint_h = yes; then |
12257 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 | |
12258 | $as_echo_n "checking whether stdint.h conforms to C99... " >&6; } | |
12259 | if ${gl_cv_header_working_stdint_h+:} false; then : | |
12260 | $as_echo_n "(cached) " >&6 | |
12261 | else | |
12262 | gl_cv_header_working_stdint_h=no | |
12263 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12264 | /* end confdefs.h. */ | |
5e8754f9 | 12265 | |
5e8754f9 | 12266 | |
c0c3707f CB |
12267 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ |
12268 | #define __STDC_CONSTANT_MACROS 1 | |
12269 | #define __STDC_LIMIT_MACROS 1 | |
12270 | #include <stdint.h> | |
12271 | /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ | |
12272 | #if !(defined WCHAR_MIN && defined WCHAR_MAX) | |
12273 | #error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>" | |
12274 | #endif | |
5e8754f9 SDJ |
12275 | |
12276 | ||
c0c3707f CB |
12277 | #include <stddef.h> |
12278 | #include <signal.h> | |
12279 | #if HAVE_WCHAR_H | |
c0c3707f CB |
12280 | # include <wchar.h> |
12281 | #endif | |
f45c62c4 YQ |
12282 | |
12283 | ||
c0c3707f CB |
12284 | #ifdef INT8_MAX |
12285 | int8_t a1 = INT8_MAX; | |
12286 | int8_t a1min = INT8_MIN; | |
12287 | #endif | |
12288 | #ifdef INT16_MAX | |
12289 | int16_t a2 = INT16_MAX; | |
12290 | int16_t a2min = INT16_MIN; | |
12291 | #endif | |
12292 | #ifdef INT32_MAX | |
12293 | int32_t a3 = INT32_MAX; | |
12294 | int32_t a3min = INT32_MIN; | |
12295 | #endif | |
12296 | #ifdef INT64_MAX | |
12297 | int64_t a4 = INT64_MAX; | |
12298 | int64_t a4min = INT64_MIN; | |
12299 | #endif | |
12300 | #ifdef UINT8_MAX | |
12301 | uint8_t b1 = UINT8_MAX; | |
12302 | #else | |
12303 | typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; | |
12304 | #endif | |
12305 | #ifdef UINT16_MAX | |
12306 | uint16_t b2 = UINT16_MAX; | |
12307 | #endif | |
12308 | #ifdef UINT32_MAX | |
12309 | uint32_t b3 = UINT32_MAX; | |
12310 | #endif | |
12311 | #ifdef UINT64_MAX | |
12312 | uint64_t b4 = UINT64_MAX; | |
12313 | #endif | |
12314 | int_least8_t c1 = INT8_C (0x7f); | |
12315 | int_least8_t c1max = INT_LEAST8_MAX; | |
12316 | int_least8_t c1min = INT_LEAST8_MIN; | |
12317 | int_least16_t c2 = INT16_C (0x7fff); | |
12318 | int_least16_t c2max = INT_LEAST16_MAX; | |
12319 | int_least16_t c2min = INT_LEAST16_MIN; | |
12320 | int_least32_t c3 = INT32_C (0x7fffffff); | |
12321 | int_least32_t c3max = INT_LEAST32_MAX; | |
12322 | int_least32_t c3min = INT_LEAST32_MIN; | |
12323 | int_least64_t c4 = INT64_C (0x7fffffffffffffff); | |
12324 | int_least64_t c4max = INT_LEAST64_MAX; | |
12325 | int_least64_t c4min = INT_LEAST64_MIN; | |
12326 | uint_least8_t d1 = UINT8_C (0xff); | |
12327 | uint_least8_t d1max = UINT_LEAST8_MAX; | |
12328 | uint_least16_t d2 = UINT16_C (0xffff); | |
12329 | uint_least16_t d2max = UINT_LEAST16_MAX; | |
12330 | uint_least32_t d3 = UINT32_C (0xffffffff); | |
12331 | uint_least32_t d3max = UINT_LEAST32_MAX; | |
12332 | uint_least64_t d4 = UINT64_C (0xffffffffffffffff); | |
12333 | uint_least64_t d4max = UINT_LEAST64_MAX; | |
12334 | int_fast8_t e1 = INT_FAST8_MAX; | |
12335 | int_fast8_t e1min = INT_FAST8_MIN; | |
12336 | int_fast16_t e2 = INT_FAST16_MAX; | |
12337 | int_fast16_t e2min = INT_FAST16_MIN; | |
12338 | int_fast32_t e3 = INT_FAST32_MAX; | |
12339 | int_fast32_t e3min = INT_FAST32_MIN; | |
12340 | int_fast64_t e4 = INT_FAST64_MAX; | |
12341 | int_fast64_t e4min = INT_FAST64_MIN; | |
12342 | uint_fast8_t f1 = UINT_FAST8_MAX; | |
12343 | uint_fast16_t f2 = UINT_FAST16_MAX; | |
12344 | uint_fast32_t f3 = UINT_FAST32_MAX; | |
12345 | uint_fast64_t f4 = UINT_FAST64_MAX; | |
12346 | #ifdef INTPTR_MAX | |
12347 | intptr_t g = INTPTR_MAX; | |
12348 | intptr_t gmin = INTPTR_MIN; | |
12349 | #endif | |
12350 | #ifdef UINTPTR_MAX | |
12351 | uintptr_t h = UINTPTR_MAX; | |
12352 | #endif | |
12353 | intmax_t i = INTMAX_MAX; | |
12354 | uintmax_t j = UINTMAX_MAX; | |
472fa5ee | 12355 | |
c0c3707f CB |
12356 | /* Check that SIZE_MAX has the correct type, if possible. */ |
12357 | #if 201112 <= __STDC_VERSION__ | |
12358 | int k = _Generic (SIZE_MAX, size_t: 0); | |
9c9d63b1 | 12359 | #elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \ |
c0c3707f CB |
12360 | || (0x5110 <= __SUNPRO_C && !__STDC__)) |
12361 | extern size_t k; | |
12362 | extern __typeof__ (SIZE_MAX) k; | |
12363 | #endif | |
472fa5ee | 12364 | |
c0c3707f CB |
12365 | #include <limits.h> /* for CHAR_BIT */ |
12366 | #define TYPE_MINIMUM(t) \ | |
12367 | ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) | |
12368 | #define TYPE_MAXIMUM(t) \ | |
12369 | ((t) ((t) 0 < (t) -1 \ | |
12370 | ? (t) -1 \ | |
12371 | : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) | |
12372 | struct s { | |
12373 | int check_PTRDIFF: | |
12374 | PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) | |
12375 | && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) | |
12376 | ? 1 : -1; | |
12377 | /* Detect bug in FreeBSD 6.0 / ia64. */ | |
12378 | int check_SIG_ATOMIC: | |
12379 | SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) | |
12380 | && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) | |
12381 | ? 1 : -1; | |
12382 | int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; | |
12383 | int check_WCHAR: | |
12384 | WCHAR_MIN == TYPE_MINIMUM (wchar_t) | |
12385 | && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) | |
12386 | ? 1 : -1; | |
12387 | /* Detect bug in mingw. */ | |
12388 | int check_WINT: | |
12389 | WINT_MIN == TYPE_MINIMUM (wint_t) | |
12390 | && WINT_MAX == TYPE_MAXIMUM (wint_t) | |
12391 | ? 1 : -1; | |
472fa5ee | 12392 | |
c0c3707f CB |
12393 | /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ |
12394 | int check_UINT8_C: | |
12395 | (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; | |
12396 | int check_UINT16_C: | |
12397 | (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; | |
f45c62c4 | 12398 | |
c0c3707f CB |
12399 | /* Detect bugs in OpenBSD 3.9 stdint.h. */ |
12400 | #ifdef UINT8_MAX | |
12401 | int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; | |
12402 | #endif | |
12403 | #ifdef UINT16_MAX | |
12404 | int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; | |
12405 | #endif | |
12406 | #ifdef UINT32_MAX | |
12407 | int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; | |
12408 | #endif | |
12409 | #ifdef UINT64_MAX | |
12410 | int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; | |
12411 | #endif | |
12412 | int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; | |
12413 | int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; | |
12414 | int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; | |
12415 | int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; | |
12416 | int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; | |
12417 | int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; | |
12418 | int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; | |
12419 | int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; | |
12420 | int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; | |
12421 | int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; | |
12422 | int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; | |
12423 | }; | |
6ec2e0f5 | 12424 | |
f45c62c4 YQ |
12425 | int |
12426 | main () | |
12427 | { | |
f45c62c4 YQ |
12428 | |
12429 | ; | |
12430 | return 0; | |
12431 | } | |
12432 | _ACEOF | |
6ec2e0f5 | 12433 | if ac_fn_c_try_compile "$LINENO"; then : |
c0c3707f | 12434 | if test "$cross_compiling" = yes; then : |
6a29c58e | 12435 | case "$host_os" in |
c0c3707f CB |
12436 | # Guess yes on native Windows. |
12437 | mingw*) gl_cv_header_working_stdint_h="guessing yes" ;; | |
12438 | # In general, assume it works. | |
12439 | *) gl_cv_header_working_stdint_h="guessing yes" ;; | |
12440 | esac | |
6a29c58e | 12441 | |
98399780 YQ |
12442 | else |
12443 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12444 | /* end confdefs.h. */ | |
98399780 YQ |
12445 | |
12446 | ||
c0c3707f CB |
12447 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ |
12448 | #define __STDC_CONSTANT_MACROS 1 | |
12449 | #define __STDC_LIMIT_MACROS 1 | |
12450 | #include <stdint.h> | |
98399780 | 12451 | |
88b48903 | 12452 | |
c0c3707f CB |
12453 | #include <stddef.h> |
12454 | #include <signal.h> | |
12455 | #if HAVE_WCHAR_H | |
c0c3707f CB |
12456 | # include <wchar.h> |
12457 | #endif | |
88b48903 | 12458 | |
472fa5ee | 12459 | |
c0c3707f CB |
12460 | #include <stdio.h> |
12461 | #include <string.h> | |
12462 | #define MVAL(macro) MVAL1(macro) | |
12463 | #define MVAL1(expression) #expression | |
12464 | static const char *macro_values[] = | |
12465 | { | |
12466 | #ifdef INT8_MAX | |
12467 | MVAL (INT8_MAX), | |
12468 | #endif | |
12469 | #ifdef INT16_MAX | |
12470 | MVAL (INT16_MAX), | |
12471 | #endif | |
12472 | #ifdef INT32_MAX | |
12473 | MVAL (INT32_MAX), | |
12474 | #endif | |
12475 | #ifdef INT64_MAX | |
12476 | MVAL (INT64_MAX), | |
12477 | #endif | |
12478 | #ifdef UINT8_MAX | |
12479 | MVAL (UINT8_MAX), | |
12480 | #endif | |
12481 | #ifdef UINT16_MAX | |
12482 | MVAL (UINT16_MAX), | |
12483 | #endif | |
12484 | #ifdef UINT32_MAX | |
12485 | MVAL (UINT32_MAX), | |
12486 | #endif | |
12487 | #ifdef UINT64_MAX | |
12488 | MVAL (UINT64_MAX), | |
12489 | #endif | |
12490 | NULL | |
12491 | }; | |
472fa5ee | 12492 | |
c0c3707f CB |
12493 | int |
12494 | main () | |
12495 | { | |
472fa5ee | 12496 | |
c0c3707f CB |
12497 | const char **mv; |
12498 | for (mv = macro_values; *mv != NULL; mv++) | |
12499 | { | |
12500 | const char *value = *mv; | |
12501 | /* Test whether it looks like a cast expression. */ | |
12502 | if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 | |
12503 | || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 | |
12504 | || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 | |
12505 | || strncmp (value, "((int)"/*)*/, 6) == 0 | |
12506 | || strncmp (value, "((signed short)"/*)*/, 15) == 0 | |
12507 | || strncmp (value, "((signed char)"/*)*/, 14) == 0) | |
12508 | return mv - macro_values + 1; | |
12509 | } | |
12510 | return 0; | |
12511 | ||
12512 | ; | |
12513 | return 0; | |
12514 | } | |
12515 | _ACEOF | |
12516 | if ac_fn_c_try_run "$LINENO"; then : | |
12517 | gl_cv_header_working_stdint_h=yes | |
12518 | fi | |
12519 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
12520 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
12521 | fi | |
12522 | ||
12523 | ||
12524 | fi | |
12525 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
8690e634 | 12526 | |
c0c3707f CB |
12527 | fi |
12528 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 | |
12529 | $as_echo "$gl_cv_header_working_stdint_h" >&6; } | |
12530 | fi | |
8690e634 | 12531 | |
c0c3707f CB |
12532 | HAVE_C99_STDINT_H=0 |
12533 | HAVE_SYS_BITYPES_H=0 | |
12534 | HAVE_SYS_INTTYPES_H=0 | |
12535 | STDINT_H=stdint.h | |
12536 | case "$gl_cv_header_working_stdint_h" in | |
12537 | *yes) | |
12538 | HAVE_C99_STDINT_H=1 | |
9c9d63b1 PM |
12539 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h works without ISO C predefines" >&5 |
12540 | $as_echo_n "checking whether stdint.h works without ISO C predefines... " >&6; } | |
12541 | if ${gl_cv_header_stdint_without_STDC_macros+:} false; then : | |
c0c3707f CB |
12542 | $as_echo_n "(cached) " >&6 |
12543 | else | |
9c9d63b1 | 12544 | gl_cv_header_stdint_without_STDC_macros=no |
c0c3707f CB |
12545 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
12546 | /* end confdefs.h. */ | |
8690e634 JK |
12547 | |
12548 | ||
c0c3707f CB |
12549 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ |
12550 | #include <stdint.h> | |
8690e634 JK |
12551 | |
12552 | ||
c0c3707f CB |
12553 | #include <stddef.h> |
12554 | #include <signal.h> | |
12555 | #if HAVE_WCHAR_H | |
c0c3707f CB |
12556 | # include <wchar.h> |
12557 | #endif | |
8690e634 JK |
12558 | |
12559 | ||
c0c3707f CB |
12560 | intmax_t im = INTMAX_MAX; |
12561 | int32_t i32 = INT32_C (0x7fffffff); | |
472fa5ee | 12562 | |
c0c3707f CB |
12563 | int |
12564 | main () | |
12565 | { | |
472fa5ee | 12566 | |
c0c3707f CB |
12567 | ; |
12568 | return 0; | |
12569 | } | |
12570 | _ACEOF | |
12571 | if ac_fn_c_try_compile "$LINENO"; then : | |
9c9d63b1 | 12572 | gl_cv_header_stdint_without_STDC_macros=yes |
c0c3707f CB |
12573 | fi |
12574 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
9c9d63b1 | 12575 | |
c0c3707f | 12576 | fi |
9c9d63b1 PM |
12577 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_without_STDC_macros" >&5 |
12578 | $as_echo "$gl_cv_header_stdint_without_STDC_macros" >&6; } | |
472fa5ee | 12579 | |
9c9d63b1 | 12580 | if test $gl_cv_header_stdint_without_STDC_macros = no; then |
472fa5ee | 12581 | |
c0c3707f | 12582 | $as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h |
472fa5ee SM |
12583 | |
12584 | ||
c0c3707f CB |
12585 | $as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h |
12586 | ||
12587 | fi | |
12588 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5 | |
12589 | $as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; } | |
12590 | if ${gl_cv_header_stdint_width+:} false; then : | |
8690e634 JK |
12591 | $as_echo_n "(cached) " >&6 |
12592 | else | |
c0c3707f CB |
12593 | gl_cv_header_stdint_width=no |
12594 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 JK |
12595 | /* end confdefs.h. */ |
12596 | ||
c0c3707f CB |
12597 | /* Work if build is not clean. */ |
12598 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 | |
12599 | #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ | |
12600 | #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 | |
12601 | #endif | |
12602 | #include <stdint.h> | |
12603 | ||
c0c3707f CB |
12604 | #include <stddef.h> |
12605 | #include <signal.h> | |
12606 | #if HAVE_WCHAR_H | |
c0c3707f CB |
12607 | # include <wchar.h> |
12608 | #endif | |
12609 | ||
12610 | int iw = UINTMAX_WIDTH; | |
12611 | ||
12612 | int | |
12613 | main () | |
8690e634 | 12614 | { |
c0c3707f CB |
12615 | |
12616 | ; | |
8690e634 JK |
12617 | return 0; |
12618 | } | |
8690e634 | 12619 | _ACEOF |
c0c3707f CB |
12620 | if ac_fn_c_try_compile "$LINENO"; then : |
12621 | gl_cv_header_stdint_width=yes | |
12622 | fi | |
12623 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12624 | fi | |
12625 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5 | |
12626 | $as_echo "$gl_cv_header_stdint_width" >&6; } | |
12627 | if test "$gl_cv_header_stdint_width" = yes; then | |
12628 | STDINT_H= | |
12629 | fi | |
12630 | ;; | |
12631 | *) | |
12632 | for ac_header in sys/inttypes.h sys/bitypes.h | |
12633 | do : | |
12634 | as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` | |
12635 | ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" | |
12636 | if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : | |
12637 | cat >>confdefs.h <<_ACEOF | |
12638 | #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 | |
12639 | _ACEOF | |
12640 | ||
12641 | fi | |
12642 | ||
12643 | done | |
12644 | ||
12645 | if test $ac_cv_header_sys_inttypes_h = yes; then | |
12646 | HAVE_SYS_INTTYPES_H=1 | |
12647 | fi | |
12648 | if test $ac_cv_header_sys_bitypes_h = yes; then | |
12649 | HAVE_SYS_BITYPES_H=1 | |
12650 | fi | |
12651 | ||
12652 | ||
12653 | if test $APPLE_UNIVERSAL_BUILD = 0; then | |
12654 | ||
12655 | ||
12656 | for gltype in ptrdiff_t size_t ; do | |
12657 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 | |
12658 | $as_echo_n "checking for bit size of $gltype... " >&6; } | |
12659 | if eval \${gl_cv_bitsizeof_${gltype}+:} false; then : | |
12660 | $as_echo_n "(cached) " >&6 | |
12661 | else | |
12662 | if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " | |
c0c3707f CB |
12663 | #include <stddef.h> |
12664 | #include <signal.h> | |
12665 | #if HAVE_WCHAR_H | |
c0c3707f CB |
12666 | # include <wchar.h> |
12667 | #endif | |
12668 | ||
12669 | #include <limits.h>"; then : | |
12670 | ||
12671 | else | |
12672 | result=unknown | |
12673 | fi | |
12674 | ||
12675 | eval gl_cv_bitsizeof_${gltype}=\$result | |
12676 | ||
12677 | fi | |
12678 | eval ac_res=\$gl_cv_bitsizeof_${gltype} | |
12679 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
12680 | $as_echo "$ac_res" >&6; } | |
12681 | eval result=\$gl_cv_bitsizeof_${gltype} | |
12682 | if test $result = unknown; then | |
12683 | result=0 | |
8690e634 | 12684 | fi |
c0c3707f CB |
12685 | GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` |
12686 | cat >>confdefs.h <<_ACEOF | |
12687 | #define BITSIZEOF_${GLTYPE} $result | |
12688 | _ACEOF | |
8690e634 | 12689 | |
c0c3707f CB |
12690 | eval BITSIZEOF_${GLTYPE}=\$result |
12691 | done | |
8690e634 JK |
12692 | |
12693 | ||
c0c3707f | 12694 | fi |
8690e634 JK |
12695 | |
12696 | ||
c0c3707f CB |
12697 | for gltype in sig_atomic_t wchar_t wint_t ; do |
12698 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 | |
12699 | $as_echo_n "checking for bit size of $gltype... " >&6; } | |
12700 | if eval \${gl_cv_bitsizeof_${gltype}+:} false; then : | |
8690e634 JK |
12701 | $as_echo_n "(cached) " >&6 |
12702 | else | |
c0c3707f | 12703 | if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " |
c0c3707f CB |
12704 | #include <stddef.h> |
12705 | #include <signal.h> | |
12706 | #if HAVE_WCHAR_H | |
c0c3707f CB |
12707 | # include <wchar.h> |
12708 | #endif | |
8690e634 | 12709 | |
c0c3707f | 12710 | #include <limits.h>"; then : |
8690e634 | 12711 | |
c0c3707f CB |
12712 | else |
12713 | result=unknown | |
12714 | fi | |
8690e634 | 12715 | |
c0c3707f | 12716 | eval gl_cv_bitsizeof_${gltype}=\$result |
8690e634 JK |
12717 | |
12718 | fi | |
c0c3707f CB |
12719 | eval ac_res=\$gl_cv_bitsizeof_${gltype} |
12720 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
12721 | $as_echo "$ac_res" >&6; } | |
12722 | eval result=\$gl_cv_bitsizeof_${gltype} | |
12723 | if test $result = unknown; then | |
12724 | result=0 | |
12725 | fi | |
12726 | GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` | |
12727 | cat >>confdefs.h <<_ACEOF | |
12728 | #define BITSIZEOF_${GLTYPE} $result | |
12729 | _ACEOF | |
12730 | ||
12731 | eval BITSIZEOF_${GLTYPE}=\$result | |
12732 | done | |
8690e634 JK |
12733 | |
12734 | ||
12735 | ||
12736 | ||
c0c3707f CB |
12737 | for gltype in sig_atomic_t wchar_t wint_t ; do |
12738 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 | |
12739 | $as_echo_n "checking whether $gltype is signed... " >&6; } | |
12740 | if eval \${gl_cv_type_${gltype}_signed+:} false; then : | |
8690e634 JK |
12741 | $as_echo_n "(cached) " >&6 |
12742 | else | |
c0c3707f | 12743 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8690e634 JK |
12744 | /* end confdefs.h. */ |
12745 | ||
c0c3707f CB |
12746 | #include <stddef.h> |
12747 | #include <signal.h> | |
12748 | #if HAVE_WCHAR_H | |
c0c3707f CB |
12749 | # include <wchar.h> |
12750 | #endif | |
12751 | ||
12752 | int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; | |
12753 | int | |
12754 | main () | |
12755 | { | |
12756 | ||
12757 | ; | |
8690e634 JK |
12758 | return 0; |
12759 | } | |
c0c3707f CB |
12760 | _ACEOF |
12761 | if ac_fn_c_try_compile "$LINENO"; then : | |
12762 | result=yes | |
12763 | else | |
12764 | result=no | |
12765 | fi | |
12766 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12767 | eval gl_cv_type_${gltype}_signed=\$result | |
8690e634 | 12768 | |
c0c3707f CB |
12769 | fi |
12770 | eval ac_res=\$gl_cv_type_${gltype}_signed | |
12771 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
12772 | $as_echo "$ac_res" >&6; } | |
12773 | eval result=\$gl_cv_type_${gltype}_signed | |
12774 | GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` | |
12775 | if test "$result" = yes; then | |
12776 | cat >>confdefs.h <<_ACEOF | |
12777 | #define HAVE_SIGNED_${GLTYPE} 1 | |
8690e634 | 12778 | _ACEOF |
c0c3707f CB |
12779 | |
12780 | eval HAVE_SIGNED_${GLTYPE}=1 | |
12781 | else | |
12782 | eval HAVE_SIGNED_${GLTYPE}=0 | |
8690e634 | 12783 | fi |
c0c3707f CB |
12784 | done |
12785 | ||
12786 | ||
12787 | gl_cv_type_ptrdiff_t_signed=yes | |
12788 | gl_cv_type_size_t_signed=no | |
12789 | if test $APPLE_UNIVERSAL_BUILD = 0; then | |
12790 | ||
12791 | ||
12792 | for gltype in ptrdiff_t size_t ; do | |
12793 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 | |
12794 | $as_echo_n "checking for $gltype integer literal suffix... " >&6; } | |
12795 | if eval \${gl_cv_type_${gltype}_suffix+:} false; then : | |
12796 | $as_echo_n "(cached) " >&6 | |
12797 | else | |
12798 | eval gl_cv_type_${gltype}_suffix=no | |
12799 | eval result=\$gl_cv_type_${gltype}_signed | |
12800 | if test "$result" = yes; then | |
12801 | glsufu= | |
12802 | else | |
12803 | glsufu=u | |
12804 | fi | |
12805 | for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do | |
12806 | case $glsuf in | |
12807 | '') gltype1='int';; | |
12808 | l) gltype1='long int';; | |
12809 | ll) gltype1='long long int';; | |
12810 | i64) gltype1='__int64';; | |
12811 | u) gltype1='unsigned int';; | |
12812 | ul) gltype1='unsigned long int';; | |
12813 | ull) gltype1='unsigned long long int';; | |
12814 | ui64)gltype1='unsigned __int64';; | |
12815 | esac | |
12816 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12817 | /* end confdefs.h. */ | |
12818 | ||
c0c3707f CB |
12819 | #include <stddef.h> |
12820 | #include <signal.h> | |
12821 | #if HAVE_WCHAR_H | |
c0c3707f CB |
12822 | # include <wchar.h> |
12823 | #endif | |
8690e634 | 12824 | |
c0c3707f CB |
12825 | extern $gltype foo; |
12826 | extern $gltype1 foo; | |
12827 | int | |
12828 | main () | |
12829 | { | |
12830 | ||
12831 | ; | |
12832 | return 0; | |
12833 | } | |
12834 | _ACEOF | |
12835 | if ac_fn_c_try_compile "$LINENO"; then : | |
12836 | eval gl_cv_type_${gltype}_suffix=\$glsuf | |
8690e634 | 12837 | fi |
c0c3707f CB |
12838 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
12839 | eval result=\$gl_cv_type_${gltype}_suffix | |
12840 | test "$result" != no && break | |
12841 | done | |
12842 | fi | |
12843 | eval ac_res=\$gl_cv_type_${gltype}_suffix | |
12844 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
12845 | $as_echo "$ac_res" >&6; } | |
12846 | GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` | |
12847 | eval result=\$gl_cv_type_${gltype}_suffix | |
12848 | test "$result" = no && result= | |
12849 | eval ${GLTYPE}_SUFFIX=\$result | |
12850 | cat >>confdefs.h <<_ACEOF | |
12851 | #define ${GLTYPE}_SUFFIX $result | |
12852 | _ACEOF | |
8690e634 | 12853 | |
c0c3707f | 12854 | done |
8690e634 JK |
12855 | |
12856 | ||
c0c3707f | 12857 | fi |
8690e634 JK |
12858 | |
12859 | ||
c0c3707f CB |
12860 | for gltype in sig_atomic_t wchar_t wint_t ; do |
12861 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 | |
12862 | $as_echo_n "checking for $gltype integer literal suffix... " >&6; } | |
12863 | if eval \${gl_cv_type_${gltype}_suffix+:} false; then : | |
8690e634 JK |
12864 | $as_echo_n "(cached) " >&6 |
12865 | else | |
c0c3707f CB |
12866 | eval gl_cv_type_${gltype}_suffix=no |
12867 | eval result=\$gl_cv_type_${gltype}_signed | |
12868 | if test "$result" = yes; then | |
12869 | glsufu= | |
12870 | else | |
12871 | glsufu=u | |
12872 | fi | |
12873 | for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do | |
12874 | case $glsuf in | |
12875 | '') gltype1='int';; | |
12876 | l) gltype1='long int';; | |
12877 | ll) gltype1='long long int';; | |
12878 | i64) gltype1='__int64';; | |
12879 | u) gltype1='unsigned int';; | |
12880 | ul) gltype1='unsigned long int';; | |
12881 | ull) gltype1='unsigned long long int';; | |
12882 | ui64)gltype1='unsigned __int64';; | |
12883 | esac | |
12884 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 JK |
12885 | /* end confdefs.h. */ |
12886 | ||
c0c3707f CB |
12887 | #include <stddef.h> |
12888 | #include <signal.h> | |
12889 | #if HAVE_WCHAR_H | |
c0c3707f CB |
12890 | # include <wchar.h> |
12891 | #endif | |
12892 | ||
12893 | extern $gltype foo; | |
12894 | extern $gltype1 foo; | |
12895 | int | |
12896 | main () | |
12897 | { | |
12898 | ||
12899 | ; | |
5e8754f9 | 12900 | return 0; |
8690e634 | 12901 | } |
c0c3707f CB |
12902 | _ACEOF |
12903 | if ac_fn_c_try_compile "$LINENO"; then : | |
12904 | eval gl_cv_type_${gltype}_suffix=\$glsuf | |
12905 | fi | |
12906 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12907 | eval result=\$gl_cv_type_${gltype}_suffix | |
12908 | test "$result" != no && break | |
12909 | done | |
12910 | fi | |
12911 | eval ac_res=\$gl_cv_type_${gltype}_suffix | |
12912 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
12913 | $as_echo "$ac_res" >&6; } | |
12914 | GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` | |
12915 | eval result=\$gl_cv_type_${gltype}_suffix | |
12916 | test "$result" = no && result= | |
12917 | eval ${GLTYPE}_SUFFIX=\$result | |
12918 | cat >>confdefs.h <<_ACEOF | |
12919 | #define ${GLTYPE}_SUFFIX $result | |
12920 | _ACEOF | |
12921 | ||
12922 | done | |
12923 | ||
12924 | ||
12925 | ||
12926 | if test $GNULIB_OVERRIDES_WINT_T = 1; then | |
12927 | BITSIZEOF_WINT_T=32 | |
12928 | fi | |
12929 | ||
12930 | ;; | |
12931 | esac | |
8690e634 | 12932 | |
8690e634 | 12933 | |
c0c3707f CB |
12934 | |
12935 | LIMITS_H='limits.h' | |
12936 | if test -n "$LIMITS_H"; then | |
12937 | GL_GENERATE_LIMITS_H_TRUE= | |
12938 | GL_GENERATE_LIMITS_H_FALSE='#' | |
12939 | else | |
12940 | GL_GENERATE_LIMITS_H_TRUE='#' | |
12941 | GL_GENERATE_LIMITS_H_FALSE= | |
8690e634 | 12942 | fi |
6ec2e0f5 SDJ |
12943 | |
12944 | ||
12945 | ||
12946 | ||
12947 | ||
12948 | ||
12949 | ||
c0c3707f CB |
12950 | if test -n "$STDINT_H"; then |
12951 | GL_GENERATE_STDINT_H_TRUE= | |
12952 | GL_GENERATE_STDINT_H_FALSE='#' | |
12953 | else | |
12954 | GL_GENERATE_STDINT_H_TRUE='#' | |
12955 | GL_GENERATE_STDINT_H_FALSE= | |
12956 | fi | |
472fa5ee SM |
12957 | |
12958 | ||
12959 | ||
c0c3707f CB |
12960 | GNULIB_IMAXABS=0; |
12961 | GNULIB_IMAXDIV=0; | |
12962 | GNULIB_STRTOIMAX=0; | |
12963 | GNULIB_STRTOUMAX=0; | |
12964 | HAVE_DECL_IMAXABS=1; | |
12965 | HAVE_DECL_IMAXDIV=1; | |
12966 | HAVE_DECL_STRTOIMAX=1; | |
12967 | HAVE_DECL_STRTOUMAX=1; | |
12968 | HAVE_IMAXDIV_T=1; | |
12969 | REPLACE_STRTOIMAX=0; | |
12970 | REPLACE_STRTOUMAX=0; | |
12971 | INT32_MAX_LT_INTMAX_MAX=1; | |
12972 | INT64_MAX_EQ_LONG_MAX='defined _LP64'; | |
c0c3707f CB |
12973 | PRIPTR_PREFIX=__PRIPTR_PREFIX; |
12974 | UINT32_MAX_LT_UINTMAX_MAX=1; | |
12975 | UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; | |
472fa5ee | 12976 | |
6ec2e0f5 SDJ |
12977 | |
12978 | ||
12979 | ||
12980 | ||
12981 | ||
6ec2e0f5 SDJ |
12982 | |
12983 | ||
6ec2e0f5 | 12984 | |
6ec2e0f5 | 12985 | |
6ec2e0f5 | 12986 | |
6ec2e0f5 | 12987 | |
6ec2e0f5 | 12988 | |
c0c3707f CB |
12989 | |
12990 | ||
12991 | if test $gl_cv_have_include_next = yes; then | |
12992 | gl_cv_next_inttypes_h='<'inttypes.h'>' | |
12993 | else | |
12994 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5 | |
12995 | $as_echo_n "checking absolute name of <inttypes.h>... " >&6; } | |
12996 | if ${gl_cv_next_inttypes_h+:} false; then : | |
12997 | $as_echo_n "(cached) " >&6 | |
12998 | else | |
12999 | ||
13000 | if test $ac_cv_header_inttypes_h = yes; then | |
13001 | ||
13002 | ||
13003 | ||
13004 | ||
13005 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13006 | /* end confdefs.h. */ | |
13007 | #include <inttypes.h> | |
6ec2e0f5 | 13008 | _ACEOF |
c0c3707f CB |
13009 | case "$host_os" in |
13010 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
13011 | *) gl_absname_cpp="$ac_cpp" ;; | |
13012 | esac | |
6ec2e0f5 | 13013 | |
c0c3707f CB |
13014 | case "$host_os" in |
13015 | mingw*) | |
13016 | gl_dirsep_regex='[/\\]' | |
13017 | ;; | |
13018 | *) | |
13019 | gl_dirsep_regex='\/' | |
13020 | ;; | |
13021 | esac | |
13022 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
13023 | gl_header_literal_regex=`echo 'inttypes.h' \ | |
13024 | | sed -e "$gl_make_literal_regex_sed"` | |
13025 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
13026 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
13027 | s|^/[^/]|//&| | |
13028 | p | |
13029 | q | |
13030 | }' | |
6ec2e0f5 | 13031 | |
c0c3707f CB |
13032 | gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
13033 | sed -n "$gl_absolute_header_sed"` | |
6ec2e0f5 | 13034 | |
c0c3707f CB |
13035 | gl_header=$gl_cv_absolute_inttypes_h |
13036 | gl_cv_next_inttypes_h='"'$gl_header'"' | |
13037 | else | |
13038 | gl_cv_next_inttypes_h='<'inttypes.h'>' | |
13039 | fi | |
6ec2e0f5 | 13040 | |
6ec2e0f5 | 13041 | |
c0c3707f CB |
13042 | fi |
13043 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5 | |
13044 | $as_echo "$gl_cv_next_inttypes_h" >&6; } | |
13045 | fi | |
13046 | NEXT_INTTYPES_H=$gl_cv_next_inttypes_h | |
6ec2e0f5 | 13047 | |
c0c3707f CB |
13048 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
13049 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
13050 | gl_next_as_first_directive='<'inttypes.h'>' | |
13051 | else | |
13052 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
13053 | gl_next_as_first_directive=$gl_cv_next_inttypes_h | |
13054 | fi | |
13055 | NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive | |
6ec2e0f5 | 13056 | |
472fa5ee SM |
13057 | |
13058 | ||
13059 | ||
13060 | ||
13061 | ||
13062 | ||
472fa5ee SM |
13063 | |
13064 | ||
13065 | ||
13066 | ||
6ec2e0f5 | 13067 | |
698be2d8 CB |
13068 | |
13069 | ||
698be2d8 CB |
13070 | |
13071 | ||
5df4cba6 SM |
13072 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 |
13073 | $as_echo_n "checking where to find the exponent in a 'double'... " >&6; } | |
13074 | if ${gl_cv_cc_double_expbit0+:} false; then : | |
13075 | $as_echo_n "(cached) " >&6 | |
13076 | else | |
13077 | ||
13078 | if test "$cross_compiling" = yes; then : | |
13079 | ||
13080 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13081 | /* end confdefs.h. */ | |
13082 | ||
13083 | #if defined arm || defined __arm || defined __arm__ | |
13084 | mixed_endianness | |
13085 | #endif | |
13086 | ||
13087 | _ACEOF | |
13088 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
13089 | $EGREP "mixed_endianness" >/dev/null 2>&1; then : | |
13090 | gl_cv_cc_double_expbit0="unknown" | |
13091 | else | |
13092 | ||
13093 | : | |
13094 | if ${ac_cv_c_bigendian+:} false; then : | |
13095 | $as_echo_n "(cached) " >&6 | |
13096 | else | |
13097 | ac_cv_c_bigendian=unknown | |
13098 | # See if we're dealing with a universal compiler. | |
13099 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13100 | /* end confdefs.h. */ | |
13101 | #ifndef __APPLE_CC__ | |
13102 | not a universal capable compiler | |
13103 | #endif | |
13104 | typedef int dummy; | |
13105 | ||
13106 | _ACEOF | |
13107 | if ac_fn_c_try_compile "$LINENO"; then : | |
13108 | ||
13109 | # Check for potential -arch flags. It is not universal unless | |
13110 | # there are at least two -arch flags with different values. | |
13111 | ac_arch= | |
13112 | ac_prev= | |
13113 | for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do | |
13114 | if test -n "$ac_prev"; then | |
13115 | case $ac_word in | |
13116 | i?86 | x86_64 | ppc | ppc64) | |
13117 | if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then | |
13118 | ac_arch=$ac_word | |
13119 | else | |
13120 | ac_cv_c_bigendian=universal | |
13121 | break | |
13122 | fi | |
13123 | ;; | |
13124 | esac | |
13125 | ac_prev= | |
13126 | elif test "x$ac_word" = "x-arch"; then | |
13127 | ac_prev=arch | |
13128 | fi | |
13129 | done | |
13130 | fi | |
13131 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13132 | if test $ac_cv_c_bigendian = unknown; then | |
13133 | # See if sys/param.h defines the BYTE_ORDER macro. | |
13134 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13135 | /* end confdefs.h. */ | |
13136 | #include <sys/types.h> | |
13137 | #include <sys/param.h> | |
13138 | ||
13139 | int | |
13140 | main () | |
13141 | { | |
13142 | #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ | |
13143 | && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ | |
13144 | && LITTLE_ENDIAN) | |
13145 | bogus endian macros | |
13146 | #endif | |
13147 | ||
13148 | ; | |
13149 | return 0; | |
13150 | } | |
13151 | _ACEOF | |
13152 | if ac_fn_c_try_compile "$LINENO"; then : | |
13153 | # It does; now see whether it defined to BIG_ENDIAN or not. | |
13154 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13155 | /* end confdefs.h. */ | |
13156 | #include <sys/types.h> | |
13157 | #include <sys/param.h> | |
13158 | ||
13159 | int | |
13160 | main () | |
13161 | { | |
13162 | #if BYTE_ORDER != BIG_ENDIAN | |
13163 | not big endian | |
13164 | #endif | |
13165 | ||
13166 | ; | |
13167 | return 0; | |
13168 | } | |
13169 | _ACEOF | |
13170 | if ac_fn_c_try_compile "$LINENO"; then : | |
13171 | ac_cv_c_bigendian=yes | |
13172 | else | |
13173 | ac_cv_c_bigendian=no | |
13174 | fi | |
13175 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13176 | fi | |
13177 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13178 | fi | |
13179 | if test $ac_cv_c_bigendian = unknown; then | |
13180 | # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). | |
13181 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13182 | /* end confdefs.h. */ | |
13183 | #include <limits.h> | |
13184 | ||
13185 | int | |
13186 | main () | |
13187 | { | |
13188 | #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) | |
13189 | bogus endian macros | |
13190 | #endif | |
13191 | ||
13192 | ; | |
13193 | return 0; | |
13194 | } | |
13195 | _ACEOF | |
13196 | if ac_fn_c_try_compile "$LINENO"; then : | |
13197 | # It does; now see whether it defined to _BIG_ENDIAN or not. | |
13198 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13199 | /* end confdefs.h. */ | |
13200 | #include <limits.h> | |
13201 | ||
13202 | int | |
13203 | main () | |
13204 | { | |
13205 | #ifndef _BIG_ENDIAN | |
13206 | not big endian | |
13207 | #endif | |
13208 | ||
13209 | ; | |
13210 | return 0; | |
13211 | } | |
13212 | _ACEOF | |
13213 | if ac_fn_c_try_compile "$LINENO"; then : | |
13214 | ac_cv_c_bigendian=yes | |
13215 | else | |
13216 | ac_cv_c_bigendian=no | |
13217 | fi | |
13218 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13219 | fi | |
13220 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13221 | fi | |
13222 | if test $ac_cv_c_bigendian = unknown; then | |
13223 | # Compile a test program. | |
13224 | if test "$cross_compiling" = yes; then : | |
13225 | # Try to guess by grepping values from an object file. | |
13226 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13227 | /* end confdefs.h. */ | |
13228 | short int ascii_mm[] = | |
13229 | { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; | |
13230 | short int ascii_ii[] = | |
13231 | { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; | |
13232 | int use_ascii (int i) { | |
13233 | return ascii_mm[i] + ascii_ii[i]; | |
13234 | } | |
13235 | short int ebcdic_ii[] = | |
13236 | { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; | |
13237 | short int ebcdic_mm[] = | |
13238 | { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; | |
13239 | int use_ebcdic (int i) { | |
13240 | return ebcdic_mm[i] + ebcdic_ii[i]; | |
13241 | } | |
13242 | extern int foo; | |
13243 | ||
13244 | int | |
13245 | main () | |
13246 | { | |
13247 | return use_ascii (foo) == use_ebcdic (foo); | |
13248 | ; | |
13249 | return 0; | |
13250 | } | |
13251 | _ACEOF | |
13252 | if ac_fn_c_try_compile "$LINENO"; then : | |
13253 | if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then | |
13254 | ac_cv_c_bigendian=yes | |
13255 | fi | |
13256 | if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then | |
13257 | if test "$ac_cv_c_bigendian" = unknown; then | |
13258 | ac_cv_c_bigendian=no | |
13259 | else | |
13260 | # finding both strings is unlikely to happen, but who knows? | |
13261 | ac_cv_c_bigendian=unknown | |
13262 | fi | |
13263 | fi | |
13264 | fi | |
13265 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13266 | else | |
13267 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13268 | /* end confdefs.h. */ | |
13269 | $ac_includes_default | |
13270 | int | |
13271 | main () | |
13272 | { | |
13273 | ||
13274 | /* Are we little or big endian? From Harbison&Steele. */ | |
13275 | union | |
13276 | { | |
13277 | long int l; | |
13278 | char c[sizeof (long int)]; | |
13279 | } u; | |
13280 | u.l = 1; | |
13281 | return u.c[sizeof (long int) - 1] == 1; | |
13282 | ||
13283 | ; | |
13284 | return 0; | |
13285 | } | |
13286 | _ACEOF | |
13287 | if ac_fn_c_try_run "$LINENO"; then : | |
13288 | ac_cv_c_bigendian=no | |
13289 | else | |
13290 | ac_cv_c_bigendian=yes | |
13291 | fi | |
13292 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
13293 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
13294 | fi | |
13295 | ||
13296 | fi | |
13297 | fi | |
13298 | : | |
13299 | case $ac_cv_c_bigendian in #( | |
13300 | yes) | |
13301 | gl_cv_cc_double_expbit0="word 0 bit 20";; #( | |
13302 | no) | |
13303 | gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( | |
13304 | universal) | |
13305 | ||
13306 | $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h | |
13307 | ||
13308 | ;; #( | |
13309 | *) | |
13310 | gl_cv_cc_double_expbit0="unknown" ;; | |
13311 | esac | |
13312 | ||
13313 | ||
13314 | fi | |
13315 | rm -f conftest* | |
13316 | ||
13317 | ||
13318 | else | |
13319 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13320 | /* end confdefs.h. */ | |
13321 | ||
13322 | #include <float.h> | |
13323 | #include <stddef.h> | |
13324 | #include <stdio.h> | |
13325 | #include <string.h> | |
13326 | #define NWORDS \ | |
13327 | ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) | |
13328 | typedef union { double value; unsigned int word[NWORDS]; } memory_double; | |
13329 | static unsigned int ored_words[NWORDS]; | |
13330 | static unsigned int anded_words[NWORDS]; | |
13331 | static void add_to_ored_words (double x) | |
13332 | { | |
13333 | memory_double m; | |
13334 | size_t i; | |
13335 | /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ | |
13336 | memset (&m, 0, sizeof (memory_double)); | |
13337 | m.value = x; | |
13338 | for (i = 0; i < NWORDS; i++) | |
13339 | { | |
13340 | ored_words[i] |= m.word[i]; | |
13341 | anded_words[i] &= m.word[i]; | |
13342 | } | |
13343 | } | |
13344 | int main () | |
13345 | { | |
13346 | size_t j; | |
13347 | FILE *fp = fopen ("conftest.out", "w"); | |
13348 | if (fp == NULL) | |
13349 | return 1; | |
13350 | for (j = 0; j < NWORDS; j++) | |
13351 | anded_words[j] = ~ (unsigned int) 0; | |
13352 | add_to_ored_words (0.25); | |
13353 | add_to_ored_words (0.5); | |
13354 | add_to_ored_words (1.0); | |
13355 | add_to_ored_words (2.0); | |
13356 | add_to_ored_words (4.0); | |
13357 | /* Remove bits that are common (e.g. if representation of the first mantissa | |
13358 | bit is explicit). */ | |
13359 | for (j = 0; j < NWORDS; j++) | |
13360 | ored_words[j] &= ~anded_words[j]; | |
13361 | /* Now find the nonzero word. */ | |
13362 | for (j = 0; j < NWORDS; j++) | |
13363 | if (ored_words[j] != 0) | |
13364 | break; | |
13365 | if (j < NWORDS) | |
13366 | { | |
13367 | size_t i; | |
13368 | for (i = j + 1; i < NWORDS; i++) | |
13369 | if (ored_words[i] != 0) | |
13370 | { | |
13371 | fprintf (fp, "unknown"); | |
13372 | return (fclose (fp) != 0); | |
13373 | } | |
13374 | for (i = 0; ; i++) | |
13375 | if ((ored_words[j] >> i) & 1) | |
13376 | { | |
13377 | fprintf (fp, "word %d bit %d", (int) j, (int) i); | |
13378 | return (fclose (fp) != 0); | |
13379 | } | |
13380 | } | |
13381 | fprintf (fp, "unknown"); | |
13382 | return (fclose (fp) != 0); | |
13383 | } | |
13384 | ||
13385 | _ACEOF | |
13386 | if ac_fn_c_try_run "$LINENO"; then : | |
13387 | gl_cv_cc_double_expbit0=`cat conftest.out` | |
13388 | else | |
13389 | gl_cv_cc_double_expbit0="unknown" | |
6ec2e0f5 | 13390 | fi |
5df4cba6 SM |
13391 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
13392 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
13393 | fi | |
13394 | ||
13395 | rm -f conftest.out | |
6ec2e0f5 SDJ |
13396 | |
13397 | fi | |
5df4cba6 SM |
13398 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 |
13399 | $as_echo "$gl_cv_cc_double_expbit0" >&6; } | |
13400 | case "$gl_cv_cc_double_expbit0" in | |
13401 | word*bit*) | |
13402 | word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` | |
13403 | bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` | |
6ec2e0f5 SDJ |
13404 | |
13405 | cat >>confdefs.h <<_ACEOF | |
5df4cba6 | 13406 | #define DBL_EXPBIT0_WORD $word |
6ec2e0f5 SDJ |
13407 | _ACEOF |
13408 | ||
c0c3707f | 13409 | |
5df4cba6 SM |
13410 | cat >>confdefs.h <<_ACEOF |
13411 | #define DBL_EXPBIT0_BIT $bit | |
13412 | _ACEOF | |
6ec2e0f5 | 13413 | |
5df4cba6 SM |
13414 | ;; |
13415 | esac | |
6ec2e0f5 | 13416 | |
6ec2e0f5 | 13417 | |
5df4cba6 SM |
13418 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 |
13419 | $as_echo_n "checking whether byte ordering is bigendian... " >&6; } | |
c0c3707f CB |
13420 | if ${ac_cv_c_bigendian+:} false; then : |
13421 | $as_echo_n "(cached) " >&6 | |
6ec2e0f5 | 13422 | else |
c0c3707f CB |
13423 | ac_cv_c_bigendian=unknown |
13424 | # See if we're dealing with a universal compiler. | |
13425 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 13426 | /* end confdefs.h. */ |
c0c3707f CB |
13427 | #ifndef __APPLE_CC__ |
13428 | not a universal capable compiler | |
13429 | #endif | |
13430 | typedef int dummy; | |
6ec2e0f5 | 13431 | |
c0c3707f CB |
13432 | _ACEOF |
13433 | if ac_fn_c_try_compile "$LINENO"; then : | |
13434 | ||
13435 | # Check for potential -arch flags. It is not universal unless | |
13436 | # there are at least two -arch flags with different values. | |
13437 | ac_arch= | |
13438 | ac_prev= | |
13439 | for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do | |
13440 | if test -n "$ac_prev"; then | |
13441 | case $ac_word in | |
13442 | i?86 | x86_64 | ppc | ppc64) | |
13443 | if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then | |
13444 | ac_arch=$ac_word | |
13445 | else | |
13446 | ac_cv_c_bigendian=universal | |
13447 | break | |
13448 | fi | |
13449 | ;; | |
13450 | esac | |
13451 | ac_prev= | |
13452 | elif test "x$ac_word" = "x-arch"; then | |
13453 | ac_prev=arch | |
13454 | fi | |
13455 | done | |
13456 | fi | |
13457 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13458 | if test $ac_cv_c_bigendian = unknown; then | |
13459 | # See if sys/param.h defines the BYTE_ORDER macro. | |
13460 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13461 | /* end confdefs.h. */ | |
13462 | #include <sys/types.h> | |
13463 | #include <sys/param.h> | |
6ec2e0f5 SDJ |
13464 | |
13465 | int | |
13466 | main () | |
13467 | { | |
c0c3707f CB |
13468 | #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ |
13469 | && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ | |
13470 | && LITTLE_ENDIAN) | |
13471 | bogus endian macros | |
13472 | #endif | |
6ec2e0f5 | 13473 | |
c0c3707f CB |
13474 | ; |
13475 | return 0; | |
13476 | } | |
13477 | _ACEOF | |
13478 | if ac_fn_c_try_compile "$LINENO"; then : | |
13479 | # It does; now see whether it defined to BIG_ENDIAN or not. | |
13480 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13481 | /* end confdefs.h. */ | |
13482 | #include <sys/types.h> | |
13483 | #include <sys/param.h> | |
13484 | ||
13485 | int | |
13486 | main () | |
13487 | { | |
13488 | #if BYTE_ORDER != BIG_ENDIAN | |
13489 | not big endian | |
13490 | #endif | |
6ec2e0f5 SDJ |
13491 | |
13492 | ; | |
13493 | return 0; | |
13494 | } | |
13495 | _ACEOF | |
c0c3707f CB |
13496 | if ac_fn_c_try_compile "$LINENO"; then : |
13497 | ac_cv_c_bigendian=yes | |
6ec2e0f5 | 13498 | else |
c0c3707f | 13499 | ac_cv_c_bigendian=no |
6ec2e0f5 | 13500 | fi |
c0c3707f | 13501 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
6ec2e0f5 | 13502 | fi |
c0c3707f CB |
13503 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
13504 | fi | |
13505 | if test $ac_cv_c_bigendian = unknown; then | |
13506 | # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). | |
13507 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13508 | /* end confdefs.h. */ | |
13509 | #include <limits.h> | |
472fa5ee | 13510 | |
c0c3707f CB |
13511 | int |
13512 | main () | |
13513 | { | |
13514 | #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) | |
13515 | bogus endian macros | |
13516 | #endif | |
6ec2e0f5 | 13517 | |
c0c3707f CB |
13518 | ; |
13519 | return 0; | |
13520 | } | |
6ec2e0f5 | 13521 | _ACEOF |
c0c3707f CB |
13522 | if ac_fn_c_try_compile "$LINENO"; then : |
13523 | # It does; now see whether it defined to _BIG_ENDIAN or not. | |
13524 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 13525 | /* end confdefs.h. */ |
c0c3707f CB |
13526 | #include <limits.h> |
13527 | ||
6ec2e0f5 SDJ |
13528 | int |
13529 | main () | |
13530 | { | |
5df4cba6 SM |
13531 | #ifndef _BIG_ENDIAN |
13532 | not big endian | |
13533 | #endif | |
13534 | ||
13535 | ; | |
13536 | return 0; | |
13537 | } | |
13538 | _ACEOF | |
13539 | if ac_fn_c_try_compile "$LINENO"; then : | |
13540 | ac_cv_c_bigendian=yes | |
13541 | else | |
13542 | ac_cv_c_bigendian=no | |
13543 | fi | |
13544 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13545 | fi | |
13546 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13547 | fi | |
13548 | if test $ac_cv_c_bigendian = unknown; then | |
13549 | # Compile a test program. | |
13550 | if test "$cross_compiling" = yes; then : | |
13551 | # Try to guess by grepping values from an object file. | |
13552 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13553 | /* end confdefs.h. */ | |
13554 | short int ascii_mm[] = | |
13555 | { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; | |
13556 | short int ascii_ii[] = | |
13557 | { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; | |
13558 | int use_ascii (int i) { | |
13559 | return ascii_mm[i] + ascii_ii[i]; | |
13560 | } | |
13561 | short int ebcdic_ii[] = | |
13562 | { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; | |
13563 | short int ebcdic_mm[] = | |
13564 | { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; | |
13565 | int use_ebcdic (int i) { | |
13566 | return ebcdic_mm[i] + ebcdic_ii[i]; | |
13567 | } | |
13568 | extern int foo; | |
13569 | ||
13570 | int | |
13571 | main () | |
13572 | { | |
13573 | return use_ascii (foo) == use_ebcdic (foo); | |
13574 | ; | |
13575 | return 0; | |
13576 | } | |
13577 | _ACEOF | |
13578 | if ac_fn_c_try_compile "$LINENO"; then : | |
13579 | if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then | |
13580 | ac_cv_c_bigendian=yes | |
13581 | fi | |
13582 | if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then | |
13583 | if test "$ac_cv_c_bigendian" = unknown; then | |
13584 | ac_cv_c_bigendian=no | |
13585 | else | |
13586 | # finding both strings is unlikely to happen, but who knows? | |
13587 | ac_cv_c_bigendian=unknown | |
13588 | fi | |
13589 | fi | |
13590 | fi | |
13591 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13592 | else | |
13593 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13594 | /* end confdefs.h. */ | |
13595 | $ac_includes_default | |
13596 | int | |
13597 | main () | |
13598 | { | |
13599 | ||
13600 | /* Are we little or big endian? From Harbison&Steele. */ | |
13601 | union | |
13602 | { | |
13603 | long int l; | |
13604 | char c[sizeof (long int)]; | |
13605 | } u; | |
13606 | u.l = 1; | |
13607 | return u.c[sizeof (long int) - 1] == 1; | |
13608 | ||
13609 | ; | |
13610 | return 0; | |
13611 | } | |
13612 | _ACEOF | |
13613 | if ac_fn_c_try_run "$LINENO"; then : | |
13614 | ac_cv_c_bigendian=no | |
13615 | else | |
13616 | ac_cv_c_bigendian=yes | |
13617 | fi | |
13618 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
13619 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
13620 | fi | |
13621 | ||
13622 | fi | |
13623 | fi | |
13624 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 | |
13625 | $as_echo "$ac_cv_c_bigendian" >&6; } | |
13626 | case $ac_cv_c_bigendian in #( | |
13627 | yes) | |
13628 | $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h | |
13629 | ;; #( | |
13630 | no) | |
13631 | ;; #( | |
13632 | universal) | |
13633 | ||
13634 | $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h | |
13635 | ||
13636 | ;; #( | |
13637 | *) | |
13638 | as_fn_error $? "unknown endianness | |
13639 | presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; | |
13640 | esac | |
13641 | ||
13642 | ||
13643 | ||
5df4cba6 SM |
13644 | GNULIB_LOCALECONV=0; |
13645 | GNULIB_SETLOCALE=0; | |
13646 | GNULIB_SETLOCALE_NULL=0; | |
13647 | GNULIB_DUPLOCALE=0; | |
13648 | GNULIB_LOCALENAME=0; | |
13649 | HAVE_NEWLOCALE=1; | |
13650 | HAVE_DUPLOCALE=1; | |
13651 | HAVE_FREELOCALE=1; | |
13652 | REPLACE_LOCALECONV=0; | |
13653 | REPLACE_SETLOCALE=0; | |
13654 | REPLACE_NEWLOCALE=0; | |
13655 | REPLACE_DUPLOCALE=0; | |
13656 | REPLACE_FREELOCALE=0; | |
13657 | REPLACE_STRUCT_LCONV=0; | |
13658 | ||
13659 | ||
13660 | REPLACE_NULL=0; | |
13661 | HAVE_MAX_ALIGN_T=1; | |
13662 | HAVE_WCHAR_T=1; | |
13663 | ||
13664 | ||
13665 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 | |
13666 | $as_echo_n "checking for wchar_t... " >&6; } | |
13667 | if ${gt_cv_c_wchar_t+:} false; then : | |
13668 | $as_echo_n "(cached) " >&6 | |
13669 | else | |
13670 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13671 | /* end confdefs.h. */ | |
13672 | #include <stddef.h> | |
13673 | wchar_t foo = (wchar_t)'\0'; | |
13674 | int | |
13675 | main () | |
13676 | { | |
13677 | ||
13678 | ; | |
13679 | return 0; | |
13680 | } | |
13681 | _ACEOF | |
13682 | if ac_fn_c_try_compile "$LINENO"; then : | |
13683 | gt_cv_c_wchar_t=yes | |
13684 | else | |
13685 | gt_cv_c_wchar_t=no | |
13686 | fi | |
13687 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13688 | fi | |
13689 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 | |
13690 | $as_echo "$gt_cv_c_wchar_t" >&6; } | |
13691 | if test $gt_cv_c_wchar_t = yes; then | |
13692 | ||
13693 | $as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h | |
13694 | ||
13695 | fi | |
13696 | ||
13697 | ||
13698 | ||
13699 | ||
9c9d63b1 PM |
13700 | |
13701 | ||
13702 | ||
5df4cba6 SM |
13703 | STDDEF_H= |
13704 | ||
13705 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5 | |
13706 | $as_echo_n "checking for good max_align_t... " >&6; } | |
13707 | if ${gl_cv_type_max_align_t+:} false; then : | |
13708 | $as_echo_n "(cached) " >&6 | |
13709 | else | |
13710 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13711 | /* end confdefs.h. */ | |
13712 | #include <stddef.h> | |
13713 | unsigned int s = sizeof (max_align_t); | |
9c9d63b1 | 13714 | #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__ |
5df4cba6 SM |
13715 | int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; |
13716 | int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; | |
13717 | #endif | |
9c9d63b1 PM |
13718 | typedef struct { char a; max_align_t b; } max_helper; |
13719 | typedef struct { char a; long b; } long_helper; | |
13720 | typedef struct { char a; double b; } double_helper; | |
13721 | typedef struct { char a; long double b; } long_double_helper; | |
13722 | int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1]; | |
13723 | int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1]; | |
13724 | int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1]; | |
5df4cba6 SM |
13725 | |
13726 | int | |
13727 | main () | |
13728 | { | |
c0c3707f | 13729 | |
6ec2e0f5 SDJ |
13730 | ; |
13731 | return 0; | |
13732 | } | |
13733 | _ACEOF | |
13734 | if ac_fn_c_try_compile "$LINENO"; then : | |
5df4cba6 | 13735 | gl_cv_type_max_align_t=yes |
6ec2e0f5 | 13736 | else |
5df4cba6 | 13737 | gl_cv_type_max_align_t=no |
6ec2e0f5 | 13738 | fi |
c0c3707f | 13739 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
6ec2e0f5 | 13740 | |
c0c3707f | 13741 | fi |
5df4cba6 SM |
13742 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5 |
13743 | $as_echo "$gl_cv_type_max_align_t" >&6; } | |
13744 | if test $gl_cv_type_max_align_t = no; then | |
13745 | HAVE_MAX_ALIGN_T=0 | |
13746 | STDDEF_H=stddef.h | |
13747 | fi | |
13748 | ||
13749 | if test $gt_cv_c_wchar_t = no; then | |
13750 | HAVE_WCHAR_T=0 | |
13751 | STDDEF_H=stddef.h | |
13752 | fi | |
13753 | ||
13754 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 | |
13755 | $as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; } | |
13756 | if ${gl_cv_decl_null_works+:} false; then : | |
13757 | $as_echo_n "(cached) " >&6 | |
c0c3707f CB |
13758 | else |
13759 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13760 | /* end confdefs.h. */ | |
5df4cba6 SM |
13761 | #include <stddef.h> |
13762 | int test[2 * (sizeof NULL == sizeof (void *)) -1]; | |
13763 | ||
c0c3707f CB |
13764 | int |
13765 | main () | |
13766 | { | |
6ec2e0f5 | 13767 | |
c0c3707f CB |
13768 | ; |
13769 | return 0; | |
13770 | } | |
13771 | _ACEOF | |
5df4cba6 SM |
13772 | if ac_fn_c_try_compile "$LINENO"; then : |
13773 | gl_cv_decl_null_works=yes | |
c0c3707f | 13774 | else |
5df4cba6 | 13775 | gl_cv_decl_null_works=no |
c0c3707f | 13776 | fi |
5df4cba6 | 13777 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
c0c3707f | 13778 | fi |
5df4cba6 SM |
13779 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 |
13780 | $as_echo "$gl_cv_decl_null_works" >&6; } | |
13781 | if test $gl_cv_decl_null_works = no; then | |
13782 | REPLACE_NULL=1 | |
13783 | STDDEF_H=stddef.h | |
13784 | fi | |
6ec2e0f5 | 13785 | |
5df4cba6 SM |
13786 | |
13787 | if test -n "$STDDEF_H"; then | |
13788 | GL_GENERATE_STDDEF_H_TRUE= | |
13789 | GL_GENERATE_STDDEF_H_FALSE='#' | |
13790 | else | |
13791 | GL_GENERATE_STDDEF_H_TRUE='#' | |
13792 | GL_GENERATE_STDDEF_H_FALSE= | |
c0c3707f | 13793 | fi |
6ec2e0f5 | 13794 | |
5df4cba6 | 13795 | if test -n "$STDDEF_H"; then |
6ec2e0f5 | 13796 | |
472fa5ee SM |
13797 | |
13798 | ||
5e8754f9 SDJ |
13799 | |
13800 | ||
5df4cba6 SM |
13801 | |
13802 | ||
13803 | ||
13804 | if test $gl_cv_have_include_next = yes; then | |
13805 | gl_cv_next_stddef_h='<'stddef.h'>' | |
13806 | else | |
13807 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5 | |
13808 | $as_echo_n "checking absolute name of <stddef.h>... " >&6; } | |
13809 | if ${gl_cv_next_stddef_h+:} false; then : | |
13810 | $as_echo_n "(cached) " >&6 | |
c0c3707f | 13811 | else |
5df4cba6 SM |
13812 | |
13813 | ||
13814 | ||
c0c3707f CB |
13815 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
13816 | /* end confdefs.h. */ | |
c0c3707f | 13817 | #include <stddef.h> |
c0c3707f | 13818 | _ACEOF |
5df4cba6 SM |
13819 | case "$host_os" in |
13820 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
13821 | *) gl_absname_cpp="$ac_cpp" ;; | |
13822 | esac | |
13823 | ||
13824 | case "$host_os" in | |
13825 | mingw*) | |
13826 | gl_dirsep_regex='[/\\]' | |
13827 | ;; | |
13828 | *) | |
13829 | gl_dirsep_regex='\/' | |
13830 | ;; | |
13831 | esac | |
13832 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
13833 | gl_header_literal_regex=`echo 'stddef.h' \ | |
13834 | | sed -e "$gl_make_literal_regex_sed"` | |
13835 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
13836 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
13837 | s|^/[^/]|//&| | |
13838 | p | |
13839 | q | |
13840 | }' | |
13841 | ||
13842 | gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
13843 | sed -n "$gl_absolute_header_sed"` | |
13844 | ||
13845 | gl_header=$gl_cv_absolute_stddef_h | |
13846 | gl_cv_next_stddef_h='"'$gl_header'"' | |
5e8754f9 SDJ |
13847 | |
13848 | ||
c0c3707f | 13849 | fi |
5df4cba6 SM |
13850 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 |
13851 | $as_echo "$gl_cv_next_stddef_h" >&6; } | |
13852 | fi | |
13853 | NEXT_STDDEF_H=$gl_cv_next_stddef_h | |
13854 | ||
13855 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
13856 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
13857 | gl_next_as_first_directive='<'stddef.h'>' | |
13858 | else | |
13859 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
13860 | gl_next_as_first_directive=$gl_cv_next_stddef_h | |
13861 | fi | |
13862 | NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive | |
5e8754f9 SDJ |
13863 | |
13864 | ||
13865 | ||
13866 | ||
5df4cba6 | 13867 | fi |
5e8754f9 SDJ |
13868 | |
13869 | ||
13870 | ||
13871 | ||
13872 | ||
13873 | ||
5df4cba6 SM |
13874 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5 |
13875 | $as_echo_n "checking whether locale.h defines locale_t... " >&6; } | |
13876 | if ${gl_cv_header_locale_has_locale_t+:} false; then : | |
13877 | $as_echo_n "(cached) " >&6 | |
13878 | else | |
13879 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 13880 | /* end confdefs.h. */ |
5df4cba6 SM |
13881 | #include <locale.h> |
13882 | locale_t x; | |
c0c3707f CB |
13883 | int |
13884 | main () | |
13885 | { | |
5e8754f9 | 13886 | |
c0c3707f CB |
13887 | ; |
13888 | return 0; | |
13889 | } | |
13890 | _ACEOF | |
13891 | if ac_fn_c_try_compile "$LINENO"; then : | |
5df4cba6 | 13892 | gl_cv_header_locale_has_locale_t=yes |
c0c3707f | 13893 | else |
5df4cba6 | 13894 | gl_cv_header_locale_has_locale_t=no |
c0c3707f CB |
13895 | fi |
13896 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5df4cba6 | 13897 | |
c0c3707f | 13898 | fi |
5df4cba6 SM |
13899 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5 |
13900 | $as_echo "$gl_cv_header_locale_has_locale_t" >&6; } | |
13901 | ||
13902 | ||
13903 | if test $ac_cv_header_xlocale_h = yes; then | |
13904 | HAVE_XLOCALE_H=1 | |
13905 | if test $gl_cv_header_locale_has_locale_t = yes; then | |
13906 | gl_cv_header_locale_h_needs_xlocale_h=no | |
13907 | else | |
13908 | gl_cv_header_locale_h_needs_xlocale_h=yes | |
c0c3707f | 13909 | fi |
5df4cba6 SM |
13910 | HAVE_LOCALE_T=1 |
13911 | else | |
13912 | HAVE_XLOCALE_H=0 | |
13913 | gl_cv_header_locale_h_needs_xlocale_h=no | |
13914 | if test $gl_cv_header_locale_has_locale_t = yes; then | |
13915 | HAVE_LOCALE_T=1 | |
13916 | else | |
13917 | HAVE_LOCALE_T=0 | |
13918 | fi | |
13919 | fi | |
13920 | ||
13921 | ||
5e8754f9 | 13922 | |
5df4cba6 SM |
13923 | |
13924 | gl_threads_api=none | |
13925 | LIBTHREAD= | |
13926 | LTLIBTHREAD= | |
13927 | LIBMULTITHREAD= | |
13928 | LTLIBMULTITHREAD= | |
13929 | if test "$gl_use_threads" != no; then | |
13930 | ||
13931 | ||
13932 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 | |
13933 | $as_echo_n "checking whether imported symbols can be declared weak... " >&6; } | |
13934 | if ${gl_cv_have_weak+:} false; then : | |
13935 | $as_echo_n "(cached) " >&6 | |
13936 | else | |
13937 | gl_cv_have_weak=no | |
13938 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13939 | /* end confdefs.h. */ | |
13940 | extern void xyzzy (); | |
13941 | #pragma weak xyzzy | |
c0c3707f CB |
13942 | int |
13943 | main () | |
13944 | { | |
5df4cba6 | 13945 | xyzzy(); |
c0c3707f CB |
13946 | ; |
13947 | return 0; | |
13948 | } | |
13949 | _ACEOF | |
5df4cba6 SM |
13950 | if ac_fn_c_try_link "$LINENO"; then : |
13951 | gl_cv_have_weak=maybe | |
13952 | fi | |
13953 | rm -f core conftest.err conftest.$ac_objext \ | |
13954 | conftest$ac_exeext conftest.$ac_ext | |
13955 | if test $gl_cv_have_weak = maybe; then | |
13956 | if test "$cross_compiling" = yes; then : | |
13957 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 13958 | /* end confdefs.h. */ |
5df4cba6 SM |
13959 | #ifdef __ELF__ |
13960 | Extensible Linking Format | |
13961 | #endif | |
5e8754f9 | 13962 | |
5df4cba6 SM |
13963 | _ACEOF |
13964 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
13965 | $EGREP "Extensible Linking Format" >/dev/null 2>&1; then : | |
13966 | gl_cv_have_weak="guessing yes" | |
13967 | else | |
13968 | gl_cv_have_weak="guessing no" | |
13969 | fi | |
13970 | rm -f conftest* | |
5e8754f9 | 13971 | |
5df4cba6 SM |
13972 | |
13973 | else | |
13974 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13975 | /* end confdefs.h. */ | |
13976 | ||
13977 | #include <stdio.h> | |
13978 | #pragma weak fputs | |
13979 | int main () | |
13980 | { | |
13981 | return (fputs == NULL); | |
c0c3707f CB |
13982 | } |
13983 | _ACEOF | |
5df4cba6 SM |
13984 | if ac_fn_c_try_run "$LINENO"; then : |
13985 | gl_cv_have_weak=yes | |
c0c3707f | 13986 | else |
5df4cba6 | 13987 | gl_cv_have_weak=no |
c0c3707f | 13988 | fi |
5df4cba6 SM |
13989 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
13990 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c0c3707f | 13991 | fi |
5df4cba6 SM |
13992 | |
13993 | fi | |
13994 | case " $LDFLAGS " in | |
13995 | *" -static "*) gl_cv_have_weak=no ;; | |
13996 | esac | |
13997 | case "$gl_cv_have_weak" in | |
13998 | *yes) | |
13999 | case "$host_os" in | |
14000 | freebsd* | dragonfly*) | |
14001 | : > conftest1.c | |
14002 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1 | |
14003 | cat <<EOF > conftest2.c | |
14004 | #include <pthread.h> | |
14005 | #pragma weak pthread_mutexattr_gettype | |
14006 | int main () | |
14007 | { | |
14008 | return (pthread_mutexattr_gettype != NULL); | |
14009 | } | |
14010 | EOF | |
14011 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \ | |
14012 | || gl_cv_have_weak=no | |
14013 | rm -f conftest1.c libempty.so conftest2.c conftest | |
14014 | ;; | |
14015 | esac | |
14016 | ;; | |
14017 | esac | |
14018 | ||
14019 | fi | |
14020 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 | |
14021 | $as_echo "$gl_cv_have_weak" >&6; } | |
14022 | case "$gl_cv_have_weak" in | |
14023 | *yes) | |
14024 | ||
14025 | $as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h | |
14026 | ||
14027 | ;; | |
14028 | esac | |
14029 | ||
14030 | if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then | |
14031 | ||
14032 | : | |
c0c3707f | 14033 | fi |
5df4cba6 SM |
14034 | if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then |
14035 | ||
14036 | gl_have_isoc_threads="$ac_cv_header_threads_h" | |
14037 | fi | |
14038 | if test "$gl_use_threads" = yes \ | |
14039 | || test "$gl_use_threads" = posix \ | |
14040 | || test "$gl_use_threads" = isoc+posix; then | |
14041 | ||
14042 | ||
14043 | if test -z "$gl_pthreadlib_body_done"; then | |
14044 | gl_pthread_api=no | |
14045 | LIBPTHREAD= | |
14046 | LIBPMULTITHREAD= | |
14047 | # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that | |
14048 | # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY. | |
14049 | ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" | |
14050 | if test "x$ac_cv_header_pthread_h" = xyes; then : | |
14051 | gl_have_pthread_h=yes | |
14052 | else | |
14053 | gl_have_pthread_h=no | |
14054 | fi | |
14055 | ||
14056 | ||
14057 | if test "$gl_have_pthread_h" = yes; then | |
14058 | # Other possible tests: | |
14059 | # -lpthreads (FSU threads, PCthreads) | |
14060 | # -lgthreads | |
14061 | # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist | |
14062 | # in libc. IRIX 6.5 has the first one in both libc and libpthread, but | |
14063 | # the second one only in libpthread, and lock.c needs it. | |
14064 | # | |
14065 | # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 | |
14066 | # needs -pthread for some reason. See: | |
14067 | # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html | |
14068 | save_LIBS=$LIBS | |
14069 | for gl_pthread in '' '-pthread'; do | |
14070 | LIBS="$LIBS $gl_pthread" | |
14071 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14072 | /* end confdefs.h. */ | |
14073 | #include <pthread.h> | |
14074 | pthread_mutex_t m; | |
14075 | pthread_mutexattr_t ma; | |
5e8754f9 | 14076 | |
c0c3707f CB |
14077 | int |
14078 | main () | |
14079 | { | |
5df4cba6 SM |
14080 | pthread_mutex_lock (&m); |
14081 | pthread_mutexattr_init (&ma); | |
c0c3707f CB |
14082 | ; |
14083 | return 0; | |
14084 | } | |
14085 | _ACEOF | |
5df4cba6 SM |
14086 | if ac_fn_c_try_link "$LINENO"; then : |
14087 | gl_pthread_api=yes | |
14088 | LIBPTHREAD=$gl_pthread | |
14089 | LIBPMULTITHREAD=$gl_pthread | |
c0c3707f | 14090 | fi |
5df4cba6 SM |
14091 | rm -f core conftest.err conftest.$ac_objext \ |
14092 | conftest$ac_exeext conftest.$ac_ext | |
14093 | LIBS=$save_LIBS | |
14094 | test $gl_pthread_api = yes && break | |
14095 | done | |
14096 | ||
14097 | # Test for libpthread by looking for pthread_kill. (Not pthread_self, | |
14098 | # since it is defined as a macro on OSF/1.) | |
14099 | if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then | |
14100 | # The program links fine without libpthread. But it may actually | |
14101 | # need to link with libpthread in order to create multiple threads. | |
14102 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
14103 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
14104 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
14105 | $as_echo_n "(cached) " >&6 | |
c0c3707f | 14106 | else |
5df4cba6 SM |
14107 | ac_check_lib_save_LIBS=$LIBS |
14108 | LIBS="-lpthread $LIBS" | |
14109 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 14110 | /* end confdefs.h. */ |
5df4cba6 SM |
14111 | |
14112 | /* Override any GCC internal prototype to avoid an error. | |
14113 | Use char because int might match the return type of a GCC | |
14114 | builtin and then its argument prototype would still apply. */ | |
14115 | #ifdef __cplusplus | |
14116 | extern "C" | |
14117 | #endif | |
14118 | char pthread_kill (); | |
c0c3707f CB |
14119 | int |
14120 | main () | |
14121 | { | |
5df4cba6 | 14122 | return pthread_kill (); |
c0c3707f CB |
14123 | ; |
14124 | return 0; | |
14125 | } | |
14126 | _ACEOF | |
5df4cba6 SM |
14127 | if ac_fn_c_try_link "$LINENO"; then : |
14128 | ac_cv_lib_pthread_pthread_kill=yes | |
6ec2e0f5 | 14129 | else |
5df4cba6 | 14130 | ac_cv_lib_pthread_pthread_kill=no |
6ec2e0f5 | 14131 | fi |
5df4cba6 SM |
14132 | rm -f core conftest.err conftest.$ac_objext \ |
14133 | conftest$ac_exeext conftest.$ac_ext | |
14134 | LIBS=$ac_check_lib_save_LIBS | |
c0c3707f | 14135 | fi |
5df4cba6 SM |
14136 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 |
14137 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
14138 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
14139 | LIBPMULTITHREAD=-lpthread | |
14140 | # On Solaris and HP-UX, most pthread functions exist also in libc. | |
14141 | # Therefore pthread_in_use() needs to actually try to create a | |
14142 | # thread: pthread_create from libc will fail, whereas | |
14143 | # pthread_create will actually create a thread. | |
14144 | # On Solaris 10 or newer, this test is no longer needed, because | |
14145 | # libc contains the fully functional pthread functions. | |
14146 | case "$host_os" in | |
14147 | solaris | solaris2.1-9 | solaris2.1-9.* | hpux*) | |
472fa5ee | 14148 | |
5df4cba6 | 14149 | $as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h |
472fa5ee | 14150 | |
5df4cba6 | 14151 | esac |
472fa5ee | 14152 | |
5df4cba6 | 14153 | fi |
472fa5ee | 14154 | |
5df4cba6 SM |
14155 | elif test $gl_pthread_api != yes; then |
14156 | # Some library is needed. Try libpthread and libc_r. | |
14157 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
14158 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
14159 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
c0c3707f CB |
14160 | $as_echo_n "(cached) " >&6 |
14161 | else | |
5df4cba6 SM |
14162 | ac_check_lib_save_LIBS=$LIBS |
14163 | LIBS="-lpthread $LIBS" | |
14164 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 14165 | /* end confdefs.h. */ |
5df4cba6 SM |
14166 | |
14167 | /* Override any GCC internal prototype to avoid an error. | |
14168 | Use char because int might match the return type of a GCC | |
14169 | builtin and then its argument prototype would still apply. */ | |
14170 | #ifdef __cplusplus | |
14171 | extern "C" | |
14172 | #endif | |
14173 | char pthread_kill (); | |
c0c3707f CB |
14174 | int |
14175 | main () | |
14176 | { | |
5df4cba6 | 14177 | return pthread_kill (); |
c0c3707f CB |
14178 | ; |
14179 | return 0; | |
14180 | } | |
14181 | _ACEOF | |
14182 | if ac_fn_c_try_link "$LINENO"; then : | |
5df4cba6 | 14183 | ac_cv_lib_pthread_pthread_kill=yes |
c0c3707f | 14184 | else |
5df4cba6 | 14185 | ac_cv_lib_pthread_pthread_kill=no |
c0c3707f CB |
14186 | fi |
14187 | rm -f core conftest.err conftest.$ac_objext \ | |
14188 | conftest$ac_exeext conftest.$ac_ext | |
5df4cba6 SM |
14189 | LIBS=$ac_check_lib_save_LIBS |
14190 | fi | |
14191 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 | |
14192 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
14193 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
14194 | gl_pthread_api=yes | |
14195 | LIBPTHREAD=-lpthread | |
14196 | LIBPMULTITHREAD=-lpthread | |
c0c3707f | 14197 | fi |
472fa5ee | 14198 | |
5df4cba6 SM |
14199 | if test $gl_pthread_api != yes; then |
14200 | # For FreeBSD 4. | |
14201 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5 | |
14202 | $as_echo_n "checking for pthread_kill in -lc_r... " >&6; } | |
14203 | if ${ac_cv_lib_c_r_pthread_kill+:} false; then : | |
14204 | $as_echo_n "(cached) " >&6 | |
14205 | else | |
14206 | ac_check_lib_save_LIBS=$LIBS | |
14207 | LIBS="-lc_r $LIBS" | |
14208 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14209 | /* end confdefs.h. */ | |
472fa5ee | 14210 | |
5df4cba6 SM |
14211 | /* Override any GCC internal prototype to avoid an error. |
14212 | Use char because int might match the return type of a GCC | |
14213 | builtin and then its argument prototype would still apply. */ | |
14214 | #ifdef __cplusplus | |
14215 | extern "C" | |
14216 | #endif | |
14217 | char pthread_kill (); | |
14218 | int | |
14219 | main () | |
14220 | { | |
14221 | return pthread_kill (); | |
14222 | ; | |
14223 | return 0; | |
14224 | } | |
14225 | _ACEOF | |
14226 | if ac_fn_c_try_link "$LINENO"; then : | |
14227 | ac_cv_lib_c_r_pthread_kill=yes | |
14228 | else | |
14229 | ac_cv_lib_c_r_pthread_kill=no | |
14230 | fi | |
14231 | rm -f core conftest.err conftest.$ac_objext \ | |
14232 | conftest$ac_exeext conftest.$ac_ext | |
14233 | LIBS=$ac_check_lib_save_LIBS | |
14234 | fi | |
14235 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5 | |
14236 | $as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; } | |
14237 | if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then : | |
14238 | gl_pthread_api=yes | |
14239 | LIBPTHREAD=-lc_r | |
14240 | LIBPMULTITHREAD=-lc_r | |
14241 | fi | |
6ec2e0f5 | 14242 | |
5df4cba6 SM |
14243 | fi |
14244 | fi | |
14245 | fi | |
14246 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 | |
14247 | $as_echo_n "checking whether POSIX threads API is available... " >&6; } | |
14248 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5 | |
14249 | $as_echo "$gl_pthread_api" >&6; } | |
472fa5ee SM |
14250 | |
14251 | ||
5df4cba6 | 14252 | if test $gl_pthread_api = yes; then |
472fa5ee | 14253 | |
5df4cba6 | 14254 | $as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h |
472fa5ee | 14255 | |
5df4cba6 | 14256 | fi |
472fa5ee | 14257 | |
5df4cba6 | 14258 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
c0c3707f | 14259 | /* end confdefs.h. */ |
5df4cba6 | 14260 | #include <sched.h> |
c0c3707f CB |
14261 | int |
14262 | main () | |
14263 | { | |
5df4cba6 | 14264 | sched_yield (); |
c0c3707f CB |
14265 | ; |
14266 | return 0; | |
14267 | } | |
14268 | _ACEOF | |
14269 | if ac_fn_c_try_link "$LINENO"; then : | |
5df4cba6 | 14270 | LIB_SCHED_YIELD= |
6ec2e0f5 | 14271 | |
c0c3707f | 14272 | else |
5df4cba6 SM |
14273 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 |
14274 | $as_echo_n "checking for sched_yield in -lrt... " >&6; } | |
14275 | if ${ac_cv_lib_rt_sched_yield+:} false; then : | |
14276 | $as_echo_n "(cached) " >&6 | |
c0c3707f | 14277 | else |
5df4cba6 SM |
14278 | ac_check_lib_save_LIBS=$LIBS |
14279 | LIBS="-lrt $LIBS" | |
14280 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 14281 | /* end confdefs.h. */ |
6ec2e0f5 | 14282 | |
5df4cba6 SM |
14283 | /* Override any GCC internal prototype to avoid an error. |
14284 | Use char because int might match the return type of a GCC | |
14285 | builtin and then its argument prototype would still apply. */ | |
14286 | #ifdef __cplusplus | |
14287 | extern "C" | |
14288 | #endif | |
14289 | char sched_yield (); | |
14290 | int | |
14291 | main () | |
c0c3707f | 14292 | { |
5df4cba6 SM |
14293 | return sched_yield (); |
14294 | ; | |
14295 | return 0; | |
c0c3707f | 14296 | } |
6ec2e0f5 | 14297 | _ACEOF |
5df4cba6 SM |
14298 | if ac_fn_c_try_link "$LINENO"; then : |
14299 | ac_cv_lib_rt_sched_yield=yes | |
c0c3707f | 14300 | else |
5df4cba6 | 14301 | ac_cv_lib_rt_sched_yield=no |
6ec2e0f5 | 14302 | fi |
5df4cba6 SM |
14303 | rm -f core conftest.err conftest.$ac_objext \ |
14304 | conftest$ac_exeext conftest.$ac_ext | |
14305 | LIBS=$ac_check_lib_save_LIBS | |
6ec2e0f5 | 14306 | fi |
5df4cba6 SM |
14307 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 |
14308 | $as_echo "$ac_cv_lib_rt_sched_yield" >&6; } | |
14309 | if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : | |
14310 | LIB_SCHED_YIELD=-lrt | |
14311 | else | |
14312 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5 | |
14313 | $as_echo_n "checking for sched_yield in -lposix4... " >&6; } | |
14314 | if ${ac_cv_lib_posix4_sched_yield+:} false; then : | |
14315 | $as_echo_n "(cached) " >&6 | |
14316 | else | |
14317 | ac_check_lib_save_LIBS=$LIBS | |
14318 | LIBS="-lposix4 $LIBS" | |
14319 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 14320 | /* end confdefs.h. */ |
6ec2e0f5 | 14321 | |
5df4cba6 SM |
14322 | /* Override any GCC internal prototype to avoid an error. |
14323 | Use char because int might match the return type of a GCC | |
14324 | builtin and then its argument prototype would still apply. */ | |
14325 | #ifdef __cplusplus | |
14326 | extern "C" | |
14327 | #endif | |
14328 | char sched_yield (); | |
c0c3707f CB |
14329 | int |
14330 | main () | |
14331 | { | |
5df4cba6 | 14332 | return sched_yield (); |
c0c3707f CB |
14333 | ; |
14334 | return 0; | |
14335 | } | |
14336 | _ACEOF | |
14337 | if ac_fn_c_try_link "$LINENO"; then : | |
5df4cba6 SM |
14338 | ac_cv_lib_posix4_sched_yield=yes |
14339 | else | |
14340 | ac_cv_lib_posix4_sched_yield=no | |
c0c3707f CB |
14341 | fi |
14342 | rm -f core conftest.err conftest.$ac_objext \ | |
14343 | conftest$ac_exeext conftest.$ac_ext | |
5df4cba6 SM |
14344 | LIBS=$ac_check_lib_save_LIBS |
14345 | fi | |
14346 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5 | |
14347 | $as_echo "$ac_cv_lib_posix4_sched_yield" >&6; } | |
14348 | if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then : | |
14349 | LIB_SCHED_YIELD=-lposix4 | |
14350 | fi | |
14351 | ||
14352 | fi | |
14353 | ||
14354 | ||
14355 | fi | |
14356 | rm -f core conftest.err conftest.$ac_objext \ | |
14357 | conftest$ac_exeext conftest.$ac_ext | |
14358 | ||
14359 | ||
14360 | gl_pthreadlib_body_done=done | |
14361 | fi | |
14362 | ||
14363 | LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD | |
14364 | LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD | |
14365 | if test $gl_pthread_api = yes; then | |
14366 | if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then | |
14367 | gl_threads_api='isoc+posix' | |
14368 | ||
14369 | $as_echo "#define USE_ISOC_AND_POSIX_THREADS 1" >>confdefs.h | |
14370 | ||
14371 | LIBTHREAD= LTLIBTHREAD= | |
14372 | else | |
14373 | gl_threads_api=posix | |
14374 | ||
14375 | $as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h | |
14376 | ||
14377 | if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then | |
14378 | if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then | |
14379 | ||
14380 | $as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h | |
14381 | ||
14382 | LIBTHREAD= LTLIBTHREAD= | |
9c9d63b1 PM |
14383 | else |
14384 | case "$host_os" in | |
14385 | freebsd* | dragonfly*) | |
14386 | if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then | |
14387 | ||
14388 | $as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h | |
14389 | ||
14390 | fi | |
14391 | ;; | |
14392 | esac | |
5df4cba6 SM |
14393 | fi |
14394 | fi | |
14395 | fi | |
c0c3707f CB |
14396 | fi |
14397 | fi | |
5df4cba6 SM |
14398 | if test $gl_threads_api = none; then |
14399 | if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then | |
14400 | ||
14401 | ||
14402 | ||
14403 | if test -z "$gl_stdthreadlib_body_done"; then | |
14404 | ||
14405 | ||
14406 | case "$host_os" in | |
14407 | mingw*) | |
14408 | LIBSTDTHREAD= | |
14409 | ;; | |
14410 | *) | |
c0c3707f CB |
14411 | |
14412 | ||
5df4cba6 | 14413 | if test -z "$gl_pthreadlib_body_done"; then |
c0c3707f CB |
14414 | gl_pthread_api=no |
14415 | LIBPTHREAD= | |
14416 | LIBPMULTITHREAD= | |
14417 | # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that | |
14418 | # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY. | |
14419 | ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" | |
14420 | if test "x$ac_cv_header_pthread_h" = xyes; then : | |
14421 | gl_have_pthread_h=yes | |
14422 | else | |
14423 | gl_have_pthread_h=no | |
14424 | fi | |
6ec2e0f5 | 14425 | |
6ec2e0f5 | 14426 | |
c0c3707f CB |
14427 | if test "$gl_have_pthread_h" = yes; then |
14428 | # Other possible tests: | |
14429 | # -lpthreads (FSU threads, PCthreads) | |
14430 | # -lgthreads | |
14431 | # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist | |
14432 | # in libc. IRIX 6.5 has the first one in both libc and libpthread, but | |
14433 | # the second one only in libpthread, and lock.c needs it. | |
14434 | # | |
14435 | # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 | |
14436 | # needs -pthread for some reason. See: | |
14437 | # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html | |
14438 | save_LIBS=$LIBS | |
14439 | for gl_pthread in '' '-pthread'; do | |
14440 | LIBS="$LIBS $gl_pthread" | |
14441 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14442 | /* end confdefs.h. */ | |
14443 | #include <pthread.h> | |
14444 | pthread_mutex_t m; | |
14445 | pthread_mutexattr_t ma; | |
6ec2e0f5 | 14446 | |
c0c3707f CB |
14447 | int |
14448 | main () | |
14449 | { | |
14450 | pthread_mutex_lock (&m); | |
14451 | pthread_mutexattr_init (&ma); | |
14452 | ; | |
14453 | return 0; | |
14454 | } | |
6ec2e0f5 | 14455 | _ACEOF |
c0c3707f CB |
14456 | if ac_fn_c_try_link "$LINENO"; then : |
14457 | gl_pthread_api=yes | |
14458 | LIBPTHREAD=$gl_pthread | |
14459 | LIBPMULTITHREAD=$gl_pthread | |
6ec2e0f5 | 14460 | fi |
c0c3707f CB |
14461 | rm -f core conftest.err conftest.$ac_objext \ |
14462 | conftest$ac_exeext conftest.$ac_ext | |
14463 | LIBS=$save_LIBS | |
14464 | test $gl_pthread_api = yes && break | |
14465 | done | |
6ec2e0f5 | 14466 | |
c0c3707f CB |
14467 | # Test for libpthread by looking for pthread_kill. (Not pthread_self, |
14468 | # since it is defined as a macro on OSF/1.) | |
14469 | if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then | |
14470 | # The program links fine without libpthread. But it may actually | |
14471 | # need to link with libpthread in order to create multiple threads. | |
14472 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
14473 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
14474 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
6ec2e0f5 SDJ |
14475 | $as_echo_n "(cached) " >&6 |
14476 | else | |
c0c3707f | 14477 | ac_check_lib_save_LIBS=$LIBS |
5df4cba6 SM |
14478 | LIBS="-lpthread $LIBS" |
14479 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14480 | /* end confdefs.h. */ | |
14481 | ||
14482 | /* Override any GCC internal prototype to avoid an error. | |
14483 | Use char because int might match the return type of a GCC | |
14484 | builtin and then its argument prototype would still apply. */ | |
14485 | #ifdef __cplusplus | |
14486 | extern "C" | |
14487 | #endif | |
14488 | char pthread_kill (); | |
14489 | int | |
14490 | main () | |
14491 | { | |
14492 | return pthread_kill (); | |
14493 | ; | |
14494 | return 0; | |
14495 | } | |
14496 | _ACEOF | |
14497 | if ac_fn_c_try_link "$LINENO"; then : | |
14498 | ac_cv_lib_pthread_pthread_kill=yes | |
14499 | else | |
14500 | ac_cv_lib_pthread_pthread_kill=no | |
14501 | fi | |
14502 | rm -f core conftest.err conftest.$ac_objext \ | |
14503 | conftest$ac_exeext conftest.$ac_ext | |
14504 | LIBS=$ac_check_lib_save_LIBS | |
14505 | fi | |
14506 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 | |
14507 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
14508 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
14509 | LIBPMULTITHREAD=-lpthread | |
14510 | # On Solaris and HP-UX, most pthread functions exist also in libc. | |
14511 | # Therefore pthread_in_use() needs to actually try to create a | |
14512 | # thread: pthread_create from libc will fail, whereas | |
14513 | # pthread_create will actually create a thread. | |
14514 | # On Solaris 10 or newer, this test is no longer needed, because | |
14515 | # libc contains the fully functional pthread functions. | |
14516 | case "$host_os" in | |
14517 | solaris | solaris2.1-9 | solaris2.1-9.* | hpux*) | |
14518 | ||
14519 | $as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h | |
14520 | ||
14521 | esac | |
14522 | ||
14523 | fi | |
14524 | ||
14525 | elif test $gl_pthread_api != yes; then | |
14526 | # Some library is needed. Try libpthread and libc_r. | |
14527 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
14528 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
14529 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
14530 | $as_echo_n "(cached) " >&6 | |
14531 | else | |
14532 | ac_check_lib_save_LIBS=$LIBS | |
14533 | LIBS="-lpthread $LIBS" | |
14534 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14535 | /* end confdefs.h. */ | |
14536 | ||
14537 | /* Override any GCC internal prototype to avoid an error. | |
14538 | Use char because int might match the return type of a GCC | |
14539 | builtin and then its argument prototype would still apply. */ | |
14540 | #ifdef __cplusplus | |
14541 | extern "C" | |
14542 | #endif | |
14543 | char pthread_kill (); | |
14544 | int | |
14545 | main () | |
14546 | { | |
14547 | return pthread_kill (); | |
14548 | ; | |
14549 | return 0; | |
14550 | } | |
14551 | _ACEOF | |
14552 | if ac_fn_c_try_link "$LINENO"; then : | |
14553 | ac_cv_lib_pthread_pthread_kill=yes | |
14554 | else | |
14555 | ac_cv_lib_pthread_pthread_kill=no | |
14556 | fi | |
14557 | rm -f core conftest.err conftest.$ac_objext \ | |
14558 | conftest$ac_exeext conftest.$ac_ext | |
14559 | LIBS=$ac_check_lib_save_LIBS | |
14560 | fi | |
14561 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 | |
14562 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
14563 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
14564 | gl_pthread_api=yes | |
14565 | LIBPTHREAD=-lpthread | |
14566 | LIBPMULTITHREAD=-lpthread | |
14567 | fi | |
14568 | ||
14569 | if test $gl_pthread_api != yes; then | |
14570 | # For FreeBSD 4. | |
14571 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5 | |
14572 | $as_echo_n "checking for pthread_kill in -lc_r... " >&6; } | |
14573 | if ${ac_cv_lib_c_r_pthread_kill+:} false; then : | |
14574 | $as_echo_n "(cached) " >&6 | |
14575 | else | |
14576 | ac_check_lib_save_LIBS=$LIBS | |
14577 | LIBS="-lc_r $LIBS" | |
14578 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14579 | /* end confdefs.h. */ | |
14580 | ||
14581 | /* Override any GCC internal prototype to avoid an error. | |
14582 | Use char because int might match the return type of a GCC | |
14583 | builtin and then its argument prototype would still apply. */ | |
14584 | #ifdef __cplusplus | |
14585 | extern "C" | |
14586 | #endif | |
14587 | char pthread_kill (); | |
14588 | int | |
14589 | main () | |
14590 | { | |
14591 | return pthread_kill (); | |
14592 | ; | |
14593 | return 0; | |
14594 | } | |
14595 | _ACEOF | |
14596 | if ac_fn_c_try_link "$LINENO"; then : | |
14597 | ac_cv_lib_c_r_pthread_kill=yes | |
14598 | else | |
14599 | ac_cv_lib_c_r_pthread_kill=no | |
14600 | fi | |
14601 | rm -f core conftest.err conftest.$ac_objext \ | |
14602 | conftest$ac_exeext conftest.$ac_ext | |
14603 | LIBS=$ac_check_lib_save_LIBS | |
14604 | fi | |
14605 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5 | |
14606 | $as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; } | |
14607 | if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then : | |
14608 | gl_pthread_api=yes | |
14609 | LIBPTHREAD=-lc_r | |
14610 | LIBPMULTITHREAD=-lc_r | |
14611 | fi | |
14612 | ||
14613 | fi | |
14614 | fi | |
14615 | fi | |
14616 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 | |
14617 | $as_echo_n "checking whether POSIX threads API is available... " >&6; } | |
14618 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5 | |
14619 | $as_echo "$gl_pthread_api" >&6; } | |
14620 | ||
14621 | ||
14622 | if test $gl_pthread_api = yes; then | |
14623 | ||
14624 | $as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h | |
14625 | ||
14626 | fi | |
14627 | ||
14628 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14629 | /* end confdefs.h. */ | |
14630 | #include <sched.h> | |
14631 | int | |
14632 | main () | |
14633 | { | |
14634 | sched_yield (); | |
14635 | ; | |
14636 | return 0; | |
14637 | } | |
14638 | _ACEOF | |
14639 | if ac_fn_c_try_link "$LINENO"; then : | |
14640 | LIB_SCHED_YIELD= | |
14641 | ||
14642 | else | |
14643 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 | |
14644 | $as_echo_n "checking for sched_yield in -lrt... " >&6; } | |
14645 | if ${ac_cv_lib_rt_sched_yield+:} false; then : | |
14646 | $as_echo_n "(cached) " >&6 | |
14647 | else | |
14648 | ac_check_lib_save_LIBS=$LIBS | |
14649 | LIBS="-lrt $LIBS" | |
c0c3707f | 14650 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6ec2e0f5 | 14651 | /* end confdefs.h. */ |
6ec2e0f5 | 14652 | |
c0c3707f CB |
14653 | /* Override any GCC internal prototype to avoid an error. |
14654 | Use char because int might match the return type of a GCC | |
14655 | builtin and then its argument prototype would still apply. */ | |
14656 | #ifdef __cplusplus | |
14657 | extern "C" | |
14658 | #endif | |
5df4cba6 | 14659 | char sched_yield (); |
c0c3707f CB |
14660 | int |
14661 | main () | |
14662 | { | |
5df4cba6 | 14663 | return sched_yield (); |
c0c3707f CB |
14664 | ; |
14665 | return 0; | |
14666 | } | |
6ec2e0f5 | 14667 | _ACEOF |
c0c3707f | 14668 | if ac_fn_c_try_link "$LINENO"; then : |
5df4cba6 | 14669 | ac_cv_lib_rt_sched_yield=yes |
6ec2e0f5 | 14670 | else |
5df4cba6 | 14671 | ac_cv_lib_rt_sched_yield=no |
6ec2e0f5 | 14672 | fi |
c0c3707f CB |
14673 | rm -f core conftest.err conftest.$ac_objext \ |
14674 | conftest$ac_exeext conftest.$ac_ext | |
14675 | LIBS=$ac_check_lib_save_LIBS | |
6ec2e0f5 | 14676 | fi |
5df4cba6 SM |
14677 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 |
14678 | $as_echo "$ac_cv_lib_rt_sched_yield" >&6; } | |
14679 | if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : | |
14680 | LIB_SCHED_YIELD=-lrt | |
14681 | else | |
14682 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5 | |
14683 | $as_echo_n "checking for sched_yield in -lposix4... " >&6; } | |
14684 | if ${ac_cv_lib_posix4_sched_yield+:} false; then : | |
6ec2e0f5 SDJ |
14685 | $as_echo_n "(cached) " >&6 |
14686 | else | |
c0c3707f | 14687 | ac_check_lib_save_LIBS=$LIBS |
5df4cba6 | 14688 | LIBS="-lposix4 $LIBS" |
c0c3707f | 14689 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6ec2e0f5 SDJ |
14690 | /* end confdefs.h. */ |
14691 | ||
c0c3707f CB |
14692 | /* Override any GCC internal prototype to avoid an error. |
14693 | Use char because int might match the return type of a GCC | |
14694 | builtin and then its argument prototype would still apply. */ | |
14695 | #ifdef __cplusplus | |
14696 | extern "C" | |
14697 | #endif | |
5df4cba6 | 14698 | char sched_yield (); |
6ec2e0f5 SDJ |
14699 | int |
14700 | main () | |
14701 | { | |
5df4cba6 | 14702 | return sched_yield (); |
c0c3707f CB |
14703 | ; |
14704 | return 0; | |
14705 | } | |
14706 | _ACEOF | |
14707 | if ac_fn_c_try_link "$LINENO"; then : | |
5df4cba6 | 14708 | ac_cv_lib_posix4_sched_yield=yes |
c0c3707f | 14709 | else |
5df4cba6 | 14710 | ac_cv_lib_posix4_sched_yield=no |
c0c3707f CB |
14711 | fi |
14712 | rm -f core conftest.err conftest.$ac_objext \ | |
14713 | conftest$ac_exeext conftest.$ac_ext | |
14714 | LIBS=$ac_check_lib_save_LIBS | |
14715 | fi | |
5df4cba6 SM |
14716 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5 |
14717 | $as_echo "$ac_cv_lib_posix4_sched_yield" >&6; } | |
14718 | if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then : | |
14719 | LIB_SCHED_YIELD=-lposix4 | |
c0c3707f | 14720 | fi |
6ec2e0f5 | 14721 | |
5df4cba6 SM |
14722 | fi |
14723 | ||
14724 | ||
14725 | fi | |
14726 | rm -f core conftest.err conftest.$ac_objext \ | |
14727 | conftest$ac_exeext conftest.$ac_ext | |
14728 | ||
14729 | ||
14730 | gl_pthreadlib_body_done=done | |
14731 | fi | |
14732 | ||
14733 | if test $ac_cv_header_threads_h = yes; then | |
14734 | for ac_func in thrd_create | |
14735 | do : | |
14736 | ac_fn_c_check_func "$LINENO" "thrd_create" "ac_cv_func_thrd_create" | |
14737 | if test "x$ac_cv_func_thrd_create" = xyes; then : | |
14738 | cat >>confdefs.h <<_ACEOF | |
14739 | #define HAVE_THRD_CREATE 1 | |
14740 | _ACEOF | |
14741 | ||
14742 | fi | |
14743 | done | |
14744 | ||
14745 | if test $ac_cv_func_thrd_create = yes; then | |
14746 | LIBSTDTHREAD= | |
14747 | else | |
14748 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thrd_create in -lstdthreads" >&5 | |
14749 | $as_echo_n "checking for thrd_create in -lstdthreads... " >&6; } | |
14750 | if ${ac_cv_lib_stdthreads_thrd_create+:} false; then : | |
c0c3707f CB |
14751 | $as_echo_n "(cached) " >&6 |
14752 | else | |
14753 | ac_check_lib_save_LIBS=$LIBS | |
5df4cba6 | 14754 | LIBS="-lstdthreads $LIBS" |
c0c3707f CB |
14755 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
14756 | /* end confdefs.h. */ | |
6ec2e0f5 | 14757 | |
c0c3707f CB |
14758 | /* Override any GCC internal prototype to avoid an error. |
14759 | Use char because int might match the return type of a GCC | |
14760 | builtin and then its argument prototype would still apply. */ | |
14761 | #ifdef __cplusplus | |
14762 | extern "C" | |
14763 | #endif | |
5df4cba6 | 14764 | char thrd_create (); |
c0c3707f CB |
14765 | int |
14766 | main () | |
14767 | { | |
5df4cba6 | 14768 | return thrd_create (); |
6ec2e0f5 SDJ |
14769 | ; |
14770 | return 0; | |
14771 | } | |
14772 | _ACEOF | |
c0c3707f | 14773 | if ac_fn_c_try_link "$LINENO"; then : |
5df4cba6 | 14774 | ac_cv_lib_stdthreads_thrd_create=yes |
6ec2e0f5 | 14775 | else |
5df4cba6 | 14776 | ac_cv_lib_stdthreads_thrd_create=no |
6ec2e0f5 | 14777 | fi |
c0c3707f CB |
14778 | rm -f core conftest.err conftest.$ac_objext \ |
14779 | conftest$ac_exeext conftest.$ac_ext | |
14780 | LIBS=$ac_check_lib_save_LIBS | |
14781 | fi | |
5df4cba6 SM |
14782 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdthreads_thrd_create" >&5 |
14783 | $as_echo "$ac_cv_lib_stdthreads_thrd_create" >&6; } | |
14784 | if test "x$ac_cv_lib_stdthreads_thrd_create" = xyes; then : | |
6ec2e0f5 | 14785 | |
5df4cba6 | 14786 | LIBSTDTHREAD='-lstdthreads -lpthread' |
6ec2e0f5 | 14787 | |
5df4cba6 | 14788 | else |
6ec2e0f5 | 14789 | |
5df4cba6 | 14790 | LIBSTDTHREAD="$LIBPMULTITHREAD" |
6ec2e0f5 | 14791 | |
5df4cba6 | 14792 | fi |
6ec2e0f5 | 14793 | |
5df4cba6 | 14794 | fi |
c0c3707f | 14795 | else |
5df4cba6 SM |
14796 | LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD" |
14797 | fi | |
14798 | ;; | |
14799 | esac | |
c0c3707f | 14800 | |
c0c3707f | 14801 | |
5df4cba6 SM |
14802 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ISO C threads API is available" >&5 |
14803 | $as_echo_n "checking whether ISO C threads API is available... " >&6; } | |
14804 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_threads_h" >&5 | |
14805 | $as_echo "$ac_cv_header_threads_h" >&6; } | |
14806 | gl_stdthreadlib_body_done=done | |
14807 | fi | |
c0c3707f | 14808 | |
5df4cba6 SM |
14809 | LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD |
14810 | LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD | |
c0c3707f CB |
14811 | gl_threads_api=isoc |
14812 | ||
14813 | $as_echo "#define USE_ISOC_THREADS 1" >>confdefs.h | |
14814 | ||
14815 | fi | |
14816 | fi | |
14817 | if test $gl_threads_api = none; then | |
14818 | case "$gl_use_threads" in | |
14819 | yes | windows | win32) # The 'win32' is for backward compatibility. | |
14820 | if { case "$host_os" in | |
14821 | mingw*) true;; | |
14822 | *) false;; | |
14823 | esac | |
14824 | }; then | |
14825 | gl_threads_api=windows | |
14826 | ||
14827 | $as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h | |
14828 | ||
14829 | fi | |
14830 | ;; | |
14831 | esac | |
14832 | fi | |
14833 | fi | |
14834 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5 | |
14835 | $as_echo_n "checking for multithread API to use... " >&6; } | |
14836 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5 | |
14837 | $as_echo "$gl_threads_api" >&6; } | |
14838 | ||
14839 | ||
14840 | ||
14841 | ||
14842 | ||
14843 | ||
14844 | ||
14845 | ||
14846 | ||
14847 | ||
14848 | ||
14849 | ||
14850 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5 | |
14851 | $as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } | |
14852 | if ${gl_cv_func_malloc_posix+:} false; then : | |
6ec2e0f5 SDJ |
14853 | $as_echo_n "(cached) " >&6 |
14854 | else | |
c0c3707f CB |
14855 | |
14856 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 14857 | /* end confdefs.h. */ |
c0c3707f | 14858 | |
6ec2e0f5 SDJ |
14859 | int |
14860 | main () | |
14861 | { | |
c0c3707f CB |
14862 | #if defined _WIN32 && ! defined __CYGWIN__ |
14863 | choke me | |
14864 | #endif | |
6ec2e0f5 SDJ |
14865 | |
14866 | ; | |
14867 | return 0; | |
14868 | } | |
14869 | _ACEOF | |
14870 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 14871 | gl_cv_func_malloc_posix=yes |
6ec2e0f5 | 14872 | else |
c0c3707f | 14873 | gl_cv_func_malloc_posix=no |
6ec2e0f5 SDJ |
14874 | fi |
14875 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
472fa5ee | 14876 | |
c0c3707f CB |
14877 | fi |
14878 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5 | |
14879 | $as_echo "$gl_cv_func_malloc_posix" >&6; } | |
472fa5ee SM |
14880 | |
14881 | ||
6ec2e0f5 | 14882 | |
9c9d63b1 | 14883 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 |
c0c3707f CB |
14884 | $as_echo_n "checking for GNU libc compatible malloc... " >&6; } |
14885 | if ${ac_cv_func_malloc_0_nonnull+:} false; then : | |
6ec2e0f5 SDJ |
14886 | $as_echo_n "(cached) " >&6 |
14887 | else | |
14888 | if test "$cross_compiling" = yes; then : | |
14889 | case "$host_os" in | |
c0c3707f CB |
14890 | # Guess yes on platforms where we know the result. |
14891 | *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \ | |
14892 | | hpux* | solaris* | cygwin* | mingw*) | |
14893 | ac_cv_func_malloc_0_nonnull="guessing yes" ;; | |
14894 | # If we don't know, obey --enable-cross-guesses. | |
14895 | *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;; | |
14896 | esac | |
6ec2e0f5 SDJ |
14897 | |
14898 | else | |
14899 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14900 | /* end confdefs.h. */ | |
9c9d63b1 | 14901 | #include <stdlib.h> |
6ec2e0f5 SDJ |
14902 | |
14903 | int | |
14904 | main () | |
14905 | { | |
c0c3707f CB |
14906 | char *p = malloc (0); |
14907 | int result = !p; | |
14908 | free (p); | |
14909 | return result; | |
6ec2e0f5 SDJ |
14910 | ; |
14911 | return 0; | |
698be2d8 CB |
14912 | } |
14913 | ||
14914 | _ACEOF | |
14915 | if ac_fn_c_try_run "$LINENO"; then : | |
14916 | ac_cv_func_malloc_0_nonnull=yes | |
14917 | else | |
14918 | ac_cv_func_malloc_0_nonnull=no | |
14919 | fi | |
14920 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
14921 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
14922 | fi | |
14923 | ||
14924 | ||
14925 | fi | |
14926 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 | |
14927 | $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } | |
14928 | case "$ac_cv_func_malloc_0_nonnull" in | |
14929 | *yes) | |
14930 | gl_cv_func_malloc_0_nonnull=1 | |
14931 | ;; | |
14932 | *) | |
14933 | gl_cv_func_malloc_0_nonnull=0 | |
14934 | ;; | |
14935 | esac | |
14936 | ||
14937 | ||
14938 | cat >>confdefs.h <<_ACEOF | |
14939 | #define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull | |
14940 | _ACEOF | |
14941 | ||
14942 | ||
14943 | ||
c0c3707f CB |
14944 | |
14945 | ||
6ec2e0f5 SDJ |
14946 | |
14947 | ||
14948 | ||
14949 | ||
14950 | ||
14951 | ||
c0c3707f CB |
14952 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 |
14953 | $as_echo_n "checking for a traditional japanese locale... " >&6; } | |
14954 | if ${gt_cv_locale_ja+:} false; then : | |
14955 | $as_echo_n "(cached) " >&6 | |
14956 | else | |
14957 | ||
14958 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14959 | /* end confdefs.h. */ | |
6ec2e0f5 | 14960 | |
c0c3707f CB |
14961 | #include <locale.h> |
14962 | #include <time.h> | |
14963 | #if HAVE_LANGINFO_CODESET | |
14964 | # include <langinfo.h> | |
14965 | #endif | |
14966 | #include <stdlib.h> | |
14967 | #include <string.h> | |
14968 | struct tm t; | |
14969 | char buf[16]; | |
14970 | int main () | |
14971 | { | |
14972 | /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl | |
14973 | imitates locale dependent behaviour by looking at the environment | |
14974 | variables, and all locales use the UTF-8 encoding. */ | |
14975 | #if defined __BEOS__ || defined __HAIKU__ | |
14976 | return 1; | |
14977 | #else | |
14978 | /* Check whether the given locale name is recognized by the system. */ | |
14979 | # if defined _WIN32 && !defined __CYGWIN__ | |
14980 | /* On native Windows, setlocale(category, "") looks at the system settings, | |
14981 | not at the environment variables. Also, when an encoding suffix such | |
14982 | as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE | |
14983 | category of the locale to "C". */ | |
14984 | if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL | |
14985 | || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) | |
14986 | return 1; | |
14987 | # else | |
14988 | if (setlocale (LC_ALL, "") == NULL) return 1; | |
14989 | # endif | |
14990 | /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". | |
14991 | On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) | |
14992 | is empty, and the behaviour of Tcl 8.4 in this locale is not useful. | |
14993 | On OpenBSD 4.0, when an unsupported locale is specified, setlocale() | |
14994 | succeeds but then nl_langinfo(CODESET) is "646". In this situation, | |
14995 | some unit tests fail. | |
14996 | On MirBSD 10, when an unsupported locale is specified, setlocale() | |
14997 | succeeds but then nl_langinfo(CODESET) is "UTF-8". */ | |
14998 | # if HAVE_LANGINFO_CODESET | |
14999 | { | |
15000 | const char *cs = nl_langinfo (CODESET); | |
15001 | if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 | |
15002 | || strcmp (cs, "UTF-8") == 0) | |
15003 | return 1; | |
15004 | } | |
15005 | # endif | |
15006 | # ifdef __CYGWIN__ | |
15007 | /* On Cygwin, avoid locale names without encoding suffix, because the | |
15008 | locale_charset() function relies on the encoding suffix. Note that | |
15009 | LC_ALL is set on the command line. */ | |
15010 | if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; | |
15011 | # endif | |
15012 | /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales | |
15013 | on Cygwin 1.5.x. */ | |
15014 | if (MB_CUR_MAX == 1) | |
15015 | return 1; | |
15016 | /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. | |
15017 | This excludes the UTF-8 encoding (except on MirBSD). */ | |
15018 | { | |
15019 | const char *p; | |
15020 | t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; | |
15021 | if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; | |
15022 | for (p = buf; *p != '\0'; p++) | |
15023 | if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) | |
15024 | return 1; | |
15025 | } | |
15026 | return 0; | |
15027 | #endif | |
15028 | } | |
6ec2e0f5 | 15029 | |
c0c3707f CB |
15030 | _ACEOF |
15031 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 | |
15032 | (eval $ac_link) 2>&5 | |
15033 | ac_status=$? | |
15034 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
15035 | test $ac_status = 0; } && test -s conftest$ac_exeext; then | |
15036 | case "$host_os" in | |
15037 | # Handle native Windows specially, because there setlocale() interprets | |
15038 | # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", | |
15039 | # "fr" or "fra" as "French" or "French_France.1252", | |
15040 | # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", | |
15041 | # "ja" as "Japanese" or "Japanese_Japan.932", | |
15042 | # and similar. | |
15043 | mingw*) | |
15044 | # Note that on native Windows, the Japanese locale is | |
15045 | # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we | |
15046 | # cannot use it here. | |
15047 | gt_cv_locale_ja=none | |
15048 | ;; | |
15049 | *) | |
15050 | # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because | |
15051 | # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the | |
15052 | # configure script would override the LC_ALL setting. Likewise for | |
15053 | # LC_CTYPE, which is also set at the beginning of the configure script. | |
15054 | # Test for the AIX locale name. | |
15055 | if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15056 | gt_cv_locale_ja=ja_JP | |
15057 | else | |
15058 | # Test for the locale name with explicit encoding suffix. | |
15059 | if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15060 | gt_cv_locale_ja=ja_JP.EUC-JP | |
15061 | else | |
15062 | # Test for the HP-UX, OSF/1, NetBSD locale name. | |
15063 | if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15064 | gt_cv_locale_ja=ja_JP.eucJP | |
15065 | else | |
15066 | # Test for the IRIX, FreeBSD locale name. | |
15067 | if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15068 | gt_cv_locale_ja=ja_JP.EUC | |
15069 | else | |
15070 | # Test for the Solaris 7 locale name. | |
15071 | if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15072 | gt_cv_locale_ja=ja | |
15073 | else | |
15074 | # Special test for NetBSD 1.6. | |
15075 | if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then | |
15076 | gt_cv_locale_ja=ja_JP.eucJP | |
15077 | else | |
15078 | # None found. | |
15079 | gt_cv_locale_ja=none | |
15080 | fi | |
15081 | fi | |
15082 | fi | |
15083 | fi | |
15084 | fi | |
15085 | fi | |
15086 | ;; | |
15087 | esac | |
15088 | fi | |
15089 | rm -fr conftest* | |
5abebf3c CB |
15090 | |
15091 | fi | |
c0c3707f CB |
15092 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 |
15093 | $as_echo "$gt_cv_locale_ja" >&6; } | |
15094 | LOCALE_JA=$gt_cv_locale_ja | |
5abebf3c | 15095 | |
5abebf3c | 15096 | |
5abebf3c | 15097 | |
5abebf3c | 15098 | |
c0c3707f CB |
15099 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 |
15100 | $as_echo_n "checking for a french Unicode locale... " >&6; } | |
15101 | if ${gt_cv_locale_fr_utf8+:} false; then : | |
5abebf3c CB |
15102 | $as_echo_n "(cached) " >&6 |
15103 | else | |
5abebf3c | 15104 | |
c0c3707f | 15105 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5abebf3c | 15106 | /* end confdefs.h. */ |
5abebf3c | 15107 | |
c0c3707f CB |
15108 | #include <locale.h> |
15109 | #include <time.h> | |
15110 | #if HAVE_LANGINFO_CODESET | |
15111 | # include <langinfo.h> | |
15112 | #endif | |
15113 | #include <stdlib.h> | |
15114 | #include <string.h> | |
15115 | struct tm t; | |
15116 | char buf[16]; | |
15117 | int main () { | |
15118 | /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl | |
15119 | imitates locale dependent behaviour by looking at the environment | |
15120 | variables, and all locales use the UTF-8 encoding. */ | |
15121 | #if !(defined __BEOS__ || defined __HAIKU__) | |
15122 | /* Check whether the given locale name is recognized by the system. */ | |
15123 | # if defined _WIN32 && !defined __CYGWIN__ | |
15124 | /* On native Windows, setlocale(category, "") looks at the system settings, | |
15125 | not at the environment variables. Also, when an encoding suffix such | |
15126 | as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE | |
15127 | category of the locale to "C". */ | |
15128 | if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL | |
15129 | || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) | |
15130 | return 1; | |
15131 | # else | |
15132 | if (setlocale (LC_ALL, "") == NULL) return 1; | |
15133 | # endif | |
15134 | /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". | |
15135 | On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) | |
15136 | is empty, and the behaviour of Tcl 8.4 in this locale is not useful. | |
15137 | On OpenBSD 4.0, when an unsupported locale is specified, setlocale() | |
15138 | succeeds but then nl_langinfo(CODESET) is "646". In this situation, | |
15139 | some unit tests fail. */ | |
15140 | # if HAVE_LANGINFO_CODESET | |
15141 | { | |
15142 | const char *cs = nl_langinfo (CODESET); | |
15143 | if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) | |
15144 | return 1; | |
15145 | } | |
15146 | # endif | |
15147 | # ifdef __CYGWIN__ | |
15148 | /* On Cygwin, avoid locale names without encoding suffix, because the | |
15149 | locale_charset() function relies on the encoding suffix. Note that | |
15150 | LC_ALL is set on the command line. */ | |
15151 | if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; | |
15152 | # endif | |
15153 | /* Check whether in the abbreviation of the second month, the second | |
15154 | character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is | |
15155 | two bytes long, with UTF-8 encoding. */ | |
15156 | t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; | |
15157 | if (strftime (buf, sizeof (buf), "%b", &t) < 4 | |
15158 | || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') | |
15159 | return 1; | |
15160 | #endif | |
15161 | #if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ | |
15162 | /* Check whether the decimal separator is a comma. | |
15163 | On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point | |
15164 | are nl_langinfo(RADIXCHAR) are both ".". */ | |
15165 | if (localeconv () ->decimal_point[0] != ',') return 1; | |
15166 | #endif | |
5abebf3c CB |
15167 | return 0; |
15168 | } | |
5abebf3c | 15169 | |
c0c3707f CB |
15170 | _ACEOF |
15171 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 | |
15172 | (eval $ac_link) 2>&5 | |
15173 | ac_status=$? | |
15174 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
15175 | test $ac_status = 0; } && test -s conftest$ac_exeext; then | |
15176 | case "$host_os" in | |
15177 | # Handle native Windows specially, because there setlocale() interprets | |
15178 | # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", | |
15179 | # "fr" or "fra" as "French" or "French_France.1252", | |
15180 | # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", | |
15181 | # "ja" as "Japanese" or "Japanese_Japan.932", | |
15182 | # and similar. | |
15183 | mingw*) | |
15184 | # Test for the hypothetical native Windows locale name. | |
15185 | if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15186 | gt_cv_locale_fr_utf8=French_France.65001 | |
15187 | else | |
15188 | # None found. | |
15189 | gt_cv_locale_fr_utf8=none | |
15190 | fi | |
15191 | ;; | |
15192 | *) | |
15193 | # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because | |
15194 | # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the | |
15195 | # configure script would override the LC_ALL setting. Likewise for | |
15196 | # LC_CTYPE, which is also set at the beginning of the configure script. | |
15197 | # Test for the usual locale name. | |
15198 | if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15199 | gt_cv_locale_fr_utf8=fr_FR | |
15200 | else | |
15201 | # Test for the locale name with explicit encoding suffix. | |
15202 | if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15203 | gt_cv_locale_fr_utf8=fr_FR.UTF-8 | |
15204 | else | |
15205 | # Test for the Solaris 7 locale name. | |
15206 | if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15207 | gt_cv_locale_fr_utf8=fr.UTF-8 | |
15208 | else | |
15209 | # None found. | |
15210 | gt_cv_locale_fr_utf8=none | |
15211 | fi | |
15212 | fi | |
15213 | fi | |
15214 | ;; | |
15215 | esac | |
15216 | fi | |
15217 | rm -fr conftest* | |
5abebf3c CB |
15218 | |
15219 | fi | |
c0c3707f CB |
15220 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 |
15221 | $as_echo "$gt_cv_locale_fr_utf8" >&6; } | |
15222 | LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 | |
5abebf3c CB |
15223 | |
15224 | ||
15225 | ||
15226 | ||
15227 | ||
c0c3707f CB |
15228 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 |
15229 | $as_echo_n "checking for a transitional chinese locale... " >&6; } | |
15230 | if ${gt_cv_locale_zh_CN+:} false; then : | |
5abebf3c CB |
15231 | $as_echo_n "(cached) " >&6 |
15232 | else | |
5abebf3c | 15233 | |
c0c3707f | 15234 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5abebf3c | 15235 | /* end confdefs.h. */ |
5abebf3c | 15236 | |
c0c3707f CB |
15237 | #include <locale.h> |
15238 | #include <stdlib.h> | |
15239 | #include <time.h> | |
15240 | #if HAVE_LANGINFO_CODESET | |
15241 | # include <langinfo.h> | |
15242 | #endif | |
15243 | #include <stdlib.h> | |
15244 | #include <string.h> | |
15245 | struct tm t; | |
15246 | char buf[16]; | |
15247 | int main () | |
5abebf3c | 15248 | { |
c0c3707f CB |
15249 | /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl |
15250 | imitates locale dependent behaviour by looking at the environment | |
15251 | variables, and all locales use the UTF-8 encoding. */ | |
15252 | #if defined __BEOS__ || defined __HAIKU__ | |
15253 | return 1; | |
15254 | #else | |
15255 | /* Check whether the given locale name is recognized by the system. */ | |
15256 | # if defined _WIN32 && !defined __CYGWIN__ | |
15257 | /* On native Windows, setlocale(category, "") looks at the system settings, | |
15258 | not at the environment variables. Also, when an encoding suffix such | |
15259 | as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE | |
15260 | category of the locale to "C". */ | |
15261 | if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL | |
15262 | || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) | |
15263 | return 1; | |
15264 | # else | |
15265 | if (setlocale (LC_ALL, "") == NULL) return 1; | |
15266 | # endif | |
15267 | /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". | |
15268 | On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) | |
15269 | is empty, and the behaviour of Tcl 8.4 in this locale is not useful. | |
15270 | On OpenBSD 4.0, when an unsupported locale is specified, setlocale() | |
15271 | succeeds but then nl_langinfo(CODESET) is "646". In this situation, | |
15272 | some unit tests fail. | |
15273 | On MirBSD 10, when an unsupported locale is specified, setlocale() | |
15274 | succeeds but then nl_langinfo(CODESET) is "UTF-8". */ | |
15275 | # if HAVE_LANGINFO_CODESET | |
15276 | { | |
15277 | const char *cs = nl_langinfo (CODESET); | |
15278 | if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 | |
15279 | || strcmp (cs, "UTF-8") == 0) | |
15280 | return 1; | |
15281 | } | |
15282 | # endif | |
15283 | # ifdef __CYGWIN__ | |
15284 | /* On Cygwin, avoid locale names without encoding suffix, because the | |
15285 | locale_charset() function relies on the encoding suffix. Note that | |
15286 | LC_ALL is set on the command line. */ | |
15287 | if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; | |
15288 | # endif | |
15289 | /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. | |
15290 | This excludes the UTF-8 encoding (except on MirBSD). */ | |
15291 | { | |
15292 | const char *p; | |
15293 | t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; | |
15294 | if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; | |
15295 | for (p = buf; *p != '\0'; p++) | |
15296 | if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) | |
15297 | return 1; | |
15298 | } | |
15299 | /* Check whether a typical GB18030 multibyte sequence is recognized as a | |
15300 | single wide character. This excludes the GB2312 and GBK encodings. */ | |
15301 | if (mblen ("\203\062\332\066", 5) != 4) | |
15302 | return 1; | |
5abebf3c | 15303 | return 0; |
c0c3707f | 15304 | #endif |
5abebf3c | 15305 | } |
c0c3707f | 15306 | |
5abebf3c | 15307 | _ACEOF |
c0c3707f CB |
15308 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 |
15309 | (eval $ac_link) 2>&5 | |
15310 | ac_status=$? | |
15311 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
15312 | test $ac_status = 0; } && test -s conftest$ac_exeext; then | |
15313 | case "$host_os" in | |
15314 | # Handle native Windows specially, because there setlocale() interprets | |
15315 | # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", | |
15316 | # "fr" or "fra" as "French" or "French_France.1252", | |
15317 | # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", | |
15318 | # "ja" as "Japanese" or "Japanese_Japan.932", | |
15319 | # and similar. | |
15320 | mingw*) | |
15321 | # Test for the hypothetical native Windows locale name. | |
15322 | if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15323 | gt_cv_locale_zh_CN=Chinese_China.54936 | |
15324 | else | |
15325 | # None found. | |
15326 | gt_cv_locale_zh_CN=none | |
15327 | fi | |
15328 | ;; | |
15329 | solaris2.8) | |
15330 | # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are | |
15331 | # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. | |
15332 | # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. | |
15333 | gt_cv_locale_zh_CN=none | |
15334 | ;; | |
15335 | *) | |
15336 | # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because | |
15337 | # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the | |
15338 | # configure script would override the LC_ALL setting. Likewise for | |
15339 | # LC_CTYPE, which is also set at the beginning of the configure script. | |
15340 | # Test for the locale name without encoding suffix. | |
15341 | if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15342 | gt_cv_locale_zh_CN=zh_CN | |
15343 | else | |
15344 | # Test for the locale name with explicit encoding suffix. | |
15345 | if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15346 | gt_cv_locale_zh_CN=zh_CN.GB18030 | |
15347 | else | |
15348 | # None found. | |
15349 | gt_cv_locale_zh_CN=none | |
15350 | fi | |
15351 | fi | |
15352 | ;; | |
15353 | esac | |
15354 | else | |
15355 | # If there was a link error, due to mblen(), the system is so old that | |
15356 | # it certainly doesn't have a chinese locale. | |
15357 | gt_cv_locale_zh_CN=none | |
15358 | fi | |
15359 | rm -fr conftest* | |
15360 | ||
5abebf3c | 15361 | fi |
c0c3707f CB |
15362 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 |
15363 | $as_echo "$gt_cv_locale_zh_CN" >&6; } | |
15364 | LOCALE_ZH_CN=$gt_cv_locale_zh_CN | |
15365 | ||
15366 | ||
15367 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 | |
15368 | $as_echo_n "checking for inline... " >&6; } | |
15369 | if ${ac_cv_c_inline+:} false; then : | |
15370 | $as_echo_n "(cached) " >&6 | |
15371 | else | |
15372 | ac_cv_c_inline=no | |
15373 | for ac_kw in inline __inline__ __inline; do | |
15374 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15375 | /* end confdefs.h. */ | |
15376 | #ifndef __cplusplus | |
15377 | typedef int foo_t; | |
15378 | static $ac_kw foo_t static_foo () {return 0; } | |
15379 | $ac_kw foo_t foo () {return 0; } | |
15380 | #endif | |
5abebf3c | 15381 | |
c0c3707f CB |
15382 | _ACEOF |
15383 | if ac_fn_c_try_compile "$LINENO"; then : | |
15384 | ac_cv_c_inline=$ac_kw | |
15385 | fi | |
15386 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
15387 | test "$ac_cv_c_inline" != no && break | |
15388 | done | |
5abebf3c CB |
15389 | |
15390 | fi | |
c0c3707f CB |
15391 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 |
15392 | $as_echo "$ac_cv_c_inline" >&6; } | |
5abebf3c | 15393 | |
c0c3707f CB |
15394 | case $ac_cv_c_inline in |
15395 | inline | yes) ;; | |
15396 | *) | |
15397 | case $ac_cv_c_inline in | |
15398 | no) ac_val=;; | |
15399 | *) ac_val=$ac_cv_c_inline;; | |
15400 | esac | |
15401 | cat >>confdefs.h <<_ACEOF | |
15402 | #ifndef __cplusplus | |
15403 | #define inline $ac_val | |
15404 | #endif | |
15405 | _ACEOF | |
15406 | ;; | |
15407 | esac | |
5abebf3c CB |
15408 | |
15409 | ||
15410 | ||
15411 | ||
5abebf3c CB |
15412 | |
15413 | ||
c0c3707f CB |
15414 | GNULIB_EXPLICIT_BZERO=0; |
15415 | GNULIB_FFSL=0; | |
15416 | GNULIB_FFSLL=0; | |
15417 | GNULIB_MEMCHR=0; | |
15418 | GNULIB_MEMMEM=0; | |
15419 | GNULIB_MEMPCPY=0; | |
15420 | GNULIB_MEMRCHR=0; | |
15421 | GNULIB_RAWMEMCHR=0; | |
15422 | GNULIB_STPCPY=0; | |
15423 | GNULIB_STPNCPY=0; | |
15424 | GNULIB_STRCHRNUL=0; | |
15425 | GNULIB_STRDUP=0; | |
15426 | GNULIB_STRNCAT=0; | |
15427 | GNULIB_STRNDUP=0; | |
15428 | GNULIB_STRNLEN=0; | |
15429 | GNULIB_STRPBRK=0; | |
15430 | GNULIB_STRSEP=0; | |
15431 | GNULIB_STRSTR=0; | |
15432 | GNULIB_STRCASESTR=0; | |
15433 | GNULIB_STRTOK_R=0; | |
15434 | GNULIB_MBSLEN=0; | |
15435 | GNULIB_MBSNLEN=0; | |
15436 | GNULIB_MBSCHR=0; | |
15437 | GNULIB_MBSRCHR=0; | |
15438 | GNULIB_MBSSTR=0; | |
15439 | GNULIB_MBSCASECMP=0; | |
15440 | GNULIB_MBSNCASECMP=0; | |
15441 | GNULIB_MBSPCASECMP=0; | |
15442 | GNULIB_MBSCASESTR=0; | |
15443 | GNULIB_MBSCSPN=0; | |
15444 | GNULIB_MBSPBRK=0; | |
15445 | GNULIB_MBSSPN=0; | |
15446 | GNULIB_MBSSEP=0; | |
15447 | GNULIB_MBSTOK_R=0; | |
15448 | GNULIB_STRERROR=0; | |
15449 | GNULIB_STRERROR_R=0; | |
9c9d63b1 PM |
15450 | GNULIB_STRERRORNAME_NP=0; |
15451 | GNULIB_SIGABBREV_NP=0; | |
15452 | GNULIB_SIGDESCR_NP=0; | |
c0c3707f CB |
15453 | GNULIB_STRSIGNAL=0; |
15454 | GNULIB_STRVERSCMP=0; | |
15455 | HAVE_MBSLEN=0; | |
9c9d63b1 PM |
15456 | GNULIB_MDA_MEMCCPY=1; |
15457 | GNULIB_MDA_STRDUP=1; | |
c0c3707f CB |
15458 | HAVE_EXPLICIT_BZERO=1; |
15459 | HAVE_FFSL=1; | |
15460 | HAVE_FFSLL=1; | |
c0c3707f CB |
15461 | HAVE_DECL_MEMMEM=1; |
15462 | HAVE_MEMPCPY=1; | |
15463 | HAVE_DECL_MEMRCHR=1; | |
15464 | HAVE_RAWMEMCHR=1; | |
15465 | HAVE_STPCPY=1; | |
15466 | HAVE_STPNCPY=1; | |
15467 | HAVE_STRCHRNUL=1; | |
15468 | HAVE_DECL_STRDUP=1; | |
15469 | HAVE_DECL_STRNDUP=1; | |
15470 | HAVE_DECL_STRNLEN=1; | |
15471 | HAVE_STRPBRK=1; | |
15472 | HAVE_STRSEP=1; | |
15473 | HAVE_STRCASESTR=1; | |
15474 | HAVE_DECL_STRTOK_R=1; | |
15475 | HAVE_DECL_STRERROR_R=1; | |
9c9d63b1 PM |
15476 | HAVE_STRERRORNAME_NP=1; |
15477 | HAVE_SIGABBREV_NP=1; | |
15478 | HAVE_SIGDESCR_NP=1; | |
c0c3707f CB |
15479 | HAVE_DECL_STRSIGNAL=1; |
15480 | HAVE_STRVERSCMP=1; | |
9c9d63b1 | 15481 | REPLACE_FFSLL=0; |
c0c3707f CB |
15482 | REPLACE_MEMCHR=0; |
15483 | REPLACE_MEMMEM=0; | |
15484 | REPLACE_STPNCPY=0; | |
15485 | REPLACE_STRCHRNUL=0; | |
15486 | REPLACE_STRDUP=0; | |
15487 | REPLACE_STRNCAT=0; | |
15488 | REPLACE_STRNDUP=0; | |
15489 | REPLACE_STRNLEN=0; | |
15490 | REPLACE_STRSTR=0; | |
15491 | REPLACE_STRCASESTR=0; | |
15492 | REPLACE_STRTOK_R=0; | |
15493 | REPLACE_STRERROR=0; | |
15494 | REPLACE_STRERROR_R=0; | |
9c9d63b1 | 15495 | REPLACE_STRERRORNAME_NP=0; |
c0c3707f CB |
15496 | REPLACE_STRSIGNAL=0; |
15497 | UNDEFINE_STRTOK_R=0; | |
5abebf3c CB |
15498 | |
15499 | ||
15500 | ||
15501 | ||
6ec2e0f5 SDJ |
15502 | |
15503 | ||
c0c3707f CB |
15504 | # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it |
15505 | # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is | |
15506 | # irrelevant for anonymous mappings. | |
15507 | ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" | |
15508 | if test "x$ac_cv_func_mmap" = xyes; then : | |
15509 | gl_have_mmap=yes | |
6ec2e0f5 | 15510 | else |
c0c3707f CB |
15511 | gl_have_mmap=no |
15512 | fi | |
6ec2e0f5 SDJ |
15513 | |
15514 | ||
c0c3707f CB |
15515 | # Try to allow MAP_ANONYMOUS. |
15516 | gl_have_mmap_anonymous=no | |
15517 | if test $gl_have_mmap = yes; then | |
15518 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 | |
15519 | $as_echo_n "checking for MAP_ANONYMOUS... " >&6; } | |
15520 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 15521 | /* end confdefs.h. */ |
6ec2e0f5 | 15522 | |
c0c3707f CB |
15523 | #include <sys/mman.h> |
15524 | #ifdef MAP_ANONYMOUS | |
15525 | I cannot identify this map | |
15526 | #endif | |
6ec2e0f5 | 15527 | |
c0c3707f CB |
15528 | _ACEOF |
15529 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
15530 | $EGREP "I cannot identify this map" >/dev/null 2>&1; then : | |
15531 | gl_have_mmap_anonymous=yes | |
6ec2e0f5 | 15532 | fi |
c0c3707f | 15533 | rm -f conftest* |
6ec2e0f5 | 15534 | |
c0c3707f CB |
15535 | if test $gl_have_mmap_anonymous != yes; then |
15536 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15537 | /* end confdefs.h. */ | |
6ec2e0f5 | 15538 | |
c0c3707f CB |
15539 | #include <sys/mman.h> |
15540 | #ifdef MAP_ANON | |
15541 | I cannot identify this map | |
15542 | #endif | |
6ec2e0f5 | 15543 | |
c0c3707f CB |
15544 | _ACEOF |
15545 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
15546 | $EGREP "I cannot identify this map" >/dev/null 2>&1; then : | |
6ec2e0f5 | 15547 | |
c0c3707f | 15548 | $as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h |
5e8754f9 | 15549 | |
c0c3707f | 15550 | gl_have_mmap_anonymous=yes |
5e8754f9 | 15551 | fi |
c0c3707f CB |
15552 | rm -f conftest* |
15553 | ||
15554 | fi | |
15555 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 | |
15556 | $as_echo "$gl_have_mmap_anonymous" >&6; } | |
15557 | if test $gl_have_mmap_anonymous = yes; then | |
6ec2e0f5 | 15558 | |
c0c3707f | 15559 | $as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h |
6ec2e0f5 | 15560 | |
c0c3707f CB |
15561 | fi |
15562 | fi | |
6ec2e0f5 SDJ |
15563 | |
15564 | ||
15565 | ||
15566 | ||
6ec2e0f5 | 15567 | |
9c9d63b1 PM |
15568 | # Detect platform-specific bugs in some versions of glibc: |
15569 | # memchr should not dereference anything with length 0 | |
15570 | # https://bugzilla.redhat.com/show_bug.cgi?id=499689 | |
15571 | # memchr should not dereference overestimated length after a match | |
15572 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 | |
15573 | # https://sourceware.org/bugzilla/show_bug.cgi?id=10162 | |
15574 | # memchr should cast the second argument to 'unsigned char'. | |
15575 | # This bug exists in Android 4.3. | |
15576 | # Assume that memchr works on platforms that lack mprotect. | |
15577 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5 | |
c0c3707f CB |
15578 | $as_echo_n "checking whether memchr works... " >&6; } |
15579 | if ${gl_cv_func_memchr_works+:} false; then : | |
15580 | $as_echo_n "(cached) " >&6 | |
6ec2e0f5 | 15581 | else |
c0c3707f CB |
15582 | if test "$cross_compiling" = yes; then : |
15583 | case "$host_os" in | |
9c9d63b1 PM |
15584 | # Guess no on Android. |
15585 | linux*-android*) gl_cv_func_memchr_works="guessing no" ;; | |
15586 | # Guess yes on native Windows. | |
15587 | mingw*) gl_cv_func_memchr_works="guessing yes" ;; | |
15588 | # If we don't know, obey --enable-cross-guesses. | |
15589 | *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;; | |
15590 | esac | |
6ec2e0f5 SDJ |
15591 | |
15592 | else | |
15593 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15594 | /* end confdefs.h. */ | |
15595 | ||
c0c3707f CB |
15596 | #include <string.h> |
15597 | #if HAVE_SYS_MMAN_H | |
15598 | # include <fcntl.h> | |
15599 | # include <unistd.h> | |
15600 | # include <sys/types.h> | |
15601 | # include <sys/mman.h> | |
15602 | # ifndef MAP_FILE | |
15603 | # define MAP_FILE 0 | |
15604 | # endif | |
15605 | #endif | |
6ec2e0f5 SDJ |
15606 | |
15607 | int | |
15608 | main () | |
15609 | { | |
c0c3707f CB |
15610 | |
15611 | int result = 0; | |
15612 | char *fence = NULL; | |
15613 | #if HAVE_SYS_MMAN_H && HAVE_MPROTECT | |
15614 | # if HAVE_MAP_ANONYMOUS | |
15615 | const int flags = MAP_ANONYMOUS | MAP_PRIVATE; | |
15616 | const int fd = -1; | |
15617 | # else /* !HAVE_MAP_ANONYMOUS */ | |
15618 | const int flags = MAP_FILE | MAP_PRIVATE; | |
15619 | int fd = open ("/dev/zero", O_RDONLY, 0666); | |
15620 | if (fd >= 0) | |
15621 | # endif | |
15622 | { | |
15623 | int pagesize = getpagesize (); | |
15624 | char *two_pages = | |
15625 | (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, | |
15626 | flags, fd, 0); | |
15627 | if (two_pages != (char *)(-1) | |
15628 | && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) | |
15629 | fence = two_pages + pagesize; | |
15630 | } | |
15631 | #endif | |
15632 | if (fence) | |
15633 | { | |
9c9d63b1 | 15634 | /* Test against bugs on glibc systems. */ |
c0c3707f CB |
15635 | if (memchr (fence, 0, 0)) |
15636 | result |= 1; | |
15637 | strcpy (fence - 9, "12345678"); | |
15638 | if (memchr (fence - 9, 0, 79) != fence - 1) | |
15639 | result |= 2; | |
15640 | if (memchr (fence - 1, 0, 3) != fence - 1) | |
15641 | result |= 4; | |
9c9d63b1 PM |
15642 | /* Test against bug on AIX 7.2. */ |
15643 | if (memchr (fence - 4, '6', 16) != fence - 4) | |
15644 | result |= 8; | |
c0c3707f CB |
15645 | } |
15646 | /* Test against bug on Android 4.3. */ | |
15647 | { | |
15648 | char input[3]; | |
15649 | input[0] = 'a'; | |
15650 | input[1] = 'b'; | |
15651 | input[2] = 'c'; | |
15652 | if (memchr (input, 0x789abc00 | 'b', 3) != input + 1) | |
9c9d63b1 | 15653 | result |= 16; |
c0c3707f CB |
15654 | } |
15655 | return result; | |
6ec2e0f5 SDJ |
15656 | |
15657 | ; | |
15658 | return 0; | |
15659 | } | |
15660 | _ACEOF | |
15661 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 15662 | gl_cv_func_memchr_works=yes |
6ec2e0f5 | 15663 | else |
c0c3707f | 15664 | gl_cv_func_memchr_works=no |
6ec2e0f5 SDJ |
15665 | fi |
15666 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
15667 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
15668 | fi | |
15669 | ||
15670 | ||
15671 | fi | |
c0c3707f CB |
15672 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5 |
15673 | $as_echo "$gl_cv_func_memchr_works" >&6; } | |
9c9d63b1 PM |
15674 | case "$gl_cv_func_memchr_works" in |
15675 | *yes) ;; | |
15676 | *) REPLACE_MEMCHR=1 ;; | |
15677 | esac | |
6ec2e0f5 | 15678 | |
c0c3707f CB |
15679 | ac_fn_c_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$ac_includes_default" |
15680 | if test "x$ac_cv_have_decl_memmem" = xyes; then : | |
6ec2e0f5 SDJ |
15681 | ac_have_decl=1 |
15682 | else | |
15683 | ac_have_decl=0 | |
15684 | fi | |
15685 | ||
15686 | cat >>confdefs.h <<_ACEOF | |
c0c3707f | 15687 | #define HAVE_DECL_MEMMEM $ac_have_decl |
6ec2e0f5 SDJ |
15688 | _ACEOF |
15689 | ||
472fa5ee | 15690 | |
6ec2e0f5 SDJ |
15691 | |
15692 | ||
15693 | ||
c0c3707f CB |
15694 | for ac_func in memmem |
15695 | do : | |
15696 | ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem" | |
15697 | if test "x$ac_cv_func_memmem" = xyes; then : | |
15698 | cat >>confdefs.h <<_ACEOF | |
15699 | #define HAVE_MEMMEM 1 | |
15700 | _ACEOF | |
6ec2e0f5 | 15701 | |
c0c3707f CB |
15702 | fi |
15703 | done | |
6ec2e0f5 | 15704 | |
c0c3707f CB |
15705 | if test $ac_cv_func_memmem = yes; then |
15706 | HAVE_MEMMEM=1 | |
15707 | else | |
15708 | HAVE_MEMMEM=0 | |
15709 | fi | |
6ec2e0f5 | 15710 | |
c0c3707f CB |
15711 | if test $ac_cv_have_decl_memmem = no; then |
15712 | HAVE_DECL_MEMMEM=0 | |
15713 | else | |
15714 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5 | |
15715 | $as_echo_n "checking whether memmem works... " >&6; } | |
15716 | if ${gl_cv_func_memmem_works_always+:} false; then : | |
6ec2e0f5 SDJ |
15717 | $as_echo_n "(cached) " >&6 |
15718 | else | |
c0c3707f CB |
15719 | if test "$cross_compiling" = yes; then : |
15720 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 15721 | /* end confdefs.h. */ |
472fa5ee | 15722 | |
c0c3707f CB |
15723 | #ifdef __GNU_LIBRARY__ |
15724 | #include <features.h> | |
15725 | #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \ | |
15726 | || __GLIBC_MINOR__ > 12)) \ | |
15727 | || (__GLIBC__ > 2)) \ | |
15728 | || defined __UCLIBC__ | |
15729 | Lucky user | |
15730 | #endif | |
15731 | #elif defined __CYGWIN__ | |
15732 | #include <cygwin/version.h> | |
15733 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) | |
15734 | Lucky user | |
15735 | #endif | |
15736 | #else | |
15737 | Lucky user | |
15738 | #endif | |
472fa5ee | 15739 | |
c0c3707f CB |
15740 | _ACEOF |
15741 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
15742 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
15743 | gl_cv_func_memmem_works_always="guessing yes" | |
15744 | else | |
15745 | gl_cv_func_memmem_works_always="$gl_cross_guess_normal" | |
15746 | fi | |
15747 | rm -f conftest* | |
472fa5ee SM |
15748 | |
15749 | ||
6ec2e0f5 SDJ |
15750 | else |
15751 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15752 | /* end confdefs.h. */ | |
c0c3707f CB |
15753 | |
15754 | #include <string.h> /* for memmem */ | |
15755 | #define P "_EF_BF_BD" | |
15756 | #define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P | |
15757 | #define NEEDLE P P P P P | |
6ec2e0f5 SDJ |
15758 | |
15759 | int | |
15760 | main () | |
15761 | { | |
c0c3707f | 15762 | |
698be2d8 CB |
15763 | int result = 0; |
15764 | if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE))) | |
15765 | result |= 1; | |
15766 | /* Check for empty needle behavior. */ | |
15767 | { | |
15768 | const char *haystack = "AAA"; | |
15769 | if (memmem (haystack, 3, (const char *) 1, 0) != haystack) | |
15770 | result |= 2; | |
15771 | } | |
15772 | return result; | |
15773 | ||
15774 | ; | |
15775 | return 0; | |
15776 | } | |
15777 | _ACEOF | |
15778 | if ac_fn_c_try_run "$LINENO"; then : | |
15779 | gl_cv_func_memmem_works_always=yes | |
15780 | else | |
15781 | gl_cv_func_memmem_works_always=no | |
15782 | fi | |
15783 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
15784 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
15785 | fi | |
15786 | ||
15787 | ||
15788 | fi | |
15789 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5 | |
15790 | $as_echo "$gl_cv_func_memmem_works_always" >&6; } | |
15791 | case "$gl_cv_func_memmem_works_always" in | |
15792 | *yes) ;; | |
15793 | *) | |
15794 | REPLACE_MEMMEM=1 | |
15795 | ;; | |
15796 | esac | |
15797 | fi | |
15798 | : | |
15799 | ||
15800 | ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default" | |
15801 | if test "x$ac_cv_have_decl_memrchr" = xyes; then : | |
15802 | ac_have_decl=1 | |
15803 | else | |
15804 | ac_have_decl=0 | |
15805 | fi | |
15806 | ||
15807 | cat >>confdefs.h <<_ACEOF | |
15808 | #define HAVE_DECL_MEMRCHR $ac_have_decl | |
15809 | _ACEOF | |
15810 | ||
15811 | ||
15812 | ||
15813 | ||
15814 | ||
15815 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <limits.h> defines MIN and MAX" >&5 | |
15816 | $as_echo_n "checking whether <limits.h> defines MIN and MAX... " >&6; } | |
15817 | if ${gl_cv_minmax_in_limits_h+:} false; then : | |
15818 | $as_echo_n "(cached) " >&6 | |
15819 | else | |
15820 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15821 | /* end confdefs.h. */ | |
15822 | #include <limits.h> | |
15823 | int x = MIN (42, 17); | |
15824 | int | |
15825 | main () | |
15826 | { | |
15827 | ||
15828 | ; | |
15829 | return 0; | |
15830 | } | |
15831 | _ACEOF | |
15832 | if ac_fn_c_try_compile "$LINENO"; then : | |
15833 | gl_cv_minmax_in_limits_h=yes | |
15834 | else | |
15835 | gl_cv_minmax_in_limits_h=no | |
15836 | fi | |
15837 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
15838 | fi | |
15839 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5 | |
15840 | $as_echo "$gl_cv_minmax_in_limits_h" >&6; } | |
15841 | if test $gl_cv_minmax_in_limits_h = yes; then | |
15842 | ||
15843 | $as_echo "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h | |
15844 | ||
15845 | fi | |
15846 | ||
15847 | ||
15848 | ||
15849 | ||
15850 | ||
15851 | ||
15852 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/param.h> defines MIN and MAX" >&5 | |
15853 | $as_echo_n "checking whether <sys/param.h> defines MIN and MAX... " >&6; } | |
15854 | if ${gl_cv_minmax_in_sys_param_h+:} false; then : | |
15855 | $as_echo_n "(cached) " >&6 | |
15856 | else | |
15857 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15858 | /* end confdefs.h. */ | |
15859 | #include <sys/param.h> | |
15860 | int x = MIN (42, 17); | |
15861 | int | |
15862 | main () | |
15863 | { | |
15864 | ||
6ec2e0f5 SDJ |
15865 | ; |
15866 | return 0; | |
15867 | } | |
15868 | _ACEOF | |
698be2d8 CB |
15869 | if ac_fn_c_try_compile "$LINENO"; then : |
15870 | gl_cv_minmax_in_sys_param_h=yes | |
6ec2e0f5 | 15871 | else |
698be2d8 | 15872 | gl_cv_minmax_in_sys_param_h=no |
6ec2e0f5 | 15873 | fi |
698be2d8 | 15874 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
6ec2e0f5 | 15875 | fi |
698be2d8 CB |
15876 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5 |
15877 | $as_echo "$gl_cv_minmax_in_sys_param_h" >&6; } | |
15878 | if test $gl_cv_minmax_in_sys_param_h = yes; then | |
6ec2e0f5 | 15879 | |
698be2d8 | 15880 | $as_echo "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h |
c0c3707f | 15881 | |
c0c3707f | 15882 | fi |
c0c3707f | 15883 | |
c0c3707f | 15884 | |
698be2d8 | 15885 | |
c0c3707f CB |
15886 | |
15887 | ||
15888 | ||
15889 | ||
15890 | ||
15891 | ||
15892 | ||
15893 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5 | |
15894 | $as_echo_n "checking for O_CLOEXEC... " >&6; } | |
15895 | if ${gl_cv_macro_O_CLOEXEC+:} false; then : | |
6ec2e0f5 SDJ |
15896 | $as_echo_n "(cached) " >&6 |
15897 | else | |
15898 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15899 | /* end confdefs.h. */ | |
c0c3707f CB |
15900 | #include <fcntl.h> |
15901 | #ifndef O_CLOEXEC | |
15902 | choke me; | |
15903 | #endif | |
6ec2e0f5 SDJ |
15904 | |
15905 | int | |
15906 | main () | |
15907 | { | |
c0c3707f | 15908 | return O_CLOEXEC; |
6ec2e0f5 SDJ |
15909 | ; |
15910 | return 0; | |
15911 | } | |
15912 | _ACEOF | |
15913 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 15914 | gl_cv_macro_O_CLOEXEC=yes |
6ec2e0f5 | 15915 | else |
c0c3707f | 15916 | gl_cv_macro_O_CLOEXEC=no |
6ec2e0f5 SDJ |
15917 | fi |
15918 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
15919 | fi | |
c0c3707f CB |
15920 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_macro_O_CLOEXEC" >&5 |
15921 | $as_echo "$gl_cv_macro_O_CLOEXEC" >&6; } | |
15922 | ||
15923 | ||
15924 | ||
15925 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5 | |
15926 | $as_echo_n "checking for promoted mode_t type... " >&6; } | |
15927 | if ${gl_cv_promoted_mode_t+:} false; then : | |
6ec2e0f5 SDJ |
15928 | $as_echo_n "(cached) " >&6 |
15929 | else | |
6ec2e0f5 | 15930 | |
c0c3707f CB |
15931 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
15932 | /* end confdefs.h. */ | |
15933 | #include <sys/types.h> | |
6ec2e0f5 SDJ |
15934 | int |
15935 | main () | |
15936 | { | |
c0c3707f | 15937 | typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1]; |
6ec2e0f5 SDJ |
15938 | ; |
15939 | return 0; | |
15940 | } | |
15941 | _ACEOF | |
15942 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 15943 | gl_cv_promoted_mode_t='int' |
6ec2e0f5 | 15944 | else |
c0c3707f | 15945 | gl_cv_promoted_mode_t='mode_t' |
6ec2e0f5 SDJ |
15946 | fi |
15947 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c0c3707f | 15948 | |
6ec2e0f5 | 15949 | fi |
c0c3707f CB |
15950 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5 |
15951 | $as_echo "$gl_cv_promoted_mode_t" >&6; } | |
6ec2e0f5 | 15952 | |
c0c3707f CB |
15953 | cat >>confdefs.h <<_ACEOF |
15954 | #define PROMOTED_MODE_T $gl_cv_promoted_mode_t | |
6ec2e0f5 | 15955 | _ACEOF |
c0c3707f CB |
15956 | |
15957 | ||
15958 | ||
15959 | ||
15960 | ||
9c9d63b1 PM |
15961 | |
15962 | ||
15963 | ||
15964 | ||
c0c3707f CB |
15965 | GNULIB_DPRINTF=0; |
15966 | GNULIB_FCLOSE=0; | |
15967 | GNULIB_FDOPEN=0; | |
15968 | GNULIB_FFLUSH=0; | |
15969 | GNULIB_FGETC=0; | |
15970 | GNULIB_FGETS=0; | |
15971 | GNULIB_FOPEN=0; | |
15972 | GNULIB_FPRINTF=0; | |
15973 | GNULIB_FPRINTF_POSIX=0; | |
15974 | GNULIB_FPURGE=0; | |
15975 | GNULIB_FPUTC=0; | |
15976 | GNULIB_FPUTS=0; | |
15977 | GNULIB_FREAD=0; | |
15978 | GNULIB_FREOPEN=0; | |
15979 | GNULIB_FSCANF=0; | |
15980 | GNULIB_FSEEK=0; | |
15981 | GNULIB_FSEEKO=0; | |
15982 | GNULIB_FTELL=0; | |
15983 | GNULIB_FTELLO=0; | |
15984 | GNULIB_FWRITE=0; | |
15985 | GNULIB_GETC=0; | |
15986 | GNULIB_GETCHAR=0; | |
15987 | GNULIB_GETDELIM=0; | |
15988 | GNULIB_GETLINE=0; | |
15989 | GNULIB_OBSTACK_PRINTF=0; | |
15990 | GNULIB_OBSTACK_PRINTF_POSIX=0; | |
15991 | GNULIB_PCLOSE=0; | |
15992 | GNULIB_PERROR=0; | |
15993 | GNULIB_POPEN=0; | |
15994 | GNULIB_PRINTF=0; | |
15995 | GNULIB_PRINTF_POSIX=0; | |
15996 | GNULIB_PUTC=0; | |
15997 | GNULIB_PUTCHAR=0; | |
15998 | GNULIB_PUTS=0; | |
15999 | GNULIB_REMOVE=0; | |
16000 | GNULIB_RENAME=0; | |
16001 | GNULIB_RENAMEAT=0; | |
16002 | GNULIB_SCANF=0; | |
16003 | GNULIB_SNPRINTF=0; | |
16004 | GNULIB_SPRINTF_POSIX=0; | |
16005 | GNULIB_STDIO_H_NONBLOCKING=0; | |
16006 | GNULIB_STDIO_H_SIGPIPE=0; | |
16007 | GNULIB_TMPFILE=0; | |
16008 | GNULIB_VASPRINTF=0; | |
16009 | GNULIB_VFSCANF=0; | |
16010 | GNULIB_VSCANF=0; | |
16011 | GNULIB_VDPRINTF=0; | |
16012 | GNULIB_VFPRINTF=0; | |
16013 | GNULIB_VFPRINTF_POSIX=0; | |
16014 | GNULIB_VPRINTF=0; | |
16015 | GNULIB_VPRINTF_POSIX=0; | |
16016 | GNULIB_VSNPRINTF=0; | |
16017 | GNULIB_VSPRINTF_POSIX=0; | |
9c9d63b1 PM |
16018 | GNULIB_MDA_FCLOSEALL=1; |
16019 | GNULIB_MDA_FDOPEN=1; | |
16020 | GNULIB_MDA_FILENO=1; | |
16021 | GNULIB_MDA_GETW=1; | |
16022 | GNULIB_MDA_PUTW=1; | |
16023 | GNULIB_MDA_TEMPNAM=1; | |
16024 | HAVE_DECL_FCLOSEALL=1; | |
16025 | HAVE_DECL_FPURGE=1; | |
c0c3707f CB |
16026 | HAVE_DECL_FSEEKO=1; |
16027 | HAVE_DECL_FTELLO=1; | |
16028 | HAVE_DECL_GETDELIM=1; | |
16029 | HAVE_DECL_GETLINE=1; | |
16030 | HAVE_DECL_OBSTACK_PRINTF=1; | |
16031 | HAVE_DECL_SNPRINTF=1; | |
16032 | HAVE_DECL_VSNPRINTF=1; | |
16033 | HAVE_DPRINTF=1; | |
16034 | HAVE_FSEEKO=1; | |
16035 | HAVE_FTELLO=1; | |
16036 | HAVE_PCLOSE=1; | |
16037 | HAVE_POPEN=1; | |
16038 | HAVE_RENAMEAT=1; | |
16039 | HAVE_VASPRINTF=1; | |
16040 | HAVE_VDPRINTF=1; | |
16041 | REPLACE_DPRINTF=0; | |
16042 | REPLACE_FCLOSE=0; | |
16043 | REPLACE_FDOPEN=0; | |
16044 | REPLACE_FFLUSH=0; | |
16045 | REPLACE_FOPEN=0; | |
16046 | REPLACE_FPRINTF=0; | |
16047 | REPLACE_FPURGE=0; | |
16048 | REPLACE_FREOPEN=0; | |
16049 | REPLACE_FSEEK=0; | |
16050 | REPLACE_FSEEKO=0; | |
16051 | REPLACE_FTELL=0; | |
16052 | REPLACE_FTELLO=0; | |
16053 | REPLACE_GETDELIM=0; | |
16054 | REPLACE_GETLINE=0; | |
16055 | REPLACE_OBSTACK_PRINTF=0; | |
16056 | REPLACE_PERROR=0; | |
16057 | REPLACE_POPEN=0; | |
16058 | REPLACE_PRINTF=0; | |
16059 | REPLACE_REMOVE=0; | |
16060 | REPLACE_RENAME=0; | |
16061 | REPLACE_RENAMEAT=0; | |
16062 | REPLACE_SNPRINTF=0; | |
16063 | REPLACE_SPRINTF=0; | |
16064 | REPLACE_STDIO_READ_FUNCS=0; | |
16065 | REPLACE_STDIO_WRITE_FUNCS=0; | |
16066 | REPLACE_TMPFILE=0; | |
16067 | REPLACE_VASPRINTF=0; | |
16068 | REPLACE_VDPRINTF=0; | |
16069 | REPLACE_VFPRINTF=0; | |
16070 | REPLACE_VPRINTF=0; | |
16071 | REPLACE_VSNPRINTF=0; | |
16072 | REPLACE_VSPRINTF=0; | |
16073 | ||
16074 | ||
16075 | ||
16076 | ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default" | |
16077 | if test "x$ac_cv_have_decl_setenv" = xyes; then : | |
16078 | ac_have_decl=1 | |
6ec2e0f5 | 16079 | else |
c0c3707f | 16080 | ac_have_decl=0 |
6ec2e0f5 | 16081 | fi |
c0c3707f CB |
16082 | |
16083 | cat >>confdefs.h <<_ACEOF | |
16084 | #define HAVE_DECL_SETENV $ac_have_decl | |
16085 | _ACEOF | |
16086 | ||
16087 | ||
16088 | ||
16089 | ||
16090 | ||
16091 | ||
16092 | if test $ac_cv_have_decl_setenv = no; then | |
16093 | HAVE_DECL_SETENV=0 | |
6ec2e0f5 SDJ |
16094 | fi |
16095 | ||
16096 | ||
16097 | ||
16098 | ||
16099 | ||
c0c3707f CB |
16100 | for ac_header in search.h |
16101 | do : | |
16102 | ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default" | |
16103 | if test "x$ac_cv_header_search_h" = xyes; then : | |
16104 | cat >>confdefs.h <<_ACEOF | |
16105 | #define HAVE_SEARCH_H 1 | |
16106 | _ACEOF | |
6ec2e0f5 | 16107 | |
c0c3707f | 16108 | fi |
6ec2e0f5 | 16109 | |
c0c3707f | 16110 | done |
6ec2e0f5 | 16111 | |
c0c3707f CB |
16112 | for ac_func in tsearch |
16113 | do : | |
16114 | ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch" | |
16115 | if test "x$ac_cv_func_tsearch" = xyes; then : | |
16116 | cat >>confdefs.h <<_ACEOF | |
16117 | #define HAVE_TSEARCH 1 | |
16118 | _ACEOF | |
6ec2e0f5 | 16119 | |
c0c3707f CB |
16120 | fi |
16121 | done | |
6ec2e0f5 SDJ |
16122 | |
16123 | ||
16124 | ||
16125 | ||
c0c3707f CB |
16126 | GNULIB_PTHREAD_SIGMASK=0; |
16127 | GNULIB_RAISE=0; | |
16128 | GNULIB_SIGNAL_H_SIGPIPE=0; | |
16129 | GNULIB_SIGPROCMASK=0; | |
16130 | GNULIB_SIGACTION=0; | |
16131 | HAVE_POSIX_SIGNALBLOCKING=1; | |
16132 | HAVE_PTHREAD_SIGMASK=1; | |
16133 | HAVE_RAISE=1; | |
16134 | HAVE_SIGSET_T=1; | |
16135 | HAVE_SIGINFO_T=1; | |
16136 | HAVE_SIGACTION=1; | |
16137 | HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; | |
6ec2e0f5 | 16138 | |
c0c3707f | 16139 | HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; |
6ec2e0f5 | 16140 | |
c0c3707f CB |
16141 | HAVE_SIGHANDLER_T=1; |
16142 | REPLACE_PTHREAD_SIGMASK=0; | |
16143 | REPLACE_RAISE=0; | |
6ec2e0f5 | 16144 | |
6ec2e0f5 | 16145 | |
c0c3707f CB |
16146 | ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" " |
16147 | #include <signal.h> | |
16148 | /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */ | |
16149 | #include <sys/types.h> | |
16150 | ||
16151 | " | |
16152 | if test "x$ac_cv_type_sigset_t" = xyes; then : | |
16153 | ||
16154 | cat >>confdefs.h <<_ACEOF | |
16155 | #define HAVE_SIGSET_T 1 | |
16156 | _ACEOF | |
16157 | ||
16158 | gl_cv_type_sigset_t=yes | |
16159 | else | |
16160 | gl_cv_type_sigset_t=no | |
16161 | fi | |
6ec2e0f5 | 16162 | |
c0c3707f CB |
16163 | if test $gl_cv_type_sigset_t != yes; then |
16164 | HAVE_SIGSET_T=0 | |
16165 | fi | |
6ec2e0f5 | 16166 | |
c0c3707f CB |
16167 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 |
16168 | $as_echo_n "checking for uid_t in sys/types.h... " >&6; } | |
16169 | if ${ac_cv_type_uid_t+:} false; then : | |
16170 | $as_echo_n "(cached) " >&6 | |
16171 | else | |
6ec2e0f5 SDJ |
16172 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
16173 | /* end confdefs.h. */ | |
c0c3707f CB |
16174 | #include <sys/types.h> |
16175 | ||
6ec2e0f5 | 16176 | _ACEOF |
c0c3707f CB |
16177 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
16178 | $EGREP "uid_t" >/dev/null 2>&1; then : | |
16179 | ac_cv_type_uid_t=yes | |
16180 | else | |
16181 | ac_cv_type_uid_t=no | |
16182 | fi | |
16183 | rm -f conftest* | |
6ec2e0f5 | 16184 | |
c0c3707f CB |
16185 | fi |
16186 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 | |
16187 | $as_echo "$ac_cv_type_uid_t" >&6; } | |
16188 | if test $ac_cv_type_uid_t = no; then | |
6ec2e0f5 | 16189 | |
c0c3707f | 16190 | $as_echo "#define uid_t int" >>confdefs.h |
6ec2e0f5 | 16191 | |
6ec2e0f5 | 16192 | |
c0c3707f | 16193 | $as_echo "#define gid_t int" >>confdefs.h |
6ec2e0f5 SDJ |
16194 | |
16195 | fi | |
6ec2e0f5 | 16196 | |
c0c3707f CB |
16197 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 |
16198 | $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } | |
16199 | if ${ac_cv_header_stdbool_h+:} false; then : | |
16200 | $as_echo_n "(cached) " >&6 | |
16201 | else | |
16202 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16203 | /* end confdefs.h. */ | |
16204 | ||
16205 | #include <stdbool.h> | |
16206 | ||
16207 | #ifdef __cplusplus | |
16208 | typedef bool Bool; | |
16209 | #else | |
16210 | typedef _Bool Bool; | |
16211 | #ifndef bool | |
16212 | "error: bool is not defined" | |
16213 | #endif | |
16214 | #ifndef false | |
16215 | "error: false is not defined" | |
16216 | #endif | |
16217 | #if false | |
16218 | "error: false is not 0" | |
16219 | #endif | |
16220 | #ifndef true | |
16221 | "error: true is not defined" | |
16222 | #endif | |
16223 | #if true != 1 | |
16224 | "error: true is not 1" | |
16225 | #endif | |
16226 | #endif | |
16227 | ||
16228 | #ifndef __bool_true_false_are_defined | |
16229 | "error: __bool_true_false_are_defined is not defined" | |
16230 | #endif | |
16231 | ||
16232 | struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s; | |
16233 | ||
16234 | char a[true == 1 ? 1 : -1]; | |
16235 | char b[false == 0 ? 1 : -1]; | |
16236 | char c[__bool_true_false_are_defined == 1 ? 1 : -1]; | |
16237 | char d[(bool) 0.5 == true ? 1 : -1]; | |
16238 | /* See body of main program for 'e'. */ | |
16239 | char f[(Bool) 0.0 == false ? 1 : -1]; | |
16240 | char g[true]; | |
16241 | char h[sizeof (Bool)]; | |
16242 | char i[sizeof s.t]; | |
16243 | enum { j = false, k = true, l = false * true, m = true * 256 }; | |
16244 | /* The following fails for | |
16245 | HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ | |
16246 | Bool n[m]; | |
16247 | char o[sizeof n == m * sizeof n[0] ? 1 : -1]; | |
16248 | char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; | |
16249 | /* Catch a bug in an HP-UX C compiler. See | |
16250 | https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html | |
16251 | https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html | |
16252 | */ | |
16253 | Bool q = true; | |
16254 | Bool *pq = &q; | |
16255 | bool *qq = &q; | |
6ec2e0f5 | 16256 | |
c0c3707f CB |
16257 | int |
16258 | main () | |
16259 | { | |
6ec2e0f5 | 16260 | |
c0c3707f CB |
16261 | bool e = &s; |
16262 | *pq |= q; *pq |= ! q; | |
16263 | *qq |= q; *qq |= ! q; | |
16264 | /* Refer to every declared value, to avoid compiler optimizations. */ | |
16265 | return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l | |
16266 | + !m + !n + !o + !p + !q + !pq + !qq); | |
6ec2e0f5 | 16267 | |
c0c3707f CB |
16268 | ; |
16269 | return 0; | |
16270 | } | |
16271 | _ACEOF | |
16272 | if ac_fn_c_try_compile "$LINENO"; then : | |
16273 | ac_cv_header_stdbool_h=yes | |
16274 | else | |
16275 | ac_cv_header_stdbool_h=no | |
16276 | fi | |
16277 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
16278 | fi | |
16279 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 | |
16280 | $as_echo "$ac_cv_header_stdbool_h" >&6; } | |
16281 | ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" | |
16282 | if test "x$ac_cv_type__Bool" = xyes; then : | |
6ec2e0f5 | 16283 | |
c0c3707f CB |
16284 | cat >>confdefs.h <<_ACEOF |
16285 | #define HAVE__BOOL 1 | |
16286 | _ACEOF | |
6ec2e0f5 SDJ |
16287 | |
16288 | ||
c0c3707f | 16289 | fi |
6ec2e0f5 SDJ |
16290 | |
16291 | ||
9c9d63b1 PM |
16292 | ac_fn_c_check_decl "$LINENO" "fcloseall" "ac_cv_have_decl_fcloseall" "$ac_includes_default" |
16293 | if test "x$ac_cv_have_decl_fcloseall" = xyes; then : | |
16294 | ac_have_decl=1 | |
16295 | else | |
16296 | ac_have_decl=0 | |
16297 | fi | |
16298 | ||
16299 | cat >>confdefs.h <<_ACEOF | |
16300 | #define HAVE_DECL_FCLOSEALL $ac_have_decl | |
16301 | _ACEOF | |
16302 | ||
16303 | ac_fn_c_check_decl "$LINENO" "ecvt" "ac_cv_have_decl_ecvt" "$ac_includes_default" | |
16304 | if test "x$ac_cv_have_decl_ecvt" = xyes; then : | |
16305 | ac_have_decl=1 | |
16306 | else | |
16307 | ac_have_decl=0 | |
16308 | fi | |
16309 | ||
16310 | cat >>confdefs.h <<_ACEOF | |
16311 | #define HAVE_DECL_ECVT $ac_have_decl | |
16312 | _ACEOF | |
16313 | ||
16314 | ac_fn_c_check_decl "$LINENO" "fcvt" "ac_cv_have_decl_fcvt" "$ac_includes_default" | |
16315 | if test "x$ac_cv_have_decl_fcvt" = xyes; then : | |
16316 | ac_have_decl=1 | |
16317 | else | |
16318 | ac_have_decl=0 | |
16319 | fi | |
16320 | ||
16321 | cat >>confdefs.h <<_ACEOF | |
16322 | #define HAVE_DECL_FCVT $ac_have_decl | |
16323 | _ACEOF | |
16324 | ||
16325 | ac_fn_c_check_decl "$LINENO" "gcvt" "ac_cv_have_decl_gcvt" "$ac_includes_default" | |
16326 | if test "x$ac_cv_have_decl_gcvt" = xyes; then : | |
16327 | ac_have_decl=1 | |
16328 | else | |
16329 | ac_have_decl=0 | |
16330 | fi | |
472fa5ee | 16331 | |
9c9d63b1 PM |
16332 | cat >>confdefs.h <<_ACEOF |
16333 | #define HAVE_DECL_GCVT $ac_have_decl | |
16334 | _ACEOF | |
f8e27d88 | 16335 | |
c0c3707f CB |
16336 | ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default" |
16337 | if test "x$ac_cv_have_decl_strdup" = xyes; then : | |
6ec2e0f5 SDJ |
16338 | ac_have_decl=1 |
16339 | else | |
16340 | ac_have_decl=0 | |
16341 | fi | |
16342 | ||
16343 | cat >>confdefs.h <<_ACEOF | |
c0c3707f | 16344 | #define HAVE_DECL_STRDUP $ac_have_decl |
6ec2e0f5 SDJ |
16345 | _ACEOF |
16346 | ||
16347 | ||
c0c3707f CB |
16348 | REPLACE_STRERROR_0=0 |
16349 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5 | |
16350 | $as_echo_n "checking whether strerror(0) succeeds... " >&6; } | |
16351 | if ${gl_cv_func_strerror_0_works+:} false; then : | |
6ec2e0f5 SDJ |
16352 | $as_echo_n "(cached) " >&6 |
16353 | else | |
c0c3707f CB |
16354 | if test "$cross_compiling" = yes; then : |
16355 | case "$host_os" in | |
16356 | # Guess yes on glibc systems. | |
16357 | *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; | |
16358 | # Guess yes on musl systems. | |
16359 | *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;; | |
16360 | # Guess yes on native Windows. | |
16361 | mingw*) gl_cv_func_strerror_0_works="guessing yes" ;; | |
16362 | # If we don't know, obey --enable-cross-guesses. | |
16363 | *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;; | |
16364 | esac | |
6ec2e0f5 | 16365 | |
5e8754f9 SDJ |
16366 | else |
16367 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16368 | /* end confdefs.h. */ | |
c0c3707f CB |
16369 | #include <string.h> |
16370 | #include <errno.h> | |
6ec2e0f5 | 16371 | |
5e8754f9 SDJ |
16372 | int |
16373 | main () | |
16374 | { | |
c0c3707f CB |
16375 | int result = 0; |
16376 | char *str; | |
16377 | errno = 0; | |
16378 | str = strerror (0); | |
16379 | if (!*str) result |= 1; | |
16380 | if (errno) result |= 2; | |
16381 | if (strstr (str, "nknown") || strstr (str, "ndefined")) | |
16382 | result |= 4; | |
16383 | return result; | |
5e8754f9 SDJ |
16384 | ; |
16385 | return 0; | |
16386 | } | |
16387 | _ACEOF | |
c0c3707f CB |
16388 | if ac_fn_c_try_run "$LINENO"; then : |
16389 | gl_cv_func_strerror_0_works=yes | |
5e8754f9 | 16390 | else |
c0c3707f | 16391 | gl_cv_func_strerror_0_works=no |
5e8754f9 | 16392 | fi |
c0c3707f CB |
16393 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
16394 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
5e8754f9 | 16395 | fi |
6ec2e0f5 | 16396 | |
6ec2e0f5 | 16397 | |
c0c3707f CB |
16398 | fi |
16399 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5 | |
16400 | $as_echo "$gl_cv_func_strerror_0_works" >&6; } | |
16401 | case "$gl_cv_func_strerror_0_works" in | |
16402 | *yes) ;; | |
16403 | *) | |
16404 | REPLACE_STRERROR_0=1 | |
6ec2e0f5 | 16405 | |
c0c3707f | 16406 | $as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h |
6ec2e0f5 | 16407 | |
c0c3707f CB |
16408 | ;; |
16409 | esac | |
6ec2e0f5 SDJ |
16410 | |
16411 | ||
16412 | ||
16413 | ||
472fa5ee SM |
16414 | |
16415 | ||
16416 | ||
725e2999 | 16417 | |
725e2999 JB |
16418 | |
16419 | ||
c0c3707f CB |
16420 | if test $ac_cv_func_strerror_r = yes; then |
16421 | if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then | |
16422 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5 | |
16423 | $as_echo_n "checking for strerror_r with POSIX signature... " >&6; } | |
16424 | if ${gl_cv_func_strerror_r_posix_signature+:} false; then : | |
16425 | $as_echo_n "(cached) " >&6 | |
16426 | else | |
16427 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16428 | /* end confdefs.h. */ | |
16429 | #include <string.h> | |
16430 | int strerror_r (int, char *, size_t); | |
725e2999 | 16431 | |
c0c3707f CB |
16432 | int |
16433 | main () | |
16434 | { | |
725e2999 | 16435 | |
c0c3707f CB |
16436 | ; |
16437 | return 0; | |
16438 | } | |
16439 | _ACEOF | |
16440 | if ac_fn_c_try_compile "$LINENO"; then : | |
16441 | gl_cv_func_strerror_r_posix_signature=yes | |
16442 | else | |
16443 | gl_cv_func_strerror_r_posix_signature=no | |
16444 | fi | |
16445 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
725e2999 | 16446 | |
c0c3707f CB |
16447 | fi |
16448 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5 | |
16449 | $as_echo "$gl_cv_func_strerror_r_posix_signature" >&6; } | |
16450 | if test $gl_cv_func_strerror_r_posix_signature = yes; then | |
16451 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5 | |
16452 | $as_echo_n "checking whether strerror_r works... " >&6; } | |
16453 | if ${gl_cv_func_strerror_r_works+:} false; then : | |
16454 | $as_echo_n "(cached) " >&6 | |
16455 | else | |
16456 | if test "$cross_compiling" = yes; then : | |
725e2999 | 16457 | |
c0c3707f CB |
16458 | case "$host_os" in |
16459 | # Guess no on AIX. | |
16460 | aix*) gl_cv_func_strerror_r_works="guessing no";; | |
16461 | # Guess no on HP-UX. | |
16462 | hpux*) gl_cv_func_strerror_r_works="guessing no";; | |
16463 | # Guess no on BSD variants. | |
16464 | *bsd*) gl_cv_func_strerror_r_works="guessing no";; | |
16465 | # Guess yes otherwise. | |
16466 | *) gl_cv_func_strerror_r_works="guessing yes";; | |
16467 | esac | |
725e2999 | 16468 | |
c0c3707f CB |
16469 | else |
16470 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16471 | /* end confdefs.h. */ | |
16472 | #include <errno.h> | |
16473 | #include <string.h> | |
725e2999 | 16474 | |
c0c3707f CB |
16475 | int |
16476 | main () | |
16477 | { | |
16478 | int result = 0; | |
16479 | char buf[79]; | |
16480 | if (strerror_r (EACCES, buf, 0) < 0) | |
16481 | result |= 1; | |
16482 | errno = 0; | |
16483 | if (strerror_r (EACCES, buf, sizeof buf) != 0) | |
16484 | result |= 2; | |
16485 | strcpy (buf, "Unknown"); | |
16486 | if (strerror_r (0, buf, sizeof buf) != 0) | |
16487 | result |= 4; | |
16488 | if (errno) | |
16489 | result |= 8; | |
16490 | if (strstr (buf, "nknown") || strstr (buf, "ndefined")) | |
16491 | result |= 0x10; | |
16492 | errno = 0; | |
16493 | *buf = 0; | |
16494 | if (strerror_r (-3, buf, sizeof buf) < 0) | |
16495 | result |= 0x20; | |
16496 | if (errno) | |
16497 | result |= 0x40; | |
16498 | if (!*buf) | |
16499 | result |= 0x80; | |
16500 | return result; | |
725e2999 | 16501 | |
c0c3707f CB |
16502 | ; |
16503 | return 0; | |
16504 | } | |
16505 | _ACEOF | |
16506 | if ac_fn_c_try_run "$LINENO"; then : | |
16507 | gl_cv_func_strerror_r_works=yes | |
16508 | else | |
16509 | gl_cv_func_strerror_r_works=no | |
16510 | fi | |
16511 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
16512 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
16513 | fi | |
725e2999 JB |
16514 | |
16515 | ||
c0c3707f CB |
16516 | fi |
16517 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 | |
16518 | $as_echo "$gl_cv_func_strerror_r_works" >&6; } | |
16519 | else | |
725e2999 | 16520 | |
c0c3707f CB |
16521 | if test $ac_cv_func___xpg_strerror_r = yes; then |
16522 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5 | |
16523 | $as_echo_n "checking whether __xpg_strerror_r works... " >&6; } | |
16524 | if ${gl_cv_func_strerror_r_works+:} false; then : | |
725e2999 JB |
16525 | $as_echo_n "(cached) " >&6 |
16526 | else | |
c0c3707f CB |
16527 | if test "$cross_compiling" = yes; then : |
16528 | gl_cv_func_strerror_r_works="$gl_cross_guess_normal" | |
725e2999 | 16529 | |
c0c3707f CB |
16530 | else |
16531 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
725e2999 | 16532 | /* end confdefs.h. */ |
c0c3707f CB |
16533 | #include <errno.h> |
16534 | #include <string.h> | |
16535 | extern | |
16536 | #ifdef __cplusplus | |
16537 | "C" | |
16538 | #endif | |
16539 | int __xpg_strerror_r(int, char *, size_t); | |
725e2999 | 16540 | |
c0c3707f CB |
16541 | int |
16542 | main () | |
16543 | { | |
16544 | int result = 0; | |
16545 | char buf[256] = "^"; | |
16546 | char copy[256]; | |
16547 | char *str = strerror (-1); | |
16548 | strcpy (copy, str); | |
16549 | if (__xpg_strerror_r (-2, buf, 1) == 0) | |
16550 | result |= 1; | |
16551 | if (*buf) | |
16552 | result |= 2; | |
16553 | __xpg_strerror_r (-2, buf, 256); | |
16554 | if (strcmp (str, copy)) | |
16555 | result |= 4; | |
16556 | return result; | |
725e2999 | 16557 | |
c0c3707f CB |
16558 | ; |
16559 | return 0; | |
16560 | } | |
725e2999 | 16561 | _ACEOF |
c0c3707f CB |
16562 | if ac_fn_c_try_run "$LINENO"; then : |
16563 | gl_cv_func_strerror_r_works=yes | |
725e2999 | 16564 | else |
c0c3707f | 16565 | gl_cv_func_strerror_r_works=no |
725e2999 | 16566 | fi |
c0c3707f CB |
16567 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
16568 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
725e2999 | 16569 | fi |
725e2999 | 16570 | |
725e2999 | 16571 | |
c0c3707f CB |
16572 | fi |
16573 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 | |
16574 | $as_echo "$gl_cv_func_strerror_r_works" >&6; } | |
16575 | fi | |
16576 | fi | |
725e2999 | 16577 | fi |
725e2999 JB |
16578 | fi |
16579 | ||
c0c3707f CB |
16580 | ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" |
16581 | if test "x$ac_cv_have_decl_strerror_r" = xyes; then : | |
16582 | ac_have_decl=1 | |
725e2999 | 16583 | else |
c0c3707f | 16584 | ac_have_decl=0 |
725e2999 JB |
16585 | fi |
16586 | ||
c0c3707f CB |
16587 | cat >>confdefs.h <<_ACEOF |
16588 | #define HAVE_DECL_STRERROR_R $ac_have_decl | |
16589 | _ACEOF | |
725e2999 JB |
16590 | |
16591 | ||
16592 | ||
16593 | ||
16594 | ||
725e2999 JB |
16595 | |
16596 | ||
16597 | ||
725e2999 JB |
16598 | |
16599 | ||
16600 | ||
16601 | ||
16602 | ||
16603 | ||
16604 | ||
725e2999 | 16605 | if test $gl_cv_have_include_next = yes; then |
c0c3707f | 16606 | gl_cv_next_string_h='<'string.h'>' |
725e2999 | 16607 | else |
c0c3707f CB |
16608 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5 |
16609 | $as_echo_n "checking absolute name of <string.h>... " >&6; } | |
16610 | if ${gl_cv_next_string_h+:} false; then : | |
725e2999 JB |
16611 | $as_echo_n "(cached) " >&6 |
16612 | else | |
16613 | ||
725e2999 JB |
16614 | |
16615 | ||
16616 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16617 | /* end confdefs.h. */ | |
c0c3707f | 16618 | #include <string.h> |
725e2999 JB |
16619 | _ACEOF |
16620 | case "$host_os" in | |
16621 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
16622 | *) gl_absname_cpp="$ac_cpp" ;; | |
16623 | esac | |
16624 | ||
16625 | case "$host_os" in | |
16626 | mingw*) | |
16627 | gl_dirsep_regex='[/\\]' | |
16628 | ;; | |
16629 | *) | |
16630 | gl_dirsep_regex='\/' | |
16631 | ;; | |
16632 | esac | |
16633 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
c0c3707f | 16634 | gl_header_literal_regex=`echo 'string.h' \ |
725e2999 JB |
16635 | | sed -e "$gl_make_literal_regex_sed"` |
16636 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
16637 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
16638 | s|^/[^/]|//&| | |
16639 | p | |
16640 | q | |
16641 | }' | |
6ec2e0f5 | 16642 | |
c0c3707f | 16643 | gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
725e2999 | 16644 | sed -n "$gl_absolute_header_sed"` |
6ec2e0f5 | 16645 | |
c0c3707f CB |
16646 | gl_header=$gl_cv_absolute_string_h |
16647 | gl_cv_next_string_h='"'$gl_header'"' | |
6ec2e0f5 SDJ |
16648 | |
16649 | ||
725e2999 | 16650 | fi |
c0c3707f CB |
16651 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 |
16652 | $as_echo "$gl_cv_next_string_h" >&6; } | |
725e2999 | 16653 | fi |
c0c3707f | 16654 | NEXT_STRING_H=$gl_cv_next_string_h |
6ec2e0f5 | 16655 | |
725e2999 JB |
16656 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
16657 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
c0c3707f | 16658 | gl_next_as_first_directive='<'string.h'>' |
725e2999 JB |
16659 | else |
16660 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
c0c3707f | 16661 | gl_next_as_first_directive=$gl_cv_next_string_h |
725e2999 | 16662 | fi |
c0c3707f CB |
16663 | NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive |
16664 | ||
16665 | ||
16666 | ||
6ec2e0f5 SDJ |
16667 | |
16668 | ||
16669 | ||
16670 | ||
16671 | ||
6ec2e0f5 SDJ |
16672 | |
16673 | ||
6ec2e0f5 | 16674 | |
698be2d8 CB |
16675 | ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default" |
16676 | if test "x$ac_cv_have_decl_strnlen" = xyes; then : | |
16677 | ac_have_decl=1 | |
16678 | else | |
16679 | ac_have_decl=0 | |
16680 | fi | |
16681 | ||
16682 | cat >>confdefs.h <<_ACEOF | |
16683 | #define HAVE_DECL_STRNLEN $ac_have_decl | |
16684 | _ACEOF | |
16685 | ||
16686 | ||
16687 | ||
c0c3707f | 16688 | |
9c9d63b1 | 16689 | if test $REPLACE_MEMCHR = 1; then |
c0c3707f CB |
16690 | REPLACE_STRSTR=1 |
16691 | else | |
16692 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5 | |
16693 | $as_echo_n "checking whether strstr works... " >&6; } | |
16694 | if ${gl_cv_func_strstr_works_always+:} false; then : | |
6ec2e0f5 SDJ |
16695 | $as_echo_n "(cached) " >&6 |
16696 | else | |
c0c3707f CB |
16697 | if test "$cross_compiling" = yes; then : |
16698 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 SDJ |
16699 | /* end confdefs.h. */ |
16700 | ||
c0c3707f CB |
16701 | #ifdef __GNU_LIBRARY__ |
16702 | #include <features.h> | |
16703 | #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ | |
16704 | || defined __UCLIBC__ | |
16705 | Lucky user | |
16706 | #endif | |
16707 | #elif defined __CYGWIN__ | |
16708 | #include <cygwin/version.h> | |
16709 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) | |
16710 | Lucky user | |
16711 | #endif | |
16712 | #else | |
16713 | Lucky user | |
6ec2e0f5 | 16714 | #endif |
c0c3707f CB |
16715 | |
16716 | _ACEOF | |
16717 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
16718 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
16719 | gl_cv_func_strstr_works_always="guessing yes" | |
16720 | else | |
16721 | gl_cv_func_strstr_works_always="$gl_cross_guess_normal" | |
16722 | fi | |
16723 | rm -f conftest* | |
16724 | ||
16725 | ||
16726 | else | |
16727 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16728 | /* end confdefs.h. */ | |
16729 | ||
16730 | #include <string.h> /* for strstr */ | |
16731 | #ifdef __GNU_LIBRARY__ | |
16732 | #include <features.h> | |
16733 | #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28 | |
16734 | Unlucky user | |
16735 | #endif | |
725e2999 | 16736 | #endif |
c0c3707f CB |
16737 | #define P "_EF_BF_BD" |
16738 | #define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P | |
16739 | #define NEEDLE P P P P P | |
6ec2e0f5 | 16740 | |
725e2999 JB |
16741 | int |
16742 | main () | |
16743 | { | |
c0c3707f CB |
16744 | return !!strstr (HAYSTACK, NEEDLE); |
16745 | ||
725e2999 JB |
16746 | ; |
16747 | return 0; | |
16748 | } | |
6ec2e0f5 | 16749 | _ACEOF |
c0c3707f CB |
16750 | if ac_fn_c_try_run "$LINENO"; then : |
16751 | gl_cv_func_strstr_works_always=yes | |
6ec2e0f5 | 16752 | else |
c0c3707f | 16753 | gl_cv_func_strstr_works_always=no |
6ec2e0f5 | 16754 | fi |
c0c3707f CB |
16755 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
16756 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
6ec2e0f5 | 16757 | fi |
6ec2e0f5 SDJ |
16758 | |
16759 | ||
c0c3707f CB |
16760 | fi |
16761 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5 | |
16762 | $as_echo "$gl_cv_func_strstr_works_always" >&6; } | |
16763 | case "$gl_cv_func_strstr_works_always" in | |
16764 | *yes) ;; | |
16765 | *) | |
16766 | REPLACE_STRSTR=1 | |
16767 | ;; | |
16768 | esac | |
16769 | fi | |
6ec2e0f5 | 16770 | |
c0c3707f CB |
16771 | ac_fn_c_check_decl "$LINENO" "strtok_r" "ac_cv_have_decl_strtok_r" "$ac_includes_default" |
16772 | if test "x$ac_cv_have_decl_strtok_r" = xyes; then : | |
16773 | ac_have_decl=1 | |
16774 | else | |
16775 | ac_have_decl=0 | |
16776 | fi | |
6ec2e0f5 | 16777 | |
c0c3707f CB |
16778 | cat >>confdefs.h <<_ACEOF |
16779 | #define HAVE_DECL_STRTOK_R $ac_have_decl | |
16780 | _ACEOF | |
6ec2e0f5 SDJ |
16781 | |
16782 | ||
16783 | ||
16784 | ||
6ec2e0f5 SDJ |
16785 | |
16786 | ||
16787 | ||
16788 | ||
16789 | ||
16790 | ||
16791 | ||
698be2d8 CB |
16792 | |
16793 | ||
c0c3707f | 16794 | $as_echo "#define _USE_STD_STAT 1" >>confdefs.h |
6ec2e0f5 | 16795 | |
6ec2e0f5 SDJ |
16796 | |
16797 | ||
16798 | ||
16799 | ||
16800 | ||
6ec2e0f5 SDJ |
16801 | |
16802 | ||
16803 | ||
16804 | ||
16805 | ||
c0c3707f CB |
16806 | if test $gl_cv_have_include_next = yes; then |
16807 | gl_cv_next_sys_types_h='<'sys/types.h'>' | |
16808 | else | |
16809 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5 | |
16810 | $as_echo_n "checking absolute name of <sys/types.h>... " >&6; } | |
16811 | if ${gl_cv_next_sys_types_h+:} false; then : | |
6ec2e0f5 SDJ |
16812 | $as_echo_n "(cached) " >&6 |
16813 | else | |
6ec2e0f5 | 16814 | |
6ec2e0f5 | 16815 | |
c0c3707f CB |
16816 | |
16817 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16818 | /* end confdefs.h. */ | |
16819 | #include <sys/types.h> | |
6ec2e0f5 | 16820 | _ACEOF |
c0c3707f CB |
16821 | case "$host_os" in |
16822 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
16823 | *) gl_absname_cpp="$ac_cpp" ;; | |
16824 | esac | |
6ec2e0f5 | 16825 | |
c0c3707f CB |
16826 | case "$host_os" in |
16827 | mingw*) | |
16828 | gl_dirsep_regex='[/\\]' | |
16829 | ;; | |
16830 | *) | |
16831 | gl_dirsep_regex='\/' | |
16832 | ;; | |
16833 | esac | |
16834 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
16835 | gl_header_literal_regex=`echo 'sys/types.h' \ | |
16836 | | sed -e "$gl_make_literal_regex_sed"` | |
16837 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
16838 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
16839 | s|^/[^/]|//&| | |
16840 | p | |
16841 | q | |
16842 | }' | |
6ec2e0f5 | 16843 | |
c0c3707f CB |
16844 | gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
16845 | sed -n "$gl_absolute_header_sed"` | |
6ec2e0f5 | 16846 | |
c0c3707f CB |
16847 | gl_header=$gl_cv_absolute_sys_types_h |
16848 | gl_cv_next_sys_types_h='"'$gl_header'"' | |
6ec2e0f5 SDJ |
16849 | |
16850 | ||
c0c3707f CB |
16851 | fi |
16852 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5 | |
16853 | $as_echo "$gl_cv_next_sys_types_h" >&6; } | |
16854 | fi | |
16855 | NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h | |
6ec2e0f5 | 16856 | |
c0c3707f CB |
16857 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
16858 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
16859 | gl_next_as_first_directive='<'sys/types.h'>' | |
16860 | else | |
16861 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
16862 | gl_next_as_first_directive=$gl_cv_next_sys_types_h | |
16863 | fi | |
16864 | NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive | |
6ec2e0f5 SDJ |
16865 | |
16866 | ||
16867 | ||
16868 | ||
6ec2e0f5 | 16869 | |
6ec2e0f5 SDJ |
16870 | |
16871 | ||
6ec2e0f5 SDJ |
16872 | |
16873 | ||
16874 | ||
16875 | ||
16876 | ||
c0c3707f | 16877 | WINDOWS_STAT_INODES=0 |
6ec2e0f5 SDJ |
16878 | |
16879 | ||
16880 | ||
16881 | ||
16882 | ||
472fa5ee SM |
16883 | |
16884 | ||
16885 | ||
9c9d63b1 PM |
16886 | GNULIB_CTIME=0; |
16887 | GNULIB_MKTIME=0; | |
16888 | GNULIB_LOCALTIME=0; | |
16889 | GNULIB_NANOSLEEP=0; | |
16890 | GNULIB_STRFTIME=0; | |
16891 | GNULIB_STRPTIME=0; | |
16892 | GNULIB_TIMEGM=0; | |
16893 | GNULIB_TIMESPEC_GET=0; | |
16894 | GNULIB_TIME_R=0; | |
16895 | GNULIB_TIME_RZ=0; | |
16896 | GNULIB_TZSET=0; | |
16897 | GNULIB_MDA_TZSET=1; | |
16898 | HAVE_DECL_LOCALTIME_R=1; | |
16899 | HAVE_NANOSLEEP=1; | |
16900 | HAVE_STRPTIME=1; | |
16901 | HAVE_TIMEGM=1; | |
16902 | HAVE_TIMESPEC_GET=1; | |
16903 | HAVE_TIMEZONE_T=0; | |
16904 | REPLACE_CTIME=GNULIB_PORTCHECK; | |
16905 | REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; | |
16906 | REPLACE_MKTIME=GNULIB_PORTCHECK; | |
16907 | REPLACE_NANOSLEEP=GNULIB_PORTCHECK; | |
16908 | REPLACE_STRFTIME=GNULIB_PORTCHECK; | |
16909 | REPLACE_TIMEGM=GNULIB_PORTCHECK; | |
16910 | REPLACE_TZSET=GNULIB_PORTCHECK; | |
16911 | ||
16912 | : ${GNULIB_GETTIMEOFDAY=0}; | |
16913 | REPLACE_GMTIME=0; | |
16914 | REPLACE_LOCALTIME=0; | |
16915 | ||
16916 | ||
472fa5ee | 16917 | |
c0c3707f CB |
16918 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5 |
16919 | $as_echo_n "checking for struct timespec in <time.h>... " >&6; } | |
16920 | if ${gl_cv_sys_struct_timespec_in_time_h+:} false; then : | |
16921 | $as_echo_n "(cached) " >&6 | |
16922 | else | |
16923 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16924 | /* end confdefs.h. */ | |
16925 | #include <time.h> | |
472fa5ee | 16926 | |
c0c3707f CB |
16927 | int |
16928 | main () | |
16929 | { | |
16930 | static struct timespec x; x.tv_sec = x.tv_nsec; | |
16931 | ; | |
16932 | return 0; | |
16933 | } | |
6ec2e0f5 | 16934 | _ACEOF |
c0c3707f CB |
16935 | if ac_fn_c_try_compile "$LINENO"; then : |
16936 | gl_cv_sys_struct_timespec_in_time_h=yes | |
16937 | else | |
16938 | gl_cv_sys_struct_timespec_in_time_h=no | |
6ec2e0f5 | 16939 | fi |
c0c3707f CB |
16940 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
16941 | fi | |
16942 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5 | |
16943 | $as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; } | |
6ec2e0f5 | 16944 | |
c0c3707f CB |
16945 | TIME_H_DEFINES_STRUCT_TIMESPEC=0 |
16946 | SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 | |
16947 | PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 | |
16948 | UNISTD_H_DEFINES_STRUCT_TIMESPEC=0 | |
16949 | if test $gl_cv_sys_struct_timespec_in_time_h = yes; then | |
16950 | TIME_H_DEFINES_STRUCT_TIMESPEC=1 | |
6ec2e0f5 | 16951 | else |
c0c3707f CB |
16952 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5 |
16953 | $as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; } | |
16954 | if ${gl_cv_sys_struct_timespec_in_sys_time_h+:} false; then : | |
16955 | $as_echo_n "(cached) " >&6 | |
16956 | else | |
16957 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16958 | /* end confdefs.h. */ | |
16959 | #include <sys/time.h> | |
472fa5ee | 16960 | |
c0c3707f CB |
16961 | int |
16962 | main () | |
16963 | { | |
16964 | static struct timespec x; x.tv_sec = x.tv_nsec; | |
16965 | ; | |
16966 | return 0; | |
16967 | } | |
16968 | _ACEOF | |
16969 | if ac_fn_c_try_compile "$LINENO"; then : | |
16970 | gl_cv_sys_struct_timespec_in_sys_time_h=yes | |
16971 | else | |
16972 | gl_cv_sys_struct_timespec_in_sys_time_h=no | |
16973 | fi | |
16974 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
16975 | fi | |
16976 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5 | |
16977 | $as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; } | |
16978 | if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then | |
16979 | SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 | |
16980 | else | |
16981 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5 | |
16982 | $as_echo_n "checking for struct timespec in <pthread.h>... " >&6; } | |
16983 | if ${gl_cv_sys_struct_timespec_in_pthread_h+:} false; then : | |
16984 | $as_echo_n "(cached) " >&6 | |
16985 | else | |
16986 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16987 | /* end confdefs.h. */ | |
16988 | #include <pthread.h> | |
472fa5ee | 16989 | |
c0c3707f CB |
16990 | int |
16991 | main () | |
16992 | { | |
16993 | static struct timespec x; x.tv_sec = x.tv_nsec; | |
16994 | ; | |
16995 | return 0; | |
16996 | } | |
16997 | _ACEOF | |
16998 | if ac_fn_c_try_compile "$LINENO"; then : | |
16999 | gl_cv_sys_struct_timespec_in_pthread_h=yes | |
17000 | else | |
17001 | gl_cv_sys_struct_timespec_in_pthread_h=no | |
17002 | fi | |
17003 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
17004 | fi | |
17005 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5 | |
17006 | $as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; } | |
17007 | if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then | |
17008 | PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 | |
17009 | else | |
17010 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5 | |
17011 | $as_echo_n "checking for struct timespec in <unistd.h>... " >&6; } | |
17012 | if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then : | |
17013 | $as_echo_n "(cached) " >&6 | |
17014 | else | |
17015 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17016 | /* end confdefs.h. */ | |
17017 | #include <unistd.h> | |
6ec2e0f5 | 17018 | |
c0c3707f CB |
17019 | int |
17020 | main () | |
17021 | { | |
17022 | static struct timespec x; x.tv_sec = x.tv_nsec; | |
17023 | ; | |
17024 | return 0; | |
17025 | } | |
17026 | _ACEOF | |
17027 | if ac_fn_c_try_compile "$LINENO"; then : | |
17028 | gl_cv_sys_struct_timespec_in_unistd_h=yes | |
17029 | else | |
17030 | gl_cv_sys_struct_timespec_in_unistd_h=no | |
17031 | fi | |
17032 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
17033 | fi | |
17034 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5 | |
17035 | $as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; } | |
17036 | if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then | |
17037 | UNISTD_H_DEFINES_STRUCT_TIMESPEC=1 | |
17038 | fi | |
6ec2e0f5 SDJ |
17039 | fi |
17040 | fi | |
c0c3707f | 17041 | fi |
6ec2e0f5 SDJ |
17042 | |
17043 | ||
17044 | ||
17045 | ||
17046 | ||
17047 | ||
6ec2e0f5 | 17048 | |
6ec2e0f5 SDJ |
17049 | |
17050 | ||
17051 | ||
17052 | ||
17053 | ||
6ec2e0f5 SDJ |
17054 | |
17055 | ||
17056 | ||
17057 | ||
c0c3707f CB |
17058 | if test $gl_cv_have_include_next = yes; then |
17059 | gl_cv_next_time_h='<'time.h'>' | |
17060 | else | |
17061 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5 | |
17062 | $as_echo_n "checking absolute name of <time.h>... " >&6; } | |
17063 | if ${gl_cv_next_time_h+:} false; then : | |
17064 | $as_echo_n "(cached) " >&6 | |
17065 | else | |
6ec2e0f5 | 17066 | |
6ec2e0f5 SDJ |
17067 | |
17068 | ||
c0c3707f CB |
17069 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
17070 | /* end confdefs.h. */ | |
17071 | #include <time.h> | |
17072 | _ACEOF | |
17073 | case "$host_os" in | |
17074 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
17075 | *) gl_absname_cpp="$ac_cpp" ;; | |
17076 | esac | |
6ec2e0f5 | 17077 | |
c0c3707f CB |
17078 | case "$host_os" in |
17079 | mingw*) | |
17080 | gl_dirsep_regex='[/\\]' | |
17081 | ;; | |
17082 | *) | |
17083 | gl_dirsep_regex='\/' | |
17084 | ;; | |
17085 | esac | |
17086 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
17087 | gl_header_literal_regex=`echo 'time.h' \ | |
17088 | | sed -e "$gl_make_literal_regex_sed"` | |
17089 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
17090 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
17091 | s|^/[^/]|//&| | |
17092 | p | |
17093 | q | |
17094 | }' | |
6ec2e0f5 | 17095 | |
c0c3707f CB |
17096 | gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
17097 | sed -n "$gl_absolute_header_sed"` | |
6ec2e0f5 | 17098 | |
c0c3707f CB |
17099 | gl_header=$gl_cv_absolute_time_h |
17100 | gl_cv_next_time_h='"'$gl_header'"' | |
6ec2e0f5 | 17101 | |
6ec2e0f5 SDJ |
17102 | |
17103 | fi | |
c0c3707f CB |
17104 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5 |
17105 | $as_echo "$gl_cv_next_time_h" >&6; } | |
17106 | fi | |
17107 | NEXT_TIME_H=$gl_cv_next_time_h | |
6ec2e0f5 | 17108 | |
c0c3707f CB |
17109 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
17110 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
17111 | gl_next_as_first_directive='<'time.h'>' | |
17112 | else | |
17113 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
17114 | gl_next_as_first_directive=$gl_cv_next_time_h | |
17115 | fi | |
17116 | NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive | |
6ec2e0f5 | 17117 | |
472fa5ee SM |
17118 | |
17119 | ||
17120 | ||
17121 | ||
17122 | ||
6ec2e0f5 | 17123 | |
6ec2e0f5 | 17124 | |
9c9d63b1 PM |
17125 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIME_UTC in <time.h>" >&5 |
17126 | $as_echo_n "checking for TIME_UTC in <time.h>... " >&6; } | |
17127 | if ${gl_cv_time_h_has_TIME_UTC+:} false; then : | |
17128 | $as_echo_n "(cached) " >&6 | |
17129 | else | |
17130 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17131 | /* end confdefs.h. */ | |
17132 | #include <time.h> | |
17133 | ||
17134 | int | |
17135 | main () | |
17136 | { | |
17137 | static int x = TIME_UTC; x++; | |
17138 | ; | |
17139 | return 0; | |
17140 | } | |
17141 | _ACEOF | |
17142 | if ac_fn_c_try_compile "$LINENO"; then : | |
17143 | gl_cv_time_h_has_TIME_UTC=yes | |
17144 | else | |
17145 | gl_cv_time_h_has_TIME_UTC=no | |
17146 | fi | |
17147 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
17148 | fi | |
17149 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_h_has_TIME_UTC" >&5 | |
17150 | $as_echo "$gl_cv_time_h_has_TIME_UTC" >&6; } | |
17151 | if test $gl_cv_time_h_has_TIME_UTC = yes; then | |
17152 | TIME_H_DEFINES_TIME_UTC=1 | |
17153 | else | |
17154 | TIME_H_DEFINES_TIME_UTC=0 | |
17155 | fi | |
17156 | ||
17157 | ||
6ec2e0f5 | 17158 | |
6ec2e0f5 | 17159 | |
9c9d63b1 PM |
17160 | ac_fn_c_check_decl "$LINENO" "execvpe" "ac_cv_have_decl_execvpe" "$ac_includes_default" |
17161 | if test "x$ac_cv_have_decl_execvpe" = xyes; then : | |
17162 | ac_have_decl=1 | |
17163 | else | |
17164 | ac_have_decl=0 | |
17165 | fi | |
698be2d8 | 17166 | |
9c9d63b1 PM |
17167 | cat >>confdefs.h <<_ACEOF |
17168 | #define HAVE_DECL_EXECVPE $ac_have_decl | |
17169 | _ACEOF | |
698be2d8 | 17170 | |
c0c3707f CB |
17171 | ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default" |
17172 | if test "x$ac_cv_have_decl_unsetenv" = xyes; then : | |
17173 | ac_have_decl=1 | |
17174 | else | |
17175 | ac_have_decl=0 | |
17176 | fi | |
6ec2e0f5 | 17177 | |
c0c3707f CB |
17178 | cat >>confdefs.h <<_ACEOF |
17179 | #define HAVE_DECL_UNSETENV $ac_have_decl | |
17180 | _ACEOF | |
6ec2e0f5 SDJ |
17181 | |
17182 | ||
6ec2e0f5 SDJ |
17183 | |
17184 | ||
17185 | ||
c0c3707f CB |
17186 | if test $ac_cv_header_crtdefs_h = yes; then |
17187 | HAVE_CRTDEFS_H=1 | |
17188 | else | |
17189 | HAVE_CRTDEFS_H=0 | |
5e8754f9 | 17190 | fi |
5e8754f9 | 17191 | |
5e8754f9 | 17192 | |
5e8754f9 | 17193 | |
c0c3707f | 17194 | GNULIB_ISWBLANK=0; |
5df4cba6 SM |
17195 | GNULIB_ISWDIGIT=0; |
17196 | GNULIB_ISWXDIGIT=0; | |
c0c3707f CB |
17197 | GNULIB_WCTYPE=0; |
17198 | GNULIB_ISWCTYPE=0; | |
17199 | GNULIB_WCTRANS=0; | |
17200 | GNULIB_TOWCTRANS=0; | |
17201 | HAVE_ISWBLANK=1; | |
17202 | HAVE_WCTYPE_T=1; | |
17203 | HAVE_WCTRANS_T=1; | |
17204 | REPLACE_ISWBLANK=0; | |
5df4cba6 SM |
17205 | REPLACE_ISWDIGIT=0; |
17206 | REPLACE_ISWXDIGIT=0; | |
5e8754f9 | 17207 | |
5e8754f9 | 17208 | |
5e8754f9 | 17209 | |
5e8754f9 | 17210 | |
698be2d8 CB |
17211 | |
17212 | ||
17213 | ||
17214 | ||
c0c3707f CB |
17215 | if false; then |
17216 | GL_COND_LIBTOOL_TRUE= | |
17217 | GL_COND_LIBTOOL_FALSE='#' | |
17218 | else | |
17219 | GL_COND_LIBTOOL_TRUE='#' | |
17220 | GL_COND_LIBTOOL_FALSE= | |
17221 | fi | |
5e8754f9 | 17222 | |
c0c3707f CB |
17223 | gl_cond_libtool=false |
17224 | gl_libdeps= | |
17225 | gl_ltlibdeps= | |
17226 | gl_m4_base='import/m4' | |
5e8754f9 | 17227 | |
5e8754f9 SDJ |
17228 | |
17229 | ||
6ec2e0f5 | 17230 | |
6ec2e0f5 | 17231 | |
6ec2e0f5 | 17232 | |
6ec2e0f5 | 17233 | |
6ec2e0f5 | 17234 | |
6ec2e0f5 | 17235 | |
5df4cba6 | 17236 | |
c0c3707f CB |
17237 | gl_source_base='import' |
17238 | ||
6ec2e0f5 | 17239 | |
c0c3707f CB |
17240 | if test $ac_cv_func_alloca_works = no; then |
17241 | : | |
17242 | fi | |
6ec2e0f5 | 17243 | |
c0c3707f CB |
17244 | # Define an additional variable used in the Makefile substitution. |
17245 | if test $ac_cv_working_alloca_h = yes; then | |
17246 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5 | |
17247 | $as_echo_n "checking for alloca as a compiler built-in... " >&6; } | |
17248 | if ${gl_cv_rpl_alloca+:} false; then : | |
6ec2e0f5 SDJ |
17249 | $as_echo_n "(cached) " >&6 |
17250 | else | |
c0c3707f CB |
17251 | |
17252 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 SDJ |
17253 | /* end confdefs.h. */ |
17254 | ||
c0c3707f CB |
17255 | #if defined __GNUC__ || defined _AIX || defined _MSC_VER |
17256 | Need own alloca | |
17257 | #endif | |
6ec2e0f5 | 17258 | |
6ec2e0f5 | 17259 | _ACEOF |
c0c3707f CB |
17260 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
17261 | $EGREP "Need own alloca" >/dev/null 2>&1; then : | |
17262 | gl_cv_rpl_alloca=yes | |
6ec2e0f5 | 17263 | else |
c0c3707f | 17264 | gl_cv_rpl_alloca=no |
6ec2e0f5 | 17265 | fi |
c0c3707f | 17266 | rm -f conftest* |
6ec2e0f5 SDJ |
17267 | |
17268 | ||
17269 | fi | |
c0c3707f CB |
17270 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5 |
17271 | $as_echo "$gl_cv_rpl_alloca" >&6; } | |
17272 | if test $gl_cv_rpl_alloca = yes; then | |
6ec2e0f5 | 17273 | |
c0c3707f | 17274 | $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h |
6ec2e0f5 | 17275 | |
c0c3707f CB |
17276 | ALLOCA_H=alloca.h |
17277 | else | |
17278 | ALLOCA_H= | |
17279 | fi | |
17280 | else | |
17281 | ALLOCA_H=alloca.h | |
17282 | fi | |
6ec2e0f5 | 17283 | |
c0c3707f CB |
17284 | if test -n "$ALLOCA_H"; then |
17285 | GL_GENERATE_ALLOCA_H_TRUE= | |
17286 | GL_GENERATE_ALLOCA_H_FALSE='#' | |
17287 | else | |
17288 | GL_GENERATE_ALLOCA_H_TRUE='#' | |
17289 | GL_GENERATE_ALLOCA_H_FALSE= | |
17290 | fi | |
6ec2e0f5 SDJ |
17291 | |
17292 | ||
c0c3707f CB |
17293 | if test $ac_cv_working_alloca_h = yes; then |
17294 | HAVE_ALLOCA_H=1 | |
17295 | else | |
17296 | HAVE_ALLOCA_H=0 | |
17297 | fi | |
6ec2e0f5 SDJ |
17298 | |
17299 | ||
17300 | ||
17301 | ||
17302 | ||
17303 | ||
c0c3707f CB |
17304 | if test $ac_cv_header_arpa_inet_h = yes; then |
17305 | HAVE_ARPA_INET_H=1 | |
17306 | else | |
17307 | HAVE_ARPA_INET_H=0 | |
17308 | fi | |
6ec2e0f5 SDJ |
17309 | |
17310 | ||
472fa5ee SM |
17311 | |
17312 | ||
17313 | ||
17314 | ||
17315 | ||
6ec2e0f5 SDJ |
17316 | |
17317 | ||
17318 | ||
17319 | if test $gl_cv_have_include_next = yes; then | |
c0c3707f | 17320 | gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' |
6ec2e0f5 | 17321 | else |
c0c3707f CB |
17322 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5 |
17323 | $as_echo_n "checking absolute name of <arpa/inet.h>... " >&6; } | |
17324 | if ${gl_cv_next_arpa_inet_h+:} false; then : | |
6ec2e0f5 SDJ |
17325 | $as_echo_n "(cached) " >&6 |
17326 | else | |
17327 | ||
c0c3707f | 17328 | if test $ac_cv_header_arpa_inet_h = yes; then |
6ec2e0f5 SDJ |
17329 | |
17330 | ||
17331 | ||
17332 | ||
17333 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17334 | /* end confdefs.h. */ | |
c0c3707f | 17335 | #include <arpa/inet.h> |
6ec2e0f5 SDJ |
17336 | _ACEOF |
17337 | case "$host_os" in | |
17338 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
17339 | *) gl_absname_cpp="$ac_cpp" ;; | |
17340 | esac | |
17341 | ||
17342 | case "$host_os" in | |
17343 | mingw*) | |
17344 | gl_dirsep_regex='[/\\]' | |
17345 | ;; | |
17346 | *) | |
17347 | gl_dirsep_regex='\/' | |
17348 | ;; | |
17349 | esac | |
17350 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
c0c3707f | 17351 | gl_header_literal_regex=`echo 'arpa/inet.h' \ |
6ec2e0f5 SDJ |
17352 | | sed -e "$gl_make_literal_regex_sed"` |
17353 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
17354 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
17355 | s|^/[^/]|//&| | |
17356 | p | |
17357 | q | |
17358 | }' | |
17359 | ||
c0c3707f | 17360 | gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
6ec2e0f5 SDJ |
17361 | sed -n "$gl_absolute_header_sed"` |
17362 | ||
c0c3707f CB |
17363 | gl_header=$gl_cv_absolute_arpa_inet_h |
17364 | gl_cv_next_arpa_inet_h='"'$gl_header'"' | |
6ec2e0f5 | 17365 | else |
c0c3707f | 17366 | gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' |
6ec2e0f5 SDJ |
17367 | fi |
17368 | ||
c0c3707f | 17369 | |
6ec2e0f5 | 17370 | fi |
c0c3707f CB |
17371 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5 |
17372 | $as_echo "$gl_cv_next_arpa_inet_h" >&6; } | |
17373 | fi | |
17374 | NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h | |
6ec2e0f5 | 17375 | |
c0c3707f CB |
17376 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
17377 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
17378 | gl_next_as_first_directive='<'arpa/inet.h'>' | |
17379 | else | |
17380 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
17381 | gl_next_as_first_directive=$gl_cv_next_arpa_inet_h | |
17382 | fi | |
17383 | NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive | |
6ec2e0f5 SDJ |
17384 | |
17385 | ||
6ec2e0f5 | 17386 | |
6ec2e0f5 | 17387 | |
6ec2e0f5 SDJ |
17388 | |
17389 | ||
6ec2e0f5 SDJ |
17390 | |
17391 | ||
17392 | ||
c0c3707f CB |
17393 | if test $ac_cv_header_sys_socket_h = yes; then |
17394 | HAVE_WS2TCPIP_H=0 | |
17395 | else | |
17396 | if test $ac_cv_header_ws2tcpip_h = yes; then | |
17397 | HAVE_WS2TCPIP_H=1 | |
17398 | else | |
17399 | HAVE_WS2TCPIP_H=0 | |
17400 | fi | |
17401 | fi | |
17402 | ||
17403 | ||
6ec2e0f5 SDJ |
17404 | |
17405 | ||
6ec2e0f5 SDJ |
17406 | |
17407 | ||
17408 | ||
17409 | ||
17410 | ||
698be2d8 CB |
17411 | |
17412 | ||
17413 | ||
17414 | ||
17415 | ||
17416 | ||
17417 | if test $ac_cv_func_btowc = no; then | |
17418 | HAVE_BTOWC=0 | |
17419 | else | |
17420 | ||
17421 | ||
17422 | ||
17423 | ||
17424 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5 | |
17425 | $as_echo_n "checking whether btowc(0) is correct... " >&6; } | |
17426 | if ${gl_cv_func_btowc_nul+:} false; then : | |
17427 | $as_echo_n "(cached) " >&6 | |
17428 | else | |
17429 | ||
17430 | if test "$cross_compiling" = yes; then : | |
17431 | ||
17432 | case "$host_os" in | |
17433 | # Guess no on Cygwin. | |
17434 | cygwin*) gl_cv_func_btowc_nul="guessing no" ;; | |
17435 | # Guess yes on native Windows. | |
17436 | mingw*) gl_cv_func_btowc_nul="guessing yes" ;; | |
17437 | # Guess yes otherwise. | |
17438 | *) gl_cv_func_btowc_nul="guessing yes" ;; | |
17439 | esac | |
17440 | ||
17441 | else | |
17442 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17443 | /* end confdefs.h. */ | |
17444 | ||
698be2d8 CB |
17445 | #include <wchar.h> |
17446 | int main () | |
17447 | { | |
17448 | if (btowc ('\0') != 0) | |
17449 | return 1; | |
17450 | return 0; | |
17451 | } | |
17452 | _ACEOF | |
17453 | if ac_fn_c_try_run "$LINENO"; then : | |
17454 | gl_cv_func_btowc_nul=yes | |
17455 | else | |
17456 | gl_cv_func_btowc_nul=no | |
17457 | fi | |
17458 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
17459 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
17460 | fi | |
17461 | ||
17462 | ||
17463 | fi | |
17464 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5 | |
17465 | $as_echo "$gl_cv_func_btowc_nul" >&6; } | |
17466 | ||
17467 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5 | |
17468 | $as_echo_n "checking whether btowc(EOF) is correct... " >&6; } | |
17469 | if ${gl_cv_func_btowc_eof+:} false; then : | |
17470 | $as_echo_n "(cached) " >&6 | |
17471 | else | |
17472 | ||
17473 | case "$host_os" in | |
17474 | # Guess no on IRIX. | |
17475 | irix*) gl_cv_func_btowc_eof="guessing no" ;; | |
17476 | # Guess yes on native Windows. | |
17477 | mingw*) gl_cv_func_btowc_eof="guessing yes" ;; | |
17478 | # Guess yes otherwise. | |
17479 | *) gl_cv_func_btowc_eof="guessing yes" ;; | |
17480 | esac | |
17481 | if test $LOCALE_FR != none; then | |
17482 | if test "$cross_compiling" = yes; then : | |
17483 | : | |
17484 | else | |
17485 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17486 | /* end confdefs.h. */ | |
17487 | ||
17488 | #include <locale.h> | |
698be2d8 | 17489 | #include <stdio.h> |
698be2d8 CB |
17490 | #include <wchar.h> |
17491 | int main () | |
17492 | { | |
17493 | if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) | |
17494 | { | |
17495 | if (btowc (EOF) != WEOF) | |
17496 | return 1; | |
17497 | } | |
17498 | return 0; | |
17499 | } | |
17500 | _ACEOF | |
17501 | if ac_fn_c_try_run "$LINENO"; then : | |
17502 | gl_cv_func_btowc_eof=yes | |
17503 | else | |
17504 | gl_cv_func_btowc_eof=no | |
17505 | fi | |
17506 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
17507 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
17508 | fi | |
17509 | ||
17510 | fi | |
17511 | ||
17512 | fi | |
17513 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5 | |
17514 | $as_echo "$gl_cv_func_btowc_eof" >&6; } | |
17515 | ||
17516 | case "$gl_cv_func_btowc_nul" in | |
17517 | *yes) ;; | |
17518 | *) REPLACE_BTOWC=1 ;; | |
17519 | esac | |
17520 | case "$gl_cv_func_btowc_eof" in | |
17521 | *yes) ;; | |
17522 | *) REPLACE_BTOWC=1 ;; | |
17523 | esac | |
17524 | fi | |
17525 | ||
17526 | if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then | |
17527 | ||
17528 | ||
17529 | ||
17530 | ||
17531 | ||
17532 | ||
17533 | ||
17534 | ||
17535 | gl_LIBOBJS="$gl_LIBOBJS btowc.$ac_objext" | |
17536 | ||
17537 | ||
17538 | : | |
17539 | ||
17540 | fi | |
17541 | ||
17542 | ||
17543 | ||
17544 | ||
17545 | ||
17546 | GNULIB_BTOWC=1 | |
17547 | ||
17548 | ||
17549 | ||
17550 | ||
17551 | ||
17552 | $as_echo "#define GNULIB_TEST_BTOWC 1" >>confdefs.h | |
17553 | ||
17554 | ||
17555 | ||
17556 | ||
c0c3707f CB |
17557 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5 |
17558 | $as_echo_n "checking for __builtin_expect... " >&6; } | |
17559 | if ${gl_cv___builtin_expect+:} false; then : | |
6ec2e0f5 SDJ |
17560 | $as_echo_n "(cached) " >&6 |
17561 | else | |
c0c3707f CB |
17562 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
17563 | /* end confdefs.h. */ | |
17564 | ||
17565 | int | |
17566 | main (int argc, char **argv) | |
17567 | { | |
17568 | argc = __builtin_expect (argc, 100); | |
17569 | return argv[argc != 100][0]; | |
17570 | } | |
17571 | _ACEOF | |
17572 | if ac_fn_c_try_link "$LINENO"; then : | |
17573 | gl_cv___builtin_expect=yes | |
17574 | else | |
17575 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17576 | /* end confdefs.h. */ | |
17577 | ||
17578 | #include <builtins.h> | |
17579 | int | |
17580 | main (int argc, char **argv) | |
17581 | { | |
17582 | argc = __builtin_expect (argc, 100); | |
17583 | return argv[argc != 100][0]; | |
17584 | } | |
17585 | _ACEOF | |
17586 | if ac_fn_c_try_link "$LINENO"; then : | |
17587 | gl_cv___builtin_expect="in <builtins.h>" | |
17588 | else | |
17589 | gl_cv___builtin_expect=no | |
6ec2e0f5 | 17590 | fi |
c0c3707f CB |
17591 | rm -f core conftest.err conftest.$ac_objext \ |
17592 | conftest$ac_exeext conftest.$ac_ext | |
17593 | fi | |
17594 | rm -f core conftest.err conftest.$ac_objext \ | |
17595 | conftest$ac_exeext conftest.$ac_ext | |
17596 | fi | |
17597 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5 | |
17598 | $as_echo "$gl_cv___builtin_expect" >&6; } | |
17599 | if test "$gl_cv___builtin_expect" = yes; then | |
17600 | $as_echo "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h | |
8690e634 | 17601 | |
c0c3707f CB |
17602 | elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then |
17603 | $as_echo "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h | |
8690e634 | 17604 | |
6ec2e0f5 | 17605 | fi |
8690e634 JK |
17606 | |
17607 | ||
17608 | ||
17609 | ||
c0c3707f CB |
17610 | |
17611 | if test $ac_cv_func_canonicalize_file_name = no; then | |
17612 | HAVE_CANONICALIZE_FILE_NAME=0 | |
17613 | if test $ac_cv_func_realpath = no; then | |
17614 | HAVE_REALPATH=0 | |
17615 | else | |
17616 | case "$gl_cv_func_realpath_works" in | |
17617 | *yes) ;; | |
17618 | *) REPLACE_REALPATH=1 ;; | |
17619 | esac | |
17620 | fi | |
17621 | else | |
17622 | case "$gl_cv_func_realpath_works" in | |
17623 | *yes) | |
17624 | ;; | |
17625 | *) | |
17626 | REPLACE_CANONICALIZE_FILE_NAME=1 | |
17627 | REPLACE_REALPATH=1 | |
17628 | ;; | |
17629 | esac | |
5e8754f9 | 17630 | fi |
8690e634 | 17631 | |
c0c3707f | 17632 | if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then |
8690e634 JK |
17633 | |
17634 | ||
17635 | ||
472fa5ee SM |
17636 | |
17637 | ||
17638 | ||
17639 | ||
17640 | ||
c0c3707f CB |
17641 | gl_LIBOBJS="$gl_LIBOBJS canonicalize-lgpl.$ac_objext" |
17642 | ||
6ec2e0f5 | 17643 | fi |
8690e634 JK |
17644 | |
17645 | ||
c0c3707f CB |
17646 | cat >>confdefs.h <<_ACEOF |
17647 | #define GNULIB_CANONICALIZE_LGPL 1 | |
17648 | _ACEOF | |
8690e634 | 17649 | |
8690e634 | 17650 | |
8690e634 | 17651 | |
8690e634 | 17652 | |
8690e634 | 17653 | |
8690e634 | 17654 | |
8690e634 | 17655 | |
c0c3707f | 17656 | GNULIB_CANONICALIZE_FILE_NAME=1 |
8690e634 | 17657 | |
8690e634 | 17658 | |
8690e634 | 17659 | |
6ec2e0f5 SDJ |
17660 | |
17661 | ||
c0c3707f | 17662 | $as_echo "#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1" >>confdefs.h |
6ec2e0f5 | 17663 | |
6ec2e0f5 | 17664 | |
8690e634 JK |
17665 | |
17666 | ||
8690e634 JK |
17667 | |
17668 | ||
17669 | ||
17670 | ||
c0c3707f | 17671 | GNULIB_REALPATH=1 |
6ec2e0f5 SDJ |
17672 | |
17673 | ||
17674 | ||
17675 | ||
6ec2e0f5 | 17676 | |
c0c3707f | 17677 | $as_echo "#define GNULIB_TEST_REALPATH 1" >>confdefs.h |
6ec2e0f5 SDJ |
17678 | |
17679 | ||
17680 | ||
17681 | ||
17682 | ||
17683 | ||
17684 | ||
6ec2e0f5 | 17685 | |
c0c3707f | 17686 | GNULIB_CHDIR=1 |
6ec2e0f5 | 17687 | |
8690e634 | 17688 | |
8690e634 | 17689 | |
6ec2e0f5 | 17690 | |
6ec2e0f5 | 17691 | |
c0c3707f CB |
17692 | $as_echo "#define GNULIB_TEST_CHDIR 1" >>confdefs.h |
17693 | ||
17694 | ||
17695 | ||
17696 | ||
17697 | ||
9c9d63b1 PM |
17698 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this system supports file names of any length" >&5 |
17699 | $as_echo_n "checking whether this system supports file names of any length... " >&6; } | |
17700 | if ${gl_cv_have_unlimited_file_name_length+:} false; then : | |
c0c3707f | 17701 | $as_echo_n "(cached) " >&6 |
8690e634 | 17702 | else |
c0c3707f CB |
17703 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
17704 | /* end confdefs.h. */ | |
8690e634 | 17705 | |
c0c3707f CB |
17706 | /* Arrange to define PATH_MAX, like "pathmax.h" does. */ |
17707 | #if HAVE_UNISTD_H | |
17708 | # include <unistd.h> | |
17709 | #endif | |
17710 | #include <limits.h> | |
17711 | #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN | |
17712 | # include <sys/param.h> | |
17713 | #endif | |
17714 | #if !defined PATH_MAX && defined MAXPATHLEN | |
17715 | # define PATH_MAX MAXPATHLEN | |
17716 | #endif | |
17717 | #ifdef __hpux | |
17718 | # undef PATH_MAX | |
17719 | # define PATH_MAX 1024 | |
17720 | #endif | |
17721 | #if defined _WIN32 && ! defined __CYGWIN__ | |
17722 | # undef PATH_MAX | |
17723 | # define PATH_MAX 260 | |
17724 | #endif | |
6ec2e0f5 | 17725 | |
c0c3707f CB |
17726 | #ifdef PATH_MAX |
17727 | have_arbitrary_file_name_length_limit | |
17728 | #endif | |
6ec2e0f5 | 17729 | _ACEOF |
c0c3707f CB |
17730 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
17731 | $EGREP "have_arbitrary_file_name_length_limit" >/dev/null 2>&1; then : | |
9c9d63b1 PM |
17732 | gl_cv_have_unlimited_file_name_length=no |
17733 | else | |
17734 | gl_cv_have_unlimited_file_name_length=yes | |
17735 | fi | |
17736 | rm -f conftest* | |
17737 | ||
17738 | fi | |
17739 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_unlimited_file_name_length" >&5 | |
17740 | $as_echo "$gl_cv_have_unlimited_file_name_length" >&6; } | |
17741 | ||
17742 | if test $gl_cv_have_unlimited_file_name_length = no; then | |
17743 | ||
17744 | ||
17745 | ||
17746 | ||
17747 | ||
17748 | ||
17749 | ||
17750 | ||
17751 | gl_LIBOBJS="$gl_LIBOBJS chdir-long.$ac_objext" | |
17752 | ||
17753 | : | |
17754 | fi | |
17755 | ||
17756 | ||
17757 | ||
17758 | # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. | |
17759 | # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. | |
17760 | ||
17761 | # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* | |
17762 | # programs in the package would end up linked with that potentially-shared | |
17763 | # library, inducing unnecessary run-time overhead. | |
17764 | LIB_CLOCK_GETTIME= | |
17765 | ||
17766 | gl_saved_libs=$LIBS | |
17767 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 | |
17768 | $as_echo_n "checking for library containing clock_gettime... " >&6; } | |
17769 | if ${ac_cv_search_clock_gettime+:} false; then : | |
17770 | $as_echo_n "(cached) " >&6 | |
c0c3707f | 17771 | else |
9c9d63b1 PM |
17772 | ac_func_search_save_LIBS=$LIBS |
17773 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17774 | /* end confdefs.h. */ | |
17775 | ||
17776 | /* Override any GCC internal prototype to avoid an error. | |
17777 | Use char because int might match the return type of a GCC | |
17778 | builtin and then its argument prototype would still apply. */ | |
17779 | #ifdef __cplusplus | |
17780 | extern "C" | |
17781 | #endif | |
17782 | char clock_gettime (); | |
17783 | int | |
17784 | main () | |
17785 | { | |
17786 | return clock_gettime (); | |
17787 | ; | |
17788 | return 0; | |
17789 | } | |
17790 | _ACEOF | |
17791 | for ac_lib in '' rt posix4; do | |
17792 | if test -z "$ac_lib"; then | |
17793 | ac_res="none required" | |
17794 | else | |
17795 | ac_res=-l$ac_lib | |
17796 | LIBS="-l$ac_lib $ac_func_search_save_LIBS" | |
17797 | fi | |
17798 | if ac_fn_c_try_link "$LINENO"; then : | |
17799 | ac_cv_search_clock_gettime=$ac_res | |
17800 | fi | |
17801 | rm -f core conftest.err conftest.$ac_objext \ | |
17802 | conftest$ac_exeext | |
17803 | if ${ac_cv_search_clock_gettime+:} false; then : | |
17804 | break | |
c0c3707f | 17805 | fi |
9c9d63b1 PM |
17806 | done |
17807 | if ${ac_cv_search_clock_gettime+:} false; then : | |
6ec2e0f5 | 17808 | |
9c9d63b1 PM |
17809 | else |
17810 | ac_cv_search_clock_gettime=no | |
17811 | fi | |
17812 | rm conftest.$ac_ext | |
17813 | LIBS=$ac_func_search_save_LIBS | |
17814 | fi | |
17815 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 | |
17816 | $as_echo "$ac_cv_search_clock_gettime" >&6; } | |
17817 | ac_res=$ac_cv_search_clock_gettime | |
17818 | if test "$ac_res" != no; then : | |
17819 | test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" | |
17820 | test "$ac_cv_search_clock_gettime" = "none required" || | |
17821 | LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime | |
6ec2e0f5 | 17822 | fi |
472fa5ee | 17823 | |
9c9d63b1 PM |
17824 | for ac_func in clock_gettime clock_settime |
17825 | do : | |
17826 | as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` | |
17827 | ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" | |
17828 | if eval test \"x\$"$as_ac_var"\" = x"yes"; then : | |
17829 | cat >>confdefs.h <<_ACEOF | |
17830 | #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 | |
17831 | _ACEOF | |
472fa5ee | 17832 | |
9c9d63b1 PM |
17833 | fi |
17834 | done | |
472fa5ee | 17835 | |
9c9d63b1 | 17836 | LIBS=$gl_saved_libs |
472fa5ee | 17837 | |
8690e634 | 17838 | |
8690e634 | 17839 | |
c0c3707f | 17840 | $as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h |
8690e634 JK |
17841 | |
17842 | ||
17843 | ||
17844 | ||
17845 | ||
8690e634 | 17846 | |
c0c3707f CB |
17847 | if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then |
17848 | REPLACE_CLOSE=1 | |
17849 | fi | |
8690e634 | 17850 | |
6ec2e0f5 SDJ |
17851 | |
17852 | ||
6ec2e0f5 SDJ |
17853 | |
17854 | ||
8690e634 | 17855 | |
c0c3707f CB |
17856 | if test $ac_cv_header_sys_socket_h != yes; then |
17857 | for ac_header in winsock2.h | |
17858 | do : | |
17859 | ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" | |
17860 | if test "x$ac_cv_header_winsock2_h" = xyes; then : | |
17861 | cat >>confdefs.h <<_ACEOF | |
17862 | #define HAVE_WINSOCK2_H 1 | |
17863 | _ACEOF | |
8690e634 | 17864 | |
c0c3707f | 17865 | fi |
8690e634 | 17866 | |
c0c3707f | 17867 | done |
8690e634 | 17868 | |
c0c3707f CB |
17869 | fi |
17870 | if test "$ac_cv_header_winsock2_h" = yes; then | |
17871 | HAVE_WINSOCK2_H=1 | |
17872 | UNISTD_H_HAVE_WINSOCK2_H=1 | |
17873 | SYS_IOCTL_H_HAVE_WINSOCK2_H=1 | |
17874 | else | |
17875 | HAVE_WINSOCK2_H=0 | |
17876 | fi | |
8690e634 | 17877 | |
6ec2e0f5 | 17878 | |
c0c3707f CB |
17879 | if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then |
17880 | REPLACE_CLOSE=1 | |
17881 | fi | |
6ec2e0f5 SDJ |
17882 | |
17883 | ||
c0c3707f | 17884 | if test $REPLACE_CLOSE = 0; then |
6ec2e0f5 SDJ |
17885 | |
17886 | ||
6ec2e0f5 | 17887 | |
c0c3707f CB |
17888 | if test $ac_cv_func_fchdir = no; then |
17889 | HAVE_FCHDIR=0 | |
17890 | fi | |
6ec2e0f5 | 17891 | |
c0c3707f CB |
17892 | if test $HAVE_FCHDIR = 0; then |
17893 | REPLACE_CLOSE=1 | |
17894 | fi | |
17895 | fi | |
6ec2e0f5 SDJ |
17896 | |
17897 | ||
c0c3707f | 17898 | if test $REPLACE_CLOSE = 1; then |
6ec2e0f5 SDJ |
17899 | |
17900 | ||
17901 | ||
17902 | ||
17903 | ||
6ec2e0f5 SDJ |
17904 | |
17905 | ||
17906 | ||
c0c3707f | 17907 | gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext" |
6ec2e0f5 | 17908 | |
c0c3707f | 17909 | fi |
6ec2e0f5 | 17910 | |
6ec2e0f5 SDJ |
17911 | |
17912 | ||
17913 | ||
17914 | ||
c0c3707f | 17915 | GNULIB_CLOSE=1 |
6ec2e0f5 | 17916 | |
6ec2e0f5 | 17917 | |
6ec2e0f5 SDJ |
17918 | |
17919 | ||
17920 | ||
c0c3707f | 17921 | $as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h |
6ec2e0f5 SDJ |
17922 | |
17923 | ||
17924 | ||
17925 | ||
17926 | ||
c0c3707f CB |
17927 | |
17928 | for ac_func in closedir | |
17929 | do : | |
17930 | ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir" | |
17931 | if test "x$ac_cv_func_closedir" = xyes; then : | |
17932 | cat >>confdefs.h <<_ACEOF | |
17933 | #define HAVE_CLOSEDIR 1 | |
17934 | _ACEOF | |
17935 | ||
17936 | fi | |
17937 | done | |
17938 | ||
17939 | if test $ac_cv_func_closedir = no; then | |
17940 | HAVE_CLOSEDIR=0 | |
17941 | fi | |
6ec2e0f5 | 17942 | |
8690e634 JK |
17943 | |
17944 | ||
8690e634 | 17945 | |
c0c3707f CB |
17946 | if test $ac_cv_func_fchdir = no; then |
17947 | HAVE_FCHDIR=0 | |
6ec2e0f5 | 17948 | fi |
6a29c58e | 17949 | |
c0c3707f CB |
17950 | if test $HAVE_FCHDIR = 0; then |
17951 | if test $HAVE_CLOSEDIR = 1; then | |
17952 | REPLACE_CLOSEDIR=1 | |
17953 | fi | |
17954 | fi | |
6a29c58e | 17955 | |
c0c3707f CB |
17956 | case $host_os,$HAVE_CLOSEDIR in |
17957 | os2*,1) | |
17958 | REPLACE_CLOSEDIR=1;; | |
17959 | esac | |
d0ac1c44 | 17960 | |
c0c3707f | 17961 | if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then |
d0ac1c44 SM |
17962 | |
17963 | ||
d0ac1c44 SM |
17964 | |
17965 | ||
6a29c58e YQ |
17966 | |
17967 | ||
3d99e817 | 17968 | |
6ec2e0f5 | 17969 | |
c0c3707f | 17970 | gl_LIBOBJS="$gl_LIBOBJS closedir.$ac_objext" |
6ec2e0f5 | 17971 | |
6ec2e0f5 SDJ |
17972 | fi |
17973 | ||
17974 | ||
6ec2e0f5 SDJ |
17975 | |
17976 | ||
3d99e817 | 17977 | |
c0c3707f | 17978 | GNULIB_CLOSEDIR=1 |
3d99e817 AK |
17979 | |
17980 | ||
17981 | ||
17982 | ||
17983 | ||
c0c3707f | 17984 | $as_echo "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h |
3d99e817 AK |
17985 | |
17986 | ||
17987 | ||
698be2d8 CB |
17988 | |
17989 | ||
17990 | ||
17991 | ||
17992 | ||
17993 | ||
17994 | ||
17995 | ||
17996 | ||
17997 | ||
17998 | ||
17999 | if test $gl_cv_have_include_next = yes; then | |
18000 | gl_cv_next_ctype_h='<'ctype.h'>' | |
18001 | else | |
18002 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <ctype.h>" >&5 | |
18003 | $as_echo_n "checking absolute name of <ctype.h>... " >&6; } | |
18004 | if ${gl_cv_next_ctype_h+:} false; then : | |
18005 | $as_echo_n "(cached) " >&6 | |
18006 | else | |
18007 | ||
18008 | ||
18009 | ||
18010 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18011 | /* end confdefs.h. */ | |
18012 | #include <ctype.h> | |
18013 | _ACEOF | |
18014 | case "$host_os" in | |
18015 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
18016 | *) gl_absname_cpp="$ac_cpp" ;; | |
18017 | esac | |
18018 | ||
18019 | case "$host_os" in | |
18020 | mingw*) | |
18021 | gl_dirsep_regex='[/\\]' | |
18022 | ;; | |
18023 | *) | |
18024 | gl_dirsep_regex='\/' | |
18025 | ;; | |
18026 | esac | |
18027 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
18028 | gl_header_literal_regex=`echo 'ctype.h' \ | |
18029 | | sed -e "$gl_make_literal_regex_sed"` | |
18030 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
18031 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
18032 | s|^/[^/]|//&| | |
18033 | p | |
18034 | q | |
18035 | }' | |
18036 | ||
18037 | gl_cv_absolute_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
18038 | sed -n "$gl_absolute_header_sed"` | |
18039 | ||
18040 | gl_header=$gl_cv_absolute_ctype_h | |
18041 | gl_cv_next_ctype_h='"'$gl_header'"' | |
18042 | ||
18043 | ||
18044 | fi | |
18045 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5 | |
18046 | $as_echo "$gl_cv_next_ctype_h" >&6; } | |
18047 | fi | |
18048 | NEXT_CTYPE_H=$gl_cv_next_ctype_h | |
18049 | ||
18050 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
18051 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
18052 | gl_next_as_first_directive='<'ctype.h'>' | |
18053 | else | |
18054 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
18055 | gl_next_as_first_directive=$gl_cv_next_ctype_h | |
18056 | fi | |
18057 | NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive | |
18058 | ||
18059 | ||
18060 | ||
18061 | ||
18062 | ||
18063 | ||
18064 | ||
18065 | ||
18066 | ||
c0c3707f CB |
18067 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5 |
18068 | $as_echo_n "checking for d_ino member in directory struct... " >&6; } | |
18069 | if ${gl_cv_struct_dirent_d_ino+:} false; then : | |
6ec2e0f5 SDJ |
18070 | $as_echo_n "(cached) " >&6 |
18071 | else | |
18072 | if test "$cross_compiling" = yes; then : | |
18073 | case "$host_os" in | |
c0c3707f CB |
18074 | # Guess yes on glibc systems with Linux kernel. |
18075 | linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;; | |
18076 | # Guess yes on musl systems with Linux kernel. | |
18077 | linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;; | |
18078 | # Guess no on native Windows. | |
18079 | mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;; | |
18080 | # If we don't know, obey --enable-cross-guesses. | |
18081 | *) gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;; | |
18082 | esac | |
3d99e817 | 18083 | |
6ec2e0f5 SDJ |
18084 | else |
18085 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18086 | /* end confdefs.h. */ | |
c0c3707f CB |
18087 | #include <sys/types.h> |
18088 | #include <sys/stat.h> | |
18089 | #include <dirent.h> | |
3d99e817 | 18090 | |
6ec2e0f5 SDJ |
18091 | int |
18092 | main () | |
18093 | { | |
c0c3707f CB |
18094 | DIR *dp = opendir ("."); |
18095 | struct dirent *e; | |
18096 | struct stat st; | |
18097 | if (! dp) | |
18098 | return 1; | |
18099 | e = readdir (dp); | |
18100 | if (! e) | |
18101 | { closedir (dp); return 2; } | |
18102 | if (lstat (e->d_name, &st) != 0) | |
18103 | { closedir (dp); return 3; } | |
18104 | if (e->d_ino != st.st_ino) | |
18105 | { closedir (dp); return 4; } | |
18106 | closedir (dp); | |
18107 | return 0; | |
18108 | ||
6ec2e0f5 SDJ |
18109 | ; |
18110 | return 0; | |
18111 | } | |
3d99e817 | 18112 | _ACEOF |
6ec2e0f5 | 18113 | if ac_fn_c_try_run "$LINENO"; then : |
c0c3707f CB |
18114 | gl_cv_struct_dirent_d_ino=yes |
18115 | else | |
18116 | gl_cv_struct_dirent_d_ino=no | |
18117 | fi | |
18118 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
18119 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
18120 | fi | |
18121 | ||
18122 | fi | |
18123 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5 | |
18124 | $as_echo "$gl_cv_struct_dirent_d_ino" >&6; } | |
18125 | case "$gl_cv_struct_dirent_d_ino" in | |
18126 | *yes) | |
18127 | ||
18128 | $as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h | |
18129 | ||
18130 | ;; | |
18131 | esac | |
18132 | ||
18133 | ||
18134 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_type member in directory struct" >&5 | |
18135 | $as_echo_n "checking for d_type member in directory struct... " >&6; } | |
18136 | if ${gl_cv_struct_dirent_d_type+:} false; then : | |
18137 | $as_echo_n "(cached) " >&6 | |
18138 | else | |
18139 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18140 | /* end confdefs.h. */ | |
18141 | ||
18142 | #include <sys/types.h> | |
18143 | #include <dirent.h> | |
18144 | ||
18145 | int | |
18146 | main () | |
18147 | { | |
18148 | struct dirent dp; dp.d_type = 0; | |
18149 | ; | |
18150 | return 0; | |
18151 | } | |
18152 | _ACEOF | |
18153 | if ac_fn_c_try_link "$LINENO"; then : | |
18154 | gl_cv_struct_dirent_d_type=yes | |
6ec2e0f5 | 18155 | else |
c0c3707f | 18156 | gl_cv_struct_dirent_d_type=no |
3d99e817 | 18157 | fi |
c0c3707f CB |
18158 | rm -f core conftest.err conftest.$ac_objext \ |
18159 | conftest$ac_exeext conftest.$ac_ext | |
3d99e817 | 18160 | |
3d99e817 | 18161 | |
c0c3707f CB |
18162 | fi |
18163 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_type" >&5 | |
18164 | $as_echo "$gl_cv_struct_dirent_d_type" >&6; } | |
18165 | if test $gl_cv_struct_dirent_d_type = yes; then | |
3d99e817 | 18166 | |
c0c3707f | 18167 | $as_echo "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h |
3d99e817 | 18168 | |
c0c3707f | 18169 | fi |
3d99e817 | 18170 | |
0750520d | 18171 | |
0750520d | 18172 | |
0750520d | 18173 | |
0750520d PA |
18174 | |
18175 | ||
0750520d | 18176 | |
0750520d | 18177 | |
0750520d | 18178 | |
0750520d | 18179 | |
0750520d | 18180 | |
0750520d | 18181 | |
0750520d | 18182 | |
0750520d | 18183 | |
c0c3707f CB |
18184 | if test $gl_cv_have_include_next = yes; then |
18185 | gl_cv_next_dirent_h='<'dirent.h'>' | |
18186 | else | |
18187 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5 | |
18188 | $as_echo_n "checking absolute name of <dirent.h>... " >&6; } | |
18189 | if ${gl_cv_next_dirent_h+:} false; then : | |
18190 | $as_echo_n "(cached) " >&6 | |
18191 | else | |
0750520d | 18192 | |
c0c3707f | 18193 | if test $ac_cv_header_dirent_h = yes; then |
6ec2e0f5 | 18194 | |
472fa5ee SM |
18195 | |
18196 | ||
18197 | ||
c0c3707f CB |
18198 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
18199 | /* end confdefs.h. */ | |
18200 | #include <dirent.h> | |
18201 | _ACEOF | |
18202 | case "$host_os" in | |
18203 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
18204 | *) gl_absname_cpp="$ac_cpp" ;; | |
18205 | esac | |
472fa5ee | 18206 | |
c0c3707f CB |
18207 | case "$host_os" in |
18208 | mingw*) | |
18209 | gl_dirsep_regex='[/\\]' | |
18210 | ;; | |
18211 | *) | |
18212 | gl_dirsep_regex='\/' | |
18213 | ;; | |
18214 | esac | |
18215 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
18216 | gl_header_literal_regex=`echo 'dirent.h' \ | |
18217 | | sed -e "$gl_make_literal_regex_sed"` | |
18218 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
18219 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
18220 | s|^/[^/]|//&| | |
18221 | p | |
18222 | q | |
18223 | }' | |
472fa5ee | 18224 | |
c0c3707f CB |
18225 | gl_cv_absolute_dirent_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
18226 | sed -n "$gl_absolute_header_sed"` | |
6ec2e0f5 | 18227 | |
c0c3707f CB |
18228 | gl_header=$gl_cv_absolute_dirent_h |
18229 | gl_cv_next_dirent_h='"'$gl_header'"' | |
18230 | else | |
18231 | gl_cv_next_dirent_h='<'dirent.h'>' | |
18232 | fi | |
6ec2e0f5 SDJ |
18233 | |
18234 | ||
c0c3707f CB |
18235 | fi |
18236 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5 | |
18237 | $as_echo "$gl_cv_next_dirent_h" >&6; } | |
18238 | fi | |
18239 | NEXT_DIRENT_H=$gl_cv_next_dirent_h | |
472fa5ee | 18240 | |
c0c3707f CB |
18241 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
18242 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
18243 | gl_next_as_first_directive='<'dirent.h'>' | |
18244 | else | |
18245 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
18246 | gl_next_as_first_directive=$gl_cv_next_dirent_h | |
18247 | fi | |
18248 | NEXT_AS_FIRST_DIRECTIVE_DIRENT_H=$gl_next_as_first_directive | |
472fa5ee SM |
18249 | |
18250 | ||
18251 | ||
18252 | ||
c0c3707f CB |
18253 | if test $ac_cv_header_dirent_h = yes; then |
18254 | HAVE_DIRENT_H=1 | |
6ec2e0f5 | 18255 | else |
c0c3707f | 18256 | HAVE_DIRENT_H=0 |
6ec2e0f5 SDJ |
18257 | fi |
18258 | ||
6ec2e0f5 | 18259 | |
0750520d | 18260 | |
0750520d | 18261 | |
0750520d | 18262 | |
472fa5ee SM |
18263 | |
18264 | ||
18265 | ||
18266 | ||
18267 | ||
0750520d | 18268 | |
c0c3707f CB |
18269 | for ac_func in dirfd |
18270 | do : | |
18271 | ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd" | |
18272 | if test "x$ac_cv_func_dirfd" = xyes; then : | |
18273 | cat >>confdefs.h <<_ACEOF | |
18274 | #define HAVE_DIRFD 1 | |
18275 | _ACEOF | |
0750520d | 18276 | |
c0c3707f CB |
18277 | fi |
18278 | done | |
0750520d | 18279 | |
c0c3707f CB |
18280 | ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h> |
18281 | #include <dirent.h> | |
18282 | " | |
18283 | if test "x$ac_cv_have_decl_dirfd" = xyes; then : | |
18284 | ac_have_decl=1 | |
8690e634 | 18285 | else |
c0c3707f CB |
18286 | ac_have_decl=0 |
18287 | fi | |
8690e634 | 18288 | |
c0c3707f CB |
18289 | cat >>confdefs.h <<_ACEOF |
18290 | #define HAVE_DECL_DIRFD $ac_have_decl | |
18291 | _ACEOF | |
49e4877c | 18292 | |
c0c3707f CB |
18293 | if test $ac_cv_have_decl_dirfd = no; then |
18294 | HAVE_DECL_DIRFD=0 | |
18295 | fi | |
8690e634 | 18296 | |
c0c3707f CB |
18297 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5 |
18298 | $as_echo_n "checking whether dirfd is a macro... " >&6; } | |
18299 | if ${gl_cv_func_dirfd_macro+:} false; then : | |
18300 | $as_echo_n "(cached) " >&6 | |
18301 | else | |
6ec2e0f5 SDJ |
18302 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
18303 | /* end confdefs.h. */ | |
8690e634 | 18304 | |
c0c3707f CB |
18305 | #include <sys/types.h> |
18306 | #include <dirent.h> | |
18307 | #ifdef dirfd | |
18308 | dirent_header_defines_dirfd | |
6ec2e0f5 | 18309 | #endif |
8690e634 | 18310 | _ACEOF |
c0c3707f CB |
18311 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
18312 | $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1; then : | |
18313 | gl_cv_func_dirfd_macro=yes | |
6ec2e0f5 | 18314 | else |
c0c3707f | 18315 | gl_cv_func_dirfd_macro=no |
6ec2e0f5 | 18316 | fi |
c0c3707f | 18317 | rm -f conftest* |
472fa5ee | 18318 | |
c0c3707f CB |
18319 | fi |
18320 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5 | |
18321 | $as_echo "$gl_cv_func_dirfd_macro" >&6; } | |
472fa5ee | 18322 | |
c0c3707f CB |
18323 | # Use the replacement if we have no function or macro with that name, |
18324 | # or if OS/2 kLIBC whose dirfd() does not work. | |
18325 | # Replace only if the system declares dirfd already. | |
18326 | case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in | |
18327 | no,no,*,yes | *,*,os2*,yes) | |
18328 | REPLACE_DIRFD=1 | |
472fa5ee | 18329 | |
c0c3707f CB |
18330 | $as_echo "#define REPLACE_DIRFD 1" >>confdefs.h |
18331 | ;; | |
18332 | esac | |
472fa5ee | 18333 | |
c0c3707f CB |
18334 | if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \ |
18335 | || test $REPLACE_DIRFD = 1; then | |
6ec2e0f5 | 18336 | |
6ec2e0f5 SDJ |
18337 | |
18338 | ||
18339 | ||
18340 | ||
472fa5ee SM |
18341 | |
18342 | ||
18343 | ||
c0c3707f | 18344 | gl_LIBOBJS="$gl_LIBOBJS dirfd.$ac_objext" |
472fa5ee SM |
18345 | |
18346 | ||
c0c3707f CB |
18347 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5 |
18348 | $as_echo_n "checking how to get the file descriptor associated with an open DIR*... " >&6; } | |
18349 | if ${gl_cv_sys_dir_fd_member_name+:} false; then : | |
18350 | $as_echo_n "(cached) " >&6 | |
18351 | else | |
6ec2e0f5 | 18352 | |
c0c3707f CB |
18353 | dirfd_save_CFLAGS=$CFLAGS |
18354 | for ac_expr in d_fd dd_fd; do | |
6ec2e0f5 | 18355 | |
c0c3707f CB |
18356 | CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr" |
18357 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18358 | /* end confdefs.h. */ | |
6ec2e0f5 | 18359 | |
c0c3707f CB |
18360 | #include <sys/types.h> |
18361 | #include <dirent.h> | |
18362 | int | |
18363 | main () | |
18364 | { | |
18365 | DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME; | |
18366 | ; | |
18367 | return 0; | |
18368 | } | |
18369 | _ACEOF | |
18370 | if ac_fn_c_try_compile "$LINENO"; then : | |
18371 | dir_fd_found=yes | |
6ec2e0f5 | 18372 | |
c0c3707f CB |
18373 | fi |
18374 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
18375 | CFLAGS=$dirfd_save_CFLAGS | |
18376 | test "$dir_fd_found" = yes && break | |
18377 | done | |
18378 | test "$dir_fd_found" = yes || ac_expr=no_such_member | |
472fa5ee | 18379 | |
c0c3707f | 18380 | gl_cv_sys_dir_fd_member_name=$ac_expr |
472fa5ee SM |
18381 | |
18382 | ||
c0c3707f CB |
18383 | fi |
18384 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5 | |
18385 | $as_echo "$gl_cv_sys_dir_fd_member_name" >&6; } | |
18386 | if test $gl_cv_sys_dir_fd_member_name != no_such_member; then | |
472fa5ee | 18387 | |
c0c3707f CB |
18388 | cat >>confdefs.h <<_ACEOF |
18389 | #define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name | |
18390 | _ACEOF | |
472fa5ee | 18391 | |
6ec2e0f5 SDJ |
18392 | fi |
18393 | ||
6ec2e0f5 | 18394 | |
c0c3707f | 18395 | fi |
6ec2e0f5 SDJ |
18396 | |
18397 | ||
18398 | ||
18399 | ||
18400 | ||
c0c3707f | 18401 | GNULIB_DIRFD=1 |
6ec2e0f5 SDJ |
18402 | |
18403 | ||
18404 | ||
6ec2e0f5 | 18405 | |
8690e634 | 18406 | |
c0c3707f | 18407 | $as_echo "#define GNULIB_TEST_DIRFD 1" >>confdefs.h |
8690e634 JK |
18408 | |
18409 | ||
8690e634 JK |
18410 | |
18411 | ||
18412 | ||
c0c3707f CB |
18413 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 |
18414 | $as_echo_n "checking whether // is distinct from /... " >&6; } | |
18415 | if ${gl_cv_double_slash_root+:} false; then : | |
18416 | $as_echo_n "(cached) " >&6 | |
18417 | else | |
18418 | if test x"$cross_compiling" = xyes ; then | |
18419 | # When cross-compiling, there is no way to tell whether // is special | |
18420 | # short of a list of hosts. However, the only known hosts to date | |
18421 | # that have a distinct // are Apollo DomainOS (too old to port to), | |
18422 | # Cygwin, and z/OS. If anyone knows of another system for which // has | |
18423 | # special semantics and is distinct from /, please report it to | |
18424 | # <bug-gnulib@gnu.org>. | |
18425 | case $host in | |
18426 | *-cygwin | i370-ibm-openedition) | |
18427 | gl_cv_double_slash_root=yes ;; | |
18428 | *) | |
18429 | # Be optimistic and assume that / and // are the same when we | |
18430 | # don't know. | |
18431 | gl_cv_double_slash_root='unknown, assuming no' ;; | |
18432 | esac | |
18433 | else | |
18434 | set x `ls -di / // 2>/dev/null` | |
18435 | if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then | |
18436 | gl_cv_double_slash_root=no | |
18437 | else | |
18438 | gl_cv_double_slash_root=yes | |
18439 | fi | |
18440 | fi | |
18441 | fi | |
18442 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 | |
18443 | $as_echo "$gl_cv_double_slash_root" >&6; } | |
18444 | if test "$gl_cv_double_slash_root" = yes; then | |
6ec2e0f5 | 18445 | |
c0c3707f | 18446 | $as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h |
8690e634 | 18447 | |
c0c3707f | 18448 | fi |
8690e634 | 18449 | |
63ce7108 TT |
18450 | |
18451 | ||
18452 | ||
18453 | ||
c0c3707f CB |
18454 | if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then |
18455 | REPLACE_DUP=1 | |
18456 | fi | |
8690e634 JK |
18457 | |
18458 | ||
18459 | ||
18460 | ||
18461 | ||
c0c3707f CB |
18462 | if test $ac_cv_func_fchdir = no; then |
18463 | HAVE_FCHDIR=0 | |
18464 | fi | |
8690e634 | 18465 | |
c0c3707f CB |
18466 | if test $HAVE_FCHDIR = 0; then |
18467 | REPLACE_DUP=1 | |
18468 | fi | |
8690e634 | 18469 | |
c0c3707f CB |
18470 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup works" >&5 |
18471 | $as_echo_n "checking whether dup works... " >&6; } | |
18472 | if ${gl_cv_func_dup_works+:} false; then : | |
8690e634 JK |
18473 | $as_echo_n "(cached) " >&6 |
18474 | else | |
c0c3707f CB |
18475 | if test "$cross_compiling" = yes; then : |
18476 | case "$host_os" in | |
18477 | # Guess no on native Windows. | |
18478 | mingw*) gl_cv_func_dup_works="guessing no" ;; | |
18479 | *) gl_cv_func_dup_works="guessing yes" ;; | |
18480 | esac | |
8690e634 | 18481 | |
c0c3707f | 18482 | else |
4a626d0a | 18483 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8690e634 | 18484 | /* end confdefs.h. */ |
c0c3707f CB |
18485 | #include <unistd.h> |
18486 | #include <fcntl.h> | |
18487 | #include <errno.h> | |
9c9d63b1 PM |
18488 | |
18489 | ||
18490 | $gl_mda_defines | |
18491 | ||
c0c3707f CB |
18492 | int |
18493 | main () | |
18494 | { | |
18495 | /* On OS/2 kLIBC, dup does not work on a directory fd. */ | |
18496 | int fd = open (".", O_RDONLY); | |
18497 | return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0; | |
8690e634 | 18498 | |
c0c3707f CB |
18499 | ; |
18500 | return 0; | |
18501 | } | |
8690e634 | 18502 | |
c0c3707f CB |
18503 | _ACEOF |
18504 | if ac_fn_c_try_run "$LINENO"; then : | |
18505 | gl_cv_func_dup_works=yes | |
18506 | else | |
18507 | gl_cv_func_dup_works=no | |
18508 | fi | |
18509 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
18510 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
8690e634 | 18511 | fi |
8690e634 | 18512 | |
8690e634 | 18513 | |
c0c3707f CB |
18514 | fi |
18515 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup_works" >&5 | |
18516 | $as_echo "$gl_cv_func_dup_works" >&6; } | |
18517 | case "$gl_cv_func_dup_works" in | |
18518 | *yes) ;; | |
18519 | *) | |
18520 | REPLACE_DUP=1 | |
18521 | ;; | |
18522 | esac | |
8690e634 | 18523 | |
c0c3707f | 18524 | if test $REPLACE_DUP = 1; then |
8690e634 JK |
18525 | |
18526 | ||
18527 | ||
18528 | ||
6ec2e0f5 SDJ |
18529 | |
18530 | ||
18531 | ||
18532 | ||
c0c3707f | 18533 | gl_LIBOBJS="$gl_LIBOBJS dup.$ac_objext" |
8690e634 | 18534 | |
c0c3707f CB |
18535 | : |
18536 | fi | |
8690e634 | 18537 | |
5e8754f9 | 18538 | |
8690e634 JK |
18539 | |
18540 | ||
8839a007 | 18541 | |
c0c3707f | 18542 | GNULIB_DUP=1 |
63ce7108 | 18543 | |
63ce7108 | 18544 | |
63ce7108 | 18545 | |
6ec2e0f5 | 18546 | |
6ec2e0f5 | 18547 | |
c0c3707f | 18548 | $as_echo "#define GNULIB_TEST_DUP 1" >>confdefs.h |
6ec2e0f5 | 18549 | |
63ce7108 TT |
18550 | |
18551 | ||
472fa5ee SM |
18552 | |
18553 | ||
18554 | ||
9c9d63b1 | 18555 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5 |
c0c3707f CB |
18556 | $as_echo_n "checking whether dup2 works... " >&6; } |
18557 | if ${gl_cv_func_dup2_works+:} false; then : | |
6ec2e0f5 SDJ |
18558 | $as_echo_n "(cached) " >&6 |
18559 | else | |
18560 | if test "$cross_compiling" = yes; then : | |
18561 | case "$host_os" in | |
9c9d63b1 PM |
18562 | mingw*) # on this platform, dup2 always returns 0 for success |
18563 | gl_cv_func_dup2_works="guessing no" ;; | |
18564 | cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 | |
18565 | gl_cv_func_dup2_works="guessing no" ;; | |
18566 | aix* | freebsd*) | |
18567 | # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, | |
18568 | # not EBADF. | |
18569 | gl_cv_func_dup2_works="guessing no" ;; | |
18570 | haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. | |
18571 | gl_cv_func_dup2_works="guessing no" ;; | |
18572 | *-android*) # implemented using dup3(), which fails if oldfd == newfd | |
18573 | gl_cv_func_dup2_works="guessing no" ;; | |
18574 | os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. | |
18575 | gl_cv_func_dup2_works="guessing no" ;; | |
18576 | *) gl_cv_func_dup2_works="guessing yes" ;; | |
18577 | esac | |
63ce7108 TT |
18578 | else |
18579 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18580 | /* end confdefs.h. */ | |
18581 | ||
9c9d63b1 PM |
18582 | #include <errno.h> |
18583 | #include <fcntl.h> | |
18584 | #include <limits.h> | |
18585 | #include <sys/resource.h> | |
18586 | #include <unistd.h> | |
18587 | ||
18588 | ||
18589 | $gl_mda_defines | |
18590 | ||
18591 | #ifndef RLIM_SAVED_CUR | |
18592 | # define RLIM_SAVED_CUR RLIM_INFINITY | |
18593 | #endif | |
18594 | #ifndef RLIM_SAVED_MAX | |
18595 | # define RLIM_SAVED_MAX RLIM_INFINITY | |
18596 | #endif | |
63ce7108 TT |
18597 | |
18598 | int | |
18599 | main () | |
18600 | { | |
6ec2e0f5 | 18601 | int result = 0; |
9c9d63b1 PM |
18602 | int bad_fd = INT_MAX; |
18603 | struct rlimit rlim; | |
18604 | if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 | |
18605 | && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX | |
18606 | && rlim.rlim_cur != RLIM_INFINITY | |
18607 | && rlim.rlim_cur != RLIM_SAVED_MAX | |
18608 | && rlim.rlim_cur != RLIM_SAVED_CUR) | |
18609 | bad_fd = rlim.rlim_cur; | |
18610 | #ifdef FD_CLOEXEC | |
18611 | if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) | |
18612 | result |= 1; | |
18613 | #endif | |
18614 | if (dup2 (1, 1) != 1) | |
18615 | result |= 2; | |
18616 | #ifdef FD_CLOEXEC | |
18617 | if (fcntl (1, F_GETFD) != FD_CLOEXEC) | |
18618 | result |= 4; | |
18619 | #endif | |
18620 | close (0); | |
18621 | if (dup2 (0, 0) != -1) | |
18622 | result |= 8; | |
18623 | /* Many gnulib modules require POSIX conformance of EBADF. */ | |
18624 | if (dup2 (2, bad_fd) == -1 && errno != EBADF) | |
18625 | result |= 16; | |
18626 | /* Flush out some cygwin core dumps. */ | |
18627 | if (dup2 (2, -1) != -1 || errno != EBADF) | |
18628 | result |= 32; | |
18629 | dup2 (2, 255); | |
18630 | dup2 (2, 256); | |
18631 | /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ | |
18632 | { | |
18633 | int fd = open (".", O_RDONLY); | |
18634 | if (fd == -1) | |
18635 | result |= 64; | |
18636 | else if (dup2 (fd, fd + 1) == -1) | |
18637 | result |= 128; | |
18638 | close (fd); | |
18639 | } | |
18640 | return result; | |
63ce7108 TT |
18641 | ; |
18642 | return 0; | |
18643 | } | |
c0c3707f | 18644 | |
63ce7108 TT |
18645 | _ACEOF |
18646 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 18647 | gl_cv_func_dup2_works=yes |
63ce7108 | 18648 | else |
c0c3707f | 18649 | gl_cv_func_dup2_works=no |
63ce7108 TT |
18650 | fi |
18651 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
18652 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
18653 | fi | |
18654 | ||
c0c3707f | 18655 | |
63ce7108 | 18656 | fi |
c0c3707f CB |
18657 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5 |
18658 | $as_echo "$gl_cv_func_dup2_works" >&6; } | |
9c9d63b1 PM |
18659 | case "$gl_cv_func_dup2_works" in |
18660 | *yes) ;; | |
18661 | *) | |
18662 | REPLACE_DUP2=1 | |
18663 | for ac_func in setdtablesize | |
c0c3707f CB |
18664 | do : |
18665 | ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize" | |
18666 | if test "x$ac_cv_func_setdtablesize" = xyes; then : | |
18667 | cat >>confdefs.h <<_ACEOF | |
18668 | #define HAVE_SETDTABLESIZE 1 | |
18669 | _ACEOF | |
18670 | ||
18671 | fi | |
18672 | done | |
18673 | ||
9c9d63b1 PM |
18674 | ;; |
18675 | esac | |
63ce7108 | 18676 | |
09607c9e TT |
18677 | |
18678 | ||
18679 | ||
c0c3707f CB |
18680 | if test $ac_cv_func_fchdir = no; then |
18681 | HAVE_FCHDIR=0 | |
18682 | fi | |
4a626d0a | 18683 | |
c0c3707f | 18684 | if test $HAVE_FCHDIR = 0; then |
9c9d63b1 | 18685 | REPLACE_DUP2=1 |
c0c3707f | 18686 | fi |
4a626d0a PA |
18687 | |
18688 | ||
9c9d63b1 | 18689 | if test $REPLACE_DUP2 = 1; then |
4a626d0a PA |
18690 | |
18691 | ||
18692 | ||
18693 | ||
18694 | ||
18695 | ||
4a626d0a | 18696 | |
4a626d0a | 18697 | |
c0c3707f | 18698 | gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" |
4a626d0a PA |
18699 | |
18700 | ||
c0c3707f | 18701 | fi |
4a626d0a PA |
18702 | |
18703 | ||
18704 | ||
18705 | ||
18706 | ||
c0c3707f | 18707 | GNULIB_DUP2=1 |
4a626d0a PA |
18708 | |
18709 | ||
18710 | ||
18711 | ||
09607c9e | 18712 | |
c0c3707f | 18713 | $as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h |
09607c9e TT |
18714 | |
18715 | ||
472fa5ee SM |
18716 | |
18717 | ||
18718 | ||
18719 | ||
18720 | ||
09607c9e | 18721 | |
6ec2e0f5 | 18722 | |
c0c3707f | 18723 | GNULIB_ENVIRON=1 |
6ec2e0f5 | 18724 | |
09607c9e | 18725 | |
09607c9e | 18726 | |
6ec2e0f5 SDJ |
18727 | |
18728 | ||
c0c3707f | 18729 | $as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h |
6ec2e0f5 SDJ |
18730 | |
18731 | ||
6ec2e0f5 | 18732 | |
5e8754f9 | 18733 | |
6ec2e0f5 | 18734 | |
c0c3707f CB |
18735 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 |
18736 | $as_echo_n "checking for error_at_line... " >&6; } | |
18737 | if ${ac_cv_lib_error_at_line+:} false; then : | |
09607c9e | 18738 | $as_echo_n "(cached) " >&6 |
4a626d0a PA |
18739 | else |
18740 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18741 | /* end confdefs.h. */ | |
c0c3707f CB |
18742 | #include <error.h> |
18743 | int | |
18744 | main () | |
18745 | { | |
18746 | error_at_line (0, 0, "", 0, "an error occurred"); | |
18747 | ; | |
4a626d0a PA |
18748 | return 0; |
18749 | } | |
18750 | _ACEOF | |
c0c3707f CB |
18751 | if ac_fn_c_try_link "$LINENO"; then : |
18752 | ac_cv_lib_error_at_line=yes | |
4a626d0a | 18753 | else |
c0c3707f | 18754 | ac_cv_lib_error_at_line=no |
6ec2e0f5 | 18755 | fi |
c0c3707f CB |
18756 | rm -f core conftest.err conftest.$ac_objext \ |
18757 | conftest$ac_exeext conftest.$ac_ext | |
6ec2e0f5 | 18758 | fi |
c0c3707f CB |
18759 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 |
18760 | $as_echo "$ac_cv_lib_error_at_line" >&6; } | |
09607c9e | 18761 | |
c0c3707f | 18762 | if test $ac_cv_lib_error_at_line = no; then |
09607c9e TT |
18763 | |
18764 | ||
18765 | ||
18766 | ||
18767 | ||
18768 | ||
18769 | ||
18770 | ||
c0c3707f | 18771 | gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext" |
09607c9e | 18772 | |
4a626d0a | 18773 | |
09607c9e | 18774 | |
c0c3707f | 18775 | : |
4a626d0a | 18776 | |
c0c3707f | 18777 | fi |
4a626d0a | 18778 | |
4a626d0a | 18779 | |
09607c9e | 18780 | |
09607c9e | 18781 | |
09607c9e TT |
18782 | |
18783 | ||
09607c9e | 18784 | |
c0c3707f CB |
18785 | if test $ac_cv_have_decl_fchdir = no; then |
18786 | HAVE_DECL_FCHDIR=0 | |
18787 | fi | |
09607c9e TT |
18788 | |
18789 | ||
c0c3707f | 18790 | if test $HAVE_FCHDIR = 0; then |
09607c9e TT |
18791 | |
18792 | ||
18793 | ||
c0c3707f CB |
18794 | |
18795 | ||
18796 | ||
18797 | ||
18798 | ||
18799 | gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext" | |
18800 | ||
18801 | : | |
18802 | ||
18803 | $as_echo "#define REPLACE_FCHDIR 1" >>confdefs.h | |
18804 | ||
18805 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open can visit directories" >&5 | |
18806 | $as_echo_n "checking whether open can visit directories... " >&6; } | |
18807 | if ${gl_cv_func_open_directory_works+:} false; then : | |
18808 | $as_echo_n "(cached) " >&6 | |
3d99e817 | 18809 | else |
c0c3707f CB |
18810 | if test "$cross_compiling" = yes; then : |
18811 | case "$host_os" in | |
9c9d63b1 PM |
18812 | # Guess yes on Linux systems. |
18813 | linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;; | |
18814 | # Guess yes on glibc systems. | |
18815 | *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;; | |
18816 | # Guess no on native Windows. | |
18817 | mingw*) gl_cv_func_open_directory_works="guessing no" ;; | |
18818 | # If we don't know, obey --enable-cross-guesses. | |
18819 | *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;; | |
18820 | esac | |
c0c3707f CB |
18821 | |
18822 | else | |
18823 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18824 | /* end confdefs.h. */ | |
18825 | #include <fcntl.h> | |
18826 | ||
9c9d63b1 PM |
18827 | |
18828 | $gl_mda_defines | |
18829 | ||
c0c3707f CB |
18830 | int |
18831 | main () | |
18832 | { | |
18833 | return open(".", O_RDONLY) < 0; | |
18834 | ; | |
18835 | return 0; | |
18836 | } | |
18837 | _ACEOF | |
18838 | if ac_fn_c_try_run "$LINENO"; then : | |
18839 | gl_cv_func_open_directory_works=yes | |
18840 | else | |
18841 | gl_cv_func_open_directory_works=no | |
18842 | fi | |
18843 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
18844 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
3d99e817 AK |
18845 | fi |
18846 | ||
c0c3707f CB |
18847 | fi |
18848 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_directory_works" >&5 | |
18849 | $as_echo "$gl_cv_func_open_directory_works" >&6; } | |
18850 | case "$gl_cv_func_open_directory_works" in | |
18851 | *yes) ;; | |
18852 | *) | |
3d99e817 | 18853 | |
c0c3707f | 18854 | $as_echo "#define REPLACE_OPEN_DIRECTORY 1" >>confdefs.h |
09607c9e | 18855 | |
c0c3707f CB |
18856 | ;; |
18857 | esac | |
18858 | fi | |
8690e634 | 18859 | |
8690e634 | 18860 | |
8690e634 | 18861 | |
8690e634 | 18862 | |
8690e634 | 18863 | |
6ec2e0f5 | 18864 | |
c0c3707f | 18865 | GNULIB_FCHDIR=1 |
6ec2e0f5 SDJ |
18866 | |
18867 | ||
6ec2e0f5 | 18868 | |
8690e634 JK |
18869 | |
18870 | ||
c0c3707f | 18871 | $as_echo "#define GNULIB_TEST_FCHDIR 1" >>confdefs.h |
8690e634 JK |
18872 | |
18873 | ||
18874 | ||
6ec2e0f5 SDJ |
18875 | |
18876 | ||
18877 | ||
6ec2e0f5 | 18878 | |
8690e634 | 18879 | |
c0c3707f | 18880 | if test $ac_cv_func_fcntl = no; then |
8690e634 JK |
18881 | |
18882 | ||
6ec2e0f5 | 18883 | |
c0c3707f CB |
18884 | if test $ac_cv_func_fcntl = no; then |
18885 | HAVE_FCNTL=0 | |
18886 | else | |
18887 | REPLACE_FCNTL=1 | |
18888 | fi | |
5e8754f9 | 18889 | |
c0c3707f CB |
18890 | else |
18891 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5 | |
18892 | $as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; } | |
18893 | if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then : | |
8690e634 | 18894 | $as_echo_n "(cached) " >&6 |
6ec2e0f5 | 18895 | else |
c0c3707f CB |
18896 | if test "$cross_compiling" = yes; then : |
18897 | case $host_os in | |
18898 | aix* | cygwin* | haiku*) | |
18899 | gl_cv_func_fcntl_f_dupfd_works="guessing no" ;; | |
18900 | *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;; | |
18901 | esac | |
18902 | else | |
18903 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18904 | /* end confdefs.h. */ | |
18905 | #include <errno.h> | |
18906 | #include <fcntl.h> | |
18907 | #include <limits.h> | |
18908 | #include <sys/resource.h> | |
18909 | #include <unistd.h> | |
9c9d63b1 PM |
18910 | |
18911 | ||
18912 | $gl_mda_defines | |
18913 | ||
c0c3707f CB |
18914 | #ifndef RLIM_SAVED_CUR |
18915 | # define RLIM_SAVED_CUR RLIM_INFINITY | |
18916 | #endif | |
18917 | #ifndef RLIM_SAVED_MAX | |
18918 | # define RLIM_SAVED_MAX RLIM_INFINITY | |
18919 | #endif | |
18920 | ||
18921 | int | |
18922 | main () | |
18923 | { | |
18924 | int result = 0; | |
18925 | int bad_fd = INT_MAX; | |
18926 | struct rlimit rlim; | |
18927 | if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 | |
18928 | && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX | |
18929 | && rlim.rlim_cur != RLIM_INFINITY | |
18930 | && rlim.rlim_cur != RLIM_SAVED_MAX | |
18931 | && rlim.rlim_cur != RLIM_SAVED_CUR) | |
18932 | bad_fd = rlim.rlim_cur; | |
18933 | if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; | |
18934 | if (errno != EINVAL) result |= 2; | |
18935 | if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; | |
18936 | if (errno != EINVAL) result |= 8; | |
18937 | /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */ | |
18938 | { | |
18939 | int fd; | |
18940 | fd = open (".", O_RDONLY); | |
18941 | if (fd == -1) | |
18942 | result |= 16; | |
18943 | else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1) | |
18944 | result |= 32; | |
18945 | ||
18946 | close (fd); | |
18947 | } | |
18948 | return result; | |
18949 | ; | |
18950 | return 0; | |
18951 | } | |
18952 | _ACEOF | |
18953 | if ac_fn_c_try_run "$LINENO"; then : | |
18954 | gl_cv_func_fcntl_f_dupfd_works=yes | |
18955 | else | |
18956 | gl_cv_func_fcntl_f_dupfd_works=no | |
18957 | fi | |
18958 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
18959 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
18960 | fi | |
18961 | ||
18962 | fi | |
18963 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5 | |
18964 | $as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; } | |
18965 | case $gl_cv_func_fcntl_f_dupfd_works in | |
18966 | *yes) ;; | |
18967 | *) | |
18968 | ||
18969 | ||
18970 | if test $ac_cv_func_fcntl = no; then | |
18971 | HAVE_FCNTL=0 | |
18972 | else | |
18973 | REPLACE_FCNTL=1 | |
18974 | fi | |
18975 | ||
18976 | ||
18977 | $as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h | |
18978 | ;; | |
18979 | esac | |
18980 | ||
9c9d63b1 | 18981 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5 |
c0c3707f CB |
18982 | $as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; } |
18983 | if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then : | |
18984 | $as_echo_n "(cached) " >&6 | |
9c9d63b1 PM |
18985 | else |
18986 | if test "$cross_compiling" = yes; then : | |
18987 | case "$host_os" in | |
18988 | # Guess no on NetBSD. | |
18989 | netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;; | |
18990 | *) gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" ;; | |
18991 | esac | |
18992 | ||
8690e634 JK |
18993 | else |
18994 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18995 | /* end confdefs.h. */ | |
c0c3707f | 18996 | #include <fcntl.h> |
9c9d63b1 PM |
18997 | #include <unistd.h> |
18998 | int main (int argc, char *argv[]) | |
18999 | { | |
19000 | if (argc == 1) | |
19001 | /* parent process */ | |
19002 | { | |
19003 | if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0) | |
19004 | return 1; | |
19005 | return execl ("./conftest", "./conftest", "child", NULL); | |
19006 | } | |
19007 | else | |
19008 | /* child process */ | |
19009 | return (fcntl (10, F_GETFL) < 0 ? 0 : 42); | |
19010 | } | |
c0c3707f | 19011 | |
c0c3707f | 19012 | |
c0c3707f | 19013 | _ACEOF |
9c9d63b1 | 19014 | if ac_fn_c_try_run "$LINENO"; then : |
c0c3707f CB |
19015 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
19016 | /* end confdefs.h. */ | |
19017 | ||
19018 | #ifdef __linux__ | |
19019 | /* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace | |
19020 | it to support the semantics on older kernels that failed with EINVAL. */ | |
19021 | choke me | |
19022 | #endif | |
8690e634 | 19023 | |
8690e634 JK |
19024 | int |
19025 | main () | |
19026 | { | |
19027 | ||
19028 | ; | |
19029 | return 0; | |
19030 | } | |
19031 | _ACEOF | |
c0c3707f CB |
19032 | if ac_fn_c_try_compile "$LINENO"; then : |
19033 | gl_cv_func_fcntl_f_dupfd_cloexec=yes | |
8690e634 | 19034 | else |
c0c3707f | 19035 | gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check" |
8690e634 | 19036 | fi |
c0c3707f | 19037 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
9c9d63b1 | 19038 | |
c0c3707f CB |
19039 | else |
19040 | gl_cv_func_fcntl_f_dupfd_cloexec=no | |
19041 | fi | |
9c9d63b1 PM |
19042 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
19043 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
19044 | fi | |
19045 | ||
19046 | ||
8690e634 | 19047 | fi |
c0c3707f CB |
19048 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5 |
19049 | $as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; } | |
9c9d63b1 PM |
19050 | case "$gl_cv_func_fcntl_f_dupfd_cloexec" in |
19051 | *yes) ;; | |
19052 | *) | |
8690e634 | 19053 | |
c0c3707f CB |
19054 | |
19055 | if test $ac_cv_func_fcntl = no; then | |
19056 | HAVE_FCNTL=0 | |
5e8754f9 | 19057 | else |
c0c3707f CB |
19058 | REPLACE_FCNTL=1 |
19059 | fi | |
19060 | ||
9c9d63b1 PM |
19061 | ;; |
19062 | esac | |
8690e634 JK |
19063 | fi |
19064 | ||
19065 | ||
8690e634 | 19066 | |
8690e634 | 19067 | |
c0c3707f CB |
19068 | if test $ac_cv_func_fchdir = no; then |
19069 | HAVE_FCHDIR=0 | |
19070 | fi | |
6ec2e0f5 | 19071 | |
c0c3707f | 19072 | if test $HAVE_FCHDIR = 0; then |
6ec2e0f5 SDJ |
19073 | |
19074 | ||
19075 | ||
c0c3707f CB |
19076 | if test $ac_cv_func_fcntl = no; then |
19077 | HAVE_FCNTL=0 | |
19078 | else | |
19079 | REPLACE_FCNTL=1 | |
19080 | fi | |
6ec2e0f5 | 19081 | |
c0c3707f | 19082 | fi |
6ec2e0f5 SDJ |
19083 | |
19084 | ||
c0c3707f | 19085 | if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then |
6ec2e0f5 | 19086 | |
6ec2e0f5 SDJ |
19087 | |
19088 | ||
5e8754f9 SDJ |
19089 | |
19090 | ||
8690e634 | 19091 | |
8690e634 JK |
19092 | |
19093 | ||
c0c3707f | 19094 | gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext" |
472fa5ee | 19095 | |
c0c3707f | 19096 | fi |
472fa5ee SM |
19097 | |
19098 | ||
19099 | ||
19100 | ||
19101 | ||
c0c3707f | 19102 | GNULIB_FCNTL=1 |
472fa5ee SM |
19103 | |
19104 | ||
19105 | ||
19106 | ||
19107 | ||
c0c3707f | 19108 | $as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h |
472fa5ee SM |
19109 | |
19110 | ||
19111 | ||
19112 | ||
19113 | ||
19114 | ||
19115 | ||
19116 | ||
19117 | ||
19118 | ||
19119 | ||
19120 | ||
19121 | ||
19122 | ||
c0c3707f CB |
19123 | if test $gl_cv_have_include_next = yes; then |
19124 | gl_cv_next_fcntl_h='<'fcntl.h'>' | |
19125 | else | |
19126 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5 | |
19127 | $as_echo_n "checking absolute name of <fcntl.h>... " >&6; } | |
19128 | if ${gl_cv_next_fcntl_h+:} false; then : | |
19129 | $as_echo_n "(cached) " >&6 | |
19130 | else | |
472fa5ee SM |
19131 | |
19132 | ||
472fa5ee | 19133 | |
c0c3707f CB |
19134 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
19135 | /* end confdefs.h. */ | |
19136 | #include <fcntl.h> | |
19137 | _ACEOF | |
19138 | case "$host_os" in | |
19139 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
19140 | *) gl_absname_cpp="$ac_cpp" ;; | |
19141 | esac | |
472fa5ee | 19142 | |
c0c3707f CB |
19143 | case "$host_os" in |
19144 | mingw*) | |
19145 | gl_dirsep_regex='[/\\]' | |
19146 | ;; | |
19147 | *) | |
19148 | gl_dirsep_regex='\/' | |
19149 | ;; | |
19150 | esac | |
19151 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
19152 | gl_header_literal_regex=`echo 'fcntl.h' \ | |
19153 | | sed -e "$gl_make_literal_regex_sed"` | |
19154 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
19155 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
19156 | s|^/[^/]|//&| | |
19157 | p | |
19158 | q | |
19159 | }' | |
472fa5ee | 19160 | |
c0c3707f CB |
19161 | gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
19162 | sed -n "$gl_absolute_header_sed"` | |
472fa5ee | 19163 | |
c0c3707f CB |
19164 | gl_header=$gl_cv_absolute_fcntl_h |
19165 | gl_cv_next_fcntl_h='"'$gl_header'"' | |
8690e634 JK |
19166 | |
19167 | ||
c0c3707f CB |
19168 | fi |
19169 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5 | |
19170 | $as_echo "$gl_cv_next_fcntl_h" >&6; } | |
19171 | fi | |
19172 | NEXT_FCNTL_H=$gl_cv_next_fcntl_h | |
8690e634 | 19173 | |
c0c3707f CB |
19174 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
19175 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
19176 | gl_next_as_first_directive='<'fcntl.h'>' | |
19177 | else | |
19178 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
19179 | gl_next_as_first_directive=$gl_cv_next_fcntl_h | |
19180 | fi | |
19181 | NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive | |
8690e634 JK |
19182 | |
19183 | ||
19184 | ||
19185 | ||
5e8754f9 SDJ |
19186 | |
19187 | ||
19188 | ||
19189 | ||
472fa5ee SM |
19190 | |
19191 | ||
19192 | ||
19193 | ||
19194 | ||
19195 | ||
19196 | ||
5e8754f9 | 19197 | cat >>confdefs.h <<_ACEOF |
c0c3707f | 19198 | #define GNULIB_FD_SAFER_FLAG 1 |
5e8754f9 | 19199 | _ACEOF |
472fa5ee SM |
19200 | |
19201 | ||
c0c3707f CB |
19202 | |
19203 | ||
19204 | ||
19205 | ||
19206 | ||
19207 | ac_fn_c_check_decl "$LINENO" "fdopendir" "ac_cv_have_decl_fdopendir" " | |
19208 | #include <dirent.h> | |
19209 | ||
5e8754f9 | 19210 | " |
c0c3707f | 19211 | if test "x$ac_cv_have_decl_fdopendir" = xyes; then : |
5e8754f9 SDJ |
19212 | ac_have_decl=1 |
19213 | else | |
19214 | ac_have_decl=0 | |
19215 | fi | |
472fa5ee | 19216 | |
5e8754f9 | 19217 | cat >>confdefs.h <<_ACEOF |
c0c3707f | 19218 | #define HAVE_DECL_FDOPENDIR $ac_have_decl |
5e8754f9 | 19219 | _ACEOF |
c0c3707f | 19220 | if test $ac_have_decl = 1; then : |
472fa5ee | 19221 | |
c0c3707f CB |
19222 | else |
19223 | HAVE_DECL_FDOPENDIR=0 | |
19224 | fi | |
472fa5ee SM |
19225 | |
19226 | ||
c0c3707f CB |
19227 | if test $ac_cv_func_fdopendir = no; then |
19228 | HAVE_FDOPENDIR=0 | |
19229 | else | |
19230 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fdopendir works" >&5 | |
19231 | $as_echo_n "checking whether fdopendir works... " >&6; } | |
19232 | if ${gl_cv_func_fdopendir_works+:} false; then : | |
19233 | $as_echo_n "(cached) " >&6 | |
19234 | else | |
19235 | if test "$cross_compiling" = yes; then : | |
19236 | case "$host_os" in | |
19237 | # Guess yes on glibc systems. | |
19238 | *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;; | |
19239 | # Guess yes on musl systems. | |
19240 | *-musl*) gl_cv_func_fdopendir_works="guessing yes" ;; | |
19241 | # If we don't know, obey --enable-cross-guesses. | |
19242 | *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;; | |
19243 | esac | |
472fa5ee | 19244 | |
c0c3707f CB |
19245 | else |
19246 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19247 | /* end confdefs.h. */ | |
472fa5ee | 19248 | |
c0c3707f CB |
19249 | #include <dirent.h> |
19250 | #include <fcntl.h> | |
19251 | #include <unistd.h> | |
9c9d63b1 PM |
19252 | |
19253 | ||
19254 | $gl_mda_defines | |
19255 | ||
c0c3707f CB |
19256 | #if !HAVE_DECL_FDOPENDIR |
19257 | extern | |
19258 | # ifdef __cplusplus | |
19259 | "C" | |
19260 | # endif | |
19261 | DIR *fdopendir (int); | |
19262 | #endif | |
472fa5ee | 19263 | |
c0c3707f CB |
19264 | int |
19265 | main () | |
19266 | { | |
19267 | int result = 0; | |
9c9d63b1 PM |
19268 | int fd = open ("conftest.c", O_RDONLY); |
19269 | if (fd < 0) result |= 1; | |
19270 | if (fdopendir (fd)) result |= 2; | |
19271 | if (close (fd)) result |= 4; | |
19272 | return result; | |
19273 | ||
c0c3707f CB |
19274 | ; |
19275 | return 0; | |
19276 | } | |
19277 | _ACEOF | |
19278 | if ac_fn_c_try_run "$LINENO"; then : | |
19279 | gl_cv_func_fdopendir_works=yes | |
19280 | else | |
19281 | gl_cv_func_fdopendir_works=no | |
19282 | fi | |
19283 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
19284 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
19285 | fi | |
472fa5ee | 19286 | |
c0c3707f CB |
19287 | fi |
19288 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopendir_works" >&5 | |
19289 | $as_echo "$gl_cv_func_fdopendir_works" >&6; } | |
19290 | case "$gl_cv_func_fdopendir_works" in | |
19291 | *yes) ;; | |
19292 | *) | |
19293 | REPLACE_FDOPENDIR=1 | |
19294 | ;; | |
19295 | esac | |
19296 | fi | |
472fa5ee | 19297 | |
c0c3707f | 19298 | if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then |
472fa5ee SM |
19299 | |
19300 | ||
19301 | ||
19302 | ||
19303 | ||
98399780 | 19304 | |
5e8754f9 SDJ |
19305 | |
19306 | ||
c0c3707f | 19307 | gl_LIBOBJS="$gl_LIBOBJS fdopendir.$ac_objext" |
5e8754f9 | 19308 | |
c0c3707f | 19309 | fi |
5e8754f9 SDJ |
19310 | |
19311 | ||
19312 | ||
19313 | ||
19314 | ||
c0c3707f | 19315 | GNULIB_FDOPENDIR=1 |
5e8754f9 SDJ |
19316 | |
19317 | ||
19318 | ||
19319 | ||
19320 | ||
c0c3707f | 19321 | $as_echo "#define GNULIB_TEST_FDOPENDIR 1" >>confdefs.h |
5e8754f9 SDJ |
19322 | |
19323 | ||
5e8754f9 SDJ |
19324 | |
19325 | ||
19326 | ||
c0c3707f CB |
19327 | cat >>confdefs.h <<_ACEOF |
19328 | #define GNULIB_FDOPENDIR 1 | |
19329 | _ACEOF | |
5e8754f9 SDJ |
19330 | |
19331 | ||
19332 | ||
5e8754f9 SDJ |
19333 | |
19334 | ||
19335 | ||
c0c3707f CB |
19336 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5 |
19337 | $as_echo_n "checking for flexible array member... " >&6; } | |
19338 | if ${ac_cv_c_flexmember+:} false; then : | |
5e8754f9 | 19339 | $as_echo_n "(cached) " >&6 |
6ec2e0f5 | 19340 | else |
c0c3707f | 19341 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5e8754f9 | 19342 | /* end confdefs.h. */ |
c0c3707f CB |
19343 | #include <stdlib.h> |
19344 | #include <stdio.h> | |
19345 | #include <stddef.h> | |
19346 | struct m { struct m *next, **list; char name[]; }; | |
19347 | struct s { struct s *p; struct m *m; int n; double d[]; }; | |
5e8754f9 SDJ |
19348 | int |
19349 | main () | |
19350 | { | |
c0c3707f CB |
19351 | int m = getchar (); |
19352 | size_t nbytes = offsetof (struct s, d) + m * sizeof (double); | |
19353 | nbytes += sizeof (struct s) - 1; | |
19354 | nbytes -= nbytes % sizeof (struct s); | |
19355 | struct s *p = malloc (nbytes); | |
19356 | p->p = p; | |
19357 | p->m = NULL; | |
19358 | p->d[0] = 0.0; | |
19359 | return p->d != (double *) NULL; | |
5e8754f9 SDJ |
19360 | ; |
19361 | return 0; | |
19362 | } | |
7a6dbc2f | 19363 | _ACEOF |
c0c3707f CB |
19364 | if ac_fn_c_try_compile "$LINENO"; then : |
19365 | ac_cv_c_flexmember=yes | |
5e8754f9 | 19366 | else |
c0c3707f | 19367 | ac_cv_c_flexmember=no |
5e8754f9 | 19368 | fi |
c0c3707f | 19369 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
5e8754f9 | 19370 | fi |
c0c3707f CB |
19371 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5 |
19372 | $as_echo "$ac_cv_c_flexmember" >&6; } | |
19373 | if test $ac_cv_c_flexmember = yes; then | |
19374 | ||
19375 | $as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h | |
5e8754f9 | 19376 | |
c0c3707f CB |
19377 | else |
19378 | $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h | |
98399780 | 19379 | |
c0c3707f | 19380 | fi |
98399780 | 19381 | |
472fa5ee SM |
19382 | |
19383 | ||
19384 | ||
c0c3707f CB |
19385 | FLOAT_H= |
19386 | REPLACE_FLOAT_LDBL=0 | |
19387 | case "$host_os" in | |
19388 | aix* | beos* | openbsd* | mirbsd* | irix*) | |
19389 | FLOAT_H=float.h | |
19390 | ;; | |
19391 | freebsd* | dragonfly*) | |
19392 | case "$host_cpu" in | |
19393 | i[34567]86 ) | |
19394 | FLOAT_H=float.h | |
19395 | ;; | |
19396 | x86_64 ) | |
19397 | # On x86_64 systems, the C compiler may still be generating | |
19398 | # 32-bit code. | |
19399 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19400 | /* end confdefs.h. */ | |
19401 | #if defined __LP64__ || defined __x86_64__ || defined __amd64__ | |
19402 | int ok; | |
19403 | #else | |
19404 | error fail | |
19405 | #endif | |
472fa5ee | 19406 | |
c0c3707f CB |
19407 | _ACEOF |
19408 | if ac_fn_c_try_compile "$LINENO"; then : | |
472fa5ee | 19409 | |
c0c3707f CB |
19410 | else |
19411 | FLOAT_H=float.h | |
19412 | fi | |
19413 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
19414 | ;; | |
19415 | esac | |
19416 | ;; | |
19417 | linux*) | |
19418 | case "$host_cpu" in | |
19419 | powerpc*) | |
19420 | FLOAT_H=float.h | |
19421 | ;; | |
19422 | esac | |
19423 | ;; | |
19424 | esac | |
19425 | case "$host_os" in | |
19426 | aix* | freebsd* | dragonfly* | linux*) | |
19427 | if test -n "$FLOAT_H"; then | |
19428 | REPLACE_FLOAT_LDBL=1 | |
19429 | fi | |
19430 | ;; | |
19431 | esac | |
19432 | ||
19433 | REPLACE_ITOLD=0 | |
19434 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5 | |
19435 | $as_echo_n "checking whether conversion from 'int' to 'long double' works... " >&6; } | |
19436 | if ${gl_cv_func_itold_works+:} false; then : | |
5e8754f9 SDJ |
19437 | $as_echo_n "(cached) " >&6 |
19438 | else | |
19439 | ||
19440 | if test "$cross_compiling" = yes; then : | |
c0c3707f CB |
19441 | case "$host" in |
19442 | sparc*-*-linux*) | |
19443 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19444 | /* end confdefs.h. */ | |
19445 | #if defined __LP64__ || defined __arch64__ | |
19446 | int ok; | |
19447 | #else | |
19448 | error fail | |
19449 | #endif | |
19450 | ||
19451 | _ACEOF | |
19452 | if ac_fn_c_try_compile "$LINENO"; then : | |
19453 | gl_cv_func_itold_works="guessing no" | |
19454 | else | |
19455 | gl_cv_func_itold_works="guessing yes" | |
19456 | fi | |
19457 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
19458 | ;; | |
19459 | # Guess yes on native Windows. | |
19460 | mingw*) gl_cv_func_itold_works="guessing yes" ;; | |
19461 | *) gl_cv_func_itold_works="guessing yes" ;; | |
5e8754f9 SDJ |
19462 | esac |
19463 | ||
19464 | else | |
19465 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19466 | /* end confdefs.h. */ | |
19467 | ||
c0c3707f CB |
19468 | int i = -1; |
19469 | volatile long double ld; | |
19470 | int main () | |
5e8754f9 | 19471 | { |
c0c3707f CB |
19472 | ld += i * 1.0L; |
19473 | if (ld > 0) | |
19474 | return 1; | |
19475 | return 0; | |
5e8754f9 SDJ |
19476 | } |
19477 | _ACEOF | |
19478 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 19479 | gl_cv_func_itold_works=yes |
5e8754f9 | 19480 | else |
c0c3707f | 19481 | gl_cv_func_itold_works=no |
5e8754f9 SDJ |
19482 | fi |
19483 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
19484 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
19485 | fi | |
19486 | ||
98399780 | 19487 | |
5e8754f9 | 19488 | fi |
c0c3707f CB |
19489 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5 |
19490 | $as_echo "$gl_cv_func_itold_works" >&6; } | |
19491 | case "$gl_cv_func_itold_works" in | |
19492 | *no) | |
19493 | REPLACE_ITOLD=1 | |
19494 | FLOAT_H=float.h | |
19495 | ;; | |
19496 | esac | |
98399780 | 19497 | |
c0c3707f | 19498 | if test -n "$FLOAT_H"; then |
98399780 YQ |
19499 | |
19500 | ||
19501 | ||
19502 | ||
6a29c58e YQ |
19503 | |
19504 | ||
19505 | ||
19506 | ||
c0c3707f CB |
19507 | if test $gl_cv_have_include_next = yes; then |
19508 | gl_cv_next_float_h='<'float.h'>' | |
19509 | else | |
19510 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5 | |
19511 | $as_echo_n "checking absolute name of <float.h>... " >&6; } | |
19512 | if ${gl_cv_next_float_h+:} false; then : | |
19513 | $as_echo_n "(cached) " >&6 | |
19514 | else | |
19515 | ||
19516 | ||
19517 | ||
19518 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19519 | /* end confdefs.h. */ | |
19520 | #include <float.h> | |
19521 | _ACEOF | |
19522 | case "$host_os" in | |
19523 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
19524 | *) gl_absname_cpp="$ac_cpp" ;; | |
19525 | esac | |
19526 | ||
19527 | case "$host_os" in | |
19528 | mingw*) | |
19529 | gl_dirsep_regex='[/\\]' | |
19530 | ;; | |
19531 | *) | |
19532 | gl_dirsep_regex='\/' | |
19533 | ;; | |
19534 | esac | |
19535 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
19536 | gl_header_literal_regex=`echo 'float.h' \ | |
19537 | | sed -e "$gl_make_literal_regex_sed"` | |
19538 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
19539 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
19540 | s|^/[^/]|//&| | |
19541 | p | |
19542 | q | |
19543 | }' | |
19544 | ||
19545 | gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
19546 | sed -n "$gl_absolute_header_sed"` | |
19547 | ||
19548 | gl_header=$gl_cv_absolute_float_h | |
19549 | gl_cv_next_float_h='"'$gl_header'"' | |
19550 | ||
19551 | ||
19552 | fi | |
19553 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5 | |
19554 | $as_echo "$gl_cv_next_float_h" >&6; } | |
19555 | fi | |
19556 | NEXT_FLOAT_H=$gl_cv_next_float_h | |
19557 | ||
19558 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
19559 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
19560 | gl_next_as_first_directive='<'float.h'>' | |
19561 | else | |
19562 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
19563 | gl_next_as_first_directive=$gl_cv_next_float_h | |
19564 | fi | |
19565 | NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive | |
19566 | ||
19567 | ||
19568 | ||
6a29c58e | 19569 | |
c0c3707f | 19570 | fi |
6a29c58e | 19571 | |
c0c3707f CB |
19572 | if test -n "$FLOAT_H"; then |
19573 | GL_GENERATE_FLOAT_H_TRUE= | |
19574 | GL_GENERATE_FLOAT_H_FALSE='#' | |
19575 | else | |
19576 | GL_GENERATE_FLOAT_H_TRUE='#' | |
19577 | GL_GENERATE_FLOAT_H_FALSE= | |
19578 | fi | |
6a29c58e YQ |
19579 | |
19580 | ||
8690e634 | 19581 | |
c0c3707f | 19582 | if test $REPLACE_FLOAT_LDBL = 1; then |
8690e634 | 19583 | |
8690e634 | 19584 | |
8690e634 | 19585 | |
8690e634 | 19586 | |
8690e634 | 19587 | |
8690e634 | 19588 | |
8690e634 | 19589 | |
4a626d0a | 19590 | |
c0c3707f | 19591 | gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext" |
8690e634 | 19592 | |
c0c3707f CB |
19593 | fi |
19594 | if test $REPLACE_ITOLD = 1; then | |
8690e634 JK |
19595 | |
19596 | ||
19597 | ||
19598 | ||
19599 | ||
19600 | ||
63ce7108 | 19601 | |
e26b6bb0 | 19602 | |
c0c3707f | 19603 | gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext" |
e26b6bb0 | 19604 | |
c0c3707f | 19605 | fi |
e26b6bb0 TT |
19606 | |
19607 | ||
19608 | ||
19609 | ||
c0c3707f CB |
19610 | gl_fnmatch_required_lowercase=` |
19611 | echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]' | |
19612 | ` | |
e26b6bb0 | 19613 | |
c0c3707f CB |
19614 | if test $ac_cv_func_fnmatch = no; then |
19615 | HAVE_FNMATCH=0 | |
19616 | else | |
19617 | gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" | |
19618 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5 | |
19619 | $as_echo_n "checking for working $gl_fnmatch_required fnmatch... " >&6; } | |
19620 | if eval \${$gl_fnmatch_cache_var+:} false; then : | |
5e8754f9 SDJ |
19621 | $as_echo_n "(cached) " >&6 |
19622 | else | |
c0c3707f CB |
19623 | if test $gl_fnmatch_required = GNU; then |
19624 | gl_fnmatch_gnu_start= | |
19625 | gl_fnmatch_gnu_end= | |
19626 | else | |
19627 | gl_fnmatch_gnu_start='#if 0' | |
19628 | gl_fnmatch_gnu_end='#endif' | |
19629 | fi | |
19630 | if test "$cross_compiling" = yes; then : | |
19631 | case "$host_os" in | |
19632 | # Guess yes on musl systems. | |
19633 | *-musl*) eval "$gl_fnmatch_cache_var=\"guessing yes\"" ;; | |
19634 | # Guess no otherwise, even on glibc systems. | |
19635 | *) eval "$gl_fnmatch_cache_var=\"guessing no\"" ;; | |
19636 | esac | |
e26b6bb0 | 19637 | |
c0c3707f CB |
19638 | else |
19639 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5e8754f9 | 19640 | /* end confdefs.h. */ |
c0c3707f CB |
19641 | #include <fnmatch.h> |
19642 | static int | |
19643 | y (char const *pattern, char const *string, int flags) | |
19644 | { | |
19645 | return fnmatch (pattern, string, flags) == 0; | |
19646 | } | |
19647 | static int | |
19648 | n (char const *pattern, char const *string, int flags) | |
19649 | { | |
19650 | return fnmatch (pattern, string, flags) == FNM_NOMATCH; | |
19651 | } | |
19652 | ||
5e8754f9 SDJ |
19653 | int |
19654 | main () | |
19655 | { | |
c0c3707f CB |
19656 | char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]"; |
19657 | char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; | |
19658 | static char const A_1[] = { 'A' - 1, 0 }; | |
19659 | static char const A01[] = { 'A' + 1, 0 }; | |
19660 | static char const a_1[] = { 'a' - 1, 0 }; | |
19661 | static char const a01[] = { 'a' + 1, 0 }; | |
19662 | static char const bs_1[] = { '\\\\' - 1, 0 }; | |
19663 | static char const bs01[] = { '\\\\' + 1, 0 }; | |
19664 | int result = 0; | |
19665 | if (!n ("a*", "", 0)) | |
19666 | return 1; | |
19667 | if (!y ("a*", "abc", 0)) | |
19668 | return 1; | |
19669 | if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ | |
19670 | return 1; | |
19671 | if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) | |
19672 | return 2; | |
19673 | if (!y ("a\\\\bc", "abc", 0)) | |
19674 | return 3; | |
19675 | if (!n ("a\\\\bc", "abc", FNM_NOESCAPE)) | |
19676 | return 3; | |
19677 | if (!y ("*x", ".x", 0)) | |
19678 | return 4; | |
19679 | if (!n ("*x", ".x", FNM_PERIOD)) | |
19680 | return 4; | |
19681 | if (!y (Apat, "\\\\", 0)) | |
19682 | return 5; | |
19683 | if (!y (Apat, "A", 0)) | |
19684 | return 5; | |
19685 | if (!y (apat, "\\\\", 0)) | |
19686 | return 5; | |
19687 | if (!y (apat, "a", 0)) | |
19688 | return 5; | |
19689 | if (!(n (Apat, A_1, 0) == ('A' < '\\\\'))) | |
19690 | return 5; | |
19691 | if (!(n (apat, a_1, 0) == ('a' < '\\\\'))) | |
19692 | return 5; | |
19693 | if (!(y (Apat, A01, 0) == ('A' < '\\\\'))) | |
19694 | return 5; | |
19695 | if (!(y (apat, a01, 0) == ('a' < '\\\\'))) | |
19696 | return 5; | |
19697 | if (!(y (Apat, bs_1, 0) == ('A' < '\\\\'))) | |
19698 | return 5; | |
19699 | if (!(y (apat, bs_1, 0) == ('a' < '\\\\'))) | |
19700 | return 5; | |
19701 | if (!(n (Apat, bs01, 0) == ('A' < '\\\\'))) | |
19702 | return 5; | |
19703 | if (!(n (apat, bs01, 0) == ('a' < '\\\\'))) | |
19704 | return 5; | |
19705 | $gl_fnmatch_gnu_start | |
19706 | if (!y ("xxXX", "xXxX", FNM_CASEFOLD)) | |
19707 | result |= 8; | |
19708 | if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)) | |
19709 | result |= 16; | |
19710 | if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME)) | |
19711 | result |= 32; | |
19712 | if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)) | |
19713 | result |= 64; | |
19714 | if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)) | |
19715 | result |= 64; | |
19716 | if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)) | |
19717 | result |= 64; | |
19718 | $gl_fnmatch_gnu_end | |
19719 | return result; | |
19720 | ||
5e8754f9 SDJ |
19721 | ; |
19722 | return 0; | |
19723 | } | |
19724 | _ACEOF | |
c0c3707f CB |
19725 | if ac_fn_c_try_run "$LINENO"; then : |
19726 | eval "$gl_fnmatch_cache_var=yes" | |
5e8754f9 | 19727 | else |
c0c3707f CB |
19728 | eval "$gl_fnmatch_cache_var=no" |
19729 | fi | |
19730 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
19731 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
5e8754f9 | 19732 | fi |
c0c3707f | 19733 | |
e26b6bb0 | 19734 | |
5e8754f9 | 19735 | fi |
c0c3707f CB |
19736 | eval ac_res=\$$gl_fnmatch_cache_var |
19737 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
19738 | $as_echo "$ac_res" >&6; } | |
19739 | eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" | |
19740 | case "$gl_fnmatch_result" in | |
19741 | *yes) ;; | |
19742 | *) REPLACE_FNMATCH=1 ;; | |
19743 | esac | |
19744 | fi | |
19745 | if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then | |
e26b6bb0 | 19746 | |
e26b6bb0 | 19747 | |
c0c3707f CB |
19748 | FNMATCH_H='fnmatch.h' |
19749 | if test -n "$FNMATCH_H"; then | |
19750 | GL_GENERATE_FNMATCH_H_TRUE= | |
19751 | GL_GENERATE_FNMATCH_H_FALSE='#' | |
5e8754f9 | 19752 | else |
c0c3707f CB |
19753 | GL_GENERATE_FNMATCH_H_TRUE='#' |
19754 | GL_GENERATE_FNMATCH_H_FALSE= | |
5e8754f9 | 19755 | fi |
e26b6bb0 | 19756 | |
18848e28 | 19757 | |
c0c3707f | 19758 | fi |
18848e28 | 19759 | |
c0c3707f | 19760 | if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then |
18848e28 | 19761 | |
18848e28 | 19762 | |
18848e28 | 19763 | |
c0c3707f CB |
19764 | |
19765 | ||
19766 | ||
19767 | ||
19768 | ||
19769 | gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" | |
19770 | ||
19771 | ||
19772 | ||
c0c3707f CB |
19773 | |
19774 | ||
19775 | fi | |
19776 | ||
19777 | ||
19778 | ||
19779 | ||
19780 | ||
19781 | GNULIB_FNMATCH=1 | |
19782 | ||
19783 | ||
19784 | ||
19785 | ||
19786 | ||
19787 | $as_echo "#define GNULIB_TEST_FNMATCH 1" >>confdefs.h | |
19788 | ||
19789 | ||
19790 | ||
19791 | ||
19792 | ||
19793 | ||
19794 | ||
19795 | ||
19796 | if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then | |
19797 | ||
19798 | ||
19799 | ||
19800 | ||
19801 | ||
19802 | ||
19803 | ||
19804 | ||
19805 | gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" | |
19806 | ||
19807 | ||
19808 | ||
18848e28 | 19809 | |
18848e28 | 19810 | |
5e8754f9 | 19811 | fi |
18848e28 | 19812 | |
18848e28 | 19813 | |
c0c3707f CB |
19814 | cat >>confdefs.h <<_ACEOF |
19815 | #define GNULIB_FNMATCH_GNU 1 | |
19816 | _ACEOF | |
18848e28 | 19817 | |
18848e28 | 19818 | |
18848e28 | 19819 | |
18848e28 | 19820 | |
9c9d63b1 PM |
19821 | |
19822 | ||
19823 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether free is known to preserve errno" >&5 | |
19824 | $as_echo_n "checking whether free is known to preserve errno... " >&6; } | |
19825 | if ${gl_cv_func_free_preserves_errno+:} false; then : | |
19826 | $as_echo_n "(cached) " >&6 | |
19827 | else | |
19828 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19829 | /* end confdefs.h. */ | |
19830 | #include <stdlib.h> | |
19831 | ||
19832 | int | |
19833 | main () | |
19834 | { | |
19835 | #if 2 < __GLIBC__ + (33 <= __GLIBC_MINOR__) | |
19836 | #elif defined __OpenBSD__ | |
19837 | #elif defined __sun | |
19838 | #else | |
19839 | #error "'free' is not known to preserve errno" | |
19840 | #endif | |
19841 | ||
19842 | ; | |
19843 | return 0; | |
19844 | } | |
19845 | _ACEOF | |
19846 | if ac_fn_c_try_compile "$LINENO"; then : | |
19847 | gl_cv_func_free_preserves_errno=yes | |
19848 | else | |
19849 | gl_cv_func_free_preserves_errno=no | |
19850 | fi | |
19851 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
19852 | ||
19853 | fi | |
19854 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_free_preserves_errno" >&5 | |
19855 | $as_echo "$gl_cv_func_free_preserves_errno" >&6; } | |
19856 | ||
19857 | case $gl_cv_func_free_preserves_errno in | |
19858 | *yes) ;; | |
19859 | *) REPLACE_FREE=1 ;; | |
19860 | esac | |
19861 | ||
19862 | if test $REPLACE_FREE = 1; then | |
19863 | ||
19864 | ||
19865 | ||
19866 | ||
19867 | ||
19868 | ||
19869 | ||
19870 | ||
19871 | gl_LIBOBJS="$gl_LIBOBJS free.$ac_objext" | |
19872 | ||
19873 | : | |
19874 | fi | |
19875 | ||
19876 | ||
19877 | ||
19878 | ||
19879 | ||
19880 | GNULIB_FREE_POSIX=1 | |
19881 | ||
19882 | ||
19883 | ||
19884 | ||
19885 | ||
19886 | $as_echo "#define GNULIB_TEST_FREE_POSIX 1" >>confdefs.h | |
19887 | ||
19888 | ||
19889 | ||
19890 | ||
c0c3707f CB |
19891 | if test $gl_func_frexp != yes; then |
19892 | ||
19893 | ||
18848e28 GF |
19894 | |
19895 | ||
18848e28 | 19896 | |
18848e28 | 19897 | |
18848e28 | 19898 | |
c0c3707f CB |
19899 | |
19900 | gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext" | |
18848e28 GF |
19901 | |
19902 | fi | |
19903 | ||
19904 | ||
19905 | ||
19906 | ||
19907 | ||
c0c3707f | 19908 | GNULIB_FREXP=1 |
18848e28 GF |
19909 | |
19910 | ||
19911 | ||
19912 | ||
19913 | ||
c0c3707f | 19914 | $as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h |
18848e28 GF |
19915 | |
19916 | ||
19917 | ||
19918 | ||
c0c3707f CB |
19919 | if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then |
19920 | ||
19921 | ||
19922 | ||
18848e28 GF |
19923 | |
19924 | ||
19925 | ||
5e8754f9 SDJ |
19926 | |
19927 | ||
c0c3707f CB |
19928 | gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext" |
19929 | ||
5e8754f9 | 19930 | fi |
18848e28 | 19931 | |
6a29c58e | 19932 | |
6a29c58e | 19933 | |
6a29c58e | 19934 | |
6ec2e0f5 | 19935 | |
c0c3707f CB |
19936 | GNULIB_FREXPL=1 |
19937 | ||
19938 | ||
19939 | ||
19940 | ||
19941 | ||
19942 | $as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h | |
19943 | ||
19944 | ||
19945 | ||
19946 | ||
19947 | ||
19948 | ||
19949 | ||
19950 | case "$host_os" in | |
19951 | mingw* | solaris*) | |
19952 | REPLACE_FSTAT=1 | |
19953 | ;; | |
19954 | esac | |
472fa5ee SM |
19955 | |
19956 | ||
19957 | ||
19958 | ||
19959 | ||
6ec2e0f5 SDJ |
19960 | if test $ac_cv_func_fchdir = no; then |
19961 | HAVE_FCHDIR=0 | |
6a29c58e YQ |
19962 | fi |
19963 | ||
6ec2e0f5 SDJ |
19964 | if test $HAVE_FCHDIR = 0; then |
19965 | case "$gl_cv_func_open_directory_works" in | |
19966 | *yes) ;; | |
19967 | *) | |
19968 | REPLACE_FSTAT=1 | |
19969 | ;; | |
19970 | esac | |
19971 | fi | |
6a29c58e YQ |
19972 | |
19973 | ||
6ec2e0f5 | 19974 | if test $REPLACE_FSTAT = 1; then |
6a29c58e | 19975 | |
3d99e817 AK |
19976 | |
19977 | ||
19978 | ||
3d99e817 AK |
19979 | |
19980 | ||
19981 | ||
19982 | ||
6ec2e0f5 | 19983 | gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext" |
3d99e817 | 19984 | |
c0c3707f CB |
19985 | case "$host_os" in |
19986 | mingw*) | |
3d99e817 AK |
19987 | |
19988 | ||
19989 | ||
19990 | ||
19991 | ||
19992 | ||
49e4877c | 19993 | |
49e4877c | 19994 | |
c0c3707f | 19995 | gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" |
49e4877c | 19996 | |
c0c3707f CB |
19997 | ;; |
19998 | esac | |
49e4877c PA |
19999 | |
20000 | ||
9c9d63b1 | 20001 | |
c0c3707f CB |
20002 | : |
20003 | ||
20004 | fi | |
6a29c58e YQ |
20005 | |
20006 | ||
88b48903 | 20007 | |
8690e634 | 20008 | |
a512b375 | 20009 | |
c0c3707f CB |
20010 | GNULIB_FSTAT=1 |
20011 | ||
20012 | ||
20013 | ||
20014 | ||
20015 | ||
20016 | $as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h | |
20017 | ||
20018 | ||
88b48903 | 20019 | |
88b48903 | 20020 | |
472fa5ee SM |
20021 | |
20022 | ||
20023 | ||
20024 | ||
20025 | ||
6ec2e0f5 SDJ |
20026 | |
20027 | if test $ac_cv_func_fstatat = no; then | |
20028 | HAVE_FSTATAT=0 | |
20029 | else | |
20030 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fstatat (..., 0) works" >&5 | |
20031 | $as_echo_n "checking whether fstatat (..., 0) works... " >&6; } | |
d0ac1c44 | 20032 | if ${gl_cv_func_fstatat_zero_flag+:} false; then : |
6ec2e0f5 SDJ |
20033 | $as_echo_n "(cached) " >&6 |
20034 | else | |
20035 | if test "$cross_compiling" = yes; then : | |
20036 | case "$host_os" in | |
20037 | aix*) gl_cv_func_fstatat_zero_flag="guessing no";; | |
20038 | *) gl_cv_func_fstatat_zero_flag="guessing yes";; | |
20039 | esac | |
88b48903 | 20040 | |
8690e634 JK |
20041 | else |
20042 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20043 | /* end confdefs.h. */ | |
8690e634 | 20044 | |
6ec2e0f5 SDJ |
20045 | #include <fcntl.h> |
20046 | #include <sys/stat.h> | |
20047 | int | |
20048 | main (void) | |
20049 | { | |
20050 | struct stat a; | |
20051 | return fstatat (AT_FDCWD, ".", &a, 0) != 0; | |
20052 | } | |
20053 | ||
88b48903 WN |
20054 | _ACEOF |
20055 | if ac_fn_c_try_run "$LINENO"; then : | |
6ec2e0f5 | 20056 | gl_cv_func_fstatat_zero_flag=yes |
88b48903 | 20057 | else |
6ec2e0f5 | 20058 | gl_cv_func_fstatat_zero_flag=no |
88b48903 WN |
20059 | fi |
20060 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
20061 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
20062 | fi | |
20063 | ||
20064 | ||
20065 | fi | |
6ec2e0f5 SDJ |
20066 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fstatat_zero_flag" >&5 |
20067 | $as_echo "$gl_cv_func_fstatat_zero_flag" >&6; } | |
88b48903 | 20068 | |
6ec2e0f5 SDJ |
20069 | case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in |
20070 | *yes+*yes) ;; | |
c0c3707f CB |
20071 | *) REPLACE_FSTATAT=1 ;; |
20072 | esac | |
20073 | ||
20074 | case $host_os in | |
20075 | solaris*) | |
20076 | REPLACE_FSTATAT=1 ;; | |
20077 | esac | |
20078 | ||
20079 | case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in | |
20080 | 1,*yes) | |
88b48903 | 20081 | |
6ec2e0f5 | 20082 | $as_echo "#define HAVE_WORKING_FSTATAT_ZERO_FLAG 1" >>confdefs.h |
88b48903 | 20083 | |
7a6dbc2f | 20084 | ;; |
6ec2e0f5 SDJ |
20085 | esac |
20086 | fi | |
88b48903 | 20087 | |
6ec2e0f5 | 20088 | if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then |
88b48903 WN |
20089 | |
20090 | ||
20091 | ||
20092 | ||
20093 | ||
88b48903 | 20094 | |
4a626d0a PA |
20095 | |
20096 | ||
6ec2e0f5 SDJ |
20097 | gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext" |
20098 | ||
20099 | fi | |
20100 | ||
20101 | ||
20102 | ||
4a626d0a | 20103 | |
6ec2e0f5 SDJ |
20104 | |
20105 | GNULIB_FSTATAT=1 | |
20106 | ||
20107 | ||
20108 | ||
20109 | ||
20110 | ||
20111 | $as_echo "#define GNULIB_TEST_FSTATAT 1" >>confdefs.h | |
20112 | ||
20113 | ||
20114 | ||
20115 | ||
20116 | ||
20117 | ||
20118 | ||
20119 | ||
20120 | gl_abort_bug=no | |
4a626d0a PA |
20121 | case "$host_os" in |
20122 | mingw*) | |
6ec2e0f5 | 20123 | gl_cv_func_getcwd_path_max=yes |
4a626d0a PA |
20124 | ;; |
20125 | *) | |
88b48903 | 20126 | |
88b48903 | 20127 | |
88b48903 WN |
20128 | |
20129 | ||
88b48903 | 20130 | |
6ec2e0f5 SDJ |
20131 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd handles long file names properly" >&5 |
20132 | $as_echo_n "checking whether getcwd handles long file names properly... " >&6; } | |
d0ac1c44 | 20133 | if ${gl_cv_func_getcwd_path_max+:} false; then : |
6ec2e0f5 SDJ |
20134 | $as_echo_n "(cached) " >&6 |
20135 | else | |
20136 | # Arrange for deletion of the temporary directory this test creates. | |
20137 | ac_clean_files="$ac_clean_files confdir3" | |
20138 | if test "$cross_compiling" = yes; then : | |
b567ca63 | 20139 | # Cross-compilation guesses: |
c0c3707f CB |
20140 | case "$host_os" in |
20141 | aix*) # On AIX, it has the AIX bug. | |
20142 | gl_cv_func_getcwd_path_max='guessing no, it has the AIX bug' ;; | |
20143 | gnu*) # On Hurd, it is 'yes'. | |
20144 | gl_cv_func_getcwd_path_max='guessing yes' ;; | |
20145 | linux* | kfreebsd*) | |
20146 | # On older Linux+glibc it's 'no, but it is partly working', | |
20147 | # on newer Linux+glibc it's 'yes'. | |
20148 | # On Linux+musl libc, it's 'no, but it is partly working'. | |
20149 | # On kFreeBSD+glibc, it's 'no, but it is partly working'. | |
20150 | gl_cv_func_getcwd_path_max='guessing no, but it is partly working' ;; | |
20151 | *) # If we don't know, obey --enable-cross-guesses. | |
20152 | gl_cv_func_getcwd_path_max="$gl_cross_guess_normal" ;; | |
20153 | esac | |
b567ca63 | 20154 | |
6ec2e0f5 SDJ |
20155 | else |
20156 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20157 | /* end confdefs.h. */ | |
88b48903 | 20158 | |
6ec2e0f5 SDJ |
20159 | #include <errno.h> |
20160 | #include <stdlib.h> | |
20161 | #if HAVE_UNISTD_H | |
20162 | # include <unistd.h> | |
20163 | #else | |
20164 | # include <direct.h> | |
20165 | #endif | |
20166 | #include <string.h> | |
20167 | #include <limits.h> | |
20168 | #include <sys/stat.h> | |
20169 | #include <sys/types.h> | |
20170 | #include <fcntl.h> | |
88b48903 WN |
20171 | |
20172 | ||
6ec2e0f5 SDJ |
20173 | /* Arrange to define PATH_MAX, like "pathmax.h" does. */ |
20174 | #if HAVE_UNISTD_H | |
20175 | # include <unistd.h> | |
20176 | #endif | |
20177 | #include <limits.h> | |
20178 | #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN | |
20179 | # include <sys/param.h> | |
20180 | #endif | |
20181 | #if !defined PATH_MAX && defined MAXPATHLEN | |
20182 | # define PATH_MAX MAXPATHLEN | |
20183 | #endif | |
20184 | #ifdef __hpux | |
20185 | # undef PATH_MAX | |
20186 | # define PATH_MAX 1024 | |
20187 | #endif | |
c0c3707f | 20188 | #if defined _WIN32 && ! defined __CYGWIN__ |
6ec2e0f5 SDJ |
20189 | # undef PATH_MAX |
20190 | # define PATH_MAX 260 | |
20191 | #endif | |
88b48903 | 20192 | |
88b48903 | 20193 | |
6ec2e0f5 SDJ |
20194 | #ifndef AT_FDCWD |
20195 | # define AT_FDCWD 0 | |
20196 | #endif | |
20197 | #ifdef ENAMETOOLONG | |
20198 | # define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG) | |
20199 | #else | |
20200 | # define is_ENAMETOOLONG(x) 0 | |
20201 | #endif | |
88b48903 | 20202 | |
6ec2e0f5 SDJ |
20203 | /* Use the getcwd function, not any macro. */ |
20204 | #undef getcwd | |
88b48903 | 20205 | |
9c9d63b1 PM |
20206 | |
20207 | ||
20208 | $gl_mda_defines | |
20209 | ||
88b48903 | 20210 | |
6ec2e0f5 SDJ |
20211 | #ifndef S_IRWXU |
20212 | # define S_IRWXU 0700 | |
20213 | #endif | |
88b48903 | 20214 | |
6ec2e0f5 SDJ |
20215 | /* The length of this name must be 8. */ |
20216 | #define DIR_NAME "confdir3" | |
20217 | #define DIR_NAME_LEN 8 | |
20218 | #define DIR_NAME_SIZE (DIR_NAME_LEN + 1) | |
88b48903 | 20219 | |
6ec2e0f5 SDJ |
20220 | /* The length of "../". */ |
20221 | #define DOTDOTSLASH_LEN 3 | |
88b48903 | 20222 | |
6ec2e0f5 SDJ |
20223 | /* Leftover bytes in the buffer, to work around library or OS bugs. */ |
20224 | #define BUF_SLOP 20 | |
88b48903 | 20225 | |
6ec2e0f5 SDJ |
20226 | int |
20227 | main () | |
20228 | { | |
20229 | #ifndef PATH_MAX | |
20230 | /* The Hurd doesn't define this, so getcwd can't exhibit the bug -- | |
20231 | at least not on a local file system. And if we were to start worrying | |
20232 | about remote file systems, we'd have to enable the wrapper function | |
20233 | all of the time, just to be safe. That's not worth the cost. */ | |
20234 | exit (0); | |
20235 | #elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \ | |
20236 | - DIR_NAME_SIZE - BUF_SLOP) \ | |
20237 | <= PATH_MAX) | |
20238 | /* FIXME: Assuming there's a system for which this is true, | |
20239 | this should be done in a compile test. */ | |
20240 | exit (0); | |
20241 | #else | |
20242 | char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) | |
20243 | + DIR_NAME_SIZE + BUF_SLOP]; | |
20244 | char *cwd = getcwd (buf, PATH_MAX); | |
20245 | size_t initial_cwd_len; | |
20246 | size_t cwd_len; | |
20247 | int fail = 0; | |
20248 | size_t n_chdirs = 0; | |
88b48903 | 20249 | |
6ec2e0f5 SDJ |
20250 | if (cwd == NULL) |
20251 | exit (10); | |
88b48903 | 20252 | |
6ec2e0f5 | 20253 | cwd_len = initial_cwd_len = strlen (cwd); |
88b48903 | 20254 | |
6ec2e0f5 SDJ |
20255 | while (1) |
20256 | { | |
20257 | size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN); | |
20258 | char *c = NULL; | |
20259 | ||
20260 | cwd_len += DIR_NAME_SIZE; | |
20261 | /* If mkdir or chdir fails, it could be that this system cannot create | |
20262 | any file with an absolute name longer than PATH_MAX, such as cygwin. | |
20263 | If so, leave fail as 0, because the current working directory can't | |
c0c3707f CB |
20264 | be too long for getcwd if it can't even be created. On Linux with |
20265 | the 9p file system, mkdir fails with error EINVAL when cwd_len gets | |
20266 | too long; ignore this failure because the getcwd() system call | |
20267 | produces good results whereas the gnulib substitute calls getdents64 | |
20268 | which fails with error EPROTO. | |
20269 | For other errors, be pessimistic and consider that as a failure, | |
20270 | too. */ | |
6ec2e0f5 SDJ |
20271 | if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0) |
20272 | { | |
20273 | if (! (errno == ERANGE || is_ENAMETOOLONG (errno))) | |
c0c3707f CB |
20274 | #ifdef __linux__ |
20275 | if (! (errno == EINVAL)) | |
20276 | #endif | |
20277 | fail = 20; | |
6ec2e0f5 SDJ |
20278 | break; |
20279 | } | |
88b48903 | 20280 | |
6ec2e0f5 SDJ |
20281 | if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE) |
20282 | { | |
20283 | struct stat sb; | |
88b48903 | 20284 | |
6ec2e0f5 SDJ |
20285 | c = getcwd (buf, PATH_MAX); |
20286 | if (!c && errno == ENOENT) | |
20287 | { | |
20288 | fail = 11; | |
20289 | break; | |
20290 | } | |
20291 | if (c) | |
20292 | { | |
20293 | fail = 31; | |
20294 | break; | |
20295 | } | |
20296 | if (! (errno == ERANGE || is_ENAMETOOLONG (errno))) | |
20297 | { | |
20298 | fail = 21; | |
20299 | break; | |
20300 | } | |
88b48903 | 20301 | |
6ec2e0f5 SDJ |
20302 | /* Our replacement needs to be able to stat() long ../../paths, |
20303 | so generate a path larger than PATH_MAX to check, | |
20304 | avoiding the replacement if we can't stat(). */ | |
20305 | c = getcwd (buf, cwd_len + 1); | |
20306 | if (c && !AT_FDCWD && stat (c, &sb) != 0 && is_ENAMETOOLONG (errno)) | |
20307 | { | |
20308 | fail = 32; | |
20309 | break; | |
20310 | } | |
20311 | } | |
88b48903 | 20312 | |
6ec2e0f5 SDJ |
20313 | if (dotdot_max <= cwd_len - initial_cwd_len) |
20314 | { | |
20315 | if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len) | |
20316 | break; | |
20317 | c = getcwd (buf, cwd_len + 1); | |
20318 | if (!c) | |
20319 | { | |
20320 | if (! (errno == ERANGE || errno == ENOENT | |
20321 | || is_ENAMETOOLONG (errno))) | |
20322 | { | |
20323 | fail = 22; | |
20324 | break; | |
20325 | } | |
20326 | if (AT_FDCWD || errno == ERANGE || errno == ENOENT) | |
20327 | { | |
20328 | fail = 12; | |
20329 | break; | |
20330 | } | |
20331 | } | |
20332 | } | |
88b48903 | 20333 | |
6ec2e0f5 SDJ |
20334 | if (c && strlen (c) != cwd_len) |
20335 | { | |
20336 | fail = 23; | |
20337 | break; | |
20338 | } | |
20339 | ++n_chdirs; | |
20340 | } | |
88b48903 | 20341 | |
6ec2e0f5 SDJ |
20342 | /* Leaving behind such a deep directory is not polite. |
20343 | So clean up here, right away, even though the driving | |
20344 | shell script would also clean up. */ | |
20345 | { | |
20346 | size_t i; | |
88b48903 | 20347 | |
6ec2e0f5 SDJ |
20348 | /* Try rmdir first, in case the chdir failed. */ |
20349 | rmdir (DIR_NAME); | |
20350 | for (i = 0; i <= n_chdirs; i++) | |
20351 | { | |
20352 | if (chdir ("..") < 0) | |
20353 | break; | |
20354 | if (rmdir (DIR_NAME) != 0) | |
20355 | break; | |
20356 | } | |
20357 | } | |
88b48903 | 20358 | |
6ec2e0f5 SDJ |
20359 | exit (fail); |
20360 | #endif | |
20361 | } | |
88b48903 | 20362 | |
6ec2e0f5 SDJ |
20363 | _ACEOF |
20364 | if ac_fn_c_try_run "$LINENO"; then : | |
20365 | gl_cv_func_getcwd_path_max=yes | |
20366 | else | |
20367 | case $? in | |
c0c3707f CB |
20368 | 10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';; |
20369 | 31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';; | |
20370 | 32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';; | |
20371 | *) gl_cv_func_getcwd_path_max=no;; | |
20372 | esac | |
6ec2e0f5 SDJ |
20373 | fi |
20374 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
20375 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
20376 | fi | |
88b48903 | 20377 | |
88b48903 | 20378 | |
6ec2e0f5 SDJ |
20379 | fi |
20380 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_path_max" >&5 | |
20381 | $as_echo "$gl_cv_func_getcwd_path_max" >&6; } | |
88b48903 | 20382 | |
6ec2e0f5 SDJ |
20383 | case "$gl_cv_func_getcwd_null" in |
20384 | *yes) | |
88b48903 WN |
20385 | |
20386 | ||
472fa5ee SM |
20387 | |
20388 | ||
20389 | ||
472fa5ee | 20390 | |
c0c3707f CB |
20391 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5 |
20392 | $as_echo_n "checking for getpagesize... " >&6; } | |
20393 | if ${gl_cv_func_getpagesize+:} false; then : | |
20394 | $as_echo_n "(cached) " >&6 | |
20395 | else | |
20396 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20397 | /* end confdefs.h. */ | |
20398 | #include <unistd.h> | |
20399 | int | |
20400 | main () | |
20401 | { | |
20402 | return getpagesize(); | |
20403 | ; | |
20404 | return 0; | |
20405 | } | |
472fa5ee | 20406 | |
c0c3707f CB |
20407 | _ACEOF |
20408 | if ac_fn_c_try_link "$LINENO"; then : | |
20409 | gl_cv_func_getpagesize=yes | |
20410 | else | |
20411 | gl_cv_func_getpagesize=no | |
20412 | fi | |
20413 | rm -f core conftest.err conftest.$ac_objext \ | |
20414 | conftest$ac_exeext conftest.$ac_ext | |
472fa5ee | 20415 | |
c0c3707f CB |
20416 | fi |
20417 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5 | |
20418 | $as_echo "$gl_cv_func_getpagesize" >&6; } | |
88b48903 | 20419 | |
c0c3707f | 20420 | if test $gl_cv_func_getpagesize = yes; then |
88b48903 | 20421 | |
c0c3707f | 20422 | cat >>confdefs.h <<_ACEOF |
7a6dbc2f SDJ |
20423 | #define HAVE_GETPAGESIZE 1 |
20424 | _ACEOF | |
20425 | ||
c0c3707f | 20426 | fi |
6ec2e0f5 | 20427 | |
9c9d63b1 PM |
20428 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd succeeds when 4k < cwd_length < 16k" >&5 |
20429 | $as_echo_n "checking whether getcwd succeeds when 4k < cwd_length < 16k... " >&6; } | |
20430 | if ${gl_cv_func_getcwd_succeeds_beyond_4k+:} false; then : | |
88b48903 WN |
20431 | $as_echo_n "(cached) " >&6 |
20432 | else | |
6ec2e0f5 SDJ |
20433 | # Remove any remnants of a previous test. |
20434 | rm -rf confdir-14B--- | |
20435 | # Arrange for deletion of the temporary directory this test creates. | |
20436 | ac_clean_files="$ac_clean_files confdir-14B---" | |
20437 | if test "$cross_compiling" = yes; then : | |
c0c3707f | 20438 | case "$host_os" in |
9c9d63b1 PM |
20439 | # Guess yes on musl systems. |
20440 | *-musl*) gl_cv_func_getcwd_succeeds_beyond_4k="guessing yes" ;; | |
20441 | # Guess no otherwise, even on glibc systems. | |
20442 | *) gl_cv_func_getcwd_succeeds_beyond_4k="guessing no" | |
c0c3707f CB |
20443 | esac |
20444 | ||
88b48903 WN |
20445 | else |
20446 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20447 | /* end confdefs.h. */ | |
6ec2e0f5 SDJ |
20448 | |
20449 | #include <errno.h> | |
20450 | #include <stdlib.h> | |
20451 | #if HAVE_UNISTD_H | |
20452 | # include <unistd.h> | |
20453 | #else /* on Windows with MSVC */ | |
20454 | # include <direct.h> | |
20455 | #endif | |
20456 | #include <string.h> | |
20457 | #include <sys/stat.h> | |
20458 | ||
20459 | ||
20460 | /* Arrange to define PATH_MAX, like "pathmax.h" does. */ | |
20461 | #if HAVE_UNISTD_H | |
20462 | # include <unistd.h> | |
20463 | #endif | |
20464 | #include <limits.h> | |
20465 | #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN | |
20466 | # include <sys/param.h> | |
20467 | #endif | |
20468 | #if !defined PATH_MAX && defined MAXPATHLEN | |
20469 | # define PATH_MAX MAXPATHLEN | |
20470 | #endif | |
20471 | #ifdef __hpux | |
20472 | # undef PATH_MAX | |
20473 | # define PATH_MAX 1024 | |
20474 | #endif | |
c0c3707f | 20475 | #if defined _WIN32 && ! defined __CYGWIN__ |
6ec2e0f5 SDJ |
20476 | # undef PATH_MAX |
20477 | # define PATH_MAX 260 | |
20478 | #endif | |
20479 | ||
20480 | ||
9c9d63b1 PM |
20481 | |
20482 | $gl_mda_defines | |
20483 | ||
6ec2e0f5 SDJ |
20484 | |
20485 | #ifndef S_IRWXU | |
20486 | # define S_IRWXU 0700 | |
20487 | #endif | |
20488 | ||
20489 | /* FIXME: skip the run-test altogether on systems without getpagesize. */ | |
20490 | #if ! HAVE_GETPAGESIZE | |
20491 | # define getpagesize() 0 | |
20492 | #endif | |
20493 | ||
20494 | /* This size is chosen to be larger than PATH_MAX (4k), yet smaller than | |
20495 | the 16kB pagesize on ia64 linux. Those conditions make the code below | |
20496 | trigger a bug in glibc's getcwd implementation before 2.4.90-10. */ | |
20497 | #define TARGET_LEN (5 * 1024) | |
88b48903 WN |
20498 | |
20499 | int | |
20500 | main () | |
20501 | { | |
6ec2e0f5 SDJ |
20502 | char *cwd; |
20503 | size_t initial_cwd_len; | |
20504 | int fail = 0; | |
20505 | ||
20506 | /* The bug is triggered when PATH_MAX < getpagesize (), so skip | |
20507 | this relatively expensive and invasive test if that's not true. */ | |
20508 | #ifdef PATH_MAX | |
20509 | int bug_possible = PATH_MAX < getpagesize (); | |
20510 | #else | |
20511 | int bug_possible = 0; | |
20512 | #endif | |
20513 | if (! bug_possible) | |
20514 | return 0; | |
8690e634 | 20515 | |
6ec2e0f5 SDJ |
20516 | cwd = getcwd (NULL, 0); |
20517 | if (cwd == NULL) | |
20518 | return 2; | |
20519 | ||
20520 | initial_cwd_len = strlen (cwd); | |
20521 | free (cwd); | |
20522 | ||
20523 | if (1) | |
20524 | { | |
20525 | static char const dir_name[] = "confdir-14B---"; | |
20526 | size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len) | |
20527 | / sizeof dir_name); | |
20528 | size_t d; | |
20529 | for (d = 0; d < desired_depth; d++) | |
20530 | { | |
20531 | if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0) | |
20532 | { | |
20533 | if (! (errno == ERANGE || errno == ENAMETOOLONG | |
20534 | || errno == ENOENT)) | |
20535 | fail = 3; /* Unable to construct deep hierarchy. */ | |
20536 | break; | |
20537 | } | |
20538 | } | |
20539 | ||
20540 | /* If libc has the bug in question, this invocation of getcwd | |
20541 | results in a failed assertion. */ | |
20542 | cwd = getcwd (NULL, 0); | |
20543 | if (cwd == NULL) | |
20544 | fail = 4; /* getcwd didn't assert, but it failed for a long name | |
20545 | where the answer could have been learned. */ | |
20546 | free (cwd); | |
20547 | ||
20548 | /* Call rmdir first, in case the above chdir failed. */ | |
20549 | rmdir (dir_name); | |
20550 | while (0 < d--) | |
20551 | { | |
20552 | if (chdir ("..") < 0) | |
20553 | { | |
20554 | fail = 5; | |
20555 | break; | |
20556 | } | |
20557 | rmdir (dir_name); | |
20558 | } | |
20559 | } | |
20560 | ||
20561 | return fail; | |
8690e634 | 20562 | } |
6ec2e0f5 | 20563 | |
8690e634 JK |
20564 | _ACEOF |
20565 | if ac_fn_c_try_run "$LINENO"; then : | |
9c9d63b1 | 20566 | gl_cv_func_getcwd_succeeds_beyond_4k=yes |
8690e634 | 20567 | else |
c0c3707f CB |
20568 | ret=$? |
20569 | if test $ret -ge 128 || test $ret = 4; then | |
9c9d63b1 | 20570 | gl_cv_func_getcwd_succeeds_beyond_4k=no |
c0c3707f | 20571 | else |
9c9d63b1 | 20572 | gl_cv_func_getcwd_succeeds_beyond_4k=yes |
c0c3707f CB |
20573 | fi |
20574 | ||
8690e634 JK |
20575 | fi |
20576 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
20577 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
20578 | fi | |
20579 | ||
20580 | ||
20581 | fi | |
9c9d63b1 PM |
20582 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_succeeds_beyond_4k" >&5 |
20583 | $as_echo "$gl_cv_func_getcwd_succeeds_beyond_4k" >&6; } | |
20584 | case "$gl_cv_func_getcwd_succeeds_beyond_4k" in | |
20585 | *no) | |
c0c3707f CB |
20586 | gl_abort_bug=yes |
20587 | ;; | |
20588 | *) | |
20589 | ||
20590 | ;; | |
20591 | esac | |
6ec2e0f5 SDJ |
20592 | |
20593 | ;; | |
20594 | esac | |
20595 | ;; | |
20596 | esac | |
20597 | case "$gl_cv_func_getcwd_path_max" in | |
c0c3707f | 20598 | *"no" | *"no, it has the AIX bug") ;; |
6ec2e0f5 SDJ |
20599 | *) |
20600 | ||
20601 | $as_echo "#define HAVE_MINIMALLY_WORKING_GETCWD 1" >>confdefs.h | |
20602 | ||
20603 | ;; | |
20604 | esac | |
20605 | case "$gl_cv_func_getcwd_path_max" in | |
c0c3707f | 20606 | *"no, but it is partly working") |
6ec2e0f5 SDJ |
20607 | |
20608 | $as_echo "#define HAVE_PARTLY_WORKING_GETCWD 1" >>confdefs.h | |
20609 | ||
20610 | ;; | |
c0c3707f | 20611 | *"yes, but with shorter paths") |
6ec2e0f5 SDJ |
20612 | |
20613 | $as_echo "#define HAVE_GETCWD_SHORTER 1" >>confdefs.h | |
20614 | ||
20615 | ;; | |
20616 | esac | |
20617 | ||
20618 | if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \ | |
20619 | || test $gl_cv_func_getcwd_posix_signature != yes \ | |
20620 | || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \ | |
20621 | || test $gl_abort_bug = yes; then | |
20622 | REPLACE_GETCWD=1 | |
8690e634 JK |
20623 | fi |
20624 | ||
6ec2e0f5 | 20625 | if test $REPLACE_GETCWD = 1; then |
8690e634 JK |
20626 | |
20627 | ||
8690e634 JK |
20628 | |
20629 | ||
20630 | ||
20631 | ||
20632 | ||
20633 | ||
6ec2e0f5 | 20634 | gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext" |
8690e634 JK |
20635 | |
20636 | ||
8690e634 JK |
20637 | |
20638 | ||
6ec2e0f5 SDJ |
20639 | : |
20640 | ||
20641 | fi | |
20642 | ||
8690e634 JK |
20643 | |
20644 | cat >>confdefs.h <<_ACEOF | |
6ec2e0f5 | 20645 | #define GNULIB_GETCWD 1 |
8690e634 JK |
20646 | _ACEOF |
20647 | ||
20648 | ||
8690e634 | 20649 | |
8690e634 JK |
20650 | |
20651 | ||
c971b7fa | 20652 | |
c971b7fa | 20653 | |
6ec2e0f5 SDJ |
20654 | GNULIB_GETCWD=1 |
20655 | ||
20656 | ||
20657 | ||
20658 | ||
20659 | ||
20660 | $as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h | |
20661 | ||
c971b7fa | 20662 | |
c971b7fa | 20663 | |
c971b7fa | 20664 | |
c971b7fa | 20665 | |
c971b7fa | 20666 | |
c971b7fa | 20667 | |
c971b7fa | 20668 | |
6ec2e0f5 SDJ |
20669 | case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in |
20670 | *yes,yes) ;; | |
20671 | *) | |
20672 | REPLACE_GETCWD=1 | |
20673 | ;; | |
20674 | esac | |
c971b7fa | 20675 | |
6ec2e0f5 | 20676 | if test $REPLACE_GETCWD = 1; then |
c971b7fa | 20677 | |
c971b7fa PA |
20678 | |
20679 | ||
c971b7fa PA |
20680 | |
20681 | ||
c971b7fa | 20682 | |
c971b7fa | 20683 | |
c971b7fa | 20684 | |
6ec2e0f5 | 20685 | gl_LIBOBJS="$gl_LIBOBJS getcwd-lgpl.$ac_objext" |
c971b7fa | 20686 | |
6ec2e0f5 | 20687 | fi |
c971b7fa | 20688 | |
c971b7fa | 20689 | |
c971b7fa | 20690 | |
c971b7fa | 20691 | |
8690e634 | 20692 | |
6ec2e0f5 | 20693 | GNULIB_GETCWD=1 |
c971b7fa | 20694 | |
88b48903 WN |
20695 | |
20696 | ||
20697 | ||
88b48903 | 20698 | |
6ec2e0f5 | 20699 | $as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h |
88b48903 | 20700 | |
88b48903 WN |
20701 | |
20702 | ||
20703 | ||
6ec2e0f5 SDJ |
20704 | |
20705 | ||
20706 | ||
20707 | ||
20708 | if test $ac_cv_func_getdtablesize = yes && | |
20709 | test $ac_cv_have_decl_getdtablesize = yes; then | |
6ec2e0f5 SDJ |
20710 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5 |
20711 | $as_echo_n "checking whether getdtablesize works... " >&6; } | |
d0ac1c44 | 20712 | if ${gl_cv_func_getdtablesize_works+:} false; then : |
88b48903 WN |
20713 | $as_echo_n "(cached) " >&6 |
20714 | else | |
c0c3707f CB |
20715 | case "$host_os" in |
20716 | vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;; | |
20717 | *) | |
20718 | if test "$cross_compiling" = yes; then : | |
88b48903 | 20719 | case "$host_os" in |
c0c3707f CB |
20720 | cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows |
20721 | gl_cv_func_getdtablesize_works="guessing no" ;; | |
20722 | *) gl_cv_func_getdtablesize_works="guessing yes" ;; | |
20723 | esac | |
20724 | ||
88b48903 WN |
20725 | else |
20726 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20727 | /* end confdefs.h. */ | |
20728 | ||
c0c3707f | 20729 | #include <unistd.h> |
9c9d63b1 PM |
20730 | |
20731 | ||
20732 | $gl_mda_defines | |
20733 | ||
20734 | ||
6ec2e0f5 SDJ |
20735 | int |
20736 | main () | |
88b48903 | 20737 | { |
6ec2e0f5 | 20738 | int size = getdtablesize(); |
9c9d63b1 PM |
20739 | if (dup2 (0, getdtablesize()) != -1) |
20740 | return 1; | |
20741 | if (size != getdtablesize()) | |
20742 | return 2; | |
6ec2e0f5 SDJ |
20743 | |
20744 | ; | |
20745 | return 0; | |
88b48903 WN |
20746 | } |
20747 | _ACEOF | |
20748 | if ac_fn_c_try_run "$LINENO"; then : | |
6ec2e0f5 | 20749 | gl_cv_func_getdtablesize_works=yes |
88b48903 | 20750 | else |
6ec2e0f5 | 20751 | gl_cv_func_getdtablesize_works=no |
88b48903 WN |
20752 | fi |
20753 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
20754 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
20755 | fi | |
20756 | ||
c0c3707f CB |
20757 | ;; |
20758 | esac | |
88b48903 WN |
20759 | |
20760 | fi | |
6ec2e0f5 SDJ |
20761 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5 |
20762 | $as_echo "$gl_cv_func_getdtablesize_works" >&6; } | |
20763 | case "$gl_cv_func_getdtablesize_works" in | |
c0c3707f | 20764 | *yes | "no (limitation)") ;; |
6ec2e0f5 | 20765 | *) REPLACE_GETDTABLESIZE=1 ;; |
88b48903 WN |
20766 | esac |
20767 | else | |
6ec2e0f5 | 20768 | HAVE_GETDTABLESIZE=0 |
88b48903 WN |
20769 | fi |
20770 | ||
6ec2e0f5 | 20771 | if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then |
88b48903 WN |
20772 | |
20773 | ||
20774 | ||
20775 | ||
20776 | ||
20777 | ||
20778 | ||
20779 | ||
6ec2e0f5 | 20780 | gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext" |
88b48903 | 20781 | |
6ec2e0f5 | 20782 | : |
88b48903 WN |
20783 | fi |
20784 | ||
20785 | ||
20786 | ||
20787 | ||
20788 | ||
6ec2e0f5 | 20789 | GNULIB_GETDTABLESIZE=1 |
88b48903 WN |
20790 | |
20791 | ||
20792 | ||
88b48903 | 20793 | |
88b48903 | 20794 | |
6ec2e0f5 | 20795 | $as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h |
88b48903 | 20796 | |
88b48903 | 20797 | |
88b48903 | 20798 | |
88b48903 | 20799 | |
88b48903 | 20800 | |
88b48903 | 20801 | |
88b48903 | 20802 | |
88b48903 WN |
20803 | |
20804 | ||
6ec2e0f5 SDJ |
20805 | if test $ac_cv_have_decl_getlogin_r = no; then |
20806 | HAVE_DECL_GETLOGIN_R=0 | |
20807 | fi | |
88b48903 | 20808 | |
88b48903 | 20809 | |
6ec2e0f5 SDJ |
20810 | if test $ac_cv_func_getlogin_r = no; then |
20811 | HAVE_GETLOGIN_R=0 | |
20812 | else | |
20813 | HAVE_GETLOGIN_R=1 | |
20814 | ||
20815 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getlogin_r works with small buffers" >&5 | |
20816 | $as_echo_n "checking whether getlogin_r works with small buffers... " >&6; } | |
d0ac1c44 | 20817 | if ${gl_cv_func_getlogin_r_works+:} false; then : |
6ec2e0f5 SDJ |
20818 | $as_echo_n "(cached) " >&6 |
20819 | else | |
88b48903 | 20820 | |
6ec2e0f5 | 20821 | case "$host_os" in |
c0c3707f CB |
20822 | # Guess no on Mac OS X, OSF/1. |
20823 | darwin* | osf*) gl_cv_func_getlogin_r_works="guessing no" ;; | |
20824 | # Guess yes otherwise. | |
20825 | *) gl_cv_func_getlogin_r_works="guessing yes" ;; | |
6ec2e0f5 SDJ |
20826 | esac |
20827 | if test "$cross_compiling" = yes; then : | |
20828 | : | |
88b48903 WN |
20829 | else |
20830 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20831 | /* end confdefs.h. */ | |
20832 | ||
6ec2e0f5 | 20833 | #include <stddef.h> |
c0c3707f | 20834 | #include <string.h> |
6ec2e0f5 SDJ |
20835 | #include <unistd.h> |
20836 | #if !HAVE_DECL_GETLOGIN_R | |
88b48903 | 20837 | extern |
6ec2e0f5 | 20838 | # ifdef __cplusplus |
88b48903 | 20839 | "C" |
6ec2e0f5 SDJ |
20840 | # endif |
20841 | int getlogin_r (char *, size_t); | |
88b48903 | 20842 | #endif |
6ec2e0f5 SDJ |
20843 | int |
20844 | main (void) | |
88b48903 WN |
20845 | { |
20846 | int result = 0; | |
6ec2e0f5 SDJ |
20847 | char buf[100]; |
20848 | ||
20849 | if (getlogin_r (buf, 0) == 0) | |
c0c3707f | 20850 | result |= 1; |
6ec2e0f5 | 20851 | if (getlogin_r (buf, 1) == 0) |
c0c3707f CB |
20852 | result |= 2; |
20853 | if (getlogin_r (buf, 100) == 0) | |
20854 | { | |
20855 | size_t n = strlen (buf); | |
20856 | if (getlogin_r (buf, n) == 0) | |
20857 | result |= 4; | |
20858 | } | |
88b48903 WN |
20859 | return result; |
20860 | } | |
20861 | _ACEOF | |
20862 | if ac_fn_c_try_run "$LINENO"; then : | |
6ec2e0f5 | 20863 | gl_cv_func_getlogin_r_works=yes |
88b48903 | 20864 | else |
c0c3707f | 20865 | gl_cv_func_getlogin_r_works=no |
88b48903 WN |
20866 | fi |
20867 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
20868 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
20869 | fi | |
20870 | ||
20871 | ||
4a626d0a | 20872 | fi |
6ec2e0f5 SDJ |
20873 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getlogin_r_works" >&5 |
20874 | $as_echo "$gl_cv_func_getlogin_r_works" >&6; } | |
20875 | case "$gl_cv_func_getlogin_r_works" in | |
20876 | *yes) ;; | |
20877 | *) REPLACE_GETLOGIN_R=1 ;; | |
20878 | esac | |
20879 | fi | |
20880 | ||
20881 | if test $HAVE_GETLOGIN_R = 0 || test $REPLACE_GETLOGIN_R = 1; then | |
20882 | ||
20883 | ||
20884 | ||
20885 | ||
20886 | ||
20887 | ||
20888 | ||
20889 | ||
20890 | gl_LIBOBJS="$gl_LIBOBJS getlogin_r.$ac_objext" | |
4a626d0a | 20891 | |
4a626d0a | 20892 | |
4a626d0a | 20893 | |
4a626d0a | 20894 | |
4a626d0a PA |
20895 | fi |
20896 | ||
20897 | ||
4a626d0a PA |
20898 | |
20899 | ||
20900 | ||
6ec2e0f5 | 20901 | GNULIB_GETLOGIN_R=1 |
4a626d0a PA |
20902 | |
20903 | ||
20904 | ||
20905 | ||
20906 | ||
6ec2e0f5 | 20907 | $as_echo "#define GNULIB_TEST_GETLOGIN_R 1" >>confdefs.h |
4a626d0a | 20908 | |
4a626d0a PA |
20909 | |
20910 | ||
20911 | ||
20912 | ||
472fa5ee | 20913 | |
4a626d0a | 20914 | |
6ec2e0f5 SDJ |
20915 | ac_found=0 |
20916 | ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h> | |
20917 | " | |
d0ac1c44 | 20918 | if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then : |
6ec2e0f5 SDJ |
20919 | ac_have_decl=1 |
20920 | else | |
20921 | ac_have_decl=0 | |
20922 | fi | |
20923 | ||
20924 | cat >>confdefs.h <<_ACEOF | |
20925 | #define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl | |
20926 | _ACEOF | |
20927 | if test $ac_have_decl = 1; then : | |
20928 | ac_found=1 | |
20929 | fi | |
20930 | ||
20931 | ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h> | |
20932 | " | |
d0ac1c44 | 20933 | if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then : |
6ec2e0f5 SDJ |
20934 | ac_have_decl=1 |
20935 | else | |
20936 | ac_have_decl=0 | |
20937 | fi | |
20938 | ||
20939 | cat >>confdefs.h <<_ACEOF | |
20940 | #define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl | |
20941 | _ACEOF | |
20942 | if test $ac_have_decl = 1; then : | |
20943 | ac_found=1 | |
20944 | fi | |
4a626d0a | 20945 | |
6ec2e0f5 SDJ |
20946 | ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h> |
20947 | " | |
d0ac1c44 | 20948 | if test "x$ac_cv_have_decl___argv" = xyes; then : |
6ec2e0f5 SDJ |
20949 | ac_have_decl=1 |
20950 | else | |
20951 | ac_have_decl=0 | |
20952 | fi | |
4a626d0a | 20953 | |
6ec2e0f5 SDJ |
20954 | cat >>confdefs.h <<_ACEOF |
20955 | #define HAVE_DECL___ARGV $ac_have_decl | |
20956 | _ACEOF | |
20957 | if test $ac_have_decl = 1; then : | |
20958 | ac_found=1 | |
20959 | fi | |
4a626d0a PA |
20960 | |
20961 | ||
6ec2e0f5 SDJ |
20962 | # Incur the cost of this test only if none of the above worked. |
20963 | if test $ac_found = 0; then | |
20964 | # On OpenBSD 5.1, using the global __progname variable appears to be | |
20965 | # the only way to implement getprogname. | |
20966 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5 | |
20967 | $as_echo_n "checking whether __progname is defined in default libraries... " >&6; } | |
d0ac1c44 | 20968 | if ${gl_cv_var___progname+:} false; then : |
6ec2e0f5 SDJ |
20969 | $as_echo_n "(cached) " >&6 |
20970 | else | |
4a626d0a | 20971 | |
6ec2e0f5 SDJ |
20972 | gl_cv_var___progname= |
20973 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20974 | /* end confdefs.h. */ | |
20975 | extern char *__progname; | |
20976 | int | |
20977 | main () | |
20978 | { | |
20979 | return *__progname; | |
20980 | ||
20981 | ; | |
20982 | return 0; | |
20983 | } | |
20984 | _ACEOF | |
20985 | if ac_fn_c_try_link "$LINENO"; then : | |
20986 | gl_cv_var___progname=yes | |
20987 | ||
20988 | fi | |
20989 | rm -f core conftest.err conftest.$ac_objext \ | |
20990 | conftest$ac_exeext conftest.$ac_ext | |
20991 | ||
20992 | ||
20993 | fi | |
20994 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5 | |
20995 | $as_echo "$gl_cv_var___progname" >&6; } | |
20996 | if test "$gl_cv_var___progname" = yes; then | |
20997 | ||
20998 | $as_echo "#define HAVE_VAR___PROGNAME 1" >>confdefs.h | |
20999 | ||
21000 | fi | |
21001 | fi | |
4a626d0a PA |
21002 | |
21003 | ||
21004 | ||
21005 | ||
21006 | ||
698be2d8 CB |
21007 | if test "$ac_cv_func_getrandom" != yes; then |
21008 | HAVE_GETRANDOM=0 | |
21009 | else | |
21010 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getrandom is compatible with its GNU+BSD signature" >&5 | |
21011 | $as_echo_n "checking whether getrandom is compatible with its GNU+BSD signature... " >&6; } | |
21012 | if ${gl_cv_func_getrandom_ok+:} false; then : | |
21013 | $as_echo_n "(cached) " >&6 | |
21014 | else | |
21015 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21016 | /* end confdefs.h. */ | |
9c9d63b1 PM |
21017 | /* Additional includes are needed before <sys/random.h> on uClibc |
21018 | and Mac OS X. */ | |
698be2d8 CB |
21019 | #include <sys/types.h> |
21020 | #include <stdlib.h> | |
21021 | #include <sys/random.h> | |
21022 | ssize_t getrandom (void *, size_t, unsigned int); | |
21023 | ||
21024 | int | |
21025 | main () | |
21026 | { | |
21027 | ||
21028 | ; | |
21029 | return 0; | |
21030 | } | |
21031 | ||
21032 | _ACEOF | |
21033 | if ac_fn_c_try_compile "$LINENO"; then : | |
21034 | gl_cv_func_getrandom_ok=yes | |
21035 | else | |
21036 | gl_cv_func_getrandom_ok=no | |
21037 | fi | |
21038 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21039 | ||
21040 | fi | |
21041 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getrandom_ok" >&5 | |
21042 | $as_echo "$gl_cv_func_getrandom_ok" >&6; } | |
21043 | if test $gl_cv_func_getrandom_ok = no; then | |
21044 | REPLACE_GETRANDOM=1 | |
21045 | fi | |
21046 | fi | |
21047 | ||
21048 | case "$host_os" in | |
21049 | mingw*) | |
21050 | for ac_header in bcrypt.h | |
21051 | do : | |
9c9d63b1 PM |
21052 | ac_fn_c_check_header_compile "$LINENO" "bcrypt.h" "ac_cv_header_bcrypt_h" "#include <windows.h> |
21053 | ||
21054 | " | |
698be2d8 CB |
21055 | if test "x$ac_cv_header_bcrypt_h" = xyes; then : |
21056 | cat >>confdefs.h <<_ACEOF | |
21057 | #define HAVE_BCRYPT_H 1 | |
21058 | _ACEOF | |
21059 | ||
21060 | fi | |
21061 | ||
21062 | done | |
21063 | ||
21064 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the bcrypt library is guaranteed to be present" >&5 | |
21065 | $as_echo_n "checking whether the bcrypt library is guaranteed to be present... " >&6; } | |
21066 | if ${gl_cv_lib_assume_bcrypt+:} false; then : | |
21067 | $as_echo_n "(cached) " >&6 | |
21068 | else | |
21069 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21070 | /* end confdefs.h. */ | |
21071 | #include <windows.h> | |
21072 | int | |
21073 | main () | |
21074 | { | |
21075 | #if !(_WIN32_WINNT >= _WIN32_WINNT_WIN7) | |
21076 | cannot assume it | |
21077 | #endif | |
21078 | ||
21079 | ; | |
21080 | return 0; | |
21081 | } | |
21082 | ||
21083 | _ACEOF | |
21084 | if ac_fn_c_try_compile "$LINENO"; then : | |
21085 | gl_cv_lib_assume_bcrypt=yes | |
21086 | else | |
21087 | gl_cv_lib_assume_bcrypt=no | |
21088 | fi | |
21089 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21090 | ||
21091 | fi | |
21092 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_assume_bcrypt" >&5 | |
21093 | $as_echo "$gl_cv_lib_assume_bcrypt" >&6; } | |
21094 | if test $gl_cv_lib_assume_bcrypt = yes; then | |
21095 | ||
21096 | $as_echo "#define HAVE_LIB_BCRYPT 1" >>confdefs.h | |
21097 | ||
21098 | LIB_GETRANDOM='-lbcrypt' | |
21099 | else | |
21100 | LIB_GETRANDOM='-ladvapi32' | |
21101 | fi | |
21102 | ;; | |
21103 | *) | |
21104 | LIB_GETRANDOM= ;; | |
21105 | esac | |
21106 | ||
21107 | ||
21108 | if test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1; then | |
21109 | ||
21110 | ||
21111 | ||
21112 | ||
21113 | ||
21114 | ||
21115 | ||
21116 | ||
21117 | gl_LIBOBJS="$gl_LIBOBJS getrandom.$ac_objext" | |
21118 | ||
21119 | fi | |
21120 | ||
21121 | ||
21122 | ||
21123 | ||
21124 | ||
21125 | GNULIB_GETRANDOM=1 | |
21126 | ||
21127 | ||
21128 | ||
21129 | ||
21130 | ||
21131 | $as_echo "#define GNULIB_TEST_GETRANDOM 1" >>confdefs.h | |
21132 | ||
21133 | ||
21134 | ||
21135 | ||
21136 | ||
21137 | ||
21138 | ||
4a626d0a PA |
21139 | |
21140 | ||
21141 | ||
472fa5ee | 21142 | |
4a626d0a PA |
21143 | |
21144 | gl_gettimeofday_timezone=void | |
21145 | if test $ac_cv_func_gettimeofday != yes; then | |
21146 | HAVE_GETTIMEOFDAY=0 | |
21147 | else | |
4a626d0a PA |
21148 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5 |
21149 | $as_echo_n "checking for gettimeofday with POSIX signature... " >&6; } | |
d0ac1c44 | 21150 | if ${gl_cv_func_gettimeofday_posix_signature+:} false; then : |
4a626d0a PA |
21151 | $as_echo_n "(cached) " >&6 |
21152 | else | |
21153 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21154 | /* end confdefs.h. */ | |
21155 | #include <sys/time.h> | |
21156 | struct timeval c; | |
21157 | int gettimeofday (struct timeval *restrict, void *restrict); | |
21158 | ||
21159 | int | |
21160 | main () | |
21161 | { | |
21162 | /* glibc uses struct timezone * rather than the POSIX void * | |
21163 | if _GNU_SOURCE is defined. However, since the only portable | |
21164 | use of gettimeofday uses NULL as the second parameter, and | |
21165 | since the glibc definition is actually more typesafe, it is | |
21166 | not worth wrapping this to get a compliant signature. */ | |
21167 | int (*f) (struct timeval *restrict, void *restrict) | |
21168 | = gettimeofday; | |
21169 | int x = f (&c, 0); | |
21170 | return !(x | c.tv_sec | c.tv_usec); | |
21171 | ||
21172 | ; | |
21173 | return 0; | |
21174 | } | |
21175 | _ACEOF | |
21176 | if ac_fn_c_try_compile "$LINENO"; then : | |
21177 | gl_cv_func_gettimeofday_posix_signature=yes | |
21178 | else | |
21179 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21180 | /* end confdefs.h. */ | |
21181 | #include <sys/time.h> | |
21182 | int gettimeofday (struct timeval *restrict, struct timezone *restrict); | |
21183 | ||
21184 | int | |
21185 | main () | |
21186 | { | |
21187 | ||
21188 | ; | |
21189 | return 0; | |
21190 | } | |
21191 | _ACEOF | |
21192 | if ac_fn_c_try_compile "$LINENO"; then : | |
21193 | gl_cv_func_gettimeofday_posix_signature=almost | |
21194 | else | |
21195 | gl_cv_func_gettimeofday_posix_signature=no | |
21196 | fi | |
21197 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21198 | fi | |
21199 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21200 | fi | |
21201 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5 | |
21202 | $as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; } | |
21203 | if test $gl_cv_func_gettimeofday_posix_signature = almost; then | |
21204 | gl_gettimeofday_timezone='struct timezone' | |
21205 | elif test $gl_cv_func_gettimeofday_posix_signature != yes; then | |
21206 | REPLACE_GETTIMEOFDAY=1 | |
21207 | fi | |
21208 | if test $REPLACE_STRUCT_TIMEVAL = 1; then | |
21209 | REPLACE_GETTIMEOFDAY=1 | |
21210 | fi | |
c0c3707f CB |
21211 | case "$host_os" in |
21212 | mingw*) REPLACE_GETTIMEOFDAY=1 ;; | |
21213 | esac | |
4a626d0a PA |
21214 | fi |
21215 | ||
21216 | cat >>confdefs.h <<_ACEOF | |
c0c3707f CB |
21217 | #define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone |
21218 | _ACEOF | |
88b48903 WN |
21219 | |
21220 | ||
c0c3707f | 21221 | if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then |
88b48903 | 21222 | |
6ec2e0f5 | 21223 | |
6ec2e0f5 | 21224 | |
6ec2e0f5 | 21225 | |
6ec2e0f5 | 21226 | |
6ec2e0f5 SDJ |
21227 | |
21228 | ||
6ec2e0f5 | 21229 | |
c0c3707f | 21230 | gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" |
6ec2e0f5 | 21231 | |
c0c3707f | 21232 | : |
5e8754f9 | 21233 | fi |
6ec2e0f5 SDJ |
21234 | |
21235 | ||
21236 | ||
6ec2e0f5 SDJ |
21237 | |
21238 | ||
5e8754f9 | 21239 | GNULIB_GETTIMEOFDAY=1 |
6ec2e0f5 SDJ |
21240 | |
21241 | ||
21242 | ||
7a6dbc2f SDJ |
21243 | |
21244 | ||
5e8754f9 | 21245 | $as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h |
6ec2e0f5 SDJ |
21246 | |
21247 | ||
21248 | ||
6ec2e0f5 | 21249 | |
6ec2e0f5 | 21250 | |
6ec2e0f5 SDJ |
21251 | |
21252 | ||
c0c3707f CB |
21253 | if test $ac_cv_func_glob = no; then |
21254 | HAVE_GLOB=0 | |
21255 | else | |
21256 | ||
21257 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU glob interface version 1 or 2" >&5 | |
21258 | $as_echo_n "checking for GNU glob interface version 1 or 2... " >&6; } | |
21259 | if ${gl_cv_gnu_glob_interface_version_1_2+:} false; then : | |
6ec2e0f5 SDJ |
21260 | $as_echo_n "(cached) " >&6 |
21261 | else | |
21262 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21263 | /* end confdefs.h. */ | |
21264 | #include <gnu-versions.h> | |
c0c3707f | 21265 | char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1 : -1]; |
6ec2e0f5 SDJ |
21266 | _ACEOF |
21267 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 21268 | gl_cv_gnu_glob_interface_version_1_2=yes |
6ec2e0f5 | 21269 | else |
c0c3707f | 21270 | gl_cv_gnu_glob_interface_version_1_2=no |
6ec2e0f5 SDJ |
21271 | fi |
21272 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21273 | fi | |
c0c3707f CB |
21274 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_gnu_glob_interface_version_1_2" >&5 |
21275 | $as_echo "$gl_cv_gnu_glob_interface_version_1_2" >&6; } | |
21276 | if test "$gl_cv_gnu_glob_interface_version_1_2" = "no"; then | |
21277 | REPLACE_GLOB=1 | |
6ec2e0f5 | 21278 | fi |
6ec2e0f5 | 21279 | |
c0c3707f CB |
21280 | if test $REPLACE_GLOB = 0; then |
21281 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether glob lists broken symlinks" >&5 | |
6ec2e0f5 | 21282 | $as_echo_n "checking whether glob lists broken symlinks... " >&6; } |
d0ac1c44 | 21283 | if ${gl_cv_glob_lists_symlinks+:} false; then : |
6ec2e0f5 SDJ |
21284 | $as_echo_n "(cached) " >&6 |
21285 | else | |
c0c3707f CB |
21286 | if test $cross_compiling != yes; then |
21287 | if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then | |
21288 | gl_cv_glob_lists_symlinks=maybe | |
21289 | else | |
21290 | # If we can't make a symlink, then we cannot test this issue. Be | |
21291 | # pessimistic about this. | |
21292 | gl_cv_glob_lists_symlinks=no | |
21293 | fi | |
21294 | if test $gl_cv_glob_lists_symlinks = maybe; then | |
21295 | if test "$cross_compiling" = yes; then : | |
21296 | : | |
5e8754f9 | 21297 | |
6ec2e0f5 SDJ |
21298 | else |
21299 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21300 | /* end confdefs.h. */ | |
6ec2e0f5 | 21301 | #include <stddef.h> |
c0c3707f | 21302 | #include <glob.h> |
6ec2e0f5 SDJ |
21303 | int |
21304 | main () | |
21305 | { | |
21306 | glob_t found; | |
c0c3707f CB |
21307 | if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH) |
21308 | return 1; | |
698be2d8 | 21309 | globfree (&found); |
c0c3707f | 21310 | |
6ec2e0f5 SDJ |
21311 | ; |
21312 | return 0; | |
21313 | } | |
4a626d0a | 21314 | _ACEOF |
6ec2e0f5 SDJ |
21315 | if ac_fn_c_try_run "$LINENO"; then : |
21316 | gl_cv_glob_lists_symlinks=yes | |
21317 | else | |
21318 | gl_cv_glob_lists_symlinks=no | |
21319 | fi | |
21320 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
21321 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
21322 | fi | |
88b48903 | 21323 | |
c0c3707f CB |
21324 | fi |
21325 | rm -f conf$$-globtest | |
21326 | else | |
21327 | gl_cv_glob_lists_symlinks="$gl_cross_guess_normal" | |
21328 | fi | |
21329 | ||
4a626d0a | 21330 | fi |
6ec2e0f5 SDJ |
21331 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_glob_lists_symlinks" >&5 |
21332 | $as_echo "$gl_cv_glob_lists_symlinks" >&6; } | |
c0c3707f CB |
21333 | case "$gl_cv_glob_lists_symlinks" in |
21334 | *yes) ;; | |
21335 | *) REPLACE_GLOB=1 ;; | |
21336 | esac | |
21337 | fi | |
21338 | ||
21339 | fi | |
88b48903 | 21340 | |
c0c3707f CB |
21341 | if test $ac_cv_func_glob_pattern_p = no; then |
21342 | HAVE_GLOB_PATTERN_P=0 | |
21343 | else | |
21344 | if test $REPLACE_GLOB = 1; then | |
21345 | REPLACE_GLOB_PATTERN_P=1 | |
6ec2e0f5 SDJ |
21346 | fi |
21347 | fi | |
4a626d0a | 21348 | |
c0c3707f | 21349 | if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then |
4a626d0a | 21350 | |
88b48903 | 21351 | |
c0c3707f | 21352 | GLOB_H='glob.h' |
6ec2e0f5 SDJ |
21353 | if test -n "$GLOB_H"; then |
21354 | GL_GENERATE_GLOB_H_TRUE= | |
21355 | GL_GENERATE_GLOB_H_FALSE='#' | |
21356 | else | |
21357 | GL_GENERATE_GLOB_H_TRUE='#' | |
21358 | GL_GENERATE_GLOB_H_FALSE= | |
21359 | fi | |
88b48903 | 21360 | |
88b48903 | 21361 | |
c0c3707f CB |
21362 | fi |
21363 | ||
21364 | if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then | |
472fa5ee SM |
21365 | |
21366 | ||
21367 | ||
21368 | ||
21369 | ||
21370 | ||
21371 | ||
21372 | ||
21373 | gl_LIBOBJS="$gl_LIBOBJS glob.$ac_objext" | |
21374 | ||
21375 | ||
21376 | ||
7a6dbc2f SDJ |
21377 | |
21378 | ||
21379 | ||
472fa5ee | 21380 | |
472fa5ee | 21381 | |
88b48903 | 21382 | |
c0c3707f | 21383 | gl_LIBOBJS="$gl_LIBOBJS globfree.$ac_objext" |
88b48903 WN |
21384 | |
21385 | ||
21386 | ||
725e2999 JB |
21387 | |
21388 | ||
21389 | ||
c0c3707f CB |
21390 | fi |
21391 | if test $HAVE_GLOB_PATTERN_P = 0 || test $REPLACE_GLOB_PATTERN_P = 1; then | |
21392 | ||
725e2999 JB |
21393 | |
21394 | ||
21395 | ||
21396 | ||
21397 | ||
21398 | ||
21399 | ||
c0c3707f | 21400 | gl_LIBOBJS="$gl_LIBOBJS glob_pattern_p.$ac_objext" |
725e2999 JB |
21401 | |
21402 | fi | |
21403 | ||
725e2999 JB |
21404 | |
21405 | ||
21406 | ||
21407 | ||
c0c3707f CB |
21408 | GNULIB_GLOB=1 |
21409 | ||
21410 | ||
21411 | ||
21412 | ||
21413 | ||
21414 | $as_echo "#define GNULIB_TEST_GLOB 1" >>confdefs.h | |
21415 | ||
21416 | ||
725e2999 JB |
21417 | |
21418 | ||
21419 | ||
5df4cba6 SM |
21420 | LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL" |
21421 | ||
21422 | ||
725e2999 | 21423 | |
725e2999 JB |
21424 | |
21425 | ||
21426 | ||
21427 | ||
725e2999 | 21428 | |
c0c3707f CB |
21429 | HAVE_INET_NTOP=1 |
21430 | INET_NTOP_LIB= | |
725e2999 JB |
21431 | |
21432 | ||
21433 | ||
21434 | ||
21435 | if test $ac_cv_header_sys_socket_h != yes; then | |
21436 | for ac_header in winsock2.h | |
21437 | do : | |
21438 | ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" | |
21439 | if test "x$ac_cv_header_winsock2_h" = xyes; then : | |
21440 | cat >>confdefs.h <<_ACEOF | |
21441 | #define HAVE_WINSOCK2_H 1 | |
21442 | _ACEOF | |
21443 | ||
21444 | fi | |
21445 | ||
21446 | done | |
21447 | ||
21448 | fi | |
21449 | if test "$ac_cv_header_winsock2_h" = yes; then | |
21450 | HAVE_WINSOCK2_H=1 | |
21451 | UNISTD_H_HAVE_WINSOCK2_H=1 | |
21452 | SYS_IOCTL_H_HAVE_WINSOCK2_H=1 | |
21453 | else | |
21454 | HAVE_WINSOCK2_H=0 | |
21455 | fi | |
21456 | ||
21457 | ||
21458 | if test $HAVE_WINSOCK2_H = 1; then | |
c0c3707f | 21459 | REPLACE_INET_NTOP=1 |
725e2999 JB |
21460 | ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <ws2tcpip.h> |
21461 | " | |
21462 | if test "x$ac_cv_have_decl_inet_ntop" = xyes; then : | |
21463 | ac_have_decl=1 | |
21464 | else | |
21465 | ac_have_decl=0 | |
21466 | fi | |
21467 | ||
21468 | cat >>confdefs.h <<_ACEOF | |
21469 | #define HAVE_DECL_INET_NTOP $ac_have_decl | |
21470 | _ACEOF | |
21471 | ||
21472 | if test $ac_cv_have_decl_inet_ntop = yes; then | |
725e2999 JB |
21473 | INET_NTOP_LIB="-lws2_32" |
21474 | else | |
21475 | HAVE_DECL_INET_NTOP=0 | |
725e2999 JB |
21476 | fi |
21477 | else | |
21478 | gl_save_LIBS=$LIBS | |
21479 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 | |
21480 | $as_echo_n "checking for library containing inet_ntop... " >&6; } | |
21481 | if ${ac_cv_search_inet_ntop+:} false; then : | |
21482 | $as_echo_n "(cached) " >&6 | |
21483 | else | |
21484 | ac_func_search_save_LIBS=$LIBS | |
21485 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21486 | /* end confdefs.h. */ | |
21487 | ||
21488 | /* Override any GCC internal prototype to avoid an error. | |
21489 | Use char because int might match the return type of a GCC | |
21490 | builtin and then its argument prototype would still apply. */ | |
21491 | #ifdef __cplusplus | |
21492 | extern "C" | |
21493 | #endif | |
21494 | char inet_ntop (); | |
21495 | int | |
21496 | main () | |
21497 | { | |
21498 | return inet_ntop (); | |
21499 | ; | |
21500 | return 0; | |
21501 | } | |
21502 | _ACEOF | |
c0c3707f | 21503 | for ac_lib in '' nsl resolv network; do |
725e2999 JB |
21504 | if test -z "$ac_lib"; then |
21505 | ac_res="none required" | |
21506 | else | |
21507 | ac_res=-l$ac_lib | |
21508 | LIBS="-l$ac_lib $ac_func_search_save_LIBS" | |
21509 | fi | |
21510 | if ac_fn_c_try_link "$LINENO"; then : | |
21511 | ac_cv_search_inet_ntop=$ac_res | |
21512 | fi | |
21513 | rm -f core conftest.err conftest.$ac_objext \ | |
21514 | conftest$ac_exeext | |
21515 | if ${ac_cv_search_inet_ntop+:} false; then : | |
21516 | break | |
21517 | fi | |
21518 | done | |
21519 | if ${ac_cv_search_inet_ntop+:} false; then : | |
21520 | ||
21521 | else | |
21522 | ac_cv_search_inet_ntop=no | |
21523 | fi | |
21524 | rm conftest.$ac_ext | |
21525 | LIBS=$ac_func_search_save_LIBS | |
21526 | fi | |
21527 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 | |
21528 | $as_echo "$ac_cv_search_inet_ntop" >&6; } | |
21529 | ac_res=$ac_cv_search_inet_ntop | |
21530 | if test "$ac_res" != no; then : | |
21531 | test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" | |
21532 | ||
21533 | else | |
21534 | for ac_func in inet_ntop | |
21535 | do : | |
21536 | ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop" | |
21537 | if test "x$ac_cv_func_inet_ntop" = xyes; then : | |
21538 | cat >>confdefs.h <<_ACEOF | |
21539 | #define HAVE_INET_NTOP 1 | |
21540 | _ACEOF | |
21541 | ||
21542 | fi | |
21543 | done | |
21544 | ||
21545 | if test $ac_cv_func_inet_ntop = no; then | |
21546 | HAVE_INET_NTOP=0 | |
21547 | fi | |
21548 | ||
21549 | fi | |
21550 | ||
21551 | LIBS=$gl_save_LIBS | |
21552 | ||
21553 | if test "$ac_cv_search_inet_ntop" != "no" \ | |
21554 | && test "$ac_cv_search_inet_ntop" != "none required"; then | |
21555 | INET_NTOP_LIB="$ac_cv_search_inet_ntop" | |
21556 | fi | |
21557 | ||
21558 | ||
725e2999 JB |
21559 | ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <arpa/inet.h> |
21560 | #if HAVE_NETDB_H | |
21561 | # include <netdb.h> | |
21562 | #endif | |
21563 | ||
21564 | " | |
21565 | if test "x$ac_cv_have_decl_inet_ntop" = xyes; then : | |
21566 | ac_have_decl=1 | |
21567 | else | |
21568 | ac_have_decl=0 | |
21569 | fi | |
21570 | ||
21571 | cat >>confdefs.h <<_ACEOF | |
21572 | #define HAVE_DECL_INET_NTOP $ac_have_decl | |
21573 | _ACEOF | |
21574 | ||
21575 | if test $ac_cv_have_decl_inet_ntop = no; then | |
21576 | HAVE_DECL_INET_NTOP=0 | |
21577 | fi | |
21578 | fi | |
21579 | ||
21580 | ||
21581 | if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then | |
21582 | ||
21583 | ||
21584 | ||
21585 | ||
21586 | ||
21587 | ||
21588 | ||
7a6dbc2f | 21589 | |
725e2999 | 21590 | gl_LIBOBJS="$gl_LIBOBJS inet_ntop.$ac_objext" |
7a6dbc2f SDJ |
21591 | |
21592 | ||
21593 | ||
7a6dbc2f | 21594 | |
725e2999 | 21595 | fi |
7a6dbc2f SDJ |
21596 | |
21597 | ||
21598 | ||
21599 | ||
7a6dbc2f | 21600 | |
725e2999 JB |
21601 | GNULIB_INET_NTOP=1 |
21602 | ||
7a6dbc2f SDJ |
21603 | |
21604 | ||
49e4877c PA |
21605 | |
21606 | ||
88b48903 WN |
21607 | |
21608 | ||
88b48903 WN |
21609 | PRIPTR_PREFIX= |
21610 | if test -n "$STDINT_H"; then | |
9c9d63b1 PM |
21611 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
21612 | /* end confdefs.h. */ | |
21613 | ||
21614 | #ifdef _WIN64 | |
21615 | LLP64 | |
21616 | #endif | |
21617 | ||
21618 | int | |
21619 | main () | |
21620 | { | |
21621 | ||
21622 | ; | |
21623 | return 0; | |
21624 | } | |
21625 | ||
21626 | _ACEOF | |
21627 | if ac_fn_c_try_compile "$LINENO"; then : | |
21628 | PRIPTR_PREFIX='"l"' | |
21629 | else | |
21630 | PRIPTR_PREFIX='"ll"' | |
21631 | fi | |
21632 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
88b48903 WN |
21633 | else |
21634 | for glpfx in '' l ll I64; do | |
21635 | case $glpfx in | |
21636 | '') gltype1='int';; | |
21637 | l) gltype1='long int';; | |
21638 | ll) gltype1='long long int';; | |
21639 | I64) gltype1='__int64';; | |
21640 | esac | |
21641 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21642 | /* end confdefs.h. */ | |
21643 | #include <stdint.h> | |
21644 | extern intptr_t foo; | |
21645 | extern $gltype1 foo; | |
21646 | int | |
21647 | main () | |
21648 | { | |
21649 | ||
21650 | ; | |
21651 | return 0; | |
21652 | } | |
21653 | _ACEOF | |
21654 | if ac_fn_c_try_compile "$LINENO"; then : | |
21655 | PRIPTR_PREFIX='"'$glpfx'"' | |
21656 | fi | |
21657 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21658 | test -n "$PRIPTR_PREFIX" && break | |
21659 | done | |
21660 | fi | |
21661 | ||
21662 | ||
21663 | ||
21664 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5 | |
21665 | $as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; } | |
d0ac1c44 | 21666 | if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then : |
88b48903 WN |
21667 | $as_echo_n "(cached) " >&6 |
21668 | else | |
21669 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21670 | /* end confdefs.h. */ | |
21671 | /* Work also in C++ mode. */ | |
21672 | #define __STDC_LIMIT_MACROS 1 | |
21673 | ||
21674 | /* Work if build is not clean. */ | |
21675 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H | |
21676 | ||
21677 | #include <limits.h> | |
21678 | #if HAVE_STDINT_H | |
21679 | #include <stdint.h> | |
21680 | #endif | |
21681 | ||
21682 | #if defined INT32_MAX && defined INTMAX_MAX | |
21683 | #define CONDITION (INT32_MAX < INTMAX_MAX) | |
88b48903 | 21684 | #else |
5df4cba6 | 21685 | #define CONDITION (sizeof (int) < sizeof (long long int)) |
88b48903 WN |
21686 | #endif |
21687 | int test[CONDITION ? 1 : -1]; | |
21688 | int | |
21689 | main () | |
21690 | { | |
21691 | ||
21692 | ; | |
21693 | return 0; | |
21694 | } | |
21695 | _ACEOF | |
21696 | if ac_fn_c_try_compile "$LINENO"; then : | |
21697 | gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes | |
21698 | else | |
21699 | gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no | |
21700 | fi | |
21701 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21702 | fi | |
21703 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5 | |
21704 | $as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; } | |
21705 | if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then | |
21706 | INT32_MAX_LT_INTMAX_MAX=1; | |
21707 | else | |
21708 | INT32_MAX_LT_INTMAX_MAX=0; | |
21709 | fi | |
21710 | ||
21711 | ||
21712 | if test $APPLE_UNIVERSAL_BUILD = 0; then | |
21713 | ||
21714 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5 | |
21715 | $as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; } | |
d0ac1c44 | 21716 | if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then : |
88b48903 WN |
21717 | $as_echo_n "(cached) " >&6 |
21718 | else | |
21719 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21720 | /* end confdefs.h. */ | |
21721 | /* Work also in C++ mode. */ | |
21722 | #define __STDC_LIMIT_MACROS 1 | |
21723 | ||
21724 | /* Work if build is not clean. */ | |
21725 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H | |
21726 | ||
21727 | #include <limits.h> | |
21728 | #if HAVE_STDINT_H | |
21729 | #include <stdint.h> | |
21730 | #endif | |
21731 | ||
21732 | #if defined INT64_MAX | |
21733 | #define CONDITION (INT64_MAX == LONG_MAX) | |
88b48903 | 21734 | #else |
5df4cba6 | 21735 | #define CONDITION (sizeof (long long int) == sizeof (long int)) |
88b48903 WN |
21736 | #endif |
21737 | int test[CONDITION ? 1 : -1]; | |
21738 | int | |
21739 | main () | |
21740 | { | |
21741 | ||
21742 | ; | |
21743 | return 0; | |
21744 | } | |
21745 | _ACEOF | |
21746 | if ac_fn_c_try_compile "$LINENO"; then : | |
21747 | gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes | |
21748 | else | |
21749 | gl_cv_test_INT64_MAX_EQ_LONG_MAX=no | |
21750 | fi | |
21751 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21752 | fi | |
21753 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5 | |
21754 | $as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; } | |
21755 | if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then | |
21756 | INT64_MAX_EQ_LONG_MAX=1; | |
21757 | else | |
21758 | INT64_MAX_EQ_LONG_MAX=0; | |
21759 | fi | |
21760 | ||
21761 | ||
21762 | else | |
21763 | INT64_MAX_EQ_LONG_MAX=-1 | |
21764 | fi | |
21765 | ||
21766 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5 | |
21767 | $as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; } | |
d0ac1c44 | 21768 | if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then : |
88b48903 WN |
21769 | $as_echo_n "(cached) " >&6 |
21770 | else | |
21771 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21772 | /* end confdefs.h. */ | |
21773 | /* Work also in C++ mode. */ | |
21774 | #define __STDC_LIMIT_MACROS 1 | |
21775 | ||
21776 | /* Work if build is not clean. */ | |
21777 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H | |
21778 | ||
21779 | #include <limits.h> | |
21780 | #if HAVE_STDINT_H | |
21781 | #include <stdint.h> | |
21782 | #endif | |
21783 | ||
21784 | #if defined UINT32_MAX && defined UINTMAX_MAX | |
21785 | #define CONDITION (UINT32_MAX < UINTMAX_MAX) | |
88b48903 | 21786 | #else |
5df4cba6 | 21787 | #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int)) |
88b48903 WN |
21788 | #endif |
21789 | int test[CONDITION ? 1 : -1]; | |
21790 | int | |
21791 | main () | |
21792 | { | |
21793 | ||
21794 | ; | |
21795 | return 0; | |
21796 | } | |
21797 | _ACEOF | |
21798 | if ac_fn_c_try_compile "$LINENO"; then : | |
21799 | gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes | |
21800 | else | |
21801 | gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no | |
21802 | fi | |
21803 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21804 | fi | |
21805 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5 | |
21806 | $as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; } | |
21807 | if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then | |
21808 | UINT32_MAX_LT_UINTMAX_MAX=1; | |
21809 | else | |
21810 | UINT32_MAX_LT_UINTMAX_MAX=0; | |
21811 | fi | |
21812 | ||
21813 | ||
21814 | if test $APPLE_UNIVERSAL_BUILD = 0; then | |
21815 | ||
21816 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5 | |
21817 | $as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; } | |
d0ac1c44 | 21818 | if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then : |
88b48903 WN |
21819 | $as_echo_n "(cached) " >&6 |
21820 | else | |
21821 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21822 | /* end confdefs.h. */ | |
21823 | /* Work also in C++ mode. */ | |
21824 | #define __STDC_LIMIT_MACROS 1 | |
21825 | ||
21826 | /* Work if build is not clean. */ | |
21827 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H | |
21828 | ||
21829 | #include <limits.h> | |
21830 | #if HAVE_STDINT_H | |
21831 | #include <stdint.h> | |
21832 | #endif | |
21833 | ||
21834 | #if defined UINT64_MAX | |
21835 | #define CONDITION (UINT64_MAX == ULONG_MAX) | |
88b48903 | 21836 | #else |
5df4cba6 | 21837 | #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int)) |
88b48903 WN |
21838 | #endif |
21839 | int test[CONDITION ? 1 : -1]; | |
21840 | int | |
21841 | main () | |
21842 | { | |
21843 | ||
21844 | ; | |
21845 | return 0; | |
21846 | } | |
21847 | _ACEOF | |
21848 | if ac_fn_c_try_compile "$LINENO"; then : | |
21849 | gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes | |
21850 | else | |
21851 | gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no | |
21852 | fi | |
21853 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21854 | fi | |
21855 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5 | |
21856 | $as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; } | |
21857 | if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then | |
21858 | UINT64_MAX_EQ_ULONG_MAX=1; | |
21859 | else | |
21860 | UINT64_MAX_EQ_ULONG_MAX=0; | |
21861 | fi | |
21862 | ||
21863 | ||
21864 | else | |
21865 | UINT64_MAX_EQ_ULONG_MAX=-1 | |
21866 | fi | |
21867 | ||
21868 | ||
21869 | ||
21870 | ||
21871 | ||
698be2d8 CB |
21872 | |
21873 | ||
21874 | ||
21875 | if test $ac_cv_func_isblank = no; then | |
21876 | HAVE_ISBLANK=0 | |
21877 | fi | |
21878 | ||
21879 | if test $HAVE_ISBLANK = 0; then | |
21880 | ||
21881 | ||
21882 | ||
21883 | ||
21884 | ||
21885 | ||
21886 | ||
21887 | ||
21888 | gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext" | |
21889 | ||
21890 | fi | |
21891 | ||
21892 | ||
21893 | cat >>confdefs.h <<_ACEOF | |
21894 | #define GNULIB_ISBLANK 1 | |
21895 | _ACEOF | |
21896 | ||
21897 | ||
21898 | ||
21899 | ||
21900 | ||
21901 | ||
21902 | ||
21903 | GNULIB_ISBLANK=1 | |
21904 | ||
21905 | ||
21906 | ||
21907 | ||
21908 | ||
21909 | ||
88b48903 WN |
21910 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5 |
21911 | $as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; } | |
d0ac1c44 | 21912 | if ${gl_cv_func_isnand_no_libm+:} false; then : |
88b48903 WN |
21913 | $as_echo_n "(cached) " >&6 |
21914 | else | |
21915 | ||
21916 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21917 | /* end confdefs.h. */ | |
21918 | #include <math.h> | |
9c9d63b1 | 21919 | #if (__GNUC__ >= 4) || (__clang_major__ >= 4) |
88b48903 WN |
21920 | # undef isnand |
21921 | # define isnand(x) __builtin_isnan ((double)(x)) | |
21922 | #else | |
21923 | # undef isnand | |
21924 | # define isnand(x) isnan ((double)(x)) | |
21925 | #endif | |
21926 | double x; | |
21927 | int | |
21928 | main () | |
21929 | { | |
21930 | return isnand (x); | |
21931 | ; | |
21932 | return 0; | |
21933 | } | |
21934 | _ACEOF | |
21935 | if ac_fn_c_try_link "$LINENO"; then : | |
21936 | gl_cv_func_isnand_no_libm=yes | |
21937 | else | |
21938 | gl_cv_func_isnand_no_libm=no | |
21939 | fi | |
21940 | rm -f core conftest.err conftest.$ac_objext \ | |
21941 | conftest$ac_exeext conftest.$ac_ext | |
21942 | ||
21943 | fi | |
21944 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5 | |
21945 | $as_echo "$gl_cv_func_isnand_no_libm" >&6; } | |
21946 | ||
21947 | gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm | |
21948 | if test $gl_cv_func_isnand_no_libm = yes; then | |
21949 | ||
21950 | $as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h | |
21951 | ||
21952 | fi | |
21953 | ||
21954 | if test $gl_func_isnand_no_libm != yes; then | |
21955 | ||
21956 | ||
21957 | ||
21958 | ||
21959 | ||
21960 | ||
21961 | ||
21962 | ||
21963 | gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext" | |
21964 | ||
21965 | ||
21966 | ||
21967 | ||
21968 | fi | |
21969 | ||
21970 | ||
21971 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5 | |
21972 | $as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; } | |
d0ac1c44 | 21973 | if ${gl_cv_func_isnanl_no_libm+:} false; then : |
88b48903 WN |
21974 | $as_echo_n "(cached) " >&6 |
21975 | else | |
21976 | ||
21977 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21978 | /* end confdefs.h. */ | |
21979 | #include <math.h> | |
9c9d63b1 | 21980 | #if (__GNUC__ >= 4) || (__clang_major__ >= 4) |
88b48903 | 21981 | # undef isnanl |
9c9d63b1 | 21982 | # define isnanl(x) __builtin_isnan ((long double)(x)) |
88b48903 WN |
21983 | #elif defined isnan |
21984 | # undef isnanl | |
21985 | # define isnanl(x) isnan ((long double)(x)) | |
21986 | #endif | |
21987 | long double x; | |
21988 | int | |
21989 | main () | |
21990 | { | |
21991 | return isnanl (x); | |
21992 | ; | |
21993 | return 0; | |
21994 | } | |
21995 | _ACEOF | |
21996 | if ac_fn_c_try_link "$LINENO"; then : | |
21997 | gl_cv_func_isnanl_no_libm=yes | |
21998 | else | |
21999 | gl_cv_func_isnanl_no_libm=no | |
22000 | fi | |
22001 | rm -f core conftest.err conftest.$ac_objext \ | |
22002 | conftest$ac_exeext conftest.$ac_ext | |
22003 | ||
22004 | fi | |
22005 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5 | |
22006 | $as_echo "$gl_cv_func_isnanl_no_libm" >&6; } | |
22007 | ||
22008 | gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm | |
22009 | if test $gl_func_isnanl_no_libm = yes; then | |
22010 | ||
22011 | ||
22012 | ||
22013 | ||
22014 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5 | |
22015 | $as_echo_n "checking whether isnanl works... " >&6; } | |
d0ac1c44 | 22016 | if ${gl_cv_func_isnanl_works+:} false; then : |
88b48903 WN |
22017 | $as_echo_n "(cached) " >&6 |
22018 | else | |
22019 | ||
22020 | if test "$cross_compiling" = yes; then : | |
c0c3707f CB |
22021 | case "$host_os" in |
22022 | mingw*) # Guess yes on mingw, no on MSVC. | |
22023 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22024 | /* end confdefs.h. */ | |
22025 | ||
22026 | #ifdef __MINGW32__ | |
22027 | Known | |
22028 | #endif | |
22029 | ||
22030 | _ACEOF | |
22031 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
22032 | $EGREP "Known" >/dev/null 2>&1; then : | |
4a626d0a | 22033 | gl_cv_func_isnanl_works="guessing yes" |
c0c3707f CB |
22034 | else |
22035 | gl_cv_func_isnanl_works="guessing no" | |
22036 | fi | |
22037 | rm -f conftest* | |
22038 | ||
22039 | ;; | |
22040 | *) gl_cv_func_isnanl_works="guessing yes" ;; | |
22041 | esac | |
22042 | ||
88b48903 WN |
22043 | else |
22044 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22045 | /* end confdefs.h. */ | |
22046 | ||
22047 | #include <float.h> | |
22048 | #include <limits.h> | |
22049 | #include <math.h> | |
9c9d63b1 | 22050 | #if (__GNUC__ >= 4) || (__clang_major__ >= 4) |
88b48903 | 22051 | # undef isnanl |
9c9d63b1 | 22052 | # define isnanl(x) __builtin_isnan ((long double)(x)) |
88b48903 WN |
22053 | #elif defined isnan |
22054 | # undef isnanl | |
22055 | # define isnanl(x) isnan ((long double)(x)) | |
22056 | #endif | |
22057 | #define NWORDS \ | |
22058 | ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) | |
22059 | typedef union { unsigned int word[NWORDS]; long double value; } | |
22060 | memory_long_double; | |
22061 | /* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the | |
22062 | runtime type conversion. */ | |
22063 | #ifdef __sgi | |
22064 | static long double NaNl () | |
22065 | { | |
22066 | double zero = 0.0; | |
22067 | return zero / zero; | |
22068 | } | |
22069 | #else | |
22070 | # define NaNl() (0.0L / 0.0L) | |
22071 | #endif | |
22072 | int main () | |
22073 | { | |
22074 | int result = 0; | |
22075 | ||
22076 | if (!isnanl (NaNl ())) | |
22077 | result |= 1; | |
22078 | ||
22079 | { | |
22080 | memory_long_double m; | |
22081 | unsigned int i; | |
22082 | ||
22083 | /* The isnanl function should be immune against changes in the sign bit and | |
22084 | in the mantissa bits. The xor operation twiddles a bit that can only be | |
22085 | a sign bit or a mantissa bit (since the exponent never extends to | |
22086 | bit 31). */ | |
22087 | m.value = NaNl (); | |
22088 | m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); | |
22089 | for (i = 0; i < NWORDS; i++) | |
22090 | m.word[i] |= 1; | |
22091 | if (!isnanl (m.value)) | |
22092 | result |= 1; | |
22093 | } | |
22094 | ||
22095 | #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 | |
22096 | /* Representation of an 80-bit 'long double' as an initializer for a sequence | |
22097 | of 'unsigned int' words. */ | |
22098 | # ifdef WORDS_BIGENDIAN | |
22099 | # define LDBL80_WORDS(exponent,manthi,mantlo) \ | |
22100 | { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ | |
4a626d0a | 22101 | ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ |
88b48903 WN |
22102 | (unsigned int) (mantlo) << 16 \ |
22103 | } | |
22104 | # else | |
22105 | # define LDBL80_WORDS(exponent,manthi,mantlo) \ | |
22106 | { mantlo, manthi, exponent } | |
22107 | # endif | |
22108 | { /* Quiet NaN. */ | |
22109 | static memory_long_double x = | |
22110 | { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; | |
22111 | if (!isnanl (x.value)) | |
22112 | result |= 2; | |
22113 | } | |
22114 | { | |
22115 | /* Signalling NaN. */ | |
22116 | static memory_long_double x = | |
22117 | { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; | |
22118 | if (!isnanl (x.value)) | |
22119 | result |= 2; | |
22120 | } | |
4a626d0a | 22121 | /* isnanl should return something even for noncanonical values. */ |
88b48903 WN |
22122 | { /* Pseudo-NaN. */ |
22123 | static memory_long_double x = | |
22124 | { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; | |
4a626d0a | 22125 | if (isnanl (x.value) && !isnanl (x.value)) |
88b48903 WN |
22126 | result |= 4; |
22127 | } | |
22128 | { /* Pseudo-Infinity. */ | |
22129 | static memory_long_double x = | |
22130 | { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; | |
4a626d0a | 22131 | if (isnanl (x.value) && !isnanl (x.value)) |
88b48903 WN |
22132 | result |= 8; |
22133 | } | |
22134 | { /* Pseudo-Zero. */ | |
22135 | static memory_long_double x = | |
22136 | { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; | |
4a626d0a | 22137 | if (isnanl (x.value) && !isnanl (x.value)) |
88b48903 WN |
22138 | result |= 16; |
22139 | } | |
22140 | { /* Unnormalized number. */ | |
22141 | static memory_long_double x = | |
22142 | { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; | |
4a626d0a | 22143 | if (isnanl (x.value) && !isnanl (x.value)) |
88b48903 WN |
22144 | result |= 32; |
22145 | } | |
22146 | { /* Pseudo-Denormal. */ | |
22147 | static memory_long_double x = | |
22148 | { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; | |
4a626d0a | 22149 | if (isnanl (x.value) && !isnanl (x.value)) |
88b48903 WN |
22150 | result |= 64; |
22151 | } | |
22152 | #endif | |
22153 | ||
22154 | return result; | |
22155 | } | |
22156 | _ACEOF | |
22157 | if ac_fn_c_try_run "$LINENO"; then : | |
22158 | gl_cv_func_isnanl_works=yes | |
22159 | else | |
22160 | gl_cv_func_isnanl_works=no | |
22161 | fi | |
22162 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
22163 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
22164 | fi | |
22165 | ||
22166 | ||
22167 | fi | |
22168 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5 | |
22169 | $as_echo "$gl_cv_func_isnanl_works" >&6; } | |
22170 | ||
22171 | case "$gl_cv_func_isnanl_works" in | |
22172 | *yes) ;; | |
22173 | *) gl_func_isnanl_no_libm=no ;; | |
22174 | esac | |
22175 | fi | |
22176 | if test $gl_func_isnanl_no_libm = yes; then | |
22177 | ||
22178 | $as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h | |
22179 | ||
22180 | fi | |
22181 | ||
22182 | if test $gl_func_isnanl_no_libm != yes; then | |
22183 | ||
22184 | ||
22185 | ||
22186 | ||
22187 | ||
22188 | ||
22189 | ||
22190 | ||
22191 | gl_LIBOBJS="$gl_LIBOBJS isnanl.$ac_objext" | |
22192 | ||
22193 | ||
22194 | ||
22195 | ||
c0c3707f | 22196 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5 |
88b48903 | 22197 | $as_echo_n "checking where to find the exponent in a 'long double'... " >&6; } |
d0ac1c44 | 22198 | if ${gl_cv_cc_long_double_expbit0+:} false; then : |
88b48903 WN |
22199 | $as_echo_n "(cached) " >&6 |
22200 | else | |
22201 | ||
22202 | if test "$cross_compiling" = yes; then : | |
22203 | ||
22204 | gl_cv_cc_long_double_expbit0="unknown" | |
c0c3707f CB |
22205 | case "$host_os" in |
22206 | mingw*) # On native Windows (little-endian), we know the result | |
22207 | # in two cases: mingw, MSVC. | |
22208 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22209 | /* end confdefs.h. */ | |
22210 | ||
22211 | #ifdef __MINGW32__ | |
22212 | Known | |
22213 | #endif | |
22214 | ||
22215 | _ACEOF | |
22216 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
22217 | $EGREP "Known" >/dev/null 2>&1; then : | |
22218 | gl_cv_cc_long_double_expbit0="word 2 bit 0" | |
22219 | fi | |
22220 | rm -f conftest* | |
22221 | ||
22222 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22223 | /* end confdefs.h. */ | |
22224 | ||
22225 | #ifdef _MSC_VER | |
22226 | Known | |
22227 | #endif | |
22228 | ||
22229 | _ACEOF | |
22230 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
22231 | $EGREP "Known" >/dev/null 2>&1; then : | |
22232 | gl_cv_cc_long_double_expbit0="word 1 bit 20" | |
22233 | fi | |
22234 | rm -f conftest* | |
22235 | ||
22236 | ;; | |
22237 | esac | |
88b48903 WN |
22238 | |
22239 | else | |
22240 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22241 | /* end confdefs.h. */ | |
22242 | ||
22243 | #include <float.h> | |
22244 | #include <stddef.h> | |
22245 | #include <stdio.h> | |
22246 | #include <string.h> | |
22247 | #define NWORDS \ | |
22248 | ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) | |
22249 | typedef union { long double value; unsigned int word[NWORDS]; } | |
22250 | memory_long_double; | |
22251 | static unsigned int ored_words[NWORDS]; | |
22252 | static unsigned int anded_words[NWORDS]; | |
698be2d8 | 22253 | static void add_to_ored_words (long double *x) |
88b48903 WN |
22254 | { |
22255 | memory_long_double m; | |
22256 | size_t i; | |
22257 | /* Clear it first, in case | |
22258 | sizeof (long double) < sizeof (memory_long_double). */ | |
22259 | memset (&m, 0, sizeof (memory_long_double)); | |
698be2d8 | 22260 | m.value = *x; |
88b48903 WN |
22261 | for (i = 0; i < NWORDS; i++) |
22262 | { | |
22263 | ored_words[i] |= m.word[i]; | |
22264 | anded_words[i] &= m.word[i]; | |
22265 | } | |
22266 | } | |
22267 | int main () | |
22268 | { | |
698be2d8 | 22269 | static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L }; |
88b48903 WN |
22270 | size_t j; |
22271 | FILE *fp = fopen ("conftest.out", "w"); | |
22272 | if (fp == NULL) | |
22273 | return 1; | |
22274 | for (j = 0; j < NWORDS; j++) | |
22275 | anded_words[j] = ~ (unsigned int) 0; | |
698be2d8 CB |
22276 | for (j = 0; j < 5; j++) |
22277 | add_to_ored_words (&samples[j]); | |
88b48903 WN |
22278 | /* Remove bits that are common (e.g. if representation of the first mantissa |
22279 | bit is explicit). */ | |
22280 | for (j = 0; j < NWORDS; j++) | |
22281 | ored_words[j] &= ~anded_words[j]; | |
22282 | /* Now find the nonzero word. */ | |
22283 | for (j = 0; j < NWORDS; j++) | |
22284 | if (ored_words[j] != 0) | |
22285 | break; | |
22286 | if (j < NWORDS) | |
22287 | { | |
22288 | size_t i; | |
22289 | for (i = j + 1; i < NWORDS; i++) | |
22290 | if (ored_words[i] != 0) | |
22291 | { | |
22292 | fprintf (fp, "unknown"); | |
22293 | return (fclose (fp) != 0); | |
22294 | } | |
22295 | for (i = 0; ; i++) | |
22296 | if ((ored_words[j] >> i) & 1) | |
22297 | { | |
22298 | fprintf (fp, "word %d bit %d", (int) j, (int) i); | |
22299 | return (fclose (fp) != 0); | |
22300 | } | |
22301 | } | |
22302 | fprintf (fp, "unknown"); | |
22303 | return (fclose (fp) != 0); | |
22304 | } | |
22305 | ||
22306 | _ACEOF | |
22307 | if ac_fn_c_try_run "$LINENO"; then : | |
22308 | gl_cv_cc_long_double_expbit0=`cat conftest.out` | |
22309 | else | |
22310 | gl_cv_cc_long_double_expbit0="unknown" | |
22311 | fi | |
22312 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
22313 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
22314 | fi | |
22315 | ||
22316 | rm -f conftest.out | |
22317 | ||
22318 | fi | |
22319 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5 | |
22320 | $as_echo "$gl_cv_cc_long_double_expbit0" >&6; } | |
22321 | case "$gl_cv_cc_long_double_expbit0" in | |
22322 | word*bit*) | |
22323 | word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` | |
22324 | bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'` | |
22325 | ||
22326 | cat >>confdefs.h <<_ACEOF | |
22327 | #define LDBL_EXPBIT0_WORD $word | |
22328 | _ACEOF | |
22329 | ||
22330 | ||
22331 | cat >>confdefs.h <<_ACEOF | |
22332 | #define LDBL_EXPBIT0_BIT $bit | |
22333 | _ACEOF | |
22334 | ||
22335 | ;; | |
22336 | esac | |
22337 | ||
22338 | ||
22339 | ||
22340 | fi | |
22341 | ||
22342 | ||
5df4cba6 SM |
22343 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the __inline keyword" >&5 |
22344 | $as_echo_n "checking whether the compiler supports the __inline keyword... " >&6; } | |
22345 | if ${gl_cv_c___inline+:} false; then : | |
22346 | $as_echo_n "(cached) " >&6 | |
22347 | else | |
22348 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22349 | /* end confdefs.h. */ | |
22350 | typedef int foo_t; | |
22351 | static __inline foo_t foo (void) { return 0; } | |
22352 | int | |
22353 | main () | |
22354 | { | |
22355 | return foo (); | |
22356 | ; | |
22357 | return 0; | |
22358 | } | |
22359 | _ACEOF | |
22360 | if ac_fn_c_try_compile "$LINENO"; then : | |
22361 | gl_cv_c___inline=yes | |
22362 | else | |
22363 | gl_cv_c___inline=no | |
22364 | fi | |
22365 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
22366 | fi | |
22367 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c___inline" >&5 | |
22368 | $as_echo "$gl_cv_c___inline" >&6; } | |
22369 | if test $gl_cv_c___inline = yes; then | |
22370 | ||
22371 | $as_echo "#define HAVE___INLINE 1" >>confdefs.h | |
22372 | ||
22373 | fi | |
22374 | ||
22375 | ||
22376 | ||
22377 | ||
22378 | ||
22379 | LOCALCHARSET_TESTS_ENVIRONMENT= | |
22380 | ||
22381 | ||
22382 | ||
22383 | ||
22384 | ||
22385 | ||
22386 | ||
22387 | ||
22388 | ||
22389 | ||
22390 | ||
22391 | case "$host_os" in | |
22392 | solaris*) | |
22393 | ||
22394 | $as_echo "#define _LCONV_C99 1" >>confdefs.h | |
22395 | ||
22396 | ;; | |
22397 | esac | |
22398 | ||
22399 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5 | |
22400 | $as_echo_n "checking whether locale.h conforms to POSIX:2001... " >&6; } | |
22401 | if ${gl_cv_header_locale_h_posix2001+:} false; then : | |
22402 | $as_echo_n "(cached) " >&6 | |
22403 | else | |
22404 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22405 | /* end confdefs.h. */ | |
22406 | #include <locale.h> | |
22407 | int x = LC_MESSAGES; | |
22408 | int y = sizeof (((struct lconv *) 0)->decimal_point); | |
22409 | int | |
22410 | main () | |
22411 | { | |
22412 | ||
22413 | ; | |
22414 | return 0; | |
22415 | } | |
22416 | _ACEOF | |
22417 | if ac_fn_c_try_compile "$LINENO"; then : | |
22418 | gl_cv_header_locale_h_posix2001=yes | |
22419 | else | |
22420 | gl_cv_header_locale_h_posix2001=no | |
22421 | fi | |
22422 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
22423 | fi | |
22424 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5 | |
22425 | $as_echo "$gl_cv_header_locale_h_posix2001" >&6; } | |
22426 | ||
22427 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5 | |
22428 | $as_echo_n "checking whether struct lconv is properly defined... " >&6; } | |
22429 | if ${gl_cv_sys_struct_lconv_ok+:} false; then : | |
c0c3707f CB |
22430 | $as_echo_n "(cached) " >&6 |
22431 | else | |
22432 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22433 | /* end confdefs.h. */ | |
5df4cba6 SM |
22434 | #include <locale.h> |
22435 | struct lconv l; | |
22436 | int x = sizeof (l.decimal_point); | |
22437 | int y = sizeof (l.int_p_cs_precedes); | |
c0c3707f CB |
22438 | int |
22439 | main () | |
22440 | { | |
5df4cba6 | 22441 | |
c0c3707f CB |
22442 | ; |
22443 | return 0; | |
22444 | } | |
22445 | _ACEOF | |
22446 | if ac_fn_c_try_compile "$LINENO"; then : | |
5df4cba6 | 22447 | gl_cv_sys_struct_lconv_ok=yes |
c0c3707f | 22448 | else |
5df4cba6 | 22449 | gl_cv_sys_struct_lconv_ok=no |
c0c3707f CB |
22450 | fi |
22451 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5df4cba6 | 22452 | |
c0c3707f | 22453 | fi |
5df4cba6 SM |
22454 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5 |
22455 | $as_echo "$gl_cv_sys_struct_lconv_ok" >&6; } | |
22456 | if test $gl_cv_sys_struct_lconv_ok = no; then | |
22457 | case "$host_os" in | |
22458 | mingw*) | |
22459 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22460 | /* end confdefs.h. */ | |
c0c3707f | 22461 | |
5df4cba6 SM |
22462 | #ifdef _MSC_VER |
22463 | Special | |
22464 | #endif | |
22465 | ||
22466 | _ACEOF | |
22467 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
22468 | $EGREP "Special" >/dev/null 2>&1; then : | |
22469 | ||
22470 | else | |
22471 | REPLACE_STRUCT_LCONV=1 | |
22472 | fi | |
22473 | rm -f conftest* | |
c0c3707f | 22474 | |
5df4cba6 SM |
22475 | ;; |
22476 | *) REPLACE_STRUCT_LCONV=1 ;; | |
22477 | esac | |
c0c3707f | 22478 | fi |
88b48903 WN |
22479 | |
22480 | ||
88b48903 WN |
22481 | |
22482 | ||
472fa5ee | 22483 | |
5df4cba6 SM |
22484 | |
22485 | ||
22486 | ||
22487 | ||
22488 | if test $gl_cv_have_include_next = yes; then | |
22489 | gl_cv_next_locale_h='<'locale.h'>' | |
22490 | else | |
22491 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5 | |
22492 | $as_echo_n "checking absolute name of <locale.h>... " >&6; } | |
22493 | if ${gl_cv_next_locale_h+:} false; then : | |
22494 | $as_echo_n "(cached) " >&6 | |
22495 | else | |
22496 | ||
22497 | ||
22498 | ||
22499 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22500 | /* end confdefs.h. */ | |
22501 | #include <locale.h> | |
22502 | _ACEOF | |
22503 | case "$host_os" in | |
22504 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
22505 | *) gl_absname_cpp="$ac_cpp" ;; | |
22506 | esac | |
22507 | ||
22508 | case "$host_os" in | |
22509 | mingw*) | |
22510 | gl_dirsep_regex='[/\\]' | |
22511 | ;; | |
22512 | *) | |
22513 | gl_dirsep_regex='\/' | |
22514 | ;; | |
22515 | esac | |
22516 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
22517 | gl_header_literal_regex=`echo 'locale.h' \ | |
22518 | | sed -e "$gl_make_literal_regex_sed"` | |
22519 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
22520 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
22521 | s|^/[^/]|//&| | |
22522 | p | |
22523 | q | |
22524 | }' | |
22525 | ||
22526 | gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
22527 | sed -n "$gl_absolute_header_sed"` | |
22528 | ||
22529 | gl_header=$gl_cv_absolute_locale_h | |
22530 | gl_cv_next_locale_h='"'$gl_header'"' | |
22531 | ||
22532 | ||
22533 | fi | |
22534 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5 | |
22535 | $as_echo "$gl_cv_next_locale_h" >&6; } | |
22536 | fi | |
22537 | NEXT_LOCALE_H=$gl_cv_next_locale_h | |
22538 | ||
22539 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
22540 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
22541 | gl_next_as_first_directive='<'locale.h'>' | |
22542 | else | |
22543 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
22544 | gl_next_as_first_directive=$gl_cv_next_locale_h | |
22545 | fi | |
22546 | NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive | |
22547 | ||
22548 | ||
22549 | ||
22550 | ||
22551 | ||
22552 | ||
22553 | ||
22554 | ||
472fa5ee SM |
22555 | |
22556 | ||
22557 | ||
5abebf3c CB |
22558 | if test "$gl_threads_api" = posix; then |
22559 | # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the | |
22560 | # pthread_rwlock_* functions. | |
c0c3707f | 22561 | has_rwlock=false |
5abebf3c CB |
22562 | ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h> |
22563 | " | |
22564 | if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then : | |
c0c3707f | 22565 | has_rwlock=true |
5abebf3c CB |
22566 | |
22567 | $as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h | |
22568 | ||
22569 | fi | |
22570 | ||
c0c3707f CB |
22571 | if $has_rwlock; then |
22572 | ||
22573 | ||
22574 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5 | |
22575 | $as_echo_n "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; } | |
22576 | if ${gl_cv_pthread_rwlock_rdlock_prefer_writer+:} false; then : | |
22577 | $as_echo_n "(cached) " >&6 | |
22578 | else | |
22579 | save_LIBS="$LIBS" | |
22580 | LIBS="$LIBS $LIBMULTITHREAD" | |
22581 | if test "$cross_compiling" = yes; then : | |
22582 | case "$host_os" in | |
22583 | # Guess no on glibc systems. | |
22584 | *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; | |
22585 | # Guess no on musl systems. | |
22586 | *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; | |
22587 | # Guess no on bionic systems. | |
22588 | *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; | |
22589 | # Guess yes on native Windows with the mingw-w64 winpthreads library. | |
22590 | # Guess no on native Windows with the gnulib windows-rwlock module. | |
22591 | mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then | |
22592 | gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes" | |
22593 | else | |
22594 | gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" | |
22595 | fi | |
22596 | ;; | |
22597 | # If we don't know, obey --enable-cross-guesses. | |
22598 | *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;; | |
22599 | esac | |
22600 | ||
22601 | else | |
22602 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22603 | /* end confdefs.h. */ | |
22604 | ||
22605 | #include <errno.h> | |
22606 | #include <pthread.h> | |
22607 | #include <stdlib.h> | |
22608 | #include <unistd.h> | |
22609 | ||
22610 | #define SUCCEED() exit (0) | |
22611 | #define FAILURE() exit (1) | |
22612 | #define UNEXPECTED(n) (exit (10 + (n))) | |
22613 | ||
22614 | /* The main thread creates the waiting writer and the requesting reader threads | |
22615 | in the default way; this guarantees that they have the same priority. | |
22616 | We can reuse the main thread as first reader thread. */ | |
22617 | ||
22618 | static pthread_rwlock_t lock; | |
22619 | static pthread_t reader1; | |
22620 | static pthread_t writer; | |
22621 | static pthread_t reader2; | |
22622 | static pthread_t timer; | |
22623 | /* Used to pass control from writer to reader2 and from reader2 to timer, | |
22624 | as in a relay race. | |
22625 | Passing control from one running thread to another running thread | |
22626 | is most likely faster than to create the second thread. */ | |
22627 | static pthread_mutex_t baton; | |
22628 | ||
22629 | static void * | |
22630 | timer_func (void *ignored) | |
22631 | { | |
22632 | /* Step 13 (can be before or after step 12): | |
22633 | The timer thread takes the baton, then waits a moment to make sure | |
22634 | it can tell whether the second reader thread is blocked at step 12. */ | |
22635 | if (pthread_mutex_lock (&baton)) | |
22636 | UNEXPECTED (13); | |
22637 | usleep (100000); | |
22638 | /* By the time we get here, it's clear that the second reader thread is | |
22639 | blocked at step 12. This is the desired behaviour. */ | |
22640 | SUCCEED (); | |
22641 | } | |
22642 | ||
22643 | static void * | |
22644 | reader2_func (void *ignored) | |
22645 | { | |
22646 | int err; | |
22647 | ||
22648 | /* Step 8 (can be before or after step 7): | |
22649 | The second reader thread takes the baton, then waits a moment to make sure | |
22650 | the writer thread has reached step 7. */ | |
22651 | if (pthread_mutex_lock (&baton)) | |
22652 | UNEXPECTED (8); | |
22653 | usleep (100000); | |
22654 | /* Step 9: The second reader thread requests the lock. */ | |
22655 | err = pthread_rwlock_tryrdlock (&lock); | |
22656 | if (err == 0) | |
22657 | FAILURE (); | |
22658 | else if (err != EBUSY) | |
22659 | UNEXPECTED (9); | |
22660 | /* Step 10: Launch a timer, to test whether the next call blocks. */ | |
22661 | if (pthread_create (&timer, NULL, timer_func, NULL)) | |
22662 | UNEXPECTED (10); | |
22663 | /* Step 11: Release the baton. */ | |
22664 | if (pthread_mutex_unlock (&baton)) | |
22665 | UNEXPECTED (11); | |
22666 | /* Step 12: The second reader thread requests the lock. */ | |
22667 | err = pthread_rwlock_rdlock (&lock); | |
22668 | if (err == 0) | |
22669 | FAILURE (); | |
22670 | else | |
22671 | UNEXPECTED (12); | |
22672 | } | |
22673 | ||
22674 | static void * | |
22675 | writer_func (void *ignored) | |
22676 | { | |
22677 | /* Step 4: Take the baton, so that the second reader thread does not go ahead | |
22678 | too early. */ | |
22679 | if (pthread_mutex_lock (&baton)) | |
22680 | UNEXPECTED (4); | |
22681 | /* Step 5: Create the second reader thread. */ | |
22682 | if (pthread_create (&reader2, NULL, reader2_func, NULL)) | |
22683 | UNEXPECTED (5); | |
22684 | /* Step 6: Release the baton. */ | |
22685 | if (pthread_mutex_unlock (&baton)) | |
22686 | UNEXPECTED (6); | |
22687 | /* Step 7: The writer thread requests the lock. */ | |
22688 | if (pthread_rwlock_wrlock (&lock)) | |
22689 | UNEXPECTED (7); | |
22690 | return NULL; | |
22691 | } | |
22692 | ||
22693 | int | |
22694 | main () | |
22695 | { | |
22696 | reader1 = pthread_self (); | |
22697 | ||
22698 | /* Step 1: The main thread initializes the lock and the baton. */ | |
22699 | if (pthread_rwlock_init (&lock, NULL)) | |
22700 | UNEXPECTED (1); | |
22701 | if (pthread_mutex_init (&baton, NULL)) | |
22702 | UNEXPECTED (1); | |
22703 | /* Step 2: The main thread acquires the lock as a reader. */ | |
22704 | if (pthread_rwlock_rdlock (&lock)) | |
22705 | UNEXPECTED (2); | |
22706 | /* Step 3: Create the writer thread. */ | |
22707 | if (pthread_create (&writer, NULL, writer_func, NULL)) | |
22708 | UNEXPECTED (3); | |
22709 | /* Job done. Go to sleep. */ | |
22710 | for (;;) | |
22711 | { | |
22712 | sleep (1); | |
22713 | } | |
22714 | } | |
22715 | ||
22716 | _ACEOF | |
22717 | if ac_fn_c_try_run "$LINENO"; then : | |
22718 | gl_cv_pthread_rwlock_rdlock_prefer_writer=yes | |
22719 | else | |
22720 | gl_cv_pthread_rwlock_rdlock_prefer_writer=no | |
22721 | fi | |
22722 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
22723 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
22724 | fi | |
22725 | ||
22726 | LIBS="$save_LIBS" | |
22727 | ||
22728 | fi | |
22729 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5 | |
22730 | $as_echo "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; } | |
22731 | case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in | |
22732 | *yes) | |
22733 | ||
22734 | $as_echo "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h | |
22735 | ||
22736 | ;; | |
22737 | esac | |
22738 | ||
22739 | fi | |
5abebf3c CB |
22740 | # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. |
22741 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22742 | /* end confdefs.h. */ | |
22743 | ||
22744 | #include <pthread.h> | |
22745 | int | |
22746 | main () | |
22747 | { | |
22748 | ||
22749 | #if __FreeBSD__ == 4 | |
22750 | error "No, in FreeBSD 4.0 recursive mutexes actually don't work." | |
22751 | #elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \ | |
22752 | && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070) | |
22753 | error "No, in Mac OS X < 10.7 recursive mutexes actually don't work." | |
22754 | #else | |
22755 | int x = (int)PTHREAD_MUTEX_RECURSIVE; | |
22756 | return !x; | |
22757 | #endif | |
22758 | ||
22759 | ; | |
22760 | return 0; | |
22761 | } | |
22762 | _ACEOF | |
22763 | if ac_fn_c_try_compile "$LINENO"; then : | |
22764 | ||
22765 | $as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h | |
22766 | ||
22767 | fi | |
22768 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
22769 | fi | |
22770 | : | |
22771 | ||
22772 | ||
22773 | ||
22774 | cat >>confdefs.h <<_ACEOF | |
22775 | #define GNULIB_LOCK 1 | |
22776 | _ACEOF | |
22777 | ||
22778 | ||
22779 | ||
22780 | ||
88b48903 | 22781 | |
472fa5ee | 22782 | |
f45c62c4 YQ |
22783 | if test $ac_cv_func_lstat = yes; then |
22784 | ||
c0c3707f CB |
22785 | case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in |
22786 | solaris* | *no) | |
f45c62c4 YQ |
22787 | REPLACE_LSTAT=1 |
22788 | ;; | |
22789 | esac | |
22790 | else | |
22791 | HAVE_LSTAT=0 | |
22792 | fi | |
22793 | ||
22794 | if test $REPLACE_LSTAT = 1; then | |
22795 | ||
22796 | ||
22797 | ||
22798 | ||
22799 | ||
22800 | ||
22801 | ||
22802 | ||
22803 | gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext" | |
22804 | ||
22805 | : | |
22806 | fi | |
22807 | ||
22808 | ||
22809 | ||
22810 | ||
22811 | ||
22812 | GNULIB_LSTAT=1 | |
22813 | ||
22814 | ||
22815 | ||
22816 | ||
22817 | ||
22818 | $as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h | |
22819 | ||
22820 | ||
22821 | ||
22822 | ||
22823 | ||
22824 | ||
6a29c58e YQ |
22825 | if test $gl_cv_func_malloc_posix = yes; then |
22826 | ||
22827 | $as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h | |
22828 | ||
22829 | else | |
22830 | REPLACE_MALLOC=1 | |
22831 | fi | |
22832 | ||
22833 | if test $REPLACE_MALLOC = 1; then | |
22834 | ||
22835 | ||
22836 | ||
22837 | ||
22838 | ||
22839 | ||
22840 | ||
22841 | ||
22842 | gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" | |
22843 | ||
22844 | fi | |
22845 | ||
22846 | ||
22847 | ||
22848 | ||
22849 | ||
22850 | GNULIB_MALLOC_POSIX=1 | |
22851 | ||
22852 | ||
22853 | ||
22854 | ||
22855 | ||
22856 | $as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h | |
22857 | ||
22858 | ||
22859 | ||
22860 | ||
22861 | ||
22862 | ||
88b48903 WN |
22863 | |
22864 | ||
22865 | ||
22866 | ||
22867 | ||
88b48903 | 22868 | |
c971b7fa | 22869 | |
c971b7fa | 22870 | |
98399780 YQ |
22871 | |
22872 | ||
22873 | ||
88b48903 WN |
22874 | if test $gl_cv_have_include_next = yes; then |
22875 | gl_cv_next_math_h='<'math.h'>' | |
22876 | else | |
22877 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5 | |
22878 | $as_echo_n "checking absolute name of <math.h>... " >&6; } | |
d0ac1c44 | 22879 | if ${gl_cv_next_math_h+:} false; then : |
88b48903 WN |
22880 | $as_echo_n "(cached) " >&6 |
22881 | else | |
c971b7fa | 22882 | |
88b48903 | 22883 | if test $ac_cv_header_math_h = yes; then |
c971b7fa PA |
22884 | |
22885 | ||
4a626d0a PA |
22886 | |
22887 | ||
22888 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 | 22889 | /* end confdefs.h. */ |
88b48903 | 22890 | #include <math.h> |
8690e634 | 22891 | _ACEOF |
4a626d0a PA |
22892 | case "$host_os" in |
22893 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
22894 | *) gl_absname_cpp="$ac_cpp" ;; | |
22895 | esac | |
22896 | ||
22897 | case "$host_os" in | |
22898 | mingw*) | |
22899 | gl_dirsep_regex='[/\\]' | |
22900 | ;; | |
22901 | *) | |
22902 | gl_dirsep_regex='\/' | |
22903 | ;; | |
22904 | esac | |
22905 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
22906 | gl_header_literal_regex=`echo 'math.h' \ | |
22907 | | sed -e "$gl_make_literal_regex_sed"` | |
22908 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
22909 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
22910 | s|^/[^/]|//&| | |
22911 | p | |
22912 | q | |
22913 | }' | |
22914 | ||
22915 | gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
22916 | sed -n "$gl_absolute_header_sed"` | |
22917 | ||
22918 | gl_header=$gl_cv_absolute_math_h | |
22919 | gl_cv_next_math_h='"'$gl_header'"' | |
88b48903 WN |
22920 | else |
22921 | gl_cv_next_math_h='<'math.h'>' | |
22922 | fi | |
8690e634 | 22923 | |
c971b7fa | 22924 | |
88b48903 WN |
22925 | fi |
22926 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5 | |
22927 | $as_echo "$gl_cv_next_math_h" >&6; } | |
22928 | fi | |
22929 | NEXT_MATH_H=$gl_cv_next_math_h | |
c971b7fa | 22930 | |
88b48903 WN |
22931 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
22932 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
22933 | gl_next_as_first_directive='<'math.h'>' | |
22934 | else | |
22935 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
22936 | gl_next_as_first_directive=$gl_cv_next_math_h | |
22937 | fi | |
22938 | NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive | |
8690e634 | 22939 | |
c971b7fa | 22940 | |
c971b7fa PA |
22941 | |
22942 | ||
c971b7fa | 22943 | |
88b48903 WN |
22944 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5 |
22945 | $as_echo_n "checking whether NAN macro works... " >&6; } | |
d0ac1c44 | 22946 | if ${gl_cv_header_math_nan_works+:} false; then : |
c971b7fa PA |
22947 | $as_echo_n "(cached) " >&6 |
22948 | else | |
8690e634 JK |
22949 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
22950 | /* end confdefs.h. */ | |
88b48903 | 22951 | #include <math.h> |
c971b7fa PA |
22952 | int |
22953 | main () | |
22954 | { | |
88b48903 WN |
22955 | /* Solaris 10 has a broken definition of NAN. Other platforms |
22956 | fail to provide NAN, or provide it only in C99 mode; this | |
22957 | test only needs to fail when NAN is provided but wrong. */ | |
22958 | float f = 1.0f; | |
22959 | #ifdef NAN | |
22960 | f = NAN; | |
22961 | #endif | |
22962 | return f == 0; | |
c971b7fa PA |
22963 | ; |
22964 | return 0; | |
22965 | } | |
22966 | _ACEOF | |
22967 | if ac_fn_c_try_compile "$LINENO"; then : | |
88b48903 | 22968 | gl_cv_header_math_nan_works=yes |
8690e634 | 22969 | else |
88b48903 | 22970 | gl_cv_header_math_nan_works=no |
c971b7fa PA |
22971 | fi |
22972 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c971b7fa | 22973 | fi |
88b48903 WN |
22974 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5 |
22975 | $as_echo "$gl_cv_header_math_nan_works" >&6; } | |
22976 | if test $gl_cv_header_math_nan_works = no; then | |
22977 | REPLACE_NAN=1 | |
c971b7fa | 22978 | fi |
88b48903 WN |
22979 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5 |
22980 | $as_echo_n "checking whether HUGE_VAL works... " >&6; } | |
d0ac1c44 | 22981 | if ${gl_cv_header_math_huge_val_works+:} false; then : |
c971b7fa PA |
22982 | $as_echo_n "(cached) " >&6 |
22983 | else | |
8690e634 | 22984 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
c971b7fa | 22985 | /* end confdefs.h. */ |
88b48903 | 22986 | #include <math.h> |
c971b7fa PA |
22987 | int |
22988 | main () | |
22989 | { | |
88b48903 WN |
22990 | /* Solaris 10 has a broken definition of HUGE_VAL. */ |
22991 | double d = HUGE_VAL; | |
22992 | return d == 0; | |
c971b7fa PA |
22993 | ; |
22994 | return 0; | |
22995 | } | |
22996 | _ACEOF | |
22997 | if ac_fn_c_try_compile "$LINENO"; then : | |
88b48903 | 22998 | gl_cv_header_math_huge_val_works=yes |
8690e634 | 22999 | else |
88b48903 | 23000 | gl_cv_header_math_huge_val_works=no |
c971b7fa PA |
23001 | fi |
23002 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c971b7fa | 23003 | fi |
88b48903 WN |
23004 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5 |
23005 | $as_echo "$gl_cv_header_math_huge_val_works" >&6; } | |
23006 | if test $gl_cv_header_math_huge_val_works = no; then | |
23007 | REPLACE_HUGE_VAL=1 | |
8690e634 | 23008 | fi |
c971b7fa | 23009 | |
c971b7fa | 23010 | |
c971b7fa PA |
23011 | |
23012 | ||
23013 | ||
23014 | ||
23015 | ||
23016 | ||
c971b7fa | 23017 | |
c971b7fa | 23018 | |
c971b7fa | 23019 | |
c971b7fa PA |
23020 | |
23021 | ||
c971b7fa | 23022 | |
472fa5ee | 23023 | |
5df4cba6 SM |
23024 | |
23025 | ||
23026 | ||
23027 | if case "$host_os" in | |
23028 | mingw*) true ;; | |
23029 | *) test $ac_cv_func_mbsinit = yes ;; | |
23030 | esac \ | |
23031 | && test $ac_cv_func_mbrtowc = yes; then | |
472fa5ee SM |
23032 | |
23033 | ||
23034 | ||
23035 | ||
c0c3707f CB |
23036 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 |
23037 | $as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } | |
23038 | if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then : | |
23039 | $as_echo_n "(cached) " >&6 | |
23040 | else | |
472fa5ee | 23041 | |
c0c3707f CB |
23042 | case "$host_os" in |
23043 | # Guess no on AIX and OSF/1. | |
23044 | aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; | |
23045 | # Guess yes otherwise. | |
23046 | *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; | |
23047 | esac | |
23048 | if test $LOCALE_JA != none; then | |
23049 | if test "$cross_compiling" = yes; then : | |
472fa5ee | 23050 | : |
c0c3707f CB |
23051 | else |
23052 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23053 | /* end confdefs.h. */ | |
472fa5ee | 23054 | |
c0c3707f CB |
23055 | #include <locale.h> |
23056 | #include <string.h> | |
c0c3707f CB |
23057 | #include <wchar.h> |
23058 | int main () | |
23059 | { | |
23060 | if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) | |
23061 | { | |
23062 | const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ | |
23063 | mbstate_t state; | |
23064 | wchar_t wc; | |
472fa5ee | 23065 | |
c0c3707f CB |
23066 | memset (&state, '\0', sizeof (mbstate_t)); |
23067 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
23068 | if (mbsinit (&state)) | |
23069 | return 2; | |
23070 | } | |
23071 | return 0; | |
23072 | } | |
23073 | _ACEOF | |
23074 | if ac_fn_c_try_run "$LINENO"; then : | |
23075 | gl_cv_func_mbrtowc_incomplete_state=yes | |
c971b7fa | 23076 | else |
c0c3707f CB |
23077 | gl_cv_func_mbrtowc_incomplete_state=no |
23078 | fi | |
23079 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23080 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23081 | fi | |
8690e634 | 23082 | |
c0c3707f CB |
23083 | else |
23084 | if test $LOCALE_FR_UTF8 != none; then | |
23085 | if test "$cross_compiling" = yes; then : | |
8690e634 JK |
23086 | : |
23087 | else | |
c971b7fa PA |
23088 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
23089 | /* end confdefs.h. */ | |
c971b7fa | 23090 | |
8690e634 JK |
23091 | #include <locale.h> |
23092 | #include <string.h> | |
8690e634 JK |
23093 | #include <wchar.h> |
23094 | int main () | |
c971b7fa | 23095 | { |
c0c3707f | 23096 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) |
8690e634 | 23097 | { |
c0c3707f | 23098 | const char input[] = "B\303\274\303\237er"; /* "Büßer" */ |
8690e634 JK |
23099 | mbstate_t state; |
23100 | wchar_t wc; | |
23101 | ||
23102 | memset (&state, '\0', sizeof (mbstate_t)); | |
23103 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
23104 | if (mbsinit (&state)) | |
c0c3707f | 23105 | return 2; |
8690e634 | 23106 | } |
c971b7fa PA |
23107 | return 0; |
23108 | } | |
23109 | _ACEOF | |
8690e634 JK |
23110 | if ac_fn_c_try_run "$LINENO"; then : |
23111 | gl_cv_func_mbrtowc_incomplete_state=yes | |
c971b7fa | 23112 | else |
8690e634 | 23113 | gl_cv_func_mbrtowc_incomplete_state=no |
c971b7fa | 23114 | fi |
8690e634 JK |
23115 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
23116 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c971b7fa | 23117 | fi |
c971b7fa | 23118 | |
c0c3707f | 23119 | fi |
8690e634 | 23120 | fi |
c971b7fa | 23121 | |
8690e634 JK |
23122 | fi |
23123 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 | |
23124 | $as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } | |
c971b7fa | 23125 | |
c971b7fa | 23126 | |
c971b7fa | 23127 | |
c971b7fa | 23128 | |
8690e634 JK |
23129 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 |
23130 | $as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } | |
d0ac1c44 | 23131 | if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then : |
c971b7fa PA |
23132 | $as_echo_n "(cached) " >&6 |
23133 | else | |
23134 | ||
8690e634 JK |
23135 | case "$host_os" in |
23136 | # Guess no on Solaris 8. | |
23137 | solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; | |
23138 | # Guess yes otherwise. | |
23139 | *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; | |
23140 | esac | |
23141 | if test $LOCALE_ZH_CN != none; then | |
23142 | if test "$cross_compiling" = yes; then : | |
23143 | : | |
23144 | else | |
23145 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c971b7fa PA |
23146 | /* end confdefs.h. */ |
23147 | ||
8690e634 JK |
23148 | #include <locale.h> |
23149 | #include <stdlib.h> | |
23150 | #include <string.h> | |
8690e634 JK |
23151 | #include <wchar.h> |
23152 | int main () | |
c971b7fa | 23153 | { |
8690e634 JK |
23154 | /* This fails on Solaris 8: |
23155 | mbrtowc returns 2, and sets wc to 0x00F0. | |
23156 | mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ | |
23157 | if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) | |
23158 | { | |
23159 | char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ | |
23160 | mbstate_t state; | |
23161 | wchar_t wc; | |
23162 | ||
23163 | memset (&state, '\0', sizeof (mbstate_t)); | |
23164 | if (mbrtowc (&wc, input + 3, 6, &state) != 4 | |
23165 | && mbtowc (&wc, input + 3, 6) == 4) | |
c0c3707f | 23166 | return 2; |
8690e634 | 23167 | } |
c971b7fa PA |
23168 | return 0; |
23169 | } | |
23170 | _ACEOF | |
8690e634 JK |
23171 | if ac_fn_c_try_run "$LINENO"; then : |
23172 | gl_cv_func_mbrtowc_sanitycheck=yes | |
c971b7fa | 23173 | else |
8690e634 | 23174 | gl_cv_func_mbrtowc_sanitycheck=no |
c971b7fa | 23175 | fi |
8690e634 JK |
23176 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
23177 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c971b7fa | 23178 | fi |
c971b7fa | 23179 | |
8690e634 | 23180 | fi |
c971b7fa | 23181 | |
8690e634 JK |
23182 | fi |
23183 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 | |
23184 | $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } | |
23185 | ||
23186 | REPLACE_MBSTATE_T=0 | |
23187 | case "$gl_cv_func_mbrtowc_incomplete_state" in | |
23188 | *yes) ;; | |
23189 | *) REPLACE_MBSTATE_T=1 ;; | |
23190 | esac | |
23191 | case "$gl_cv_func_mbrtowc_sanitycheck" in | |
23192 | *yes) ;; | |
23193 | *) REPLACE_MBSTATE_T=1 ;; | |
23194 | esac | |
c971b7fa | 23195 | else |
8690e634 | 23196 | REPLACE_MBSTATE_T=1 |
c971b7fa PA |
23197 | fi |
23198 | ||
23199 | ||
23200 | ||
8690e634 JK |
23201 | if test $ac_cv_func_mbrtowc = no; then |
23202 | HAVE_MBRTOWC=0 | |
23203 | ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" " | |
9c9d63b1 | 23204 | #include <wchar.h> |
c971b7fa | 23205 | |
8690e634 | 23206 | " |
d0ac1c44 | 23207 | if test "x$ac_cv_have_decl_mbrtowc" = xyes; then : |
8690e634 JK |
23208 | ac_have_decl=1 |
23209 | else | |
23210 | ac_have_decl=0 | |
c971b7fa | 23211 | fi |
c971b7fa | 23212 | |
8690e634 JK |
23213 | cat >>confdefs.h <<_ACEOF |
23214 | #define HAVE_DECL_MBRTOWC $ac_have_decl | |
23215 | _ACEOF | |
c971b7fa | 23216 | |
8690e634 JK |
23217 | if test $ac_cv_have_decl_mbrtowc = yes; then |
23218 | REPLACE_MBRTOWC=1 | |
23219 | fi | |
23220 | else | |
23221 | if test $REPLACE_MBSTATE_T = 1; then | |
23222 | REPLACE_MBRTOWC=1 | |
23223 | else | |
c971b7fa PA |
23224 | |
23225 | ||
23226 | ||
8690e634 JK |
23227 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5 |
23228 | $as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; } | |
d0ac1c44 | 23229 | if ${gl_cv_func_mbrtowc_null_arg1+:} false; then : |
8690e634 | 23230 | $as_echo_n "(cached) " >&6 |
c971b7fa | 23231 | else |
c971b7fa | 23232 | |
8690e634 JK |
23233 | case "$host_os" in |
23234 | # Guess no on Solaris. | |
23235 | solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; | |
23236 | # Guess yes otherwise. | |
23237 | *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; | |
23238 | esac | |
23239 | if test $LOCALE_FR_UTF8 != none; then | |
23240 | if test "$cross_compiling" = yes; then : | |
23241 | : | |
23242 | else | |
23243 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c971b7fa PA |
23244 | /* end confdefs.h. */ |
23245 | ||
8690e634 JK |
23246 | #include <locale.h> |
23247 | #include <stdlib.h> | |
23248 | #include <string.h> | |
8690e634 JK |
23249 | #include <wchar.h> |
23250 | int main () | |
23251 | { | |
23252 | int result = 0; | |
23253 | ||
23254 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
23255 | { | |
23256 | char input[] = "\303\237er"; | |
23257 | mbstate_t state; | |
23258 | wchar_t wc; | |
23259 | size_t ret; | |
23260 | ||
23261 | memset (&state, '\0', sizeof (mbstate_t)); | |
23262 | wc = (wchar_t) 0xBADFACE; | |
23263 | ret = mbrtowc (&wc, input, 5, &state); | |
23264 | if (ret != 2) | |
23265 | result |= 1; | |
23266 | if (!mbsinit (&state)) | |
23267 | result |= 2; | |
c971b7fa | 23268 | |
8690e634 JK |
23269 | memset (&state, '\0', sizeof (mbstate_t)); |
23270 | ret = mbrtowc (NULL, input, 5, &state); | |
23271 | if (ret != 2) /* Solaris 7 fails here: ret is -1. */ | |
23272 | result |= 4; | |
23273 | if (!mbsinit (&state)) | |
23274 | result |= 8; | |
23275 | } | |
23276 | return result; | |
23277 | } | |
c971b7fa | 23278 | _ACEOF |
8690e634 JK |
23279 | if ac_fn_c_try_run "$LINENO"; then : |
23280 | gl_cv_func_mbrtowc_null_arg1=yes | |
23281 | else | |
23282 | gl_cv_func_mbrtowc_null_arg1=no | |
23283 | fi | |
23284 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23285 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23286 | fi | |
c971b7fa | 23287 | |
8690e634 | 23288 | fi |
c971b7fa | 23289 | |
c971b7fa | 23290 | fi |
8690e634 JK |
23291 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5 |
23292 | $as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; } | |
c971b7fa | 23293 | |
c971b7fa | 23294 | |
c971b7fa | 23295 | |
c971b7fa | 23296 | |
8690e634 JK |
23297 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 |
23298 | $as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; } | |
d0ac1c44 | 23299 | if ${gl_cv_func_mbrtowc_null_arg2+:} false; then : |
8690e634 JK |
23300 | $as_echo_n "(cached) " >&6 |
23301 | else | |
c971b7fa | 23302 | |
8690e634 JK |
23303 | case "$host_os" in |
23304 | # Guess no on OSF/1. | |
23305 | osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; | |
23306 | # Guess yes otherwise. | |
23307 | *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; | |
23308 | esac | |
23309 | if test $LOCALE_FR_UTF8 != none; then | |
23310 | if test "$cross_compiling" = yes; then : | |
c971b7fa | 23311 | : |
8690e634 JK |
23312 | else |
23313 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23314 | /* end confdefs.h. */ | |
23315 | ||
23316 | #include <locale.h> | |
23317 | #include <string.h> | |
8690e634 JK |
23318 | #include <wchar.h> |
23319 | int main () | |
23320 | { | |
23321 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
23322 | { | |
23323 | mbstate_t state; | |
23324 | wchar_t wc; | |
23325 | int ret; | |
23326 | ||
23327 | memset (&state, '\0', sizeof (mbstate_t)); | |
23328 | wc = (wchar_t) 0xBADFACE; | |
23329 | mbrtowc (&wc, NULL, 5, &state); | |
23330 | /* Check that wc was not modified. */ | |
23331 | if (wc != (wchar_t) 0xBADFACE) | |
c0c3707f | 23332 | return 2; |
8690e634 JK |
23333 | } |
23334 | return 0; | |
23335 | } | |
23336 | _ACEOF | |
23337 | if ac_fn_c_try_run "$LINENO"; then : | |
23338 | gl_cv_func_mbrtowc_null_arg2=yes | |
23339 | else | |
23340 | gl_cv_func_mbrtowc_null_arg2=no | |
23341 | fi | |
23342 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23343 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23344 | fi | |
23345 | ||
23346 | fi | |
23347 | ||
23348 | fi | |
23349 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5 | |
23350 | $as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; } | |
c971b7fa PA |
23351 | |
23352 | ||
23353 | ||
23354 | ||
23355 | ||
23356 | ||
8690e634 JK |
23357 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 |
23358 | $as_echo_n "checking whether mbrtowc has a correct return value... " >&6; } | |
d0ac1c44 | 23359 | if ${gl_cv_func_mbrtowc_retval+:} false; then : |
8690e634 JK |
23360 | $as_echo_n "(cached) " >&6 |
23361 | else | |
23362 | ||
23363 | case "$host_os" in | |
23364 | # Guess no on HP-UX, Solaris, native Windows. | |
23365 | hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; | |
23366 | # Guess yes otherwise. | |
23367 | *) gl_cv_func_mbrtowc_retval="guessing yes" ;; | |
23368 | esac | |
23369 | if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ | |
23370 | || { case "$host_os" in mingw*) true;; *) false;; esac; }; then | |
23371 | if test "$cross_compiling" = yes; then : | |
c971b7fa | 23372 | : |
8690e634 JK |
23373 | else |
23374 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23375 | /* end confdefs.h. */ | |
c971b7fa | 23376 | |
8690e634 JK |
23377 | #include <locale.h> |
23378 | #include <string.h> | |
8690e634 JK |
23379 | #include <wchar.h> |
23380 | int main () | |
23381 | { | |
23382 | int result = 0; | |
23383 | int found_some_locale = 0; | |
23384 | /* This fails on Solaris. */ | |
23385 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
23386 | { | |
23387 | char input[] = "B\303\274\303\237er"; /* "Büßer" */ | |
23388 | mbstate_t state; | |
23389 | wchar_t wc; | |
23390 | ||
23391 | memset (&state, '\0', sizeof (mbstate_t)); | |
23392 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
23393 | { | |
23394 | input[1] = '\0'; | |
23395 | if (mbrtowc (&wc, input + 2, 5, &state) != 1) | |
23396 | result |= 1; | |
23397 | } | |
23398 | found_some_locale = 1; | |
23399 | } | |
23400 | /* This fails on HP-UX 11.11. */ | |
23401 | if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) | |
23402 | { | |
23403 | char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ | |
23404 | mbstate_t state; | |
23405 | wchar_t wc; | |
23406 | ||
23407 | memset (&state, '\0', sizeof (mbstate_t)); | |
23408 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
23409 | { | |
23410 | input[1] = '\0'; | |
23411 | if (mbrtowc (&wc, input + 2, 5, &state) != 2) | |
23412 | result |= 2; | |
23413 | } | |
23414 | found_some_locale = 1; | |
23415 | } | |
5df4cba6 SM |
23416 | /* This fails on native Windows. */ |
23417 | if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) | |
23418 | { | |
23419 | char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ | |
23420 | mbstate_t state; | |
23421 | wchar_t wc; | |
23422 | ||
23423 | memset (&state, '\0', sizeof (mbstate_t)); | |
23424 | if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) | |
23425 | { | |
23426 | input[3] = '\0'; | |
23427 | if (mbrtowc (&wc, input + 4, 4, &state) != 1) | |
23428 | result |= 4; | |
23429 | } | |
23430 | found_some_locale = 1; | |
23431 | } | |
23432 | if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) | |
23433 | { | |
23434 | char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ | |
23435 | mbstate_t state; | |
23436 | wchar_t wc; | |
23437 | ||
23438 | memset (&state, '\0', sizeof (mbstate_t)); | |
23439 | if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) | |
23440 | { | |
23441 | input[3] = '\0'; | |
23442 | if (mbrtowc (&wc, input + 4, 4, &state) != 1) | |
23443 | result |= 8; | |
23444 | } | |
23445 | found_some_locale = 1; | |
23446 | } | |
23447 | if (setlocale (LC_ALL, "Chinese_China.936") != NULL) | |
23448 | { | |
23449 | char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ | |
23450 | mbstate_t state; | |
23451 | wchar_t wc; | |
23452 | ||
23453 | memset (&state, '\0', sizeof (mbstate_t)); | |
23454 | if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) | |
23455 | { | |
23456 | input[3] = '\0'; | |
23457 | if (mbrtowc (&wc, input + 4, 4, &state) != 1) | |
23458 | result |= 16; | |
23459 | } | |
23460 | found_some_locale = 1; | |
23461 | } | |
23462 | return (found_some_locale ? result : 77); | |
23463 | } | |
23464 | _ACEOF | |
23465 | if ac_fn_c_try_run "$LINENO"; then : | |
23466 | gl_cv_func_mbrtowc_retval=yes | |
23467 | else | |
23468 | if test $? != 77; then | |
23469 | gl_cv_func_mbrtowc_retval=no | |
23470 | fi | |
23471 | ||
23472 | fi | |
23473 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23474 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23475 | fi | |
23476 | ||
23477 | fi | |
23478 | ||
23479 | fi | |
23480 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 | |
23481 | $as_echo "$gl_cv_func_mbrtowc_retval" >&6; } | |
23482 | ||
23483 | ||
23484 | ||
23485 | ||
23486 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 | |
23487 | $as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } | |
23488 | if ${gl_cv_func_mbrtowc_nul_retval+:} false; then : | |
23489 | $as_echo_n "(cached) " >&6 | |
23490 | else | |
23491 | ||
23492 | case "$host_os" in | |
23493 | # Guess no on Solaris 8 and 9. | |
23494 | solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; | |
23495 | # Guess yes otherwise. | |
23496 | *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; | |
23497 | esac | |
23498 | if test $LOCALE_ZH_CN != none; then | |
23499 | if test "$cross_compiling" = yes; then : | |
23500 | : | |
23501 | else | |
23502 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23503 | /* end confdefs.h. */ | |
23504 | ||
23505 | #include <locale.h> | |
23506 | #include <string.h> | |
5df4cba6 SM |
23507 | #include <wchar.h> |
23508 | int main () | |
23509 | { | |
23510 | /* This fails on Solaris 8 and 9. */ | |
23511 | if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) | |
23512 | { | |
23513 | mbstate_t state; | |
23514 | wchar_t wc; | |
23515 | ||
23516 | memset (&state, '\0', sizeof (mbstate_t)); | |
23517 | if (mbrtowc (&wc, "", 1, &state) != 0) | |
23518 | return 2; | |
23519 | } | |
23520 | return 0; | |
23521 | } | |
23522 | _ACEOF | |
23523 | if ac_fn_c_try_run "$LINENO"; then : | |
23524 | gl_cv_func_mbrtowc_nul_retval=yes | |
23525 | else | |
23526 | gl_cv_func_mbrtowc_nul_retval=no | |
23527 | fi | |
23528 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23529 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23530 | fi | |
23531 | ||
23532 | fi | |
23533 | ||
23534 | fi | |
23535 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 | |
23536 | $as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; } | |
23537 | ||
23538 | ||
23539 | ||
23540 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc stores incomplete characters" >&5 | |
23541 | $as_echo_n "checking whether mbrtowc stores incomplete characters... " >&6; } | |
23542 | if ${gl_cv_func_mbrtowc_stores_incomplete+:} false; then : | |
23543 | $as_echo_n "(cached) " >&6 | |
23544 | else | |
23545 | ||
23546 | case "$host_os" in | |
23547 | # Guess yes on native Windows. | |
23548 | mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;; | |
23549 | *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;; | |
23550 | esac | |
23551 | case "$host_os" in | |
23552 | mingw*) | |
23553 | if test "$cross_compiling" = yes; then : | |
23554 | : | |
23555 | else | |
23556 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23557 | /* end confdefs.h. */ | |
23558 | ||
23559 | #include <locale.h> | |
23560 | #include <string.h> | |
5df4cba6 SM |
23561 | #include <wchar.h> |
23562 | int main () | |
23563 | { | |
23564 | int result = 0; | |
23565 | if (setlocale (LC_ALL, "French_France.65001") != NULL) | |
23566 | { | |
23567 | wchar_t wc = (wchar_t) 0xBADFACE; | |
23568 | mbstate_t state; | |
23569 | ||
23570 | memset (&state, '\0', sizeof (mbstate_t)); | |
23571 | if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2) | |
23572 | && wc != (wchar_t) 0xBADFACE) | |
23573 | result |= 1; | |
23574 | } | |
8690e634 JK |
23575 | if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) |
23576 | { | |
5df4cba6 | 23577 | wchar_t wc = (wchar_t) 0xBADFACE; |
8690e634 | 23578 | mbstate_t state; |
8690e634 JK |
23579 | |
23580 | memset (&state, '\0', sizeof (mbstate_t)); | |
5df4cba6 SM |
23581 | if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2) |
23582 | && wc != (wchar_t) 0xBADFACE) | |
23583 | result |= 2; | |
8690e634 JK |
23584 | } |
23585 | if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) | |
23586 | { | |
5df4cba6 | 23587 | wchar_t wc = (wchar_t) 0xBADFACE; |
8690e634 | 23588 | mbstate_t state; |
8690e634 JK |
23589 | |
23590 | memset (&state, '\0', sizeof (mbstate_t)); | |
5df4cba6 SM |
23591 | if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2) |
23592 | && wc != (wchar_t) 0xBADFACE) | |
23593 | result |= 4; | |
8690e634 JK |
23594 | } |
23595 | if (setlocale (LC_ALL, "Chinese_China.936") != NULL) | |
23596 | { | |
5df4cba6 | 23597 | wchar_t wc = (wchar_t) 0xBADFACE; |
8690e634 | 23598 | mbstate_t state; |
8690e634 JK |
23599 | |
23600 | memset (&state, '\0', sizeof (mbstate_t)); | |
5df4cba6 SM |
23601 | if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2) |
23602 | && wc != (wchar_t) 0xBADFACE) | |
23603 | result |= 8; | |
8690e634 | 23604 | } |
5df4cba6 | 23605 | return result; |
8690e634 JK |
23606 | } |
23607 | _ACEOF | |
23608 | if ac_fn_c_try_run "$LINENO"; then : | |
5df4cba6 | 23609 | gl_cv_func_mbrtowc_stores_incomplete=no |
8690e634 | 23610 | else |
5df4cba6 | 23611 | gl_cv_func_mbrtowc_stores_incomplete=yes |
8690e634 JK |
23612 | fi |
23613 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23614 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23615 | fi | |
c971b7fa | 23616 | |
5df4cba6 SM |
23617 | ;; |
23618 | *) | |
8690e634 | 23619 | |
5df4cba6 SM |
23620 | if test $LOCALE_FR_UTF8 != none; then |
23621 | if test "$cross_compiling" = yes; then : | |
8690e634 | 23622 | : |
c971b7fa PA |
23623 | else |
23624 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23625 | /* end confdefs.h. */ | |
23626 | ||
8690e634 | 23627 | #include <locale.h> |
c971b7fa | 23628 | #include <string.h> |
8690e634 JK |
23629 | #include <wchar.h> |
23630 | int main () | |
c971b7fa | 23631 | { |
5df4cba6 | 23632 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) |
c971b7fa | 23633 | { |
5df4cba6 | 23634 | wchar_t wc = (wchar_t) 0xBADFACE; |
8690e634 | 23635 | mbstate_t state; |
c971b7fa | 23636 | |
8690e634 | 23637 | memset (&state, '\0', sizeof (mbstate_t)); |
5df4cba6 SM |
23638 | if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2) |
23639 | && wc != (wchar_t) 0xBADFACE) | |
23640 | return 1; | |
8690e634 | 23641 | } |
c971b7fa PA |
23642 | return 0; |
23643 | } | |
23644 | _ACEOF | |
23645 | if ac_fn_c_try_run "$LINENO"; then : | |
5df4cba6 | 23646 | gl_cv_func_mbrtowc_stores_incomplete=no |
c971b7fa | 23647 | else |
5df4cba6 | 23648 | gl_cv_func_mbrtowc_stores_incomplete=yes |
c971b7fa PA |
23649 | fi |
23650 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23651 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23652 | fi | |
23653 | ||
5df4cba6 SM |
23654 | fi |
23655 | ;; | |
23656 | esac | |
8690e634 | 23657 | |
c971b7fa | 23658 | fi |
5df4cba6 SM |
23659 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_stores_incomplete" >&5 |
23660 | $as_echo "$gl_cv_func_mbrtowc_stores_incomplete" >&6; } | |
8690e634 | 23661 | |
4a626d0a PA |
23662 | |
23663 | ||
23664 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5 | |
23665 | $as_echo_n "checking whether mbrtowc works on empty input... " >&6; } | |
d0ac1c44 | 23666 | if ${gl_cv_func_mbrtowc_empty_input+:} false; then : |
4a626d0a PA |
23667 | $as_echo_n "(cached) " >&6 |
23668 | else | |
23669 | ||
23670 | case "$host_os" in | |
c0c3707f CB |
23671 | # Guess no on AIX and glibc systems. |
23672 | aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;; | |
23673 | # Guess yes on native Windows. | |
23674 | mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; | |
23675 | *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; | |
4a626d0a PA |
23676 | esac |
23677 | if test "$cross_compiling" = yes; then : | |
23678 | : | |
23679 | else | |
23680 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23681 | /* end confdefs.h. */ | |
23682 | ||
23683 | #include <wchar.h> | |
23684 | static wchar_t wc; | |
23685 | static mbstate_t mbs; | |
23686 | int | |
23687 | main (void) | |
23688 | { | |
49e4877c | 23689 | return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2; |
4a626d0a PA |
23690 | } |
23691 | _ACEOF | |
23692 | if ac_fn_c_try_run "$LINENO"; then : | |
4a626d0a | 23693 | gl_cv_func_mbrtowc_empty_input=yes |
49e4877c PA |
23694 | else |
23695 | gl_cv_func_mbrtowc_empty_input=no | |
4a626d0a PA |
23696 | fi |
23697 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23698 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23699 | fi | |
23700 | ||
23701 | ||
23702 | fi | |
23703 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5 | |
23704 | $as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; } | |
23705 | ||
49e4877c | 23706 | |
c0c3707f | 23707 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5 |
49e4877c | 23708 | $as_echo_n "checking whether the C locale is free of encoding errors... " >&6; } |
5df4cba6 | 23709 | if ${gl_cv_func_mbrtowc_C_locale_sans_EILSEQ+:} false; then : |
49e4877c PA |
23710 | $as_echo_n "(cached) " >&6 |
23711 | else | |
23712 | ||
5df4cba6 | 23713 | gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal" |
49e4877c PA |
23714 | |
23715 | if test "$cross_compiling" = yes; then : | |
c0c3707f CB |
23716 | case "$host_os" in |
23717 | # Guess yes on native Windows. | |
5df4cba6 | 23718 | mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;; |
c0c3707f CB |
23719 | esac |
23720 | ||
49e4877c PA |
23721 | else |
23722 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23723 | /* end confdefs.h. */ | |
23724 | #include <limits.h> | |
23725 | #include <locale.h> | |
23726 | #include <wchar.h> | |
23727 | ||
23728 | int | |
23729 | main () | |
23730 | { | |
23731 | ||
23732 | int i; | |
23733 | char *locale = setlocale (LC_ALL, "C"); | |
23734 | if (! locale) | |
c0c3707f | 23735 | return 2; |
49e4877c PA |
23736 | for (i = CHAR_MIN; i <= CHAR_MAX; i++) |
23737 | { | |
23738 | char c = i; | |
23739 | wchar_t wc; | |
23740 | mbstate_t mbs = { 0, }; | |
23741 | size_t ss = mbrtowc (&wc, &c, 1, &mbs); | |
23742 | if (1 < ss) | |
c0c3707f | 23743 | return 3; |
49e4877c PA |
23744 | } |
23745 | return 0; | |
23746 | ||
6ec2e0f5 SDJ |
23747 | ; |
23748 | return 0; | |
23749 | } | |
23750 | _ACEOF | |
23751 | if ac_fn_c_try_run "$LINENO"; then : | |
5df4cba6 | 23752 | gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes |
6ec2e0f5 | 23753 | else |
5df4cba6 | 23754 | gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no |
6ec2e0f5 SDJ |
23755 | fi |
23756 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23757 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23758 | fi | |
23759 | ||
c0c3707f | 23760 | |
6ec2e0f5 | 23761 | fi |
5df4cba6 SM |
23762 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&5 |
23763 | $as_echo "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&6; } | |
6ec2e0f5 SDJ |
23764 | |
23765 | case "$gl_cv_func_mbrtowc_null_arg1" in | |
23766 | *yes) ;; | |
23767 | *) | |
23768 | $as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h | |
23769 | ||
23770 | REPLACE_MBRTOWC=1 | |
23771 | ;; | |
23772 | esac | |
23773 | case "$gl_cv_func_mbrtowc_null_arg2" in | |
23774 | *yes) ;; | |
23775 | *) | |
23776 | $as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h | |
23777 | ||
23778 | REPLACE_MBRTOWC=1 | |
23779 | ;; | |
23780 | esac | |
23781 | case "$gl_cv_func_mbrtowc_retval" in | |
23782 | *yes) ;; | |
23783 | *) | |
23784 | $as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h | |
23785 | ||
23786 | REPLACE_MBRTOWC=1 | |
23787 | ;; | |
23788 | esac | |
23789 | case "$gl_cv_func_mbrtowc_nul_retval" in | |
23790 | *yes) ;; | |
23791 | *) | |
23792 | $as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h | |
23793 | ||
5df4cba6 SM |
23794 | REPLACE_MBRTOWC=1 |
23795 | ;; | |
23796 | esac | |
23797 | case "$gl_cv_func_mbrtowc_stores_incomplete" in | |
23798 | *no) ;; | |
23799 | *) | |
23800 | $as_echo "#define MBRTOWC_STORES_INCOMPLETE_BUG 1" >>confdefs.h | |
23801 | ||
23802 | REPLACE_MBRTOWC=1 | |
23803 | ;; | |
23804 | esac | |
23805 | case "$gl_cv_func_mbrtowc_empty_input" in | |
23806 | *yes) ;; | |
23807 | *) | |
23808 | $as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h | |
23809 | ||
23810 | REPLACE_MBRTOWC=1 | |
23811 | ;; | |
23812 | esac | |
23813 | case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in | |
23814 | *yes) ;; | |
23815 | *) | |
23816 | $as_echo "#define MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h | |
23817 | ||
23818 | REPLACE_MBRTOWC=1 | |
23819 | ;; | |
23820 | esac | |
23821 | fi | |
23822 | fi | |
23823 | if test $REPLACE_MBSTATE_T = 1; then | |
23824 | case "$host_os" in | |
23825 | mingw*) LIB_MBRTOWC= ;; | |
23826 | *) | |
23827 | ||
23828 | ||
23829 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 | |
23830 | $as_echo_n "checking whether imported symbols can be declared weak... " >&6; } | |
23831 | if ${gl_cv_have_weak+:} false; then : | |
23832 | $as_echo_n "(cached) " >&6 | |
23833 | else | |
23834 | gl_cv_have_weak=no | |
23835 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23836 | /* end confdefs.h. */ | |
23837 | extern void xyzzy (); | |
23838 | #pragma weak xyzzy | |
23839 | int | |
23840 | main () | |
23841 | { | |
23842 | xyzzy(); | |
23843 | ; | |
23844 | return 0; | |
23845 | } | |
23846 | _ACEOF | |
23847 | if ac_fn_c_try_link "$LINENO"; then : | |
23848 | gl_cv_have_weak=maybe | |
23849 | fi | |
23850 | rm -f core conftest.err conftest.$ac_objext \ | |
23851 | conftest$ac_exeext conftest.$ac_ext | |
23852 | if test $gl_cv_have_weak = maybe; then | |
23853 | if test "$cross_compiling" = yes; then : | |
23854 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23855 | /* end confdefs.h. */ | |
23856 | #ifdef __ELF__ | |
23857 | Extensible Linking Format | |
23858 | #endif | |
23859 | ||
23860 | _ACEOF | |
23861 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
23862 | $EGREP "Extensible Linking Format" >/dev/null 2>&1; then : | |
23863 | gl_cv_have_weak="guessing yes" | |
23864 | else | |
23865 | gl_cv_have_weak="guessing no" | |
23866 | fi | |
23867 | rm -f conftest* | |
23868 | ||
23869 | ||
23870 | else | |
23871 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23872 | /* end confdefs.h. */ | |
23873 | ||
23874 | #include <stdio.h> | |
23875 | #pragma weak fputs | |
23876 | int main () | |
23877 | { | |
23878 | return (fputs == NULL); | |
23879 | } | |
23880 | _ACEOF | |
23881 | if ac_fn_c_try_run "$LINENO"; then : | |
23882 | gl_cv_have_weak=yes | |
23883 | else | |
23884 | gl_cv_have_weak=no | |
23885 | fi | |
23886 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23887 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23888 | fi | |
23889 | ||
23890 | fi | |
23891 | case " $LDFLAGS " in | |
23892 | *" -static "*) gl_cv_have_weak=no ;; | |
23893 | esac | |
23894 | case "$gl_cv_have_weak" in | |
23895 | *yes) | |
23896 | case "$host_os" in | |
23897 | freebsd* | dragonfly*) | |
23898 | : > conftest1.c | |
23899 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1 | |
23900 | cat <<EOF > conftest2.c | |
23901 | #include <pthread.h> | |
23902 | #pragma weak pthread_mutexattr_gettype | |
23903 | int main () | |
23904 | { | |
23905 | return (pthread_mutexattr_gettype != NULL); | |
23906 | } | |
23907 | EOF | |
23908 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \ | |
23909 | || gl_cv_have_weak=no | |
23910 | rm -f conftest1.c libempty.so conftest2.c conftest | |
23911 | ;; | |
23912 | esac | |
23913 | ;; | |
23914 | esac | |
23915 | ||
23916 | fi | |
23917 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 | |
23918 | $as_echo "$gl_cv_have_weak" >&6; } | |
23919 | case "$gl_cv_have_weak" in | |
23920 | *yes) | |
23921 | ||
23922 | $as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h | |
23923 | ||
23924 | ;; | |
23925 | esac | |
23926 | ||
23927 | case "$gl_cv_have_weak" in | |
23928 | *yes) LIB_MBRTOWC= ;; | |
23929 | *) LIB_MBRTOWC="$LIBPTHREAD" ;; | |
23930 | esac | |
23931 | ;; | |
23932 | esac | |
23933 | else | |
23934 | LIB_MBRTOWC= | |
23935 | fi | |
23936 | ||
23937 | ||
23938 | if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then | |
23939 | ||
23940 | ||
23941 | ||
23942 | ||
23943 | ||
23944 | ||
23945 | ||
23946 | ||
23947 | gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext" | |
23948 | ||
23949 | if test $REPLACE_MBSTATE_T = 1; then | |
23950 | ||
23951 | ||
23952 | ||
23953 | ||
23954 | ||
23955 | ||
23956 | ||
23957 | ||
23958 | gl_LIBOBJS="$gl_LIBOBJS lc-charset-dispatch.$ac_objext" | |
23959 | ||
23960 | ||
23961 | ||
23962 | ||
23963 | ||
23964 | ||
23965 | ||
23966 | ||
23967 | ||
23968 | gl_LIBOBJS="$gl_LIBOBJS mbtowc-lock.$ac_objext" | |
23969 | ||
23970 | ||
23971 | ||
23972 | ||
23973 | CFLAG_VISIBILITY= | |
23974 | HAVE_VISIBILITY=0 | |
23975 | if test -n "$GCC"; then | |
23976 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5 | |
23977 | $as_echo_n "checking whether the -Werror option is usable... " >&6; } | |
23978 | if ${gl_cv_cc_vis_werror+:} false; then : | |
23979 | $as_echo_n "(cached) " >&6 | |
23980 | else | |
23981 | gl_save_CFLAGS="$CFLAGS" | |
23982 | CFLAGS="$CFLAGS -Werror" | |
23983 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23984 | /* end confdefs.h. */ | |
23985 | ||
23986 | int | |
23987 | main () | |
23988 | { | |
23989 | ||
23990 | ; | |
23991 | return 0; | |
23992 | } | |
23993 | _ACEOF | |
23994 | if ac_fn_c_try_compile "$LINENO"; then : | |
23995 | gl_cv_cc_vis_werror=yes | |
23996 | else | |
23997 | gl_cv_cc_vis_werror=no | |
23998 | fi | |
23999 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
24000 | CFLAGS="$gl_save_CFLAGS" | |
24001 | ||
24002 | fi | |
24003 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5 | |
24004 | $as_echo "$gl_cv_cc_vis_werror" >&6; } | |
24005 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5 | |
24006 | $as_echo_n "checking for simple visibility declarations... " >&6; } | |
24007 | if ${gl_cv_cc_visibility+:} false; then : | |
24008 | $as_echo_n "(cached) " >&6 | |
24009 | else | |
24010 | gl_save_CFLAGS="$CFLAGS" | |
24011 | CFLAGS="$CFLAGS -fvisibility=hidden" | |
24012 | if test $gl_cv_cc_vis_werror = yes; then | |
24013 | CFLAGS="$CFLAGS -Werror" | |
24014 | fi | |
24015 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24016 | /* end confdefs.h. */ | |
24017 | extern __attribute__((__visibility__("hidden"))) int hiddenvar; | |
24018 | extern __attribute__((__visibility__("default"))) int exportedvar; | |
24019 | extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); | |
24020 | extern __attribute__((__visibility__("default"))) int exportedfunc (void); | |
24021 | void dummyfunc (void) {} | |
24022 | ||
24023 | int | |
24024 | main () | |
24025 | { | |
6ec2e0f5 | 24026 | |
5df4cba6 SM |
24027 | ; |
24028 | return 0; | |
24029 | } | |
24030 | _ACEOF | |
24031 | if ac_fn_c_try_compile "$LINENO"; then : | |
24032 | gl_cv_cc_visibility=yes | |
24033 | else | |
24034 | gl_cv_cc_visibility=no | |
24035 | fi | |
24036 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
24037 | CFLAGS="$gl_save_CFLAGS" | |
6ec2e0f5 | 24038 | |
5df4cba6 SM |
24039 | fi |
24040 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5 | |
24041 | $as_echo "$gl_cv_cc_visibility" >&6; } | |
24042 | if test $gl_cv_cc_visibility = yes; then | |
24043 | CFLAG_VISIBILITY="-fvisibility=hidden" | |
24044 | HAVE_VISIBILITY=1 | |
6ec2e0f5 SDJ |
24045 | fi |
24046 | fi | |
24047 | ||
6ec2e0f5 SDJ |
24048 | |
24049 | ||
5df4cba6 SM |
24050 | cat >>confdefs.h <<_ACEOF |
24051 | #define HAVE_VISIBILITY $HAVE_VISIBILITY | |
24052 | _ACEOF | |
6ec2e0f5 SDJ |
24053 | |
24054 | ||
6ec2e0f5 | 24055 | |
5df4cba6 | 24056 | fi |
6ec2e0f5 | 24057 | |
c0c3707f | 24058 | |
6ec2e0f5 SDJ |
24059 | : |
24060 | ||
24061 | fi | |
24062 | ||
24063 | ||
24064 | ||
24065 | ||
24066 | ||
24067 | GNULIB_MBRTOWC=1 | |
24068 | ||
24069 | ||
24070 | ||
24071 | ||
24072 | ||
24073 | $as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h | |
24074 | ||
24075 | ||
24076 | ||
24077 | ||
24078 | ||
24079 | ||
24080 | ||
24081 | ||
24082 | ||
24083 | ||
24084 | ||
24085 | ||
24086 | ||
24087 | ||
5df4cba6 SM |
24088 | |
24089 | if case "$host_os" in | |
24090 | mingw*) true ;; | |
24091 | *) test $ac_cv_func_mbsinit = yes ;; | |
24092 | esac \ | |
24093 | && test $ac_cv_func_mbrtowc = yes; then | |
6ec2e0f5 SDJ |
24094 | |
24095 | ||
24096 | ||
c0c3707f | 24097 | |
6ec2e0f5 SDJ |
24098 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 |
24099 | $as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } | |
d0ac1c44 | 24100 | if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then : |
6ec2e0f5 SDJ |
24101 | $as_echo_n "(cached) " >&6 |
24102 | else | |
24103 | ||
24104 | case "$host_os" in | |
24105 | # Guess no on AIX and OSF/1. | |
24106 | aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; | |
24107 | # Guess yes otherwise. | |
24108 | *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; | |
24109 | esac | |
24110 | if test $LOCALE_JA != none; then | |
24111 | if test "$cross_compiling" = yes; then : | |
24112 | : | |
24113 | else | |
24114 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24115 | /* end confdefs.h. */ | |
24116 | ||
24117 | #include <locale.h> | |
24118 | #include <string.h> | |
6ec2e0f5 SDJ |
24119 | #include <wchar.h> |
24120 | int main () | |
24121 | { | |
24122 | if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) | |
24123 | { | |
24124 | const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ | |
24125 | mbstate_t state; | |
24126 | wchar_t wc; | |
24127 | ||
24128 | memset (&state, '\0', sizeof (mbstate_t)); | |
24129 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
24130 | if (mbsinit (&state)) | |
c0c3707f CB |
24131 | return 2; |
24132 | } | |
24133 | return 0; | |
24134 | } | |
24135 | _ACEOF | |
24136 | if ac_fn_c_try_run "$LINENO"; then : | |
24137 | gl_cv_func_mbrtowc_incomplete_state=yes | |
24138 | else | |
24139 | gl_cv_func_mbrtowc_incomplete_state=no | |
24140 | fi | |
24141 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24142 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24143 | fi | |
24144 | ||
24145 | else | |
24146 | if test $LOCALE_FR_UTF8 != none; then | |
24147 | if test "$cross_compiling" = yes; then : | |
24148 | : | |
24149 | else | |
24150 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24151 | /* end confdefs.h. */ | |
24152 | ||
24153 | #include <locale.h> | |
24154 | #include <string.h> | |
c0c3707f CB |
24155 | #include <wchar.h> |
24156 | int main () | |
24157 | { | |
24158 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
24159 | { | |
24160 | const char input[] = "B\303\274\303\237er"; /* "Büßer" */ | |
24161 | mbstate_t state; | |
24162 | wchar_t wc; | |
24163 | ||
24164 | memset (&state, '\0', sizeof (mbstate_t)); | |
24165 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
24166 | if (mbsinit (&state)) | |
24167 | return 2; | |
6ec2e0f5 SDJ |
24168 | } |
24169 | return 0; | |
24170 | } | |
24171 | _ACEOF | |
24172 | if ac_fn_c_try_run "$LINENO"; then : | |
24173 | gl_cv_func_mbrtowc_incomplete_state=yes | |
24174 | else | |
24175 | gl_cv_func_mbrtowc_incomplete_state=no | |
24176 | fi | |
24177 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24178 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24179 | fi | |
24180 | ||
c0c3707f | 24181 | fi |
6ec2e0f5 SDJ |
24182 | fi |
24183 | ||
24184 | fi | |
24185 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 | |
24186 | $as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } | |
24187 | ||
24188 | ||
24189 | ||
24190 | ||
24191 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 | |
24192 | $as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } | |
d0ac1c44 | 24193 | if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then : |
6ec2e0f5 SDJ |
24194 | $as_echo_n "(cached) " >&6 |
24195 | else | |
24196 | ||
24197 | case "$host_os" in | |
24198 | # Guess no on Solaris 8. | |
24199 | solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; | |
24200 | # Guess yes otherwise. | |
24201 | *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; | |
24202 | esac | |
24203 | if test $LOCALE_ZH_CN != none; then | |
24204 | if test "$cross_compiling" = yes; then : | |
24205 | : | |
24206 | else | |
24207 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24208 | /* end confdefs.h. */ | |
24209 | ||
24210 | #include <locale.h> | |
24211 | #include <stdlib.h> | |
24212 | #include <string.h> | |
6ec2e0f5 SDJ |
24213 | #include <wchar.h> |
24214 | int main () | |
24215 | { | |
24216 | /* This fails on Solaris 8: | |
24217 | mbrtowc returns 2, and sets wc to 0x00F0. | |
24218 | mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ | |
24219 | if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) | |
24220 | { | |
24221 | char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ | |
24222 | mbstate_t state; | |
24223 | wchar_t wc; | |
24224 | ||
24225 | memset (&state, '\0', sizeof (mbstate_t)); | |
24226 | if (mbrtowc (&wc, input + 3, 6, &state) != 4 | |
24227 | && mbtowc (&wc, input + 3, 6) == 4) | |
c0c3707f | 24228 | return 2; |
6ec2e0f5 | 24229 | } |
49e4877c PA |
24230 | return 0; |
24231 | } | |
24232 | _ACEOF | |
24233 | if ac_fn_c_try_run "$LINENO"; then : | |
6ec2e0f5 | 24234 | gl_cv_func_mbrtowc_sanitycheck=yes |
49e4877c | 24235 | else |
6ec2e0f5 | 24236 | gl_cv_func_mbrtowc_sanitycheck=no |
49e4877c PA |
24237 | fi |
24238 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24239 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24240 | fi | |
24241 | ||
6ec2e0f5 SDJ |
24242 | fi |
24243 | ||
49e4877c | 24244 | fi |
6ec2e0f5 SDJ |
24245 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 |
24246 | $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } | |
49e4877c | 24247 | |
6ec2e0f5 SDJ |
24248 | REPLACE_MBSTATE_T=0 |
24249 | case "$gl_cv_func_mbrtowc_incomplete_state" in | |
24250 | *yes) ;; | |
24251 | *) REPLACE_MBSTATE_T=1 ;; | |
24252 | esac | |
24253 | case "$gl_cv_func_mbrtowc_sanitycheck" in | |
24254 | *yes) ;; | |
24255 | *) REPLACE_MBSTATE_T=1 ;; | |
24256 | esac | |
24257 | else | |
24258 | REPLACE_MBSTATE_T=1 | |
24259 | fi | |
8690e634 | 24260 | |
8690e634 | 24261 | |
8690e634 | 24262 | |
6ec2e0f5 SDJ |
24263 | if test $ac_cv_func_mbsinit = no; then |
24264 | HAVE_MBSINIT=0 | |
24265 | ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" " | |
9c9d63b1 | 24266 | #include <wchar.h> |
8690e634 | 24267 | |
6ec2e0f5 | 24268 | " |
d0ac1c44 | 24269 | if test "x$ac_cv_have_decl_mbsinit" = xyes; then : |
6ec2e0f5 SDJ |
24270 | ac_have_decl=1 |
24271 | else | |
24272 | ac_have_decl=0 | |
24273 | fi | |
4a626d0a | 24274 | |
6ec2e0f5 SDJ |
24275 | cat >>confdefs.h <<_ACEOF |
24276 | #define HAVE_DECL_MBSINIT $ac_have_decl | |
24277 | _ACEOF | |
49e4877c | 24278 | |
6ec2e0f5 SDJ |
24279 | if test $ac_cv_have_decl_mbsinit = yes; then |
24280 | REPLACE_MBSINIT=1 | |
24281 | fi | |
24282 | else | |
24283 | if test $REPLACE_MBSTATE_T = 1; then | |
24284 | REPLACE_MBSINIT=1 | |
24285 | else | |
24286 | case "$host_os" in | |
24287 | mingw*) REPLACE_MBSINIT=1 ;; | |
8690e634 | 24288 | esac |
c971b7fa PA |
24289 | fi |
24290 | fi | |
24291 | ||
6ec2e0f5 | 24292 | if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then |
c971b7fa | 24293 | |
c971b7fa | 24294 | |
c971b7fa PA |
24295 | |
24296 | ||
24297 | ||
24298 | ||
24299 | ||
24300 | ||
6ec2e0f5 | 24301 | gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext" |
8690e634 JK |
24302 | |
24303 | ||
24304 | : | |
c971b7fa | 24305 | |
a512b375 | 24306 | fi |
c971b7fa | 24307 | |
8690e634 JK |
24308 | |
24309 | ||
24310 | ||
24311 | ||
6ec2e0f5 | 24312 | GNULIB_MBSINIT=1 |
8690e634 JK |
24313 | |
24314 | ||
24315 | ||
24316 | ||
8690e634 | 24317 | |
6ec2e0f5 | 24318 | $as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h |
8690e634 JK |
24319 | |
24320 | ||
24321 | ||
24322 | ||
24323 | ||
24324 | ||
24325 | ||
24326 | ||
24327 | ||
24328 | ||
24329 | ||
c971b7fa | 24330 | |
c971b7fa | 24331 | |
5df4cba6 SM |
24332 | |
24333 | if case "$host_os" in | |
24334 | mingw*) true ;; | |
24335 | *) test $ac_cv_func_mbsinit = yes ;; | |
24336 | esac \ | |
24337 | && test $ac_cv_func_mbrtowc = yes; then | |
c971b7fa | 24338 | |
8690e634 JK |
24339 | |
24340 | ||
c0c3707f | 24341 | |
8690e634 JK |
24342 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 |
24343 | $as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } | |
d0ac1c44 | 24344 | if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then : |
8690e634 JK |
24345 | $as_echo_n "(cached) " >&6 |
24346 | else | |
24347 | ||
24348 | case "$host_os" in | |
24349 | # Guess no on AIX and OSF/1. | |
24350 | aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; | |
24351 | # Guess yes otherwise. | |
24352 | *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; | |
24353 | esac | |
24354 | if test $LOCALE_JA != none; then | |
24355 | if test "$cross_compiling" = yes; then : | |
24356 | : | |
c971b7fa PA |
24357 | else |
24358 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24359 | /* end confdefs.h. */ | |
24360 | ||
8690e634 JK |
24361 | #include <locale.h> |
24362 | #include <string.h> | |
8690e634 JK |
24363 | #include <wchar.h> |
24364 | int main () | |
c971b7fa | 24365 | { |
8690e634 | 24366 | if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) |
c971b7fa | 24367 | { |
8690e634 JK |
24368 | const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ |
24369 | mbstate_t state; | |
24370 | wchar_t wc; | |
24371 | ||
24372 | memset (&state, '\0', sizeof (mbstate_t)); | |
24373 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
24374 | if (mbsinit (&state)) | |
c0c3707f CB |
24375 | return 2; |
24376 | } | |
24377 | return 0; | |
24378 | } | |
24379 | _ACEOF | |
24380 | if ac_fn_c_try_run "$LINENO"; then : | |
24381 | gl_cv_func_mbrtowc_incomplete_state=yes | |
24382 | else | |
24383 | gl_cv_func_mbrtowc_incomplete_state=no | |
24384 | fi | |
24385 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24386 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24387 | fi | |
24388 | ||
24389 | else | |
24390 | if test $LOCALE_FR_UTF8 != none; then | |
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> | |
c0c3707f CB |
24399 | #include <wchar.h> |
24400 | int main () | |
24401 | { | |
24402 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
24403 | { | |
24404 | const char input[] = "B\303\274\303\237er"; /* "Büßer" */ | |
24405 | mbstate_t state; | |
24406 | wchar_t wc; | |
24407 | ||
24408 | memset (&state, '\0', sizeof (mbstate_t)); | |
24409 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
24410 | if (mbsinit (&state)) | |
24411 | return 2; | |
c971b7fa | 24412 | } |
c971b7fa PA |
24413 | return 0; |
24414 | } | |
24415 | _ACEOF | |
24416 | if ac_fn_c_try_run "$LINENO"; then : | |
8690e634 | 24417 | gl_cv_func_mbrtowc_incomplete_state=yes |
c971b7fa | 24418 | else |
8690e634 | 24419 | gl_cv_func_mbrtowc_incomplete_state=no |
c971b7fa PA |
24420 | fi |
24421 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24422 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24423 | fi | |
24424 | ||
c0c3707f | 24425 | fi |
8690e634 | 24426 | fi |
c971b7fa PA |
24427 | |
24428 | fi | |
8690e634 JK |
24429 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 |
24430 | $as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } | |
c971b7fa PA |
24431 | |
24432 | ||
c971b7fa PA |
24433 | |
24434 | ||
8690e634 JK |
24435 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 |
24436 | $as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } | |
d0ac1c44 | 24437 | if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then : |
c971b7fa PA |
24438 | $as_echo_n "(cached) " >&6 |
24439 | else | |
8690e634 JK |
24440 | |
24441 | case "$host_os" in | |
24442 | # Guess no on Solaris 8. | |
24443 | solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; | |
24444 | # Guess yes otherwise. | |
24445 | *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; | |
24446 | esac | |
24447 | if test $LOCALE_ZH_CN != none; then | |
24448 | if test "$cross_compiling" = yes; then : | |
24449 | : | |
24450 | else | |
c971b7fa PA |
24451 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
24452 | /* end confdefs.h. */ | |
8690e634 JK |
24453 | |
24454 | #include <locale.h> | |
24455 | #include <stdlib.h> | |
24456 | #include <string.h> | |
8690e634 JK |
24457 | #include <wchar.h> |
24458 | int main () | |
c971b7fa | 24459 | { |
8690e634 JK |
24460 | /* This fails on Solaris 8: |
24461 | mbrtowc returns 2, and sets wc to 0x00F0. | |
24462 | mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ | |
24463 | if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) | |
24464 | { | |
24465 | char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ | |
24466 | mbstate_t state; | |
24467 | wchar_t wc; | |
24468 | ||
24469 | memset (&state, '\0', sizeof (mbstate_t)); | |
24470 | if (mbrtowc (&wc, input + 3, 6, &state) != 4 | |
24471 | && mbtowc (&wc, input + 3, 6) == 4) | |
c0c3707f | 24472 | return 2; |
8690e634 | 24473 | } |
c971b7fa PA |
24474 | return 0; |
24475 | } | |
24476 | _ACEOF | |
8690e634 JK |
24477 | if ac_fn_c_try_run "$LINENO"; then : |
24478 | gl_cv_func_mbrtowc_sanitycheck=yes | |
c971b7fa | 24479 | else |
8690e634 | 24480 | gl_cv_func_mbrtowc_sanitycheck=no |
c971b7fa | 24481 | fi |
8690e634 JK |
24482 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
24483 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c971b7fa | 24484 | fi |
c971b7fa | 24485 | |
8690e634 JK |
24486 | fi |
24487 | ||
24488 | fi | |
24489 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 | |
24490 | $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } | |
c971b7fa | 24491 | |
8690e634 JK |
24492 | REPLACE_MBSTATE_T=0 |
24493 | case "$gl_cv_func_mbrtowc_incomplete_state" in | |
24494 | *yes) ;; | |
24495 | *) REPLACE_MBSTATE_T=1 ;; | |
24496 | esac | |
24497 | case "$gl_cv_func_mbrtowc_sanitycheck" in | |
24498 | *yes) ;; | |
24499 | *) REPLACE_MBSTATE_T=1 ;; | |
24500 | esac | |
24501 | else | |
24502 | REPLACE_MBSTATE_T=1 | |
c971b7fa PA |
24503 | fi |
24504 | ||
c971b7fa | 24505 | |
8690e634 | 24506 | |
6ec2e0f5 SDJ |
24507 | if test $ac_cv_func_mbsrtowcs = no; then |
24508 | HAVE_MBSRTOWCS=0 | |
24509 | ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" " | |
9c9d63b1 | 24510 | #include <wchar.h> |
8690e634 JK |
24511 | |
24512 | " | |
d0ac1c44 | 24513 | if test "x$ac_cv_have_decl_mbsrtowcs" = xyes; then : |
8690e634 JK |
24514 | ac_have_decl=1 |
24515 | else | |
24516 | ac_have_decl=0 | |
c971b7fa | 24517 | fi |
c971b7fa | 24518 | |
8690e634 | 24519 | cat >>confdefs.h <<_ACEOF |
6ec2e0f5 | 24520 | #define HAVE_DECL_MBSRTOWCS $ac_have_decl |
c971b7fa | 24521 | _ACEOF |
c971b7fa | 24522 | |
6ec2e0f5 SDJ |
24523 | if test $ac_cv_have_decl_mbsrtowcs = yes; then |
24524 | REPLACE_MBSRTOWCS=1 | |
8690e634 JK |
24525 | fi |
24526 | else | |
24527 | if test $REPLACE_MBSTATE_T = 1; then | |
6ec2e0f5 | 24528 | REPLACE_MBSRTOWCS=1 |
8690e634 | 24529 | else |
6ec2e0f5 SDJ |
24530 | |
24531 | ||
24532 | ||
24533 | ||
24534 | ||
24535 | ||
24536 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5 | |
24537 | $as_echo_n "checking whether mbsrtowcs works... " >&6; } | |
d0ac1c44 | 24538 | if ${gl_cv_func_mbsrtowcs_works+:} false; then : |
6ec2e0f5 SDJ |
24539 | $as_echo_n "(cached) " >&6 |
24540 | else | |
24541 | ||
24542 | case "$host_os" in | |
24543 | # Guess no on HP-UX, Solaris, mingw. | |
24544 | hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;; | |
24545 | # Guess yes otherwise. | |
24546 | *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; | |
24547 | esac | |
24548 | if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then | |
24549 | if test "$cross_compiling" = yes; then : | |
24550 | : | |
24551 | else | |
24552 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24553 | /* end confdefs.h. */ | |
24554 | ||
24555 | #include <locale.h> | |
24556 | #include <string.h> | |
6ec2e0f5 SDJ |
24557 | #include <wchar.h> |
24558 | int main () | |
24559 | { | |
24560 | int result = 0; | |
24561 | /* Test whether the function supports a NULL destination argument. | |
24562 | This fails on native Windows. */ | |
24563 | if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) | |
24564 | { | |
24565 | const char input[] = "\337er"; | |
24566 | const char *src = input; | |
24567 | mbstate_t state; | |
24568 | ||
24569 | memset (&state, '\0', sizeof (mbstate_t)); | |
24570 | if (mbsrtowcs (NULL, &src, 1, &state) != 3 | |
24571 | || src != input) | |
24572 | result |= 1; | |
24573 | } | |
24574 | /* Test whether the function works when started with a conversion state | |
24575 | in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ | |
24576 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
24577 | { | |
24578 | const char input[] = "B\303\274\303\237er"; | |
24579 | mbstate_t state; | |
24580 | ||
24581 | memset (&state, '\0', sizeof (mbstate_t)); | |
24582 | if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) | |
24583 | if (!mbsinit (&state)) | |
24584 | { | |
24585 | const char *src = input + 2; | |
24586 | if (mbsrtowcs (NULL, &src, 10, &state) != 4) | |
24587 | result |= 2; | |
24588 | } | |
24589 | } | |
24590 | if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) | |
24591 | { | |
24592 | const char input[] = "<\306\374\313\334\270\354>"; | |
24593 | mbstate_t state; | |
24594 | ||
24595 | memset (&state, '\0', sizeof (mbstate_t)); | |
24596 | if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) | |
24597 | if (!mbsinit (&state)) | |
24598 | { | |
24599 | const char *src = input + 4; | |
24600 | if (mbsrtowcs (NULL, &src, 10, &state) != 3) | |
24601 | result |= 4; | |
24602 | } | |
24603 | } | |
24604 | if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) | |
24605 | { | |
24606 | const char input[] = "B\250\271\201\060\211\070er"; | |
24607 | mbstate_t state; | |
24608 | ||
24609 | memset (&state, '\0', sizeof (mbstate_t)); | |
24610 | if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) | |
24611 | if (!mbsinit (&state)) | |
24612 | { | |
24613 | const char *src = input + 2; | |
24614 | if (mbsrtowcs (NULL, &src, 10, &state) != 4) | |
24615 | result |= 8; | |
24616 | } | |
24617 | } | |
24618 | return result; | |
24619 | } | |
24620 | _ACEOF | |
24621 | if ac_fn_c_try_run "$LINENO"; then : | |
24622 | gl_cv_func_mbsrtowcs_works=yes | |
24623 | else | |
24624 | gl_cv_func_mbsrtowcs_works=no | |
24625 | fi | |
24626 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24627 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24628 | fi | |
24629 | ||
24630 | fi | |
24631 | ||
24632 | fi | |
24633 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5 | |
24634 | $as_echo "$gl_cv_func_mbsrtowcs_works" >&6; } | |
24635 | ||
24636 | case "$gl_cv_func_mbsrtowcs_works" in | |
24637 | *yes) ;; | |
24638 | *) REPLACE_MBSRTOWCS=1 ;; | |
8690e634 JK |
24639 | esac |
24640 | fi | |
24641 | fi | |
c971b7fa | 24642 | |
6ec2e0f5 | 24643 | if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then |
c971b7fa PA |
24644 | |
24645 | ||
24646 | ||
24647 | ||
24648 | ||
24649 | ||
24650 | ||
24651 | ||
698be2d8 CB |
24652 | gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext" |
24653 | ||
24654 | ||
24655 | ||
24656 | ||
24657 | ||
24658 | ||
24659 | ||
24660 | ||
24661 | ||
24662 | gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext" | |
24663 | ||
24664 | ||
24665 | : | |
24666 | ||
24667 | fi | |
24668 | ||
24669 | ||
24670 | ||
24671 | ||
24672 | ||
24673 | GNULIB_MBSRTOWCS=1 | |
24674 | ||
24675 | ||
24676 | ||
24677 | ||
24678 | ||
24679 | $as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h | |
24680 | ||
24681 | ||
24682 | ||
24683 | ||
24684 | ||
24685 | ||
24686 | for ac_func in mbtowc | |
24687 | do : | |
24688 | ac_fn_c_check_func "$LINENO" "mbtowc" "ac_cv_func_mbtowc" | |
24689 | if test "x$ac_cv_func_mbtowc" = xyes; then : | |
24690 | cat >>confdefs.h <<_ACEOF | |
24691 | #define HAVE_MBTOWC 1 | |
24692 | _ACEOF | |
24693 | ||
24694 | fi | |
24695 | done | |
24696 | ||
24697 | if test $ac_cv_func_mbtowc = no; then | |
24698 | HAVE_MBTOWC=0 | |
24699 | else | |
24700 | if false; then | |
24701 | REPLACE_MBTOWC=1 | |
24702 | fi | |
24703 | fi | |
6ec2e0f5 | 24704 | |
698be2d8 | 24705 | if test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1; then |
6ec2e0f5 SDJ |
24706 | |
24707 | ||
24708 | ||
24709 | ||
24710 | ||
24711 | ||
24712 | ||
24713 | ||
698be2d8 | 24714 | gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext" |
c971b7fa PA |
24715 | |
24716 | ||
8690e634 | 24717 | : |
c971b7fa | 24718 | |
a512b375 | 24719 | fi |
c971b7fa | 24720 | |
c971b7fa | 24721 | |
c971b7fa | 24722 | |
c971b7fa PA |
24723 | |
24724 | ||
698be2d8 | 24725 | GNULIB_MBTOWC=1 |
c971b7fa | 24726 | |
c971b7fa PA |
24727 | |
24728 | ||
24729 | ||
24730 | ||
698be2d8 | 24731 | $as_echo "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h |
c971b7fa PA |
24732 | |
24733 | ||
c971b7fa | 24734 | |
c971b7fa | 24735 | |
9c9d63b1 | 24736 | if test $REPLACE_MEMCHR = 1; then |
c971b7fa PA |
24737 | |
24738 | ||
24739 | ||
c971b7fa | 24740 | |
c971b7fa PA |
24741 | |
24742 | ||
24743 | ||
24744 | ||
6ec2e0f5 | 24745 | gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext" |
8690e634 | 24746 | |
c971b7fa | 24747 | |
6ec2e0f5 SDJ |
24748 | for ac_header in bp-sym.h |
24749 | do : | |
24750 | ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default" | |
d0ac1c44 | 24751 | if test "x$ac_cv_header_bp_sym_h" = xyes; then : |
6ec2e0f5 SDJ |
24752 | cat >>confdefs.h <<_ACEOF |
24753 | #define HAVE_BP_SYM_H 1 | |
24754 | _ACEOF | |
c971b7fa | 24755 | |
6ec2e0f5 | 24756 | fi |
c971b7fa | 24757 | |
6ec2e0f5 SDJ |
24758 | done |
24759 | ||
24760 | ||
24761 | fi | |
24762 | ||
24763 | ||
24764 | ||
24765 | ||
24766 | ||
24767 | GNULIB_MEMCHR=1 | |
24768 | ||
24769 | ||
24770 | ||
24771 | ||
24772 | ||
24773 | $as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h | |
24774 | ||
24775 | ||
24776 | ||
24777 | ||
24778 | ||
24779 | if test $HAVE_DECL_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then | |
24780 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works in linear time" >&5 | |
24781 | $as_echo_n "checking whether memmem works in linear time... " >&6; } | |
d0ac1c44 | 24782 | if ${gl_cv_func_memmem_works_fast+:} false; then : |
8690e634 JK |
24783 | $as_echo_n "(cached) " >&6 |
24784 | else | |
6ec2e0f5 SDJ |
24785 | if test "$cross_compiling" = yes; then : |
24786 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24787 | /* end confdefs.h. */ | |
24788 | ||
24789 | #include <features.h> | |
24790 | #ifdef __GNU_LIBRARY__ | |
24791 | #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)) \ | |
24792 | && !defined __UCLIBC__ | |
24793 | Lucky user | |
24794 | #endif | |
24795 | #endif | |
24796 | #ifdef __CYGWIN__ | |
24797 | #include <cygwin/version.h> | |
24798 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 0) | |
24799 | Lucky user | |
24800 | #endif | |
24801 | #endif | |
24802 | ||
24803 | _ACEOF | |
24804 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
24805 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
24806 | gl_cv_func_memmem_works_fast="guessing yes" | |
24807 | else | |
c0c3707f | 24808 | gl_cv_func_memmem_works_fast="$gl_cross_guess_normal" |
6ec2e0f5 SDJ |
24809 | fi |
24810 | rm -f conftest* | |
24811 | ||
c971b7fa | 24812 | |
8690e634 JK |
24813 | else |
24814 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c971b7fa | 24815 | /* end confdefs.h. */ |
c971b7fa | 24816 | |
6ec2e0f5 SDJ |
24817 | #include <signal.h> /* for signal */ |
24818 | #include <string.h> /* for memmem */ | |
24819 | #include <stdlib.h> /* for malloc */ | |
24820 | #include <unistd.h> /* for alarm */ | |
24821 | static void quit (int sig) { _exit (sig + 128); } | |
24822 | ||
24823 | int | |
24824 | main () | |
8690e634 | 24825 | { |
8690e634 | 24826 | |
6ec2e0f5 SDJ |
24827 | int result = 0; |
24828 | size_t m = 1000000; | |
24829 | char *haystack = (char *) malloc (2 * m + 1); | |
24830 | char *needle = (char *) malloc (m + 1); | |
24831 | /* Failure to compile this test due to missing alarm is okay, | |
24832 | since all such platforms (mingw) also lack memmem. */ | |
24833 | signal (SIGALRM, quit); | |
24834 | alarm (5); | |
24835 | /* Check for quadratic performance. */ | |
24836 | if (haystack && needle) | |
24837 | { | |
24838 | memset (haystack, 'A', 2 * m); | |
24839 | haystack[2 * m] = 'B'; | |
24840 | memset (needle, 'A', m); | |
24841 | needle[m] = 'B'; | |
24842 | if (!memmem (haystack, 2 * m + 1, needle, m + 1)) | |
24843 | result |= 1; | |
24844 | } | |
c0c3707f CB |
24845 | /* Free allocated memory, in case some sanitizer is watching. */ |
24846 | free (haystack); | |
24847 | free (needle); | |
6ec2e0f5 SDJ |
24848 | return result; |
24849 | ||
24850 | ; | |
c971b7fa PA |
24851 | return 0; |
24852 | } | |
24853 | _ACEOF | |
8690e634 | 24854 | if ac_fn_c_try_run "$LINENO"; then : |
6ec2e0f5 | 24855 | gl_cv_func_memmem_works_fast=yes |
8690e634 | 24856 | else |
6ec2e0f5 | 24857 | gl_cv_func_memmem_works_fast=no |
8690e634 JK |
24858 | fi |
24859 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24860 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c971b7fa | 24861 | fi |
c971b7fa PA |
24862 | |
24863 | ||
8690e634 | 24864 | fi |
6ec2e0f5 SDJ |
24865 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_fast" >&5 |
24866 | $as_echo "$gl_cv_func_memmem_works_fast" >&6; } | |
24867 | case "$gl_cv_func_memmem_works_fast" in | |
24868 | *yes) ;; | |
24869 | *) | |
24870 | REPLACE_MEMMEM=1 | |
24871 | ;; | |
24872 | esac | |
24873 | fi | |
c971b7fa | 24874 | |
6ec2e0f5 | 24875 | if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then |
8690e634 JK |
24876 | |
24877 | ||
24878 | ||
6ec2e0f5 SDJ |
24879 | |
24880 | ||
24881 | ||
24882 | ||
24883 | ||
24884 | gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext" | |
24885 | ||
24886 | fi | |
24887 | ||
24888 | ||
24889 | ||
24890 | ||
24891 | for ac_func in memmem | |
24892 | do : | |
24893 | ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem" | |
d0ac1c44 | 24894 | if test "x$ac_cv_func_memmem" = xyes; then : |
6ec2e0f5 SDJ |
24895 | cat >>confdefs.h <<_ACEOF |
24896 | #define HAVE_MEMMEM 1 | |
24897 | _ACEOF | |
24898 | ||
24899 | fi | |
24900 | done | |
24901 | ||
24902 | if test $ac_cv_func_memmem = yes; then | |
24903 | HAVE_MEMMEM=1 | |
24904 | else | |
24905 | HAVE_MEMMEM=0 | |
24906 | fi | |
24907 | ||
24908 | if test $ac_cv_have_decl_memmem = no; then | |
24909 | HAVE_DECL_MEMMEM=0 | |
24910 | else | |
24911 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5 | |
24912 | $as_echo_n "checking whether memmem works... " >&6; } | |
d0ac1c44 | 24913 | if ${gl_cv_func_memmem_works_always+:} false; then : |
c971b7fa PA |
24914 | $as_echo_n "(cached) " >&6 |
24915 | else | |
6ec2e0f5 SDJ |
24916 | if test "$cross_compiling" = yes; then : |
24917 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24918 | /* end confdefs.h. */ | |
24919 | ||
24920 | #ifdef __GNU_LIBRARY__ | |
24921 | #include <features.h> | |
24922 | #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \ | |
24923 | || __GLIBC_MINOR__ > 12)) \ | |
24924 | || (__GLIBC__ > 2)) \ | |
24925 | || defined __UCLIBC__ | |
24926 | Lucky user | |
24927 | #endif | |
24928 | #elif defined __CYGWIN__ | |
24929 | #include <cygwin/version.h> | |
24930 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) | |
24931 | Lucky user | |
24932 | #endif | |
24933 | #else | |
24934 | Lucky user | |
24935 | #endif | |
24936 | ||
24937 | _ACEOF | |
24938 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
24939 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
24940 | gl_cv_func_memmem_works_always="guessing yes" | |
24941 | else | |
c0c3707f | 24942 | gl_cv_func_memmem_works_always="$gl_cross_guess_normal" |
6ec2e0f5 SDJ |
24943 | fi |
24944 | rm -f conftest* | |
24945 | ||
8690e634 | 24946 | |
8690e634 | 24947 | else |
c971b7fa PA |
24948 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
24949 | /* end confdefs.h. */ | |
c971b7fa | 24950 | |
6ec2e0f5 SDJ |
24951 | #include <string.h> /* for memmem */ |
24952 | #define P "_EF_BF_BD" | |
24953 | #define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P | |
24954 | #define NEEDLE P P P P P | |
24955 | ||
24956 | int | |
24957 | main () | |
c971b7fa | 24958 | { |
8690e634 | 24959 | |
6ec2e0f5 SDJ |
24960 | int result = 0; |
24961 | if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE))) | |
24962 | result |= 1; | |
24963 | /* Check for empty needle behavior. */ | |
24964 | { | |
24965 | const char *haystack = "AAA"; | |
698be2d8 | 24966 | if (memmem (haystack, 3, (const char *) 1, 0) != haystack) |
6ec2e0f5 | 24967 | result |= 2; |
8690e634 | 24968 | } |
6ec2e0f5 SDJ |
24969 | return result; |
24970 | ||
24971 | ; | |
c971b7fa PA |
24972 | return 0; |
24973 | } | |
24974 | _ACEOF | |
8690e634 | 24975 | if ac_fn_c_try_run "$LINENO"; then : |
6ec2e0f5 | 24976 | gl_cv_func_memmem_works_always=yes |
c971b7fa | 24977 | else |
6ec2e0f5 | 24978 | gl_cv_func_memmem_works_always=no |
c971b7fa | 24979 | fi |
8690e634 JK |
24980 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
24981 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c971b7fa | 24982 | fi |
8690e634 | 24983 | |
8690e634 JK |
24984 | |
24985 | fi | |
6ec2e0f5 SDJ |
24986 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5 |
24987 | $as_echo "$gl_cv_func_memmem_works_always" >&6; } | |
24988 | case "$gl_cv_func_memmem_works_always" in | |
8690e634 | 24989 | *yes) ;; |
6ec2e0f5 SDJ |
24990 | *) |
24991 | REPLACE_MEMMEM=1 | |
24992 | ;; | |
8690e634 | 24993 | esac |
c971b7fa | 24994 | fi |
6ec2e0f5 | 24995 | : |
c971b7fa | 24996 | |
6ec2e0f5 | 24997 | if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then |
c971b7fa | 24998 | |
c971b7fa | 24999 | |
8690e634 | 25000 | |
c971b7fa | 25001 | |
6ec2e0f5 SDJ |
25002 | |
25003 | ||
25004 | ||
25005 | ||
25006 | gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext" | |
25007 | ||
25008 | fi | |
25009 | ||
25010 | ||
25011 | ||
25012 | ||
25013 | ||
25014 | GNULIB_MEMMEM=1 | |
25015 | ||
25016 | ||
25017 | ||
25018 | ||
25019 | ||
25020 | $as_echo "#define GNULIB_TEST_MEMMEM 1" >>confdefs.h | |
25021 | ||
25022 | ||
25023 | ||
25024 | ||
25025 | ||
25026 | ||
25027 | ||
25028 | ||
25029 | ||
25030 | for ac_func in mempcpy | |
25031 | do : | |
25032 | ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy" | |
d0ac1c44 | 25033 | if test "x$ac_cv_func_mempcpy" = xyes; then : |
6ec2e0f5 SDJ |
25034 | cat >>confdefs.h <<_ACEOF |
25035 | #define HAVE_MEMPCPY 1 | |
8690e634 | 25036 | _ACEOF |
c971b7fa | 25037 | |
6ec2e0f5 SDJ |
25038 | fi |
25039 | done | |
c971b7fa | 25040 | |
6ec2e0f5 SDJ |
25041 | if test $ac_cv_func_mempcpy = no; then |
25042 | HAVE_MEMPCPY=0 | |
25043 | fi | |
8690e634 | 25044 | |
6ec2e0f5 | 25045 | if test $HAVE_MEMPCPY = 0; then |
8690e634 JK |
25046 | |
25047 | ||
25048 | ||
25049 | ||
8690e634 | 25050 | |
6ec2e0f5 SDJ |
25051 | |
25052 | ||
25053 | ||
25054 | gl_LIBOBJS="$gl_LIBOBJS mempcpy.$ac_objext" | |
25055 | ||
25056 | ||
8690e634 | 25057 | : |
c971b7fa | 25058 | |
6ec2e0f5 | 25059 | fi |
c971b7fa | 25060 | |
8690e634 | 25061 | |
8690e634 | 25062 | |
8690e634 | 25063 | |
6ec2e0f5 SDJ |
25064 | |
25065 | GNULIB_MEMPCPY=1 | |
25066 | ||
25067 | ||
25068 | ||
25069 | ||
25070 | ||
25071 | $as_echo "#define GNULIB_TEST_MEMPCPY 1" >>confdefs.h | |
25072 | ||
25073 | ||
25074 | ||
25075 | ||
25076 | ||
25077 | ||
25078 | ||
25079 | ||
25080 | if test $ac_cv_have_decl_memrchr = no; then | |
25081 | HAVE_DECL_MEMRCHR=0 | |
25082 | fi | |
25083 | ||
25084 | for ac_func in memrchr | |
25085 | do : | |
25086 | ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr" | |
d0ac1c44 | 25087 | if test "x$ac_cv_func_memrchr" = xyes; then : |
6ec2e0f5 SDJ |
25088 | cat >>confdefs.h <<_ACEOF |
25089 | #define HAVE_MEMRCHR 1 | |
c971b7fa | 25090 | _ACEOF |
6ec2e0f5 | 25091 | |
c971b7fa | 25092 | fi |
6ec2e0f5 | 25093 | done |
8690e634 | 25094 | |
8690e634 | 25095 | |
6ec2e0f5 | 25096 | if test $ac_cv_func_memrchr = no; then |
8690e634 | 25097 | |
6ec2e0f5 SDJ |
25098 | |
25099 | ||
25100 | ||
25101 | ||
25102 | ||
25103 | ||
25104 | ||
25105 | gl_LIBOBJS="$gl_LIBOBJS memrchr.$ac_objext" | |
25106 | ||
25107 | : | |
c971b7fa PA |
25108 | fi |
25109 | ||
25110 | ||
c971b7fa | 25111 | |
c971b7fa | 25112 | |
c971b7fa | 25113 | |
6ec2e0f5 SDJ |
25114 | GNULIB_MEMRCHR=1 |
25115 | ||
25116 | ||
25117 | ||
25118 | ||
25119 | ||
25120 | $as_echo "#define GNULIB_TEST_MEMRCHR 1" >>confdefs.h | |
25121 | ||
25122 | ||
25123 | ||
25124 | ||
2d8adcbd | 25125 | |
698be2d8 CB |
25126 | |
25127 | ||
25128 | ||
8a99096f SM |
25129 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing slash" >&5 |
25130 | $as_echo_n "checking whether mkdir handles trailing slash... " >&6; } | |
25131 | if ${gl_cv_func_mkdir_trailing_slash_works+:} false; then : | |
25132 | $as_echo_n "(cached) " >&6 | |
25133 | else | |
25134 | rm -rf conftest.dir | |
9c9d63b1 | 25135 | if test "$cross_compiling" = yes; then : |
8a99096f | 25136 | case "$host_os" in |
9c9d63b1 PM |
25137 | # Guess yes on Linux systems. |
25138 | linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; | |
25139 | # Guess yes on glibc systems. | |
25140 | *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; | |
25141 | # Guess yes on MSVC, no on mingw. | |
25142 | mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f CB |
25143 | /* end confdefs.h. */ |
25144 | ||
25145 | #ifdef _MSC_VER | |
25146 | Known | |
25147 | #endif | |
25148 | ||
25149 | _ACEOF | |
25150 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
25151 | $EGREP "Known" >/dev/null 2>&1; then : | |
25152 | gl_cv_func_mkdir_trailing_slash_works="guessing yes" | |
25153 | else | |
25154 | gl_cv_func_mkdir_trailing_slash_works="guessing no" | |
25155 | fi | |
25156 | rm -f conftest* | |
25157 | ||
9c9d63b1 PM |
25158 | ;; |
25159 | # If we don't know, obey --enable-cross-guesses. | |
25160 | *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;; | |
25161 | esac | |
8a99096f SM |
25162 | |
25163 | else | |
25164 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25165 | /* end confdefs.h. */ | |
25166 | ||
9c9d63b1 PM |
25167 | #include <sys/types.h> |
25168 | #include <sys/stat.h> | |
25169 | ||
25170 | ||
25171 | $gl_mda_defines | |
8a99096f SM |
25172 | |
25173 | int | |
25174 | main () | |
25175 | { | |
25176 | return mkdir ("conftest.dir/", 0700); | |
25177 | ; | |
25178 | return 0; | |
25179 | } | |
25180 | _ACEOF | |
25181 | if ac_fn_c_try_run "$LINENO"; then : | |
25182 | gl_cv_func_mkdir_trailing_slash_works=yes | |
25183 | else | |
25184 | gl_cv_func_mkdir_trailing_slash_works=no | |
25185 | fi | |
25186 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25187 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25188 | fi | |
25189 | ||
9c9d63b1 | 25190 | rm -rf conftest.dir |
8a99096f SM |
25191 | |
25192 | fi | |
25193 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_slash_works" >&5 | |
25194 | $as_echo "$gl_cv_func_mkdir_trailing_slash_works" >&6; } | |
25195 | case "$gl_cv_func_mkdir_trailing_slash_works" in | |
25196 | *yes) ;; | |
25197 | *) | |
25198 | REPLACE_MKDIR=1 | |
25199 | ;; | |
25200 | esac | |
25201 | ||
25202 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing dot" >&5 | |
25203 | $as_echo_n "checking whether mkdir handles trailing dot... " >&6; } | |
25204 | if ${gl_cv_func_mkdir_trailing_dot_works+:} false; then : | |
25205 | $as_echo_n "(cached) " >&6 | |
25206 | else | |
25207 | rm -rf conftest.dir | |
9c9d63b1 | 25208 | if test "$cross_compiling" = yes; then : |
8a99096f | 25209 | case "$host_os" in |
9c9d63b1 PM |
25210 | # Guess yes on glibc systems. |
25211 | *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;; | |
25212 | # Guess yes on musl systems. | |
25213 | *-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;; | |
25214 | # Guess no on native Windows. | |
25215 | mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;; | |
25216 | # If we don't know, obey --enable-cross-guesses. | |
25217 | *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;; | |
25218 | esac | |
8a99096f SM |
25219 | |
25220 | else | |
25221 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25222 | /* end confdefs.h. */ | |
25223 | ||
9c9d63b1 PM |
25224 | #include <sys/types.h> |
25225 | #include <sys/stat.h> | |
25226 | ||
25227 | ||
25228 | $gl_mda_defines | |
8a99096f SM |
25229 | |
25230 | int | |
25231 | main () | |
25232 | { | |
25233 | return !mkdir ("conftest.dir/./", 0700); | |
25234 | ; | |
25235 | return 0; | |
25236 | } | |
25237 | _ACEOF | |
25238 | if ac_fn_c_try_run "$LINENO"; then : | |
25239 | gl_cv_func_mkdir_trailing_dot_works=yes | |
25240 | else | |
25241 | gl_cv_func_mkdir_trailing_dot_works=no | |
25242 | fi | |
25243 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25244 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25245 | fi | |
25246 | ||
9c9d63b1 | 25247 | rm -rf conftest.dir |
8a99096f SM |
25248 | |
25249 | ||
25250 | fi | |
25251 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_dot_works" >&5 | |
25252 | $as_echo "$gl_cv_func_mkdir_trailing_dot_works" >&6; } | |
25253 | case "$gl_cv_func_mkdir_trailing_dot_works" in | |
25254 | *yes) ;; | |
25255 | *) | |
25256 | REPLACE_MKDIR=1 | |
25257 | ||
25258 | $as_echo "#define FUNC_MKDIR_DOT_BUG 1" >>confdefs.h | |
25259 | ||
25260 | ;; | |
25261 | esac | |
25262 | ||
25263 | if test $REPLACE_MKDIR = 1; then | |
25264 | ||
25265 | ||
25266 | ||
25267 | ||
25268 | ||
25269 | ||
25270 | ||
25271 | ||
25272 | gl_LIBOBJS="$gl_LIBOBJS mkdir.$ac_objext" | |
25273 | ||
25274 | fi | |
25275 | ||
25276 | ||
9c9d63b1 PM |
25277 | |
25278 | ||
25279 | ||
25280 | GNULIB_MKDIR=1 | |
25281 | ||
25282 | ||
25283 | ||
25284 | ||
25285 | ||
25286 | $as_echo "#define GNULIB_TEST_MKDIR 1" >>confdefs.h | |
25287 | ||
25288 | ||
25289 | ||
25290 | ||
25291 | ||
e8d8cce6 SM |
25292 | for ac_func in mkdtemp |
25293 | do : | |
25294 | ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp" | |
25295 | if test "x$ac_cv_func_mkdtemp" = xyes; then : | |
25296 | cat >>confdefs.h <<_ACEOF | |
25297 | #define HAVE_MKDTEMP 1 | |
25298 | _ACEOF | |
25299 | ||
25300 | fi | |
25301 | done | |
25302 | ||
25303 | if test $ac_cv_func_mkdtemp = no; then | |
25304 | HAVE_MKDTEMP=0 | |
25305 | fi | |
25306 | ||
25307 | if test $HAVE_MKDTEMP = 0; then | |
25308 | ||
25309 | ||
25310 | ||
25311 | ||
25312 | ||
25313 | ||
25314 | ||
25315 | ||
25316 | gl_LIBOBJS="$gl_LIBOBJS mkdtemp.$ac_objext" | |
25317 | ||
25318 | : | |
25319 | ||
25320 | fi | |
25321 | ||
25322 | ||
25323 | ||
25324 | ||
25325 | ||
25326 | GNULIB_MKDTEMP=1 | |
25327 | ||
25328 | ||
25329 | ||
25330 | ||
25331 | ||
25332 | $as_echo "#define GNULIB_TEST_MKDTEMP 1" >>confdefs.h | |
25333 | ||
25334 | ||
25335 | ||
25336 | ||
25337 | ||
2d8adcbd MM |
25338 | |
25339 | ||
b3279b60 TT |
25340 | |
25341 | ||
b3279b60 TT |
25342 | if test $ac_cv_func_mkostemp != yes; then |
25343 | HAVE_MKOSTEMP=0 | |
25344 | fi | |
2d8adcbd | 25345 | |
b3279b60 | 25346 | if test $HAVE_MKOSTEMP = 0; then |
2d8adcbd | 25347 | |
2d8adcbd | 25348 | |
2d8adcbd | 25349 | |
2d8adcbd | 25350 | |
2d8adcbd MM |
25351 | |
25352 | ||
25353 | ||
25354 | ||
b3279b60 | 25355 | gl_LIBOBJS="$gl_LIBOBJS mkostemp.$ac_objext" |
2d8adcbd MM |
25356 | |
25357 | ||
25358 | ||
b3279b60 | 25359 | fi |
2d8adcbd | 25360 | |
2d8adcbd | 25361 | |
b3279b60 TT |
25362 | cat >>confdefs.h <<_ACEOF |
25363 | #define GNULIB_MKOSTEMP 1 | |
25364 | _ACEOF | |
2d8adcbd MM |
25365 | |
25366 | ||
2d8adcbd MM |
25367 | |
25368 | ||
25369 | ||
25370 | ||
25371 | ||
b3279b60 | 25372 | GNULIB_MKOSTEMP=1 |
2d8adcbd MM |
25373 | |
25374 | ||
25375 | ||
25376 | ||
25377 | ||
b3279b60 | 25378 | $as_echo "#define GNULIB_TEST_MKOSTEMP 1" >>confdefs.h |
2d8adcbd MM |
25379 | |
25380 | ||
25381 | ||
25382 | ||
6ec2e0f5 SDJ |
25383 | if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then |
25384 | ||
25385 | ||
25386 | ||
c971b7fa | 25387 | |
c971b7fa | 25388 | |
c971b7fa PA |
25389 | |
25390 | ||
8690e634 | 25391 | |
6ec2e0f5 | 25392 | gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext" |
8690e634 | 25393 | |
6ec2e0f5 | 25394 | fi |
8690e634 | 25395 | |
6ec2e0f5 | 25396 | if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then |
8690e634 JK |
25397 | |
25398 | ||
25399 | ||
25400 | ||
25401 | ||
25402 | ||
8690e634 JK |
25403 | |
25404 | ||
6ec2e0f5 | 25405 | gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext" |
8690e634 | 25406 | |
a512b375 | 25407 | fi |
8690e634 JK |
25408 | |
25409 | ||
c0c3707f CB |
25410 | cat >>confdefs.h <<_ACEOF |
25411 | #define GNULIB_MSVC_NOTHROW 1 | |
25412 | _ACEOF | |
25413 | ||
25414 | ||
25415 | ||
25416 | ||
725e2999 JB |
25417 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5 |
25418 | $as_echo_n "checking whether <netinet/in.h> is self-contained... " >&6; } | |
25419 | if ${gl_cv_header_netinet_in_h_selfcontained+:} false; then : | |
25420 | $as_echo_n "(cached) " >&6 | |
25421 | else | |
25422 | ||
25423 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25424 | /* end confdefs.h. */ | |
25425 | #include <netinet/in.h> | |
25426 | int | |
25427 | main () | |
25428 | { | |
25429 | ||
25430 | ; | |
25431 | return 0; | |
25432 | } | |
25433 | _ACEOF | |
25434 | if ac_fn_c_try_compile "$LINENO"; then : | |
25435 | gl_cv_header_netinet_in_h_selfcontained=yes | |
25436 | else | |
25437 | gl_cv_header_netinet_in_h_selfcontained=no | |
25438 | fi | |
25439 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
25440 | ||
25441 | fi | |
25442 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5 | |
25443 | $as_echo "$gl_cv_header_netinet_in_h_selfcontained" >&6; } | |
25444 | if test $gl_cv_header_netinet_in_h_selfcontained = yes; then | |
25445 | NETINET_IN_H='' | |
25446 | else | |
25447 | NETINET_IN_H='netinet/in.h' | |
25448 | for ac_header in netinet/in.h | |
25449 | do : | |
25450 | ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" | |
25451 | if test "x$ac_cv_header_netinet_in_h" = xyes; then : | |
25452 | cat >>confdefs.h <<_ACEOF | |
25453 | #define HAVE_NETINET_IN_H 1 | |
25454 | _ACEOF | |
25455 | ||
25456 | fi | |
25457 | ||
25458 | done | |
25459 | ||
25460 | ||
25461 | ||
25462 | ||
25463 | ||
25464 | ||
25465 | ||
725e2999 JB |
25466 | |
25467 | ||
25468 | ||
25469 | if test $gl_cv_have_include_next = yes; then | |
25470 | gl_cv_next_netinet_in_h='<'netinet/in.h'>' | |
25471 | else | |
25472 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5 | |
25473 | $as_echo_n "checking absolute name of <netinet/in.h>... " >&6; } | |
25474 | if ${gl_cv_next_netinet_in_h+:} false; then : | |
25475 | $as_echo_n "(cached) " >&6 | |
25476 | else | |
25477 | ||
25478 | if test $ac_cv_header_netinet_in_h = yes; then | |
25479 | ||
25480 | ||
25481 | ||
25482 | ||
25483 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25484 | /* end confdefs.h. */ | |
25485 | #include <netinet/in.h> | |
25486 | _ACEOF | |
25487 | case "$host_os" in | |
25488 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
25489 | *) gl_absname_cpp="$ac_cpp" ;; | |
25490 | esac | |
25491 | ||
25492 | case "$host_os" in | |
25493 | mingw*) | |
25494 | gl_dirsep_regex='[/\\]' | |
25495 | ;; | |
25496 | *) | |
25497 | gl_dirsep_regex='\/' | |
25498 | ;; | |
25499 | esac | |
25500 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
25501 | gl_header_literal_regex=`echo 'netinet/in.h' \ | |
25502 | | sed -e "$gl_make_literal_regex_sed"` | |
25503 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
25504 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
25505 | s|^/[^/]|//&| | |
25506 | p | |
25507 | q | |
25508 | }' | |
25509 | ||
25510 | gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
25511 | sed -n "$gl_absolute_header_sed"` | |
25512 | ||
25513 | gl_header=$gl_cv_absolute_netinet_in_h | |
25514 | gl_cv_next_netinet_in_h='"'$gl_header'"' | |
25515 | else | |
25516 | gl_cv_next_netinet_in_h='<'netinet/in.h'>' | |
25517 | fi | |
25518 | ||
25519 | ||
25520 | fi | |
25521 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5 | |
25522 | $as_echo "$gl_cv_next_netinet_in_h" >&6; } | |
25523 | fi | |
25524 | NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h | |
25525 | ||
25526 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
25527 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
25528 | gl_next_as_first_directive='<'netinet/in.h'>' | |
25529 | else | |
25530 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
25531 | gl_next_as_first_directive=$gl_cv_next_netinet_in_h | |
25532 | fi | |
25533 | NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive | |
25534 | ||
25535 | ||
25536 | ||
25537 | ||
25538 | if test $ac_cv_header_netinet_in_h = yes; then | |
25539 | HAVE_NETINET_IN_H=1 | |
25540 | else | |
25541 | HAVE_NETINET_IN_H=0 | |
25542 | fi | |
25543 | ||
25544 | fi | |
25545 | ||
25546 | if test -n "$NETINET_IN_H"; then | |
25547 | GL_GENERATE_NETINET_IN_H_TRUE= | |
25548 | GL_GENERATE_NETINET_IN_H_FALSE='#' | |
25549 | else | |
25550 | GL_GENERATE_NETINET_IN_H_TRUE='#' | |
25551 | GL_GENERATE_NETINET_IN_H_FALSE= | |
25552 | fi | |
25553 | ||
25554 | ||
25555 | ||
25556 | ||
8690e634 | 25557 | |
c0c3707f | 25558 | |
6ec2e0f5 SDJ |
25559 | case "$host_os" in |
25560 | mingw* | pw*) | |
25561 | REPLACE_OPEN=1 | |
25562 | ;; | |
25563 | *) | |
25564 | ||
c0c3707f CB |
25565 | if test "$gl_cv_macro_O_CLOEXEC" != yes; then |
25566 | REPLACE_OPEN=1 | |
25567 | fi | |
472fa5ee SM |
25568 | |
25569 | ||
c0c3707f | 25570 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5 |
6ec2e0f5 | 25571 | $as_echo_n "checking whether open recognizes a trailing slash... " >&6; } |
d0ac1c44 | 25572 | if ${gl_cv_func_open_slash+:} false; then : |
6ec2e0f5 SDJ |
25573 | $as_echo_n "(cached) " >&6 |
25574 | else | |
25575 | # Assume that if we have lstat, we can also check symlinks. | |
c0c3707f CB |
25576 | if test $ac_cv_func_lstat = yes; then |
25577 | touch conftest.tmp | |
25578 | ln -s conftest.tmp conftest.lnk | |
25579 | fi | |
25580 | if test "$cross_compiling" = yes; then : | |
8690e634 | 25581 | |
c0c3707f CB |
25582 | case "$host_os" in |
25583 | freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) | |
25584 | gl_cv_func_open_slash="guessing no" ;; | |
25585 | *) | |
25586 | gl_cv_func_open_slash="guessing yes" ;; | |
25587 | esac | |
8690e634 | 25588 | |
6ec2e0f5 SDJ |
25589 | else |
25590 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25591 | /* end confdefs.h. */ | |
25592 | ||
25593 | #include <fcntl.h> | |
25594 | #if HAVE_UNISTD_H | |
25595 | # include <unistd.h> | |
25596 | #endif | |
9c9d63b1 PM |
25597 | |
25598 | ||
25599 | $gl_mda_defines | |
25600 | ||
6ec2e0f5 SDJ |
25601 | int main () |
25602 | { | |
25603 | int result = 0; | |
25604 | #if HAVE_LSTAT | |
25605 | if (open ("conftest.lnk/", O_RDONLY) != -1) | |
25606 | result |= 1; | |
25607 | #endif | |
25608 | if (open ("conftest.sl/", O_CREAT, 0600) >= 0) | |
25609 | result |= 2; | |
25610 | return result; | |
25611 | } | |
25612 | _ACEOF | |
25613 | if ac_fn_c_try_run "$LINENO"; then : | |
25614 | gl_cv_func_open_slash=yes | |
25615 | else | |
25616 | gl_cv_func_open_slash=no | |
25617 | fi | |
25618 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25619 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25620 | fi | |
8690e634 | 25621 | |
c0c3707f | 25622 | rm -f conftest.sl conftest.tmp conftest.lnk |
8690e634 | 25623 | |
6ec2e0f5 SDJ |
25624 | fi |
25625 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5 | |
25626 | $as_echo "$gl_cv_func_open_slash" >&6; } | |
c0c3707f CB |
25627 | case "$gl_cv_func_open_slash" in |
25628 | *no) | |
8690e634 | 25629 | |
6ec2e0f5 | 25630 | $as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h |
8690e634 | 25631 | |
6ec2e0f5 SDJ |
25632 | ;; |
25633 | esac | |
8690e634 | 25634 | |
c0c3707f CB |
25635 | case "$gl_cv_func_open_slash" in |
25636 | *no) | |
25637 | REPLACE_OPEN=1 | |
25638 | ;; | |
25639 | esac | |
25640 | ;; | |
25641 | esac | |
472fa5ee | 25642 | |
c0c3707f | 25643 | if test $REPLACE_OPEN = 0; then |
472fa5ee SM |
25644 | |
25645 | ||
25646 | ||
6ec2e0f5 SDJ |
25647 | if test $ac_cv_func_fchdir = no; then |
25648 | HAVE_FCHDIR=0 | |
25649 | fi | |
c971b7fa | 25650 | |
6ec2e0f5 SDJ |
25651 | if test $HAVE_FCHDIR = 0; then |
25652 | REPLACE_OPEN=1 | |
25653 | fi | |
25654 | fi | |
c971b7fa PA |
25655 | |
25656 | ||
25657 | ||
6ec2e0f5 | 25658 | if test $REPLACE_OPEN = 1; then |
c971b7fa PA |
25659 | |
25660 | ||
25661 | ||
25662 | ||
25663 | ||
c971b7fa PA |
25664 | |
25665 | ||
c971b7fa | 25666 | |
6ec2e0f5 | 25667 | gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" |
c971b7fa | 25668 | |
c971b7fa PA |
25669 | |
25670 | ||
6ec2e0f5 SDJ |
25671 | : |
25672 | ||
a512b375 | 25673 | fi |
c971b7fa PA |
25674 | |
25675 | ||
25676 | ||
25677 | ||
25678 | ||
6ec2e0f5 | 25679 | GNULIB_OPEN=1 |
c971b7fa PA |
25680 | |
25681 | ||
25682 | ||
25683 | ||
25684 | ||
6ec2e0f5 | 25685 | $as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h |
c971b7fa PA |
25686 | |
25687 | ||
25688 | ||
25689 | ||
25690 | ||
c971b7fa | 25691 | |
c971b7fa | 25692 | |
472fa5ee | 25693 | |
63ce7108 | 25694 | |
c0c3707f CB |
25695 | case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in |
25696 | yes+*yes+yes) | |
6ec2e0f5 SDJ |
25697 | ;; |
25698 | yes+*) | |
c0c3707f | 25699 | # Solaris 10 lacks O_CLOEXEC. |
6ec2e0f5 SDJ |
25700 | # Solaris 9 has *at functions, but uniformly mishandles trailing |
25701 | # slash in all of them. | |
25702 | REPLACE_OPENAT=1 | |
25703 | ;; | |
25704 | *) | |
25705 | HAVE_OPENAT=0 | |
25706 | ;; | |
25707 | esac | |
63ce7108 | 25708 | |
6ec2e0f5 | 25709 | if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then |
63ce7108 | 25710 | |
63ce7108 | 25711 | |
63ce7108 | 25712 | |
63ce7108 | 25713 | |
63ce7108 TT |
25714 | |
25715 | ||
63ce7108 | 25716 | |
63ce7108 | 25717 | |
6ec2e0f5 | 25718 | gl_LIBOBJS="$gl_LIBOBJS openat.$ac_objext" |
63ce7108 TT |
25719 | |
25720 | ||
25721 | ||
6ec2e0f5 | 25722 | : |
63ce7108 | 25723 | |
6ec2e0f5 | 25724 | fi |
63ce7108 TT |
25725 | |
25726 | ||
6ec2e0f5 SDJ |
25727 | cat >>confdefs.h <<_ACEOF |
25728 | #define GNULIB_OPENAT 1 | |
25729 | _ACEOF | |
63ce7108 | 25730 | |
63ce7108 | 25731 | |
63ce7108 TT |
25732 | |
25733 | ||
25734 | ||
25735 | ||
6ec2e0f5 | 25736 | GNULIB_OPENAT=1 |
63ce7108 | 25737 | |
63ce7108 | 25738 | |
63ce7108 | 25739 | |
63ce7108 | 25740 | |
63ce7108 | 25741 | |
6ec2e0f5 | 25742 | $as_echo "#define GNULIB_TEST_OPENAT 1" >>confdefs.h |
63ce7108 TT |
25743 | |
25744 | ||
63ce7108 | 25745 | |
63ce7108 | 25746 | |
63ce7108 | 25747 | |
63ce7108 | 25748 | |
6ec2e0f5 SDJ |
25749 | for ac_func in opendir |
25750 | do : | |
25751 | ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir" | |
d0ac1c44 | 25752 | if test "x$ac_cv_func_opendir" = xyes; then : |
6ec2e0f5 SDJ |
25753 | cat >>confdefs.h <<_ACEOF |
25754 | #define HAVE_OPENDIR 1 | |
63ce7108 | 25755 | _ACEOF |
6ec2e0f5 | 25756 | |
63ce7108 | 25757 | fi |
6ec2e0f5 | 25758 | done |
63ce7108 | 25759 | |
6ec2e0f5 SDJ |
25760 | if test $ac_cv_func_opendir = no; then |
25761 | HAVE_OPENDIR=0 | |
25762 | fi | |
63ce7108 | 25763 | |
6ec2e0f5 SDJ |
25764 | |
25765 | ||
25766 | ||
25767 | if test $ac_cv_func_fchdir = no; then | |
25768 | HAVE_FCHDIR=0 | |
63ce7108 | 25769 | fi |
63ce7108 | 25770 | |
6ec2e0f5 SDJ |
25771 | if test $HAVE_FCHDIR = 0; then |
25772 | if test $HAVE_OPENDIR = 1; then | |
25773 | REPLACE_OPENDIR=1 | |
25774 | fi | |
25775 | fi | |
25776 | ||
25777 | case $host_os,$HAVE_OPENDIR in | |
25778 | os2*,1) | |
25779 | REPLACE_OPENDIR=1;; | |
25780 | esac | |
25781 | ||
25782 | if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then | |
63ce7108 TT |
25783 | |
25784 | ||
25785 | ||
25786 | ||
25787 | ||
25788 | ||
25789 | ||
25790 | ||
6ec2e0f5 | 25791 | gl_LIBOBJS="$gl_LIBOBJS opendir.$ac_objext" |
63ce7108 TT |
25792 | |
25793 | fi | |
25794 | ||
25795 | ||
25796 | ||
25797 | ||
25798 | ||
6ec2e0f5 | 25799 | GNULIB_OPENDIR=1 |
63ce7108 TT |
25800 | |
25801 | ||
25802 | ||
25803 | ||
63ce7108 | 25804 | |
6ec2e0f5 | 25805 | $as_echo "#define GNULIB_TEST_OPENDIR 1" >>confdefs.h |
63ce7108 TT |
25806 | |
25807 | ||
25808 | ||
25809 | ||
25810 | ||
25811 | ||
25812 | ||
2196f55f YQ |
25813 | |
25814 | ||
8424cc97 | 25815 | |
9c9d63b1 PM |
25816 | if test $ac_cv_func_pipe != yes; then |
25817 | HAVE_PIPE=0 | |
25818 | fi | |
25819 | ||
25820 | if test $HAVE_PIPE = 0; then | |
25821 | ||
25822 | ||
25823 | ||
25824 | ||
25825 | ||
25826 | ||
25827 | ||
25828 | ||
25829 | gl_LIBOBJS="$gl_LIBOBJS pipe.$ac_objext" | |
25830 | ||
25831 | fi | |
25832 | ||
25833 | ||
25834 | ||
25835 | ||
25836 | ||
25837 | GNULIB_PIPE=1 | |
25838 | ||
25839 | ||
25840 | ||
25841 | ||
25842 | ||
25843 | $as_echo "#define GNULIB_TEST_PIPE 1" >>confdefs.h | |
25844 | ||
25845 | ||
25846 | ||
25847 | ||
25848 | ||
25849 | ||
25850 | ||
8424cc97 SM |
25851 | for ac_func in rawmemchr |
25852 | do : | |
25853 | ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr" | |
d0ac1c44 | 25854 | if test "x$ac_cv_func_rawmemchr" = xyes; then : |
8424cc97 SM |
25855 | cat >>confdefs.h <<_ACEOF |
25856 | #define HAVE_RAWMEMCHR 1 | |
25857 | _ACEOF | |
25858 | ||
25859 | fi | |
25860 | done | |
25861 | ||
25862 | if test $ac_cv_func_rawmemchr = no; then | |
25863 | HAVE_RAWMEMCHR=0 | |
25864 | fi | |
25865 | ||
25866 | if test $HAVE_RAWMEMCHR = 0; then | |
25867 | ||
25868 | ||
25869 | ||
25870 | ||
25871 | ||
25872 | ||
25873 | ||
25874 | ||
25875 | gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext" | |
25876 | ||
25877 | : | |
25878 | fi | |
25879 | ||
25880 | ||
25881 | ||
25882 | ||
25883 | ||
25884 | GNULIB_RAWMEMCHR=1 | |
25885 | ||
25886 | ||
25887 | ||
25888 | ||
25889 | ||
25890 | $as_echo "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h | |
25891 | ||
25892 | ||
25893 | ||
25894 | ||
25895 | ||
25896 | ||
6ec2e0f5 SDJ |
25897 | for ac_func in readdir |
25898 | do : | |
25899 | ac_fn_c_check_func "$LINENO" "readdir" "ac_cv_func_readdir" | |
d0ac1c44 | 25900 | if test "x$ac_cv_func_readdir" = xyes; then : |
6ec2e0f5 SDJ |
25901 | cat >>confdefs.h <<_ACEOF |
25902 | #define HAVE_READDIR 1 | |
25903 | _ACEOF | |
25904 | ||
25905 | fi | |
25906 | done | |
25907 | ||
25908 | if test $ac_cv_func_readdir = no; then | |
25909 | HAVE_READDIR=0 | |
25910 | fi | |
25911 | ||
25912 | if test $HAVE_READDIR = 0; then | |
25913 | ||
25914 | ||
25915 | ||
25916 | ||
25917 | ||
25918 | ||
25919 | ||
25920 | ||
25921 | gl_LIBOBJS="$gl_LIBOBJS readdir.$ac_objext" | |
25922 | ||
25923 | fi | |
25924 | ||
25925 | ||
25926 | ||
25927 | ||
25928 | ||
25929 | GNULIB_READDIR=1 | |
25930 | ||
25931 | ||
25932 | ||
25933 | ||
25934 | ||
25935 | $as_echo "#define GNULIB_TEST_READDIR 1" >>confdefs.h | |
25936 | ||
25937 | ||
25938 | ||
25939 | ||
25940 | ||
25941 | ||
2196f55f YQ |
25942 | if test $ac_cv_func_readlink = no; then |
25943 | HAVE_READLINK=0 | |
25944 | else | |
25945 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5 | |
25946 | $as_echo_n "checking whether readlink signature is correct... " >&6; } | |
d0ac1c44 | 25947 | if ${gl_cv_decl_readlink_works+:} false; then : |
2196f55f YQ |
25948 | $as_echo_n "(cached) " >&6 |
25949 | else | |
25950 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25951 | /* end confdefs.h. */ | |
25952 | #include <unistd.h> | |
25953 | /* Cause compilation failure if original declaration has wrong type. */ | |
25954 | ssize_t readlink (const char *, char *, size_t); | |
25955 | int | |
25956 | main () | |
25957 | { | |
25958 | ||
25959 | ; | |
25960 | return 0; | |
25961 | } | |
25962 | _ACEOF | |
25963 | if ac_fn_c_try_compile "$LINENO"; then : | |
25964 | gl_cv_decl_readlink_works=yes | |
25965 | else | |
25966 | gl_cv_decl_readlink_works=no | |
25967 | fi | |
25968 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
25969 | fi | |
25970 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5 | |
25971 | $as_echo "$gl_cv_decl_readlink_works" >&6; } | |
25972 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5 | |
25973 | $as_echo_n "checking whether readlink handles trailing slash correctly... " >&6; } | |
9c9d63b1 | 25974 | if ${gl_cv_func_readlink_trailing_slash+:} false; then : |
2196f55f YQ |
25975 | $as_echo_n "(cached) " >&6 |
25976 | else | |
25977 | # We have readlink, so assume ln -s works. | |
25978 | ln -s conftest.no-such conftest.link | |
25979 | ln -s conftest.link conftest.lnk2 | |
25980 | if test "$cross_compiling" = yes; then : | |
25981 | case "$host_os" in | |
9c9d63b1 PM |
25982 | # Guess yes on Linux or glibc systems. |
25983 | linux-* | linux | *-gnu* | gnu*) | |
25984 | gl_cv_func_readlink_trailing_slash="guessing yes" ;; | |
25985 | # Guess no on AIX or HP-UX. | |
25986 | aix* | hpux*) | |
25987 | gl_cv_func_readlink_trailing_slash="guessing no" ;; | |
25988 | # If we don't know, obey --enable-cross-guesses. | |
25989 | *) | |
25990 | gl_cv_func_readlink_trailing_slash="$gl_cross_guess_normal" ;; | |
2196f55f YQ |
25991 | esac |
25992 | ||
25993 | else | |
25994 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25995 | /* end confdefs.h. */ | |
25996 | #include <unistd.h> | |
25997 | ||
25998 | int | |
25999 | main () | |
26000 | { | |
26001 | char buf[20]; | |
26002 | return readlink ("conftest.lnk2/", buf, sizeof buf) != -1; | |
26003 | ; | |
26004 | return 0; | |
26005 | } | |
26006 | _ACEOF | |
26007 | if ac_fn_c_try_run "$LINENO"; then : | |
9c9d63b1 | 26008 | gl_cv_func_readlink_trailing_slash=yes |
2196f55f | 26009 | else |
9c9d63b1 | 26010 | gl_cv_func_readlink_trailing_slash=no |
2196f55f YQ |
26011 | fi |
26012 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
26013 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
26014 | fi | |
26015 | ||
26016 | rm -f conftest.link conftest.lnk2 | |
26017 | fi | |
9c9d63b1 PM |
26018 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_trailing_slash" >&5 |
26019 | $as_echo "$gl_cv_func_readlink_trailing_slash" >&6; } | |
26020 | case "$gl_cv_func_readlink_trailing_slash" in | |
2196f55f YQ |
26021 | *yes) |
26022 | if test "$gl_cv_decl_readlink_works" != yes; then | |
26023 | REPLACE_READLINK=1 | |
26024 | fi | |
26025 | ;; | |
26026 | *) | |
26027 | ||
26028 | $as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h | |
26029 | ||
26030 | REPLACE_READLINK=1 | |
26031 | ;; | |
26032 | esac | |
9c9d63b1 PM |
26033 | |
26034 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink truncates results correctly" >&5 | |
26035 | $as_echo_n "checking whether readlink truncates results correctly... " >&6; } | |
26036 | if ${gl_cv_func_readlink_truncate+:} false; then : | |
26037 | $as_echo_n "(cached) " >&6 | |
26038 | else | |
26039 | # We have readlink, so assume ln -s works. | |
26040 | ln -s ab conftest.link | |
26041 | if test "$cross_compiling" = yes; then : | |
26042 | case "$host_os" in | |
26043 | # Guess yes on Linux or glibc systems. | |
26044 | linux-* | linux | *-gnu* | gnu*) | |
26045 | gl_cv_func_readlink_truncate="guessing yes" ;; | |
26046 | # Guess no on AIX or HP-UX. | |
26047 | aix* | hpux*) | |
26048 | gl_cv_func_readlink_truncate="guessing no" ;; | |
26049 | # If we don't know, obey --enable-cross-guesses. | |
26050 | *) | |
26051 | gl_cv_func_readlink_truncate="$gl_cross_guess_normal" ;; | |
26052 | esac | |
26053 | ||
26054 | else | |
26055 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26056 | /* end confdefs.h. */ | |
26057 | #include <unistd.h> | |
26058 | ||
26059 | int | |
26060 | main () | |
26061 | { | |
26062 | char c; | |
26063 | return readlink ("conftest.link", &c, 1) != 1; | |
26064 | ; | |
26065 | return 0; | |
26066 | } | |
26067 | _ACEOF | |
26068 | if ac_fn_c_try_run "$LINENO"; then : | |
26069 | gl_cv_func_readlink_truncate=yes | |
26070 | else | |
26071 | gl_cv_func_readlink_truncate=no | |
26072 | fi | |
26073 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
26074 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
26075 | fi | |
26076 | ||
26077 | rm -f conftest.link conftest.lnk2 | |
26078 | fi | |
26079 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_truncate" >&5 | |
26080 | $as_echo "$gl_cv_func_readlink_truncate" >&6; } | |
26081 | case $gl_cv_func_readlink_truncate in | |
26082 | *yes) | |
26083 | if test "$gl_cv_decl_readlink_works" != yes; then | |
26084 | REPLACE_READLINK=1 | |
26085 | fi | |
26086 | ;; | |
26087 | *) | |
26088 | ||
26089 | $as_echo "#define READLINK_TRUNCATE_BUG 1" >>confdefs.h | |
26090 | ||
26091 | REPLACE_READLINK=1 | |
26092 | ;; | |
26093 | esac | |
2196f55f YQ |
26094 | fi |
26095 | ||
26096 | if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then | |
26097 | ||
26098 | ||
26099 | ||
26100 | ||
26101 | ||
26102 | ||
26103 | ||
26104 | ||
26105 | gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext" | |
26106 | ||
26107 | ||
26108 | : | |
26109 | ||
26110 | fi | |
26111 | ||
26112 | ||
26113 | ||
26114 | ||
26115 | ||
26116 | GNULIB_READLINK=1 | |
26117 | ||
26118 | ||
26119 | ||
26120 | ||
26121 | ||
26122 | $as_echo "#define GNULIB_TEST_READLINK 1" >>confdefs.h | |
26123 | ||
26124 | ||
26125 | ||
26126 | ||
6a29c58e YQ |
26127 | |
26128 | ||
6ec2e0f5 SDJ |
26129 | if test $gl_cv_func_malloc_posix = yes; then |
26130 | ||
26131 | $as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h | |
26132 | ||
26133 | else | |
26134 | REPLACE_REALLOC=1 | |
26135 | fi | |
26136 | ||
26137 | if test $REPLACE_REALLOC = 1; then | |
26138 | ||
26139 | ||
26140 | ||
26141 | ||
26142 | ||
26143 | ||
26144 | ||
26145 | ||
26146 | gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext" | |
26147 | ||
26148 | fi | |
26149 | ||
26150 | ||
26151 | ||
26152 | ||
26153 | ||
26154 | GNULIB_REALLOC_POSIX=1 | |
26155 | ||
26156 | ||
26157 | ||
26158 | ||
26159 | ||
26160 | $as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h | |
26161 | ||
26162 | ||
26163 | ||
26164 | ||
26165 | ||
26166 | ||
6a29c58e YQ |
26167 | |
26168 | ||
26169 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on destination" >&5 | |
26170 | $as_echo_n "checking whether rename honors trailing slash on destination... " >&6; } | |
d0ac1c44 | 26171 | if ${gl_cv_func_rename_slash_dst_works+:} false; then : |
6a29c58e YQ |
26172 | $as_echo_n "(cached) " >&6 |
26173 | else | |
26174 | rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk | |
26175 | touch conftest.f && touch conftest.f1 && mkdir conftest.d1 || | |
d0ac1c44 | 26176 | as_fn_error $? "cannot create temporary files" "$LINENO" 5 |
6a29c58e YQ |
26177 | # Assume that if we have lstat, we can also check symlinks. |
26178 | if test $ac_cv_func_lstat = yes; then | |
26179 | ln -s conftest.f conftest.lnk | |
26180 | fi | |
26181 | if test "$cross_compiling" = yes; then : | |
26182 | case "$host_os" in | |
c0c3707f CB |
26183 | # Guess yes on Linux systems. |
26184 | linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;; | |
26185 | # Guess yes on glibc systems. | |
26186 | *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;; | |
26187 | # Guess no on native Windows. | |
26188 | mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;; | |
26189 | # If we don't know, obey --enable-cross-guesses. | |
26190 | *) gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;; | |
6a29c58e YQ |
26191 | esac |
26192 | ||
26193 | else | |
26194 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26195 | /* end confdefs.h. */ | |
26196 | ||
26197 | # include <stdio.h> | |
26198 | # include <stdlib.h> | |
26199 | ||
26200 | int | |
26201 | main () | |
26202 | { | |
26203 | int result = 0; | |
26204 | if (rename ("conftest.f1", "conftest.f2/") == 0) | |
26205 | result |= 1; | |
26206 | if (rename ("conftest.d1", "conftest.d2/") != 0) | |
26207 | result |= 2; | |
26208 | #if HAVE_LSTAT | |
26209 | if (rename ("conftest.f", "conftest.lnk/") == 0) | |
26210 | result |= 4; | |
26211 | #endif | |
26212 | return result; | |
26213 | ||
26214 | ; | |
26215 | return 0; | |
26216 | } | |
26217 | _ACEOF | |
26218 | if ac_fn_c_try_run "$LINENO"; then : | |
26219 | gl_cv_func_rename_slash_dst_works=yes | |
26220 | else | |
26221 | gl_cv_func_rename_slash_dst_works=no | |
26222 | fi | |
26223 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
26224 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
26225 | fi | |
26226 | ||
26227 | rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk | |
26228 | ||
26229 | fi | |
26230 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_dst_works" >&5 | |
26231 | $as_echo "$gl_cv_func_rename_slash_dst_works" >&6; } | |
26232 | case "$gl_cv_func_rename_slash_dst_works" in | |
26233 | *yes) ;; | |
26234 | *) | |
26235 | REPLACE_RENAME=1 | |
26236 | ||
26237 | $as_echo "#define RENAME_TRAILING_SLASH_DEST_BUG 1" >>confdefs.h | |
26238 | ||
26239 | ;; | |
26240 | esac | |
26241 | ||
26242 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on source" >&5 | |
26243 | $as_echo_n "checking whether rename honors trailing slash on source... " >&6; } | |
d0ac1c44 | 26244 | if ${gl_cv_func_rename_slash_src_works+:} false; then : |
6a29c58e YQ |
26245 | $as_echo_n "(cached) " >&6 |
26246 | else | |
26247 | rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk | |
26248 | touch conftest.f && touch conftest.f1 && mkdir conftest.d1 || | |
d0ac1c44 | 26249 | as_fn_error $? "cannot create temporary files" "$LINENO" 5 |
6a29c58e YQ |
26250 | # Assume that if we have lstat, we can also check symlinks. |
26251 | if test $ac_cv_func_lstat = yes; then | |
26252 | ln -s conftest.f conftest.lnk | |
26253 | fi | |
26254 | if test "$cross_compiling" = yes; then : | |
26255 | case "$host_os" in | |
c0c3707f CB |
26256 | # Guess yes on Linux systems. |
26257 | linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;; | |
26258 | # Guess yes on glibc systems. | |
26259 | *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;; | |
26260 | # Guess yes on native Windows. | |
26261 | mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;; | |
26262 | # If we don't know, obey --enable-cross-guesses. | |
26263 | *) gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;; | |
6a29c58e YQ |
26264 | esac |
26265 | ||
26266 | else | |
26267 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26268 | /* end confdefs.h. */ | |
26269 | ||
26270 | # include <stdio.h> | |
26271 | # include <stdlib.h> | |
26272 | ||
26273 | int | |
26274 | main () | |
26275 | { | |
26276 | int result = 0; | |
26277 | if (rename ("conftest.f1/", "conftest.d3") == 0) | |
26278 | result |= 1; | |
26279 | if (rename ("conftest.d1/", "conftest.d2") != 0) | |
26280 | result |= 2; | |
26281 | #if HAVE_LSTAT | |
26282 | if (rename ("conftest.lnk/", "conftest.f") == 0) | |
26283 | result |= 4; | |
26284 | #endif | |
26285 | return result; | |
26286 | ||
26287 | ; | |
26288 | return 0; | |
26289 | } | |
26290 | _ACEOF | |
26291 | if ac_fn_c_try_run "$LINENO"; then : | |
26292 | gl_cv_func_rename_slash_src_works=yes | |
26293 | else | |
26294 | gl_cv_func_rename_slash_src_works=no | |
26295 | fi | |
26296 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
26297 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
26298 | fi | |
26299 | ||
26300 | rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk | |
26301 | ||
26302 | fi | |
26303 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_src_works" >&5 | |
26304 | $as_echo "$gl_cv_func_rename_slash_src_works" >&6; } | |
26305 | case "$gl_cv_func_rename_slash_src_works" in | |
26306 | *yes) ;; | |
26307 | *) | |
26308 | REPLACE_RENAME=1 | |
26309 | ||
26310 | $as_echo "#define RENAME_TRAILING_SLASH_SOURCE_BUG 1" >>confdefs.h | |
26311 | ||
26312 | ;; | |
26313 | esac | |
26314 | ||
26315 | ||
26316 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages hard links correctly" >&5 | |
26317 | $as_echo_n "checking whether rename manages hard links correctly... " >&6; } | |
d0ac1c44 | 26318 | if ${gl_cv_func_rename_link_works+:} false; then : |
6a29c58e YQ |
26319 | $as_echo_n "(cached) " >&6 |
26320 | else | |
26321 | if test $ac_cv_func_link = yes; then | |
c0c3707f CB |
26322 | if test $cross_compiling != yes; then |
26323 | rm -rf conftest.f conftest.f1 conftest.f2 | |
26324 | if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 && | |
26325 | set x `ls -i conftest.f conftest.f1` && test "" = ""; then | |
26326 | if test "$cross_compiling" = yes; then : | |
26327 | : | |
6a29c58e YQ |
26328 | |
26329 | else | |
26330 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26331 | /* end confdefs.h. */ | |
26332 | ||
c0c3707f CB |
26333 | # include <errno.h> |
26334 | # include <stdio.h> | |
26335 | # include <stdlib.h> | |
26336 | # include <unistd.h> | |
6a29c58e | 26337 | |
9c9d63b1 PM |
26338 | |
26339 | $gl_mda_defines | |
26340 | ||
6a29c58e YQ |
26341 | int |
26342 | main () | |
26343 | { | |
26344 | int result = 0; | |
c0c3707f CB |
26345 | if (rename ("conftest.f", "conftest.f1")) |
26346 | result |= 1; | |
26347 | if (unlink ("conftest.f1")) | |
26348 | result |= 2; | |
26349 | ||
26350 | /* Allow either the POSIX-required behavior, where the | |
26351 | previous rename kept conftest.f, or the (better) NetBSD | |
26352 | behavior, where it removed conftest.f. */ | |
26353 | if (rename ("conftest.f", "conftest.f") != 0 | |
26354 | && errno != ENOENT) | |
26355 | result |= 4; | |
26356 | ||
26357 | if (rename ("conftest.f1", "conftest.f1") == 0) | |
26358 | result |= 8; | |
26359 | if (rename ("conftest.f2", "conftest.f2") != 0) | |
26360 | result |= 16; | |
26361 | return result; | |
6a29c58e YQ |
26362 | |
26363 | ; | |
26364 | return 0; | |
26365 | } | |
26366 | _ACEOF | |
26367 | if ac_fn_c_try_run "$LINENO"; then : | |
26368 | gl_cv_func_rename_link_works=yes | |
26369 | else | |
26370 | gl_cv_func_rename_link_works=no | |
26371 | fi | |
26372 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
26373 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
26374 | fi | |
26375 | ||
c0c3707f CB |
26376 | else |
26377 | gl_cv_func_rename_link_works="guessing no" | |
26378 | fi | |
26379 | rm -rf conftest.f conftest.f1 conftest.f2 | |
6a29c58e | 26380 | else |
c0c3707f CB |
26381 | case "$host_os" in |
26382 | # Guess yes on Linux systems. | |
26383 | linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;; | |
26384 | # Guess yes on glibc systems. | |
26385 | *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;; | |
26386 | # Guess yes on native Windows. | |
26387 | mingw*) gl_cv_func_rename_link_works="guessing yes" ;; | |
26388 | # If we don't know, obey --enable-cross-guesses. | |
26389 | *) gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;; | |
26390 | esac | |
6a29c58e | 26391 | fi |
6a29c58e YQ |
26392 | else |
26393 | gl_cv_func_rename_link_works=yes | |
26394 | fi | |
26395 | ||
26396 | fi | |
26397 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_link_works" >&5 | |
26398 | $as_echo "$gl_cv_func_rename_link_works" >&6; } | |
26399 | case "$gl_cv_func_rename_link_works" in | |
26400 | *yes) ;; | |
26401 | *) | |
26402 | REPLACE_RENAME=1 | |
26403 | ||
26404 | $as_echo "#define RENAME_HARD_LINK_BUG 1" >>confdefs.h | |
26405 | ||
26406 | ;; | |
26407 | esac | |
26408 | ||
26409 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages existing destinations correctly" >&5 | |
26410 | $as_echo_n "checking whether rename manages existing destinations correctly... " >&6; } | |
d0ac1c44 | 26411 | if ${gl_cv_func_rename_dest_works+:} false; then : |
6a29c58e YQ |
26412 | $as_echo_n "(cached) " >&6 |
26413 | else | |
26414 | rm -rf conftest.f conftest.d1 conftest.d2 | |
26415 | touch conftest.f && mkdir conftest.d1 conftest.d2 || | |
d0ac1c44 | 26416 | as_fn_error $? "cannot create temporary files" "$LINENO" 5 |
6a29c58e YQ |
26417 | if test "$cross_compiling" = yes; then : |
26418 | case "$host_os" in | |
c0c3707f CB |
26419 | # Guess yes on Linux systems. |
26420 | linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;; | |
26421 | # Guess yes on glibc systems. | |
26422 | *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;; | |
26423 | # Guess no on native Windows. | |
26424 | mingw*) gl_cv_func_rename_dest_works="guessing no" ;; | |
26425 | # If we don't know, obey --enable-cross-guesses. | |
26426 | *) gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;; | |
6a29c58e YQ |
26427 | esac |
26428 | ||
26429 | else | |
26430 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26431 | /* end confdefs.h. */ | |
26432 | ||
26433 | # include <stdio.h> | |
26434 | # include <stdlib.h> | |
26435 | ||
26436 | int | |
26437 | main () | |
26438 | { | |
26439 | int result = 0; | |
26440 | if (rename ("conftest.d1", "conftest.d2") != 0) | |
26441 | result |= 1; | |
26442 | if (rename ("conftest.d2", "conftest.f") == 0) | |
26443 | result |= 2; | |
26444 | return result; | |
26445 | ||
26446 | ; | |
26447 | return 0; | |
26448 | } | |
26449 | _ACEOF | |
26450 | if ac_fn_c_try_run "$LINENO"; then : | |
26451 | gl_cv_func_rename_dest_works=yes | |
26452 | else | |
26453 | gl_cv_func_rename_dest_works=no | |
26454 | fi | |
26455 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
26456 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
26457 | fi | |
26458 | ||
26459 | rm -rf conftest.f conftest.d1 conftest.d2 | |
26460 | ||
26461 | fi | |
26462 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_dest_works" >&5 | |
26463 | $as_echo "$gl_cv_func_rename_dest_works" >&6; } | |
26464 | case "$gl_cv_func_rename_dest_works" in | |
26465 | *yes) ;; | |
26466 | *) | |
26467 | REPLACE_RENAME=1 | |
26468 | ||
26469 | $as_echo "#define RENAME_DEST_EXISTS_BUG 1" >>confdefs.h | |
26470 | ||
26471 | ;; | |
26472 | esac | |
26473 | ||
26474 | if test $REPLACE_RENAME = 1; then | |
26475 | ||
26476 | ||
26477 | ||
26478 | ||
26479 | ||
26480 | ||
26481 | ||
26482 | ||
26483 | gl_LIBOBJS="$gl_LIBOBJS rename.$ac_objext" | |
26484 | ||
26485 | fi | |
26486 | ||
26487 | ||
26488 | ||
26489 | ||
26490 | ||
26491 | GNULIB_RENAME=1 | |
26492 | ||
26493 | ||
26494 | ||
26495 | ||
26496 | ||
26497 | $as_echo "#define GNULIB_TEST_RENAME 1" >>confdefs.h | |
26498 | ||
26499 | ||
26500 | ||
26501 | ||
26502 | ||
26503 | ||
6ec2e0f5 SDJ |
26504 | for ac_func in rewinddir |
26505 | do : | |
26506 | ac_fn_c_check_func "$LINENO" "rewinddir" "ac_cv_func_rewinddir" | |
d0ac1c44 | 26507 | if test "x$ac_cv_func_rewinddir" = xyes; then : |
6ec2e0f5 SDJ |
26508 | cat >>confdefs.h <<_ACEOF |
26509 | #define HAVE_REWINDDIR 1 | |
26510 | _ACEOF | |
26511 | ||
26512 | fi | |
26513 | done | |
26514 | ||
26515 | if test $ac_cv_func_rewinddir = no; then | |
26516 | HAVE_REWINDDIR=0 | |
26517 | fi | |
26518 | ||
26519 | if test $HAVE_REWINDDIR = 0; then | |
26520 | ||
26521 | ||
26522 | ||
26523 | ||
26524 | ||
26525 | ||
26526 | ||
26527 | ||
26528 | gl_LIBOBJS="$gl_LIBOBJS rewinddir.$ac_objext" | |
26529 | ||
26530 | fi | |
26531 | ||
26532 | ||
26533 | ||
26534 | ||
26535 | ||
26536 | GNULIB_REWINDDIR=1 | |
26537 | ||
26538 | ||
26539 | ||
26540 | ||
26541 | ||
26542 | $as_echo "#define GNULIB_TEST_REWINDDIR 1" >>confdefs.h | |
26543 | ||
26544 | ||
26545 | ||
26546 | ||
26547 | ||
26548 | ||
6a29c58e YQ |
26549 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rmdir works" >&5 |
26550 | $as_echo_n "checking whether rmdir works... " >&6; } | |
d0ac1c44 | 26551 | if ${gl_cv_func_rmdir_works+:} false; then : |
6a29c58e YQ |
26552 | $as_echo_n "(cached) " >&6 |
26553 | else | |
26554 | mkdir conftest.dir | |
26555 | touch conftest.file | |
26556 | if test "$cross_compiling" = yes; then : | |
26557 | case "$host_os" in | |
c0c3707f CB |
26558 | # Guess yes on Linux systems. |
26559 | linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;; | |
26560 | # Guess yes on glibc systems. | |
26561 | *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;; | |
26562 | # Guess no on native Windows. | |
26563 | mingw*) gl_cv_func_rmdir_works="guessing no" ;; | |
26564 | # If we don't know, obey --enable-cross-guesses. | |
26565 | *) gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;; | |
6a29c58e YQ |
26566 | esac |
26567 | ||
26568 | else | |
26569 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26570 | /* end confdefs.h. */ | |
26571 | #include <stdio.h> | |
26572 | #include <errno.h> | |
26573 | #if HAVE_UNISTD_H | |
26574 | # include <unistd.h> | |
26575 | #else /* on Windows with MSVC */ | |
26576 | # include <direct.h> | |
26577 | #endif | |
26578 | ||
9c9d63b1 PM |
26579 | |
26580 | $gl_mda_defines | |
26581 | ||
6a29c58e YQ |
26582 | int |
26583 | main () | |
26584 | { | |
26585 | int result = 0; | |
9c9d63b1 PM |
26586 | if (!rmdir ("conftest.file/")) |
26587 | result |= 1; | |
26588 | else if (errno != ENOTDIR) | |
26589 | result |= 2; | |
26590 | if (!rmdir ("conftest.dir/./")) | |
26591 | result |= 4; | |
26592 | return result; | |
6a29c58e YQ |
26593 | |
26594 | ; | |
26595 | return 0; | |
26596 | } | |
26597 | _ACEOF | |
26598 | if ac_fn_c_try_run "$LINENO"; then : | |
26599 | gl_cv_func_rmdir_works=yes | |
26600 | else | |
26601 | gl_cv_func_rmdir_works=no | |
26602 | fi | |
26603 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
26604 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
26605 | fi | |
26606 | ||
26607 | rm -rf conftest.dir conftest.file | |
26608 | fi | |
26609 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_works" >&5 | |
26610 | $as_echo "$gl_cv_func_rmdir_works" >&6; } | |
26611 | case "$gl_cv_func_rmdir_works" in | |
26612 | *yes) ;; | |
26613 | *) | |
26614 | REPLACE_RMDIR=1 | |
26615 | ;; | |
26616 | esac | |
26617 | ||
26618 | if test $REPLACE_RMDIR = 1; then | |
26619 | ||
26620 | ||
26621 | ||
26622 | ||
26623 | ||
26624 | ||
26625 | ||
26626 | ||
26627 | gl_LIBOBJS="$gl_LIBOBJS rmdir.$ac_objext" | |
26628 | ||
26629 | fi | |
26630 | ||
26631 | ||
26632 | ||
26633 | ||
26634 | ||
26635 | GNULIB_RMDIR=1 | |
26636 | ||
26637 | ||
26638 | ||
26639 | ||
26640 | ||
26641 | $as_echo "#define GNULIB_TEST_RMDIR 1" >>confdefs.h | |
26642 | ||
26643 | ||
26644 | ||
26645 | ||
0750520d | 26646 | |
5e8754f9 SDJ |
26647 | |
26648 | ||
26649 | ||
3d99e817 AK |
26650 | if test $ac_cv_func_setenv = no; then |
26651 | HAVE_SETENV=0 | |
26652 | else | |
26653 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5 | |
26654 | $as_echo_n "checking whether setenv validates arguments... " >&6; } | |
d0ac1c44 | 26655 | if ${gl_cv_func_setenv_works+:} false; then : |
3d99e817 AK |
26656 | $as_echo_n "(cached) " >&6 |
26657 | else | |
26658 | if test "$cross_compiling" = yes; then : | |
26659 | case "$host_os" in | |
c0c3707f CB |
26660 | # Guess yes on glibc systems. |
26661 | *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;; | |
26662 | # Guess yes on musl systems. | |
26663 | *-musl*) gl_cv_func_setenv_works="guessing yes" ;; | |
26664 | # If we don't know, obey --enable-cross-guesses. | |
26665 | *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;; | |
3d99e817 AK |
26666 | esac |
26667 | ||
26668 | else | |
26669 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26670 | /* end confdefs.h. */ | |
26671 | ||
26672 | #include <stdlib.h> | |
26673 | #include <errno.h> | |
26674 | #include <string.h> | |
26675 | ||
26676 | int | |
26677 | main () | |
26678 | { | |
26679 | ||
26680 | int result = 0; | |
26681 | { | |
26682 | if (setenv ("", "", 0) != -1) | |
26683 | result |= 1; | |
26684 | else if (errno != EINVAL) | |
26685 | result |= 2; | |
26686 | } | |
26687 | { | |
26688 | if (setenv ("a", "=", 1) != 0) | |
26689 | result |= 4; | |
26690 | else if (strcmp (getenv ("a"), "=") != 0) | |
26691 | result |= 8; | |
26692 | } | |
26693 | return result; | |
26694 | ||
26695 | ; | |
26696 | return 0; | |
26697 | } | |
26698 | _ACEOF | |
26699 | if ac_fn_c_try_run "$LINENO"; then : | |
26700 | gl_cv_func_setenv_works=yes | |
26701 | else | |
26702 | gl_cv_func_setenv_works=no | |
26703 | fi | |
26704 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
26705 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
26706 | fi | |
26707 | ||
26708 | fi | |
26709 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5 | |
26710 | $as_echo "$gl_cv_func_setenv_works" >&6; } | |
26711 | case "$gl_cv_func_setenv_works" in | |
26712 | *yes) ;; | |
26713 | *) | |
26714 | REPLACE_SETENV=1 | |
26715 | ;; | |
26716 | esac | |
26717 | fi | |
26718 | ||
26719 | if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then | |
26720 | ||
26721 | ||
26722 | ||
26723 | ||
26724 | ||
26725 | ||
26726 | ||
26727 | ||
26728 | gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext" | |
26729 | ||
26730 | fi | |
26731 | ||
26732 | ||
26733 | ||
26734 | ||
26735 | ||
26736 | GNULIB_SETENV=1 | |
26737 | ||
26738 | ||
26739 | ||
26740 | ||
26741 | ||
26742 | $as_echo "#define GNULIB_TEST_SETENV 1" >>confdefs.h | |
26743 | ||
26744 | ||
26745 | ||
26746 | ||
26747 | ||
0750520d PA |
26748 | |
26749 | ||
26750 | ||
5df4cba6 SM |
26751 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5 |
26752 | $as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; } | |
26753 | if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then : | |
26754 | $as_echo_n "(cached) " >&6 | |
26755 | else | |
26756 | case "$host_os" in | |
26757 | # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin. | |
26758 | *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*) | |
26759 | gl_cv_func_setlocale_null_all_mtsafe=no ;; | |
26760 | # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows. | |
26761 | *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*) | |
26762 | gl_cv_func_setlocale_null_all_mtsafe=yes ;; | |
26763 | # If we don't know, obey --enable-cross-guesses. | |
26764 | *) | |
26765 | gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;; | |
26766 | esac | |
26767 | ||
26768 | fi | |
26769 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5 | |
26770 | $as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; } | |
26771 | case "$host_os" in | |
26772 | mingw*) ;; | |
26773 | *) | |
26774 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then | |
26775 | gl_cv_func_setlocale_null_all_mtsafe="trivially yes" | |
26776 | fi | |
26777 | ;; | |
26778 | esac | |
26779 | case "$gl_cv_func_setlocale_null_all_mtsafe" in | |
26780 | *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;; | |
26781 | *) SETLOCALE_NULL_ALL_MTSAFE=0 ;; | |
26782 | esac | |
26783 | ||
26784 | cat >>confdefs.h <<_ACEOF | |
26785 | #define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE | |
26786 | _ACEOF | |
26787 | ||
26788 | ||
26789 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5 | |
26790 | $as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; } | |
26791 | if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then : | |
26792 | $as_echo_n "(cached) " >&6 | |
26793 | else | |
26794 | case "$host_os" in | |
26795 | # Guess no on OpenBSD, AIX. | |
26796 | openbsd* | aix*) | |
26797 | gl_cv_func_setlocale_null_one_mtsafe=no ;; | |
26798 | # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows. | |
26799 | *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*) | |
26800 | gl_cv_func_setlocale_null_one_mtsafe=yes ;; | |
26801 | # If we don't know, obey --enable-cross-guesses. | |
26802 | *) | |
26803 | gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;; | |
26804 | esac | |
26805 | ||
26806 | fi | |
26807 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5 | |
26808 | $as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; } | |
26809 | case "$host_os" in | |
26810 | mingw*) ;; | |
26811 | *) | |
26812 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then | |
26813 | gl_cv_func_setlocale_null_one_mtsafe="trivially yes" | |
26814 | fi | |
26815 | ;; | |
26816 | esac | |
26817 | case "$gl_cv_func_setlocale_null_one_mtsafe" in | |
26818 | *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;; | |
26819 | *) SETLOCALE_NULL_ONE_MTSAFE=0 ;; | |
26820 | esac | |
26821 | ||
26822 | cat >>confdefs.h <<_ACEOF | |
26823 | #define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE | |
26824 | _ACEOF | |
26825 | ||
26826 | ||
26827 | if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then | |
26828 | case "$host_os" in | |
26829 | mingw*) LIB_SETLOCALE_NULL= ;; | |
26830 | *) | |
26831 | ||
26832 | ||
26833 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 | |
26834 | $as_echo_n "checking whether imported symbols can be declared weak... " >&6; } | |
26835 | if ${gl_cv_have_weak+:} false; then : | |
26836 | $as_echo_n "(cached) " >&6 | |
26837 | else | |
26838 | gl_cv_have_weak=no | |
26839 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26840 | /* end confdefs.h. */ | |
26841 | extern void xyzzy (); | |
26842 | #pragma weak xyzzy | |
26843 | int | |
26844 | main () | |
26845 | { | |
26846 | xyzzy(); | |
26847 | ; | |
26848 | return 0; | |
26849 | } | |
26850 | _ACEOF | |
26851 | if ac_fn_c_try_link "$LINENO"; then : | |
26852 | gl_cv_have_weak=maybe | |
26853 | fi | |
26854 | rm -f core conftest.err conftest.$ac_objext \ | |
26855 | conftest$ac_exeext conftest.$ac_ext | |
26856 | if test $gl_cv_have_weak = maybe; then | |
26857 | if test "$cross_compiling" = yes; then : | |
26858 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26859 | /* end confdefs.h. */ | |
26860 | #ifdef __ELF__ | |
26861 | Extensible Linking Format | |
26862 | #endif | |
26863 | ||
26864 | _ACEOF | |
26865 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
26866 | $EGREP "Extensible Linking Format" >/dev/null 2>&1; then : | |
26867 | gl_cv_have_weak="guessing yes" | |
26868 | else | |
26869 | gl_cv_have_weak="guessing no" | |
26870 | fi | |
26871 | rm -f conftest* | |
26872 | ||
26873 | ||
26874 | else | |
26875 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26876 | /* end confdefs.h. */ | |
26877 | ||
26878 | #include <stdio.h> | |
26879 | #pragma weak fputs | |
26880 | int main () | |
26881 | { | |
26882 | return (fputs == NULL); | |
26883 | } | |
26884 | _ACEOF | |
26885 | if ac_fn_c_try_run "$LINENO"; then : | |
26886 | gl_cv_have_weak=yes | |
26887 | else | |
26888 | gl_cv_have_weak=no | |
26889 | fi | |
26890 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
26891 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
26892 | fi | |
26893 | ||
26894 | fi | |
26895 | case " $LDFLAGS " in | |
26896 | *" -static "*) gl_cv_have_weak=no ;; | |
26897 | esac | |
26898 | case "$gl_cv_have_weak" in | |
26899 | *yes) | |
26900 | case "$host_os" in | |
26901 | freebsd* | dragonfly*) | |
26902 | : > conftest1.c | |
26903 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1 | |
26904 | cat <<EOF > conftest2.c | |
26905 | #include <pthread.h> | |
26906 | #pragma weak pthread_mutexattr_gettype | |
26907 | int main () | |
26908 | { | |
26909 | return (pthread_mutexattr_gettype != NULL); | |
26910 | } | |
26911 | EOF | |
26912 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \ | |
26913 | || gl_cv_have_weak=no | |
26914 | rm -f conftest1.c libempty.so conftest2.c conftest | |
26915 | ;; | |
26916 | esac | |
26917 | ;; | |
26918 | esac | |
26919 | ||
26920 | fi | |
26921 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 | |
26922 | $as_echo "$gl_cv_have_weak" >&6; } | |
26923 | case "$gl_cv_have_weak" in | |
26924 | *yes) | |
26925 | ||
26926 | $as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h | |
26927 | ||
26928 | ;; | |
26929 | esac | |
26930 | ||
26931 | case "$gl_cv_have_weak" in | |
26932 | *yes) LIB_SETLOCALE_NULL= ;; | |
26933 | *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;; | |
26934 | esac | |
26935 | ;; | |
26936 | esac | |
26937 | else | |
26938 | LIB_SETLOCALE_NULL= | |
26939 | fi | |
26940 | ||
26941 | ||
26942 | if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then | |
26943 | ||
26944 | ||
26945 | ||
26946 | ||
26947 | ||
26948 | ||
26949 | ||
26950 | ||
26951 | gl_LIBOBJS="$gl_LIBOBJS setlocale-lock.$ac_objext" | |
26952 | ||
26953 | ||
26954 | ||
26955 | ||
26956 | CFLAG_VISIBILITY= | |
26957 | HAVE_VISIBILITY=0 | |
26958 | if test -n "$GCC"; then | |
26959 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5 | |
26960 | $as_echo_n "checking whether the -Werror option is usable... " >&6; } | |
26961 | if ${gl_cv_cc_vis_werror+:} false; then : | |
26962 | $as_echo_n "(cached) " >&6 | |
26963 | else | |
26964 | gl_save_CFLAGS="$CFLAGS" | |
26965 | CFLAGS="$CFLAGS -Werror" | |
26966 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26967 | /* end confdefs.h. */ | |
26968 | ||
26969 | int | |
26970 | main () | |
26971 | { | |
26972 | ||
26973 | ; | |
26974 | return 0; | |
26975 | } | |
26976 | _ACEOF | |
26977 | if ac_fn_c_try_compile "$LINENO"; then : | |
26978 | gl_cv_cc_vis_werror=yes | |
26979 | else | |
26980 | gl_cv_cc_vis_werror=no | |
26981 | fi | |
26982 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
26983 | CFLAGS="$gl_save_CFLAGS" | |
26984 | ||
26985 | fi | |
26986 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5 | |
26987 | $as_echo "$gl_cv_cc_vis_werror" >&6; } | |
26988 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5 | |
26989 | $as_echo_n "checking for simple visibility declarations... " >&6; } | |
26990 | if ${gl_cv_cc_visibility+:} false; then : | |
26991 | $as_echo_n "(cached) " >&6 | |
26992 | else | |
26993 | gl_save_CFLAGS="$CFLAGS" | |
26994 | CFLAGS="$CFLAGS -fvisibility=hidden" | |
26995 | if test $gl_cv_cc_vis_werror = yes; then | |
26996 | CFLAGS="$CFLAGS -Werror" | |
26997 | fi | |
26998 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26999 | /* end confdefs.h. */ | |
27000 | extern __attribute__((__visibility__("hidden"))) int hiddenvar; | |
27001 | extern __attribute__((__visibility__("default"))) int exportedvar; | |
27002 | extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); | |
27003 | extern __attribute__((__visibility__("default"))) int exportedfunc (void); | |
27004 | void dummyfunc (void) {} | |
27005 | ||
27006 | int | |
27007 | main () | |
27008 | { | |
27009 | ||
27010 | ; | |
27011 | return 0; | |
27012 | } | |
27013 | _ACEOF | |
27014 | if ac_fn_c_try_compile "$LINENO"; then : | |
27015 | gl_cv_cc_visibility=yes | |
27016 | else | |
27017 | gl_cv_cc_visibility=no | |
27018 | fi | |
27019 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
27020 | CFLAGS="$gl_save_CFLAGS" | |
27021 | ||
27022 | fi | |
27023 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5 | |
27024 | $as_echo "$gl_cv_cc_visibility" >&6; } | |
27025 | if test $gl_cv_cc_visibility = yes; then | |
27026 | CFLAG_VISIBILITY="-fvisibility=hidden" | |
27027 | HAVE_VISIBILITY=1 | |
27028 | fi | |
27029 | fi | |
27030 | ||
27031 | ||
27032 | ||
27033 | cat >>confdefs.h <<_ACEOF | |
27034 | #define HAVE_VISIBILITY $HAVE_VISIBILITY | |
27035 | _ACEOF | |
27036 | ||
27037 | ||
27038 | ||
27039 | fi | |
27040 | ||
27041 | ||
27042 | ||
27043 | ||
27044 | ||
27045 | GNULIB_SETLOCALE_NULL=1 | |
27046 | ||
27047 | ||
27048 | ||
27049 | ||
27050 | ||
27051 | $as_echo "#define GNULIB_TEST_SETLOCALE_NULL 1" >>confdefs.h | |
27052 | ||
27053 | ||
27054 | ||
27055 | ||
27056 | ||
27057 | ||
27058 | ||
27059 | ||
0750520d PA |
27060 | |
27061 | ||
27062 | ||
27063 | ||
27064 | ||
27065 | ||
27066 | if test $gl_cv_have_include_next = yes; then | |
27067 | gl_cv_next_signal_h='<'signal.h'>' | |
27068 | else | |
27069 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5 | |
27070 | $as_echo_n "checking absolute name of <signal.h>... " >&6; } | |
d0ac1c44 | 27071 | if ${gl_cv_next_signal_h+:} false; then : |
0750520d PA |
27072 | $as_echo_n "(cached) " >&6 |
27073 | else | |
27074 | ||
27075 | ||
27076 | ||
27077 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27078 | /* end confdefs.h. */ | |
27079 | #include <signal.h> | |
27080 | _ACEOF | |
27081 | case "$host_os" in | |
27082 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
27083 | *) gl_absname_cpp="$ac_cpp" ;; | |
27084 | esac | |
27085 | ||
27086 | case "$host_os" in | |
27087 | mingw*) | |
27088 | gl_dirsep_regex='[/\\]' | |
27089 | ;; | |
27090 | *) | |
27091 | gl_dirsep_regex='\/' | |
27092 | ;; | |
27093 | esac | |
27094 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
27095 | gl_header_literal_regex=`echo 'signal.h' \ | |
27096 | | sed -e "$gl_make_literal_regex_sed"` | |
27097 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
27098 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
27099 | s|^/[^/]|//&| | |
27100 | p | |
27101 | q | |
27102 | }' | |
27103 | ||
27104 | gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
27105 | sed -n "$gl_absolute_header_sed"` | |
27106 | ||
27107 | gl_header=$gl_cv_absolute_signal_h | |
27108 | gl_cv_next_signal_h='"'$gl_header'"' | |
27109 | ||
27110 | ||
27111 | fi | |
27112 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5 | |
27113 | $as_echo "$gl_cv_next_signal_h" >&6; } | |
27114 | fi | |
27115 | NEXT_SIGNAL_H=$gl_cv_next_signal_h | |
27116 | ||
27117 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
27118 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
27119 | gl_next_as_first_directive='<'signal.h'>' | |
27120 | else | |
27121 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
27122 | gl_next_as_first_directive=$gl_cv_next_signal_h | |
27123 | fi | |
27124 | NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive | |
27125 | ||
27126 | ||
27127 | ||
27128 | ||
27129 | ||
27130 | # AIX declares sig_atomic_t to already include volatile, and C89 compilers | |
27131 | # then choke on 'volatile sig_atomic_t'. C99 requires that it compile. | |
27132 | ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" " | |
27133 | #include <signal.h> | |
27134 | ||
27135 | " | |
d0ac1c44 | 27136 | if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes; then : |
0750520d PA |
27137 | |
27138 | else | |
27139 | HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0 | |
27140 | fi | |
27141 | ||
27142 | ||
27143 | ||
27144 | ||
27145 | ||
27146 | ||
27147 | ||
27148 | ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" " | |
27149 | #include <signal.h> | |
27150 | ||
27151 | " | |
d0ac1c44 | 27152 | if test "x$ac_cv_type_sighandler_t" = xyes; then : |
0750520d PA |
27153 | |
27154 | else | |
27155 | HAVE_SIGHANDLER_T=0 | |
27156 | fi | |
27157 | ||
27158 | ||
27159 | ||
0750520d | 27160 | |
0750520d PA |
27161 | |
27162 | ||
698be2d8 CB |
27163 | |
27164 | ||
725e2999 JB |
27165 | ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " |
27166 | /* <sys/types.h> is not needed according to POSIX, but the | |
27167 | <sys/socket.h> in i386-unknown-freebsd4.10 and | |
27168 | powerpc-apple-darwin5.5 required it. */ | |
27169 | #include <sys/types.h> | |
27170 | #if HAVE_SYS_SOCKET_H | |
27171 | # include <sys/socket.h> | |
27172 | #elif HAVE_WS2TCPIP_H | |
27173 | # include <ws2tcpip.h> | |
27174 | #endif | |
27175 | ||
27176 | " | |
27177 | if test "x$ac_cv_type_socklen_t" = xyes; then : | |
27178 | ||
27179 | else | |
27180 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 | |
27181 | $as_echo_n "checking for socklen_t equivalent... " >&6; } | |
c0c3707f | 27182 | if ${gl_cv_socklen_t_equiv+:} false; then : |
725e2999 JB |
27183 | $as_echo_n "(cached) " >&6 |
27184 | else | |
27185 | # Systems have either "struct sockaddr *" or | |
27186 | # "void *" as the second argument to getpeername | |
27187 | gl_cv_socklen_t_equiv= | |
27188 | for arg2 in "struct sockaddr" void; do | |
27189 | for t in int size_t "unsigned int" "long int" "unsigned long int"; do | |
27190 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27191 | /* end confdefs.h. */ | |
27192 | #include <sys/types.h> | |
27193 | #include <sys/socket.h> | |
27194 | ||
27195 | int getpeername (int, $arg2 *, $t *); | |
27196 | int | |
27197 | main () | |
27198 | { | |
27199 | $t len; | |
27200 | getpeername (0, 0, &len); | |
27201 | ; | |
27202 | return 0; | |
27203 | } | |
27204 | _ACEOF | |
27205 | if ac_fn_c_try_compile "$LINENO"; then : | |
27206 | gl_cv_socklen_t_equiv="$t" | |
27207 | fi | |
27208 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
27209 | test "$gl_cv_socklen_t_equiv" != "" && break | |
27210 | done | |
27211 | test "$gl_cv_socklen_t_equiv" != "" && break | |
27212 | done | |
c0c3707f CB |
27213 | if test "$gl_cv_socklen_t_equiv" = ""; then |
27214 | as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5 | |
27215 | fi | |
725e2999 JB |
27216 | |
27217 | fi | |
c0c3707f | 27218 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5 |
725e2999 JB |
27219 | $as_echo "$gl_cv_socklen_t_equiv" >&6; } |
27220 | ||
27221 | cat >>confdefs.h <<_ACEOF | |
27222 | #define socklen_t $gl_cv_socklen_t_equiv | |
27223 | _ACEOF | |
27224 | ||
27225 | fi | |
27226 | ||
0750520d | 27227 | |
63ce7108 TT |
27228 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 |
27229 | $as_echo_n "checking for ssize_t... " >&6; } | |
d0ac1c44 | 27230 | if ${gt_cv_ssize_t+:} false; then : |
63ce7108 TT |
27231 | $as_echo_n "(cached) " >&6 |
27232 | else | |
27233 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27234 | /* end confdefs.h. */ | |
27235 | #include <sys/types.h> | |
27236 | int | |
27237 | main () | |
27238 | { | |
27239 | int x = sizeof (ssize_t *) + sizeof (ssize_t); | |
27240 | return !x; | |
27241 | ; | |
27242 | return 0; | |
27243 | } | |
27244 | _ACEOF | |
27245 | if ac_fn_c_try_compile "$LINENO"; then : | |
27246 | gt_cv_ssize_t=yes | |
27247 | else | |
27248 | gt_cv_ssize_t=no | |
27249 | fi | |
27250 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
27251 | fi | |
27252 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 | |
27253 | $as_echo "$gt_cv_ssize_t" >&6; } | |
27254 | if test $gt_cv_ssize_t = no; then | |
27255 | ||
27256 | $as_echo "#define ssize_t int" >>confdefs.h | |
27257 | ||
27258 | fi | |
27259 | ||
27260 | ||
27261 | ||
27262 | ||
472fa5ee | 27263 | |
c0c3707f CB |
27264 | case "$host_os" in |
27265 | mingw*) | |
d706b69e | 27266 | ;; |
c0c3707f CB |
27267 | *) |
27268 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 | |
27269 | $as_echo_n "checking whether stat handles trailing slashes on files... " >&6; } | |
27270 | if ${gl_cv_func_stat_file_slash+:} false; then : | |
2196f55f YQ |
27271 | $as_echo_n "(cached) " >&6 |
27272 | else | |
c0c3707f CB |
27273 | touch conftest.tmp |
27274 | # Assume that if we have lstat, we can also check symlinks. | |
27275 | if test $ac_cv_func_lstat = yes; then | |
27276 | ln -s conftest.tmp conftest.lnk | |
27277 | fi | |
27278 | if test "$cross_compiling" = yes; then : | |
27279 | case "$host_os" in | |
27280 | # Guess yes on Linux systems. | |
27281 | linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;; | |
27282 | # Guess yes on glibc systems. | |
27283 | *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; | |
27284 | # If we don't know, obey --enable-cross-guesses. | |
27285 | *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;; | |
27286 | esac | |
27287 | ||
2196f55f YQ |
27288 | else |
27289 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27290 | /* end confdefs.h. */ | |
27291 | #include <sys/stat.h> | |
27292 | ||
27293 | int | |
27294 | main () | |
27295 | { | |
c0c3707f CB |
27296 | int result = 0; |
27297 | struct stat st; | |
27298 | if (!stat ("conftest.tmp/", &st)) | |
27299 | result |= 1; | |
27300 | #if HAVE_LSTAT | |
27301 | if (!stat ("conftest.lnk/", &st)) | |
27302 | result |= 2; | |
27303 | #endif | |
27304 | return result; | |
27305 | ||
2196f55f YQ |
27306 | ; |
27307 | return 0; | |
27308 | } | |
27309 | _ACEOF | |
27310 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 27311 | gl_cv_func_stat_file_slash=yes |
2196f55f | 27312 | else |
c0c3707f | 27313 | gl_cv_func_stat_file_slash=no |
2196f55f YQ |
27314 | fi |
27315 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
27316 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
27317 | fi | |
27318 | ||
c0c3707f | 27319 | rm -f conftest.tmp conftest.lnk |
2196f55f | 27320 | fi |
c0c3707f CB |
27321 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5 |
27322 | $as_echo "$gl_cv_func_stat_file_slash" >&6; } | |
27323 | case $gl_cv_func_stat_file_slash in | |
27324 | *no) | |
27325 | REPLACE_STAT=1 | |
27326 | ||
27327 | $as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h | |
27328 | ;; | |
27329 | esac | |
27330 | case $host_os in | |
27331 | solaris*) | |
27332 | REPLACE_FSTAT=1 ;; | |
27333 | esac | |
27334 | ;; | |
27335 | esac | |
27336 | ||
27337 | if test $REPLACE_STAT = 1; then | |
27338 | ||
27339 | ||
27340 | ||
27341 | ||
27342 | ||
27343 | ||
27344 | ||
27345 | ||
27346 | gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext" | |
27347 | ||
27348 | case "$host_os" in | |
27349 | mingw*) | |
27350 | ||
27351 | ||
27352 | ||
27353 | ||
27354 | ||
27355 | ||
27356 | ||
27357 | ||
27358 | gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" | |
27359 | ||
27360 | ;; | |
27361 | esac | |
27362 | ||
27363 | ||
9c9d63b1 | 27364 | |
c0c3707f CB |
27365 | : |
27366 | ||
27367 | fi | |
27368 | ||
27369 | ||
27370 | ||
27371 | ||
27372 | ||
27373 | GNULIB_STAT=1 | |
27374 | ||
27375 | ||
27376 | ||
27377 | ||
27378 | ||
27379 | $as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h | |
27380 | ||
27381 | ||
27382 | ||
27383 | ||
7a6dbc2f | 27384 | |
c0c3707f CB |
27385 | |
27386 | ||
27387 | 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> | |
27388 | #include <sys/stat.h> | |
27389 | " | |
27390 | if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then : | |
27391 | ||
27392 | cat >>confdefs.h <<_ACEOF | |
27393 | #define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1 | |
27394 | _ACEOF | |
27395 | ||
27396 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5 | |
27397 | $as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; } | |
27398 | if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then : | |
27399 | $as_echo_n "(cached) " >&6 | |
2196f55f | 27400 | else |
5e8754f9 SDJ |
27401 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
27402 | /* end confdefs.h. */ | |
c0c3707f CB |
27403 | |
27404 | #include <sys/types.h> | |
27405 | #include <sys/stat.h> | |
27406 | #if HAVE_SYS_TIME_H | |
27407 | # include <sys/time.h> | |
27408 | #endif | |
27409 | #include <time.h> | |
27410 | struct timespec ts; | |
27411 | struct stat st; | |
7a6dbc2f | 27412 | |
5e8754f9 SDJ |
27413 | int |
27414 | main () | |
27415 | { | |
c0c3707f CB |
27416 | |
27417 | st.st_atim = ts; | |
7a6dbc2f | 27418 | |
5e8754f9 SDJ |
27419 | ; |
27420 | return 0; | |
27421 | } | |
27422 | _ACEOF | |
c0c3707f CB |
27423 | if ac_fn_c_try_compile "$LINENO"; then : |
27424 | ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes | |
5e8754f9 | 27425 | else |
c0c3707f | 27426 | ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no |
2196f55f | 27427 | fi |
c0c3707f | 27428 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
2196f55f | 27429 | fi |
c0c3707f CB |
27430 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5 |
27431 | $as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; } | |
27432 | if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then | |
2196f55f | 27433 | |
c0c3707f | 27434 | $as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h |
2196f55f | 27435 | |
c0c3707f CB |
27436 | fi |
27437 | else | |
27438 | 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> | |
27439 | #include <sys/stat.h> | |
27440 | " | |
27441 | if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then : | |
2196f55f | 27442 | |
c0c3707f CB |
27443 | cat >>confdefs.h <<_ACEOF |
27444 | #define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1 | |
27445 | _ACEOF | |
2196f55f | 27446 | |
c0c3707f CB |
27447 | |
27448 | else | |
27449 | ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h> | |
27450 | #include <sys/stat.h> | |
27451 | " | |
27452 | if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then : | |
27453 | ||
27454 | cat >>confdefs.h <<_ACEOF | |
27455 | #define HAVE_STRUCT_STAT_ST_ATIMENSEC 1 | |
27456 | _ACEOF | |
2196f55f YQ |
27457 | |
27458 | ||
c0c3707f CB |
27459 | else |
27460 | 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> | |
27461 | #include <sys/stat.h> | |
27462 | " | |
27463 | if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then : | |
2196f55f | 27464 | |
c0c3707f CB |
27465 | cat >>confdefs.h <<_ACEOF |
27466 | #define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1 | |
27467 | _ACEOF | |
2196f55f YQ |
27468 | |
27469 | ||
c0c3707f | 27470 | fi |
2196f55f | 27471 | |
c0c3707f | 27472 | fi |
2196f55f | 27473 | |
c0c3707f | 27474 | fi |
2196f55f | 27475 | |
c0c3707f | 27476 | fi |
2196f55f YQ |
27477 | |
27478 | ||
27479 | ||
27480 | ||
27481 | ||
c0c3707f CB |
27482 | 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> |
27483 | #include <sys/stat.h> | |
27484 | " | |
27485 | if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes; then : | |
2196f55f | 27486 | |
c0c3707f CB |
27487 | cat >>confdefs.h <<_ACEOF |
27488 | #define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1 | |
27489 | _ACEOF | |
2196f55f YQ |
27490 | |
27491 | ||
c0c3707f CB |
27492 | else |
27493 | ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h> | |
27494 | #include <sys/stat.h> | |
27495 | " | |
27496 | if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes; then : | |
2196f55f | 27497 | |
c0c3707f CB |
27498 | cat >>confdefs.h <<_ACEOF |
27499 | #define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1 | |
27500 | _ACEOF | |
2196f55f | 27501 | |
2196f55f | 27502 | |
c0c3707f CB |
27503 | else |
27504 | 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> | |
27505 | #include <sys/stat.h> | |
27506 | " | |
27507 | if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes; then : | |
27508 | ||
27509 | cat >>confdefs.h <<_ACEOF | |
27510 | #define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1 | |
27511 | _ACEOF | |
27512 | ||
27513 | ||
27514 | fi | |
27515 | ||
27516 | fi | |
5e8754f9 | 27517 | |
c0c3707f | 27518 | fi |
2196f55f YQ |
27519 | |
27520 | ||
27521 | ||
725e2999 JB |
27522 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5 |
27523 | $as_echo_n "checking for working stdalign.h... " >&6; } | |
27524 | if ${gl_cv_header_working_stdalign_h+:} false; then : | |
27525 | $as_echo_n "(cached) " >&6 | |
27526 | else | |
27527 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27528 | /* end confdefs.h. */ | |
27529 | #include <stdalign.h> | |
27530 | #include <stddef.h> | |
27531 | ||
27532 | /* Test that alignof yields a result consistent with offsetof. | |
27533 | This catches GCC bug 52023 | |
c0c3707f | 27534 | <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */ |
725e2999 JB |
27535 | #ifdef __cplusplus |
27536 | template <class t> struct alignof_helper { char a; t b; }; | |
27537 | # define ao(type) offsetof (alignof_helper<type>, b) | |
27538 | #else | |
27539 | # define ao(type) offsetof (struct { char a; type b; }, b) | |
27540 | #endif | |
27541 | char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1]; | |
27542 | char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1]; | |
27543 | char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1]; | |
27544 | ||
27545 | /* Test _Alignas only on platforms where gnulib can help. */ | |
27546 | #if \ | |
27547 | ((defined __cplusplus && 201103 <= __cplusplus) \ | |
27548 | || (defined __APPLE__ && defined __MACH__ \ | |
27549 | ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ | |
27550 | : __GNUC__) \ | |
c0c3707f CB |
27551 | || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ |
27552 | || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \ | |
725e2999 JB |
27553 | || 1300 <= _MSC_VER) |
27554 | struct alignas_test { char c; char alignas (8) alignas_8; }; | |
27555 | char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 | |
27556 | ? 1 : -1]; | |
27557 | #endif | |
27558 | ||
27559 | int | |
27560 | main () | |
27561 | { | |
27562 | ||
27563 | ; | |
27564 | return 0; | |
27565 | } | |
27566 | _ACEOF | |
27567 | if ac_fn_c_try_compile "$LINENO"; then : | |
27568 | gl_cv_header_working_stdalign_h=yes | |
27569 | else | |
27570 | gl_cv_header_working_stdalign_h=no | |
27571 | fi | |
27572 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
27573 | fi | |
27574 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5 | |
27575 | $as_echo "$gl_cv_header_working_stdalign_h" >&6; } | |
27576 | ||
27577 | if test $gl_cv_header_working_stdalign_h = yes; then | |
27578 | STDALIGN_H='' | |
27579 | else | |
27580 | STDALIGN_H='stdalign.h' | |
27581 | fi | |
27582 | ||
27583 | ||
27584 | if test -n "$STDALIGN_H"; then | |
27585 | GL_GENERATE_STDALIGN_H_TRUE= | |
27586 | GL_GENERATE_STDALIGN_H_FALSE='#' | |
27587 | else | |
27588 | GL_GENERATE_STDALIGN_H_TRUE='#' | |
27589 | GL_GENERATE_STDALIGN_H_FALSE= | |
27590 | fi | |
27591 | ||
27592 | ||
27593 | ||
2196f55f YQ |
27594 | |
27595 | ||
63ce7108 | 27596 | |
c0c3707f CB |
27597 | if test "$ac_cv_header_stdbool_h" = yes; then |
27598 | case "$host_os" in | |
27599 | solaris*) | |
27600 | if test -z "$GCC"; then | |
27601 | STDBOOL_H='stdbool.h' | |
27602 | else | |
27603 | STDBOOL_H='' | |
27604 | fi | |
27605 | ;; | |
27606 | *) | |
27607 | STDBOOL_H='' | |
27608 | ;; | |
27609 | esac | |
63ce7108 TT |
27610 | else |
27611 | STDBOOL_H='stdbool.h' | |
27612 | fi | |
27613 | ||
27614 | if test -n "$STDBOOL_H"; then | |
27615 | GL_GENERATE_STDBOOL_H_TRUE= | |
27616 | GL_GENERATE_STDBOOL_H_FALSE='#' | |
27617 | else | |
27618 | GL_GENERATE_STDBOOL_H_TRUE='#' | |
27619 | GL_GENERATE_STDBOOL_H_FALSE= | |
27620 | fi | |
27621 | ||
27622 | ||
27623 | if test "$ac_cv_type__Bool" = yes; then | |
27624 | HAVE__BOOL=1 | |
27625 | else | |
27626 | HAVE__BOOL=0 | |
27627 | fi | |
27628 | ||
27629 | ||
27630 | ||
27631 | ||
27632 | ||
9c9d63b1 PM |
27633 | |
27634 | ||
27635 | ||
63ce7108 | 27636 | STDDEF_H= |
4a626d0a | 27637 | |
c0c3707f CB |
27638 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5 |
27639 | $as_echo_n "checking for good max_align_t... " >&6; } | |
27640 | if ${gl_cv_type_max_align_t+:} false; then : | |
27641 | $as_echo_n "(cached) " >&6 | |
27642 | else | |
27643 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27644 | /* end confdefs.h. */ | |
27645 | #include <stddef.h> | |
27646 | unsigned int s = sizeof (max_align_t); | |
9c9d63b1 | 27647 | #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__ |
c0c3707f CB |
27648 | int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; |
27649 | int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; | |
27650 | #endif | |
9c9d63b1 PM |
27651 | typedef struct { char a; max_align_t b; } max_helper; |
27652 | typedef struct { char a; long b; } long_helper; | |
27653 | typedef struct { char a; double b; } double_helper; | |
27654 | typedef struct { char a; long double b; } long_double_helper; | |
27655 | int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1]; | |
27656 | int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1]; | |
27657 | int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1]; | |
c0c3707f CB |
27658 | |
27659 | int | |
27660 | main () | |
27661 | { | |
4a626d0a | 27662 | |
c0c3707f CB |
27663 | ; |
27664 | return 0; | |
27665 | } | |
27666 | _ACEOF | |
27667 | if ac_fn_c_try_compile "$LINENO"; then : | |
27668 | gl_cv_type_max_align_t=yes | |
4a626d0a | 27669 | else |
c0c3707f | 27670 | gl_cv_type_max_align_t=no |
4a626d0a | 27671 | fi |
c0c3707f CB |
27672 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
27673 | ||
27674 | fi | |
27675 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5 | |
27676 | $as_echo "$gl_cv_type_max_align_t" >&6; } | |
27677 | if test $gl_cv_type_max_align_t = no; then | |
27678 | HAVE_MAX_ALIGN_T=0 | |
27679 | STDDEF_H=stddef.h | |
27680 | fi | |
4a626d0a | 27681 | |
63ce7108 TT |
27682 | if test $gt_cv_c_wchar_t = no; then |
27683 | HAVE_WCHAR_T=0 | |
27684 | STDDEF_H=stddef.h | |
27685 | fi | |
c0c3707f | 27686 | |
63ce7108 TT |
27687 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 |
27688 | $as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; } | |
d0ac1c44 | 27689 | if ${gl_cv_decl_null_works+:} false; then : |
63ce7108 TT |
27690 | $as_echo_n "(cached) " >&6 |
27691 | else | |
27692 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27693 | /* end confdefs.h. */ | |
27694 | #include <stddef.h> | |
27695 | int test[2 * (sizeof NULL == sizeof (void *)) -1]; | |
27696 | ||
27697 | int | |
27698 | main () | |
27699 | { | |
27700 | ||
27701 | ; | |
27702 | return 0; | |
27703 | } | |
27704 | _ACEOF | |
27705 | if ac_fn_c_try_compile "$LINENO"; then : | |
27706 | gl_cv_decl_null_works=yes | |
27707 | else | |
27708 | gl_cv_decl_null_works=no | |
27709 | fi | |
27710 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
27711 | fi | |
27712 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 | |
27713 | $as_echo "$gl_cv_decl_null_works" >&6; } | |
27714 | if test $gl_cv_decl_null_works = no; then | |
27715 | REPLACE_NULL=1 | |
27716 | STDDEF_H=stddef.h | |
27717 | fi | |
27718 | ||
c0c3707f | 27719 | |
63ce7108 TT |
27720 | if test -n "$STDDEF_H"; then |
27721 | GL_GENERATE_STDDEF_H_TRUE= | |
27722 | GL_GENERATE_STDDEF_H_FALSE='#' | |
27723 | else | |
27724 | GL_GENERATE_STDDEF_H_TRUE='#' | |
27725 | GL_GENERATE_STDDEF_H_FALSE= | |
27726 | fi | |
27727 | ||
27728 | if test -n "$STDDEF_H"; then | |
27729 | ||
27730 | ||
27731 | ||
27732 | ||
27733 | ||
27734 | ||
27735 | ||
27736 | ||
27737 | if test $gl_cv_have_include_next = yes; then | |
27738 | gl_cv_next_stddef_h='<'stddef.h'>' | |
27739 | else | |
27740 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5 | |
27741 | $as_echo_n "checking absolute name of <stddef.h>... " >&6; } | |
d0ac1c44 | 27742 | if ${gl_cv_next_stddef_h+:} false; then : |
63ce7108 TT |
27743 | $as_echo_n "(cached) " >&6 |
27744 | else | |
27745 | ||
4a626d0a PA |
27746 | |
27747 | ||
27748 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
63ce7108 TT |
27749 | /* end confdefs.h. */ |
27750 | #include <stddef.h> | |
63ce7108 | 27751 | _ACEOF |
4a626d0a PA |
27752 | case "$host_os" in |
27753 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
27754 | *) gl_absname_cpp="$ac_cpp" ;; | |
27755 | esac | |
63ce7108 | 27756 | |
4a626d0a PA |
27757 | case "$host_os" in |
27758 | mingw*) | |
27759 | gl_dirsep_regex='[/\\]' | |
27760 | ;; | |
27761 | *) | |
27762 | gl_dirsep_regex='\/' | |
27763 | ;; | |
27764 | esac | |
27765 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
27766 | gl_header_literal_regex=`echo 'stddef.h' \ | |
27767 | | sed -e "$gl_make_literal_regex_sed"` | |
27768 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
27769 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
27770 | s|^/[^/]|//&| | |
27771 | p | |
27772 | q | |
27773 | }' | |
63ce7108 | 27774 | |
4a626d0a PA |
27775 | gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
27776 | sed -n "$gl_absolute_header_sed"` | |
27777 | ||
27778 | gl_header=$gl_cv_absolute_stddef_h | |
27779 | gl_cv_next_stddef_h='"'$gl_header'"' | |
63ce7108 TT |
27780 | |
27781 | ||
27782 | fi | |
27783 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 | |
27784 | $as_echo "$gl_cv_next_stddef_h" >&6; } | |
27785 | fi | |
27786 | NEXT_STDDEF_H=$gl_cv_next_stddef_h | |
27787 | ||
27788 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
27789 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
27790 | gl_next_as_first_directive='<'stddef.h'>' | |
27791 | else | |
27792 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
27793 | gl_next_as_first_directive=$gl_cv_next_stddef_h | |
27794 | fi | |
27795 | NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive | |
27796 | ||
27797 | ||
27798 | ||
27799 | ||
27800 | fi | |
27801 | ||
27802 | ||
27803 | ||
27804 | ||
49e4877c | 27805 | $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h |
63ce7108 TT |
27806 | |
27807 | ||
27808 | ||
98399780 YQ |
27809 | |
27810 | ||
27811 | ||
27812 | ||
27813 | ||
4a626d0a PA |
27814 | |
27815 | ||
6a29c58e YQ |
27816 | if test $gl_cv_have_include_next = yes; then |
27817 | gl_cv_next_stdio_h='<'stdio.h'>' | |
27818 | else | |
27819 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5 | |
27820 | $as_echo_n "checking absolute name of <stdio.h>... " >&6; } | |
d0ac1c44 | 27821 | if ${gl_cv_next_stdio_h+:} false; then : |
6a29c58e YQ |
27822 | $as_echo_n "(cached) " >&6 |
27823 | else | |
27824 | ||
4a626d0a PA |
27825 | |
27826 | ||
27827 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6a29c58e YQ |
27828 | /* end confdefs.h. */ |
27829 | #include <stdio.h> | |
6a29c58e | 27830 | _ACEOF |
4a626d0a PA |
27831 | case "$host_os" in |
27832 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
27833 | *) gl_absname_cpp="$ac_cpp" ;; | |
27834 | esac | |
27835 | ||
27836 | case "$host_os" in | |
27837 | mingw*) | |
27838 | gl_dirsep_regex='[/\\]' | |
27839 | ;; | |
27840 | *) | |
27841 | gl_dirsep_regex='\/' | |
27842 | ;; | |
27843 | esac | |
27844 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
27845 | gl_header_literal_regex=`echo 'stdio.h' \ | |
27846 | | sed -e "$gl_make_literal_regex_sed"` | |
27847 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
27848 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
27849 | s|^/[^/]|//&| | |
27850 | p | |
27851 | q | |
27852 | }' | |
6a29c58e | 27853 | |
4a626d0a PA |
27854 | gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
27855 | sed -n "$gl_absolute_header_sed"` | |
6a29c58e | 27856 | |
4a626d0a PA |
27857 | gl_header=$gl_cv_absolute_stdio_h |
27858 | gl_cv_next_stdio_h='"'$gl_header'"' | |
6a29c58e YQ |
27859 | |
27860 | ||
27861 | fi | |
27862 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5 | |
27863 | $as_echo "$gl_cv_next_stdio_h" >&6; } | |
27864 | fi | |
27865 | NEXT_STDIO_H=$gl_cv_next_stdio_h | |
27866 | ||
27867 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
27868 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
27869 | gl_next_as_first_directive='<'stdio.h'>' | |
27870 | else | |
27871 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
27872 | gl_next_as_first_directive=$gl_cv_next_stdio_h | |
27873 | fi | |
27874 | NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive | |
27875 | ||
27876 | ||
27877 | ||
27878 | ||
27879 | ||
4a626d0a PA |
27880 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5 |
27881 | $as_echo_n "checking which flavor of printf attribute matches inttypes macros... " >&6; } | |
d0ac1c44 | 27882 | if ${gl_cv_func_printf_attribute_flavor+:} false; then : |
4a626d0a PA |
27883 | $as_echo_n "(cached) " >&6 |
27884 | else | |
27885 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27886 | /* end confdefs.h. */ | |
27887 | ||
27888 | #define __STDC_FORMAT_MACROS 1 | |
27889 | #include <stdio.h> | |
27890 | #include <inttypes.h> | |
27891 | /* For non-mingw systems, compilation will trivially succeed. | |
27892 | For mingw, compilation will succeed for older mingw (system | |
27893 | printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ | |
c0c3707f | 27894 | #if (defined _WIN32 && ! defined __CYGWIN__) && \ |
4a626d0a PA |
27895 | (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) |
27896 | extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; | |
27897 | #endif | |
27898 | ||
27899 | int | |
27900 | main () | |
27901 | { | |
27902 | ||
27903 | ; | |
27904 | return 0; | |
27905 | } | |
27906 | _ACEOF | |
27907 | if ac_fn_c_try_compile "$LINENO"; then : | |
27908 | gl_cv_func_printf_attribute_flavor=system | |
27909 | else | |
27910 | gl_cv_func_printf_attribute_flavor=gnu | |
27911 | fi | |
27912 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
27913 | fi | |
27914 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5 | |
27915 | $as_echo "$gl_cv_func_printf_attribute_flavor" >&6; } | |
27916 | if test "$gl_cv_func_printf_attribute_flavor" = gnu; then | |
27917 | ||
27918 | $as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h | |
27919 | ||
27920 | fi | |
27921 | ||
6a29c58e YQ |
27922 | GNULIB_FSCANF=1 |
27923 | ||
27924 | ||
27925 | cat >>confdefs.h <<_ACEOF | |
27926 | #define GNULIB_FSCANF 1 | |
27927 | _ACEOF | |
27928 | ||
27929 | ||
27930 | GNULIB_SCANF=1 | |
27931 | ||
27932 | ||
27933 | cat >>confdefs.h <<_ACEOF | |
27934 | #define GNULIB_SCANF 1 | |
27935 | _ACEOF | |
27936 | ||
27937 | ||
27938 | GNULIB_FGETC=1 | |
27939 | GNULIB_GETC=1 | |
27940 | GNULIB_GETCHAR=1 | |
27941 | GNULIB_FGETS=1 | |
27942 | GNULIB_FREAD=1 | |
27943 | ||
27944 | ||
27945 | GNULIB_FPRINTF=1 | |
27946 | GNULIB_PRINTF=1 | |
27947 | GNULIB_VFPRINTF=1 | |
27948 | GNULIB_VPRINTF=1 | |
27949 | GNULIB_FPUTC=1 | |
27950 | GNULIB_PUTC=1 | |
27951 | GNULIB_PUTCHAR=1 | |
27952 | GNULIB_FPUTS=1 | |
27953 | GNULIB_PUTS=1 | |
27954 | GNULIB_FWRITE=1 | |
27955 | ||
27956 | ||
27957 | ||
27958 | ||
6a29c58e | 27959 | |
6a29c58e YQ |
27960 | |
27961 | ||
27962 | ||
27963 | ||
27964 | ||
9c9d63b1 PM |
27965 | if test $ac_cv_have_decl_fcloseall = no; then |
27966 | HAVE_DECL_FCLOSEALL=0 | |
27967 | fi | |
27968 | ||
27969 | ||
6a29c58e YQ |
27970 | |
27971 | ||
27972 | ||
27973 | ||
27974 | ||
27975 | ||
27976 | ||
698be2d8 CB |
27977 | |
27978 | ||
98399780 YQ |
27979 | if test $gl_cv_have_include_next = yes; then |
27980 | gl_cv_next_stdlib_h='<'stdlib.h'>' | |
27981 | else | |
27982 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5 | |
27983 | $as_echo_n "checking absolute name of <stdlib.h>... " >&6; } | |
d0ac1c44 | 27984 | if ${gl_cv_next_stdlib_h+:} false; then : |
98399780 YQ |
27985 | $as_echo_n "(cached) " >&6 |
27986 | else | |
27987 | ||
4a626d0a PA |
27988 | |
27989 | ||
27990 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
98399780 YQ |
27991 | /* end confdefs.h. */ |
27992 | #include <stdlib.h> | |
98399780 | 27993 | _ACEOF |
4a626d0a PA |
27994 | case "$host_os" in |
27995 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
27996 | *) gl_absname_cpp="$ac_cpp" ;; | |
27997 | esac | |
27998 | ||
27999 | case "$host_os" in | |
28000 | mingw*) | |
28001 | gl_dirsep_regex='[/\\]' | |
28002 | ;; | |
28003 | *) | |
28004 | gl_dirsep_regex='\/' | |
28005 | ;; | |
28006 | esac | |
28007 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
28008 | gl_header_literal_regex=`echo 'stdlib.h' \ | |
28009 | | sed -e "$gl_make_literal_regex_sed"` | |
28010 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
28011 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
28012 | s|^/[^/]|//&| | |
28013 | p | |
28014 | q | |
28015 | }' | |
98399780 | 28016 | |
4a626d0a PA |
28017 | gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
28018 | sed -n "$gl_absolute_header_sed"` | |
98399780 | 28019 | |
4a626d0a PA |
28020 | gl_header=$gl_cv_absolute_stdlib_h |
28021 | gl_cv_next_stdlib_h='"'$gl_header'"' | |
98399780 YQ |
28022 | |
28023 | ||
28024 | fi | |
28025 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5 | |
28026 | $as_echo "$gl_cv_next_stdlib_h" >&6; } | |
28027 | fi | |
28028 | NEXT_STDLIB_H=$gl_cv_next_stdlib_h | |
28029 | ||
28030 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
28031 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
28032 | gl_next_as_first_directive='<'stdlib.h'>' | |
28033 | else | |
28034 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
28035 | gl_next_as_first_directive=$gl_cv_next_stdlib_h | |
28036 | fi | |
28037 | NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive | |
28038 | ||
28039 | ||
28040 | ||
28041 | ||
28042 | ||
28043 | ||
98399780 | 28044 | |
98399780 YQ |
28045 | |
28046 | ||
28047 | ||
28048 | ||
28049 | ||
9c9d63b1 PM |
28050 | if test $ac_cv_have_decl_ecvt = no; then |
28051 | HAVE_DECL_ECVT=0 | |
28052 | fi | |
28053 | ||
28054 | if test $ac_cv_have_decl_fcvt = no; then | |
28055 | HAVE_DECL_FCVT=0 | |
28056 | fi | |
28057 | ||
28058 | if test $ac_cv_have_decl_gcvt = no; then | |
28059 | HAVE_DECL_GCVT=0 | |
28060 | fi | |
28061 | ||
28062 | ||
98399780 | 28063 | |
698be2d8 CB |
28064 | |
28065 | ||
8424cc97 SM |
28066 | for ac_func in strchrnul |
28067 | do : | |
28068 | ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul" | |
d0ac1c44 | 28069 | if test "x$ac_cv_func_strchrnul" = xyes; then : |
8424cc97 SM |
28070 | cat >>confdefs.h <<_ACEOF |
28071 | #define HAVE_STRCHRNUL 1 | |
28072 | _ACEOF | |
28073 | ||
28074 | fi | |
28075 | done | |
28076 | ||
28077 | if test $ac_cv_func_strchrnul = no; then | |
28078 | HAVE_STRCHRNUL=0 | |
28079 | else | |
28080 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strchrnul works" >&5 | |
28081 | $as_echo_n "checking whether strchrnul works... " >&6; } | |
d0ac1c44 | 28082 | if ${gl_cv_func_strchrnul_works+:} false; then : |
8424cc97 SM |
28083 | $as_echo_n "(cached) " >&6 |
28084 | else | |
28085 | if test "$cross_compiling" = yes; then : | |
28086 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28087 | /* end confdefs.h. */ | |
28088 | ||
28089 | #if defined __CYGWIN__ | |
28090 | #include <cygwin/version.h> | |
28091 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9) | |
28092 | Lucky user | |
28093 | #endif | |
28094 | #else | |
28095 | Lucky user | |
28096 | #endif | |
28097 | ||
28098 | _ACEOF | |
28099 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
28100 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
28101 | gl_cv_func_strchrnul_works="guessing yes" | |
28102 | else | |
28103 | gl_cv_func_strchrnul_works="guessing no" | |
28104 | fi | |
28105 | rm -f conftest* | |
28106 | ||
28107 | ||
28108 | else | |
28109 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28110 | /* end confdefs.h. */ | |
28111 | ||
28112 | #include <string.h> /* for strchrnul */ | |
28113 | ||
28114 | int | |
28115 | main () | |
28116 | { | |
28117 | const char *buf = "a"; | |
28118 | return strchrnul (buf, 'b') != buf + 1; | |
28119 | ||
28120 | ; | |
28121 | return 0; | |
28122 | } | |
28123 | _ACEOF | |
28124 | if ac_fn_c_try_run "$LINENO"; then : | |
28125 | gl_cv_func_strchrnul_works=yes | |
28126 | else | |
28127 | gl_cv_func_strchrnul_works=no | |
28128 | fi | |
28129 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
28130 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
28131 | fi | |
28132 | ||
28133 | ||
28134 | fi | |
28135 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strchrnul_works" >&5 | |
28136 | $as_echo "$gl_cv_func_strchrnul_works" >&6; } | |
28137 | case "$gl_cv_func_strchrnul_works" in | |
28138 | *yes) ;; | |
28139 | *) REPLACE_STRCHRNUL=1 ;; | |
28140 | esac | |
28141 | fi | |
28142 | ||
28143 | if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then | |
28144 | ||
28145 | ||
28146 | ||
28147 | ||
28148 | ||
28149 | ||
28150 | ||
28151 | ||
28152 | gl_LIBOBJS="$gl_LIBOBJS strchrnul.$ac_objext" | |
28153 | ||
28154 | : | |
28155 | fi | |
28156 | ||
28157 | ||
28158 | ||
28159 | ||
28160 | ||
28161 | GNULIB_STRCHRNUL=1 | |
28162 | ||
28163 | ||
28164 | ||
28165 | ||
28166 | ||
28167 | $as_echo "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h | |
28168 | ||
28169 | ||
28170 | ||
28171 | ||
28172 | ||
28173 | ||
9c9d63b1 PM |
28174 | if test $gl_cv_func_malloc_posix != yes; then |
28175 | REPLACE_STRDUP=1 | |
6ec2e0f5 SDJ |
28176 | fi |
28177 | ||
28178 | if test $ac_cv_have_decl_strdup = no; then | |
28179 | HAVE_DECL_STRDUP=0 | |
28180 | fi | |
28181 | ||
9c9d63b1 | 28182 | if test $REPLACE_STRDUP = 1; then |
6ec2e0f5 SDJ |
28183 | |
28184 | ||
28185 | ||
28186 | ||
28187 | ||
28188 | ||
28189 | ||
28190 | ||
28191 | gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext" | |
28192 | ||
28193 | : | |
28194 | fi | |
28195 | ||
28196 | ||
28197 | ||
28198 | ||
28199 | ||
28200 | GNULIB_STRDUP=1 | |
28201 | ||
28202 | ||
28203 | ||
28204 | ||
28205 | ||
28206 | $as_echo "#define GNULIB_TEST_STRDUP 1" >>confdefs.h | |
28207 | ||
28208 | ||
28209 | ||
28210 | ||
28211 | ||
28212 | ||
28213 | ||
28214 | ||
5abebf3c CB |
28215 | |
28216 | ||
6ec2e0f5 SDJ |
28217 | if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then |
28218 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5 | |
28219 | $as_echo_n "checking for working strerror function... " >&6; } | |
d0ac1c44 | 28220 | if ${gl_cv_func_working_strerror+:} false; then : |
6ec2e0f5 SDJ |
28221 | $as_echo_n "(cached) " >&6 |
28222 | else | |
28223 | if test "$cross_compiling" = yes; then : | |
28224 | case "$host_os" in | |
c0c3707f CB |
28225 | # Guess yes on glibc systems. |
28226 | *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;; | |
28227 | # Guess yes on musl systems. | |
28228 | *-musl*) gl_cv_func_working_strerror="guessing yes" ;; | |
28229 | # If we don't know, obey --enable-cross-guesses. | |
28230 | *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;; | |
6ec2e0f5 SDJ |
28231 | esac |
28232 | ||
28233 | else | |
28234 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28235 | /* end confdefs.h. */ | |
28236 | #include <string.h> | |
28237 | ||
28238 | int | |
28239 | main () | |
28240 | { | |
28241 | if (!*strerror (-2)) return 1; | |
28242 | ; | |
28243 | return 0; | |
28244 | } | |
28245 | _ACEOF | |
28246 | if ac_fn_c_try_run "$LINENO"; then : | |
28247 | gl_cv_func_working_strerror=yes | |
28248 | else | |
28249 | gl_cv_func_working_strerror=no | |
28250 | fi | |
28251 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
28252 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
28253 | fi | |
28254 | ||
28255 | ||
28256 | fi | |
28257 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5 | |
28258 | $as_echo "$gl_cv_func_working_strerror" >&6; } | |
28259 | case "$gl_cv_func_working_strerror" in | |
28260 | *yes) ;; | |
28261 | *) | |
28262 | REPLACE_STRERROR=1 | |
28263 | ;; | |
28264 | esac | |
28265 | ||
5abebf3c CB |
28266 | case "$gl_cv_func_strerror_r_works" in |
28267 | *no) REPLACE_STRERROR=1 ;; | |
28268 | esac | |
28269 | ||
6ec2e0f5 SDJ |
28270 | else |
28271 | REPLACE_STRERROR=1 | |
28272 | fi | |
28273 | ||
28274 | if test $REPLACE_STRERROR = 1; then | |
28275 | ||
28276 | ||
28277 | ||
28278 | ||
28279 | ||
28280 | ||
28281 | ||
28282 | ||
28283 | gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext" | |
28284 | ||
28285 | fi | |
28286 | ||
28287 | ||
28288 | cat >>confdefs.h <<_ACEOF | |
28289 | #define GNULIB_STRERROR 1 | |
28290 | _ACEOF | |
28291 | ||
28292 | ||
28293 | ||
28294 | ||
28295 | ||
28296 | ||
28297 | ||
28298 | GNULIB_STRERROR=1 | |
28299 | ||
28300 | ||
28301 | ||
28302 | ||
28303 | ||
28304 | $as_echo "#define GNULIB_TEST_STRERROR 1" >>confdefs.h | |
28305 | ||
28306 | ||
28307 | ||
28308 | ||
28309 | ||
28310 | if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then | |
28311 | ||
28312 | ||
28313 | ||
28314 | ||
28315 | ||
28316 | ||
28317 | ||
28318 | ||
28319 | gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext" | |
28320 | ||
28321 | ||
28322 | ||
28323 | ||
28324 | ||
28325 | if test $ac_cv_header_sys_socket_h != yes; then | |
28326 | for ac_header in winsock2.h | |
28327 | do : | |
28328 | ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" | |
d0ac1c44 | 28329 | if test "x$ac_cv_header_winsock2_h" = xyes; then : |
6ec2e0f5 SDJ |
28330 | cat >>confdefs.h <<_ACEOF |
28331 | #define HAVE_WINSOCK2_H 1 | |
28332 | _ACEOF | |
28333 | ||
28334 | fi | |
28335 | ||
28336 | done | |
28337 | ||
28338 | fi | |
28339 | if test "$ac_cv_header_winsock2_h" = yes; then | |
28340 | HAVE_WINSOCK2_H=1 | |
28341 | UNISTD_H_HAVE_WINSOCK2_H=1 | |
28342 | SYS_IOCTL_H_HAVE_WINSOCK2_H=1 | |
28343 | else | |
28344 | HAVE_WINSOCK2_H=0 | |
28345 | fi | |
28346 | ||
28347 | ||
28348 | fi | |
28349 | ||
28350 | ||
28351 | ||
28352 | ||
98399780 | 28353 | |
5abebf3c | 28354 | |
5abebf3c | 28355 | |
c0c3707f CB |
28356 | if test $ac_cv_have_decl_strerror_r = no; then |
28357 | HAVE_DECL_STRERROR_R=0 | |
28358 | fi | |
5abebf3c CB |
28359 | |
28360 | if test $ac_cv_func_strerror_r = yes; then | |
28361 | if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then | |
28362 | if test $gl_cv_func_strerror_r_posix_signature = yes; then | |
28363 | case "$gl_cv_func_strerror_r_works" in | |
28364 | *no) REPLACE_STRERROR_R=1 ;; | |
28365 | esac | |
28366 | else | |
28367 | REPLACE_STRERROR_R=1 | |
28368 | fi | |
28369 | else | |
28370 | REPLACE_STRERROR_R=1 | |
28371 | fi | |
28372 | fi | |
28373 | ||
5abebf3c CB |
28374 | if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then |
28375 | ||
28376 | ||
28377 | ||
28378 | ||
28379 | ||
28380 | ||
28381 | ||
28382 | ||
28383 | gl_LIBOBJS="$gl_LIBOBJS strerror_r.$ac_objext" | |
28384 | ||
28385 | ||
28386 | ||
5abebf3c CB |
28387 | |
28388 | ||
28389 | ||
c0c3707f | 28390 | fi |
5abebf3c CB |
28391 | |
28392 | ||
28393 | ||
28394 | ||
5abebf3c | 28395 | |
c0c3707f | 28396 | GNULIB_STRERROR_R=1 |
5abebf3c CB |
28397 | |
28398 | ||
28399 | ||
28400 | ||
5abebf3c | 28401 | |
c0c3707f | 28402 | $as_echo "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h |
5abebf3c CB |
28403 | |
28404 | ||
28405 | ||
28406 | ||
5abebf3c | 28407 | |
c0c3707f CB |
28408 | cat >>confdefs.h <<_ACEOF |
28409 | #define GNULIB_STRERROR_R_POSIX 1 | |
28410 | _ACEOF | |
5abebf3c CB |
28411 | |
28412 | ||
28413 | ||
28414 | ||
28415 | ||
28416 | ||
28417 | ||
698be2d8 CB |
28418 | |
28419 | ||
28420 | ||
28421 | ||
28422 | if test $ac_cv_have_decl_strnlen = no; then | |
28423 | HAVE_DECL_STRNLEN=0 | |
28424 | else | |
28425 | ||
28426 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5 | |
28427 | $as_echo_n "checking for working strnlen... " >&6; } | |
28428 | if ${ac_cv_func_strnlen_working+:} false; then : | |
28429 | $as_echo_n "(cached) " >&6 | |
28430 | else | |
28431 | if test "$cross_compiling" = yes; then : | |
28432 | # Guess no on AIX systems, yes otherwise. | |
28433 | case "$host_os" in | |
28434 | aix*) ac_cv_func_strnlen_working=no;; | |
28435 | *) ac_cv_func_strnlen_working=yes;; | |
28436 | esac | |
28437 | else | |
28438 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28439 | /* end confdefs.h. */ | |
28440 | $ac_includes_default | |
28441 | int | |
28442 | main () | |
28443 | { | |
28444 | ||
28445 | #define S "foobar" | |
28446 | #define S_LEN (sizeof S - 1) | |
28447 | ||
28448 | /* At least one implementation is buggy: that of AIX 4.3 would | |
28449 | give strnlen (S, 1) == 3. */ | |
28450 | ||
28451 | int i; | |
28452 | for (i = 0; i < S_LEN + 1; ++i) | |
28453 | { | |
28454 | int expected = i <= S_LEN ? i : S_LEN; | |
28455 | if (strnlen (S, i) != expected) | |
28456 | return 1; | |
28457 | } | |
28458 | return 0; | |
28459 | ||
28460 | ; | |
28461 | return 0; | |
28462 | } | |
28463 | _ACEOF | |
28464 | if ac_fn_c_try_run "$LINENO"; then : | |
28465 | ac_cv_func_strnlen_working=yes | |
28466 | else | |
28467 | ac_cv_func_strnlen_working=no | |
28468 | fi | |
28469 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
28470 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
28471 | fi | |
28472 | ||
28473 | fi | |
28474 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5 | |
28475 | $as_echo "$ac_cv_func_strnlen_working" >&6; } | |
28476 | test $ac_cv_func_strnlen_working = no && : | |
28477 | ||
28478 | ||
28479 | if test $ac_cv_func_strnlen_working = no; then | |
28480 | REPLACE_STRNLEN=1 | |
28481 | fi | |
28482 | fi | |
28483 | ||
28484 | if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then | |
28485 | ||
28486 | ||
28487 | ||
28488 | ||
28489 | ||
28490 | ||
28491 | ||
28492 | ||
28493 | gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext" | |
28494 | ||
28495 | : | |
28496 | fi | |
28497 | ||
28498 | ||
28499 | ||
28500 | ||
28501 | ||
28502 | GNULIB_STRNLEN=1 | |
28503 | ||
28504 | ||
28505 | ||
28506 | ||
28507 | ||
28508 | $as_echo "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h | |
28509 | ||
28510 | ||
28511 | ||
28512 | ||
28513 | ||
63ce7108 TT |
28514 | if test $REPLACE_STRSTR = 0; then |
28515 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works in linear time" >&5 | |
28516 | $as_echo_n "checking whether strstr works in linear time... " >&6; } | |
d0ac1c44 | 28517 | if ${gl_cv_func_strstr_linear+:} false; then : |
63ce7108 TT |
28518 | $as_echo_n "(cached) " >&6 |
28519 | else | |
28520 | if test "$cross_compiling" = yes; then : | |
28521 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28522 | /* end confdefs.h. */ | |
28523 | ||
28524 | #include <features.h> | |
28525 | #ifdef __GNU_LIBRARY__ | |
28526 | #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ | |
28527 | && !(defined __i386__ || defined __x86_64__) \ | |
28528 | && !defined __UCLIBC__ | |
28529 | Lucky user | |
28530 | #endif | |
28531 | #endif | |
28532 | #ifdef __CYGWIN__ | |
28533 | #include <cygwin/version.h> | |
28534 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) | |
28535 | Lucky user | |
28536 | #endif | |
28537 | #endif | |
28538 | ||
28539 | _ACEOF | |
28540 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
28541 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
28542 | gl_cv_func_strstr_linear="guessing yes" | |
c971b7fa | 28543 | else |
c0c3707f | 28544 | gl_cv_func_strstr_linear="$gl_cross_guess_normal" |
c971b7fa PA |
28545 | fi |
28546 | rm -f conftest* | |
28547 | ||
28548 | ||
28549 | else | |
28550 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28551 | /* end confdefs.h. */ | |
28552 | ||
49e4877c PA |
28553 | #ifdef __MVS__ |
28554 | /* z/OS does not deliver signals while strstr() is running (thanks to | |
28555 | restrictions on its LE runtime), which prevents us from limiting the | |
28556 | running time of this test. */ | |
28557 | # error "This test does not work properly on z/OS" | |
28558 | #endif | |
c971b7fa | 28559 | #include <signal.h> /* for signal */ |
63ce7108 | 28560 | #include <string.h> /* for strstr */ |
c971b7fa PA |
28561 | #include <stdlib.h> /* for malloc */ |
28562 | #include <unistd.h> /* for alarm */ | |
49e4877c | 28563 | static void quit (int sig) { _exit (sig + 128); } |
c971b7fa PA |
28564 | |
28565 | int | |
28566 | main () | |
28567 | { | |
28568 | ||
28569 | int result = 0; | |
28570 | size_t m = 1000000; | |
63ce7108 TT |
28571 | char *haystack = (char *) malloc (2 * m + 2); |
28572 | char *needle = (char *) malloc (m + 2); | |
c971b7fa | 28573 | /* Failure to compile this test due to missing alarm is okay, |
63ce7108 | 28574 | since all such platforms (mingw) also have quadratic strstr. */ |
c971b7fa PA |
28575 | signal (SIGALRM, quit); |
28576 | alarm (5); | |
28577 | /* Check for quadratic performance. */ | |
28578 | if (haystack && needle) | |
28579 | { | |
28580 | memset (haystack, 'A', 2 * m); | |
28581 | haystack[2 * m] = 'B'; | |
63ce7108 | 28582 | haystack[2 * m + 1] = 0; |
c971b7fa PA |
28583 | memset (needle, 'A', m); |
28584 | needle[m] = 'B'; | |
63ce7108 TT |
28585 | needle[m + 1] = 0; |
28586 | if (!strstr (haystack, needle)) | |
c971b7fa PA |
28587 | result |= 1; |
28588 | } | |
c0c3707f CB |
28589 | /* Free allocated memory, in case some sanitizer is watching. */ |
28590 | free (haystack); | |
28591 | free (needle); | |
c971b7fa PA |
28592 | return result; |
28593 | ||
28594 | ; | |
28595 | return 0; | |
28596 | } | |
28597 | _ACEOF | |
28598 | if ac_fn_c_try_run "$LINENO"; then : | |
63ce7108 | 28599 | gl_cv_func_strstr_linear=yes |
c971b7fa | 28600 | else |
63ce7108 | 28601 | gl_cv_func_strstr_linear=no |
c971b7fa PA |
28602 | fi |
28603 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
28604 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
28605 | fi | |
28606 | ||
28607 | ||
28608 | fi | |
63ce7108 TT |
28609 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_linear" >&5 |
28610 | $as_echo "$gl_cv_func_strstr_linear" >&6; } | |
28611 | case "$gl_cv_func_strstr_linear" in | |
40a73391 JK |
28612 | *yes) ;; |
28613 | *) | |
63ce7108 | 28614 | REPLACE_STRSTR=1 |
40a73391 JK |
28615 | ;; |
28616 | esac | |
c971b7fa PA |
28617 | fi |
28618 | ||
63ce7108 | 28619 | if test $REPLACE_STRSTR = 1; then |
c971b7fa PA |
28620 | |
28621 | ||
28622 | ||
28623 | ||
28624 | ||
28625 | ||
28626 | ||
28627 | ||
63ce7108 | 28628 | gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext" |
c971b7fa | 28629 | |
a512b375 | 28630 | fi |
c971b7fa PA |
28631 | |
28632 | ||
28633 | ||
9c9d63b1 | 28634 | if test $REPLACE_MEMCHR = 1; then |
63ce7108 | 28635 | REPLACE_STRSTR=1 |
c971b7fa | 28636 | else |
c0c3707f | 28637 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5 |
63ce7108 | 28638 | $as_echo_n "checking whether strstr works... " >&6; } |
d0ac1c44 | 28639 | if ${gl_cv_func_strstr_works_always+:} false; then : |
c971b7fa PA |
28640 | $as_echo_n "(cached) " >&6 |
28641 | else | |
28642 | if test "$cross_compiling" = yes; then : | |
c0c3707f | 28643 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
c971b7fa PA |
28644 | /* end confdefs.h. */ |
28645 | ||
28646 | #ifdef __GNU_LIBRARY__ | |
28647 | #include <features.h> | |
63ce7108 | 28648 | #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ |
c971b7fa PA |
28649 | || defined __UCLIBC__ |
28650 | Lucky user | |
28651 | #endif | |
28652 | #elif defined __CYGWIN__ | |
28653 | #include <cygwin/version.h> | |
28654 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) | |
28655 | Lucky user | |
28656 | #endif | |
28657 | #else | |
28658 | Lucky user | |
28659 | #endif | |
28660 | ||
28661 | _ACEOF | |
28662 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
28663 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
63ce7108 | 28664 | gl_cv_func_strstr_works_always="guessing yes" |
c971b7fa | 28665 | else |
c0c3707f | 28666 | gl_cv_func_strstr_works_always="$gl_cross_guess_normal" |
c971b7fa PA |
28667 | fi |
28668 | rm -f conftest* | |
28669 | ||
28670 | ||
28671 | else | |
28672 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28673 | /* end confdefs.h. */ | |
28674 | ||
63ce7108 | 28675 | #include <string.h> /* for strstr */ |
c0c3707f CB |
28676 | #ifdef __GNU_LIBRARY__ |
28677 | #include <features.h> | |
28678 | #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28 | |
28679 | Unlucky user | |
28680 | #endif | |
28681 | #endif | |
c971b7fa PA |
28682 | #define P "_EF_BF_BD" |
28683 | #define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P | |
28684 | #define NEEDLE P P P P P | |
28685 | ||
28686 | int | |
28687 | main () | |
28688 | { | |
63ce7108 | 28689 | return !!strstr (HAYSTACK, NEEDLE); |
c971b7fa PA |
28690 | |
28691 | ; | |
28692 | return 0; | |
28693 | } | |
28694 | _ACEOF | |
28695 | if ac_fn_c_try_run "$LINENO"; then : | |
63ce7108 | 28696 | gl_cv_func_strstr_works_always=yes |
c971b7fa | 28697 | else |
63ce7108 | 28698 | gl_cv_func_strstr_works_always=no |
c971b7fa PA |
28699 | fi |
28700 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
28701 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
28702 | fi | |
28703 | ||
28704 | ||
28705 | fi | |
63ce7108 TT |
28706 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5 |
28707 | $as_echo "$gl_cv_func_strstr_works_always" >&6; } | |
28708 | case "$gl_cv_func_strstr_works_always" in | |
40a73391 JK |
28709 | *yes) ;; |
28710 | *) | |
63ce7108 | 28711 | REPLACE_STRSTR=1 |
40a73391 JK |
28712 | ;; |
28713 | esac | |
c971b7fa | 28714 | fi |
8839a007 | 28715 | |
63ce7108 | 28716 | if test $REPLACE_STRSTR = 1; then |
8839a007 | 28717 | |
8690e634 JK |
28718 | |
28719 | ||
8690e634 JK |
28720 | |
28721 | ||
28722 | ||
28723 | ||
28724 | ||
63ce7108 | 28725 | gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext" |
8690e634 | 28726 | |
8690e634 JK |
28727 | fi |
28728 | ||
8690e634 JK |
28729 | |
28730 | ||
8690e634 | 28731 | |
8690e634 | 28732 | |
63ce7108 | 28733 | GNULIB_STRSTR=1 |
8690e634 JK |
28734 | |
28735 | ||
28736 | ||
8690e634 JK |
28737 | |
28738 | ||
63ce7108 | 28739 | $as_echo "#define GNULIB_TEST_STRSTR 1" >>confdefs.h |
8690e634 JK |
28740 | |
28741 | ||
28742 | ||
28743 | ||
28744 | ||
28745 | ||
28746 | ||
421693b0 PA |
28747 | for ac_func in strtok_r |
28748 | do : | |
28749 | ac_fn_c_check_func "$LINENO" "strtok_r" "ac_cv_func_strtok_r" | |
d0ac1c44 | 28750 | if test "x$ac_cv_func_strtok_r" = xyes; then : |
421693b0 PA |
28751 | cat >>confdefs.h <<_ACEOF |
28752 | #define HAVE_STRTOK_R 1 | |
28753 | _ACEOF | |
28754 | ||
28755 | fi | |
28756 | done | |
28757 | ||
28758 | if test $ac_cv_func_strtok_r = yes; then | |
28759 | HAVE_STRTOK_R=1 | |
28760 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtok_r works" >&5 | |
28761 | $as_echo_n "checking whether strtok_r works... " >&6; } | |
d0ac1c44 | 28762 | if ${gl_cv_func_strtok_r_works+:} false; then : |
421693b0 PA |
28763 | $as_echo_n "(cached) " >&6 |
28764 | else | |
28765 | if test "$cross_compiling" = yes; then : | |
c0c3707f CB |
28766 | case "$host_os" in |
28767 | # Guess no on glibc systems. | |
28768 | *-gnu* | gnu*) gl_cv_func_strtok_r_works="guessing no" ;; | |
28769 | # Guess yes on native Windows. | |
28770 | mingw*) gl_cv_func_strtok_r_works="guessing yes" ;; | |
28771 | *) gl_cv_func_strtok_r_works="guessing yes" ;; | |
421693b0 PA |
28772 | esac |
28773 | ||
28774 | else | |
28775 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28776 | /* end confdefs.h. */ | |
28777 | ||
28778 | #ifndef __OPTIMIZE__ | |
28779 | # define __OPTIMIZE__ 1 | |
28780 | #endif | |
28781 | #undef __OPTIMIZE_SIZE__ | |
28782 | #undef __NO_INLINE__ | |
28783 | #include <stdlib.h> | |
28784 | #include <string.h> | |
28785 | ||
28786 | int | |
28787 | main () | |
28788 | { | |
28789 | static const char dummy[] = "\177\01a"; | |
28790 | char delimiters[] = "xxxxxxxx"; | |
28791 | char *save_ptr = (char *) dummy; | |
28792 | strtok_r (delimiters, "x", &save_ptr); | |
28793 | strtok_r (NULL, "x", &save_ptr); | |
28794 | return 0; | |
28795 | ||
28796 | ; | |
28797 | return 0; | |
28798 | } | |
28799 | ||
28800 | _ACEOF | |
28801 | if ac_fn_c_try_run "$LINENO"; then : | |
28802 | gl_cv_func_strtok_r_works=yes | |
28803 | else | |
28804 | gl_cv_func_strtok_r_works=no | |
28805 | fi | |
28806 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
28807 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
28808 | fi | |
28809 | ||
28810 | ||
28811 | fi | |
28812 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtok_r_works" >&5 | |
28813 | $as_echo "$gl_cv_func_strtok_r_works" >&6; } | |
28814 | case "$gl_cv_func_strtok_r_works" in | |
28815 | *no) | |
28816 | UNDEFINE_STRTOK_R=1 | |
28817 | ;; | |
28818 | esac | |
28819 | else | |
28820 | HAVE_STRTOK_R=0 | |
28821 | fi | |
28822 | ||
28823 | if test $ac_cv_have_decl_strtok_r = no; then | |
28824 | HAVE_DECL_STRTOK_R=0 | |
28825 | fi | |
28826 | ||
28827 | if test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1; then | |
28828 | ||
28829 | ||
28830 | ||
28831 | ||
28832 | ||
28833 | ||
28834 | ||
28835 | ||
28836 | gl_LIBOBJS="$gl_LIBOBJS strtok_r.$ac_objext" | |
28837 | ||
28838 | ||
28839 | : | |
28840 | ||
28841 | fi | |
28842 | ||
28843 | ||
28844 | ||
28845 | ||
28846 | ||
28847 | GNULIB_STRTOK_R=1 | |
28848 | ||
28849 | ||
28850 | ||
28851 | ||
28852 | ||
28853 | $as_echo "#define GNULIB_TEST_STRTOK_R 1" >>confdefs.h | |
28854 | ||
28855 | ||
28856 | ||
28857 | ||
28858 | ||
28859 | ||
28860 | ||
8690e634 JK |
28861 | |
28862 | ||
28863 | ||
28864 | ||
28865 | ||
8690e634 | 28866 | |
09607c9e | 28867 | |
698be2d8 CB |
28868 | if test $gl_cv_have_include_next = yes; then |
28869 | gl_cv_next_sys_random_h='<'sys/random.h'>' | |
28870 | else | |
28871 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/random.h>" >&5 | |
28872 | $as_echo_n "checking absolute name of <sys/random.h>... " >&6; } | |
28873 | if ${gl_cv_next_sys_random_h+:} false; then : | |
28874 | $as_echo_n "(cached) " >&6 | |
28875 | else | |
28876 | ||
28877 | if test $ac_cv_header_sys_random_h = yes; then | |
28878 | ||
28879 | ||
28880 | ||
28881 | ||
28882 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28883 | /* end confdefs.h. */ | |
28884 | #include <sys/random.h> | |
28885 | _ACEOF | |
28886 | case "$host_os" in | |
28887 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
28888 | *) gl_absname_cpp="$ac_cpp" ;; | |
28889 | esac | |
28890 | ||
28891 | case "$host_os" in | |
28892 | mingw*) | |
28893 | gl_dirsep_regex='[/\\]' | |
28894 | ;; | |
28895 | *) | |
28896 | gl_dirsep_regex='\/' | |
28897 | ;; | |
28898 | esac | |
28899 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
28900 | gl_header_literal_regex=`echo 'sys/random.h' \ | |
28901 | | sed -e "$gl_make_literal_regex_sed"` | |
28902 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
28903 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
28904 | s|^/[^/]|//&| | |
28905 | p | |
28906 | q | |
28907 | }' | |
28908 | ||
28909 | gl_cv_absolute_sys_random_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
28910 | sed -n "$gl_absolute_header_sed"` | |
28911 | ||
28912 | gl_header=$gl_cv_absolute_sys_random_h | |
28913 | gl_cv_next_sys_random_h='"'$gl_header'"' | |
28914 | else | |
28915 | gl_cv_next_sys_random_h='<'sys/random.h'>' | |
28916 | fi | |
28917 | ||
28918 | ||
28919 | fi | |
28920 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_random_h" >&5 | |
28921 | $as_echo "$gl_cv_next_sys_random_h" >&6; } | |
28922 | fi | |
28923 | NEXT_SYS_RANDOM_H=$gl_cv_next_sys_random_h | |
28924 | ||
28925 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
28926 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
28927 | gl_next_as_first_directive='<'sys/random.h'>' | |
28928 | else | |
28929 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
28930 | gl_next_as_first_directive=$gl_cv_next_sys_random_h | |
28931 | fi | |
28932 | NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H=$gl_next_as_first_directive | |
28933 | ||
28934 | ||
28935 | ||
28936 | ||
28937 | if test $ac_cv_header_sys_random_h = yes; then | |
28938 | HAVE_SYS_RANDOM_H=1 | |
28939 | else | |
28940 | HAVE_SYS_RANDOM_H=0 | |
28941 | fi | |
28942 | ||
28943 | ||
28944 | ||
28945 | if test $ac_cv_header_sys_random_h = yes; then | |
28946 | UNISTD_H_HAVE_SYS_RANDOM_H=1 | |
28947 | fi | |
28948 | ||
28949 | ||
28950 | ||
28951 | ||
28952 | ||
28953 | ||
28954 | ||
28955 | ||
28956 | ||
28957 | ||
28958 | ||
28959 | ||
28960 | ||
28961 | ||
28962 | ||
28963 | ||
28964 | ||
725e2999 JB |
28965 | |
28966 | ||
09607c9e TT |
28967 | |
28968 | ||
28969 | ||
28970 | if test $gl_cv_have_include_next = yes; then | |
28971 | gl_cv_next_sys_stat_h='<'sys/stat.h'>' | |
28972 | else | |
28973 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5 | |
28974 | $as_echo_n "checking absolute name of <sys/stat.h>... " >&6; } | |
d0ac1c44 | 28975 | if ${gl_cv_next_sys_stat_h+:} false; then : |
09607c9e TT |
28976 | $as_echo_n "(cached) " >&6 |
28977 | else | |
28978 | ||
28979 | if test $ac_cv_header_sys_stat_h = yes; then | |
28980 | ||
28981 | ||
4a626d0a PA |
28982 | |
28983 | ||
28984 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
09607c9e TT |
28985 | /* end confdefs.h. */ |
28986 | #include <sys/stat.h> | |
09607c9e | 28987 | _ACEOF |
4a626d0a PA |
28988 | case "$host_os" in |
28989 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
28990 | *) gl_absname_cpp="$ac_cpp" ;; | |
28991 | esac | |
28992 | ||
28993 | case "$host_os" in | |
28994 | mingw*) | |
28995 | gl_dirsep_regex='[/\\]' | |
28996 | ;; | |
28997 | *) | |
28998 | gl_dirsep_regex='\/' | |
28999 | ;; | |
29000 | esac | |
29001 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
29002 | gl_header_literal_regex=`echo 'sys/stat.h' \ | |
29003 | | sed -e "$gl_make_literal_regex_sed"` | |
29004 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
29005 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
29006 | s|^/[^/]|//&| | |
29007 | p | |
29008 | q | |
29009 | }' | |
29010 | ||
29011 | gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
29012 | sed -n "$gl_absolute_header_sed"` | |
29013 | ||
29014 | gl_header=$gl_cv_absolute_sys_stat_h | |
29015 | gl_cv_next_sys_stat_h='"'$gl_header'"' | |
09607c9e TT |
29016 | else |
29017 | gl_cv_next_sys_stat_h='<'sys/stat.h'>' | |
29018 | fi | |
29019 | ||
29020 | ||
29021 | fi | |
29022 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 | |
29023 | $as_echo "$gl_cv_next_sys_stat_h" >&6; } | |
29024 | fi | |
29025 | NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h | |
29026 | ||
29027 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
29028 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
29029 | gl_next_as_first_directive='<'sys/stat.h'>' | |
29030 | else | |
29031 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
29032 | gl_next_as_first_directive=$gl_cv_next_sys_stat_h | |
29033 | fi | |
29034 | NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive | |
29035 | ||
29036 | ||
29037 | ||
29038 | ||
29039 | ||
29040 | ||
29041 | ||
29042 | ||
c0c3707f CB |
29043 | WINDOWS_STAT_TIMESPEC=0 |
29044 | ||
29045 | ||
2196f55f | 29046 | |
09607c9e TT |
29047 | |
29048 | ||
09607c9e | 29049 | |
09607c9e | 29050 | |
09607c9e TT |
29051 | |
29052 | ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h> | |
29053 | #include <sys/stat.h> | |
29054 | " | |
d0ac1c44 | 29055 | if test "x$ac_cv_type_nlink_t" = xyes; then : |
09607c9e TT |
29056 | |
29057 | else | |
29058 | ||
c0c3707f | 29059 | $as_echo "#define nlink_t int" >>confdefs.h |
09607c9e | 29060 | |
c0c3707f | 29061 | fi |
09607c9e TT |
29062 | |
29063 | ||
29064 | ||
29065 | ||
29066 | ||
29067 | ||
29068 | ||
29069 | ||
29070 | ||
29071 | ||
725e2999 JB |
29072 | |
29073 | ||
29074 | ||
29075 | ||
29076 | ||
29077 | ||
725e2999 JB |
29078 | |
29079 | ||
29080 | ||
29081 | ||
29082 | ||
698be2d8 CB |
29083 | |
29084 | ||
725e2999 JB |
29085 | |
29086 | ||
29087 | ||
29088 | if test $gl_cv_have_include_next = yes; then | |
29089 | gl_cv_next_sys_uio_h='<'sys/uio.h'>' | |
29090 | else | |
29091 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5 | |
29092 | $as_echo_n "checking absolute name of <sys/uio.h>... " >&6; } | |
29093 | if ${gl_cv_next_sys_uio_h+:} false; then : | |
29094 | $as_echo_n "(cached) " >&6 | |
29095 | else | |
29096 | ||
29097 | if test $ac_cv_header_sys_uio_h = yes; then | |
29098 | ||
29099 | ||
29100 | ||
29101 | ||
29102 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29103 | /* end confdefs.h. */ | |
29104 | #include <sys/uio.h> | |
29105 | _ACEOF | |
29106 | case "$host_os" in | |
29107 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
29108 | *) gl_absname_cpp="$ac_cpp" ;; | |
29109 | esac | |
29110 | ||
29111 | case "$host_os" in | |
29112 | mingw*) | |
29113 | gl_dirsep_regex='[/\\]' | |
29114 | ;; | |
29115 | *) | |
29116 | gl_dirsep_regex='\/' | |
29117 | ;; | |
29118 | esac | |
29119 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
29120 | gl_header_literal_regex=`echo 'sys/uio.h' \ | |
29121 | | sed -e "$gl_make_literal_regex_sed"` | |
29122 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
29123 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
29124 | s|^/[^/]|//&| | |
29125 | p | |
29126 | q | |
29127 | }' | |
29128 | ||
29129 | gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
29130 | sed -n "$gl_absolute_header_sed"` | |
29131 | ||
29132 | gl_header=$gl_cv_absolute_sys_uio_h | |
29133 | gl_cv_next_sys_uio_h='"'$gl_header'"' | |
29134 | else | |
29135 | gl_cv_next_sys_uio_h='<'sys/uio.h'>' | |
29136 | fi | |
29137 | ||
29138 | ||
29139 | fi | |
29140 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5 | |
29141 | $as_echo "$gl_cv_next_sys_uio_h" >&6; } | |
29142 | fi | |
29143 | NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h | |
29144 | ||
29145 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
29146 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
29147 | gl_next_as_first_directive='<'sys/uio.h'>' | |
29148 | else | |
29149 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
29150 | gl_next_as_first_directive=$gl_cv_next_sys_uio_h | |
29151 | fi | |
29152 | NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive | |
29153 | ||
29154 | ||
29155 | ||
29156 | ||
29157 | if test $ac_cv_header_sys_uio_h = yes; then | |
29158 | HAVE_SYS_UIO_H=1 | |
29159 | else | |
29160 | HAVE_SYS_UIO_H=0 | |
29161 | fi | |
29162 | ||
29163 | ||
29164 | ||
29165 | ||
29166 | ||
2d8adcbd MM |
29167 | : |
29168 | ||
29169 | ||
29170 | ||
29171 | ||
9c9d63b1 PM |
29172 | cat >>confdefs.h <<_ACEOF |
29173 | #define GNULIB_TEMPNAME 1 | |
29174 | _ACEOF | |
29175 | ||
29176 | ||
29177 | ||
29178 | ||
09607c9e TT |
29179 | |
29180 | ||
29181 | ||
8839a007 PA |
29182 | |
29183 | ||
29184 | ||
29185 | ||
09607c9e | 29186 | |
c0c3707f CB |
29187 | 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, |
29188 | gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has | |
29189 | been included before. */ | |
29190 | #if defined __MINGW32__ | |
29191 | # include <unistd.h> | |
29192 | #endif | |
29193 | #include <time.h> | |
09607c9e | 29194 | |
f8e27d88 CB |
29195 | " |
29196 | if test "x$ac_cv_have_decl_localtime_r" = xyes; then : | |
29197 | ac_have_decl=1 | |
29198 | else | |
29199 | ac_have_decl=0 | |
29200 | fi | |
29201 | ||
29202 | cat >>confdefs.h <<_ACEOF | |
29203 | #define HAVE_DECL_LOCALTIME_R $ac_have_decl | |
29204 | _ACEOF | |
29205 | ||
29206 | if test $ac_cv_have_decl_localtime_r = no; then | |
29207 | HAVE_DECL_LOCALTIME_R=0 | |
29208 | fi | |
29209 | ||
29210 | ||
f8e27d88 CB |
29211 | if test $ac_cv_func_localtime_r = yes; then |
29212 | HAVE_LOCALTIME_R=1 | |
29213 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5 | |
29214 | $as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; } | |
29215 | if ${gl_cv_time_r_posix+:} false; then : | |
29216 | $as_echo_n "(cached) " >&6 | |
29217 | else | |
29218 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29219 | /* end confdefs.h. */ | |
c0c3707f CB |
29220 | /* mingw's <time.h> provides the functions asctime_r, ctime_r, |
29221 | gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has | |
29222 | been included before. */ | |
29223 | #if defined __MINGW32__ | |
29224 | # include <unistd.h> | |
29225 | #endif | |
29226 | #include <time.h> | |
29227 | ||
f8e27d88 CB |
29228 | int |
29229 | main () | |
29230 | { | |
29231 | /* We don't need to append 'restrict's to the argument types, | |
29232 | even though the POSIX signature has the 'restrict's, | |
29233 | since C99 says they can't affect type compatibility. */ | |
29234 | struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; | |
29235 | if (ptr) return 0; | |
29236 | /* Check the return type is a pointer. | |
29237 | On HP-UX 10 it is 'int'. */ | |
29238 | *localtime_r (0, 0); | |
29239 | ; | |
29240 | return 0; | |
29241 | } | |
29242 | ||
29243 | _ACEOF | |
29244 | if ac_fn_c_try_compile "$LINENO"; then : | |
29245 | gl_cv_time_r_posix=yes | |
29246 | else | |
29247 | gl_cv_time_r_posix=no | |
29248 | fi | |
29249 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
29250 | ||
29251 | fi | |
29252 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5 | |
29253 | $as_echo "$gl_cv_time_r_posix" >&6; } | |
29254 | if test $gl_cv_time_r_posix = yes; then | |
29255 | REPLACE_LOCALTIME_R=0 | |
29256 | else | |
29257 | REPLACE_LOCALTIME_R=1 | |
29258 | fi | |
29259 | else | |
29260 | HAVE_LOCALTIME_R=0 | |
c0c3707f CB |
29261 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r exists as an inline function" >&5 |
29262 | $as_echo_n "checking whether localtime_r exists as an inline function... " >&6; } | |
29263 | if ${gl_cv_func_localtime_r_inline+:} false; then : | |
29264 | $as_echo_n "(cached) " >&6 | |
29265 | else | |
29266 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29267 | /* end confdefs.h. */ | |
29268 | /* mingw's <time.h> provides the functions asctime_r, ctime_r, | |
29269 | gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has | |
29270 | been included before. */ | |
29271 | #if defined __MINGW32__ | |
29272 | # include <unistd.h> | |
29273 | #endif | |
29274 | #include <time.h> | |
29275 | ||
29276 | int | |
29277 | main () | |
29278 | { | |
29279 | time_t a; | |
29280 | struct tm r; | |
29281 | localtime_r (&a, &r); | |
29282 | ||
29283 | ; | |
29284 | return 0; | |
29285 | } | |
29286 | ||
29287 | _ACEOF | |
29288 | if ac_fn_c_try_link "$LINENO"; then : | |
29289 | gl_cv_func_localtime_r_inline=yes | |
29290 | else | |
29291 | gl_cv_func_localtime_r_inline=no | |
29292 | fi | |
29293 | rm -f core conftest.err conftest.$ac_objext \ | |
29294 | conftest$ac_exeext conftest.$ac_ext | |
29295 | ||
29296 | fi | |
29297 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_localtime_r_inline" >&5 | |
29298 | $as_echo "$gl_cv_func_localtime_r_inline" >&6; } | |
29299 | if test $gl_cv_func_localtime_r_inline = yes; then | |
29300 | REPLACE_LOCALTIME_R=1 | |
29301 | fi | |
f8e27d88 CB |
29302 | fi |
29303 | ||
29304 | if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then | |
29305 | ||
29306 | ||
29307 | ||
29308 | ||
29309 | ||
29310 | ||
29311 | ||
29312 | ||
29313 | gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext" | |
29314 | ||
29315 | ||
29316 | : | |
29317 | ||
29318 | fi | |
29319 | ||
29320 | ||
29321 | ||
29322 | ||
29323 | ||
29324 | GNULIB_TIME_R=1 | |
29325 | ||
29326 | ||
29327 | ||
29328 | ||
29329 | ||
29330 | $as_echo "#define GNULIB_TEST_TIME_R 1" >>confdefs.h | |
29331 | ||
29332 | ||
29333 | ||
29334 | ||
29335 | ||
29336 | ||
29337 | ||
29338 | ||
29339 | ||
5abebf3c CB |
29340 | |
29341 | ||
29342 | ||
8839a007 PA |
29343 | |
29344 | ||
29345 | ||
29346 | if test $gl_cv_have_include_next = yes; then | |
29347 | gl_cv_next_unistd_h='<'unistd.h'>' | |
29348 | else | |
29349 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5 | |
29350 | $as_echo_n "checking absolute name of <unistd.h>... " >&6; } | |
d0ac1c44 | 29351 | if ${gl_cv_next_unistd_h+:} false; then : |
8839a007 PA |
29352 | $as_echo_n "(cached) " >&6 |
29353 | else | |
29354 | ||
29355 | if test $ac_cv_header_unistd_h = yes; then | |
29356 | ||
29357 | ||
4a626d0a PA |
29358 | |
29359 | ||
29360 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8839a007 PA |
29361 | /* end confdefs.h. */ |
29362 | #include <unistd.h> | |
8839a007 | 29363 | _ACEOF |
4a626d0a PA |
29364 | case "$host_os" in |
29365 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
29366 | *) gl_absname_cpp="$ac_cpp" ;; | |
29367 | esac | |
29368 | ||
29369 | case "$host_os" in | |
29370 | mingw*) | |
29371 | gl_dirsep_regex='[/\\]' | |
29372 | ;; | |
29373 | *) | |
29374 | gl_dirsep_regex='\/' | |
29375 | ;; | |
29376 | esac | |
29377 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
29378 | gl_header_literal_regex=`echo 'unistd.h' \ | |
29379 | | sed -e "$gl_make_literal_regex_sed"` | |
29380 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
29381 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
29382 | s|^/[^/]|//&| | |
29383 | p | |
29384 | q | |
29385 | }' | |
29386 | ||
29387 | gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
29388 | sed -n "$gl_absolute_header_sed"` | |
29389 | ||
29390 | gl_header=$gl_cv_absolute_unistd_h | |
29391 | gl_cv_next_unistd_h='"'$gl_header'"' | |
8839a007 PA |
29392 | else |
29393 | gl_cv_next_unistd_h='<'unistd.h'>' | |
29394 | fi | |
29395 | ||
29396 | ||
29397 | fi | |
29398 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5 | |
29399 | $as_echo "$gl_cv_next_unistd_h" >&6; } | |
29400 | fi | |
29401 | NEXT_UNISTD_H=$gl_cv_next_unistd_h | |
29402 | ||
29403 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
29404 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
29405 | gl_next_as_first_directive='<'unistd.h'>' | |
29406 | else | |
29407 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
29408 | gl_next_as_first_directive=$gl_cv_next_unistd_h | |
29409 | fi | |
29410 | NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive | |
29411 | ||
29412 | ||
29413 | ||
29414 | ||
29415 | if test $ac_cv_header_unistd_h = yes; then | |
29416 | HAVE_UNISTD_H=1 | |
29417 | else | |
29418 | HAVE_UNISTD_H=0 | |
29419 | fi | |
29420 | ||
29421 | ||
29422 | ||
29423 | ||
29424 | ||
29425 | ||
29426 | ||
472fa5ee SM |
29427 | |
29428 | ||
29429 | ||
29430 | ||
29431 | ||
8839a007 | 29432 | |
9c9d63b1 PM |
29433 | if test $ac_cv_have_decl_execvpe = no; then |
29434 | HAVE_DECL_EXECVPE=0 | |
29435 | fi | |
29436 | ||
29437 | ||
6ec2e0f5 SDJ |
29438 | |
29439 | ||
29440 | ||
698be2d8 CB |
29441 | |
29442 | ||
3d99e817 AK |
29443 | if test $ac_cv_have_decl_unsetenv = no; then |
29444 | HAVE_DECL_UNSETENV=0 | |
29445 | fi | |
29446 | for ac_func in unsetenv | |
29447 | do : | |
29448 | ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" | |
d0ac1c44 | 29449 | if test "x$ac_cv_func_unsetenv" = xyes; then : |
3d99e817 AK |
29450 | cat >>confdefs.h <<_ACEOF |
29451 | #define HAVE_UNSETENV 1 | |
29452 | _ACEOF | |
29453 | ||
29454 | fi | |
29455 | done | |
29456 | ||
29457 | if test $ac_cv_func_unsetenv = no; then | |
29458 | HAVE_UNSETENV=0 | |
29459 | else | |
29460 | HAVE_UNSETENV=1 | |
29461 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5 | |
29462 | $as_echo_n "checking for unsetenv() return type... " >&6; } | |
d0ac1c44 | 29463 | if ${gt_cv_func_unsetenv_ret+:} false; then : |
3d99e817 AK |
29464 | $as_echo_n "(cached) " >&6 |
29465 | else | |
29466 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29467 | /* end confdefs.h. */ | |
29468 | ||
29469 | #undef _BSD | |
29470 | #define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */ | |
29471 | #include <stdlib.h> | |
29472 | extern | |
29473 | #ifdef __cplusplus | |
29474 | "C" | |
29475 | #endif | |
29476 | int unsetenv (const char *name); | |
29477 | ||
29478 | int | |
29479 | main () | |
29480 | { | |
29481 | ||
29482 | ; | |
29483 | return 0; | |
29484 | } | |
29485 | _ACEOF | |
29486 | if ac_fn_c_try_compile "$LINENO"; then : | |
29487 | gt_cv_func_unsetenv_ret='int' | |
29488 | else | |
29489 | gt_cv_func_unsetenv_ret='void' | |
29490 | fi | |
29491 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
29492 | fi | |
29493 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5 | |
29494 | $as_echo "$gt_cv_func_unsetenv_ret" >&6; } | |
29495 | if test $gt_cv_func_unsetenv_ret = 'void'; then | |
29496 | ||
29497 | $as_echo "#define VOID_UNSETENV 1" >>confdefs.h | |
29498 | ||
29499 | REPLACE_UNSETENV=1 | |
29500 | fi | |
29501 | ||
29502 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5 | |
29503 | $as_echo_n "checking whether unsetenv obeys POSIX... " >&6; } | |
d0ac1c44 | 29504 | if ${gl_cv_func_unsetenv_works+:} false; then : |
3d99e817 AK |
29505 | $as_echo_n "(cached) " >&6 |
29506 | else | |
29507 | if test "$cross_compiling" = yes; then : | |
29508 | case "$host_os" in | |
9c9d63b1 PM |
29509 | # Guess yes on glibc systems. |
29510 | *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;; | |
29511 | # If we don't know, obey --enable-cross-guesses. | |
29512 | *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;; | |
29513 | esac | |
3d99e817 AK |
29514 | |
29515 | else | |
29516 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29517 | /* end confdefs.h. */ | |
29518 | ||
9c9d63b1 PM |
29519 | #include <stdlib.h> |
29520 | #include <errno.h> | |
29521 | extern char **environ; | |
29522 | ||
29523 | ||
29524 | $gl_mda_defines | |
3d99e817 AK |
29525 | |
29526 | int | |
29527 | main () | |
29528 | { | |
29529 | ||
9c9d63b1 PM |
29530 | char entry1[] = "a=1"; |
29531 | char entry2[] = "b=2"; | |
29532 | char *env[] = { entry1, entry2, NULL }; | |
29533 | if (putenv ((char *) "a=1")) return 1; | |
29534 | if (putenv (entry2)) return 2; | |
29535 | entry2[0] = 'a'; | |
29536 | unsetenv ("a"); | |
29537 | if (getenv ("a")) return 3; | |
29538 | if (!unsetenv ("") || errno != EINVAL) return 4; | |
29539 | entry2[0] = 'b'; | |
29540 | environ = env; | |
29541 | if (!getenv ("a")) return 5; | |
29542 | entry2[0] = 'a'; | |
29543 | unsetenv ("a"); | |
29544 | if (getenv ("a")) return 6; | |
3d99e817 AK |
29545 | |
29546 | ; | |
29547 | return 0; | |
29548 | } | |
29549 | _ACEOF | |
29550 | if ac_fn_c_try_run "$LINENO"; then : | |
29551 | gl_cv_func_unsetenv_works=yes | |
29552 | else | |
29553 | gl_cv_func_unsetenv_works=no | |
29554 | fi | |
29555 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
29556 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
29557 | fi | |
29558 | ||
9c9d63b1 | 29559 | |
3d99e817 AK |
29560 | fi |
29561 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5 | |
29562 | $as_echo "$gl_cv_func_unsetenv_works" >&6; } | |
29563 | case "$gl_cv_func_unsetenv_works" in | |
29564 | *yes) ;; | |
29565 | *) | |
29566 | REPLACE_UNSETENV=1 | |
29567 | ;; | |
29568 | esac | |
29569 | fi | |
29570 | ||
29571 | if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then | |
29572 | ||
29573 | ||
29574 | ||
29575 | ||
29576 | ||
29577 | ||
29578 | ||
29579 | ||
29580 | gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext" | |
29581 | ||
29582 | ||
29583 | ||
29584 | ||
29585 | ||
29586 | fi | |
29587 | ||
29588 | ||
29589 | ||
29590 | ||
29591 | ||
29592 | GNULIB_UNSETENV=1 | |
29593 | ||
29594 | ||
29595 | ||
29596 | ||
29597 | ||
29598 | $as_echo "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h | |
29599 | ||
29600 | ||
29601 | ||
29602 | ||
29603 | ||
29604 | ||
8839a007 PA |
29605 | |
29606 | ||
29607 | ||
29608 | ||
29609 | ||
29610 | ||
29611 | ||
8690e634 JK |
29612 | |
29613 | ||
29614 | if test $gl_cv_have_include_next = yes; then | |
29615 | gl_cv_next_wchar_h='<'wchar.h'>' | |
29616 | else | |
29617 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5 | |
29618 | $as_echo_n "checking absolute name of <wchar.h>... " >&6; } | |
d0ac1c44 | 29619 | if ${gl_cv_next_wchar_h+:} false; then : |
8690e634 JK |
29620 | $as_echo_n "(cached) " >&6 |
29621 | else | |
29622 | ||
29623 | if test $ac_cv_header_wchar_h = yes; then | |
29624 | ||
29625 | ||
4a626d0a PA |
29626 | |
29627 | ||
29628 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 JK |
29629 | /* end confdefs.h. */ |
29630 | #include <wchar.h> | |
8690e634 | 29631 | _ACEOF |
4a626d0a PA |
29632 | case "$host_os" in |
29633 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
29634 | *) gl_absname_cpp="$ac_cpp" ;; | |
29635 | esac | |
29636 | ||
29637 | case "$host_os" in | |
29638 | mingw*) | |
29639 | gl_dirsep_regex='[/\\]' | |
29640 | ;; | |
29641 | *) | |
29642 | gl_dirsep_regex='\/' | |
29643 | ;; | |
29644 | esac | |
29645 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
29646 | gl_header_literal_regex=`echo 'wchar.h' \ | |
29647 | | sed -e "$gl_make_literal_regex_sed"` | |
29648 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
29649 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
29650 | s|^/[^/]|//&| | |
29651 | p | |
29652 | q | |
29653 | }' | |
29654 | ||
29655 | gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
29656 | sed -n "$gl_absolute_header_sed"` | |
29657 | ||
29658 | gl_header=$gl_cv_absolute_wchar_h | |
29659 | gl_cv_next_wchar_h='"'$gl_header'"' | |
8690e634 JK |
29660 | else |
29661 | gl_cv_next_wchar_h='<'wchar.h'>' | |
29662 | fi | |
29663 | ||
29664 | ||
29665 | fi | |
29666 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5 | |
29667 | $as_echo "$gl_cv_next_wchar_h" >&6; } | |
29668 | fi | |
29669 | NEXT_WCHAR_H=$gl_cv_next_wchar_h | |
29670 | ||
29671 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
29672 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
29673 | gl_next_as_first_directive='<'wchar.h'>' | |
29674 | else | |
29675 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
29676 | gl_next_as_first_directive=$gl_cv_next_wchar_h | |
29677 | fi | |
29678 | NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive | |
29679 | ||
29680 | ||
29681 | ||
29682 | ||
29683 | if test $ac_cv_header_wchar_h = yes; then | |
29684 | HAVE_WCHAR_H=1 | |
29685 | else | |
29686 | HAVE_WCHAR_H=0 | |
29687 | fi | |
29688 | ||
c971b7fa PA |
29689 | |
29690 | ||
29691 | ||
29692 | ||
8690e634 JK |
29693 | if test $gt_cv_c_wint_t = yes; then |
29694 | HAVE_WINT_T=1 | |
29695 | else | |
29696 | HAVE_WINT_T=0 | |
29697 | fi | |
c971b7fa PA |
29698 | |
29699 | ||
29700 | ||
8690e634 JK |
29701 | |
29702 | ||
29703 | ||
29704 | ||
29705 | ||
472fa5ee SM |
29706 | |
29707 | ||
9c9d63b1 PM |
29708 | ac_fn_c_check_decl "$LINENO" "wcsdup" "ac_cv_have_decl_wcsdup" " |
29709 | #include <wchar.h> | |
29710 | ||
29711 | " | |
29712 | if test "x$ac_cv_have_decl_wcsdup" = xyes; then : | |
29713 | ac_have_decl=1 | |
29714 | else | |
29715 | ac_have_decl=0 | |
29716 | fi | |
29717 | ||
29718 | cat >>confdefs.h <<_ACEOF | |
29719 | #define HAVE_DECL_WCSDUP $ac_have_decl | |
29720 | _ACEOF | |
29721 | ||
29722 | if test $ac_cv_have_decl_wcsdup = no; then | |
29723 | HAVE_DECL_WCSDUP=0 | |
29724 | fi | |
29725 | ||
472fa5ee SM |
29726 | |
29727 | ||
29728 | ||
698be2d8 CB |
29729 | |
29730 | ||
8690e634 JK |
29731 | if test $ac_cv_func_iswcntrl = yes; then |
29732 | HAVE_ISWCNTRL=1 | |
29733 | else | |
29734 | HAVE_ISWCNTRL=0 | |
29735 | fi | |
29736 | ||
29737 | ||
29738 | ||
8690e634 JK |
29739 | if test $gt_cv_c_wint_t = yes; then |
29740 | HAVE_WINT_T=1 | |
29741 | else | |
29742 | HAVE_WINT_T=0 | |
29743 | fi | |
29744 | ||
29745 | ||
29746 | ||
29747 | ||
29748 | ||
29749 | ||
c971b7fa | 29750 | |
8690e634 | 29751 | |
472fa5ee SM |
29752 | |
29753 | ||
c971b7fa PA |
29754 | |
29755 | ||
29756 | ||
29757 | if test $gl_cv_have_include_next = yes; then | |
8690e634 | 29758 | gl_cv_next_wctype_h='<'wctype.h'>' |
c971b7fa | 29759 | else |
8690e634 JK |
29760 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5 |
29761 | $as_echo_n "checking absolute name of <wctype.h>... " >&6; } | |
d0ac1c44 | 29762 | if ${gl_cv_next_wctype_h+:} false; then : |
c971b7fa PA |
29763 | $as_echo_n "(cached) " >&6 |
29764 | else | |
29765 | ||
8690e634 JK |
29766 | if test $ac_cv_header_wctype_h = yes; then |
29767 | ||
29768 | ||
4a626d0a PA |
29769 | |
29770 | ||
29771 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c971b7fa | 29772 | /* end confdefs.h. */ |
8690e634 | 29773 | #include <wctype.h> |
c971b7fa | 29774 | _ACEOF |
4a626d0a PA |
29775 | case "$host_os" in |
29776 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
29777 | *) gl_absname_cpp="$ac_cpp" ;; | |
29778 | esac | |
29779 | ||
29780 | case "$host_os" in | |
29781 | mingw*) | |
29782 | gl_dirsep_regex='[/\\]' | |
29783 | ;; | |
29784 | *) | |
29785 | gl_dirsep_regex='\/' | |
29786 | ;; | |
29787 | esac | |
29788 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
29789 | gl_header_literal_regex=`echo 'wctype.h' \ | |
29790 | | sed -e "$gl_make_literal_regex_sed"` | |
29791 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
29792 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
29793 | s|^/[^/]|//&| | |
29794 | p | |
29795 | q | |
29796 | }' | |
29797 | ||
29798 | gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
29799 | sed -n "$gl_absolute_header_sed"` | |
29800 | ||
29801 | gl_header=$gl_cv_absolute_wctype_h | |
29802 | gl_cv_next_wctype_h='"'$gl_header'"' | |
8690e634 JK |
29803 | else |
29804 | gl_cv_next_wctype_h='<'wctype.h'>' | |
29805 | fi | |
c971b7fa PA |
29806 | |
29807 | ||
29808 | fi | |
8690e634 JK |
29809 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 |
29810 | $as_echo "$gl_cv_next_wctype_h" >&6; } | |
c971b7fa | 29811 | fi |
8690e634 | 29812 | NEXT_WCTYPE_H=$gl_cv_next_wctype_h |
c971b7fa PA |
29813 | |
29814 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
29815 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
8690e634 | 29816 | gl_next_as_first_directive='<'wctype.h'>' |
c971b7fa PA |
29817 | else |
29818 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
8690e634 | 29819 | gl_next_as_first_directive=$gl_cv_next_wctype_h |
c971b7fa | 29820 | fi |
8690e634 JK |
29821 | NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive |
29822 | ||
29823 | ||
29824 | ||
29825 | ||
29826 | if test $ac_cv_header_wctype_h = yes; then | |
29827 | if test $ac_cv_func_iswcntrl = yes; then | |
29828 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 | |
29829 | $as_echo_n "checking whether iswcntrl works... " >&6; } | |
d0ac1c44 | 29830 | if ${gl_cv_func_iswcntrl_works+:} false; then : |
8690e634 JK |
29831 | $as_echo_n "(cached) " >&6 |
29832 | else | |
29833 | ||
29834 | if test "$cross_compiling" = yes; then : | |
c0c3707f | 29835 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8690e634 JK |
29836 | /* end confdefs.h. */ |
29837 | #include <stdlib.h> | |
29838 | #if __GNU_LIBRARY__ == 1 | |
29839 | Linux libc5 i18n is broken. | |
29840 | #endif | |
29841 | int | |
29842 | main () | |
29843 | { | |
29844 | ||
29845 | ; | |
29846 | return 0; | |
29847 | } | |
29848 | _ACEOF | |
29849 | if ac_fn_c_try_compile "$LINENO"; then : | |
29850 | gl_cv_func_iswcntrl_works="guessing yes" | |
29851 | else | |
29852 | gl_cv_func_iswcntrl_works="guessing no" | |
29853 | fi | |
29854 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
29855 | ||
29856 | else | |
29857 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29858 | /* end confdefs.h. */ | |
29859 | ||
8690e634 JK |
29860 | #include <wchar.h> |
29861 | #include <wctype.h> | |
29862 | int main () { return iswprint ('x') == 0; } | |
29863 | ||
29864 | _ACEOF | |
29865 | if ac_fn_c_try_run "$LINENO"; then : | |
29866 | gl_cv_func_iswcntrl_works=yes | |
29867 | else | |
29868 | gl_cv_func_iswcntrl_works=no | |
29869 | fi | |
29870 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
29871 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
29872 | fi | |
29873 | ||
29874 | ||
29875 | fi | |
29876 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 | |
29877 | $as_echo "$gl_cv_func_iswcntrl_works" >&6; } | |
29878 | fi | |
29879 | HAVE_WCTYPE_H=1 | |
29880 | else | |
29881 | HAVE_WCTYPE_H=0 | |
29882 | fi | |
29883 | ||
29884 | ||
c0c3707f CB |
29885 | if test $GNULIB_OVERRIDES_WINT_T = 1; then |
29886 | REPLACE_ISWCNTRL=1 | |
29887 | else | |
29888 | case "$gl_cv_func_iswcntrl_works" in | |
29889 | *yes) REPLACE_ISWCNTRL=0 ;; | |
29890 | *) REPLACE_ISWCNTRL=1 ;; | |
29891 | esac | |
29892 | fi | |
8690e634 JK |
29893 | |
29894 | ||
29895 | if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then | |
29896 | : | |
29897 | fi | |
29898 | ||
29899 | if test $REPLACE_ISWCNTRL = 1; then | |
29900 | REPLACE_TOWLOWER=1 | |
29901 | else | |
29902 | for ac_func in towlower | |
29903 | do : | |
29904 | ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" | |
d0ac1c44 | 29905 | if test "x$ac_cv_func_towlower" = xyes; then : |
8690e634 JK |
29906 | cat >>confdefs.h <<_ACEOF |
29907 | #define HAVE_TOWLOWER 1 | |
29908 | _ACEOF | |
29909 | ||
29910 | fi | |
29911 | done | |
29912 | ||
29913 | if test $ac_cv_func_towlower = yes; then | |
29914 | REPLACE_TOWLOWER=0 | |
29915 | else | |
9c9d63b1 | 29916 | ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "#include <wchar.h> |
8690e634 JK |
29917 | #if HAVE_WCTYPE_H |
29918 | # include <wctype.h> | |
29919 | #endif | |
29920 | ||
29921 | " | |
d0ac1c44 | 29922 | if test "x$ac_cv_have_decl_towlower" = xyes; then : |
8690e634 JK |
29923 | ac_have_decl=1 |
29924 | else | |
29925 | ac_have_decl=0 | |
29926 | fi | |
29927 | ||
29928 | cat >>confdefs.h <<_ACEOF | |
29929 | #define HAVE_DECL_TOWLOWER $ac_have_decl | |
29930 | _ACEOF | |
29931 | ||
29932 | if test $ac_cv_have_decl_towlower = yes; then | |
29933 | REPLACE_TOWLOWER=1 | |
29934 | else | |
29935 | REPLACE_TOWLOWER=0 | |
29936 | fi | |
29937 | fi | |
29938 | fi | |
29939 | ||
29940 | ||
29941 | if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then | |
29942 | : | |
29943 | fi | |
29944 | ||
29945 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 | |
29946 | $as_echo_n "checking for wctype_t... " >&6; } | |
d0ac1c44 | 29947 | if ${gl_cv_type_wctype_t+:} false; then : |
8690e634 JK |
29948 | $as_echo_n "(cached) " >&6 |
29949 | else | |
29950 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29951 | /* end confdefs.h. */ | |
9c9d63b1 | 29952 | #include <wchar.h> |
8690e634 JK |
29953 | #if HAVE_WCTYPE_H |
29954 | # include <wctype.h> | |
29955 | #endif | |
29956 | wctype_t a; | |
29957 | ||
29958 | int | |
29959 | main () | |
29960 | { | |
29961 | ||
29962 | ; | |
29963 | return 0; | |
29964 | } | |
29965 | _ACEOF | |
29966 | if ac_fn_c_try_compile "$LINENO"; then : | |
29967 | gl_cv_type_wctype_t=yes | |
29968 | else | |
29969 | gl_cv_type_wctype_t=no | |
29970 | fi | |
29971 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c971b7fa | 29972 | |
8690e634 JK |
29973 | fi |
29974 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 | |
29975 | $as_echo "$gl_cv_type_wctype_t" >&6; } | |
29976 | if test $gl_cv_type_wctype_t = no; then | |
29977 | HAVE_WCTYPE_T=0 | |
29978 | fi | |
29979 | ||
29980 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 | |
29981 | $as_echo_n "checking for wctrans_t... " >&6; } | |
d0ac1c44 | 29982 | if ${gl_cv_type_wctrans_t+:} false; then : |
8690e634 JK |
29983 | $as_echo_n "(cached) " >&6 |
29984 | else | |
29985 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
29986 | /* end confdefs.h. */ | |
9c9d63b1 | 29987 | #include <wchar.h> |
8690e634 JK |
29988 | #include <wctype.h> |
29989 | wctrans_t a; | |
c971b7fa | 29990 | |
8690e634 JK |
29991 | int |
29992 | main () | |
29993 | { | |
c971b7fa | 29994 | |
8690e634 JK |
29995 | ; |
29996 | return 0; | |
29997 | } | |
29998 | _ACEOF | |
29999 | if ac_fn_c_try_compile "$LINENO"; then : | |
30000 | gl_cv_type_wctrans_t=yes | |
30001 | else | |
30002 | gl_cv_type_wctrans_t=no | |
30003 | fi | |
30004 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c971b7fa | 30005 | |
8690e634 JK |
30006 | fi |
30007 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 | |
30008 | $as_echo "$gl_cv_type_wctrans_t" >&6; } | |
30009 | if test $gl_cv_type_wctrans_t = no; then | |
30010 | HAVE_WCTRANS_T=0 | |
c971b7fa PA |
30011 | fi |
30012 | ||
30013 | ||
5e8754f9 | 30014 | |
5e8754f9 | 30015 | |
c971b7fa | 30016 | |
c0c3707f CB |
30017 | |
30018 | case "$host_os" in | |
30019 | mingw*) | |
30020 | ||
30021 | ||
30022 | ||
30023 | ||
30024 | ||
30025 | ||
30026 | ||
30027 | ||
30028 | gl_LIBOBJS="$gl_LIBOBJS windows-mutex.$ac_objext" | |
30029 | ||
30030 | ;; | |
30031 | esac | |
30032 | ||
30033 | case "$host_os" in | |
30034 | mingw*) | |
30035 | ||
30036 | ||
30037 | ||
30038 | ||
30039 | ||
30040 | ||
30041 | ||
30042 | ||
30043 | gl_LIBOBJS="$gl_LIBOBJS windows-once.$ac_objext" | |
30044 | ||
30045 | ;; | |
30046 | esac | |
30047 | ||
30048 | case "$host_os" in | |
30049 | mingw*) | |
30050 | ||
30051 | ||
c971b7fa PA |
30052 | |
30053 | ||
c0c3707f CB |
30054 | |
30055 | ||
30056 | ||
30057 | ||
30058 | gl_LIBOBJS="$gl_LIBOBJS windows-recmutex.$ac_objext" | |
30059 | ||
30060 | ;; | |
30061 | esac | |
30062 | ||
30063 | case "$host_os" in | |
30064 | mingw*) | |
30065 | ||
30066 | ||
30067 | ||
30068 | ||
30069 | ||
30070 | ||
30071 | ||
30072 | ||
30073 | gl_LIBOBJS="$gl_LIBOBJS windows-rwlock.$ac_objext" | |
30074 | ||
30075 | ;; | |
30076 | esac | |
698be2d8 CB |
30077 | |
30078 | ||
30079 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wmemchr" >&5 | |
30080 | $as_echo_n "checking for wmemchr... " >&6; } | |
30081 | if ${gl_cv_func_wmemchr+:} false; then : | |
30082 | $as_echo_n "(cached) " >&6 | |
30083 | else | |
30084 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
30085 | /* end confdefs.h. */ | |
698be2d8 CB |
30086 | #include <wchar.h> |
30087 | ||
30088 | int | |
30089 | main () | |
30090 | { | |
30091 | return ! wmemchr ((const wchar_t *) 0, (wchar_t) ' ', 0); | |
30092 | ; | |
30093 | return 0; | |
30094 | } | |
30095 | ||
30096 | _ACEOF | |
30097 | if ac_fn_c_try_link "$LINENO"; then : | |
30098 | gl_cv_func_wmemchr=yes | |
30099 | else | |
30100 | gl_cv_func_wmemchr=no | |
30101 | fi | |
30102 | rm -f core conftest.err conftest.$ac_objext \ | |
30103 | conftest$ac_exeext conftest.$ac_ext | |
30104 | ||
30105 | fi | |
30106 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wmemchr" >&5 | |
30107 | $as_echo "$gl_cv_func_wmemchr" >&6; } | |
30108 | if test $gl_cv_func_wmemchr = no; then | |
30109 | HAVE_WMEMCHR=0 | |
30110 | fi | |
30111 | ||
30112 | if test $HAVE_WMEMCHR = 0; then | |
30113 | ||
30114 | ||
30115 | ||
30116 | ||
30117 | ||
30118 | ||
30119 | ||
30120 | ||
30121 | gl_LIBOBJS="$gl_LIBOBJS wmemchr.$ac_objext" | |
30122 | ||
30123 | fi | |
30124 | ||
30125 | ||
30126 | ||
30127 | ||
30128 | ||
30129 | GNULIB_WMEMCHR=1 | |
30130 | ||
30131 | ||
30132 | ||
30133 | ||
30134 | ||
30135 | $as_echo "#define GNULIB_TEST_WMEMCHR 1" >>confdefs.h | |
30136 | ||
30137 | ||
30138 | ||
30139 | ||
30140 | ||
30141 | ||
30142 | ||
30143 | ||
30144 | ||
30145 | ||
30146 | ||
30147 | if test $ac_cv_func_wmempcpy = no; then | |
30148 | HAVE_WMEMPCPY=0 | |
30149 | fi | |
30150 | ||
30151 | if test $HAVE_WMEMPCPY = 0; then | |
30152 | ||
30153 | ||
30154 | ||
30155 | ||
30156 | ||
30157 | ||
30158 | ||
30159 | ||
30160 | gl_LIBOBJS="$gl_LIBOBJS wmempcpy.$ac_objext" | |
30161 | ||
30162 | fi | |
30163 | ||
30164 | ||
30165 | ||
30166 | ||
30167 | ||
30168 | GNULIB_WMEMPCPY=1 | |
30169 | ||
30170 | ||
30171 | ||
30172 | ||
30173 | ||
30174 | $as_echo "#define GNULIB_TEST_WMEMPCPY 1" >>confdefs.h | |
30175 | ||
30176 | ||
30177 | ||
c971b7fa PA |
30178 | # End of code from modules |
30179 | ||
30180 | ||
30181 | ||
30182 | ||
30183 | ||
30184 | ||
30185 | ||
30186 | ||
30187 | ||
30188 | gltests_libdeps= | |
30189 | gltests_ltlibdeps= | |
30190 | ||
30191 | ||
30192 | ||
30193 | ||
30194 | ||
30195 | ||
30196 | ||
30197 | ||
30198 | ||
5df4cba6 | 30199 | |
c971b7fa PA |
30200 | gl_source_base='tests' |
30201 | 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 | |
30202 | ||
30203 | gl_module_indicator_condition=$gltests_WITNESS | |
30204 | ||
30205 | ||
30206 | ||
30207 | ||
30208 | ||
30209 | ||
30210 | ||
30211 | ||
30212 | ||
30213 | LIBGNU_LIBDEPS="$gl_libdeps" | |
30214 | ||
30215 | LIBGNU_LTLIBDEPS="$gl_ltlibdeps" | |
30216 | ||
30217 | ||
30218 | ||
d0ac1c44 | 30219 | am__api_version='1.15' |
c971b7fa PA |
30220 | |
30221 | # Find a good install program. We prefer a C program (faster), | |
30222 | # so one script is as good as another. But avoid the broken or | |
30223 | # incompatible versions: | |
30224 | # SysV /etc/install, /usr/sbin/install | |
30225 | # SunOS /usr/etc/install | |
30226 | # IRIX /sbin/install | |
30227 | # AIX /bin/install | |
30228 | # AmigaOS /C/install, which installs bootblocks on floppy discs | |
30229 | # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag | |
30230 | # AFS /usr/afsws/bin/install, which mishandles nonexistent args | |
30231 | # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" | |
30232 | # OS/2's system install, which has a completely different semantic | |
30233 | # ./install, which can be erroneously created by make from ./install.sh. | |
30234 | # Reject install programs that cannot install multiple files. | |
30235 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 | |
30236 | $as_echo_n "checking for a BSD-compatible install... " >&6; } | |
30237 | if test -z "$INSTALL"; then | |
d0ac1c44 | 30238 | if ${ac_cv_path_install+:} false; then : |
c971b7fa PA |
30239 | $as_echo_n "(cached) " >&6 |
30240 | else | |
30241 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
30242 | for as_dir in $PATH | |
30243 | do | |
30244 | IFS=$as_save_IFS | |
30245 | test -z "$as_dir" && as_dir=. | |
30246 | # Account for people who put trailing slashes in PATH elements. | |
30247 | case $as_dir/ in #(( | |
30248 | ./ | .// | /[cC]/* | \ | |
30249 | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ | |
30250 | ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ | |
30251 | /usr/ucb/* ) ;; | |
30252 | *) | |
30253 | # OSF1 and SCO ODT 3.0 have their own names for install. | |
30254 | # Don't use installbsd from OSF since it installs stuff as root | |
30255 | # by default. | |
30256 | for ac_prog in ginstall scoinst install; do | |
30257 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 30258 | if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then |
c971b7fa PA |
30259 | if test $ac_prog = install && |
30260 | grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then | |
30261 | # AIX install. It has an incompatible calling convention. | |
30262 | : | |
30263 | elif test $ac_prog = install && | |
30264 | grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then | |
30265 | # program-specific install script used by HP pwplus--don't use. | |
30266 | : | |
30267 | else | |
30268 | rm -rf conftest.one conftest.two conftest.dir | |
30269 | echo one > conftest.one | |
30270 | echo two > conftest.two | |
30271 | mkdir conftest.dir | |
30272 | if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && | |
30273 | test -s conftest.one && test -s conftest.two && | |
30274 | test -s conftest.dir/conftest.one && | |
30275 | test -s conftest.dir/conftest.two | |
30276 | then | |
30277 | ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" | |
30278 | break 3 | |
30279 | fi | |
30280 | fi | |
30281 | fi | |
30282 | done | |
30283 | done | |
30284 | ;; | |
30285 | esac | |
30286 | ||
30287 | done | |
30288 | IFS=$as_save_IFS | |
30289 | ||
30290 | rm -rf conftest.one conftest.two conftest.dir | |
30291 | ||
30292 | fi | |
30293 | if test "${ac_cv_path_install+set}" = set; then | |
30294 | INSTALL=$ac_cv_path_install | |
30295 | else | |
30296 | # As a last resort, use the slow shell script. Don't cache a | |
30297 | # value for INSTALL within a source directory, because that will | |
30298 | # break other packages using the cache if that directory is | |
30299 | # removed, or if the value is a relative name. | |
30300 | INSTALL=$ac_install_sh | |
30301 | fi | |
30302 | fi | |
30303 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 | |
30304 | $as_echo "$INSTALL" >&6; } | |
30305 | ||
30306 | # Use test -z because SunOS4 sh mishandles braces in ${var-val}. | |
30307 | # It thinks the first close brace ends the variable substitution. | |
30308 | test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' | |
30309 | ||
30310 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' | |
30311 | ||
30312 | test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' | |
30313 | ||
30314 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 | |
30315 | $as_echo_n "checking whether build environment is sane... " >&6; } | |
c971b7fa PA |
30316 | # Reject unsafe characters in $srcdir or the absolute working directory |
30317 | # name. Accept space and tab only in the latter. | |
30318 | am_lf=' | |
30319 | ' | |
30320 | case `pwd` in | |
30321 | *[\\\"\#\$\&\'\`$am_lf]*) | |
d0ac1c44 | 30322 | as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; |
c971b7fa PA |
30323 | esac |
30324 | case $srcdir in | |
30325 | *[\\\"\#\$\&\'\`$am_lf\ \ ]*) | |
d0ac1c44 | 30326 | as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; |
c971b7fa PA |
30327 | esac |
30328 | ||
d0ac1c44 | 30329 | # Do 'set' in a subshell so we don't clobber the current shell's |
c971b7fa PA |
30330 | # arguments. Must try -L first in case configure is actually a |
30331 | # symlink; some systems play weird games with the mod time of symlinks | |
30332 | # (eg FreeBSD returns the mod time of the symlink's containing | |
30333 | # directory). | |
30334 | if ( | |
d0ac1c44 SM |
30335 | am_has_slept=no |
30336 | for am_try in 1 2; do | |
30337 | echo "timestamp, slept: $am_has_slept" > conftest.file | |
30338 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` | |
30339 | if test "$*" = "X"; then | |
30340 | # -L didn't work. | |
30341 | set X `ls -t "$srcdir/configure" conftest.file` | |
30342 | fi | |
30343 | if test "$*" != "X $srcdir/configure conftest.file" \ | |
30344 | && test "$*" != "X conftest.file $srcdir/configure"; then | |
30345 | ||
30346 | # If neither matched, then we have a broken ls. This can happen | |
30347 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
30348 | # broken ls alias from the environment. This has actually | |
30349 | # happened. Such a system could not be considered "sane". | |
30350 | as_fn_error $? "ls -t appears to fail. Make sure there is not a broken | |
30351 | alias in your environment" "$LINENO" 5 | |
30352 | fi | |
30353 | if test "$2" = conftest.file || test $am_try -eq 2; then | |
30354 | break | |
30355 | fi | |
30356 | # Just in case. | |
30357 | sleep 1 | |
30358 | am_has_slept=yes | |
30359 | done | |
c971b7fa PA |
30360 | test "$2" = conftest.file |
30361 | ) | |
30362 | then | |
30363 | # Ok. | |
30364 | : | |
30365 | else | |
d0ac1c44 | 30366 | as_fn_error $? "newly created file is older than distributed files! |
c971b7fa PA |
30367 | Check your system clock" "$LINENO" 5 |
30368 | fi | |
30369 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
30370 | $as_echo "yes" >&6; } | |
d0ac1c44 SM |
30371 | # If we didn't sleep, we still need to ensure time stamps of config.status and |
30372 | # generated files are strictly newer. | |
30373 | am_sleep_pid= | |
30374 | if grep 'slept: no' conftest.file >/dev/null 2>&1; then | |
30375 | ( sleep 1 ) & | |
30376 | am_sleep_pid=$! | |
30377 | fi | |
30378 | ||
30379 | rm -f conftest.file | |
30380 | ||
c971b7fa PA |
30381 | test "$program_prefix" != NONE && |
30382 | program_transform_name="s&^&$program_prefix&;$program_transform_name" | |
30383 | # Use a double $ so make ignores it. | |
30384 | test "$program_suffix" != NONE && | |
30385 | program_transform_name="s&\$&$program_suffix&;$program_transform_name" | |
30386 | # Double any \ or $. | |
30387 | # By default was `s,x,x', remove it if useless. | |
30388 | ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' | |
30389 | program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` | |
30390 | ||
c0c3707f CB |
30391 | # Expand $ac_aux_dir to an absolute path. |
30392 | am_aux_dir=`cd "$ac_aux_dir" && pwd` | |
30393 | ||
c971b7fa PA |
30394 | if test x"${MISSING+set}" != xset; then |
30395 | case $am_aux_dir in | |
30396 | *\ * | *\ *) | |
30397 | MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; | |
30398 | *) | |
30399 | MISSING="\${SHELL} $am_aux_dir/missing" ;; | |
30400 | esac | |
30401 | fi | |
30402 | # Use eval to expand $SHELL | |
d0ac1c44 SM |
30403 | if eval "$MISSING --is-lightweight"; then |
30404 | am_missing_run="$MISSING " | |
c971b7fa PA |
30405 | else |
30406 | am_missing_run= | |
d0ac1c44 SM |
30407 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 |
30408 | $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} | |
c971b7fa PA |
30409 | fi |
30410 | ||
d0ac1c44 | 30411 | if test x"${install_sh+set}" != xset; then |
c971b7fa PA |
30412 | case $am_aux_dir in |
30413 | *\ * | *\ *) | |
30414 | install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; | |
30415 | *) | |
30416 | install_sh="\${SHELL} $am_aux_dir/install-sh" | |
30417 | esac | |
30418 | fi | |
30419 | ||
d0ac1c44 SM |
30420 | # Installed binaries are usually stripped using 'strip' when the user |
30421 | # run "make install-strip". However 'strip' might not be the right | |
c971b7fa | 30422 | # tool to use in cross-compilation environments, therefore Automake |
d0ac1c44 | 30423 | # will honor the 'STRIP' environment variable to overrule this program. |
c971b7fa PA |
30424 | if test "$cross_compiling" != no; then |
30425 | if test -n "$ac_tool_prefix"; then | |
30426 | # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. | |
30427 | set dummy ${ac_tool_prefix}strip; ac_word=$2 | |
30428 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
30429 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 30430 | if ${ac_cv_prog_STRIP+:} false; then : |
c971b7fa PA |
30431 | $as_echo_n "(cached) " >&6 |
30432 | else | |
30433 | if test -n "$STRIP"; then | |
30434 | ac_cv_prog_STRIP="$STRIP" # Let the user override the test. | |
30435 | else | |
30436 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
30437 | for as_dir in $PATH | |
30438 | do | |
30439 | IFS=$as_save_IFS | |
30440 | test -z "$as_dir" && as_dir=. | |
30441 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 30442 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
30443 | ac_cv_prog_STRIP="${ac_tool_prefix}strip" |
30444 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
30445 | break 2 | |
30446 | fi | |
30447 | done | |
30448 | done | |
30449 | IFS=$as_save_IFS | |
30450 | ||
30451 | fi | |
30452 | fi | |
30453 | STRIP=$ac_cv_prog_STRIP | |
30454 | if test -n "$STRIP"; then | |
30455 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 | |
30456 | $as_echo "$STRIP" >&6; } | |
30457 | else | |
30458 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
30459 | $as_echo "no" >&6; } | |
30460 | fi | |
30461 | ||
30462 | ||
30463 | fi | |
30464 | if test -z "$ac_cv_prog_STRIP"; then | |
30465 | ac_ct_STRIP=$STRIP | |
30466 | # Extract the first word of "strip", so it can be a program name with args. | |
30467 | set dummy strip; ac_word=$2 | |
30468 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
30469 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 30470 | if ${ac_cv_prog_ac_ct_STRIP+:} false; then : |
c971b7fa PA |
30471 | $as_echo_n "(cached) " >&6 |
30472 | else | |
30473 | if test -n "$ac_ct_STRIP"; then | |
30474 | ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. | |
30475 | else | |
30476 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
30477 | for as_dir in $PATH | |
30478 | do | |
30479 | IFS=$as_save_IFS | |
30480 | test -z "$as_dir" && as_dir=. | |
30481 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 30482 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
30483 | ac_cv_prog_ac_ct_STRIP="strip" |
30484 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
30485 | break 2 | |
30486 | fi | |
30487 | done | |
30488 | done | |
30489 | IFS=$as_save_IFS | |
30490 | ||
30491 | fi | |
30492 | fi | |
30493 | ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP | |
30494 | if test -n "$ac_ct_STRIP"; then | |
30495 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 | |
30496 | $as_echo "$ac_ct_STRIP" >&6; } | |
30497 | else | |
30498 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
30499 | $as_echo "no" >&6; } | |
30500 | fi | |
30501 | ||
30502 | if test "x$ac_ct_STRIP" = x; then | |
30503 | STRIP=":" | |
30504 | else | |
30505 | case $cross_compiling:$ac_tool_warned in | |
30506 | yes:) | |
30507 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
30508 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
30509 | ac_tool_warned=yes ;; | |
30510 | esac | |
30511 | STRIP=$ac_ct_STRIP | |
30512 | fi | |
30513 | else | |
30514 | STRIP="$ac_cv_prog_STRIP" | |
30515 | fi | |
30516 | ||
30517 | fi | |
30518 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" | |
30519 | ||
c971b7fa PA |
30520 | for ac_prog in gawk mawk nawk awk |
30521 | do | |
30522 | # Extract the first word of "$ac_prog", so it can be a program name with args. | |
30523 | set dummy $ac_prog; ac_word=$2 | |
30524 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
30525 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 30526 | if ${ac_cv_prog_AWK+:} false; then : |
c971b7fa PA |
30527 | $as_echo_n "(cached) " >&6 |
30528 | else | |
30529 | if test -n "$AWK"; then | |
30530 | ac_cv_prog_AWK="$AWK" # Let the user override the test. | |
30531 | else | |
30532 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
30533 | for as_dir in $PATH | |
30534 | do | |
30535 | IFS=$as_save_IFS | |
30536 | test -z "$as_dir" && as_dir=. | |
30537 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 30538 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
30539 | ac_cv_prog_AWK="$ac_prog" |
30540 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
30541 | break 2 | |
30542 | fi | |
30543 | done | |
30544 | done | |
30545 | IFS=$as_save_IFS | |
30546 | ||
30547 | fi | |
30548 | fi | |
30549 | AWK=$ac_cv_prog_AWK | |
30550 | if test -n "$AWK"; then | |
30551 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 | |
30552 | $as_echo "$AWK" >&6; } | |
30553 | else | |
30554 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
30555 | $as_echo "no" >&6; } | |
30556 | fi | |
30557 | ||
30558 | ||
30559 | test -n "$AWK" && break | |
30560 | done | |
30561 | ||
30562 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 | |
30563 | $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } | |
30564 | set x ${MAKE-make} | |
30565 | ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` | |
d0ac1c44 | 30566 | if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : |
c971b7fa PA |
30567 | $as_echo_n "(cached) " >&6 |
30568 | else | |
30569 | cat >conftest.make <<\_ACEOF | |
30570 | SHELL = /bin/sh | |
30571 | all: | |
30572 | @echo '@@@%%%=$(MAKE)=@@@%%%' | |
30573 | _ACEOF | |
d0ac1c44 | 30574 | # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. |
c971b7fa PA |
30575 | case `${MAKE-make} -f conftest.make 2>/dev/null` in |
30576 | *@@@%%%=?*=@@@%%%*) | |
30577 | eval ac_cv_prog_make_${ac_make}_set=yes;; | |
30578 | *) | |
30579 | eval ac_cv_prog_make_${ac_make}_set=no;; | |
30580 | esac | |
30581 | rm -f conftest.make | |
30582 | fi | |
30583 | if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then | |
30584 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
30585 | $as_echo "yes" >&6; } | |
30586 | SET_MAKE= | |
30587 | else | |
30588 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
30589 | $as_echo "no" >&6; } | |
30590 | SET_MAKE="MAKE=${MAKE-make}" | |
30591 | fi | |
30592 | ||
30593 | rm -rf .tst 2>/dev/null | |
30594 | mkdir .tst 2>/dev/null | |
30595 | if test -d .tst; then | |
30596 | am__leading_dot=. | |
30597 | else | |
30598 | am__leading_dot=_ | |
30599 | fi | |
30600 | rmdir .tst 2>/dev/null | |
30601 | ||
30602 | DEPDIR="${am__leading_dot}deps" | |
30603 | ||
30604 | ac_config_commands="$ac_config_commands depfiles" | |
30605 | ||
30606 | ||
30607 | am_make=${MAKE-make} | |
30608 | cat > confinc << 'END' | |
30609 | am__doit: | |
30610 | @echo this is the am__doit target | |
30611 | .PHONY: am__doit | |
30612 | END | |
30613 | # If we don't find an include directive, just comment out the code. | |
30614 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 | |
30615 | $as_echo_n "checking for style of include used by $am_make... " >&6; } | |
30616 | am__include="#" | |
30617 | am__quote= | |
30618 | _am_result=none | |
30619 | # First try GNU make style include. | |
30620 | echo "include confinc" > confmf | |
d0ac1c44 | 30621 | # Ignore all kinds of additional output from 'make'. |
c971b7fa PA |
30622 | case `$am_make -s -f confmf 2> /dev/null` in #( |
30623 | *the\ am__doit\ target*) | |
30624 | am__include=include | |
30625 | am__quote= | |
30626 | _am_result=GNU | |
30627 | ;; | |
30628 | esac | |
30629 | # Now try BSD make style include. | |
30630 | if test "$am__include" = "#"; then | |
30631 | echo '.include "confinc"' > confmf | |
30632 | case `$am_make -s -f confmf 2> /dev/null` in #( | |
30633 | *the\ am__doit\ target*) | |
30634 | am__include=.include | |
30635 | am__quote="\"" | |
30636 | _am_result=BSD | |
30637 | ;; | |
30638 | esac | |
30639 | fi | |
30640 | ||
30641 | ||
30642 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 | |
30643 | $as_echo "$_am_result" >&6; } | |
30644 | rm -f confinc confmf | |
30645 | ||
30646 | # Check whether --enable-dependency-tracking was given. | |
30647 | if test "${enable_dependency_tracking+set}" = set; then : | |
30648 | enableval=$enable_dependency_tracking; | |
30649 | fi | |
30650 | ||
30651 | if test "x$enable_dependency_tracking" != xno; then | |
30652 | am_depcomp="$ac_aux_dir/depcomp" | |
30653 | AMDEPBACKSLASH='\' | |
d0ac1c44 | 30654 | am__nodep='_no' |
c971b7fa PA |
30655 | fi |
30656 | if test "x$enable_dependency_tracking" != xno; then | |
30657 | AMDEP_TRUE= | |
30658 | AMDEP_FALSE='#' | |
30659 | else | |
30660 | AMDEP_TRUE='#' | |
30661 | AMDEP_FALSE= | |
30662 | fi | |
30663 | ||
30664 | ||
d0ac1c44 SM |
30665 | # Check whether --enable-silent-rules was given. |
30666 | if test "${enable_silent_rules+set}" = set; then : | |
30667 | enableval=$enable_silent_rules; | |
30668 | fi | |
30669 | ||
30670 | case $enable_silent_rules in # ((( | |
30671 | yes) AM_DEFAULT_VERBOSITY=0;; | |
30672 | no) AM_DEFAULT_VERBOSITY=1;; | |
30673 | *) AM_DEFAULT_VERBOSITY=1;; | |
30674 | esac | |
30675 | am_make=${MAKE-make} | |
30676 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 | |
30677 | $as_echo_n "checking whether $am_make supports nested variables... " >&6; } | |
30678 | if ${am_cv_make_support_nested_variables+:} false; then : | |
30679 | $as_echo_n "(cached) " >&6 | |
30680 | else | |
30681 | if $as_echo 'TRUE=$(BAR$(V)) | |
30682 | BAR0=false | |
30683 | BAR1=true | |
30684 | V=1 | |
30685 | am__doit: | |
30686 | @$(TRUE) | |
30687 | .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then | |
30688 | am_cv_make_support_nested_variables=yes | |
30689 | else | |
30690 | am_cv_make_support_nested_variables=no | |
30691 | fi | |
30692 | fi | |
30693 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 | |
30694 | $as_echo "$am_cv_make_support_nested_variables" >&6; } | |
30695 | if test $am_cv_make_support_nested_variables = yes; then | |
30696 | AM_V='$(V)' | |
30697 | AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' | |
30698 | else | |
30699 | AM_V=$AM_DEFAULT_VERBOSITY | |
30700 | AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY | |
30701 | fi | |
30702 | AM_BACKSLASH='\' | |
30703 | ||
c971b7fa PA |
30704 | if test "`cd $srcdir && pwd`" != "`pwd`"; then |
30705 | # Use -I$(srcdir) only when $(srcdir) != ., so that make's output | |
30706 | # is not polluted with repeated "-I." | |
30707 | am__isrc=' -I$(srcdir)' | |
30708 | # test to see if srcdir already configured | |
30709 | if test -f $srcdir/config.status; then | |
d0ac1c44 | 30710 | as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 |
c971b7fa PA |
30711 | fi |
30712 | fi | |
30713 | ||
30714 | # test whether we have cygpath | |
30715 | if test -z "$CYGPATH_W"; then | |
30716 | if (cygpath --version) >/dev/null 2>/dev/null; then | |
30717 | CYGPATH_W='cygpath -w' | |
30718 | else | |
30719 | CYGPATH_W=echo | |
30720 | fi | |
30721 | fi | |
30722 | ||
30723 | ||
30724 | # Define the identity of the package. | |
d0ac1c44 SM |
30725 | PACKAGE='libgnu' |
30726 | VERSION='UNUSED-VERSION' | |
c971b7fa PA |
30727 | |
30728 | ||
30729 | # Some tools Automake needs. | |
30730 | ||
30731 | ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} | |
30732 | ||
30733 | ||
30734 | AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} | |
30735 | ||
30736 | ||
30737 | AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} | |
30738 | ||
30739 | ||
30740 | AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} | |
30741 | ||
30742 | ||
30743 | MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} | |
30744 | ||
d0ac1c44 SM |
30745 | # For better backward compatibility. To be removed once Automake 1.9.x |
30746 | # dies out for good. For more background, see: | |
30747 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> | |
30748 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> | |
30749 | mkdir_p='$(MKDIR_P)' | |
30750 | ||
30751 | # We need awk for the "check" target (and possibly the TAP driver). The | |
30752 | # system "awk" is bad on some platforms. | |
30753 | # Always define AMTAR for backward compatibility. Yes, it's still used | |
30754 | # in the wild :-( We should find a proper way to deprecate it ... | |
30755 | AMTAR='$${TAR-tar}' | |
30756 | ||
30757 | ||
30758 | # We'll loop over all known methods to create a tar archive until one works. | |
30759 | _am_tools='gnutar pax cpio none' | |
c971b7fa | 30760 | |
d0ac1c44 | 30761 | am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' |
c971b7fa | 30762 | |
c971b7fa PA |
30763 | |
30764 | ||
30765 | ||
30766 | ||
30767 | depcc="$CC" am_compiler_list= | |
30768 | ||
30769 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 | |
30770 | $as_echo_n "checking dependency style of $depcc... " >&6; } | |
d0ac1c44 | 30771 | if ${am_cv_CC_dependencies_compiler_type+:} false; then : |
c971b7fa PA |
30772 | $as_echo_n "(cached) " >&6 |
30773 | else | |
30774 | if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then | |
30775 | # We make a subdir and do the tests there. Otherwise we can end up | |
30776 | # making bogus files that we don't know about and never remove. For | |
30777 | # instance it was reported that on HP-UX the gcc test will end up | |
d0ac1c44 SM |
30778 | # making a dummy file named 'D' -- because '-MD' means "put the output |
30779 | # in D". | |
30780 | rm -rf conftest.dir | |
c971b7fa PA |
30781 | mkdir conftest.dir |
30782 | # Copy depcomp to subdir because otherwise we won't find it if we're | |
30783 | # using a relative directory. | |
30784 | cp "$am_depcomp" conftest.dir | |
30785 | cd conftest.dir | |
30786 | # We will build objects and dependencies in a subdirectory because | |
30787 | # it helps to detect inapplicable dependency modes. For instance | |
30788 | # both Tru64's cc and ICC support -MD to output dependencies as a | |
30789 | # side effect of compilation, but ICC will put the dependencies in | |
30790 | # the current directory while Tru64 will put them in the object | |
30791 | # directory. | |
30792 | mkdir sub | |
30793 | ||
30794 | am_cv_CC_dependencies_compiler_type=none | |
30795 | if test "$am_compiler_list" = ""; then | |
30796 | am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` | |
30797 | fi | |
30798 | am__universal=false | |
30799 | case " $depcc " in #( | |
30800 | *\ -arch\ *\ -arch\ *) am__universal=true ;; | |
30801 | esac | |
30802 | ||
30803 | for depmode in $am_compiler_list; do | |
30804 | # Setup a source with many dependencies, because some compilers | |
30805 | # like to wrap large dependency lists on column 80 (with \), and | |
30806 | # we should not choose a depcomp mode which is confused by this. | |
30807 | # | |
30808 | # We need to recreate these files for each test, as the compiler may | |
30809 | # overwrite some of them when testing with obscure command lines. | |
30810 | # This happens at least with the AIX C compiler. | |
30811 | : > sub/conftest.c | |
30812 | for i in 1 2 3 4 5 6; do | |
30813 | echo '#include "conftst'$i'.h"' >> sub/conftest.c | |
d0ac1c44 SM |
30814 | # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with |
30815 | # Solaris 10 /bin/sh. | |
30816 | echo '/* dummy */' > sub/conftst$i.h | |
c971b7fa PA |
30817 | done |
30818 | echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf | |
30819 | ||
d0ac1c44 | 30820 | # We check with '-c' and '-o' for the sake of the "dashmstdout" |
c971b7fa | 30821 | # mode. It turns out that the SunPro C++ compiler does not properly |
d0ac1c44 SM |
30822 | # handle '-M -o', and we need to detect this. Also, some Intel |
30823 | # versions had trouble with output in subdirs. | |
c971b7fa PA |
30824 | am__obj=sub/conftest.${OBJEXT-o} |
30825 | am__minus_obj="-o $am__obj" | |
30826 | case $depmode in | |
30827 | gcc) | |
30828 | # This depmode causes a compiler race in universal mode. | |
30829 | test "$am__universal" = false || continue | |
30830 | ;; | |
30831 | nosideeffect) | |
d0ac1c44 SM |
30832 | # After this tag, mechanisms are not by side-effect, so they'll |
30833 | # only be used when explicitly requested. | |
c971b7fa PA |
30834 | if test "x$enable_dependency_tracking" = xyes; then |
30835 | continue | |
30836 | else | |
30837 | break | |
30838 | fi | |
30839 | ;; | |
d0ac1c44 SM |
30840 | msvc7 | msvc7msys | msvisualcpp | msvcmsys) |
30841 | # This compiler won't grok '-c -o', but also, the minuso test has | |
c971b7fa PA |
30842 | # not run yet. These depmodes are late enough in the game, and |
30843 | # so weak that their functioning should not be impacted. | |
30844 | am__obj=conftest.${OBJEXT-o} | |
30845 | am__minus_obj= | |
30846 | ;; | |
30847 | none) break ;; | |
30848 | esac | |
30849 | if depmode=$depmode \ | |
30850 | source=sub/conftest.c object=$am__obj \ | |
30851 | depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ | |
30852 | $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ | |
30853 | >/dev/null 2>conftest.err && | |
30854 | grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && | |
30855 | grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && | |
30856 | grep $am__obj sub/conftest.Po > /dev/null 2>&1 && | |
30857 | ${MAKE-make} -s -f confmf > /dev/null 2>&1; then | |
30858 | # icc doesn't choke on unknown options, it will just issue warnings | |
30859 | # or remarks (even with -Werror). So we grep stderr for any message | |
30860 | # that says an option was ignored or not supported. | |
30861 | # When given -MP, icc 7.0 and 7.1 complain thusly: | |
30862 | # icc: Command line warning: ignoring option '-M'; no argument required | |
30863 | # The diagnosis changed in icc 8.0: | |
30864 | # icc: Command line remark: option '-MP' not supported | |
30865 | if (grep 'ignoring option' conftest.err || | |
30866 | grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else | |
30867 | am_cv_CC_dependencies_compiler_type=$depmode | |
30868 | break | |
30869 | fi | |
30870 | fi | |
30871 | done | |
30872 | ||
30873 | cd .. | |
30874 | rm -rf conftest.dir | |
30875 | else | |
30876 | am_cv_CC_dependencies_compiler_type=none | |
30877 | fi | |
30878 | ||
30879 | fi | |
30880 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 | |
30881 | $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } | |
30882 | CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type | |
30883 | ||
30884 | if | |
30885 | test "x$enable_dependency_tracking" != xno \ | |
30886 | && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then | |
30887 | am__fastdepCC_TRUE= | |
30888 | am__fastdepCC_FALSE='#' | |
30889 | else | |
30890 | am__fastdepCC_TRUE='#' | |
30891 | am__fastdepCC_FALSE= | |
30892 | fi | |
30893 | ||
30894 | ||
30895 | ||
d0ac1c44 SM |
30896 | # POSIX will say in a future version that running "rm -f" with no argument |
30897 | # is OK; and we want to be able to make that assumption in our Makefile | |
30898 | # recipes. So use an aggressive probe to check that the usage we want is | |
30899 | # actually supported "in the wild" to an acceptable degree. | |
30900 | # See automake bug#10828. | |
30901 | # To make any issue more visible, cause the running configure to be aborted | |
30902 | # by default if the 'rm' program in use doesn't match our expectations; the | |
30903 | # user can still override this though. | |
30904 | if rm -f && rm -fr && rm -rf; then : OK; else | |
30905 | cat >&2 <<'END' | |
30906 | Oops! | |
30907 | ||
30908 | Your 'rm' program seems unable to run without file operands specified | |
30909 | on the command line, even when the '-f' option is present. This is contrary | |
30910 | to the behaviour of most rm programs out there, and not conforming with | |
30911 | the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> | |
30912 | ||
30913 | Please tell bug-automake@gnu.org about your system, including the value | |
30914 | of your $PATH and any error possibly output before this message. This | |
30915 | can help us improve future automake versions. | |
30916 | ||
30917 | END | |
30918 | if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then | |
30919 | echo 'Configuration will proceed anyway, since you have set the' >&2 | |
30920 | echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 | |
30921 | echo >&2 | |
30922 | else | |
30923 | cat >&2 <<'END' | |
30924 | Aborting the configuration process, to ensure you take notice of the issue. | |
30925 | ||
30926 | You can download and install GNU coreutils to get an 'rm' implementation | |
30927 | that behaves properly: <http://www.gnu.org/software/coreutils/>. | |
30928 | ||
30929 | If you want to complete the configuration process using your problematic | |
30930 | 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM | |
30931 | to "yes", and re-run configure. | |
30932 | ||
30933 | END | |
30934 | as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 | |
30935 | fi | |
30936 | fi | |
30937 | ||
c971b7fa | 30938 | |
39be3c7e SM |
30939 | # Check whether --enable-silent-rules was given. |
30940 | if test "${enable_silent_rules+set}" = set; then : | |
30941 | enableval=$enable_silent_rules; | |
30942 | fi | |
30943 | ||
d0ac1c44 SM |
30944 | case $enable_silent_rules in # ((( |
30945 | yes) AM_DEFAULT_VERBOSITY=0;; | |
30946 | no) AM_DEFAULT_VERBOSITY=1;; | |
30947 | *) AM_DEFAULT_VERBOSITY=0;; | |
39be3c7e | 30948 | esac |
d0ac1c44 SM |
30949 | am_make=${MAKE-make} |
30950 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 | |
30951 | $as_echo_n "checking whether $am_make supports nested variables... " >&6; } | |
30952 | if ${am_cv_make_support_nested_variables+:} false; then : | |
30953 | $as_echo_n "(cached) " >&6 | |
30954 | else | |
30955 | if $as_echo 'TRUE=$(BAR$(V)) | |
30956 | BAR0=false | |
30957 | BAR1=true | |
30958 | V=1 | |
30959 | am__doit: | |
30960 | @$(TRUE) | |
30961 | .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then | |
30962 | am_cv_make_support_nested_variables=yes | |
30963 | else | |
30964 | am_cv_make_support_nested_variables=no | |
30965 | fi | |
30966 | fi | |
30967 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 | |
30968 | $as_echo "$am_cv_make_support_nested_variables" >&6; } | |
30969 | if test $am_cv_make_support_nested_variables = yes; then | |
30970 | AM_V='$(V)' | |
30971 | AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' | |
30972 | else | |
30973 | AM_V=$AM_DEFAULT_VERBOSITY | |
30974 | AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY | |
30975 | fi | |
39be3c7e SM |
30976 | AM_BACKSLASH='\' |
30977 | ||
30978 | ||
c971b7fa PA |
30979 | # --------------------- # |
30980 | # Checks for programs. # | |
30981 | # --------------------- # | |
30982 | ||
30983 | ||
30984 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 | |
30985 | $as_echo_n "checking whether ln -s works... " >&6; } | |
30986 | LN_S=$as_ln_s | |
30987 | if test "$LN_S" = "ln -s"; then | |
30988 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
30989 | $as_echo "yes" >&6; } | |
30990 | else | |
30991 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 | |
30992 | $as_echo "no, using $LN_S" >&6; } | |
30993 | fi | |
30994 | ||
30995 | if test -n "$ac_tool_prefix"; then | |
30996 | # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. | |
30997 | set dummy ${ac_tool_prefix}ranlib; ac_word=$2 | |
30998 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
30999 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 31000 | if ${ac_cv_prog_RANLIB+:} false; then : |
c971b7fa PA |
31001 | $as_echo_n "(cached) " >&6 |
31002 | else | |
31003 | if test -n "$RANLIB"; then | |
31004 | ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. | |
31005 | else | |
31006 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
31007 | for as_dir in $PATH | |
31008 | do | |
31009 | IFS=$as_save_IFS | |
31010 | test -z "$as_dir" && as_dir=. | |
31011 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 31012 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
31013 | ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" |
31014 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
31015 | break 2 | |
31016 | fi | |
31017 | done | |
31018 | done | |
31019 | IFS=$as_save_IFS | |
31020 | ||
31021 | fi | |
31022 | fi | |
31023 | RANLIB=$ac_cv_prog_RANLIB | |
31024 | if test -n "$RANLIB"; then | |
31025 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 | |
31026 | $as_echo "$RANLIB" >&6; } | |
31027 | else | |
31028 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
31029 | $as_echo "no" >&6; } | |
31030 | fi | |
31031 | ||
31032 | ||
31033 | fi | |
31034 | if test -z "$ac_cv_prog_RANLIB"; then | |
31035 | ac_ct_RANLIB=$RANLIB | |
31036 | # Extract the first word of "ranlib", so it can be a program name with args. | |
31037 | set dummy ranlib; ac_word=$2 | |
31038 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
31039 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 31040 | if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : |
c971b7fa PA |
31041 | $as_echo_n "(cached) " >&6 |
31042 | else | |
31043 | if test -n "$ac_ct_RANLIB"; then | |
31044 | ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. | |
31045 | else | |
31046 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
31047 | for as_dir in $PATH | |
31048 | do | |
31049 | IFS=$as_save_IFS | |
31050 | test -z "$as_dir" && as_dir=. | |
31051 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 31052 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
31053 | ac_cv_prog_ac_ct_RANLIB="ranlib" |
31054 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
31055 | break 2 | |
31056 | fi | |
31057 | done | |
31058 | done | |
31059 | IFS=$as_save_IFS | |
31060 | ||
31061 | fi | |
31062 | fi | |
31063 | ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB | |
31064 | if test -n "$ac_ct_RANLIB"; then | |
31065 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 | |
31066 | $as_echo "$ac_ct_RANLIB" >&6; } | |
31067 | else | |
31068 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
31069 | $as_echo "no" >&6; } | |
31070 | fi | |
31071 | ||
31072 | if test "x$ac_ct_RANLIB" = x; then | |
31073 | RANLIB=":" | |
31074 | else | |
31075 | case $cross_compiling:$ac_tool_warned in | |
31076 | yes:) | |
31077 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
31078 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
31079 | ac_tool_warned=yes ;; | |
31080 | esac | |
31081 | RANLIB=$ac_ct_RANLIB | |
31082 | fi | |
31083 | else | |
31084 | RANLIB="$ac_cv_prog_RANLIB" | |
31085 | fi | |
31086 | ||
31087 | ||
31088 | if test -n "$ac_tool_prefix"; then | |
31089 | # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. | |
31090 | set dummy ${ac_tool_prefix}ar; ac_word=$2 | |
31091 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
31092 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 31093 | if ${ac_cv_prog_AR+:} false; then : |
c971b7fa PA |
31094 | $as_echo_n "(cached) " >&6 |
31095 | else | |
31096 | if test -n "$AR"; then | |
31097 | ac_cv_prog_AR="$AR" # Let the user override the test. | |
31098 | else | |
31099 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
31100 | for as_dir in $PATH | |
31101 | do | |
31102 | IFS=$as_save_IFS | |
31103 | test -z "$as_dir" && as_dir=. | |
31104 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 31105 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
31106 | ac_cv_prog_AR="${ac_tool_prefix}ar" |
31107 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
31108 | break 2 | |
31109 | fi | |
31110 | done | |
31111 | done | |
31112 | IFS=$as_save_IFS | |
31113 | ||
31114 | fi | |
31115 | fi | |
31116 | AR=$ac_cv_prog_AR | |
31117 | if test -n "$AR"; then | |
31118 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 | |
31119 | $as_echo "$AR" >&6; } | |
31120 | else | |
31121 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
31122 | $as_echo "no" >&6; } | |
31123 | fi | |
31124 | ||
31125 | ||
31126 | fi | |
31127 | if test -z "$ac_cv_prog_AR"; then | |
31128 | ac_ct_AR=$AR | |
31129 | # Extract the first word of "ar", so it can be a program name with args. | |
31130 | set dummy ar; ac_word=$2 | |
31131 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
31132 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 31133 | if ${ac_cv_prog_ac_ct_AR+:} false; then : |
c971b7fa PA |
31134 | $as_echo_n "(cached) " >&6 |
31135 | else | |
31136 | if test -n "$ac_ct_AR"; then | |
31137 | ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. | |
31138 | else | |
31139 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
31140 | for as_dir in $PATH | |
31141 | do | |
31142 | IFS=$as_save_IFS | |
31143 | test -z "$as_dir" && as_dir=. | |
31144 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 31145 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
31146 | ac_cv_prog_ac_ct_AR="ar" |
31147 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
31148 | break 2 | |
31149 | fi | |
31150 | done | |
31151 | done | |
31152 | IFS=$as_save_IFS | |
31153 | ||
31154 | fi | |
31155 | fi | |
31156 | ac_ct_AR=$ac_cv_prog_ac_ct_AR | |
31157 | if test -n "$ac_ct_AR"; then | |
31158 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 | |
31159 | $as_echo "$ac_ct_AR" >&6; } | |
31160 | else | |
31161 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
31162 | $as_echo "no" >&6; } | |
31163 | fi | |
31164 | ||
31165 | if test "x$ac_ct_AR" = x; then | |
31166 | AR="" | |
31167 | else | |
31168 | case $cross_compiling:$ac_tool_warned in | |
31169 | yes:) | |
31170 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
31171 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
31172 | ac_tool_warned=yes ;; | |
31173 | esac | |
31174 | AR=$ac_ct_AR | |
31175 | fi | |
31176 | else | |
31177 | AR="$ac_cv_prog_AR" | |
31178 | fi | |
31179 | ||
31180 | ||
31181 | # ---------------------- # | |
31182 | # Checks for libraries. # | |
31183 | # ---------------------- # | |
31184 | ||
361cb219 AB |
31185 | ac_config_files="$ac_config_files Makefile.gnulib.inc" |
31186 | ||
31187 | ||
c971b7fa PA |
31188 | ac_config_files="$ac_config_files Makefile import/Makefile" |
31189 | ||
31190 | ac_config_commands="$ac_config_commands default" | |
31191 | ||
31192 | cat >confcache <<\_ACEOF | |
31193 | # This file is a shell script that caches the results of configure | |
31194 | # tests run on this system so they can be shared between configure | |
31195 | # scripts and configure runs, see configure's option --config-cache. | |
31196 | # It is not useful on other systems. If it contains results you don't | |
31197 | # want to keep, you may remove or edit it. | |
31198 | # | |
31199 | # config.status only pays attention to the cache file if you give it | |
31200 | # the --recheck option to rerun configure. | |
31201 | # | |
31202 | # `ac_cv_env_foo' variables (set or unset) will be overridden when | |
31203 | # loading this file, other *unset* `ac_cv_foo' will be assigned the | |
31204 | # following values. | |
31205 | ||
31206 | _ACEOF | |
31207 | ||
31208 | # The following way of writing the cache mishandles newlines in values, | |
31209 | # but we know of no workaround that is simple, portable, and efficient. | |
31210 | # So, we kill variables containing newlines. | |
31211 | # Ultrix sh set writes to stderr and can't be redirected directly, | |
31212 | # and sets the high bit in the cache file unless we assign to the vars. | |
31213 | ( | |
31214 | for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do | |
31215 | eval ac_val=\$$ac_var | |
31216 | case $ac_val in #( | |
31217 | *${as_nl}*) | |
31218 | case $ac_var in #( | |
31219 | *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 | |
31220 | $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; | |
31221 | esac | |
31222 | case $ac_var in #( | |
31223 | _ | IFS | as_nl) ;; #( | |
31224 | BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( | |
31225 | *) { eval $ac_var=; unset $ac_var;} ;; | |
31226 | esac ;; | |
31227 | esac | |
31228 | done | |
31229 | ||
31230 | (set) 2>&1 | | |
31231 | case $as_nl`(ac_space=' '; set) 2>&1` in #( | |
31232 | *${as_nl}ac_space=\ *) | |
31233 | # `set' does not quote correctly, so add quotes: double-quote | |
31234 | # substitution turns \\\\ into \\, and sed turns \\ into \. | |
31235 | sed -n \ | |
31236 | "s/'/'\\\\''/g; | |
31237 | s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" | |
31238 | ;; #( | |
31239 | *) | |
31240 | # `set' quotes correctly as required by POSIX, so do not add quotes. | |
31241 | sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" | |
31242 | ;; | |
31243 | esac | | |
31244 | sort | |
31245 | ) | | |
31246 | sed ' | |
31247 | /^ac_cv_env_/b end | |
31248 | t clear | |
31249 | :clear | |
31250 | s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ | |
31251 | t end | |
31252 | s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ | |
31253 | :end' >>confcache | |
31254 | if diff "$cache_file" confcache >/dev/null 2>&1; then :; else | |
31255 | if test -w "$cache_file"; then | |
d0ac1c44 | 31256 | if test "x$cache_file" != "x/dev/null"; then |
c971b7fa PA |
31257 | { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 |
31258 | $as_echo "$as_me: updating cache $cache_file" >&6;} | |
d0ac1c44 SM |
31259 | if test ! -f "$cache_file" || test -h "$cache_file"; then |
31260 | cat confcache >"$cache_file" | |
31261 | else | |
31262 | case $cache_file in #( | |
31263 | */* | ?:*) | |
31264 | mv -f confcache "$cache_file"$$ && | |
31265 | mv -f "$cache_file"$$ "$cache_file" ;; #( | |
31266 | *) | |
31267 | mv -f confcache "$cache_file" ;; | |
31268 | esac | |
31269 | fi | |
31270 | fi | |
c971b7fa PA |
31271 | else |
31272 | { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 | |
31273 | $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} | |
31274 | fi | |
31275 | fi | |
31276 | rm -f confcache | |
31277 | ||
31278 | test "x$prefix" = xNONE && prefix=$ac_default_prefix | |
31279 | # Let make expand exec_prefix. | |
31280 | test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' | |
31281 | ||
31282 | DEFS=-DHAVE_CONFIG_H | |
31283 | ||
31284 | ac_libobjs= | |
31285 | ac_ltlibobjs= | |
31286 | for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue | |
31287 | # 1. Remove the extension, and $U if already installed. | |
31288 | ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' | |
31289 | ac_i=`$as_echo "$ac_i" | sed "$ac_script"` | |
31290 | # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR | |
31291 | # will be set to the directory where LIBOBJS objects are built. | |
31292 | as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" | |
31293 | as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' | |
31294 | done | |
31295 | LIBOBJS=$ac_libobjs | |
31296 | ||
31297 | LTLIBOBJS=$ac_ltlibobjs | |
31298 | ||
31299 | ||
31300 | if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then | |
d0ac1c44 | 31301 | as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. |
c971b7fa PA |
31302 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
31303 | fi | |
31304 | if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then | |
d0ac1c44 | 31305 | as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined. |
c971b7fa PA |
31306 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
31307 | fi | |
8690e634 | 31308 | if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then |
d0ac1c44 | 31309 | as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined. |
8690e634 JK |
31310 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
31311 | fi | |
18848e28 | 31312 | if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then |
d0ac1c44 | 31313 | as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined. |
18848e28 GF |
31314 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
31315 | fi | |
88b48903 | 31316 | if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then |
d0ac1c44 | 31317 | as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined. |
88b48903 WN |
31318 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
31319 | fi | |
8690e634 | 31320 | if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then |
d0ac1c44 | 31321 | as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined. |
8690e634 JK |
31322 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
31323 | fi | |
c0c3707f CB |
31324 | if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then |
31325 | as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined. | |
31326 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
31327 | fi | |
31328 | if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then | |
31329 | as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined. | |
31330 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
31331 | fi | |
6ec2e0f5 | 31332 | if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then |
d0ac1c44 | 31333 | as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined. |
6ec2e0f5 SDJ |
31334 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
31335 | fi | |
49e4877c | 31336 | if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then |
d0ac1c44 | 31337 | as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. |
49e4877c PA |
31338 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
31339 | fi | |
31340 | if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then | |
d0ac1c44 | 31341 | as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. |
49e4877c PA |
31342 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
31343 | fi | |
c971b7fa | 31344 | if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then |
d0ac1c44 | 31345 | as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined. |
c971b7fa PA |
31346 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
31347 | fi | |
88b48903 WN |
31348 | |
31349 | ||
5df4cba6 SM |
31350 | if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then |
31351 | as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. | |
31352 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
31353 | fi | |
725e2999 JB |
31354 | if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then |
31355 | as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined. | |
31356 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
31357 | fi | |
31358 | if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then | |
31359 | as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined. | |
31360 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
31361 | fi | |
8690e634 | 31362 | if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then |
d0ac1c44 | 31363 | as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined. |
8690e634 JK |
31364 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
31365 | fi | |
c971b7fa | 31366 | if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then |
d0ac1c44 | 31367 | as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. |
c971b7fa PA |
31368 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
31369 | fi | |
31370 | ||
31371 | gl_libobjs= | |
31372 | gl_ltlibobjs= | |
31373 | if test -n "$gl_LIBOBJS"; then | |
31374 | # Remove the extension. | |
31375 | sed_drop_objext='s/\.o$//;s/\.obj$//' | |
31376 | for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do | |
31377 | gl_libobjs="$gl_libobjs $i.$ac_objext" | |
31378 | gl_ltlibobjs="$gl_ltlibobjs $i.lo" | |
31379 | done | |
31380 | fi | |
31381 | gl_LIBOBJS=$gl_libobjs | |
31382 | ||
31383 | gl_LTLIBOBJS=$gl_ltlibobjs | |
31384 | ||
31385 | ||
31386 | ||
31387 | gltests_libobjs= | |
31388 | gltests_ltlibobjs= | |
31389 | if test -n "$gltests_LIBOBJS"; then | |
31390 | # Remove the extension. | |
31391 | sed_drop_objext='s/\.o$//;s/\.obj$//' | |
31392 | for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do | |
31393 | gltests_libobjs="$gltests_libobjs $i.$ac_objext" | |
31394 | gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" | |
31395 | done | |
31396 | fi | |
31397 | gltests_LIBOBJS=$gltests_libobjs | |
31398 | ||
31399 | gltests_LTLIBOBJS=$gltests_ltlibobjs | |
31400 | ||
31401 | ||
d0ac1c44 SM |
31402 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 |
31403 | $as_echo_n "checking that generated files are newer than configure... " >&6; } | |
31404 | if test -n "$am_sleep_pid"; then | |
31405 | # Hide warnings about reused PIDs. | |
31406 | wait $am_sleep_pid 2>/dev/null | |
31407 | fi | |
31408 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 | |
31409 | $as_echo "done" >&6; } | |
c971b7fa | 31410 | if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then |
d0ac1c44 | 31411 | as_fn_error $? "conditional \"AMDEP\" was never defined. |
c971b7fa PA |
31412 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
31413 | fi | |
31414 | if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then | |
d0ac1c44 | 31415 | as_fn_error $? "conditional \"am__fastdepCC\" was never defined. |
c971b7fa PA |
31416 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
31417 | fi | |
31418 | if test -n "$EXEEXT"; then | |
31419 | am__EXEEXT_TRUE= | |
31420 | am__EXEEXT_FALSE='#' | |
31421 | else | |
31422 | am__EXEEXT_TRUE='#' | |
31423 | am__EXEEXT_FALSE= | |
31424 | fi | |
31425 | ||
31426 | ||
d0ac1c44 | 31427 | : "${CONFIG_STATUS=./config.status}" |
c971b7fa PA |
31428 | ac_write_fail=0 |
31429 | ac_clean_files_save=$ac_clean_files | |
31430 | ac_clean_files="$ac_clean_files $CONFIG_STATUS" | |
31431 | { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 | |
31432 | $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} | |
31433 | as_write_fail=0 | |
31434 | cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 | |
31435 | #! $SHELL | |
31436 | # Generated by $as_me. | |
31437 | # Run this file to recreate the current configuration. | |
31438 | # Compiler output produced by configure, useful for debugging | |
31439 | # configure, is in config.log if it exists. | |
31440 | ||
31441 | debug=false | |
31442 | ac_cs_recheck=false | |
31443 | ac_cs_silent=false | |
31444 | ||
31445 | SHELL=\${CONFIG_SHELL-$SHELL} | |
31446 | export SHELL | |
31447 | _ASEOF | |
31448 | cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 | |
31449 | ## -------------------- ## | |
31450 | ## M4sh Initialization. ## | |
31451 | ## -------------------- ## | |
31452 | ||
31453 | # Be more Bourne compatible | |
31454 | DUALCASE=1; export DUALCASE # for MKS sh | |
31455 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : | |
31456 | emulate sh | |
31457 | NULLCMD=: | |
31458 | # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which | |
31459 | # is contrary to our usage. Disable this feature. | |
31460 | alias -g '${1+"$@"}'='"$@"' | |
31461 | setopt NO_GLOB_SUBST | |
31462 | else | |
31463 | case `(set -o) 2>/dev/null` in #( | |
31464 | *posix*) : | |
31465 | set -o posix ;; #( | |
31466 | *) : | |
31467 | ;; | |
31468 | esac | |
31469 | fi | |
31470 | ||
31471 | ||
31472 | as_nl=' | |
31473 | ' | |
31474 | export as_nl | |
31475 | # Printing a long string crashes Solaris 7 /usr/bin/printf. | |
31476 | as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' | |
31477 | as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo | |
31478 | as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo | |
31479 | # Prefer a ksh shell builtin over an external printf program on Solaris, | |
31480 | # but without wasting forks for bash or zsh. | |
31481 | if test -z "$BASH_VERSION$ZSH_VERSION" \ | |
31482 | && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then | |
31483 | as_echo='print -r --' | |
31484 | as_echo_n='print -rn --' | |
31485 | elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then | |
31486 | as_echo='printf %s\n' | |
31487 | as_echo_n='printf %s' | |
31488 | else | |
31489 | if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then | |
31490 | as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' | |
31491 | as_echo_n='/usr/ucb/echo -n' | |
31492 | else | |
31493 | as_echo_body='eval expr "X$1" : "X\\(.*\\)"' | |
31494 | as_echo_n_body='eval | |
31495 | arg=$1; | |
31496 | case $arg in #( | |
31497 | *"$as_nl"*) | |
31498 | expr "X$arg" : "X\\(.*\\)$as_nl"; | |
31499 | arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; | |
31500 | esac; | |
31501 | expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" | |
31502 | ' | |
31503 | export as_echo_n_body | |
31504 | as_echo_n='sh -c $as_echo_n_body as_echo' | |
31505 | fi | |
31506 | export as_echo_body | |
31507 | as_echo='sh -c $as_echo_body as_echo' | |
31508 | fi | |
31509 | ||
31510 | # The user is always right. | |
31511 | if test "${PATH_SEPARATOR+set}" != set; then | |
31512 | PATH_SEPARATOR=: | |
31513 | (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { | |
31514 | (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || | |
31515 | PATH_SEPARATOR=';' | |
31516 | } | |
31517 | fi | |
31518 | ||
31519 | ||
31520 | # IFS | |
31521 | # We need space, tab and new line, in precisely that order. Quoting is | |
31522 | # there to prevent editors from complaining about space-tab. | |
31523 | # (If _AS_PATH_WALK were called with IFS unset, it would disable word | |
31524 | # splitting by setting IFS to empty value.) | |
31525 | IFS=" "" $as_nl" | |
31526 | ||
31527 | # Find who we are. Look in the path if we contain no directory separator. | |
d0ac1c44 | 31528 | as_myself= |
c971b7fa PA |
31529 | case $0 in #(( |
31530 | *[\\/]* ) as_myself=$0 ;; | |
31531 | *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
31532 | for as_dir in $PATH | |
31533 | do | |
31534 | IFS=$as_save_IFS | |
31535 | test -z "$as_dir" && as_dir=. | |
31536 | test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break | |
31537 | done | |
31538 | IFS=$as_save_IFS | |
31539 | ||
31540 | ;; | |
31541 | esac | |
31542 | # We did not find ourselves, most probably we were run as `sh COMMAND' | |
31543 | # in which case we are not to be found in the path. | |
31544 | if test "x$as_myself" = x; then | |
31545 | as_myself=$0 | |
31546 | fi | |
31547 | if test ! -f "$as_myself"; then | |
31548 | $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 | |
31549 | exit 1 | |
31550 | fi | |
31551 | ||
31552 | # Unset variables that we do not need and which cause bugs (e.g. in | |
31553 | # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" | |
31554 | # suppresses any "Segmentation fault" message there. '((' could | |
31555 | # trigger a bug in pdksh 5.2.14. | |
31556 | for as_var in BASH_ENV ENV MAIL MAILPATH | |
31557 | do eval test x\${$as_var+set} = xset \ | |
31558 | && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : | |
31559 | done | |
31560 | PS1='$ ' | |
31561 | PS2='> ' | |
31562 | PS4='+ ' | |
31563 | ||
31564 | # NLS nuisances. | |
31565 | LC_ALL=C | |
31566 | export LC_ALL | |
31567 | LANGUAGE=C | |
31568 | export LANGUAGE | |
31569 | ||
31570 | # CDPATH. | |
31571 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH | |
31572 | ||
31573 | ||
d0ac1c44 SM |
31574 | # as_fn_error STATUS ERROR [LINENO LOG_FD] |
31575 | # ---------------------------------------- | |
c971b7fa PA |
31576 | # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are |
31577 | # provided, also output the error to LOG_FD, referencing LINENO. Then exit the | |
d0ac1c44 | 31578 | # script with STATUS, using 1 if that was 0. |
c971b7fa PA |
31579 | as_fn_error () |
31580 | { | |
d0ac1c44 SM |
31581 | as_status=$1; test $as_status -eq 0 && as_status=1 |
31582 | if test "$4"; then | |
31583 | as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
31584 | $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 | |
c971b7fa | 31585 | fi |
d0ac1c44 | 31586 | $as_echo "$as_me: error: $2" >&2 |
c971b7fa PA |
31587 | as_fn_exit $as_status |
31588 | } # as_fn_error | |
31589 | ||
31590 | ||
31591 | # as_fn_set_status STATUS | |
31592 | # ----------------------- | |
31593 | # Set $? to STATUS, without forking. | |
31594 | as_fn_set_status () | |
31595 | { | |
31596 | return $1 | |
31597 | } # as_fn_set_status | |
31598 | ||
31599 | # as_fn_exit STATUS | |
31600 | # ----------------- | |
31601 | # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. | |
31602 | as_fn_exit () | |
31603 | { | |
31604 | set +e | |
31605 | as_fn_set_status $1 | |
31606 | exit $1 | |
31607 | } # as_fn_exit | |
31608 | ||
31609 | # as_fn_unset VAR | |
31610 | # --------------- | |
31611 | # Portably unset VAR. | |
31612 | as_fn_unset () | |
31613 | { | |
31614 | { eval $1=; unset $1;} | |
31615 | } | |
31616 | as_unset=as_fn_unset | |
31617 | # as_fn_append VAR VALUE | |
31618 | # ---------------------- | |
31619 | # Append the text in VALUE to the end of the definition contained in VAR. Take | |
31620 | # advantage of any shell optimizations that allow amortized linear growth over | |
31621 | # repeated appends, instead of the typical quadratic growth present in naive | |
31622 | # implementations. | |
31623 | if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : | |
31624 | eval 'as_fn_append () | |
31625 | { | |
31626 | eval $1+=\$2 | |
31627 | }' | |
31628 | else | |
31629 | as_fn_append () | |
31630 | { | |
31631 | eval $1=\$$1\$2 | |
31632 | } | |
31633 | fi # as_fn_append | |
31634 | ||
31635 | # as_fn_arith ARG... | |
31636 | # ------------------ | |
31637 | # Perform arithmetic evaluation on the ARGs, and store the result in the | |
31638 | # global $as_val. Take advantage of shells that can avoid forks. The arguments | |
31639 | # must be portable across $(()) and expr. | |
31640 | if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : | |
31641 | eval 'as_fn_arith () | |
31642 | { | |
31643 | as_val=$(( $* )) | |
31644 | }' | |
31645 | else | |
31646 | as_fn_arith () | |
31647 | { | |
31648 | as_val=`expr "$@" || test $? -eq 1` | |
31649 | } | |
31650 | fi # as_fn_arith | |
31651 | ||
31652 | ||
31653 | if expr a : '\(a\)' >/dev/null 2>&1 && | |
31654 | test "X`expr 00001 : '.*\(...\)'`" = X001; then | |
31655 | as_expr=expr | |
31656 | else | |
31657 | as_expr=false | |
31658 | fi | |
31659 | ||
31660 | if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then | |
31661 | as_basename=basename | |
31662 | else | |
31663 | as_basename=false | |
31664 | fi | |
31665 | ||
31666 | if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then | |
31667 | as_dirname=dirname | |
31668 | else | |
31669 | as_dirname=false | |
31670 | fi | |
31671 | ||
31672 | as_me=`$as_basename -- "$0" || | |
31673 | $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ | |
31674 | X"$0" : 'X\(//\)$' \| \ | |
31675 | X"$0" : 'X\(/\)' \| . 2>/dev/null || | |
31676 | $as_echo X/"$0" | | |
31677 | sed '/^.*\/\([^/][^/]*\)\/*$/{ | |
31678 | s//\1/ | |
31679 | q | |
31680 | } | |
31681 | /^X\/\(\/\/\)$/{ | |
31682 | s//\1/ | |
31683 | q | |
31684 | } | |
31685 | /^X\/\(\/\).*/{ | |
31686 | s//\1/ | |
31687 | q | |
31688 | } | |
31689 | s/.*/./; q'` | |
31690 | ||
31691 | # Avoid depending upon Character Ranges. | |
31692 | as_cr_letters='abcdefghijklmnopqrstuvwxyz' | |
31693 | as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
31694 | as_cr_Letters=$as_cr_letters$as_cr_LETTERS | |
31695 | as_cr_digits='0123456789' | |
31696 | as_cr_alnum=$as_cr_Letters$as_cr_digits | |
31697 | ||
31698 | ECHO_C= ECHO_N= ECHO_T= | |
31699 | case `echo -n x` in #((((( | |
31700 | -n*) | |
31701 | case `echo 'xy\c'` in | |
31702 | *c*) ECHO_T=' ';; # ECHO_T is single tab character. | |
31703 | xy) ECHO_C='\c';; | |
31704 | *) echo `echo ksh88 bug on AIX 6.1` > /dev/null | |
31705 | ECHO_T=' ';; | |
31706 | esac;; | |
31707 | *) | |
31708 | ECHO_N='-n';; | |
31709 | esac | |
31710 | ||
31711 | rm -f conf$$ conf$$.exe conf$$.file | |
31712 | if test -d conf$$.dir; then | |
31713 | rm -f conf$$.dir/conf$$.file | |
31714 | else | |
31715 | rm -f conf$$.dir | |
31716 | mkdir conf$$.dir 2>/dev/null | |
31717 | fi | |
31718 | if (echo >conf$$.file) 2>/dev/null; then | |
31719 | if ln -s conf$$.file conf$$ 2>/dev/null; then | |
31720 | as_ln_s='ln -s' | |
31721 | # ... but there are two gotchas: | |
31722 | # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. | |
31723 | # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. | |
d0ac1c44 | 31724 | # In both cases, we have to default to `cp -pR'. |
c971b7fa | 31725 | ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || |
d0ac1c44 | 31726 | as_ln_s='cp -pR' |
c971b7fa PA |
31727 | elif ln conf$$.file conf$$ 2>/dev/null; then |
31728 | as_ln_s=ln | |
31729 | else | |
d0ac1c44 | 31730 | as_ln_s='cp -pR' |
c971b7fa PA |
31731 | fi |
31732 | else | |
d0ac1c44 | 31733 | as_ln_s='cp -pR' |
c971b7fa PA |
31734 | fi |
31735 | rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file | |
31736 | rmdir conf$$.dir 2>/dev/null | |
31737 | ||
31738 | ||
31739 | # as_fn_mkdir_p | |
31740 | # ------------- | |
31741 | # Create "$as_dir" as a directory, including parents if necessary. | |
31742 | as_fn_mkdir_p () | |
31743 | { | |
31744 | ||
31745 | case $as_dir in #( | |
31746 | -*) as_dir=./$as_dir;; | |
31747 | esac | |
31748 | test -d "$as_dir" || eval $as_mkdir_p || { | |
31749 | as_dirs= | |
31750 | while :; do | |
31751 | case $as_dir in #( | |
31752 | *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( | |
31753 | *) as_qdir=$as_dir;; | |
31754 | esac | |
31755 | as_dirs="'$as_qdir' $as_dirs" | |
31756 | as_dir=`$as_dirname -- "$as_dir" || | |
31757 | $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
31758 | X"$as_dir" : 'X\(//\)[^/]' \| \ | |
31759 | X"$as_dir" : 'X\(//\)$' \| \ | |
31760 | X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || | |
31761 | $as_echo X"$as_dir" | | |
31762 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
31763 | s//\1/ | |
31764 | q | |
31765 | } | |
31766 | /^X\(\/\/\)[^/].*/{ | |
31767 | s//\1/ | |
31768 | q | |
31769 | } | |
31770 | /^X\(\/\/\)$/{ | |
31771 | s//\1/ | |
31772 | q | |
31773 | } | |
31774 | /^X\(\/\).*/{ | |
31775 | s//\1/ | |
31776 | q | |
31777 | } | |
31778 | s/.*/./; q'` | |
31779 | test -d "$as_dir" && break | |
31780 | done | |
31781 | test -z "$as_dirs" || eval "mkdir $as_dirs" | |
d0ac1c44 | 31782 | } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" |
c971b7fa PA |
31783 | |
31784 | ||
31785 | } # as_fn_mkdir_p | |
31786 | if mkdir -p . 2>/dev/null; then | |
31787 | as_mkdir_p='mkdir -p "$as_dir"' | |
31788 | else | |
31789 | test -d ./-p && rmdir ./-p | |
31790 | as_mkdir_p=false | |
31791 | fi | |
31792 | ||
d0ac1c44 SM |
31793 | |
31794 | # as_fn_executable_p FILE | |
31795 | # ----------------------- | |
31796 | # Test if FILE is an executable regular file. | |
31797 | as_fn_executable_p () | |
31798 | { | |
31799 | test -f "$1" && test -x "$1" | |
31800 | } # as_fn_executable_p | |
31801 | as_test_x='test -x' | |
31802 | as_executable_p=as_fn_executable_p | |
c971b7fa PA |
31803 | |
31804 | # Sed expression to map a string onto a valid CPP name. | |
31805 | as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" | |
31806 | ||
31807 | # Sed expression to map a string onto a valid variable name. | |
31808 | as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" | |
31809 | ||
31810 | ||
31811 | exec 6>&1 | |
31812 | ## ----------------------------------- ## | |
31813 | ## Main body of $CONFIG_STATUS script. ## | |
31814 | ## ----------------------------------- ## | |
31815 | _ASEOF | |
31816 | test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 | |
31817 | ||
31818 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
31819 | # Save the log message, to keep $0 and so on meaningful, and to | |
31820 | # report actual input values of CONFIG_FILES etc. instead of their | |
31821 | # values after options handling. | |
31822 | ac_log=" | |
d0ac1c44 SM |
31823 | This file was extended by libgnu $as_me UNUSED-VERSION, which was |
31824 | generated by GNU Autoconf 2.69. Invocation command line was | |
c971b7fa PA |
31825 | |
31826 | CONFIG_FILES = $CONFIG_FILES | |
31827 | CONFIG_HEADERS = $CONFIG_HEADERS | |
31828 | CONFIG_LINKS = $CONFIG_LINKS | |
31829 | CONFIG_COMMANDS = $CONFIG_COMMANDS | |
31830 | $ $0 $@ | |
31831 | ||
31832 | on `(hostname || uname -n) 2>/dev/null | sed 1q` | |
31833 | " | |
31834 | ||
31835 | _ACEOF | |
31836 | ||
31837 | case $ac_config_files in *" | |
31838 | "*) set x $ac_config_files; shift; ac_config_files=$*;; | |
31839 | esac | |
31840 | ||
31841 | case $ac_config_headers in *" | |
31842 | "*) set x $ac_config_headers; shift; ac_config_headers=$*;; | |
31843 | esac | |
31844 | ||
31845 | ||
31846 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
31847 | # Files that config.status was made for. | |
31848 | config_files="$ac_config_files" | |
31849 | config_headers="$ac_config_headers" | |
31850 | config_commands="$ac_config_commands" | |
31851 | ||
31852 | _ACEOF | |
31853 | ||
31854 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
31855 | ac_cs_usage="\ | |
31856 | \`$as_me' instantiates files and other configuration actions | |
31857 | from templates according to the current configuration. Unless the files | |
31858 | and actions are specified as TAGs, all are instantiated by default. | |
31859 | ||
31860 | Usage: $0 [OPTION]... [TAG]... | |
31861 | ||
31862 | -h, --help print this help, then exit | |
31863 | -V, --version print version number and configuration settings, then exit | |
d0ac1c44 | 31864 | --config print configuration, then exit |
c971b7fa PA |
31865 | -q, --quiet, --silent |
31866 | do not print progress messages | |
31867 | -d, --debug don't remove temporary files | |
31868 | --recheck update $as_me by reconfiguring in the same conditions | |
31869 | --file=FILE[:TEMPLATE] | |
31870 | instantiate the configuration file FILE | |
31871 | --header=FILE[:TEMPLATE] | |
31872 | instantiate the configuration header FILE | |
31873 | ||
31874 | Configuration files: | |
31875 | $config_files | |
31876 | ||
31877 | Configuration headers: | |
31878 | $config_headers | |
31879 | ||
31880 | Configuration commands: | |
31881 | $config_commands | |
31882 | ||
31883 | Report bugs to the package provider." | |
31884 | ||
31885 | _ACEOF | |
31886 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
d0ac1c44 | 31887 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
c971b7fa | 31888 | ac_cs_version="\\ |
d0ac1c44 SM |
31889 | libgnu config.status UNUSED-VERSION |
31890 | configured by $0, generated by GNU Autoconf 2.69, | |
31891 | with options \\"\$ac_cs_config\\" | |
c971b7fa | 31892 | |
d0ac1c44 | 31893 | Copyright (C) 2012 Free Software Foundation, Inc. |
c971b7fa PA |
31894 | This config.status script is free software; the Free Software Foundation |
31895 | gives unlimited permission to copy, distribute and modify it." | |
31896 | ||
31897 | ac_pwd='$ac_pwd' | |
31898 | srcdir='$srcdir' | |
31899 | INSTALL='$INSTALL' | |
31900 | MKDIR_P='$MKDIR_P' | |
31901 | AWK='$AWK' | |
31902 | test -n "\$AWK" || AWK=awk | |
31903 | _ACEOF | |
31904 | ||
31905 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
31906 | # The default lists apply if the user does not specify any file. | |
31907 | ac_need_defaults=: | |
31908 | while test $# != 0 | |
31909 | do | |
31910 | case $1 in | |
d0ac1c44 | 31911 | --*=?*) |
c971b7fa PA |
31912 | ac_option=`expr "X$1" : 'X\([^=]*\)='` |
31913 | ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` | |
31914 | ac_shift=: | |
31915 | ;; | |
d0ac1c44 SM |
31916 | --*=) |
31917 | ac_option=`expr "X$1" : 'X\([^=]*\)='` | |
31918 | ac_optarg= | |
31919 | ac_shift=: | |
31920 | ;; | |
c971b7fa PA |
31921 | *) |
31922 | ac_option=$1 | |
31923 | ac_optarg=$2 | |
31924 | ac_shift=shift | |
31925 | ;; | |
31926 | esac | |
31927 | ||
31928 | case $ac_option in | |
31929 | # Handling of the options. | |
31930 | -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) | |
31931 | ac_cs_recheck=: ;; | |
31932 | --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) | |
31933 | $as_echo "$ac_cs_version"; exit ;; | |
d0ac1c44 SM |
31934 | --config | --confi | --conf | --con | --co | --c ) |
31935 | $as_echo "$ac_cs_config"; exit ;; | |
c971b7fa PA |
31936 | --debug | --debu | --deb | --de | --d | -d ) |
31937 | debug=: ;; | |
31938 | --file | --fil | --fi | --f ) | |
31939 | $ac_shift | |
31940 | case $ac_optarg in | |
31941 | *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; | |
d0ac1c44 | 31942 | '') as_fn_error $? "missing file argument" ;; |
c971b7fa PA |
31943 | esac |
31944 | as_fn_append CONFIG_FILES " '$ac_optarg'" | |
31945 | ac_need_defaults=false;; | |
31946 | --header | --heade | --head | --hea ) | |
31947 | $ac_shift | |
31948 | case $ac_optarg in | |
31949 | *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; | |
31950 | esac | |
31951 | as_fn_append CONFIG_HEADERS " '$ac_optarg'" | |
31952 | ac_need_defaults=false;; | |
31953 | --he | --h) | |
31954 | # Conflict between --help and --header | |
d0ac1c44 | 31955 | as_fn_error $? "ambiguous option: \`$1' |
c971b7fa PA |
31956 | Try \`$0 --help' for more information.";; |
31957 | --help | --hel | -h ) | |
31958 | $as_echo "$ac_cs_usage"; exit ;; | |
31959 | -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | |
31960 | | -silent | --silent | --silen | --sile | --sil | --si | --s) | |
31961 | ac_cs_silent=: ;; | |
31962 | ||
31963 | # This is an error. | |
d0ac1c44 | 31964 | -*) as_fn_error $? "unrecognized option: \`$1' |
c971b7fa PA |
31965 | Try \`$0 --help' for more information." ;; |
31966 | ||
31967 | *) as_fn_append ac_config_targets " $1" | |
31968 | ac_need_defaults=false ;; | |
31969 | ||
31970 | esac | |
31971 | shift | |
31972 | done | |
31973 | ||
31974 | ac_configure_extra_args= | |
31975 | ||
31976 | if $ac_cs_silent; then | |
31977 | exec 6>/dev/null | |
31978 | ac_configure_extra_args="$ac_configure_extra_args --silent" | |
31979 | fi | |
31980 | ||
31981 | _ACEOF | |
31982 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
31983 | if \$ac_cs_recheck; then | |
d0ac1c44 | 31984 | set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion |
c971b7fa PA |
31985 | shift |
31986 | \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 | |
31987 | CONFIG_SHELL='$SHELL' | |
31988 | export CONFIG_SHELL | |
31989 | exec "\$@" | |
31990 | fi | |
31991 | ||
31992 | _ACEOF | |
31993 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
31994 | exec 5>>config.log | |
31995 | { | |
31996 | echo | |
31997 | sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX | |
31998 | ## Running $as_me. ## | |
31999 | _ASBOX | |
32000 | $as_echo "$ac_log" | |
32001 | } >&5 | |
32002 | ||
32003 | _ACEOF | |
32004 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
32005 | # | |
32006 | # INIT-COMMANDS | |
32007 | # | |
32008 | AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" | |
32009 | ||
32010 | _ACEOF | |
32011 | ||
32012 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
32013 | ||
32014 | # Handling of arguments. | |
32015 | for ac_config_target in $ac_config_targets | |
32016 | do | |
32017 | case $ac_config_target in | |
32018 | "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; | |
32019 | "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; | |
361cb219 | 32020 | "Makefile.gnulib.inc") CONFIG_FILES="$CONFIG_FILES Makefile.gnulib.inc" ;; |
c971b7fa PA |
32021 | "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; |
32022 | "import/Makefile") CONFIG_FILES="$CONFIG_FILES import/Makefile" ;; | |
32023 | "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; | |
32024 | ||
d0ac1c44 | 32025 | *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; |
c971b7fa PA |
32026 | esac |
32027 | done | |
32028 | ||
32029 | ||
32030 | # If the user did not use the arguments to specify the items to instantiate, | |
32031 | # then the envvar interface is used. Set only those that are not. | |
32032 | # We use the long form for the default assignment because of an extremely | |
32033 | # bizarre bug on SunOS 4.1.3. | |
32034 | if $ac_need_defaults; then | |
32035 | test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files | |
32036 | test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers | |
32037 | test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands | |
32038 | fi | |
32039 | ||
32040 | # Have a temporary directory for convenience. Make it in the build tree | |
32041 | # simply because there is no reason against having it here, and in addition, | |
32042 | # creating and moving files from /tmp can sometimes cause problems. | |
32043 | # Hook for its removal unless debugging. | |
32044 | # Note that there is a small window in which the directory will not be cleaned: | |
32045 | # after its creation but before its name has been assigned to `$tmp'. | |
32046 | $debug || | |
32047 | { | |
d0ac1c44 | 32048 | tmp= ac_tmp= |
c971b7fa | 32049 | trap 'exit_status=$? |
d0ac1c44 SM |
32050 | : "${ac_tmp:=$tmp}" |
32051 | { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status | |
c971b7fa PA |
32052 | ' 0 |
32053 | trap 'as_fn_exit 1' 1 2 13 15 | |
32054 | } | |
32055 | # Create a (secure) tmp directory for tmp files. | |
32056 | ||
32057 | { | |
32058 | tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && | |
d0ac1c44 | 32059 | test -d "$tmp" |
c971b7fa PA |
32060 | } || |
32061 | { | |
32062 | tmp=./conf$$-$RANDOM | |
32063 | (umask 077 && mkdir "$tmp") | |
d0ac1c44 SM |
32064 | } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 |
32065 | ac_tmp=$tmp | |
c971b7fa PA |
32066 | |
32067 | # Set up the scripts for CONFIG_FILES section. | |
32068 | # No need to generate them if there are no CONFIG_FILES. | |
32069 | # This happens for instance with `./config.status config.h'. | |
32070 | if test -n "$CONFIG_FILES"; then | |
32071 | ||
32072 | ||
32073 | ac_cr=`echo X | tr X '\015'` | |
32074 | # On cygwin, bash can eat \r inside `` if the user requested igncr. | |
32075 | # But we know of no other shell where ac_cr would be empty at this | |
32076 | # point, so we can use a bashism as a fallback. | |
32077 | if test "x$ac_cr" = x; then | |
32078 | eval ac_cr=\$\'\\r\' | |
32079 | fi | |
32080 | ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` | |
32081 | if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then | |
d0ac1c44 | 32082 | ac_cs_awk_cr='\\r' |
c971b7fa PA |
32083 | else |
32084 | ac_cs_awk_cr=$ac_cr | |
32085 | fi | |
32086 | ||
d0ac1c44 | 32087 | echo 'BEGIN {' >"$ac_tmp/subs1.awk" && |
c971b7fa PA |
32088 | _ACEOF |
32089 | ||
32090 | ||
32091 | { | |
32092 | echo "cat >conf$$subs.awk <<_ACEOF" && | |
32093 | echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && | |
32094 | echo "_ACEOF" | |
32095 | } >conf$$subs.sh || | |
d0ac1c44 SM |
32096 | as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 |
32097 | ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` | |
c971b7fa PA |
32098 | ac_delim='%!_!# ' |
32099 | for ac_last_try in false false false false false :; do | |
32100 | . ./conf$$subs.sh || | |
d0ac1c44 | 32101 | as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 |
c971b7fa PA |
32102 | |
32103 | ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` | |
32104 | if test $ac_delim_n = $ac_delim_num; then | |
32105 | break | |
32106 | elif $ac_last_try; then | |
d0ac1c44 | 32107 | as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 |
c971b7fa PA |
32108 | else |
32109 | ac_delim="$ac_delim!$ac_delim _$ac_delim!! " | |
32110 | fi | |
32111 | done | |
32112 | rm -f conf$$subs.sh | |
32113 | ||
32114 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
d0ac1c44 | 32115 | cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && |
c971b7fa PA |
32116 | _ACEOF |
32117 | sed -n ' | |
32118 | h | |
32119 | s/^/S["/; s/!.*/"]=/ | |
32120 | p | |
32121 | g | |
32122 | s/^[^!]*!// | |
32123 | :repl | |
32124 | t repl | |
32125 | s/'"$ac_delim"'$// | |
32126 | t delim | |
32127 | :nl | |
32128 | h | |
d0ac1c44 | 32129 | s/\(.\{148\}\)..*/\1/ |
c971b7fa PA |
32130 | t more1 |
32131 | s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ | |
32132 | p | |
32133 | n | |
32134 | b repl | |
32135 | :more1 | |
32136 | s/["\\]/\\&/g; s/^/"/; s/$/"\\/ | |
32137 | p | |
32138 | g | |
32139 | s/.\{148\}// | |
32140 | t nl | |
32141 | :delim | |
32142 | h | |
d0ac1c44 | 32143 | s/\(.\{148\}\)..*/\1/ |
c971b7fa PA |
32144 | t more2 |
32145 | s/["\\]/\\&/g; s/^/"/; s/$/"/ | |
32146 | p | |
32147 | b | |
32148 | :more2 | |
32149 | s/["\\]/\\&/g; s/^/"/; s/$/"\\/ | |
32150 | p | |
32151 | g | |
32152 | s/.\{148\}// | |
32153 | t delim | |
32154 | ' <conf$$subs.awk | sed ' | |
32155 | /^[^""]/{ | |
32156 | N | |
32157 | s/\n// | |
32158 | } | |
32159 | ' >>$CONFIG_STATUS || ac_write_fail=1 | |
32160 | rm -f conf$$subs.awk | |
32161 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
32162 | _ACAWK | |
d0ac1c44 | 32163 | cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && |
c971b7fa PA |
32164 | for (key in S) S_is_set[key] = 1 |
32165 | FS = "\a" | |
32166 | ||
32167 | } | |
32168 | { | |
32169 | line = $ 0 | |
32170 | nfields = split(line, field, "@") | |
32171 | substed = 0 | |
32172 | len = length(field[1]) | |
32173 | for (i = 2; i < nfields; i++) { | |
32174 | key = field[i] | |
32175 | keylen = length(key) | |
32176 | if (S_is_set[key]) { | |
32177 | value = S[key] | |
32178 | line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) | |
32179 | len += length(value) + length(field[++i]) | |
32180 | substed = 1 | |
32181 | } else | |
32182 | len += 1 + keylen | |
32183 | } | |
32184 | ||
32185 | print line | |
32186 | } | |
32187 | ||
32188 | _ACAWK | |
32189 | _ACEOF | |
32190 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
32191 | if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then | |
32192 | sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" | |
32193 | else | |
32194 | cat | |
d0ac1c44 SM |
32195 | fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ |
32196 | || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 | |
c971b7fa PA |
32197 | _ACEOF |
32198 | ||
d0ac1c44 SM |
32199 | # VPATH may cause trouble with some makes, so we remove sole $(srcdir), |
32200 | # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and | |
c971b7fa PA |
32201 | # trailing colons and then remove the whole line if VPATH becomes empty |
32202 | # (actually we leave an empty line to preserve line numbers). | |
32203 | if test "x$srcdir" = x.; then | |
d0ac1c44 SM |
32204 | ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ |
32205 | h | |
32206 | s/// | |
32207 | s/^/:/ | |
32208 | s/[ ]*$/:/ | |
32209 | s/:\$(srcdir):/:/g | |
32210 | s/:\${srcdir}:/:/g | |
32211 | s/:@srcdir@:/:/g | |
32212 | s/^:*// | |
c971b7fa | 32213 | s/:*$// |
d0ac1c44 SM |
32214 | x |
32215 | s/\(=[ ]*\).*/\1/ | |
32216 | G | |
32217 | s/\n// | |
c971b7fa PA |
32218 | s/^[^=]*=[ ]*$// |
32219 | }' | |
32220 | fi | |
32221 | ||
32222 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
32223 | fi # test -n "$CONFIG_FILES" | |
32224 | ||
32225 | # Set up the scripts for CONFIG_HEADERS section. | |
32226 | # No need to generate them if there are no CONFIG_HEADERS. | |
32227 | # This happens for instance with `./config.status Makefile'. | |
32228 | if test -n "$CONFIG_HEADERS"; then | |
d0ac1c44 | 32229 | cat >"$ac_tmp/defines.awk" <<\_ACAWK || |
c971b7fa PA |
32230 | BEGIN { |
32231 | _ACEOF | |
32232 | ||
32233 | # Transform confdefs.h into an awk script `defines.awk', embedded as | |
32234 | # here-document in config.status, that substitutes the proper values into | |
32235 | # config.h.in to produce config.h. | |
32236 | ||
32237 | # Create a delimiter string that does not exist in confdefs.h, to ease | |
32238 | # handling of long lines. | |
32239 | ac_delim='%!_!# ' | |
32240 | for ac_last_try in false false :; do | |
d0ac1c44 SM |
32241 | ac_tt=`sed -n "/$ac_delim/p" confdefs.h` |
32242 | if test -z "$ac_tt"; then | |
c971b7fa PA |
32243 | break |
32244 | elif $ac_last_try; then | |
d0ac1c44 | 32245 | as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 |
c971b7fa PA |
32246 | else |
32247 | ac_delim="$ac_delim!$ac_delim _$ac_delim!! " | |
32248 | fi | |
32249 | done | |
32250 | ||
32251 | # For the awk script, D is an array of macro values keyed by name, | |
32252 | # likewise P contains macro parameters if any. Preserve backslash | |
32253 | # newline sequences. | |
32254 | ||
32255 | ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* | |
32256 | sed -n ' | |
32257 | s/.\{148\}/&'"$ac_delim"'/g | |
32258 | t rset | |
32259 | :rset | |
32260 | s/^[ ]*#[ ]*define[ ][ ]*/ / | |
32261 | t def | |
32262 | d | |
32263 | :def | |
32264 | s/\\$// | |
32265 | t bsnl | |
32266 | s/["\\]/\\&/g | |
32267 | s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ | |
32268 | D["\1"]=" \3"/p | |
32269 | s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p | |
32270 | d | |
32271 | :bsnl | |
32272 | s/["\\]/\\&/g | |
32273 | s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ | |
32274 | D["\1"]=" \3\\\\\\n"\\/p | |
32275 | t cont | |
32276 | s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p | |
32277 | t cont | |
32278 | d | |
32279 | :cont | |
32280 | n | |
32281 | s/.\{148\}/&'"$ac_delim"'/g | |
32282 | t clear | |
32283 | :clear | |
32284 | s/\\$// | |
32285 | t bsnlc | |
32286 | s/["\\]/\\&/g; s/^/"/; s/$/"/p | |
32287 | d | |
32288 | :bsnlc | |
32289 | s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p | |
32290 | b cont | |
32291 | ' <confdefs.h | sed ' | |
32292 | s/'"$ac_delim"'/"\\\ | |
32293 | "/g' >>$CONFIG_STATUS || ac_write_fail=1 | |
32294 | ||
32295 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
32296 | for (key in D) D_is_set[key] = 1 | |
32297 | FS = "\a" | |
32298 | } | |
32299 | /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { | |
32300 | line = \$ 0 | |
32301 | split(line, arg, " ") | |
32302 | if (arg[1] == "#") { | |
32303 | defundef = arg[2] | |
32304 | mac1 = arg[3] | |
32305 | } else { | |
32306 | defundef = substr(arg[1], 2) | |
32307 | mac1 = arg[2] | |
32308 | } | |
32309 | split(mac1, mac2, "(") #) | |
32310 | macro = mac2[1] | |
32311 | prefix = substr(line, 1, index(line, defundef) - 1) | |
32312 | if (D_is_set[macro]) { | |
32313 | # Preserve the white space surrounding the "#". | |
32314 | print prefix "define", macro P[macro] D[macro] | |
32315 | next | |
32316 | } else { | |
32317 | # Replace #undef with comments. This is necessary, for example, | |
32318 | # in the case of _POSIX_SOURCE, which is predefined and required | |
32319 | # on some systems where configure will not decide to define it. | |
32320 | if (defundef == "undef") { | |
32321 | print "/*", prefix defundef, macro, "*/" | |
32322 | next | |
32323 | } | |
32324 | } | |
32325 | } | |
32326 | { print } | |
32327 | _ACAWK | |
32328 | _ACEOF | |
32329 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
d0ac1c44 | 32330 | as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 |
c971b7fa PA |
32331 | fi # test -n "$CONFIG_HEADERS" |
32332 | ||
32333 | ||
32334 | eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" | |
32335 | shift | |
32336 | for ac_tag | |
32337 | do | |
32338 | case $ac_tag in | |
32339 | :[FHLC]) ac_mode=$ac_tag; continue;; | |
32340 | esac | |
32341 | case $ac_mode$ac_tag in | |
32342 | :[FHL]*:*);; | |
d0ac1c44 | 32343 | :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; |
c971b7fa PA |
32344 | :[FH]-) ac_tag=-:-;; |
32345 | :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; | |
32346 | esac | |
32347 | ac_save_IFS=$IFS | |
32348 | IFS=: | |
32349 | set x $ac_tag | |
32350 | IFS=$ac_save_IFS | |
32351 | shift | |
32352 | ac_file=$1 | |
32353 | shift | |
32354 | ||
32355 | case $ac_mode in | |
32356 | :L) ac_source=$1;; | |
32357 | :[FH]) | |
32358 | ac_file_inputs= | |
32359 | for ac_f | |
32360 | do | |
32361 | case $ac_f in | |
d0ac1c44 | 32362 | -) ac_f="$ac_tmp/stdin";; |
c971b7fa PA |
32363 | *) # Look for the file first in the build tree, then in the source tree |
32364 | # (if the path is not absolute). The absolute path cannot be DOS-style, | |
32365 | # because $ac_f cannot contain `:'. | |
32366 | test -f "$ac_f" || | |
32367 | case $ac_f in | |
32368 | [\\/$]*) false;; | |
32369 | *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; | |
32370 | esac || | |
d0ac1c44 | 32371 | as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; |
c971b7fa PA |
32372 | esac |
32373 | case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac | |
32374 | as_fn_append ac_file_inputs " '$ac_f'" | |
32375 | done | |
32376 | ||
32377 | # Let's still pretend it is `configure' which instantiates (i.e., don't | |
32378 | # use $as_me), people would be surprised to read: | |
32379 | # /* config.h. Generated by config.status. */ | |
32380 | configure_input='Generated from '` | |
32381 | $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' | |
32382 | `' by configure.' | |
32383 | if test x"$ac_file" != x-; then | |
32384 | configure_input="$ac_file. $configure_input" | |
32385 | { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 | |
32386 | $as_echo "$as_me: creating $ac_file" >&6;} | |
32387 | fi | |
32388 | # Neutralize special characters interpreted by sed in replacement strings. | |
32389 | case $configure_input in #( | |
32390 | *\&* | *\|* | *\\* ) | |
32391 | ac_sed_conf_input=`$as_echo "$configure_input" | | |
32392 | sed 's/[\\\\&|]/\\\\&/g'`;; #( | |
32393 | *) ac_sed_conf_input=$configure_input;; | |
32394 | esac | |
32395 | ||
32396 | case $ac_tag in | |
d0ac1c44 SM |
32397 | *:-:* | *:-) cat >"$ac_tmp/stdin" \ |
32398 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; | |
c971b7fa PA |
32399 | esac |
32400 | ;; | |
32401 | esac | |
32402 | ||
32403 | ac_dir=`$as_dirname -- "$ac_file" || | |
32404 | $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
32405 | X"$ac_file" : 'X\(//\)[^/]' \| \ | |
32406 | X"$ac_file" : 'X\(//\)$' \| \ | |
32407 | X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || | |
32408 | $as_echo X"$ac_file" | | |
32409 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
32410 | s//\1/ | |
32411 | q | |
32412 | } | |
32413 | /^X\(\/\/\)[^/].*/{ | |
32414 | s//\1/ | |
32415 | q | |
32416 | } | |
32417 | /^X\(\/\/\)$/{ | |
32418 | s//\1/ | |
32419 | q | |
32420 | } | |
32421 | /^X\(\/\).*/{ | |
32422 | s//\1/ | |
32423 | q | |
32424 | } | |
32425 | s/.*/./; q'` | |
32426 | as_dir="$ac_dir"; as_fn_mkdir_p | |
32427 | ac_builddir=. | |
32428 | ||
32429 | case "$ac_dir" in | |
32430 | .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; | |
32431 | *) | |
32432 | ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` | |
32433 | # A ".." for each directory in $ac_dir_suffix. | |
32434 | ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` | |
32435 | case $ac_top_builddir_sub in | |
32436 | "") ac_top_builddir_sub=. ac_top_build_prefix= ;; | |
32437 | *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; | |
32438 | esac ;; | |
32439 | esac | |
32440 | ac_abs_top_builddir=$ac_pwd | |
32441 | ac_abs_builddir=$ac_pwd$ac_dir_suffix | |
32442 | # for backward compatibility: | |
32443 | ac_top_builddir=$ac_top_build_prefix | |
32444 | ||
32445 | case $srcdir in | |
32446 | .) # We are building in place. | |
32447 | ac_srcdir=. | |
32448 | ac_top_srcdir=$ac_top_builddir_sub | |
32449 | ac_abs_top_srcdir=$ac_pwd ;; | |
32450 | [\\/]* | ?:[\\/]* ) # Absolute name. | |
32451 | ac_srcdir=$srcdir$ac_dir_suffix; | |
32452 | ac_top_srcdir=$srcdir | |
32453 | ac_abs_top_srcdir=$srcdir ;; | |
32454 | *) # Relative name. | |
32455 | ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix | |
32456 | ac_top_srcdir=$ac_top_build_prefix$srcdir | |
32457 | ac_abs_top_srcdir=$ac_pwd/$srcdir ;; | |
32458 | esac | |
32459 | ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix | |
32460 | ||
32461 | ||
32462 | case $ac_mode in | |
32463 | :F) | |
32464 | # | |
32465 | # CONFIG_FILE | |
32466 | # | |
32467 | ||
32468 | case $INSTALL in | |
32469 | [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; | |
32470 | *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; | |
32471 | esac | |
32472 | ac_MKDIR_P=$MKDIR_P | |
32473 | case $MKDIR_P in | |
32474 | [\\/$]* | ?:[\\/]* ) ;; | |
32475 | */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; | |
32476 | esac | |
32477 | _ACEOF | |
32478 | ||
32479 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
32480 | # If the template does not know about datarootdir, expand it. | |
32481 | # FIXME: This hack should be removed a few years after 2.60. | |
32482 | ac_datarootdir_hack=; ac_datarootdir_seen= | |
32483 | ac_sed_dataroot=' | |
32484 | /datarootdir/ { | |
32485 | p | |
32486 | q | |
32487 | } | |
32488 | /@datadir@/p | |
32489 | /@docdir@/p | |
32490 | /@infodir@/p | |
32491 | /@localedir@/p | |
32492 | /@mandir@/p' | |
32493 | case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in | |
32494 | *datarootdir*) ac_datarootdir_seen=yes;; | |
32495 | *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) | |
32496 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 | |
32497 | $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} | |
32498 | _ACEOF | |
32499 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
32500 | ac_datarootdir_hack=' | |
32501 | s&@datadir@&$datadir&g | |
32502 | s&@docdir@&$docdir&g | |
32503 | s&@infodir@&$infodir&g | |
32504 | s&@localedir@&$localedir&g | |
32505 | s&@mandir@&$mandir&g | |
32506 | s&\\\${datarootdir}&$datarootdir&g' ;; | |
32507 | esac | |
32508 | _ACEOF | |
32509 | ||
32510 | # Neutralize VPATH when `$srcdir' = `.'. | |
32511 | # Shell code in configure.ac might set extrasub. | |
32512 | # FIXME: do we really want to maintain this feature? | |
32513 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
32514 | ac_sed_extra="$ac_vpsub | |
32515 | $extrasub | |
32516 | _ACEOF | |
32517 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
32518 | :t | |
32519 | /@[a-zA-Z_][a-zA-Z_0-9]*@/!b | |
32520 | s|@configure_input@|$ac_sed_conf_input|;t t | |
32521 | s&@top_builddir@&$ac_top_builddir_sub&;t t | |
32522 | s&@top_build_prefix@&$ac_top_build_prefix&;t t | |
32523 | s&@srcdir@&$ac_srcdir&;t t | |
32524 | s&@abs_srcdir@&$ac_abs_srcdir&;t t | |
32525 | s&@top_srcdir@&$ac_top_srcdir&;t t | |
32526 | s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t | |
32527 | s&@builddir@&$ac_builddir&;t t | |
32528 | s&@abs_builddir@&$ac_abs_builddir&;t t | |
32529 | s&@abs_top_builddir@&$ac_abs_top_builddir&;t t | |
32530 | s&@INSTALL@&$ac_INSTALL&;t t | |
32531 | s&@MKDIR_P@&$ac_MKDIR_P&;t t | |
32532 | $ac_datarootdir_hack | |
32533 | " | |
d0ac1c44 SM |
32534 | eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ |
32535 | >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 | |
c971b7fa PA |
32536 | |
32537 | test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && | |
d0ac1c44 SM |
32538 | { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && |
32539 | { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ | |
32540 | "$ac_tmp/out"`; test -z "$ac_out"; } && | |
c971b7fa | 32541 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' |
d0ac1c44 | 32542 | which seems to be undefined. Please make sure it is defined" >&5 |
c971b7fa | 32543 | $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' |
d0ac1c44 | 32544 | which seems to be undefined. Please make sure it is defined" >&2;} |
c971b7fa | 32545 | |
d0ac1c44 | 32546 | rm -f "$ac_tmp/stdin" |
c971b7fa | 32547 | case $ac_file in |
d0ac1c44 SM |
32548 | -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; |
32549 | *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; | |
c971b7fa | 32550 | esac \ |
d0ac1c44 | 32551 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 |
c971b7fa PA |
32552 | ;; |
32553 | :H) | |
32554 | # | |
32555 | # CONFIG_HEADER | |
32556 | # | |
32557 | if test x"$ac_file" != x-; then | |
32558 | { | |
32559 | $as_echo "/* $configure_input */" \ | |
d0ac1c44 SM |
32560 | && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" |
32561 | } >"$ac_tmp/config.h" \ | |
32562 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 | |
32563 | if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then | |
c971b7fa PA |
32564 | { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 |
32565 | $as_echo "$as_me: $ac_file is unchanged" >&6;} | |
32566 | else | |
32567 | rm -f "$ac_file" | |
d0ac1c44 SM |
32568 | mv "$ac_tmp/config.h" "$ac_file" \ |
32569 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 | |
c971b7fa PA |
32570 | fi |
32571 | else | |
32572 | $as_echo "/* $configure_input */" \ | |
d0ac1c44 SM |
32573 | && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ |
32574 | || as_fn_error $? "could not create -" "$LINENO" 5 | |
c971b7fa PA |
32575 | fi |
32576 | # Compute "$ac_file"'s index in $config_headers. | |
32577 | _am_arg="$ac_file" | |
32578 | _am_stamp_count=1 | |
32579 | for _am_header in $config_headers :; do | |
32580 | case $_am_header in | |
32581 | $_am_arg | $_am_arg:* ) | |
32582 | break ;; | |
32583 | * ) | |
32584 | _am_stamp_count=`expr $_am_stamp_count + 1` ;; | |
32585 | esac | |
32586 | done | |
32587 | echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || | |
32588 | $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
32589 | X"$_am_arg" : 'X\(//\)[^/]' \| \ | |
32590 | X"$_am_arg" : 'X\(//\)$' \| \ | |
32591 | X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || | |
32592 | $as_echo X"$_am_arg" | | |
32593 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
32594 | s//\1/ | |
32595 | q | |
32596 | } | |
32597 | /^X\(\/\/\)[^/].*/{ | |
32598 | s//\1/ | |
32599 | q | |
32600 | } | |
32601 | /^X\(\/\/\)$/{ | |
32602 | s//\1/ | |
32603 | q | |
32604 | } | |
32605 | /^X\(\/\).*/{ | |
32606 | s//\1/ | |
32607 | q | |
32608 | } | |
32609 | s/.*/./; q'`/stamp-h$_am_stamp_count | |
32610 | ;; | |
32611 | ||
32612 | :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 | |
32613 | $as_echo "$as_me: executing $ac_file commands" >&6;} | |
32614 | ;; | |
32615 | esac | |
32616 | ||
32617 | ||
32618 | case $ac_file$ac_mode in | |
32619 | "depfiles":C) test x"$AMDEP_TRUE" != x"" || { | |
d0ac1c44 | 32620 | # Older Autoconf quotes --file arguments for eval, but not when files |
c971b7fa PA |
32621 | # are listed without --file. Let's play safe and only enable the eval |
32622 | # if we detect the quoting. | |
32623 | case $CONFIG_FILES in | |
32624 | *\'*) eval set x "$CONFIG_FILES" ;; | |
32625 | *) set x $CONFIG_FILES ;; | |
32626 | esac | |
32627 | shift | |
32628 | for mf | |
32629 | do | |
32630 | # Strip MF so we end up with the name of the file. | |
32631 | mf=`echo "$mf" | sed -e 's/:.*$//'` | |
32632 | # Check whether this is an Automake generated Makefile or not. | |
d0ac1c44 | 32633 | # We used to match only the files named 'Makefile.in', but |
c971b7fa PA |
32634 | # some people rename them; so instead we look at the file content. |
32635 | # Grep'ing the first line is not enough: some people post-process | |
32636 | # each Makefile.in and add a new line on top of each file to say so. | |
32637 | # Grep'ing the whole file is not good either: AIX grep has a line | |
32638 | # limit of 2048, but all sed's we know have understand at least 4000. | |
32639 | if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then | |
32640 | dirpart=`$as_dirname -- "$mf" || | |
32641 | $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
32642 | X"$mf" : 'X\(//\)[^/]' \| \ | |
32643 | X"$mf" : 'X\(//\)$' \| \ | |
32644 | X"$mf" : 'X\(/\)' \| . 2>/dev/null || | |
32645 | $as_echo X"$mf" | | |
32646 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
32647 | s//\1/ | |
32648 | q | |
32649 | } | |
32650 | /^X\(\/\/\)[^/].*/{ | |
32651 | s//\1/ | |
32652 | q | |
32653 | } | |
32654 | /^X\(\/\/\)$/{ | |
32655 | s//\1/ | |
32656 | q | |
32657 | } | |
32658 | /^X\(\/\).*/{ | |
32659 | s//\1/ | |
32660 | q | |
32661 | } | |
32662 | s/.*/./; q'` | |
32663 | else | |
32664 | continue | |
32665 | fi | |
32666 | # Extract the definition of DEPDIR, am__include, and am__quote | |
d0ac1c44 | 32667 | # from the Makefile without running 'make'. |
c971b7fa PA |
32668 | DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` |
32669 | test -z "$DEPDIR" && continue | |
32670 | am__include=`sed -n 's/^am__include = //p' < "$mf"` | |
d0ac1c44 | 32671 | test -z "$am__include" && continue |
c971b7fa | 32672 | am__quote=`sed -n 's/^am__quote = //p' < "$mf"` |
c971b7fa PA |
32673 | # Find all dependency output files, they are included files with |
32674 | # $(DEPDIR) in their names. We invoke sed twice because it is the | |
32675 | # simplest approach to changing $(DEPDIR) to its actual value in the | |
32676 | # expansion. | |
32677 | for file in `sed -n " | |
32678 | s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ | |
d0ac1c44 | 32679 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do |
c971b7fa PA |
32680 | # Make sure the directory exists. |
32681 | test -f "$dirpart/$file" && continue | |
32682 | fdir=`$as_dirname -- "$file" || | |
32683 | $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
32684 | X"$file" : 'X\(//\)[^/]' \| \ | |
32685 | X"$file" : 'X\(//\)$' \| \ | |
32686 | X"$file" : 'X\(/\)' \| . 2>/dev/null || | |
32687 | $as_echo X"$file" | | |
32688 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
32689 | s//\1/ | |
32690 | q | |
32691 | } | |
32692 | /^X\(\/\/\)[^/].*/{ | |
32693 | s//\1/ | |
32694 | q | |
32695 | } | |
32696 | /^X\(\/\/\)$/{ | |
32697 | s//\1/ | |
32698 | q | |
32699 | } | |
32700 | /^X\(\/\).*/{ | |
32701 | s//\1/ | |
32702 | q | |
32703 | } | |
32704 | s/.*/./; q'` | |
32705 | as_dir=$dirpart/$fdir; as_fn_mkdir_p | |
32706 | # echo "creating $dirpart/$file" | |
32707 | echo '# dummy' > "$dirpart/$file" | |
32708 | done | |
32709 | done | |
32710 | } | |
32711 | ;; | |
32712 | "default":C) | |
32713 | case x$CONFIG_HEADERS in | |
32714 | xconfig.h:config.in) | |
32715 | echo > stamp-h ;; | |
32716 | esac | |
32717 | ;; | |
32718 | ||
32719 | esac | |
32720 | done # for ac_tag | |
32721 | ||
32722 | ||
32723 | as_fn_exit 0 | |
32724 | _ACEOF | |
32725 | ac_clean_files=$ac_clean_files_save | |
32726 | ||
32727 | test $ac_write_fail = 0 || | |
d0ac1c44 | 32728 | as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 |
c971b7fa PA |
32729 | |
32730 | ||
32731 | # configure is writing to config.log, and then calls config.status. | |
32732 | # config.status does its own redirection, appending to config.log. | |
32733 | # Unfortunately, on DOS this fails, as config.log is still kept open | |
32734 | # by configure, so config.status won't be able to write to it; its | |
32735 | # output is simply discarded. So we exec the FD to /dev/null, | |
32736 | # effectively closing config.log, so it can be properly (re)opened and | |
32737 | # appended to by config.status. When coming back to configure, we | |
32738 | # need to make the FD available again. | |
32739 | if test "$no_create" != yes; then | |
32740 | ac_cs_success=: | |
32741 | ac_config_status_args= | |
32742 | test "$silent" = yes && | |
32743 | ac_config_status_args="$ac_config_status_args --quiet" | |
32744 | exec 5>/dev/null | |
32745 | $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false | |
32746 | exec 5>>config.log | |
32747 | # Use ||, not &&, to avoid exiting from the if with $? = 1, which | |
32748 | # would make configure fail if this is the last instruction. | |
d0ac1c44 | 32749 | $ac_cs_success || as_fn_exit 1 |
c971b7fa PA |
32750 | fi |
32751 | if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then | |
32752 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 | |
32753 | $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} | |
32754 | fi | |
32755 | ||
32756 | ||
32757 | exit 0 |