]>
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" |
c971b7fa PA |
586 | # Factoring default headers for most tests. |
587 | ac_includes_default="\ | |
588 | #include <stdio.h> | |
589 | #ifdef HAVE_SYS_TYPES_H | |
590 | # include <sys/types.h> | |
591 | #endif | |
592 | #ifdef HAVE_SYS_STAT_H | |
593 | # include <sys/stat.h> | |
594 | #endif | |
595 | #ifdef STDC_HEADERS | |
596 | # include <stdlib.h> | |
597 | # include <stddef.h> | |
598 | #else | |
599 | # ifdef HAVE_STDLIB_H | |
600 | # include <stdlib.h> | |
601 | # endif | |
602 | #endif | |
603 | #ifdef HAVE_STRING_H | |
604 | # if !defined STDC_HEADERS && defined HAVE_MEMORY_H | |
605 | # include <memory.h> | |
606 | # endif | |
607 | # include <string.h> | |
608 | #endif | |
609 | #ifdef HAVE_STRINGS_H | |
610 | # include <strings.h> | |
611 | #endif | |
612 | #ifdef HAVE_INTTYPES_H | |
613 | # include <inttypes.h> | |
614 | #endif | |
615 | #ifdef HAVE_STDINT_H | |
616 | # include <stdint.h> | |
617 | #endif | |
618 | #ifdef HAVE_UNISTD_H | |
619 | # include <unistd.h> | |
620 | #endif" | |
621 | ||
5abebf3c | 622 | gl_use_threads_default= |
c0c3707f CB |
623 | gl_use_winpthreads_default= |
624 | ac_header_list= | |
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 | |
4a626d0a | 701 | UNISTD_H_DEFINES_STRUCT_TIMESPEC |
09607c9e TT |
702 | PTHREAD_H_DEFINES_STRUCT_TIMESPEC |
703 | SYS_TIME_H_DEFINES_STRUCT_TIMESPEC | |
704 | TIME_H_DEFINES_STRUCT_TIMESPEC | |
705 | NEXT_AS_FIRST_DIRECTIVE_TIME_H | |
706 | NEXT_TIME_H | |
725e2999 JB |
707 | HAVE_SYS_UIO_H |
708 | NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H | |
709 | NEXT_SYS_UIO_H | |
c0c3707f | 710 | WINDOWS_STAT_INODES |
63ce7108 TT |
711 | WINDOWS_64_BIT_OFF_T |
712 | NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H | |
713 | NEXT_SYS_TYPES_H | |
2196f55f YQ |
714 | NEXT_AS_FIRST_DIRECTIVE_STRING_H |
715 | NEXT_STRING_H | |
98399780 YQ |
716 | NEXT_AS_FIRST_DIRECTIVE_STDLIB_H |
717 | NEXT_STDLIB_H | |
6a29c58e YQ |
718 | NEXT_AS_FIRST_DIRECTIVE_STDIO_H |
719 | NEXT_STDIO_H | |
2196f55f YQ |
720 | HAVE__BOOL |
721 | GL_GENERATE_STDBOOL_H_FALSE | |
722 | GL_GENERATE_STDBOOL_H_TRUE | |
723 | STDBOOL_H | |
725e2999 JB |
724 | GL_GENERATE_STDALIGN_H_FALSE |
725 | GL_GENERATE_STDALIGN_H_TRUE | |
726 | STDALIGN_H | |
0750520d PA |
727 | NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H |
728 | NEXT_SIGNAL_H | |
729 | REPLACE_RAISE | |
730 | REPLACE_PTHREAD_SIGMASK | |
731 | HAVE_SIGHANDLER_T | |
732 | HAVE_TYPE_VOLATILE_SIG_ATOMIC_T | |
733 | HAVE_STRUCT_SIGACTION_SA_SIGACTION | |
734 | HAVE_SIGACTION | |
735 | HAVE_SIGINFO_T | |
736 | HAVE_SIGSET_T | |
737 | HAVE_RAISE | |
738 | HAVE_PTHREAD_SIGMASK | |
739 | HAVE_POSIX_SIGNALBLOCKING | |
740 | GNULIB_SIGACTION | |
741 | GNULIB_SIGPROCMASK | |
742 | GNULIB_SIGNAL_H_SIGPIPE | |
743 | GNULIB_RAISE | |
744 | GNULIB_PTHREAD_SIGMASK | |
6a29c58e YQ |
745 | REPLACE_VSPRINTF |
746 | REPLACE_VSNPRINTF | |
747 | REPLACE_VPRINTF | |
748 | REPLACE_VFPRINTF | |
749 | REPLACE_VDPRINTF | |
750 | REPLACE_VASPRINTF | |
751 | REPLACE_TMPFILE | |
752 | REPLACE_STDIO_WRITE_FUNCS | |
753 | REPLACE_STDIO_READ_FUNCS | |
754 | REPLACE_SPRINTF | |
755 | REPLACE_SNPRINTF | |
756 | REPLACE_RENAMEAT | |
757 | REPLACE_RENAME | |
758 | REPLACE_REMOVE | |
759 | REPLACE_PRINTF | |
760 | REPLACE_POPEN | |
761 | REPLACE_PERROR | |
762 | REPLACE_OBSTACK_PRINTF | |
763 | REPLACE_GETLINE | |
764 | REPLACE_GETDELIM | |
765 | REPLACE_FTELLO | |
766 | REPLACE_FTELL | |
767 | REPLACE_FSEEKO | |
768 | REPLACE_FSEEK | |
769 | REPLACE_FREOPEN | |
770 | REPLACE_FPURGE | |
771 | REPLACE_FPRINTF | |
772 | REPLACE_FOPEN | |
773 | REPLACE_FFLUSH | |
774 | REPLACE_FDOPEN | |
775 | REPLACE_FCLOSE | |
776 | REPLACE_DPRINTF | |
777 | HAVE_VDPRINTF | |
778 | HAVE_VASPRINTF | |
779 | HAVE_RENAMEAT | |
780 | HAVE_POPEN | |
781 | HAVE_PCLOSE | |
782 | HAVE_FTELLO | |
783 | HAVE_FSEEKO | |
784 | HAVE_DPRINTF | |
785 | HAVE_DECL_VSNPRINTF | |
786 | HAVE_DECL_SNPRINTF | |
787 | HAVE_DECL_OBSTACK_PRINTF | |
788 | HAVE_DECL_GETLINE | |
789 | HAVE_DECL_GETDELIM | |
790 | HAVE_DECL_FTELLO | |
791 | HAVE_DECL_FSEEKO | |
792 | HAVE_DECL_FPURGE | |
793 | GNULIB_VSPRINTF_POSIX | |
794 | GNULIB_VSNPRINTF | |
795 | GNULIB_VPRINTF_POSIX | |
796 | GNULIB_VPRINTF | |
797 | GNULIB_VFPRINTF_POSIX | |
798 | GNULIB_VFPRINTF | |
799 | GNULIB_VDPRINTF | |
800 | GNULIB_VSCANF | |
801 | GNULIB_VFSCANF | |
802 | GNULIB_VASPRINTF | |
803 | GNULIB_TMPFILE | |
804 | GNULIB_STDIO_H_SIGPIPE | |
805 | GNULIB_STDIO_H_NONBLOCKING | |
806 | GNULIB_SPRINTF_POSIX | |
807 | GNULIB_SNPRINTF | |
808 | GNULIB_SCANF | |
809 | GNULIB_RENAMEAT | |
810 | GNULIB_RENAME | |
811 | GNULIB_REMOVE | |
812 | GNULIB_PUTS | |
813 | GNULIB_PUTCHAR | |
814 | GNULIB_PUTC | |
815 | GNULIB_PRINTF_POSIX | |
816 | GNULIB_PRINTF | |
817 | GNULIB_POPEN | |
818 | GNULIB_PERROR | |
819 | GNULIB_PCLOSE | |
820 | GNULIB_OBSTACK_PRINTF_POSIX | |
821 | GNULIB_OBSTACK_PRINTF | |
822 | GNULIB_GETLINE | |
823 | GNULIB_GETDELIM | |
824 | GNULIB_GETCHAR | |
825 | GNULIB_GETC | |
826 | GNULIB_FWRITE | |
827 | GNULIB_FTELLO | |
828 | GNULIB_FTELL | |
829 | GNULIB_FSEEKO | |
830 | GNULIB_FSEEK | |
831 | GNULIB_FSCANF | |
832 | GNULIB_FREOPEN | |
833 | GNULIB_FREAD | |
834 | GNULIB_FPUTS | |
835 | GNULIB_FPUTC | |
836 | GNULIB_FPURGE | |
837 | GNULIB_FPRINTF_POSIX | |
838 | GNULIB_FPRINTF | |
839 | GNULIB_FOPEN | |
840 | GNULIB_FGETS | |
841 | GNULIB_FGETC | |
842 | GNULIB_FFLUSH | |
843 | GNULIB_FDOPEN | |
844 | GNULIB_FCLOSE | |
845 | GNULIB_DPRINTF | |
725e2999 JB |
846 | GL_GENERATE_NETINET_IN_H_FALSE |
847 | GL_GENERATE_NETINET_IN_H_TRUE | |
848 | NETINET_IN_H | |
849 | HAVE_NETINET_IN_H | |
850 | NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H | |
851 | NEXT_NETINET_IN_H | |
c971b7fa | 852 | UNDEFINE_STRTOK_R |
c971b7fa | 853 | REPLACE_STRSIGNAL |
c971b7fa PA |
854 | REPLACE_STRERROR_R |
855 | REPLACE_STRERROR | |
c0c3707f | 856 | REPLACE_STRTOK_R |
c971b7fa PA |
857 | REPLACE_STRCASESTR |
858 | REPLACE_STRSTR | |
c0c3707f CB |
859 | REPLACE_STRNLEN |
860 | REPLACE_STRNDUP | |
861 | REPLACE_STRNCAT | |
c971b7fa | 862 | REPLACE_STRDUP |
c0c3707f | 863 | REPLACE_STRCHRNUL |
c971b7fa PA |
864 | REPLACE_STPNCPY |
865 | REPLACE_MEMMEM | |
866 | REPLACE_MEMCHR | |
867 | HAVE_STRVERSCMP | |
868 | HAVE_DECL_STRSIGNAL | |
869 | HAVE_DECL_STRERROR_R | |
870 | HAVE_DECL_STRTOK_R | |
871 | HAVE_STRCASESTR | |
872 | HAVE_STRSEP | |
873 | HAVE_STRPBRK | |
874 | HAVE_DECL_STRNLEN | |
875 | HAVE_DECL_STRNDUP | |
876 | HAVE_DECL_STRDUP | |
877 | HAVE_STRCHRNUL | |
878 | HAVE_STPNCPY | |
879 | HAVE_STPCPY | |
880 | HAVE_RAWMEMCHR | |
881 | HAVE_DECL_MEMRCHR | |
882 | HAVE_MEMPCPY | |
883 | HAVE_DECL_MEMMEM | |
884 | HAVE_MEMCHR | |
885 | HAVE_FFSLL | |
886 | HAVE_FFSL | |
c0c3707f | 887 | HAVE_EXPLICIT_BZERO |
c971b7fa PA |
888 | HAVE_MBSLEN |
889 | GNULIB_STRVERSCMP | |
890 | GNULIB_STRSIGNAL | |
891 | GNULIB_STRERROR_R | |
892 | GNULIB_STRERROR | |
893 | GNULIB_MBSTOK_R | |
894 | GNULIB_MBSSEP | |
895 | GNULIB_MBSSPN | |
896 | GNULIB_MBSPBRK | |
897 | GNULIB_MBSCSPN | |
898 | GNULIB_MBSCASESTR | |
899 | GNULIB_MBSPCASECMP | |
900 | GNULIB_MBSNCASECMP | |
901 | GNULIB_MBSCASECMP | |
902 | GNULIB_MBSSTR | |
903 | GNULIB_MBSRCHR | |
904 | GNULIB_MBSCHR | |
905 | GNULIB_MBSNLEN | |
906 | GNULIB_MBSLEN | |
907 | GNULIB_STRTOK_R | |
908 | GNULIB_STRCASESTR | |
909 | GNULIB_STRSTR | |
910 | GNULIB_STRSEP | |
911 | GNULIB_STRPBRK | |
912 | GNULIB_STRNLEN | |
913 | GNULIB_STRNDUP | |
914 | GNULIB_STRNCAT | |
915 | GNULIB_STRDUP | |
916 | GNULIB_STRCHRNUL | |
917 | GNULIB_STPNCPY | |
918 | GNULIB_STPCPY | |
919 | GNULIB_RAWMEMCHR | |
920 | GNULIB_MEMRCHR | |
921 | GNULIB_MEMPCPY | |
922 | GNULIB_MEMMEM | |
923 | GNULIB_MEMCHR | |
924 | GNULIB_FFSLL | |
925 | GNULIB_FFSL | |
c0c3707f | 926 | GNULIB_EXPLICIT_BZERO |
8690e634 | 927 | LOCALE_FR |
5df4cba6 SM |
928 | HAVE_VISIBILITY |
929 | CFLAG_VISIBILITY | |
930 | LIB_MBRTOWC | |
8690e634 | 931 | LOCALE_ZH_CN |
c0c3707f | 932 | LOCALE_FR_UTF8 |
8690e634 | 933 | LOCALE_JA |
c0c3707f CB |
934 | REPLACE_WCSTOK |
935 | REPLACE_WCSFTIME | |
8690e634 JK |
936 | REPLACE_WCSWIDTH |
937 | REPLACE_WCWIDTH | |
938 | REPLACE_WCSNRTOMBS | |
939 | REPLACE_WCSRTOMBS | |
940 | REPLACE_WCRTOMB | |
941 | REPLACE_MBSNRTOWCS | |
942 | REPLACE_MBSRTOWCS | |
943 | REPLACE_MBRLEN | |
944 | REPLACE_MBRTOWC | |
945 | REPLACE_MBSINIT | |
946 | REPLACE_WCTOB | |
947 | REPLACE_BTOWC | |
948 | REPLACE_MBSTATE_T | |
949 | HAVE_DECL_WCWIDTH | |
950 | HAVE_DECL_WCTOB | |
c0c3707f | 951 | HAVE_WCSFTIME |
8690e634 JK |
952 | HAVE_WCSWIDTH |
953 | HAVE_WCSTOK | |
954 | HAVE_WCSSTR | |
955 | HAVE_WCSPBRK | |
956 | HAVE_WCSSPN | |
957 | HAVE_WCSCSPN | |
958 | HAVE_WCSRCHR | |
959 | HAVE_WCSCHR | |
960 | HAVE_WCSDUP | |
961 | HAVE_WCSXFRM | |
962 | HAVE_WCSCOLL | |
963 | HAVE_WCSNCASECMP | |
964 | HAVE_WCSCASECMP | |
965 | HAVE_WCSNCMP | |
966 | HAVE_WCSCMP | |
967 | HAVE_WCSNCAT | |
968 | HAVE_WCSCAT | |
969 | HAVE_WCPNCPY | |
970 | HAVE_WCSNCPY | |
971 | HAVE_WCPCPY | |
972 | HAVE_WCSCPY | |
973 | HAVE_WCSNLEN | |
974 | HAVE_WCSLEN | |
975 | HAVE_WMEMSET | |
976 | HAVE_WMEMMOVE | |
977 | HAVE_WMEMCPY | |
978 | HAVE_WMEMCMP | |
979 | HAVE_WMEMCHR | |
980 | HAVE_WCSNRTOMBS | |
981 | HAVE_WCSRTOMBS | |
982 | HAVE_WCRTOMB | |
983 | HAVE_MBSNRTOWCS | |
984 | HAVE_MBSRTOWCS | |
985 | HAVE_MBRLEN | |
986 | HAVE_MBRTOWC | |
987 | HAVE_MBSINIT | |
988 | HAVE_BTOWC | |
c0c3707f | 989 | GNULIB_WCSFTIME |
8690e634 JK |
990 | GNULIB_WCSWIDTH |
991 | GNULIB_WCSTOK | |
992 | GNULIB_WCSSTR | |
993 | GNULIB_WCSPBRK | |
994 | GNULIB_WCSSPN | |
995 | GNULIB_WCSCSPN | |
996 | GNULIB_WCSRCHR | |
997 | GNULIB_WCSCHR | |
998 | GNULIB_WCSDUP | |
999 | GNULIB_WCSXFRM | |
1000 | GNULIB_WCSCOLL | |
1001 | GNULIB_WCSNCASECMP | |
1002 | GNULIB_WCSCASECMP | |
1003 | GNULIB_WCSNCMP | |
1004 | GNULIB_WCSCMP | |
1005 | GNULIB_WCSNCAT | |
1006 | GNULIB_WCSCAT | |
1007 | GNULIB_WCPNCPY | |
1008 | GNULIB_WCSNCPY | |
1009 | GNULIB_WCPCPY | |
1010 | GNULIB_WCSCPY | |
1011 | GNULIB_WCSNLEN | |
1012 | GNULIB_WCSLEN | |
1013 | GNULIB_WMEMSET | |
1014 | GNULIB_WMEMMOVE | |
1015 | GNULIB_WMEMCPY | |
1016 | GNULIB_WMEMCMP | |
1017 | GNULIB_WMEMCHR | |
1018 | GNULIB_WCWIDTH | |
1019 | GNULIB_WCSNRTOMBS | |
1020 | GNULIB_WCSRTOMBS | |
1021 | GNULIB_WCRTOMB | |
1022 | GNULIB_MBSNRTOWCS | |
1023 | GNULIB_MBSRTOWCS | |
1024 | GNULIB_MBRLEN | |
1025 | GNULIB_MBRTOWC | |
1026 | GNULIB_MBSINIT | |
1027 | GNULIB_WCTOB | |
1028 | GNULIB_BTOWC | |
88b48903 WN |
1029 | NEXT_AS_FIRST_DIRECTIVE_MATH_H |
1030 | NEXT_MATH_H | |
5abebf3c CB |
1031 | LTLIBMULTITHREAD |
1032 | LIBMULTITHREAD | |
1033 | LTLIBTHREAD | |
1034 | LIBTHREAD | |
5df4cba6 SM |
1035 | LIBSTDTHREAD |
1036 | NEXT_AS_FIRST_DIRECTIVE_LOCALE_H | |
1037 | NEXT_LOCALE_H | |
1038 | HAVE_XLOCALE_H | |
1039 | NEXT_AS_FIRST_DIRECTIVE_STDDEF_H | |
1040 | NEXT_STDDEF_H | |
1041 | GL_GENERATE_STDDEF_H_FALSE | |
1042 | GL_GENERATE_STDDEF_H_TRUE | |
1043 | STDDEF_H | |
1044 | HAVE_WCHAR_T | |
1045 | HAVE_MAX_ALIGN_T | |
1046 | REPLACE_NULL | |
1047 | REPLACE_STRUCT_LCONV | |
1048 | REPLACE_FREELOCALE | |
1049 | REPLACE_DUPLOCALE | |
1050 | REPLACE_NEWLOCALE | |
1051 | REPLACE_SETLOCALE | |
1052 | REPLACE_LOCALECONV | |
1053 | HAVE_FREELOCALE | |
1054 | HAVE_DUPLOCALE | |
1055 | HAVE_NEWLOCALE | |
1056 | GNULIB_LOCALENAME | |
1057 | GNULIB_DUPLOCALE | |
1058 | GNULIB_SETLOCALE_NULL | |
1059 | GNULIB_SETLOCALE | |
1060 | GNULIB_LOCALECONV | |
8690e634 | 1061 | LOCALCHARSET_TESTS_ENVIRONMENT |
c971b7fa PA |
1062 | NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H |
1063 | NEXT_INTTYPES_H | |
1064 | UINT64_MAX_EQ_ULONG_MAX | |
1065 | UINT32_MAX_LT_UINTMAX_MAX | |
1066 | PRIPTR_PREFIX | |
1067 | PRI_MACROS_BROKEN | |
1068 | INT64_MAX_EQ_LONG_MAX | |
1069 | INT32_MAX_LT_INTMAX_MAX | |
4a626d0a | 1070 | REPLACE_STRTOUMAX |
c971b7fa | 1071 | REPLACE_STRTOIMAX |
c0c3707f | 1072 | HAVE_IMAXDIV_T |
c971b7fa PA |
1073 | HAVE_DECL_STRTOUMAX |
1074 | HAVE_DECL_STRTOIMAX | |
1075 | HAVE_DECL_IMAXDIV | |
1076 | HAVE_DECL_IMAXABS | |
1077 | GNULIB_STRTOUMAX | |
1078 | GNULIB_STRTOIMAX | |
1079 | GNULIB_IMAXDIV | |
1080 | GNULIB_IMAXABS | |
1081 | GL_GENERATE_STDINT_H_FALSE | |
1082 | GL_GENERATE_STDINT_H_TRUE | |
1083 | STDINT_H | |
49e4877c PA |
1084 | HAVE_SYS_INTTYPES_H |
1085 | HAVE_SYS_BITYPES_H | |
1086 | HAVE_C99_STDINT_H | |
c971b7fa PA |
1087 | WINT_T_SUFFIX |
1088 | WCHAR_T_SUFFIX | |
1089 | SIG_ATOMIC_T_SUFFIX | |
1090 | SIZE_T_SUFFIX | |
1091 | PTRDIFF_T_SUFFIX | |
1092 | HAVE_SIGNED_WINT_T | |
1093 | HAVE_SIGNED_WCHAR_T | |
1094 | HAVE_SIGNED_SIG_ATOMIC_T | |
1095 | BITSIZEOF_WINT_T | |
1096 | BITSIZEOF_WCHAR_T | |
1097 | BITSIZEOF_SIG_ATOMIC_T | |
1098 | BITSIZEOF_SIZE_T | |
1099 | BITSIZEOF_PTRDIFF_T | |
1100 | APPLE_UNIVERSAL_BUILD | |
c971b7fa PA |
1101 | HAVE_STDINT_H |
1102 | NEXT_AS_FIRST_DIRECTIVE_STDINT_H | |
1103 | NEXT_STDINT_H | |
c971b7fa PA |
1104 | HAVE_SYS_TYPES_H |
1105 | HAVE_INTTYPES_H | |
1106 | HAVE_WCHAR_H | |
c0c3707f | 1107 | GNULIB_OVERRIDES_WINT_T |
49e4877c PA |
1108 | GL_GENERATE_LIMITS_H_FALSE |
1109 | GL_GENERATE_LIMITS_H_TRUE | |
1110 | LIMITS_H | |
1111 | NEXT_AS_FIRST_DIRECTIVE_LIMITS_H | |
1112 | NEXT_LIMITS_H | |
725e2999 JB |
1113 | HAVE_SYS_SOCKET_H |
1114 | NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H | |
1115 | NEXT_SYS_SOCKET_H | |
1116 | HAVE_ACCEPT4 | |
1117 | HAVE_SA_FAMILY_T | |
1118 | HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY | |
1119 | HAVE_STRUCT_SOCKADDR_STORAGE | |
1120 | GNULIB_ACCEPT4 | |
1121 | GNULIB_SHUTDOWN | |
1122 | GNULIB_SETSOCKOPT | |
1123 | GNULIB_SENDTO | |
1124 | GNULIB_RECVFROM | |
1125 | GNULIB_SEND | |
1126 | GNULIB_RECV | |
1127 | GNULIB_LISTEN | |
1128 | GNULIB_GETSOCKOPT | |
1129 | GNULIB_GETSOCKNAME | |
1130 | GNULIB_GETPEERNAME | |
1131 | GNULIB_BIND | |
1132 | GNULIB_ACCEPT | |
1133 | GNULIB_CONNECT | |
1134 | GNULIB_SOCKET | |
1135 | INET_NTOP_LIB | |
5df4cba6 SM |
1136 | LIB_HARD_LOCALE |
1137 | LIB_SETLOCALE_NULL | |
1138 | LIB_SCHED_YIELD | |
1139 | LIBPMULTITHREAD | |
1140 | LIBPTHREAD | |
6ec2e0f5 SDJ |
1141 | GL_GENERATE_GLOB_H_FALSE |
1142 | GL_GENERATE_GLOB_H_TRUE | |
1143 | GLOB_H | |
c0c3707f CB |
1144 | HAVE_GLOB_H |
1145 | NEXT_AS_FIRST_DIRECTIVE_GLOB_H | |
1146 | NEXT_GLOB_H | |
1147 | REPLACE_GLOB_PATTERN_P | |
1148 | REPLACE_GLOB | |
1149 | HAVE_GLOB_PATTERN_P | |
1150 | HAVE_GLOB | |
1151 | GNULIB_GLOB | |
1152 | REPLACE_LOCALTIME | |
1153 | REPLACE_GMTIME | |
1154 | REPLACE_TZSET | |
1155 | REPLACE_TIMEGM | |
1156 | REPLACE_STRFTIME | |
1157 | REPLACE_NANOSLEEP | |
1158 | REPLACE_MKTIME | |
1159 | REPLACE_LOCALTIME_R | |
1160 | REPLACE_CTIME | |
1161 | HAVE_TIMEZONE_T | |
1162 | HAVE_TZSET | |
1163 | HAVE_TIMEGM | |
1164 | HAVE_STRPTIME | |
1165 | HAVE_NANOSLEEP | |
1166 | HAVE_DECL_LOCALTIME_R | |
1167 | GNULIB_TZSET | |
1168 | GNULIB_TIME_RZ | |
1169 | GNULIB_TIME_R | |
1170 | GNULIB_TIMEGM | |
1171 | GNULIB_STRPTIME | |
1172 | GNULIB_STRFTIME | |
1173 | GNULIB_NANOSLEEP | |
1174 | GNULIB_LOCALTIME | |
1175 | GNULIB_MKTIME | |
1176 | GNULIB_CTIME | |
4a626d0a PA |
1177 | NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H |
1178 | NEXT_SYS_TIME_H | |
1179 | REPLACE_STRUCT_TIMEVAL | |
1180 | REPLACE_GETTIMEOFDAY | |
4a626d0a PA |
1181 | HAVE_SYS_TIME_H |
1182 | HAVE_STRUCT_TIMEVAL | |
1183 | HAVE_GETTIMEOFDAY | |
1184 | GNULIB_GETTIMEOFDAY | |
6ec2e0f5 SDJ |
1185 | LTLIBINTL |
1186 | LIBINTL | |
c0c3707f | 1187 | LIB_GETLOGIN |
6ec2e0f5 | 1188 | WINDOWS_64_BIT_ST_SIZE |
c0c3707f | 1189 | WINDOWS_STAT_TIMESPEC |
6ec2e0f5 SDJ |
1190 | NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H |
1191 | NEXT_SYS_STAT_H | |
1192 | REPLACE_UTIMENSAT | |
1193 | REPLACE_STAT | |
1194 | REPLACE_MKNOD | |
1195 | REPLACE_MKFIFO | |
1196 | REPLACE_MKDIR | |
1197 | REPLACE_LSTAT | |
5df4cba6 | 1198 | REPLACE_LCHMOD |
6ec2e0f5 SDJ |
1199 | REPLACE_FUTIMENS |
1200 | REPLACE_FSTATAT | |
1201 | REPLACE_FSTAT | |
5df4cba6 | 1202 | REPLACE_FCHMODAT |
6ec2e0f5 SDJ |
1203 | HAVE_UTIMENSAT |
1204 | HAVE_MKNODAT | |
1205 | HAVE_MKNOD | |
1206 | HAVE_MKFIFOAT | |
1207 | HAVE_MKFIFO | |
1208 | HAVE_MKDIRAT | |
1209 | HAVE_LSTAT | |
1210 | HAVE_LCHMOD | |
1211 | HAVE_FUTIMENS | |
1212 | HAVE_FSTATAT | |
1213 | HAVE_FCHMODAT | |
c0c3707f | 1214 | GNULIB_OVERRIDES_STRUCT_STAT |
6ec2e0f5 SDJ |
1215 | GNULIB_UTIMENSAT |
1216 | GNULIB_STAT | |
1217 | GNULIB_MKNODAT | |
1218 | GNULIB_MKNOD | |
1219 | GNULIB_MKFIFOAT | |
1220 | GNULIB_MKFIFO | |
1221 | GNULIB_MKDIRAT | |
1222 | GNULIB_LSTAT | |
1223 | GNULIB_LCHMOD | |
1224 | GNULIB_FUTIMENS | |
1225 | GNULIB_FSTATAT | |
1226 | GNULIB_FSTAT | |
1227 | GNULIB_FCHMODAT | |
88b48903 WN |
1228 | FREXPL_LIBM |
1229 | HAVE_SAME_LONG_DOUBLE_AS_DOUBLE | |
1230 | FREXP_LIBM | |
1231 | REPLACE_TRUNCL | |
1232 | REPLACE_TRUNCF | |
1233 | REPLACE_TRUNC | |
c0c3707f CB |
1234 | REPLACE_TANHF |
1235 | REPLACE_TANF | |
88b48903 | 1236 | REPLACE_SQRTL |
c0c3707f CB |
1237 | REPLACE_SQRTF |
1238 | REPLACE_SINHF | |
1239 | REPLACE_SINF | |
88b48903 WN |
1240 | REPLACE_SIGNBIT_USING_GCC |
1241 | REPLACE_SIGNBIT | |
1242 | REPLACE_ROUNDL | |
1243 | REPLACE_ROUNDF | |
1244 | REPLACE_ROUND | |
c0c3707f | 1245 | REPLACE_RINTL |
88b48903 WN |
1246 | REPLACE_REMAINDERL |
1247 | REPLACE_REMAINDERF | |
1248 | REPLACE_REMAINDER | |
1249 | REPLACE_NAN | |
1250 | REPLACE_MODFL | |
1251 | REPLACE_MODFF | |
1252 | REPLACE_MODF | |
1253 | REPLACE_LOGBL | |
1254 | REPLACE_LOGBF | |
1255 | REPLACE_LOGB | |
1256 | REPLACE_LOG2L | |
1257 | REPLACE_LOG2F | |
1258 | REPLACE_LOG2 | |
1259 | REPLACE_LOG1PL | |
1260 | REPLACE_LOG1PF | |
1261 | REPLACE_LOG1P | |
1262 | REPLACE_LOG10L | |
1263 | REPLACE_LOG10F | |
1264 | REPLACE_LOG10 | |
1265 | REPLACE_LOGL | |
1266 | REPLACE_LOGF | |
1267 | REPLACE_LOG | |
1268 | REPLACE_LDEXPL | |
1269 | REPLACE_ISNAN | |
1270 | REPLACE_ISINF | |
1271 | REPLACE_ISFINITE | |
c0c3707f | 1272 | REPLACE_ILOGBL |
88b48903 WN |
1273 | REPLACE_ILOGBF |
1274 | REPLACE_ILOGB | |
1275 | REPLACE_HYPOTL | |
1276 | REPLACE_HYPOTF | |
1277 | REPLACE_HYPOT | |
1278 | REPLACE_HUGE_VAL | |
1279 | REPLACE_FREXPL | |
1280 | REPLACE_FREXP | |
1281 | REPLACE_FREXPF | |
1282 | REPLACE_FMODL | |
1283 | REPLACE_FMODF | |
1284 | REPLACE_FMOD | |
1285 | REPLACE_FMAL | |
1286 | REPLACE_FMAF | |
1287 | REPLACE_FMA | |
1288 | REPLACE_FLOORL | |
1289 | REPLACE_FLOORF | |
1290 | REPLACE_FLOOR | |
1291 | REPLACE_FABSL | |
1292 | REPLACE_EXP2L | |
1293 | REPLACE_EXP2 | |
c0c3707f | 1294 | REPLACE_EXPM1L |
88b48903 WN |
1295 | REPLACE_EXPM1F |
1296 | REPLACE_EXPM1 | |
c0c3707f CB |
1297 | REPLACE_EXPL |
1298 | REPLACE_EXPF | |
1299 | REPLACE_COSHF | |
1300 | REPLACE_COSF | |
88b48903 WN |
1301 | REPLACE_CEILL |
1302 | REPLACE_CEILF | |
1303 | REPLACE_CEIL | |
1304 | REPLACE_CBRTL | |
1305 | REPLACE_CBRTF | |
c0c3707f CB |
1306 | REPLACE_ATAN2F |
1307 | REPLACE_ATANF | |
1308 | REPLACE_ASINF | |
1309 | REPLACE_ACOSF | |
88b48903 WN |
1310 | HAVE_DECL_TRUNCL |
1311 | HAVE_DECL_TRUNCF | |
1312 | HAVE_DECL_TRUNC | |
1313 | HAVE_DECL_TANL | |
1314 | HAVE_DECL_SQRTL | |
1315 | HAVE_DECL_SINL | |
1316 | HAVE_DECL_ROUNDL | |
1317 | HAVE_DECL_ROUNDF | |
1318 | HAVE_DECL_ROUND | |
1319 | HAVE_DECL_RINTF | |
1320 | HAVE_DECL_REMAINDERL | |
1321 | HAVE_DECL_REMAINDER | |
1322 | HAVE_DECL_LOGB | |
1323 | HAVE_DECL_LOG2L | |
1324 | HAVE_DECL_LOG2F | |
1325 | HAVE_DECL_LOG2 | |
1326 | HAVE_DECL_LOG10L | |
1327 | HAVE_DECL_LOGL | |
1328 | HAVE_DECL_LDEXPL | |
1329 | HAVE_DECL_FREXPL | |
1330 | HAVE_DECL_FLOORL | |
1331 | HAVE_DECL_FLOORF | |
1332 | HAVE_DECL_EXPM1L | |
1333 | HAVE_DECL_EXP2L | |
1334 | HAVE_DECL_EXP2F | |
1335 | HAVE_DECL_EXP2 | |
1336 | HAVE_DECL_EXPL | |
1337 | HAVE_DECL_COSL | |
1338 | HAVE_DECL_COPYSIGNF | |
1339 | HAVE_DECL_CEILL | |
1340 | HAVE_DECL_CEILF | |
1341 | HAVE_DECL_CBRTL | |
1342 | HAVE_DECL_CBRTF | |
1343 | HAVE_DECL_ATANL | |
1344 | HAVE_DECL_ASINL | |
1345 | HAVE_DECL_ACOSL | |
1346 | HAVE_TANHF | |
1347 | HAVE_TANL | |
1348 | HAVE_TANF | |
1349 | HAVE_SQRTL | |
1350 | HAVE_SQRTF | |
1351 | HAVE_SINHF | |
1352 | HAVE_SINL | |
1353 | HAVE_SINF | |
1354 | HAVE_RINTL | |
1355 | HAVE_RINT | |
1356 | HAVE_REMAINDERF | |
1357 | HAVE_REMAINDER | |
1358 | HAVE_POWF | |
1359 | HAVE_MODFL | |
1360 | HAVE_MODFF | |
1361 | HAVE_LOGBL | |
1362 | HAVE_LOGBF | |
1363 | HAVE_LOG1PL | |
1364 | HAVE_LOG1PF | |
1365 | HAVE_LOG1P | |
1366 | HAVE_LOG10L | |
1367 | HAVE_LOG10F | |
1368 | HAVE_LOGL | |
1369 | HAVE_LOGF | |
1370 | HAVE_LDEXPF | |
1371 | HAVE_ISNANL | |
1372 | HAVE_ISNAND | |
1373 | HAVE_ISNANF | |
1374 | HAVE_ILOGBL | |
1375 | HAVE_ILOGBF | |
1376 | HAVE_ILOGB | |
1377 | HAVE_HYPOTL | |
1378 | HAVE_HYPOTF | |
1379 | HAVE_FREXPF | |
1380 | HAVE_FMODL | |
1381 | HAVE_FMODF | |
1382 | HAVE_FMAL | |
1383 | HAVE_FMAF | |
1384 | HAVE_FMA | |
1385 | HAVE_FABSL | |
1386 | HAVE_FABSF | |
1387 | HAVE_EXPM1F | |
1388 | HAVE_EXPM1 | |
1389 | HAVE_EXPL | |
1390 | HAVE_EXPF | |
1391 | HAVE_COSHF | |
1392 | HAVE_COSL | |
1393 | HAVE_COSF | |
1394 | HAVE_COPYSIGNL | |
1395 | HAVE_COPYSIGN | |
1396 | HAVE_CBRTL | |
1397 | HAVE_CBRTF | |
1398 | HAVE_CBRT | |
1399 | HAVE_ATAN2F | |
1400 | HAVE_ATANL | |
1401 | HAVE_ATANF | |
1402 | HAVE_ASINL | |
1403 | HAVE_ASINF | |
1404 | HAVE_ACOSL | |
1405 | HAVE_ACOSF | |
1406 | GNULIB_TRUNCL | |
1407 | GNULIB_TRUNCF | |
1408 | GNULIB_TRUNC | |
1409 | GNULIB_TANHF | |
1410 | GNULIB_TANL | |
1411 | GNULIB_TANF | |
1412 | GNULIB_SQRTL | |
1413 | GNULIB_SQRTF | |
1414 | GNULIB_SINHF | |
1415 | GNULIB_SINL | |
1416 | GNULIB_SINF | |
1417 | GNULIB_SIGNBIT | |
1418 | GNULIB_ROUNDL | |
1419 | GNULIB_ROUNDF | |
1420 | GNULIB_ROUND | |
1421 | GNULIB_RINTL | |
1422 | GNULIB_RINTF | |
1423 | GNULIB_RINT | |
1424 | GNULIB_REMAINDERL | |
1425 | GNULIB_REMAINDERF | |
1426 | GNULIB_REMAINDER | |
1427 | GNULIB_POWF | |
1428 | GNULIB_MODFL | |
1429 | GNULIB_MODFF | |
1430 | GNULIB_MODF | |
1431 | GNULIB_LOGBL | |
1432 | GNULIB_LOGBF | |
1433 | GNULIB_LOGB | |
1434 | GNULIB_LOG2L | |
1435 | GNULIB_LOG2F | |
1436 | GNULIB_LOG2 | |
1437 | GNULIB_LOG1PL | |
1438 | GNULIB_LOG1PF | |
1439 | GNULIB_LOG1P | |
1440 | GNULIB_LOG10L | |
1441 | GNULIB_LOG10F | |
1442 | GNULIB_LOG10 | |
1443 | GNULIB_LOGL | |
1444 | GNULIB_LOGF | |
1445 | GNULIB_LOG | |
1446 | GNULIB_LDEXPL | |
1447 | GNULIB_LDEXPF | |
1448 | GNULIB_ISNANL | |
1449 | GNULIB_ISNAND | |
1450 | GNULIB_ISNANF | |
1451 | GNULIB_ISNAN | |
1452 | GNULIB_ISINF | |
1453 | GNULIB_ISFINITE | |
1454 | GNULIB_ILOGBL | |
1455 | GNULIB_ILOGBF | |
1456 | GNULIB_ILOGB | |
1457 | GNULIB_HYPOTL | |
1458 | GNULIB_HYPOTF | |
1459 | GNULIB_HYPOT | |
1460 | GNULIB_FREXPL | |
1461 | GNULIB_FREXP | |
1462 | GNULIB_FREXPF | |
1463 | GNULIB_FMODL | |
1464 | GNULIB_FMODF | |
1465 | GNULIB_FMOD | |
1466 | GNULIB_FMAL | |
1467 | GNULIB_FMAF | |
1468 | GNULIB_FMA | |
1469 | GNULIB_FLOORL | |
1470 | GNULIB_FLOORF | |
1471 | GNULIB_FLOOR | |
1472 | GNULIB_FABSL | |
1473 | GNULIB_FABSF | |
1474 | GNULIB_EXPM1L | |
1475 | GNULIB_EXPM1F | |
1476 | GNULIB_EXPM1 | |
1477 | GNULIB_EXP2L | |
1478 | GNULIB_EXP2F | |
1479 | GNULIB_EXP2 | |
1480 | GNULIB_EXPL | |
1481 | GNULIB_EXPF | |
1482 | GNULIB_COSHF | |
1483 | GNULIB_COSL | |
1484 | GNULIB_COSF | |
1485 | GNULIB_COPYSIGNL | |
1486 | GNULIB_COPYSIGNF | |
1487 | GNULIB_COPYSIGN | |
1488 | GNULIB_CEILL | |
1489 | GNULIB_CEILF | |
1490 | GNULIB_CEIL | |
1491 | GNULIB_CBRTL | |
1492 | GNULIB_CBRTF | |
1493 | GNULIB_CBRT | |
1494 | GNULIB_ATAN2F | |
1495 | GNULIB_ATANL | |
1496 | GNULIB_ATANF | |
1497 | GNULIB_ASINL | |
1498 | GNULIB_ASINF | |
1499 | GNULIB_ACOSL | |
1500 | GNULIB_ACOSF | |
8690e634 JK |
1501 | GL_GENERATE_FNMATCH_H_FALSE |
1502 | GL_GENERATE_FNMATCH_H_TRUE | |
1503 | FNMATCH_H | |
c0c3707f CB |
1504 | HAVE_FNMATCH_H |
1505 | NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H | |
1506 | NEXT_FNMATCH_H | |
1507 | REPLACE_FNMATCH | |
1508 | HAVE_FNMATCH | |
1509 | GNULIB_FNMATCH | |
88b48903 WN |
1510 | REPLACE_ITOLD |
1511 | GL_GENERATE_FLOAT_H_FALSE | |
1512 | GL_GENERATE_FLOAT_H_TRUE | |
1513 | FLOAT_H | |
1514 | NEXT_AS_FIRST_DIRECTIVE_FLOAT_H | |
1515 | NEXT_FLOAT_H | |
6ec2e0f5 SDJ |
1516 | NEXT_AS_FIRST_DIRECTIVE_FCNTL_H |
1517 | NEXT_FCNTL_H | |
1518 | REPLACE_OPENAT | |
1519 | REPLACE_OPEN | |
1520 | REPLACE_FCNTL | |
c0c3707f | 1521 | REPLACE_CREAT |
6ec2e0f5 SDJ |
1522 | HAVE_OPENAT |
1523 | HAVE_FCNTL | |
1524 | GNULIB_OPENAT | |
1525 | GNULIB_OPEN | |
1526 | GNULIB_NONBLOCKING | |
1527 | GNULIB_FCNTL | |
c0c3707f | 1528 | GNULIB_CREAT |
18848e28 GF |
1529 | EOVERFLOW_VALUE |
1530 | EOVERFLOW_HIDDEN | |
1531 | ENOLINK_VALUE | |
1532 | ENOLINK_HIDDEN | |
1533 | EMULTIHOP_VALUE | |
1534 | EMULTIHOP_HIDDEN | |
1535 | GL_GENERATE_ERRNO_H_FALSE | |
1536 | GL_GENERATE_ERRNO_H_TRUE | |
1537 | ERRNO_H | |
1538 | NEXT_AS_FIRST_DIRECTIVE_ERRNO_H | |
1539 | NEXT_ERRNO_H | |
e26b6bb0 TT |
1540 | HAVE_DIRENT_H |
1541 | NEXT_AS_FIRST_DIRECTIVE_DIRENT_H | |
1542 | NEXT_DIRENT_H | |
e26b6bb0 TT |
1543 | REPLACE_FDOPENDIR |
1544 | REPLACE_DIRFD | |
1545 | REPLACE_CLOSEDIR | |
1546 | REPLACE_OPENDIR | |
1547 | HAVE_ALPHASORT | |
1548 | HAVE_SCANDIR | |
1549 | HAVE_FDOPENDIR | |
1550 | HAVE_DECL_FDOPENDIR | |
1551 | HAVE_DECL_DIRFD | |
1552 | HAVE_CLOSEDIR | |
1553 | HAVE_REWINDDIR | |
1554 | HAVE_READDIR | |
1555 | HAVE_OPENDIR | |
1556 | GNULIB_ALPHASORT | |
1557 | GNULIB_SCANDIR | |
1558 | GNULIB_FDOPENDIR | |
1559 | GNULIB_DIRFD | |
1560 | GNULIB_CLOSEDIR | |
1561 | GNULIB_REWINDDIR | |
1562 | GNULIB_READDIR | |
1563 | GNULIB_OPENDIR | |
6ec2e0f5 SDJ |
1564 | HAVE_WINSOCK2_H |
1565 | HAVE_MSVC_INVALID_PARAMETER_HANDLER | |
e26b6bb0 TT |
1566 | UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS |
1567 | UNISTD_H_HAVE_WINSOCK2_H | |
1568 | REPLACE_WRITE | |
1569 | REPLACE_USLEEP | |
1570 | REPLACE_UNLINKAT | |
1571 | REPLACE_UNLINK | |
1572 | REPLACE_TTYNAME_R | |
c0c3707f | 1573 | REPLACE_TRUNCATE |
4a626d0a | 1574 | REPLACE_SYMLINKAT |
e26b6bb0 TT |
1575 | REPLACE_SYMLINK |
1576 | REPLACE_SLEEP | |
1577 | REPLACE_RMDIR | |
4a626d0a | 1578 | REPLACE_READLINKAT |
e26b6bb0 TT |
1579 | REPLACE_READLINK |
1580 | REPLACE_READ | |
1581 | REPLACE_PWRITE | |
1582 | REPLACE_PREAD | |
1583 | REPLACE_LSEEK | |
1584 | REPLACE_LINKAT | |
1585 | REPLACE_LINK | |
1586 | REPLACE_LCHOWN | |
1587 | REPLACE_ISATTY | |
c0c3707f | 1588 | REPLACE_GETPASS |
e26b6bb0 TT |
1589 | REPLACE_GETPAGESIZE |
1590 | REPLACE_GETGROUPS | |
1591 | REPLACE_GETLOGIN_R | |
4a626d0a | 1592 | REPLACE_GETDTABLESIZE |
e26b6bb0 TT |
1593 | REPLACE_GETDOMAINNAME |
1594 | REPLACE_GETCWD | |
1595 | REPLACE_FTRUNCATE | |
1596 | REPLACE_FCHOWNAT | |
c0c3707f | 1597 | REPLACE_FACCESSAT |
e26b6bb0 TT |
1598 | REPLACE_DUP2 |
1599 | REPLACE_DUP | |
1600 | REPLACE_CLOSE | |
1601 | REPLACE_CHOWN | |
c0c3707f | 1602 | REPLACE_ACCESS |
e26b6bb0 TT |
1603 | HAVE_SYS_PARAM_H |
1604 | HAVE_OS_H | |
1605 | HAVE_DECL_TTYNAME_R | |
c0c3707f | 1606 | HAVE_DECL_TRUNCATE |
e26b6bb0 TT |
1607 | HAVE_DECL_SETHOSTNAME |
1608 | HAVE_DECL_GETUSERSHELL | |
1609 | HAVE_DECL_GETPAGESIZE | |
1610 | HAVE_DECL_GETLOGIN_R | |
c0c3707f | 1611 | HAVE_DECL_GETLOGIN |
e26b6bb0 TT |
1612 | HAVE_DECL_GETDOMAINNAME |
1613 | HAVE_DECL_FDATASYNC | |
1614 | HAVE_DECL_FCHDIR | |
1615 | HAVE_DECL_ENVIRON | |
1616 | HAVE_USLEEP | |
1617 | HAVE_UNLINKAT | |
1618 | HAVE_SYMLINKAT | |
1619 | HAVE_SYMLINK | |
1620 | HAVE_SLEEP | |
1621 | HAVE_SETHOSTNAME | |
1622 | HAVE_READLINKAT | |
1623 | HAVE_READLINK | |
1624 | HAVE_PWRITE | |
1625 | HAVE_PREAD | |
1626 | HAVE_PIPE2 | |
1627 | HAVE_PIPE | |
1628 | HAVE_LINKAT | |
1629 | HAVE_LINK | |
1630 | HAVE_LCHOWN | |
1631 | HAVE_GROUP_MEMBER | |
c0c3707f | 1632 | HAVE_GETPASS |
e26b6bb0 TT |
1633 | HAVE_GETPAGESIZE |
1634 | HAVE_GETLOGIN | |
1635 | HAVE_GETHOSTNAME | |
1636 | HAVE_GETGROUPS | |
1637 | HAVE_GETDTABLESIZE | |
1638 | HAVE_FTRUNCATE | |
1639 | HAVE_FSYNC | |
1640 | HAVE_FDATASYNC | |
1641 | HAVE_FCHOWNAT | |
1642 | HAVE_FCHDIR | |
1643 | HAVE_FACCESSAT | |
1644 | HAVE_EUIDACCESS | |
1645 | HAVE_DUP3 | |
1646 | HAVE_DUP2 | |
c0c3707f | 1647 | HAVE_COPY_FILE_RANGE |
e26b6bb0 TT |
1648 | HAVE_CHOWN |
1649 | GNULIB_WRITE | |
1650 | GNULIB_USLEEP | |
1651 | GNULIB_UNLINKAT | |
1652 | GNULIB_UNLINK | |
1653 | GNULIB_UNISTD_H_SIGPIPE | |
1654 | GNULIB_UNISTD_H_NONBLOCKING | |
1655 | GNULIB_TTYNAME_R | |
c0c3707f | 1656 | GNULIB_TRUNCATE |
e26b6bb0 TT |
1657 | GNULIB_SYMLINKAT |
1658 | GNULIB_SYMLINK | |
1659 | GNULIB_SLEEP | |
1660 | GNULIB_SETHOSTNAME | |
1661 | GNULIB_RMDIR | |
1662 | GNULIB_READLINKAT | |
1663 | GNULIB_READLINK | |
1664 | GNULIB_READ | |
1665 | GNULIB_PWRITE | |
1666 | GNULIB_PREAD | |
1667 | GNULIB_PIPE2 | |
1668 | GNULIB_PIPE | |
1669 | GNULIB_LSEEK | |
1670 | GNULIB_LINKAT | |
1671 | GNULIB_LINK | |
1672 | GNULIB_LCHOWN | |
1673 | GNULIB_ISATTY | |
1674 | GNULIB_GROUP_MEMBER | |
1675 | GNULIB_GETUSERSHELL | |
c0c3707f | 1676 | GNULIB_GETPASS |
e26b6bb0 | 1677 | GNULIB_GETPAGESIZE |
5df4cba6 | 1678 | GNULIB_GETOPT_POSIX |
e26b6bb0 TT |
1679 | GNULIB_GETLOGIN_R |
1680 | GNULIB_GETLOGIN | |
1681 | GNULIB_GETHOSTNAME | |
1682 | GNULIB_GETGROUPS | |
1683 | GNULIB_GETDTABLESIZE | |
1684 | GNULIB_GETDOMAINNAME | |
1685 | GNULIB_GETCWD | |
1686 | GNULIB_FTRUNCATE | |
1687 | GNULIB_FSYNC | |
1688 | GNULIB_FDATASYNC | |
1689 | GNULIB_FCHOWNAT | |
1690 | GNULIB_FCHDIR | |
1691 | GNULIB_FACCESSAT | |
1692 | GNULIB_EUIDACCESS | |
1693 | GNULIB_ENVIRON | |
1694 | GNULIB_DUP3 | |
1695 | GNULIB_DUP2 | |
1696 | GNULIB_DUP | |
c0c3707f | 1697 | GNULIB_COPY_FILE_RANGE |
e26b6bb0 TT |
1698 | GNULIB_CLOSE |
1699 | GNULIB_CHOWN | |
1700 | GNULIB_CHDIR | |
c0c3707f | 1701 | GNULIB_ACCESS |
98399780 YQ |
1702 | REPLACE_WCTOMB |
1703 | REPLACE_UNSETENV | |
c0c3707f | 1704 | REPLACE_STRTOLD |
98399780 | 1705 | REPLACE_STRTOD |
c0c3707f | 1706 | REPLACE_SETSTATE |
98399780 YQ |
1707 | REPLACE_SETENV |
1708 | REPLACE_REALPATH | |
1709 | REPLACE_REALLOC | |
1710 | REPLACE_RANDOM_R | |
c0c3707f | 1711 | REPLACE_RANDOM |
4a626d0a | 1712 | REPLACE_QSORT_R |
98399780 YQ |
1713 | REPLACE_PUTENV |
1714 | REPLACE_PTSNAME_R | |
1715 | REPLACE_PTSNAME | |
1716 | REPLACE_MKSTEMP | |
1717 | REPLACE_MBTOWC | |
1718 | REPLACE_MALLOC | |
c0c3707f | 1719 | REPLACE_INITSTATE |
98399780 YQ |
1720 | REPLACE_CANONICALIZE_FILE_NAME |
1721 | REPLACE_CALLOC | |
1722 | HAVE_DECL_UNSETENV | |
1723 | HAVE_UNLOCKPT | |
1724 | HAVE_SYS_LOADAVG_H | |
1725 | HAVE_STRUCT_RANDOM_DATA | |
1726 | HAVE_STRTOULL | |
1727 | HAVE_STRTOLL | |
c0c3707f | 1728 | HAVE_STRTOLD |
98399780 | 1729 | HAVE_STRTOD |
c0c3707f CB |
1730 | HAVE_DECL_SETSTATE |
1731 | HAVE_SETSTATE | |
98399780 YQ |
1732 | HAVE_DECL_SETENV |
1733 | HAVE_SETENV | |
4a626d0a | 1734 | HAVE_SECURE_GETENV |
98399780 YQ |
1735 | HAVE_RPMATCH |
1736 | HAVE_REALPATH | |
c0c3707f | 1737 | HAVE_REALLOCARRAY |
98399780 YQ |
1738 | HAVE_RANDOM_R |
1739 | HAVE_RANDOM_H | |
1740 | HAVE_RANDOM | |
4c62b19f | 1741 | HAVE_QSORT_R |
98399780 YQ |
1742 | HAVE_PTSNAME_R |
1743 | HAVE_PTSNAME | |
1744 | HAVE_POSIX_OPENPT | |
1745 | HAVE_MKSTEMPS | |
1746 | HAVE_MKSTEMP | |
1747 | HAVE_MKOSTEMPS | |
1748 | HAVE_MKOSTEMP | |
1749 | HAVE_MKDTEMP | |
c0c3707f CB |
1750 | HAVE_MBTOWC |
1751 | HAVE_DECL_INITSTATE | |
1752 | HAVE_INITSTATE | |
98399780 YQ |
1753 | HAVE_GRANTPT |
1754 | HAVE_GETSUBOPT | |
1755 | HAVE_DECL_GETLOADAVG | |
1756 | HAVE_CANONICALIZE_FILE_NAME | |
1757 | HAVE_ATOLL | |
1758 | HAVE__EXIT | |
1759 | GNULIB_WCTOMB | |
1760 | GNULIB_UNSETENV | |
1761 | GNULIB_UNLOCKPT | |
1762 | GNULIB_SYSTEM_POSIX | |
1763 | GNULIB_STRTOULL | |
1764 | GNULIB_STRTOLL | |
c0c3707f | 1765 | GNULIB_STRTOLD |
98399780 YQ |
1766 | GNULIB_STRTOD |
1767 | GNULIB_SETENV | |
4a626d0a | 1768 | GNULIB_SECURE_GETENV |
98399780 YQ |
1769 | GNULIB_RPMATCH |
1770 | GNULIB_REALPATH | |
1771 | GNULIB_REALLOC_POSIX | |
c0c3707f | 1772 | GNULIB_REALLOCARRAY |
98399780 YQ |
1773 | GNULIB_RANDOM_R |
1774 | GNULIB_RANDOM | |
4a626d0a | 1775 | GNULIB_QSORT_R |
98399780 YQ |
1776 | GNULIB_PUTENV |
1777 | GNULIB_PTSNAME_R | |
1778 | GNULIB_PTSNAME | |
1779 | GNULIB_POSIX_OPENPT | |
1780 | GNULIB_MKSTEMPS | |
1781 | GNULIB_MKSTEMP | |
1782 | GNULIB_MKOSTEMPS | |
1783 | GNULIB_MKOSTEMP | |
1784 | GNULIB_MKDTEMP | |
1785 | GNULIB_MBTOWC | |
1786 | GNULIB_MALLOC_POSIX | |
1787 | GNULIB_GRANTPT | |
1788 | GNULIB_GETSUBOPT | |
1789 | GNULIB_GETLOADAVG | |
1790 | GNULIB_CANONICALIZE_FILE_NAME | |
1791 | GNULIB_CALLOC_POSIX | |
1792 | GNULIB_ATOLL | |
1793 | GNULIB__EXIT | |
725e2999 | 1794 | MKDIR_P |
c0c3707f | 1795 | HAVE_WS2TCPIP_H |
725e2999 JB |
1796 | HAVE_FEATURES_H |
1797 | NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H | |
1798 | NEXT_ARPA_INET_H | |
1799 | PRAGMA_COLUMNS | |
1800 | PRAGMA_SYSTEM_HEADER | |
1801 | INCLUDE_NEXT_AS_FIRST_DIRECTIVE | |
1802 | INCLUDE_NEXT | |
1803 | HAVE_ARPA_INET_H | |
1804 | REPLACE_INET_PTON | |
1805 | REPLACE_INET_NTOP | |
1806 | HAVE_DECL_INET_PTON | |
1807 | HAVE_DECL_INET_NTOP | |
1808 | GNULIB_INET_PTON | |
1809 | GNULIB_INET_NTOP | |
c0c3707f | 1810 | HAVE_ALLOCA_H |
8690e634 JK |
1811 | GL_GENERATE_ALLOCA_H_FALSE |
1812 | GL_GENERATE_ALLOCA_H_TRUE | |
1813 | ALLOCA_H | |
1814 | ALLOCA | |
c971b7fa PA |
1815 | GL_COND_LIBTOOL_FALSE |
1816 | GL_COND_LIBTOOL_TRUE | |
c8693053 RO |
1817 | RANLIB |
1818 | ARFLAGS | |
1819 | AR | |
1820 | LARGEFILE_CPPFLAGS | |
c971b7fa PA |
1821 | target_os |
1822 | target_vendor | |
1823 | target_cpu | |
1824 | target | |
c971b7fa PA |
1825 | host_os |
1826 | host_vendor | |
1827 | host_cpu | |
1828 | host | |
1829 | build_os | |
1830 | build_vendor | |
1831 | build_cpu | |
1832 | build | |
4a626d0a PA |
1833 | EGREP |
1834 | GREP | |
1835 | CPP | |
c971b7fa PA |
1836 | OBJEXT |
1837 | EXEEXT | |
1838 | ac_ct_CC | |
1839 | CPPFLAGS | |
1840 | LDFLAGS | |
1841 | CFLAGS | |
1842 | CC | |
1843 | MAINT | |
1844 | MAINTAINER_MODE_FALSE | |
1845 | MAINTAINER_MODE_TRUE | |
1846 | target_alias | |
1847 | host_alias | |
1848 | build_alias | |
1849 | LIBS | |
1850 | ECHO_T | |
1851 | ECHO_N | |
1852 | ECHO_C | |
1853 | DEFS | |
1854 | mandir | |
1855 | localedir | |
1856 | libdir | |
1857 | psdir | |
1858 | pdfdir | |
1859 | dvidir | |
1860 | htmldir | |
1861 | infodir | |
1862 | docdir | |
1863 | oldincludedir | |
1864 | includedir | |
1865 | localstatedir | |
1866 | sharedstatedir | |
1867 | sysconfdir | |
1868 | datadir | |
1869 | datarootdir | |
1870 | libexecdir | |
1871 | sbindir | |
1872 | bindir | |
1873 | program_transform_name | |
1874 | prefix | |
1875 | exec_prefix | |
1876 | PACKAGE_URL | |
1877 | PACKAGE_BUGREPORT | |
1878 | PACKAGE_STRING | |
1879 | PACKAGE_VERSION | |
1880 | PACKAGE_TARNAME | |
1881 | PACKAGE_NAME | |
1882 | PATH_SEPARATOR | |
1883 | SHELL' | |
1884 | ac_subst_files='' | |
1885 | ac_user_opts=' | |
1886 | enable_option_checking | |
1887 | enable_maintainer_mode | |
c8693053 | 1888 | enable_plugins |
2196f55f | 1889 | enable_largefile |
5abebf3c | 1890 | enable_threads |
c0c3707f | 1891 | enable_cross_guesses |
c971b7fa | 1892 | enable_dependency_tracking |
39be3c7e | 1893 | enable_silent_rules |
c971b7fa PA |
1894 | ' |
1895 | ac_precious_vars='build_alias | |
1896 | host_alias | |
1897 | target_alias | |
1898 | CC | |
1899 | CFLAGS | |
1900 | LDFLAGS | |
1901 | LIBS | |
1902 | CPPFLAGS | |
1903 | CPP' | |
1904 | ||
1905 | ||
1906 | # Initialize some variables set by options. | |
1907 | ac_init_help= | |
1908 | ac_init_version=false | |
1909 | ac_unrecognized_opts= | |
1910 | ac_unrecognized_sep= | |
1911 | # The variables have the same names as the options, with | |
1912 | # dashes changed to underlines. | |
1913 | cache_file=/dev/null | |
1914 | exec_prefix=NONE | |
1915 | no_create= | |
1916 | no_recursion= | |
1917 | prefix=NONE | |
1918 | program_prefix=NONE | |
1919 | program_suffix=NONE | |
1920 | program_transform_name=s,x,x, | |
1921 | silent= | |
1922 | site= | |
1923 | srcdir= | |
1924 | verbose= | |
1925 | x_includes=NONE | |
1926 | x_libraries=NONE | |
1927 | ||
1928 | # Installation directory options. | |
1929 | # These are left unexpanded so users can "make install exec_prefix=/foo" | |
1930 | # and all the variables that are supposed to be based on exec_prefix | |
1931 | # by default will actually change. | |
1932 | # Use braces instead of parens because sh, perl, etc. also accept them. | |
1933 | # (The list follows the same order as the GNU Coding Standards.) | |
1934 | bindir='${exec_prefix}/bin' | |
1935 | sbindir='${exec_prefix}/sbin' | |
1936 | libexecdir='${exec_prefix}/libexec' | |
1937 | datarootdir='${prefix}/share' | |
1938 | datadir='${datarootdir}' | |
1939 | sysconfdir='${prefix}/etc' | |
1940 | sharedstatedir='${prefix}/com' | |
1941 | localstatedir='${prefix}/var' | |
1942 | includedir='${prefix}/include' | |
1943 | oldincludedir='/usr/include' | |
d0ac1c44 | 1944 | docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' |
c971b7fa PA |
1945 | infodir='${datarootdir}/info' |
1946 | htmldir='${docdir}' | |
1947 | dvidir='${docdir}' | |
1948 | pdfdir='${docdir}' | |
1949 | psdir='${docdir}' | |
1950 | libdir='${exec_prefix}/lib' | |
1951 | localedir='${datarootdir}/locale' | |
1952 | mandir='${datarootdir}/man' | |
1953 | ||
1954 | ac_prev= | |
1955 | ac_dashdash= | |
1956 | for ac_option | |
1957 | do | |
1958 | # If the previous option needs an argument, assign it. | |
1959 | if test -n "$ac_prev"; then | |
1960 | eval $ac_prev=\$ac_option | |
1961 | ac_prev= | |
1962 | continue | |
1963 | fi | |
1964 | ||
1965 | case $ac_option in | |
d0ac1c44 SM |
1966 | *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; |
1967 | *=) ac_optarg= ;; | |
1968 | *) ac_optarg=yes ;; | |
c971b7fa PA |
1969 | esac |
1970 | ||
1971 | # Accept the important Cygnus configure options, so we can diagnose typos. | |
1972 | ||
1973 | case $ac_dashdash$ac_option in | |
1974 | --) | |
1975 | ac_dashdash=yes ;; | |
1976 | ||
1977 | -bindir | --bindir | --bindi | --bind | --bin | --bi) | |
1978 | ac_prev=bindir ;; | |
1979 | -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) | |
1980 | bindir=$ac_optarg ;; | |
1981 | ||
1982 | -build | --build | --buil | --bui | --bu) | |
1983 | ac_prev=build_alias ;; | |
1984 | -build=* | --build=* | --buil=* | --bui=* | --bu=*) | |
1985 | build_alias=$ac_optarg ;; | |
1986 | ||
1987 | -cache-file | --cache-file | --cache-fil | --cache-fi \ | |
1988 | | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) | |
1989 | ac_prev=cache_file ;; | |
1990 | -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | |
1991 | | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) | |
1992 | cache_file=$ac_optarg ;; | |
1993 | ||
1994 | --config-cache | -C) | |
1995 | cache_file=config.cache ;; | |
1996 | ||
1997 | -datadir | --datadir | --datadi | --datad) | |
1998 | ac_prev=datadir ;; | |
1999 | -datadir=* | --datadir=* | --datadi=* | --datad=*) | |
2000 | datadir=$ac_optarg ;; | |
2001 | ||
2002 | -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | |
2003 | | --dataroo | --dataro | --datar) | |
2004 | ac_prev=datarootdir ;; | |
2005 | -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | |
2006 | | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) | |
2007 | datarootdir=$ac_optarg ;; | |
2008 | ||
2009 | -disable-* | --disable-*) | |
2010 | ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` | |
2011 | # Reject names that are not valid shell variable names. | |
2012 | expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && | |
d0ac1c44 | 2013 | as_fn_error $? "invalid feature name: $ac_useropt" |
c971b7fa PA |
2014 | ac_useropt_orig=$ac_useropt |
2015 | ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` | |
2016 | case $ac_user_opts in | |
2017 | *" | |
2018 | "enable_$ac_useropt" | |
2019 | "*) ;; | |
2020 | *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" | |
2021 | ac_unrecognized_sep=', ';; | |
2022 | esac | |
2023 | eval enable_$ac_useropt=no ;; | |
2024 | ||
2025 | -docdir | --docdir | --docdi | --doc | --do) | |
2026 | ac_prev=docdir ;; | |
2027 | -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) | |
2028 | docdir=$ac_optarg ;; | |
2029 | ||
2030 | -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) | |
2031 | ac_prev=dvidir ;; | |
2032 | -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) | |
2033 | dvidir=$ac_optarg ;; | |
2034 | ||
2035 | -enable-* | --enable-*) | |
2036 | ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` | |
2037 | # Reject names that are not valid shell variable names. | |
2038 | expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && | |
d0ac1c44 | 2039 | as_fn_error $? "invalid feature name: $ac_useropt" |
c971b7fa PA |
2040 | ac_useropt_orig=$ac_useropt |
2041 | ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` | |
2042 | case $ac_user_opts in | |
2043 | *" | |
2044 | "enable_$ac_useropt" | |
2045 | "*) ;; | |
2046 | *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" | |
2047 | ac_unrecognized_sep=', ';; | |
2048 | esac | |
2049 | eval enable_$ac_useropt=\$ac_optarg ;; | |
2050 | ||
2051 | -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | |
2052 | | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | |
2053 | | --exec | --exe | --ex) | |
2054 | ac_prev=exec_prefix ;; | |
2055 | -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | |
2056 | | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | |
2057 | | --exec=* | --exe=* | --ex=*) | |
2058 | exec_prefix=$ac_optarg ;; | |
2059 | ||
2060 | -gas | --gas | --ga | --g) | |
2061 | # Obsolete; use --with-gas. | |
2062 | with_gas=yes ;; | |
2063 | ||
2064 | -help | --help | --hel | --he | -h) | |
2065 | ac_init_help=long ;; | |
2066 | -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) | |
2067 | ac_init_help=recursive ;; | |
2068 | -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) | |
2069 | ac_init_help=short ;; | |
2070 | ||
2071 | -host | --host | --hos | --ho) | |
2072 | ac_prev=host_alias ;; | |
2073 | -host=* | --host=* | --hos=* | --ho=*) | |
2074 | host_alias=$ac_optarg ;; | |
2075 | ||
2076 | -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) | |
2077 | ac_prev=htmldir ;; | |
2078 | -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | |
2079 | | --ht=*) | |
2080 | htmldir=$ac_optarg ;; | |
2081 | ||
2082 | -includedir | --includedir | --includedi | --included | --include \ | |
2083 | | --includ | --inclu | --incl | --inc) | |
2084 | ac_prev=includedir ;; | |
2085 | -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | |
2086 | | --includ=* | --inclu=* | --incl=* | --inc=*) | |
2087 | includedir=$ac_optarg ;; | |
2088 | ||
2089 | -infodir | --infodir | --infodi | --infod | --info | --inf) | |
2090 | ac_prev=infodir ;; | |
2091 | -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) | |
2092 | infodir=$ac_optarg ;; | |
2093 | ||
2094 | -libdir | --libdir | --libdi | --libd) | |
2095 | ac_prev=libdir ;; | |
2096 | -libdir=* | --libdir=* | --libdi=* | --libd=*) | |
2097 | libdir=$ac_optarg ;; | |
2098 | ||
2099 | -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | |
2100 | | --libexe | --libex | --libe) | |
2101 | ac_prev=libexecdir ;; | |
2102 | -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | |
2103 | | --libexe=* | --libex=* | --libe=*) | |
2104 | libexecdir=$ac_optarg ;; | |
2105 | ||
2106 | -localedir | --localedir | --localedi | --localed | --locale) | |
2107 | ac_prev=localedir ;; | |
2108 | -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) | |
2109 | localedir=$ac_optarg ;; | |
2110 | ||
2111 | -localstatedir | --localstatedir | --localstatedi | --localstated \ | |
2112 | | --localstate | --localstat | --localsta | --localst | --locals) | |
2113 | ac_prev=localstatedir ;; | |
2114 | -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | |
2115 | | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) | |
2116 | localstatedir=$ac_optarg ;; | |
2117 | ||
2118 | -mandir | --mandir | --mandi | --mand | --man | --ma | --m) | |
2119 | ac_prev=mandir ;; | |
2120 | -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) | |
2121 | mandir=$ac_optarg ;; | |
2122 | ||
2123 | -nfp | --nfp | --nf) | |
2124 | # Obsolete; use --without-fp. | |
2125 | with_fp=no ;; | |
2126 | ||
2127 | -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | |
2128 | | --no-cr | --no-c | -n) | |
2129 | no_create=yes ;; | |
2130 | ||
2131 | -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | |
2132 | | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) | |
2133 | no_recursion=yes ;; | |
2134 | ||
2135 | -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | |
2136 | | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | |
2137 | | --oldin | --oldi | --old | --ol | --o) | |
2138 | ac_prev=oldincludedir ;; | |
2139 | -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | |
2140 | | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | |
2141 | | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) | |
2142 | oldincludedir=$ac_optarg ;; | |
2143 | ||
2144 | -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) | |
2145 | ac_prev=prefix ;; | |
2146 | -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) | |
2147 | prefix=$ac_optarg ;; | |
2148 | ||
2149 | -program-prefix | --program-prefix | --program-prefi | --program-pref \ | |
2150 | | --program-pre | --program-pr | --program-p) | |
2151 | ac_prev=program_prefix ;; | |
2152 | -program-prefix=* | --program-prefix=* | --program-prefi=* \ | |
2153 | | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) | |
2154 | program_prefix=$ac_optarg ;; | |
2155 | ||
2156 | -program-suffix | --program-suffix | --program-suffi | --program-suff \ | |
2157 | | --program-suf | --program-su | --program-s) | |
2158 | ac_prev=program_suffix ;; | |
2159 | -program-suffix=* | --program-suffix=* | --program-suffi=* \ | |
2160 | | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) | |
2161 | program_suffix=$ac_optarg ;; | |
2162 | ||
2163 | -program-transform-name | --program-transform-name \ | |
2164 | | --program-transform-nam | --program-transform-na \ | |
2165 | | --program-transform-n | --program-transform- \ | |
2166 | | --program-transform | --program-transfor \ | |
2167 | | --program-transfo | --program-transf \ | |
2168 | | --program-trans | --program-tran \ | |
2169 | | --progr-tra | --program-tr | --program-t) | |
2170 | ac_prev=program_transform_name ;; | |
2171 | -program-transform-name=* | --program-transform-name=* \ | |
2172 | | --program-transform-nam=* | --program-transform-na=* \ | |
2173 | | --program-transform-n=* | --program-transform-=* \ | |
2174 | | --program-transform=* | --program-transfor=* \ | |
2175 | | --program-transfo=* | --program-transf=* \ | |
2176 | | --program-trans=* | --program-tran=* \ | |
2177 | | --progr-tra=* | --program-tr=* | --program-t=*) | |
2178 | program_transform_name=$ac_optarg ;; | |
2179 | ||
2180 | -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) | |
2181 | ac_prev=pdfdir ;; | |
2182 | -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) | |
2183 | pdfdir=$ac_optarg ;; | |
2184 | ||
2185 | -psdir | --psdir | --psdi | --psd | --ps) | |
2186 | ac_prev=psdir ;; | |
2187 | -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) | |
2188 | psdir=$ac_optarg ;; | |
2189 | ||
2190 | -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | |
2191 | | -silent | --silent | --silen | --sile | --sil) | |
2192 | silent=yes ;; | |
2193 | ||
2194 | -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) | |
2195 | ac_prev=sbindir ;; | |
2196 | -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | |
2197 | | --sbi=* | --sb=*) | |
2198 | sbindir=$ac_optarg ;; | |
2199 | ||
2200 | -sharedstatedir | --sharedstatedir | --sharedstatedi \ | |
2201 | | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | |
2202 | | --sharedst | --shareds | --shared | --share | --shar \ | |
2203 | | --sha | --sh) | |
2204 | ac_prev=sharedstatedir ;; | |
2205 | -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | |
2206 | | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | |
2207 | | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | |
2208 | | --sha=* | --sh=*) | |
2209 | sharedstatedir=$ac_optarg ;; | |
2210 | ||
2211 | -site | --site | --sit) | |
2212 | ac_prev=site ;; | |
2213 | -site=* | --site=* | --sit=*) | |
2214 | site=$ac_optarg ;; | |
2215 | ||
2216 | -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) | |
2217 | ac_prev=srcdir ;; | |
2218 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) | |
2219 | srcdir=$ac_optarg ;; | |
2220 | ||
2221 | -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | |
2222 | | --syscon | --sysco | --sysc | --sys | --sy) | |
2223 | ac_prev=sysconfdir ;; | |
2224 | -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | |
2225 | | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) | |
2226 | sysconfdir=$ac_optarg ;; | |
2227 | ||
2228 | -target | --target | --targe | --targ | --tar | --ta | --t) | |
2229 | ac_prev=target_alias ;; | |
2230 | -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) | |
2231 | target_alias=$ac_optarg ;; | |
2232 | ||
2233 | -v | -verbose | --verbose | --verbos | --verbo | --verb) | |
2234 | verbose=yes ;; | |
2235 | ||
2236 | -version | --version | --versio | --versi | --vers | -V) | |
2237 | ac_init_version=: ;; | |
2238 | ||
2239 | -with-* | --with-*) | |
2240 | ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` | |
2241 | # Reject names that are not valid shell variable names. | |
2242 | expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && | |
d0ac1c44 | 2243 | as_fn_error $? "invalid package name: $ac_useropt" |
c971b7fa PA |
2244 | ac_useropt_orig=$ac_useropt |
2245 | ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` | |
2246 | case $ac_user_opts in | |
2247 | *" | |
2248 | "with_$ac_useropt" | |
2249 | "*) ;; | |
2250 | *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" | |
2251 | ac_unrecognized_sep=', ';; | |
2252 | esac | |
2253 | eval with_$ac_useropt=\$ac_optarg ;; | |
2254 | ||
2255 | -without-* | --without-*) | |
2256 | ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` | |
2257 | # Reject names that are not valid shell variable names. | |
2258 | expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && | |
d0ac1c44 | 2259 | as_fn_error $? "invalid package name: $ac_useropt" |
c971b7fa PA |
2260 | ac_useropt_orig=$ac_useropt |
2261 | ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` | |
2262 | case $ac_user_opts in | |
2263 | *" | |
2264 | "with_$ac_useropt" | |
2265 | "*) ;; | |
2266 | *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" | |
2267 | ac_unrecognized_sep=', ';; | |
2268 | esac | |
2269 | eval with_$ac_useropt=no ;; | |
2270 | ||
2271 | --x) | |
2272 | # Obsolete; use --with-x. | |
2273 | with_x=yes ;; | |
2274 | ||
2275 | -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | |
2276 | | --x-incl | --x-inc | --x-in | --x-i) | |
2277 | ac_prev=x_includes ;; | |
2278 | -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | |
2279 | | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) | |
2280 | x_includes=$ac_optarg ;; | |
2281 | ||
2282 | -x-libraries | --x-libraries | --x-librarie | --x-librari \ | |
2283 | | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) | |
2284 | ac_prev=x_libraries ;; | |
2285 | -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | |
2286 | | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) | |
2287 | x_libraries=$ac_optarg ;; | |
2288 | ||
d0ac1c44 SM |
2289 | -*) as_fn_error $? "unrecognized option: \`$ac_option' |
2290 | Try \`$0 --help' for more information" | |
c971b7fa PA |
2291 | ;; |
2292 | ||
2293 | *=*) | |
2294 | ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` | |
2295 | # Reject names that are not valid shell variable names. | |
2296 | case $ac_envvar in #( | |
2297 | '' | [0-9]* | *[!_$as_cr_alnum]* ) | |
d0ac1c44 | 2298 | as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; |
c971b7fa PA |
2299 | esac |
2300 | eval $ac_envvar=\$ac_optarg | |
2301 | export $ac_envvar ;; | |
2302 | ||
2303 | *) | |
2304 | # FIXME: should be removed in autoconf 3.0. | |
2305 | $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 | |
2306 | expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && | |
2307 | $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 | |
d0ac1c44 | 2308 | : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" |
c971b7fa PA |
2309 | ;; |
2310 | ||
2311 | esac | |
2312 | done | |
2313 | ||
2314 | if test -n "$ac_prev"; then | |
2315 | ac_option=--`echo $ac_prev | sed 's/_/-/g'` | |
d0ac1c44 | 2316 | as_fn_error $? "missing argument to $ac_option" |
c971b7fa PA |
2317 | fi |
2318 | ||
2319 | if test -n "$ac_unrecognized_opts"; then | |
2320 | case $enable_option_checking in | |
2321 | no) ;; | |
d0ac1c44 | 2322 | fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; |
c971b7fa PA |
2323 | *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; |
2324 | esac | |
2325 | fi | |
2326 | ||
2327 | # Check all directory arguments for consistency. | |
2328 | for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ | |
2329 | datadir sysconfdir sharedstatedir localstatedir includedir \ | |
2330 | oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ | |
2331 | libdir localedir mandir | |
2332 | do | |
2333 | eval ac_val=\$$ac_var | |
2334 | # Remove trailing slashes. | |
2335 | case $ac_val in | |
2336 | */ ) | |
2337 | ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` | |
2338 | eval $ac_var=\$ac_val;; | |
2339 | esac | |
2340 | # Be sure to have absolute directory names. | |
2341 | case $ac_val in | |
2342 | [\\/$]* | ?:[\\/]* ) continue;; | |
2343 | NONE | '' ) case $ac_var in *prefix ) continue;; esac;; | |
2344 | esac | |
d0ac1c44 | 2345 | as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" |
c971b7fa PA |
2346 | done |
2347 | ||
2348 | # There might be people who depend on the old broken behavior: `$host' | |
2349 | # used to hold the argument of --host etc. | |
2350 | # FIXME: To remove some day. | |
2351 | build=$build_alias | |
2352 | host=$host_alias | |
2353 | target=$target_alias | |
2354 | ||
2355 | # FIXME: To remove some day. | |
2356 | if test "x$host_alias" != x; then | |
2357 | if test "x$build_alias" = x; then | |
2358 | cross_compiling=maybe | |
c971b7fa PA |
2359 | elif test "x$build_alias" != "x$host_alias"; then |
2360 | cross_compiling=yes | |
2361 | fi | |
2362 | fi | |
2363 | ||
2364 | ac_tool_prefix= | |
2365 | test -n "$host_alias" && ac_tool_prefix=$host_alias- | |
2366 | ||
2367 | test "$silent" = yes && exec 6>/dev/null | |
2368 | ||
2369 | ||
2370 | ac_pwd=`pwd` && test -n "$ac_pwd" && | |
2371 | ac_ls_di=`ls -di .` && | |
2372 | ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || | |
d0ac1c44 | 2373 | as_fn_error $? "working directory cannot be determined" |
c971b7fa | 2374 | test "X$ac_ls_di" = "X$ac_pwd_ls_di" || |
d0ac1c44 | 2375 | as_fn_error $? "pwd does not report name of working directory" |
c971b7fa PA |
2376 | |
2377 | ||
2378 | # Find the source files, if location was not specified. | |
2379 | if test -z "$srcdir"; then | |
2380 | ac_srcdir_defaulted=yes | |
2381 | # Try the directory containing this script, then the parent directory. | |
2382 | ac_confdir=`$as_dirname -- "$as_myself" || | |
2383 | $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
2384 | X"$as_myself" : 'X\(//\)[^/]' \| \ | |
2385 | X"$as_myself" : 'X\(//\)$' \| \ | |
2386 | X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || | |
2387 | $as_echo X"$as_myself" | | |
2388 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
2389 | s//\1/ | |
2390 | q | |
2391 | } | |
2392 | /^X\(\/\/\)[^/].*/{ | |
2393 | s//\1/ | |
2394 | q | |
2395 | } | |
2396 | /^X\(\/\/\)$/{ | |
2397 | s//\1/ | |
2398 | q | |
2399 | } | |
2400 | /^X\(\/\).*/{ | |
2401 | s//\1/ | |
2402 | q | |
2403 | } | |
2404 | s/.*/./; q'` | |
2405 | srcdir=$ac_confdir | |
2406 | if test ! -r "$srcdir/$ac_unique_file"; then | |
2407 | srcdir=.. | |
2408 | fi | |
2409 | else | |
2410 | ac_srcdir_defaulted=no | |
2411 | fi | |
2412 | if test ! -r "$srcdir/$ac_unique_file"; then | |
2413 | test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." | |
d0ac1c44 | 2414 | as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" |
c971b7fa PA |
2415 | fi |
2416 | ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" | |
2417 | ac_abs_confdir=`( | |
d0ac1c44 | 2418 | cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" |
c971b7fa PA |
2419 | pwd)` |
2420 | # When building in place, set srcdir=. | |
2421 | if test "$ac_abs_confdir" = "$ac_pwd"; then | |
2422 | srcdir=. | |
2423 | fi | |
2424 | # Remove unnecessary trailing slashes from srcdir. | |
2425 | # Double slashes in file names in object file debugging info | |
2426 | # mess up M-x gdb in Emacs. | |
2427 | case $srcdir in | |
2428 | */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; | |
2429 | esac | |
2430 | for ac_var in $ac_precious_vars; do | |
2431 | eval ac_env_${ac_var}_set=\${${ac_var}+set} | |
2432 | eval ac_env_${ac_var}_value=\$${ac_var} | |
2433 | eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} | |
2434 | eval ac_cv_env_${ac_var}_value=\$${ac_var} | |
2435 | done | |
2436 | ||
2437 | # | |
2438 | # Report the --help message. | |
2439 | # | |
2440 | if test "$ac_init_help" = "long"; then | |
2441 | # Omit some internal or obsolete options to make the list less imposing. | |
2442 | # This message is too long to be a string in the A/UX 3.1 sh. | |
2443 | cat <<_ACEOF | |
d0ac1c44 | 2444 | \`configure' configures libgnu UNUSED-VERSION to adapt to many kinds of systems. |
c971b7fa PA |
2445 | |
2446 | Usage: $0 [OPTION]... [VAR=VALUE]... | |
2447 | ||
2448 | To assign environment variables (e.g., CC, CFLAGS...), specify them as | |
2449 | VAR=VALUE. See below for descriptions of some of the useful variables. | |
2450 | ||
2451 | Defaults for the options are specified in brackets. | |
2452 | ||
2453 | Configuration: | |
2454 | -h, --help display this help and exit | |
2455 | --help=short display options specific to this package | |
2456 | --help=recursive display the short help of all the included packages | |
2457 | -V, --version display version information and exit | |
d0ac1c44 | 2458 | -q, --quiet, --silent do not print \`checking ...' messages |
c971b7fa PA |
2459 | --cache-file=FILE cache test results in FILE [disabled] |
2460 | -C, --config-cache alias for \`--cache-file=config.cache' | |
2461 | -n, --no-create do not create output files | |
2462 | --srcdir=DIR find the sources in DIR [configure dir or \`..'] | |
2463 | ||
2464 | Installation directories: | |
2465 | --prefix=PREFIX install architecture-independent files in PREFIX | |
2466 | [$ac_default_prefix] | |
2467 | --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX | |
2468 | [PREFIX] | |
2469 | ||
2470 | By default, \`make install' will install all the files in | |
2471 | \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify | |
2472 | an installation prefix other than \`$ac_default_prefix' using \`--prefix', | |
2473 | for instance \`--prefix=\$HOME'. | |
2474 | ||
2475 | For better control, use the options below. | |
2476 | ||
2477 | Fine tuning of the installation directories: | |
2478 | --bindir=DIR user executables [EPREFIX/bin] | |
2479 | --sbindir=DIR system admin executables [EPREFIX/sbin] | |
2480 | --libexecdir=DIR program executables [EPREFIX/libexec] | |
2481 | --sysconfdir=DIR read-only single-machine data [PREFIX/etc] | |
2482 | --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] | |
2483 | --localstatedir=DIR modifiable single-machine data [PREFIX/var] | |
2484 | --libdir=DIR object code libraries [EPREFIX/lib] | |
2485 | --includedir=DIR C header files [PREFIX/include] | |
2486 | --oldincludedir=DIR C header files for non-gcc [/usr/include] | |
2487 | --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] | |
2488 | --datadir=DIR read-only architecture-independent data [DATAROOTDIR] | |
2489 | --infodir=DIR info documentation [DATAROOTDIR/info] | |
2490 | --localedir=DIR locale-dependent data [DATAROOTDIR/locale] | |
2491 | --mandir=DIR man documentation [DATAROOTDIR/man] | |
d0ac1c44 | 2492 | --docdir=DIR documentation root [DATAROOTDIR/doc/libgnu] |
c971b7fa PA |
2493 | --htmldir=DIR html documentation [DOCDIR] |
2494 | --dvidir=DIR dvi documentation [DOCDIR] | |
2495 | --pdfdir=DIR pdf documentation [DOCDIR] | |
2496 | --psdir=DIR ps documentation [DOCDIR] | |
2497 | _ACEOF | |
2498 | ||
2499 | cat <<\_ACEOF | |
2500 | ||
2501 | Program names: | |
2502 | --program-prefix=PREFIX prepend PREFIX to installed program names | |
2503 | --program-suffix=SUFFIX append SUFFIX to installed program names | |
2504 | --program-transform-name=PROGRAM run sed PROGRAM on installed program names | |
2505 | ||
2506 | System types: | |
2507 | --build=BUILD configure for building on BUILD [guessed] | |
2508 | --host=HOST cross-compile to build programs to run on HOST [BUILD] | |
2509 | --target=TARGET configure for building compilers for TARGET [HOST] | |
2510 | _ACEOF | |
2511 | fi | |
2512 | ||
2513 | if test -n "$ac_init_help"; then | |
d0ac1c44 SM |
2514 | case $ac_init_help in |
2515 | short | recursive ) echo "Configuration of libgnu UNUSED-VERSION:";; | |
2516 | esac | |
c971b7fa PA |
2517 | cat <<\_ACEOF |
2518 | ||
2519 | Optional Features: | |
2520 | --disable-option-checking ignore unrecognized --enable/--with options | |
2521 | --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) | |
2522 | --enable-FEATURE[=ARG] include FEATURE [ARG=yes] | |
d0ac1c44 SM |
2523 | --enable-maintainer-mode |
2524 | enable make rules and dependencies not useful (and | |
2525 | sometimes confusing) to the casual installer | |
c8693053 | 2526 | --enable-plugins Enable support for plugins |
2196f55f | 2527 | --disable-largefile omit support for large files |
c0c3707f | 2528 | --enable-threads={isoc|posix|isoc+posix|windows} |
5abebf3c CB |
2529 | specify multithreading API |
2530 | --disable-threads build without multithread safety | |
c0c3707f CB |
2531 | --enable-cross-guesses={conservative|risky} |
2532 | specify policy for cross-compilation guesses | |
d0ac1c44 SM |
2533 | --enable-dependency-tracking |
2534 | do not reject slow dependency extractors | |
2535 | --disable-dependency-tracking | |
2536 | speeds up one-time build | |
2537 | --enable-silent-rules less verbose build output (undo: "make V=1") | |
2538 | --disable-silent-rules verbose build output (undo: "make V=0") | |
c971b7fa PA |
2539 | |
2540 | Some influential environment variables: | |
2541 | CC C compiler command | |
2542 | CFLAGS C compiler flags | |
2543 | LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a | |
2544 | nonstandard directory <lib dir> | |
2545 | LIBS libraries to pass to the linker, e.g. -l<library> | |
d0ac1c44 | 2546 | CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if |
c971b7fa PA |
2547 | you have headers in a nonstandard directory <include dir> |
2548 | CPP C preprocessor | |
2549 | ||
2550 | Use these variables to override the choices made by `configure' or to help | |
2551 | it to find libraries and programs with nonstandard names/locations. | |
2552 | ||
2553 | Report bugs to the package provider. | |
2554 | _ACEOF | |
2555 | ac_status=$? | |
2556 | fi | |
2557 | ||
2558 | if test "$ac_init_help" = "recursive"; then | |
2559 | # If there are subdirs, report their specific --help. | |
2560 | for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue | |
2561 | test -d "$ac_dir" || | |
2562 | { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || | |
2563 | continue | |
2564 | ac_builddir=. | |
2565 | ||
2566 | case "$ac_dir" in | |
2567 | .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; | |
2568 | *) | |
2569 | ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` | |
2570 | # A ".." for each directory in $ac_dir_suffix. | |
2571 | ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` | |
2572 | case $ac_top_builddir_sub in | |
2573 | "") ac_top_builddir_sub=. ac_top_build_prefix= ;; | |
2574 | *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; | |
2575 | esac ;; | |
2576 | esac | |
2577 | ac_abs_top_builddir=$ac_pwd | |
2578 | ac_abs_builddir=$ac_pwd$ac_dir_suffix | |
2579 | # for backward compatibility: | |
2580 | ac_top_builddir=$ac_top_build_prefix | |
2581 | ||
2582 | case $srcdir in | |
2583 | .) # We are building in place. | |
2584 | ac_srcdir=. | |
2585 | ac_top_srcdir=$ac_top_builddir_sub | |
2586 | ac_abs_top_srcdir=$ac_pwd ;; | |
2587 | [\\/]* | ?:[\\/]* ) # Absolute name. | |
2588 | ac_srcdir=$srcdir$ac_dir_suffix; | |
2589 | ac_top_srcdir=$srcdir | |
2590 | ac_abs_top_srcdir=$srcdir ;; | |
2591 | *) # Relative name. | |
2592 | ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix | |
2593 | ac_top_srcdir=$ac_top_build_prefix$srcdir | |
2594 | ac_abs_top_srcdir=$ac_pwd/$srcdir ;; | |
2595 | esac | |
2596 | ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix | |
2597 | ||
2598 | cd "$ac_dir" || { ac_status=$?; continue; } | |
2599 | # Check for guested configure. | |
2600 | if test -f "$ac_srcdir/configure.gnu"; then | |
2601 | echo && | |
2602 | $SHELL "$ac_srcdir/configure.gnu" --help=recursive | |
2603 | elif test -f "$ac_srcdir/configure"; then | |
2604 | echo && | |
2605 | $SHELL "$ac_srcdir/configure" --help=recursive | |
2606 | else | |
2607 | $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 | |
2608 | fi || ac_status=$? | |
2609 | cd "$ac_pwd" || { ac_status=$?; break; } | |
2610 | done | |
2611 | fi | |
2612 | ||
2613 | test -n "$ac_init_help" && exit $ac_status | |
2614 | if $ac_init_version; then | |
2615 | cat <<\_ACEOF | |
d0ac1c44 SM |
2616 | libgnu configure UNUSED-VERSION |
2617 | generated by GNU Autoconf 2.69 | |
c971b7fa | 2618 | |
d0ac1c44 | 2619 | Copyright (C) 2012 Free Software Foundation, Inc. |
c971b7fa PA |
2620 | This configure script is free software; the Free Software Foundation |
2621 | gives unlimited permission to copy, distribute and modify it. | |
2622 | _ACEOF | |
2623 | exit | |
2624 | fi | |
2625 | ||
2626 | ## ------------------------ ## | |
2627 | ## Autoconf initialization. ## | |
2628 | ## ------------------------ ## | |
2629 | ||
2630 | # ac_fn_c_try_compile LINENO | |
2631 | # -------------------------- | |
2632 | # Try to compile conftest.$ac_ext, and return whether this succeeded. | |
2633 | ac_fn_c_try_compile () | |
2634 | { | |
2635 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2636 | rm -f conftest.$ac_objext | |
2637 | if { { ac_try="$ac_compile" | |
2638 | case "(($ac_try" in | |
2639 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
2640 | *) ac_try_echo=$ac_try;; | |
2641 | esac | |
2642 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
2643 | $as_echo "$ac_try_echo"; } >&5 | |
2644 | (eval "$ac_compile") 2>conftest.err | |
2645 | ac_status=$? | |
2646 | if test -s conftest.err; then | |
2647 | grep -v '^ *+' conftest.err >conftest.er1 | |
2648 | cat conftest.er1 >&5 | |
2649 | mv -f conftest.er1 conftest.err | |
2650 | fi | |
2651 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
2652 | test $ac_status = 0; } && { | |
2653 | test -z "$ac_c_werror_flag" || | |
2654 | test ! -s conftest.err | |
2655 | } && test -s conftest.$ac_objext; then : | |
2656 | ac_retval=0 | |
2657 | else | |
2658 | $as_echo "$as_me: failed program was:" >&5 | |
2659 | sed 's/^/| /' conftest.$ac_ext >&5 | |
2660 | ||
2661 | ac_retval=1 | |
2662 | fi | |
d0ac1c44 SM |
2663 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
2664 | as_fn_set_status $ac_retval | |
c971b7fa PA |
2665 | |
2666 | } # ac_fn_c_try_compile | |
2667 | ||
2668 | # ac_fn_c_try_cpp LINENO | |
2669 | # ---------------------- | |
2670 | # Try to preprocess conftest.$ac_ext, and return whether this succeeded. | |
2671 | ac_fn_c_try_cpp () | |
2672 | { | |
2673 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2674 | if { { ac_try="$ac_cpp conftest.$ac_ext" | |
2675 | case "(($ac_try" in | |
2676 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
2677 | *) ac_try_echo=$ac_try;; | |
2678 | esac | |
2679 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
2680 | $as_echo "$ac_try_echo"; } >&5 | |
2681 | (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err | |
2682 | ac_status=$? | |
2683 | if test -s conftest.err; then | |
2684 | grep -v '^ *+' conftest.err >conftest.er1 | |
2685 | cat conftest.er1 >&5 | |
2686 | mv -f conftest.er1 conftest.err | |
2687 | fi | |
2688 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
d0ac1c44 | 2689 | test $ac_status = 0; } > conftest.i && { |
c971b7fa PA |
2690 | test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || |
2691 | test ! -s conftest.err | |
2692 | }; then : | |
2693 | ac_retval=0 | |
2694 | else | |
2695 | $as_echo "$as_me: failed program was:" >&5 | |
2696 | sed 's/^/| /' conftest.$ac_ext >&5 | |
2697 | ||
2698 | ac_retval=1 | |
2699 | fi | |
d0ac1c44 SM |
2700 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
2701 | as_fn_set_status $ac_retval | |
c971b7fa PA |
2702 | |
2703 | } # ac_fn_c_try_cpp | |
2704 | ||
2705 | # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES | |
2706 | # ------------------------------------------------------- | |
2707 | # Tests whether HEADER exists, giving a warning if it cannot be compiled using | |
2708 | # the include files in INCLUDES and setting the cache variable VAR | |
2709 | # accordingly. | |
2710 | ac_fn_c_check_header_mongrel () | |
2711 | { | |
2712 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
d0ac1c44 | 2713 | if eval \${$3+:} false; then : |
c971b7fa PA |
2714 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 |
2715 | $as_echo_n "checking for $2... " >&6; } | |
d0ac1c44 | 2716 | if eval \${$3+:} false; then : |
c971b7fa PA |
2717 | $as_echo_n "(cached) " >&6 |
2718 | fi | |
2719 | eval ac_res=\$$3 | |
2720 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
2721 | $as_echo "$ac_res" >&6; } | |
2722 | else | |
2723 | # Is the header compilable? | |
2724 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 | |
2725 | $as_echo_n "checking $2 usability... " >&6; } | |
2726 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
2727 | /* end confdefs.h. */ | |
2728 | $4 | |
2729 | #include <$2> | |
2730 | _ACEOF | |
2731 | if ac_fn_c_try_compile "$LINENO"; then : | |
2732 | ac_header_compiler=yes | |
2733 | else | |
2734 | ac_header_compiler=no | |
2735 | fi | |
2736 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
2737 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 | |
2738 | $as_echo "$ac_header_compiler" >&6; } | |
2739 | ||
2740 | # Is the header present? | |
2741 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 | |
2742 | $as_echo_n "checking $2 presence... " >&6; } | |
2743 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
2744 | /* end confdefs.h. */ | |
2745 | #include <$2> | |
2746 | _ACEOF | |
2747 | if ac_fn_c_try_cpp "$LINENO"; then : | |
2748 | ac_header_preproc=yes | |
2749 | else | |
2750 | ac_header_preproc=no | |
2751 | fi | |
d0ac1c44 | 2752 | rm -f conftest.err conftest.i conftest.$ac_ext |
c971b7fa PA |
2753 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 |
2754 | $as_echo "$ac_header_preproc" >&6; } | |
2755 | ||
2756 | # So? What about this header? | |
2757 | case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( | |
2758 | yes:no: ) | |
2759 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 | |
2760 | $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} | |
2761 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 | |
2762 | $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} | |
2763 | ;; | |
2764 | no:yes:* ) | |
2765 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 | |
2766 | $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} | |
2767 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 | |
2768 | $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} | |
2769 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 | |
2770 | $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} | |
2771 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 | |
2772 | $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} | |
2773 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 | |
2774 | $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} | |
2775 | ;; | |
2776 | esac | |
2777 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 | |
2778 | $as_echo_n "checking for $2... " >&6; } | |
d0ac1c44 | 2779 | if eval \${$3+:} false; then : |
c971b7fa PA |
2780 | $as_echo_n "(cached) " >&6 |
2781 | else | |
2782 | eval "$3=\$ac_header_compiler" | |
2783 | fi | |
2784 | eval ac_res=\$$3 | |
2785 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
2786 | $as_echo "$ac_res" >&6; } | |
2787 | fi | |
d0ac1c44 | 2788 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
c971b7fa PA |
2789 | |
2790 | } # ac_fn_c_check_header_mongrel | |
2791 | ||
2792 | # ac_fn_c_try_run LINENO | |
2793 | # ---------------------- | |
2794 | # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes | |
2795 | # that executables *can* be run. | |
2796 | ac_fn_c_try_run () | |
2797 | { | |
2798 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2799 | if { { ac_try="$ac_link" | |
2800 | case "(($ac_try" in | |
2801 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
2802 | *) ac_try_echo=$ac_try;; | |
2803 | esac | |
2804 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
2805 | $as_echo "$ac_try_echo"; } >&5 | |
2806 | (eval "$ac_link") 2>&5 | |
2807 | ac_status=$? | |
2808 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
2809 | test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' | |
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_try") 2>&5 | |
2817 | ac_status=$? | |
2818 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
2819 | test $ac_status = 0; }; }; then : | |
2820 | ac_retval=0 | |
2821 | else | |
2822 | $as_echo "$as_me: program exited with status $ac_status" >&5 | |
2823 | $as_echo "$as_me: failed program was:" >&5 | |
2824 | sed 's/^/| /' conftest.$ac_ext >&5 | |
2825 | ||
2826 | ac_retval=$ac_status | |
2827 | fi | |
2828 | rm -rf conftest.dSYM conftest_ipa8_conftest.oo | |
d0ac1c44 SM |
2829 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
2830 | as_fn_set_status $ac_retval | |
c971b7fa PA |
2831 | |
2832 | } # ac_fn_c_try_run | |
2833 | ||
2834 | # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES | |
2835 | # ------------------------------------------------------- | |
2836 | # Tests whether HEADER exists and can be compiled using the include files in | |
2837 | # INCLUDES, setting the cache variable VAR accordingly. | |
2838 | ac_fn_c_check_header_compile () | |
2839 | { | |
2840 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2841 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 | |
2842 | $as_echo_n "checking for $2... " >&6; } | |
d0ac1c44 | 2843 | if eval \${$3+:} false; then : |
c971b7fa PA |
2844 | $as_echo_n "(cached) " >&6 |
2845 | else | |
2846 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
2847 | /* end confdefs.h. */ | |
2848 | $4 | |
2849 | #include <$2> | |
2850 | _ACEOF | |
2851 | if ac_fn_c_try_compile "$LINENO"; then : | |
2852 | eval "$3=yes" | |
2853 | else | |
2854 | eval "$3=no" | |
2855 | fi | |
2856 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
2857 | fi | |
2858 | eval ac_res=\$$3 | |
2859 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
2860 | $as_echo "$ac_res" >&6; } | |
d0ac1c44 | 2861 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
c971b7fa PA |
2862 | |
2863 | } # ac_fn_c_check_header_compile | |
2864 | ||
73cc7272 TT |
2865 | # ac_fn_c_try_link LINENO |
2866 | # ----------------------- | |
2867 | # Try to link conftest.$ac_ext, and return whether this succeeded. | |
2868 | ac_fn_c_try_link () | |
2869 | { | |
2870 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2871 | rm -f conftest.$ac_objext conftest$ac_exeext | |
2872 | if { { ac_try="$ac_link" | |
2873 | case "(($ac_try" in | |
2874 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
2875 | *) ac_try_echo=$ac_try;; | |
2876 | esac | |
2877 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
2878 | $as_echo "$ac_try_echo"; } >&5 | |
2879 | (eval "$ac_link") 2>conftest.err | |
2880 | ac_status=$? | |
2881 | if test -s conftest.err; then | |
2882 | grep -v '^ *+' conftest.err >conftest.er1 | |
2883 | cat conftest.er1 >&5 | |
2884 | mv -f conftest.er1 conftest.err | |
2885 | fi | |
2886 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
2887 | test $ac_status = 0; } && { | |
2888 | test -z "$ac_c_werror_flag" || | |
2889 | test ! -s conftest.err | |
2890 | } && test -s conftest$ac_exeext && { | |
2891 | test "$cross_compiling" = yes || | |
2892 | test -x conftest$ac_exeext | |
2893 | }; then : | |
2894 | ac_retval=0 | |
2895 | else | |
2896 | $as_echo "$as_me: failed program was:" >&5 | |
2897 | sed 's/^/| /' conftest.$ac_ext >&5 | |
2898 | ||
2899 | ac_retval=1 | |
2900 | fi | |
2901 | # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information | |
2902 | # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would | |
2903 | # interfere with the next link command; also delete a directory that is | |
2904 | # left behind by Apple's compiler. We do this before executing the actions. | |
2905 | rm -rf conftest.dSYM conftest_ipa8_conftest.oo | |
2906 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
2907 | as_fn_set_status $ac_retval | |
2908 | ||
2909 | } # ac_fn_c_try_link | |
2910 | ||
d0ac1c44 SM |
2911 | # ac_fn_c_check_type LINENO TYPE VAR INCLUDES |
2912 | # ------------------------------------------- | |
2913 | # Tests whether TYPE exists after having included INCLUDES, setting cache | |
2914 | # variable VAR accordingly. | |
2915 | ac_fn_c_check_type () | |
2916 | { | |
2917 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2918 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 | |
2919 | $as_echo_n "checking for $2... " >&6; } | |
2920 | if eval \${$3+:} false; then : | |
2921 | $as_echo_n "(cached) " >&6 | |
2922 | else | |
2923 | eval "$3=no" | |
2924 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
2925 | /* end confdefs.h. */ | |
2926 | $4 | |
2927 | int | |
2928 | main () | |
2929 | { | |
2930 | if (sizeof ($2)) | |
2931 | return 0; | |
2932 | ; | |
2933 | return 0; | |
2934 | } | |
2935 | _ACEOF | |
2936 | if ac_fn_c_try_compile "$LINENO"; then : | |
2937 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
2938 | /* end confdefs.h. */ | |
2939 | $4 | |
2940 | int | |
2941 | main () | |
2942 | { | |
2943 | if (sizeof (($2))) | |
2944 | return 0; | |
2945 | ; | |
2946 | return 0; | |
2947 | } | |
2948 | _ACEOF | |
2949 | if ac_fn_c_try_compile "$LINENO"; then : | |
2950 | ||
2951 | else | |
2952 | eval "$3=yes" | |
2953 | fi | |
2954 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
2955 | fi | |
2956 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
2957 | fi | |
2958 | eval ac_res=\$$3 | |
2959 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
2960 | $as_echo "$ac_res" >&6; } | |
2961 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
2962 | ||
2963 | } # ac_fn_c_check_type | |
2964 | ||
8690e634 JK |
2965 | # ac_fn_c_check_func LINENO FUNC VAR |
2966 | # ---------------------------------- | |
2967 | # Tests whether FUNC exists, setting the cache variable VAR accordingly | |
2968 | ac_fn_c_check_func () | |
2969 | { | |
2970 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
2971 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 | |
2972 | $as_echo_n "checking for $2... " >&6; } | |
d0ac1c44 | 2973 | if eval \${$3+:} false; then : |
8690e634 JK |
2974 | $as_echo_n "(cached) " >&6 |
2975 | else | |
2976 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
2977 | /* end confdefs.h. */ | |
2978 | /* Define $2 to an innocuous variant, in case <limits.h> declares $2. | |
2979 | For example, HP-UX 11i <limits.h> declares gettimeofday. */ | |
2980 | #define $2 innocuous_$2 | |
2981 | ||
2982 | /* System header to define __stub macros and hopefully few prototypes, | |
2983 | which can conflict with char $2 (); below. | |
2984 | Prefer <limits.h> to <assert.h> if __STDC__ is defined, since | |
2985 | <limits.h> exists even on freestanding compilers. */ | |
2986 | ||
2987 | #ifdef __STDC__ | |
2988 | # include <limits.h> | |
2989 | #else | |
2990 | # include <assert.h> | |
2991 | #endif | |
2992 | ||
2993 | #undef $2 | |
2994 | ||
2995 | /* Override any GCC internal prototype to avoid an error. | |
2996 | Use char because int might match the return type of a GCC | |
2997 | builtin and then its argument prototype would still apply. */ | |
2998 | #ifdef __cplusplus | |
2999 | extern "C" | |
3000 | #endif | |
3001 | char $2 (); | |
3002 | /* The GNU C library defines this for functions which it implements | |
3003 | to always fail with ENOSYS. Some functions are actually named | |
3004 | something starting with __ and the normal name is an alias. */ | |
3005 | #if defined __stub_$2 || defined __stub___$2 | |
3006 | choke me | |
3007 | #endif | |
3008 | ||
3009 | int | |
3010 | main () | |
3011 | { | |
3012 | return $2 (); | |
3013 | ; | |
3014 | return 0; | |
3015 | } | |
3016 | _ACEOF | |
3017 | if ac_fn_c_try_link "$LINENO"; then : | |
3018 | eval "$3=yes" | |
3019 | else | |
3020 | eval "$3=no" | |
3021 | fi | |
3022 | rm -f core conftest.err conftest.$ac_objext \ | |
3023 | conftest$ac_exeext conftest.$ac_ext | |
3024 | fi | |
3025 | eval ac_res=\$$3 | |
3026 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
3027 | $as_echo "$ac_res" >&6; } | |
d0ac1c44 | 3028 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
8690e634 JK |
3029 | |
3030 | } # ac_fn_c_check_func | |
3031 | ||
d0ac1c44 SM |
3032 | # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES |
3033 | # --------------------------------------------- | |
3034 | # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR | |
3035 | # accordingly. | |
8986e351 TT |
3036 | ac_fn_c_check_decl () |
3037 | { | |
5df4cba6 SM |
3038 | ac_save_ac_compile="$ac_compile" |
3039 | if test -n "$ac_compile_for_check_decl"; then | |
3040 | ac_compile="$ac_compile_for_check_decl" | |
3041 | fi | |
8986e351 | 3042 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
d0ac1c44 SM |
3043 | as_decl_name=`echo $2|sed 's/ *(.*//'` |
3044 | as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` | |
3045 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 | |
3046 | $as_echo_n "checking whether $as_decl_name is declared... " >&6; } | |
3047 | if eval \${$3+:} false; then : | |
8986e351 TT |
3048 | $as_echo_n "(cached) " >&6 |
3049 | else | |
3050 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3051 | /* end confdefs.h. */ | |
3052 | $4 | |
3053 | int | |
3054 | main () | |
3055 | { | |
d0ac1c44 SM |
3056 | #ifndef $as_decl_name |
3057 | #ifdef __cplusplus | |
3058 | (void) $as_decl_use; | |
3059 | #else | |
3060 | (void) $as_decl_name; | |
3061 | #endif | |
8986e351 TT |
3062 | #endif |
3063 | ||
3064 | ; | |
3065 | return 0; | |
3066 | } | |
3067 | _ACEOF | |
3068 | if ac_fn_c_try_compile "$LINENO"; then : | |
3069 | eval "$3=yes" | |
3070 | else | |
3071 | eval "$3=no" | |
3072 | fi | |
3073 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3074 | fi | |
3075 | eval ac_res=\$$3 | |
3076 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
3077 | $as_echo "$ac_res" >&6; } | |
d0ac1c44 | 3078 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
5df4cba6 | 3079 | ac_compile="$ac_save_ac_compile" |
8986e351 TT |
3080 | |
3081 | } # ac_fn_c_check_decl | |
3082 | ||
c971b7fa PA |
3083 | # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES |
3084 | # -------------------------------------------- | |
3085 | # Tries to find the compile-time value of EXPR in a program that includes | |
3086 | # INCLUDES, setting VAR accordingly. Returns whether the value could be | |
3087 | # computed | |
3088 | ac_fn_c_compute_int () | |
3089 | { | |
3090 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
3091 | if test "$cross_compiling" = yes; then | |
3092 | # Depending upon the size, compute the lo and hi bounds. | |
3093 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3094 | /* end confdefs.h. */ | |
3095 | $4 | |
3096 | int | |
3097 | main () | |
3098 | { | |
3099 | static int test_array [1 - 2 * !(($2) >= 0)]; | |
d0ac1c44 SM |
3100 | test_array [0] = 0; |
3101 | return test_array [0]; | |
c971b7fa PA |
3102 | |
3103 | ; | |
3104 | return 0; | |
3105 | } | |
3106 | _ACEOF | |
3107 | if ac_fn_c_try_compile "$LINENO"; then : | |
3108 | ac_lo=0 ac_mid=0 | |
3109 | while :; do | |
3110 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3111 | /* end confdefs.h. */ | |
3112 | $4 | |
3113 | int | |
3114 | main () | |
3115 | { | |
3116 | static int test_array [1 - 2 * !(($2) <= $ac_mid)]; | |
d0ac1c44 SM |
3117 | test_array [0] = 0; |
3118 | return test_array [0]; | |
c971b7fa PA |
3119 | |
3120 | ; | |
3121 | return 0; | |
3122 | } | |
3123 | _ACEOF | |
3124 | if ac_fn_c_try_compile "$LINENO"; then : | |
3125 | ac_hi=$ac_mid; break | |
3126 | else | |
3127 | as_fn_arith $ac_mid + 1 && ac_lo=$as_val | |
3128 | if test $ac_lo -le $ac_mid; then | |
3129 | ac_lo= ac_hi= | |
3130 | break | |
3131 | fi | |
3132 | as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val | |
3133 | fi | |
3134 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3135 | done | |
3136 | else | |
3137 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3138 | /* end confdefs.h. */ | |
3139 | $4 | |
3140 | int | |
3141 | main () | |
3142 | { | |
3143 | static int test_array [1 - 2 * !(($2) < 0)]; | |
d0ac1c44 SM |
3144 | test_array [0] = 0; |
3145 | return test_array [0]; | |
c971b7fa PA |
3146 | |
3147 | ; | |
3148 | return 0; | |
3149 | } | |
3150 | _ACEOF | |
3151 | if ac_fn_c_try_compile "$LINENO"; then : | |
3152 | ac_hi=-1 ac_mid=-1 | |
3153 | while :; do | |
3154 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3155 | /* end confdefs.h. */ | |
3156 | $4 | |
3157 | int | |
3158 | main () | |
3159 | { | |
3160 | static int test_array [1 - 2 * !(($2) >= $ac_mid)]; | |
d0ac1c44 SM |
3161 | test_array [0] = 0; |
3162 | return test_array [0]; | |
c971b7fa PA |
3163 | |
3164 | ; | |
3165 | return 0; | |
3166 | } | |
3167 | _ACEOF | |
3168 | if ac_fn_c_try_compile "$LINENO"; then : | |
3169 | ac_lo=$ac_mid; break | |
3170 | else | |
3171 | as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val | |
3172 | if test $ac_mid -le $ac_hi; then | |
3173 | ac_lo= ac_hi= | |
3174 | break | |
3175 | fi | |
3176 | as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val | |
3177 | fi | |
3178 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3179 | done | |
3180 | else | |
3181 | ac_lo= ac_hi= | |
3182 | fi | |
3183 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3184 | fi | |
3185 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3186 | # Binary search between lo and hi bounds. | |
3187 | while test "x$ac_lo" != "x$ac_hi"; do | |
3188 | as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val | |
3189 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3190 | /* end confdefs.h. */ | |
3191 | $4 | |
3192 | int | |
3193 | main () | |
3194 | { | |
3195 | static int test_array [1 - 2 * !(($2) <= $ac_mid)]; | |
d0ac1c44 SM |
3196 | test_array [0] = 0; |
3197 | return test_array [0]; | |
c971b7fa PA |
3198 | |
3199 | ; | |
3200 | return 0; | |
3201 | } | |
3202 | _ACEOF | |
3203 | if ac_fn_c_try_compile "$LINENO"; then : | |
3204 | ac_hi=$ac_mid | |
3205 | else | |
3206 | as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val | |
3207 | fi | |
3208 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3209 | done | |
3210 | case $ac_lo in #(( | |
3211 | ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; | |
3212 | '') ac_retval=1 ;; | |
3213 | esac | |
3214 | else | |
3215 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3216 | /* end confdefs.h. */ | |
3217 | $4 | |
3218 | static long int longval () { return $2; } | |
3219 | static unsigned long int ulongval () { return $2; } | |
3220 | #include <stdio.h> | |
3221 | #include <stdlib.h> | |
3222 | int | |
3223 | main () | |
3224 | { | |
3225 | ||
3226 | FILE *f = fopen ("conftest.val", "w"); | |
3227 | if (! f) | |
3228 | return 1; | |
3229 | if (($2) < 0) | |
3230 | { | |
3231 | long int i = longval (); | |
3232 | if (i != ($2)) | |
3233 | return 1; | |
3234 | fprintf (f, "%ld", i); | |
3235 | } | |
3236 | else | |
3237 | { | |
3238 | unsigned long int i = ulongval (); | |
3239 | if (i != ($2)) | |
3240 | return 1; | |
3241 | fprintf (f, "%lu", i); | |
3242 | } | |
3243 | /* Do not output a trailing newline, as this causes \r\n confusion | |
3244 | on some platforms. */ | |
3245 | return ferror (f) || fclose (f) != 0; | |
3246 | ||
3247 | ; | |
3248 | return 0; | |
3249 | } | |
3250 | _ACEOF | |
3251 | if ac_fn_c_try_run "$LINENO"; then : | |
3252 | echo >>conftest.val; read $3 <conftest.val; ac_retval=0 | |
3253 | else | |
3254 | ac_retval=1 | |
3255 | fi | |
3256 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
3257 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
3258 | rm -f conftest.val | |
3259 | ||
3260 | fi | |
d0ac1c44 SM |
3261 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno |
3262 | as_fn_set_status $ac_retval | |
c971b7fa PA |
3263 | |
3264 | } # ac_fn_c_compute_int | |
725e2999 JB |
3265 | |
3266 | # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES | |
3267 | # ---------------------------------------------------- | |
3268 | # Tries to find if the field MEMBER exists in type AGGR, after including | |
3269 | # INCLUDES, setting cache variable VAR accordingly. | |
3270 | ac_fn_c_check_member () | |
3271 | { | |
3272 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
3273 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 | |
3274 | $as_echo_n "checking for $2.$3... " >&6; } | |
3275 | if eval \${$4+:} false; then : | |
3276 | $as_echo_n "(cached) " >&6 | |
3277 | else | |
3278 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3279 | /* end confdefs.h. */ | |
3280 | $5 | |
3281 | int | |
3282 | main () | |
3283 | { | |
3284 | static $2 ac_aggr; | |
3285 | if (ac_aggr.$3) | |
3286 | return 0; | |
3287 | ; | |
3288 | return 0; | |
3289 | } | |
3290 | _ACEOF | |
3291 | if ac_fn_c_try_compile "$LINENO"; then : | |
3292 | eval "$4=yes" | |
3293 | else | |
3294 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
3295 | /* end confdefs.h. */ | |
3296 | $5 | |
3297 | int | |
3298 | main () | |
3299 | { | |
3300 | static $2 ac_aggr; | |
3301 | if (sizeof ac_aggr.$3) | |
3302 | return 0; | |
3303 | ; | |
3304 | return 0; | |
3305 | } | |
3306 | _ACEOF | |
3307 | if ac_fn_c_try_compile "$LINENO"; then : | |
3308 | eval "$4=yes" | |
3309 | else | |
3310 | eval "$4=no" | |
3311 | fi | |
3312 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3313 | fi | |
3314 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
3315 | fi | |
3316 | eval ac_res=\$$4 | |
3317 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
3318 | $as_echo "$ac_res" >&6; } | |
3319 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
3320 | ||
3321 | } # ac_fn_c_check_member | |
c971b7fa PA |
3322 | cat >config.log <<_ACEOF |
3323 | This file contains any messages produced by compilers while | |
3324 | running configure, to aid debugging if configure makes a mistake. | |
3325 | ||
d0ac1c44 SM |
3326 | It was created by libgnu $as_me UNUSED-VERSION, which was |
3327 | generated by GNU Autoconf 2.69. Invocation command line was | |
c971b7fa PA |
3328 | |
3329 | $ $0 $@ | |
3330 | ||
3331 | _ACEOF | |
3332 | exec 5>>config.log | |
3333 | { | |
3334 | cat <<_ASUNAME | |
3335 | ## --------- ## | |
3336 | ## Platform. ## | |
3337 | ## --------- ## | |
3338 | ||
3339 | hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` | |
3340 | uname -m = `(uname -m) 2>/dev/null || echo unknown` | |
3341 | uname -r = `(uname -r) 2>/dev/null || echo unknown` | |
3342 | uname -s = `(uname -s) 2>/dev/null || echo unknown` | |
3343 | uname -v = `(uname -v) 2>/dev/null || echo unknown` | |
3344 | ||
3345 | /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` | |
3346 | /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` | |
3347 | ||
3348 | /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` | |
3349 | /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` | |
3350 | /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` | |
3351 | /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` | |
3352 | /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` | |
3353 | /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` | |
3354 | /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` | |
3355 | ||
3356 | _ASUNAME | |
3357 | ||
3358 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
3359 | for as_dir in $PATH | |
3360 | do | |
3361 | IFS=$as_save_IFS | |
3362 | test -z "$as_dir" && as_dir=. | |
3363 | $as_echo "PATH: $as_dir" | |
3364 | done | |
3365 | IFS=$as_save_IFS | |
3366 | ||
3367 | } >&5 | |
3368 | ||
3369 | cat >&5 <<_ACEOF | |
3370 | ||
3371 | ||
3372 | ## ----------- ## | |
3373 | ## Core tests. ## | |
3374 | ## ----------- ## | |
3375 | ||
3376 | _ACEOF | |
3377 | ||
3378 | ||
3379 | # Keep a trace of the command line. | |
3380 | # Strip out --no-create and --no-recursion so they do not pile up. | |
3381 | # Strip out --silent because we don't want to record it for future runs. | |
3382 | # Also quote any args containing shell meta-characters. | |
3383 | # Make two passes to allow for proper duplicate-argument suppression. | |
3384 | ac_configure_args= | |
3385 | ac_configure_args0= | |
3386 | ac_configure_args1= | |
3387 | ac_must_keep_next=false | |
3388 | for ac_pass in 1 2 | |
3389 | do | |
3390 | for ac_arg | |
3391 | do | |
3392 | case $ac_arg in | |
3393 | -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; | |
3394 | -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | |
3395 | | -silent | --silent | --silen | --sile | --sil) | |
3396 | continue ;; | |
3397 | *\'*) | |
3398 | ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; | |
3399 | esac | |
3400 | case $ac_pass in | |
3401 | 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; | |
3402 | 2) | |
3403 | as_fn_append ac_configure_args1 " '$ac_arg'" | |
3404 | if test $ac_must_keep_next = true; then | |
3405 | ac_must_keep_next=false # Got value, back to normal. | |
3406 | else | |
3407 | case $ac_arg in | |
3408 | *=* | --config-cache | -C | -disable-* | --disable-* \ | |
3409 | | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | |
3410 | | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | |
3411 | | -with-* | --with-* | -without-* | --without-* | --x) | |
3412 | case "$ac_configure_args0 " in | |
3413 | "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; | |
3414 | esac | |
3415 | ;; | |
3416 | -* ) ac_must_keep_next=true ;; | |
3417 | esac | |
3418 | fi | |
3419 | as_fn_append ac_configure_args " '$ac_arg'" | |
3420 | ;; | |
3421 | esac | |
3422 | done | |
3423 | done | |
3424 | { ac_configure_args0=; unset ac_configure_args0;} | |
3425 | { ac_configure_args1=; unset ac_configure_args1;} | |
3426 | ||
3427 | # When interrupted or exit'd, cleanup temporary files, and complete | |
3428 | # config.log. We remove comments because anyway the quotes in there | |
3429 | # would cause problems or look ugly. | |
3430 | # WARNING: Use '\'' to represent an apostrophe within the trap. | |
3431 | # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. | |
3432 | trap 'exit_status=$? | |
3433 | # Save into config.log some information that might help in debugging. | |
3434 | { | |
3435 | echo | |
3436 | ||
d0ac1c44 | 3437 | $as_echo "## ---------------- ## |
c971b7fa | 3438 | ## Cache variables. ## |
d0ac1c44 | 3439 | ## ---------------- ##" |
c971b7fa PA |
3440 | echo |
3441 | # The following way of writing the cache mishandles newlines in values, | |
3442 | ( | |
3443 | for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do | |
3444 | eval ac_val=\$$ac_var | |
3445 | case $ac_val in #( | |
3446 | *${as_nl}*) | |
3447 | case $ac_var in #( | |
3448 | *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 | |
3449 | $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; | |
3450 | esac | |
3451 | case $ac_var in #( | |
3452 | _ | IFS | as_nl) ;; #( | |
3453 | BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( | |
3454 | *) { eval $ac_var=; unset $ac_var;} ;; | |
3455 | esac ;; | |
3456 | esac | |
3457 | done | |
3458 | (set) 2>&1 | | |
3459 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( | |
3460 | *${as_nl}ac_space=\ *) | |
3461 | sed -n \ | |
3462 | "s/'\''/'\''\\\\'\'''\''/g; | |
3463 | s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" | |
3464 | ;; #( | |
3465 | *) | |
3466 | sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" | |
3467 | ;; | |
3468 | esac | | |
3469 | sort | |
3470 | ) | |
3471 | echo | |
3472 | ||
d0ac1c44 | 3473 | $as_echo "## ----------------- ## |
c971b7fa | 3474 | ## Output variables. ## |
d0ac1c44 | 3475 | ## ----------------- ##" |
c971b7fa PA |
3476 | echo |
3477 | for ac_var in $ac_subst_vars | |
3478 | do | |
3479 | eval ac_val=\$$ac_var | |
3480 | case $ac_val in | |
3481 | *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; | |
3482 | esac | |
3483 | $as_echo "$ac_var='\''$ac_val'\''" | |
3484 | done | sort | |
3485 | echo | |
3486 | ||
3487 | if test -n "$ac_subst_files"; then | |
d0ac1c44 | 3488 | $as_echo "## ------------------- ## |
c971b7fa | 3489 | ## File substitutions. ## |
d0ac1c44 | 3490 | ## ------------------- ##" |
c971b7fa PA |
3491 | echo |
3492 | for ac_var in $ac_subst_files | |
3493 | do | |
3494 | eval ac_val=\$$ac_var | |
3495 | case $ac_val in | |
3496 | *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; | |
3497 | esac | |
3498 | $as_echo "$ac_var='\''$ac_val'\''" | |
3499 | done | sort | |
3500 | echo | |
3501 | fi | |
3502 | ||
3503 | if test -s confdefs.h; then | |
d0ac1c44 | 3504 | $as_echo "## ----------- ## |
c971b7fa | 3505 | ## confdefs.h. ## |
d0ac1c44 | 3506 | ## ----------- ##" |
c971b7fa PA |
3507 | echo |
3508 | cat confdefs.h | |
3509 | echo | |
3510 | fi | |
3511 | test "$ac_signal" != 0 && | |
3512 | $as_echo "$as_me: caught signal $ac_signal" | |
3513 | $as_echo "$as_me: exit $exit_status" | |
3514 | } >&5 | |
3515 | rm -f core *.core core.conftest.* && | |
3516 | rm -f -r conftest* confdefs* conf$$* $ac_clean_files && | |
3517 | exit $exit_status | |
3518 | ' 0 | |
3519 | for ac_signal in 1 2 13 15; do | |
3520 | trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal | |
3521 | done | |
3522 | ac_signal=0 | |
3523 | ||
3524 | # confdefs.h avoids OS command line length limits that DEFS can exceed. | |
3525 | rm -f -r conftest* confdefs.h | |
3526 | ||
3527 | $as_echo "/* confdefs.h */" > confdefs.h | |
3528 | ||
3529 | # Predefined preprocessor variables. | |
3530 | ||
3531 | cat >>confdefs.h <<_ACEOF | |
3532 | #define PACKAGE_NAME "$PACKAGE_NAME" | |
3533 | _ACEOF | |
3534 | ||
3535 | cat >>confdefs.h <<_ACEOF | |
3536 | #define PACKAGE_TARNAME "$PACKAGE_TARNAME" | |
3537 | _ACEOF | |
3538 | ||
3539 | cat >>confdefs.h <<_ACEOF | |
3540 | #define PACKAGE_VERSION "$PACKAGE_VERSION" | |
3541 | _ACEOF | |
3542 | ||
3543 | cat >>confdefs.h <<_ACEOF | |
3544 | #define PACKAGE_STRING "$PACKAGE_STRING" | |
3545 | _ACEOF | |
3546 | ||
3547 | cat >>confdefs.h <<_ACEOF | |
3548 | #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" | |
3549 | _ACEOF | |
3550 | ||
3551 | cat >>confdefs.h <<_ACEOF | |
3552 | #define PACKAGE_URL "$PACKAGE_URL" | |
3553 | _ACEOF | |
3554 | ||
3555 | ||
3556 | # Let the site file select an alternate cache file if it wants to. | |
3557 | # Prefer an explicitly selected file to automatically selected ones. | |
3558 | ac_site_file1=NONE | |
3559 | ac_site_file2=NONE | |
3560 | if test -n "$CONFIG_SITE"; then | |
d0ac1c44 SM |
3561 | # We do not want a PATH search for config.site. |
3562 | case $CONFIG_SITE in #(( | |
3563 | -*) ac_site_file1=./$CONFIG_SITE;; | |
3564 | */*) ac_site_file1=$CONFIG_SITE;; | |
3565 | *) ac_site_file1=./$CONFIG_SITE;; | |
3566 | esac | |
c971b7fa PA |
3567 | elif test "x$prefix" != xNONE; then |
3568 | ac_site_file1=$prefix/share/config.site | |
3569 | ac_site_file2=$prefix/etc/config.site | |
3570 | else | |
3571 | ac_site_file1=$ac_default_prefix/share/config.site | |
3572 | ac_site_file2=$ac_default_prefix/etc/config.site | |
3573 | fi | |
3574 | for ac_site_file in "$ac_site_file1" "$ac_site_file2" | |
3575 | do | |
3576 | test "x$ac_site_file" = xNONE && continue | |
d0ac1c44 | 3577 | if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then |
c971b7fa PA |
3578 | { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 |
3579 | $as_echo "$as_me: loading site script $ac_site_file" >&6;} | |
3580 | sed 's/^/| /' "$ac_site_file" >&5 | |
d0ac1c44 SM |
3581 | . "$ac_site_file" \ |
3582 | || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
3583 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
3584 | as_fn_error $? "failed to load site script $ac_site_file | |
3585 | See \`config.log' for more details" "$LINENO" 5; } | |
c971b7fa PA |
3586 | fi |
3587 | done | |
3588 | ||
3589 | if test -r "$cache_file"; then | |
d0ac1c44 SM |
3590 | # Some versions of bash will fail to source /dev/null (special files |
3591 | # actually), so we avoid doing that. DJGPP emulates it as a regular file. | |
3592 | if test /dev/null != "$cache_file" && test -f "$cache_file"; then | |
c971b7fa PA |
3593 | { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 |
3594 | $as_echo "$as_me: loading cache $cache_file" >&6;} | |
3595 | case $cache_file in | |
3596 | [\\/]* | ?:[\\/]* ) . "$cache_file";; | |
3597 | *) . "./$cache_file";; | |
3598 | esac | |
3599 | fi | |
3600 | else | |
3601 | { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 | |
3602 | $as_echo "$as_me: creating cache $cache_file" >&6;} | |
3603 | >$cache_file | |
3604 | fi | |
3605 | ||
c0c3707f CB |
3606 | as_fn_append ac_header_list " arpa/inet.h" |
3607 | as_fn_append ac_header_list " features.h" | |
3608 | as_fn_append ac_header_list " sys/socket.h" | |
3609 | as_fn_append ac_func_list " canonicalize_file_name" | |
3610 | as_fn_append ac_func_list " getcwd" | |
3611 | as_fn_append ac_func_list " readlink" | |
3612 | as_fn_append ac_func_list " realpath" | |
3613 | as_fn_append ac_header_list " sys/param.h" | |
3614 | as_fn_append ac_header_list " unistd.h" | |
3615 | as_fn_append ac_func_list " _set_invalid_parameter_handler" | |
3616 | as_fn_append ac_func_list " fchdir" | |
3617 | as_fn_append ac_header_list " dirent.h" | |
3618 | as_fn_append ac_func_list " fcntl" | |
3619 | as_fn_append ac_func_list " symlink" | |
3620 | as_fn_append ac_func_list " fdopendir" | |
3621 | as_fn_append ac_func_list " mempcpy" | |
3622 | as_fn_append ac_header_list " fnmatch.h" | |
3623 | as_fn_append ac_func_list " fnmatch" | |
3624 | as_fn_append ac_func_list " btowc" | |
3625 | as_fn_append ac_func_list " isblank" | |
3626 | as_fn_append ac_func_list " iswctype" | |
3627 | as_fn_append ac_func_list " mbsrtowcs" | |
3628 | as_fn_append ac_func_list " wmemchr" | |
3629 | as_fn_append ac_func_list " wmemcpy" | |
3630 | as_fn_append ac_func_list " wmempcpy" | |
3631 | as_fn_append ac_header_list " wctype.h" | |
8690e634 | 3632 | gl_fnmatch_required=GNU |
c0c3707f CB |
3633 | as_fn_append ac_header_list " sys/stat.h" |
3634 | as_fn_append ac_func_list " fstatat" | |
3635 | as_fn_append ac_func_list " getdtablesize" | |
3636 | as_fn_append ac_func_list " getlogin_r" | |
3637 | as_fn_append ac_func_list " getprogname" | |
3638 | as_fn_append ac_func_list " getexecname" | |
3639 | as_fn_append ac_header_list " sys/time.h" | |
3640 | as_fn_append ac_func_list " gettimeofday" | |
3641 | as_fn_append ac_header_list " glob.h" | |
3642 | as_fn_append ac_func_list " glob" | |
3643 | as_fn_append ac_func_list " glob_pattern_p" | |
3644 | as_fn_append ac_func_list " getpwnam_r" | |
5df4cba6 | 3645 | as_fn_append ac_header_list " threads.h" |
c0c3707f CB |
3646 | as_fn_append ac_header_list " netdb.h" |
3647 | as_fn_append ac_header_list " netinet/in.h" | |
3648 | as_fn_append ac_header_list " limits.h" | |
3649 | as_fn_append ac_header_list " wchar.h" | |
3650 | as_fn_append ac_header_list " stdint.h" | |
3651 | as_fn_append ac_header_list " inttypes.h" | |
5df4cba6 | 3652 | as_fn_append ac_header_list " xlocale.h" |
c0c3707f CB |
3653 | as_fn_append ac_func_list " lstat" |
3654 | as_fn_append ac_header_list " math.h" | |
3655 | as_fn_append ac_func_list " mbsinit" | |
3656 | as_fn_append ac_func_list " mbrtowc" | |
3657 | as_fn_append ac_header_list " sys/mman.h" | |
3658 | as_fn_append ac_func_list " mprotect" | |
3659 | as_fn_append ac_func_list " mkostemp" | |
3660 | as_fn_append ac_func_list " openat" | |
3661 | as_fn_append ac_func_list " link" | |
3662 | as_fn_append ac_func_list " setenv" | |
3663 | as_fn_append ac_func_list " strdup" | |
3664 | as_fn_append ac_func_list " strerror_r" | |
3665 | as_fn_append ac_func_list " __xpg_strerror_r" | |
3666 | as_fn_append ac_func_list " catgets" | |
3667 | as_fn_append ac_func_list " snprintf" | |
3668 | as_fn_append ac_header_list " sys/uio.h" | |
3669 | as_fn_append ac_func_list " localtime_r" | |
3670 | as_fn_append ac_func_list " pipe" | |
3671 | as_fn_append ac_header_list " crtdefs.h" | |
3672 | as_fn_append ac_func_list " iswcntrl" | |
c971b7fa PA |
3673 | # Check that the precious variables saved in the cache have kept the same |
3674 | # value. | |
3675 | ac_cache_corrupted=false | |
3676 | for ac_var in $ac_precious_vars; do | |
3677 | eval ac_old_set=\$ac_cv_env_${ac_var}_set | |
3678 | eval ac_new_set=\$ac_env_${ac_var}_set | |
3679 | eval ac_old_val=\$ac_cv_env_${ac_var}_value | |
3680 | eval ac_new_val=\$ac_env_${ac_var}_value | |
3681 | case $ac_old_set,$ac_new_set in | |
3682 | set,) | |
3683 | { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 | |
3684 | $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} | |
3685 | ac_cache_corrupted=: ;; | |
3686 | ,set) | |
3687 | { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 | |
3688 | $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} | |
3689 | ac_cache_corrupted=: ;; | |
3690 | ,);; | |
3691 | *) | |
3692 | if test "x$ac_old_val" != "x$ac_new_val"; then | |
3693 | # differences in whitespace do not lead to failure. | |
3694 | ac_old_val_w=`echo x $ac_old_val` | |
3695 | ac_new_val_w=`echo x $ac_new_val` | |
3696 | if test "$ac_old_val_w" != "$ac_new_val_w"; then | |
3697 | { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 | |
3698 | $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} | |
3699 | ac_cache_corrupted=: | |
3700 | else | |
3701 | { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 | |
3702 | $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} | |
3703 | eval $ac_var=\$ac_old_val | |
3704 | fi | |
3705 | { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 | |
3706 | $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} | |
3707 | { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 | |
3708 | $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} | |
3709 | fi;; | |
3710 | esac | |
3711 | # Pass precious variables to config.status. | |
3712 | if test "$ac_new_set" = set; then | |
3713 | case $ac_new_val in | |
3714 | *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; | |
3715 | *) ac_arg=$ac_var=$ac_new_val ;; | |
3716 | esac | |
3717 | case " $ac_configure_args " in | |
3718 | *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. | |
3719 | *) as_fn_append ac_configure_args " '$ac_arg'" ;; | |
3720 | esac | |
3721 | fi | |
3722 | done | |
3723 | if $ac_cache_corrupted; then | |
3724 | { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
3725 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
3726 | { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 | |
3727 | $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} | |
d0ac1c44 | 3728 | as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 |
c971b7fa PA |
3729 | fi |
3730 | ## -------------------- ## | |
3731 | ## Main body of script. ## | |
3732 | ## -------------------- ## | |
3733 | ||
3734 | ac_ext=c | |
3735 | ac_cpp='$CPP $CPPFLAGS' | |
3736 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
3737 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
3738 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
3739 | ||
3740 | ||
d0ac1c44 | 3741 | |
73cc7272 TT |
3742 | |
3743 | ||
3744 | ||
c971b7fa PA |
3745 | ac_config_headers="$ac_config_headers config.h:config.in" |
3746 | ||
3747 | ||
5abebf3c CB |
3748 | |
3749 | ||
c971b7fa PA |
3750 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 |
3751 | $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } | |
3752 | # Check whether --enable-maintainer-mode was given. | |
3753 | if test "${enable_maintainer_mode+set}" = set; then : | |
3754 | enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval | |
3755 | else | |
3756 | USE_MAINTAINER_MODE=no | |
3757 | fi | |
3758 | ||
3759 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 | |
3760 | $as_echo "$USE_MAINTAINER_MODE" >&6; } | |
3761 | if test $USE_MAINTAINER_MODE = yes; then | |
3762 | MAINTAINER_MODE_TRUE= | |
3763 | MAINTAINER_MODE_FALSE='#' | |
3764 | else | |
3765 | MAINTAINER_MODE_TRUE='#' | |
3766 | MAINTAINER_MODE_FALSE= | |
3767 | fi | |
3768 | ||
3769 | MAINT=$MAINTAINER_MODE_TRUE | |
3770 | ||
3771 | ||
3772 | ||
3773 | ac_ext=c | |
3774 | ac_cpp='$CPP $CPPFLAGS' | |
3775 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
3776 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
3777 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
3778 | if test -n "$ac_tool_prefix"; then | |
3779 | # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. | |
3780 | set dummy ${ac_tool_prefix}gcc; ac_word=$2 | |
3781 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
3782 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 3783 | if ${ac_cv_prog_CC+:} false; then : |
c971b7fa PA |
3784 | $as_echo_n "(cached) " >&6 |
3785 | else | |
3786 | if test -n "$CC"; then | |
3787 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
3788 | else | |
3789 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
3790 | for as_dir in $PATH | |
3791 | do | |
3792 | IFS=$as_save_IFS | |
3793 | test -z "$as_dir" && as_dir=. | |
3794 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 3795 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
3796 | ac_cv_prog_CC="${ac_tool_prefix}gcc" |
3797 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
3798 | break 2 | |
3799 | fi | |
3800 | done | |
3801 | done | |
3802 | IFS=$as_save_IFS | |
3803 | ||
3804 | fi | |
3805 | fi | |
3806 | CC=$ac_cv_prog_CC | |
3807 | if test -n "$CC"; then | |
3808 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 | |
3809 | $as_echo "$CC" >&6; } | |
3810 | else | |
3811 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
3812 | $as_echo "no" >&6; } | |
3813 | fi | |
3814 | ||
3815 | ||
3816 | fi | |
3817 | if test -z "$ac_cv_prog_CC"; then | |
3818 | ac_ct_CC=$CC | |
3819 | # Extract the first word of "gcc", so it can be a program name with args. | |
3820 | set dummy gcc; ac_word=$2 | |
3821 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
3822 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 3823 | if ${ac_cv_prog_ac_ct_CC+:} false; then : |
c971b7fa PA |
3824 | $as_echo_n "(cached) " >&6 |
3825 | else | |
3826 | if test -n "$ac_ct_CC"; then | |
3827 | ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. | |
3828 | else | |
3829 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
3830 | for as_dir in $PATH | |
3831 | do | |
3832 | IFS=$as_save_IFS | |
3833 | test -z "$as_dir" && as_dir=. | |
3834 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 3835 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
3836 | ac_cv_prog_ac_ct_CC="gcc" |
3837 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
3838 | break 2 | |
3839 | fi | |
3840 | done | |
3841 | done | |
3842 | IFS=$as_save_IFS | |
3843 | ||
3844 | fi | |
3845 | fi | |
3846 | ac_ct_CC=$ac_cv_prog_ac_ct_CC | |
3847 | if test -n "$ac_ct_CC"; then | |
3848 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 | |
3849 | $as_echo "$ac_ct_CC" >&6; } | |
3850 | else | |
3851 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
3852 | $as_echo "no" >&6; } | |
3853 | fi | |
3854 | ||
3855 | if test "x$ac_ct_CC" = x; then | |
3856 | CC="" | |
3857 | else | |
3858 | case $cross_compiling:$ac_tool_warned in | |
3859 | yes:) | |
3860 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
3861 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
3862 | ac_tool_warned=yes ;; | |
3863 | esac | |
3864 | CC=$ac_ct_CC | |
3865 | fi | |
3866 | else | |
3867 | CC="$ac_cv_prog_CC" | |
3868 | fi | |
3869 | ||
3870 | if test -z "$CC"; then | |
3871 | if test -n "$ac_tool_prefix"; then | |
3872 | # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. | |
3873 | set dummy ${ac_tool_prefix}cc; ac_word=$2 | |
3874 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
3875 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 3876 | if ${ac_cv_prog_CC+:} false; then : |
c971b7fa PA |
3877 | $as_echo_n "(cached) " >&6 |
3878 | else | |
3879 | if test -n "$CC"; then | |
3880 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
3881 | else | |
3882 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
3883 | for as_dir in $PATH | |
3884 | do | |
3885 | IFS=$as_save_IFS | |
3886 | test -z "$as_dir" && as_dir=. | |
3887 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 3888 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
3889 | ac_cv_prog_CC="${ac_tool_prefix}cc" |
3890 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
3891 | break 2 | |
3892 | fi | |
3893 | done | |
3894 | done | |
3895 | IFS=$as_save_IFS | |
3896 | ||
3897 | fi | |
3898 | fi | |
3899 | CC=$ac_cv_prog_CC | |
3900 | if test -n "$CC"; then | |
3901 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 | |
3902 | $as_echo "$CC" >&6; } | |
3903 | else | |
3904 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
3905 | $as_echo "no" >&6; } | |
3906 | fi | |
3907 | ||
3908 | ||
3909 | fi | |
3910 | fi | |
3911 | if test -z "$CC"; then | |
3912 | # Extract the first word of "cc", so it can be a program name with args. | |
3913 | set dummy cc; ac_word=$2 | |
3914 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
3915 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 3916 | if ${ac_cv_prog_CC+:} false; then : |
c971b7fa PA |
3917 | $as_echo_n "(cached) " >&6 |
3918 | else | |
3919 | if test -n "$CC"; then | |
3920 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
3921 | else | |
3922 | ac_prog_rejected=no | |
3923 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
3924 | for as_dir in $PATH | |
3925 | do | |
3926 | IFS=$as_save_IFS | |
3927 | test -z "$as_dir" && as_dir=. | |
3928 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 3929 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
3930 | if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then |
3931 | ac_prog_rejected=yes | |
3932 | continue | |
3933 | fi | |
3934 | ac_cv_prog_CC="cc" | |
3935 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
3936 | break 2 | |
3937 | fi | |
3938 | done | |
3939 | done | |
3940 | IFS=$as_save_IFS | |
3941 | ||
3942 | if test $ac_prog_rejected = yes; then | |
3943 | # We found a bogon in the path, so make sure we never use it. | |
3944 | set dummy $ac_cv_prog_CC | |
3945 | shift | |
3946 | if test $# != 0; then | |
3947 | # We chose a different compiler from the bogus one. | |
3948 | # However, it has the same basename, so the bogon will be chosen | |
3949 | # first if we set CC to just the basename; use the full file name. | |
3950 | shift | |
3951 | ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" | |
3952 | fi | |
3953 | fi | |
3954 | fi | |
3955 | fi | |
3956 | CC=$ac_cv_prog_CC | |
3957 | if test -n "$CC"; then | |
3958 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 | |
3959 | $as_echo "$CC" >&6; } | |
3960 | else | |
3961 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
3962 | $as_echo "no" >&6; } | |
3963 | fi | |
3964 | ||
3965 | ||
3966 | fi | |
3967 | if test -z "$CC"; then | |
3968 | if test -n "$ac_tool_prefix"; then | |
3969 | for ac_prog in cl.exe | |
3970 | do | |
3971 | # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. | |
3972 | set dummy $ac_tool_prefix$ac_prog; ac_word=$2 | |
3973 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
3974 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 3975 | if ${ac_cv_prog_CC+:} false; then : |
c971b7fa PA |
3976 | $as_echo_n "(cached) " >&6 |
3977 | else | |
3978 | if test -n "$CC"; then | |
3979 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
3980 | else | |
3981 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
3982 | for as_dir in $PATH | |
3983 | do | |
3984 | IFS=$as_save_IFS | |
3985 | test -z "$as_dir" && as_dir=. | |
3986 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 3987 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
3988 | ac_cv_prog_CC="$ac_tool_prefix$ac_prog" |
3989 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
3990 | break 2 | |
3991 | fi | |
3992 | done | |
3993 | done | |
3994 | IFS=$as_save_IFS | |
3995 | ||
3996 | fi | |
3997 | fi | |
3998 | CC=$ac_cv_prog_CC | |
3999 | if test -n "$CC"; then | |
4000 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 | |
4001 | $as_echo "$CC" >&6; } | |
4002 | else | |
4003 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4004 | $as_echo "no" >&6; } | |
4005 | fi | |
4006 | ||
4007 | ||
4008 | test -n "$CC" && break | |
4009 | done | |
4010 | fi | |
4011 | if test -z "$CC"; then | |
4012 | ac_ct_CC=$CC | |
4013 | for ac_prog in cl.exe | |
4014 | do | |
4015 | # Extract the first word of "$ac_prog", so it can be a program name with args. | |
4016 | set dummy $ac_prog; ac_word=$2 | |
4017 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
4018 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 4019 | if ${ac_cv_prog_ac_ct_CC+:} false; then : |
c971b7fa PA |
4020 | $as_echo_n "(cached) " >&6 |
4021 | else | |
4022 | if test -n "$ac_ct_CC"; then | |
4023 | ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. | |
4024 | else | |
4025 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
4026 | for as_dir in $PATH | |
4027 | do | |
4028 | IFS=$as_save_IFS | |
4029 | test -z "$as_dir" && as_dir=. | |
4030 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 4031 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
4032 | ac_cv_prog_ac_ct_CC="$ac_prog" |
4033 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
4034 | break 2 | |
4035 | fi | |
4036 | done | |
4037 | done | |
4038 | IFS=$as_save_IFS | |
4039 | ||
4040 | fi | |
4041 | fi | |
4042 | ac_ct_CC=$ac_cv_prog_ac_ct_CC | |
4043 | if test -n "$ac_ct_CC"; then | |
4044 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 | |
4045 | $as_echo "$ac_ct_CC" >&6; } | |
4046 | else | |
4047 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4048 | $as_echo "no" >&6; } | |
4049 | fi | |
4050 | ||
4051 | ||
4052 | test -n "$ac_ct_CC" && break | |
4053 | done | |
4054 | ||
4055 | if test "x$ac_ct_CC" = x; then | |
4056 | CC="" | |
4057 | else | |
4058 | case $cross_compiling:$ac_tool_warned in | |
4059 | yes:) | |
4060 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
4061 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
4062 | ac_tool_warned=yes ;; | |
4063 | esac | |
4064 | CC=$ac_ct_CC | |
4065 | fi | |
4066 | fi | |
4067 | ||
c0c3707f CB |
4068 | fi |
4069 | if test -z "$CC"; then | |
4070 | if test -n "$ac_tool_prefix"; then | |
4071 | # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. | |
4072 | set dummy ${ac_tool_prefix}clang; ac_word=$2 | |
4073 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
4074 | $as_echo_n "checking for $ac_word... " >&6; } | |
4075 | if ${ac_cv_prog_CC+:} false; then : | |
4076 | $as_echo_n "(cached) " >&6 | |
4077 | else | |
4078 | if test -n "$CC"; then | |
4079 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
4080 | else | |
4081 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
4082 | for as_dir in $PATH | |
4083 | do | |
4084 | IFS=$as_save_IFS | |
4085 | test -z "$as_dir" && as_dir=. | |
4086 | for ac_exec_ext in '' $ac_executable_extensions; do | |
4087 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
4088 | ac_cv_prog_CC="${ac_tool_prefix}clang" | |
4089 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
4090 | break 2 | |
4091 | fi | |
4092 | done | |
4093 | done | |
4094 | IFS=$as_save_IFS | |
4095 | ||
4096 | fi | |
4097 | fi | |
4098 | CC=$ac_cv_prog_CC | |
4099 | if test -n "$CC"; then | |
4100 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 | |
4101 | $as_echo "$CC" >&6; } | |
4102 | else | |
4103 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4104 | $as_echo "no" >&6; } | |
4105 | fi | |
4106 | ||
4107 | ||
4108 | fi | |
4109 | if test -z "$ac_cv_prog_CC"; then | |
4110 | ac_ct_CC=$CC | |
4111 | # Extract the first word of "clang", so it can be a program name with args. | |
4112 | set dummy clang; ac_word=$2 | |
4113 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
4114 | $as_echo_n "checking for $ac_word... " >&6; } | |
4115 | if ${ac_cv_prog_ac_ct_CC+:} false; then : | |
4116 | $as_echo_n "(cached) " >&6 | |
4117 | else | |
4118 | if test -n "$ac_ct_CC"; then | |
4119 | ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. | |
4120 | else | |
4121 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
4122 | for as_dir in $PATH | |
4123 | do | |
4124 | IFS=$as_save_IFS | |
4125 | test -z "$as_dir" && as_dir=. | |
4126 | for ac_exec_ext in '' $ac_executable_extensions; do | |
4127 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
4128 | ac_cv_prog_ac_ct_CC="clang" | |
4129 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
4130 | break 2 | |
4131 | fi | |
4132 | done | |
4133 | done | |
4134 | IFS=$as_save_IFS | |
4135 | ||
4136 | fi | |
4137 | fi | |
4138 | ac_ct_CC=$ac_cv_prog_ac_ct_CC | |
4139 | if test -n "$ac_ct_CC"; then | |
4140 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 | |
4141 | $as_echo "$ac_ct_CC" >&6; } | |
4142 | else | |
4143 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
4144 | $as_echo "no" >&6; } | |
4145 | fi | |
4146 | ||
4147 | if test "x$ac_ct_CC" = x; then | |
4148 | CC="" | |
4149 | else | |
4150 | case $cross_compiling:$ac_tool_warned in | |
4151 | yes:) | |
4152 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
4153 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
4154 | ac_tool_warned=yes ;; | |
4155 | esac | |
4156 | CC=$ac_ct_CC | |
4157 | fi | |
4158 | else | |
4159 | CC="$ac_cv_prog_CC" | |
4160 | fi | |
4161 | ||
c971b7fa PA |
4162 | fi |
4163 | ||
4164 | ||
4165 | test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
4166 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
d0ac1c44 SM |
4167 | as_fn_error $? "no acceptable C compiler found in \$PATH |
4168 | See \`config.log' for more details" "$LINENO" 5; } | |
c971b7fa PA |
4169 | |
4170 | # Provide some information about the compiler. | |
4171 | $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 | |
4172 | set X $ac_compile | |
4173 | ac_compiler=$2 | |
c0c3707f | 4174 | for ac_option in --version -v -V -qversion -version; do |
c971b7fa PA |
4175 | { { ac_try="$ac_compiler $ac_option >&5" |
4176 | case "(($ac_try" in | |
4177 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4178 | *) ac_try_echo=$ac_try;; | |
4179 | esac | |
4180 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4181 | $as_echo "$ac_try_echo"; } >&5 | |
4182 | (eval "$ac_compiler $ac_option >&5") 2>conftest.err | |
4183 | ac_status=$? | |
4184 | if test -s conftest.err; then | |
4185 | sed '10a\ | |
4186 | ... rest of stderr output deleted ... | |
4187 | 10q' conftest.err >conftest.er1 | |
4188 | cat conftest.er1 >&5 | |
c971b7fa | 4189 | fi |
d0ac1c44 | 4190 | rm -f conftest.er1 conftest.err |
c971b7fa PA |
4191 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
4192 | test $ac_status = 0; } | |
4193 | done | |
4194 | ||
4195 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4196 | /* end confdefs.h. */ | |
d0ac1c44 | 4197 | |
c971b7fa PA |
4198 | int |
4199 | main () | |
4200 | { | |
c971b7fa PA |
4201 | |
4202 | ; | |
4203 | return 0; | |
4204 | } | |
4205 | _ACEOF | |
4206 | ac_clean_files_save=$ac_clean_files | |
d0ac1c44 | 4207 | ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" |
c971b7fa PA |
4208 | # Try to create an executable without -o first, disregard a.out. |
4209 | # It will help us diagnose broken compilers, and finding out an intuition | |
4210 | # of exeext. | |
d0ac1c44 SM |
4211 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 |
4212 | $as_echo_n "checking whether the C compiler works... " >&6; } | |
c971b7fa PA |
4213 | ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` |
4214 | ||
4215 | # The possible output files: | |
4216 | ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" | |
4217 | ||
4218 | ac_rmfiles= | |
4219 | for ac_file in $ac_files | |
4220 | do | |
4221 | case $ac_file in | |
4222 | *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; | |
4223 | * ) ac_rmfiles="$ac_rmfiles $ac_file";; | |
4224 | esac | |
4225 | done | |
4226 | rm -f $ac_rmfiles | |
4227 | ||
4228 | if { { ac_try="$ac_link_default" | |
4229 | case "(($ac_try" in | |
4230 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4231 | *) ac_try_echo=$ac_try;; | |
4232 | esac | |
4233 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4234 | $as_echo "$ac_try_echo"; } >&5 | |
4235 | (eval "$ac_link_default") 2>&5 | |
4236 | ac_status=$? | |
4237 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
4238 | test $ac_status = 0; }; then : | |
4239 | # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. | |
4240 | # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' | |
4241 | # in a Makefile. We should not override ac_cv_exeext if it was cached, | |
4242 | # so that the user can short-circuit this test for compilers unknown to | |
4243 | # Autoconf. | |
4244 | for ac_file in $ac_files '' | |
4245 | do | |
4246 | test -f "$ac_file" || continue | |
4247 | case $ac_file in | |
4248 | *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) | |
4249 | ;; | |
4250 | [ab].out ) | |
4251 | # We found the default executable, but exeext='' is most | |
4252 | # certainly right. | |
4253 | break;; | |
4254 | *.* ) | |
4255 | if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; | |
4256 | then :; else | |
4257 | ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` | |
4258 | fi | |
4259 | # We set ac_cv_exeext here because the later test for it is not | |
4260 | # safe: cross compilers may not add the suffix if given an `-o' | |
4261 | # argument, so we may need to know it at that point already. | |
4262 | # Even if this section looks crufty: it has the advantage of | |
4263 | # actually working. | |
4264 | break;; | |
4265 | * ) | |
4266 | break;; | |
4267 | esac | |
4268 | done | |
4269 | test "$ac_cv_exeext" = no && ac_cv_exeext= | |
4270 | ||
4271 | else | |
4272 | ac_file='' | |
4273 | fi | |
c971b7fa | 4274 | if test -z "$ac_file"; then : |
d0ac1c44 SM |
4275 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
4276 | $as_echo "no" >&6; } | |
4277 | $as_echo "$as_me: failed program was:" >&5 | |
c971b7fa PA |
4278 | sed 's/^/| /' conftest.$ac_ext >&5 |
4279 | ||
4280 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
4281 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
d0ac1c44 SM |
4282 | as_fn_error 77 "C compiler cannot create executables |
4283 | See \`config.log' for more details" "$LINENO" 5; } | |
4284 | else | |
4285 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
4286 | $as_echo "yes" >&6; } | |
c971b7fa | 4287 | fi |
d0ac1c44 SM |
4288 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 |
4289 | $as_echo_n "checking for C compiler default output file name... " >&6; } | |
4290 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 | |
4291 | $as_echo "$ac_file" >&6; } | |
c971b7fa PA |
4292 | ac_exeext=$ac_cv_exeext |
4293 | ||
d0ac1c44 | 4294 | rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out |
c971b7fa | 4295 | ac_clean_files=$ac_clean_files_save |
c971b7fa PA |
4296 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 |
4297 | $as_echo_n "checking for suffix of executables... " >&6; } | |
4298 | if { { ac_try="$ac_link" | |
4299 | case "(($ac_try" in | |
4300 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4301 | *) ac_try_echo=$ac_try;; | |
4302 | esac | |
4303 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4304 | $as_echo "$ac_try_echo"; } >&5 | |
4305 | (eval "$ac_link") 2>&5 | |
4306 | ac_status=$? | |
4307 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
4308 | test $ac_status = 0; }; then : | |
4309 | # If both `conftest.exe' and `conftest' are `present' (well, observable) | |
4310 | # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will | |
4311 | # work properly (i.e., refer to `conftest.exe'), while it won't with | |
4312 | # `rm'. | |
4313 | for ac_file in conftest.exe conftest conftest.*; do | |
4314 | test -f "$ac_file" || continue | |
4315 | case $ac_file in | |
4316 | *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; | |
4317 | *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` | |
4318 | break;; | |
4319 | * ) break;; | |
4320 | esac | |
4321 | done | |
4322 | else | |
4323 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
4324 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
d0ac1c44 SM |
4325 | as_fn_error $? "cannot compute suffix of executables: cannot compile and link |
4326 | See \`config.log' for more details" "$LINENO" 5; } | |
c971b7fa | 4327 | fi |
d0ac1c44 | 4328 | rm -f conftest conftest$ac_cv_exeext |
c971b7fa PA |
4329 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 |
4330 | $as_echo "$ac_cv_exeext" >&6; } | |
4331 | ||
4332 | rm -f conftest.$ac_ext | |
4333 | EXEEXT=$ac_cv_exeext | |
4334 | ac_exeext=$EXEEXT | |
d0ac1c44 SM |
4335 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
4336 | /* end confdefs.h. */ | |
4337 | #include <stdio.h> | |
4338 | int | |
4339 | main () | |
4340 | { | |
4341 | FILE *f = fopen ("conftest.out", "w"); | |
4342 | return ferror (f) || fclose (f) != 0; | |
4343 | ||
4344 | ; | |
4345 | return 0; | |
4346 | } | |
4347 | _ACEOF | |
4348 | ac_clean_files="$ac_clean_files conftest.out" | |
4349 | # Check that the compiler produces executables we can run. If not, either | |
4350 | # the compiler is broken, or we cross compile. | |
4351 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 | |
4352 | $as_echo_n "checking whether we are cross compiling... " >&6; } | |
4353 | if test "$cross_compiling" != yes; then | |
4354 | { { ac_try="$ac_link" | |
4355 | case "(($ac_try" in | |
4356 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4357 | *) ac_try_echo=$ac_try;; | |
4358 | esac | |
4359 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4360 | $as_echo "$ac_try_echo"; } >&5 | |
4361 | (eval "$ac_link") 2>&5 | |
4362 | ac_status=$? | |
4363 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
4364 | test $ac_status = 0; } | |
4365 | if { ac_try='./conftest$ac_cv_exeext' | |
4366 | { { case "(($ac_try" in | |
4367 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4368 | *) ac_try_echo=$ac_try;; | |
4369 | esac | |
4370 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4371 | $as_echo "$ac_try_echo"; } >&5 | |
4372 | (eval "$ac_try") 2>&5 | |
4373 | ac_status=$? | |
4374 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
4375 | test $ac_status = 0; }; }; then | |
4376 | cross_compiling=no | |
4377 | else | |
4378 | if test "$cross_compiling" = maybe; then | |
4379 | cross_compiling=yes | |
4380 | else | |
4381 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
4382 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
4383 | as_fn_error $? "cannot run C compiled programs. | |
4384 | If you meant to cross compile, use \`--host'. | |
4385 | See \`config.log' for more details" "$LINENO" 5; } | |
4386 | fi | |
4387 | fi | |
4388 | fi | |
4389 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 | |
4390 | $as_echo "$cross_compiling" >&6; } | |
4391 | ||
4392 | rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out | |
4393 | ac_clean_files=$ac_clean_files_save | |
c971b7fa PA |
4394 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 |
4395 | $as_echo_n "checking for suffix of object files... " >&6; } | |
d0ac1c44 | 4396 | if ${ac_cv_objext+:} false; then : |
c971b7fa PA |
4397 | $as_echo_n "(cached) " >&6 |
4398 | else | |
4399 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4400 | /* end confdefs.h. */ | |
4401 | ||
4402 | int | |
4403 | main () | |
4404 | { | |
4405 | ||
4406 | ; | |
4407 | return 0; | |
4408 | } | |
4409 | _ACEOF | |
4410 | rm -f conftest.o conftest.obj | |
4411 | if { { ac_try="$ac_compile" | |
4412 | case "(($ac_try" in | |
4413 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | |
4414 | *) ac_try_echo=$ac_try;; | |
4415 | esac | |
4416 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | |
4417 | $as_echo "$ac_try_echo"; } >&5 | |
4418 | (eval "$ac_compile") 2>&5 | |
4419 | ac_status=$? | |
4420 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
4421 | test $ac_status = 0; }; then : | |
4422 | for ac_file in conftest.o conftest.obj conftest.*; do | |
4423 | test -f "$ac_file" || continue; | |
4424 | case $ac_file in | |
4425 | *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; | |
4426 | *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` | |
4427 | break;; | |
4428 | esac | |
4429 | done | |
4430 | else | |
4431 | $as_echo "$as_me: failed program was:" >&5 | |
4432 | sed 's/^/| /' conftest.$ac_ext >&5 | |
4433 | ||
4434 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
4435 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
d0ac1c44 SM |
4436 | as_fn_error $? "cannot compute suffix of object files: cannot compile |
4437 | See \`config.log' for more details" "$LINENO" 5; } | |
c971b7fa PA |
4438 | fi |
4439 | rm -f conftest.$ac_cv_objext conftest.$ac_ext | |
4440 | fi | |
4441 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 | |
4442 | $as_echo "$ac_cv_objext" >&6; } | |
4443 | OBJEXT=$ac_cv_objext | |
4444 | ac_objext=$OBJEXT | |
4445 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 | |
4446 | $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } | |
d0ac1c44 | 4447 | if ${ac_cv_c_compiler_gnu+:} false; then : |
c971b7fa PA |
4448 | $as_echo_n "(cached) " >&6 |
4449 | else | |
4450 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4451 | /* end confdefs.h. */ | |
4452 | ||
4453 | int | |
4454 | main () | |
4455 | { | |
4456 | #ifndef __GNUC__ | |
4457 | choke me | |
4458 | #endif | |
4459 | ||
4460 | ; | |
4461 | return 0; | |
4462 | } | |
4463 | _ACEOF | |
4464 | if ac_fn_c_try_compile "$LINENO"; then : | |
4465 | ac_compiler_gnu=yes | |
4466 | else | |
4467 | ac_compiler_gnu=no | |
4468 | fi | |
4469 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
4470 | ac_cv_c_compiler_gnu=$ac_compiler_gnu | |
4471 | ||
4472 | fi | |
4473 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 | |
4474 | $as_echo "$ac_cv_c_compiler_gnu" >&6; } | |
4475 | if test $ac_compiler_gnu = yes; then | |
4476 | GCC=yes | |
4477 | else | |
4478 | GCC= | |
4479 | fi | |
4480 | ac_test_CFLAGS=${CFLAGS+set} | |
4481 | ac_save_CFLAGS=$CFLAGS | |
4482 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 | |
4483 | $as_echo_n "checking whether $CC accepts -g... " >&6; } | |
d0ac1c44 | 4484 | if ${ac_cv_prog_cc_g+:} false; then : |
c971b7fa PA |
4485 | $as_echo_n "(cached) " >&6 |
4486 | else | |
4487 | ac_save_c_werror_flag=$ac_c_werror_flag | |
4488 | ac_c_werror_flag=yes | |
4489 | ac_cv_prog_cc_g=no | |
4490 | CFLAGS="-g" | |
4491 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4492 | /* end confdefs.h. */ | |
4493 | ||
4494 | int | |
4495 | main () | |
4496 | { | |
4497 | ||
4498 | ; | |
4499 | return 0; | |
4500 | } | |
4501 | _ACEOF | |
4502 | if ac_fn_c_try_compile "$LINENO"; then : | |
4503 | ac_cv_prog_cc_g=yes | |
4504 | else | |
4505 | CFLAGS="" | |
4506 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4507 | /* end confdefs.h. */ | |
4508 | ||
4509 | int | |
4510 | main () | |
4511 | { | |
4512 | ||
4513 | ; | |
4514 | return 0; | |
4515 | } | |
4516 | _ACEOF | |
4517 | if ac_fn_c_try_compile "$LINENO"; then : | |
4518 | ||
4519 | else | |
4520 | ac_c_werror_flag=$ac_save_c_werror_flag | |
4521 | CFLAGS="-g" | |
4522 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4523 | /* end confdefs.h. */ | |
4524 | ||
4525 | int | |
4526 | main () | |
4527 | { | |
4528 | ||
4529 | ; | |
4530 | return 0; | |
4531 | } | |
4532 | _ACEOF | |
4533 | if ac_fn_c_try_compile "$LINENO"; then : | |
4534 | ac_cv_prog_cc_g=yes | |
4535 | fi | |
4536 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
4537 | fi | |
4538 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
4539 | fi | |
4540 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
4541 | ac_c_werror_flag=$ac_save_c_werror_flag | |
4542 | fi | |
4543 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 | |
4544 | $as_echo "$ac_cv_prog_cc_g" >&6; } | |
4545 | if test "$ac_test_CFLAGS" = set; then | |
4546 | CFLAGS=$ac_save_CFLAGS | |
4547 | elif test $ac_cv_prog_cc_g = yes; then | |
4548 | if test "$GCC" = yes; then | |
4549 | CFLAGS="-g -O2" | |
4550 | else | |
4551 | CFLAGS="-g" | |
4552 | fi | |
4553 | else | |
4554 | if test "$GCC" = yes; then | |
4555 | CFLAGS="-O2" | |
4556 | else | |
4557 | CFLAGS= | |
4558 | fi | |
4559 | fi | |
c0c3707f CB |
4560 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 |
4561 | $as_echo_n "checking for $CC option to enable C11 features... " >&6; } | |
4562 | if ${ac_cv_prog_cc_c11+:} false; then : | |
c971b7fa PA |
4563 | $as_echo_n "(cached) " >&6 |
4564 | else | |
c0c3707f | 4565 | ac_cv_prog_cc_c11=no |
c971b7fa PA |
4566 | ac_save_CC=$CC |
4567 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4568 | /* end confdefs.h. */ | |
4569 | #include <stdarg.h> | |
c0c3707f CB |
4570 | #include <stdbool.h> |
4571 | #include <stddef.h> | |
4572 | #include <stdlib.h> | |
4573 | #include <wchar.h> | |
c971b7fa | 4574 | #include <stdio.h> |
c0c3707f CB |
4575 | |
4576 | // Check varargs macros. These examples are taken from C99 6.10.3.5. | |
4577 | #define debug(...) fprintf (stderr, __VA_ARGS__) | |
4578 | #define showlist(...) puts (#__VA_ARGS__) | |
4579 | #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) | |
4580 | static void | |
4581 | test_varargs_macros (void) | |
7a6dbc2f | 4582 | { |
c0c3707f CB |
4583 | int x = 1234; |
4584 | int y = 5678; | |
4585 | debug ("Flag"); | |
4586 | debug ("X = %d\n", x); | |
4587 | showlist (The first, second, and third items.); | |
4588 | report (x>y, "x is %d but y is %d", x, y); | |
c971b7fa | 4589 | } |
c0c3707f CB |
4590 | |
4591 | // Check long long types. | |
4592 | #define BIG64 18446744073709551615ull | |
4593 | #define BIG32 4294967295ul | |
4594 | #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) | |
4595 | #if !BIG_OK | |
4596 | your preprocessor is broken; | |
4597 | #endif | |
4598 | #if BIG_OK | |
4599 | #else | |
4600 | your preprocessor is broken; | |
4601 | #endif | |
4602 | static long long int bignum = -9223372036854775807LL; | |
4603 | static unsigned long long int ubignum = BIG64; | |
4604 | ||
4605 | struct incomplete_array | |
7a6dbc2f | 4606 | { |
c0c3707f CB |
4607 | int datasize; |
4608 | double data[]; | |
4609 | }; | |
4610 | ||
4611 | struct named_init { | |
4612 | int number; | |
4613 | const wchar_t *name; | |
4614 | double average; | |
4615 | }; | |
4616 | ||
4617 | typedef const char *ccp; | |
4618 | ||
4619 | static inline int | |
4620 | test_restrict (ccp restrict text) | |
4621 | { | |
4622 | // See if C++-style comments work. | |
4623 | // Iterate through items via the restricted pointer. | |
4624 | // Also check for declarations in for loops. | |
4625 | for (unsigned int i = 0; *(text+i) != '\0'; ++i) | |
4626 | continue; | |
4627 | return 0; | |
7a6dbc2f | 4628 | } |
7a6dbc2f | 4629 | |
c0c3707f CB |
4630 | // Check varargs and va_copy. |
4631 | static bool | |
4632 | test_varargs (const char *format, ...) | |
4633 | { | |
4634 | va_list args; | |
4635 | va_start (args, format); | |
4636 | va_list args_copy; | |
4637 | va_copy (args_copy, args); | |
7a6dbc2f | 4638 | |
c0c3707f CB |
4639 | const char *str = ""; |
4640 | int number = 0; | |
4641 | float fnumber = 0; | |
4642 | ||
4643 | while (*format) | |
4644 | { | |
4645 | switch (*format++) | |
4646 | { | |
4647 | case 's': // string | |
4648 | str = va_arg (args_copy, const char *); | |
4649 | break; | |
4650 | case 'd': // int | |
4651 | number = va_arg (args_copy, int); | |
4652 | break; | |
4653 | case 'f': // float | |
4654 | fnumber = va_arg (args_copy, double); | |
4655 | break; | |
4656 | default: | |
4657 | break; | |
4658 | } | |
4659 | } | |
4660 | va_end (args_copy); | |
4661 | va_end (args); | |
4662 | ||
4663 | return *str && number && fnumber; | |
4664 | } | |
4665 | // Check _Alignas. | |
4666 | char _Alignas (double) aligned_as_double; | |
4667 | char _Alignas (0) no_special_alignment; | |
4668 | extern char aligned_as_int; | |
4669 | char _Alignas (0) _Alignas (int) aligned_as_int; | |
4670 | ||
4671 | // Check _Alignof. | |
4672 | enum | |
4673 | { | |
4674 | int_alignment = _Alignof (int), | |
4675 | int_array_alignment = _Alignof (int[100]), | |
4676 | char_alignment = _Alignof (char) | |
4677 | }; | |
4678 | _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); | |
4679 | ||
4680 | // Check _Noreturn. | |
4681 | int _Noreturn does_not_return (void) { for (;;) continue; } | |
4682 | ||
4683 | // Check _Static_assert. | |
4684 | struct test_static_assert | |
4685 | { | |
4686 | int x; | |
4687 | _Static_assert (sizeof (int) <= sizeof (long int), | |
4688 | "_Static_assert does not work in struct"); | |
4689 | long int y; | |
4690 | }; | |
4691 | ||
4692 | // Check UTF-8 literals. | |
4693 | #define u8 syntax error! | |
4694 | char const utf8_literal[] = u8"happens to be ASCII" "another string"; | |
4695 | ||
4696 | // Check duplicate typedefs. | |
4697 | typedef long *long_ptr; | |
4698 | typedef long int *long_ptr; | |
4699 | typedef long_ptr long_ptr; | |
4700 | ||
4701 | // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. | |
4702 | struct anonymous | |
4703 | { | |
4704 | union { | |
4705 | struct { int i; int j; }; | |
4706 | struct { int k; long int l; } w; | |
4707 | }; | |
4708 | int m; | |
4709 | } v1; | |
c971b7fa | 4710 | |
c971b7fa PA |
4711 | int |
4712 | main () | |
4713 | { | |
c0c3707f CB |
4714 | |
4715 | // Check bool. | |
4716 | _Bool success = false; | |
4717 | ||
4718 | // Check restrict. | |
4719 | if (test_restrict ("String literal") == 0) | |
4720 | success = true; | |
4721 | char *restrict newvar = "Another string"; | |
4722 | ||
4723 | // Check varargs. | |
4724 | success &= test_varargs ("s, d' f .", "string", 65, 34.234); | |
4725 | test_varargs_macros (); | |
4726 | ||
4727 | // Check flexible array members. | |
4728 | struct incomplete_array *ia = | |
4729 | malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); | |
4730 | ia->datasize = 10; | |
4731 | for (int i = 0; i < ia->datasize; ++i) | |
4732 | ia->data[i] = i * 1.234; | |
4733 | ||
4734 | // Check named initializers. | |
4735 | struct named_init ni = { | |
4736 | .number = 34, | |
4737 | .name = L"Test wide string", | |
4738 | .average = 543.34343, | |
4739 | }; | |
4740 | ||
4741 | ni.number = 58; | |
4742 | ||
4743 | int dynamic_array[ni.number]; | |
4744 | dynamic_array[ni.number - 1] = 543; | |
4745 | ||
4746 | // work around unused variable warnings | |
4747 | return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' | |
4748 | || dynamic_array[ni.number - 1] != 543); | |
4749 | ||
4750 | v1.i = 2; | |
4751 | v1.w.k = 5; | |
4752 | _Static_assert ((offsetof (struct anonymous, i) | |
4753 | == offsetof (struct anonymous, w.k)), | |
4754 | "Anonymous union alignment botch"); | |
4755 | ||
c971b7fa PA |
4756 | ; |
4757 | return 0; | |
4758 | } | |
4759 | _ACEOF | |
c0c3707f | 4760 | for ac_arg in '' -std=gnu11 |
c971b7fa PA |
4761 | do |
4762 | CC="$ac_save_CC $ac_arg" | |
4763 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 4764 | ac_cv_prog_cc_c11=$ac_arg |
c971b7fa PA |
4765 | fi |
4766 | rm -f core conftest.err conftest.$ac_objext | |
c0c3707f | 4767 | test "x$ac_cv_prog_cc_c11" != "xno" && break |
c971b7fa PA |
4768 | done |
4769 | rm -f conftest.$ac_ext | |
4770 | CC=$ac_save_CC | |
4771 | ||
4772 | fi | |
4773 | # AC_CACHE_VAL | |
c0c3707f CB |
4774 | ac_prog_cc_stdc_options= |
4775 | case "x$ac_cv_prog_cc_c11" in | |
c971b7fa PA |
4776 | x) |
4777 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 | |
4778 | $as_echo "none needed" >&6; } ;; | |
4779 | xno) | |
4780 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 | |
4781 | $as_echo "unsupported" >&6; } ;; | |
4782 | *) | |
c0c3707f CB |
4783 | ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c11" |
4784 | CC=$CC$ac_prog_cc_stdc_options | |
4785 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 | |
4786 | $as_echo "$ac_cv_prog_cc_c11" >&6; } ;; | |
c971b7fa | 4787 | esac |
c0c3707f CB |
4788 | if test "x$ac_cv_prog_cc_c11" != xno; then : |
4789 | ac_prog_cc_stdc=c11 | |
4790 | ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 | |
4791 | else | |
4792 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 | |
4793 | $as_echo_n "checking for $CC option to enable C99 features... " >&6; } | |
4794 | if ${ac_cv_prog_cc_c99+:} false; then : | |
4795 | $as_echo_n "(cached) " >&6 | |
4796 | else | |
4797 | ac_cv_prog_cc_c99=no | |
4798 | ac_save_CC=$CC | |
4799 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
4800 | /* end confdefs.h. */ | |
4801 | #include <stdarg.h> | |
4802 | #include <stdbool.h> | |
4803 | #include <stddef.h> | |
4804 | #include <stdlib.h> | |
4805 | #include <wchar.h> | |
4806 | #include <stdio.h> | |
7a6dbc2f | 4807 | |
c0c3707f CB |
4808 | // Check varargs macros. These examples are taken from C99 6.10.3.5. |
4809 | #define debug(...) fprintf (stderr, __VA_ARGS__) | |
4810 | #define showlist(...) puts (#__VA_ARGS__) | |
4811 | #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) | |
4812 | static void | |
4813 | test_varargs_macros (void) | |
4814 | { | |
4815 | int x = 1234; | |
4816 | int y = 5678; | |
4817 | debug ("Flag"); | |
4818 | debug ("X = %d\n", x); | |
4819 | showlist (The first, second, and third items.); | |
4820 | report (x>y, "x is %d but y is %d", x, y); | |
4821 | } | |
7a6dbc2f | 4822 | |
c0c3707f CB |
4823 | // Check long long types. |
4824 | #define BIG64 18446744073709551615ull | |
4825 | #define BIG32 4294967295ul | |
4826 | #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) | |
4827 | #if !BIG_OK | |
4828 | your preprocessor is broken; | |
4829 | #endif | |
4830 | #if BIG_OK | |
4831 | #else | |
4832 | your preprocessor is broken; | |
4833 | #endif | |
4834 | static long long int bignum = -9223372036854775807LL; | |
4835 | static unsigned long long int ubignum = BIG64; | |
7a6dbc2f | 4836 | |
c0c3707f CB |
4837 | struct incomplete_array |
4838 | { | |
4839 | int datasize; | |
4840 | double data[]; | |
4841 | }; | |
7a6dbc2f | 4842 | |
c0c3707f CB |
4843 | struct named_init { |
4844 | int number; | |
4845 | const wchar_t *name; | |
4846 | double average; | |
4847 | }; | |
7a6dbc2f | 4848 | |
c0c3707f | 4849 | typedef const char *ccp; |
7a6dbc2f | 4850 | |
c0c3707f CB |
4851 | static inline int |
4852 | test_restrict (ccp restrict text) | |
4853 | { | |
4854 | // See if C++-style comments work. | |
4855 | // Iterate through items via the restricted pointer. | |
4856 | // Also check for declarations in for loops. | |
4857 | for (unsigned int i = 0; *(text+i) != '\0'; ++i) | |
4858 | continue; | |
4859 | return 0; | |
4860 | } | |
7a6dbc2f | 4861 | |
c0c3707f CB |
4862 | // Check varargs and va_copy. |
4863 | static bool | |
4864 | test_varargs (const char *format, ...) | |
4865 | { | |
4866 | va_list args; | |
4867 | va_start (args, format); | |
4868 | va_list args_copy; | |
4869 | va_copy (args_copy, args); | |
4870 | ||
4871 | const char *str = ""; | |
4872 | int number = 0; | |
4873 | float fnumber = 0; | |
4874 | ||
4875 | while (*format) | |
4876 | { | |
4877 | switch (*format++) | |
4878 | { | |
4879 | case 's': // string | |
4880 | str = va_arg (args_copy, const char *); | |
4881 | break; | |
4882 | case 'd': // int | |
4883 | number = va_arg (args_copy, int); | |
4884 | break; | |
4885 | case 'f': // float | |
4886 | fnumber = va_arg (args_copy, double); | |
4887 | break; | |
4888 | default: | |
4889 | break; | |
4890 | } | |
4891 | } | |
4892 | va_end (args_copy); | |
4893 | va_end (args); | |
4894 | ||
4895 | return *str && number && fnumber; | |
4896 | } | |
4897 | int | |
4898 | main () | |
4899 | { | |
4900 | ||
4901 | // Check bool. | |
4902 | _Bool success = false; | |
4903 | ||
4904 | // Check restrict. | |
4905 | if (test_restrict ("String literal") == 0) | |
4906 | success = true; | |
4907 | char *restrict newvar = "Another string"; | |
4908 | ||
4909 | // Check varargs. | |
4910 | success &= test_varargs ("s, d' f .", "string", 65, 34.234); | |
4911 | test_varargs_macros (); | |
4912 | ||
4913 | // Check flexible array members. | |
4914 | struct incomplete_array *ia = | |
4915 | malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); | |
4916 | ia->datasize = 10; | |
4917 | for (int i = 0; i < ia->datasize; ++i) | |
4918 | ia->data[i] = i * 1.234; | |
4919 | ||
4920 | // Check named initializers. | |
4921 | struct named_init ni = { | |
4922 | .number = 34, | |
4923 | .name = L"Test wide string", | |
4924 | .average = 543.34343, | |
4925 | }; | |
4926 | ||
4927 | ni.number = 58; | |
4928 | ||
4929 | int dynamic_array[ni.number]; | |
4930 | dynamic_array[ni.number - 1] = 543; | |
4931 | ||
4932 | // work around unused variable warnings | |
4933 | return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' | |
4934 | || dynamic_array[ni.number - 1] != 543); | |
4935 | ||
4936 | ; | |
4937 | return 0; | |
4938 | } | |
4939 | _ACEOF | |
4940 | for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99 | |
4941 | do | |
4942 | CC="$ac_save_CC $ac_arg" | |
4943 | if ac_fn_c_try_compile "$LINENO"; then : | |
4944 | ac_cv_prog_cc_c99=$ac_arg | |
4945 | fi | |
4946 | rm -f core conftest.err conftest.$ac_objext | |
4947 | test "x$ac_cv_prog_cc_c99" != "xno" && break | |
4948 | done | |
4949 | rm -f conftest.$ac_ext | |
4950 | CC=$ac_save_CC | |
4951 | ||
4952 | fi | |
4953 | # AC_CACHE_VAL | |
4954 | ac_prog_cc_stdc_options= | |
4955 | case "x$ac_cv_prog_cc_c99" in | |
4956 | x) | |
4957 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 | |
4958 | $as_echo "none needed" >&6; } ;; | |
4959 | xno) | |
4960 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 | |
4961 | $as_echo "unsupported" >&6; } ;; | |
4962 | *) | |
4963 | ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c99" | |
4964 | CC=$CC$ac_prog_cc_stdc_options | |
4965 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 | |
4966 | $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; | |
4967 | esac | |
4968 | if test "x$ac_cv_prog_cc_c99" != xno; then : | |
4969 | ac_prog_cc_stdc=c99 | |
4970 | ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 | |
4971 | else | |
4972 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 | |
4973 | $as_echo_n "checking for $CC option to enable C89 features... " >&6; } | |
4974 | if ${ac_cv_prog_cc_c89+:} false; then : | |
d0ac1c44 SM |
4975 | $as_echo_n "(cached) " >&6 |
4976 | else | |
c0c3707f CB |
4977 | ac_cv_prog_cc_c89=no |
4978 | ac_save_CC=$CC | |
4979 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
d0ac1c44 | 4980 | /* end confdefs.h. */ |
c0c3707f CB |
4981 | #include <stdarg.h> |
4982 | #include <stdio.h> | |
4983 | struct stat; | |
4984 | /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ | |
4985 | struct buf { int x; }; | |
4986 | FILE * (*rcsopen) (struct buf *, struct stat *, int); | |
4987 | static char *e (p, i) | |
4988 | char **p; | |
4989 | int i; | |
4990 | { | |
4991 | return p[i]; | |
4992 | } | |
4993 | static char *f (char * (*g) (char **, int), char **p, ...) | |
4994 | { | |
4995 | char *s; | |
4996 | va_list v; | |
4997 | va_start (v,p); | |
4998 | s = g (p, va_arg (v,int)); | |
4999 | va_end (v); | |
5000 | return s; | |
5001 | } | |
5002 | ||
5003 | /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has | |
5004 | function prototypes and stuff, but not '\xHH' hex character constants. | |
5005 | These don't provoke an error unfortunately, instead are silently treated | |
5006 | as 'x'. The following induces an error, until -std is added to get | |
5007 | proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an | |
5008 | array size at least. It's necessary to write '\x00'==0 to get something | |
5009 | that's true only with -std. */ | |
5010 | int osf4_cc_array ['\x00' == 0 ? 1 : -1]; | |
5011 | ||
5012 | /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters | |
5013 | inside strings and character constants. */ | |
5014 | #define FOO(x) 'x' | |
5015 | int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; | |
d0ac1c44 | 5016 | |
c0c3707f CB |
5017 | int test (int i, double x); |
5018 | struct s1 {int (*f) (int a);}; | |
5019 | struct s2 {int (*f) (double a);}; | |
5020 | int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); | |
5021 | int argc; | |
5022 | char **argv; | |
d0ac1c44 SM |
5023 | int |
5024 | main () | |
5025 | { | |
c0c3707f | 5026 | return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; |
d0ac1c44 SM |
5027 | ; |
5028 | return 0; | |
5029 | } | |
5030 | _ACEOF | |
c0c3707f CB |
5031 | for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ |
5032 | -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" | |
5033 | do | |
5034 | CC="$ac_save_CC $ac_arg" | |
5035 | if ac_fn_c_try_compile "$LINENO"; then : | |
5036 | ac_cv_prog_cc_c89=$ac_arg | |
5037 | fi | |
5038 | rm -f core conftest.err conftest.$ac_objext | |
5039 | test "x$ac_cv_prog_cc_c89" != "xno" && break | |
5040 | done | |
5041 | rm -f conftest.$ac_ext | |
5042 | CC=$ac_save_CC | |
5043 | ||
5044 | fi | |
5045 | # AC_CACHE_VAL | |
5046 | ac_prog_cc_stdc_options= | |
5047 | case "x$ac_cv_prog_cc_c89" in | |
5048 | x) | |
5049 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 | |
5050 | $as_echo "none needed" >&6; } ;; | |
5051 | xno) | |
5052 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 | |
5053 | $as_echo "unsupported" >&6; } ;; | |
5054 | *) | |
5055 | ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c89" | |
5056 | CC=$CC$ac_prog_cc_stdc_options | |
5057 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 | |
5058 | $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; | |
5059 | esac | |
5060 | if test "x$ac_cv_prog_cc_c89" != xno; then : | |
5061 | ac_prog_cc_stdc=c89 | |
5062 | ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 | |
5063 | else | |
5064 | ac_prog_cc_stdc=no | |
5065 | ac_cv_prog_cc_stdc=no | |
5066 | fi | |
5067 | ||
5068 | fi | |
5069 | ||
7a6dbc2f | 5070 | fi |
c0c3707f | 5071 | |
d0ac1c44 SM |
5072 | ac_ext=c |
5073 | ac_cpp='$CPP $CPPFLAGS' | |
5074 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
5075 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
5076 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
5077 | ||
5078 | ||
5df4cba6 SM |
5079 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5 |
5080 | $as_echo_n "checking whether the compiler is clang... " >&6; } | |
5081 | if ${gl_cv_compiler_clang+:} false; then : | |
5082 | $as_echo_n "(cached) " >&6 | |
5083 | else | |
5084 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5085 | /* end confdefs.h. */ | |
5086 | ||
5087 | #ifdef __clang__ | |
5088 | barfbarf | |
5089 | #endif | |
5090 | ||
5091 | int | |
5092 | main () | |
5093 | { | |
5094 | ||
5095 | ; | |
5096 | return 0; | |
5097 | } | |
5098 | ||
5099 | _ACEOF | |
5100 | if ac_fn_c_try_compile "$LINENO"; then : | |
5101 | gl_cv_compiler_clang=no | |
5102 | else | |
5103 | gl_cv_compiler_clang=yes | |
5104 | fi | |
5105 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5106 | ||
5107 | fi | |
5108 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_clang" >&5 | |
5109 | $as_echo "$gl_cv_compiler_clang" >&6; } | |
5110 | ||
5111 | ||
5112 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler option needed when checking for declarations" >&5 | |
5113 | $as_echo_n "checking for compiler option needed when checking for declarations... " >&6; } | |
5114 | if ${gl_cv_compiler_check_decl_option+:} false; then : | |
5115 | $as_echo_n "(cached) " >&6 | |
5116 | else | |
5117 | if test $gl_cv_compiler_clang = yes; then | |
5118 | save_ac_compile="$ac_compile" | |
5119 | ac_compile="$ac_compile -Werror=implicit-function-declaration" | |
5120 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5121 | /* end confdefs.h. */ | |
5122 | ||
5123 | int | |
5124 | main () | |
5125 | { | |
5126 | ||
5127 | ; | |
5128 | return 0; | |
5129 | } | |
5130 | _ACEOF | |
5131 | if ac_fn_c_try_compile "$LINENO"; then : | |
5132 | gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration' | |
5133 | else | |
5134 | gl_cv_compiler_check_decl_option=none | |
5135 | fi | |
5136 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5137 | ac_compile="$save_ac_compile" | |
5138 | else | |
5139 | gl_cv_compiler_check_decl_option=none | |
5140 | fi | |
5141 | ||
5142 | fi | |
5143 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_check_decl_option" >&5 | |
5144 | $as_echo "$gl_cv_compiler_check_decl_option" >&6; } | |
5145 | if test "x$gl_cv_compiler_check_decl_option" != xnone; then | |
5146 | ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option" | |
5147 | else | |
5148 | ac_compile_for_check_decl="$ac_compile" | |
5149 | fi | |
5150 | ||
5151 | ||
5152 | ||
c971b7fa PA |
5153 | ac_ext=c |
5154 | ac_cpp='$CPP $CPPFLAGS' | |
5155 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
5156 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
5157 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
5158 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 | |
5159 | $as_echo_n "checking how to run the C preprocessor... " >&6; } | |
5160 | # On Suns, sometimes $CPP names a directory. | |
5161 | if test -n "$CPP" && test -d "$CPP"; then | |
5162 | CPP= | |
5163 | fi | |
5164 | if test -z "$CPP"; then | |
d0ac1c44 | 5165 | if ${ac_cv_prog_CPP+:} false; then : |
c971b7fa PA |
5166 | $as_echo_n "(cached) " >&6 |
5167 | else | |
5168 | # Double quotes because CPP needs to be expanded | |
5169 | for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" | |
5170 | do | |
5171 | ac_preproc_ok=false | |
5172 | for ac_c_preproc_warn_flag in '' yes | |
5173 | do | |
5174 | # Use a header file that comes with gcc, so configuring glibc | |
5175 | # with a fresh cross-compiler works. | |
5176 | # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since | |
5177 | # <limits.h> exists even on freestanding compilers. | |
5178 | # On the NeXT, cc -E runs the code through the compiler's parser, | |
5179 | # not just through cpp. "Syntax error" is here to catch this case. | |
5180 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5181 | /* end confdefs.h. */ | |
5182 | #ifdef __STDC__ | |
5183 | # include <limits.h> | |
5184 | #else | |
5185 | # include <assert.h> | |
5186 | #endif | |
5187 | Syntax error | |
5188 | _ACEOF | |
5189 | if ac_fn_c_try_cpp "$LINENO"; then : | |
5190 | ||
5191 | else | |
5192 | # Broken: fails on valid input. | |
5193 | continue | |
5194 | fi | |
d0ac1c44 | 5195 | rm -f conftest.err conftest.i conftest.$ac_ext |
c971b7fa PA |
5196 | |
5197 | # OK, works on sane cases. Now check whether nonexistent headers | |
5198 | # can be detected and how. | |
5199 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5200 | /* end confdefs.h. */ | |
5201 | #include <ac_nonexistent.h> | |
5202 | _ACEOF | |
5203 | if ac_fn_c_try_cpp "$LINENO"; then : | |
5204 | # Broken: success on invalid input. | |
5205 | continue | |
5206 | else | |
5207 | # Passes both tests. | |
5208 | ac_preproc_ok=: | |
5209 | break | |
5210 | fi | |
d0ac1c44 | 5211 | rm -f conftest.err conftest.i conftest.$ac_ext |
c971b7fa PA |
5212 | |
5213 | done | |
5214 | # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. | |
d0ac1c44 | 5215 | rm -f conftest.i conftest.err conftest.$ac_ext |
c971b7fa PA |
5216 | if $ac_preproc_ok; then : |
5217 | break | |
5218 | fi | |
5219 | ||
5220 | done | |
5221 | ac_cv_prog_CPP=$CPP | |
5222 | ||
5223 | fi | |
5224 | CPP=$ac_cv_prog_CPP | |
5225 | else | |
5226 | ac_cv_prog_CPP=$CPP | |
5227 | fi | |
5228 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 | |
5229 | $as_echo "$CPP" >&6; } | |
5230 | ac_preproc_ok=false | |
5231 | for ac_c_preproc_warn_flag in '' yes | |
5232 | do | |
5233 | # Use a header file that comes with gcc, so configuring glibc | |
5234 | # with a fresh cross-compiler works. | |
5235 | # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since | |
5236 | # <limits.h> exists even on freestanding compilers. | |
5237 | # On the NeXT, cc -E runs the code through the compiler's parser, | |
5238 | # not just through cpp. "Syntax error" is here to catch this case. | |
5239 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5240 | /* end confdefs.h. */ | |
5241 | #ifdef __STDC__ | |
5242 | # include <limits.h> | |
5243 | #else | |
5244 | # include <assert.h> | |
5245 | #endif | |
5246 | Syntax error | |
5247 | _ACEOF | |
5248 | if ac_fn_c_try_cpp "$LINENO"; then : | |
5249 | ||
5250 | else | |
5251 | # Broken: fails on valid input. | |
5252 | continue | |
5253 | fi | |
d0ac1c44 | 5254 | rm -f conftest.err conftest.i conftest.$ac_ext |
c971b7fa PA |
5255 | |
5256 | # OK, works on sane cases. Now check whether nonexistent headers | |
5257 | # can be detected and how. | |
5258 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5259 | /* end confdefs.h. */ | |
5260 | #include <ac_nonexistent.h> | |
5261 | _ACEOF | |
5262 | if ac_fn_c_try_cpp "$LINENO"; then : | |
5263 | # Broken: success on invalid input. | |
5264 | continue | |
5265 | else | |
5266 | # Passes both tests. | |
5267 | ac_preproc_ok=: | |
5268 | break | |
5269 | fi | |
d0ac1c44 | 5270 | rm -f conftest.err conftest.i conftest.$ac_ext |
c971b7fa PA |
5271 | |
5272 | done | |
5273 | # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. | |
d0ac1c44 | 5274 | rm -f conftest.i conftest.err conftest.$ac_ext |
c971b7fa PA |
5275 | if $ac_preproc_ok; then : |
5276 | ||
5277 | else | |
5278 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | |
5279 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | |
d0ac1c44 SM |
5280 | as_fn_error $? "C preprocessor \"$CPP\" fails sanity check |
5281 | See \`config.log' for more details" "$LINENO" 5; } | |
c971b7fa PA |
5282 | fi |
5283 | ||
5284 | ac_ext=c | |
5285 | ac_cpp='$CPP $CPPFLAGS' | |
5286 | ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |
5287 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | |
5288 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
5289 | ||
5290 | ||
5291 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 | |
5292 | $as_echo_n "checking for grep that handles long lines and -e... " >&6; } | |
d0ac1c44 | 5293 | if ${ac_cv_path_GREP+:} false; then : |
c971b7fa PA |
5294 | $as_echo_n "(cached) " >&6 |
5295 | else | |
5296 | if test -z "$GREP"; then | |
5297 | ac_path_GREP_found=false | |
5298 | # Loop through the user's path and test for each of PROGNAME-LIST | |
5299 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
5300 | for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin | |
5301 | do | |
5302 | IFS=$as_save_IFS | |
5303 | test -z "$as_dir" && as_dir=. | |
5304 | for ac_prog in grep ggrep; do | |
5305 | for ac_exec_ext in '' $ac_executable_extensions; do | |
5306 | ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" | |
d0ac1c44 | 5307 | as_fn_executable_p "$ac_path_GREP" || continue |
c971b7fa PA |
5308 | # Check for GNU ac_path_GREP and select it if it is found. |
5309 | # Check for GNU $ac_path_GREP | |
5310 | case `"$ac_path_GREP" --version 2>&1` in | |
5311 | *GNU*) | |
5312 | ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; | |
5313 | *) | |
5314 | ac_count=0 | |
5315 | $as_echo_n 0123456789 >"conftest.in" | |
5316 | while : | |
5317 | do | |
5318 | cat "conftest.in" "conftest.in" >"conftest.tmp" | |
5319 | mv "conftest.tmp" "conftest.in" | |
5320 | cp "conftest.in" "conftest.nl" | |
5321 | $as_echo 'GREP' >> "conftest.nl" | |
5322 | "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break | |
5323 | diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break | |
5324 | as_fn_arith $ac_count + 1 && ac_count=$as_val | |
5325 | if test $ac_count -gt ${ac_path_GREP_max-0}; then | |
5326 | # Best one so far, save it but keep looking for a better one | |
5327 | ac_cv_path_GREP="$ac_path_GREP" | |
5328 | ac_path_GREP_max=$ac_count | |
5329 | fi | |
5330 | # 10*(2^10) chars as input seems more than enough | |
5331 | test $ac_count -gt 10 && break | |
5332 | done | |
5333 | rm -f conftest.in conftest.tmp conftest.nl conftest.out;; | |
5334 | esac | |
5335 | ||
5336 | $ac_path_GREP_found && break 3 | |
5337 | done | |
5338 | done | |
5339 | done | |
5340 | IFS=$as_save_IFS | |
5341 | if test -z "$ac_cv_path_GREP"; then | |
d0ac1c44 | 5342 | as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 |
c971b7fa PA |
5343 | fi |
5344 | else | |
5345 | ac_cv_path_GREP=$GREP | |
5346 | fi | |
5347 | ||
5348 | fi | |
5349 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 | |
5350 | $as_echo "$ac_cv_path_GREP" >&6; } | |
5351 | GREP="$ac_cv_path_GREP" | |
5352 | ||
5353 | ||
5354 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 | |
5355 | $as_echo_n "checking for egrep... " >&6; } | |
d0ac1c44 | 5356 | if ${ac_cv_path_EGREP+:} false; then : |
c971b7fa PA |
5357 | $as_echo_n "(cached) " >&6 |
5358 | else | |
5359 | if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 | |
5360 | then ac_cv_path_EGREP="$GREP -E" | |
5361 | else | |
5362 | if test -z "$EGREP"; then | |
5363 | ac_path_EGREP_found=false | |
5364 | # Loop through the user's path and test for each of PROGNAME-LIST | |
5365 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
5366 | for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin | |
5367 | do | |
5368 | IFS=$as_save_IFS | |
5369 | test -z "$as_dir" && as_dir=. | |
5370 | for ac_prog in egrep; do | |
5371 | for ac_exec_ext in '' $ac_executable_extensions; do | |
5372 | ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" | |
d0ac1c44 | 5373 | as_fn_executable_p "$ac_path_EGREP" || continue |
c971b7fa PA |
5374 | # Check for GNU ac_path_EGREP and select it if it is found. |
5375 | # Check for GNU $ac_path_EGREP | |
5376 | case `"$ac_path_EGREP" --version 2>&1` in | |
5377 | *GNU*) | |
5378 | ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; | |
5379 | *) | |
5380 | ac_count=0 | |
5381 | $as_echo_n 0123456789 >"conftest.in" | |
5382 | while : | |
5383 | do | |
5384 | cat "conftest.in" "conftest.in" >"conftest.tmp" | |
5385 | mv "conftest.tmp" "conftest.in" | |
5386 | cp "conftest.in" "conftest.nl" | |
5387 | $as_echo 'EGREP' >> "conftest.nl" | |
5388 | "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break | |
5389 | diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break | |
5390 | as_fn_arith $ac_count + 1 && ac_count=$as_val | |
5391 | if test $ac_count -gt ${ac_path_EGREP_max-0}; then | |
5392 | # Best one so far, save it but keep looking for a better one | |
5393 | ac_cv_path_EGREP="$ac_path_EGREP" | |
5394 | ac_path_EGREP_max=$ac_count | |
5395 | fi | |
5396 | # 10*(2^10) chars as input seems more than enough | |
5397 | test $ac_count -gt 10 && break | |
5398 | done | |
5399 | rm -f conftest.in conftest.tmp conftest.nl conftest.out;; | |
5400 | esac | |
5401 | ||
5402 | $ac_path_EGREP_found && break 3 | |
5403 | done | |
5404 | done | |
5405 | done | |
5406 | IFS=$as_save_IFS | |
5407 | if test -z "$ac_cv_path_EGREP"; then | |
d0ac1c44 | 5408 | as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 |
c971b7fa PA |
5409 | fi |
5410 | else | |
5411 | ac_cv_path_EGREP=$EGREP | |
5412 | fi | |
5413 | ||
5414 | fi | |
5415 | fi | |
5416 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 | |
5417 | $as_echo "$ac_cv_path_EGREP" >&6; } | |
5418 | EGREP="$ac_cv_path_EGREP" | |
5419 | ||
5420 | ||
5421 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 | |
5422 | $as_echo_n "checking for ANSI C header files... " >&6; } | |
d0ac1c44 | 5423 | if ${ac_cv_header_stdc+:} false; then : |
c971b7fa PA |
5424 | $as_echo_n "(cached) " >&6 |
5425 | else | |
5426 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5427 | /* end confdefs.h. */ | |
5428 | #include <stdlib.h> | |
5429 | #include <stdarg.h> | |
5430 | #include <string.h> | |
5431 | #include <float.h> | |
5432 | ||
5433 | int | |
5434 | main () | |
5435 | { | |
5436 | ||
5437 | ; | |
5438 | return 0; | |
5439 | } | |
5440 | _ACEOF | |
5441 | if ac_fn_c_try_compile "$LINENO"; then : | |
5442 | ac_cv_header_stdc=yes | |
5443 | else | |
5444 | ac_cv_header_stdc=no | |
5445 | fi | |
5446 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5447 | ||
5448 | if test $ac_cv_header_stdc = yes; then | |
5449 | # SunOS 4.x string.h does not declare mem*, contrary to ANSI. | |
5450 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5451 | /* end confdefs.h. */ | |
5452 | #include <string.h> | |
5453 | ||
5454 | _ACEOF | |
5455 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
5456 | $EGREP "memchr" >/dev/null 2>&1; then : | |
5457 | ||
5458 | else | |
5459 | ac_cv_header_stdc=no | |
5460 | fi | |
5461 | rm -f conftest* | |
5462 | ||
5463 | fi | |
5464 | ||
5465 | if test $ac_cv_header_stdc = yes; then | |
5466 | # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. | |
5467 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5468 | /* end confdefs.h. */ | |
5469 | #include <stdlib.h> | |
5470 | ||
5471 | _ACEOF | |
5472 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
5473 | $EGREP "free" >/dev/null 2>&1; then : | |
5474 | ||
5475 | else | |
5476 | ac_cv_header_stdc=no | |
5477 | fi | |
5478 | rm -f conftest* | |
5479 | ||
5480 | fi | |
5481 | ||
5482 | if test $ac_cv_header_stdc = yes; then | |
5483 | # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. | |
5484 | if test "$cross_compiling" = yes; then : | |
5485 | : | |
5486 | else | |
5487 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5488 | /* end confdefs.h. */ | |
5489 | #include <ctype.h> | |
5490 | #include <stdlib.h> | |
5491 | #if ((' ' & 0x0FF) == 0x020) | |
5492 | # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') | |
5493 | # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) | |
5494 | #else | |
5495 | # define ISLOWER(c) \ | |
5496 | (('a' <= (c) && (c) <= 'i') \ | |
5497 | || ('j' <= (c) && (c) <= 'r') \ | |
5498 | || ('s' <= (c) && (c) <= 'z')) | |
5499 | # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) | |
5500 | #endif | |
5501 | ||
5502 | #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) | |
5503 | int | |
5504 | main () | |
5505 | { | |
5506 | int i; | |
5507 | for (i = 0; i < 256; i++) | |
5508 | if (XOR (islower (i), ISLOWER (i)) | |
5509 | || toupper (i) != TOUPPER (i)) | |
5510 | return 2; | |
5511 | return 0; | |
5512 | } | |
5513 | _ACEOF | |
5514 | if ac_fn_c_try_run "$LINENO"; then : | |
5515 | ||
5516 | else | |
5517 | ac_cv_header_stdc=no | |
5518 | fi | |
5519 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
5520 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
5521 | fi | |
5522 | ||
5523 | fi | |
5524 | fi | |
5525 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 | |
5526 | $as_echo "$ac_cv_header_stdc" >&6; } | |
5527 | if test $ac_cv_header_stdc = yes; then | |
5528 | ||
5529 | $as_echo "#define STDC_HEADERS 1" >>confdefs.h | |
5530 | ||
5531 | fi | |
5532 | ||
5533 | # On IRIX 5.3, sys/types and inttypes.h are conflicting. | |
5534 | for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ | |
5535 | inttypes.h stdint.h unistd.h | |
5536 | do : | |
5537 | as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` | |
5538 | ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default | |
5539 | " | |
d0ac1c44 | 5540 | if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : |
c971b7fa PA |
5541 | cat >>confdefs.h <<_ACEOF |
5542 | #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 | |
5543 | _ACEOF | |
5544 | ||
5545 | fi | |
5546 | ||
5547 | done | |
5548 | ||
5549 | ||
5550 | ||
c971b7fa | 5551 | ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" |
d0ac1c44 | 5552 | if test "x$ac_cv_header_minix_config_h" = xyes; then : |
c971b7fa PA |
5553 | MINIX=yes |
5554 | else | |
5555 | MINIX= | |
5556 | fi | |
5557 | ||
5558 | ||
5559 | if test "$MINIX" = yes; then | |
5560 | ||
5561 | $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h | |
5562 | ||
5563 | ||
5564 | $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h | |
5565 | ||
5566 | ||
5567 | $as_echo "#define _MINIX 1" >>confdefs.h | |
5568 | ||
c971b7fa | 5569 | |
4a626d0a | 5570 | $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h |
c971b7fa | 5571 | |
4a626d0a | 5572 | fi |
c971b7fa PA |
5573 | |
5574 | ||
5575 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 | |
5576 | $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } | |
d0ac1c44 | 5577 | if ${ac_cv_safe_to_define___extensions__+:} false; then : |
c971b7fa PA |
5578 | $as_echo_n "(cached) " >&6 |
5579 | else | |
5580 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5581 | /* end confdefs.h. */ | |
5582 | ||
5583 | # define __EXTENSIONS__ 1 | |
5584 | $ac_includes_default | |
5585 | int | |
5586 | main () | |
5587 | { | |
5588 | ||
5589 | ; | |
5590 | return 0; | |
5591 | } | |
5592 | _ACEOF | |
5593 | if ac_fn_c_try_compile "$LINENO"; then : | |
5594 | ac_cv_safe_to_define___extensions__=yes | |
5595 | else | |
5596 | ac_cv_safe_to_define___extensions__=no | |
5597 | fi | |
5598 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5599 | fi | |
5600 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 | |
5601 | $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } | |
5602 | test $ac_cv_safe_to_define___extensions__ = yes && | |
5603 | $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h | |
5604 | ||
5605 | $as_echo "#define _ALL_SOURCE 1" >>confdefs.h | |
5606 | ||
5607 | $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h | |
5608 | ||
5609 | $as_echo "#define _GNU_SOURCE 1" >>confdefs.h | |
5610 | ||
c0c3707f CB |
5611 | $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h |
5612 | ||
5613 | $as_echo "#define _OPENBSD_SOURCE 1" >>confdefs.h | |
5614 | ||
c971b7fa PA |
5615 | $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h |
5616 | ||
49e4877c PA |
5617 | $as_echo "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h |
5618 | ||
5619 | $as_echo "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h | |
5620 | ||
5621 | $as_echo "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h | |
5622 | ||
5623 | $as_echo "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h | |
5624 | ||
5625 | $as_echo "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h | |
5626 | ||
5627 | $as_echo "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h | |
5628 | ||
5629 | $as_echo "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h | |
5630 | ||
c971b7fa PA |
5631 | $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h |
5632 | ||
4a626d0a PA |
5633 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 |
5634 | $as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; } | |
d0ac1c44 | 5635 | if ${ac_cv_should_define__xopen_source+:} false; then : |
4a626d0a PA |
5636 | $as_echo_n "(cached) " >&6 |
5637 | else | |
5638 | ac_cv_should_define__xopen_source=no | |
5639 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5640 | /* end confdefs.h. */ | |
5641 | ||
5642 | #include <wchar.h> | |
5643 | mbstate_t x; | |
5644 | int | |
5645 | main () | |
5646 | { | |
5647 | ||
5648 | ; | |
5649 | return 0; | |
5650 | } | |
5651 | _ACEOF | |
5652 | if ac_fn_c_try_compile "$LINENO"; then : | |
5653 | ||
5654 | else | |
5655 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5656 | /* end confdefs.h. */ | |
5657 | ||
5658 | #define _XOPEN_SOURCE 500 | |
5659 | #include <wchar.h> | |
5660 | mbstate_t x; | |
5661 | int | |
5662 | main () | |
5663 | { | |
5664 | ||
5665 | ; | |
5666 | return 0; | |
5667 | } | |
5668 | _ACEOF | |
5669 | if ac_fn_c_try_compile "$LINENO"; then : | |
5670 | ac_cv_should_define__xopen_source=yes | |
5671 | fi | |
d0ac1c44 SM |
5672 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
5673 | fi | |
5674 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5675 | fi | |
5676 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 | |
5677 | $as_echo "$ac_cv_should_define__xopen_source" >&6; } | |
5678 | test $ac_cv_should_define__xopen_source = yes && | |
5679 | $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h | |
5680 | ||
c0c3707f CB |
5681 | $as_echo "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h |
5682 | ||
d0ac1c44 | 5683 | |
c8693053 RO |
5684 | # Needs to run before gl_EARLY so it can override AC_SYS_LARGEFILE included |
5685 | # there. | |
c0c3707f CB |
5686 | ac_aux_dir= |
5687 | for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do | |
5688 | if test -f "$ac_dir/install-sh"; then | |
5689 | ac_aux_dir=$ac_dir | |
5690 | ac_install_sh="$ac_aux_dir/install-sh -c" | |
5691 | break | |
5692 | elif test -f "$ac_dir/install.sh"; then | |
5693 | ac_aux_dir=$ac_dir | |
5694 | ac_install_sh="$ac_aux_dir/install.sh -c" | |
5695 | break | |
5696 | elif test -f "$ac_dir/shtool"; then | |
5697 | ac_aux_dir=$ac_dir | |
5698 | ac_install_sh="$ac_aux_dir/shtool install -c" | |
5699 | break | |
5700 | fi | |
5701 | done | |
5702 | if test -z "$ac_aux_dir"; then | |
5703 | as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 | |
5704 | fi | |
5705 | ||
5706 | # These three variables are undocumented and unsupported, | |
5707 | # and are intended to be withdrawn in a future Autoconf release. | |
5708 | # They can cause serious problems if a builder's source tree is in a directory | |
5709 | # whose full name contains unusual characters. | |
5710 | ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. | |
5711 | ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. | |
5712 | ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. | |
5713 | ||
5714 | ||
4a626d0a PA |
5715 | # Make sure we can run config.sub. |
5716 | $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || | |
d0ac1c44 | 5717 | as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 |
4a626d0a PA |
5718 | |
5719 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 | |
5720 | $as_echo_n "checking build system type... " >&6; } | |
d0ac1c44 | 5721 | if ${ac_cv_build+:} false; then : |
4a626d0a PA |
5722 | $as_echo_n "(cached) " >&6 |
5723 | else | |
5724 | ac_build_alias=$build_alias | |
5725 | test "x$ac_build_alias" = x && | |
5726 | ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` | |
5727 | test "x$ac_build_alias" = x && | |
d0ac1c44 | 5728 | as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 |
4a626d0a | 5729 | ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || |
d0ac1c44 | 5730 | as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 |
4a626d0a PA |
5731 | |
5732 | fi | |
5733 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 | |
5734 | $as_echo "$ac_cv_build" >&6; } | |
5735 | case $ac_cv_build in | |
5736 | *-*-*) ;; | |
d0ac1c44 | 5737 | *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; |
4a626d0a PA |
5738 | esac |
5739 | build=$ac_cv_build | |
5740 | ac_save_IFS=$IFS; IFS='-' | |
5741 | set x $ac_cv_build | |
5742 | shift | |
5743 | build_cpu=$1 | |
5744 | build_vendor=$2 | |
5745 | shift; shift | |
5746 | # Remember, the first character of IFS is used to create $*, | |
5747 | # except with old shells: | |
5748 | build_os=$* | |
5749 | IFS=$ac_save_IFS | |
5750 | case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac | |
5751 | ||
5752 | ||
5753 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 | |
5754 | $as_echo_n "checking host system type... " >&6; } | |
d0ac1c44 | 5755 | if ${ac_cv_host+:} false; then : |
4a626d0a PA |
5756 | $as_echo_n "(cached) " >&6 |
5757 | else | |
5758 | if test "x$host_alias" = x; then | |
5759 | ac_cv_host=$ac_cv_build | |
5760 | else | |
5761 | ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || | |
d0ac1c44 | 5762 | as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 |
4a626d0a PA |
5763 | fi |
5764 | ||
5765 | fi | |
5766 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 | |
5767 | $as_echo "$ac_cv_host" >&6; } | |
5768 | case $ac_cv_host in | |
5769 | *-*-*) ;; | |
d0ac1c44 | 5770 | *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; |
4a626d0a PA |
5771 | esac |
5772 | host=$ac_cv_host | |
5773 | ac_save_IFS=$IFS; IFS='-' | |
5774 | set x $ac_cv_host | |
5775 | shift | |
5776 | host_cpu=$1 | |
5777 | host_vendor=$2 | |
5778 | shift; shift | |
5779 | # Remember, the first character of IFS is used to create $*, | |
5780 | # except with old shells: | |
5781 | host_os=$* | |
5782 | IFS=$ac_save_IFS | |
5783 | case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac | |
5784 | ||
5785 | ||
c8693053 RO |
5786 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 |
5787 | $as_echo_n "checking target system type... " >&6; } | |
5788 | if ${ac_cv_target+:} false; then : | |
5789 | $as_echo_n "(cached) " >&6 | |
5790 | else | |
5791 | if test "x$target_alias" = x; then | |
5792 | ac_cv_target=$ac_cv_host | |
5793 | else | |
5794 | ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || | |
5795 | as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 | |
5796 | fi | |
c971b7fa | 5797 | |
c8693053 RO |
5798 | fi |
5799 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 | |
5800 | $as_echo "$ac_cv_target" >&6; } | |
5801 | case $ac_cv_target in | |
5802 | *-*-*) ;; | |
5803 | *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; | |
5804 | esac | |
5805 | target=$ac_cv_target | |
5806 | ac_save_IFS=$IFS; IFS='-' | |
5807 | set x $ac_cv_target | |
5808 | shift | |
5809 | target_cpu=$1 | |
5810 | target_vendor=$2 | |
5811 | shift; shift | |
5812 | # Remember, the first character of IFS is used to create $*, | |
5813 | # except with old shells: | |
5814 | target_os=$* | |
5815 | IFS=$ac_save_IFS | |
5816 | case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac | |
c971b7fa | 5817 | |
88b48903 | 5818 | |
c8693053 RO |
5819 | # The aliases save the names the user supplied, while $host etc. |
5820 | # will get canonicalized. | |
5821 | test -n "$target_alias" && | |
5822 | test "$program_prefix$program_suffix$program_transform_name" = \ | |
5823 | NONENONEs,x,x, && | |
5824 | program_prefix=${target_alias}- | |
5825 | ||
5826 | # The tests for host and target for $enable_largefile require | |
5827 | # canonical names. | |
5828 | ||
5829 | ||
5830 | ||
5831 | # As the $enable_largefile decision depends on --enable-plugins we must set it | |
5832 | # even in directories otherwise not depending on the $plugins option. | |
5833 | ||
5834 | ||
5835 | maybe_plugins=no | |
5836 | for ac_header in dlfcn.h | |
5837 | do : | |
5838 | ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default | |
5839 | " | |
5840 | if test "x$ac_cv_header_dlfcn_h" = xyes; then : | |
5841 | cat >>confdefs.h <<_ACEOF | |
5842 | #define HAVE_DLFCN_H 1 | |
5843 | _ACEOF | |
5844 | maybe_plugins=yes | |
5845 | fi | |
5846 | ||
5847 | done | |
5848 | ||
5849 | for ac_header in windows.h | |
5850 | do : | |
5851 | ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default | |
5852 | " | |
5853 | if test "x$ac_cv_header_windows_h" = xyes; then : | |
5854 | cat >>confdefs.h <<_ACEOF | |
5855 | #define HAVE_WINDOWS_H 1 | |
5856 | _ACEOF | |
5857 | maybe_plugins=yes | |
5858 | fi | |
5859 | ||
5860 | done | |
5861 | ||
5862 | ||
5863 | # Check whether --enable-plugins was given. | |
5864 | if test "${enable_plugins+set}" = set; then : | |
5865 | enableval=$enable_plugins; case "${enableval}" in | |
5866 | no) plugins=no ;; | |
5867 | *) plugins=yes | |
5868 | if test "$maybe_plugins" != "yes" ; then | |
5869 | as_fn_error $? "Building with plugin support requires a host that supports dlopen." "$LINENO" 5 | |
5870 | fi ;; | |
5871 | esac | |
5872 | else | |
5873 | plugins=$maybe_plugins | |
5874 | ||
5875 | fi | |
5876 | ||
5877 | if test "$plugins" = "yes"; then | |
5878 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlsym" >&5 | |
5879 | $as_echo_n "checking for library containing dlsym... " >&6; } | |
5880 | if ${ac_cv_search_dlsym+:} false; then : | |
5881 | $as_echo_n "(cached) " >&6 | |
5882 | else | |
5883 | ac_func_search_save_LIBS=$LIBS | |
5884 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5885 | /* end confdefs.h. */ | |
5886 | ||
5887 | /* Override any GCC internal prototype to avoid an error. | |
5888 | Use char because int might match the return type of a GCC | |
5889 | builtin and then its argument prototype would still apply. */ | |
5890 | #ifdef __cplusplus | |
5891 | extern "C" | |
5892 | #endif | |
5893 | char dlsym (); | |
5894 | int | |
5895 | main () | |
5896 | { | |
5897 | return dlsym (); | |
5898 | ; | |
5899 | return 0; | |
5900 | } | |
5901 | _ACEOF | |
5902 | for ac_lib in '' dl; do | |
5903 | if test -z "$ac_lib"; then | |
5904 | ac_res="none required" | |
5905 | else | |
5906 | ac_res=-l$ac_lib | |
5907 | LIBS="-l$ac_lib $ac_func_search_save_LIBS" | |
5908 | fi | |
5909 | if ac_fn_c_try_link "$LINENO"; then : | |
5910 | ac_cv_search_dlsym=$ac_res | |
5911 | fi | |
5912 | rm -f core conftest.err conftest.$ac_objext \ | |
5913 | conftest$ac_exeext | |
5914 | if ${ac_cv_search_dlsym+:} false; then : | |
5915 | break | |
5916 | fi | |
5917 | done | |
5918 | if ${ac_cv_search_dlsym+:} false; then : | |
5919 | ||
5920 | else | |
5921 | ac_cv_search_dlsym=no | |
5922 | fi | |
5923 | rm conftest.$ac_ext | |
5924 | LIBS=$ac_func_search_save_LIBS | |
5925 | fi | |
5926 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlsym" >&5 | |
5927 | $as_echo "$ac_cv_search_dlsym" >&6; } | |
5928 | ac_res=$ac_cv_search_dlsym | |
5929 | if test "$ac_res" != no; then : | |
5930 | test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" | |
5931 | ||
5932 | fi | |
5933 | ||
5934 | fi | |
5935 | ||
5936 | ||
5937 | case "${host}" in | |
5938 | sparc-*-solaris*|i?86-*-solaris*) | |
5939 | # On native 32-bit Solaris/SPARC and x86, large-file and procfs support | |
5940 | # were mutually exclusive until Solaris 11.3. Without procfs support, | |
5941 | # the bfd/ elf module cannot provide certain routines such as | |
5942 | # elfcore_write_prpsinfo or elfcore_write_prstatus. So unless the user | |
5943 | # explicitly requested large-file support through the | |
5944 | # --enable-largefile switch, disable large-file support in favor of | |
5945 | # procfs support. | |
5946 | # | |
5947 | # Check if <sys/procfs.h> is incompatible with large-file support. | |
5948 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5949 | /* end confdefs.h. */ | |
5950 | #define _FILE_OFFSET_BITS 64 | |
5951 | #define _STRUCTURED_PROC 1 | |
5952 | #include <sys/procfs.h> | |
5953 | int | |
5954 | main () | |
5955 | { | |
5956 | ||
5957 | ; | |
5958 | return 0; | |
5959 | } | |
5960 | _ACEOF | |
5961 | if ac_fn_c_try_compile "$LINENO"; then : | |
5962 | acx_cv_procfs_lfs=yes | |
5963 | else | |
5964 | acx_cv_procfs_lfs=no | |
5965 | fi | |
5966 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5967 | # | |
5968 | # Forcefully disable large-file support only if necessary, gdb is in | |
5969 | # tree and enabled. | |
5970 | if test "${target}" = "${host}" -a "$acx_cv_procfs_lfs" = no \ | |
5971 | -a -d $srcdir/../gdb -a "$enable_gdb" != no; then | |
5972 | : ${enable_largefile="no"} | |
5973 | if test "$plugins" = yes; then | |
5974 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: | |
5975 | plugin support disabled; require large-file support which is incompatible with GDB." >&5 | |
5976 | $as_echo "$as_me: WARNING: | |
5977 | plugin support disabled; require large-file support which is incompatible with GDB." >&2;} | |
5978 | plugins=no | |
88b48903 | 5979 | fi |
c8693053 RO |
5980 | fi |
5981 | # | |
5982 | # Explicitly undef _FILE_OFFSET_BITS if enable_largefile=no for the | |
5983 | # benefit of g++ 9+ which predefines it on Solaris. | |
5984 | if test "$enable_largefile" = no; then | |
5985 | LARGEFILE_CPPFLAGS="-U_FILE_OFFSET_BITS" | |
5986 | ||
5987 | fi | |
5988 | ;; | |
5989 | esac | |
88b48903 | 5990 | |
2196f55f YQ |
5991 | # Check whether --enable-largefile was given. |
5992 | if test "${enable_largefile+set}" = set; then : | |
5993 | enableval=$enable_largefile; | |
5994 | fi | |
5995 | ||
5996 | if test "$enable_largefile" != no; then | |
5997 | ||
5998 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 | |
5999 | $as_echo_n "checking for special C compiler options needed for large files... " >&6; } | |
d0ac1c44 | 6000 | if ${ac_cv_sys_largefile_CC+:} false; then : |
2196f55f YQ |
6001 | $as_echo_n "(cached) " >&6 |
6002 | else | |
6003 | ac_cv_sys_largefile_CC=no | |
6004 | if test "$GCC" != yes; then | |
6005 | ac_save_CC=$CC | |
6006 | while :; do | |
6007 | # IRIX 6.2 and later do not support large files by default, | |
6008 | # so use the C compiler's -n32 option if that helps. | |
6009 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6010 | /* end confdefs.h. */ | |
6011 | #include <sys/types.h> | |
6012 | /* Check that off_t can represent 2**63 - 1 correctly. | |
6013 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | |
6014 | since some C++ compilers masquerading as C compilers | |
6015 | incorrectly reject 9223372036854775807. */ | |
6016 | #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) | |
6017 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 | |
6018 | && LARGE_OFF_T % 2147483647 == 1) | |
6019 | ? 1 : -1]; | |
6020 | int | |
6021 | main () | |
6022 | { | |
6023 | ||
6024 | ; | |
6025 | return 0; | |
6026 | } | |
6027 | _ACEOF | |
6028 | if ac_fn_c_try_compile "$LINENO"; then : | |
6029 | break | |
6030 | fi | |
6031 | rm -f core conftest.err conftest.$ac_objext | |
6032 | CC="$CC -n32" | |
6033 | if ac_fn_c_try_compile "$LINENO"; then : | |
6034 | ac_cv_sys_largefile_CC=' -n32'; break | |
6035 | fi | |
6036 | rm -f core conftest.err conftest.$ac_objext | |
6037 | break | |
6038 | done | |
6039 | CC=$ac_save_CC | |
6040 | rm -f conftest.$ac_ext | |
6041 | fi | |
6042 | fi | |
6043 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 | |
6044 | $as_echo "$ac_cv_sys_largefile_CC" >&6; } | |
6045 | if test "$ac_cv_sys_largefile_CC" != no; then | |
6046 | CC=$CC$ac_cv_sys_largefile_CC | |
6047 | fi | |
6048 | ||
6049 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 | |
6050 | $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } | |
d0ac1c44 | 6051 | if ${ac_cv_sys_file_offset_bits+:} false; then : |
2196f55f YQ |
6052 | $as_echo_n "(cached) " >&6 |
6053 | else | |
6054 | while :; do | |
6055 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6056 | /* end confdefs.h. */ | |
6057 | #include <sys/types.h> | |
6058 | /* Check that off_t can represent 2**63 - 1 correctly. | |
6059 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | |
6060 | since some C++ compilers masquerading as C compilers | |
6061 | incorrectly reject 9223372036854775807. */ | |
6062 | #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) | |
6063 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 | |
6064 | && LARGE_OFF_T % 2147483647 == 1) | |
6065 | ? 1 : -1]; | |
6066 | int | |
6067 | main () | |
6068 | { | |
6069 | ||
6070 | ; | |
6071 | return 0; | |
6072 | } | |
6073 | _ACEOF | |
6074 | if ac_fn_c_try_compile "$LINENO"; then : | |
6075 | ac_cv_sys_file_offset_bits=no; break | |
6076 | fi | |
6077 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6078 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6079 | /* end confdefs.h. */ | |
6080 | #define _FILE_OFFSET_BITS 64 | |
6081 | #include <sys/types.h> | |
6082 | /* Check that off_t can represent 2**63 - 1 correctly. | |
6083 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | |
6084 | since some C++ compilers masquerading as C compilers | |
6085 | incorrectly reject 9223372036854775807. */ | |
6086 | #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) | |
6087 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 | |
6088 | && LARGE_OFF_T % 2147483647 == 1) | |
6089 | ? 1 : -1]; | |
6090 | int | |
6091 | main () | |
6092 | { | |
6093 | ||
6094 | ; | |
6095 | return 0; | |
6096 | } | |
6097 | _ACEOF | |
6098 | if ac_fn_c_try_compile "$LINENO"; then : | |
6099 | ac_cv_sys_file_offset_bits=64; break | |
6100 | fi | |
6101 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6102 | ac_cv_sys_file_offset_bits=unknown | |
6103 | break | |
6104 | done | |
6105 | fi | |
6106 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 | |
6107 | $as_echo "$ac_cv_sys_file_offset_bits" >&6; } | |
6108 | case $ac_cv_sys_file_offset_bits in #( | |
6109 | no | unknown) ;; | |
6110 | *) | |
6111 | cat >>confdefs.h <<_ACEOF | |
6112 | #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits | |
6113 | _ACEOF | |
6114 | ;; | |
6115 | esac | |
6116 | rm -rf conftest* | |
6117 | if test $ac_cv_sys_file_offset_bits = unknown; then | |
6118 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 | |
6119 | $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } | |
d0ac1c44 | 6120 | if ${ac_cv_sys_large_files+:} false; then : |
2196f55f YQ |
6121 | $as_echo_n "(cached) " >&6 |
6122 | else | |
6123 | while :; do | |
6124 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6125 | /* end confdefs.h. */ | |
6126 | #include <sys/types.h> | |
6127 | /* Check that off_t can represent 2**63 - 1 correctly. | |
6128 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | |
6129 | since some C++ compilers masquerading as C compilers | |
6130 | incorrectly reject 9223372036854775807. */ | |
6131 | #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) | |
6132 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 | |
6133 | && LARGE_OFF_T % 2147483647 == 1) | |
6134 | ? 1 : -1]; | |
6135 | int | |
6136 | main () | |
6137 | { | |
6138 | ||
6139 | ; | |
6140 | return 0; | |
6141 | } | |
6142 | _ACEOF | |
6143 | if ac_fn_c_try_compile "$LINENO"; then : | |
6144 | ac_cv_sys_large_files=no; break | |
6145 | fi | |
6146 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6147 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6148 | /* end confdefs.h. */ | |
6149 | #define _LARGE_FILES 1 | |
6150 | #include <sys/types.h> | |
6151 | /* Check that off_t can represent 2**63 - 1 correctly. | |
6152 | We can't simply define LARGE_OFF_T to be 9223372036854775807, | |
6153 | since some C++ compilers masquerading as C compilers | |
6154 | incorrectly reject 9223372036854775807. */ | |
6155 | #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) | |
6156 | int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 | |
6157 | && LARGE_OFF_T % 2147483647 == 1) | |
6158 | ? 1 : -1]; | |
6159 | int | |
6160 | main () | |
6161 | { | |
6162 | ||
6163 | ; | |
6164 | return 0; | |
6165 | } | |
6166 | _ACEOF | |
6167 | if ac_fn_c_try_compile "$LINENO"; then : | |
6168 | ac_cv_sys_large_files=1; break | |
6169 | fi | |
6170 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6171 | ac_cv_sys_large_files=unknown | |
6172 | break | |
6173 | done | |
6174 | fi | |
6175 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 | |
6176 | $as_echo "$ac_cv_sys_large_files" >&6; } | |
6177 | case $ac_cv_sys_large_files in #( | |
6178 | no | unknown) ;; | |
6179 | *) | |
6180 | cat >>confdefs.h <<_ACEOF | |
6181 | #define _LARGE_FILES $ac_cv_sys_large_files | |
6182 | _ACEOF | |
6183 | ;; | |
6184 | esac | |
6185 | rm -rf conftest* | |
6186 | fi | |
6187 | ||
6188 | ||
4a626d0a PA |
6189 | $as_echo "#define _DARWIN_USE_64_BIT_INODE 1" >>confdefs.h |
6190 | ||
2196f55f YQ |
6191 | fi |
6192 | ||
88b48903 WN |
6193 | |
6194 | ||
5abebf3c CB |
6195 | |
6196 | ||
6197 | ||
c0c3707f | 6198 | |
5abebf3c | 6199 | |
5abebf3c | 6200 | |
c0c3707f CB |
6201 | |
6202 | ||
c8693053 RO |
6203 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5 |
6204 | $as_echo_n "checking for Minix Amsterdam compiler... " >&6; } | |
6205 | if ${gl_cv_c_amsterdam_compiler+:} false; then : | |
6206 | $as_echo_n "(cached) " >&6 | |
6207 | else | |
c0c3707f | 6208 | |
c8693053 RO |
6209 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6210 | /* end confdefs.h. */ | |
5abebf3c | 6211 | |
c8693053 RO |
6212 | #ifdef __ACK__ |
6213 | Amsterdam | |
6214 | #endif | |
5abebf3c | 6215 | |
c8693053 RO |
6216 | _ACEOF |
6217 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
6218 | $EGREP "Amsterdam" >/dev/null 2>&1; then : | |
6219 | gl_cv_c_amsterdam_compiler=yes | |
6220 | else | |
6221 | gl_cv_c_amsterdam_compiler=no | |
6222 | fi | |
6223 | rm -f conftest* | |
5abebf3c CB |
6224 | |
6225 | ||
c8693053 RO |
6226 | fi |
6227 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5 | |
6228 | $as_echo "$gl_cv_c_amsterdam_compiler" >&6; } | |
5abebf3c | 6229 | |
c8693053 RO |
6230 | if test $gl_cv_c_amsterdam_compiler = yes; then |
6231 | if test -z "$AR"; then | |
6232 | AR='cc -c.a' | |
6233 | fi | |
6234 | if test -z "$ARFLAGS"; then | |
6235 | ARFLAGS='-o' | |
6236 | fi | |
6237 | else | |
6238 | : | |
6239 | fi | |
c971b7fa | 6240 | |
c8693053 RO |
6241 | if test -n "$ac_tool_prefix"; then |
6242 | # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. | |
6243 | set dummy ${ac_tool_prefix}ar; ac_word=$2 | |
6244 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
6245 | $as_echo_n "checking for $ac_word... " >&6; } | |
6246 | if ${ac_cv_prog_AR+:} false; then : | |
6247 | $as_echo_n "(cached) " >&6 | |
6248 | else | |
6249 | if test -n "$AR"; then | |
6250 | ac_cv_prog_AR="$AR" # Let the user override the test. | |
6251 | else | |
6252 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
6253 | for as_dir in $PATH | |
6254 | do | |
6255 | IFS=$as_save_IFS | |
6256 | test -z "$as_dir" && as_dir=. | |
6257 | for ac_exec_ext in '' $ac_executable_extensions; do | |
6258 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
6259 | ac_cv_prog_AR="${ac_tool_prefix}ar" | |
6260 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
6261 | break 2 | |
6262 | fi | |
6263 | done | |
6264 | done | |
6265 | IFS=$as_save_IFS | |
c971b7fa | 6266 | |
c8693053 RO |
6267 | fi |
6268 | fi | |
6269 | AR=$ac_cv_prog_AR | |
6270 | if test -n "$AR"; then | |
6271 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 | |
6272 | $as_echo "$AR" >&6; } | |
6273 | else | |
6274 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
6275 | $as_echo "no" >&6; } | |
6276 | fi | |
c971b7fa | 6277 | |
c971b7fa | 6278 | |
c8693053 RO |
6279 | fi |
6280 | if test -z "$ac_cv_prog_AR"; then | |
6281 | ac_ct_AR=$AR | |
6282 | # Extract the first word of "ar", so it can be a program name with args. | |
6283 | set dummy ar; ac_word=$2 | |
6284 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
6285 | $as_echo_n "checking for $ac_word... " >&6; } | |
6286 | if ${ac_cv_prog_ac_ct_AR+:} false; then : | |
c971b7fa PA |
6287 | $as_echo_n "(cached) " >&6 |
6288 | else | |
c8693053 RO |
6289 | if test -n "$ac_ct_AR"; then |
6290 | ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. | |
5e8754f9 | 6291 | else |
c8693053 RO |
6292 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
6293 | for as_dir in $PATH | |
6294 | do | |
6295 | IFS=$as_save_IFS | |
6296 | test -z "$as_dir" && as_dir=. | |
6297 | for ac_exec_ext in '' $ac_executable_extensions; do | |
6298 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
6299 | ac_cv_prog_ac_ct_AR="ar" | |
6300 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
6301 | break 2 | |
6302 | fi | |
6303 | done | |
6304 | done | |
6305 | IFS=$as_save_IFS | |
7a6dbc2f | 6306 | |
c971b7fa | 6307 | fi |
c8693053 RO |
6308 | fi |
6309 | ac_ct_AR=$ac_cv_prog_ac_ct_AR | |
6310 | if test -n "$ac_ct_AR"; then | |
6311 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 | |
6312 | $as_echo "$ac_ct_AR" >&6; } | |
6313 | else | |
6314 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
6315 | $as_echo "no" >&6; } | |
6316 | fi | |
5e8754f9 | 6317 | |
c8693053 RO |
6318 | if test "x$ac_ct_AR" = x; then |
6319 | AR="ar" | |
6320 | else | |
6321 | case $cross_compiling:$ac_tool_warned in | |
6322 | yes:) | |
6323 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
6324 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
6325 | ac_tool_warned=yes ;; | |
6326 | esac | |
6327 | AR=$ac_ct_AR | |
6328 | fi | |
6329 | else | |
6330 | AR="$ac_cv_prog_AR" | |
6331 | fi | |
c0c3707f | 6332 | |
c8693053 RO |
6333 | if test -z "$ARFLAGS"; then |
6334 | ARFLAGS='cr' | |
6335 | fi | |
7a6dbc2f | 6336 | |
7a6dbc2f | 6337 | |
c0c3707f | 6338 | |
c8693053 RO |
6339 | if test -z "$RANLIB"; then |
6340 | if test $gl_cv_c_amsterdam_compiler = yes; then | |
6341 | RANLIB=':' | |
6342 | else | |
6343 | if test -n "$ac_tool_prefix"; then | |
6344 | # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. | |
6345 | set dummy ${ac_tool_prefix}ranlib; ac_word=$2 | |
6346 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
6347 | $as_echo_n "checking for $ac_word... " >&6; } | |
6348 | if ${ac_cv_prog_RANLIB+:} false; then : | |
6349 | $as_echo_n "(cached) " >&6 | |
6350 | else | |
6351 | if test -n "$RANLIB"; then | |
6352 | ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. | |
6353 | else | |
6354 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
6355 | for as_dir in $PATH | |
6356 | do | |
6357 | IFS=$as_save_IFS | |
6358 | test -z "$as_dir" && as_dir=. | |
6359 | for ac_exec_ext in '' $ac_executable_extensions; do | |
6360 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
6361 | ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" | |
6362 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
6363 | break 2 | |
6364 | fi | |
5e8754f9 | 6365 | done |
c8693053 RO |
6366 | done |
6367 | IFS=$as_save_IFS | |
5e8754f9 | 6368 | |
c971b7fa | 6369 | fi |
c8693053 RO |
6370 | fi |
6371 | RANLIB=$ac_cv_prog_RANLIB | |
6372 | if test -n "$RANLIB"; then | |
6373 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 | |
6374 | $as_echo "$RANLIB" >&6; } | |
c0c3707f | 6375 | else |
c8693053 RO |
6376 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
6377 | $as_echo "no" >&6; } | |
5e8754f9 | 6378 | fi |
c0c3707f | 6379 | |
c8693053 RO |
6380 | |
6381 | fi | |
6382 | if test -z "$ac_cv_prog_RANLIB"; then | |
6383 | ac_ct_RANLIB=$RANLIB | |
6384 | # Extract the first word of "ranlib", so it can be a program name with args. | |
6385 | set dummy ranlib; ac_word=$2 | |
6386 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
6387 | $as_echo_n "checking for $ac_word... " >&6; } | |
6388 | if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : | |
c971b7fa PA |
6389 | $as_echo_n "(cached) " >&6 |
6390 | else | |
c8693053 RO |
6391 | if test -n "$ac_ct_RANLIB"; then |
6392 | ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. | |
6393 | else | |
6394 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
6395 | for as_dir in $PATH | |
6396 | do | |
6397 | IFS=$as_save_IFS | |
6398 | test -z "$as_dir" && as_dir=. | |
6399 | for ac_exec_ext in '' $ac_executable_extensions; do | |
6400 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
6401 | ac_cv_prog_ac_ct_RANLIB="ranlib" | |
6402 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
6403 | break 2 | |
5e8754f9 SDJ |
6404 | fi |
6405 | done | |
c8693053 RO |
6406 | done |
6407 | IFS=$as_save_IFS | |
5e8754f9 SDJ |
6408 | |
6409 | fi | |
6410 | fi | |
c8693053 RO |
6411 | ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB |
6412 | if test -n "$ac_ct_RANLIB"; then | |
6413 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 | |
6414 | $as_echo "$ac_ct_RANLIB" >&6; } | |
6415 | else | |
6416 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
6417 | $as_echo "no" >&6; } | |
6418 | fi | |
c0c3707f | 6419 | |
c8693053 RO |
6420 | if test "x$ac_ct_RANLIB" = x; then |
6421 | RANLIB=":" | |
6422 | else | |
6423 | case $cross_compiling:$ac_tool_warned in | |
6424 | yes:) | |
6425 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
6426 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
6427 | ac_tool_warned=yes ;; | |
6428 | esac | |
6429 | RANLIB=$ac_ct_RANLIB | |
6430 | fi | |
6431 | else | |
6432 | RANLIB="$ac_cv_prog_RANLIB" | |
5e8754f9 SDJ |
6433 | fi |
6434 | ||
c8693053 | 6435 | fi |
c0c3707f | 6436 | fi |
5e8754f9 | 6437 | |
5e8754f9 | 6438 | |
5e8754f9 | 6439 | |
5e8754f9 SDJ |
6440 | |
6441 | ||
5e8754f9 | 6442 | |
c8693053 RO |
6443 | # IEEE behaviour is the default on all CPUs except Alpha and SH |
6444 | # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 | |
6445 | # and the GCC 4.1.2 manual). | |
6446 | case "$host_cpu" in | |
6447 | alpha*) | |
6448 | # On Alpha systems, a compiler option provides the behaviour. | |
6449 | # See the ieee(3) manual page, also available at | |
6450 | # <https://backdrift.org/man/tru64/man3/ieee.3.html> | |
6451 | if test -n "$GCC"; then | |
6452 | # GCC has the option -mieee. | |
6453 | # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. | |
6454 | CPPFLAGS="$CPPFLAGS -mieee" | |
6455 | else | |
6456 | # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact. | |
6457 | # For full IEEE compliance (rarely needed), use option -ieee_with_inexact. | |
6458 | CPPFLAGS="$CPPFLAGS -ieee" | |
6459 | fi | |
6460 | ;; | |
6461 | sh*) | |
6462 | if test -n "$GCC"; then | |
6463 | # GCC has the option -mieee. | |
6464 | CPPFLAGS="$CPPFLAGS -mieee" | |
6465 | fi | |
6466 | ;; | |
6467 | esac | |
c0c3707f | 6468 | |
c971b7fa | 6469 | |
c971b7fa | 6470 | |
c8693053 RO |
6471 | |
6472 | ||
6473 | ||
6474 | ||
6475 | # Check whether --enable-threads was given. | |
6476 | if test "${enable_threads+set}" = set; then : | |
6477 | enableval=$enable_threads; gl_use_threads=$enableval | |
5e8754f9 | 6478 | else |
c8693053 RO |
6479 | if test -n "$gl_use_threads_default"; then |
6480 | gl_use_threads="$gl_use_threads_default" | |
6481 | else | |
6482 | case "$host_os" in | |
6483 | osf*) gl_use_threads=no ;; | |
6484 | cygwin*) | |
6485 | case `uname -r` in | |
6486 | 1.[0-5].*) gl_use_threads=no ;; | |
6487 | *) gl_use_threads=yes ;; | |
6488 | esac | |
6489 | ;; | |
6490 | mingw*) | |
6491 | case "$gl_use_winpthreads_default" in | |
6492 | yes) gl_use_threads=posix ;; | |
6493 | no) gl_use_threads=windows ;; | |
6494 | *) gl_use_threads=yes ;; | |
6495 | esac | |
6496 | ;; | |
6497 | *) gl_use_threads=yes ;; | |
6498 | esac | |
6499 | fi | |
c971b7fa | 6500 | |
5e8754f9 | 6501 | fi |
c0c3707f | 6502 | |
c8693053 RO |
6503 | if test "$gl_use_threads" = yes \ |
6504 | || test "$gl_use_threads" = isoc \ | |
6505 | || test "$gl_use_threads" = posix \ | |
6506 | || test "$gl_use_threads" = isoc+posix; then | |
6507 | # For using <threads.h> or <pthread.h>: | |
6508 | ||
6509 | ||
6510 | if test -z "$gl_anythreadlib_early_done"; then | |
6511 | case "$host_os" in | |
6512 | osf*) | |
6513 | # On OSF/1, the compiler needs the flag -D_REENTRANT so that it | |
6514 | # groks <pthread.h>. cc also understands the flag -pthread, but | |
6515 | # we don't use it because 1. gcc-2.95 doesn't understand -pthread, | |
6516 | # 2. putting a flag into CPPFLAGS that has an effect on the linker | |
6517 | # causes the AC_LINK_IFELSE test below to succeed unexpectedly, | |
6518 | # leading to wrong values of LIBTHREAD and LTLIBTHREAD. | |
6519 | CPPFLAGS="$CPPFLAGS -D_REENTRANT" | |
6520 | ;; | |
6521 | esac | |
6522 | # Some systems optimize for single-threaded programs by default, and | |
6523 | # need special flags to disable these optimizations. For example, the | |
6524 | # definition of 'errno' in <errno.h>. | |
6525 | case "$host_os" in | |
6526 | aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;; | |
6527 | solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; | |
6528 | esac | |
6529 | gl_anythreadlib_early_done=done | |
5e8754f9 | 6530 | fi |
c0c3707f | 6531 | |
c8693053 | 6532 | fi |
c0c3707f | 6533 | |
c0c3707f | 6534 | |
c971b7fa | 6535 | |
c8693053 RO |
6536 | # Pre-early section. |
6537 | ||
6538 | ||
6539 | ||
6540 | ||
6541 | # Code from module absolute-header: | |
6542 | # Code from module alloca: | |
6543 | # Code from module alloca-opt: | |
6544 | # Code from module arpa_inet: | |
6545 | # Code from module assure: | |
6546 | # Code from module at-internal: | |
6547 | # Code from module builtin-expect: | |
6548 | # Code from module c99: | |
6549 | # Code from module canonicalize-lgpl: | |
6550 | # Code from module chdir: | |
6551 | # Code from module chdir-long: | |
6552 | # Code from module cloexec: | |
6553 | # Code from module close: | |
6554 | # Code from module closedir: | |
6555 | # Code from module count-one-bits: | |
6556 | # Code from module d-ino: | |
6557 | # Code from module d-type: | |
6558 | # Code from module dirent: | |
6559 | # Code from module dirfd: | |
6560 | # Code from module dirname-lgpl: | |
6561 | # Code from module dosname: | |
6562 | # Code from module double-slash-root: | |
6563 | # Code from module dup: | |
6564 | # Code from module dup2: | |
6565 | # Code from module environ: | |
6566 | # Code from module errno: | |
6567 | # Code from module error: | |
6568 | # Code from module exitfail: | |
6569 | # Code from module extensions: | |
6570 | # Code from module extern-inline: | |
6571 | # Code from module fchdir: | |
6572 | # Code from module fcntl: | |
6573 | # Code from module fcntl-h: | |
6574 | # Code from module fd-hook: | |
6575 | # Code from module fd-safer-flag: | |
6576 | # Code from module fdopendir: | |
6577 | # Code from module filename: | |
6578 | # Code from module filenamecat-lgpl: | |
6579 | # Code from module flexmember: | |
6580 | # Code from module float: | |
6581 | # Code from module fnmatch: | |
6582 | # Code from module fnmatch-gnu: | |
6583 | # Code from module fnmatch-h: | |
6584 | # Code from module fpieee: | |
6585 | ||
6586 | # Code from module fpucw: | |
6587 | # Code from module frexp: | |
6588 | # Code from module frexpl: | |
6589 | # Code from module fstat: | |
6590 | # Code from module fstatat: | |
6591 | # Code from module getcwd: | |
6592 | # Code from module getcwd-lgpl: | |
6593 | # Code from module getdtablesize: | |
6594 | # Code from module getlogin_r: | |
6595 | # Code from module getprogname: | |
6596 | # Code from module gettext-h: | |
6597 | # Code from module gettimeofday: | |
6598 | # Code from module glob: | |
6599 | # Code from module glob-h: | |
6600 | # Code from module hard-locale: | |
6601 | # Code from module include_next: | |
6602 | # Code from module inet_ntop: | |
6603 | # Code from module intprops: | |
6604 | # Code from module inttypes: | |
6605 | # Code from module inttypes-incomplete: | |
6606 | # Code from module isnand-nolibm: | |
6607 | # Code from module isnanl-nolibm: | |
6608 | # Code from module largefile: | |
6609 | ||
6610 | # Code from module libc-config: | |
6611 | # Code from module limits-h: | |
6612 | # Code from module localcharset: | |
6613 | # Code from module locale: | |
6614 | # Code from module localtime-buffer: | |
6615 | # Code from module lock: | |
6616 | # Code from module lstat: | |
6617 | # Code from module malloc-posix: | |
6618 | # Code from module malloca: | |
6619 | # Code from module math: | |
6620 | # Code from module mbrtowc: | |
6621 | # Code from module mbsinit: | |
6622 | # Code from module mbsrtowcs: | |
6623 | # Code from module memchr: | |
6624 | # Code from module memmem: | |
6625 | # Code from module memmem-simple: | |
6626 | # Code from module mempcpy: | |
6627 | # Code from module memrchr: | |
6628 | # Code from module mkdir: | |
6629 | # Code from module mkdtemp: | |
6630 | # Code from module mkostemp: | |
6631 | # Code from module msvc-inval: | |
6632 | # Code from module msvc-nothrow: | |
6633 | # Code from module multiarch: | |
6634 | # Code from module netinet_in: | |
6635 | # Code from module nocrash: | |
6636 | # Code from module open: | |
6637 | # Code from module openat: | |
6638 | # Code from module openat-die: | |
6639 | # Code from module openat-h: | |
6640 | # Code from module opendir: | |
6641 | # Code from module pathmax: | |
6642 | # Code from module rawmemchr: | |
6643 | # Code from module readdir: | |
6644 | # Code from module readlink: | |
6645 | # Code from module realloc-posix: | |
6646 | # Code from module rename: | |
6647 | # Code from module rewinddir: | |
6648 | # Code from module rmdir: | |
6649 | # Code from module same-inode: | |
6650 | # Code from module save-cwd: | |
6651 | # Code from module scratch_buffer: | |
6652 | # Code from module setenv: | |
6653 | # Code from module setlocale-null: | |
6654 | # Code from module signal-h: | |
6655 | # Code from module snippet/_Noreturn: | |
6656 | # Code from module snippet/arg-nonnull: | |
6657 | # Code from module snippet/c++defs: | |
6658 | # Code from module snippet/warn-on-use: | |
6659 | # Code from module socklen: | |
6660 | # Code from module ssize_t: | |
6661 | # Code from module stat: | |
6662 | # Code from module stat-time: | |
6663 | # Code from module std-gnu11: | |
6664 | # Code from module stdalign: | |
6665 | # Code from module stdbool: | |
6666 | # Code from module stddef: | |
6667 | # Code from module stdint: | |
6668 | # Code from module stdio: | |
6669 | # Code from module stdlib: | |
6670 | # Code from module strchrnul: | |
6671 | # Code from module strdup-posix: | |
6672 | # Code from module streq: | |
6673 | # Code from module strerror: | |
6674 | # Code from module strerror-override: | |
6675 | # Code from module strerror_r-posix: | |
6676 | # Code from module string: | |
6677 | # Code from module strnlen1: | |
6678 | # Code from module strstr: | |
6679 | # Code from module strstr-simple: | |
6680 | # Code from module strtok_r: | |
6681 | # Code from module sys_socket: | |
6682 | # Code from module sys_stat: | |
6683 | # Code from module sys_time: | |
6684 | # Code from module sys_types: | |
6685 | # Code from module sys_uio: | |
6686 | # Code from module tempname: | |
6687 | # Code from module threadlib: | |
6688 | ||
6689 | ||
6690 | ||
6691 | # Code from module time: | |
6692 | # Code from module time_r: | |
6693 | # Code from module unistd: | |
6694 | # Code from module unistd-safer: | |
6695 | # Code from module unsetenv: | |
6696 | # Code from module update-copyright: | |
6697 | # Code from module verify: | |
6698 | # Code from module wchar: | |
6699 | # Code from module wctype-h: | |
6700 | # Code from module windows-mutex: | |
6701 | # Code from module windows-once: | |
6702 | # Code from module windows-recmutex: | |
6703 | # Code from module windows-rwlock: | |
6704 | # Code from module xalloc-oversized: | |
6705 | ||
6706 | ||
6707 | am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc | |
c971b7fa PA |
6708 | |
6709 | ||
c0c3707f CB |
6710 | ac_aux_dir= |
6711 | for ac_dir in .. "$srcdir"/..; do | |
6712 | if test -f "$ac_dir/install-sh"; then | |
6713 | ac_aux_dir=$ac_dir | |
6714 | ac_install_sh="$ac_aux_dir/install-sh -c" | |
6715 | break | |
6716 | elif test -f "$ac_dir/install.sh"; then | |
6717 | ac_aux_dir=$ac_dir | |
6718 | ac_install_sh="$ac_aux_dir/install.sh -c" | |
6719 | break | |
6720 | elif test -f "$ac_dir/shtool"; then | |
6721 | ac_aux_dir=$ac_dir | |
6722 | ac_install_sh="$ac_aux_dir/shtool install -c" | |
6723 | break | |
6724 | fi | |
6725 | done | |
6726 | if test -z "$ac_aux_dir"; then | |
6727 | as_fn_error $? "cannot find install-sh, install.sh, or shtool in .. \"$srcdir\"/.." "$LINENO" 5 | |
6728 | fi | |
6729 | ||
6730 | # These three variables are undocumented and unsupported, | |
6731 | # and are intended to be withdrawn in a future Autoconf release. | |
6732 | # They can cause serious problems if a builder's source tree is in a directory | |
6733 | # whose full name contains unusual characters. | |
6734 | ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. | |
6735 | ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. | |
6736 | ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. | |
6737 | ||
6738 | ||
6739 | ||
6740 | ||
6741 | ||
6742 | ||
6743 | ||
6744 | ||
6745 | ||
6746 | ||
6747 | # Check whether --enable-cross-guesses was given. | |
6748 | if test "${enable_cross_guesses+set}" = set; then : | |
6749 | enableval=$enable_cross_guesses; if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then | |
6750 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-cross-guesses" >&5 | |
6751 | $as_echo "$as_me: WARNING: invalid argument supplied to --enable-cross-guesses" >&2;} | |
6752 | enableval=conservative | |
6753 | fi | |
6754 | gl_cross_guesses="$enableval" | |
6755 | else | |
6756 | gl_cross_guesses=conservative | |
6757 | fi | |
6758 | ||
6759 | if test $gl_cross_guesses = risky; then | |
6760 | gl_cross_guess_normal="guessing yes" | |
6761 | gl_cross_guess_inverted="guessing no" | |
6762 | else | |
6763 | gl_cross_guess_normal="guessing no" | |
6764 | gl_cross_guess_inverted="guessing yes" | |
6765 | fi | |
6766 | LIBC_FATAL_STDERR_=1 | |
6767 | export LIBC_FATAL_STDERR_ | |
6768 | ||
5df4cba6 | 6769 | |
c0c3707f CB |
6770 | ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" |
6771 | if test "x$ac_cv_type_size_t" = xyes; then : | |
6772 | ||
6773 | else | |
6774 | ||
6775 | cat >>confdefs.h <<_ACEOF | |
6776 | #define size_t unsigned int | |
6777 | _ACEOF | |
6778 | ||
6779 | fi | |
6780 | ||
6781 | # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works | |
6782 | # for constant arguments. Useless! | |
6783 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 | |
6784 | $as_echo_n "checking for working alloca.h... " >&6; } | |
6785 | if ${ac_cv_working_alloca_h+:} false; then : | |
6786 | $as_echo_n "(cached) " >&6 | |
6787 | else | |
6788 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6789 | /* end confdefs.h. */ | |
6790 | #include <alloca.h> | |
5e8754f9 SDJ |
6791 | int |
6792 | main () | |
6793 | { | |
c0c3707f CB |
6794 | char *p = (char *) alloca (2 * sizeof (int)); |
6795 | if (p) return 0; | |
5e8754f9 SDJ |
6796 | ; |
6797 | return 0; | |
6798 | } | |
6799 | _ACEOF | |
c0c3707f CB |
6800 | if ac_fn_c_try_link "$LINENO"; then : |
6801 | ac_cv_working_alloca_h=yes | |
6802 | else | |
6803 | ac_cv_working_alloca_h=no | |
5e8754f9 | 6804 | fi |
c0c3707f CB |
6805 | rm -f core conftest.err conftest.$ac_objext \ |
6806 | conftest$ac_exeext conftest.$ac_ext | |
5e8754f9 | 6807 | fi |
c0c3707f CB |
6808 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 |
6809 | $as_echo "$ac_cv_working_alloca_h" >&6; } | |
6810 | if test $ac_cv_working_alloca_h = yes; then | |
c971b7fa | 6811 | |
c0c3707f | 6812 | $as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h |
c971b7fa | 6813 | |
c0c3707f | 6814 | fi |
d0ac1c44 | 6815 | |
c0c3707f CB |
6816 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 |
6817 | $as_echo_n "checking for alloca... " >&6; } | |
6818 | if ${ac_cv_func_alloca_works+:} false; then : | |
5e8754f9 SDJ |
6819 | $as_echo_n "(cached) " >&6 |
6820 | else | |
6821 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6822 | /* end confdefs.h. */ | |
c0c3707f CB |
6823 | #ifdef __GNUC__ |
6824 | # define alloca __builtin_alloca | |
6825 | #else | |
6826 | # ifdef _MSC_VER | |
6827 | # include <malloc.h> | |
6828 | # define alloca _alloca | |
6829 | # else | |
6830 | # ifdef HAVE_ALLOCA_H | |
6831 | # include <alloca.h> | |
6832 | # else | |
6833 | # ifdef _AIX | |
6834 | #pragma alloca | |
6835 | # else | |
6836 | # ifndef alloca /* predefined by HP cc +Olibcalls */ | |
6837 | void *alloca (size_t); | |
6838 | # endif | |
6839 | # endif | |
6840 | # endif | |
6841 | # endif | |
6842 | #endif | |
d0ac1c44 | 6843 | |
5e8754f9 SDJ |
6844 | int |
6845 | main () | |
6846 | { | |
c0c3707f CB |
6847 | char *p = (char *) alloca (1); |
6848 | if (p) return 0; | |
5e8754f9 SDJ |
6849 | ; |
6850 | return 0; | |
6851 | } | |
6852 | _ACEOF | |
c0c3707f CB |
6853 | if ac_fn_c_try_link "$LINENO"; then : |
6854 | ac_cv_func_alloca_works=yes | |
6855 | else | |
6856 | ac_cv_func_alloca_works=no | |
5e8754f9 | 6857 | fi |
c0c3707f CB |
6858 | rm -f core conftest.err conftest.$ac_objext \ |
6859 | conftest$ac_exeext conftest.$ac_ext | |
6860 | fi | |
6861 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 | |
6862 | $as_echo "$ac_cv_func_alloca_works" >&6; } | |
7a6dbc2f | 6863 | |
c0c3707f | 6864 | if test $ac_cv_func_alloca_works = yes; then |
7a6dbc2f | 6865 | |
c0c3707f | 6866 | $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h |
7a6dbc2f | 6867 | |
5e8754f9 | 6868 | else |
c0c3707f CB |
6869 | # The SVR3 libPW and SVR4 libucb both contain incompatible functions |
6870 | # that cause trouble. Some versions do not even contain alloca or | |
6871 | # contain a buggy version. If you still want to use their alloca, | |
6872 | # use ar to extract alloca.o from them instead of compiling alloca.c. | |
c971b7fa PA |
6873 | |
6874 | ||
7a6dbc2f | 6875 | |
73cc7272 TT |
6876 | |
6877 | ||
c0c3707f | 6878 | ALLOCA=\${LIBOBJDIR}alloca.$ac_objext |
73cc7272 | 6879 | |
c0c3707f | 6880 | $as_echo "#define C_ALLOCA 1" >>confdefs.h |
73cc7272 TT |
6881 | |
6882 | ||
c0c3707f CB |
6883 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 |
6884 | $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } | |
6885 | if ${ac_cv_os_cray+:} false; then : | |
6886 | $as_echo_n "(cached) " >&6 | |
6887 | else | |
6888 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6889 | /* end confdefs.h. */ | |
6890 | #if defined CRAY && ! defined CRAY2 | |
6891 | webecray | |
6892 | #else | |
6893 | wenotbecray | |
6894 | #endif | |
73cc7272 | 6895 | |
73cc7272 | 6896 | _ACEOF |
c0c3707f CB |
6897 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
6898 | $EGREP "webecray" >/dev/null 2>&1; then : | |
6899 | ac_cv_os_cray=yes | |
6900 | else | |
6901 | ac_cv_os_cray=no | |
73cc7272 | 6902 | fi |
c0c3707f | 6903 | rm -f conftest* |
73cc7272 | 6904 | |
c0c3707f CB |
6905 | fi |
6906 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 | |
6907 | $as_echo "$ac_cv_os_cray" >&6; } | |
6908 | if test $ac_cv_os_cray = yes; then | |
6909 | for ac_func in _getb67 GETB67 getb67; do | |
6910 | as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` | |
6911 | ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" | |
6912 | if eval test \"x\$"$as_ac_var"\" = x"yes"; then : | |
73cc7272 | 6913 | |
c0c3707f CB |
6914 | cat >>confdefs.h <<_ACEOF |
6915 | #define CRAY_STACKSEG_END $ac_func | |
6916 | _ACEOF | |
73cc7272 | 6917 | |
c0c3707f CB |
6918 | break |
6919 | fi | |
73cc7272 | 6920 | |
c0c3707f | 6921 | done |
73cc7272 TT |
6922 | fi |
6923 | ||
c0c3707f CB |
6924 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 |
6925 | $as_echo_n "checking stack direction for C alloca... " >&6; } | |
6926 | if ${ac_cv_c_stack_direction+:} false; then : | |
73cc7272 TT |
6927 | $as_echo_n "(cached) " >&6 |
6928 | else | |
c0c3707f CB |
6929 | if test "$cross_compiling" = yes; then : |
6930 | ac_cv_c_stack_direction=0 | |
6931 | else | |
6932 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
73cc7272 | 6933 | /* end confdefs.h. */ |
c0c3707f CB |
6934 | $ac_includes_default |
6935 | int | |
6936 | find_stack_direction (int *addr, int depth) | |
6937 | { | |
6938 | int dir, dummy = 0; | |
6939 | if (! addr) | |
6940 | addr = &dummy; | |
6941 | *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; | |
6942 | dir = depth ? find_stack_direction (addr, depth - 1) : 0; | |
6943 | return dir + dummy; | |
6944 | } | |
73cc7272 | 6945 | |
73cc7272 | 6946 | int |
c0c3707f | 6947 | main (int argc, char **argv) |
73cc7272 | 6948 | { |
c0c3707f | 6949 | return find_stack_direction (0, argc + !argv + 20) < 0; |
73cc7272 TT |
6950 | } |
6951 | _ACEOF | |
c0c3707f CB |
6952 | if ac_fn_c_try_run "$LINENO"; then : |
6953 | ac_cv_c_stack_direction=1 | |
6954 | else | |
6955 | ac_cv_c_stack_direction=-1 | |
73cc7272 | 6956 | fi |
c0c3707f CB |
6957 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
6958 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
73cc7272 | 6959 | fi |
73cc7272 | 6960 | |
73cc7272 | 6961 | fi |
c0c3707f CB |
6962 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 |
6963 | $as_echo "$ac_cv_c_stack_direction" >&6; } | |
6964 | cat >>confdefs.h <<_ACEOF | |
6965 | #define STACK_DIRECTION $ac_cv_c_stack_direction | |
6966 | _ACEOF | |
6967 | ||
73cc7272 TT |
6968 | |
6969 | fi | |
6970 | ||
73cc7272 | 6971 | |
c0c3707f CB |
6972 | GNULIB_INET_NTOP=0; |
6973 | GNULIB_INET_PTON=0; | |
6974 | HAVE_DECL_INET_NTOP=1; | |
6975 | HAVE_DECL_INET_PTON=1; | |
6976 | REPLACE_INET_NTOP=0; | |
6977 | REPLACE_INET_PTON=0; | |
73cc7272 | 6978 | |
73cc7272 | 6979 | |
c0c3707f CB |
6980 | |
6981 | ||
6982 | for ac_header in $ac_header_list | |
6983 | do : | |
6984 | as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` | |
6985 | ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default | |
6986 | " | |
6987 | if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : | |
6988 | cat >>confdefs.h <<_ACEOF | |
6989 | #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 | |
6990 | _ACEOF | |
6991 | ||
73cc7272 TT |
6992 | fi |
6993 | ||
c0c3707f | 6994 | done |
73cc7272 | 6995 | |
c0c3707f CB |
6996 | |
6997 | ||
6998 | ||
6999 | ||
7000 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 | |
7001 | $as_echo_n "checking whether the preprocessor supports include_next... " >&6; } | |
7002 | if ${gl_cv_have_include_next+:} false; then : | |
73cc7272 TT |
7003 | $as_echo_n "(cached) " >&6 |
7004 | else | |
c0c3707f CB |
7005 | rm -rf conftestd1a conftestd1b conftestd2 |
7006 | mkdir conftestd1a conftestd1b conftestd2 | |
7007 | cat <<EOF > conftestd1a/conftest.h | |
7008 | #define DEFINED_IN_CONFTESTD1 | |
7009 | #include_next <conftest.h> | |
7010 | #ifdef DEFINED_IN_CONFTESTD2 | |
7011 | int foo; | |
7012 | #else | |
7013 | #error "include_next doesn't work" | |
7014 | #endif | |
7015 | EOF | |
7016 | cat <<EOF > conftestd1b/conftest.h | |
7017 | #define DEFINED_IN_CONFTESTD1 | |
7018 | #include <stdio.h> | |
7019 | #include_next <conftest.h> | |
7020 | #ifdef DEFINED_IN_CONFTESTD2 | |
7021 | int foo; | |
7022 | #else | |
7023 | #error "include_next doesn't work" | |
7024 | #endif | |
7025 | EOF | |
7026 | cat <<EOF > conftestd2/conftest.h | |
7027 | #ifndef DEFINED_IN_CONFTESTD1 | |
7028 | #error "include_next test doesn't work" | |
7029 | #endif | |
7030 | #define DEFINED_IN_CONFTESTD2 | |
7031 | EOF | |
7032 | gl_save_CPPFLAGS="$CPPFLAGS" | |
7033 | CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" | |
7034 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
73cc7272 | 7035 | /* end confdefs.h. */ |
c0c3707f | 7036 | #include <conftest.h> |
73cc7272 | 7037 | _ACEOF |
c0c3707f CB |
7038 | if ac_fn_c_try_compile "$LINENO"; then : |
7039 | gl_cv_have_include_next=yes | |
7040 | else | |
7041 | CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" | |
7042 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
7043 | /* end confdefs.h. */ | |
7044 | #include <conftest.h> | |
7045 | _ACEOF | |
7046 | if ac_fn_c_try_compile "$LINENO"; then : | |
7047 | gl_cv_have_include_next=buggy | |
7048 | else | |
7049 | gl_cv_have_include_next=no | |
73cc7272 | 7050 | fi |
c0c3707f CB |
7051 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
7052 | ||
73cc7272 | 7053 | fi |
c0c3707f CB |
7054 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
7055 | CPPFLAGS="$gl_save_CPPFLAGS" | |
7056 | rm -rf conftestd1a conftestd1b conftestd2 | |
7057 | ||
73cc7272 | 7058 | fi |
c0c3707f CB |
7059 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 |
7060 | $as_echo "$gl_cv_have_include_next" >&6; } | |
7061 | PRAGMA_SYSTEM_HEADER= | |
7062 | if test $gl_cv_have_include_next = yes; then | |
7063 | INCLUDE_NEXT=include_next | |
7064 | INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next | |
7065 | if test -n "$GCC"; then | |
7066 | PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' | |
7067 | fi | |
7068 | else | |
7069 | if test $gl_cv_have_include_next = buggy; then | |
7070 | INCLUDE_NEXT=include | |
7071 | INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next | |
7072 | else | |
7073 | INCLUDE_NEXT=include | |
7074 | INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include | |
7075 | fi | |
73cc7272 TT |
7076 | fi |
7077 | ||
73cc7272 | 7078 | |
73cc7272 | 7079 | |
c0c3707f CB |
7080 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5 |
7081 | $as_echo_n "checking whether system header files limit the line length... " >&6; } | |
7082 | if ${gl_cv_pragma_columns+:} false; then : | |
73cc7272 TT |
7083 | $as_echo_n "(cached) " >&6 |
7084 | else | |
c0c3707f | 7085 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
73cc7272 | 7086 | /* end confdefs.h. */ |
73cc7272 | 7087 | |
c0c3707f CB |
7088 | #ifdef __TANDEM |
7089 | choke me | |
7090 | #endif | |
73cc7272 | 7091 | |
73cc7272 | 7092 | _ACEOF |
c0c3707f CB |
7093 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
7094 | $EGREP "choke me" >/dev/null 2>&1; then : | |
7095 | gl_cv_pragma_columns=yes | |
7096 | else | |
7097 | gl_cv_pragma_columns=no | |
73cc7272 | 7098 | fi |
c0c3707f | 7099 | rm -f conftest* |
73cc7272 | 7100 | |
73cc7272 TT |
7101 | |
7102 | fi | |
c0c3707f CB |
7103 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5 |
7104 | $as_echo "$gl_cv_pragma_columns" >&6; } | |
7105 | if test $gl_cv_pragma_columns = yes; then | |
7106 | PRAGMA_COLUMNS="#pragma COLUMNS 10000" | |
7107 | else | |
7108 | PRAGMA_COLUMNS= | |
7109 | fi | |
73cc7272 TT |
7110 | |
7111 | ||
7112 | ||
73cc7272 | 7113 | |
73cc7272 TT |
7114 | |
7115 | ||
c0c3707f CB |
7116 | if test $ac_cv_header_features_h = yes; then |
7117 | HAVE_FEATURES_H=1 | |
7118 | else | |
7119 | HAVE_FEATURES_H=0 | |
7120 | fi | |
73cc7272 | 7121 | |
7a6dbc2f SDJ |
7122 | |
7123 | ||
7124 | ||
7125 | ||
c0c3707f CB |
7126 | if test $ac_cv_header_sys_socket_h = no; then |
7127 | for ac_header in ws2tcpip.h | |
7128 | do : | |
7129 | ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" | |
7130 | if test "x$ac_cv_header_ws2tcpip_h" = xyes; then : | |
7131 | cat >>confdefs.h <<_ACEOF | |
7132 | #define HAVE_WS2TCPIP_H 1 | |
7133 | _ACEOF | |
7a6dbc2f | 7134 | |
c0c3707f | 7135 | fi |
7a6dbc2f | 7136 | |
c0c3707f | 7137 | done |
7a6dbc2f | 7138 | |
c0c3707f | 7139 | fi |
7a6dbc2f | 7140 | |
c0c3707f CB |
7141 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 |
7142 | $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } | |
7143 | if test -z "$MKDIR_P"; then | |
7144 | if ${ac_cv_path_mkdir+:} false; then : | |
7145 | $as_echo_n "(cached) " >&6 | |
5e8754f9 | 7146 | else |
c0c3707f CB |
7147 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
7148 | for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin | |
7149 | do | |
7150 | IFS=$as_save_IFS | |
7151 | test -z "$as_dir" && as_dir=. | |
7152 | for ac_prog in mkdir gmkdir; do | |
7153 | for ac_exec_ext in '' $ac_executable_extensions; do | |
7154 | as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue | |
7155 | case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( | |
7156 | 'mkdir (GNU coreutils) '* | \ | |
7157 | 'mkdir (coreutils) '* | \ | |
7158 | 'mkdir (fileutils) '4.1*) | |
7159 | ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext | |
7160 | break 3;; | |
7161 | esac | |
7162 | done | |
7163 | done | |
7164 | done | |
7165 | IFS=$as_save_IFS | |
7a6dbc2f | 7166 | |
5e8754f9 | 7167 | fi |
7a6dbc2f | 7168 | |
c0c3707f CB |
7169 | test -d ./--version && rmdir ./--version |
7170 | if test "${ac_cv_path_mkdir+set}" = set; then | |
7171 | MKDIR_P="$ac_cv_path_mkdir -p" | |
7172 | else | |
7173 | # As a last resort, use the slow shell script. Don't cache a | |
7174 | # value for MKDIR_P within a source directory, because that will | |
7175 | # break other packages using the cache if that directory is | |
7176 | # removed, or if the value is a relative name. | |
7177 | MKDIR_P="$ac_install_sh -d" | |
7178 | fi | |
5e8754f9 | 7179 | fi |
c0c3707f CB |
7180 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 |
7181 | $as_echo "$MKDIR_P" >&6; } | |
7a6dbc2f | 7182 | |
5e8754f9 | 7183 | |
c0c3707f CB |
7184 | GNULIB__EXIT=0; |
7185 | GNULIB_ATOLL=0; | |
7186 | GNULIB_CALLOC_POSIX=0; | |
7187 | GNULIB_CANONICALIZE_FILE_NAME=0; | |
7188 | GNULIB_GETLOADAVG=0; | |
7189 | GNULIB_GETSUBOPT=0; | |
7190 | GNULIB_GRANTPT=0; | |
7191 | GNULIB_MALLOC_POSIX=0; | |
7192 | GNULIB_MBTOWC=0; | |
7193 | GNULIB_MKDTEMP=0; | |
7194 | GNULIB_MKOSTEMP=0; | |
7195 | GNULIB_MKOSTEMPS=0; | |
7196 | GNULIB_MKSTEMP=0; | |
7197 | GNULIB_MKSTEMPS=0; | |
7198 | GNULIB_POSIX_OPENPT=0; | |
7199 | GNULIB_PTSNAME=0; | |
7200 | GNULIB_PTSNAME_R=0; | |
7201 | GNULIB_PUTENV=0; | |
7202 | GNULIB_QSORT_R=0; | |
7203 | GNULIB_RANDOM=0; | |
7204 | GNULIB_RANDOM_R=0; | |
7205 | GNULIB_REALLOCARRAY=0; | |
7206 | GNULIB_REALLOC_POSIX=0; | |
7207 | GNULIB_REALPATH=0; | |
7208 | GNULIB_RPMATCH=0; | |
7209 | GNULIB_SECURE_GETENV=0; | |
7210 | GNULIB_SETENV=0; | |
7211 | GNULIB_STRTOD=0; | |
7212 | GNULIB_STRTOLD=0; | |
7213 | GNULIB_STRTOLL=0; | |
7214 | GNULIB_STRTOULL=0; | |
7215 | GNULIB_SYSTEM_POSIX=0; | |
7216 | GNULIB_UNLOCKPT=0; | |
7217 | GNULIB_UNSETENV=0; | |
7218 | GNULIB_WCTOMB=0; | |
7219 | HAVE__EXIT=1; | |
7220 | HAVE_ATOLL=1; | |
7221 | HAVE_CANONICALIZE_FILE_NAME=1; | |
7222 | HAVE_DECL_GETLOADAVG=1; | |
7223 | HAVE_GETSUBOPT=1; | |
7224 | HAVE_GRANTPT=1; | |
7225 | HAVE_INITSTATE=1; | |
7226 | HAVE_DECL_INITSTATE=1; | |
7227 | HAVE_MBTOWC=1; | |
7228 | HAVE_MKDTEMP=1; | |
7229 | HAVE_MKOSTEMP=1; | |
7230 | HAVE_MKOSTEMPS=1; | |
7231 | HAVE_MKSTEMP=1; | |
7232 | HAVE_MKSTEMPS=1; | |
7233 | HAVE_POSIX_OPENPT=1; | |
7234 | HAVE_PTSNAME=1; | |
7235 | HAVE_PTSNAME_R=1; | |
7236 | HAVE_QSORT_R=1; | |
7237 | HAVE_RANDOM=1; | |
7238 | HAVE_RANDOM_H=1; | |
7239 | HAVE_RANDOM_R=1; | |
7240 | HAVE_REALLOCARRAY=1; | |
7241 | HAVE_REALPATH=1; | |
7242 | HAVE_RPMATCH=1; | |
7243 | HAVE_SECURE_GETENV=1; | |
7244 | HAVE_SETENV=1; | |
7245 | HAVE_DECL_SETENV=1; | |
7246 | HAVE_SETSTATE=1; | |
7247 | HAVE_DECL_SETSTATE=1; | |
7248 | HAVE_STRTOD=1; | |
7249 | HAVE_STRTOLD=1; | |
7250 | HAVE_STRTOLL=1; | |
7251 | HAVE_STRTOULL=1; | |
7252 | HAVE_STRUCT_RANDOM_DATA=1; | |
7253 | HAVE_SYS_LOADAVG_H=0; | |
7254 | HAVE_UNLOCKPT=1; | |
7255 | HAVE_DECL_UNSETENV=1; | |
7256 | REPLACE_CALLOC=0; | |
7257 | REPLACE_CANONICALIZE_FILE_NAME=0; | |
7258 | REPLACE_INITSTATE=0; | |
7259 | REPLACE_MALLOC=0; | |
7260 | REPLACE_MBTOWC=0; | |
7261 | REPLACE_MKSTEMP=0; | |
7262 | REPLACE_PTSNAME=0; | |
7263 | REPLACE_PTSNAME_R=0; | |
7264 | REPLACE_PUTENV=0; | |
7265 | REPLACE_QSORT_R=0; | |
7266 | REPLACE_RANDOM=0; | |
7267 | REPLACE_RANDOM_R=0; | |
7268 | REPLACE_REALLOC=0; | |
7269 | REPLACE_REALPATH=0; | |
7270 | REPLACE_SETENV=0; | |
7271 | REPLACE_SETSTATE=0; | |
7272 | REPLACE_STRTOD=0; | |
7273 | REPLACE_STRTOLD=0; | |
7274 | REPLACE_UNSETENV=0; | |
7275 | REPLACE_WCTOMB=0; | |
7a6dbc2f | 7276 | |
7a6dbc2f | 7277 | |
98399780 | 7278 | |
98399780 | 7279 | |
c0c3707f CB |
7280 | for ac_func in $ac_func_list |
7281 | do : | |
7282 | as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` | |
7283 | ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" | |
7284 | if eval test \"x\$"$as_ac_var"\" = x"yes"; then : | |
7285 | cat >>confdefs.h <<_ACEOF | |
7286 | #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 | |
7287 | _ACEOF | |
472fa5ee | 7288 | |
c0c3707f CB |
7289 | fi |
7290 | done | |
472fa5ee SM |
7291 | |
7292 | ||
7293 | ||
7294 | ||
7295 | ||
7296 | ||
7297 | ||
7298 | ||
7299 | ||
c0c3707f CB |
7300 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 |
7301 | $as_echo_n "checking whether // is distinct from /... " >&6; } | |
7302 | if ${gl_cv_double_slash_root+:} false; then : | |
7303 | $as_echo_n "(cached) " >&6 | |
5e8754f9 | 7304 | else |
c0c3707f CB |
7305 | if test x"$cross_compiling" = xyes ; then |
7306 | # When cross-compiling, there is no way to tell whether // is special | |
7307 | # short of a list of hosts. However, the only known hosts to date | |
7308 | # that have a distinct // are Apollo DomainOS (too old to port to), | |
7309 | # Cygwin, and z/OS. If anyone knows of another system for which // has | |
7310 | # special semantics and is distinct from /, please report it to | |
7311 | # <bug-gnulib@gnu.org>. | |
7312 | case $host in | |
7313 | *-cygwin | i370-ibm-openedition) | |
7314 | gl_cv_double_slash_root=yes ;; | |
7315 | *) | |
7316 | # Be optimistic and assume that / and // are the same when we | |
7317 | # don't know. | |
7318 | gl_cv_double_slash_root='unknown, assuming no' ;; | |
7319 | esac | |
7320 | else | |
7321 | set x `ls -di / // 2>/dev/null` | |
7322 | if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then | |
7323 | gl_cv_double_slash_root=no | |
7324 | else | |
7325 | gl_cv_double_slash_root=yes | |
7326 | fi | |
7327 | fi | |
5e8754f9 | 7328 | fi |
c0c3707f CB |
7329 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 |
7330 | $as_echo "$gl_cv_double_slash_root" >&6; } | |
7331 | if test "$gl_cv_double_slash_root" = yes; then | |
472fa5ee | 7332 | |
c0c3707f | 7333 | $as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h |
472fa5ee | 7334 | |
c0c3707f | 7335 | fi |
472fa5ee SM |
7336 | |
7337 | ||
472fa5ee | 7338 | |
c0c3707f CB |
7339 | |
7340 | ||
7341 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether realpath works" >&5 | |
7342 | $as_echo_n "checking whether realpath works... " >&6; } | |
7343 | if ${gl_cv_func_realpath_works+:} false; then : | |
5e8754f9 SDJ |
7344 | $as_echo_n "(cached) " >&6 |
7345 | else | |
c0c3707f CB |
7346 | |
7347 | touch conftest.a | |
7348 | mkdir conftest.d | |
7349 | if test "$cross_compiling" = yes; then : | |
7350 | case "$host_os" in | |
7351 | # Guess yes on glibc systems. | |
7352 | *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;; | |
7353 | # Guess yes on musl systems. | |
7354 | *-musl*) gl_cv_func_realpath_works="guessing yes" ;; | |
7355 | # Guess no on native Windows. | |
7356 | mingw*) gl_cv_func_realpath_works="guessing no" ;; | |
7357 | # If we don't know, obey --enable-cross-guesses. | |
7358 | *) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;; | |
7359 | esac | |
7360 | ||
5e8754f9 SDJ |
7361 | else |
7362 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
7363 | /* end confdefs.h. */ | |
c0c3707f CB |
7364 | |
7365 | ||
7366 | ||
7367 | #include <stdlib.h> | |
7368 | #if defined __MACH__ && defined __APPLE__ | |
7369 | /* Avoid a crash on Mac OS X. */ | |
7370 | #include <mach/mach.h> | |
7371 | #include <mach/mach_error.h> | |
7372 | #include <mach/thread_status.h> | |
7373 | #include <mach/exception.h> | |
7374 | #include <mach/task.h> | |
7375 | #include <pthread.h> | |
7376 | /* The exception port on which our thread listens. */ | |
7377 | static mach_port_t our_exception_port; | |
7378 | /* The main function of the thread listening for exceptions of type | |
7379 | EXC_BAD_ACCESS. */ | |
7380 | static void * | |
7381 | mach_exception_thread (void *arg) | |
5e8754f9 | 7382 | { |
c0c3707f CB |
7383 | /* Buffer for a message to be received. */ |
7384 | struct { | |
7385 | mach_msg_header_t head; | |
7386 | mach_msg_body_t msgh_body; | |
7387 | char data[1024]; | |
7388 | } msg; | |
7389 | mach_msg_return_t retval; | |
7390 | /* Wait for a message on the exception port. */ | |
7391 | retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), | |
7392 | our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); | |
7393 | if (retval != MACH_MSG_SUCCESS) | |
7394 | abort (); | |
7395 | exit (1); | |
7396 | } | |
7397 | static void | |
7398 | nocrash_init (void) | |
7399 | { | |
7400 | mach_port_t self = mach_task_self (); | |
7401 | /* Allocate a port on which the thread shall listen for exceptions. */ | |
7402 | if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) | |
7403 | == KERN_SUCCESS) { | |
7404 | /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ | |
7405 | if (mach_port_insert_right (self, our_exception_port, our_exception_port, | |
7406 | MACH_MSG_TYPE_MAKE_SEND) | |
7407 | == KERN_SUCCESS) { | |
7408 | /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting | |
7409 | for us. */ | |
7410 | exception_mask_t mask = EXC_MASK_BAD_ACCESS; | |
7411 | /* Create the thread listening on the exception port. */ | |
7412 | pthread_attr_t attr; | |
7413 | pthread_t thread; | |
7414 | if (pthread_attr_init (&attr) == 0 | |
7415 | && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 | |
7416 | && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { | |
7417 | pthread_attr_destroy (&attr); | |
7418 | /* Replace the exception port info for these exceptions with our own. | |
7419 | Note that we replace the exception port for the entire task, not only | |
7420 | for a particular thread. This has the effect that when our exception | |
7421 | port gets the message, the thread specific exception port has already | |
7422 | been asked, and we don't need to bother about it. | |
7423 | See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ | |
7424 | task_set_exception_ports (self, mask, our_exception_port, | |
7425 | EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); | |
7426 | } | |
7427 | } | |
7428 | } | |
7429 | } | |
7430 | #elif defined _WIN32 && ! defined __CYGWIN__ | |
7431 | /* Avoid a crash on native Windows. */ | |
7432 | #define WIN32_LEAN_AND_MEAN | |
7433 | #include <windows.h> | |
7434 | #include <winerror.h> | |
7435 | static LONG WINAPI | |
7436 | exception_filter (EXCEPTION_POINTERS *ExceptionInfo) | |
7437 | { | |
7438 | switch (ExceptionInfo->ExceptionRecord->ExceptionCode) | |
7439 | { | |
7440 | case EXCEPTION_ACCESS_VIOLATION: | |
7441 | case EXCEPTION_IN_PAGE_ERROR: | |
7442 | case EXCEPTION_STACK_OVERFLOW: | |
7443 | case EXCEPTION_GUARD_PAGE: | |
7444 | case EXCEPTION_PRIV_INSTRUCTION: | |
7445 | case EXCEPTION_ILLEGAL_INSTRUCTION: | |
7446 | case EXCEPTION_DATATYPE_MISALIGNMENT: | |
7447 | case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: | |
7448 | case EXCEPTION_NONCONTINUABLE_EXCEPTION: | |
7449 | exit (1); | |
7450 | } | |
7451 | return EXCEPTION_CONTINUE_SEARCH; | |
7452 | } | |
7453 | static void | |
7454 | nocrash_init (void) | |
7455 | { | |
7456 | SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); | |
7457 | } | |
7458 | #else | |
7459 | /* Avoid a crash on POSIX systems. */ | |
7460 | #include <signal.h> | |
7461 | #include <unistd.h> | |
7462 | /* A POSIX signal handler. */ | |
7463 | static void | |
7464 | exception_handler (int sig) | |
7465 | { | |
7466 | _exit (1); | |
7467 | } | |
7468 | static void | |
7469 | nocrash_init (void) | |
7470 | { | |
7471 | #ifdef SIGSEGV | |
7472 | signal (SIGSEGV, exception_handler); | |
7473 | #endif | |
7474 | #ifdef SIGBUS | |
7475 | signal (SIGBUS, exception_handler); | |
7476 | #endif | |
5e8754f9 | 7477 | } |
c0c3707f CB |
7478 | #endif |
7479 | ||
7480 | #include <stdlib.h> | |
7481 | #include <string.h> | |
472fa5ee | 7482 | |
5e8754f9 | 7483 | int |
c0c3707f | 7484 | main () |
5e8754f9 | 7485 | { |
c0c3707f CB |
7486 | |
7487 | int result = 0; | |
7488 | { | |
7489 | char *name = realpath ("conftest.a", NULL); | |
7490 | if (!(name && *name == '/')) | |
7491 | result |= 1; | |
7492 | free (name); | |
7493 | } | |
7494 | { | |
7495 | char *name = realpath ("conftest.b/../conftest.a", NULL); | |
7496 | if (name != NULL) | |
7497 | result |= 2; | |
7498 | free (name); | |
7499 | } | |
7500 | { | |
7501 | char *name = realpath ("conftest.a/", NULL); | |
7502 | if (name != NULL) | |
7503 | result |= 4; | |
7504 | free (name); | |
7505 | } | |
7506 | { | |
7507 | char *name1 = realpath (".", NULL); | |
7508 | char *name2 = realpath ("conftest.d//./..", NULL); | |
7509 | if (! name1 || ! name2 || strcmp (name1, name2)) | |
7510 | result |= 8; | |
7511 | free (name1); | |
7512 | free (name2); | |
7513 | } | |
7514 | return result; | |
7515 | ||
7516 | ; | |
7517 | return 0; | |
5e8754f9 | 7518 | } |
c0c3707f | 7519 | |
5e8754f9 SDJ |
7520 | _ACEOF |
7521 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 7522 | gl_cv_func_realpath_works=yes |
5e8754f9 | 7523 | else |
c0c3707f | 7524 | gl_cv_func_realpath_works=no |
5e8754f9 SDJ |
7525 | fi |
7526 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
7527 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
7528 | fi | |
472fa5ee | 7529 | |
c0c3707f | 7530 | rm -rf conftest.a conftest.d |
98399780 | 7531 | |
5e8754f9 | 7532 | fi |
c0c3707f CB |
7533 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_realpath_works" >&5 |
7534 | $as_echo "$gl_cv_func_realpath_works" >&6; } | |
7535 | case "$gl_cv_func_realpath_works" in | |
7536 | *yes) | |
98399780 | 7537 | |
c0c3707f | 7538 | $as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h |
98399780 | 7539 | |
c0c3707f CB |
7540 | ;; |
7541 | esac | |
725e2999 JB |
7542 | |
7543 | ||
725e2999 | 7544 | |
725e2999 | 7545 | |
725e2999 JB |
7546 | |
7547 | ||
7548 | ||
7549 | ||
7550 | ||
7551 | ||
7552 | ||
c0c3707f CB |
7553 | GNULIB_ACCESS=0; |
7554 | GNULIB_CHDIR=0; | |
7555 | GNULIB_CHOWN=0; | |
7556 | GNULIB_CLOSE=0; | |
7557 | GNULIB_COPY_FILE_RANGE=0; | |
7558 | GNULIB_DUP=0; | |
7559 | GNULIB_DUP2=0; | |
7560 | GNULIB_DUP3=0; | |
7561 | GNULIB_ENVIRON=0; | |
7562 | GNULIB_EUIDACCESS=0; | |
7563 | GNULIB_FACCESSAT=0; | |
7564 | GNULIB_FCHDIR=0; | |
7565 | GNULIB_FCHOWNAT=0; | |
7566 | GNULIB_FDATASYNC=0; | |
7567 | GNULIB_FSYNC=0; | |
7568 | GNULIB_FTRUNCATE=0; | |
7569 | GNULIB_GETCWD=0; | |
7570 | GNULIB_GETDOMAINNAME=0; | |
7571 | GNULIB_GETDTABLESIZE=0; | |
7572 | GNULIB_GETGROUPS=0; | |
7573 | GNULIB_GETHOSTNAME=0; | |
7574 | GNULIB_GETLOGIN=0; | |
7575 | GNULIB_GETLOGIN_R=0; | |
5df4cba6 | 7576 | GNULIB_GETOPT_POSIX=0; |
c0c3707f CB |
7577 | GNULIB_GETPAGESIZE=0; |
7578 | GNULIB_GETPASS=0; | |
7579 | GNULIB_GETUSERSHELL=0; | |
7580 | GNULIB_GROUP_MEMBER=0; | |
7581 | GNULIB_ISATTY=0; | |
7582 | GNULIB_LCHOWN=0; | |
7583 | GNULIB_LINK=0; | |
7584 | GNULIB_LINKAT=0; | |
7585 | GNULIB_LSEEK=0; | |
7586 | GNULIB_PIPE=0; | |
7587 | GNULIB_PIPE2=0; | |
7588 | GNULIB_PREAD=0; | |
7589 | GNULIB_PWRITE=0; | |
7590 | GNULIB_READ=0; | |
7591 | GNULIB_READLINK=0; | |
7592 | GNULIB_READLINKAT=0; | |
7593 | GNULIB_RMDIR=0; | |
7594 | GNULIB_SETHOSTNAME=0; | |
7595 | GNULIB_SLEEP=0; | |
7596 | GNULIB_SYMLINK=0; | |
7597 | GNULIB_SYMLINKAT=0; | |
7598 | GNULIB_TRUNCATE=0; | |
7599 | GNULIB_TTYNAME_R=0; | |
7600 | GNULIB_UNISTD_H_NONBLOCKING=0; | |
7601 | GNULIB_UNISTD_H_SIGPIPE=0; | |
7602 | GNULIB_UNLINK=0; | |
7603 | GNULIB_UNLINKAT=0; | |
7604 | GNULIB_USLEEP=0; | |
7605 | GNULIB_WRITE=0; | |
7606 | HAVE_CHOWN=1; | |
7607 | HAVE_COPY_FILE_RANGE=1; | |
7608 | HAVE_DUP2=1; | |
7609 | HAVE_DUP3=1; | |
7610 | HAVE_EUIDACCESS=1; | |
7611 | HAVE_FACCESSAT=1; | |
7612 | HAVE_FCHDIR=1; | |
7613 | HAVE_FCHOWNAT=1; | |
7614 | HAVE_FDATASYNC=1; | |
7615 | HAVE_FSYNC=1; | |
7616 | HAVE_FTRUNCATE=1; | |
7617 | HAVE_GETDTABLESIZE=1; | |
7618 | HAVE_GETGROUPS=1; | |
7619 | HAVE_GETHOSTNAME=1; | |
7620 | HAVE_GETLOGIN=1; | |
7621 | HAVE_GETPAGESIZE=1; | |
7622 | HAVE_GETPASS=1; | |
7623 | HAVE_GROUP_MEMBER=1; | |
7624 | HAVE_LCHOWN=1; | |
7625 | HAVE_LINK=1; | |
7626 | HAVE_LINKAT=1; | |
7627 | HAVE_PIPE=1; | |
7628 | HAVE_PIPE2=1; | |
7629 | HAVE_PREAD=1; | |
7630 | HAVE_PWRITE=1; | |
7631 | HAVE_READLINK=1; | |
7632 | HAVE_READLINKAT=1; | |
7633 | HAVE_SETHOSTNAME=1; | |
7634 | HAVE_SLEEP=1; | |
7635 | HAVE_SYMLINK=1; | |
7636 | HAVE_SYMLINKAT=1; | |
7637 | HAVE_UNLINKAT=1; | |
7638 | HAVE_USLEEP=1; | |
7639 | HAVE_DECL_ENVIRON=1; | |
7640 | HAVE_DECL_FCHDIR=1; | |
7641 | HAVE_DECL_FDATASYNC=1; | |
7642 | HAVE_DECL_GETDOMAINNAME=1; | |
7643 | HAVE_DECL_GETLOGIN=1; | |
7644 | HAVE_DECL_GETLOGIN_R=1; | |
7645 | HAVE_DECL_GETPAGESIZE=1; | |
7646 | HAVE_DECL_GETUSERSHELL=1; | |
7647 | HAVE_DECL_SETHOSTNAME=1; | |
7648 | HAVE_DECL_TRUNCATE=1; | |
7649 | HAVE_DECL_TTYNAME_R=1; | |
7650 | HAVE_OS_H=0; | |
7651 | HAVE_SYS_PARAM_H=0; | |
7652 | REPLACE_ACCESS=0; | |
7653 | REPLACE_CHOWN=0; | |
7654 | REPLACE_CLOSE=0; | |
7655 | REPLACE_DUP=0; | |
7656 | REPLACE_DUP2=0; | |
7657 | REPLACE_FACCESSAT=0; | |
7658 | REPLACE_FCHOWNAT=0; | |
7659 | REPLACE_FTRUNCATE=0; | |
7660 | REPLACE_GETCWD=0; | |
7661 | REPLACE_GETDOMAINNAME=0; | |
7662 | REPLACE_GETDTABLESIZE=0; | |
7663 | REPLACE_GETLOGIN_R=0; | |
7664 | REPLACE_GETGROUPS=0; | |
7665 | REPLACE_GETPAGESIZE=0; | |
7666 | REPLACE_GETPASS=0; | |
7667 | REPLACE_ISATTY=0; | |
7668 | REPLACE_LCHOWN=0; | |
7669 | REPLACE_LINK=0; | |
7670 | REPLACE_LINKAT=0; | |
7671 | REPLACE_LSEEK=0; | |
7672 | REPLACE_PREAD=0; | |
7673 | REPLACE_PWRITE=0; | |
7674 | REPLACE_READ=0; | |
7675 | REPLACE_READLINK=0; | |
7676 | REPLACE_READLINKAT=0; | |
7677 | REPLACE_RMDIR=0; | |
7678 | REPLACE_SLEEP=0; | |
7679 | REPLACE_SYMLINK=0; | |
7680 | REPLACE_SYMLINKAT=0; | |
7681 | REPLACE_TRUNCATE=0; | |
7682 | REPLACE_TTYNAME_R=0; | |
7683 | REPLACE_UNLINK=0; | |
7684 | REPLACE_UNLINKAT=0; | |
7685 | REPLACE_USLEEP=0; | |
7686 | REPLACE_WRITE=0; | |
7687 | UNISTD_H_HAVE_WINSOCK2_H=0; | |
7688 | UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; | |
725e2999 | 7689 | |
725e2999 | 7690 | |
725e2999 JB |
7691 | |
7692 | ||
7693 | ||
725e2999 | 7694 | |
725e2999 | 7695 | |
725e2999 JB |
7696 | |
7697 | ||
c0c3707f CB |
7698 | |
7699 | ||
7700 | if test $ac_cv_func__set_invalid_parameter_handler = yes; then | |
7701 | HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 | |
7702 | ||
7703 | $as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h | |
7704 | ||
725e2999 | 7705 | else |
c0c3707f | 7706 | HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 |
725e2999 JB |
7707 | fi |
7708 | ||
7709 | ||
7710 | ||
7711 | ||
7712 | ||
c0c3707f CB |
7713 | GNULIB_OPENDIR=0; |
7714 | GNULIB_READDIR=0; | |
7715 | GNULIB_REWINDDIR=0; | |
7716 | GNULIB_CLOSEDIR=0; | |
7717 | GNULIB_DIRFD=0; | |
7718 | GNULIB_FDOPENDIR=0; | |
7719 | GNULIB_SCANDIR=0; | |
7720 | GNULIB_ALPHASORT=0; | |
7721 | HAVE_OPENDIR=1; | |
7722 | HAVE_READDIR=1; | |
7723 | HAVE_REWINDDIR=1; | |
7724 | HAVE_CLOSEDIR=1; | |
7725 | HAVE_DECL_DIRFD=1; | |
7726 | HAVE_DECL_FDOPENDIR=1; | |
7727 | HAVE_FDOPENDIR=1; | |
7728 | HAVE_SCANDIR=1; | |
7729 | HAVE_ALPHASORT=1; | |
7730 | REPLACE_OPENDIR=0; | |
7731 | REPLACE_CLOSEDIR=0; | |
7732 | REPLACE_DIRFD=0; | |
7733 | REPLACE_FDOPENDIR=0; | |
725e2999 JB |
7734 | |
7735 | ||
7736 | ||
7737 | ||
725e2999 JB |
7738 | |
7739 | ||
7740 | ||
7741 | ||
725e2999 JB |
7742 | |
7743 | ||
c0c3707f CB |
7744 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5 |
7745 | $as_echo_n "checking if environ is properly declared... " >&6; } | |
7746 | if ${gt_cv_var_environ_declaration+:} false; then : | |
725e2999 JB |
7747 | $as_echo_n "(cached) " >&6 |
7748 | else | |
c0c3707f CB |
7749 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
7750 | /* end confdefs.h. */ | |
7751 | #if HAVE_UNISTD_H | |
7752 | #include <unistd.h> | |
7753 | #endif | |
7754 | /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */ | |
7755 | #include <stdlib.h> | |
725e2999 | 7756 | |
c0c3707f CB |
7757 | extern struct { int foo; } environ; |
7758 | int | |
7759 | main () | |
7760 | { | |
7761 | environ.foo = 1; | |
7762 | ; | |
7763 | return 0; | |
7764 | } | |
7765 | _ACEOF | |
7766 | if ac_fn_c_try_compile "$LINENO"; then : | |
7767 | gt_cv_var_environ_declaration=no | |
7768 | else | |
7769 | gt_cv_var_environ_declaration=yes | |
725e2999 | 7770 | fi |
c0c3707f CB |
7771 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
7772 | fi | |
7773 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5 | |
7774 | $as_echo "$gt_cv_var_environ_declaration" >&6; } | |
7775 | if test $gt_cv_var_environ_declaration = yes; then | |
7776 | ||
7777 | $as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h | |
725e2999 | 7778 | |
725e2999 | 7779 | fi |
725e2999 JB |
7780 | |
7781 | ||
c0c3707f CB |
7782 | if test $gt_cv_var_environ_declaration != yes; then |
7783 | HAVE_DECL_ENVIRON=0 | |
7784 | fi | |
6ec2e0f5 SDJ |
7785 | |
7786 | ||
7787 | ||
c0c3707f CB |
7788 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5 |
7789 | $as_echo_n "checking for complete errno.h... " >&6; } | |
7790 | if ${gl_cv_header_errno_h_complete+:} false; then : | |
7791 | $as_echo_n "(cached) " >&6 | |
7792 | else | |
6ec2e0f5 | 7793 | |
c0c3707f CB |
7794 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
7795 | /* end confdefs.h. */ | |
472fa5ee | 7796 | |
c0c3707f CB |
7797 | #include <errno.h> |
7798 | #if !defined ETXTBSY | |
7799 | booboo | |
7800 | #endif | |
7801 | #if !defined ENOMSG | |
7802 | booboo | |
7803 | #endif | |
7804 | #if !defined EIDRM | |
7805 | booboo | |
7806 | #endif | |
7807 | #if !defined ENOLINK | |
7808 | booboo | |
7809 | #endif | |
7810 | #if !defined EPROTO | |
7811 | booboo | |
7812 | #endif | |
7813 | #if !defined EMULTIHOP | |
7814 | booboo | |
7815 | #endif | |
7816 | #if !defined EBADMSG | |
7817 | booboo | |
7818 | #endif | |
7819 | #if !defined EOVERFLOW | |
7820 | booboo | |
7821 | #endif | |
7822 | #if !defined ENOTSUP | |
7823 | booboo | |
7824 | #endif | |
7825 | #if !defined ENETRESET | |
7826 | booboo | |
7827 | #endif | |
7828 | #if !defined ECONNABORTED | |
7829 | booboo | |
7830 | #endif | |
7831 | #if !defined ESTALE | |
7832 | booboo | |
7833 | #endif | |
7834 | #if !defined EDQUOT | |
7835 | booboo | |
7836 | #endif | |
7837 | #if !defined ECANCELED | |
7838 | booboo | |
7839 | #endif | |
7840 | #if !defined EOWNERDEAD | |
7841 | booboo | |
7842 | #endif | |
7843 | #if !defined ENOTRECOVERABLE | |
7844 | booboo | |
7845 | #endif | |
7846 | #if !defined EILSEQ | |
7847 | booboo | |
7848 | #endif | |
472fa5ee | 7849 | |
c0c3707f CB |
7850 | _ACEOF |
7851 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
7852 | $EGREP "booboo" >/dev/null 2>&1; then : | |
7853 | gl_cv_header_errno_h_complete=no | |
7854 | else | |
7855 | gl_cv_header_errno_h_complete=yes | |
5e8754f9 | 7856 | fi |
c0c3707f | 7857 | rm -f conftest* |
472fa5ee SM |
7858 | |
7859 | ||
c0c3707f CB |
7860 | fi |
7861 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5 | |
7862 | $as_echo "$gl_cv_header_errno_h_complete" >&6; } | |
7863 | if test $gl_cv_header_errno_h_complete = yes; then | |
7864 | ERRNO_H='' | |
7865 | else | |
472fa5ee SM |
7866 | |
7867 | ||
7868 | ||
7869 | ||
7870 | ||
472fa5ee SM |
7871 | |
7872 | ||
7873 | ||
c0c3707f CB |
7874 | if test $gl_cv_have_include_next = yes; then |
7875 | gl_cv_next_errno_h='<'errno.h'>' | |
7876 | else | |
7877 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5 | |
7878 | $as_echo_n "checking absolute name of <errno.h>... " >&6; } | |
7879 | if ${gl_cv_next_errno_h+:} false; then : | |
5e8754f9 SDJ |
7880 | $as_echo_n "(cached) " >&6 |
7881 | else | |
6ec2e0f5 | 7882 | |
6ec2e0f5 | 7883 | |
6ec2e0f5 | 7884 | |
c0c3707f CB |
7885 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
7886 | /* end confdefs.h. */ | |
7887 | #include <errno.h> | |
7888 | _ACEOF | |
7889 | case "$host_os" in | |
7890 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
7891 | *) gl_absname_cpp="$ac_cpp" ;; | |
7892 | esac | |
6ec2e0f5 | 7893 | |
c0c3707f CB |
7894 | case "$host_os" in |
7895 | mingw*) | |
7896 | gl_dirsep_regex='[/\\]' | |
7897 | ;; | |
7898 | *) | |
7899 | gl_dirsep_regex='\/' | |
7900 | ;; | |
7901 | esac | |
7902 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
7903 | gl_header_literal_regex=`echo 'errno.h' \ | |
7904 | | sed -e "$gl_make_literal_regex_sed"` | |
7905 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
7906 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
7907 | s|^/[^/]|//&| | |
7908 | p | |
7909 | q | |
7910 | }' | |
6ec2e0f5 | 7911 | |
c0c3707f CB |
7912 | gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
7913 | sed -n "$gl_absolute_header_sed"` | |
6ec2e0f5 | 7914 | |
c0c3707f CB |
7915 | gl_header=$gl_cv_absolute_errno_h |
7916 | gl_cv_next_errno_h='"'$gl_header'"' | |
6ec2e0f5 SDJ |
7917 | |
7918 | ||
c0c3707f CB |
7919 | fi |
7920 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5 | |
7921 | $as_echo "$gl_cv_next_errno_h" >&6; } | |
7922 | fi | |
7923 | NEXT_ERRNO_H=$gl_cv_next_errno_h | |
6ec2e0f5 | 7924 | |
c0c3707f CB |
7925 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
7926 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
7927 | gl_next_as_first_directive='<'errno.h'>' | |
7928 | else | |
7929 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
7930 | gl_next_as_first_directive=$gl_cv_next_errno_h | |
7931 | fi | |
7932 | NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive | |
6ec2e0f5 | 7933 | |
472fa5ee SM |
7934 | |
7935 | ||
7936 | ||
c0c3707f CB |
7937 | ERRNO_H='errno.h' |
7938 | fi | |
472fa5ee | 7939 | |
c0c3707f CB |
7940 | if test -n "$ERRNO_H"; then |
7941 | GL_GENERATE_ERRNO_H_TRUE= | |
7942 | GL_GENERATE_ERRNO_H_FALSE='#' | |
5e8754f9 | 7943 | else |
c0c3707f CB |
7944 | GL_GENERATE_ERRNO_H_TRUE='#' |
7945 | GL_GENERATE_ERRNO_H_FALSE= | |
7946 | fi | |
472fa5ee SM |
7947 | |
7948 | ||
c0c3707f CB |
7949 | if test -n "$ERRNO_H"; then |
7950 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5 | |
7951 | $as_echo_n "checking for EMULTIHOP value... " >&6; } | |
7952 | if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then : | |
7953 | $as_echo_n "(cached) " >&6 | |
5e8754f9 | 7954 | else |
e26b6bb0 | 7955 | |
c0c3707f CB |
7956 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
7957 | /* end confdefs.h. */ | |
e26b6bb0 | 7958 | |
c0c3707f CB |
7959 | #include <errno.h> |
7960 | #ifdef EMULTIHOP | |
7961 | yes | |
88b48903 | 7962 | #endif |
88b48903 | 7963 | |
c0c3707f CB |
7964 | _ACEOF |
7965 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
7966 | $EGREP "yes" >/dev/null 2>&1; then : | |
7967 | gl_cv_header_errno_h_EMULTIHOP=yes | |
7968 | else | |
7969 | gl_cv_header_errno_h_EMULTIHOP=no | |
7970 | fi | |
7971 | rm -f conftest* | |
88b48903 | 7972 | |
c0c3707f CB |
7973 | if test $gl_cv_header_errno_h_EMULTIHOP = no; then |
7974 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
7975 | /* end confdefs.h. */ | |
88b48903 | 7976 | |
c0c3707f CB |
7977 | #define _XOPEN_SOURCE_EXTENDED 1 |
7978 | #include <errno.h> | |
7979 | #ifdef EMULTIHOP | |
7980 | yes | |
7981 | #endif | |
88b48903 WN |
7982 | |
7983 | _ACEOF | |
c0c3707f CB |
7984 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
7985 | $EGREP "yes" >/dev/null 2>&1; then : | |
7986 | gl_cv_header_errno_h_EMULTIHOP=hidden | |
88b48903 | 7987 | fi |
c0c3707f | 7988 | rm -f conftest* |
88b48903 | 7989 | |
c0c3707f CB |
7990 | if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then |
7991 | if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" " | |
7992 | #define _XOPEN_SOURCE_EXTENDED 1 | |
7993 | #include <errno.h> | |
7994 | /* The following two lines are a workaround against an autoconf-2.52 bug. */ | |
7995 | #include <stdio.h> | |
7996 | #include <stdlib.h> | |
7997 | "; then : | |
88b48903 WN |
7998 | |
7999 | fi | |
88b48903 | 8000 | |
c0c3707f CB |
8001 | fi |
8002 | fi | |
88b48903 | 8003 | |
c0c3707f CB |
8004 | fi |
8005 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 | |
8006 | $as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; } | |
8007 | case $gl_cv_header_errno_h_EMULTIHOP in | |
8008 | yes | no) | |
8009 | EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE= | |
8010 | ;; | |
8011 | *) | |
8012 | EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP" | |
8013 | ;; | |
8014 | esac | |
88b48903 | 8015 | |
e26b6bb0 | 8016 | |
c0c3707f | 8017 | fi |
e26b6bb0 | 8018 | |
3d99e817 | 8019 | |
c0c3707f CB |
8020 | if test -n "$ERRNO_H"; then |
8021 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5 | |
8022 | $as_echo_n "checking for ENOLINK value... " >&6; } | |
8023 | if ${gl_cv_header_errno_h_ENOLINK+:} false; then : | |
8024 | $as_echo_n "(cached) " >&6 | |
8025 | else | |
472fa5ee | 8026 | |
c0c3707f CB |
8027 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8028 | /* end confdefs.h. */ | |
472fa5ee | 8029 | |
c0c3707f CB |
8030 | #include <errno.h> |
8031 | #ifdef ENOLINK | |
8032 | yes | |
8033 | #endif | |
472fa5ee | 8034 | |
c0c3707f CB |
8035 | _ACEOF |
8036 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
8037 | $EGREP "yes" >/dev/null 2>&1; then : | |
8038 | gl_cv_header_errno_h_ENOLINK=yes | |
8039 | else | |
8040 | gl_cv_header_errno_h_ENOLINK=no | |
8041 | fi | |
8042 | rm -f conftest* | |
472fa5ee | 8043 | |
c0c3707f CB |
8044 | if test $gl_cv_header_errno_h_ENOLINK = no; then |
8045 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8046 | /* end confdefs.h. */ | |
3d99e817 | 8047 | |
c0c3707f CB |
8048 | #define _XOPEN_SOURCE_EXTENDED 1 |
8049 | #include <errno.h> | |
8050 | #ifdef ENOLINK | |
8051 | yes | |
8052 | #endif | |
3d99e817 | 8053 | |
c0c3707f CB |
8054 | _ACEOF |
8055 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
8056 | $EGREP "yes" >/dev/null 2>&1; then : | |
8057 | gl_cv_header_errno_h_ENOLINK=hidden | |
8058 | fi | |
8059 | rm -f conftest* | |
3d99e817 | 8060 | |
c0c3707f CB |
8061 | if test $gl_cv_header_errno_h_ENOLINK = hidden; then |
8062 | if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" " | |
8063 | #define _XOPEN_SOURCE_EXTENDED 1 | |
8064 | #include <errno.h> | |
8065 | /* The following two lines are a workaround against an autoconf-2.52 bug. */ | |
8066 | #include <stdio.h> | |
8067 | #include <stdlib.h> | |
8068 | "; then : | |
3d99e817 | 8069 | |
c0c3707f | 8070 | fi |
3d99e817 | 8071 | |
c0c3707f CB |
8072 | fi |
8073 | fi | |
3d99e817 | 8074 | |
c0c3707f CB |
8075 | fi |
8076 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5 | |
8077 | $as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; } | |
8078 | case $gl_cv_header_errno_h_ENOLINK in | |
8079 | yes | no) | |
8080 | ENOLINK_HIDDEN=0; ENOLINK_VALUE= | |
8081 | ;; | |
8082 | *) | |
8083 | ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK" | |
8084 | ;; | |
8085 | esac | |
18848e28 | 8086 | |
18848e28 | 8087 | |
c0c3707f | 8088 | fi |
18848e28 | 8089 | |
18848e28 | 8090 | |
c0c3707f CB |
8091 | if test -n "$ERRNO_H"; then |
8092 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5 | |
8093 | $as_echo_n "checking for EOVERFLOW value... " >&6; } | |
8094 | if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then : | |
8095 | $as_echo_n "(cached) " >&6 | |
8096 | else | |
18848e28 | 8097 | |
c0c3707f CB |
8098 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8099 | /* end confdefs.h. */ | |
18848e28 | 8100 | |
c0c3707f CB |
8101 | #include <errno.h> |
8102 | #ifdef EOVERFLOW | |
8103 | yes | |
8104 | #endif | |
18848e28 | 8105 | |
c0c3707f CB |
8106 | _ACEOF |
8107 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
8108 | $EGREP "yes" >/dev/null 2>&1; then : | |
8109 | gl_cv_header_errno_h_EOVERFLOW=yes | |
8110 | else | |
8111 | gl_cv_header_errno_h_EOVERFLOW=no | |
8112 | fi | |
8113 | rm -f conftest* | |
18848e28 | 8114 | |
c0c3707f CB |
8115 | if test $gl_cv_header_errno_h_EOVERFLOW = no; then |
8116 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8117 | /* end confdefs.h. */ | |
18848e28 | 8118 | |
c0c3707f CB |
8119 | #define _XOPEN_SOURCE_EXTENDED 1 |
8120 | #include <errno.h> | |
8121 | #ifdef EOVERFLOW | |
8122 | yes | |
8123 | #endif | |
18848e28 | 8124 | |
c0c3707f CB |
8125 | _ACEOF |
8126 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
8127 | $EGREP "yes" >/dev/null 2>&1; then : | |
8128 | gl_cv_header_errno_h_EOVERFLOW=hidden | |
8129 | fi | |
8130 | rm -f conftest* | |
18848e28 | 8131 | |
c0c3707f CB |
8132 | if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then |
8133 | if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" " | |
8134 | #define _XOPEN_SOURCE_EXTENDED 1 | |
8135 | #include <errno.h> | |
8136 | /* The following two lines are a workaround against an autoconf-2.52 bug. */ | |
8137 | #include <stdio.h> | |
8138 | #include <stdlib.h> | |
8139 | "; then : | |
18848e28 | 8140 | |
c0c3707f | 8141 | fi |
18848e28 | 8142 | |
c0c3707f CB |
8143 | fi |
8144 | fi | |
18848e28 | 8145 | |
c0c3707f CB |
8146 | fi |
8147 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 | |
8148 | $as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; } | |
8149 | case $gl_cv_header_errno_h_EOVERFLOW in | |
8150 | yes | no) | |
8151 | EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE= | |
8152 | ;; | |
8153 | *) | |
8154 | EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW" | |
8155 | ;; | |
8156 | esac | |
4a626d0a PA |
8157 | |
8158 | ||
c0c3707f | 8159 | fi |
18848e28 | 8160 | |
4a626d0a | 8161 | |
c0c3707f CB |
8162 | ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" |
8163 | if test "x$ac_cv_have_decl_strerror_r" = xyes; then : | |
8164 | ac_have_decl=1 | |
8165 | else | |
8166 | ac_have_decl=0 | |
8167 | fi | |
4a626d0a | 8168 | |
c0c3707f CB |
8169 | cat >>confdefs.h <<_ACEOF |
8170 | #define HAVE_DECL_STRERROR_R $ac_have_decl | |
8171 | _ACEOF | |
4a626d0a | 8172 | |
c0c3707f CB |
8173 | for ac_func in strerror_r |
8174 | do : | |
8175 | ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" | |
8176 | if test "x$ac_cv_func_strerror_r" = xyes; then : | |
8177 | cat >>confdefs.h <<_ACEOF | |
8178 | #define HAVE_STRERROR_R 1 | |
8179 | _ACEOF | |
4a626d0a | 8180 | |
c0c3707f CB |
8181 | fi |
8182 | done | |
18848e28 | 8183 | |
c0c3707f CB |
8184 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 |
8185 | $as_echo_n "checking whether strerror_r returns char *... " >&6; } | |
8186 | if ${ac_cv_func_strerror_r_char_p+:} false; then : | |
8187 | $as_echo_n "(cached) " >&6 | |
8188 | else | |
18848e28 | 8189 | |
c0c3707f CB |
8190 | ac_cv_func_strerror_r_char_p=no |
8191 | if test $ac_cv_have_decl_strerror_r = yes; then | |
8192 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8193 | /* end confdefs.h. */ | |
8194 | $ac_includes_default | |
8195 | int | |
8196 | main () | |
8197 | { | |
18848e28 | 8198 | |
c0c3707f CB |
8199 | char buf[100]; |
8200 | char x = *strerror_r (0, buf, sizeof buf); | |
8201 | char *p = strerror_r (0, buf, sizeof buf); | |
8202 | return !p || x; | |
18848e28 | 8203 | |
c0c3707f CB |
8204 | ; |
8205 | return 0; | |
8206 | } | |
8207 | _ACEOF | |
8208 | if ac_fn_c_try_compile "$LINENO"; then : | |
8209 | ac_cv_func_strerror_r_char_p=yes | |
8210 | fi | |
8211 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
8212 | else | |
8213 | # strerror_r is not declared. Choose between | |
8214 | # systems that have relatively inaccessible declarations for the | |
8215 | # function. BeOS and DEC UNIX 4.0 fall in this category, but the | |
8216 | # former has a strerror_r that returns char*, while the latter | |
8217 | # has a strerror_r that returns `int'. | |
8218 | # This test should segfault on the DEC system. | |
8219 | if test "$cross_compiling" = yes; then : | |
8220 | : | |
8221 | else | |
8222 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8223 | /* end confdefs.h. */ | |
8224 | $ac_includes_default | |
8225 | extern char *strerror_r (); | |
8226 | int | |
8227 | main () | |
8228 | { | |
8229 | char buf[100]; | |
8230 | char x = *strerror_r (0, buf, sizeof buf); | |
8231 | return ! isalpha (x); | |
8232 | ; | |
8233 | return 0; | |
8234 | } | |
8235 | _ACEOF | |
8236 | if ac_fn_c_try_run "$LINENO"; then : | |
8237 | ac_cv_func_strerror_r_char_p=yes | |
8238 | fi | |
8239 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
8240 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
8241 | fi | |
18848e28 | 8242 | |
c0c3707f | 8243 | fi |
18848e28 | 8244 | |
c0c3707f CB |
8245 | fi |
8246 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 | |
8247 | $as_echo "$ac_cv_func_strerror_r_char_p" >&6; } | |
8248 | if test $ac_cv_func_strerror_r_char_p = yes; then | |
18848e28 | 8249 | |
c0c3707f | 8250 | $as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h |
18848e28 | 8251 | |
c0c3707f | 8252 | fi |
18848e28 | 8253 | |
18848e28 | 8254 | |
18848e28 | 8255 | |
18848e28 | 8256 | |
c0c3707f CB |
8257 | ac_fn_c_check_decl "$LINENO" "fchdir" "ac_cv_have_decl_fchdir" "$ac_includes_default" |
8258 | if test "x$ac_cv_have_decl_fchdir" = xyes; then : | |
8259 | ac_have_decl=1 | |
8260 | else | |
8261 | ac_have_decl=0 | |
8262 | fi | |
18848e28 | 8263 | |
c0c3707f CB |
8264 | cat >>confdefs.h <<_ACEOF |
8265 | #define HAVE_DECL_FCHDIR $ac_have_decl | |
8266 | _ACEOF | |
18848e28 | 8267 | |
18848e28 | 8268 | |
c0c3707f CB |
8269 | GNULIB_CREAT=0; |
8270 | GNULIB_FCNTL=0; | |
8271 | GNULIB_NONBLOCKING=0; | |
8272 | GNULIB_OPEN=0; | |
8273 | GNULIB_OPENAT=0; | |
8274 | HAVE_FCNTL=1; | |
8275 | HAVE_OPENAT=1; | |
8276 | REPLACE_CREAT=0; | |
8277 | REPLACE_FCNTL=0; | |
8278 | REPLACE_OPEN=0; | |
8279 | REPLACE_OPENAT=0; | |
18848e28 | 8280 | |
18848e28 | 8281 | |
18848e28 | 8282 | |
18848e28 GF |
8283 | |
8284 | ||
18848e28 GF |
8285 | |
8286 | ||
18848e28 | 8287 | |
18848e28 | 8288 | |
18848e28 | 8289 | |
c0c3707f CB |
8290 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 |
8291 | $as_echo_n "checking for working fcntl.h... " >&6; } | |
8292 | if ${gl_cv_header_working_fcntl_h+:} false; then : | |
8293 | $as_echo_n "(cached) " >&6 | |
8294 | else | |
8295 | if test "$cross_compiling" = yes; then : | |
8296 | case "$host_os" in | |
8297 | # Guess 'no' on native Windows. | |
8298 | mingw*) gl_cv_header_working_fcntl_h='no' ;; | |
8299 | *) gl_cv_header_working_fcntl_h=cross-compiling ;; | |
8300 | esac | |
18848e28 | 8301 | |
c0c3707f CB |
8302 | else |
8303 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8304 | /* end confdefs.h. */ | |
8305 | #include <sys/types.h> | |
8306 | #include <sys/stat.h> | |
8307 | #if HAVE_UNISTD_H | |
8308 | # include <unistd.h> | |
8309 | #else /* on Windows with MSVC */ | |
8310 | # include <io.h> | |
8311 | # include <stdlib.h> | |
8312 | # defined sleep(n) _sleep ((n) * 1000) | |
8313 | #endif | |
8314 | #include <fcntl.h> | |
8315 | #ifndef O_NOATIME | |
8316 | #define O_NOATIME 0 | |
8317 | #endif | |
8318 | #ifndef O_NOFOLLOW | |
8319 | #define O_NOFOLLOW 0 | |
8320 | #endif | |
8321 | static int const constants[] = | |
8322 | { | |
8323 | O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, | |
8324 | O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY | |
8325 | }; | |
18848e28 | 8326 | |
c0c3707f CB |
8327 | int |
8328 | main () | |
8329 | { | |
18848e28 | 8330 | |
c0c3707f CB |
8331 | int result = !constants; |
8332 | #if HAVE_SYMLINK | |
8333 | { | |
8334 | static char const sym[] = "conftest.sym"; | |
8335 | if (symlink ("/dev/null", sym) != 0) | |
8336 | result |= 2; | |
8337 | else | |
8338 | { | |
8339 | int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); | |
8340 | if (fd >= 0) | |
8341 | { | |
8342 | close (fd); | |
8343 | result |= 4; | |
8344 | } | |
8345 | } | |
8346 | if (unlink (sym) != 0 || symlink (".", sym) != 0) | |
8347 | result |= 2; | |
8348 | else | |
8349 | { | |
8350 | int fd = open (sym, O_RDONLY | O_NOFOLLOW); | |
8351 | if (fd >= 0) | |
8352 | { | |
8353 | close (fd); | |
8354 | result |= 4; | |
8355 | } | |
8356 | } | |
8357 | unlink (sym); | |
8358 | } | |
8359 | #endif | |
8360 | { | |
8361 | static char const file[] = "confdefs.h"; | |
8362 | int fd = open (file, O_RDONLY | O_NOATIME); | |
8363 | if (fd < 0) | |
8364 | result |= 8; | |
8365 | else | |
8366 | { | |
8367 | struct stat st0; | |
8368 | if (fstat (fd, &st0) != 0) | |
8369 | result |= 16; | |
8370 | else | |
8371 | { | |
8372 | char c; | |
8373 | sleep (1); | |
8374 | if (read (fd, &c, 1) != 1) | |
8375 | result |= 24; | |
8376 | else | |
8377 | { | |
8378 | if (close (fd) != 0) | |
8379 | result |= 32; | |
8380 | else | |
8381 | { | |
8382 | struct stat st1; | |
8383 | if (stat (file, &st1) != 0) | |
8384 | result |= 40; | |
8385 | else | |
8386 | if (st0.st_atime != st1.st_atime) | |
8387 | result |= 64; | |
8388 | } | |
8389 | } | |
8390 | } | |
8391 | } | |
8392 | } | |
8393 | return result; | |
8394 | ; | |
8395 | return 0; | |
8396 | } | |
8397 | _ACEOF | |
8398 | if ac_fn_c_try_run "$LINENO"; then : | |
8399 | gl_cv_header_working_fcntl_h=yes | |
8400 | else | |
8401 | case $? in #( | |
8402 | 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( | |
8403 | 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( | |
8404 | 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( | |
8405 | *) gl_cv_header_working_fcntl_h='no';; | |
8406 | esac | |
8407 | fi | |
8408 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
8409 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
8410 | fi | |
18848e28 | 8411 | |
18848e28 | 8412 | |
c0c3707f CB |
8413 | fi |
8414 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 | |
8415 | $as_echo "$gl_cv_header_working_fcntl_h" >&6; } | |
18848e28 | 8416 | |
c0c3707f CB |
8417 | case $gl_cv_header_working_fcntl_h in #( |
8418 | *O_NOATIME* | no | cross-compiling) ac_val=0;; #( | |
8419 | *) ac_val=1;; | |
8420 | esac | |
18848e28 | 8421 | |
c0c3707f CB |
8422 | cat >>confdefs.h <<_ACEOF |
8423 | #define HAVE_WORKING_O_NOATIME $ac_val | |
8424 | _ACEOF | |
18848e28 GF |
8425 | |
8426 | ||
c0c3707f CB |
8427 | case $gl_cv_header_working_fcntl_h in #( |
8428 | *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( | |
8429 | *) ac_val=1;; | |
8430 | esac | |
18848e28 | 8431 | |
c0c3707f CB |
8432 | cat >>confdefs.h <<_ACEOF |
8433 | #define HAVE_WORKING_O_NOFOLLOW $ac_val | |
8434 | _ACEOF | |
18848e28 | 8435 | |
63ce7108 | 8436 | |
c0c3707f CB |
8437 | ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" |
8438 | if test "x$ac_cv_type_pid_t" = xyes; then : | |
63ce7108 | 8439 | |
c0c3707f | 8440 | else |
63ce7108 | 8441 | |
c0c3707f CB |
8442 | cat >>confdefs.h <<_ACEOF |
8443 | #define pid_t int | |
8444 | _ACEOF | |
63ce7108 | 8445 | |
c0c3707f | 8446 | fi |
63ce7108 | 8447 | |
c0c3707f CB |
8448 | ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" |
8449 | if test "x$ac_cv_type_mode_t" = xyes; then : | |
63ce7108 | 8450 | |
c0c3707f | 8451 | else |
63ce7108 | 8452 | |
c0c3707f CB |
8453 | cat >>confdefs.h <<_ACEOF |
8454 | #define mode_t int | |
8455 | _ACEOF | |
63ce7108 | 8456 | |
c0c3707f | 8457 | fi |
63ce7108 | 8458 | |
472fa5ee SM |
8459 | |
8460 | ||
8461 | ||
8462 | ||
8463 | ||
c0c3707f CB |
8464 | GNULIB_FNMATCH=0; |
8465 | HAVE_FNMATCH=1; | |
8466 | REPLACE_FNMATCH=0; | |
472fa5ee SM |
8467 | |
8468 | ||
8469 | ||
8470 | ||
8471 | ||
8472 | ||
472fa5ee SM |
8473 | |
8474 | ||
472fa5ee SM |
8475 | |
8476 | ||
8477 | ||
8478 | ||
8479 | ||
8480 | ||
8481 | ||
8482 | ||
7a6dbc2f | 8483 | if test $gl_cv_have_include_next = yes; then |
c0c3707f | 8484 | gl_cv_next_fnmatch_h='<'fnmatch.h'>' |
7a6dbc2f | 8485 | else |
c0c3707f CB |
8486 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fnmatch.h>" >&5 |
8487 | $as_echo_n "checking absolute name of <fnmatch.h>... " >&6; } | |
8488 | if ${gl_cv_next_fnmatch_h+:} false; then : | |
7a6dbc2f SDJ |
8489 | $as_echo_n "(cached) " >&6 |
8490 | else | |
472fa5ee | 8491 | |
c0c3707f CB |
8492 | if test $ac_cv_header_fnmatch_h = yes; then |
8493 | ||
8494 | ||
472fa5ee SM |
8495 | |
8496 | ||
7a6dbc2f SDJ |
8497 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8498 | /* end confdefs.h. */ | |
c0c3707f | 8499 | #include <fnmatch.h> |
7a6dbc2f SDJ |
8500 | _ACEOF |
8501 | case "$host_os" in | |
8502 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
8503 | *) gl_absname_cpp="$ac_cpp" ;; | |
8504 | esac | |
472fa5ee | 8505 | |
7a6dbc2f SDJ |
8506 | case "$host_os" in |
8507 | mingw*) | |
8508 | gl_dirsep_regex='[/\\]' | |
8509 | ;; | |
8510 | *) | |
8511 | gl_dirsep_regex='\/' | |
8512 | ;; | |
8513 | esac | |
8514 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
c0c3707f | 8515 | gl_header_literal_regex=`echo 'fnmatch.h' \ |
7a6dbc2f SDJ |
8516 | | sed -e "$gl_make_literal_regex_sed"` |
8517 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
8518 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
8519 | s|^/[^/]|//&| | |
8520 | p | |
8521 | q | |
8522 | }' | |
8523 | ||
c0c3707f | 8524 | gl_cv_absolute_fnmatch_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
7a6dbc2f SDJ |
8525 | sed -n "$gl_absolute_header_sed"` |
8526 | ||
c0c3707f CB |
8527 | gl_header=$gl_cv_absolute_fnmatch_h |
8528 | gl_cv_next_fnmatch_h='"'$gl_header'"' | |
8529 | else | |
8530 | gl_cv_next_fnmatch_h='<'fnmatch.h'>' | |
8531 | fi | |
7a6dbc2f SDJ |
8532 | |
8533 | ||
8534 | fi | |
c0c3707f CB |
8535 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fnmatch_h" >&5 |
8536 | $as_echo "$gl_cv_next_fnmatch_h" >&6; } | |
7a6dbc2f | 8537 | fi |
c0c3707f | 8538 | NEXT_FNMATCH_H=$gl_cv_next_fnmatch_h |
7a6dbc2f SDJ |
8539 | |
8540 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
8541 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
c0c3707f | 8542 | gl_next_as_first_directive='<'fnmatch.h'>' |
7a6dbc2f SDJ |
8543 | else |
8544 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
c0c3707f | 8545 | gl_next_as_first_directive=$gl_cv_next_fnmatch_h |
7a6dbc2f | 8546 | fi |
c0c3707f | 8547 | NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H=$gl_next_as_first_directive |
7a6dbc2f SDJ |
8548 | |
8549 | ||
8550 | ||
8551 | ||
7a6dbc2f | 8552 | |
7a6dbc2f SDJ |
8553 | |
8554 | ||
c0c3707f CB |
8555 | if test $ac_cv_header_fnmatch_h = yes; then |
8556 | HAVE_FNMATCH_H=1 | |
8557 | else | |
8558 | HAVE_FNMATCH_H=0 | |
8559 | fi | |
7a6dbc2f SDJ |
8560 | |
8561 | ||
c0c3707f CB |
8562 | FNMATCH_H='' |
8563 | if false; then | |
8564 | FNMATCH_H=fnmatch.h | |
8565 | else | |
8566 | if test $ac_cv_header_fnmatch_h != yes; then | |
8567 | FNMATCH_H=fnmatch.h | |
8568 | fi | |
8569 | fi | |
7a6dbc2f | 8570 | |
c0c3707f CB |
8571 | |
8572 | if test -n "$FNMATCH_H"; then | |
8573 | GL_GENERATE_FNMATCH_H_TRUE= | |
8574 | GL_GENERATE_FNMATCH_H_FALSE='#' | |
7a6dbc2f | 8575 | else |
c0c3707f CB |
8576 | GL_GENERATE_FNMATCH_H_TRUE='#' |
8577 | GL_GENERATE_FNMATCH_H_FALSE= | |
7a6dbc2f | 8578 | fi |
7a6dbc2f | 8579 | |
7a6dbc2f | 8580 | |
7a6dbc2f | 8581 | |
7a6dbc2f SDJ |
8582 | |
8583 | ||
8584 | ||
8585 | ||
8586 | ||
8587 | ||
8588 | ||
c0c3707f CB |
8589 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 |
8590 | $as_echo_n "checking for mbstate_t... " >&6; } | |
8591 | if ${ac_cv_type_mbstate_t+:} false; then : | |
5e8754f9 SDJ |
8592 | $as_echo_n "(cached) " >&6 |
8593 | else | |
c0c3707f | 8594 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5e8754f9 | 8595 | /* end confdefs.h. */ |
c0c3707f CB |
8596 | $ac_includes_default |
8597 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
8598 | <wchar.h>. | |
8599 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
8600 | included before <wchar.h>. */ | |
8601 | #include <stddef.h> | |
8602 | #include <stdio.h> | |
8603 | #include <time.h> | |
8604 | #include <wchar.h> | |
8605 | int | |
8606 | main () | |
8607 | { | |
8608 | mbstate_t x; return sizeof x; | |
8609 | ; | |
8610 | return 0; | |
8611 | } | |
5e8754f9 | 8612 | _ACEOF |
c0c3707f CB |
8613 | if ac_fn_c_try_compile "$LINENO"; then : |
8614 | ac_cv_type_mbstate_t=yes | |
5e8754f9 | 8615 | else |
c0c3707f | 8616 | ac_cv_type_mbstate_t=no |
5e8754f9 | 8617 | fi |
c0c3707f CB |
8618 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
8619 | fi | |
8620 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 | |
8621 | $as_echo "$ac_cv_type_mbstate_t" >&6; } | |
8622 | if test $ac_cv_type_mbstate_t = yes; then | |
5e8754f9 | 8623 | |
c0c3707f | 8624 | $as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h |
5e8754f9 | 8625 | |
c0c3707f | 8626 | else |
5e8754f9 | 8627 | |
c0c3707f | 8628 | $as_echo "#define mbstate_t int" >>confdefs.h |
5e8754f9 | 8629 | |
c0c3707f | 8630 | fi |
5e8754f9 SDJ |
8631 | |
8632 | ||
8633 | ||
8634 | ||
8635 | ||
8636 | ||
8637 | ||
8638 | ||
8639 | ||
8640 | ||
8641 | ||
8642 | ||
8643 | ||
8644 | ||
8645 | ||
8646 | ||
8647 | ||
8648 | ||
8649 | GNULIB_ACOSF=0; | |
8650 | GNULIB_ACOSL=0; | |
8651 | GNULIB_ASINF=0; | |
8652 | GNULIB_ASINL=0; | |
8653 | GNULIB_ATANF=0; | |
8654 | GNULIB_ATANL=0; | |
8655 | GNULIB_ATAN2F=0; | |
8656 | GNULIB_CBRT=0; | |
8657 | GNULIB_CBRTF=0; | |
8658 | GNULIB_CBRTL=0; | |
8659 | GNULIB_CEIL=0; | |
8660 | GNULIB_CEILF=0; | |
8661 | GNULIB_CEILL=0; | |
8662 | GNULIB_COPYSIGN=0; | |
8663 | GNULIB_COPYSIGNF=0; | |
8664 | GNULIB_COPYSIGNL=0; | |
8665 | GNULIB_COSF=0; | |
8666 | GNULIB_COSL=0; | |
8667 | GNULIB_COSHF=0; | |
8668 | GNULIB_EXPF=0; | |
8669 | GNULIB_EXPL=0; | |
8670 | GNULIB_EXP2=0; | |
8671 | GNULIB_EXP2F=0; | |
8672 | GNULIB_EXP2L=0; | |
8673 | GNULIB_EXPM1=0; | |
8674 | GNULIB_EXPM1F=0; | |
8675 | GNULIB_EXPM1L=0; | |
8676 | GNULIB_FABSF=0; | |
8677 | GNULIB_FABSL=0; | |
8678 | GNULIB_FLOOR=0; | |
8679 | GNULIB_FLOORF=0; | |
8680 | GNULIB_FLOORL=0; | |
8681 | GNULIB_FMA=0; | |
8682 | GNULIB_FMAF=0; | |
8683 | GNULIB_FMAL=0; | |
8684 | GNULIB_FMOD=0; | |
8685 | GNULIB_FMODF=0; | |
8686 | GNULIB_FMODL=0; | |
8687 | GNULIB_FREXPF=0; | |
8688 | GNULIB_FREXP=0; | |
8689 | GNULIB_FREXPL=0; | |
8690 | GNULIB_HYPOT=0; | |
8691 | GNULIB_HYPOTF=0; | |
8692 | GNULIB_HYPOTL=0; | |
8693 | GNULIB_ILOGB=0; | |
8694 | GNULIB_ILOGBF=0; | |
8695 | GNULIB_ILOGBL=0; | |
8696 | GNULIB_ISFINITE=0; | |
8697 | GNULIB_ISINF=0; | |
8698 | GNULIB_ISNAN=0; | |
8699 | GNULIB_ISNANF=0; | |
8700 | GNULIB_ISNAND=0; | |
8701 | GNULIB_ISNANL=0; | |
8702 | GNULIB_LDEXPF=0; | |
8703 | GNULIB_LDEXPL=0; | |
8704 | GNULIB_LOG=0; | |
8705 | GNULIB_LOGF=0; | |
8706 | GNULIB_LOGL=0; | |
8707 | GNULIB_LOG10=0; | |
8708 | GNULIB_LOG10F=0; | |
8709 | GNULIB_LOG10L=0; | |
8710 | GNULIB_LOG1P=0; | |
8711 | GNULIB_LOG1PF=0; | |
8712 | GNULIB_LOG1PL=0; | |
8713 | GNULIB_LOG2=0; | |
8714 | GNULIB_LOG2F=0; | |
8715 | GNULIB_LOG2L=0; | |
8716 | GNULIB_LOGB=0; | |
8717 | GNULIB_LOGBF=0; | |
8718 | GNULIB_LOGBL=0; | |
8719 | GNULIB_MODF=0; | |
8720 | GNULIB_MODFF=0; | |
8721 | GNULIB_MODFL=0; | |
8722 | GNULIB_POWF=0; | |
8723 | GNULIB_REMAINDER=0; | |
8724 | GNULIB_REMAINDERF=0; | |
8725 | GNULIB_REMAINDERL=0; | |
8726 | GNULIB_RINT=0; | |
8727 | GNULIB_RINTF=0; | |
8728 | GNULIB_RINTL=0; | |
8729 | GNULIB_ROUND=0; | |
8730 | GNULIB_ROUNDF=0; | |
8731 | GNULIB_ROUNDL=0; | |
8732 | GNULIB_SIGNBIT=0; | |
8733 | GNULIB_SINF=0; | |
8734 | GNULIB_SINL=0; | |
8735 | GNULIB_SINHF=0; | |
8736 | GNULIB_SQRTF=0; | |
8737 | GNULIB_SQRTL=0; | |
8738 | GNULIB_TANF=0; | |
8739 | GNULIB_TANL=0; | |
8740 | GNULIB_TANHF=0; | |
8741 | GNULIB_TRUNC=0; | |
8742 | GNULIB_TRUNCF=0; | |
8743 | GNULIB_TRUNCL=0; | |
8744 | HAVE_ACOSF=1; | |
8745 | HAVE_ACOSL=1; | |
8746 | HAVE_ASINF=1; | |
8747 | HAVE_ASINL=1; | |
8748 | HAVE_ATANF=1; | |
8749 | HAVE_ATANL=1; | |
8750 | HAVE_ATAN2F=1; | |
8751 | HAVE_CBRT=1; | |
8752 | HAVE_CBRTF=1; | |
8753 | HAVE_CBRTL=1; | |
8754 | HAVE_COPYSIGN=1; | |
8755 | HAVE_COPYSIGNL=1; | |
8756 | HAVE_COSF=1; | |
8757 | HAVE_COSL=1; | |
8758 | HAVE_COSHF=1; | |
8759 | HAVE_EXPF=1; | |
8760 | HAVE_EXPL=1; | |
8761 | HAVE_EXPM1=1; | |
8762 | HAVE_EXPM1F=1; | |
8763 | HAVE_FABSF=1; | |
8764 | HAVE_FABSL=1; | |
8765 | HAVE_FMA=1; | |
8766 | HAVE_FMAF=1; | |
8767 | HAVE_FMAL=1; | |
8768 | HAVE_FMODF=1; | |
8769 | HAVE_FMODL=1; | |
8770 | HAVE_FREXPF=1; | |
8771 | HAVE_HYPOTF=1; | |
8772 | HAVE_HYPOTL=1; | |
8773 | HAVE_ILOGB=1; | |
8774 | HAVE_ILOGBF=1; | |
8775 | HAVE_ILOGBL=1; | |
8776 | HAVE_ISNANF=1; | |
8777 | HAVE_ISNAND=1; | |
8778 | HAVE_ISNANL=1; | |
8779 | HAVE_LDEXPF=1; | |
8780 | HAVE_LOGF=1; | |
8781 | HAVE_LOGL=1; | |
8782 | HAVE_LOG10F=1; | |
8783 | HAVE_LOG10L=1; | |
8784 | HAVE_LOG1P=1; | |
8785 | HAVE_LOG1PF=1; | |
8786 | HAVE_LOG1PL=1; | |
8787 | HAVE_LOGBF=1; | |
8788 | HAVE_LOGBL=1; | |
8789 | HAVE_MODFF=1; | |
8790 | HAVE_MODFL=1; | |
8791 | HAVE_POWF=1; | |
8792 | HAVE_REMAINDER=1; | |
8793 | HAVE_REMAINDERF=1; | |
8794 | HAVE_RINT=1; | |
8795 | HAVE_RINTL=1; | |
8796 | HAVE_SINF=1; | |
8797 | HAVE_SINL=1; | |
8798 | HAVE_SINHF=1; | |
8799 | HAVE_SQRTF=1; | |
8800 | HAVE_SQRTL=1; | |
8801 | HAVE_TANF=1; | |
8802 | HAVE_TANL=1; | |
8803 | HAVE_TANHF=1; | |
8804 | HAVE_DECL_ACOSL=1; | |
8805 | HAVE_DECL_ASINL=1; | |
8806 | HAVE_DECL_ATANL=1; | |
8807 | HAVE_DECL_CBRTF=1; | |
8808 | HAVE_DECL_CBRTL=1; | |
8809 | HAVE_DECL_CEILF=1; | |
8810 | HAVE_DECL_CEILL=1; | |
8811 | HAVE_DECL_COPYSIGNF=1; | |
8812 | HAVE_DECL_COSL=1; | |
8813 | HAVE_DECL_EXPL=1; | |
8814 | HAVE_DECL_EXP2=1; | |
8815 | HAVE_DECL_EXP2F=1; | |
8816 | HAVE_DECL_EXP2L=1; | |
8817 | HAVE_DECL_EXPM1L=1; | |
8818 | HAVE_DECL_FLOORF=1; | |
8819 | HAVE_DECL_FLOORL=1; | |
8820 | HAVE_DECL_FREXPL=1; | |
8821 | HAVE_DECL_LDEXPL=1; | |
8822 | HAVE_DECL_LOGL=1; | |
8823 | HAVE_DECL_LOG10L=1; | |
8824 | HAVE_DECL_LOG2=1; | |
8825 | HAVE_DECL_LOG2F=1; | |
8826 | HAVE_DECL_LOG2L=1; | |
8827 | HAVE_DECL_LOGB=1; | |
8828 | HAVE_DECL_REMAINDER=1; | |
8829 | HAVE_DECL_REMAINDERL=1; | |
8830 | HAVE_DECL_RINTF=1; | |
8831 | HAVE_DECL_ROUND=1; | |
8832 | HAVE_DECL_ROUNDF=1; | |
8833 | HAVE_DECL_ROUNDL=1; | |
8834 | HAVE_DECL_SINL=1; | |
8835 | HAVE_DECL_SQRTL=1; | |
8836 | HAVE_DECL_TANL=1; | |
8837 | HAVE_DECL_TRUNC=1; | |
8838 | HAVE_DECL_TRUNCF=1; | |
8839 | HAVE_DECL_TRUNCL=1; | |
c0c3707f CB |
8840 | REPLACE_ACOSF=0; |
8841 | REPLACE_ASINF=0; | |
8842 | REPLACE_ATANF=0; | |
8843 | REPLACE_ATAN2F=0; | |
5e8754f9 SDJ |
8844 | REPLACE_CBRTF=0; |
8845 | REPLACE_CBRTL=0; | |
8846 | REPLACE_CEIL=0; | |
8847 | REPLACE_CEILF=0; | |
8848 | REPLACE_CEILL=0; | |
c0c3707f CB |
8849 | REPLACE_COSF=0; |
8850 | REPLACE_COSHF=0; | |
8851 | REPLACE_EXPF=0; | |
8852 | REPLACE_EXPL=0; | |
5e8754f9 SDJ |
8853 | REPLACE_EXPM1=0; |
8854 | REPLACE_EXPM1F=0; | |
c0c3707f | 8855 | REPLACE_EXPM1L=0; |
5e8754f9 SDJ |
8856 | REPLACE_EXP2=0; |
8857 | REPLACE_EXP2L=0; | |
8858 | REPLACE_FABSL=0; | |
8859 | REPLACE_FLOOR=0; | |
8860 | REPLACE_FLOORF=0; | |
8861 | REPLACE_FLOORL=0; | |
8862 | REPLACE_FMA=0; | |
8863 | REPLACE_FMAF=0; | |
8864 | REPLACE_FMAL=0; | |
8865 | REPLACE_FMOD=0; | |
8866 | REPLACE_FMODF=0; | |
8867 | REPLACE_FMODL=0; | |
8868 | REPLACE_FREXPF=0; | |
8869 | REPLACE_FREXP=0; | |
8870 | REPLACE_FREXPL=0; | |
8871 | REPLACE_HUGE_VAL=0; | |
8872 | REPLACE_HYPOT=0; | |
8873 | REPLACE_HYPOTF=0; | |
8874 | REPLACE_HYPOTL=0; | |
8875 | REPLACE_ILOGB=0; | |
8876 | REPLACE_ILOGBF=0; | |
c0c3707f | 8877 | REPLACE_ILOGBL=0; |
5e8754f9 SDJ |
8878 | REPLACE_ISFINITE=0; |
8879 | REPLACE_ISINF=0; | |
8880 | REPLACE_ISNAN=0; | |
8881 | REPLACE_LDEXPL=0; | |
8882 | REPLACE_LOG=0; | |
8883 | REPLACE_LOGF=0; | |
8884 | REPLACE_LOGL=0; | |
8885 | REPLACE_LOG10=0; | |
8886 | REPLACE_LOG10F=0; | |
8887 | REPLACE_LOG10L=0; | |
8888 | REPLACE_LOG1P=0; | |
8889 | REPLACE_LOG1PF=0; | |
8890 | REPLACE_LOG1PL=0; | |
8891 | REPLACE_LOG2=0; | |
8892 | REPLACE_LOG2F=0; | |
8893 | REPLACE_LOG2L=0; | |
8894 | REPLACE_LOGB=0; | |
8895 | REPLACE_LOGBF=0; | |
8896 | REPLACE_LOGBL=0; | |
8897 | REPLACE_MODF=0; | |
8898 | REPLACE_MODFF=0; | |
8899 | REPLACE_MODFL=0; | |
8900 | REPLACE_NAN=0; | |
8901 | REPLACE_REMAINDER=0; | |
8902 | REPLACE_REMAINDERF=0; | |
8903 | REPLACE_REMAINDERL=0; | |
c0c3707f | 8904 | REPLACE_RINTL=0; |
5e8754f9 | 8905 | REPLACE_ROUND=0; |
c0c3707f CB |
8906 | REPLACE_ROUNDF=0; |
8907 | REPLACE_ROUNDL=0; | |
8908 | REPLACE_SIGNBIT=0; | |
8909 | REPLACE_SIGNBIT_USING_GCC=0; | |
8910 | REPLACE_SINF=0; | |
8911 | REPLACE_SINHF=0; | |
8912 | REPLACE_SQRTF=0; | |
8913 | REPLACE_SQRTL=0; | |
8914 | REPLACE_TANF=0; | |
8915 | REPLACE_TANHF=0; | |
8916 | REPLACE_TRUNC=0; | |
8917 | REPLACE_TRUNCF=0; | |
8918 | REPLACE_TRUNCL=0; | |
49e4877c | 8919 | |
49e4877c | 8920 | |
c0c3707f CB |
8921 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5 |
8922 | $as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; } | |
8923 | if ${gl_cv_func_frexp_no_libm+:} false; then : | |
8924 | $as_echo_n "(cached) " >&6 | |
8925 | else | |
8690e634 | 8926 | |
c0c3707f CB |
8927 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8928 | /* end confdefs.h. */ | |
8929 | #include <math.h> | |
8930 | double x; | |
8931 | int | |
8932 | main () | |
8933 | { | |
8934 | int e; return frexp (x, &e) > 0; | |
8935 | ; | |
8936 | return 0; | |
8937 | } | |
8938 | _ACEOF | |
8939 | if ac_fn_c_try_link "$LINENO"; then : | |
8940 | gl_cv_func_frexp_no_libm=yes | |
8941 | else | |
8942 | gl_cv_func_frexp_no_libm=no | |
8943 | fi | |
8944 | rm -f core conftest.err conftest.$ac_objext \ | |
8945 | conftest$ac_exeext conftest.$ac_ext | |
8690e634 | 8946 | |
c0c3707f CB |
8947 | fi |
8948 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5 | |
8949 | $as_echo "$gl_cv_func_frexp_no_libm" >&6; } | |
8690e634 | 8950 | |
c0c3707f CB |
8951 | ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default" |
8952 | if test "x$ac_cv_have_decl_alarm" = xyes; then : | |
8953 | ac_have_decl=1 | |
8954 | else | |
8955 | ac_have_decl=0 | |
8956 | fi | |
472fa5ee | 8957 | |
c0c3707f CB |
8958 | cat >>confdefs.h <<_ACEOF |
8959 | #define HAVE_DECL_ALARM $ac_have_decl | |
8960 | _ACEOF | |
472fa5ee SM |
8961 | |
8962 | ||
8963 | ||
8964 | ||
c0c3707f CB |
8965 | FREXP_LIBM= |
8966 | if test $gl_cv_func_frexp_no_libm = no; then | |
8967 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used with libm" >&5 | |
8968 | $as_echo_n "checking whether frexp() can be used with libm... " >&6; } | |
8969 | if ${gl_cv_func_frexp_in_libm+:} false; then : | |
8970 | $as_echo_n "(cached) " >&6 | |
8971 | else | |
8690e634 | 8972 | |
c0c3707f CB |
8973 | save_LIBS="$LIBS" |
8974 | LIBS="$LIBS -lm" | |
8975 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8976 | /* end confdefs.h. */ | |
8977 | #include <math.h> | |
8978 | double x; | |
8979 | int | |
8980 | main () | |
8981 | { | |
8982 | int e; return frexp (x, &e) > 0; | |
8983 | ; | |
8984 | return 0; | |
8985 | } | |
8986 | _ACEOF | |
8987 | if ac_fn_c_try_link "$LINENO"; then : | |
8988 | gl_cv_func_frexp_in_libm=yes | |
8989 | else | |
8990 | gl_cv_func_frexp_in_libm=no | |
8991 | fi | |
8992 | rm -f core conftest.err conftest.$ac_objext \ | |
8993 | conftest$ac_exeext conftest.$ac_ext | |
8994 | LIBS="$save_LIBS" | |
8690e634 | 8995 | |
c0c3707f CB |
8996 | fi |
8997 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_in_libm" >&5 | |
8998 | $as_echo "$gl_cv_func_frexp_in_libm" >&6; } | |
8999 | if test $gl_cv_func_frexp_in_libm = yes; then | |
9000 | FREXP_LIBM=-lm | |
9001 | fi | |
6ec2e0f5 | 9002 | fi |
c0c3707f CB |
9003 | if test $gl_cv_func_frexp_no_libm = yes \ |
9004 | || test $gl_cv_func_frexp_in_libm = yes; then | |
9005 | save_LIBS="$LIBS" | |
9006 | LIBS="$LIBS $FREXP_LIBM" | |
8690e634 JK |
9007 | |
9008 | ||
8690e634 | 9009 | |
c0c3707f CB |
9010 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5 |
9011 | $as_echo_n "checking whether frexp works... " >&6; } | |
9012 | if ${gl_cv_func_frexp_works+:} false; then : | |
9013 | $as_echo_n "(cached) " >&6 | |
9014 | else | |
8690e634 | 9015 | |
c0c3707f CB |
9016 | if test "$cross_compiling" = yes; then : |
9017 | case "$host_os" in | |
9018 | netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;; | |
9019 | mingw*) # Guess yes with MSVC, no with mingw. | |
9020 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9021 | /* end confdefs.h. */ | |
8690e634 | 9022 | |
c0c3707f CB |
9023 | #ifdef _MSC_VER |
9024 | Good | |
9025 | #endif | |
8690e634 | 9026 | |
c0c3707f CB |
9027 | _ACEOF |
9028 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
9029 | $EGREP "Good" >/dev/null 2>&1; then : | |
9030 | gl_cv_func_frexp_works="guessing yes" | |
9031 | else | |
9032 | gl_cv_func_frexp_works="guessing no" | |
9033 | fi | |
9034 | rm -f conftest* | |
8690e634 | 9035 | |
c0c3707f CB |
9036 | ;; |
9037 | *) gl_cv_func_frexp_works="guessing yes" ;; | |
9038 | esac | |
8690e634 | 9039 | |
c0c3707f CB |
9040 | else |
9041 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9042 | /* end confdefs.h. */ | |
8690e634 | 9043 | |
c0c3707f CB |
9044 | #include <float.h> |
9045 | #include <math.h> | |
9046 | #include <string.h> | |
9047 | #if HAVE_DECL_ALARM | |
9048 | # include <signal.h> | |
9049 | # include <unistd.h> | |
9050 | #endif | |
9051 | /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. | |
9052 | ICC 10.0 has a bug when optimizing the expression -zero. | |
9053 | The expression -DBL_MIN * DBL_MIN does not work when cross-compiling | |
9054 | to PowerPC on Mac OS X 10.5. */ | |
9055 | #if defined __hpux || defined __sgi || defined __ICC | |
9056 | static double | |
9057 | compute_minus_zero (void) | |
9058 | { | |
9059 | return -DBL_MIN * DBL_MIN; | |
9060 | } | |
9061 | # define minus_zero compute_minus_zero () | |
9062 | #else | |
9063 | double minus_zero = -0.0; | |
9064 | #endif | |
9065 | int main() | |
9066 | { | |
9067 | int result = 0; | |
9068 | int i; | |
9069 | volatile double x; | |
9070 | double zero = 0.0; | |
9071 | #if HAVE_DECL_ALARM | |
9072 | /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite | |
9073 | number. Let the test fail in this case. */ | |
9074 | signal (SIGALRM, SIG_DFL); | |
9075 | alarm (5); | |
9076 | #endif | |
9077 | /* Test on denormalized numbers. */ | |
9078 | for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) | |
9079 | ; | |
9080 | if (x > 0.0) | |
9081 | { | |
9082 | int exp; | |
9083 | double y = frexp (x, &exp); | |
9084 | /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022. | |
9085 | On NetBSD: y = 0.75. Correct: y = 0.5. */ | |
9086 | if (y != 0.5) | |
9087 | result |= 1; | |
9088 | } | |
9089 | /* Test on infinite numbers. */ | |
9090 | x = 1.0 / zero; | |
9091 | { | |
9092 | int exp; | |
9093 | double y = frexp (x, &exp); | |
9094 | if (y != x) | |
9095 | result |= 2; | |
9096 | } | |
9097 | /* Test on negative zero. */ | |
9098 | x = minus_zero; | |
9099 | { | |
9100 | int exp; | |
9101 | double y = frexp (x, &exp); | |
9102 | if (memcmp (&y, &x, sizeof x)) | |
9103 | result |= 4; | |
9104 | } | |
9105 | return result; | |
9106 | } | |
9107 | _ACEOF | |
9108 | if ac_fn_c_try_run "$LINENO"; then : | |
9109 | gl_cv_func_frexp_works=yes | |
9110 | else | |
9111 | gl_cv_func_frexp_works=no | |
9112 | fi | |
9113 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
9114 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
9115 | fi | |
472fa5ee SM |
9116 | |
9117 | ||
c0c3707f CB |
9118 | fi |
9119 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5 | |
9120 | $as_echo "$gl_cv_func_frexp_works" >&6; } | |
472fa5ee | 9121 | |
c0c3707f CB |
9122 | LIBS="$save_LIBS" |
9123 | case "$gl_cv_func_frexp_works" in | |
9124 | *yes) gl_func_frexp=yes ;; | |
9125 | *) gl_func_frexp=no; REPLACE_FREXP=1; FREXP_LIBM= ;; | |
9126 | esac | |
9127 | else | |
9128 | gl_func_frexp=no | |
9129 | fi | |
9130 | if test $gl_func_frexp = yes; then | |
472fa5ee | 9131 | |
c0c3707f | 9132 | $as_echo "#define HAVE_FREXP 1" >>confdefs.h |
472fa5ee | 9133 | |
c0c3707f | 9134 | fi |
8690e634 | 9135 | |
6ec2e0f5 SDJ |
9136 | |
9137 | ||
c0c3707f CB |
9138 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5 |
9139 | $as_echo_n "checking whether long double and double are the same... " >&6; } | |
9140 | if ${gl_cv_long_double_equals_double+:} false; then : | |
8690e634 JK |
9141 | $as_echo_n "(cached) " >&6 |
9142 | else | |
c0c3707f CB |
9143 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
9144 | /* end confdefs.h. */ | |
9145 | #include <float.h> | |
9146 | int | |
9147 | main () | |
9148 | { | |
9149 | typedef int check[sizeof (long double) == sizeof (double) | |
9150 | && LDBL_MANT_DIG == DBL_MANT_DIG | |
9151 | && LDBL_MAX_EXP == DBL_MAX_EXP | |
9152 | && LDBL_MIN_EXP == DBL_MIN_EXP | |
9153 | ? 1 : -1]; | |
8690e634 | 9154 | |
c0c3707f CB |
9155 | ; |
9156 | return 0; | |
9157 | } | |
9158 | _ACEOF | |
9159 | if ac_fn_c_try_compile "$LINENO"; then : | |
9160 | gl_cv_long_double_equals_double=yes | |
9161 | else | |
9162 | gl_cv_long_double_equals_double=no | |
9163 | fi | |
9164 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
8690e634 | 9165 | |
c0c3707f CB |
9166 | fi |
9167 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5 | |
9168 | $as_echo "$gl_cv_long_double_equals_double" >&6; } | |
9169 | if test $gl_cv_long_double_equals_double = yes; then | |
8690e634 | 9170 | |
c0c3707f | 9171 | $as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h |
6ec2e0f5 | 9172 | |
c0c3707f CB |
9173 | HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1 |
9174 | else | |
9175 | HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0 | |
9176 | fi | |
8690e634 | 9177 | |
6ec2e0f5 | 9178 | |
6ec2e0f5 | 9179 | |
6ec2e0f5 SDJ |
9180 | |
9181 | ||
6ec2e0f5 | 9182 | |
8690e634 JK |
9183 | |
9184 | ||
c0c3707f CB |
9185 | ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h> |
9186 | " | |
9187 | if test "x$ac_cv_have_decl_frexpl" = xyes; then : | |
8690e634 | 9188 | |
c0c3707f CB |
9189 | else |
9190 | HAVE_DECL_FREXPL=0 | |
9191 | fi | |
8690e634 | 9192 | |
6ec2e0f5 | 9193 | |
c0c3707f CB |
9194 | FREXPL_LIBM= |
9195 | if test $HAVE_DECL_FREXPL = 1; then | |
6ec2e0f5 | 9196 | |
c0c3707f CB |
9197 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5 |
9198 | $as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; } | |
9199 | if ${gl_cv_func_frexpl_no_libm+:} false; then : | |
8690e634 JK |
9200 | $as_echo_n "(cached) " >&6 |
9201 | else | |
c0c3707f CB |
9202 | |
9203 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 | 9204 | /* end confdefs.h. */ |
c0c3707f CB |
9205 | #include <math.h> |
9206 | long double x; | |
9207 | int | |
9208 | main () | |
9209 | { | |
9210 | int e; return frexpl (x, &e) > 0; | |
9211 | ; | |
9212 | return 0; | |
9213 | } | |
9214 | _ACEOF | |
9215 | if ac_fn_c_try_link "$LINENO"; then : | |
9216 | gl_cv_func_frexpl_no_libm=yes | |
9217 | else | |
9218 | gl_cv_func_frexpl_no_libm=no | |
9219 | fi | |
9220 | rm -f core conftest.err conftest.$ac_objext \ | |
9221 | conftest$ac_exeext conftest.$ac_ext | |
8690e634 | 9222 | |
c0c3707f CB |
9223 | fi |
9224 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5 | |
9225 | $as_echo "$gl_cv_func_frexpl_no_libm" >&6; } | |
6ec2e0f5 | 9226 | |
c0c3707f CB |
9227 | if test $gl_cv_func_frexpl_no_libm = no; then |
9228 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used with libm" >&5 | |
9229 | $as_echo_n "checking whether frexpl() can be used with libm... " >&6; } | |
9230 | if ${gl_cv_func_frexpl_in_libm+:} false; then : | |
9231 | $as_echo_n "(cached) " >&6 | |
9232 | else | |
6ec2e0f5 | 9233 | |
c0c3707f CB |
9234 | save_LIBS="$LIBS" |
9235 | LIBS="$LIBS -lm" | |
9236 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9237 | /* end confdefs.h. */ | |
9238 | #include <math.h> | |
9239 | long double x; | |
9240 | int | |
9241 | main () | |
9242 | { | |
9243 | int e; return frexpl (x, &e) > 0; | |
9244 | ; | |
9245 | return 0; | |
9246 | } | |
9247 | _ACEOF | |
9248 | if ac_fn_c_try_link "$LINENO"; then : | |
9249 | gl_cv_func_frexpl_in_libm=yes | |
9250 | else | |
9251 | gl_cv_func_frexpl_in_libm=no | |
9252 | fi | |
9253 | rm -f core conftest.err conftest.$ac_objext \ | |
9254 | conftest$ac_exeext conftest.$ac_ext | |
9255 | LIBS="$save_LIBS" | |
6ec2e0f5 | 9256 | |
c0c3707f CB |
9257 | fi |
9258 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_in_libm" >&5 | |
9259 | $as_echo "$gl_cv_func_frexpl_in_libm" >&6; } | |
9260 | if test $gl_cv_func_frexpl_in_libm = yes; then | |
9261 | FREXPL_LIBM=-lm | |
9262 | fi | |
9263 | fi | |
9264 | if test $gl_cv_func_frexpl_no_libm = yes \ | |
9265 | || test $gl_cv_func_frexpl_in_libm = yes; then | |
9266 | save_LIBS="$LIBS" | |
9267 | LIBS="$LIBS $FREXPL_LIBM" | |
8690e634 | 9268 | |
8690e634 | 9269 | |
c0c3707f CB |
9270 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5 |
9271 | $as_echo_n "checking whether frexpl works... " >&6; } | |
9272 | if ${gl_cv_func_frexpl_works+:} false; then : | |
9273 | $as_echo_n "(cached) " >&6 | |
9274 | else | |
8690e634 | 9275 | |
c0c3707f | 9276 | if test "$cross_compiling" = yes; then : |
8690e634 | 9277 | |
c0c3707f CB |
9278 | case "$host_os" in |
9279 | aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*) | |
9280 | gl_cv_func_frexpl_works="guessing no";; | |
9281 | *) gl_cv_func_frexpl_works="guessing yes";; | |
9282 | esac | |
8690e634 | 9283 | |
c0c3707f CB |
9284 | else |
9285 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9286 | /* end confdefs.h. */ | |
8690e634 | 9287 | |
c0c3707f CB |
9288 | #include <float.h> |
9289 | #include <math.h> | |
9290 | /* Override the values of <float.h>, like done in float.in.h. */ | |
9291 | #if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) | |
9292 | # undef LDBL_MIN_EXP | |
9293 | # define LDBL_MIN_EXP (-16381) | |
6ec2e0f5 | 9294 | #endif |
c0c3707f CB |
9295 | #if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__) |
9296 | # undef LDBL_MIN_EXP | |
9297 | # define LDBL_MIN_EXP (-16381) | |
6ec2e0f5 | 9298 | #endif |
c0c3707f CB |
9299 | #if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__ |
9300 | # undef LDBL_MIN_EXP | |
9301 | # define LDBL_MIN_EXP DBL_MIN_EXP | |
6ec2e0f5 | 9302 | #endif |
c0c3707f CB |
9303 | #if defined __sgi && (LDBL_MANT_DIG >= 106) |
9304 | # if defined __GNUC__ | |
9305 | # undef LDBL_MIN_EXP | |
9306 | # define LDBL_MIN_EXP DBL_MIN_EXP | |
9307 | # endif | |
6ec2e0f5 | 9308 | #endif |
c0c3707f CB |
9309 | extern |
9310 | #ifdef __cplusplus | |
9311 | "C" | |
9312 | #endif | |
9313 | long double frexpl (long double, int *); | |
9314 | int main() | |
8690e634 | 9315 | { |
c0c3707f CB |
9316 | int result = 0; |
9317 | volatile long double x; | |
9318 | /* Test on finite numbers that fails on AIX 5.1. */ | |
9319 | x = 16.0L; | |
9320 | { | |
9321 | int exp = -9999; | |
9322 | frexpl (x, &exp); | |
9323 | if (exp != 5) | |
9324 | result |= 1; | |
9325 | } | |
9326 | /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl | |
9327 | function returns an invalid (incorrectly normalized) value: it returns | |
9328 | y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 } | |
9329 | but the correct result is | |
9330 | 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */ | |
9331 | x = 1.01L; | |
9332 | { | |
9333 | int exp = -9999; | |
9334 | long double y = frexpl (x, &exp); | |
9335 | if (!(exp == 1 && y == 0.505L)) | |
9336 | result |= 2; | |
9337 | } | |
9338 | /* Test on large finite numbers. This fails on BeOS at i = 16322, while | |
9339 | LDBL_MAX_EXP = 16384. | |
9340 | In the loop end test, we test x against Infinity, rather than comparing | |
9341 | i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */ | |
9342 | { | |
9343 | int i; | |
9344 | for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L) | |
9345 | { | |
9346 | int exp = -9999; | |
9347 | frexpl (x, &exp); | |
9348 | if (exp != i) | |
9349 | { | |
9350 | result |= 4; | |
9351 | break; | |
9352 | } | |
9353 | } | |
9354 | } | |
9355 | /* Test on denormalized numbers. */ | |
9356 | { | |
9357 | int i; | |
9358 | for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L) | |
9359 | ; | |
9360 | if (x > 0.0L) | |
9361 | { | |
9362 | int exp; | |
9363 | long double y = frexpl (x, &exp); | |
9364 | /* On machines with IEEE854 arithmetic: x = 1.68105e-4932, | |
9365 | exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */ | |
9366 | if (exp != LDBL_MIN_EXP - 1) | |
9367 | result |= 8; | |
9368 | } | |
9369 | } | |
9370 | /* Test on infinite numbers. */ | |
9371 | x = 1.0L / 0.0L; | |
9372 | { | |
9373 | int exp; | |
9374 | long double y = frexpl (x, &exp); | |
9375 | if (y != x) | |
9376 | result |= 16; | |
9377 | } | |
9378 | return result; | |
8690e634 JK |
9379 | } |
9380 | _ACEOF | |
c0c3707f CB |
9381 | if ac_fn_c_try_run "$LINENO"; then : |
9382 | gl_cv_func_frexpl_works=yes | |
6ec2e0f5 | 9383 | else |
c0c3707f CB |
9384 | gl_cv_func_frexpl_works=no |
9385 | fi | |
9386 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
9387 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
9388 | fi | |
8690e634 | 9389 | |
8690e634 | 9390 | |
c0c3707f CB |
9391 | fi |
9392 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5 | |
9393 | $as_echo "$gl_cv_func_frexpl_works" >&6; } | |
8690e634 | 9394 | |
c0c3707f CB |
9395 | LIBS="$save_LIBS" |
9396 | case "$gl_cv_func_frexpl_works" in | |
9397 | *yes) gl_func_frexpl=yes ;; | |
9398 | *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;; | |
9399 | esac | |
9400 | else | |
9401 | gl_func_frexpl=no | |
9402 | fi | |
9403 | if test $gl_func_frexpl = yes; then | |
8690e634 | 9404 | |
c0c3707f | 9405 | $as_echo "#define HAVE_FREXPL 1" >>confdefs.h |
8690e634 | 9406 | |
c0c3707f CB |
9407 | fi |
9408 | fi | |
9409 | if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then | |
9410 | if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then | |
8690e634 | 9411 | |
c0c3707f CB |
9412 | FREXPL_LIBM="$FREXP_LIBM" |
9413 | else | |
9414 | FREXPL_LIBM= | |
9415 | fi | |
9416 | fi | |
6ec2e0f5 | 9417 | |
6ec2e0f5 | 9418 | |
6ec2e0f5 | 9419 | |
c0c3707f CB |
9420 | GNULIB_FCHMODAT=0; |
9421 | GNULIB_FSTAT=0; | |
9422 | GNULIB_FSTATAT=0; | |
9423 | GNULIB_FUTIMENS=0; | |
9424 | GNULIB_LCHMOD=0; | |
9425 | GNULIB_LSTAT=0; | |
9426 | GNULIB_MKDIRAT=0; | |
9427 | GNULIB_MKFIFO=0; | |
9428 | GNULIB_MKFIFOAT=0; | |
9429 | GNULIB_MKNOD=0; | |
9430 | GNULIB_MKNODAT=0; | |
9431 | GNULIB_STAT=0; | |
9432 | GNULIB_UTIMENSAT=0; | |
9433 | GNULIB_OVERRIDES_STRUCT_STAT=0; | |
9434 | HAVE_FCHMODAT=1; | |
9435 | HAVE_FSTATAT=1; | |
9436 | HAVE_FUTIMENS=1; | |
9437 | HAVE_LCHMOD=1; | |
9438 | HAVE_LSTAT=1; | |
9439 | HAVE_MKDIRAT=1; | |
9440 | HAVE_MKFIFO=1; | |
9441 | HAVE_MKFIFOAT=1; | |
9442 | HAVE_MKNOD=1; | |
9443 | HAVE_MKNODAT=1; | |
9444 | HAVE_UTIMENSAT=1; | |
5df4cba6 | 9445 | REPLACE_FCHMODAT=0; |
c0c3707f CB |
9446 | REPLACE_FSTAT=0; |
9447 | REPLACE_FSTATAT=0; | |
9448 | REPLACE_FUTIMENS=0; | |
5df4cba6 | 9449 | REPLACE_LCHMOD=0; |
c0c3707f CB |
9450 | REPLACE_LSTAT=0; |
9451 | REPLACE_MKDIR=0; | |
9452 | REPLACE_MKFIFO=0; | |
9453 | REPLACE_MKNOD=0; | |
9454 | REPLACE_STAT=0; | |
9455 | REPLACE_UTIMENSAT=0; | |
9456 | ||
9457 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 | |
9458 | $as_echo_n "checking whether stat file-mode macros are broken... " >&6; } | |
9459 | if ${ac_cv_header_stat_broken+:} false; then : | |
9460 | $as_echo_n "(cached) " >&6 | |
9461 | else | |
9462 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9463 | /* end confdefs.h. */ | |
9464 | #include <sys/types.h> | |
9465 | #include <sys/stat.h> | |
9466 | ||
9467 | #if defined S_ISBLK && defined S_IFDIR | |
9468 | extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; | |
9469 | #endif | |
9470 | ||
9471 | #if defined S_ISBLK && defined S_IFCHR | |
9472 | extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; | |
9473 | #endif | |
9474 | ||
9475 | #if defined S_ISLNK && defined S_IFREG | |
9476 | extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; | |
9477 | #endif | |
8690e634 | 9478 | |
c0c3707f CB |
9479 | #if defined S_ISSOCK && defined S_IFREG |
9480 | extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; | |
9481 | #endif | |
8690e634 | 9482 | |
c0c3707f CB |
9483 | _ACEOF |
9484 | if ac_fn_c_try_compile "$LINENO"; then : | |
9485 | ac_cv_header_stat_broken=no | |
9486 | else | |
9487 | ac_cv_header_stat_broken=yes | |
6ec2e0f5 SDJ |
9488 | fi |
9489 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6ec2e0f5 | 9490 | fi |
c0c3707f CB |
9491 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 |
9492 | $as_echo "$ac_cv_header_stat_broken" >&6; } | |
9493 | if test $ac_cv_header_stat_broken = yes; then | |
8690e634 | 9494 | |
c0c3707f | 9495 | $as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h |
49e4877c | 9496 | |
c0c3707f | 9497 | fi |
49e4877c PA |
9498 | |
9499 | ||
9500 | ||
9501 | ||
8690e634 | 9502 | |
c0c3707f CB |
9503 | case "$host_os" in |
9504 | mingw*) | |
9505 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5 | |
9506 | $as_echo_n "checking for 64-bit off_t... " >&6; } | |
9507 | if ${gl_cv_type_off_t_64+:} false; then : | |
9508 | $as_echo_n "(cached) " >&6 | |
9509 | else | |
9510 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9511 | /* end confdefs.h. */ | |
9512 | #include <sys/types.h> | |
9513 | int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1]; | |
8690e634 | 9514 | |
6ec2e0f5 SDJ |
9515 | int |
9516 | main () | |
9517 | { | |
8690e634 | 9518 | |
6ec2e0f5 SDJ |
9519 | ; |
9520 | return 0; | |
9521 | } | |
9522 | _ACEOF | |
9523 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f CB |
9524 | gl_cv_type_off_t_64=yes |
9525 | else | |
9526 | gl_cv_type_off_t_64=no | |
6ec2e0f5 SDJ |
9527 | fi |
9528 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
8690e634 | 9529 | |
c0c3707f CB |
9530 | fi |
9531 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5 | |
9532 | $as_echo "$gl_cv_type_off_t_64" >&6; } | |
9533 | if test $gl_cv_type_off_t_64 = no; then | |
9534 | WINDOWS_64_BIT_OFF_T=1 | |
9535 | else | |
9536 | WINDOWS_64_BIT_OFF_T=0 | |
9537 | fi | |
9538 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5 | |
9539 | $as_echo_n "checking for 64-bit st_size... " >&6; } | |
9540 | if ${gl_cv_member_st_size_64+:} false; then : | |
6ec2e0f5 SDJ |
9541 | $as_echo_n "(cached) " >&6 |
9542 | else | |
c0c3707f | 9543 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6ec2e0f5 | 9544 | /* end confdefs.h. */ |
c0c3707f CB |
9545 | #include <sys/types.h> |
9546 | struct stat buf; | |
9547 | int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1]; | |
8690e634 | 9548 | |
6ec2e0f5 SDJ |
9549 | int |
9550 | main () | |
9551 | { | |
8690e634 | 9552 | |
6ec2e0f5 SDJ |
9553 | ; |
9554 | return 0; | |
9555 | } | |
9556 | _ACEOF | |
9557 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f CB |
9558 | gl_cv_member_st_size_64=yes |
9559 | else | |
9560 | gl_cv_member_st_size_64=no | |
6ec2e0f5 SDJ |
9561 | fi |
9562 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
8690e634 | 9563 | |
6ec2e0f5 | 9564 | fi |
c0c3707f CB |
9565 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5 |
9566 | $as_echo "$gl_cv_member_st_size_64" >&6; } | |
9567 | if test $gl_cv_member_st_size_64 = no; then | |
9568 | WINDOWS_64_BIT_ST_SIZE=1 | |
9569 | else | |
9570 | WINDOWS_64_BIT_ST_SIZE=0 | |
9571 | fi | |
9572 | ;; | |
9573 | *) | |
9574 | WINDOWS_64_BIT_OFF_T=0 | |
9575 | WINDOWS_64_BIT_ST_SIZE=0 | |
9576 | ;; | |
9577 | esac | |
8690e634 JK |
9578 | |
9579 | ||
9580 | ||
9581 | ||
9582 | ||
9583 | ||
c0c3707f CB |
9584 | |
9585 | ||
9586 | ||
9587 | ||
9588 | ||
9589 | ||
9590 | ||
9591 | ||
9592 | ||
9593 | if test $gl_cv_have_include_next = yes; then | |
9594 | gl_cv_next_sys_stat_h='<'sys/stat.h'>' | |
9595 | else | |
9596 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5 | |
9597 | $as_echo_n "checking absolute name of <sys/stat.h>... " >&6; } | |
9598 | if ${gl_cv_next_sys_stat_h+:} false; then : | |
8690e634 JK |
9599 | $as_echo_n "(cached) " >&6 |
9600 | else | |
9601 | ||
c0c3707f | 9602 | if test $ac_cv_header_sys_stat_h = yes; then |
4a626d0a PA |
9603 | |
9604 | ||
4a626d0a | 9605 | |
c0c3707f CB |
9606 | |
9607 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9608 | /* end confdefs.h. */ | |
9609 | #include <sys/stat.h> | |
6ec2e0f5 | 9610 | _ACEOF |
c0c3707f CB |
9611 | case "$host_os" in |
9612 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
9613 | *) gl_absname_cpp="$ac_cpp" ;; | |
9614 | esac | |
9615 | ||
9616 | case "$host_os" in | |
9617 | mingw*) | |
9618 | gl_dirsep_regex='[/\\]' | |
9619 | ;; | |
9620 | *) | |
9621 | gl_dirsep_regex='\/' | |
9622 | ;; | |
9623 | esac | |
9624 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
9625 | gl_header_literal_regex=`echo 'sys/stat.h' \ | |
9626 | | sed -e "$gl_make_literal_regex_sed"` | |
9627 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
9628 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
9629 | s|^/[^/]|//&| | |
9630 | p | |
9631 | q | |
9632 | }' | |
9633 | ||
9634 | gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
9635 | sed -n "$gl_absolute_header_sed"` | |
9636 | ||
9637 | gl_header=$gl_cv_absolute_sys_stat_h | |
9638 | gl_cv_next_sys_stat_h='"'$gl_header'"' | |
9639 | else | |
9640 | gl_cv_next_sys_stat_h='<'sys/stat.h'>' | |
9641 | fi | |
9642 | ||
9643 | ||
9644 | fi | |
9645 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 | |
9646 | $as_echo "$gl_cv_next_sys_stat_h" >&6; } | |
9647 | fi | |
9648 | NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h | |
9649 | ||
9650 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
9651 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
9652 | gl_next_as_first_directive='<'sys/stat.h'>' | |
9653 | else | |
9654 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
9655 | gl_next_as_first_directive=$gl_cv_next_sys_stat_h | |
9656 | fi | |
9657 | NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive | |
9658 | ||
9659 | ||
9660 | ||
9661 | ||
9662 | ||
9663 | ||
9664 | ||
9665 | ||
9666 | WINDOWS_STAT_TIMESPEC=0 | |
9667 | ||
9668 | ||
9669 | ||
9670 | ||
4a626d0a | 9671 | |
4a626d0a | 9672 | |
8690e634 JK |
9673 | |
9674 | ||
c0c3707f CB |
9675 | ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h> |
9676 | #include <sys/stat.h> | |
9677 | " | |
9678 | if test "x$ac_cv_type_nlink_t" = xyes; then : | |
8690e634 | 9679 | |
6ec2e0f5 | 9680 | else |
8690e634 | 9681 | |
c0c3707f | 9682 | $as_echo "#define nlink_t int" >>confdefs.h |
6ec2e0f5 | 9683 | |
6ec2e0f5 | 9684 | fi |
8690e634 JK |
9685 | |
9686 | ||
9687 | ||
9688 | ||
9689 | ||
9690 | ||
9691 | ||
c0c3707f CB |
9692 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 |
9693 | $as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } | |
9694 | if ${gl_cv_func_lstat_dereferences_slashed_symlink+:} false; then : | |
8690e634 | 9695 | $as_echo_n "(cached) " >&6 |
c0c3707f CB |
9696 | else |
9697 | rm -f conftest.sym conftest.file | |
9698 | echo >conftest.file | |
9699 | if test "$cross_compiling" = yes; then : | |
9700 | case "$host_os" in | |
9701 | linux-* | linux) | |
9702 | # Guess yes on Linux systems. | |
9703 | gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; | |
9704 | *-gnu* | gnu*) | |
9705 | # Guess yes on glibc systems. | |
9706 | gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; | |
9707 | mingw*) | |
9708 | # Guess no on native Windows. | |
9709 | gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; | |
9710 | *) | |
9711 | # If we don't know, obey --enable-cross-guesses. | |
9712 | gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;; | |
9713 | esac | |
9714 | ||
8690e634 JK |
9715 | else |
9716 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9717 | /* end confdefs.h. */ | |
c0c3707f | 9718 | $ac_includes_default |
8690e634 JK |
9719 | int |
9720 | main () | |
9721 | { | |
c0c3707f CB |
9722 | struct stat sbuf; |
9723 | if (symlink ("conftest.file", "conftest.sym") != 0) | |
9724 | return 1; | |
9725 | /* Linux will dereference the symlink and fail, as required by | |
9726 | POSIX. That is better in the sense that it means we will not | |
9727 | have to compile and use the lstat wrapper. */ | |
9728 | return lstat ("conftest.sym/", &sbuf) == 0; | |
6ec2e0f5 | 9729 | |
8690e634 JK |
9730 | ; |
9731 | return 0; | |
9732 | } | |
9733 | _ACEOF | |
c0c3707f CB |
9734 | if ac_fn_c_try_run "$LINENO"; then : |
9735 | gl_cv_func_lstat_dereferences_slashed_symlink=yes | |
8690e634 | 9736 | else |
c0c3707f | 9737 | gl_cv_func_lstat_dereferences_slashed_symlink=no |
8690e634 | 9738 | fi |
c0c3707f CB |
9739 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
9740 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
9741 | fi | |
9742 | ||
9743 | rm -f conftest.sym conftest.file | |
6ec2e0f5 | 9744 | |
8690e634 | 9745 | fi |
c0c3707f CB |
9746 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5 |
9747 | $as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; } | |
9748 | case "$gl_cv_func_lstat_dereferences_slashed_symlink" in | |
9749 | *yes) | |
9750 | ||
9751 | cat >>confdefs.h <<_ACEOF | |
9752 | #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 | |
8690e634 JK |
9753 | _ACEOF |
9754 | ||
c0c3707f CB |
9755 | ;; |
9756 | esac | |
8690e634 | 9757 | |
8690e634 | 9758 | |
8690e634 | 9759 | |
8690e634 | 9760 | |
c0c3707f CB |
9761 | |
9762 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5 | |
9763 | $as_echo_n "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; } | |
9764 | if ${gl_cv_func_getcwd_null+:} false; then : | |
8690e634 JK |
9765 | $as_echo_n "(cached) " >&6 |
9766 | else | |
c0c3707f CB |
9767 | if test "$cross_compiling" = yes; then : |
9768 | case "$host_os" in | |
9769 | # Guess yes on glibc systems. | |
9770 | *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";; | |
9771 | # Guess yes on musl systems. | |
9772 | *-musl*) gl_cv_func_getcwd_null="guessing yes";; | |
9773 | # Guess yes on Cygwin. | |
9774 | cygwin*) gl_cv_func_getcwd_null="guessing yes";; | |
9775 | # If we don't know, obey --enable-cross-guesses. | |
9776 | *) gl_cv_func_getcwd_null="$gl_cross_guess_normal";; | |
9777 | esac | |
9778 | ||
9779 | else | |
9780 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 JK |
9781 | /* end confdefs.h. */ |
9782 | ||
c0c3707f CB |
9783 | # include <stdlib.h> |
9784 | # if HAVE_UNISTD_H | |
9785 | # include <unistd.h> | |
9786 | # else /* on Windows with MSVC */ | |
9787 | # include <direct.h> | |
9788 | # endif | |
9789 | # ifndef getcwd | |
9790 | char *getcwd (); | |
9791 | # endif | |
8690e634 JK |
9792 | |
9793 | int | |
9794 | main () | |
9795 | { | |
9796 | ||
c0c3707f CB |
9797 | #if defined _WIN32 && ! defined __CYGWIN__ |
9798 | /* mingw cwd does not start with '/', but getcwd does allocate. | |
9799 | However, mingw fails to honor non-zero size. */ | |
9800 | #else | |
9801 | if (chdir ("/") != 0) | |
9802 | return 1; | |
9803 | else | |
9804 | { | |
9805 | char *f = getcwd (NULL, 0); | |
9806 | if (! f) | |
9807 | return 2; | |
9808 | if (f[0] != '/') | |
9809 | { free (f); return 3; } | |
9810 | if (f[1] != '\0') | |
9811 | { free (f); return 4; } | |
9812 | free (f); | |
9813 | return 0; | |
9814 | } | |
9815 | #endif | |
9816 | ||
8690e634 JK |
9817 | ; |
9818 | return 0; | |
9819 | } | |
9820 | _ACEOF | |
c0c3707f CB |
9821 | if ac_fn_c_try_run "$LINENO"; then : |
9822 | gl_cv_func_getcwd_null=yes | |
9823 | else | |
9824 | gl_cv_func_getcwd_null=no | |
8690e634 | 9825 | fi |
c0c3707f CB |
9826 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
9827 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
8690e634 | 9828 | fi |
8690e634 | 9829 | |
c0c3707f CB |
9830 | fi |
9831 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5 | |
9832 | $as_echo "$gl_cv_func_getcwd_null" >&6; } | |
8690e634 | 9833 | |
6ec2e0f5 | 9834 | |
c0c3707f CB |
9835 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5 |
9836 | $as_echo_n "checking for getcwd with POSIX signature... " >&6; } | |
9837 | if ${gl_cv_func_getcwd_posix_signature+:} false; then : | |
8690e634 JK |
9838 | $as_echo_n "(cached) " >&6 |
9839 | else | |
c0c3707f | 9840 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8690e634 | 9841 | /* end confdefs.h. */ |
c0c3707f | 9842 | #include <unistd.h> |
88b48903 WN |
9843 | int |
9844 | main () | |
9845 | { | |
c0c3707f CB |
9846 | extern |
9847 | #ifdef __cplusplus | |
9848 | "C" | |
9849 | #endif | |
9850 | char *getcwd (char *, size_t); | |
88b48903 WN |
9851 | |
9852 | ; | |
9853 | return 0; | |
9854 | } | |
c0c3707f | 9855 | |
88b48903 WN |
9856 | _ACEOF |
9857 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f CB |
9858 | gl_cv_func_getcwd_posix_signature=yes |
9859 | else | |
9860 | gl_cv_func_getcwd_posix_signature=no | |
8690e634 | 9861 | fi |
88b48903 | 9862 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
8690e634 | 9863 | |
c0c3707f CB |
9864 | fi |
9865 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5 | |
9866 | $as_echo "$gl_cv_func_getcwd_posix_signature" >&6; } | |
8690e634 | 9867 | |
c0c3707f CB |
9868 | ac_fn_c_check_decl "$LINENO" "getcwd" "ac_cv_have_decl_getcwd" "$ac_includes_default" |
9869 | if test "x$ac_cv_have_decl_getcwd" = xyes; then : | |
9870 | ac_have_decl=1 | |
9871 | else | |
9872 | ac_have_decl=0 | |
9873 | fi | |
8690e634 | 9874 | |
c0c3707f CB |
9875 | cat >>confdefs.h <<_ACEOF |
9876 | #define HAVE_DECL_GETCWD $ac_have_decl | |
9877 | _ACEOF | |
8690e634 JK |
9878 | |
9879 | ||
7a6dbc2f | 9880 | |
c0c3707f CB |
9881 | ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default" |
9882 | if test "x$ac_cv_have_decl_getdtablesize" = xyes; then : | |
9883 | ac_have_decl=1 | |
88b48903 | 9884 | else |
c0c3707f | 9885 | ac_have_decl=0 |
88b48903 | 9886 | fi |
8690e634 | 9887 | |
c0c3707f CB |
9888 | cat >>confdefs.h <<_ACEOF |
9889 | #define HAVE_DECL_GETDTABLESIZE $ac_have_decl | |
9890 | _ACEOF | |
8690e634 | 9891 | |
c0c3707f CB |
9892 | ac_fn_c_check_decl "$LINENO" "getlogin_r" "ac_cv_have_decl_getlogin_r" "$ac_includes_default" |
9893 | if test "x$ac_cv_have_decl_getlogin_r" = xyes; then : | |
9894 | ac_have_decl=1 | |
9895 | else | |
9896 | ac_have_decl=0 | |
9897 | fi | |
8690e634 | 9898 | |
c0c3707f CB |
9899 | cat >>confdefs.h <<_ACEOF |
9900 | #define HAVE_DECL_GETLOGIN_R $ac_have_decl | |
9901 | _ACEOF | |
8690e634 JK |
9902 | |
9903 | ||
6ec2e0f5 | 9904 | |
c0c3707f CB |
9905 | ac_fn_c_check_decl "$LINENO" "getlogin" "ac_cv_have_decl_getlogin" "$ac_includes_default" |
9906 | if test "x$ac_cv_have_decl_getlogin" = xyes; then : | |
9907 | ac_have_decl=1 | |
6ec2e0f5 | 9908 | else |
c0c3707f | 9909 | ac_have_decl=0 |
88b48903 | 9910 | fi |
8690e634 | 9911 | |
c0c3707f CB |
9912 | cat >>confdefs.h <<_ACEOF |
9913 | #define HAVE_DECL_GETLOGIN $ac_have_decl | |
9914 | _ACEOF | |
8690e634 JK |
9915 | |
9916 | ||
9917 | ||
c0c3707f CB |
9918 | case $host_os in |
9919 | mingw*) | |
9920 | LIB_GETLOGIN='-ladvapi32' ;; | |
9921 | *) | |
9922 | LIB_GETLOGIN= ;; | |
9923 | esac | |
6ec2e0f5 | 9924 | |
472fa5ee SM |
9925 | |
9926 | ||
9927 | ||
6ec2e0f5 SDJ |
9928 | |
9929 | ||
9930 | ||
c0c3707f CB |
9931 | GNULIB_GETTIMEOFDAY=0; |
9932 | HAVE_GETTIMEOFDAY=1; | |
9933 | HAVE_STRUCT_TIMEVAL=1; | |
9934 | HAVE_SYS_TIME_H=1; | |
9935 | REPLACE_GETTIMEOFDAY=0; | |
9936 | REPLACE_STRUCT_TIMEVAL=0; | |
472fa5ee | 9937 | |
c0c3707f CB |
9938 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 |
9939 | $as_echo_n "checking for C/C++ restrict keyword... " >&6; } | |
9940 | if ${ac_cv_c_restrict+:} false; then : | |
9941 | $as_echo_n "(cached) " >&6 | |
9942 | else | |
9943 | ac_cv_c_restrict=no | |
9944 | # The order here caters to the fact that C++ does not require restrict. | |
9945 | for ac_kw in __restrict __restrict__ _Restrict restrict; do | |
9946 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
9947 | /* end confdefs.h. */ | |
9948 | typedef int *int_ptr; | |
9949 | int foo (int_ptr $ac_kw ip) { return ip[0]; } | |
9950 | int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ | |
9951 | int bar (int ip[$ac_kw]) { return ip[0]; } | |
472fa5ee | 9952 | |
c0c3707f CB |
9953 | int |
9954 | main () | |
9955 | { | |
9956 | int s[1]; | |
9957 | int *$ac_kw t = s; | |
9958 | t[0] = 0; | |
9959 | return foo (t) + bar (t); | |
472fa5ee | 9960 | |
c0c3707f CB |
9961 | ; |
9962 | return 0; | |
9963 | } | |
9964 | _ACEOF | |
9965 | if ac_fn_c_try_compile "$LINENO"; then : | |
9966 | ac_cv_c_restrict=$ac_kw | |
9967 | fi | |
9968 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
9969 | test "$ac_cv_c_restrict" != no && break | |
9970 | done | |
472fa5ee | 9971 | |
c0c3707f CB |
9972 | fi |
9973 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 | |
9974 | $as_echo "$ac_cv_c_restrict" >&6; } | |
472fa5ee | 9975 | |
c0c3707f CB |
9976 | case $ac_cv_c_restrict in |
9977 | restrict) ;; | |
9978 | no) $as_echo "#define restrict /**/" >>confdefs.h | |
9979 | ;; | |
9980 | *) cat >>confdefs.h <<_ACEOF | |
9981 | #define restrict $ac_cv_c_restrict | |
9982 | _ACEOF | |
9983 | ;; | |
9984 | esac | |
472fa5ee SM |
9985 | |
9986 | ||
6ec2e0f5 SDJ |
9987 | |
9988 | ||
9989 | ||
9990 | ||
9991 | ||
9992 | ||
472fa5ee SM |
9993 | |
9994 | ||
9995 | ||
6ec2e0f5 SDJ |
9996 | |
9997 | ||
9998 | ||
9999 | ||
10000 | ||
10001 | if test $gl_cv_have_include_next = yes; then | |
c0c3707f | 10002 | gl_cv_next_sys_time_h='<'sys/time.h'>' |
6ec2e0f5 | 10003 | else |
c0c3707f CB |
10004 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5 |
10005 | $as_echo_n "checking absolute name of <sys/time.h>... " >&6; } | |
10006 | if ${gl_cv_next_sys_time_h+:} false; then : | |
6ec2e0f5 | 10007 | $as_echo_n "(cached) " >&6 |
88b48903 | 10008 | else |
8690e634 | 10009 | |
c0c3707f | 10010 | if test $ac_cv_header_sys_time_h = yes; then |
8690e634 JK |
10011 | |
10012 | ||
8690e634 JK |
10013 | |
10014 | ||
6ec2e0f5 SDJ |
10015 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
10016 | /* end confdefs.h. */ | |
c0c3707f | 10017 | #include <sys/time.h> |
88b48903 | 10018 | _ACEOF |
6ec2e0f5 SDJ |
10019 | case "$host_os" in |
10020 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
10021 | *) gl_absname_cpp="$ac_cpp" ;; | |
10022 | esac | |
8690e634 | 10023 | |
6ec2e0f5 SDJ |
10024 | case "$host_os" in |
10025 | mingw*) | |
10026 | gl_dirsep_regex='[/\\]' | |
10027 | ;; | |
10028 | *) | |
10029 | gl_dirsep_regex='\/' | |
88b48903 WN |
10030 | ;; |
10031 | esac | |
6ec2e0f5 | 10032 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' |
c0c3707f | 10033 | gl_header_literal_regex=`echo 'sys/time.h' \ |
6ec2e0f5 SDJ |
10034 | | sed -e "$gl_make_literal_regex_sed"` |
10035 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
10036 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
10037 | s|^/[^/]|//&| | |
10038 | p | |
10039 | q | |
10040 | }' | |
8690e634 | 10041 | |
c0c3707f | 10042 | gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
6ec2e0f5 | 10043 | sed -n "$gl_absolute_header_sed"` |
8690e634 | 10044 | |
c0c3707f CB |
10045 | gl_header=$gl_cv_absolute_sys_time_h |
10046 | gl_cv_next_sys_time_h='"'$gl_header'"' | |
6ec2e0f5 | 10047 | else |
c0c3707f | 10048 | gl_cv_next_sys_time_h='<'sys/time.h'>' |
6ec2e0f5 | 10049 | fi |
88b48903 | 10050 | |
88b48903 | 10051 | |
88b48903 | 10052 | fi |
c0c3707f CB |
10053 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5 |
10054 | $as_echo "$gl_cv_next_sys_time_h" >&6; } | |
6ec2e0f5 | 10055 | fi |
c0c3707f | 10056 | NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h |
88b48903 | 10057 | |
6ec2e0f5 SDJ |
10058 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
10059 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
c0c3707f | 10060 | gl_next_as_first_directive='<'sys/time.h'>' |
6ec2e0f5 SDJ |
10061 | else |
10062 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
c0c3707f CB |
10063 | gl_next_as_first_directive=$gl_cv_next_sys_time_h |
10064 | fi | |
10065 | NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive | |
6ec2e0f5 | 10066 | |
6ec2e0f5 SDJ |
10067 | |
10068 | ||
10069 | ||
6ec2e0f5 | 10070 | |
c0c3707f CB |
10071 | if test $ac_cv_header_sys_time_h != yes; then |
10072 | HAVE_SYS_TIME_H=0 | |
10073 | fi | |
6ec2e0f5 | 10074 | |
6ec2e0f5 | 10075 | |
6ec2e0f5 | 10076 | |
6ec2e0f5 | 10077 | |
6ec2e0f5 | 10078 | |
c0c3707f CB |
10079 | if test $ac_cv_header_sys_socket_h != yes; then |
10080 | for ac_header in winsock2.h | |
10081 | do : | |
10082 | ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" | |
10083 | if test "x$ac_cv_header_winsock2_h" = xyes; then : | |
10084 | cat >>confdefs.h <<_ACEOF | |
10085 | #define HAVE_WINSOCK2_H 1 | |
6ec2e0f5 | 10086 | _ACEOF |
6ec2e0f5 | 10087 | |
6ec2e0f5 | 10088 | fi |
6ec2e0f5 | 10089 | |
c0c3707f | 10090 | done |
6ec2e0f5 | 10091 | |
c0c3707f CB |
10092 | fi |
10093 | if test "$ac_cv_header_winsock2_h" = yes; then | |
10094 | HAVE_WINSOCK2_H=1 | |
10095 | UNISTD_H_HAVE_WINSOCK2_H=1 | |
10096 | SYS_IOCTL_H_HAVE_WINSOCK2_H=1 | |
10097 | else | |
10098 | HAVE_WINSOCK2_H=0 | |
10099 | fi | |
10100 | ||
10101 | ||
10102 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5 | |
10103 | $as_echo_n "checking for struct timeval... " >&6; } | |
10104 | if ${gl_cv_sys_struct_timeval+:} false; then : | |
10105 | $as_echo_n "(cached) " >&6 | |
10106 | else | |
10107 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 10108 | /* end confdefs.h. */ |
c0c3707f CB |
10109 | #if HAVE_SYS_TIME_H |
10110 | #include <sys/time.h> | |
10111 | #endif | |
10112 | #include <time.h> | |
10113 | #if HAVE_WINSOCK2_H | |
10114 | # include <winsock2.h> | |
10115 | #endif | |
6ec2e0f5 SDJ |
10116 | |
10117 | int | |
10118 | main () | |
10119 | { | |
c0c3707f | 10120 | static struct timeval x; x.tv_sec = x.tv_usec; |
6ec2e0f5 SDJ |
10121 | ; |
10122 | return 0; | |
10123 | } | |
10124 | _ACEOF | |
10125 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 10126 | gl_cv_sys_struct_timeval=yes |
6ec2e0f5 | 10127 | else |
c0c3707f | 10128 | gl_cv_sys_struct_timeval=no |
6ec2e0f5 SDJ |
10129 | fi |
10130 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
88b48903 | 10131 | |
c0c3707f CB |
10132 | fi |
10133 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5 | |
10134 | $as_echo "$gl_cv_sys_struct_timeval" >&6; } | |
10135 | if test $gl_cv_sys_struct_timeval != yes; then | |
10136 | HAVE_STRUCT_TIMEVAL=0 | |
10137 | else | |
10138 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5 | |
10139 | $as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; } | |
10140 | if ${gl_cv_sys_struct_timeval_tv_sec+:} false; then : | |
10141 | $as_echo_n "(cached) " >&6 | |
10142 | else | |
10143 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
88b48903 | 10144 | /* end confdefs.h. */ |
c0c3707f CB |
10145 | #if HAVE_SYS_TIME_H |
10146 | #include <sys/time.h> | |
10147 | #endif | |
10148 | #include <time.h> | |
10149 | #if HAVE_WINSOCK2_H | |
10150 | # include <winsock2.h> | |
10151 | #endif | |
88b48903 WN |
10152 | |
10153 | int | |
10154 | main () | |
10155 | { | |
c0c3707f CB |
10156 | static struct timeval x; |
10157 | typedef int verify_tv_sec_type[ | |
10158 | sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 | |
10159 | ]; | |
88b48903 WN |
10160 | |
10161 | ; | |
10162 | return 0; | |
10163 | } | |
10164 | _ACEOF | |
10165 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 10166 | gl_cv_sys_struct_timeval_tv_sec=yes |
88b48903 | 10167 | else |
c0c3707f | 10168 | gl_cv_sys_struct_timeval_tv_sec=no |
88b48903 WN |
10169 | fi |
10170 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c0c3707f | 10171 | |
88b48903 | 10172 | fi |
c0c3707f CB |
10173 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5 |
10174 | $as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; } | |
10175 | if test $gl_cv_sys_struct_timeval_tv_sec != yes; then | |
10176 | REPLACE_STRUCT_TIMEVAL=1 | |
88b48903 | 10177 | fi |
c0c3707f | 10178 | fi |
88b48903 | 10179 | |
c0c3707f CB |
10180 | |
10181 | ||
10182 | ||
10183 | ||
10184 | ||
10185 | ||
10186 | ||
10187 | ||
10188 | ||
10189 | ||
10190 | NEED_LOCALTIME_BUFFER=0 | |
10191 | ||
10192 | ||
10193 | GNULIB_CTIME=0; | |
10194 | GNULIB_MKTIME=0; | |
10195 | GNULIB_LOCALTIME=0; | |
10196 | GNULIB_NANOSLEEP=0; | |
10197 | GNULIB_STRFTIME=0; | |
10198 | GNULIB_STRPTIME=0; | |
10199 | GNULIB_TIMEGM=0; | |
10200 | GNULIB_TIME_R=0; | |
10201 | GNULIB_TIME_RZ=0; | |
10202 | GNULIB_TZSET=0; | |
10203 | HAVE_DECL_LOCALTIME_R=1; | |
10204 | HAVE_NANOSLEEP=1; | |
10205 | HAVE_STRPTIME=1; | |
10206 | HAVE_TIMEGM=1; | |
10207 | HAVE_TZSET=1; | |
10208 | HAVE_TIMEZONE_T=0; | |
10209 | REPLACE_CTIME=GNULIB_PORTCHECK; | |
10210 | REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; | |
10211 | REPLACE_MKTIME=GNULIB_PORTCHECK; | |
10212 | REPLACE_NANOSLEEP=GNULIB_PORTCHECK; | |
10213 | REPLACE_STRFTIME=GNULIB_PORTCHECK; | |
10214 | REPLACE_TIMEGM=GNULIB_PORTCHECK; | |
10215 | REPLACE_TZSET=GNULIB_PORTCHECK; | |
10216 | ||
10217 | : ${GNULIB_GETTIMEOFDAY=0}; | |
10218 | REPLACE_GMTIME=0; | |
10219 | REPLACE_LOCALTIME=0; | |
10220 | ||
10221 | ||
10222 | GNULIB_GLOB=0; | |
10223 | HAVE_GLOB=1; | |
10224 | HAVE_GLOB_PATTERN_P=1; | |
10225 | REPLACE_GLOB=0; | |
10226 | REPLACE_GLOB_PATTERN_P=0; | |
10227 | ||
10228 | ||
10229 | ||
10230 | ||
10231 | ||
10232 | ||
10233 | ||
10234 | ||
10235 | ||
10236 | ||
10237 | ||
10238 | ||
10239 | ||
10240 | ||
10241 | ||
10242 | ||
10243 | ||
10244 | if test $gl_cv_have_include_next = yes; then | |
10245 | gl_cv_next_glob_h='<'glob.h'>' | |
10246 | else | |
10247 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <glob.h>" >&5 | |
10248 | $as_echo_n "checking absolute name of <glob.h>... " >&6; } | |
10249 | if ${gl_cv_next_glob_h+:} false; then : | |
10250 | $as_echo_n "(cached) " >&6 | |
88b48903 | 10251 | else |
c0c3707f CB |
10252 | |
10253 | if test $ac_cv_header_glob_h = yes; then | |
10254 | ||
10255 | ||
10256 | ||
10257 | ||
88b48903 WN |
10258 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
10259 | /* end confdefs.h. */ | |
c0c3707f CB |
10260 | #include <glob.h> |
10261 | _ACEOF | |
10262 | case "$host_os" in | |
10263 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
10264 | *) gl_absname_cpp="$ac_cpp" ;; | |
10265 | esac | |
88b48903 | 10266 | |
c0c3707f CB |
10267 | case "$host_os" in |
10268 | mingw*) | |
10269 | gl_dirsep_regex='[/\\]' | |
10270 | ;; | |
10271 | *) | |
10272 | gl_dirsep_regex='\/' | |
10273 | ;; | |
10274 | esac | |
10275 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
10276 | gl_header_literal_regex=`echo 'glob.h' \ | |
10277 | | sed -e "$gl_make_literal_regex_sed"` | |
10278 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
10279 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
10280 | s|^/[^/]|//&| | |
10281 | p | |
10282 | q | |
10283 | }' | |
10284 | ||
10285 | gl_cv_absolute_glob_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
10286 | sed -n "$gl_absolute_header_sed"` | |
10287 | ||
10288 | gl_header=$gl_cv_absolute_glob_h | |
10289 | gl_cv_next_glob_h='"'$gl_header'"' | |
10290 | else | |
10291 | gl_cv_next_glob_h='<'glob.h'>' | |
10292 | fi | |
88b48903 | 10293 | |
88b48903 | 10294 | |
88b48903 | 10295 | fi |
c0c3707f CB |
10296 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_glob_h" >&5 |
10297 | $as_echo "$gl_cv_next_glob_h" >&6; } | |
10298 | fi | |
10299 | NEXT_GLOB_H=$gl_cv_next_glob_h | |
88b48903 | 10300 | |
c0c3707f CB |
10301 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
10302 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
10303 | gl_next_as_first_directive='<'glob.h'>' | |
10304 | else | |
10305 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
10306 | gl_next_as_first_directive=$gl_cv_next_glob_h | |
10307 | fi | |
10308 | NEXT_AS_FIRST_DIRECTIVE_GLOB_H=$gl_next_as_first_directive | |
88b48903 | 10309 | |
88b48903 WN |
10310 | |
10311 | ||
10312 | ||
2196f55f | 10313 | |
c0c3707f CB |
10314 | if test $ac_cv_header_glob_h = yes; then |
10315 | HAVE_GLOB_H=1 | |
10316 | else | |
10317 | HAVE_GLOB_H=0 | |
10318 | fi | |
2196f55f | 10319 | |
6ec2e0f5 | 10320 | |
c0c3707f CB |
10321 | GLOB_H='' |
10322 | if false; then | |
10323 | GLOB_H=glob.h | |
10324 | else | |
10325 | if test $ac_cv_header_glob_h != yes; then | |
10326 | GLOB_H=glob.h | |
10327 | fi | |
10328 | fi | |
10329 | ||
10330 | ||
10331 | if test -n "$GLOB_H"; then | |
10332 | GL_GENERATE_GLOB_H_TRUE= | |
10333 | GL_GENERATE_GLOB_H_FALSE='#' | |
88b48903 | 10334 | else |
c0c3707f CB |
10335 | GL_GENERATE_GLOB_H_TRUE='#' |
10336 | GL_GENERATE_GLOB_H_FALSE= | |
6ec2e0f5 SDJ |
10337 | fi |
10338 | ||
88b48903 | 10339 | |
88b48903 | 10340 | |
88b48903 | 10341 | |
88b48903 WN |
10342 | |
10343 | ||
10344 | ||
10345 | ||
10346 | ||
10347 | ||
10348 | ||
10349 | ||
8690e634 | 10350 | |
c0c3707f CB |
10351 | |
10352 | ||
c0c3707f | 10353 | |
5df4cba6 SM |
10354 | if test -z "$gl_pthreadlib_body_done"; then |
10355 | gl_pthread_api=no | |
10356 | LIBPTHREAD= | |
10357 | LIBPMULTITHREAD= | |
10358 | # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that | |
10359 | # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY. | |
10360 | ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" | |
10361 | if test "x$ac_cv_header_pthread_h" = xyes; then : | |
10362 | gl_have_pthread_h=yes | |
c0c3707f | 10363 | else |
5df4cba6 SM |
10364 | gl_have_pthread_h=no |
10365 | fi | |
c0c3707f | 10366 | |
5df4cba6 SM |
10367 | |
10368 | if test "$gl_have_pthread_h" = yes; then | |
10369 | # Other possible tests: | |
10370 | # -lpthreads (FSU threads, PCthreads) | |
10371 | # -lgthreads | |
10372 | # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist | |
10373 | # in libc. IRIX 6.5 has the first one in both libc and libpthread, but | |
10374 | # the second one only in libpthread, and lock.c needs it. | |
10375 | # | |
10376 | # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 | |
10377 | # needs -pthread for some reason. See: | |
10378 | # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html | |
10379 | save_LIBS=$LIBS | |
10380 | for gl_pthread in '' '-pthread'; do | |
10381 | LIBS="$LIBS $gl_pthread" | |
10382 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 10383 | /* end confdefs.h. */ |
5df4cba6 SM |
10384 | #include <pthread.h> |
10385 | pthread_mutex_t m; | |
10386 | pthread_mutexattr_t ma; | |
10387 | ||
8690e634 JK |
10388 | int |
10389 | main () | |
10390 | { | |
5df4cba6 SM |
10391 | pthread_mutex_lock (&m); |
10392 | pthread_mutexattr_init (&ma); | |
8690e634 JK |
10393 | ; |
10394 | return 0; | |
10395 | } | |
10396 | _ACEOF | |
5df4cba6 SM |
10397 | if ac_fn_c_try_link "$LINENO"; then : |
10398 | gl_pthread_api=yes | |
10399 | LIBPTHREAD=$gl_pthread | |
10400 | LIBPMULTITHREAD=$gl_pthread | |
c0c3707f | 10401 | fi |
5df4cba6 SM |
10402 | rm -f core conftest.err conftest.$ac_objext \ |
10403 | conftest$ac_exeext conftest.$ac_ext | |
10404 | LIBS=$save_LIBS | |
10405 | test $gl_pthread_api = yes && break | |
10406 | done | |
6ec2e0f5 | 10407 | |
5df4cba6 SM |
10408 | # Test for libpthread by looking for pthread_kill. (Not pthread_self, |
10409 | # since it is defined as a macro on OSF/1.) | |
10410 | if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then | |
10411 | # The program links fine without libpthread. But it may actually | |
10412 | # need to link with libpthread in order to create multiple threads. | |
10413 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
10414 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
10415 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
c0c3707f CB |
10416 | $as_echo_n "(cached) " >&6 |
10417 | else | |
5df4cba6 SM |
10418 | ac_check_lib_save_LIBS=$LIBS |
10419 | LIBS="-lpthread $LIBS" | |
10420 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 10421 | /* end confdefs.h. */ |
5df4cba6 SM |
10422 | |
10423 | /* Override any GCC internal prototype to avoid an error. | |
10424 | Use char because int might match the return type of a GCC | |
10425 | builtin and then its argument prototype would still apply. */ | |
10426 | #ifdef __cplusplus | |
10427 | extern "C" | |
10428 | #endif | |
10429 | char pthread_kill (); | |
6ec2e0f5 SDJ |
10430 | int |
10431 | main () | |
10432 | { | |
5df4cba6 | 10433 | return pthread_kill (); |
6ec2e0f5 SDJ |
10434 | ; |
10435 | return 0; | |
10436 | } | |
10437 | _ACEOF | |
5df4cba6 SM |
10438 | if ac_fn_c_try_link "$LINENO"; then : |
10439 | ac_cv_lib_pthread_pthread_kill=yes | |
6ec2e0f5 | 10440 | else |
5df4cba6 | 10441 | ac_cv_lib_pthread_pthread_kill=no |
8690e634 | 10442 | fi |
5df4cba6 SM |
10443 | rm -f core conftest.err conftest.$ac_objext \ |
10444 | conftest$ac_exeext conftest.$ac_ext | |
10445 | LIBS=$ac_check_lib_save_LIBS | |
10446 | fi | |
10447 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 | |
10448 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
10449 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
10450 | LIBPMULTITHREAD=-lpthread | |
10451 | # On Solaris and HP-UX, most pthread functions exist also in libc. | |
10452 | # Therefore pthread_in_use() needs to actually try to create a | |
10453 | # thread: pthread_create from libc will fail, whereas | |
10454 | # pthread_create will actually create a thread. | |
10455 | # On Solaris 10 or newer, this test is no longer needed, because | |
10456 | # libc contains the fully functional pthread functions. | |
10457 | case "$host_os" in | |
10458 | solaris | solaris2.1-9 | solaris2.1-9.* | hpux*) | |
10459 | ||
10460 | $as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h | |
10461 | ||
10462 | esac | |
c0c3707f | 10463 | |
6ec2e0f5 | 10464 | fi |
8690e634 | 10465 | |
5df4cba6 SM |
10466 | elif test $gl_pthread_api != yes; then |
10467 | # Some library is needed. Try libpthread and libc_r. | |
10468 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
10469 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
10470 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
10471 | $as_echo_n "(cached) " >&6 | |
10472 | else | |
10473 | ac_check_lib_save_LIBS=$LIBS | |
10474 | LIBS="-lpthread $LIBS" | |
10475 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10476 | /* end confdefs.h. */ | |
c0c3707f | 10477 | |
5df4cba6 SM |
10478 | /* Override any GCC internal prototype to avoid an error. |
10479 | Use char because int might match the return type of a GCC | |
10480 | builtin and then its argument prototype would still apply. */ | |
10481 | #ifdef __cplusplus | |
10482 | extern "C" | |
10483 | #endif | |
10484 | char pthread_kill (); | |
10485 | int | |
10486 | main () | |
10487 | { | |
10488 | return pthread_kill (); | |
10489 | ; | |
10490 | return 0; | |
10491 | } | |
10492 | _ACEOF | |
10493 | if ac_fn_c_try_link "$LINENO"; then : | |
10494 | ac_cv_lib_pthread_pthread_kill=yes | |
10495 | else | |
10496 | ac_cv_lib_pthread_pthread_kill=no | |
10497 | fi | |
10498 | rm -f core conftest.err conftest.$ac_objext \ | |
10499 | conftest$ac_exeext conftest.$ac_ext | |
10500 | LIBS=$ac_check_lib_save_LIBS | |
10501 | fi | |
10502 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 | |
10503 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
10504 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
10505 | gl_pthread_api=yes | |
10506 | LIBPTHREAD=-lpthread | |
10507 | LIBPMULTITHREAD=-lpthread | |
10508 | fi | |
c0c3707f | 10509 | |
5df4cba6 SM |
10510 | if test $gl_pthread_api != yes; then |
10511 | # For FreeBSD 4. | |
10512 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5 | |
10513 | $as_echo_n "checking for pthread_kill in -lc_r... " >&6; } | |
10514 | if ${ac_cv_lib_c_r_pthread_kill+:} false; then : | |
10515 | $as_echo_n "(cached) " >&6 | |
10516 | else | |
10517 | ac_check_lib_save_LIBS=$LIBS | |
10518 | LIBS="-lc_r $LIBS" | |
10519 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10520 | /* end confdefs.h. */ | |
c0c3707f | 10521 | |
5df4cba6 SM |
10522 | /* Override any GCC internal prototype to avoid an error. |
10523 | Use char because int might match the return type of a GCC | |
10524 | builtin and then its argument prototype would still apply. */ | |
10525 | #ifdef __cplusplus | |
10526 | extern "C" | |
10527 | #endif | |
10528 | char pthread_kill (); | |
10529 | int | |
10530 | main () | |
10531 | { | |
10532 | return pthread_kill (); | |
10533 | ; | |
10534 | return 0; | |
10535 | } | |
10536 | _ACEOF | |
10537 | if ac_fn_c_try_link "$LINENO"; then : | |
10538 | ac_cv_lib_c_r_pthread_kill=yes | |
10539 | else | |
10540 | ac_cv_lib_c_r_pthread_kill=no | |
10541 | fi | |
10542 | rm -f core conftest.err conftest.$ac_objext \ | |
10543 | conftest$ac_exeext conftest.$ac_ext | |
10544 | LIBS=$ac_check_lib_save_LIBS | |
10545 | fi | |
10546 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5 | |
10547 | $as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; } | |
10548 | if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then : | |
10549 | gl_pthread_api=yes | |
10550 | LIBPTHREAD=-lc_r | |
10551 | LIBPMULTITHREAD=-lc_r | |
10552 | fi | |
c0c3707f | 10553 | |
5df4cba6 SM |
10554 | fi |
10555 | fi | |
10556 | fi | |
10557 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 | |
10558 | $as_echo_n "checking whether POSIX threads API is available... " >&6; } | |
10559 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5 | |
10560 | $as_echo "$gl_pthread_api" >&6; } | |
c0c3707f CB |
10561 | |
10562 | ||
5df4cba6 | 10563 | if test $gl_pthread_api = yes; then |
c0c3707f | 10564 | |
5df4cba6 | 10565 | $as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h |
c0c3707f | 10566 | |
5df4cba6 | 10567 | fi |
c0c3707f | 10568 | |
5df4cba6 SM |
10569 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
10570 | /* end confdefs.h. */ | |
10571 | #include <sched.h> | |
10572 | int | |
10573 | main () | |
10574 | { | |
10575 | sched_yield (); | |
10576 | ; | |
10577 | return 0; | |
10578 | } | |
10579 | _ACEOF | |
10580 | if ac_fn_c_try_link "$LINENO"; then : | |
10581 | LIB_SCHED_YIELD= | |
c0c3707f | 10582 | |
5df4cba6 SM |
10583 | else |
10584 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 | |
10585 | $as_echo_n "checking for sched_yield in -lrt... " >&6; } | |
10586 | if ${ac_cv_lib_rt_sched_yield+:} false; then : | |
c0c3707f | 10587 | $as_echo_n "(cached) " >&6 |
6ec2e0f5 | 10588 | else |
5df4cba6 SM |
10589 | ac_check_lib_save_LIBS=$LIBS |
10590 | LIBS="-lrt $LIBS" | |
10591 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 10592 | /* end confdefs.h. */ |
6ec2e0f5 | 10593 | |
5df4cba6 SM |
10594 | /* Override any GCC internal prototype to avoid an error. |
10595 | Use char because int might match the return type of a GCC | |
10596 | builtin and then its argument prototype would still apply. */ | |
10597 | #ifdef __cplusplus | |
10598 | extern "C" | |
10599 | #endif | |
10600 | char sched_yield (); | |
10601 | int | |
10602 | main () | |
10603 | { | |
10604 | return sched_yield (); | |
10605 | ; | |
10606 | return 0; | |
10607 | } | |
10608 | _ACEOF | |
10609 | if ac_fn_c_try_link "$LINENO"; then : | |
10610 | ac_cv_lib_rt_sched_yield=yes | |
10611 | else | |
10612 | ac_cv_lib_rt_sched_yield=no | |
10613 | fi | |
10614 | rm -f core conftest.err conftest.$ac_objext \ | |
10615 | conftest$ac_exeext conftest.$ac_ext | |
10616 | LIBS=$ac_check_lib_save_LIBS | |
10617 | fi | |
10618 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 | |
10619 | $as_echo "$ac_cv_lib_rt_sched_yield" >&6; } | |
10620 | if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : | |
10621 | LIB_SCHED_YIELD=-lrt | |
10622 | else | |
10623 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5 | |
10624 | $as_echo_n "checking for sched_yield in -lposix4... " >&6; } | |
10625 | if ${ac_cv_lib_posix4_sched_yield+:} false; then : | |
10626 | $as_echo_n "(cached) " >&6 | |
10627 | else | |
10628 | ac_check_lib_save_LIBS=$LIBS | |
10629 | LIBS="-lposix4 $LIBS" | |
10630 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10631 | /* end confdefs.h. */ | |
6ec2e0f5 | 10632 | |
5df4cba6 SM |
10633 | /* Override any GCC internal prototype to avoid an error. |
10634 | Use char because int might match the return type of a GCC | |
10635 | builtin and then its argument prototype would still apply. */ | |
10636 | #ifdef __cplusplus | |
10637 | extern "C" | |
10638 | #endif | |
10639 | char sched_yield (); | |
10640 | int | |
10641 | main () | |
10642 | { | |
10643 | return sched_yield (); | |
10644 | ; | |
10645 | return 0; | |
10646 | } | |
10647 | _ACEOF | |
10648 | if ac_fn_c_try_link "$LINENO"; then : | |
10649 | ac_cv_lib_posix4_sched_yield=yes | |
10650 | else | |
10651 | ac_cv_lib_posix4_sched_yield=no | |
10652 | fi | |
10653 | rm -f core conftest.err conftest.$ac_objext \ | |
10654 | conftest$ac_exeext conftest.$ac_ext | |
10655 | LIBS=$ac_check_lib_save_LIBS | |
10656 | fi | |
10657 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5 | |
10658 | $as_echo "$ac_cv_lib_posix4_sched_yield" >&6; } | |
10659 | if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then : | |
10660 | LIB_SCHED_YIELD=-lposix4 | |
6ec2e0f5 | 10661 | fi |
8690e634 | 10662 | |
5df4cba6 | 10663 | fi |
8690e634 | 10664 | |
8690e634 | 10665 | |
5df4cba6 SM |
10666 | fi |
10667 | rm -f core conftest.err conftest.$ac_objext \ | |
10668 | conftest$ac_exeext conftest.$ac_ext | |
6ec2e0f5 SDJ |
10669 | |
10670 | ||
5df4cba6 | 10671 | gl_pthreadlib_body_done=done |
c0c3707f | 10672 | fi |
6ec2e0f5 | 10673 | |
6ec2e0f5 | 10674 | |
8690e634 JK |
10675 | |
10676 | ||
472fa5ee | 10677 | |
c0c3707f | 10678 | |
c0c3707f | 10679 | |
c0c3707f | 10680 | |
c0c3707f | 10681 | |
5df4cba6 SM |
10682 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5 |
10683 | $as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; } | |
10684 | if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then : | |
10685 | $as_echo_n "(cached) " >&6 | |
10686 | else | |
10687 | case "$host_os" in | |
10688 | # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin. | |
10689 | *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*) | |
10690 | gl_cv_func_setlocale_null_all_mtsafe=no ;; | |
10691 | # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows. | |
10692 | *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*) | |
10693 | gl_cv_func_setlocale_null_all_mtsafe=yes ;; | |
10694 | # If we don't know, obey --enable-cross-guesses. | |
10695 | *) | |
10696 | gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;; | |
10697 | esac | |
c0c3707f | 10698 | |
5e8754f9 | 10699 | fi |
5df4cba6 SM |
10700 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5 |
10701 | $as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; } | |
10702 | case "$host_os" in | |
10703 | mingw*) ;; | |
10704 | *) | |
10705 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then | |
10706 | gl_cv_func_setlocale_null_all_mtsafe="trivially yes" | |
10707 | fi | |
10708 | ;; | |
10709 | esac | |
10710 | case "$gl_cv_func_setlocale_null_all_mtsafe" in | |
10711 | *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;; | |
10712 | *) SETLOCALE_NULL_ALL_MTSAFE=0 ;; | |
10713 | esac | |
5e8754f9 SDJ |
10714 | |
10715 | cat >>confdefs.h <<_ACEOF | |
5df4cba6 | 10716 | #define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE |
5e8754f9 SDJ |
10717 | _ACEOF |
10718 | ||
10719 | ||
5df4cba6 SM |
10720 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5 |
10721 | $as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; } | |
10722 | if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then : | |
10723 | $as_echo_n "(cached) " >&6 | |
10724 | else | |
10725 | case "$host_os" in | |
10726 | # Guess no on OpenBSD, AIX. | |
10727 | openbsd* | aix*) | |
10728 | gl_cv_func_setlocale_null_one_mtsafe=no ;; | |
10729 | # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows. | |
10730 | *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*) | |
10731 | gl_cv_func_setlocale_null_one_mtsafe=yes ;; | |
10732 | # If we don't know, obey --enable-cross-guesses. | |
10733 | *) | |
10734 | gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;; | |
10735 | esac | |
5abebf3c | 10736 | |
5df4cba6 SM |
10737 | fi |
10738 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5 | |
10739 | $as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; } | |
10740 | case "$host_os" in | |
10741 | mingw*) ;; | |
10742 | *) | |
10743 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then | |
10744 | gl_cv_func_setlocale_null_one_mtsafe="trivially yes" | |
10745 | fi | |
10746 | ;; | |
10747 | esac | |
10748 | case "$gl_cv_func_setlocale_null_one_mtsafe" in | |
10749 | *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;; | |
10750 | *) SETLOCALE_NULL_ONE_MTSAFE=0 ;; | |
10751 | esac | |
5abebf3c | 10752 | |
c0c3707f | 10753 | cat >>confdefs.h <<_ACEOF |
5df4cba6 | 10754 | #define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE |
5abebf3c | 10755 | _ACEOF |
c0c3707f CB |
10756 | |
10757 | ||
5df4cba6 SM |
10758 | if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then |
10759 | case "$host_os" in | |
10760 | mingw*) LIB_SETLOCALE_NULL= ;; | |
10761 | *) | |
10762 | ||
10763 | ||
10764 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 | |
10765 | $as_echo_n "checking whether imported symbols can be declared weak... " >&6; } | |
10766 | if ${gl_cv_have_weak+:} false; then : | |
10767 | $as_echo_n "(cached) " >&6 | |
5abebf3c | 10768 | else |
5df4cba6 SM |
10769 | gl_cv_have_weak=no |
10770 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10771 | /* end confdefs.h. */ | |
10772 | extern void xyzzy (); | |
10773 | #pragma weak xyzzy | |
10774 | int | |
10775 | main () | |
10776 | { | |
10777 | xyzzy(); | |
10778 | ; | |
10779 | return 0; | |
10780 | } | |
10781 | _ACEOF | |
10782 | if ac_fn_c_try_link "$LINENO"; then : | |
10783 | gl_cv_have_weak=maybe | |
5abebf3c | 10784 | fi |
5df4cba6 SM |
10785 | rm -f core conftest.err conftest.$ac_objext \ |
10786 | conftest$ac_exeext conftest.$ac_ext | |
10787 | if test $gl_cv_have_weak = maybe; then | |
10788 | if test "$cross_compiling" = yes; then : | |
10789 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10790 | /* end confdefs.h. */ | |
10791 | #ifdef __ELF__ | |
10792 | Extensible Linking Format | |
10793 | #endif | |
c0c3707f | 10794 | |
5df4cba6 SM |
10795 | _ACEOF |
10796 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
10797 | $EGREP "Extensible Linking Format" >/dev/null 2>&1; then : | |
10798 | gl_cv_have_weak="guessing yes" | |
10799 | else | |
10800 | gl_cv_have_weak="guessing no" | |
10801 | fi | |
10802 | rm -f conftest* | |
5abebf3c CB |
10803 | |
10804 | ||
5df4cba6 SM |
10805 | else |
10806 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
10807 | /* end confdefs.h. */ | |
5abebf3c | 10808 | |
5df4cba6 SM |
10809 | #include <stdio.h> |
10810 | #pragma weak fputs | |
10811 | int main () | |
10812 | { | |
10813 | return (fputs == NULL); | |
10814 | } | |
c0c3707f | 10815 | _ACEOF |
5df4cba6 SM |
10816 | if ac_fn_c_try_run "$LINENO"; then : |
10817 | gl_cv_have_weak=yes | |
10818 | else | |
10819 | gl_cv_have_weak=no | |
10820 | fi | |
10821 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
10822 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
10823 | fi | |
10824 | ||
10825 | fi | |
10826 | case " $LDFLAGS " in | |
10827 | *" -static "*) gl_cv_have_weak=no ;; | |
10828 | esac | |
10829 | case "$gl_cv_have_weak" in | |
10830 | *yes) | |
10831 | case "$host_os" in | |
10832 | freebsd* | dragonfly*) | |
10833 | : > conftest1.c | |
10834 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1 | |
10835 | cat <<EOF > conftest2.c | |
10836 | #include <pthread.h> | |
10837 | #pragma weak pthread_mutexattr_gettype | |
10838 | int main () | |
10839 | { | |
10840 | return (pthread_mutexattr_gettype != NULL); | |
10841 | } | |
10842 | EOF | |
10843 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \ | |
10844 | || gl_cv_have_weak=no | |
10845 | rm -f conftest1.c libempty.so conftest2.c conftest | |
10846 | ;; | |
10847 | esac | |
10848 | ;; | |
10849 | esac | |
5abebf3c | 10850 | |
c0c3707f | 10851 | fi |
5df4cba6 SM |
10852 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 |
10853 | $as_echo "$gl_cv_have_weak" >&6; } | |
10854 | case "$gl_cv_have_weak" in | |
10855 | *yes) | |
5abebf3c | 10856 | |
5df4cba6 | 10857 | $as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h |
5abebf3c | 10858 | |
5df4cba6 SM |
10859 | ;; |
10860 | esac | |
10861 | ||
10862 | case "$gl_cv_have_weak" in | |
10863 | *yes) LIB_SETLOCALE_NULL= ;; | |
10864 | *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;; | |
10865 | esac | |
10866 | ;; | |
10867 | esac | |
5abebf3c | 10868 | else |
5df4cba6 | 10869 | LIB_SETLOCALE_NULL= |
5abebf3c | 10870 | fi |
5abebf3c CB |
10871 | |
10872 | ||
10873 | ||
5abebf3c | 10874 | |
5abebf3c | 10875 | |
5df4cba6 SM |
10876 | GNULIB_SOCKET=0; |
10877 | GNULIB_CONNECT=0; | |
10878 | GNULIB_ACCEPT=0; | |
10879 | GNULIB_BIND=0; | |
10880 | GNULIB_GETPEERNAME=0; | |
10881 | GNULIB_GETSOCKNAME=0; | |
10882 | GNULIB_GETSOCKOPT=0; | |
10883 | GNULIB_LISTEN=0; | |
10884 | GNULIB_RECV=0; | |
10885 | GNULIB_SEND=0; | |
10886 | GNULIB_RECVFROM=0; | |
10887 | GNULIB_SENDTO=0; | |
10888 | GNULIB_SETSOCKOPT=0; | |
10889 | GNULIB_SHUTDOWN=0; | |
10890 | GNULIB_ACCEPT4=0; | |
10891 | HAVE_STRUCT_SOCKADDR_STORAGE=1; | |
10892 | HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; | |
10893 | ||
10894 | HAVE_SA_FAMILY_T=1; | |
10895 | HAVE_ACCEPT4=1; | |
c0c3707f CB |
10896 | |
10897 | ||
10898 | ||
10899 | ||
10900 | ||
5df4cba6 SM |
10901 | case "$host_os" in |
10902 | osf*) | |
c0c3707f | 10903 | |
5df4cba6 | 10904 | $as_echo "#define _POSIX_PII_SOCKET 1" >>confdefs.h |
c0c3707f | 10905 | |
5df4cba6 SM |
10906 | ;; |
10907 | esac | |
c0c3707f | 10908 | |
5df4cba6 SM |
10909 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5 |
10910 | $as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; } | |
10911 | if ${gl_cv_header_sys_socket_h_selfcontained+:} false; then : | |
5abebf3c CB |
10912 | $as_echo_n "(cached) " >&6 |
10913 | else | |
5df4cba6 SM |
10914 | |
10915 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 10916 | /* end confdefs.h. */ |
c0c3707f | 10917 | #include <sys/socket.h> |
c0c3707f CB |
10918 | int |
10919 | main () | |
10920 | { | |
5df4cba6 | 10921 | |
c0c3707f CB |
10922 | ; |
10923 | return 0; | |
10924 | } | |
10925 | _ACEOF | |
10926 | if ac_fn_c_try_compile "$LINENO"; then : | |
5df4cba6 | 10927 | gl_cv_header_sys_socket_h_selfcontained=yes |
5abebf3c | 10928 | else |
5df4cba6 | 10929 | gl_cv_header_sys_socket_h_selfcontained=no |
5abebf3c | 10930 | fi |
c0c3707f | 10931 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
5abebf3c | 10932 | |
5df4cba6 SM |
10933 | fi |
10934 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 | |
10935 | $as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; } | |
10936 | if test $gl_cv_header_sys_socket_h_selfcontained = yes; then | |
10937 | for ac_func in shutdown | |
10938 | do : | |
10939 | ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown" | |
10940 | if test "x$ac_cv_func_shutdown" = xyes; then : | |
10941 | cat >>confdefs.h <<_ACEOF | |
10942 | #define HAVE_SHUTDOWN 1 | |
10943 | _ACEOF | |
c0c3707f | 10944 | |
5df4cba6 SM |
10945 | fi |
10946 | done | |
c0c3707f | 10947 | |
5df4cba6 SM |
10948 | if test $ac_cv_func_shutdown = yes; then |
10949 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5 | |
10950 | $as_echo_n "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; } | |
10951 | if ${gl_cv_header_sys_socket_h_shut+:} false; then : | |
5abebf3c CB |
10952 | $as_echo_n "(cached) " >&6 |
10953 | else | |
5df4cba6 SM |
10954 | |
10955 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 10956 | /* end confdefs.h. */ |
c0c3707f | 10957 | #include <sys/socket.h> |
c0c3707f CB |
10958 | int |
10959 | main () | |
10960 | { | |
5df4cba6 | 10961 | int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR }; |
c0c3707f CB |
10962 | ; |
10963 | return 0; | |
10964 | } | |
10965 | _ACEOF | |
10966 | if ac_fn_c_try_compile "$LINENO"; then : | |
5df4cba6 | 10967 | gl_cv_header_sys_socket_h_shut=yes |
c0c3707f | 10968 | else |
5df4cba6 | 10969 | gl_cv_header_sys_socket_h_shut=no |
c0c3707f CB |
10970 | fi |
10971 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5abebf3c | 10972 | |
5df4cba6 SM |
10973 | fi |
10974 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5 | |
10975 | $as_echo "$gl_cv_header_sys_socket_h_shut" >&6; } | |
10976 | if test $gl_cv_header_sys_socket_h_shut = no; then | |
10977 | SYS_SOCKET_H='sys/socket.h' | |
10978 | fi | |
10979 | fi | |
c0c3707f | 10980 | fi |
5df4cba6 | 10981 | # We need to check for ws2tcpip.h now. |
5abebf3c | 10982 | |
5abebf3c | 10983 | |
5abebf3c | 10984 | |
5abebf3c CB |
10985 | |
10986 | ||
10987 | ||
10988 | ||
c0c3707f CB |
10989 | |
10990 | ||
10991 | ||
10992 | ||
10993 | if test $gl_cv_have_include_next = yes; then | |
5df4cba6 | 10994 | gl_cv_next_sys_socket_h='<'sys/socket.h'>' |
c0c3707f | 10995 | else |
5df4cba6 SM |
10996 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5 |
10997 | $as_echo_n "checking absolute name of <sys/socket.h>... " >&6; } | |
10998 | if ${gl_cv_next_sys_socket_h+:} false; then : | |
5abebf3c CB |
10999 | $as_echo_n "(cached) " >&6 |
11000 | else | |
5abebf3c | 11001 | |
5df4cba6 | 11002 | if test $ac_cv_header_sys_socket_h = yes; then |
5abebf3c | 11003 | |
5abebf3c CB |
11004 | |
11005 | ||
c0c3707f CB |
11006 | |
11007 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11008 | /* end confdefs.h. */ | |
5df4cba6 | 11009 | #include <sys/socket.h> |
c0c3707f CB |
11010 | _ACEOF |
11011 | case "$host_os" in | |
11012 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
11013 | *) gl_absname_cpp="$ac_cpp" ;; | |
11014 | esac | |
11015 | ||
11016 | case "$host_os" in | |
11017 | mingw*) | |
11018 | gl_dirsep_regex='[/\\]' | |
5abebf3c CB |
11019 | ;; |
11020 | *) | |
c0c3707f | 11021 | gl_dirsep_regex='\/' |
5abebf3c CB |
11022 | ;; |
11023 | esac | |
c0c3707f | 11024 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' |
5df4cba6 | 11025 | gl_header_literal_regex=`echo 'sys/socket.h' \ |
c0c3707f CB |
11026 | | sed -e "$gl_make_literal_regex_sed"` |
11027 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
11028 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
11029 | s|^/[^/]|//&| | |
11030 | p | |
11031 | q | |
11032 | }' | |
5abebf3c | 11033 | |
5df4cba6 | 11034 | gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
c0c3707f | 11035 | sed -n "$gl_absolute_header_sed"` |
5abebf3c | 11036 | |
5df4cba6 SM |
11037 | gl_header=$gl_cv_absolute_sys_socket_h |
11038 | gl_cv_next_sys_socket_h='"'$gl_header'"' | |
c0c3707f | 11039 | else |
5df4cba6 | 11040 | gl_cv_next_sys_socket_h='<'sys/socket.h'>' |
c0c3707f | 11041 | fi |
5abebf3c | 11042 | |
5abebf3c | 11043 | |
5abebf3c | 11044 | fi |
5df4cba6 SM |
11045 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5 |
11046 | $as_echo "$gl_cv_next_sys_socket_h" >&6; } | |
c0c3707f | 11047 | fi |
5df4cba6 | 11048 | NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h |
c0c3707f CB |
11049 | |
11050 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
11051 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
5df4cba6 | 11052 | gl_next_as_first_directive='<'sys/socket.h'>' |
c0c3707f CB |
11053 | else |
11054 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
5df4cba6 | 11055 | gl_next_as_first_directive=$gl_cv_next_sys_socket_h |
c0c3707f | 11056 | fi |
5df4cba6 | 11057 | NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive |
5abebf3c CB |
11058 | |
11059 | ||
c0c3707f CB |
11060 | |
11061 | ||
5df4cba6 SM |
11062 | if test $ac_cv_header_sys_socket_h = yes; then |
11063 | HAVE_SYS_SOCKET_H=1 | |
11064 | else | |
11065 | HAVE_SYS_SOCKET_H=0 | |
11066 | fi | |
c0c3707f | 11067 | |
5abebf3c | 11068 | |
c0c3707f | 11069 | |
5df4cba6 SM |
11070 | if test $ac_cv_header_sys_socket_h = yes; then |
11071 | HAVE_WS2TCPIP_H=0 | |
11072 | else | |
11073 | if test $ac_cv_header_ws2tcpip_h = yes; then | |
11074 | HAVE_WS2TCPIP_H=1 | |
11075 | else | |
11076 | HAVE_WS2TCPIP_H=0 | |
11077 | fi | |
11078 | fi | |
11079 | ||
11080 | ||
11081 | ||
11082 | ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " | |
11083 | /* sys/types.h is not needed according to POSIX, but the | |
11084 | sys/socket.h in i386-unknown-freebsd4.10 and | |
11085 | powerpc-apple-darwin5.5 required it. */ | |
11086 | #include <sys/types.h> | |
11087 | #ifdef HAVE_SYS_SOCKET_H | |
11088 | #include <sys/socket.h> | |
11089 | #endif | |
11090 | #ifdef HAVE_WS2TCPIP_H | |
11091 | #include <ws2tcpip.h> | |
11092 | #endif | |
11093 | ||
11094 | " | |
11095 | if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then : | |
11096 | ||
11097 | cat >>confdefs.h <<_ACEOF | |
11098 | #define HAVE_STRUCT_SOCKADDR_STORAGE 1 | |
5abebf3c | 11099 | _ACEOF |
5df4cba6 SM |
11100 | |
11101 | ||
5abebf3c | 11102 | fi |
5df4cba6 SM |
11103 | ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" " |
11104 | /* sys/types.h is not needed according to POSIX, but the | |
11105 | sys/socket.h in i386-unknown-freebsd4.10 and | |
11106 | powerpc-apple-darwin5.5 required it. */ | |
11107 | #include <sys/types.h> | |
11108 | #ifdef HAVE_SYS_SOCKET_H | |
11109 | #include <sys/socket.h> | |
11110 | #endif | |
11111 | #ifdef HAVE_WS2TCPIP_H | |
11112 | #include <ws2tcpip.h> | |
11113 | #endif | |
11114 | ||
11115 | " | |
11116 | if test "x$ac_cv_type_sa_family_t" = xyes; then : | |
11117 | ||
11118 | cat >>confdefs.h <<_ACEOF | |
11119 | #define HAVE_SA_FAMILY_T 1 | |
11120 | _ACEOF | |
11121 | ||
11122 | ||
5abebf3c | 11123 | fi |
5df4cba6 SM |
11124 | |
11125 | if test $ac_cv_type_struct_sockaddr_storage = no; then | |
11126 | HAVE_STRUCT_SOCKADDR_STORAGE=0 | |
11127 | fi | |
11128 | if test $ac_cv_type_sa_family_t = no; then | |
11129 | HAVE_SA_FAMILY_T=0 | |
c0c3707f | 11130 | fi |
5df4cba6 SM |
11131 | if test $ac_cv_type_struct_sockaddr_storage != no; then |
11132 | ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h> | |
11133 | #ifdef HAVE_SYS_SOCKET_H | |
11134 | #include <sys/socket.h> | |
11135 | #endif | |
11136 | #ifdef HAVE_WS2TCPIP_H | |
11137 | #include <ws2tcpip.h> | |
11138 | #endif | |
11139 | ||
11140 | " | |
11141 | if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then : | |
11142 | ||
11143 | cat >>confdefs.h <<_ACEOF | |
11144 | #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 | |
11145 | _ACEOF | |
11146 | ||
5abebf3c | 11147 | |
5abebf3c | 11148 | else |
5df4cba6 | 11149 | HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0 |
5abebf3c CB |
11150 | fi |
11151 | ||
5df4cba6 SM |
11152 | fi |
11153 | if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \ | |
11154 | || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then | |
11155 | SYS_SOCKET_H='sys/socket.h' | |
11156 | fi | |
5abebf3c | 11157 | |
5abebf3c | 11158 | |
5df4cba6 SM |
11159 | |
11160 | ||
11161 | if test $ac_cv_header_sys_socket_h != yes; then | |
11162 | for ac_header in winsock2.h | |
11163 | do : | |
11164 | ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" | |
11165 | if test "x$ac_cv_header_winsock2_h" = xyes; then : | |
11166 | cat >>confdefs.h <<_ACEOF | |
11167 | #define HAVE_WINSOCK2_H 1 | |
11168 | _ACEOF | |
11169 | ||
11170 | fi | |
11171 | ||
11172 | done | |
11173 | ||
11174 | fi | |
11175 | if test "$ac_cv_header_winsock2_h" = yes; then | |
11176 | HAVE_WINSOCK2_H=1 | |
11177 | UNISTD_H_HAVE_WINSOCK2_H=1 | |
11178 | SYS_IOCTL_H_HAVE_WINSOCK2_H=1 | |
11179 | else | |
11180 | HAVE_WINSOCK2_H=0 | |
11181 | fi | |
11182 | ||
11183 | ||
11184 | ||
11185 | ||
11186 | ||
11187 | ||
11188 | ||
11189 | ||
11190 | ||
11191 | ||
11192 | ||
11193 | ||
11194 | ||
11195 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5 | |
11196 | $as_echo_n "checking for IPv4 sockets... " >&6; } | |
11197 | if ${gl_cv_socket_ipv4+:} false; then : | |
5abebf3c CB |
11198 | $as_echo_n "(cached) " >&6 |
11199 | else | |
c0c3707f | 11200 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5abebf3c | 11201 | /* end confdefs.h. */ |
5df4cba6 SM |
11202 | #include <sys/types.h> |
11203 | #ifdef HAVE_SYS_SOCKET_H | |
11204 | #include <sys/socket.h> | |
11205 | #endif | |
11206 | #ifdef HAVE_NETINET_IN_H | |
11207 | #include <netinet/in.h> | |
11208 | #endif | |
11209 | #ifdef HAVE_WINSOCK2_H | |
11210 | #include <winsock2.h> | |
11211 | #endif | |
5abebf3c CB |
11212 | int |
11213 | main () | |
11214 | { | |
5df4cba6 SM |
11215 | int x = AF_INET; struct in_addr y; struct sockaddr_in z; |
11216 | if (&x && &y && &z) return 0; | |
5abebf3c CB |
11217 | ; |
11218 | return 0; | |
11219 | } | |
11220 | _ACEOF | |
c0c3707f | 11221 | if ac_fn_c_try_compile "$LINENO"; then : |
5df4cba6 | 11222 | gl_cv_socket_ipv4=yes |
5abebf3c | 11223 | else |
5df4cba6 | 11224 | gl_cv_socket_ipv4=no |
5abebf3c | 11225 | fi |
c0c3707f | 11226 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
5abebf3c | 11227 | fi |
5df4cba6 SM |
11228 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5 |
11229 | $as_echo "$gl_cv_socket_ipv4" >&6; } | |
11230 | if test $gl_cv_socket_ipv4 = yes; then | |
5abebf3c | 11231 | |
5df4cba6 | 11232 | $as_echo "#define HAVE_IPV4 1" >>confdefs.h |
5abebf3c | 11233 | |
5df4cba6 | 11234 | fi |
5abebf3c | 11235 | |
5df4cba6 SM |
11236 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5 |
11237 | $as_echo_n "checking for IPv6 sockets... " >&6; } | |
11238 | if ${gl_cv_socket_ipv6+:} false; then : | |
5abebf3c CB |
11239 | $as_echo_n "(cached) " >&6 |
11240 | else | |
c0c3707f | 11241 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5abebf3c | 11242 | /* end confdefs.h. */ |
5df4cba6 SM |
11243 | #include <sys/types.h> |
11244 | #ifdef HAVE_SYS_SOCKET_H | |
11245 | #include <sys/socket.h> | |
5abebf3c | 11246 | #endif |
5df4cba6 SM |
11247 | #ifdef HAVE_NETINET_IN_H |
11248 | #include <netinet/in.h> | |
11249 | #endif | |
11250 | #ifdef HAVE_WINSOCK2_H | |
11251 | #include <winsock2.h> | |
11252 | #endif | |
11253 | #ifdef HAVE_WS2TCPIP_H | |
11254 | #include <ws2tcpip.h> | |
11255 | #endif | |
11256 | int | |
11257 | main () | |
11258 | { | |
11259 | int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; | |
11260 | if (&x && &y && &z) return 0; | |
11261 | ; | |
11262 | return 0; | |
11263 | } | |
11264 | _ACEOF | |
11265 | if ac_fn_c_try_compile "$LINENO"; then : | |
11266 | gl_cv_socket_ipv6=yes | |
11267 | else | |
11268 | gl_cv_socket_ipv6=no | |
11269 | fi | |
11270 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
11271 | fi | |
11272 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5 | |
11273 | $as_echo "$gl_cv_socket_ipv6" >&6; } | |
11274 | if test $gl_cv_socket_ipv6 = yes; then | |
11275 | ||
11276 | $as_echo "#define HAVE_IPV6 1" >>confdefs.h | |
11277 | ||
11278 | fi | |
11279 | ||
11280 | ||
11281 | ||
11282 | ||
11283 | ||
11284 | ||
11285 | ||
11286 | ||
11287 | ||
11288 | ||
11289 | ||
11290 | ||
11291 | ||
11292 | if test $gl_cv_have_include_next = yes; then | |
11293 | gl_cv_next_limits_h='<'limits.h'>' | |
11294 | else | |
11295 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5 | |
11296 | $as_echo_n "checking absolute name of <limits.h>... " >&6; } | |
11297 | if ${gl_cv_next_limits_h+:} false; then : | |
11298 | $as_echo_n "(cached) " >&6 | |
11299 | else | |
11300 | ||
11301 | if test $ac_cv_header_limits_h = yes; then | |
11302 | ||
11303 | ||
11304 | ||
11305 | ||
11306 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11307 | /* end confdefs.h. */ | |
11308 | #include <limits.h> | |
11309 | _ACEOF | |
11310 | case "$host_os" in | |
11311 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
11312 | *) gl_absname_cpp="$ac_cpp" ;; | |
11313 | esac | |
11314 | ||
11315 | case "$host_os" in | |
11316 | mingw*) | |
11317 | gl_dirsep_regex='[/\\]' | |
11318 | ;; | |
11319 | *) | |
11320 | gl_dirsep_regex='\/' | |
11321 | ;; | |
11322 | esac | |
11323 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
11324 | gl_header_literal_regex=`echo 'limits.h' \ | |
11325 | | sed -e "$gl_make_literal_regex_sed"` | |
11326 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
11327 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
11328 | s|^/[^/]|//&| | |
11329 | p | |
11330 | q | |
11331 | }' | |
11332 | ||
11333 | gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
11334 | sed -n "$gl_absolute_header_sed"` | |
11335 | ||
11336 | gl_header=$gl_cv_absolute_limits_h | |
11337 | gl_cv_next_limits_h='"'$gl_header'"' | |
11338 | else | |
11339 | gl_cv_next_limits_h='<'limits.h'>' | |
11340 | fi | |
11341 | ||
11342 | ||
11343 | fi | |
11344 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5 | |
11345 | $as_echo "$gl_cv_next_limits_h" >&6; } | |
11346 | fi | |
11347 | NEXT_LIMITS_H=$gl_cv_next_limits_h | |
11348 | ||
11349 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
11350 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
11351 | gl_next_as_first_directive='<'limits.h'>' | |
11352 | else | |
11353 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
11354 | gl_next_as_first_directive=$gl_cv_next_limits_h | |
11355 | fi | |
11356 | NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive | |
11357 | ||
11358 | ||
11359 | ||
11360 | ||
11361 | ||
11362 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc." >&5 | |
11363 | $as_echo_n "checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... " >&6; } | |
11364 | if ${gl_cv_header_limits_width+:} false; then : | |
11365 | $as_echo_n "(cached) " >&6 | |
11366 | else | |
11367 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11368 | /* end confdefs.h. */ | |
11369 | #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ | |
11370 | #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 | |
11371 | #endif | |
11372 | #include <limits.h> | |
11373 | long long llm = LLONG_MAX; | |
11374 | int wb = WORD_BIT; | |
11375 | int ullw = ULLONG_WIDTH; | |
c0c3707f | 11376 | |
5abebf3c CB |
11377 | int |
11378 | main () | |
11379 | { | |
c0c3707f | 11380 | |
5abebf3c CB |
11381 | ; |
11382 | return 0; | |
11383 | } | |
11384 | _ACEOF | |
c0c3707f | 11385 | if ac_fn_c_try_compile "$LINENO"; then : |
5df4cba6 | 11386 | gl_cv_header_limits_width=yes |
5abebf3c | 11387 | else |
5df4cba6 | 11388 | gl_cv_header_limits_width=no |
5abebf3c | 11389 | fi |
c0c3707f | 11390 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
5abebf3c | 11391 | fi |
5df4cba6 SM |
11392 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5 |
11393 | $as_echo "$gl_cv_header_limits_width" >&6; } | |
11394 | if test "$gl_cv_header_limits_width" = yes; then | |
11395 | LIMITS_H= | |
c0c3707f | 11396 | else |
5df4cba6 | 11397 | LIMITS_H=limits.h |
c0c3707f | 11398 | fi |
5abebf3c | 11399 | |
5df4cba6 SM |
11400 | if test -n "$LIMITS_H"; then |
11401 | GL_GENERATE_LIMITS_H_TRUE= | |
11402 | GL_GENERATE_LIMITS_H_FALSE='#' | |
11403 | else | |
11404 | GL_GENERATE_LIMITS_H_TRUE='#' | |
11405 | GL_GENERATE_LIMITS_H_FALSE= | |
11406 | fi | |
c0c3707f CB |
11407 | |
11408 | ||
5abebf3c | 11409 | |
5df4cba6 SM |
11410 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 |
11411 | $as_echo_n "checking for wint_t... " >&6; } | |
11412 | if ${gt_cv_c_wint_t+:} false; then : | |
c0c3707f | 11413 | $as_echo_n "(cached) " >&6 |
c0c3707f CB |
11414 | else |
11415 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5abebf3c | 11416 | /* end confdefs.h. */ |
5df4cba6 SM |
11417 | |
11418 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
11419 | <wchar.h>. | |
11420 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included | |
11421 | before <wchar.h>. */ | |
11422 | #include <stddef.h> | |
11423 | #include <stdio.h> | |
11424 | #include <time.h> | |
11425 | #include <wchar.h> | |
11426 | wint_t foo = (wchar_t)'\0'; | |
5abebf3c CB |
11427 | int |
11428 | main () | |
11429 | { | |
5df4cba6 | 11430 | |
5abebf3c CB |
11431 | ; |
11432 | return 0; | |
11433 | } | |
11434 | _ACEOF | |
5df4cba6 SM |
11435 | if ac_fn_c_try_compile "$LINENO"; then : |
11436 | gt_cv_c_wint_t=yes | |
c0c3707f | 11437 | else |
5df4cba6 | 11438 | gt_cv_c_wint_t=no |
c0c3707f | 11439 | fi |
5df4cba6 | 11440 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
c0c3707f | 11441 | fi |
5df4cba6 SM |
11442 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 |
11443 | $as_echo "$gt_cv_c_wint_t" >&6; } | |
11444 | if test $gt_cv_c_wint_t = yes; then | |
5abebf3c | 11445 | |
5df4cba6 | 11446 | $as_echo "#define HAVE_WINT_T 1" >>confdefs.h |
5abebf3c CB |
11447 | |
11448 | ||
5df4cba6 SM |
11449 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5 |
11450 | $as_echo_n "checking whether wint_t is too small... " >&6; } | |
11451 | if ${gl_cv_type_wint_t_too_small+:} false; then : | |
11452 | $as_echo_n "(cached) " >&6 | |
11453 | else | |
11454 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11455 | /* end confdefs.h. */ | |
11456 | ||
11457 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
11458 | <wchar.h>. | |
11459 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
11460 | included before <wchar.h>. */ | |
11461 | #if !(defined __GLIBC__ && !defined __UCLIBC__) | |
11462 | # include <stddef.h> | |
11463 | # include <stdio.h> | |
11464 | # include <time.h> | |
11465 | #endif | |
11466 | #include <wchar.h> | |
11467 | int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; | |
11468 | ||
11469 | int | |
11470 | main () | |
11471 | { | |
11472 | ||
11473 | ; | |
11474 | return 0; | |
11475 | } | |
11476 | _ACEOF | |
11477 | if ac_fn_c_try_compile "$LINENO"; then : | |
11478 | gl_cv_type_wint_t_too_small=no | |
11479 | else | |
11480 | gl_cv_type_wint_t_too_small=yes | |
11481 | fi | |
11482 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
11483 | fi | |
11484 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5 | |
11485 | $as_echo "$gl_cv_type_wint_t_too_small" >&6; } | |
11486 | if test $gl_cv_type_wint_t_too_small = yes; then | |
11487 | GNULIB_OVERRIDES_WINT_T=1 | |
11488 | else | |
11489 | GNULIB_OVERRIDES_WINT_T=0 | |
11490 | fi | |
11491 | else | |
11492 | GNULIB_OVERRIDES_WINT_T=0 | |
c0c3707f | 11493 | fi |
5abebf3c | 11494 | |
5abebf3c CB |
11495 | |
11496 | ||
11497 | ||
11498 | ||
11499 | ||
5df4cba6 | 11500 | |
c0c3707f CB |
11501 | gl_cv_c_multiarch=no |
11502 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11503 | /* end confdefs.h. */ | |
11504 | #ifndef __APPLE_CC__ | |
11505 | not a universal capable compiler | |
11506 | #endif | |
11507 | typedef int dummy; | |
5abebf3c | 11508 | |
c0c3707f CB |
11509 | _ACEOF |
11510 | if ac_fn_c_try_compile "$LINENO"; then : | |
5abebf3c | 11511 | |
c0c3707f CB |
11512 | arch= |
11513 | prev= | |
11514 | for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do | |
11515 | if test -n "$prev"; then | |
11516 | case $word in | |
11517 | i?86 | x86_64 | ppc | ppc64) | |
11518 | if test -z "$arch" || test "$arch" = "$word"; then | |
11519 | arch="$word" | |
11520 | else | |
11521 | gl_cv_c_multiarch=yes | |
11522 | fi | |
11523 | ;; | |
11524 | esac | |
11525 | prev= | |
11526 | else | |
11527 | if test "x$word" = "x-arch"; then | |
11528 | prev=arch | |
11529 | fi | |
11530 | fi | |
11531 | done | |
5abebf3c | 11532 | |
c0c3707f CB |
11533 | fi |
11534 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
11535 | if test $gl_cv_c_multiarch = yes; then | |
11536 | APPLE_UNIVERSAL_BUILD=1 | |
11537 | else | |
11538 | APPLE_UNIVERSAL_BUILD=0 | |
11539 | fi | |
5abebf3c | 11540 | |
5abebf3c | 11541 | |
5abebf3c | 11542 | |
5abebf3c CB |
11543 | |
11544 | ||
5abebf3c | 11545 | |
5abebf3c | 11546 | |
5abebf3c | 11547 | |
5df4cba6 | 11548 | $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h |
5abebf3c | 11549 | |
5abebf3c | 11550 | |
5df4cba6 | 11551 | $as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h |
5abebf3c | 11552 | |
c0c3707f CB |
11553 | |
11554 | ||
11555 | if test $ac_cv_header_wchar_h = yes; then | |
11556 | HAVE_WCHAR_H=1 | |
11557 | else | |
11558 | HAVE_WCHAR_H=0 | |
5abebf3c | 11559 | fi |
c0c3707f CB |
11560 | |
11561 | ||
11562 | if test $ac_cv_header_inttypes_h = yes; then | |
11563 | HAVE_INTTYPES_H=1 | |
11564 | else | |
11565 | HAVE_INTTYPES_H=0 | |
5abebf3c CB |
11566 | fi |
11567 | ||
11568 | ||
c0c3707f CB |
11569 | if test $ac_cv_header_sys_types_h = yes; then |
11570 | HAVE_SYS_TYPES_H=1 | |
11571 | else | |
11572 | HAVE_SYS_TYPES_H=0 | |
11573 | fi | |
11574 | ||
5abebf3c CB |
11575 | |
11576 | ||
11577 | ||
11578 | ||
5abebf3c | 11579 | |
5abebf3c | 11580 | |
5abebf3c | 11581 | |
5abebf3c | 11582 | |
5abebf3c CB |
11583 | |
11584 | ||
c0c3707f CB |
11585 | if test $gl_cv_have_include_next = yes; then |
11586 | gl_cv_next_stdint_h='<'stdint.h'>' | |
11587 | else | |
11588 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5 | |
11589 | $as_echo_n "checking absolute name of <stdint.h>... " >&6; } | |
11590 | if ${gl_cv_next_stdint_h+:} false; then : | |
11591 | $as_echo_n "(cached) " >&6 | |
11592 | else | |
5abebf3c | 11593 | |
c0c3707f | 11594 | if test $ac_cv_header_stdint_h = yes; then |
5abebf3c | 11595 | |
5abebf3c CB |
11596 | |
11597 | ||
11598 | ||
c0c3707f | 11599 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5abebf3c | 11600 | /* end confdefs.h. */ |
c0c3707f | 11601 | #include <stdint.h> |
5abebf3c | 11602 | _ACEOF |
c0c3707f CB |
11603 | case "$host_os" in |
11604 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
11605 | *) gl_absname_cpp="$ac_cpp" ;; | |
11606 | esac | |
5abebf3c | 11607 | |
c0c3707f CB |
11608 | case "$host_os" in |
11609 | mingw*) | |
11610 | gl_dirsep_regex='[/\\]' | |
11611 | ;; | |
11612 | *) | |
11613 | gl_dirsep_regex='\/' | |
11614 | ;; | |
11615 | esac | |
11616 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
11617 | gl_header_literal_regex=`echo 'stdint.h' \ | |
11618 | | sed -e "$gl_make_literal_regex_sed"` | |
11619 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
11620 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
11621 | s|^/[^/]|//&| | |
11622 | p | |
11623 | q | |
11624 | }' | |
5abebf3c | 11625 | |
c0c3707f CB |
11626 | gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
11627 | sed -n "$gl_absolute_header_sed"` | |
5abebf3c | 11628 | |
c0c3707f CB |
11629 | gl_header=$gl_cv_absolute_stdint_h |
11630 | gl_cv_next_stdint_h='"'$gl_header'"' | |
11631 | else | |
11632 | gl_cv_next_stdint_h='<'stdint.h'>' | |
11633 | fi | |
5abebf3c | 11634 | |
5abebf3c | 11635 | |
c0c3707f CB |
11636 | fi |
11637 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5 | |
11638 | $as_echo "$gl_cv_next_stdint_h" >&6; } | |
11639 | fi | |
11640 | NEXT_STDINT_H=$gl_cv_next_stdint_h | |
5abebf3c | 11641 | |
c0c3707f CB |
11642 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
11643 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
11644 | gl_next_as_first_directive='<'stdint.h'>' | |
11645 | else | |
11646 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
11647 | gl_next_as_first_directive=$gl_cv_next_stdint_h | |
11648 | fi | |
11649 | NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive | |
5abebf3c | 11650 | |
5e8754f9 | 11651 | |
5e8754f9 | 11652 | |
5e8754f9 | 11653 | |
c0c3707f CB |
11654 | if test $ac_cv_header_stdint_h = yes; then |
11655 | HAVE_STDINT_H=1 | |
11656 | else | |
11657 | HAVE_STDINT_H=0 | |
11658 | fi | |
5e8754f9 SDJ |
11659 | |
11660 | ||
c0c3707f CB |
11661 | if test $ac_cv_header_stdint_h = yes; then |
11662 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5 | |
11663 | $as_echo_n "checking whether stdint.h conforms to C99... " >&6; } | |
11664 | if ${gl_cv_header_working_stdint_h+:} false; then : | |
11665 | $as_echo_n "(cached) " >&6 | |
11666 | else | |
11667 | gl_cv_header_working_stdint_h=no | |
11668 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11669 | /* end confdefs.h. */ | |
5e8754f9 | 11670 | |
5e8754f9 | 11671 | |
c0c3707f CB |
11672 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ |
11673 | #define __STDC_CONSTANT_MACROS 1 | |
11674 | #define __STDC_LIMIT_MACROS 1 | |
11675 | #include <stdint.h> | |
11676 | /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ | |
11677 | #if !(defined WCHAR_MIN && defined WCHAR_MAX) | |
11678 | #error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>" | |
11679 | #endif | |
5e8754f9 SDJ |
11680 | |
11681 | ||
c0c3707f CB |
11682 | /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be |
11683 | included before <wchar.h>. */ | |
11684 | #include <stddef.h> | |
11685 | #include <signal.h> | |
11686 | #if HAVE_WCHAR_H | |
11687 | # include <stdio.h> | |
11688 | # include <time.h> | |
11689 | # include <wchar.h> | |
11690 | #endif | |
f45c62c4 YQ |
11691 | |
11692 | ||
c0c3707f CB |
11693 | #ifdef INT8_MAX |
11694 | int8_t a1 = INT8_MAX; | |
11695 | int8_t a1min = INT8_MIN; | |
11696 | #endif | |
11697 | #ifdef INT16_MAX | |
11698 | int16_t a2 = INT16_MAX; | |
11699 | int16_t a2min = INT16_MIN; | |
11700 | #endif | |
11701 | #ifdef INT32_MAX | |
11702 | int32_t a3 = INT32_MAX; | |
11703 | int32_t a3min = INT32_MIN; | |
11704 | #endif | |
11705 | #ifdef INT64_MAX | |
11706 | int64_t a4 = INT64_MAX; | |
11707 | int64_t a4min = INT64_MIN; | |
11708 | #endif | |
11709 | #ifdef UINT8_MAX | |
11710 | uint8_t b1 = UINT8_MAX; | |
11711 | #else | |
11712 | typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; | |
11713 | #endif | |
11714 | #ifdef UINT16_MAX | |
11715 | uint16_t b2 = UINT16_MAX; | |
11716 | #endif | |
11717 | #ifdef UINT32_MAX | |
11718 | uint32_t b3 = UINT32_MAX; | |
11719 | #endif | |
11720 | #ifdef UINT64_MAX | |
11721 | uint64_t b4 = UINT64_MAX; | |
11722 | #endif | |
11723 | int_least8_t c1 = INT8_C (0x7f); | |
11724 | int_least8_t c1max = INT_LEAST8_MAX; | |
11725 | int_least8_t c1min = INT_LEAST8_MIN; | |
11726 | int_least16_t c2 = INT16_C (0x7fff); | |
11727 | int_least16_t c2max = INT_LEAST16_MAX; | |
11728 | int_least16_t c2min = INT_LEAST16_MIN; | |
11729 | int_least32_t c3 = INT32_C (0x7fffffff); | |
11730 | int_least32_t c3max = INT_LEAST32_MAX; | |
11731 | int_least32_t c3min = INT_LEAST32_MIN; | |
11732 | int_least64_t c4 = INT64_C (0x7fffffffffffffff); | |
11733 | int_least64_t c4max = INT_LEAST64_MAX; | |
11734 | int_least64_t c4min = INT_LEAST64_MIN; | |
11735 | uint_least8_t d1 = UINT8_C (0xff); | |
11736 | uint_least8_t d1max = UINT_LEAST8_MAX; | |
11737 | uint_least16_t d2 = UINT16_C (0xffff); | |
11738 | uint_least16_t d2max = UINT_LEAST16_MAX; | |
11739 | uint_least32_t d3 = UINT32_C (0xffffffff); | |
11740 | uint_least32_t d3max = UINT_LEAST32_MAX; | |
11741 | uint_least64_t d4 = UINT64_C (0xffffffffffffffff); | |
11742 | uint_least64_t d4max = UINT_LEAST64_MAX; | |
11743 | int_fast8_t e1 = INT_FAST8_MAX; | |
11744 | int_fast8_t e1min = INT_FAST8_MIN; | |
11745 | int_fast16_t e2 = INT_FAST16_MAX; | |
11746 | int_fast16_t e2min = INT_FAST16_MIN; | |
11747 | int_fast32_t e3 = INT_FAST32_MAX; | |
11748 | int_fast32_t e3min = INT_FAST32_MIN; | |
11749 | int_fast64_t e4 = INT_FAST64_MAX; | |
11750 | int_fast64_t e4min = INT_FAST64_MIN; | |
11751 | uint_fast8_t f1 = UINT_FAST8_MAX; | |
11752 | uint_fast16_t f2 = UINT_FAST16_MAX; | |
11753 | uint_fast32_t f3 = UINT_FAST32_MAX; | |
11754 | uint_fast64_t f4 = UINT_FAST64_MAX; | |
11755 | #ifdef INTPTR_MAX | |
11756 | intptr_t g = INTPTR_MAX; | |
11757 | intptr_t gmin = INTPTR_MIN; | |
11758 | #endif | |
11759 | #ifdef UINTPTR_MAX | |
11760 | uintptr_t h = UINTPTR_MAX; | |
11761 | #endif | |
11762 | intmax_t i = INTMAX_MAX; | |
11763 | uintmax_t j = UINTMAX_MAX; | |
472fa5ee | 11764 | |
c0c3707f CB |
11765 | /* Check that SIZE_MAX has the correct type, if possible. */ |
11766 | #if 201112 <= __STDC_VERSION__ | |
11767 | int k = _Generic (SIZE_MAX, size_t: 0); | |
11768 | #elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ | |
11769 | || (0x5110 <= __SUNPRO_C && !__STDC__)) | |
11770 | extern size_t k; | |
11771 | extern __typeof__ (SIZE_MAX) k; | |
11772 | #endif | |
472fa5ee | 11773 | |
c0c3707f CB |
11774 | #include <limits.h> /* for CHAR_BIT */ |
11775 | #define TYPE_MINIMUM(t) \ | |
11776 | ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) | |
11777 | #define TYPE_MAXIMUM(t) \ | |
11778 | ((t) ((t) 0 < (t) -1 \ | |
11779 | ? (t) -1 \ | |
11780 | : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) | |
11781 | struct s { | |
11782 | int check_PTRDIFF: | |
11783 | PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) | |
11784 | && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) | |
11785 | ? 1 : -1; | |
11786 | /* Detect bug in FreeBSD 6.0 / ia64. */ | |
11787 | int check_SIG_ATOMIC: | |
11788 | SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) | |
11789 | && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) | |
11790 | ? 1 : -1; | |
11791 | int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; | |
11792 | int check_WCHAR: | |
11793 | WCHAR_MIN == TYPE_MINIMUM (wchar_t) | |
11794 | && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) | |
11795 | ? 1 : -1; | |
11796 | /* Detect bug in mingw. */ | |
11797 | int check_WINT: | |
11798 | WINT_MIN == TYPE_MINIMUM (wint_t) | |
11799 | && WINT_MAX == TYPE_MAXIMUM (wint_t) | |
11800 | ? 1 : -1; | |
472fa5ee | 11801 | |
c0c3707f CB |
11802 | /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ |
11803 | int check_UINT8_C: | |
11804 | (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; | |
11805 | int check_UINT16_C: | |
11806 | (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; | |
f45c62c4 | 11807 | |
c0c3707f CB |
11808 | /* Detect bugs in OpenBSD 3.9 stdint.h. */ |
11809 | #ifdef UINT8_MAX | |
11810 | int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; | |
11811 | #endif | |
11812 | #ifdef UINT16_MAX | |
11813 | int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; | |
11814 | #endif | |
11815 | #ifdef UINT32_MAX | |
11816 | int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; | |
11817 | #endif | |
11818 | #ifdef UINT64_MAX | |
11819 | int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; | |
11820 | #endif | |
11821 | int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; | |
11822 | int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; | |
11823 | int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; | |
11824 | int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; | |
11825 | int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; | |
11826 | int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; | |
11827 | int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; | |
11828 | int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; | |
11829 | int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; | |
11830 | int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; | |
11831 | int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; | |
11832 | }; | |
6ec2e0f5 | 11833 | |
f45c62c4 YQ |
11834 | int |
11835 | main () | |
11836 | { | |
f45c62c4 YQ |
11837 | |
11838 | ; | |
11839 | return 0; | |
11840 | } | |
11841 | _ACEOF | |
6ec2e0f5 | 11842 | if ac_fn_c_try_compile "$LINENO"; then : |
c0c3707f | 11843 | if test "$cross_compiling" = yes; then : |
6a29c58e | 11844 | case "$host_os" in |
c0c3707f CB |
11845 | # Guess yes on native Windows. |
11846 | mingw*) gl_cv_header_working_stdint_h="guessing yes" ;; | |
11847 | # In general, assume it works. | |
11848 | *) gl_cv_header_working_stdint_h="guessing yes" ;; | |
11849 | esac | |
6a29c58e | 11850 | |
98399780 YQ |
11851 | else |
11852 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11853 | /* end confdefs.h. */ | |
98399780 YQ |
11854 | |
11855 | ||
c0c3707f CB |
11856 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ |
11857 | #define __STDC_CONSTANT_MACROS 1 | |
11858 | #define __STDC_LIMIT_MACROS 1 | |
11859 | #include <stdint.h> | |
98399780 | 11860 | |
88b48903 | 11861 | |
c0c3707f CB |
11862 | /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be |
11863 | included before <wchar.h>. */ | |
11864 | #include <stddef.h> | |
11865 | #include <signal.h> | |
11866 | #if HAVE_WCHAR_H | |
11867 | # include <stdio.h> | |
11868 | # include <time.h> | |
11869 | # include <wchar.h> | |
11870 | #endif | |
88b48903 | 11871 | |
472fa5ee | 11872 | |
c0c3707f CB |
11873 | #include <stdio.h> |
11874 | #include <string.h> | |
11875 | #define MVAL(macro) MVAL1(macro) | |
11876 | #define MVAL1(expression) #expression | |
11877 | static const char *macro_values[] = | |
11878 | { | |
11879 | #ifdef INT8_MAX | |
11880 | MVAL (INT8_MAX), | |
11881 | #endif | |
11882 | #ifdef INT16_MAX | |
11883 | MVAL (INT16_MAX), | |
11884 | #endif | |
11885 | #ifdef INT32_MAX | |
11886 | MVAL (INT32_MAX), | |
11887 | #endif | |
11888 | #ifdef INT64_MAX | |
11889 | MVAL (INT64_MAX), | |
11890 | #endif | |
11891 | #ifdef UINT8_MAX | |
11892 | MVAL (UINT8_MAX), | |
11893 | #endif | |
11894 | #ifdef UINT16_MAX | |
11895 | MVAL (UINT16_MAX), | |
11896 | #endif | |
11897 | #ifdef UINT32_MAX | |
11898 | MVAL (UINT32_MAX), | |
11899 | #endif | |
11900 | #ifdef UINT64_MAX | |
11901 | MVAL (UINT64_MAX), | |
11902 | #endif | |
11903 | NULL | |
11904 | }; | |
472fa5ee | 11905 | |
c0c3707f CB |
11906 | int |
11907 | main () | |
11908 | { | |
472fa5ee | 11909 | |
c0c3707f CB |
11910 | const char **mv; |
11911 | for (mv = macro_values; *mv != NULL; mv++) | |
11912 | { | |
11913 | const char *value = *mv; | |
11914 | /* Test whether it looks like a cast expression. */ | |
11915 | if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 | |
11916 | || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 | |
11917 | || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 | |
11918 | || strncmp (value, "((int)"/*)*/, 6) == 0 | |
11919 | || strncmp (value, "((signed short)"/*)*/, 15) == 0 | |
11920 | || strncmp (value, "((signed char)"/*)*/, 14) == 0) | |
11921 | return mv - macro_values + 1; | |
11922 | } | |
11923 | return 0; | |
11924 | ||
11925 | ; | |
11926 | return 0; | |
11927 | } | |
11928 | _ACEOF | |
11929 | if ac_fn_c_try_run "$LINENO"; then : | |
11930 | gl_cv_header_working_stdint_h=yes | |
11931 | fi | |
11932 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
11933 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
11934 | fi | |
11935 | ||
11936 | ||
11937 | fi | |
11938 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
8690e634 | 11939 | |
c0c3707f CB |
11940 | fi |
11941 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 | |
11942 | $as_echo "$gl_cv_header_working_stdint_h" >&6; } | |
11943 | fi | |
8690e634 | 11944 | |
c0c3707f CB |
11945 | HAVE_C99_STDINT_H=0 |
11946 | HAVE_SYS_BITYPES_H=0 | |
11947 | HAVE_SYS_INTTYPES_H=0 | |
11948 | STDINT_H=stdint.h | |
11949 | case "$gl_cv_header_working_stdint_h" in | |
11950 | *yes) | |
11951 | HAVE_C99_STDINT_H=1 | |
11952 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5 | |
11953 | $as_echo_n "checking whether stdint.h predates C++11... " >&6; } | |
11954 | if ${gl_cv_header_stdint_predates_cxx11_h+:} false; then : | |
11955 | $as_echo_n "(cached) " >&6 | |
11956 | else | |
11957 | gl_cv_header_stdint_predates_cxx11_h=yes | |
11958 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
11959 | /* end confdefs.h. */ | |
8690e634 JK |
11960 | |
11961 | ||
c0c3707f CB |
11962 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ |
11963 | #include <stdint.h> | |
8690e634 JK |
11964 | |
11965 | ||
c0c3707f CB |
11966 | /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be |
11967 | included before <wchar.h>. */ | |
11968 | #include <stddef.h> | |
11969 | #include <signal.h> | |
11970 | #if HAVE_WCHAR_H | |
11971 | # include <stdio.h> | |
11972 | # include <time.h> | |
11973 | # include <wchar.h> | |
11974 | #endif | |
8690e634 JK |
11975 | |
11976 | ||
c0c3707f CB |
11977 | intmax_t im = INTMAX_MAX; |
11978 | int32_t i32 = INT32_C (0x7fffffff); | |
472fa5ee | 11979 | |
c0c3707f CB |
11980 | int |
11981 | main () | |
11982 | { | |
472fa5ee | 11983 | |
c0c3707f CB |
11984 | ; |
11985 | return 0; | |
11986 | } | |
11987 | _ACEOF | |
11988 | if ac_fn_c_try_compile "$LINENO"; then : | |
11989 | gl_cv_header_stdint_predates_cxx11_h=no | |
11990 | fi | |
11991 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
11992 | fi | |
11993 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5 | |
11994 | $as_echo "$gl_cv_header_stdint_predates_cxx11_h" >&6; } | |
472fa5ee | 11995 | |
c0c3707f | 11996 | if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then |
472fa5ee | 11997 | |
c0c3707f | 11998 | $as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h |
472fa5ee SM |
11999 | |
12000 | ||
c0c3707f CB |
12001 | $as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h |
12002 | ||
12003 | fi | |
12004 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5 | |
12005 | $as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; } | |
12006 | if ${gl_cv_header_stdint_width+:} false; then : | |
8690e634 JK |
12007 | $as_echo_n "(cached) " >&6 |
12008 | else | |
c0c3707f CB |
12009 | gl_cv_header_stdint_width=no |
12010 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 JK |
12011 | /* end confdefs.h. */ |
12012 | ||
c0c3707f CB |
12013 | /* Work if build is not clean. */ |
12014 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 | |
12015 | #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ | |
12016 | #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 | |
12017 | #endif | |
12018 | #include <stdint.h> | |
12019 | ||
12020 | /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
12021 | included before <wchar.h>. */ | |
12022 | #include <stddef.h> | |
12023 | #include <signal.h> | |
12024 | #if HAVE_WCHAR_H | |
12025 | # include <stdio.h> | |
12026 | # include <time.h> | |
12027 | # include <wchar.h> | |
12028 | #endif | |
12029 | ||
12030 | int iw = UINTMAX_WIDTH; | |
12031 | ||
12032 | int | |
12033 | main () | |
8690e634 | 12034 | { |
c0c3707f CB |
12035 | |
12036 | ; | |
8690e634 JK |
12037 | return 0; |
12038 | } | |
8690e634 | 12039 | _ACEOF |
c0c3707f CB |
12040 | if ac_fn_c_try_compile "$LINENO"; then : |
12041 | gl_cv_header_stdint_width=yes | |
12042 | fi | |
12043 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12044 | fi | |
12045 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5 | |
12046 | $as_echo "$gl_cv_header_stdint_width" >&6; } | |
12047 | if test "$gl_cv_header_stdint_width" = yes; then | |
12048 | STDINT_H= | |
12049 | fi | |
12050 | ;; | |
12051 | *) | |
12052 | for ac_header in sys/inttypes.h sys/bitypes.h | |
12053 | do : | |
12054 | as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` | |
12055 | ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" | |
12056 | if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : | |
12057 | cat >>confdefs.h <<_ACEOF | |
12058 | #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 | |
12059 | _ACEOF | |
12060 | ||
12061 | fi | |
12062 | ||
12063 | done | |
12064 | ||
12065 | if test $ac_cv_header_sys_inttypes_h = yes; then | |
12066 | HAVE_SYS_INTTYPES_H=1 | |
12067 | fi | |
12068 | if test $ac_cv_header_sys_bitypes_h = yes; then | |
12069 | HAVE_SYS_BITYPES_H=1 | |
12070 | fi | |
12071 | ||
12072 | ||
12073 | if test $APPLE_UNIVERSAL_BUILD = 0; then | |
12074 | ||
12075 | ||
12076 | for gltype in ptrdiff_t size_t ; do | |
12077 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 | |
12078 | $as_echo_n "checking for bit size of $gltype... " >&6; } | |
12079 | if eval \${gl_cv_bitsizeof_${gltype}+:} false; then : | |
12080 | $as_echo_n "(cached) " >&6 | |
12081 | else | |
12082 | if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " | |
12083 | /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
12084 | included before <wchar.h>. */ | |
12085 | #include <stddef.h> | |
12086 | #include <signal.h> | |
12087 | #if HAVE_WCHAR_H | |
12088 | # include <stdio.h> | |
12089 | # include <time.h> | |
12090 | # include <wchar.h> | |
12091 | #endif | |
12092 | ||
12093 | #include <limits.h>"; then : | |
12094 | ||
12095 | else | |
12096 | result=unknown | |
12097 | fi | |
12098 | ||
12099 | eval gl_cv_bitsizeof_${gltype}=\$result | |
12100 | ||
12101 | fi | |
12102 | eval ac_res=\$gl_cv_bitsizeof_${gltype} | |
12103 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
12104 | $as_echo "$ac_res" >&6; } | |
12105 | eval result=\$gl_cv_bitsizeof_${gltype} | |
12106 | if test $result = unknown; then | |
12107 | result=0 | |
8690e634 | 12108 | fi |
c0c3707f CB |
12109 | GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` |
12110 | cat >>confdefs.h <<_ACEOF | |
12111 | #define BITSIZEOF_${GLTYPE} $result | |
12112 | _ACEOF | |
8690e634 | 12113 | |
c0c3707f CB |
12114 | eval BITSIZEOF_${GLTYPE}=\$result |
12115 | done | |
8690e634 JK |
12116 | |
12117 | ||
c0c3707f | 12118 | fi |
8690e634 JK |
12119 | |
12120 | ||
c0c3707f CB |
12121 | for gltype in sig_atomic_t wchar_t wint_t ; do |
12122 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5 | |
12123 | $as_echo_n "checking for bit size of $gltype... " >&6; } | |
12124 | if eval \${gl_cv_bitsizeof_${gltype}+:} false; then : | |
8690e634 JK |
12125 | $as_echo_n "(cached) " >&6 |
12126 | else | |
c0c3707f CB |
12127 | if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " |
12128 | /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
12129 | included before <wchar.h>. */ | |
12130 | #include <stddef.h> | |
12131 | #include <signal.h> | |
12132 | #if HAVE_WCHAR_H | |
12133 | # include <stdio.h> | |
12134 | # include <time.h> | |
12135 | # include <wchar.h> | |
12136 | #endif | |
8690e634 | 12137 | |
c0c3707f | 12138 | #include <limits.h>"; then : |
8690e634 | 12139 | |
c0c3707f CB |
12140 | else |
12141 | result=unknown | |
12142 | fi | |
8690e634 | 12143 | |
c0c3707f | 12144 | eval gl_cv_bitsizeof_${gltype}=\$result |
8690e634 JK |
12145 | |
12146 | fi | |
c0c3707f CB |
12147 | eval ac_res=\$gl_cv_bitsizeof_${gltype} |
12148 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
12149 | $as_echo "$ac_res" >&6; } | |
12150 | eval result=\$gl_cv_bitsizeof_${gltype} | |
12151 | if test $result = unknown; then | |
12152 | result=0 | |
12153 | fi | |
12154 | GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` | |
12155 | cat >>confdefs.h <<_ACEOF | |
12156 | #define BITSIZEOF_${GLTYPE} $result | |
12157 | _ACEOF | |
12158 | ||
12159 | eval BITSIZEOF_${GLTYPE}=\$result | |
12160 | done | |
8690e634 JK |
12161 | |
12162 | ||
12163 | ||
12164 | ||
c0c3707f CB |
12165 | for gltype in sig_atomic_t wchar_t wint_t ; do |
12166 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5 | |
12167 | $as_echo_n "checking whether $gltype is signed... " >&6; } | |
12168 | if eval \${gl_cv_type_${gltype}_signed+:} false; then : | |
8690e634 JK |
12169 | $as_echo_n "(cached) " >&6 |
12170 | else | |
c0c3707f | 12171 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8690e634 JK |
12172 | /* end confdefs.h. */ |
12173 | ||
c0c3707f CB |
12174 | /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be |
12175 | included before <wchar.h>. */ | |
12176 | #include <stddef.h> | |
12177 | #include <signal.h> | |
12178 | #if HAVE_WCHAR_H | |
12179 | # include <stdio.h> | |
12180 | # include <time.h> | |
12181 | # include <wchar.h> | |
12182 | #endif | |
12183 | ||
12184 | int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; | |
12185 | int | |
12186 | main () | |
12187 | { | |
12188 | ||
12189 | ; | |
8690e634 JK |
12190 | return 0; |
12191 | } | |
c0c3707f CB |
12192 | _ACEOF |
12193 | if ac_fn_c_try_compile "$LINENO"; then : | |
12194 | result=yes | |
12195 | else | |
12196 | result=no | |
12197 | fi | |
12198 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12199 | eval gl_cv_type_${gltype}_signed=\$result | |
8690e634 | 12200 | |
c0c3707f CB |
12201 | fi |
12202 | eval ac_res=\$gl_cv_type_${gltype}_signed | |
12203 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
12204 | $as_echo "$ac_res" >&6; } | |
12205 | eval result=\$gl_cv_type_${gltype}_signed | |
12206 | GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` | |
12207 | if test "$result" = yes; then | |
12208 | cat >>confdefs.h <<_ACEOF | |
12209 | #define HAVE_SIGNED_${GLTYPE} 1 | |
8690e634 | 12210 | _ACEOF |
c0c3707f CB |
12211 | |
12212 | eval HAVE_SIGNED_${GLTYPE}=1 | |
12213 | else | |
12214 | eval HAVE_SIGNED_${GLTYPE}=0 | |
8690e634 | 12215 | fi |
c0c3707f CB |
12216 | done |
12217 | ||
12218 | ||
12219 | gl_cv_type_ptrdiff_t_signed=yes | |
12220 | gl_cv_type_size_t_signed=no | |
12221 | if test $APPLE_UNIVERSAL_BUILD = 0; then | |
12222 | ||
12223 | ||
12224 | for gltype in ptrdiff_t size_t ; do | |
12225 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 | |
12226 | $as_echo_n "checking for $gltype integer literal suffix... " >&6; } | |
12227 | if eval \${gl_cv_type_${gltype}_suffix+:} false; then : | |
12228 | $as_echo_n "(cached) " >&6 | |
12229 | else | |
12230 | eval gl_cv_type_${gltype}_suffix=no | |
12231 | eval result=\$gl_cv_type_${gltype}_signed | |
12232 | if test "$result" = yes; then | |
12233 | glsufu= | |
12234 | else | |
12235 | glsufu=u | |
12236 | fi | |
12237 | for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do | |
12238 | case $glsuf in | |
12239 | '') gltype1='int';; | |
12240 | l) gltype1='long int';; | |
12241 | ll) gltype1='long long int';; | |
12242 | i64) gltype1='__int64';; | |
12243 | u) gltype1='unsigned int';; | |
12244 | ul) gltype1='unsigned long int';; | |
12245 | ull) gltype1='unsigned long long int';; | |
12246 | ui64)gltype1='unsigned __int64';; | |
12247 | esac | |
12248 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12249 | /* end confdefs.h. */ | |
12250 | ||
12251 | /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
12252 | included before <wchar.h>. */ | |
12253 | #include <stddef.h> | |
12254 | #include <signal.h> | |
12255 | #if HAVE_WCHAR_H | |
12256 | # include <stdio.h> | |
12257 | # include <time.h> | |
12258 | # include <wchar.h> | |
12259 | #endif | |
8690e634 | 12260 | |
c0c3707f CB |
12261 | extern $gltype foo; |
12262 | extern $gltype1 foo; | |
12263 | int | |
12264 | main () | |
12265 | { | |
12266 | ||
12267 | ; | |
12268 | return 0; | |
12269 | } | |
12270 | _ACEOF | |
12271 | if ac_fn_c_try_compile "$LINENO"; then : | |
12272 | eval gl_cv_type_${gltype}_suffix=\$glsuf | |
8690e634 | 12273 | fi |
c0c3707f CB |
12274 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
12275 | eval result=\$gl_cv_type_${gltype}_suffix | |
12276 | test "$result" != no && break | |
12277 | done | |
12278 | fi | |
12279 | eval ac_res=\$gl_cv_type_${gltype}_suffix | |
12280 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
12281 | $as_echo "$ac_res" >&6; } | |
12282 | GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` | |
12283 | eval result=\$gl_cv_type_${gltype}_suffix | |
12284 | test "$result" = no && result= | |
12285 | eval ${GLTYPE}_SUFFIX=\$result | |
12286 | cat >>confdefs.h <<_ACEOF | |
12287 | #define ${GLTYPE}_SUFFIX $result | |
12288 | _ACEOF | |
8690e634 | 12289 | |
c0c3707f | 12290 | done |
8690e634 JK |
12291 | |
12292 | ||
c0c3707f | 12293 | fi |
8690e634 JK |
12294 | |
12295 | ||
c0c3707f CB |
12296 | for gltype in sig_atomic_t wchar_t wint_t ; do |
12297 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5 | |
12298 | $as_echo_n "checking for $gltype integer literal suffix... " >&6; } | |
12299 | if eval \${gl_cv_type_${gltype}_suffix+:} false; then : | |
8690e634 JK |
12300 | $as_echo_n "(cached) " >&6 |
12301 | else | |
c0c3707f CB |
12302 | eval gl_cv_type_${gltype}_suffix=no |
12303 | eval result=\$gl_cv_type_${gltype}_signed | |
12304 | if test "$result" = yes; then | |
12305 | glsufu= | |
12306 | else | |
12307 | glsufu=u | |
12308 | fi | |
12309 | for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do | |
12310 | case $glsuf in | |
12311 | '') gltype1='int';; | |
12312 | l) gltype1='long int';; | |
12313 | ll) gltype1='long long int';; | |
12314 | i64) gltype1='__int64';; | |
12315 | u) gltype1='unsigned int';; | |
12316 | ul) gltype1='unsigned long int';; | |
12317 | ull) gltype1='unsigned long long int';; | |
12318 | ui64)gltype1='unsigned __int64';; | |
12319 | esac | |
12320 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 JK |
12321 | /* end confdefs.h. */ |
12322 | ||
c0c3707f CB |
12323 | /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be |
12324 | included before <wchar.h>. */ | |
12325 | #include <stddef.h> | |
12326 | #include <signal.h> | |
12327 | #if HAVE_WCHAR_H | |
12328 | # include <stdio.h> | |
12329 | # include <time.h> | |
12330 | # include <wchar.h> | |
12331 | #endif | |
12332 | ||
12333 | extern $gltype foo; | |
12334 | extern $gltype1 foo; | |
12335 | int | |
12336 | main () | |
12337 | { | |
12338 | ||
12339 | ; | |
5e8754f9 | 12340 | return 0; |
8690e634 | 12341 | } |
c0c3707f CB |
12342 | _ACEOF |
12343 | if ac_fn_c_try_compile "$LINENO"; then : | |
12344 | eval gl_cv_type_${gltype}_suffix=\$glsuf | |
12345 | fi | |
12346 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12347 | eval result=\$gl_cv_type_${gltype}_suffix | |
12348 | test "$result" != no && break | |
12349 | done | |
12350 | fi | |
12351 | eval ac_res=\$gl_cv_type_${gltype}_suffix | |
12352 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
12353 | $as_echo "$ac_res" >&6; } | |
12354 | GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` | |
12355 | eval result=\$gl_cv_type_${gltype}_suffix | |
12356 | test "$result" = no && result= | |
12357 | eval ${GLTYPE}_SUFFIX=\$result | |
12358 | cat >>confdefs.h <<_ACEOF | |
12359 | #define ${GLTYPE}_SUFFIX $result | |
12360 | _ACEOF | |
12361 | ||
12362 | done | |
12363 | ||
12364 | ||
12365 | ||
12366 | if test $GNULIB_OVERRIDES_WINT_T = 1; then | |
12367 | BITSIZEOF_WINT_T=32 | |
12368 | fi | |
12369 | ||
12370 | ;; | |
12371 | esac | |
8690e634 | 12372 | |
8690e634 | 12373 | |
c0c3707f CB |
12374 | |
12375 | LIMITS_H='limits.h' | |
12376 | if test -n "$LIMITS_H"; then | |
12377 | GL_GENERATE_LIMITS_H_TRUE= | |
12378 | GL_GENERATE_LIMITS_H_FALSE='#' | |
12379 | else | |
12380 | GL_GENERATE_LIMITS_H_TRUE='#' | |
12381 | GL_GENERATE_LIMITS_H_FALSE= | |
8690e634 | 12382 | fi |
6ec2e0f5 SDJ |
12383 | |
12384 | ||
12385 | ||
12386 | ||
12387 | ||
12388 | ||
12389 | ||
c0c3707f CB |
12390 | if test -n "$STDINT_H"; then |
12391 | GL_GENERATE_STDINT_H_TRUE= | |
12392 | GL_GENERATE_STDINT_H_FALSE='#' | |
12393 | else | |
12394 | GL_GENERATE_STDINT_H_TRUE='#' | |
12395 | GL_GENERATE_STDINT_H_FALSE= | |
12396 | fi | |
472fa5ee SM |
12397 | |
12398 | ||
12399 | ||
12400 | ||
12401 | ||
c0c3707f CB |
12402 | GNULIB_IMAXABS=0; |
12403 | GNULIB_IMAXDIV=0; | |
12404 | GNULIB_STRTOIMAX=0; | |
12405 | GNULIB_STRTOUMAX=0; | |
12406 | HAVE_DECL_IMAXABS=1; | |
12407 | HAVE_DECL_IMAXDIV=1; | |
12408 | HAVE_DECL_STRTOIMAX=1; | |
12409 | HAVE_DECL_STRTOUMAX=1; | |
12410 | HAVE_IMAXDIV_T=1; | |
12411 | REPLACE_STRTOIMAX=0; | |
12412 | REPLACE_STRTOUMAX=0; | |
12413 | INT32_MAX_LT_INTMAX_MAX=1; | |
12414 | INT64_MAX_EQ_LONG_MAX='defined _LP64'; | |
12415 | PRI_MACROS_BROKEN=0; | |
12416 | PRIPTR_PREFIX=__PRIPTR_PREFIX; | |
12417 | UINT32_MAX_LT_UINTMAX_MAX=1; | |
12418 | UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; | |
472fa5ee | 12419 | |
6ec2e0f5 SDJ |
12420 | |
12421 | ||
12422 | ||
12423 | ||
12424 | ||
6ec2e0f5 SDJ |
12425 | |
12426 | ||
6ec2e0f5 | 12427 | |
6ec2e0f5 | 12428 | |
6ec2e0f5 | 12429 | |
6ec2e0f5 | 12430 | |
6ec2e0f5 | 12431 | |
c0c3707f CB |
12432 | |
12433 | ||
12434 | if test $gl_cv_have_include_next = yes; then | |
12435 | gl_cv_next_inttypes_h='<'inttypes.h'>' | |
12436 | else | |
12437 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5 | |
12438 | $as_echo_n "checking absolute name of <inttypes.h>... " >&6; } | |
12439 | if ${gl_cv_next_inttypes_h+:} false; then : | |
12440 | $as_echo_n "(cached) " >&6 | |
12441 | else | |
12442 | ||
12443 | if test $ac_cv_header_inttypes_h = yes; then | |
12444 | ||
12445 | ||
12446 | ||
12447 | ||
12448 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12449 | /* end confdefs.h. */ | |
12450 | #include <inttypes.h> | |
6ec2e0f5 | 12451 | _ACEOF |
c0c3707f CB |
12452 | case "$host_os" in |
12453 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
12454 | *) gl_absname_cpp="$ac_cpp" ;; | |
12455 | esac | |
6ec2e0f5 | 12456 | |
c0c3707f CB |
12457 | case "$host_os" in |
12458 | mingw*) | |
12459 | gl_dirsep_regex='[/\\]' | |
12460 | ;; | |
12461 | *) | |
12462 | gl_dirsep_regex='\/' | |
12463 | ;; | |
12464 | esac | |
12465 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
12466 | gl_header_literal_regex=`echo 'inttypes.h' \ | |
12467 | | sed -e "$gl_make_literal_regex_sed"` | |
12468 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
12469 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
12470 | s|^/[^/]|//&| | |
12471 | p | |
12472 | q | |
12473 | }' | |
6ec2e0f5 | 12474 | |
c0c3707f CB |
12475 | gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
12476 | sed -n "$gl_absolute_header_sed"` | |
6ec2e0f5 | 12477 | |
c0c3707f CB |
12478 | gl_header=$gl_cv_absolute_inttypes_h |
12479 | gl_cv_next_inttypes_h='"'$gl_header'"' | |
12480 | else | |
12481 | gl_cv_next_inttypes_h='<'inttypes.h'>' | |
12482 | fi | |
6ec2e0f5 | 12483 | |
6ec2e0f5 | 12484 | |
c0c3707f CB |
12485 | fi |
12486 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5 | |
12487 | $as_echo "$gl_cv_next_inttypes_h" >&6; } | |
12488 | fi | |
12489 | NEXT_INTTYPES_H=$gl_cv_next_inttypes_h | |
6ec2e0f5 | 12490 | |
c0c3707f CB |
12491 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
12492 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
12493 | gl_next_as_first_directive='<'inttypes.h'>' | |
12494 | else | |
12495 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
12496 | gl_next_as_first_directive=$gl_cv_next_inttypes_h | |
12497 | fi | |
12498 | NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive | |
6ec2e0f5 | 12499 | |
472fa5ee SM |
12500 | |
12501 | ||
12502 | ||
12503 | ||
12504 | ||
12505 | ||
472fa5ee SM |
12506 | |
12507 | ||
12508 | ||
12509 | ||
6ec2e0f5 | 12510 | |
c0c3707f CB |
12511 | for ac_header in inttypes.h |
12512 | do : | |
12513 | ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" | |
12514 | if test "x$ac_cv_header_inttypes_h" = xyes; then : | |
12515 | cat >>confdefs.h <<_ACEOF | |
12516 | #define HAVE_INTTYPES_H 1 | |
12517 | _ACEOF | |
6ec2e0f5 | 12518 | |
c0c3707f | 12519 | fi |
6ec2e0f5 | 12520 | |
c0c3707f | 12521 | done |
6ec2e0f5 | 12522 | |
c0c3707f CB |
12523 | if test $ac_cv_header_inttypes_h = yes; then |
12524 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5 | |
12525 | $as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; } | |
12526 | if ${gt_cv_inttypes_pri_broken+:} false; then : | |
6ec2e0f5 SDJ |
12527 | $as_echo_n "(cached) " >&6 |
12528 | else | |
c0c3707f CB |
12529 | |
12530 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 SDJ |
12531 | /* end confdefs.h. */ |
12532 | ||
c0c3707f CB |
12533 | #include <inttypes.h> |
12534 | #ifdef PRId32 | |
12535 | char *p = PRId32; | |
6ec2e0f5 SDJ |
12536 | #endif |
12537 | ||
12538 | int | |
12539 | main () | |
12540 | { | |
12541 | ||
6ec2e0f5 SDJ |
12542 | ; |
12543 | return 0; | |
12544 | } | |
12545 | _ACEOF | |
c0c3707f CB |
12546 | if ac_fn_c_try_compile "$LINENO"; then : |
12547 | gt_cv_inttypes_pri_broken=no | |
6ec2e0f5 | 12548 | else |
5df4cba6 SM |
12549 | gt_cv_inttypes_pri_broken=yes |
12550 | fi | |
12551 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12552 | ||
12553 | fi | |
12554 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5 | |
12555 | $as_echo "$gt_cv_inttypes_pri_broken" >&6; } | |
12556 | fi | |
12557 | if test "$gt_cv_inttypes_pri_broken" = yes; then | |
12558 | ||
12559 | cat >>confdefs.h <<_ACEOF | |
12560 | #define PRI_MACROS_BROKEN 1 | |
12561 | _ACEOF | |
12562 | ||
12563 | PRI_MACROS_BROKEN=1 | |
12564 | else | |
12565 | PRI_MACROS_BROKEN=0 | |
12566 | fi | |
12567 | ||
12568 | ||
12569 | ||
12570 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 | |
12571 | $as_echo_n "checking where to find the exponent in a 'double'... " >&6; } | |
12572 | if ${gl_cv_cc_double_expbit0+:} false; then : | |
12573 | $as_echo_n "(cached) " >&6 | |
12574 | else | |
12575 | ||
12576 | if test "$cross_compiling" = yes; then : | |
12577 | ||
12578 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12579 | /* end confdefs.h. */ | |
12580 | ||
12581 | #if defined arm || defined __arm || defined __arm__ | |
12582 | mixed_endianness | |
12583 | #endif | |
12584 | ||
12585 | _ACEOF | |
12586 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
12587 | $EGREP "mixed_endianness" >/dev/null 2>&1; then : | |
12588 | gl_cv_cc_double_expbit0="unknown" | |
12589 | else | |
12590 | ||
12591 | : | |
12592 | if ${ac_cv_c_bigendian+:} false; then : | |
12593 | $as_echo_n "(cached) " >&6 | |
12594 | else | |
12595 | ac_cv_c_bigendian=unknown | |
12596 | # See if we're dealing with a universal compiler. | |
12597 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12598 | /* end confdefs.h. */ | |
12599 | #ifndef __APPLE_CC__ | |
12600 | not a universal capable compiler | |
12601 | #endif | |
12602 | typedef int dummy; | |
12603 | ||
12604 | _ACEOF | |
12605 | if ac_fn_c_try_compile "$LINENO"; then : | |
12606 | ||
12607 | # Check for potential -arch flags. It is not universal unless | |
12608 | # there are at least two -arch flags with different values. | |
12609 | ac_arch= | |
12610 | ac_prev= | |
12611 | for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do | |
12612 | if test -n "$ac_prev"; then | |
12613 | case $ac_word in | |
12614 | i?86 | x86_64 | ppc | ppc64) | |
12615 | if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then | |
12616 | ac_arch=$ac_word | |
12617 | else | |
12618 | ac_cv_c_bigendian=universal | |
12619 | break | |
12620 | fi | |
12621 | ;; | |
12622 | esac | |
12623 | ac_prev= | |
12624 | elif test "x$ac_word" = "x-arch"; then | |
12625 | ac_prev=arch | |
12626 | fi | |
12627 | done | |
12628 | fi | |
12629 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12630 | if test $ac_cv_c_bigendian = unknown; then | |
12631 | # See if sys/param.h defines the BYTE_ORDER macro. | |
12632 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12633 | /* end confdefs.h. */ | |
12634 | #include <sys/types.h> | |
12635 | #include <sys/param.h> | |
12636 | ||
12637 | int | |
12638 | main () | |
12639 | { | |
12640 | #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ | |
12641 | && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ | |
12642 | && LITTLE_ENDIAN) | |
12643 | bogus endian macros | |
12644 | #endif | |
12645 | ||
12646 | ; | |
12647 | return 0; | |
12648 | } | |
12649 | _ACEOF | |
12650 | if ac_fn_c_try_compile "$LINENO"; then : | |
12651 | # It does; now see whether it defined to BIG_ENDIAN or not. | |
12652 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12653 | /* end confdefs.h. */ | |
12654 | #include <sys/types.h> | |
12655 | #include <sys/param.h> | |
12656 | ||
12657 | int | |
12658 | main () | |
12659 | { | |
12660 | #if BYTE_ORDER != BIG_ENDIAN | |
12661 | not big endian | |
12662 | #endif | |
12663 | ||
12664 | ; | |
12665 | return 0; | |
12666 | } | |
12667 | _ACEOF | |
12668 | if ac_fn_c_try_compile "$LINENO"; then : | |
12669 | ac_cv_c_bigendian=yes | |
12670 | else | |
12671 | ac_cv_c_bigendian=no | |
12672 | fi | |
12673 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12674 | fi | |
12675 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12676 | fi | |
12677 | if test $ac_cv_c_bigendian = unknown; then | |
12678 | # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). | |
12679 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12680 | /* end confdefs.h. */ | |
12681 | #include <limits.h> | |
12682 | ||
12683 | int | |
12684 | main () | |
12685 | { | |
12686 | #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) | |
12687 | bogus endian macros | |
12688 | #endif | |
12689 | ||
12690 | ; | |
12691 | return 0; | |
12692 | } | |
12693 | _ACEOF | |
12694 | if ac_fn_c_try_compile "$LINENO"; then : | |
12695 | # It does; now see whether it defined to _BIG_ENDIAN or not. | |
12696 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12697 | /* end confdefs.h. */ | |
12698 | #include <limits.h> | |
12699 | ||
12700 | int | |
12701 | main () | |
12702 | { | |
12703 | #ifndef _BIG_ENDIAN | |
12704 | not big endian | |
12705 | #endif | |
12706 | ||
12707 | ; | |
12708 | return 0; | |
12709 | } | |
12710 | _ACEOF | |
12711 | if ac_fn_c_try_compile "$LINENO"; then : | |
12712 | ac_cv_c_bigendian=yes | |
12713 | else | |
12714 | ac_cv_c_bigendian=no | |
12715 | fi | |
12716 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12717 | fi | |
12718 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12719 | fi | |
12720 | if test $ac_cv_c_bigendian = unknown; then | |
12721 | # Compile a test program. | |
12722 | if test "$cross_compiling" = yes; then : | |
12723 | # Try to guess by grepping values from an object file. | |
12724 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12725 | /* end confdefs.h. */ | |
12726 | short int ascii_mm[] = | |
12727 | { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; | |
12728 | short int ascii_ii[] = | |
12729 | { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; | |
12730 | int use_ascii (int i) { | |
12731 | return ascii_mm[i] + ascii_ii[i]; | |
12732 | } | |
12733 | short int ebcdic_ii[] = | |
12734 | { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; | |
12735 | short int ebcdic_mm[] = | |
12736 | { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; | |
12737 | int use_ebcdic (int i) { | |
12738 | return ebcdic_mm[i] + ebcdic_ii[i]; | |
12739 | } | |
12740 | extern int foo; | |
12741 | ||
12742 | int | |
12743 | main () | |
12744 | { | |
12745 | return use_ascii (foo) == use_ebcdic (foo); | |
12746 | ; | |
12747 | return 0; | |
12748 | } | |
12749 | _ACEOF | |
12750 | if ac_fn_c_try_compile "$LINENO"; then : | |
12751 | if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then | |
12752 | ac_cv_c_bigendian=yes | |
12753 | fi | |
12754 | if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then | |
12755 | if test "$ac_cv_c_bigendian" = unknown; then | |
12756 | ac_cv_c_bigendian=no | |
12757 | else | |
12758 | # finding both strings is unlikely to happen, but who knows? | |
12759 | ac_cv_c_bigendian=unknown | |
12760 | fi | |
12761 | fi | |
12762 | fi | |
12763 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12764 | else | |
12765 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12766 | /* end confdefs.h. */ | |
12767 | $ac_includes_default | |
12768 | int | |
12769 | main () | |
12770 | { | |
12771 | ||
12772 | /* Are we little or big endian? From Harbison&Steele. */ | |
12773 | union | |
12774 | { | |
12775 | long int l; | |
12776 | char c[sizeof (long int)]; | |
12777 | } u; | |
12778 | u.l = 1; | |
12779 | return u.c[sizeof (long int) - 1] == 1; | |
12780 | ||
12781 | ; | |
12782 | return 0; | |
12783 | } | |
12784 | _ACEOF | |
12785 | if ac_fn_c_try_run "$LINENO"; then : | |
12786 | ac_cv_c_bigendian=no | |
12787 | else | |
12788 | ac_cv_c_bigendian=yes | |
12789 | fi | |
12790 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
12791 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
12792 | fi | |
12793 | ||
12794 | fi | |
12795 | fi | |
12796 | : | |
12797 | case $ac_cv_c_bigendian in #( | |
12798 | yes) | |
12799 | gl_cv_cc_double_expbit0="word 0 bit 20";; #( | |
12800 | no) | |
12801 | gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( | |
12802 | universal) | |
12803 | ||
12804 | $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h | |
12805 | ||
12806 | ;; #( | |
12807 | *) | |
12808 | gl_cv_cc_double_expbit0="unknown" ;; | |
12809 | esac | |
12810 | ||
12811 | ||
12812 | fi | |
12813 | rm -f conftest* | |
12814 | ||
12815 | ||
12816 | else | |
12817 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12818 | /* end confdefs.h. */ | |
12819 | ||
12820 | #include <float.h> | |
12821 | #include <stddef.h> | |
12822 | #include <stdio.h> | |
12823 | #include <string.h> | |
12824 | #define NWORDS \ | |
12825 | ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) | |
12826 | typedef union { double value; unsigned int word[NWORDS]; } memory_double; | |
12827 | static unsigned int ored_words[NWORDS]; | |
12828 | static unsigned int anded_words[NWORDS]; | |
12829 | static void add_to_ored_words (double x) | |
12830 | { | |
12831 | memory_double m; | |
12832 | size_t i; | |
12833 | /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ | |
12834 | memset (&m, 0, sizeof (memory_double)); | |
12835 | m.value = x; | |
12836 | for (i = 0; i < NWORDS; i++) | |
12837 | { | |
12838 | ored_words[i] |= m.word[i]; | |
12839 | anded_words[i] &= m.word[i]; | |
12840 | } | |
12841 | } | |
12842 | int main () | |
12843 | { | |
12844 | size_t j; | |
12845 | FILE *fp = fopen ("conftest.out", "w"); | |
12846 | if (fp == NULL) | |
12847 | return 1; | |
12848 | for (j = 0; j < NWORDS; j++) | |
12849 | anded_words[j] = ~ (unsigned int) 0; | |
12850 | add_to_ored_words (0.25); | |
12851 | add_to_ored_words (0.5); | |
12852 | add_to_ored_words (1.0); | |
12853 | add_to_ored_words (2.0); | |
12854 | add_to_ored_words (4.0); | |
12855 | /* Remove bits that are common (e.g. if representation of the first mantissa | |
12856 | bit is explicit). */ | |
12857 | for (j = 0; j < NWORDS; j++) | |
12858 | ored_words[j] &= ~anded_words[j]; | |
12859 | /* Now find the nonzero word. */ | |
12860 | for (j = 0; j < NWORDS; j++) | |
12861 | if (ored_words[j] != 0) | |
12862 | break; | |
12863 | if (j < NWORDS) | |
12864 | { | |
12865 | size_t i; | |
12866 | for (i = j + 1; i < NWORDS; i++) | |
12867 | if (ored_words[i] != 0) | |
12868 | { | |
12869 | fprintf (fp, "unknown"); | |
12870 | return (fclose (fp) != 0); | |
12871 | } | |
12872 | for (i = 0; ; i++) | |
12873 | if ((ored_words[j] >> i) & 1) | |
12874 | { | |
12875 | fprintf (fp, "word %d bit %d", (int) j, (int) i); | |
12876 | return (fclose (fp) != 0); | |
12877 | } | |
12878 | } | |
12879 | fprintf (fp, "unknown"); | |
12880 | return (fclose (fp) != 0); | |
12881 | } | |
12882 | ||
12883 | _ACEOF | |
12884 | if ac_fn_c_try_run "$LINENO"; then : | |
12885 | gl_cv_cc_double_expbit0=`cat conftest.out` | |
12886 | else | |
12887 | gl_cv_cc_double_expbit0="unknown" | |
6ec2e0f5 | 12888 | fi |
5df4cba6 SM |
12889 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
12890 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
12891 | fi | |
12892 | ||
12893 | rm -f conftest.out | |
6ec2e0f5 SDJ |
12894 | |
12895 | fi | |
5df4cba6 SM |
12896 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 |
12897 | $as_echo "$gl_cv_cc_double_expbit0" >&6; } | |
12898 | case "$gl_cv_cc_double_expbit0" in | |
12899 | word*bit*) | |
12900 | word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` | |
12901 | bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` | |
6ec2e0f5 SDJ |
12902 | |
12903 | cat >>confdefs.h <<_ACEOF | |
5df4cba6 | 12904 | #define DBL_EXPBIT0_WORD $word |
6ec2e0f5 SDJ |
12905 | _ACEOF |
12906 | ||
c0c3707f | 12907 | |
5df4cba6 SM |
12908 | cat >>confdefs.h <<_ACEOF |
12909 | #define DBL_EXPBIT0_BIT $bit | |
12910 | _ACEOF | |
6ec2e0f5 | 12911 | |
5df4cba6 SM |
12912 | ;; |
12913 | esac | |
6ec2e0f5 | 12914 | |
6ec2e0f5 | 12915 | |
5df4cba6 SM |
12916 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 |
12917 | $as_echo_n "checking whether byte ordering is bigendian... " >&6; } | |
c0c3707f CB |
12918 | if ${ac_cv_c_bigendian+:} false; then : |
12919 | $as_echo_n "(cached) " >&6 | |
6ec2e0f5 | 12920 | else |
c0c3707f CB |
12921 | ac_cv_c_bigendian=unknown |
12922 | # See if we're dealing with a universal compiler. | |
12923 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 12924 | /* end confdefs.h. */ |
c0c3707f CB |
12925 | #ifndef __APPLE_CC__ |
12926 | not a universal capable compiler | |
12927 | #endif | |
12928 | typedef int dummy; | |
6ec2e0f5 | 12929 | |
c0c3707f CB |
12930 | _ACEOF |
12931 | if ac_fn_c_try_compile "$LINENO"; then : | |
12932 | ||
12933 | # Check for potential -arch flags. It is not universal unless | |
12934 | # there are at least two -arch flags with different values. | |
12935 | ac_arch= | |
12936 | ac_prev= | |
12937 | for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do | |
12938 | if test -n "$ac_prev"; then | |
12939 | case $ac_word in | |
12940 | i?86 | x86_64 | ppc | ppc64) | |
12941 | if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then | |
12942 | ac_arch=$ac_word | |
12943 | else | |
12944 | ac_cv_c_bigendian=universal | |
12945 | break | |
12946 | fi | |
12947 | ;; | |
12948 | esac | |
12949 | ac_prev= | |
12950 | elif test "x$ac_word" = "x-arch"; then | |
12951 | ac_prev=arch | |
12952 | fi | |
12953 | done | |
12954 | fi | |
12955 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
12956 | if test $ac_cv_c_bigendian = unknown; then | |
12957 | # See if sys/param.h defines the BYTE_ORDER macro. | |
12958 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12959 | /* end confdefs.h. */ | |
12960 | #include <sys/types.h> | |
12961 | #include <sys/param.h> | |
6ec2e0f5 SDJ |
12962 | |
12963 | int | |
12964 | main () | |
12965 | { | |
c0c3707f CB |
12966 | #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ |
12967 | && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ | |
12968 | && LITTLE_ENDIAN) | |
12969 | bogus endian macros | |
12970 | #endif | |
6ec2e0f5 | 12971 | |
c0c3707f CB |
12972 | ; |
12973 | return 0; | |
12974 | } | |
12975 | _ACEOF | |
12976 | if ac_fn_c_try_compile "$LINENO"; then : | |
12977 | # It does; now see whether it defined to BIG_ENDIAN or not. | |
12978 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
12979 | /* end confdefs.h. */ | |
12980 | #include <sys/types.h> | |
12981 | #include <sys/param.h> | |
12982 | ||
12983 | int | |
12984 | main () | |
12985 | { | |
12986 | #if BYTE_ORDER != BIG_ENDIAN | |
12987 | not big endian | |
12988 | #endif | |
6ec2e0f5 SDJ |
12989 | |
12990 | ; | |
12991 | return 0; | |
12992 | } | |
12993 | _ACEOF | |
c0c3707f CB |
12994 | if ac_fn_c_try_compile "$LINENO"; then : |
12995 | ac_cv_c_bigendian=yes | |
6ec2e0f5 | 12996 | else |
c0c3707f | 12997 | ac_cv_c_bigendian=no |
6ec2e0f5 | 12998 | fi |
c0c3707f | 12999 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
6ec2e0f5 | 13000 | fi |
c0c3707f CB |
13001 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
13002 | fi | |
13003 | if test $ac_cv_c_bigendian = unknown; then | |
13004 | # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). | |
13005 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13006 | /* end confdefs.h. */ | |
13007 | #include <limits.h> | |
472fa5ee | 13008 | |
c0c3707f CB |
13009 | int |
13010 | main () | |
13011 | { | |
13012 | #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) | |
13013 | bogus endian macros | |
13014 | #endif | |
6ec2e0f5 | 13015 | |
c0c3707f CB |
13016 | ; |
13017 | return 0; | |
13018 | } | |
6ec2e0f5 | 13019 | _ACEOF |
c0c3707f CB |
13020 | if ac_fn_c_try_compile "$LINENO"; then : |
13021 | # It does; now see whether it defined to _BIG_ENDIAN or not. | |
13022 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 13023 | /* end confdefs.h. */ |
c0c3707f CB |
13024 | #include <limits.h> |
13025 | ||
6ec2e0f5 SDJ |
13026 | int |
13027 | main () | |
13028 | { | |
5df4cba6 SM |
13029 | #ifndef _BIG_ENDIAN |
13030 | not big endian | |
13031 | #endif | |
13032 | ||
13033 | ; | |
13034 | return 0; | |
13035 | } | |
13036 | _ACEOF | |
13037 | if ac_fn_c_try_compile "$LINENO"; then : | |
13038 | ac_cv_c_bigendian=yes | |
13039 | else | |
13040 | ac_cv_c_bigendian=no | |
13041 | fi | |
13042 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13043 | fi | |
13044 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13045 | fi | |
13046 | if test $ac_cv_c_bigendian = unknown; then | |
13047 | # Compile a test program. | |
13048 | if test "$cross_compiling" = yes; then : | |
13049 | # Try to guess by grepping values from an object file. | |
13050 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13051 | /* end confdefs.h. */ | |
13052 | short int ascii_mm[] = | |
13053 | { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; | |
13054 | short int ascii_ii[] = | |
13055 | { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; | |
13056 | int use_ascii (int i) { | |
13057 | return ascii_mm[i] + ascii_ii[i]; | |
13058 | } | |
13059 | short int ebcdic_ii[] = | |
13060 | { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; | |
13061 | short int ebcdic_mm[] = | |
13062 | { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; | |
13063 | int use_ebcdic (int i) { | |
13064 | return ebcdic_mm[i] + ebcdic_ii[i]; | |
13065 | } | |
13066 | extern int foo; | |
13067 | ||
13068 | int | |
13069 | main () | |
13070 | { | |
13071 | return use_ascii (foo) == use_ebcdic (foo); | |
13072 | ; | |
13073 | return 0; | |
13074 | } | |
13075 | _ACEOF | |
13076 | if ac_fn_c_try_compile "$LINENO"; then : | |
13077 | if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then | |
13078 | ac_cv_c_bigendian=yes | |
13079 | fi | |
13080 | if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then | |
13081 | if test "$ac_cv_c_bigendian" = unknown; then | |
13082 | ac_cv_c_bigendian=no | |
13083 | else | |
13084 | # finding both strings is unlikely to happen, but who knows? | |
13085 | ac_cv_c_bigendian=unknown | |
13086 | fi | |
13087 | fi | |
13088 | fi | |
13089 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13090 | else | |
13091 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13092 | /* end confdefs.h. */ | |
13093 | $ac_includes_default | |
13094 | int | |
13095 | main () | |
13096 | { | |
13097 | ||
13098 | /* Are we little or big endian? From Harbison&Steele. */ | |
13099 | union | |
13100 | { | |
13101 | long int l; | |
13102 | char c[sizeof (long int)]; | |
13103 | } u; | |
13104 | u.l = 1; | |
13105 | return u.c[sizeof (long int) - 1] == 1; | |
13106 | ||
13107 | ; | |
13108 | return 0; | |
13109 | } | |
13110 | _ACEOF | |
13111 | if ac_fn_c_try_run "$LINENO"; then : | |
13112 | ac_cv_c_bigendian=no | |
13113 | else | |
13114 | ac_cv_c_bigendian=yes | |
13115 | fi | |
13116 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
13117 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
13118 | fi | |
13119 | ||
13120 | fi | |
13121 | fi | |
13122 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 | |
13123 | $as_echo "$ac_cv_c_bigendian" >&6; } | |
13124 | case $ac_cv_c_bigendian in #( | |
13125 | yes) | |
13126 | $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h | |
13127 | ;; #( | |
13128 | no) | |
13129 | ;; #( | |
13130 | universal) | |
13131 | ||
13132 | $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h | |
13133 | ||
13134 | ;; #( | |
13135 | *) | |
13136 | as_fn_error $? "unknown endianness | |
13137 | presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; | |
13138 | esac | |
13139 | ||
13140 | ||
13141 | ||
13142 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 | |
13143 | $as_echo_n "checking for nl_langinfo and CODESET... " >&6; } | |
13144 | if ${am_cv_langinfo_codeset+:} false; then : | |
13145 | $as_echo_n "(cached) " >&6 | |
13146 | else | |
13147 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13148 | /* end confdefs.h. */ | |
13149 | #include <langinfo.h> | |
13150 | int | |
13151 | main () | |
13152 | { | |
13153 | char* cs = nl_langinfo(CODESET); return !cs; | |
13154 | ; | |
13155 | return 0; | |
13156 | } | |
13157 | _ACEOF | |
13158 | if ac_fn_c_try_link "$LINENO"; then : | |
13159 | am_cv_langinfo_codeset=yes | |
13160 | else | |
13161 | am_cv_langinfo_codeset=no | |
13162 | fi | |
13163 | rm -f core conftest.err conftest.$ac_objext \ | |
13164 | conftest$ac_exeext conftest.$ac_ext | |
13165 | ||
13166 | fi | |
13167 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 | |
13168 | $as_echo "$am_cv_langinfo_codeset" >&6; } | |
13169 | if test $am_cv_langinfo_codeset = yes; then | |
13170 | ||
13171 | $as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h | |
13172 | ||
13173 | fi | |
13174 | ||
13175 | ||
13176 | GNULIB_LOCALECONV=0; | |
13177 | GNULIB_SETLOCALE=0; | |
13178 | GNULIB_SETLOCALE_NULL=0; | |
13179 | GNULIB_DUPLOCALE=0; | |
13180 | GNULIB_LOCALENAME=0; | |
13181 | HAVE_NEWLOCALE=1; | |
13182 | HAVE_DUPLOCALE=1; | |
13183 | HAVE_FREELOCALE=1; | |
13184 | REPLACE_LOCALECONV=0; | |
13185 | REPLACE_SETLOCALE=0; | |
13186 | REPLACE_NEWLOCALE=0; | |
13187 | REPLACE_DUPLOCALE=0; | |
13188 | REPLACE_FREELOCALE=0; | |
13189 | REPLACE_STRUCT_LCONV=0; | |
13190 | ||
13191 | ||
13192 | REPLACE_NULL=0; | |
13193 | HAVE_MAX_ALIGN_T=1; | |
13194 | HAVE_WCHAR_T=1; | |
13195 | ||
13196 | ||
13197 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 | |
13198 | $as_echo_n "checking for wchar_t... " >&6; } | |
13199 | if ${gt_cv_c_wchar_t+:} false; then : | |
13200 | $as_echo_n "(cached) " >&6 | |
13201 | else | |
13202 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13203 | /* end confdefs.h. */ | |
13204 | #include <stddef.h> | |
13205 | wchar_t foo = (wchar_t)'\0'; | |
13206 | int | |
13207 | main () | |
13208 | { | |
13209 | ||
13210 | ; | |
13211 | return 0; | |
13212 | } | |
13213 | _ACEOF | |
13214 | if ac_fn_c_try_compile "$LINENO"; then : | |
13215 | gt_cv_c_wchar_t=yes | |
13216 | else | |
13217 | gt_cv_c_wchar_t=no | |
13218 | fi | |
13219 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
13220 | fi | |
13221 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 | |
13222 | $as_echo "$gt_cv_c_wchar_t" >&6; } | |
13223 | if test $gt_cv_c_wchar_t = yes; then | |
13224 | ||
13225 | $as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h | |
13226 | ||
13227 | fi | |
13228 | ||
13229 | ||
13230 | ||
13231 | ||
13232 | STDDEF_H= | |
13233 | ||
13234 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5 | |
13235 | $as_echo_n "checking for good max_align_t... " >&6; } | |
13236 | if ${gl_cv_type_max_align_t+:} false; then : | |
13237 | $as_echo_n "(cached) " >&6 | |
13238 | else | |
13239 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13240 | /* end confdefs.h. */ | |
13241 | #include <stddef.h> | |
13242 | unsigned int s = sizeof (max_align_t); | |
13243 | #if defined __GNUC__ || defined __IBM__ALIGNOF__ | |
13244 | int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; | |
13245 | int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; | |
13246 | #endif | |
13247 | ||
13248 | int | |
13249 | main () | |
13250 | { | |
c0c3707f | 13251 | |
6ec2e0f5 SDJ |
13252 | ; |
13253 | return 0; | |
13254 | } | |
13255 | _ACEOF | |
13256 | if ac_fn_c_try_compile "$LINENO"; then : | |
5df4cba6 | 13257 | gl_cv_type_max_align_t=yes |
6ec2e0f5 | 13258 | else |
5df4cba6 | 13259 | gl_cv_type_max_align_t=no |
6ec2e0f5 | 13260 | fi |
c0c3707f | 13261 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
6ec2e0f5 | 13262 | |
c0c3707f | 13263 | fi |
5df4cba6 SM |
13264 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5 |
13265 | $as_echo "$gl_cv_type_max_align_t" >&6; } | |
13266 | if test $gl_cv_type_max_align_t = no; then | |
13267 | HAVE_MAX_ALIGN_T=0 | |
13268 | STDDEF_H=stddef.h | |
13269 | fi | |
13270 | ||
13271 | if test $gt_cv_c_wchar_t = no; then | |
13272 | HAVE_WCHAR_T=0 | |
13273 | STDDEF_H=stddef.h | |
13274 | fi | |
13275 | ||
13276 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 | |
13277 | $as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; } | |
13278 | if ${gl_cv_decl_null_works+:} false; then : | |
13279 | $as_echo_n "(cached) " >&6 | |
c0c3707f CB |
13280 | else |
13281 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13282 | /* end confdefs.h. */ | |
5df4cba6 SM |
13283 | #include <stddef.h> |
13284 | int test[2 * (sizeof NULL == sizeof (void *)) -1]; | |
13285 | ||
c0c3707f CB |
13286 | int |
13287 | main () | |
13288 | { | |
6ec2e0f5 | 13289 | |
c0c3707f CB |
13290 | ; |
13291 | return 0; | |
13292 | } | |
13293 | _ACEOF | |
5df4cba6 SM |
13294 | if ac_fn_c_try_compile "$LINENO"; then : |
13295 | gl_cv_decl_null_works=yes | |
c0c3707f | 13296 | else |
5df4cba6 | 13297 | gl_cv_decl_null_works=no |
c0c3707f | 13298 | fi |
5df4cba6 | 13299 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
c0c3707f | 13300 | fi |
5df4cba6 SM |
13301 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 |
13302 | $as_echo "$gl_cv_decl_null_works" >&6; } | |
13303 | if test $gl_cv_decl_null_works = no; then | |
13304 | REPLACE_NULL=1 | |
13305 | STDDEF_H=stddef.h | |
13306 | fi | |
6ec2e0f5 | 13307 | |
5df4cba6 SM |
13308 | |
13309 | if test -n "$STDDEF_H"; then | |
13310 | GL_GENERATE_STDDEF_H_TRUE= | |
13311 | GL_GENERATE_STDDEF_H_FALSE='#' | |
13312 | else | |
13313 | GL_GENERATE_STDDEF_H_TRUE='#' | |
13314 | GL_GENERATE_STDDEF_H_FALSE= | |
c0c3707f | 13315 | fi |
6ec2e0f5 | 13316 | |
5df4cba6 | 13317 | if test -n "$STDDEF_H"; then |
6ec2e0f5 | 13318 | |
472fa5ee SM |
13319 | |
13320 | ||
5e8754f9 SDJ |
13321 | |
13322 | ||
5df4cba6 SM |
13323 | |
13324 | ||
13325 | ||
13326 | if test $gl_cv_have_include_next = yes; then | |
13327 | gl_cv_next_stddef_h='<'stddef.h'>' | |
13328 | else | |
13329 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5 | |
13330 | $as_echo_n "checking absolute name of <stddef.h>... " >&6; } | |
13331 | if ${gl_cv_next_stddef_h+:} false; then : | |
13332 | $as_echo_n "(cached) " >&6 | |
c0c3707f | 13333 | else |
5df4cba6 SM |
13334 | |
13335 | ||
13336 | ||
c0c3707f CB |
13337 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
13338 | /* end confdefs.h. */ | |
c0c3707f | 13339 | #include <stddef.h> |
c0c3707f | 13340 | _ACEOF |
5df4cba6 SM |
13341 | case "$host_os" in |
13342 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
13343 | *) gl_absname_cpp="$ac_cpp" ;; | |
13344 | esac | |
13345 | ||
13346 | case "$host_os" in | |
13347 | mingw*) | |
13348 | gl_dirsep_regex='[/\\]' | |
13349 | ;; | |
13350 | *) | |
13351 | gl_dirsep_regex='\/' | |
13352 | ;; | |
13353 | esac | |
13354 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
13355 | gl_header_literal_regex=`echo 'stddef.h' \ | |
13356 | | sed -e "$gl_make_literal_regex_sed"` | |
13357 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
13358 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
13359 | s|^/[^/]|//&| | |
13360 | p | |
13361 | q | |
13362 | }' | |
13363 | ||
13364 | gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
13365 | sed -n "$gl_absolute_header_sed"` | |
13366 | ||
13367 | gl_header=$gl_cv_absolute_stddef_h | |
13368 | gl_cv_next_stddef_h='"'$gl_header'"' | |
5e8754f9 SDJ |
13369 | |
13370 | ||
c0c3707f | 13371 | fi |
5df4cba6 SM |
13372 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 |
13373 | $as_echo "$gl_cv_next_stddef_h" >&6; } | |
13374 | fi | |
13375 | NEXT_STDDEF_H=$gl_cv_next_stddef_h | |
13376 | ||
13377 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
13378 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
13379 | gl_next_as_first_directive='<'stddef.h'>' | |
13380 | else | |
13381 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
13382 | gl_next_as_first_directive=$gl_cv_next_stddef_h | |
13383 | fi | |
13384 | NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive | |
5e8754f9 SDJ |
13385 | |
13386 | ||
13387 | ||
13388 | ||
5df4cba6 | 13389 | fi |
5e8754f9 SDJ |
13390 | |
13391 | ||
13392 | ||
13393 | ||
13394 | ||
13395 | ||
5df4cba6 SM |
13396 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5 |
13397 | $as_echo_n "checking whether locale.h defines locale_t... " >&6; } | |
13398 | if ${gl_cv_header_locale_has_locale_t+:} false; then : | |
13399 | $as_echo_n "(cached) " >&6 | |
13400 | else | |
13401 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 13402 | /* end confdefs.h. */ |
5df4cba6 SM |
13403 | #include <locale.h> |
13404 | locale_t x; | |
c0c3707f CB |
13405 | int |
13406 | main () | |
13407 | { | |
5e8754f9 | 13408 | |
c0c3707f CB |
13409 | ; |
13410 | return 0; | |
13411 | } | |
13412 | _ACEOF | |
13413 | if ac_fn_c_try_compile "$LINENO"; then : | |
5df4cba6 | 13414 | gl_cv_header_locale_has_locale_t=yes |
c0c3707f | 13415 | else |
5df4cba6 | 13416 | gl_cv_header_locale_has_locale_t=no |
c0c3707f CB |
13417 | fi |
13418 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5df4cba6 | 13419 | |
c0c3707f | 13420 | fi |
5df4cba6 SM |
13421 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5 |
13422 | $as_echo "$gl_cv_header_locale_has_locale_t" >&6; } | |
13423 | ||
13424 | ||
13425 | if test $ac_cv_header_xlocale_h = yes; then | |
13426 | HAVE_XLOCALE_H=1 | |
13427 | if test $gl_cv_header_locale_has_locale_t = yes; then | |
13428 | gl_cv_header_locale_h_needs_xlocale_h=no | |
13429 | else | |
13430 | gl_cv_header_locale_h_needs_xlocale_h=yes | |
c0c3707f | 13431 | fi |
5df4cba6 SM |
13432 | HAVE_LOCALE_T=1 |
13433 | else | |
13434 | HAVE_XLOCALE_H=0 | |
13435 | gl_cv_header_locale_h_needs_xlocale_h=no | |
13436 | if test $gl_cv_header_locale_has_locale_t = yes; then | |
13437 | HAVE_LOCALE_T=1 | |
13438 | else | |
13439 | HAVE_LOCALE_T=0 | |
13440 | fi | |
13441 | fi | |
13442 | ||
13443 | ||
5e8754f9 | 13444 | |
5df4cba6 SM |
13445 | |
13446 | gl_threads_api=none | |
13447 | LIBTHREAD= | |
13448 | LTLIBTHREAD= | |
13449 | LIBMULTITHREAD= | |
13450 | LTLIBMULTITHREAD= | |
13451 | if test "$gl_use_threads" != no; then | |
13452 | ||
13453 | ||
13454 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 | |
13455 | $as_echo_n "checking whether imported symbols can be declared weak... " >&6; } | |
13456 | if ${gl_cv_have_weak+:} false; then : | |
13457 | $as_echo_n "(cached) " >&6 | |
13458 | else | |
13459 | gl_cv_have_weak=no | |
13460 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13461 | /* end confdefs.h. */ | |
13462 | extern void xyzzy (); | |
13463 | #pragma weak xyzzy | |
c0c3707f CB |
13464 | int |
13465 | main () | |
13466 | { | |
5df4cba6 | 13467 | xyzzy(); |
c0c3707f CB |
13468 | ; |
13469 | return 0; | |
13470 | } | |
13471 | _ACEOF | |
5df4cba6 SM |
13472 | if ac_fn_c_try_link "$LINENO"; then : |
13473 | gl_cv_have_weak=maybe | |
13474 | fi | |
13475 | rm -f core conftest.err conftest.$ac_objext \ | |
13476 | conftest$ac_exeext conftest.$ac_ext | |
13477 | if test $gl_cv_have_weak = maybe; then | |
13478 | if test "$cross_compiling" = yes; then : | |
13479 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 13480 | /* end confdefs.h. */ |
5df4cba6 SM |
13481 | #ifdef __ELF__ |
13482 | Extensible Linking Format | |
13483 | #endif | |
5e8754f9 | 13484 | |
5df4cba6 SM |
13485 | _ACEOF |
13486 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
13487 | $EGREP "Extensible Linking Format" >/dev/null 2>&1; then : | |
13488 | gl_cv_have_weak="guessing yes" | |
13489 | else | |
13490 | gl_cv_have_weak="guessing no" | |
13491 | fi | |
13492 | rm -f conftest* | |
5e8754f9 | 13493 | |
5df4cba6 SM |
13494 | |
13495 | else | |
13496 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13497 | /* end confdefs.h. */ | |
13498 | ||
13499 | #include <stdio.h> | |
13500 | #pragma weak fputs | |
13501 | int main () | |
13502 | { | |
13503 | return (fputs == NULL); | |
c0c3707f CB |
13504 | } |
13505 | _ACEOF | |
5df4cba6 SM |
13506 | if ac_fn_c_try_run "$LINENO"; then : |
13507 | gl_cv_have_weak=yes | |
c0c3707f | 13508 | else |
5df4cba6 | 13509 | gl_cv_have_weak=no |
c0c3707f | 13510 | fi |
5df4cba6 SM |
13511 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
13512 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c0c3707f | 13513 | fi |
5df4cba6 SM |
13514 | |
13515 | fi | |
13516 | case " $LDFLAGS " in | |
13517 | *" -static "*) gl_cv_have_weak=no ;; | |
13518 | esac | |
13519 | case "$gl_cv_have_weak" in | |
13520 | *yes) | |
13521 | case "$host_os" in | |
13522 | freebsd* | dragonfly*) | |
13523 | : > conftest1.c | |
13524 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1 | |
13525 | cat <<EOF > conftest2.c | |
13526 | #include <pthread.h> | |
13527 | #pragma weak pthread_mutexattr_gettype | |
13528 | int main () | |
13529 | { | |
13530 | return (pthread_mutexattr_gettype != NULL); | |
13531 | } | |
13532 | EOF | |
13533 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \ | |
13534 | || gl_cv_have_weak=no | |
13535 | rm -f conftest1.c libempty.so conftest2.c conftest | |
13536 | ;; | |
13537 | esac | |
13538 | ;; | |
13539 | esac | |
13540 | ||
13541 | fi | |
13542 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 | |
13543 | $as_echo "$gl_cv_have_weak" >&6; } | |
13544 | case "$gl_cv_have_weak" in | |
13545 | *yes) | |
13546 | ||
13547 | $as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h | |
13548 | ||
13549 | ;; | |
13550 | esac | |
13551 | ||
13552 | if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then | |
13553 | ||
13554 | : | |
c0c3707f | 13555 | fi |
5df4cba6 SM |
13556 | if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then |
13557 | ||
13558 | gl_have_isoc_threads="$ac_cv_header_threads_h" | |
13559 | fi | |
13560 | if test "$gl_use_threads" = yes \ | |
13561 | || test "$gl_use_threads" = posix \ | |
13562 | || test "$gl_use_threads" = isoc+posix; then | |
13563 | ||
13564 | ||
13565 | if test -z "$gl_pthreadlib_body_done"; then | |
13566 | gl_pthread_api=no | |
13567 | LIBPTHREAD= | |
13568 | LIBPMULTITHREAD= | |
13569 | # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that | |
13570 | # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY. | |
13571 | ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" | |
13572 | if test "x$ac_cv_header_pthread_h" = xyes; then : | |
13573 | gl_have_pthread_h=yes | |
13574 | else | |
13575 | gl_have_pthread_h=no | |
13576 | fi | |
13577 | ||
13578 | ||
13579 | if test "$gl_have_pthread_h" = yes; then | |
13580 | # Other possible tests: | |
13581 | # -lpthreads (FSU threads, PCthreads) | |
13582 | # -lgthreads | |
13583 | # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist | |
13584 | # in libc. IRIX 6.5 has the first one in both libc and libpthread, but | |
13585 | # the second one only in libpthread, and lock.c needs it. | |
13586 | # | |
13587 | # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 | |
13588 | # needs -pthread for some reason. See: | |
13589 | # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html | |
13590 | save_LIBS=$LIBS | |
13591 | for gl_pthread in '' '-pthread'; do | |
13592 | LIBS="$LIBS $gl_pthread" | |
13593 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13594 | /* end confdefs.h. */ | |
13595 | #include <pthread.h> | |
13596 | pthread_mutex_t m; | |
13597 | pthread_mutexattr_t ma; | |
5e8754f9 | 13598 | |
c0c3707f CB |
13599 | int |
13600 | main () | |
13601 | { | |
5df4cba6 SM |
13602 | pthread_mutex_lock (&m); |
13603 | pthread_mutexattr_init (&ma); | |
c0c3707f CB |
13604 | ; |
13605 | return 0; | |
13606 | } | |
13607 | _ACEOF | |
5df4cba6 SM |
13608 | if ac_fn_c_try_link "$LINENO"; then : |
13609 | gl_pthread_api=yes | |
13610 | LIBPTHREAD=$gl_pthread | |
13611 | LIBPMULTITHREAD=$gl_pthread | |
c0c3707f | 13612 | fi |
5df4cba6 SM |
13613 | rm -f core conftest.err conftest.$ac_objext \ |
13614 | conftest$ac_exeext conftest.$ac_ext | |
13615 | LIBS=$save_LIBS | |
13616 | test $gl_pthread_api = yes && break | |
13617 | done | |
13618 | ||
13619 | # Test for libpthread by looking for pthread_kill. (Not pthread_self, | |
13620 | # since it is defined as a macro on OSF/1.) | |
13621 | if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then | |
13622 | # The program links fine without libpthread. But it may actually | |
13623 | # need to link with libpthread in order to create multiple threads. | |
13624 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
13625 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
13626 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
13627 | $as_echo_n "(cached) " >&6 | |
c0c3707f | 13628 | else |
5df4cba6 SM |
13629 | ac_check_lib_save_LIBS=$LIBS |
13630 | LIBS="-lpthread $LIBS" | |
13631 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 13632 | /* end confdefs.h. */ |
5df4cba6 SM |
13633 | |
13634 | /* Override any GCC internal prototype to avoid an error. | |
13635 | Use char because int might match the return type of a GCC | |
13636 | builtin and then its argument prototype would still apply. */ | |
13637 | #ifdef __cplusplus | |
13638 | extern "C" | |
13639 | #endif | |
13640 | char pthread_kill (); | |
c0c3707f CB |
13641 | int |
13642 | main () | |
13643 | { | |
5df4cba6 | 13644 | return pthread_kill (); |
c0c3707f CB |
13645 | ; |
13646 | return 0; | |
13647 | } | |
13648 | _ACEOF | |
5df4cba6 SM |
13649 | if ac_fn_c_try_link "$LINENO"; then : |
13650 | ac_cv_lib_pthread_pthread_kill=yes | |
6ec2e0f5 | 13651 | else |
5df4cba6 | 13652 | ac_cv_lib_pthread_pthread_kill=no |
6ec2e0f5 | 13653 | fi |
5df4cba6 SM |
13654 | rm -f core conftest.err conftest.$ac_objext \ |
13655 | conftest$ac_exeext conftest.$ac_ext | |
13656 | LIBS=$ac_check_lib_save_LIBS | |
c0c3707f | 13657 | fi |
5df4cba6 SM |
13658 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 |
13659 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
13660 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
13661 | LIBPMULTITHREAD=-lpthread | |
13662 | # On Solaris and HP-UX, most pthread functions exist also in libc. | |
13663 | # Therefore pthread_in_use() needs to actually try to create a | |
13664 | # thread: pthread_create from libc will fail, whereas | |
13665 | # pthread_create will actually create a thread. | |
13666 | # On Solaris 10 or newer, this test is no longer needed, because | |
13667 | # libc contains the fully functional pthread functions. | |
13668 | case "$host_os" in | |
13669 | solaris | solaris2.1-9 | solaris2.1-9.* | hpux*) | |
472fa5ee | 13670 | |
5df4cba6 | 13671 | $as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h |
472fa5ee | 13672 | |
5df4cba6 | 13673 | esac |
472fa5ee | 13674 | |
5df4cba6 | 13675 | fi |
472fa5ee | 13676 | |
5df4cba6 SM |
13677 | elif test $gl_pthread_api != yes; then |
13678 | # Some library is needed. Try libpthread and libc_r. | |
13679 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
13680 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
13681 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
c0c3707f CB |
13682 | $as_echo_n "(cached) " >&6 |
13683 | else | |
5df4cba6 SM |
13684 | ac_check_lib_save_LIBS=$LIBS |
13685 | LIBS="-lpthread $LIBS" | |
13686 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 13687 | /* end confdefs.h. */ |
5df4cba6 SM |
13688 | |
13689 | /* Override any GCC internal prototype to avoid an error. | |
13690 | Use char because int might match the return type of a GCC | |
13691 | builtin and then its argument prototype would still apply. */ | |
13692 | #ifdef __cplusplus | |
13693 | extern "C" | |
13694 | #endif | |
13695 | char pthread_kill (); | |
c0c3707f CB |
13696 | int |
13697 | main () | |
13698 | { | |
5df4cba6 | 13699 | return pthread_kill (); |
c0c3707f CB |
13700 | ; |
13701 | return 0; | |
13702 | } | |
13703 | _ACEOF | |
13704 | if ac_fn_c_try_link "$LINENO"; then : | |
5df4cba6 | 13705 | ac_cv_lib_pthread_pthread_kill=yes |
c0c3707f | 13706 | else |
5df4cba6 | 13707 | ac_cv_lib_pthread_pthread_kill=no |
c0c3707f CB |
13708 | fi |
13709 | rm -f core conftest.err conftest.$ac_objext \ | |
13710 | conftest$ac_exeext conftest.$ac_ext | |
5df4cba6 SM |
13711 | LIBS=$ac_check_lib_save_LIBS |
13712 | fi | |
13713 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 | |
13714 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
13715 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
13716 | gl_pthread_api=yes | |
13717 | LIBPTHREAD=-lpthread | |
13718 | LIBPMULTITHREAD=-lpthread | |
c0c3707f | 13719 | fi |
472fa5ee | 13720 | |
5df4cba6 SM |
13721 | if test $gl_pthread_api != yes; then |
13722 | # For FreeBSD 4. | |
13723 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5 | |
13724 | $as_echo_n "checking for pthread_kill in -lc_r... " >&6; } | |
13725 | if ${ac_cv_lib_c_r_pthread_kill+:} false; then : | |
13726 | $as_echo_n "(cached) " >&6 | |
13727 | else | |
13728 | ac_check_lib_save_LIBS=$LIBS | |
13729 | LIBS="-lc_r $LIBS" | |
13730 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13731 | /* end confdefs.h. */ | |
472fa5ee | 13732 | |
5df4cba6 SM |
13733 | /* Override any GCC internal prototype to avoid an error. |
13734 | Use char because int might match the return type of a GCC | |
13735 | builtin and then its argument prototype would still apply. */ | |
13736 | #ifdef __cplusplus | |
13737 | extern "C" | |
13738 | #endif | |
13739 | char pthread_kill (); | |
13740 | int | |
13741 | main () | |
13742 | { | |
13743 | return pthread_kill (); | |
13744 | ; | |
13745 | return 0; | |
13746 | } | |
13747 | _ACEOF | |
13748 | if ac_fn_c_try_link "$LINENO"; then : | |
13749 | ac_cv_lib_c_r_pthread_kill=yes | |
13750 | else | |
13751 | ac_cv_lib_c_r_pthread_kill=no | |
13752 | fi | |
13753 | rm -f core conftest.err conftest.$ac_objext \ | |
13754 | conftest$ac_exeext conftest.$ac_ext | |
13755 | LIBS=$ac_check_lib_save_LIBS | |
13756 | fi | |
13757 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5 | |
13758 | $as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; } | |
13759 | if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then : | |
13760 | gl_pthread_api=yes | |
13761 | LIBPTHREAD=-lc_r | |
13762 | LIBPMULTITHREAD=-lc_r | |
13763 | fi | |
6ec2e0f5 | 13764 | |
5df4cba6 SM |
13765 | fi |
13766 | fi | |
13767 | fi | |
13768 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 | |
13769 | $as_echo_n "checking whether POSIX threads API is available... " >&6; } | |
13770 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5 | |
13771 | $as_echo "$gl_pthread_api" >&6; } | |
472fa5ee SM |
13772 | |
13773 | ||
5df4cba6 | 13774 | if test $gl_pthread_api = yes; then |
472fa5ee | 13775 | |
5df4cba6 | 13776 | $as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h |
472fa5ee | 13777 | |
5df4cba6 | 13778 | fi |
472fa5ee | 13779 | |
5df4cba6 | 13780 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
c0c3707f | 13781 | /* end confdefs.h. */ |
5df4cba6 | 13782 | #include <sched.h> |
c0c3707f CB |
13783 | int |
13784 | main () | |
13785 | { | |
5df4cba6 | 13786 | sched_yield (); |
c0c3707f CB |
13787 | ; |
13788 | return 0; | |
13789 | } | |
13790 | _ACEOF | |
13791 | if ac_fn_c_try_link "$LINENO"; then : | |
5df4cba6 | 13792 | LIB_SCHED_YIELD= |
6ec2e0f5 | 13793 | |
c0c3707f | 13794 | else |
5df4cba6 SM |
13795 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 |
13796 | $as_echo_n "checking for sched_yield in -lrt... " >&6; } | |
13797 | if ${ac_cv_lib_rt_sched_yield+:} false; then : | |
13798 | $as_echo_n "(cached) " >&6 | |
c0c3707f | 13799 | else |
5df4cba6 SM |
13800 | ac_check_lib_save_LIBS=$LIBS |
13801 | LIBS="-lrt $LIBS" | |
13802 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 13803 | /* end confdefs.h. */ |
6ec2e0f5 | 13804 | |
5df4cba6 SM |
13805 | /* Override any GCC internal prototype to avoid an error. |
13806 | Use char because int might match the return type of a GCC | |
13807 | builtin and then its argument prototype would still apply. */ | |
13808 | #ifdef __cplusplus | |
13809 | extern "C" | |
13810 | #endif | |
13811 | char sched_yield (); | |
13812 | int | |
13813 | main () | |
c0c3707f | 13814 | { |
5df4cba6 SM |
13815 | return sched_yield (); |
13816 | ; | |
13817 | return 0; | |
c0c3707f | 13818 | } |
6ec2e0f5 | 13819 | _ACEOF |
5df4cba6 SM |
13820 | if ac_fn_c_try_link "$LINENO"; then : |
13821 | ac_cv_lib_rt_sched_yield=yes | |
c0c3707f | 13822 | else |
5df4cba6 | 13823 | ac_cv_lib_rt_sched_yield=no |
6ec2e0f5 | 13824 | fi |
5df4cba6 SM |
13825 | rm -f core conftest.err conftest.$ac_objext \ |
13826 | conftest$ac_exeext conftest.$ac_ext | |
13827 | LIBS=$ac_check_lib_save_LIBS | |
6ec2e0f5 | 13828 | fi |
5df4cba6 SM |
13829 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 |
13830 | $as_echo "$ac_cv_lib_rt_sched_yield" >&6; } | |
13831 | if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : | |
13832 | LIB_SCHED_YIELD=-lrt | |
13833 | else | |
13834 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5 | |
13835 | $as_echo_n "checking for sched_yield in -lposix4... " >&6; } | |
13836 | if ${ac_cv_lib_posix4_sched_yield+:} false; then : | |
13837 | $as_echo_n "(cached) " >&6 | |
13838 | else | |
13839 | ac_check_lib_save_LIBS=$LIBS | |
13840 | LIBS="-lposix4 $LIBS" | |
13841 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c0c3707f | 13842 | /* end confdefs.h. */ |
6ec2e0f5 | 13843 | |
5df4cba6 SM |
13844 | /* Override any GCC internal prototype to avoid an error. |
13845 | Use char because int might match the return type of a GCC | |
13846 | builtin and then its argument prototype would still apply. */ | |
13847 | #ifdef __cplusplus | |
13848 | extern "C" | |
13849 | #endif | |
13850 | char sched_yield (); | |
c0c3707f CB |
13851 | int |
13852 | main () | |
13853 | { | |
5df4cba6 | 13854 | return sched_yield (); |
c0c3707f CB |
13855 | ; |
13856 | return 0; | |
13857 | } | |
13858 | _ACEOF | |
13859 | if ac_fn_c_try_link "$LINENO"; then : | |
5df4cba6 SM |
13860 | ac_cv_lib_posix4_sched_yield=yes |
13861 | else | |
13862 | ac_cv_lib_posix4_sched_yield=no | |
c0c3707f CB |
13863 | fi |
13864 | rm -f core conftest.err conftest.$ac_objext \ | |
13865 | conftest$ac_exeext conftest.$ac_ext | |
5df4cba6 SM |
13866 | LIBS=$ac_check_lib_save_LIBS |
13867 | fi | |
13868 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5 | |
13869 | $as_echo "$ac_cv_lib_posix4_sched_yield" >&6; } | |
13870 | if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then : | |
13871 | LIB_SCHED_YIELD=-lposix4 | |
13872 | fi | |
13873 | ||
13874 | fi | |
13875 | ||
13876 | ||
13877 | fi | |
13878 | rm -f core conftest.err conftest.$ac_objext \ | |
13879 | conftest$ac_exeext conftest.$ac_ext | |
13880 | ||
13881 | ||
13882 | gl_pthreadlib_body_done=done | |
13883 | fi | |
13884 | ||
13885 | LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD | |
13886 | LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD | |
13887 | if test $gl_pthread_api = yes; then | |
13888 | if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then | |
13889 | gl_threads_api='isoc+posix' | |
13890 | ||
13891 | $as_echo "#define USE_ISOC_AND_POSIX_THREADS 1" >>confdefs.h | |
13892 | ||
13893 | LIBTHREAD= LTLIBTHREAD= | |
13894 | else | |
13895 | gl_threads_api=posix | |
13896 | ||
13897 | $as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h | |
13898 | ||
13899 | if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then | |
13900 | if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then | |
13901 | ||
13902 | $as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h | |
13903 | ||
13904 | LIBTHREAD= LTLIBTHREAD= | |
13905 | fi | |
13906 | fi | |
13907 | fi | |
c0c3707f CB |
13908 | fi |
13909 | fi | |
5df4cba6 SM |
13910 | if test $gl_threads_api = none; then |
13911 | if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then | |
13912 | ||
13913 | ||
13914 | ||
13915 | if test -z "$gl_stdthreadlib_body_done"; then | |
13916 | ||
13917 | ||
13918 | case "$host_os" in | |
13919 | mingw*) | |
13920 | LIBSTDTHREAD= | |
13921 | ;; | |
13922 | *) | |
c0c3707f CB |
13923 | |
13924 | ||
5df4cba6 | 13925 | if test -z "$gl_pthreadlib_body_done"; then |
c0c3707f CB |
13926 | gl_pthread_api=no |
13927 | LIBPTHREAD= | |
13928 | LIBPMULTITHREAD= | |
13929 | # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that | |
13930 | # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY. | |
13931 | ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" | |
13932 | if test "x$ac_cv_header_pthread_h" = xyes; then : | |
13933 | gl_have_pthread_h=yes | |
13934 | else | |
13935 | gl_have_pthread_h=no | |
13936 | fi | |
6ec2e0f5 | 13937 | |
6ec2e0f5 | 13938 | |
c0c3707f CB |
13939 | if test "$gl_have_pthread_h" = yes; then |
13940 | # Other possible tests: | |
13941 | # -lpthreads (FSU threads, PCthreads) | |
13942 | # -lgthreads | |
13943 | # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist | |
13944 | # in libc. IRIX 6.5 has the first one in both libc and libpthread, but | |
13945 | # the second one only in libpthread, and lock.c needs it. | |
13946 | # | |
13947 | # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 | |
13948 | # needs -pthread for some reason. See: | |
13949 | # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html | |
13950 | save_LIBS=$LIBS | |
13951 | for gl_pthread in '' '-pthread'; do | |
13952 | LIBS="$LIBS $gl_pthread" | |
13953 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13954 | /* end confdefs.h. */ | |
13955 | #include <pthread.h> | |
13956 | pthread_mutex_t m; | |
13957 | pthread_mutexattr_t ma; | |
6ec2e0f5 | 13958 | |
c0c3707f CB |
13959 | int |
13960 | main () | |
13961 | { | |
13962 | pthread_mutex_lock (&m); | |
13963 | pthread_mutexattr_init (&ma); | |
13964 | ; | |
13965 | return 0; | |
13966 | } | |
6ec2e0f5 | 13967 | _ACEOF |
c0c3707f CB |
13968 | if ac_fn_c_try_link "$LINENO"; then : |
13969 | gl_pthread_api=yes | |
13970 | LIBPTHREAD=$gl_pthread | |
13971 | LIBPMULTITHREAD=$gl_pthread | |
6ec2e0f5 | 13972 | fi |
c0c3707f CB |
13973 | rm -f core conftest.err conftest.$ac_objext \ |
13974 | conftest$ac_exeext conftest.$ac_ext | |
13975 | LIBS=$save_LIBS | |
13976 | test $gl_pthread_api = yes && break | |
13977 | done | |
6ec2e0f5 | 13978 | |
c0c3707f CB |
13979 | # Test for libpthread by looking for pthread_kill. (Not pthread_self, |
13980 | # since it is defined as a macro on OSF/1.) | |
13981 | if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then | |
13982 | # The program links fine without libpthread. But it may actually | |
13983 | # need to link with libpthread in order to create multiple threads. | |
13984 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
13985 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
13986 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
6ec2e0f5 SDJ |
13987 | $as_echo_n "(cached) " >&6 |
13988 | else | |
c0c3707f | 13989 | ac_check_lib_save_LIBS=$LIBS |
5df4cba6 SM |
13990 | LIBS="-lpthread $LIBS" |
13991 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
13992 | /* end confdefs.h. */ | |
13993 | ||
13994 | /* Override any GCC internal prototype to avoid an error. | |
13995 | Use char because int might match the return type of a GCC | |
13996 | builtin and then its argument prototype would still apply. */ | |
13997 | #ifdef __cplusplus | |
13998 | extern "C" | |
13999 | #endif | |
14000 | char pthread_kill (); | |
14001 | int | |
14002 | main () | |
14003 | { | |
14004 | return pthread_kill (); | |
14005 | ; | |
14006 | return 0; | |
14007 | } | |
14008 | _ACEOF | |
14009 | if ac_fn_c_try_link "$LINENO"; then : | |
14010 | ac_cv_lib_pthread_pthread_kill=yes | |
14011 | else | |
14012 | ac_cv_lib_pthread_pthread_kill=no | |
14013 | fi | |
14014 | rm -f core conftest.err conftest.$ac_objext \ | |
14015 | conftest$ac_exeext conftest.$ac_ext | |
14016 | LIBS=$ac_check_lib_save_LIBS | |
14017 | fi | |
14018 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 | |
14019 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
14020 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
14021 | LIBPMULTITHREAD=-lpthread | |
14022 | # On Solaris and HP-UX, most pthread functions exist also in libc. | |
14023 | # Therefore pthread_in_use() needs to actually try to create a | |
14024 | # thread: pthread_create from libc will fail, whereas | |
14025 | # pthread_create will actually create a thread. | |
14026 | # On Solaris 10 or newer, this test is no longer needed, because | |
14027 | # libc contains the fully functional pthread functions. | |
14028 | case "$host_os" in | |
14029 | solaris | solaris2.1-9 | solaris2.1-9.* | hpux*) | |
14030 | ||
14031 | $as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h | |
14032 | ||
14033 | esac | |
14034 | ||
14035 | fi | |
14036 | ||
14037 | elif test $gl_pthread_api != yes; then | |
14038 | # Some library is needed. Try libpthread and libc_r. | |
14039 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 | |
14040 | $as_echo_n "checking for pthread_kill in -lpthread... " >&6; } | |
14041 | if ${ac_cv_lib_pthread_pthread_kill+:} false; then : | |
14042 | $as_echo_n "(cached) " >&6 | |
14043 | else | |
14044 | ac_check_lib_save_LIBS=$LIBS | |
14045 | LIBS="-lpthread $LIBS" | |
14046 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14047 | /* end confdefs.h. */ | |
14048 | ||
14049 | /* Override any GCC internal prototype to avoid an error. | |
14050 | Use char because int might match the return type of a GCC | |
14051 | builtin and then its argument prototype would still apply. */ | |
14052 | #ifdef __cplusplus | |
14053 | extern "C" | |
14054 | #endif | |
14055 | char pthread_kill (); | |
14056 | int | |
14057 | main () | |
14058 | { | |
14059 | return pthread_kill (); | |
14060 | ; | |
14061 | return 0; | |
14062 | } | |
14063 | _ACEOF | |
14064 | if ac_fn_c_try_link "$LINENO"; then : | |
14065 | ac_cv_lib_pthread_pthread_kill=yes | |
14066 | else | |
14067 | ac_cv_lib_pthread_pthread_kill=no | |
14068 | fi | |
14069 | rm -f core conftest.err conftest.$ac_objext \ | |
14070 | conftest$ac_exeext conftest.$ac_ext | |
14071 | LIBS=$ac_check_lib_save_LIBS | |
14072 | fi | |
14073 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 | |
14074 | $as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } | |
14075 | if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : | |
14076 | gl_pthread_api=yes | |
14077 | LIBPTHREAD=-lpthread | |
14078 | LIBPMULTITHREAD=-lpthread | |
14079 | fi | |
14080 | ||
14081 | if test $gl_pthread_api != yes; then | |
14082 | # For FreeBSD 4. | |
14083 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5 | |
14084 | $as_echo_n "checking for pthread_kill in -lc_r... " >&6; } | |
14085 | if ${ac_cv_lib_c_r_pthread_kill+:} false; then : | |
14086 | $as_echo_n "(cached) " >&6 | |
14087 | else | |
14088 | ac_check_lib_save_LIBS=$LIBS | |
14089 | LIBS="-lc_r $LIBS" | |
14090 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14091 | /* end confdefs.h. */ | |
14092 | ||
14093 | /* Override any GCC internal prototype to avoid an error. | |
14094 | Use char because int might match the return type of a GCC | |
14095 | builtin and then its argument prototype would still apply. */ | |
14096 | #ifdef __cplusplus | |
14097 | extern "C" | |
14098 | #endif | |
14099 | char pthread_kill (); | |
14100 | int | |
14101 | main () | |
14102 | { | |
14103 | return pthread_kill (); | |
14104 | ; | |
14105 | return 0; | |
14106 | } | |
14107 | _ACEOF | |
14108 | if ac_fn_c_try_link "$LINENO"; then : | |
14109 | ac_cv_lib_c_r_pthread_kill=yes | |
14110 | else | |
14111 | ac_cv_lib_c_r_pthread_kill=no | |
14112 | fi | |
14113 | rm -f core conftest.err conftest.$ac_objext \ | |
14114 | conftest$ac_exeext conftest.$ac_ext | |
14115 | LIBS=$ac_check_lib_save_LIBS | |
14116 | fi | |
14117 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5 | |
14118 | $as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; } | |
14119 | if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then : | |
14120 | gl_pthread_api=yes | |
14121 | LIBPTHREAD=-lc_r | |
14122 | LIBPMULTITHREAD=-lc_r | |
14123 | fi | |
14124 | ||
14125 | fi | |
14126 | fi | |
14127 | fi | |
14128 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 | |
14129 | $as_echo_n "checking whether POSIX threads API is available... " >&6; } | |
14130 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5 | |
14131 | $as_echo "$gl_pthread_api" >&6; } | |
14132 | ||
14133 | ||
14134 | if test $gl_pthread_api = yes; then | |
14135 | ||
14136 | $as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h | |
14137 | ||
14138 | fi | |
14139 | ||
14140 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14141 | /* end confdefs.h. */ | |
14142 | #include <sched.h> | |
14143 | int | |
14144 | main () | |
14145 | { | |
14146 | sched_yield (); | |
14147 | ; | |
14148 | return 0; | |
14149 | } | |
14150 | _ACEOF | |
14151 | if ac_fn_c_try_link "$LINENO"; then : | |
14152 | LIB_SCHED_YIELD= | |
14153 | ||
14154 | else | |
14155 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 | |
14156 | $as_echo_n "checking for sched_yield in -lrt... " >&6; } | |
14157 | if ${ac_cv_lib_rt_sched_yield+:} false; then : | |
14158 | $as_echo_n "(cached) " >&6 | |
14159 | else | |
14160 | ac_check_lib_save_LIBS=$LIBS | |
14161 | LIBS="-lrt $LIBS" | |
c0c3707f | 14162 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6ec2e0f5 | 14163 | /* end confdefs.h. */ |
6ec2e0f5 | 14164 | |
c0c3707f CB |
14165 | /* Override any GCC internal prototype to avoid an error. |
14166 | Use char because int might match the return type of a GCC | |
14167 | builtin and then its argument prototype would still apply. */ | |
14168 | #ifdef __cplusplus | |
14169 | extern "C" | |
14170 | #endif | |
5df4cba6 | 14171 | char sched_yield (); |
c0c3707f CB |
14172 | int |
14173 | main () | |
14174 | { | |
5df4cba6 | 14175 | return sched_yield (); |
c0c3707f CB |
14176 | ; |
14177 | return 0; | |
14178 | } | |
6ec2e0f5 | 14179 | _ACEOF |
c0c3707f | 14180 | if ac_fn_c_try_link "$LINENO"; then : |
5df4cba6 | 14181 | ac_cv_lib_rt_sched_yield=yes |
6ec2e0f5 | 14182 | else |
5df4cba6 | 14183 | ac_cv_lib_rt_sched_yield=no |
6ec2e0f5 | 14184 | fi |
c0c3707f CB |
14185 | rm -f core conftest.err conftest.$ac_objext \ |
14186 | conftest$ac_exeext conftest.$ac_ext | |
14187 | LIBS=$ac_check_lib_save_LIBS | |
6ec2e0f5 | 14188 | fi |
5df4cba6 SM |
14189 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 |
14190 | $as_echo "$ac_cv_lib_rt_sched_yield" >&6; } | |
14191 | if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : | |
14192 | LIB_SCHED_YIELD=-lrt | |
14193 | else | |
14194 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5 | |
14195 | $as_echo_n "checking for sched_yield in -lposix4... " >&6; } | |
14196 | if ${ac_cv_lib_posix4_sched_yield+:} false; then : | |
6ec2e0f5 SDJ |
14197 | $as_echo_n "(cached) " >&6 |
14198 | else | |
c0c3707f | 14199 | ac_check_lib_save_LIBS=$LIBS |
5df4cba6 | 14200 | LIBS="-lposix4 $LIBS" |
c0c3707f | 14201 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6ec2e0f5 SDJ |
14202 | /* end confdefs.h. */ |
14203 | ||
c0c3707f CB |
14204 | /* Override any GCC internal prototype to avoid an error. |
14205 | Use char because int might match the return type of a GCC | |
14206 | builtin and then its argument prototype would still apply. */ | |
14207 | #ifdef __cplusplus | |
14208 | extern "C" | |
14209 | #endif | |
5df4cba6 | 14210 | char sched_yield (); |
6ec2e0f5 SDJ |
14211 | int |
14212 | main () | |
14213 | { | |
5df4cba6 | 14214 | return sched_yield (); |
c0c3707f CB |
14215 | ; |
14216 | return 0; | |
14217 | } | |
14218 | _ACEOF | |
14219 | if ac_fn_c_try_link "$LINENO"; then : | |
5df4cba6 | 14220 | ac_cv_lib_posix4_sched_yield=yes |
c0c3707f | 14221 | else |
5df4cba6 | 14222 | ac_cv_lib_posix4_sched_yield=no |
c0c3707f CB |
14223 | fi |
14224 | rm -f core conftest.err conftest.$ac_objext \ | |
14225 | conftest$ac_exeext conftest.$ac_ext | |
14226 | LIBS=$ac_check_lib_save_LIBS | |
14227 | fi | |
5df4cba6 SM |
14228 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5 |
14229 | $as_echo "$ac_cv_lib_posix4_sched_yield" >&6; } | |
14230 | if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then : | |
14231 | LIB_SCHED_YIELD=-lposix4 | |
c0c3707f | 14232 | fi |
6ec2e0f5 | 14233 | |
5df4cba6 SM |
14234 | fi |
14235 | ||
14236 | ||
14237 | fi | |
14238 | rm -f core conftest.err conftest.$ac_objext \ | |
14239 | conftest$ac_exeext conftest.$ac_ext | |
14240 | ||
14241 | ||
14242 | gl_pthreadlib_body_done=done | |
14243 | fi | |
14244 | ||
14245 | if test $ac_cv_header_threads_h = yes; then | |
14246 | for ac_func in thrd_create | |
14247 | do : | |
14248 | ac_fn_c_check_func "$LINENO" "thrd_create" "ac_cv_func_thrd_create" | |
14249 | if test "x$ac_cv_func_thrd_create" = xyes; then : | |
14250 | cat >>confdefs.h <<_ACEOF | |
14251 | #define HAVE_THRD_CREATE 1 | |
14252 | _ACEOF | |
14253 | ||
14254 | fi | |
14255 | done | |
14256 | ||
14257 | if test $ac_cv_func_thrd_create = yes; then | |
14258 | LIBSTDTHREAD= | |
14259 | else | |
14260 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thrd_create in -lstdthreads" >&5 | |
14261 | $as_echo_n "checking for thrd_create in -lstdthreads... " >&6; } | |
14262 | if ${ac_cv_lib_stdthreads_thrd_create+:} false; then : | |
c0c3707f CB |
14263 | $as_echo_n "(cached) " >&6 |
14264 | else | |
14265 | ac_check_lib_save_LIBS=$LIBS | |
5df4cba6 | 14266 | LIBS="-lstdthreads $LIBS" |
c0c3707f CB |
14267 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
14268 | /* end confdefs.h. */ | |
6ec2e0f5 | 14269 | |
c0c3707f CB |
14270 | /* Override any GCC internal prototype to avoid an error. |
14271 | Use char because int might match the return type of a GCC | |
14272 | builtin and then its argument prototype would still apply. */ | |
14273 | #ifdef __cplusplus | |
14274 | extern "C" | |
14275 | #endif | |
5df4cba6 | 14276 | char thrd_create (); |
c0c3707f CB |
14277 | int |
14278 | main () | |
14279 | { | |
5df4cba6 | 14280 | return thrd_create (); |
6ec2e0f5 SDJ |
14281 | ; |
14282 | return 0; | |
14283 | } | |
14284 | _ACEOF | |
c0c3707f | 14285 | if ac_fn_c_try_link "$LINENO"; then : |
5df4cba6 | 14286 | ac_cv_lib_stdthreads_thrd_create=yes |
6ec2e0f5 | 14287 | else |
5df4cba6 | 14288 | ac_cv_lib_stdthreads_thrd_create=no |
6ec2e0f5 | 14289 | fi |
c0c3707f CB |
14290 | rm -f core conftest.err conftest.$ac_objext \ |
14291 | conftest$ac_exeext conftest.$ac_ext | |
14292 | LIBS=$ac_check_lib_save_LIBS | |
14293 | fi | |
5df4cba6 SM |
14294 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdthreads_thrd_create" >&5 |
14295 | $as_echo "$ac_cv_lib_stdthreads_thrd_create" >&6; } | |
14296 | if test "x$ac_cv_lib_stdthreads_thrd_create" = xyes; then : | |
6ec2e0f5 | 14297 | |
5df4cba6 | 14298 | LIBSTDTHREAD='-lstdthreads -lpthread' |
6ec2e0f5 | 14299 | |
5df4cba6 | 14300 | else |
6ec2e0f5 | 14301 | |
5df4cba6 | 14302 | LIBSTDTHREAD="$LIBPMULTITHREAD" |
6ec2e0f5 | 14303 | |
5df4cba6 | 14304 | fi |
6ec2e0f5 | 14305 | |
5df4cba6 | 14306 | fi |
c0c3707f | 14307 | else |
5df4cba6 SM |
14308 | LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD" |
14309 | fi | |
14310 | ;; | |
14311 | esac | |
c0c3707f | 14312 | |
c0c3707f | 14313 | |
5df4cba6 SM |
14314 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ISO C threads API is available" >&5 |
14315 | $as_echo_n "checking whether ISO C threads API is available... " >&6; } | |
14316 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_threads_h" >&5 | |
14317 | $as_echo "$ac_cv_header_threads_h" >&6; } | |
14318 | gl_stdthreadlib_body_done=done | |
14319 | fi | |
c0c3707f | 14320 | |
5df4cba6 SM |
14321 | LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD |
14322 | LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD | |
c0c3707f CB |
14323 | gl_threads_api=isoc |
14324 | ||
14325 | $as_echo "#define USE_ISOC_THREADS 1" >>confdefs.h | |
14326 | ||
14327 | fi | |
14328 | fi | |
14329 | if test $gl_threads_api = none; then | |
14330 | case "$gl_use_threads" in | |
14331 | yes | windows | win32) # The 'win32' is for backward compatibility. | |
14332 | if { case "$host_os" in | |
14333 | mingw*) true;; | |
14334 | *) false;; | |
14335 | esac | |
14336 | }; then | |
14337 | gl_threads_api=windows | |
14338 | ||
14339 | $as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h | |
14340 | ||
14341 | fi | |
14342 | ;; | |
14343 | esac | |
14344 | fi | |
14345 | fi | |
14346 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5 | |
14347 | $as_echo_n "checking for multithread API to use... " >&6; } | |
14348 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5 | |
14349 | $as_echo "$gl_threads_api" >&6; } | |
14350 | ||
14351 | ||
14352 | ||
14353 | ||
14354 | ||
14355 | ||
14356 | ||
14357 | ||
14358 | ||
14359 | ||
14360 | ||
14361 | ||
14362 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5 | |
14363 | $as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } | |
14364 | if ${gl_cv_func_malloc_posix+:} false; then : | |
6ec2e0f5 SDJ |
14365 | $as_echo_n "(cached) " >&6 |
14366 | else | |
c0c3707f CB |
14367 | |
14368 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 14369 | /* end confdefs.h. */ |
c0c3707f | 14370 | |
6ec2e0f5 SDJ |
14371 | int |
14372 | main () | |
14373 | { | |
c0c3707f CB |
14374 | #if defined _WIN32 && ! defined __CYGWIN__ |
14375 | choke me | |
14376 | #endif | |
6ec2e0f5 SDJ |
14377 | |
14378 | ; | |
14379 | return 0; | |
14380 | } | |
14381 | _ACEOF | |
14382 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 14383 | gl_cv_func_malloc_posix=yes |
6ec2e0f5 | 14384 | else |
c0c3707f | 14385 | gl_cv_func_malloc_posix=no |
6ec2e0f5 SDJ |
14386 | fi |
14387 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
472fa5ee | 14388 | |
c0c3707f CB |
14389 | fi |
14390 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5 | |
14391 | $as_echo "$gl_cv_func_malloc_posix" >&6; } | |
472fa5ee SM |
14392 | |
14393 | ||
6ec2e0f5 | 14394 | |
c0c3707f CB |
14395 | for ac_header in stdlib.h |
14396 | do : | |
14397 | ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" | |
14398 | if test "x$ac_cv_header_stdlib_h" = xyes; then : | |
14399 | cat >>confdefs.h <<_ACEOF | |
14400 | #define HAVE_STDLIB_H 1 | |
6ec2e0f5 SDJ |
14401 | _ACEOF |
14402 | ||
c0c3707f | 14403 | fi |
6ec2e0f5 | 14404 | |
c0c3707f | 14405 | done |
472fa5ee | 14406 | |
c0c3707f CB |
14407 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 |
14408 | $as_echo_n "checking for GNU libc compatible malloc... " >&6; } | |
14409 | if ${ac_cv_func_malloc_0_nonnull+:} false; then : | |
6ec2e0f5 SDJ |
14410 | $as_echo_n "(cached) " >&6 |
14411 | else | |
14412 | if test "$cross_compiling" = yes; then : | |
14413 | case "$host_os" in | |
c0c3707f CB |
14414 | # Guess yes on platforms where we know the result. |
14415 | *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \ | |
14416 | | hpux* | solaris* | cygwin* | mingw*) | |
14417 | ac_cv_func_malloc_0_nonnull="guessing yes" ;; | |
14418 | # If we don't know, obey --enable-cross-guesses. | |
14419 | *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;; | |
14420 | esac | |
6ec2e0f5 SDJ |
14421 | |
14422 | else | |
14423 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14424 | /* end confdefs.h. */ | |
c0c3707f CB |
14425 | #if defined STDC_HEADERS || defined HAVE_STDLIB_H |
14426 | # include <stdlib.h> | |
14427 | #else | |
14428 | char *malloc (); | |
14429 | #endif | |
6ec2e0f5 SDJ |
14430 | |
14431 | int | |
14432 | main () | |
14433 | { | |
c0c3707f CB |
14434 | char *p = malloc (0); |
14435 | int result = !p; | |
14436 | free (p); | |
14437 | return result; | |
6ec2e0f5 SDJ |
14438 | ; |
14439 | return 0; | |
14440 | } | |
c0c3707f | 14441 | |
6ec2e0f5 SDJ |
14442 | _ACEOF |
14443 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 14444 | ac_cv_func_malloc_0_nonnull=yes |
6ec2e0f5 | 14445 | else |
c0c3707f | 14446 | ac_cv_func_malloc_0_nonnull=no |
6ec2e0f5 SDJ |
14447 | fi |
14448 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
14449 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
14450 | fi | |
14451 | ||
14452 | ||
14453 | fi | |
c0c3707f CB |
14454 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 |
14455 | $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } | |
14456 | case "$ac_cv_func_malloc_0_nonnull" in | |
14457 | *yes) | |
14458 | gl_cv_func_malloc_0_nonnull=1 | |
14459 | ;; | |
6ec2e0f5 | 14460 | *) |
c0c3707f | 14461 | gl_cv_func_malloc_0_nonnull=0 |
6ec2e0f5 SDJ |
14462 | ;; |
14463 | esac | |
14464 | ||
14465 | ||
c0c3707f CB |
14466 | cat >>confdefs.h <<_ACEOF |
14467 | #define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull | |
14468 | _ACEOF | |
14469 | ||
14470 | ||
14471 | ||
14472 | ||
14473 | ||
14474 | GNULIB_BTOWC=0; | |
14475 | GNULIB_WCTOB=0; | |
14476 | GNULIB_MBSINIT=0; | |
14477 | GNULIB_MBRTOWC=0; | |
14478 | GNULIB_MBRLEN=0; | |
14479 | GNULIB_MBSRTOWCS=0; | |
14480 | GNULIB_MBSNRTOWCS=0; | |
14481 | GNULIB_WCRTOMB=0; | |
14482 | GNULIB_WCSRTOMBS=0; | |
14483 | GNULIB_WCSNRTOMBS=0; | |
14484 | GNULIB_WCWIDTH=0; | |
14485 | GNULIB_WMEMCHR=0; | |
14486 | GNULIB_WMEMCMP=0; | |
14487 | GNULIB_WMEMCPY=0; | |
14488 | GNULIB_WMEMMOVE=0; | |
14489 | GNULIB_WMEMSET=0; | |
14490 | GNULIB_WCSLEN=0; | |
14491 | GNULIB_WCSNLEN=0; | |
14492 | GNULIB_WCSCPY=0; | |
14493 | GNULIB_WCPCPY=0; | |
14494 | GNULIB_WCSNCPY=0; | |
14495 | GNULIB_WCPNCPY=0; | |
14496 | GNULIB_WCSCAT=0; | |
14497 | GNULIB_WCSNCAT=0; | |
14498 | GNULIB_WCSCMP=0; | |
14499 | GNULIB_WCSNCMP=0; | |
14500 | GNULIB_WCSCASECMP=0; | |
14501 | GNULIB_WCSNCASECMP=0; | |
14502 | GNULIB_WCSCOLL=0; | |
14503 | GNULIB_WCSXFRM=0; | |
14504 | GNULIB_WCSDUP=0; | |
14505 | GNULIB_WCSCHR=0; | |
14506 | GNULIB_WCSRCHR=0; | |
14507 | GNULIB_WCSCSPN=0; | |
14508 | GNULIB_WCSSPN=0; | |
14509 | GNULIB_WCSPBRK=0; | |
14510 | GNULIB_WCSSTR=0; | |
14511 | GNULIB_WCSTOK=0; | |
14512 | GNULIB_WCSWIDTH=0; | |
14513 | GNULIB_WCSFTIME=0; | |
14514 | HAVE_BTOWC=1; | |
14515 | HAVE_MBSINIT=1; | |
14516 | HAVE_MBRTOWC=1; | |
14517 | HAVE_MBRLEN=1; | |
14518 | HAVE_MBSRTOWCS=1; | |
14519 | HAVE_MBSNRTOWCS=1; | |
14520 | HAVE_WCRTOMB=1; | |
14521 | HAVE_WCSRTOMBS=1; | |
14522 | HAVE_WCSNRTOMBS=1; | |
14523 | HAVE_WMEMCHR=1; | |
14524 | HAVE_WMEMCMP=1; | |
14525 | HAVE_WMEMCPY=1; | |
14526 | HAVE_WMEMMOVE=1; | |
14527 | HAVE_WMEMSET=1; | |
14528 | HAVE_WCSLEN=1; | |
14529 | HAVE_WCSNLEN=1; | |
14530 | HAVE_WCSCPY=1; | |
14531 | HAVE_WCPCPY=1; | |
14532 | HAVE_WCSNCPY=1; | |
14533 | HAVE_WCPNCPY=1; | |
14534 | HAVE_WCSCAT=1; | |
14535 | HAVE_WCSNCAT=1; | |
14536 | HAVE_WCSCMP=1; | |
14537 | HAVE_WCSNCMP=1; | |
14538 | HAVE_WCSCASECMP=1; | |
14539 | HAVE_WCSNCASECMP=1; | |
14540 | HAVE_WCSCOLL=1; | |
14541 | HAVE_WCSXFRM=1; | |
14542 | HAVE_WCSDUP=1; | |
14543 | HAVE_WCSCHR=1; | |
14544 | HAVE_WCSRCHR=1; | |
14545 | HAVE_WCSCSPN=1; | |
14546 | HAVE_WCSSPN=1; | |
14547 | HAVE_WCSPBRK=1; | |
14548 | HAVE_WCSSTR=1; | |
14549 | HAVE_WCSTOK=1; | |
14550 | HAVE_WCSWIDTH=1; | |
14551 | HAVE_WCSFTIME=1; | |
14552 | HAVE_DECL_WCTOB=1; | |
14553 | HAVE_DECL_WCWIDTH=1; | |
14554 | REPLACE_MBSTATE_T=0; | |
14555 | REPLACE_BTOWC=0; | |
14556 | REPLACE_WCTOB=0; | |
14557 | REPLACE_MBSINIT=0; | |
14558 | REPLACE_MBRTOWC=0; | |
14559 | REPLACE_MBRLEN=0; | |
14560 | REPLACE_MBSRTOWCS=0; | |
14561 | REPLACE_MBSNRTOWCS=0; | |
14562 | REPLACE_WCRTOMB=0; | |
14563 | REPLACE_WCSRTOMBS=0; | |
14564 | REPLACE_WCSNRTOMBS=0; | |
14565 | REPLACE_WCWIDTH=0; | |
14566 | REPLACE_WCSWIDTH=0; | |
14567 | REPLACE_WCSFTIME=0; | |
14568 | REPLACE_WCSTOK=0; | |
14569 | ||
14570 | ||
6ec2e0f5 SDJ |
14571 | |
14572 | ||
14573 | ||
14574 | ||
14575 | ||
14576 | ||
c0c3707f CB |
14577 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 |
14578 | $as_echo_n "checking for a traditional japanese locale... " >&6; } | |
14579 | if ${gt_cv_locale_ja+:} false; then : | |
14580 | $as_echo_n "(cached) " >&6 | |
14581 | else | |
14582 | ||
14583 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
14584 | /* end confdefs.h. */ | |
6ec2e0f5 | 14585 | |
c0c3707f CB |
14586 | #include <locale.h> |
14587 | #include <time.h> | |
14588 | #if HAVE_LANGINFO_CODESET | |
14589 | # include <langinfo.h> | |
14590 | #endif | |
14591 | #include <stdlib.h> | |
14592 | #include <string.h> | |
14593 | struct tm t; | |
14594 | char buf[16]; | |
14595 | int main () | |
14596 | { | |
14597 | /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl | |
14598 | imitates locale dependent behaviour by looking at the environment | |
14599 | variables, and all locales use the UTF-8 encoding. */ | |
14600 | #if defined __BEOS__ || defined __HAIKU__ | |
14601 | return 1; | |
14602 | #else | |
14603 | /* Check whether the given locale name is recognized by the system. */ | |
14604 | # if defined _WIN32 && !defined __CYGWIN__ | |
14605 | /* On native Windows, setlocale(category, "") looks at the system settings, | |
14606 | not at the environment variables. Also, when an encoding suffix such | |
14607 | as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE | |
14608 | category of the locale to "C". */ | |
14609 | if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL | |
14610 | || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) | |
14611 | return 1; | |
14612 | # else | |
14613 | if (setlocale (LC_ALL, "") == NULL) return 1; | |
14614 | # endif | |
14615 | /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". | |
14616 | On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) | |
14617 | is empty, and the behaviour of Tcl 8.4 in this locale is not useful. | |
14618 | On OpenBSD 4.0, when an unsupported locale is specified, setlocale() | |
14619 | succeeds but then nl_langinfo(CODESET) is "646". In this situation, | |
14620 | some unit tests fail. | |
14621 | On MirBSD 10, when an unsupported locale is specified, setlocale() | |
14622 | succeeds but then nl_langinfo(CODESET) is "UTF-8". */ | |
14623 | # if HAVE_LANGINFO_CODESET | |
14624 | { | |
14625 | const char *cs = nl_langinfo (CODESET); | |
14626 | if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 | |
14627 | || strcmp (cs, "UTF-8") == 0) | |
14628 | return 1; | |
14629 | } | |
14630 | # endif | |
14631 | # ifdef __CYGWIN__ | |
14632 | /* On Cygwin, avoid locale names without encoding suffix, because the | |
14633 | locale_charset() function relies on the encoding suffix. Note that | |
14634 | LC_ALL is set on the command line. */ | |
14635 | if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; | |
14636 | # endif | |
14637 | /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales | |
14638 | on Cygwin 1.5.x. */ | |
14639 | if (MB_CUR_MAX == 1) | |
14640 | return 1; | |
14641 | /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. | |
14642 | This excludes the UTF-8 encoding (except on MirBSD). */ | |
14643 | { | |
14644 | const char *p; | |
14645 | t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; | |
14646 | if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; | |
14647 | for (p = buf; *p != '\0'; p++) | |
14648 | if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) | |
14649 | return 1; | |
14650 | } | |
14651 | return 0; | |
14652 | #endif | |
14653 | } | |
6ec2e0f5 | 14654 | |
c0c3707f CB |
14655 | _ACEOF |
14656 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 | |
14657 | (eval $ac_link) 2>&5 | |
14658 | ac_status=$? | |
14659 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
14660 | test $ac_status = 0; } && test -s conftest$ac_exeext; then | |
14661 | case "$host_os" in | |
14662 | # Handle native Windows specially, because there setlocale() interprets | |
14663 | # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", | |
14664 | # "fr" or "fra" as "French" or "French_France.1252", | |
14665 | # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", | |
14666 | # "ja" as "Japanese" or "Japanese_Japan.932", | |
14667 | # and similar. | |
14668 | mingw*) | |
14669 | # Note that on native Windows, the Japanese locale is | |
14670 | # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we | |
14671 | # cannot use it here. | |
14672 | gt_cv_locale_ja=none | |
14673 | ;; | |
14674 | *) | |
14675 | # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because | |
14676 | # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the | |
14677 | # configure script would override the LC_ALL setting. Likewise for | |
14678 | # LC_CTYPE, which is also set at the beginning of the configure script. | |
14679 | # Test for the AIX locale name. | |
14680 | if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
14681 | gt_cv_locale_ja=ja_JP | |
14682 | else | |
14683 | # Test for the locale name with explicit encoding suffix. | |
14684 | if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
14685 | gt_cv_locale_ja=ja_JP.EUC-JP | |
14686 | else | |
14687 | # Test for the HP-UX, OSF/1, NetBSD locale name. | |
14688 | if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
14689 | gt_cv_locale_ja=ja_JP.eucJP | |
14690 | else | |
14691 | # Test for the IRIX, FreeBSD locale name. | |
14692 | if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
14693 | gt_cv_locale_ja=ja_JP.EUC | |
14694 | else | |
14695 | # Test for the Solaris 7 locale name. | |
14696 | if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
14697 | gt_cv_locale_ja=ja | |
14698 | else | |
14699 | # Special test for NetBSD 1.6. | |
14700 | if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then | |
14701 | gt_cv_locale_ja=ja_JP.eucJP | |
14702 | else | |
14703 | # None found. | |
14704 | gt_cv_locale_ja=none | |
14705 | fi | |
14706 | fi | |
14707 | fi | |
14708 | fi | |
14709 | fi | |
14710 | fi | |
14711 | ;; | |
14712 | esac | |
14713 | fi | |
14714 | rm -fr conftest* | |
5abebf3c CB |
14715 | |
14716 | fi | |
c0c3707f CB |
14717 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 |
14718 | $as_echo "$gt_cv_locale_ja" >&6; } | |
14719 | LOCALE_JA=$gt_cv_locale_ja | |
5abebf3c | 14720 | |
5abebf3c | 14721 | |
5abebf3c | 14722 | |
5abebf3c | 14723 | |
c0c3707f CB |
14724 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 |
14725 | $as_echo_n "checking for a french Unicode locale... " >&6; } | |
14726 | if ${gt_cv_locale_fr_utf8+:} false; then : | |
5abebf3c CB |
14727 | $as_echo_n "(cached) " >&6 |
14728 | else | |
5abebf3c | 14729 | |
c0c3707f | 14730 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5abebf3c | 14731 | /* end confdefs.h. */ |
5abebf3c | 14732 | |
c0c3707f CB |
14733 | #include <locale.h> |
14734 | #include <time.h> | |
14735 | #if HAVE_LANGINFO_CODESET | |
14736 | # include <langinfo.h> | |
14737 | #endif | |
14738 | #include <stdlib.h> | |
14739 | #include <string.h> | |
14740 | struct tm t; | |
14741 | char buf[16]; | |
14742 | int main () { | |
14743 | /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl | |
14744 | imitates locale dependent behaviour by looking at the environment | |
14745 | variables, and all locales use the UTF-8 encoding. */ | |
14746 | #if !(defined __BEOS__ || defined __HAIKU__) | |
14747 | /* Check whether the given locale name is recognized by the system. */ | |
14748 | # if defined _WIN32 && !defined __CYGWIN__ | |
14749 | /* On native Windows, setlocale(category, "") looks at the system settings, | |
14750 | not at the environment variables. Also, when an encoding suffix such | |
14751 | as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE | |
14752 | category of the locale to "C". */ | |
14753 | if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL | |
14754 | || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) | |
14755 | return 1; | |
14756 | # else | |
14757 | if (setlocale (LC_ALL, "") == NULL) return 1; | |
14758 | # endif | |
14759 | /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". | |
14760 | On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) | |
14761 | is empty, and the behaviour of Tcl 8.4 in this locale is not useful. | |
14762 | On OpenBSD 4.0, when an unsupported locale is specified, setlocale() | |
14763 | succeeds but then nl_langinfo(CODESET) is "646". In this situation, | |
14764 | some unit tests fail. */ | |
14765 | # if HAVE_LANGINFO_CODESET | |
14766 | { | |
14767 | const char *cs = nl_langinfo (CODESET); | |
14768 | if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) | |
14769 | return 1; | |
14770 | } | |
14771 | # endif | |
14772 | # ifdef __CYGWIN__ | |
14773 | /* On Cygwin, avoid locale names without encoding suffix, because the | |
14774 | locale_charset() function relies on the encoding suffix. Note that | |
14775 | LC_ALL is set on the command line. */ | |
14776 | if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; | |
14777 | # endif | |
14778 | /* Check whether in the abbreviation of the second month, the second | |
14779 | character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is | |
14780 | two bytes long, with UTF-8 encoding. */ | |
14781 | t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; | |
14782 | if (strftime (buf, sizeof (buf), "%b", &t) < 4 | |
14783 | || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') | |
14784 | return 1; | |
14785 | #endif | |
14786 | #if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ | |
14787 | /* Check whether the decimal separator is a comma. | |
14788 | On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point | |
14789 | are nl_langinfo(RADIXCHAR) are both ".". */ | |
14790 | if (localeconv () ->decimal_point[0] != ',') return 1; | |
14791 | #endif | |
5abebf3c CB |
14792 | return 0; |
14793 | } | |
5abebf3c | 14794 | |
c0c3707f CB |
14795 | _ACEOF |
14796 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 | |
14797 | (eval $ac_link) 2>&5 | |
14798 | ac_status=$? | |
14799 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
14800 | test $ac_status = 0; } && test -s conftest$ac_exeext; then | |
14801 | case "$host_os" in | |
14802 | # Handle native Windows specially, because there setlocale() interprets | |
14803 | # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", | |
14804 | # "fr" or "fra" as "French" or "French_France.1252", | |
14805 | # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", | |
14806 | # "ja" as "Japanese" or "Japanese_Japan.932", | |
14807 | # and similar. | |
14808 | mingw*) | |
14809 | # Test for the hypothetical native Windows locale name. | |
14810 | if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
14811 | gt_cv_locale_fr_utf8=French_France.65001 | |
14812 | else | |
14813 | # None found. | |
14814 | gt_cv_locale_fr_utf8=none | |
14815 | fi | |
14816 | ;; | |
14817 | *) | |
14818 | # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because | |
14819 | # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the | |
14820 | # configure script would override the LC_ALL setting. Likewise for | |
14821 | # LC_CTYPE, which is also set at the beginning of the configure script. | |
14822 | # Test for the usual locale name. | |
14823 | if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
14824 | gt_cv_locale_fr_utf8=fr_FR | |
14825 | else | |
14826 | # Test for the locale name with explicit encoding suffix. | |
14827 | if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
14828 | gt_cv_locale_fr_utf8=fr_FR.UTF-8 | |
14829 | else | |
14830 | # Test for the Solaris 7 locale name. | |
14831 | if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
14832 | gt_cv_locale_fr_utf8=fr.UTF-8 | |
14833 | else | |
14834 | # None found. | |
14835 | gt_cv_locale_fr_utf8=none | |
14836 | fi | |
14837 | fi | |
14838 | fi | |
14839 | ;; | |
14840 | esac | |
14841 | fi | |
14842 | rm -fr conftest* | |
5abebf3c CB |
14843 | |
14844 | fi | |
c0c3707f CB |
14845 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 |
14846 | $as_echo "$gt_cv_locale_fr_utf8" >&6; } | |
14847 | LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 | |
5abebf3c CB |
14848 | |
14849 | ||
14850 | ||
14851 | ||
14852 | ||
c0c3707f CB |
14853 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 |
14854 | $as_echo_n "checking for a transitional chinese locale... " >&6; } | |
14855 | if ${gt_cv_locale_zh_CN+:} false; then : | |
5abebf3c CB |
14856 | $as_echo_n "(cached) " >&6 |
14857 | else | |
5abebf3c | 14858 | |
c0c3707f | 14859 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5abebf3c | 14860 | /* end confdefs.h. */ |
5abebf3c | 14861 | |
c0c3707f CB |
14862 | #include <locale.h> |
14863 | #include <stdlib.h> | |
14864 | #include <time.h> | |
14865 | #if HAVE_LANGINFO_CODESET | |
14866 | # include <langinfo.h> | |
14867 | #endif | |
14868 | #include <stdlib.h> | |
14869 | #include <string.h> | |
14870 | struct tm t; | |
14871 | char buf[16]; | |
14872 | int main () | |
5abebf3c | 14873 | { |
c0c3707f CB |
14874 | /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl |
14875 | imitates locale dependent behaviour by looking at the environment | |
14876 | variables, and all locales use the UTF-8 encoding. */ | |
14877 | #if defined __BEOS__ || defined __HAIKU__ | |
14878 | return 1; | |
14879 | #else | |
14880 | /* Check whether the given locale name is recognized by the system. */ | |
14881 | # if defined _WIN32 && !defined __CYGWIN__ | |
14882 | /* On native Windows, setlocale(category, "") looks at the system settings, | |
14883 | not at the environment variables. Also, when an encoding suffix such | |
14884 | as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE | |
14885 | category of the locale to "C". */ | |
14886 | if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL | |
14887 | || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) | |
14888 | return 1; | |
14889 | # else | |
14890 | if (setlocale (LC_ALL, "") == NULL) return 1; | |
14891 | # endif | |
14892 | /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". | |
14893 | On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) | |
14894 | is empty, and the behaviour of Tcl 8.4 in this locale is not useful. | |
14895 | On OpenBSD 4.0, when an unsupported locale is specified, setlocale() | |
14896 | succeeds but then nl_langinfo(CODESET) is "646". In this situation, | |
14897 | some unit tests fail. | |
14898 | On MirBSD 10, when an unsupported locale is specified, setlocale() | |
14899 | succeeds but then nl_langinfo(CODESET) is "UTF-8". */ | |
14900 | # if HAVE_LANGINFO_CODESET | |
14901 | { | |
14902 | const char *cs = nl_langinfo (CODESET); | |
14903 | if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 | |
14904 | || strcmp (cs, "UTF-8") == 0) | |
14905 | return 1; | |
14906 | } | |
14907 | # endif | |
14908 | # ifdef __CYGWIN__ | |
14909 | /* On Cygwin, avoid locale names without encoding suffix, because the | |
14910 | locale_charset() function relies on the encoding suffix. Note that | |
14911 | LC_ALL is set on the command line. */ | |
14912 | if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; | |
14913 | # endif | |
14914 | /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. | |
14915 | This excludes the UTF-8 encoding (except on MirBSD). */ | |
14916 | { | |
14917 | const char *p; | |
14918 | t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; | |
14919 | if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; | |
14920 | for (p = buf; *p != '\0'; p++) | |
14921 | if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) | |
14922 | return 1; | |
14923 | } | |
14924 | /* Check whether a typical GB18030 multibyte sequence is recognized as a | |
14925 | single wide character. This excludes the GB2312 and GBK encodings. */ | |
14926 | if (mblen ("\203\062\332\066", 5) != 4) | |
14927 | return 1; | |
5abebf3c | 14928 | return 0; |
c0c3707f | 14929 | #endif |
5abebf3c | 14930 | } |
c0c3707f | 14931 | |
5abebf3c | 14932 | _ACEOF |
c0c3707f CB |
14933 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 |
14934 | (eval $ac_link) 2>&5 | |
14935 | ac_status=$? | |
14936 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
14937 | test $ac_status = 0; } && test -s conftest$ac_exeext; then | |
14938 | case "$host_os" in | |
14939 | # Handle native Windows specially, because there setlocale() interprets | |
14940 | # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", | |
14941 | # "fr" or "fra" as "French" or "French_France.1252", | |
14942 | # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", | |
14943 | # "ja" as "Japanese" or "Japanese_Japan.932", | |
14944 | # and similar. | |
14945 | mingw*) | |
14946 | # Test for the hypothetical native Windows locale name. | |
14947 | if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
14948 | gt_cv_locale_zh_CN=Chinese_China.54936 | |
14949 | else | |
14950 | # None found. | |
14951 | gt_cv_locale_zh_CN=none | |
14952 | fi | |
14953 | ;; | |
14954 | solaris2.8) | |
14955 | # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are | |
14956 | # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. | |
14957 | # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. | |
14958 | gt_cv_locale_zh_CN=none | |
14959 | ;; | |
14960 | *) | |
14961 | # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because | |
14962 | # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the | |
14963 | # configure script would override the LC_ALL setting. Likewise for | |
14964 | # LC_CTYPE, which is also set at the beginning of the configure script. | |
14965 | # Test for the locale name without encoding suffix. | |
14966 | if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
14967 | gt_cv_locale_zh_CN=zh_CN | |
14968 | else | |
14969 | # Test for the locale name with explicit encoding suffix. | |
14970 | if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
14971 | gt_cv_locale_zh_CN=zh_CN.GB18030 | |
14972 | else | |
14973 | # None found. | |
14974 | gt_cv_locale_zh_CN=none | |
14975 | fi | |
14976 | fi | |
14977 | ;; | |
14978 | esac | |
14979 | else | |
14980 | # If there was a link error, due to mblen(), the system is so old that | |
14981 | # it certainly doesn't have a chinese locale. | |
14982 | gt_cv_locale_zh_CN=none | |
14983 | fi | |
14984 | rm -fr conftest* | |
14985 | ||
5abebf3c | 14986 | fi |
c0c3707f CB |
14987 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 |
14988 | $as_echo "$gt_cv_locale_zh_CN" >&6; } | |
14989 | LOCALE_ZH_CN=$gt_cv_locale_zh_CN | |
14990 | ||
14991 | ||
14992 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 | |
14993 | $as_echo_n "checking for inline... " >&6; } | |
14994 | if ${ac_cv_c_inline+:} false; then : | |
14995 | $as_echo_n "(cached) " >&6 | |
14996 | else | |
14997 | ac_cv_c_inline=no | |
14998 | for ac_kw in inline __inline__ __inline; do | |
14999 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15000 | /* end confdefs.h. */ | |
15001 | #ifndef __cplusplus | |
15002 | typedef int foo_t; | |
15003 | static $ac_kw foo_t static_foo () {return 0; } | |
15004 | $ac_kw foo_t foo () {return 0; } | |
15005 | #endif | |
5abebf3c | 15006 | |
c0c3707f CB |
15007 | _ACEOF |
15008 | if ac_fn_c_try_compile "$LINENO"; then : | |
15009 | ac_cv_c_inline=$ac_kw | |
15010 | fi | |
15011 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
15012 | test "$ac_cv_c_inline" != no && break | |
15013 | done | |
5abebf3c CB |
15014 | |
15015 | fi | |
c0c3707f CB |
15016 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 |
15017 | $as_echo "$ac_cv_c_inline" >&6; } | |
5abebf3c | 15018 | |
c0c3707f CB |
15019 | case $ac_cv_c_inline in |
15020 | inline | yes) ;; | |
15021 | *) | |
15022 | case $ac_cv_c_inline in | |
15023 | no) ac_val=;; | |
15024 | *) ac_val=$ac_cv_c_inline;; | |
15025 | esac | |
15026 | cat >>confdefs.h <<_ACEOF | |
15027 | #ifndef __cplusplus | |
15028 | #define inline $ac_val | |
15029 | #endif | |
15030 | _ACEOF | |
15031 | ;; | |
15032 | esac | |
5abebf3c CB |
15033 | |
15034 | ||
15035 | ||
15036 | ||
c0c3707f CB |
15037 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 |
15038 | $as_echo_n "checking for a traditional french locale... " >&6; } | |
15039 | if ${gt_cv_locale_fr+:} false; then : | |
15040 | $as_echo_n "(cached) " >&6 | |
15041 | else | |
5abebf3c | 15042 | |
c0c3707f CB |
15043 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
15044 | /* end confdefs.h. */ | |
5abebf3c | 15045 | |
c0c3707f CB |
15046 | #include <locale.h> |
15047 | #include <time.h> | |
15048 | #if HAVE_LANGINFO_CODESET | |
15049 | # include <langinfo.h> | |
15050 | #endif | |
15051 | #include <stdlib.h> | |
15052 | #include <string.h> | |
15053 | struct tm t; | |
15054 | char buf[16]; | |
15055 | int main () { | |
15056 | /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl | |
15057 | imitates locale dependent behaviour by looking at the environment | |
15058 | variables, and all locales use the UTF-8 encoding. */ | |
15059 | #if defined __BEOS__ || defined __HAIKU__ | |
15060 | return 1; | |
15061 | #else | |
15062 | /* Check whether the given locale name is recognized by the system. */ | |
15063 | # if defined _WIN32 && !defined __CYGWIN__ | |
15064 | /* On native Windows, setlocale(category, "") looks at the system settings, | |
15065 | not at the environment variables. Also, when an encoding suffix such | |
15066 | as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE | |
15067 | category of the locale to "C". */ | |
15068 | if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL | |
15069 | || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) | |
15070 | return 1; | |
15071 | # else | |
15072 | if (setlocale (LC_ALL, "") == NULL) return 1; | |
15073 | # endif | |
15074 | /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". | |
15075 | On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) | |
15076 | is empty, and the behaviour of Tcl 8.4 in this locale is not useful. | |
15077 | On OpenBSD 4.0, when an unsupported locale is specified, setlocale() | |
15078 | succeeds but then nl_langinfo(CODESET) is "646". In this situation, | |
15079 | some unit tests fail. | |
15080 | On MirBSD 10, when an unsupported locale is specified, setlocale() | |
15081 | succeeds but then nl_langinfo(CODESET) is "UTF-8". */ | |
15082 | # if HAVE_LANGINFO_CODESET | |
15083 | { | |
15084 | const char *cs = nl_langinfo (CODESET); | |
15085 | if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 | |
15086 | || strcmp (cs, "UTF-8") == 0) | |
15087 | return 1; | |
15088 | } | |
15089 | # endif | |
15090 | # ifdef __CYGWIN__ | |
15091 | /* On Cygwin, avoid locale names without encoding suffix, because the | |
15092 | locale_charset() function relies on the encoding suffix. Note that | |
15093 | LC_ALL is set on the command line. */ | |
15094 | if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; | |
15095 | # endif | |
15096 | /* Check whether in the abbreviation of the second month, the second | |
15097 | character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only | |
15098 | one byte long. This excludes the UTF-8 encoding. */ | |
15099 | t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; | |
15100 | if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; | |
15101 | # if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ | |
15102 | /* Check whether the decimal separator is a comma. | |
15103 | On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point | |
15104 | are nl_langinfo(RADIXCHAR) are both ".". */ | |
15105 | if (localeconv () ->decimal_point[0] != ',') return 1; | |
15106 | # endif | |
15107 | return 0; | |
15108 | #endif | |
15109 | } | |
5abebf3c | 15110 | |
c0c3707f CB |
15111 | _ACEOF |
15112 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 | |
15113 | (eval $ac_link) 2>&5 | |
15114 | ac_status=$? | |
15115 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
15116 | test $ac_status = 0; } && test -s conftest$ac_exeext; then | |
15117 | case "$host_os" in | |
15118 | # Handle native Windows specially, because there setlocale() interprets | |
15119 | # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", | |
15120 | # "fr" or "fra" as "French" or "French_France.1252", | |
15121 | # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", | |
15122 | # "ja" as "Japanese" or "Japanese_Japan.932", | |
15123 | # and similar. | |
15124 | mingw*) | |
15125 | # Test for the native Windows locale name. | |
15126 | if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15127 | gt_cv_locale_fr=French_France.1252 | |
15128 | else | |
15129 | # None found. | |
15130 | gt_cv_locale_fr=none | |
15131 | fi | |
15132 | ;; | |
15133 | *) | |
15134 | # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because | |
15135 | # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the | |
15136 | # configure script would override the LC_ALL setting. Likewise for | |
15137 | # LC_CTYPE, which is also set at the beginning of the configure script. | |
15138 | # Test for the usual locale name. | |
15139 | if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15140 | gt_cv_locale_fr=fr_FR | |
15141 | else | |
15142 | # Test for the locale name with explicit encoding suffix. | |
15143 | if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15144 | gt_cv_locale_fr=fr_FR.ISO-8859-1 | |
15145 | else | |
15146 | # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. | |
15147 | if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15148 | gt_cv_locale_fr=fr_FR.ISO8859-1 | |
15149 | else | |
15150 | # Test for the HP-UX locale name. | |
15151 | if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15152 | gt_cv_locale_fr=fr_FR.iso88591 | |
15153 | else | |
15154 | # Test for the Solaris 7 locale name. | |
15155 | if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then | |
15156 | gt_cv_locale_fr=fr | |
15157 | else | |
15158 | # None found. | |
15159 | gt_cv_locale_fr=none | |
15160 | fi | |
15161 | fi | |
15162 | fi | |
15163 | fi | |
15164 | fi | |
15165 | ;; | |
15166 | esac | |
15167 | fi | |
15168 | rm -fr conftest* | |
5abebf3c | 15169 | |
c0c3707f CB |
15170 | fi |
15171 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 | |
15172 | $as_echo "$gt_cv_locale_fr" >&6; } | |
15173 | LOCALE_FR=$gt_cv_locale_fr | |
5abebf3c CB |
15174 | |
15175 | ||
15176 | ||
15177 | ||
15178 | ||
15179 | ||
15180 | ||
c0c3707f CB |
15181 | GNULIB_EXPLICIT_BZERO=0; |
15182 | GNULIB_FFSL=0; | |
15183 | GNULIB_FFSLL=0; | |
15184 | GNULIB_MEMCHR=0; | |
15185 | GNULIB_MEMMEM=0; | |
15186 | GNULIB_MEMPCPY=0; | |
15187 | GNULIB_MEMRCHR=0; | |
15188 | GNULIB_RAWMEMCHR=0; | |
15189 | GNULIB_STPCPY=0; | |
15190 | GNULIB_STPNCPY=0; | |
15191 | GNULIB_STRCHRNUL=0; | |
15192 | GNULIB_STRDUP=0; | |
15193 | GNULIB_STRNCAT=0; | |
15194 | GNULIB_STRNDUP=0; | |
15195 | GNULIB_STRNLEN=0; | |
15196 | GNULIB_STRPBRK=0; | |
15197 | GNULIB_STRSEP=0; | |
15198 | GNULIB_STRSTR=0; | |
15199 | GNULIB_STRCASESTR=0; | |
15200 | GNULIB_STRTOK_R=0; | |
15201 | GNULIB_MBSLEN=0; | |
15202 | GNULIB_MBSNLEN=0; | |
15203 | GNULIB_MBSCHR=0; | |
15204 | GNULIB_MBSRCHR=0; | |
15205 | GNULIB_MBSSTR=0; | |
15206 | GNULIB_MBSCASECMP=0; | |
15207 | GNULIB_MBSNCASECMP=0; | |
15208 | GNULIB_MBSPCASECMP=0; | |
15209 | GNULIB_MBSCASESTR=0; | |
15210 | GNULIB_MBSCSPN=0; | |
15211 | GNULIB_MBSPBRK=0; | |
15212 | GNULIB_MBSSPN=0; | |
15213 | GNULIB_MBSSEP=0; | |
15214 | GNULIB_MBSTOK_R=0; | |
15215 | GNULIB_STRERROR=0; | |
15216 | GNULIB_STRERROR_R=0; | |
15217 | GNULIB_STRSIGNAL=0; | |
15218 | GNULIB_STRVERSCMP=0; | |
15219 | HAVE_MBSLEN=0; | |
15220 | HAVE_EXPLICIT_BZERO=1; | |
15221 | HAVE_FFSL=1; | |
15222 | HAVE_FFSLL=1; | |
15223 | HAVE_MEMCHR=1; | |
15224 | HAVE_DECL_MEMMEM=1; | |
15225 | HAVE_MEMPCPY=1; | |
15226 | HAVE_DECL_MEMRCHR=1; | |
15227 | HAVE_RAWMEMCHR=1; | |
15228 | HAVE_STPCPY=1; | |
15229 | HAVE_STPNCPY=1; | |
15230 | HAVE_STRCHRNUL=1; | |
15231 | HAVE_DECL_STRDUP=1; | |
15232 | HAVE_DECL_STRNDUP=1; | |
15233 | HAVE_DECL_STRNLEN=1; | |
15234 | HAVE_STRPBRK=1; | |
15235 | HAVE_STRSEP=1; | |
15236 | HAVE_STRCASESTR=1; | |
15237 | HAVE_DECL_STRTOK_R=1; | |
15238 | HAVE_DECL_STRERROR_R=1; | |
15239 | HAVE_DECL_STRSIGNAL=1; | |
15240 | HAVE_STRVERSCMP=1; | |
15241 | REPLACE_MEMCHR=0; | |
15242 | REPLACE_MEMMEM=0; | |
15243 | REPLACE_STPNCPY=0; | |
15244 | REPLACE_STRCHRNUL=0; | |
15245 | REPLACE_STRDUP=0; | |
15246 | REPLACE_STRNCAT=0; | |
15247 | REPLACE_STRNDUP=0; | |
15248 | REPLACE_STRNLEN=0; | |
15249 | REPLACE_STRSTR=0; | |
15250 | REPLACE_STRCASESTR=0; | |
15251 | REPLACE_STRTOK_R=0; | |
15252 | REPLACE_STRERROR=0; | |
15253 | REPLACE_STRERROR_R=0; | |
15254 | REPLACE_STRSIGNAL=0; | |
15255 | UNDEFINE_STRTOK_R=0; | |
5abebf3c CB |
15256 | |
15257 | ||
15258 | ||
15259 | ||
6ec2e0f5 SDJ |
15260 | |
15261 | ||
c0c3707f CB |
15262 | # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it |
15263 | # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is | |
15264 | # irrelevant for anonymous mappings. | |
15265 | ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" | |
15266 | if test "x$ac_cv_func_mmap" = xyes; then : | |
15267 | gl_have_mmap=yes | |
6ec2e0f5 | 15268 | else |
c0c3707f CB |
15269 | gl_have_mmap=no |
15270 | fi | |
6ec2e0f5 SDJ |
15271 | |
15272 | ||
c0c3707f CB |
15273 | # Try to allow MAP_ANONYMOUS. |
15274 | gl_have_mmap_anonymous=no | |
15275 | if test $gl_have_mmap = yes; then | |
15276 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 | |
15277 | $as_echo_n "checking for MAP_ANONYMOUS... " >&6; } | |
15278 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 15279 | /* end confdefs.h. */ |
6ec2e0f5 | 15280 | |
c0c3707f CB |
15281 | #include <sys/mman.h> |
15282 | #ifdef MAP_ANONYMOUS | |
15283 | I cannot identify this map | |
15284 | #endif | |
6ec2e0f5 | 15285 | |
c0c3707f CB |
15286 | _ACEOF |
15287 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
15288 | $EGREP "I cannot identify this map" >/dev/null 2>&1; then : | |
15289 | gl_have_mmap_anonymous=yes | |
6ec2e0f5 | 15290 | fi |
c0c3707f | 15291 | rm -f conftest* |
6ec2e0f5 | 15292 | |
c0c3707f CB |
15293 | if test $gl_have_mmap_anonymous != yes; then |
15294 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15295 | /* end confdefs.h. */ | |
6ec2e0f5 | 15296 | |
c0c3707f CB |
15297 | #include <sys/mman.h> |
15298 | #ifdef MAP_ANON | |
15299 | I cannot identify this map | |
15300 | #endif | |
6ec2e0f5 | 15301 | |
c0c3707f CB |
15302 | _ACEOF |
15303 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
15304 | $EGREP "I cannot identify this map" >/dev/null 2>&1; then : | |
6ec2e0f5 | 15305 | |
c0c3707f | 15306 | $as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h |
5e8754f9 | 15307 | |
c0c3707f | 15308 | gl_have_mmap_anonymous=yes |
5e8754f9 | 15309 | fi |
c0c3707f CB |
15310 | rm -f conftest* |
15311 | ||
15312 | fi | |
15313 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 | |
15314 | $as_echo "$gl_have_mmap_anonymous" >&6; } | |
15315 | if test $gl_have_mmap_anonymous = yes; then | |
6ec2e0f5 | 15316 | |
c0c3707f | 15317 | $as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h |
6ec2e0f5 | 15318 | |
c0c3707f CB |
15319 | fi |
15320 | fi | |
6ec2e0f5 SDJ |
15321 | |
15322 | ||
15323 | ||
15324 | ||
6ec2e0f5 | 15325 | |
6ec2e0f5 | 15326 | |
c0c3707f CB |
15327 | if test $HAVE_MEMCHR = 1; then |
15328 | # Detect platform-specific bugs in some versions of glibc: | |
15329 | # memchr should not dereference anything with length 0 | |
15330 | # https://bugzilla.redhat.com/show_bug.cgi?id=499689 | |
15331 | # memchr should not dereference overestimated length after a match | |
15332 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 | |
15333 | # https://sourceware.org/bugzilla/show_bug.cgi?id=10162 | |
15334 | # memchr should cast the second argument to 'unsigned char'. | |
15335 | # This bug exists in Android 4.3. | |
15336 | # Assume that memchr works on platforms that lack mprotect. | |
15337 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5 | |
15338 | $as_echo_n "checking whether memchr works... " >&6; } | |
15339 | if ${gl_cv_func_memchr_works+:} false; then : | |
15340 | $as_echo_n "(cached) " >&6 | |
6ec2e0f5 | 15341 | else |
c0c3707f CB |
15342 | if test "$cross_compiling" = yes; then : |
15343 | case "$host_os" in | |
15344 | # Guess no on Android. | |
15345 | linux*-android*) gl_cv_func_memchr_works="guessing no" ;; | |
15346 | # Guess yes on native Windows. | |
15347 | mingw*) gl_cv_func_memchr_works="guessing yes" ;; | |
15348 | # If we don't know, obey --enable-cross-guesses. | |
15349 | *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;; | |
15350 | esac | |
6ec2e0f5 SDJ |
15351 | |
15352 | else | |
15353 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15354 | /* end confdefs.h. */ | |
15355 | ||
c0c3707f CB |
15356 | #include <string.h> |
15357 | #if HAVE_SYS_MMAN_H | |
15358 | # include <fcntl.h> | |
15359 | # include <unistd.h> | |
15360 | # include <sys/types.h> | |
15361 | # include <sys/mman.h> | |
15362 | # ifndef MAP_FILE | |
15363 | # define MAP_FILE 0 | |
15364 | # endif | |
15365 | #endif | |
6ec2e0f5 SDJ |
15366 | |
15367 | int | |
15368 | main () | |
15369 | { | |
c0c3707f CB |
15370 | |
15371 | int result = 0; | |
15372 | char *fence = NULL; | |
15373 | #if HAVE_SYS_MMAN_H && HAVE_MPROTECT | |
15374 | # if HAVE_MAP_ANONYMOUS | |
15375 | const int flags = MAP_ANONYMOUS | MAP_PRIVATE; | |
15376 | const int fd = -1; | |
15377 | # else /* !HAVE_MAP_ANONYMOUS */ | |
15378 | const int flags = MAP_FILE | MAP_PRIVATE; | |
15379 | int fd = open ("/dev/zero", O_RDONLY, 0666); | |
15380 | if (fd >= 0) | |
15381 | # endif | |
15382 | { | |
15383 | int pagesize = getpagesize (); | |
15384 | char *two_pages = | |
15385 | (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, | |
15386 | flags, fd, 0); | |
15387 | if (two_pages != (char *)(-1) | |
15388 | && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) | |
15389 | fence = two_pages + pagesize; | |
15390 | } | |
15391 | #endif | |
15392 | if (fence) | |
15393 | { | |
15394 | if (memchr (fence, 0, 0)) | |
15395 | result |= 1; | |
15396 | strcpy (fence - 9, "12345678"); | |
15397 | if (memchr (fence - 9, 0, 79) != fence - 1) | |
15398 | result |= 2; | |
15399 | if (memchr (fence - 1, 0, 3) != fence - 1) | |
15400 | result |= 4; | |
15401 | } | |
15402 | /* Test against bug on Android 4.3. */ | |
15403 | { | |
15404 | char input[3]; | |
15405 | input[0] = 'a'; | |
15406 | input[1] = 'b'; | |
15407 | input[2] = 'c'; | |
15408 | if (memchr (input, 0x789abc00 | 'b', 3) != input + 1) | |
15409 | result |= 8; | |
15410 | } | |
15411 | return result; | |
6ec2e0f5 SDJ |
15412 | |
15413 | ; | |
15414 | return 0; | |
15415 | } | |
15416 | _ACEOF | |
15417 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 15418 | gl_cv_func_memchr_works=yes |
6ec2e0f5 | 15419 | else |
c0c3707f | 15420 | gl_cv_func_memchr_works=no |
6ec2e0f5 SDJ |
15421 | fi |
15422 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
15423 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
15424 | fi | |
15425 | ||
15426 | ||
15427 | fi | |
c0c3707f CB |
15428 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5 |
15429 | $as_echo "$gl_cv_func_memchr_works" >&6; } | |
15430 | case "$gl_cv_func_memchr_works" in | |
6ec2e0f5 | 15431 | *yes) ;; |
c0c3707f | 15432 | *) REPLACE_MEMCHR=1 ;; |
6ec2e0f5 SDJ |
15433 | esac |
15434 | fi | |
15435 | ||
c0c3707f CB |
15436 | ac_fn_c_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$ac_includes_default" |
15437 | if test "x$ac_cv_have_decl_memmem" = xyes; then : | |
6ec2e0f5 SDJ |
15438 | ac_have_decl=1 |
15439 | else | |
15440 | ac_have_decl=0 | |
15441 | fi | |
15442 | ||
15443 | cat >>confdefs.h <<_ACEOF | |
c0c3707f | 15444 | #define HAVE_DECL_MEMMEM $ac_have_decl |
6ec2e0f5 SDJ |
15445 | _ACEOF |
15446 | ||
472fa5ee | 15447 | |
6ec2e0f5 SDJ |
15448 | |
15449 | ||
15450 | ||
c0c3707f CB |
15451 | for ac_func in memmem |
15452 | do : | |
15453 | ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem" | |
15454 | if test "x$ac_cv_func_memmem" = xyes; then : | |
15455 | cat >>confdefs.h <<_ACEOF | |
15456 | #define HAVE_MEMMEM 1 | |
15457 | _ACEOF | |
6ec2e0f5 | 15458 | |
c0c3707f CB |
15459 | fi |
15460 | done | |
6ec2e0f5 | 15461 | |
c0c3707f CB |
15462 | if test $ac_cv_func_memmem = yes; then |
15463 | HAVE_MEMMEM=1 | |
15464 | else | |
15465 | HAVE_MEMMEM=0 | |
15466 | fi | |
6ec2e0f5 | 15467 | |
c0c3707f CB |
15468 | if test $ac_cv_have_decl_memmem = no; then |
15469 | HAVE_DECL_MEMMEM=0 | |
15470 | else | |
15471 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5 | |
15472 | $as_echo_n "checking whether memmem works... " >&6; } | |
15473 | if ${gl_cv_func_memmem_works_always+:} false; then : | |
6ec2e0f5 SDJ |
15474 | $as_echo_n "(cached) " >&6 |
15475 | else | |
c0c3707f CB |
15476 | if test "$cross_compiling" = yes; then : |
15477 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 | 15478 | /* end confdefs.h. */ |
472fa5ee | 15479 | |
c0c3707f CB |
15480 | #ifdef __GNU_LIBRARY__ |
15481 | #include <features.h> | |
15482 | #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \ | |
15483 | || __GLIBC_MINOR__ > 12)) \ | |
15484 | || (__GLIBC__ > 2)) \ | |
15485 | || defined __UCLIBC__ | |
15486 | Lucky user | |
15487 | #endif | |
15488 | #elif defined __CYGWIN__ | |
15489 | #include <cygwin/version.h> | |
15490 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) | |
15491 | Lucky user | |
15492 | #endif | |
15493 | #else | |
15494 | Lucky user | |
15495 | #endif | |
472fa5ee | 15496 | |
c0c3707f CB |
15497 | _ACEOF |
15498 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
15499 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
15500 | gl_cv_func_memmem_works_always="guessing yes" | |
15501 | else | |
15502 | gl_cv_func_memmem_works_always="$gl_cross_guess_normal" | |
15503 | fi | |
15504 | rm -f conftest* | |
472fa5ee SM |
15505 | |
15506 | ||
6ec2e0f5 SDJ |
15507 | else |
15508 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15509 | /* end confdefs.h. */ | |
c0c3707f CB |
15510 | |
15511 | #include <string.h> /* for memmem */ | |
15512 | #define P "_EF_BF_BD" | |
15513 | #define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P | |
15514 | #define NEEDLE P P P P P | |
6ec2e0f5 SDJ |
15515 | |
15516 | int | |
15517 | main () | |
15518 | { | |
c0c3707f CB |
15519 | |
15520 | int result = 0; | |
15521 | if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE))) | |
15522 | result |= 1; | |
15523 | /* Check for empty needle behavior. */ | |
15524 | { | |
15525 | const char *haystack = "AAA"; | |
15526 | if (memmem (haystack, 3, NULL, 0) != haystack) | |
15527 | result |= 2; | |
15528 | } | |
15529 | return result; | |
15530 | ||
6ec2e0f5 SDJ |
15531 | ; |
15532 | return 0; | |
15533 | } | |
15534 | _ACEOF | |
c0c3707f CB |
15535 | if ac_fn_c_try_run "$LINENO"; then : |
15536 | gl_cv_func_memmem_works_always=yes | |
6ec2e0f5 | 15537 | else |
c0c3707f | 15538 | gl_cv_func_memmem_works_always=no |
6ec2e0f5 | 15539 | fi |
c0c3707f CB |
15540 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
15541 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
6ec2e0f5 | 15542 | fi |
6ec2e0f5 | 15543 | |
c0c3707f CB |
15544 | |
15545 | fi | |
15546 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5 | |
15547 | $as_echo "$gl_cv_func_memmem_works_always" >&6; } | |
15548 | case "$gl_cv_func_memmem_works_always" in | |
15549 | *yes) ;; | |
15550 | *) | |
15551 | REPLACE_MEMMEM=1 | |
15552 | ;; | |
15553 | esac | |
15554 | fi | |
15555 | : | |
15556 | ||
15557 | ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default" | |
15558 | if test "x$ac_cv_have_decl_memrchr" = xyes; then : | |
15559 | ac_have_decl=1 | |
15560 | else | |
15561 | ac_have_decl=0 | |
15562 | fi | |
15563 | ||
15564 | cat >>confdefs.h <<_ACEOF | |
15565 | #define HAVE_DECL_MEMRCHR $ac_have_decl | |
15566 | _ACEOF | |
15567 | ||
15568 | ||
15569 | ||
15570 | ||
15571 | ||
15572 | ||
15573 | ||
15574 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5 | |
15575 | $as_echo_n "checking for O_CLOEXEC... " >&6; } | |
15576 | if ${gl_cv_macro_O_CLOEXEC+:} false; then : | |
6ec2e0f5 SDJ |
15577 | $as_echo_n "(cached) " >&6 |
15578 | else | |
15579 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15580 | /* end confdefs.h. */ | |
c0c3707f CB |
15581 | #include <fcntl.h> |
15582 | #ifndef O_CLOEXEC | |
15583 | choke me; | |
15584 | #endif | |
6ec2e0f5 SDJ |
15585 | |
15586 | int | |
15587 | main () | |
15588 | { | |
c0c3707f | 15589 | return O_CLOEXEC; |
6ec2e0f5 SDJ |
15590 | ; |
15591 | return 0; | |
15592 | } | |
15593 | _ACEOF | |
15594 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 15595 | gl_cv_macro_O_CLOEXEC=yes |
6ec2e0f5 | 15596 | else |
c0c3707f | 15597 | gl_cv_macro_O_CLOEXEC=no |
6ec2e0f5 SDJ |
15598 | fi |
15599 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
15600 | fi | |
c0c3707f CB |
15601 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_macro_O_CLOEXEC" >&5 |
15602 | $as_echo "$gl_cv_macro_O_CLOEXEC" >&6; } | |
15603 | ||
15604 | ||
15605 | ||
15606 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5 | |
15607 | $as_echo_n "checking for promoted mode_t type... " >&6; } | |
15608 | if ${gl_cv_promoted_mode_t+:} false; then : | |
6ec2e0f5 SDJ |
15609 | $as_echo_n "(cached) " >&6 |
15610 | else | |
6ec2e0f5 | 15611 | |
c0c3707f CB |
15612 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
15613 | /* end confdefs.h. */ | |
15614 | #include <sys/types.h> | |
6ec2e0f5 SDJ |
15615 | int |
15616 | main () | |
15617 | { | |
c0c3707f | 15618 | typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1]; |
6ec2e0f5 SDJ |
15619 | ; |
15620 | return 0; | |
15621 | } | |
15622 | _ACEOF | |
15623 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 15624 | gl_cv_promoted_mode_t='int' |
6ec2e0f5 | 15625 | else |
c0c3707f | 15626 | gl_cv_promoted_mode_t='mode_t' |
6ec2e0f5 SDJ |
15627 | fi |
15628 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c0c3707f | 15629 | |
6ec2e0f5 | 15630 | fi |
c0c3707f CB |
15631 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5 |
15632 | $as_echo "$gl_cv_promoted_mode_t" >&6; } | |
6ec2e0f5 | 15633 | |
c0c3707f CB |
15634 | cat >>confdefs.h <<_ACEOF |
15635 | #define PROMOTED_MODE_T $gl_cv_promoted_mode_t | |
6ec2e0f5 | 15636 | _ACEOF |
c0c3707f CB |
15637 | |
15638 | ||
15639 | ||
15640 | ||
15641 | ||
15642 | GNULIB_DPRINTF=0; | |
15643 | GNULIB_FCLOSE=0; | |
15644 | GNULIB_FDOPEN=0; | |
15645 | GNULIB_FFLUSH=0; | |
15646 | GNULIB_FGETC=0; | |
15647 | GNULIB_FGETS=0; | |
15648 | GNULIB_FOPEN=0; | |
15649 | GNULIB_FPRINTF=0; | |
15650 | GNULIB_FPRINTF_POSIX=0; | |
15651 | GNULIB_FPURGE=0; | |
15652 | GNULIB_FPUTC=0; | |
15653 | GNULIB_FPUTS=0; | |
15654 | GNULIB_FREAD=0; | |
15655 | GNULIB_FREOPEN=0; | |
15656 | GNULIB_FSCANF=0; | |
15657 | GNULIB_FSEEK=0; | |
15658 | GNULIB_FSEEKO=0; | |
15659 | GNULIB_FTELL=0; | |
15660 | GNULIB_FTELLO=0; | |
15661 | GNULIB_FWRITE=0; | |
15662 | GNULIB_GETC=0; | |
15663 | GNULIB_GETCHAR=0; | |
15664 | GNULIB_GETDELIM=0; | |
15665 | GNULIB_GETLINE=0; | |
15666 | GNULIB_OBSTACK_PRINTF=0; | |
15667 | GNULIB_OBSTACK_PRINTF_POSIX=0; | |
15668 | GNULIB_PCLOSE=0; | |
15669 | GNULIB_PERROR=0; | |
15670 | GNULIB_POPEN=0; | |
15671 | GNULIB_PRINTF=0; | |
15672 | GNULIB_PRINTF_POSIX=0; | |
15673 | GNULIB_PUTC=0; | |
15674 | GNULIB_PUTCHAR=0; | |
15675 | GNULIB_PUTS=0; | |
15676 | GNULIB_REMOVE=0; | |
15677 | GNULIB_RENAME=0; | |
15678 | GNULIB_RENAMEAT=0; | |
15679 | GNULIB_SCANF=0; | |
15680 | GNULIB_SNPRINTF=0; | |
15681 | GNULIB_SPRINTF_POSIX=0; | |
15682 | GNULIB_STDIO_H_NONBLOCKING=0; | |
15683 | GNULIB_STDIO_H_SIGPIPE=0; | |
15684 | GNULIB_TMPFILE=0; | |
15685 | GNULIB_VASPRINTF=0; | |
15686 | GNULIB_VFSCANF=0; | |
15687 | GNULIB_VSCANF=0; | |
15688 | GNULIB_VDPRINTF=0; | |
15689 | GNULIB_VFPRINTF=0; | |
15690 | GNULIB_VFPRINTF_POSIX=0; | |
15691 | GNULIB_VPRINTF=0; | |
15692 | GNULIB_VPRINTF_POSIX=0; | |
15693 | GNULIB_VSNPRINTF=0; | |
15694 | GNULIB_VSPRINTF_POSIX=0; | |
15695 | HAVE_DECL_FPURGE=1; | |
15696 | HAVE_DECL_FSEEKO=1; | |
15697 | HAVE_DECL_FTELLO=1; | |
15698 | HAVE_DECL_GETDELIM=1; | |
15699 | HAVE_DECL_GETLINE=1; | |
15700 | HAVE_DECL_OBSTACK_PRINTF=1; | |
15701 | HAVE_DECL_SNPRINTF=1; | |
15702 | HAVE_DECL_VSNPRINTF=1; | |
15703 | HAVE_DPRINTF=1; | |
15704 | HAVE_FSEEKO=1; | |
15705 | HAVE_FTELLO=1; | |
15706 | HAVE_PCLOSE=1; | |
15707 | HAVE_POPEN=1; | |
15708 | HAVE_RENAMEAT=1; | |
15709 | HAVE_VASPRINTF=1; | |
15710 | HAVE_VDPRINTF=1; | |
15711 | REPLACE_DPRINTF=0; | |
15712 | REPLACE_FCLOSE=0; | |
15713 | REPLACE_FDOPEN=0; | |
15714 | REPLACE_FFLUSH=0; | |
15715 | REPLACE_FOPEN=0; | |
15716 | REPLACE_FPRINTF=0; | |
15717 | REPLACE_FPURGE=0; | |
15718 | REPLACE_FREOPEN=0; | |
15719 | REPLACE_FSEEK=0; | |
15720 | REPLACE_FSEEKO=0; | |
15721 | REPLACE_FTELL=0; | |
15722 | REPLACE_FTELLO=0; | |
15723 | REPLACE_GETDELIM=0; | |
15724 | REPLACE_GETLINE=0; | |
15725 | REPLACE_OBSTACK_PRINTF=0; | |
15726 | REPLACE_PERROR=0; | |
15727 | REPLACE_POPEN=0; | |
15728 | REPLACE_PRINTF=0; | |
15729 | REPLACE_REMOVE=0; | |
15730 | REPLACE_RENAME=0; | |
15731 | REPLACE_RENAMEAT=0; | |
15732 | REPLACE_SNPRINTF=0; | |
15733 | REPLACE_SPRINTF=0; | |
15734 | REPLACE_STDIO_READ_FUNCS=0; | |
15735 | REPLACE_STDIO_WRITE_FUNCS=0; | |
15736 | REPLACE_TMPFILE=0; | |
15737 | REPLACE_VASPRINTF=0; | |
15738 | REPLACE_VDPRINTF=0; | |
15739 | REPLACE_VFPRINTF=0; | |
15740 | REPLACE_VPRINTF=0; | |
15741 | REPLACE_VSNPRINTF=0; | |
15742 | REPLACE_VSPRINTF=0; | |
15743 | ||
15744 | ||
15745 | ||
15746 | ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default" | |
15747 | if test "x$ac_cv_have_decl_setenv" = xyes; then : | |
15748 | ac_have_decl=1 | |
6ec2e0f5 | 15749 | else |
c0c3707f | 15750 | ac_have_decl=0 |
6ec2e0f5 | 15751 | fi |
c0c3707f CB |
15752 | |
15753 | cat >>confdefs.h <<_ACEOF | |
15754 | #define HAVE_DECL_SETENV $ac_have_decl | |
15755 | _ACEOF | |
15756 | ||
15757 | ||
15758 | ||
15759 | ||
15760 | ||
15761 | ||
15762 | if test $ac_cv_have_decl_setenv = no; then | |
15763 | HAVE_DECL_SETENV=0 | |
6ec2e0f5 SDJ |
15764 | fi |
15765 | ||
15766 | ||
15767 | ||
15768 | ||
15769 | ||
c0c3707f CB |
15770 | for ac_header in search.h |
15771 | do : | |
15772 | ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default" | |
15773 | if test "x$ac_cv_header_search_h" = xyes; then : | |
15774 | cat >>confdefs.h <<_ACEOF | |
15775 | #define HAVE_SEARCH_H 1 | |
15776 | _ACEOF | |
6ec2e0f5 | 15777 | |
c0c3707f | 15778 | fi |
6ec2e0f5 | 15779 | |
c0c3707f | 15780 | done |
6ec2e0f5 | 15781 | |
c0c3707f CB |
15782 | for ac_func in tsearch |
15783 | do : | |
15784 | ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch" | |
15785 | if test "x$ac_cv_func_tsearch" = xyes; then : | |
15786 | cat >>confdefs.h <<_ACEOF | |
15787 | #define HAVE_TSEARCH 1 | |
15788 | _ACEOF | |
6ec2e0f5 | 15789 | |
c0c3707f CB |
15790 | fi |
15791 | done | |
6ec2e0f5 SDJ |
15792 | |
15793 | ||
15794 | ||
15795 | ||
c0c3707f CB |
15796 | GNULIB_PTHREAD_SIGMASK=0; |
15797 | GNULIB_RAISE=0; | |
15798 | GNULIB_SIGNAL_H_SIGPIPE=0; | |
15799 | GNULIB_SIGPROCMASK=0; | |
15800 | GNULIB_SIGACTION=0; | |
15801 | HAVE_POSIX_SIGNALBLOCKING=1; | |
15802 | HAVE_PTHREAD_SIGMASK=1; | |
15803 | HAVE_RAISE=1; | |
15804 | HAVE_SIGSET_T=1; | |
15805 | HAVE_SIGINFO_T=1; | |
15806 | HAVE_SIGACTION=1; | |
15807 | HAVE_STRUCT_SIGACTION_SA_SIGACTION=1; | |
6ec2e0f5 | 15808 | |
c0c3707f | 15809 | HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1; |
6ec2e0f5 | 15810 | |
c0c3707f CB |
15811 | HAVE_SIGHANDLER_T=1; |
15812 | REPLACE_PTHREAD_SIGMASK=0; | |
15813 | REPLACE_RAISE=0; | |
6ec2e0f5 | 15814 | |
6ec2e0f5 | 15815 | |
c0c3707f CB |
15816 | ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" " |
15817 | #include <signal.h> | |
15818 | /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */ | |
15819 | #include <sys/types.h> | |
15820 | ||
15821 | " | |
15822 | if test "x$ac_cv_type_sigset_t" = xyes; then : | |
15823 | ||
15824 | cat >>confdefs.h <<_ACEOF | |
15825 | #define HAVE_SIGSET_T 1 | |
15826 | _ACEOF | |
15827 | ||
15828 | gl_cv_type_sigset_t=yes | |
15829 | else | |
15830 | gl_cv_type_sigset_t=no | |
15831 | fi | |
6ec2e0f5 | 15832 | |
c0c3707f CB |
15833 | if test $gl_cv_type_sigset_t != yes; then |
15834 | HAVE_SIGSET_T=0 | |
15835 | fi | |
6ec2e0f5 | 15836 | |
c0c3707f CB |
15837 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 |
15838 | $as_echo_n "checking for uid_t in sys/types.h... " >&6; } | |
15839 | if ${ac_cv_type_uid_t+:} false; then : | |
15840 | $as_echo_n "(cached) " >&6 | |
15841 | else | |
6ec2e0f5 SDJ |
15842 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
15843 | /* end confdefs.h. */ | |
c0c3707f CB |
15844 | #include <sys/types.h> |
15845 | ||
6ec2e0f5 | 15846 | _ACEOF |
c0c3707f CB |
15847 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
15848 | $EGREP "uid_t" >/dev/null 2>&1; then : | |
15849 | ac_cv_type_uid_t=yes | |
15850 | else | |
15851 | ac_cv_type_uid_t=no | |
15852 | fi | |
15853 | rm -f conftest* | |
6ec2e0f5 | 15854 | |
c0c3707f CB |
15855 | fi |
15856 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 | |
15857 | $as_echo "$ac_cv_type_uid_t" >&6; } | |
15858 | if test $ac_cv_type_uid_t = no; then | |
6ec2e0f5 | 15859 | |
c0c3707f | 15860 | $as_echo "#define uid_t int" >>confdefs.h |
6ec2e0f5 | 15861 | |
6ec2e0f5 | 15862 | |
c0c3707f | 15863 | $as_echo "#define gid_t int" >>confdefs.h |
6ec2e0f5 SDJ |
15864 | |
15865 | fi | |
6ec2e0f5 | 15866 | |
c0c3707f CB |
15867 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 |
15868 | $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } | |
15869 | if ${ac_cv_header_stdbool_h+:} false; then : | |
15870 | $as_echo_n "(cached) " >&6 | |
15871 | else | |
15872 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15873 | /* end confdefs.h. */ | |
15874 | ||
15875 | #include <stdbool.h> | |
15876 | ||
15877 | #ifdef __cplusplus | |
15878 | typedef bool Bool; | |
15879 | #else | |
15880 | typedef _Bool Bool; | |
15881 | #ifndef bool | |
15882 | "error: bool is not defined" | |
15883 | #endif | |
15884 | #ifndef false | |
15885 | "error: false is not defined" | |
15886 | #endif | |
15887 | #if false | |
15888 | "error: false is not 0" | |
15889 | #endif | |
15890 | #ifndef true | |
15891 | "error: true is not defined" | |
15892 | #endif | |
15893 | #if true != 1 | |
15894 | "error: true is not 1" | |
15895 | #endif | |
15896 | #endif | |
15897 | ||
15898 | #ifndef __bool_true_false_are_defined | |
15899 | "error: __bool_true_false_are_defined is not defined" | |
15900 | #endif | |
15901 | ||
15902 | struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s; | |
15903 | ||
15904 | char a[true == 1 ? 1 : -1]; | |
15905 | char b[false == 0 ? 1 : -1]; | |
15906 | char c[__bool_true_false_are_defined == 1 ? 1 : -1]; | |
15907 | char d[(bool) 0.5 == true ? 1 : -1]; | |
15908 | /* See body of main program for 'e'. */ | |
15909 | char f[(Bool) 0.0 == false ? 1 : -1]; | |
15910 | char g[true]; | |
15911 | char h[sizeof (Bool)]; | |
15912 | char i[sizeof s.t]; | |
15913 | enum { j = false, k = true, l = false * true, m = true * 256 }; | |
15914 | /* The following fails for | |
15915 | HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ | |
15916 | Bool n[m]; | |
15917 | char o[sizeof n == m * sizeof n[0] ? 1 : -1]; | |
15918 | char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; | |
15919 | /* Catch a bug in an HP-UX C compiler. See | |
15920 | https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html | |
15921 | https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html | |
15922 | */ | |
15923 | Bool q = true; | |
15924 | Bool *pq = &q; | |
15925 | bool *qq = &q; | |
6ec2e0f5 | 15926 | |
c0c3707f CB |
15927 | int |
15928 | main () | |
15929 | { | |
6ec2e0f5 | 15930 | |
c0c3707f CB |
15931 | bool e = &s; |
15932 | *pq |= q; *pq |= ! q; | |
15933 | *qq |= q; *qq |= ! q; | |
15934 | /* Refer to every declared value, to avoid compiler optimizations. */ | |
15935 | return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l | |
15936 | + !m + !n + !o + !p + !q + !pq + !qq); | |
6ec2e0f5 | 15937 | |
c0c3707f CB |
15938 | ; |
15939 | return 0; | |
15940 | } | |
15941 | _ACEOF | |
15942 | if ac_fn_c_try_compile "$LINENO"; then : | |
15943 | ac_cv_header_stdbool_h=yes | |
15944 | else | |
15945 | ac_cv_header_stdbool_h=no | |
15946 | fi | |
15947 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
15948 | fi | |
15949 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 | |
15950 | $as_echo "$ac_cv_header_stdbool_h" >&6; } | |
15951 | ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" | |
15952 | if test "x$ac_cv_type__Bool" = xyes; then : | |
6ec2e0f5 | 15953 | |
c0c3707f CB |
15954 | cat >>confdefs.h <<_ACEOF |
15955 | #define HAVE__BOOL 1 | |
15956 | _ACEOF | |
6ec2e0f5 SDJ |
15957 | |
15958 | ||
c0c3707f | 15959 | fi |
6ec2e0f5 SDJ |
15960 | |
15961 | ||
472fa5ee | 15962 | |
f8e27d88 | 15963 | |
c0c3707f CB |
15964 | ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default" |
15965 | if test "x$ac_cv_have_decl_strdup" = xyes; then : | |
6ec2e0f5 SDJ |
15966 | ac_have_decl=1 |
15967 | else | |
15968 | ac_have_decl=0 | |
15969 | fi | |
15970 | ||
15971 | cat >>confdefs.h <<_ACEOF | |
c0c3707f | 15972 | #define HAVE_DECL_STRDUP $ac_have_decl |
6ec2e0f5 SDJ |
15973 | _ACEOF |
15974 | ||
15975 | ||
c0c3707f CB |
15976 | REPLACE_STRERROR_0=0 |
15977 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5 | |
15978 | $as_echo_n "checking whether strerror(0) succeeds... " >&6; } | |
15979 | if ${gl_cv_func_strerror_0_works+:} false; then : | |
6ec2e0f5 SDJ |
15980 | $as_echo_n "(cached) " >&6 |
15981 | else | |
c0c3707f CB |
15982 | if test "$cross_compiling" = yes; then : |
15983 | case "$host_os" in | |
15984 | # Guess yes on glibc systems. | |
15985 | *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; | |
15986 | # Guess yes on musl systems. | |
15987 | *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;; | |
15988 | # Guess yes on native Windows. | |
15989 | mingw*) gl_cv_func_strerror_0_works="guessing yes" ;; | |
15990 | # If we don't know, obey --enable-cross-guesses. | |
15991 | *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;; | |
15992 | esac | |
6ec2e0f5 | 15993 | |
5e8754f9 SDJ |
15994 | else |
15995 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
15996 | /* end confdefs.h. */ | |
c0c3707f CB |
15997 | #include <string.h> |
15998 | #include <errno.h> | |
6ec2e0f5 | 15999 | |
5e8754f9 SDJ |
16000 | int |
16001 | main () | |
16002 | { | |
c0c3707f CB |
16003 | int result = 0; |
16004 | char *str; | |
16005 | errno = 0; | |
16006 | str = strerror (0); | |
16007 | if (!*str) result |= 1; | |
16008 | if (errno) result |= 2; | |
16009 | if (strstr (str, "nknown") || strstr (str, "ndefined")) | |
16010 | result |= 4; | |
16011 | return result; | |
5e8754f9 SDJ |
16012 | ; |
16013 | return 0; | |
16014 | } | |
16015 | _ACEOF | |
c0c3707f CB |
16016 | if ac_fn_c_try_run "$LINENO"; then : |
16017 | gl_cv_func_strerror_0_works=yes | |
5e8754f9 | 16018 | else |
c0c3707f | 16019 | gl_cv_func_strerror_0_works=no |
5e8754f9 | 16020 | fi |
c0c3707f CB |
16021 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
16022 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
5e8754f9 | 16023 | fi |
6ec2e0f5 | 16024 | |
6ec2e0f5 | 16025 | |
c0c3707f CB |
16026 | fi |
16027 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5 | |
16028 | $as_echo "$gl_cv_func_strerror_0_works" >&6; } | |
16029 | case "$gl_cv_func_strerror_0_works" in | |
16030 | *yes) ;; | |
16031 | *) | |
16032 | REPLACE_STRERROR_0=1 | |
6ec2e0f5 | 16033 | |
c0c3707f | 16034 | $as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h |
6ec2e0f5 | 16035 | |
c0c3707f CB |
16036 | ;; |
16037 | esac | |
6ec2e0f5 SDJ |
16038 | |
16039 | ||
16040 | ||
16041 | ||
472fa5ee SM |
16042 | |
16043 | ||
16044 | ||
725e2999 | 16045 | |
725e2999 JB |
16046 | |
16047 | ||
c0c3707f CB |
16048 | if test $ac_cv_func_strerror_r = yes; then |
16049 | if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then | |
16050 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5 | |
16051 | $as_echo_n "checking for strerror_r with POSIX signature... " >&6; } | |
16052 | if ${gl_cv_func_strerror_r_posix_signature+:} false; then : | |
16053 | $as_echo_n "(cached) " >&6 | |
16054 | else | |
16055 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16056 | /* end confdefs.h. */ | |
16057 | #include <string.h> | |
16058 | int strerror_r (int, char *, size_t); | |
725e2999 | 16059 | |
c0c3707f CB |
16060 | int |
16061 | main () | |
16062 | { | |
725e2999 | 16063 | |
c0c3707f CB |
16064 | ; |
16065 | return 0; | |
16066 | } | |
16067 | _ACEOF | |
16068 | if ac_fn_c_try_compile "$LINENO"; then : | |
16069 | gl_cv_func_strerror_r_posix_signature=yes | |
16070 | else | |
16071 | gl_cv_func_strerror_r_posix_signature=no | |
16072 | fi | |
16073 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
725e2999 | 16074 | |
c0c3707f CB |
16075 | fi |
16076 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5 | |
16077 | $as_echo "$gl_cv_func_strerror_r_posix_signature" >&6; } | |
16078 | if test $gl_cv_func_strerror_r_posix_signature = yes; then | |
16079 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5 | |
16080 | $as_echo_n "checking whether strerror_r works... " >&6; } | |
16081 | if ${gl_cv_func_strerror_r_works+:} false; then : | |
16082 | $as_echo_n "(cached) " >&6 | |
16083 | else | |
16084 | if test "$cross_compiling" = yes; then : | |
725e2999 | 16085 | |
c0c3707f CB |
16086 | case "$host_os" in |
16087 | # Guess no on AIX. | |
16088 | aix*) gl_cv_func_strerror_r_works="guessing no";; | |
16089 | # Guess no on HP-UX. | |
16090 | hpux*) gl_cv_func_strerror_r_works="guessing no";; | |
16091 | # Guess no on BSD variants. | |
16092 | *bsd*) gl_cv_func_strerror_r_works="guessing no";; | |
16093 | # Guess yes otherwise. | |
16094 | *) gl_cv_func_strerror_r_works="guessing yes";; | |
16095 | esac | |
725e2999 | 16096 | |
c0c3707f CB |
16097 | else |
16098 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16099 | /* end confdefs.h. */ | |
16100 | #include <errno.h> | |
16101 | #include <string.h> | |
725e2999 | 16102 | |
c0c3707f CB |
16103 | int |
16104 | main () | |
16105 | { | |
16106 | int result = 0; | |
16107 | char buf[79]; | |
16108 | if (strerror_r (EACCES, buf, 0) < 0) | |
16109 | result |= 1; | |
16110 | errno = 0; | |
16111 | if (strerror_r (EACCES, buf, sizeof buf) != 0) | |
16112 | result |= 2; | |
16113 | strcpy (buf, "Unknown"); | |
16114 | if (strerror_r (0, buf, sizeof buf) != 0) | |
16115 | result |= 4; | |
16116 | if (errno) | |
16117 | result |= 8; | |
16118 | if (strstr (buf, "nknown") || strstr (buf, "ndefined")) | |
16119 | result |= 0x10; | |
16120 | errno = 0; | |
16121 | *buf = 0; | |
16122 | if (strerror_r (-3, buf, sizeof buf) < 0) | |
16123 | result |= 0x20; | |
16124 | if (errno) | |
16125 | result |= 0x40; | |
16126 | if (!*buf) | |
16127 | result |= 0x80; | |
16128 | return result; | |
725e2999 | 16129 | |
c0c3707f CB |
16130 | ; |
16131 | return 0; | |
16132 | } | |
16133 | _ACEOF | |
16134 | if ac_fn_c_try_run "$LINENO"; then : | |
16135 | gl_cv_func_strerror_r_works=yes | |
16136 | else | |
16137 | gl_cv_func_strerror_r_works=no | |
16138 | fi | |
16139 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
16140 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
16141 | fi | |
725e2999 JB |
16142 | |
16143 | ||
c0c3707f CB |
16144 | fi |
16145 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 | |
16146 | $as_echo "$gl_cv_func_strerror_r_works" >&6; } | |
16147 | else | |
725e2999 | 16148 | |
c0c3707f CB |
16149 | if test $ac_cv_func___xpg_strerror_r = yes; then |
16150 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5 | |
16151 | $as_echo_n "checking whether __xpg_strerror_r works... " >&6; } | |
16152 | if ${gl_cv_func_strerror_r_works+:} false; then : | |
725e2999 JB |
16153 | $as_echo_n "(cached) " >&6 |
16154 | else | |
c0c3707f CB |
16155 | if test "$cross_compiling" = yes; then : |
16156 | gl_cv_func_strerror_r_works="$gl_cross_guess_normal" | |
725e2999 | 16157 | |
c0c3707f CB |
16158 | else |
16159 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
725e2999 | 16160 | /* end confdefs.h. */ |
c0c3707f CB |
16161 | #include <errno.h> |
16162 | #include <string.h> | |
16163 | extern | |
16164 | #ifdef __cplusplus | |
16165 | "C" | |
16166 | #endif | |
16167 | int __xpg_strerror_r(int, char *, size_t); | |
725e2999 | 16168 | |
c0c3707f CB |
16169 | int |
16170 | main () | |
16171 | { | |
16172 | int result = 0; | |
16173 | char buf[256] = "^"; | |
16174 | char copy[256]; | |
16175 | char *str = strerror (-1); | |
16176 | strcpy (copy, str); | |
16177 | if (__xpg_strerror_r (-2, buf, 1) == 0) | |
16178 | result |= 1; | |
16179 | if (*buf) | |
16180 | result |= 2; | |
16181 | __xpg_strerror_r (-2, buf, 256); | |
16182 | if (strcmp (str, copy)) | |
16183 | result |= 4; | |
16184 | return result; | |
725e2999 | 16185 | |
c0c3707f CB |
16186 | ; |
16187 | return 0; | |
16188 | } | |
725e2999 | 16189 | _ACEOF |
c0c3707f CB |
16190 | if ac_fn_c_try_run "$LINENO"; then : |
16191 | gl_cv_func_strerror_r_works=yes | |
725e2999 | 16192 | else |
c0c3707f | 16193 | gl_cv_func_strerror_r_works=no |
725e2999 | 16194 | fi |
c0c3707f CB |
16195 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
16196 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
725e2999 | 16197 | fi |
725e2999 | 16198 | |
725e2999 | 16199 | |
c0c3707f CB |
16200 | fi |
16201 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5 | |
16202 | $as_echo "$gl_cv_func_strerror_r_works" >&6; } | |
16203 | fi | |
16204 | fi | |
725e2999 | 16205 | fi |
725e2999 JB |
16206 | fi |
16207 | ||
c0c3707f CB |
16208 | ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" |
16209 | if test "x$ac_cv_have_decl_strerror_r" = xyes; then : | |
16210 | ac_have_decl=1 | |
725e2999 | 16211 | else |
c0c3707f | 16212 | ac_have_decl=0 |
725e2999 JB |
16213 | fi |
16214 | ||
c0c3707f CB |
16215 | cat >>confdefs.h <<_ACEOF |
16216 | #define HAVE_DECL_STRERROR_R $ac_have_decl | |
16217 | _ACEOF | |
725e2999 JB |
16218 | |
16219 | ||
16220 | ||
16221 | ||
16222 | ||
725e2999 JB |
16223 | |
16224 | ||
16225 | ||
725e2999 JB |
16226 | |
16227 | ||
16228 | ||
16229 | ||
16230 | ||
16231 | ||
16232 | ||
16233 | ||
16234 | if test $gl_cv_have_include_next = yes; then | |
c0c3707f | 16235 | gl_cv_next_string_h='<'string.h'>' |
725e2999 | 16236 | else |
c0c3707f CB |
16237 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5 |
16238 | $as_echo_n "checking absolute name of <string.h>... " >&6; } | |
16239 | if ${gl_cv_next_string_h+:} false; then : | |
725e2999 JB |
16240 | $as_echo_n "(cached) " >&6 |
16241 | else | |
16242 | ||
725e2999 JB |
16243 | |
16244 | ||
16245 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16246 | /* end confdefs.h. */ | |
c0c3707f | 16247 | #include <string.h> |
725e2999 JB |
16248 | _ACEOF |
16249 | case "$host_os" in | |
16250 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
16251 | *) gl_absname_cpp="$ac_cpp" ;; | |
16252 | esac | |
16253 | ||
16254 | case "$host_os" in | |
16255 | mingw*) | |
16256 | gl_dirsep_regex='[/\\]' | |
16257 | ;; | |
16258 | *) | |
16259 | gl_dirsep_regex='\/' | |
16260 | ;; | |
16261 | esac | |
16262 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
c0c3707f | 16263 | gl_header_literal_regex=`echo 'string.h' \ |
725e2999 JB |
16264 | | sed -e "$gl_make_literal_regex_sed"` |
16265 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
16266 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
16267 | s|^/[^/]|//&| | |
16268 | p | |
16269 | q | |
16270 | }' | |
6ec2e0f5 | 16271 | |
c0c3707f | 16272 | gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
725e2999 | 16273 | sed -n "$gl_absolute_header_sed"` |
6ec2e0f5 | 16274 | |
c0c3707f CB |
16275 | gl_header=$gl_cv_absolute_string_h |
16276 | gl_cv_next_string_h='"'$gl_header'"' | |
6ec2e0f5 SDJ |
16277 | |
16278 | ||
725e2999 | 16279 | fi |
c0c3707f CB |
16280 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 |
16281 | $as_echo "$gl_cv_next_string_h" >&6; } | |
725e2999 | 16282 | fi |
c0c3707f | 16283 | NEXT_STRING_H=$gl_cv_next_string_h |
6ec2e0f5 | 16284 | |
725e2999 JB |
16285 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
16286 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
c0c3707f | 16287 | gl_next_as_first_directive='<'string.h'>' |
725e2999 JB |
16288 | else |
16289 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
c0c3707f | 16290 | gl_next_as_first_directive=$gl_cv_next_string_h |
725e2999 | 16291 | fi |
c0c3707f CB |
16292 | NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive |
16293 | ||
16294 | ||
16295 | ||
6ec2e0f5 SDJ |
16296 | |
16297 | ||
16298 | ||
16299 | ||
16300 | ||
6ec2e0f5 SDJ |
16301 | |
16302 | ||
6ec2e0f5 | 16303 | |
c0c3707f CB |
16304 | |
16305 | if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then | |
16306 | REPLACE_STRSTR=1 | |
16307 | else | |
16308 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5 | |
16309 | $as_echo_n "checking whether strstr works... " >&6; } | |
16310 | if ${gl_cv_func_strstr_works_always+:} false; then : | |
6ec2e0f5 SDJ |
16311 | $as_echo_n "(cached) " >&6 |
16312 | else | |
c0c3707f CB |
16313 | if test "$cross_compiling" = yes; then : |
16314 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 SDJ |
16315 | /* end confdefs.h. */ |
16316 | ||
c0c3707f CB |
16317 | #ifdef __GNU_LIBRARY__ |
16318 | #include <features.h> | |
16319 | #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ | |
16320 | || defined __UCLIBC__ | |
16321 | Lucky user | |
16322 | #endif | |
16323 | #elif defined __CYGWIN__ | |
16324 | #include <cygwin/version.h> | |
16325 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) | |
16326 | Lucky user | |
16327 | #endif | |
16328 | #else | |
16329 | Lucky user | |
6ec2e0f5 | 16330 | #endif |
c0c3707f CB |
16331 | |
16332 | _ACEOF | |
16333 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
16334 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
16335 | gl_cv_func_strstr_works_always="guessing yes" | |
16336 | else | |
16337 | gl_cv_func_strstr_works_always="$gl_cross_guess_normal" | |
16338 | fi | |
16339 | rm -f conftest* | |
16340 | ||
16341 | ||
16342 | else | |
16343 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16344 | /* end confdefs.h. */ | |
16345 | ||
16346 | #include <string.h> /* for strstr */ | |
16347 | #ifdef __GNU_LIBRARY__ | |
16348 | #include <features.h> | |
16349 | #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28 | |
16350 | Unlucky user | |
16351 | #endif | |
725e2999 | 16352 | #endif |
c0c3707f CB |
16353 | #define P "_EF_BF_BD" |
16354 | #define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P | |
16355 | #define NEEDLE P P P P P | |
6ec2e0f5 | 16356 | |
725e2999 JB |
16357 | int |
16358 | main () | |
16359 | { | |
c0c3707f CB |
16360 | return !!strstr (HAYSTACK, NEEDLE); |
16361 | ||
725e2999 JB |
16362 | ; |
16363 | return 0; | |
16364 | } | |
6ec2e0f5 | 16365 | _ACEOF |
c0c3707f CB |
16366 | if ac_fn_c_try_run "$LINENO"; then : |
16367 | gl_cv_func_strstr_works_always=yes | |
6ec2e0f5 | 16368 | else |
c0c3707f | 16369 | gl_cv_func_strstr_works_always=no |
6ec2e0f5 | 16370 | fi |
c0c3707f CB |
16371 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
16372 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
6ec2e0f5 | 16373 | fi |
6ec2e0f5 SDJ |
16374 | |
16375 | ||
c0c3707f CB |
16376 | fi |
16377 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5 | |
16378 | $as_echo "$gl_cv_func_strstr_works_always" >&6; } | |
16379 | case "$gl_cv_func_strstr_works_always" in | |
16380 | *yes) ;; | |
16381 | *) | |
16382 | REPLACE_STRSTR=1 | |
16383 | ;; | |
16384 | esac | |
16385 | fi | |
6ec2e0f5 | 16386 | |
c0c3707f CB |
16387 | ac_fn_c_check_decl "$LINENO" "strtok_r" "ac_cv_have_decl_strtok_r" "$ac_includes_default" |
16388 | if test "x$ac_cv_have_decl_strtok_r" = xyes; then : | |
16389 | ac_have_decl=1 | |
16390 | else | |
16391 | ac_have_decl=0 | |
16392 | fi | |
6ec2e0f5 | 16393 | |
c0c3707f CB |
16394 | cat >>confdefs.h <<_ACEOF |
16395 | #define HAVE_DECL_STRTOK_R $ac_have_decl | |
16396 | _ACEOF | |
6ec2e0f5 SDJ |
16397 | |
16398 | ||
16399 | ||
16400 | ||
6ec2e0f5 SDJ |
16401 | |
16402 | ||
16403 | ||
16404 | ||
16405 | ||
16406 | ||
16407 | ||
c0c3707f | 16408 | $as_echo "#define _USE_STD_STAT 1" >>confdefs.h |
6ec2e0f5 | 16409 | |
6ec2e0f5 SDJ |
16410 | |
16411 | ||
16412 | ||
16413 | ||
16414 | ||
6ec2e0f5 SDJ |
16415 | |
16416 | ||
16417 | ||
16418 | ||
16419 | ||
c0c3707f CB |
16420 | if test $gl_cv_have_include_next = yes; then |
16421 | gl_cv_next_sys_types_h='<'sys/types.h'>' | |
16422 | else | |
16423 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5 | |
16424 | $as_echo_n "checking absolute name of <sys/types.h>... " >&6; } | |
16425 | if ${gl_cv_next_sys_types_h+:} false; then : | |
6ec2e0f5 SDJ |
16426 | $as_echo_n "(cached) " >&6 |
16427 | else | |
6ec2e0f5 | 16428 | |
6ec2e0f5 | 16429 | |
c0c3707f CB |
16430 | |
16431 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16432 | /* end confdefs.h. */ | |
16433 | #include <sys/types.h> | |
6ec2e0f5 | 16434 | _ACEOF |
c0c3707f CB |
16435 | case "$host_os" in |
16436 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
16437 | *) gl_absname_cpp="$ac_cpp" ;; | |
16438 | esac | |
6ec2e0f5 | 16439 | |
c0c3707f CB |
16440 | case "$host_os" in |
16441 | mingw*) | |
16442 | gl_dirsep_regex='[/\\]' | |
16443 | ;; | |
16444 | *) | |
16445 | gl_dirsep_regex='\/' | |
16446 | ;; | |
16447 | esac | |
16448 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
16449 | gl_header_literal_regex=`echo 'sys/types.h' \ | |
16450 | | sed -e "$gl_make_literal_regex_sed"` | |
16451 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
16452 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
16453 | s|^/[^/]|//&| | |
16454 | p | |
16455 | q | |
16456 | }' | |
6ec2e0f5 | 16457 | |
c0c3707f CB |
16458 | gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
16459 | sed -n "$gl_absolute_header_sed"` | |
6ec2e0f5 | 16460 | |
c0c3707f CB |
16461 | gl_header=$gl_cv_absolute_sys_types_h |
16462 | gl_cv_next_sys_types_h='"'$gl_header'"' | |
6ec2e0f5 SDJ |
16463 | |
16464 | ||
c0c3707f CB |
16465 | fi |
16466 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5 | |
16467 | $as_echo "$gl_cv_next_sys_types_h" >&6; } | |
16468 | fi | |
16469 | NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h | |
6ec2e0f5 | 16470 | |
c0c3707f CB |
16471 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
16472 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
16473 | gl_next_as_first_directive='<'sys/types.h'>' | |
16474 | else | |
16475 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
16476 | gl_next_as_first_directive=$gl_cv_next_sys_types_h | |
16477 | fi | |
16478 | NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive | |
6ec2e0f5 SDJ |
16479 | |
16480 | ||
16481 | ||
16482 | ||
6ec2e0f5 | 16483 | |
6ec2e0f5 SDJ |
16484 | |
16485 | ||
6ec2e0f5 SDJ |
16486 | |
16487 | ||
16488 | ||
16489 | ||
16490 | ||
c0c3707f | 16491 | WINDOWS_STAT_INODES=0 |
6ec2e0f5 SDJ |
16492 | |
16493 | ||
16494 | ||
16495 | ||
16496 | ||
472fa5ee SM |
16497 | |
16498 | ||
16499 | ||
16500 | ||
c0c3707f CB |
16501 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5 |
16502 | $as_echo_n "checking for struct timespec in <time.h>... " >&6; } | |
16503 | if ${gl_cv_sys_struct_timespec_in_time_h+:} false; then : | |
16504 | $as_echo_n "(cached) " >&6 | |
16505 | else | |
16506 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16507 | /* end confdefs.h. */ | |
16508 | #include <time.h> | |
472fa5ee | 16509 | |
c0c3707f CB |
16510 | int |
16511 | main () | |
16512 | { | |
16513 | static struct timespec x; x.tv_sec = x.tv_nsec; | |
16514 | ; | |
16515 | return 0; | |
16516 | } | |
6ec2e0f5 | 16517 | _ACEOF |
c0c3707f CB |
16518 | if ac_fn_c_try_compile "$LINENO"; then : |
16519 | gl_cv_sys_struct_timespec_in_time_h=yes | |
16520 | else | |
16521 | gl_cv_sys_struct_timespec_in_time_h=no | |
6ec2e0f5 | 16522 | fi |
c0c3707f CB |
16523 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
16524 | fi | |
16525 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5 | |
16526 | $as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; } | |
6ec2e0f5 | 16527 | |
c0c3707f CB |
16528 | TIME_H_DEFINES_STRUCT_TIMESPEC=0 |
16529 | SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 | |
16530 | PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 | |
16531 | UNISTD_H_DEFINES_STRUCT_TIMESPEC=0 | |
16532 | if test $gl_cv_sys_struct_timespec_in_time_h = yes; then | |
16533 | TIME_H_DEFINES_STRUCT_TIMESPEC=1 | |
6ec2e0f5 | 16534 | else |
c0c3707f CB |
16535 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5 |
16536 | $as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; } | |
16537 | if ${gl_cv_sys_struct_timespec_in_sys_time_h+:} false; then : | |
16538 | $as_echo_n "(cached) " >&6 | |
16539 | else | |
16540 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16541 | /* end confdefs.h. */ | |
16542 | #include <sys/time.h> | |
472fa5ee | 16543 | |
c0c3707f CB |
16544 | int |
16545 | main () | |
16546 | { | |
16547 | static struct timespec x; x.tv_sec = x.tv_nsec; | |
16548 | ; | |
16549 | return 0; | |
16550 | } | |
16551 | _ACEOF | |
16552 | if ac_fn_c_try_compile "$LINENO"; then : | |
16553 | gl_cv_sys_struct_timespec_in_sys_time_h=yes | |
16554 | else | |
16555 | gl_cv_sys_struct_timespec_in_sys_time_h=no | |
16556 | fi | |
16557 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
16558 | fi | |
16559 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5 | |
16560 | $as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; } | |
16561 | if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then | |
16562 | SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 | |
16563 | else | |
16564 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5 | |
16565 | $as_echo_n "checking for struct timespec in <pthread.h>... " >&6; } | |
16566 | if ${gl_cv_sys_struct_timespec_in_pthread_h+:} false; then : | |
16567 | $as_echo_n "(cached) " >&6 | |
16568 | else | |
16569 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16570 | /* end confdefs.h. */ | |
16571 | #include <pthread.h> | |
472fa5ee | 16572 | |
c0c3707f CB |
16573 | int |
16574 | main () | |
16575 | { | |
16576 | static struct timespec x; x.tv_sec = x.tv_nsec; | |
16577 | ; | |
16578 | return 0; | |
16579 | } | |
16580 | _ACEOF | |
16581 | if ac_fn_c_try_compile "$LINENO"; then : | |
16582 | gl_cv_sys_struct_timespec_in_pthread_h=yes | |
16583 | else | |
16584 | gl_cv_sys_struct_timespec_in_pthread_h=no | |
16585 | fi | |
16586 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
16587 | fi | |
16588 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5 | |
16589 | $as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; } | |
16590 | if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then | |
16591 | PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 | |
16592 | else | |
16593 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5 | |
16594 | $as_echo_n "checking for struct timespec in <unistd.h>... " >&6; } | |
16595 | if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then : | |
16596 | $as_echo_n "(cached) " >&6 | |
16597 | else | |
16598 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16599 | /* end confdefs.h. */ | |
16600 | #include <unistd.h> | |
6ec2e0f5 | 16601 | |
c0c3707f CB |
16602 | int |
16603 | main () | |
16604 | { | |
16605 | static struct timespec x; x.tv_sec = x.tv_nsec; | |
16606 | ; | |
16607 | return 0; | |
16608 | } | |
16609 | _ACEOF | |
16610 | if ac_fn_c_try_compile "$LINENO"; then : | |
16611 | gl_cv_sys_struct_timespec_in_unistd_h=yes | |
16612 | else | |
16613 | gl_cv_sys_struct_timespec_in_unistd_h=no | |
16614 | fi | |
16615 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
16616 | fi | |
16617 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5 | |
16618 | $as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; } | |
16619 | if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then | |
16620 | UNISTD_H_DEFINES_STRUCT_TIMESPEC=1 | |
16621 | fi | |
6ec2e0f5 SDJ |
16622 | fi |
16623 | fi | |
c0c3707f | 16624 | fi |
6ec2e0f5 SDJ |
16625 | |
16626 | ||
16627 | ||
16628 | ||
16629 | ||
16630 | ||
6ec2e0f5 | 16631 | |
6ec2e0f5 SDJ |
16632 | |
16633 | ||
16634 | ||
16635 | ||
16636 | ||
6ec2e0f5 SDJ |
16637 | |
16638 | ||
16639 | ||
16640 | ||
c0c3707f CB |
16641 | if test $gl_cv_have_include_next = yes; then |
16642 | gl_cv_next_time_h='<'time.h'>' | |
16643 | else | |
16644 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5 | |
16645 | $as_echo_n "checking absolute name of <time.h>... " >&6; } | |
16646 | if ${gl_cv_next_time_h+:} false; then : | |
16647 | $as_echo_n "(cached) " >&6 | |
16648 | else | |
6ec2e0f5 | 16649 | |
6ec2e0f5 SDJ |
16650 | |
16651 | ||
c0c3707f CB |
16652 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
16653 | /* end confdefs.h. */ | |
16654 | #include <time.h> | |
16655 | _ACEOF | |
16656 | case "$host_os" in | |
16657 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
16658 | *) gl_absname_cpp="$ac_cpp" ;; | |
16659 | esac | |
6ec2e0f5 | 16660 | |
c0c3707f CB |
16661 | case "$host_os" in |
16662 | mingw*) | |
16663 | gl_dirsep_regex='[/\\]' | |
16664 | ;; | |
16665 | *) | |
16666 | gl_dirsep_regex='\/' | |
16667 | ;; | |
16668 | esac | |
16669 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
16670 | gl_header_literal_regex=`echo 'time.h' \ | |
16671 | | sed -e "$gl_make_literal_regex_sed"` | |
16672 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
16673 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
16674 | s|^/[^/]|//&| | |
16675 | p | |
16676 | q | |
16677 | }' | |
6ec2e0f5 | 16678 | |
c0c3707f CB |
16679 | gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
16680 | sed -n "$gl_absolute_header_sed"` | |
6ec2e0f5 | 16681 | |
c0c3707f CB |
16682 | gl_header=$gl_cv_absolute_time_h |
16683 | gl_cv_next_time_h='"'$gl_header'"' | |
6ec2e0f5 | 16684 | |
6ec2e0f5 SDJ |
16685 | |
16686 | fi | |
c0c3707f CB |
16687 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5 |
16688 | $as_echo "$gl_cv_next_time_h" >&6; } | |
16689 | fi | |
16690 | NEXT_TIME_H=$gl_cv_next_time_h | |
6ec2e0f5 | 16691 | |
c0c3707f CB |
16692 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
16693 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
16694 | gl_next_as_first_directive='<'time.h'>' | |
16695 | else | |
16696 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
16697 | gl_next_as_first_directive=$gl_cv_next_time_h | |
16698 | fi | |
16699 | NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive | |
6ec2e0f5 | 16700 | |
472fa5ee SM |
16701 | |
16702 | ||
16703 | ||
16704 | ||
16705 | ||
6ec2e0f5 | 16706 | |
6ec2e0f5 | 16707 | |
6ec2e0f5 | 16708 | |
6ec2e0f5 | 16709 | |
c0c3707f CB |
16710 | ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default" |
16711 | if test "x$ac_cv_have_decl_unsetenv" = xyes; then : | |
16712 | ac_have_decl=1 | |
16713 | else | |
16714 | ac_have_decl=0 | |
16715 | fi | |
6ec2e0f5 | 16716 | |
c0c3707f CB |
16717 | cat >>confdefs.h <<_ACEOF |
16718 | #define HAVE_DECL_UNSETENV $ac_have_decl | |
16719 | _ACEOF | |
6ec2e0f5 SDJ |
16720 | |
16721 | ||
c0c3707f CB |
16722 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5 |
16723 | $as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; } | |
16724 | if ${gl_cv_header_wchar_h_correct_inline+:} false; then : | |
16725 | $as_echo_n "(cached) " >&6 | |
16726 | else | |
16727 | gl_cv_header_wchar_h_correct_inline=yes | |
16728 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16729 | /* end confdefs.h. */ | |
6ec2e0f5 | 16730 | |
c0c3707f CB |
16731 | #define wcstod renamed_wcstod |
16732 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
16733 | <wchar.h>. | |
16734 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
16735 | included before <wchar.h>. */ | |
16736 | #include <stddef.h> | |
16737 | #include <stdio.h> | |
16738 | #include <time.h> | |
16739 | #include <wchar.h> | |
16740 | extern int zero (void); | |
16741 | int main () { return zero(); } | |
6ec2e0f5 | 16742 | |
c0c3707f CB |
16743 | _ACEOF |
16744 | save_ac_compile="$ac_compile" | |
16745 | ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` | |
16746 | if echo '#include "conftest.c"' >conftest1.c && | |
16747 | { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 | |
16748 | (eval $ac_compile) 2>&5 | |
16749 | ac_status=$? | |
16750 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
16751 | test $ac_status = 0; }; then | |
16752 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16753 | /* end confdefs.h. */ | |
6ec2e0f5 | 16754 | |
c0c3707f CB |
16755 | #define wcstod renamed_wcstod |
16756 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
16757 | <wchar.h>. | |
16758 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
16759 | included before <wchar.h>. */ | |
16760 | #include <stddef.h> | |
16761 | #include <stdio.h> | |
16762 | #include <time.h> | |
16763 | #include <wchar.h> | |
16764 | int zero (void) { return 0; } | |
6ec2e0f5 | 16765 | |
c0c3707f CB |
16766 | _ACEOF |
16767 | ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` | |
16768 | if echo '#include "conftest.c"' >conftest2.c && | |
16769 | { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 | |
16770 | (eval $ac_compile) 2>&5 | |
16771 | ac_status=$? | |
16772 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | |
16773 | test $ac_status = 0; }; then | |
16774 | if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then | |
16775 | : | |
16776 | else | |
16777 | gl_cv_header_wchar_h_correct_inline=no | |
16778 | fi | |
16779 | fi | |
16780 | fi | |
16781 | ac_compile="$save_ac_compile" | |
16782 | rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext | |
6ec2e0f5 | 16783 | |
c0c3707f CB |
16784 | fi |
16785 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 | |
16786 | $as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; } | |
16787 | if test $gl_cv_header_wchar_h_correct_inline = no; then | |
16788 | as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). | |
16789 | This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in | |
16790 | C99 mode. You have four options: | |
16791 | - Add the flag -fgnu89-inline to CC and reconfigure, or | |
16792 | - Fix your include files, using parts of | |
16793 | <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or | |
16794 | - Use a gcc version older than 4.3, or | |
16795 | - Don't use the flags -std=c99 or -std=gnu99. | |
16796 | Configuration aborted." "$LINENO" 5 | |
6ec2e0f5 SDJ |
16797 | fi |
16798 | ||
16799 | ||
16800 | ||
16801 | ||
16802 | ||
c0c3707f CB |
16803 | if test $ac_cv_header_crtdefs_h = yes; then |
16804 | HAVE_CRTDEFS_H=1 | |
16805 | else | |
16806 | HAVE_CRTDEFS_H=0 | |
5e8754f9 | 16807 | fi |
5e8754f9 | 16808 | |
5e8754f9 | 16809 | |
5e8754f9 | 16810 | |
c0c3707f | 16811 | GNULIB_ISWBLANK=0; |
5df4cba6 SM |
16812 | GNULIB_ISWDIGIT=0; |
16813 | GNULIB_ISWXDIGIT=0; | |
c0c3707f CB |
16814 | GNULIB_WCTYPE=0; |
16815 | GNULIB_ISWCTYPE=0; | |
16816 | GNULIB_WCTRANS=0; | |
16817 | GNULIB_TOWCTRANS=0; | |
16818 | HAVE_ISWBLANK=1; | |
16819 | HAVE_WCTYPE_T=1; | |
16820 | HAVE_WCTRANS_T=1; | |
16821 | REPLACE_ISWBLANK=0; | |
5df4cba6 SM |
16822 | REPLACE_ISWDIGIT=0; |
16823 | REPLACE_ISWXDIGIT=0; | |
5e8754f9 | 16824 | |
5e8754f9 | 16825 | |
5e8754f9 | 16826 | |
5e8754f9 | 16827 | |
c0c3707f CB |
16828 | if false; then |
16829 | GL_COND_LIBTOOL_TRUE= | |
16830 | GL_COND_LIBTOOL_FALSE='#' | |
16831 | else | |
16832 | GL_COND_LIBTOOL_TRUE='#' | |
16833 | GL_COND_LIBTOOL_FALSE= | |
16834 | fi | |
5e8754f9 | 16835 | |
c0c3707f CB |
16836 | gl_cond_libtool=false |
16837 | gl_libdeps= | |
16838 | gl_ltlibdeps= | |
16839 | gl_m4_base='import/m4' | |
5e8754f9 | 16840 | |
5e8754f9 SDJ |
16841 | |
16842 | ||
6ec2e0f5 | 16843 | |
6ec2e0f5 | 16844 | |
6ec2e0f5 | 16845 | |
6ec2e0f5 | 16846 | |
6ec2e0f5 | 16847 | |
6ec2e0f5 | 16848 | |
5df4cba6 | 16849 | |
c0c3707f CB |
16850 | gl_source_base='import' |
16851 | ||
6ec2e0f5 | 16852 | |
c0c3707f CB |
16853 | if test $ac_cv_func_alloca_works = no; then |
16854 | : | |
16855 | fi | |
6ec2e0f5 | 16856 | |
c0c3707f CB |
16857 | # Define an additional variable used in the Makefile substitution. |
16858 | if test $ac_cv_working_alloca_h = yes; then | |
16859 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5 | |
16860 | $as_echo_n "checking for alloca as a compiler built-in... " >&6; } | |
16861 | if ${gl_cv_rpl_alloca+:} false; then : | |
6ec2e0f5 SDJ |
16862 | $as_echo_n "(cached) " >&6 |
16863 | else | |
c0c3707f CB |
16864 | |
16865 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6ec2e0f5 SDJ |
16866 | /* end confdefs.h. */ |
16867 | ||
c0c3707f CB |
16868 | #if defined __GNUC__ || defined _AIX || defined _MSC_VER |
16869 | Need own alloca | |
16870 | #endif | |
6ec2e0f5 | 16871 | |
6ec2e0f5 | 16872 | _ACEOF |
c0c3707f CB |
16873 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
16874 | $EGREP "Need own alloca" >/dev/null 2>&1; then : | |
16875 | gl_cv_rpl_alloca=yes | |
6ec2e0f5 | 16876 | else |
c0c3707f | 16877 | gl_cv_rpl_alloca=no |
6ec2e0f5 | 16878 | fi |
c0c3707f | 16879 | rm -f conftest* |
6ec2e0f5 SDJ |
16880 | |
16881 | ||
16882 | fi | |
c0c3707f CB |
16883 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5 |
16884 | $as_echo "$gl_cv_rpl_alloca" >&6; } | |
16885 | if test $gl_cv_rpl_alloca = yes; then | |
6ec2e0f5 | 16886 | |
c0c3707f | 16887 | $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h |
6ec2e0f5 | 16888 | |
c0c3707f CB |
16889 | ALLOCA_H=alloca.h |
16890 | else | |
16891 | ALLOCA_H= | |
16892 | fi | |
16893 | else | |
16894 | ALLOCA_H=alloca.h | |
16895 | fi | |
6ec2e0f5 | 16896 | |
c0c3707f CB |
16897 | if test -n "$ALLOCA_H"; then |
16898 | GL_GENERATE_ALLOCA_H_TRUE= | |
16899 | GL_GENERATE_ALLOCA_H_FALSE='#' | |
16900 | else | |
16901 | GL_GENERATE_ALLOCA_H_TRUE='#' | |
16902 | GL_GENERATE_ALLOCA_H_FALSE= | |
16903 | fi | |
6ec2e0f5 SDJ |
16904 | |
16905 | ||
c0c3707f CB |
16906 | if test $ac_cv_working_alloca_h = yes; then |
16907 | HAVE_ALLOCA_H=1 | |
16908 | else | |
16909 | HAVE_ALLOCA_H=0 | |
16910 | fi | |
6ec2e0f5 SDJ |
16911 | |
16912 | ||
16913 | ||
16914 | ||
16915 | ||
16916 | ||
c0c3707f CB |
16917 | if test $ac_cv_header_arpa_inet_h = yes; then |
16918 | HAVE_ARPA_INET_H=1 | |
16919 | else | |
16920 | HAVE_ARPA_INET_H=0 | |
16921 | fi | |
6ec2e0f5 SDJ |
16922 | |
16923 | ||
472fa5ee SM |
16924 | |
16925 | ||
16926 | ||
16927 | ||
16928 | ||
6ec2e0f5 SDJ |
16929 | |
16930 | ||
16931 | ||
16932 | if test $gl_cv_have_include_next = yes; then | |
c0c3707f | 16933 | gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' |
6ec2e0f5 | 16934 | else |
c0c3707f CB |
16935 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5 |
16936 | $as_echo_n "checking absolute name of <arpa/inet.h>... " >&6; } | |
16937 | if ${gl_cv_next_arpa_inet_h+:} false; then : | |
6ec2e0f5 SDJ |
16938 | $as_echo_n "(cached) " >&6 |
16939 | else | |
16940 | ||
c0c3707f | 16941 | if test $ac_cv_header_arpa_inet_h = yes; then |
6ec2e0f5 SDJ |
16942 | |
16943 | ||
16944 | ||
16945 | ||
16946 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16947 | /* end confdefs.h. */ | |
c0c3707f | 16948 | #include <arpa/inet.h> |
6ec2e0f5 SDJ |
16949 | _ACEOF |
16950 | case "$host_os" in | |
16951 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
16952 | *) gl_absname_cpp="$ac_cpp" ;; | |
16953 | esac | |
16954 | ||
16955 | case "$host_os" in | |
16956 | mingw*) | |
16957 | gl_dirsep_regex='[/\\]' | |
16958 | ;; | |
16959 | *) | |
16960 | gl_dirsep_regex='\/' | |
16961 | ;; | |
16962 | esac | |
16963 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
c0c3707f | 16964 | gl_header_literal_regex=`echo 'arpa/inet.h' \ |
6ec2e0f5 SDJ |
16965 | | sed -e "$gl_make_literal_regex_sed"` |
16966 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
16967 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
16968 | s|^/[^/]|//&| | |
16969 | p | |
16970 | q | |
16971 | }' | |
16972 | ||
c0c3707f | 16973 | gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
6ec2e0f5 SDJ |
16974 | sed -n "$gl_absolute_header_sed"` |
16975 | ||
c0c3707f CB |
16976 | gl_header=$gl_cv_absolute_arpa_inet_h |
16977 | gl_cv_next_arpa_inet_h='"'$gl_header'"' | |
6ec2e0f5 | 16978 | else |
c0c3707f | 16979 | gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' |
6ec2e0f5 SDJ |
16980 | fi |
16981 | ||
c0c3707f | 16982 | |
6ec2e0f5 | 16983 | fi |
c0c3707f CB |
16984 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5 |
16985 | $as_echo "$gl_cv_next_arpa_inet_h" >&6; } | |
16986 | fi | |
16987 | NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h | |
6ec2e0f5 | 16988 | |
c0c3707f CB |
16989 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
16990 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
16991 | gl_next_as_first_directive='<'arpa/inet.h'>' | |
16992 | else | |
16993 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
16994 | gl_next_as_first_directive=$gl_cv_next_arpa_inet_h | |
16995 | fi | |
16996 | NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive | |
6ec2e0f5 SDJ |
16997 | |
16998 | ||
6ec2e0f5 | 16999 | |
6ec2e0f5 | 17000 | |
6ec2e0f5 SDJ |
17001 | |
17002 | ||
6ec2e0f5 SDJ |
17003 | |
17004 | ||
17005 | ||
c0c3707f CB |
17006 | if test $ac_cv_header_sys_socket_h = yes; then |
17007 | HAVE_WS2TCPIP_H=0 | |
17008 | else | |
17009 | if test $ac_cv_header_ws2tcpip_h = yes; then | |
17010 | HAVE_WS2TCPIP_H=1 | |
17011 | else | |
17012 | HAVE_WS2TCPIP_H=0 | |
17013 | fi | |
17014 | fi | |
17015 | ||
17016 | ||
6ec2e0f5 SDJ |
17017 | |
17018 | ||
6ec2e0f5 SDJ |
17019 | |
17020 | ||
17021 | ||
17022 | ||
17023 | ||
c0c3707f CB |
17024 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5 |
17025 | $as_echo_n "checking for __builtin_expect... " >&6; } | |
17026 | if ${gl_cv___builtin_expect+:} false; then : | |
6ec2e0f5 SDJ |
17027 | $as_echo_n "(cached) " >&6 |
17028 | else | |
c0c3707f CB |
17029 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
17030 | /* end confdefs.h. */ | |
17031 | ||
17032 | int | |
17033 | main (int argc, char **argv) | |
17034 | { | |
17035 | argc = __builtin_expect (argc, 100); | |
17036 | return argv[argc != 100][0]; | |
17037 | } | |
17038 | _ACEOF | |
17039 | if ac_fn_c_try_link "$LINENO"; then : | |
17040 | gl_cv___builtin_expect=yes | |
17041 | else | |
17042 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17043 | /* end confdefs.h. */ | |
17044 | ||
17045 | #include <builtins.h> | |
17046 | int | |
17047 | main (int argc, char **argv) | |
17048 | { | |
17049 | argc = __builtin_expect (argc, 100); | |
17050 | return argv[argc != 100][0]; | |
17051 | } | |
17052 | _ACEOF | |
17053 | if ac_fn_c_try_link "$LINENO"; then : | |
17054 | gl_cv___builtin_expect="in <builtins.h>" | |
17055 | else | |
17056 | gl_cv___builtin_expect=no | |
6ec2e0f5 | 17057 | fi |
c0c3707f CB |
17058 | rm -f core conftest.err conftest.$ac_objext \ |
17059 | conftest$ac_exeext conftest.$ac_ext | |
17060 | fi | |
17061 | rm -f core conftest.err conftest.$ac_objext \ | |
17062 | conftest$ac_exeext conftest.$ac_ext | |
17063 | fi | |
17064 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5 | |
17065 | $as_echo "$gl_cv___builtin_expect" >&6; } | |
17066 | if test "$gl_cv___builtin_expect" = yes; then | |
17067 | $as_echo "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h | |
8690e634 | 17068 | |
c0c3707f CB |
17069 | elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then |
17070 | $as_echo "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h | |
8690e634 | 17071 | |
6ec2e0f5 | 17072 | fi |
8690e634 JK |
17073 | |
17074 | ||
17075 | ||
17076 | ||
c0c3707f CB |
17077 | |
17078 | if test $ac_cv_func_canonicalize_file_name = no; then | |
17079 | HAVE_CANONICALIZE_FILE_NAME=0 | |
17080 | if test $ac_cv_func_realpath = no; then | |
17081 | HAVE_REALPATH=0 | |
17082 | else | |
17083 | case "$gl_cv_func_realpath_works" in | |
17084 | *yes) ;; | |
17085 | *) REPLACE_REALPATH=1 ;; | |
17086 | esac | |
17087 | fi | |
17088 | else | |
17089 | case "$gl_cv_func_realpath_works" in | |
17090 | *yes) | |
17091 | ;; | |
17092 | *) | |
17093 | REPLACE_CANONICALIZE_FILE_NAME=1 | |
17094 | REPLACE_REALPATH=1 | |
17095 | ;; | |
17096 | esac | |
5e8754f9 | 17097 | fi |
8690e634 | 17098 | |
c0c3707f | 17099 | if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then |
8690e634 JK |
17100 | |
17101 | ||
17102 | ||
472fa5ee SM |
17103 | |
17104 | ||
17105 | ||
17106 | ||
17107 | ||
c0c3707f CB |
17108 | gl_LIBOBJS="$gl_LIBOBJS canonicalize-lgpl.$ac_objext" |
17109 | ||
6ec2e0f5 | 17110 | fi |
8690e634 JK |
17111 | |
17112 | ||
c0c3707f CB |
17113 | cat >>confdefs.h <<_ACEOF |
17114 | #define GNULIB_CANONICALIZE_LGPL 1 | |
17115 | _ACEOF | |
8690e634 | 17116 | |
8690e634 | 17117 | |
8690e634 | 17118 | |
8690e634 | 17119 | |
8690e634 | 17120 | |
8690e634 | 17121 | |
8690e634 | 17122 | |
c0c3707f | 17123 | GNULIB_CANONICALIZE_FILE_NAME=1 |
8690e634 | 17124 | |
8690e634 | 17125 | |
8690e634 | 17126 | |
6ec2e0f5 SDJ |
17127 | |
17128 | ||
c0c3707f | 17129 | $as_echo "#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1" >>confdefs.h |
6ec2e0f5 | 17130 | |
6ec2e0f5 | 17131 | |
8690e634 JK |
17132 | |
17133 | ||
8690e634 JK |
17134 | |
17135 | ||
17136 | ||
17137 | ||
c0c3707f | 17138 | GNULIB_REALPATH=1 |
6ec2e0f5 SDJ |
17139 | |
17140 | ||
17141 | ||
17142 | ||
6ec2e0f5 | 17143 | |
c0c3707f | 17144 | $as_echo "#define GNULIB_TEST_REALPATH 1" >>confdefs.h |
6ec2e0f5 SDJ |
17145 | |
17146 | ||
17147 | ||
17148 | ||
17149 | ||
17150 | ||
17151 | ||
6ec2e0f5 | 17152 | |
c0c3707f | 17153 | GNULIB_CHDIR=1 |
6ec2e0f5 | 17154 | |
8690e634 | 17155 | |
8690e634 | 17156 | |
6ec2e0f5 | 17157 | |
6ec2e0f5 | 17158 | |
c0c3707f CB |
17159 | $as_echo "#define GNULIB_TEST_CHDIR 1" >>confdefs.h |
17160 | ||
17161 | ||
17162 | ||
17163 | ||
17164 | ||
17165 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this system has an arbitrary file name length limit" >&5 | |
17166 | $as_echo_n "checking whether this system has an arbitrary file name length limit... " >&6; } | |
17167 | if ${gl_cv_have_arbitrary_file_name_length_limit+:} false; then : | |
17168 | $as_echo_n "(cached) " >&6 | |
8690e634 | 17169 | else |
c0c3707f CB |
17170 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
17171 | /* end confdefs.h. */ | |
8690e634 | 17172 | |
c0c3707f CB |
17173 | /* Arrange to define PATH_MAX, like "pathmax.h" does. */ |
17174 | #if HAVE_UNISTD_H | |
17175 | # include <unistd.h> | |
17176 | #endif | |
17177 | #include <limits.h> | |
17178 | #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN | |
17179 | # include <sys/param.h> | |
17180 | #endif | |
17181 | #if !defined PATH_MAX && defined MAXPATHLEN | |
17182 | # define PATH_MAX MAXPATHLEN | |
17183 | #endif | |
17184 | #ifdef __hpux | |
17185 | # undef PATH_MAX | |
17186 | # define PATH_MAX 1024 | |
17187 | #endif | |
17188 | #if defined _WIN32 && ! defined __CYGWIN__ | |
17189 | # undef PATH_MAX | |
17190 | # define PATH_MAX 260 | |
17191 | #endif | |
6ec2e0f5 | 17192 | |
c0c3707f CB |
17193 | #ifdef PATH_MAX |
17194 | have_arbitrary_file_name_length_limit | |
17195 | #endif | |
6ec2e0f5 | 17196 | _ACEOF |
c0c3707f CB |
17197 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
17198 | $EGREP "have_arbitrary_file_name_length_limit" >/dev/null 2>&1; then : | |
17199 | gl_cv_have_arbitrary_file_name_length_limit=yes | |
17200 | else | |
17201 | gl_cv_have_arbitrary_file_name_length_limit=no | |
17202 | fi | |
17203 | rm -f conftest* | |
6ec2e0f5 SDJ |
17204 | |
17205 | fi | |
c0c3707f CB |
17206 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_arbitrary_file_name_length_limit" >&5 |
17207 | $as_echo "$gl_cv_have_arbitrary_file_name_length_limit" >&6; } | |
6ec2e0f5 | 17208 | |
c0c3707f | 17209 | if test $gl_cv_have_arbitrary_file_name_length_limit = yes; then |
6ec2e0f5 SDJ |
17210 | |
17211 | ||
17212 | ||
17213 | ||
472fa5ee SM |
17214 | |
17215 | ||
17216 | ||
17217 | ||
c0c3707f | 17218 | gl_LIBOBJS="$gl_LIBOBJS chdir-long.$ac_objext" |
472fa5ee | 17219 | |
c0c3707f | 17220 | : |
8690e634 JK |
17221 | fi |
17222 | ||
8690e634 | 17223 | |
c0c3707f | 17224 | $as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h |
8690e634 JK |
17225 | |
17226 | ||
17227 | ||
17228 | ||
17229 | ||
8690e634 | 17230 | |
c0c3707f CB |
17231 | if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then |
17232 | REPLACE_CLOSE=1 | |
17233 | fi | |
8690e634 | 17234 | |
6ec2e0f5 SDJ |
17235 | |
17236 | ||
6ec2e0f5 SDJ |
17237 | |
17238 | ||
8690e634 | 17239 | |
c0c3707f CB |
17240 | if test $ac_cv_header_sys_socket_h != yes; then |
17241 | for ac_header in winsock2.h | |
17242 | do : | |
17243 | ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" | |
17244 | if test "x$ac_cv_header_winsock2_h" = xyes; then : | |
17245 | cat >>confdefs.h <<_ACEOF | |
17246 | #define HAVE_WINSOCK2_H 1 | |
17247 | _ACEOF | |
8690e634 | 17248 | |
c0c3707f | 17249 | fi |
8690e634 | 17250 | |
c0c3707f | 17251 | done |
8690e634 | 17252 | |
c0c3707f CB |
17253 | fi |
17254 | if test "$ac_cv_header_winsock2_h" = yes; then | |
17255 | HAVE_WINSOCK2_H=1 | |
17256 | UNISTD_H_HAVE_WINSOCK2_H=1 | |
17257 | SYS_IOCTL_H_HAVE_WINSOCK2_H=1 | |
17258 | else | |
17259 | HAVE_WINSOCK2_H=0 | |
17260 | fi | |
8690e634 | 17261 | |
6ec2e0f5 | 17262 | |
c0c3707f CB |
17263 | if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then |
17264 | REPLACE_CLOSE=1 | |
17265 | fi | |
6ec2e0f5 SDJ |
17266 | |
17267 | ||
c0c3707f | 17268 | if test $REPLACE_CLOSE = 0; then |
6ec2e0f5 SDJ |
17269 | |
17270 | ||
6ec2e0f5 | 17271 | |
c0c3707f CB |
17272 | if test $ac_cv_func_fchdir = no; then |
17273 | HAVE_FCHDIR=0 | |
17274 | fi | |
6ec2e0f5 | 17275 | |
c0c3707f CB |
17276 | if test $HAVE_FCHDIR = 0; then |
17277 | REPLACE_CLOSE=1 | |
17278 | fi | |
17279 | fi | |
6ec2e0f5 SDJ |
17280 | |
17281 | ||
c0c3707f | 17282 | if test $REPLACE_CLOSE = 1; then |
6ec2e0f5 SDJ |
17283 | |
17284 | ||
17285 | ||
17286 | ||
17287 | ||
6ec2e0f5 SDJ |
17288 | |
17289 | ||
17290 | ||
c0c3707f | 17291 | gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext" |
6ec2e0f5 | 17292 | |
c0c3707f | 17293 | fi |
6ec2e0f5 | 17294 | |
6ec2e0f5 SDJ |
17295 | |
17296 | ||
17297 | ||
17298 | ||
c0c3707f | 17299 | GNULIB_CLOSE=1 |
6ec2e0f5 | 17300 | |
6ec2e0f5 | 17301 | |
6ec2e0f5 SDJ |
17302 | |
17303 | ||
17304 | ||
c0c3707f | 17305 | $as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h |
6ec2e0f5 SDJ |
17306 | |
17307 | ||
17308 | ||
17309 | ||
17310 | ||
c0c3707f CB |
17311 | |
17312 | for ac_func in closedir | |
17313 | do : | |
17314 | ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir" | |
17315 | if test "x$ac_cv_func_closedir" = xyes; then : | |
17316 | cat >>confdefs.h <<_ACEOF | |
17317 | #define HAVE_CLOSEDIR 1 | |
17318 | _ACEOF | |
17319 | ||
17320 | fi | |
17321 | done | |
17322 | ||
17323 | if test $ac_cv_func_closedir = no; then | |
17324 | HAVE_CLOSEDIR=0 | |
17325 | fi | |
6ec2e0f5 | 17326 | |
8690e634 JK |
17327 | |
17328 | ||
8690e634 | 17329 | |
c0c3707f CB |
17330 | if test $ac_cv_func_fchdir = no; then |
17331 | HAVE_FCHDIR=0 | |
6ec2e0f5 | 17332 | fi |
6a29c58e | 17333 | |
c0c3707f CB |
17334 | if test $HAVE_FCHDIR = 0; then |
17335 | if test $HAVE_CLOSEDIR = 1; then | |
17336 | REPLACE_CLOSEDIR=1 | |
17337 | fi | |
17338 | fi | |
6a29c58e | 17339 | |
c0c3707f CB |
17340 | case $host_os,$HAVE_CLOSEDIR in |
17341 | os2*,1) | |
17342 | REPLACE_CLOSEDIR=1;; | |
17343 | esac | |
d0ac1c44 | 17344 | |
c0c3707f | 17345 | if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then |
d0ac1c44 SM |
17346 | |
17347 | ||
d0ac1c44 SM |
17348 | |
17349 | ||
6a29c58e YQ |
17350 | |
17351 | ||
3d99e817 | 17352 | |
6ec2e0f5 | 17353 | |
c0c3707f | 17354 | gl_LIBOBJS="$gl_LIBOBJS closedir.$ac_objext" |
6ec2e0f5 | 17355 | |
6ec2e0f5 SDJ |
17356 | fi |
17357 | ||
17358 | ||
6ec2e0f5 SDJ |
17359 | |
17360 | ||
3d99e817 | 17361 | |
c0c3707f | 17362 | GNULIB_CLOSEDIR=1 |
3d99e817 AK |
17363 | |
17364 | ||
17365 | ||
17366 | ||
17367 | ||
c0c3707f | 17368 | $as_echo "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h |
3d99e817 AK |
17369 | |
17370 | ||
17371 | ||
c0c3707f CB |
17372 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5 |
17373 | $as_echo_n "checking for d_ino member in directory struct... " >&6; } | |
17374 | if ${gl_cv_struct_dirent_d_ino+:} false; then : | |
6ec2e0f5 SDJ |
17375 | $as_echo_n "(cached) " >&6 |
17376 | else | |
17377 | if test "$cross_compiling" = yes; then : | |
17378 | case "$host_os" in | |
c0c3707f CB |
17379 | # Guess yes on glibc systems with Linux kernel. |
17380 | linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;; | |
17381 | # Guess yes on musl systems with Linux kernel. | |
17382 | linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;; | |
17383 | # Guess no on native Windows. | |
17384 | mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;; | |
17385 | # If we don't know, obey --enable-cross-guesses. | |
17386 | *) gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;; | |
17387 | esac | |
3d99e817 | 17388 | |
6ec2e0f5 SDJ |
17389 | else |
17390 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17391 | /* end confdefs.h. */ | |
c0c3707f CB |
17392 | #include <sys/types.h> |
17393 | #include <sys/stat.h> | |
17394 | #include <dirent.h> | |
3d99e817 | 17395 | |
6ec2e0f5 SDJ |
17396 | int |
17397 | main () | |
17398 | { | |
c0c3707f CB |
17399 | DIR *dp = opendir ("."); |
17400 | struct dirent *e; | |
17401 | struct stat st; | |
17402 | if (! dp) | |
17403 | return 1; | |
17404 | e = readdir (dp); | |
17405 | if (! e) | |
17406 | { closedir (dp); return 2; } | |
17407 | if (lstat (e->d_name, &st) != 0) | |
17408 | { closedir (dp); return 3; } | |
17409 | if (e->d_ino != st.st_ino) | |
17410 | { closedir (dp); return 4; } | |
17411 | closedir (dp); | |
17412 | return 0; | |
17413 | ||
6ec2e0f5 SDJ |
17414 | ; |
17415 | return 0; | |
17416 | } | |
3d99e817 | 17417 | _ACEOF |
6ec2e0f5 | 17418 | if ac_fn_c_try_run "$LINENO"; then : |
c0c3707f CB |
17419 | gl_cv_struct_dirent_d_ino=yes |
17420 | else | |
17421 | gl_cv_struct_dirent_d_ino=no | |
17422 | fi | |
17423 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
17424 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
17425 | fi | |
17426 | ||
17427 | fi | |
17428 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5 | |
17429 | $as_echo "$gl_cv_struct_dirent_d_ino" >&6; } | |
17430 | case "$gl_cv_struct_dirent_d_ino" in | |
17431 | *yes) | |
17432 | ||
17433 | $as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h | |
17434 | ||
17435 | ;; | |
17436 | esac | |
17437 | ||
17438 | ||
17439 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_type member in directory struct" >&5 | |
17440 | $as_echo_n "checking for d_type member in directory struct... " >&6; } | |
17441 | if ${gl_cv_struct_dirent_d_type+:} false; then : | |
17442 | $as_echo_n "(cached) " >&6 | |
17443 | else | |
17444 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17445 | /* end confdefs.h. */ | |
17446 | ||
17447 | #include <sys/types.h> | |
17448 | #include <dirent.h> | |
17449 | ||
17450 | int | |
17451 | main () | |
17452 | { | |
17453 | struct dirent dp; dp.d_type = 0; | |
17454 | ; | |
17455 | return 0; | |
17456 | } | |
17457 | _ACEOF | |
17458 | if ac_fn_c_try_link "$LINENO"; then : | |
17459 | gl_cv_struct_dirent_d_type=yes | |
6ec2e0f5 | 17460 | else |
c0c3707f | 17461 | gl_cv_struct_dirent_d_type=no |
3d99e817 | 17462 | fi |
c0c3707f CB |
17463 | rm -f core conftest.err conftest.$ac_objext \ |
17464 | conftest$ac_exeext conftest.$ac_ext | |
3d99e817 | 17465 | |
3d99e817 | 17466 | |
c0c3707f CB |
17467 | fi |
17468 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_type" >&5 | |
17469 | $as_echo "$gl_cv_struct_dirent_d_type" >&6; } | |
17470 | if test $gl_cv_struct_dirent_d_type = yes; then | |
3d99e817 | 17471 | |
c0c3707f | 17472 | $as_echo "#define HAVE_STRUCT_DIRENT_D_TYPE 1" >>confdefs.h |
3d99e817 | 17473 | |
c0c3707f | 17474 | fi |
3d99e817 | 17475 | |
0750520d | 17476 | |
0750520d | 17477 | |
0750520d | 17478 | |
0750520d PA |
17479 | |
17480 | ||
0750520d | 17481 | |
0750520d | 17482 | |
0750520d | 17483 | |
0750520d | 17484 | |
0750520d | 17485 | |
0750520d | 17486 | |
0750520d | 17487 | |
0750520d | 17488 | |
c0c3707f CB |
17489 | if test $gl_cv_have_include_next = yes; then |
17490 | gl_cv_next_dirent_h='<'dirent.h'>' | |
17491 | else | |
17492 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5 | |
17493 | $as_echo_n "checking absolute name of <dirent.h>... " >&6; } | |
17494 | if ${gl_cv_next_dirent_h+:} false; then : | |
17495 | $as_echo_n "(cached) " >&6 | |
17496 | else | |
0750520d | 17497 | |
c0c3707f | 17498 | if test $ac_cv_header_dirent_h = yes; then |
6ec2e0f5 | 17499 | |
472fa5ee SM |
17500 | |
17501 | ||
17502 | ||
c0c3707f CB |
17503 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
17504 | /* end confdefs.h. */ | |
17505 | #include <dirent.h> | |
17506 | _ACEOF | |
17507 | case "$host_os" in | |
17508 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
17509 | *) gl_absname_cpp="$ac_cpp" ;; | |
17510 | esac | |
472fa5ee | 17511 | |
c0c3707f CB |
17512 | case "$host_os" in |
17513 | mingw*) | |
17514 | gl_dirsep_regex='[/\\]' | |
17515 | ;; | |
17516 | *) | |
17517 | gl_dirsep_regex='\/' | |
17518 | ;; | |
17519 | esac | |
17520 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
17521 | gl_header_literal_regex=`echo 'dirent.h' \ | |
17522 | | sed -e "$gl_make_literal_regex_sed"` | |
17523 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
17524 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
17525 | s|^/[^/]|//&| | |
17526 | p | |
17527 | q | |
17528 | }' | |
472fa5ee | 17529 | |
c0c3707f CB |
17530 | gl_cv_absolute_dirent_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
17531 | sed -n "$gl_absolute_header_sed"` | |
6ec2e0f5 | 17532 | |
c0c3707f CB |
17533 | gl_header=$gl_cv_absolute_dirent_h |
17534 | gl_cv_next_dirent_h='"'$gl_header'"' | |
17535 | else | |
17536 | gl_cv_next_dirent_h='<'dirent.h'>' | |
17537 | fi | |
6ec2e0f5 SDJ |
17538 | |
17539 | ||
c0c3707f CB |
17540 | fi |
17541 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5 | |
17542 | $as_echo "$gl_cv_next_dirent_h" >&6; } | |
17543 | fi | |
17544 | NEXT_DIRENT_H=$gl_cv_next_dirent_h | |
472fa5ee | 17545 | |
c0c3707f CB |
17546 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
17547 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
17548 | gl_next_as_first_directive='<'dirent.h'>' | |
17549 | else | |
17550 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
17551 | gl_next_as_first_directive=$gl_cv_next_dirent_h | |
17552 | fi | |
17553 | NEXT_AS_FIRST_DIRECTIVE_DIRENT_H=$gl_next_as_first_directive | |
472fa5ee SM |
17554 | |
17555 | ||
17556 | ||
17557 | ||
c0c3707f CB |
17558 | if test $ac_cv_header_dirent_h = yes; then |
17559 | HAVE_DIRENT_H=1 | |
6ec2e0f5 | 17560 | else |
c0c3707f | 17561 | HAVE_DIRENT_H=0 |
6ec2e0f5 SDJ |
17562 | fi |
17563 | ||
6ec2e0f5 | 17564 | |
0750520d | 17565 | |
0750520d | 17566 | |
0750520d | 17567 | |
472fa5ee SM |
17568 | |
17569 | ||
17570 | ||
17571 | ||
17572 | ||
0750520d | 17573 | |
c0c3707f CB |
17574 | for ac_func in dirfd |
17575 | do : | |
17576 | ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd" | |
17577 | if test "x$ac_cv_func_dirfd" = xyes; then : | |
17578 | cat >>confdefs.h <<_ACEOF | |
17579 | #define HAVE_DIRFD 1 | |
17580 | _ACEOF | |
0750520d | 17581 | |
c0c3707f CB |
17582 | fi |
17583 | done | |
0750520d | 17584 | |
c0c3707f CB |
17585 | ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h> |
17586 | #include <dirent.h> | |
17587 | " | |
17588 | if test "x$ac_cv_have_decl_dirfd" = xyes; then : | |
17589 | ac_have_decl=1 | |
8690e634 | 17590 | else |
c0c3707f CB |
17591 | ac_have_decl=0 |
17592 | fi | |
8690e634 | 17593 | |
c0c3707f CB |
17594 | cat >>confdefs.h <<_ACEOF |
17595 | #define HAVE_DECL_DIRFD $ac_have_decl | |
17596 | _ACEOF | |
49e4877c | 17597 | |
c0c3707f CB |
17598 | if test $ac_cv_have_decl_dirfd = no; then |
17599 | HAVE_DECL_DIRFD=0 | |
17600 | fi | |
8690e634 | 17601 | |
c0c3707f CB |
17602 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5 |
17603 | $as_echo_n "checking whether dirfd is a macro... " >&6; } | |
17604 | if ${gl_cv_func_dirfd_macro+:} false; then : | |
17605 | $as_echo_n "(cached) " >&6 | |
17606 | else | |
6ec2e0f5 SDJ |
17607 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
17608 | /* end confdefs.h. */ | |
8690e634 | 17609 | |
c0c3707f CB |
17610 | #include <sys/types.h> |
17611 | #include <dirent.h> | |
17612 | #ifdef dirfd | |
17613 | dirent_header_defines_dirfd | |
6ec2e0f5 | 17614 | #endif |
8690e634 | 17615 | _ACEOF |
c0c3707f CB |
17616 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
17617 | $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1; then : | |
17618 | gl_cv_func_dirfd_macro=yes | |
6ec2e0f5 | 17619 | else |
c0c3707f | 17620 | gl_cv_func_dirfd_macro=no |
6ec2e0f5 | 17621 | fi |
c0c3707f | 17622 | rm -f conftest* |
472fa5ee | 17623 | |
c0c3707f CB |
17624 | fi |
17625 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5 | |
17626 | $as_echo "$gl_cv_func_dirfd_macro" >&6; } | |
472fa5ee | 17627 | |
c0c3707f CB |
17628 | # Use the replacement if we have no function or macro with that name, |
17629 | # or if OS/2 kLIBC whose dirfd() does not work. | |
17630 | # Replace only if the system declares dirfd already. | |
17631 | case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in | |
17632 | no,no,*,yes | *,*,os2*,yes) | |
17633 | REPLACE_DIRFD=1 | |
472fa5ee | 17634 | |
c0c3707f CB |
17635 | $as_echo "#define REPLACE_DIRFD 1" >>confdefs.h |
17636 | ;; | |
17637 | esac | |
472fa5ee | 17638 | |
c0c3707f CB |
17639 | if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \ |
17640 | || test $REPLACE_DIRFD = 1; then | |
6ec2e0f5 | 17641 | |
6ec2e0f5 SDJ |
17642 | |
17643 | ||
17644 | ||
17645 | ||
472fa5ee SM |
17646 | |
17647 | ||
17648 | ||
c0c3707f | 17649 | gl_LIBOBJS="$gl_LIBOBJS dirfd.$ac_objext" |
472fa5ee SM |
17650 | |
17651 | ||
c0c3707f CB |
17652 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5 |
17653 | $as_echo_n "checking how to get the file descriptor associated with an open DIR*... " >&6; } | |
17654 | if ${gl_cv_sys_dir_fd_member_name+:} false; then : | |
17655 | $as_echo_n "(cached) " >&6 | |
17656 | else | |
6ec2e0f5 | 17657 | |
c0c3707f CB |
17658 | dirfd_save_CFLAGS=$CFLAGS |
17659 | for ac_expr in d_fd dd_fd; do | |
6ec2e0f5 | 17660 | |
c0c3707f CB |
17661 | CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr" |
17662 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17663 | /* end confdefs.h. */ | |
6ec2e0f5 | 17664 | |
c0c3707f CB |
17665 | #include <sys/types.h> |
17666 | #include <dirent.h> | |
17667 | int | |
17668 | main () | |
17669 | { | |
17670 | DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME; | |
17671 | ; | |
17672 | return 0; | |
17673 | } | |
17674 | _ACEOF | |
17675 | if ac_fn_c_try_compile "$LINENO"; then : | |
17676 | dir_fd_found=yes | |
6ec2e0f5 | 17677 | |
c0c3707f CB |
17678 | fi |
17679 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
17680 | CFLAGS=$dirfd_save_CFLAGS | |
17681 | test "$dir_fd_found" = yes && break | |
17682 | done | |
17683 | test "$dir_fd_found" = yes || ac_expr=no_such_member | |
472fa5ee | 17684 | |
c0c3707f | 17685 | gl_cv_sys_dir_fd_member_name=$ac_expr |
472fa5ee SM |
17686 | |
17687 | ||
c0c3707f CB |
17688 | fi |
17689 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5 | |
17690 | $as_echo "$gl_cv_sys_dir_fd_member_name" >&6; } | |
17691 | if test $gl_cv_sys_dir_fd_member_name != no_such_member; then | |
472fa5ee | 17692 | |
c0c3707f CB |
17693 | cat >>confdefs.h <<_ACEOF |
17694 | #define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name | |
17695 | _ACEOF | |
472fa5ee | 17696 | |
6ec2e0f5 SDJ |
17697 | fi |
17698 | ||
6ec2e0f5 | 17699 | |
c0c3707f | 17700 | fi |
6ec2e0f5 SDJ |
17701 | |
17702 | ||
17703 | ||
17704 | ||
17705 | ||
c0c3707f | 17706 | GNULIB_DIRFD=1 |
6ec2e0f5 SDJ |
17707 | |
17708 | ||
17709 | ||
6ec2e0f5 | 17710 | |
8690e634 | 17711 | |
c0c3707f | 17712 | $as_echo "#define GNULIB_TEST_DIRFD 1" >>confdefs.h |
8690e634 JK |
17713 | |
17714 | ||
8690e634 JK |
17715 | |
17716 | ||
17717 | ||
8690e634 JK |
17718 | |
17719 | ||
8690e634 | 17720 | |
8690e634 | 17721 | |
c0c3707f CB |
17722 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 |
17723 | $as_echo_n "checking whether // is distinct from /... " >&6; } | |
17724 | if ${gl_cv_double_slash_root+:} false; then : | |
17725 | $as_echo_n "(cached) " >&6 | |
17726 | else | |
17727 | if test x"$cross_compiling" = xyes ; then | |
17728 | # When cross-compiling, there is no way to tell whether // is special | |
17729 | # short of a list of hosts. However, the only known hosts to date | |
17730 | # that have a distinct // are Apollo DomainOS (too old to port to), | |
17731 | # Cygwin, and z/OS. If anyone knows of another system for which // has | |
17732 | # special semantics and is distinct from /, please report it to | |
17733 | # <bug-gnulib@gnu.org>. | |
17734 | case $host in | |
17735 | *-cygwin | i370-ibm-openedition) | |
17736 | gl_cv_double_slash_root=yes ;; | |
17737 | *) | |
17738 | # Be optimistic and assume that / and // are the same when we | |
17739 | # don't know. | |
17740 | gl_cv_double_slash_root='unknown, assuming no' ;; | |
17741 | esac | |
17742 | else | |
17743 | set x `ls -di / // 2>/dev/null` | |
17744 | if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then | |
17745 | gl_cv_double_slash_root=no | |
17746 | else | |
17747 | gl_cv_double_slash_root=yes | |
17748 | fi | |
17749 | fi | |
17750 | fi | |
17751 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 | |
17752 | $as_echo "$gl_cv_double_slash_root" >&6; } | |
17753 | if test "$gl_cv_double_slash_root" = yes; then | |
6ec2e0f5 | 17754 | |
c0c3707f | 17755 | $as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h |
8690e634 | 17756 | |
c0c3707f | 17757 | fi |
8690e634 | 17758 | |
63ce7108 TT |
17759 | |
17760 | ||
17761 | ||
17762 | ||
c0c3707f CB |
17763 | if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then |
17764 | REPLACE_DUP=1 | |
17765 | fi | |
8690e634 JK |
17766 | |
17767 | ||
17768 | ||
17769 | ||
17770 | ||
c0c3707f CB |
17771 | if test $ac_cv_func_fchdir = no; then |
17772 | HAVE_FCHDIR=0 | |
17773 | fi | |
8690e634 | 17774 | |
c0c3707f CB |
17775 | if test $HAVE_FCHDIR = 0; then |
17776 | REPLACE_DUP=1 | |
17777 | fi | |
8690e634 | 17778 | |
c0c3707f CB |
17779 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup works" >&5 |
17780 | $as_echo_n "checking whether dup works... " >&6; } | |
17781 | if ${gl_cv_func_dup_works+:} false; then : | |
8690e634 JK |
17782 | $as_echo_n "(cached) " >&6 |
17783 | else | |
c0c3707f CB |
17784 | if test "$cross_compiling" = yes; then : |
17785 | case "$host_os" in | |
17786 | # Guess no on native Windows. | |
17787 | mingw*) gl_cv_func_dup_works="guessing no" ;; | |
17788 | *) gl_cv_func_dup_works="guessing yes" ;; | |
17789 | esac | |
8690e634 | 17790 | |
c0c3707f | 17791 | else |
4a626d0a | 17792 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8690e634 | 17793 | /* end confdefs.h. */ |
c0c3707f CB |
17794 | #include <unistd.h> |
17795 | #include <fcntl.h> | |
17796 | #include <errno.h> | |
17797 | int | |
17798 | main () | |
17799 | { | |
17800 | /* On OS/2 kLIBC, dup does not work on a directory fd. */ | |
17801 | int fd = open (".", O_RDONLY); | |
17802 | return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0; | |
8690e634 | 17803 | |
c0c3707f CB |
17804 | ; |
17805 | return 0; | |
17806 | } | |
8690e634 | 17807 | |
c0c3707f CB |
17808 | _ACEOF |
17809 | if ac_fn_c_try_run "$LINENO"; then : | |
17810 | gl_cv_func_dup_works=yes | |
17811 | else | |
17812 | gl_cv_func_dup_works=no | |
17813 | fi | |
17814 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
17815 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
8690e634 | 17816 | fi |
8690e634 | 17817 | |
8690e634 | 17818 | |
c0c3707f CB |
17819 | fi |
17820 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup_works" >&5 | |
17821 | $as_echo "$gl_cv_func_dup_works" >&6; } | |
17822 | case "$gl_cv_func_dup_works" in | |
17823 | *yes) ;; | |
17824 | *) | |
17825 | REPLACE_DUP=1 | |
17826 | ;; | |
17827 | esac | |
8690e634 | 17828 | |
c0c3707f | 17829 | if test $REPLACE_DUP = 1; then |
8690e634 JK |
17830 | |
17831 | ||
17832 | ||
17833 | ||
6ec2e0f5 SDJ |
17834 | |
17835 | ||
17836 | ||
17837 | ||
c0c3707f | 17838 | gl_LIBOBJS="$gl_LIBOBJS dup.$ac_objext" |
8690e634 | 17839 | |
c0c3707f CB |
17840 | : |
17841 | fi | |
8690e634 | 17842 | |
5e8754f9 | 17843 | |
8690e634 JK |
17844 | |
17845 | ||
8839a007 | 17846 | |
c0c3707f | 17847 | GNULIB_DUP=1 |
63ce7108 | 17848 | |
63ce7108 | 17849 | |
63ce7108 | 17850 | |
6ec2e0f5 | 17851 | |
6ec2e0f5 | 17852 | |
c0c3707f | 17853 | $as_echo "#define GNULIB_TEST_DUP 1" >>confdefs.h |
6ec2e0f5 | 17854 | |
63ce7108 TT |
17855 | |
17856 | ||
472fa5ee SM |
17857 | |
17858 | ||
17859 | ||
17860 | ||
17861 | ||
c0c3707f CB |
17862 | $as_echo "#define HAVE_DUP2 1" >>confdefs.h |
17863 | ||
17864 | ||
17865 | if test $HAVE_DUP2 = 1; then | |
17866 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5 | |
17867 | $as_echo_n "checking whether dup2 works... " >&6; } | |
17868 | if ${gl_cv_func_dup2_works+:} false; then : | |
6ec2e0f5 SDJ |
17869 | $as_echo_n "(cached) " >&6 |
17870 | else | |
17871 | if test "$cross_compiling" = yes; then : | |
17872 | case "$host_os" in | |
c0c3707f CB |
17873 | mingw*) # on this platform, dup2 always returns 0 for success |
17874 | gl_cv_func_dup2_works="guessing no" ;; | |
17875 | cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 | |
17876 | gl_cv_func_dup2_works="guessing no" ;; | |
17877 | aix* | freebsd*) | |
17878 | # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, | |
17879 | # not EBADF. | |
17880 | gl_cv_func_dup2_works="guessing no" ;; | |
17881 | haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. | |
17882 | gl_cv_func_dup2_works="guessing no" ;; | |
17883 | *-android*) # implemented using dup3(), which fails if oldfd == newfd | |
17884 | gl_cv_func_dup2_works="guessing no" ;; | |
17885 | os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. | |
17886 | gl_cv_func_dup2_works="guessing no" ;; | |
17887 | *) gl_cv_func_dup2_works="guessing yes" ;; | |
17888 | esac | |
63ce7108 TT |
17889 | else |
17890 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
17891 | /* end confdefs.h. */ | |
17892 | ||
c0c3707f CB |
17893 | #include <errno.h> |
17894 | #include <fcntl.h> | |
17895 | #include <limits.h> | |
17896 | #include <sys/resource.h> | |
17897 | #include <unistd.h> | |
17898 | #ifndef RLIM_SAVED_CUR | |
17899 | # define RLIM_SAVED_CUR RLIM_INFINITY | |
17900 | #endif | |
17901 | #ifndef RLIM_SAVED_MAX | |
17902 | # define RLIM_SAVED_MAX RLIM_INFINITY | |
17903 | #endif | |
63ce7108 TT |
17904 | |
17905 | int | |
17906 | main () | |
17907 | { | |
6ec2e0f5 | 17908 | int result = 0; |
c0c3707f CB |
17909 | int bad_fd = INT_MAX; |
17910 | struct rlimit rlim; | |
17911 | if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 | |
17912 | && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX | |
17913 | && rlim.rlim_cur != RLIM_INFINITY | |
17914 | && rlim.rlim_cur != RLIM_SAVED_MAX | |
17915 | && rlim.rlim_cur != RLIM_SAVED_CUR) | |
17916 | bad_fd = rlim.rlim_cur; | |
17917 | #ifdef FD_CLOEXEC | |
17918 | if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) | |
17919 | result |= 1; | |
17920 | #endif | |
17921 | if (dup2 (1, 1) != 1) | |
17922 | result |= 2; | |
17923 | #ifdef FD_CLOEXEC | |
17924 | if (fcntl (1, F_GETFD) != FD_CLOEXEC) | |
17925 | result |= 4; | |
17926 | #endif | |
17927 | close (0); | |
17928 | if (dup2 (0, 0) != -1) | |
17929 | result |= 8; | |
17930 | /* Many gnulib modules require POSIX conformance of EBADF. */ | |
17931 | if (dup2 (2, bad_fd) == -1 && errno != EBADF) | |
17932 | result |= 16; | |
17933 | /* Flush out some cygwin core dumps. */ | |
17934 | if (dup2 (2, -1) != -1 || errno != EBADF) | |
17935 | result |= 32; | |
17936 | dup2 (2, 255); | |
17937 | dup2 (2, 256); | |
17938 | /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ | |
17939 | { | |
17940 | int fd = open (".", O_RDONLY); | |
17941 | if (fd == -1) | |
17942 | result |= 64; | |
17943 | else if (dup2 (fd, fd + 1) == -1) | |
17944 | result |= 128; | |
17945 | ||
17946 | close (fd); | |
17947 | } | |
17948 | return result; | |
63ce7108 TT |
17949 | ; |
17950 | return 0; | |
17951 | } | |
c0c3707f | 17952 | |
63ce7108 TT |
17953 | _ACEOF |
17954 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 17955 | gl_cv_func_dup2_works=yes |
63ce7108 | 17956 | else |
c0c3707f | 17957 | gl_cv_func_dup2_works=no |
63ce7108 TT |
17958 | fi |
17959 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
17960 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
17961 | fi | |
17962 | ||
c0c3707f | 17963 | |
63ce7108 | 17964 | fi |
c0c3707f CB |
17965 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5 |
17966 | $as_echo "$gl_cv_func_dup2_works" >&6; } | |
17967 | case "$gl_cv_func_dup2_works" in | |
63ce7108 TT |
17968 | *yes) ;; |
17969 | *) | |
c0c3707f CB |
17970 | REPLACE_DUP2=1 |
17971 | for ac_func in setdtablesize | |
17972 | do : | |
17973 | ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize" | |
17974 | if test "x$ac_cv_func_setdtablesize" = xyes; then : | |
17975 | cat >>confdefs.h <<_ACEOF | |
17976 | #define HAVE_SETDTABLESIZE 1 | |
17977 | _ACEOF | |
17978 | ||
17979 | fi | |
17980 | done | |
17981 | ||
63ce7108 TT |
17982 | ;; |
17983 | esac | |
17984 | fi | |
17985 | ||
09607c9e TT |
17986 | |
17987 | ||
17988 | ||
c0c3707f CB |
17989 | if test $ac_cv_func_fchdir = no; then |
17990 | HAVE_FCHDIR=0 | |
17991 | fi | |
4a626d0a | 17992 | |
c0c3707f CB |
17993 | if test $HAVE_FCHDIR = 0; then |
17994 | if test $HAVE_DUP2 = 1; then | |
17995 | REPLACE_DUP2=1 | |
17996 | fi | |
17997 | fi | |
4a626d0a PA |
17998 | |
17999 | ||
c0c3707f | 18000 | if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then |
4a626d0a PA |
18001 | |
18002 | ||
18003 | ||
18004 | ||
18005 | ||
18006 | ||
4a626d0a | 18007 | |
4a626d0a | 18008 | |
c0c3707f | 18009 | gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" |
4a626d0a PA |
18010 | |
18011 | ||
c0c3707f | 18012 | fi |
4a626d0a PA |
18013 | |
18014 | ||
18015 | ||
18016 | ||
18017 | ||
c0c3707f | 18018 | GNULIB_DUP2=1 |
4a626d0a PA |
18019 | |
18020 | ||
18021 | ||
18022 | ||
09607c9e | 18023 | |
c0c3707f | 18024 | $as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h |
09607c9e TT |
18025 | |
18026 | ||
472fa5ee SM |
18027 | |
18028 | ||
18029 | ||
18030 | ||
18031 | ||
09607c9e | 18032 | |
6ec2e0f5 | 18033 | |
c0c3707f | 18034 | GNULIB_ENVIRON=1 |
6ec2e0f5 | 18035 | |
09607c9e | 18036 | |
09607c9e | 18037 | |
6ec2e0f5 SDJ |
18038 | |
18039 | ||
c0c3707f | 18040 | $as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h |
6ec2e0f5 SDJ |
18041 | |
18042 | ||
6ec2e0f5 | 18043 | |
5e8754f9 | 18044 | |
6ec2e0f5 | 18045 | |
c0c3707f CB |
18046 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 |
18047 | $as_echo_n "checking for error_at_line... " >&6; } | |
18048 | if ${ac_cv_lib_error_at_line+:} false; then : | |
09607c9e | 18049 | $as_echo_n "(cached) " >&6 |
4a626d0a PA |
18050 | else |
18051 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18052 | /* end confdefs.h. */ | |
c0c3707f CB |
18053 | #include <error.h> |
18054 | int | |
18055 | main () | |
18056 | { | |
18057 | error_at_line (0, 0, "", 0, "an error occurred"); | |
18058 | ; | |
4a626d0a PA |
18059 | return 0; |
18060 | } | |
18061 | _ACEOF | |
c0c3707f CB |
18062 | if ac_fn_c_try_link "$LINENO"; then : |
18063 | ac_cv_lib_error_at_line=yes | |
4a626d0a | 18064 | else |
c0c3707f | 18065 | ac_cv_lib_error_at_line=no |
6ec2e0f5 | 18066 | fi |
c0c3707f CB |
18067 | rm -f core conftest.err conftest.$ac_objext \ |
18068 | conftest$ac_exeext conftest.$ac_ext | |
6ec2e0f5 | 18069 | fi |
c0c3707f CB |
18070 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 |
18071 | $as_echo "$ac_cv_lib_error_at_line" >&6; } | |
09607c9e | 18072 | |
c0c3707f | 18073 | if test $ac_cv_lib_error_at_line = no; then |
09607c9e TT |
18074 | |
18075 | ||
18076 | ||
18077 | ||
18078 | ||
18079 | ||
18080 | ||
18081 | ||
c0c3707f | 18082 | gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext" |
09607c9e | 18083 | |
4a626d0a | 18084 | |
09607c9e | 18085 | |
c0c3707f | 18086 | : |
4a626d0a | 18087 | |
c0c3707f | 18088 | fi |
4a626d0a | 18089 | |
4a626d0a | 18090 | |
09607c9e | 18091 | |
09607c9e | 18092 | |
09607c9e TT |
18093 | |
18094 | ||
09607c9e | 18095 | |
c0c3707f CB |
18096 | if test $ac_cv_have_decl_fchdir = no; then |
18097 | HAVE_DECL_FCHDIR=0 | |
18098 | fi | |
09607c9e TT |
18099 | |
18100 | ||
c0c3707f | 18101 | if test $HAVE_FCHDIR = 0; then |
09607c9e TT |
18102 | |
18103 | ||
18104 | ||
c0c3707f CB |
18105 | |
18106 | ||
18107 | ||
18108 | ||
18109 | ||
18110 | gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext" | |
18111 | ||
18112 | : | |
18113 | ||
18114 | $as_echo "#define REPLACE_FCHDIR 1" >>confdefs.h | |
18115 | ||
18116 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open can visit directories" >&5 | |
18117 | $as_echo_n "checking whether open can visit directories... " >&6; } | |
18118 | if ${gl_cv_func_open_directory_works+:} false; then : | |
18119 | $as_echo_n "(cached) " >&6 | |
3d99e817 | 18120 | else |
c0c3707f CB |
18121 | if test "$cross_compiling" = yes; then : |
18122 | case "$host_os" in | |
18123 | # Guess yes on Linux systems. | |
18124 | linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;; | |
18125 | # Guess yes on glibc systems. | |
18126 | *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;; | |
18127 | # Guess no on native Windows. | |
18128 | mingw*) gl_cv_func_open_directory_works="guessing no" ;; | |
18129 | # If we don't know, obey --enable-cross-guesses. | |
18130 | *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;; | |
18131 | esac | |
18132 | ||
18133 | else | |
18134 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18135 | /* end confdefs.h. */ | |
18136 | #include <fcntl.h> | |
18137 | ||
18138 | int | |
18139 | main () | |
18140 | { | |
18141 | return open(".", O_RDONLY) < 0; | |
18142 | ; | |
18143 | return 0; | |
18144 | } | |
18145 | _ACEOF | |
18146 | if ac_fn_c_try_run "$LINENO"; then : | |
18147 | gl_cv_func_open_directory_works=yes | |
18148 | else | |
18149 | gl_cv_func_open_directory_works=no | |
18150 | fi | |
18151 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
18152 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
3d99e817 AK |
18153 | fi |
18154 | ||
c0c3707f CB |
18155 | fi |
18156 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_directory_works" >&5 | |
18157 | $as_echo "$gl_cv_func_open_directory_works" >&6; } | |
18158 | case "$gl_cv_func_open_directory_works" in | |
18159 | *yes) ;; | |
18160 | *) | |
3d99e817 | 18161 | |
c0c3707f | 18162 | $as_echo "#define REPLACE_OPEN_DIRECTORY 1" >>confdefs.h |
09607c9e | 18163 | |
c0c3707f CB |
18164 | ;; |
18165 | esac | |
18166 | fi | |
8690e634 | 18167 | |
8690e634 | 18168 | |
8690e634 | 18169 | |
8690e634 | 18170 | |
8690e634 | 18171 | |
6ec2e0f5 | 18172 | |
c0c3707f | 18173 | GNULIB_FCHDIR=1 |
6ec2e0f5 SDJ |
18174 | |
18175 | ||
6ec2e0f5 | 18176 | |
8690e634 JK |
18177 | |
18178 | ||
c0c3707f | 18179 | $as_echo "#define GNULIB_TEST_FCHDIR 1" >>confdefs.h |
8690e634 JK |
18180 | |
18181 | ||
18182 | ||
6ec2e0f5 SDJ |
18183 | |
18184 | ||
18185 | ||
6ec2e0f5 | 18186 | |
8690e634 | 18187 | |
c0c3707f | 18188 | if test $ac_cv_func_fcntl = no; then |
8690e634 JK |
18189 | |
18190 | ||
6ec2e0f5 | 18191 | |
c0c3707f CB |
18192 | if test $ac_cv_func_fcntl = no; then |
18193 | HAVE_FCNTL=0 | |
18194 | else | |
18195 | REPLACE_FCNTL=1 | |
18196 | fi | |
5e8754f9 | 18197 | |
c0c3707f CB |
18198 | else |
18199 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5 | |
18200 | $as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; } | |
18201 | if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then : | |
8690e634 | 18202 | $as_echo_n "(cached) " >&6 |
6ec2e0f5 | 18203 | else |
c0c3707f CB |
18204 | if test "$cross_compiling" = yes; then : |
18205 | case $host_os in | |
18206 | aix* | cygwin* | haiku*) | |
18207 | gl_cv_func_fcntl_f_dupfd_works="guessing no" ;; | |
18208 | *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;; | |
18209 | esac | |
18210 | else | |
18211 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18212 | /* end confdefs.h. */ | |
18213 | #include <errno.h> | |
18214 | #include <fcntl.h> | |
18215 | #include <limits.h> | |
18216 | #include <sys/resource.h> | |
18217 | #include <unistd.h> | |
18218 | #ifndef RLIM_SAVED_CUR | |
18219 | # define RLIM_SAVED_CUR RLIM_INFINITY | |
18220 | #endif | |
18221 | #ifndef RLIM_SAVED_MAX | |
18222 | # define RLIM_SAVED_MAX RLIM_INFINITY | |
18223 | #endif | |
18224 | ||
18225 | int | |
18226 | main () | |
18227 | { | |
18228 | int result = 0; | |
18229 | int bad_fd = INT_MAX; | |
18230 | struct rlimit rlim; | |
18231 | if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 | |
18232 | && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX | |
18233 | && rlim.rlim_cur != RLIM_INFINITY | |
18234 | && rlim.rlim_cur != RLIM_SAVED_MAX | |
18235 | && rlim.rlim_cur != RLIM_SAVED_CUR) | |
18236 | bad_fd = rlim.rlim_cur; | |
18237 | if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; | |
18238 | if (errno != EINVAL) result |= 2; | |
18239 | if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; | |
18240 | if (errno != EINVAL) result |= 8; | |
18241 | /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */ | |
18242 | { | |
18243 | int fd; | |
18244 | fd = open (".", O_RDONLY); | |
18245 | if (fd == -1) | |
18246 | result |= 16; | |
18247 | else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1) | |
18248 | result |= 32; | |
18249 | ||
18250 | close (fd); | |
18251 | } | |
18252 | return result; | |
18253 | ; | |
18254 | return 0; | |
18255 | } | |
18256 | _ACEOF | |
18257 | if ac_fn_c_try_run "$LINENO"; then : | |
18258 | gl_cv_func_fcntl_f_dupfd_works=yes | |
18259 | else | |
18260 | gl_cv_func_fcntl_f_dupfd_works=no | |
18261 | fi | |
18262 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
18263 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
18264 | fi | |
18265 | ||
18266 | fi | |
18267 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5 | |
18268 | $as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; } | |
18269 | case $gl_cv_func_fcntl_f_dupfd_works in | |
18270 | *yes) ;; | |
18271 | *) | |
18272 | ||
18273 | ||
18274 | if test $ac_cv_func_fcntl = no; then | |
18275 | HAVE_FCNTL=0 | |
18276 | else | |
18277 | REPLACE_FCNTL=1 | |
18278 | fi | |
18279 | ||
18280 | ||
18281 | $as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h | |
18282 | ;; | |
18283 | esac | |
18284 | ||
18285 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5 | |
18286 | $as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; } | |
18287 | if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then : | |
18288 | $as_echo_n "(cached) " >&6 | |
8690e634 JK |
18289 | else |
18290 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18291 | /* end confdefs.h. */ | |
c0c3707f CB |
18292 | |
18293 | #include <fcntl.h> | |
18294 | #ifndef F_DUPFD_CLOEXEC | |
18295 | choke me | |
18296 | #endif | |
18297 | ||
18298 | int | |
18299 | main () | |
18300 | { | |
18301 | ||
18302 | ; | |
18303 | return 0; | |
18304 | } | |
18305 | _ACEOF | |
18306 | if ac_fn_c_try_compile "$LINENO"; then : | |
18307 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18308 | /* end confdefs.h. */ | |
18309 | ||
18310 | #ifdef __linux__ | |
18311 | /* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace | |
18312 | it to support the semantics on older kernels that failed with EINVAL. */ | |
18313 | choke me | |
18314 | #endif | |
8690e634 | 18315 | |
8690e634 JK |
18316 | int |
18317 | main () | |
18318 | { | |
18319 | ||
18320 | ; | |
18321 | return 0; | |
18322 | } | |
18323 | _ACEOF | |
c0c3707f CB |
18324 | if ac_fn_c_try_compile "$LINENO"; then : |
18325 | gl_cv_func_fcntl_f_dupfd_cloexec=yes | |
8690e634 | 18326 | else |
c0c3707f | 18327 | gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check" |
8690e634 | 18328 | fi |
c0c3707f CB |
18329 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
18330 | else | |
18331 | gl_cv_func_fcntl_f_dupfd_cloexec=no | |
18332 | fi | |
18333 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
8690e634 | 18334 | fi |
c0c3707f CB |
18335 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5 |
18336 | $as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; } | |
18337 | if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then | |
8690e634 | 18338 | |
8690e634 | 18339 | |
c0c3707f CB |
18340 | |
18341 | if test $ac_cv_func_fcntl = no; then | |
18342 | HAVE_FCNTL=0 | |
5e8754f9 | 18343 | else |
c0c3707f CB |
18344 | REPLACE_FCNTL=1 |
18345 | fi | |
18346 | ||
18347 | fi | |
8690e634 JK |
18348 | fi |
18349 | ||
18350 | ||
8690e634 | 18351 | |
8690e634 | 18352 | |
c0c3707f CB |
18353 | if test $ac_cv_func_fchdir = no; then |
18354 | HAVE_FCHDIR=0 | |
18355 | fi | |
6ec2e0f5 | 18356 | |
c0c3707f | 18357 | if test $HAVE_FCHDIR = 0; then |
6ec2e0f5 SDJ |
18358 | |
18359 | ||
18360 | ||
c0c3707f CB |
18361 | if test $ac_cv_func_fcntl = no; then |
18362 | HAVE_FCNTL=0 | |
18363 | else | |
18364 | REPLACE_FCNTL=1 | |
18365 | fi | |
6ec2e0f5 | 18366 | |
c0c3707f | 18367 | fi |
6ec2e0f5 SDJ |
18368 | |
18369 | ||
c0c3707f | 18370 | if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then |
6ec2e0f5 | 18371 | |
6ec2e0f5 SDJ |
18372 | |
18373 | ||
5e8754f9 SDJ |
18374 | |
18375 | ||
8690e634 | 18376 | |
8690e634 JK |
18377 | |
18378 | ||
c0c3707f | 18379 | gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext" |
472fa5ee | 18380 | |
c0c3707f | 18381 | fi |
472fa5ee SM |
18382 | |
18383 | ||
18384 | ||
18385 | ||
18386 | ||
c0c3707f | 18387 | GNULIB_FCNTL=1 |
472fa5ee SM |
18388 | |
18389 | ||
18390 | ||
18391 | ||
18392 | ||
c0c3707f | 18393 | $as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h |
472fa5ee SM |
18394 | |
18395 | ||
18396 | ||
18397 | ||
18398 | ||
18399 | ||
18400 | ||
18401 | ||
18402 | ||
18403 | ||
18404 | ||
18405 | ||
18406 | ||
18407 | ||
c0c3707f CB |
18408 | if test $gl_cv_have_include_next = yes; then |
18409 | gl_cv_next_fcntl_h='<'fcntl.h'>' | |
18410 | else | |
18411 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5 | |
18412 | $as_echo_n "checking absolute name of <fcntl.h>... " >&6; } | |
18413 | if ${gl_cv_next_fcntl_h+:} false; then : | |
18414 | $as_echo_n "(cached) " >&6 | |
18415 | else | |
472fa5ee SM |
18416 | |
18417 | ||
472fa5ee | 18418 | |
c0c3707f CB |
18419 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
18420 | /* end confdefs.h. */ | |
18421 | #include <fcntl.h> | |
18422 | _ACEOF | |
18423 | case "$host_os" in | |
18424 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
18425 | *) gl_absname_cpp="$ac_cpp" ;; | |
18426 | esac | |
472fa5ee | 18427 | |
c0c3707f CB |
18428 | case "$host_os" in |
18429 | mingw*) | |
18430 | gl_dirsep_regex='[/\\]' | |
18431 | ;; | |
18432 | *) | |
18433 | gl_dirsep_regex='\/' | |
18434 | ;; | |
18435 | esac | |
18436 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
18437 | gl_header_literal_regex=`echo 'fcntl.h' \ | |
18438 | | sed -e "$gl_make_literal_regex_sed"` | |
18439 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
18440 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
18441 | s|^/[^/]|//&| | |
18442 | p | |
18443 | q | |
18444 | }' | |
472fa5ee | 18445 | |
c0c3707f CB |
18446 | gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
18447 | sed -n "$gl_absolute_header_sed"` | |
472fa5ee | 18448 | |
c0c3707f CB |
18449 | gl_header=$gl_cv_absolute_fcntl_h |
18450 | gl_cv_next_fcntl_h='"'$gl_header'"' | |
8690e634 JK |
18451 | |
18452 | ||
c0c3707f CB |
18453 | fi |
18454 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5 | |
18455 | $as_echo "$gl_cv_next_fcntl_h" >&6; } | |
18456 | fi | |
18457 | NEXT_FCNTL_H=$gl_cv_next_fcntl_h | |
8690e634 | 18458 | |
c0c3707f CB |
18459 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
18460 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
18461 | gl_next_as_first_directive='<'fcntl.h'>' | |
18462 | else | |
18463 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
18464 | gl_next_as_first_directive=$gl_cv_next_fcntl_h | |
18465 | fi | |
18466 | NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive | |
8690e634 JK |
18467 | |
18468 | ||
18469 | ||
18470 | ||
5e8754f9 SDJ |
18471 | |
18472 | ||
18473 | ||
18474 | ||
472fa5ee SM |
18475 | |
18476 | ||
18477 | ||
18478 | ||
18479 | ||
18480 | ||
18481 | ||
5e8754f9 | 18482 | cat >>confdefs.h <<_ACEOF |
c0c3707f | 18483 | #define GNULIB_FD_SAFER_FLAG 1 |
5e8754f9 | 18484 | _ACEOF |
472fa5ee SM |
18485 | |
18486 | ||
c0c3707f CB |
18487 | |
18488 | ||
18489 | ||
18490 | ||
18491 | ||
18492 | ac_fn_c_check_decl "$LINENO" "fdopendir" "ac_cv_have_decl_fdopendir" " | |
18493 | #include <dirent.h> | |
18494 | ||
5e8754f9 | 18495 | " |
c0c3707f | 18496 | if test "x$ac_cv_have_decl_fdopendir" = xyes; then : |
5e8754f9 SDJ |
18497 | ac_have_decl=1 |
18498 | else | |
18499 | ac_have_decl=0 | |
18500 | fi | |
472fa5ee | 18501 | |
5e8754f9 | 18502 | cat >>confdefs.h <<_ACEOF |
c0c3707f | 18503 | #define HAVE_DECL_FDOPENDIR $ac_have_decl |
5e8754f9 | 18504 | _ACEOF |
c0c3707f | 18505 | if test $ac_have_decl = 1; then : |
472fa5ee | 18506 | |
c0c3707f CB |
18507 | else |
18508 | HAVE_DECL_FDOPENDIR=0 | |
18509 | fi | |
472fa5ee SM |
18510 | |
18511 | ||
c0c3707f CB |
18512 | if test $ac_cv_func_fdopendir = no; then |
18513 | HAVE_FDOPENDIR=0 | |
18514 | else | |
18515 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fdopendir works" >&5 | |
18516 | $as_echo_n "checking whether fdopendir works... " >&6; } | |
18517 | if ${gl_cv_func_fdopendir_works+:} false; then : | |
18518 | $as_echo_n "(cached) " >&6 | |
18519 | else | |
18520 | if test "$cross_compiling" = yes; then : | |
18521 | case "$host_os" in | |
18522 | # Guess yes on glibc systems. | |
18523 | *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;; | |
18524 | # Guess yes on musl systems. | |
18525 | *-musl*) gl_cv_func_fdopendir_works="guessing yes" ;; | |
18526 | # If we don't know, obey --enable-cross-guesses. | |
18527 | *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;; | |
18528 | esac | |
472fa5ee | 18529 | |
c0c3707f CB |
18530 | else |
18531 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18532 | /* end confdefs.h. */ | |
472fa5ee | 18533 | |
c0c3707f CB |
18534 | #include <dirent.h> |
18535 | #include <fcntl.h> | |
18536 | #include <unistd.h> | |
18537 | #if !HAVE_DECL_FDOPENDIR | |
18538 | extern | |
18539 | # ifdef __cplusplus | |
18540 | "C" | |
18541 | # endif | |
18542 | DIR *fdopendir (int); | |
18543 | #endif | |
472fa5ee | 18544 | |
c0c3707f CB |
18545 | int |
18546 | main () | |
18547 | { | |
18548 | int result = 0; | |
18549 | int fd = open ("conftest.c", O_RDONLY); | |
18550 | if (fd < 0) result |= 1; | |
18551 | if (fdopendir (fd)) result |= 2; | |
18552 | if (close (fd)) result |= 4; | |
18553 | return result; | |
18554 | ; | |
18555 | return 0; | |
18556 | } | |
18557 | _ACEOF | |
18558 | if ac_fn_c_try_run "$LINENO"; then : | |
18559 | gl_cv_func_fdopendir_works=yes | |
18560 | else | |
18561 | gl_cv_func_fdopendir_works=no | |
18562 | fi | |
18563 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
18564 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
18565 | fi | |
472fa5ee | 18566 | |
c0c3707f CB |
18567 | fi |
18568 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopendir_works" >&5 | |
18569 | $as_echo "$gl_cv_func_fdopendir_works" >&6; } | |
18570 | case "$gl_cv_func_fdopendir_works" in | |
18571 | *yes) ;; | |
18572 | *) | |
18573 | REPLACE_FDOPENDIR=1 | |
18574 | ;; | |
18575 | esac | |
18576 | fi | |
472fa5ee | 18577 | |
c0c3707f | 18578 | if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then |
472fa5ee SM |
18579 | |
18580 | ||
18581 | ||
18582 | ||
18583 | ||
98399780 | 18584 | |
5e8754f9 SDJ |
18585 | |
18586 | ||
c0c3707f | 18587 | gl_LIBOBJS="$gl_LIBOBJS fdopendir.$ac_objext" |
5e8754f9 | 18588 | |
c0c3707f | 18589 | fi |
5e8754f9 SDJ |
18590 | |
18591 | ||
18592 | ||
18593 | ||
18594 | ||
c0c3707f | 18595 | GNULIB_FDOPENDIR=1 |
5e8754f9 SDJ |
18596 | |
18597 | ||
18598 | ||
18599 | ||
18600 | ||
c0c3707f | 18601 | $as_echo "#define GNULIB_TEST_FDOPENDIR 1" >>confdefs.h |
5e8754f9 SDJ |
18602 | |
18603 | ||
5e8754f9 SDJ |
18604 | |
18605 | ||
18606 | ||
c0c3707f CB |
18607 | cat >>confdefs.h <<_ACEOF |
18608 | #define GNULIB_FDOPENDIR 1 | |
18609 | _ACEOF | |
5e8754f9 SDJ |
18610 | |
18611 | ||
18612 | ||
5e8754f9 SDJ |
18613 | |
18614 | ||
18615 | ||
c0c3707f CB |
18616 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5 |
18617 | $as_echo_n "checking for flexible array member... " >&6; } | |
18618 | if ${ac_cv_c_flexmember+:} false; then : | |
5e8754f9 | 18619 | $as_echo_n "(cached) " >&6 |
6ec2e0f5 | 18620 | else |
c0c3707f | 18621 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5e8754f9 | 18622 | /* end confdefs.h. */ |
c0c3707f CB |
18623 | #include <stdlib.h> |
18624 | #include <stdio.h> | |
18625 | #include <stddef.h> | |
18626 | struct m { struct m *next, **list; char name[]; }; | |
18627 | struct s { struct s *p; struct m *m; int n; double d[]; }; | |
5e8754f9 SDJ |
18628 | int |
18629 | main () | |
18630 | { | |
c0c3707f CB |
18631 | int m = getchar (); |
18632 | size_t nbytes = offsetof (struct s, d) + m * sizeof (double); | |
18633 | nbytes += sizeof (struct s) - 1; | |
18634 | nbytes -= nbytes % sizeof (struct s); | |
18635 | struct s *p = malloc (nbytes); | |
18636 | p->p = p; | |
18637 | p->m = NULL; | |
18638 | p->d[0] = 0.0; | |
18639 | return p->d != (double *) NULL; | |
5e8754f9 SDJ |
18640 | ; |
18641 | return 0; | |
18642 | } | |
7a6dbc2f | 18643 | _ACEOF |
c0c3707f CB |
18644 | if ac_fn_c_try_compile "$LINENO"; then : |
18645 | ac_cv_c_flexmember=yes | |
5e8754f9 | 18646 | else |
c0c3707f | 18647 | ac_cv_c_flexmember=no |
5e8754f9 | 18648 | fi |
c0c3707f | 18649 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
5e8754f9 | 18650 | fi |
c0c3707f CB |
18651 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5 |
18652 | $as_echo "$ac_cv_c_flexmember" >&6; } | |
18653 | if test $ac_cv_c_flexmember = yes; then | |
18654 | ||
18655 | $as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h | |
5e8754f9 | 18656 | |
c0c3707f CB |
18657 | else |
18658 | $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h | |
98399780 | 18659 | |
c0c3707f | 18660 | fi |
98399780 | 18661 | |
472fa5ee SM |
18662 | |
18663 | ||
18664 | ||
c0c3707f CB |
18665 | FLOAT_H= |
18666 | REPLACE_FLOAT_LDBL=0 | |
18667 | case "$host_os" in | |
18668 | aix* | beos* | openbsd* | mirbsd* | irix*) | |
18669 | FLOAT_H=float.h | |
18670 | ;; | |
18671 | freebsd* | dragonfly*) | |
18672 | case "$host_cpu" in | |
18673 | i[34567]86 ) | |
18674 | FLOAT_H=float.h | |
18675 | ;; | |
18676 | x86_64 ) | |
18677 | # On x86_64 systems, the C compiler may still be generating | |
18678 | # 32-bit code. | |
18679 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18680 | /* end confdefs.h. */ | |
18681 | #if defined __LP64__ || defined __x86_64__ || defined __amd64__ | |
18682 | int ok; | |
18683 | #else | |
18684 | error fail | |
18685 | #endif | |
472fa5ee | 18686 | |
c0c3707f CB |
18687 | _ACEOF |
18688 | if ac_fn_c_try_compile "$LINENO"; then : | |
472fa5ee | 18689 | |
c0c3707f CB |
18690 | else |
18691 | FLOAT_H=float.h | |
18692 | fi | |
18693 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
18694 | ;; | |
18695 | esac | |
18696 | ;; | |
18697 | linux*) | |
18698 | case "$host_cpu" in | |
18699 | powerpc*) | |
18700 | FLOAT_H=float.h | |
18701 | ;; | |
18702 | esac | |
18703 | ;; | |
18704 | esac | |
18705 | case "$host_os" in | |
18706 | aix* | freebsd* | dragonfly* | linux*) | |
18707 | if test -n "$FLOAT_H"; then | |
18708 | REPLACE_FLOAT_LDBL=1 | |
18709 | fi | |
18710 | ;; | |
18711 | esac | |
18712 | ||
18713 | REPLACE_ITOLD=0 | |
18714 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5 | |
18715 | $as_echo_n "checking whether conversion from 'int' to 'long double' works... " >&6; } | |
18716 | if ${gl_cv_func_itold_works+:} false; then : | |
5e8754f9 SDJ |
18717 | $as_echo_n "(cached) " >&6 |
18718 | else | |
18719 | ||
18720 | if test "$cross_compiling" = yes; then : | |
c0c3707f CB |
18721 | case "$host" in |
18722 | sparc*-*-linux*) | |
18723 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18724 | /* end confdefs.h. */ | |
18725 | #if defined __LP64__ || defined __arch64__ | |
18726 | int ok; | |
18727 | #else | |
18728 | error fail | |
18729 | #endif | |
18730 | ||
18731 | _ACEOF | |
18732 | if ac_fn_c_try_compile "$LINENO"; then : | |
18733 | gl_cv_func_itold_works="guessing no" | |
18734 | else | |
18735 | gl_cv_func_itold_works="guessing yes" | |
18736 | fi | |
18737 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
18738 | ;; | |
18739 | # Guess yes on native Windows. | |
18740 | mingw*) gl_cv_func_itold_works="guessing yes" ;; | |
18741 | *) gl_cv_func_itold_works="guessing yes" ;; | |
5e8754f9 SDJ |
18742 | esac |
18743 | ||
18744 | else | |
18745 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18746 | /* end confdefs.h. */ | |
18747 | ||
c0c3707f CB |
18748 | int i = -1; |
18749 | volatile long double ld; | |
18750 | int main () | |
5e8754f9 | 18751 | { |
c0c3707f CB |
18752 | ld += i * 1.0L; |
18753 | if (ld > 0) | |
18754 | return 1; | |
18755 | return 0; | |
5e8754f9 SDJ |
18756 | } |
18757 | _ACEOF | |
18758 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 18759 | gl_cv_func_itold_works=yes |
5e8754f9 | 18760 | else |
c0c3707f | 18761 | gl_cv_func_itold_works=no |
5e8754f9 SDJ |
18762 | fi |
18763 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
18764 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
18765 | fi | |
18766 | ||
98399780 | 18767 | |
5e8754f9 | 18768 | fi |
c0c3707f CB |
18769 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5 |
18770 | $as_echo "$gl_cv_func_itold_works" >&6; } | |
18771 | case "$gl_cv_func_itold_works" in | |
18772 | *no) | |
18773 | REPLACE_ITOLD=1 | |
18774 | FLOAT_H=float.h | |
18775 | ;; | |
18776 | esac | |
98399780 | 18777 | |
c0c3707f | 18778 | if test -n "$FLOAT_H"; then |
98399780 YQ |
18779 | |
18780 | ||
18781 | ||
18782 | ||
6a29c58e YQ |
18783 | |
18784 | ||
18785 | ||
18786 | ||
c0c3707f CB |
18787 | if test $gl_cv_have_include_next = yes; then |
18788 | gl_cv_next_float_h='<'float.h'>' | |
18789 | else | |
18790 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5 | |
18791 | $as_echo_n "checking absolute name of <float.h>... " >&6; } | |
18792 | if ${gl_cv_next_float_h+:} false; then : | |
18793 | $as_echo_n "(cached) " >&6 | |
18794 | else | |
18795 | ||
18796 | ||
18797 | ||
18798 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
18799 | /* end confdefs.h. */ | |
18800 | #include <float.h> | |
18801 | _ACEOF | |
18802 | case "$host_os" in | |
18803 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
18804 | *) gl_absname_cpp="$ac_cpp" ;; | |
18805 | esac | |
18806 | ||
18807 | case "$host_os" in | |
18808 | mingw*) | |
18809 | gl_dirsep_regex='[/\\]' | |
18810 | ;; | |
18811 | *) | |
18812 | gl_dirsep_regex='\/' | |
18813 | ;; | |
18814 | esac | |
18815 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
18816 | gl_header_literal_regex=`echo 'float.h' \ | |
18817 | | sed -e "$gl_make_literal_regex_sed"` | |
18818 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
18819 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
18820 | s|^/[^/]|//&| | |
18821 | p | |
18822 | q | |
18823 | }' | |
18824 | ||
18825 | gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
18826 | sed -n "$gl_absolute_header_sed"` | |
18827 | ||
18828 | gl_header=$gl_cv_absolute_float_h | |
18829 | gl_cv_next_float_h='"'$gl_header'"' | |
18830 | ||
18831 | ||
18832 | fi | |
18833 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5 | |
18834 | $as_echo "$gl_cv_next_float_h" >&6; } | |
18835 | fi | |
18836 | NEXT_FLOAT_H=$gl_cv_next_float_h | |
18837 | ||
18838 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
18839 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
18840 | gl_next_as_first_directive='<'float.h'>' | |
18841 | else | |
18842 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
18843 | gl_next_as_first_directive=$gl_cv_next_float_h | |
18844 | fi | |
18845 | NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive | |
18846 | ||
18847 | ||
18848 | ||
6a29c58e | 18849 | |
c0c3707f | 18850 | fi |
6a29c58e | 18851 | |
c0c3707f CB |
18852 | if test -n "$FLOAT_H"; then |
18853 | GL_GENERATE_FLOAT_H_TRUE= | |
18854 | GL_GENERATE_FLOAT_H_FALSE='#' | |
18855 | else | |
18856 | GL_GENERATE_FLOAT_H_TRUE='#' | |
18857 | GL_GENERATE_FLOAT_H_FALSE= | |
18858 | fi | |
6a29c58e YQ |
18859 | |
18860 | ||
8690e634 | 18861 | |
c0c3707f | 18862 | if test $REPLACE_FLOAT_LDBL = 1; then |
8690e634 | 18863 | |
8690e634 | 18864 | |
8690e634 | 18865 | |
8690e634 | 18866 | |
8690e634 | 18867 | |
8690e634 | 18868 | |
8690e634 | 18869 | |
4a626d0a | 18870 | |
c0c3707f | 18871 | gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext" |
8690e634 | 18872 | |
c0c3707f CB |
18873 | fi |
18874 | if test $REPLACE_ITOLD = 1; then | |
8690e634 JK |
18875 | |
18876 | ||
18877 | ||
18878 | ||
18879 | ||
18880 | ||
63ce7108 | 18881 | |
e26b6bb0 | 18882 | |
c0c3707f | 18883 | gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext" |
e26b6bb0 | 18884 | |
c0c3707f | 18885 | fi |
e26b6bb0 TT |
18886 | |
18887 | ||
18888 | ||
18889 | ||
c0c3707f CB |
18890 | gl_fnmatch_required_lowercase=` |
18891 | echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]' | |
18892 | ` | |
e26b6bb0 | 18893 | |
c0c3707f CB |
18894 | if test $ac_cv_func_fnmatch = no; then |
18895 | HAVE_FNMATCH=0 | |
18896 | else | |
18897 | gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" | |
18898 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5 | |
18899 | $as_echo_n "checking for working $gl_fnmatch_required fnmatch... " >&6; } | |
18900 | if eval \${$gl_fnmatch_cache_var+:} false; then : | |
5e8754f9 SDJ |
18901 | $as_echo_n "(cached) " >&6 |
18902 | else | |
c0c3707f CB |
18903 | if test $gl_fnmatch_required = GNU; then |
18904 | gl_fnmatch_gnu_start= | |
18905 | gl_fnmatch_gnu_end= | |
18906 | else | |
18907 | gl_fnmatch_gnu_start='#if 0' | |
18908 | gl_fnmatch_gnu_end='#endif' | |
18909 | fi | |
18910 | if test "$cross_compiling" = yes; then : | |
18911 | case "$host_os" in | |
18912 | # Guess yes on musl systems. | |
18913 | *-musl*) eval "$gl_fnmatch_cache_var=\"guessing yes\"" ;; | |
18914 | # Guess no otherwise, even on glibc systems. | |
18915 | *) eval "$gl_fnmatch_cache_var=\"guessing no\"" ;; | |
18916 | esac | |
e26b6bb0 | 18917 | |
c0c3707f CB |
18918 | else |
18919 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
5e8754f9 | 18920 | /* end confdefs.h. */ |
c0c3707f CB |
18921 | #include <fnmatch.h> |
18922 | static int | |
18923 | y (char const *pattern, char const *string, int flags) | |
18924 | { | |
18925 | return fnmatch (pattern, string, flags) == 0; | |
18926 | } | |
18927 | static int | |
18928 | n (char const *pattern, char const *string, int flags) | |
18929 | { | |
18930 | return fnmatch (pattern, string, flags) == FNM_NOMATCH; | |
18931 | } | |
18932 | ||
5e8754f9 SDJ |
18933 | int |
18934 | main () | |
18935 | { | |
c0c3707f CB |
18936 | char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]"; |
18937 | char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; | |
18938 | static char const A_1[] = { 'A' - 1, 0 }; | |
18939 | static char const A01[] = { 'A' + 1, 0 }; | |
18940 | static char const a_1[] = { 'a' - 1, 0 }; | |
18941 | static char const a01[] = { 'a' + 1, 0 }; | |
18942 | static char const bs_1[] = { '\\\\' - 1, 0 }; | |
18943 | static char const bs01[] = { '\\\\' + 1, 0 }; | |
18944 | int result = 0; | |
18945 | if (!n ("a*", "", 0)) | |
18946 | return 1; | |
18947 | if (!y ("a*", "abc", 0)) | |
18948 | return 1; | |
18949 | if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ | |
18950 | return 1; | |
18951 | if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) | |
18952 | return 2; | |
18953 | if (!y ("a\\\\bc", "abc", 0)) | |
18954 | return 3; | |
18955 | if (!n ("a\\\\bc", "abc", FNM_NOESCAPE)) | |
18956 | return 3; | |
18957 | if (!y ("*x", ".x", 0)) | |
18958 | return 4; | |
18959 | if (!n ("*x", ".x", FNM_PERIOD)) | |
18960 | return 4; | |
18961 | if (!y (Apat, "\\\\", 0)) | |
18962 | return 5; | |
18963 | if (!y (Apat, "A", 0)) | |
18964 | return 5; | |
18965 | if (!y (apat, "\\\\", 0)) | |
18966 | return 5; | |
18967 | if (!y (apat, "a", 0)) | |
18968 | return 5; | |
18969 | if (!(n (Apat, A_1, 0) == ('A' < '\\\\'))) | |
18970 | return 5; | |
18971 | if (!(n (apat, a_1, 0) == ('a' < '\\\\'))) | |
18972 | return 5; | |
18973 | if (!(y (Apat, A01, 0) == ('A' < '\\\\'))) | |
18974 | return 5; | |
18975 | if (!(y (apat, a01, 0) == ('a' < '\\\\'))) | |
18976 | return 5; | |
18977 | if (!(y (Apat, bs_1, 0) == ('A' < '\\\\'))) | |
18978 | return 5; | |
18979 | if (!(y (apat, bs_1, 0) == ('a' < '\\\\'))) | |
18980 | return 5; | |
18981 | if (!(n (Apat, bs01, 0) == ('A' < '\\\\'))) | |
18982 | return 5; | |
18983 | if (!(n (apat, bs01, 0) == ('a' < '\\\\'))) | |
18984 | return 5; | |
18985 | $gl_fnmatch_gnu_start | |
18986 | if (!y ("xxXX", "xXxX", FNM_CASEFOLD)) | |
18987 | result |= 8; | |
18988 | if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)) | |
18989 | result |= 16; | |
18990 | if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME)) | |
18991 | result |= 32; | |
18992 | if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)) | |
18993 | result |= 64; | |
18994 | if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)) | |
18995 | result |= 64; | |
18996 | if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)) | |
18997 | result |= 64; | |
18998 | $gl_fnmatch_gnu_end | |
18999 | return result; | |
19000 | ||
5e8754f9 SDJ |
19001 | ; |
19002 | return 0; | |
19003 | } | |
19004 | _ACEOF | |
c0c3707f CB |
19005 | if ac_fn_c_try_run "$LINENO"; then : |
19006 | eval "$gl_fnmatch_cache_var=yes" | |
5e8754f9 | 19007 | else |
c0c3707f CB |
19008 | eval "$gl_fnmatch_cache_var=no" |
19009 | fi | |
19010 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
19011 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
5e8754f9 | 19012 | fi |
c0c3707f | 19013 | |
e26b6bb0 | 19014 | |
5e8754f9 | 19015 | fi |
c0c3707f CB |
19016 | eval ac_res=\$$gl_fnmatch_cache_var |
19017 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 | |
19018 | $as_echo "$ac_res" >&6; } | |
19019 | eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" | |
19020 | case "$gl_fnmatch_result" in | |
19021 | *yes) ;; | |
19022 | *) REPLACE_FNMATCH=1 ;; | |
19023 | esac | |
19024 | fi | |
19025 | if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then | |
e26b6bb0 | 19026 | |
e26b6bb0 | 19027 | |
c0c3707f CB |
19028 | FNMATCH_H='fnmatch.h' |
19029 | if test -n "$FNMATCH_H"; then | |
19030 | GL_GENERATE_FNMATCH_H_TRUE= | |
19031 | GL_GENERATE_FNMATCH_H_FALSE='#' | |
5e8754f9 | 19032 | else |
c0c3707f CB |
19033 | GL_GENERATE_FNMATCH_H_TRUE='#' |
19034 | GL_GENERATE_FNMATCH_H_FALSE= | |
5e8754f9 | 19035 | fi |
e26b6bb0 | 19036 | |
18848e28 | 19037 | |
c0c3707f | 19038 | fi |
18848e28 | 19039 | |
c0c3707f | 19040 | if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then |
18848e28 | 19041 | |
18848e28 | 19042 | |
18848e28 | 19043 | |
c0c3707f CB |
19044 | |
19045 | ||
19046 | ||
19047 | ||
19048 | ||
19049 | gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" | |
19050 | ||
19051 | ||
19052 | ||
19053 | ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h> | |
19054 | " | |
19055 | if test "x$ac_cv_have_decl_isblank" = xyes; then : | |
19056 | ac_have_decl=1 | |
5e8754f9 | 19057 | else |
c0c3707f CB |
19058 | ac_have_decl=0 |
19059 | fi | |
18848e28 | 19060 | |
c0c3707f CB |
19061 | cat >>confdefs.h <<_ACEOF |
19062 | #define HAVE_DECL_ISBLANK $ac_have_decl | |
5e8754f9 | 19063 | _ACEOF |
c0c3707f CB |
19064 | |
19065 | ||
19066 | ||
19067 | ||
19068 | fi | |
19069 | ||
19070 | ||
19071 | ||
19072 | ||
19073 | ||
19074 | GNULIB_FNMATCH=1 | |
19075 | ||
19076 | ||
19077 | ||
19078 | ||
19079 | ||
19080 | $as_echo "#define GNULIB_TEST_FNMATCH 1" >>confdefs.h | |
19081 | ||
19082 | ||
19083 | ||
19084 | ||
19085 | ||
19086 | ||
19087 | ||
19088 | ||
19089 | if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then | |
19090 | ||
19091 | ||
19092 | ||
19093 | ||
19094 | ||
19095 | ||
19096 | ||
19097 | ||
19098 | gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" | |
19099 | ||
19100 | ||
19101 | ||
19102 | ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h> | |
19103 | " | |
19104 | if test "x$ac_cv_have_decl_isblank" = xyes; then : | |
19105 | ac_have_decl=1 | |
5e8754f9 | 19106 | else |
c0c3707f | 19107 | ac_have_decl=0 |
5e8754f9 | 19108 | fi |
18848e28 | 19109 | |
c0c3707f CB |
19110 | cat >>confdefs.h <<_ACEOF |
19111 | #define HAVE_DECL_ISBLANK $ac_have_decl | |
19112 | _ACEOF | |
18848e28 GF |
19113 | |
19114 | ||
19115 | ||
18848e28 | 19116 | |
5e8754f9 | 19117 | fi |
18848e28 | 19118 | |
18848e28 | 19119 | |
c0c3707f CB |
19120 | cat >>confdefs.h <<_ACEOF |
19121 | #define GNULIB_FNMATCH_GNU 1 | |
19122 | _ACEOF | |
18848e28 | 19123 | |
18848e28 | 19124 | |
18848e28 | 19125 | |
18848e28 | 19126 | |
c0c3707f CB |
19127 | if test $gl_func_frexp != yes; then |
19128 | ||
19129 | ||
18848e28 GF |
19130 | |
19131 | ||
18848e28 | 19132 | |
18848e28 | 19133 | |
18848e28 | 19134 | |
c0c3707f CB |
19135 | |
19136 | gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext" | |
18848e28 GF |
19137 | |
19138 | fi | |
19139 | ||
19140 | ||
19141 | ||
19142 | ||
19143 | ||
c0c3707f | 19144 | GNULIB_FREXP=1 |
18848e28 GF |
19145 | |
19146 | ||
19147 | ||
19148 | ||
19149 | ||
c0c3707f | 19150 | $as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h |
18848e28 GF |
19151 | |
19152 | ||
19153 | ||
19154 | ||
c0c3707f CB |
19155 | if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then |
19156 | ||
19157 | ||
19158 | ||
18848e28 GF |
19159 | |
19160 | ||
19161 | ||
5e8754f9 SDJ |
19162 | |
19163 | ||
c0c3707f CB |
19164 | gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext" |
19165 | ||
5e8754f9 | 19166 | fi |
18848e28 | 19167 | |
6a29c58e | 19168 | |
6a29c58e | 19169 | |
6a29c58e | 19170 | |
6ec2e0f5 | 19171 | |
c0c3707f CB |
19172 | GNULIB_FREXPL=1 |
19173 | ||
19174 | ||
19175 | ||
19176 | ||
19177 | ||
19178 | $as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h | |
19179 | ||
19180 | ||
19181 | ||
19182 | ||
19183 | ||
19184 | ||
19185 | ||
19186 | case "$host_os" in | |
19187 | mingw* | solaris*) | |
19188 | REPLACE_FSTAT=1 | |
19189 | ;; | |
19190 | esac | |
472fa5ee SM |
19191 | |
19192 | ||
19193 | ||
19194 | ||
19195 | ||
6ec2e0f5 SDJ |
19196 | if test $ac_cv_func_fchdir = no; then |
19197 | HAVE_FCHDIR=0 | |
6a29c58e YQ |
19198 | fi |
19199 | ||
6ec2e0f5 SDJ |
19200 | if test $HAVE_FCHDIR = 0; then |
19201 | case "$gl_cv_func_open_directory_works" in | |
19202 | *yes) ;; | |
19203 | *) | |
19204 | REPLACE_FSTAT=1 | |
19205 | ;; | |
19206 | esac | |
19207 | fi | |
6a29c58e YQ |
19208 | |
19209 | ||
6ec2e0f5 | 19210 | if test $REPLACE_FSTAT = 1; then |
6a29c58e | 19211 | |
3d99e817 AK |
19212 | |
19213 | ||
19214 | ||
3d99e817 AK |
19215 | |
19216 | ||
19217 | ||
19218 | ||
6ec2e0f5 | 19219 | gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext" |
3d99e817 | 19220 | |
c0c3707f CB |
19221 | case "$host_os" in |
19222 | mingw*) | |
3d99e817 AK |
19223 | |
19224 | ||
19225 | ||
19226 | ||
19227 | ||
19228 | ||
49e4877c | 19229 | |
49e4877c | 19230 | |
c0c3707f | 19231 | gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" |
49e4877c | 19232 | |
c0c3707f CB |
19233 | ;; |
19234 | esac | |
49e4877c PA |
19235 | |
19236 | ||
c0c3707f CB |
19237 | : |
19238 | ||
19239 | fi | |
6a29c58e YQ |
19240 | |
19241 | ||
88b48903 | 19242 | |
8690e634 | 19243 | |
a512b375 | 19244 | |
c0c3707f CB |
19245 | GNULIB_FSTAT=1 |
19246 | ||
19247 | ||
19248 | ||
19249 | ||
19250 | ||
19251 | $as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h | |
19252 | ||
19253 | ||
88b48903 | 19254 | |
88b48903 | 19255 | |
472fa5ee SM |
19256 | |
19257 | ||
19258 | ||
19259 | ||
19260 | ||
6ec2e0f5 SDJ |
19261 | |
19262 | if test $ac_cv_func_fstatat = no; then | |
19263 | HAVE_FSTATAT=0 | |
19264 | else | |
19265 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fstatat (..., 0) works" >&5 | |
19266 | $as_echo_n "checking whether fstatat (..., 0) works... " >&6; } | |
d0ac1c44 | 19267 | if ${gl_cv_func_fstatat_zero_flag+:} false; then : |
6ec2e0f5 SDJ |
19268 | $as_echo_n "(cached) " >&6 |
19269 | else | |
19270 | if test "$cross_compiling" = yes; then : | |
19271 | case "$host_os" in | |
19272 | aix*) gl_cv_func_fstatat_zero_flag="guessing no";; | |
19273 | *) gl_cv_func_fstatat_zero_flag="guessing yes";; | |
19274 | esac | |
88b48903 | 19275 | |
8690e634 JK |
19276 | else |
19277 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19278 | /* end confdefs.h. */ | |
8690e634 | 19279 | |
6ec2e0f5 SDJ |
19280 | #include <fcntl.h> |
19281 | #include <sys/stat.h> | |
19282 | int | |
19283 | main (void) | |
19284 | { | |
19285 | struct stat a; | |
19286 | return fstatat (AT_FDCWD, ".", &a, 0) != 0; | |
19287 | } | |
19288 | ||
88b48903 WN |
19289 | _ACEOF |
19290 | if ac_fn_c_try_run "$LINENO"; then : | |
6ec2e0f5 | 19291 | gl_cv_func_fstatat_zero_flag=yes |
88b48903 | 19292 | else |
6ec2e0f5 | 19293 | gl_cv_func_fstatat_zero_flag=no |
88b48903 WN |
19294 | fi |
19295 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
19296 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
19297 | fi | |
19298 | ||
19299 | ||
19300 | fi | |
6ec2e0f5 SDJ |
19301 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fstatat_zero_flag" >&5 |
19302 | $as_echo "$gl_cv_func_fstatat_zero_flag" >&6; } | |
88b48903 | 19303 | |
6ec2e0f5 SDJ |
19304 | case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in |
19305 | *yes+*yes) ;; | |
c0c3707f CB |
19306 | *) REPLACE_FSTATAT=1 ;; |
19307 | esac | |
19308 | ||
19309 | case $host_os in | |
19310 | solaris*) | |
19311 | REPLACE_FSTATAT=1 ;; | |
19312 | esac | |
19313 | ||
19314 | case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in | |
19315 | 1,*yes) | |
88b48903 | 19316 | |
6ec2e0f5 | 19317 | $as_echo "#define HAVE_WORKING_FSTATAT_ZERO_FLAG 1" >>confdefs.h |
88b48903 | 19318 | |
7a6dbc2f | 19319 | ;; |
6ec2e0f5 SDJ |
19320 | esac |
19321 | fi | |
88b48903 | 19322 | |
6ec2e0f5 | 19323 | if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then |
88b48903 WN |
19324 | |
19325 | ||
19326 | ||
19327 | ||
19328 | ||
88b48903 | 19329 | |
4a626d0a PA |
19330 | |
19331 | ||
6ec2e0f5 SDJ |
19332 | gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext" |
19333 | ||
19334 | fi | |
19335 | ||
19336 | ||
19337 | ||
4a626d0a | 19338 | |
6ec2e0f5 SDJ |
19339 | |
19340 | GNULIB_FSTATAT=1 | |
19341 | ||
19342 | ||
19343 | ||
19344 | ||
19345 | ||
19346 | $as_echo "#define GNULIB_TEST_FSTATAT 1" >>confdefs.h | |
19347 | ||
19348 | ||
19349 | ||
19350 | ||
19351 | ||
19352 | ||
19353 | ||
19354 | ||
19355 | gl_abort_bug=no | |
4a626d0a PA |
19356 | case "$host_os" in |
19357 | mingw*) | |
6ec2e0f5 | 19358 | gl_cv_func_getcwd_path_max=yes |
4a626d0a PA |
19359 | ;; |
19360 | *) | |
88b48903 | 19361 | |
88b48903 | 19362 | |
88b48903 WN |
19363 | |
19364 | ||
88b48903 | 19365 | |
6ec2e0f5 SDJ |
19366 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd handles long file names properly" >&5 |
19367 | $as_echo_n "checking whether getcwd handles long file names properly... " >&6; } | |
d0ac1c44 | 19368 | if ${gl_cv_func_getcwd_path_max+:} false; then : |
6ec2e0f5 SDJ |
19369 | $as_echo_n "(cached) " >&6 |
19370 | else | |
19371 | # Arrange for deletion of the temporary directory this test creates. | |
19372 | ac_clean_files="$ac_clean_files confdir3" | |
19373 | if test "$cross_compiling" = yes; then : | |
b567ca63 | 19374 | # Cross-compilation guesses: |
c0c3707f CB |
19375 | case "$host_os" in |
19376 | aix*) # On AIX, it has the AIX bug. | |
19377 | gl_cv_func_getcwd_path_max='guessing no, it has the AIX bug' ;; | |
19378 | gnu*) # On Hurd, it is 'yes'. | |
19379 | gl_cv_func_getcwd_path_max='guessing yes' ;; | |
19380 | linux* | kfreebsd*) | |
19381 | # On older Linux+glibc it's 'no, but it is partly working', | |
19382 | # on newer Linux+glibc it's 'yes'. | |
19383 | # On Linux+musl libc, it's 'no, but it is partly working'. | |
19384 | # On kFreeBSD+glibc, it's 'no, but it is partly working'. | |
19385 | gl_cv_func_getcwd_path_max='guessing no, but it is partly working' ;; | |
19386 | *) # If we don't know, obey --enable-cross-guesses. | |
19387 | gl_cv_func_getcwd_path_max="$gl_cross_guess_normal" ;; | |
19388 | esac | |
b567ca63 | 19389 | |
6ec2e0f5 SDJ |
19390 | else |
19391 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19392 | /* end confdefs.h. */ | |
88b48903 | 19393 | |
6ec2e0f5 SDJ |
19394 | #include <errno.h> |
19395 | #include <stdlib.h> | |
19396 | #if HAVE_UNISTD_H | |
19397 | # include <unistd.h> | |
19398 | #else | |
19399 | # include <direct.h> | |
19400 | #endif | |
19401 | #include <string.h> | |
19402 | #include <limits.h> | |
19403 | #include <sys/stat.h> | |
19404 | #include <sys/types.h> | |
19405 | #include <fcntl.h> | |
88b48903 WN |
19406 | |
19407 | ||
6ec2e0f5 SDJ |
19408 | /* Arrange to define PATH_MAX, like "pathmax.h" does. */ |
19409 | #if HAVE_UNISTD_H | |
19410 | # include <unistd.h> | |
19411 | #endif | |
19412 | #include <limits.h> | |
19413 | #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN | |
19414 | # include <sys/param.h> | |
19415 | #endif | |
19416 | #if !defined PATH_MAX && defined MAXPATHLEN | |
19417 | # define PATH_MAX MAXPATHLEN | |
19418 | #endif | |
19419 | #ifdef __hpux | |
19420 | # undef PATH_MAX | |
19421 | # define PATH_MAX 1024 | |
19422 | #endif | |
c0c3707f | 19423 | #if defined _WIN32 && ! defined __CYGWIN__ |
6ec2e0f5 SDJ |
19424 | # undef PATH_MAX |
19425 | # define PATH_MAX 260 | |
19426 | #endif | |
88b48903 | 19427 | |
88b48903 | 19428 | |
6ec2e0f5 SDJ |
19429 | #ifndef AT_FDCWD |
19430 | # define AT_FDCWD 0 | |
19431 | #endif | |
19432 | #ifdef ENAMETOOLONG | |
19433 | # define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG) | |
19434 | #else | |
19435 | # define is_ENAMETOOLONG(x) 0 | |
19436 | #endif | |
88b48903 | 19437 | |
6ec2e0f5 SDJ |
19438 | /* Use the getcwd function, not any macro. */ |
19439 | #undef getcwd | |
88b48903 | 19440 | |
6ec2e0f5 SDJ |
19441 | /* Don't get link errors because mkdir is redefined to rpl_mkdir. */ |
19442 | #undef mkdir | |
88b48903 | 19443 | |
6ec2e0f5 SDJ |
19444 | #ifndef S_IRWXU |
19445 | # define S_IRWXU 0700 | |
19446 | #endif | |
88b48903 | 19447 | |
6ec2e0f5 SDJ |
19448 | /* The length of this name must be 8. */ |
19449 | #define DIR_NAME "confdir3" | |
19450 | #define DIR_NAME_LEN 8 | |
19451 | #define DIR_NAME_SIZE (DIR_NAME_LEN + 1) | |
88b48903 | 19452 | |
6ec2e0f5 SDJ |
19453 | /* The length of "../". */ |
19454 | #define DOTDOTSLASH_LEN 3 | |
88b48903 | 19455 | |
6ec2e0f5 SDJ |
19456 | /* Leftover bytes in the buffer, to work around library or OS bugs. */ |
19457 | #define BUF_SLOP 20 | |
88b48903 | 19458 | |
6ec2e0f5 SDJ |
19459 | int |
19460 | main () | |
19461 | { | |
19462 | #ifndef PATH_MAX | |
19463 | /* The Hurd doesn't define this, so getcwd can't exhibit the bug -- | |
19464 | at least not on a local file system. And if we were to start worrying | |
19465 | about remote file systems, we'd have to enable the wrapper function | |
19466 | all of the time, just to be safe. That's not worth the cost. */ | |
19467 | exit (0); | |
19468 | #elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \ | |
19469 | - DIR_NAME_SIZE - BUF_SLOP) \ | |
19470 | <= PATH_MAX) | |
19471 | /* FIXME: Assuming there's a system for which this is true, | |
19472 | this should be done in a compile test. */ | |
19473 | exit (0); | |
19474 | #else | |
19475 | char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) | |
19476 | + DIR_NAME_SIZE + BUF_SLOP]; | |
19477 | char *cwd = getcwd (buf, PATH_MAX); | |
19478 | size_t initial_cwd_len; | |
19479 | size_t cwd_len; | |
19480 | int fail = 0; | |
19481 | size_t n_chdirs = 0; | |
88b48903 | 19482 | |
6ec2e0f5 SDJ |
19483 | if (cwd == NULL) |
19484 | exit (10); | |
88b48903 | 19485 | |
6ec2e0f5 | 19486 | cwd_len = initial_cwd_len = strlen (cwd); |
88b48903 | 19487 | |
6ec2e0f5 SDJ |
19488 | while (1) |
19489 | { | |
19490 | size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN); | |
19491 | char *c = NULL; | |
19492 | ||
19493 | cwd_len += DIR_NAME_SIZE; | |
19494 | /* If mkdir or chdir fails, it could be that this system cannot create | |
19495 | any file with an absolute name longer than PATH_MAX, such as cygwin. | |
19496 | If so, leave fail as 0, because the current working directory can't | |
c0c3707f CB |
19497 | be too long for getcwd if it can't even be created. On Linux with |
19498 | the 9p file system, mkdir fails with error EINVAL when cwd_len gets | |
19499 | too long; ignore this failure because the getcwd() system call | |
19500 | produces good results whereas the gnulib substitute calls getdents64 | |
19501 | which fails with error EPROTO. | |
19502 | For other errors, be pessimistic and consider that as a failure, | |
19503 | too. */ | |
6ec2e0f5 SDJ |
19504 | if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0) |
19505 | { | |
19506 | if (! (errno == ERANGE || is_ENAMETOOLONG (errno))) | |
c0c3707f CB |
19507 | #ifdef __linux__ |
19508 | if (! (errno == EINVAL)) | |
19509 | #endif | |
19510 | fail = 20; | |
6ec2e0f5 SDJ |
19511 | break; |
19512 | } | |
88b48903 | 19513 | |
6ec2e0f5 SDJ |
19514 | if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE) |
19515 | { | |
19516 | struct stat sb; | |
88b48903 | 19517 | |
6ec2e0f5 SDJ |
19518 | c = getcwd (buf, PATH_MAX); |
19519 | if (!c && errno == ENOENT) | |
19520 | { | |
19521 | fail = 11; | |
19522 | break; | |
19523 | } | |
19524 | if (c) | |
19525 | { | |
19526 | fail = 31; | |
19527 | break; | |
19528 | } | |
19529 | if (! (errno == ERANGE || is_ENAMETOOLONG (errno))) | |
19530 | { | |
19531 | fail = 21; | |
19532 | break; | |
19533 | } | |
88b48903 | 19534 | |
6ec2e0f5 SDJ |
19535 | /* Our replacement needs to be able to stat() long ../../paths, |
19536 | so generate a path larger than PATH_MAX to check, | |
19537 | avoiding the replacement if we can't stat(). */ | |
19538 | c = getcwd (buf, cwd_len + 1); | |
19539 | if (c && !AT_FDCWD && stat (c, &sb) != 0 && is_ENAMETOOLONG (errno)) | |
19540 | { | |
19541 | fail = 32; | |
19542 | break; | |
19543 | } | |
19544 | } | |
88b48903 | 19545 | |
6ec2e0f5 SDJ |
19546 | if (dotdot_max <= cwd_len - initial_cwd_len) |
19547 | { | |
19548 | if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len) | |
19549 | break; | |
19550 | c = getcwd (buf, cwd_len + 1); | |
19551 | if (!c) | |
19552 | { | |
19553 | if (! (errno == ERANGE || errno == ENOENT | |
19554 | || is_ENAMETOOLONG (errno))) | |
19555 | { | |
19556 | fail = 22; | |
19557 | break; | |
19558 | } | |
19559 | if (AT_FDCWD || errno == ERANGE || errno == ENOENT) | |
19560 | { | |
19561 | fail = 12; | |
19562 | break; | |
19563 | } | |
19564 | } | |
19565 | } | |
88b48903 | 19566 | |
6ec2e0f5 SDJ |
19567 | if (c && strlen (c) != cwd_len) |
19568 | { | |
19569 | fail = 23; | |
19570 | break; | |
19571 | } | |
19572 | ++n_chdirs; | |
19573 | } | |
88b48903 | 19574 | |
6ec2e0f5 SDJ |
19575 | /* Leaving behind such a deep directory is not polite. |
19576 | So clean up here, right away, even though the driving | |
19577 | shell script would also clean up. */ | |
19578 | { | |
19579 | size_t i; | |
88b48903 | 19580 | |
6ec2e0f5 SDJ |
19581 | /* Try rmdir first, in case the chdir failed. */ |
19582 | rmdir (DIR_NAME); | |
19583 | for (i = 0; i <= n_chdirs; i++) | |
19584 | { | |
19585 | if (chdir ("..") < 0) | |
19586 | break; | |
19587 | if (rmdir (DIR_NAME) != 0) | |
19588 | break; | |
19589 | } | |
19590 | } | |
88b48903 | 19591 | |
6ec2e0f5 SDJ |
19592 | exit (fail); |
19593 | #endif | |
19594 | } | |
88b48903 | 19595 | |
6ec2e0f5 SDJ |
19596 | _ACEOF |
19597 | if ac_fn_c_try_run "$LINENO"; then : | |
19598 | gl_cv_func_getcwd_path_max=yes | |
19599 | else | |
19600 | case $? in | |
c0c3707f CB |
19601 | 10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';; |
19602 | 31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';; | |
19603 | 32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';; | |
19604 | *) gl_cv_func_getcwd_path_max=no;; | |
19605 | esac | |
6ec2e0f5 SDJ |
19606 | fi |
19607 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
19608 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
19609 | fi | |
88b48903 | 19610 | |
88b48903 | 19611 | |
6ec2e0f5 SDJ |
19612 | fi |
19613 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_path_max" >&5 | |
19614 | $as_echo "$gl_cv_func_getcwd_path_max" >&6; } | |
88b48903 | 19615 | |
6ec2e0f5 SDJ |
19616 | case "$gl_cv_func_getcwd_null" in |
19617 | *yes) | |
88b48903 WN |
19618 | |
19619 | ||
472fa5ee SM |
19620 | |
19621 | ||
19622 | ||
472fa5ee | 19623 | |
c0c3707f CB |
19624 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5 |
19625 | $as_echo_n "checking for getpagesize... " >&6; } | |
19626 | if ${gl_cv_func_getpagesize+:} false; then : | |
19627 | $as_echo_n "(cached) " >&6 | |
19628 | else | |
19629 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19630 | /* end confdefs.h. */ | |
19631 | #include <unistd.h> | |
19632 | int | |
19633 | main () | |
19634 | { | |
19635 | return getpagesize(); | |
19636 | ; | |
19637 | return 0; | |
19638 | } | |
472fa5ee | 19639 | |
c0c3707f CB |
19640 | _ACEOF |
19641 | if ac_fn_c_try_link "$LINENO"; then : | |
19642 | gl_cv_func_getpagesize=yes | |
19643 | else | |
19644 | gl_cv_func_getpagesize=no | |
19645 | fi | |
19646 | rm -f core conftest.err conftest.$ac_objext \ | |
19647 | conftest$ac_exeext conftest.$ac_ext | |
472fa5ee | 19648 | |
c0c3707f CB |
19649 | fi |
19650 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5 | |
19651 | $as_echo "$gl_cv_func_getpagesize" >&6; } | |
88b48903 | 19652 | |
c0c3707f | 19653 | if test $gl_cv_func_getpagesize = yes; then |
88b48903 | 19654 | |
c0c3707f | 19655 | cat >>confdefs.h <<_ACEOF |
7a6dbc2f SDJ |
19656 | #define HAVE_GETPAGESIZE 1 |
19657 | _ACEOF | |
19658 | ||
c0c3707f | 19659 | fi |
6ec2e0f5 SDJ |
19660 | |
19661 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd aborts when 4k < cwd_length < 16k" >&5 | |
19662 | $as_echo_n "checking whether getcwd aborts when 4k < cwd_length < 16k... " >&6; } | |
d0ac1c44 | 19663 | if ${gl_cv_func_getcwd_abort_bug+:} false; then : |
88b48903 WN |
19664 | $as_echo_n "(cached) " >&6 |
19665 | else | |
6ec2e0f5 SDJ |
19666 | # Remove any remnants of a previous test. |
19667 | rm -rf confdir-14B--- | |
19668 | # Arrange for deletion of the temporary directory this test creates. | |
19669 | ac_clean_files="$ac_clean_files confdir-14B---" | |
19670 | if test "$cross_compiling" = yes; then : | |
c0c3707f CB |
19671 | case "$host_os" in |
19672 | # Guess no on musl systems. | |
19673 | *-musl*) gl_cv_func_getcwd_abort_bug="guessing no" ;; | |
19674 | # Guess yes otherwise, even on glibc systems. | |
19675 | *) gl_cv_func_getcwd_abort_bug="guessing yes" | |
19676 | esac | |
19677 | ||
88b48903 WN |
19678 | else |
19679 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19680 | /* end confdefs.h. */ | |
6ec2e0f5 SDJ |
19681 | |
19682 | #include <errno.h> | |
19683 | #include <stdlib.h> | |
19684 | #if HAVE_UNISTD_H | |
19685 | # include <unistd.h> | |
19686 | #else /* on Windows with MSVC */ | |
19687 | # include <direct.h> | |
19688 | #endif | |
19689 | #include <string.h> | |
19690 | #include <sys/stat.h> | |
19691 | ||
19692 | ||
19693 | /* Arrange to define PATH_MAX, like "pathmax.h" does. */ | |
19694 | #if HAVE_UNISTD_H | |
19695 | # include <unistd.h> | |
19696 | #endif | |
19697 | #include <limits.h> | |
19698 | #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN | |
19699 | # include <sys/param.h> | |
19700 | #endif | |
19701 | #if !defined PATH_MAX && defined MAXPATHLEN | |
19702 | # define PATH_MAX MAXPATHLEN | |
19703 | #endif | |
19704 | #ifdef __hpux | |
19705 | # undef PATH_MAX | |
19706 | # define PATH_MAX 1024 | |
19707 | #endif | |
c0c3707f | 19708 | #if defined _WIN32 && ! defined __CYGWIN__ |
6ec2e0f5 SDJ |
19709 | # undef PATH_MAX |
19710 | # define PATH_MAX 260 | |
19711 | #endif | |
19712 | ||
19713 | ||
19714 | /* Don't get link errors because mkdir is redefined to rpl_mkdir. */ | |
19715 | #undef mkdir | |
19716 | ||
19717 | #ifndef S_IRWXU | |
19718 | # define S_IRWXU 0700 | |
19719 | #endif | |
19720 | ||
19721 | /* FIXME: skip the run-test altogether on systems without getpagesize. */ | |
19722 | #if ! HAVE_GETPAGESIZE | |
19723 | # define getpagesize() 0 | |
19724 | #endif | |
19725 | ||
19726 | /* This size is chosen to be larger than PATH_MAX (4k), yet smaller than | |
19727 | the 16kB pagesize on ia64 linux. Those conditions make the code below | |
19728 | trigger a bug in glibc's getcwd implementation before 2.4.90-10. */ | |
19729 | #define TARGET_LEN (5 * 1024) | |
88b48903 WN |
19730 | |
19731 | int | |
19732 | main () | |
19733 | { | |
6ec2e0f5 SDJ |
19734 | char *cwd; |
19735 | size_t initial_cwd_len; | |
19736 | int fail = 0; | |
19737 | ||
19738 | /* The bug is triggered when PATH_MAX < getpagesize (), so skip | |
19739 | this relatively expensive and invasive test if that's not true. */ | |
19740 | #ifdef PATH_MAX | |
19741 | int bug_possible = PATH_MAX < getpagesize (); | |
19742 | #else | |
19743 | int bug_possible = 0; | |
19744 | #endif | |
19745 | if (! bug_possible) | |
19746 | return 0; | |
8690e634 | 19747 | |
6ec2e0f5 SDJ |
19748 | cwd = getcwd (NULL, 0); |
19749 | if (cwd == NULL) | |
19750 | return 2; | |
19751 | ||
19752 | initial_cwd_len = strlen (cwd); | |
19753 | free (cwd); | |
19754 | ||
19755 | if (1) | |
19756 | { | |
19757 | static char const dir_name[] = "confdir-14B---"; | |
19758 | size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len) | |
19759 | / sizeof dir_name); | |
19760 | size_t d; | |
19761 | for (d = 0; d < desired_depth; d++) | |
19762 | { | |
19763 | if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0) | |
19764 | { | |
19765 | if (! (errno == ERANGE || errno == ENAMETOOLONG | |
19766 | || errno == ENOENT)) | |
19767 | fail = 3; /* Unable to construct deep hierarchy. */ | |
19768 | break; | |
19769 | } | |
19770 | } | |
19771 | ||
19772 | /* If libc has the bug in question, this invocation of getcwd | |
19773 | results in a failed assertion. */ | |
19774 | cwd = getcwd (NULL, 0); | |
19775 | if (cwd == NULL) | |
19776 | fail = 4; /* getcwd didn't assert, but it failed for a long name | |
19777 | where the answer could have been learned. */ | |
19778 | free (cwd); | |
19779 | ||
19780 | /* Call rmdir first, in case the above chdir failed. */ | |
19781 | rmdir (dir_name); | |
19782 | while (0 < d--) | |
19783 | { | |
19784 | if (chdir ("..") < 0) | |
19785 | { | |
19786 | fail = 5; | |
19787 | break; | |
19788 | } | |
19789 | rmdir (dir_name); | |
19790 | } | |
19791 | } | |
19792 | ||
19793 | return fail; | |
8690e634 | 19794 | } |
6ec2e0f5 | 19795 | |
8690e634 JK |
19796 | _ACEOF |
19797 | if ac_fn_c_try_run "$LINENO"; then : | |
6ec2e0f5 | 19798 | gl_cv_func_getcwd_abort_bug=no |
8690e634 | 19799 | else |
c0c3707f CB |
19800 | ret=$? |
19801 | if test $ret -ge 128 || test $ret = 4; then | |
19802 | gl_cv_func_getcwd_abort_bug=yes | |
19803 | else | |
19804 | gl_cv_func_getcwd_abort_bug=no | |
19805 | fi | |
19806 | ||
8690e634 JK |
19807 | fi |
19808 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
19809 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
19810 | fi | |
19811 | ||
19812 | ||
19813 | fi | |
6ec2e0f5 SDJ |
19814 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_abort_bug" >&5 |
19815 | $as_echo "$gl_cv_func_getcwd_abort_bug" >&6; } | |
c0c3707f CB |
19816 | case "$gl_cv_func_getcwd_abort_bug" in |
19817 | *yes) | |
19818 | gl_abort_bug=yes | |
19819 | ;; | |
19820 | *) | |
19821 | ||
19822 | ;; | |
19823 | esac | |
6ec2e0f5 SDJ |
19824 | |
19825 | ;; | |
19826 | esac | |
19827 | ;; | |
19828 | esac | |
19829 | case "$gl_cv_func_getcwd_path_max" in | |
c0c3707f | 19830 | *"no" | *"no, it has the AIX bug") ;; |
6ec2e0f5 SDJ |
19831 | *) |
19832 | ||
19833 | $as_echo "#define HAVE_MINIMALLY_WORKING_GETCWD 1" >>confdefs.h | |
19834 | ||
19835 | ;; | |
19836 | esac | |
19837 | case "$gl_cv_func_getcwd_path_max" in | |
c0c3707f | 19838 | *"no, but it is partly working") |
6ec2e0f5 SDJ |
19839 | |
19840 | $as_echo "#define HAVE_PARTLY_WORKING_GETCWD 1" >>confdefs.h | |
19841 | ||
19842 | ;; | |
c0c3707f | 19843 | *"yes, but with shorter paths") |
6ec2e0f5 SDJ |
19844 | |
19845 | $as_echo "#define HAVE_GETCWD_SHORTER 1" >>confdefs.h | |
19846 | ||
19847 | ;; | |
19848 | esac | |
19849 | ||
19850 | if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \ | |
19851 | || test $gl_cv_func_getcwd_posix_signature != yes \ | |
19852 | || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \ | |
19853 | || test $gl_abort_bug = yes; then | |
19854 | REPLACE_GETCWD=1 | |
8690e634 JK |
19855 | fi |
19856 | ||
6ec2e0f5 | 19857 | if test $REPLACE_GETCWD = 1; then |
8690e634 JK |
19858 | |
19859 | ||
8690e634 JK |
19860 | |
19861 | ||
19862 | ||
19863 | ||
19864 | ||
19865 | ||
6ec2e0f5 | 19866 | gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext" |
8690e634 JK |
19867 | |
19868 | ||
8690e634 JK |
19869 | |
19870 | ||
6ec2e0f5 SDJ |
19871 | : |
19872 | ||
19873 | fi | |
19874 | ||
8690e634 JK |
19875 | |
19876 | cat >>confdefs.h <<_ACEOF | |
6ec2e0f5 | 19877 | #define GNULIB_GETCWD 1 |
8690e634 JK |
19878 | _ACEOF |
19879 | ||
19880 | ||
8690e634 | 19881 | |
8690e634 JK |
19882 | |
19883 | ||
c971b7fa | 19884 | |
c971b7fa | 19885 | |
6ec2e0f5 SDJ |
19886 | GNULIB_GETCWD=1 |
19887 | ||
19888 | ||
19889 | ||
19890 | ||
19891 | ||
19892 | $as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h | |
19893 | ||
c971b7fa | 19894 | |
c971b7fa | 19895 | |
c971b7fa | 19896 | |
c971b7fa | 19897 | |
c971b7fa | 19898 | |
c971b7fa | 19899 | |
c971b7fa | 19900 | |
6ec2e0f5 SDJ |
19901 | case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in |
19902 | *yes,yes) ;; | |
19903 | *) | |
19904 | REPLACE_GETCWD=1 | |
19905 | ;; | |
19906 | esac | |
c971b7fa | 19907 | |
6ec2e0f5 | 19908 | if test $REPLACE_GETCWD = 1; then |
c971b7fa | 19909 | |
c971b7fa PA |
19910 | |
19911 | ||
c971b7fa PA |
19912 | |
19913 | ||
c971b7fa | 19914 | |
c971b7fa | 19915 | |
c971b7fa | 19916 | |
6ec2e0f5 | 19917 | gl_LIBOBJS="$gl_LIBOBJS getcwd-lgpl.$ac_objext" |
c971b7fa | 19918 | |
6ec2e0f5 | 19919 | fi |
c971b7fa | 19920 | |
c971b7fa | 19921 | |
c971b7fa | 19922 | |
c971b7fa | 19923 | |
8690e634 | 19924 | |
6ec2e0f5 | 19925 | GNULIB_GETCWD=1 |
c971b7fa | 19926 | |
88b48903 WN |
19927 | |
19928 | ||
19929 | ||
88b48903 | 19930 | |
6ec2e0f5 | 19931 | $as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h |
88b48903 | 19932 | |
88b48903 WN |
19933 | |
19934 | ||
19935 | ||
6ec2e0f5 SDJ |
19936 | |
19937 | ||
19938 | ||
19939 | ||
19940 | if test $ac_cv_func_getdtablesize = yes && | |
19941 | test $ac_cv_have_decl_getdtablesize = yes; then | |
6ec2e0f5 SDJ |
19942 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5 |
19943 | $as_echo_n "checking whether getdtablesize works... " >&6; } | |
d0ac1c44 | 19944 | if ${gl_cv_func_getdtablesize_works+:} false; then : |
88b48903 WN |
19945 | $as_echo_n "(cached) " >&6 |
19946 | else | |
c0c3707f CB |
19947 | case "$host_os" in |
19948 | vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;; | |
19949 | *) | |
19950 | if test "$cross_compiling" = yes; then : | |
88b48903 | 19951 | case "$host_os" in |
c0c3707f CB |
19952 | cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows |
19953 | gl_cv_func_getdtablesize_works="guessing no" ;; | |
19954 | *) gl_cv_func_getdtablesize_works="guessing yes" ;; | |
19955 | esac | |
19956 | ||
88b48903 WN |
19957 | else |
19958 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
19959 | /* end confdefs.h. */ | |
19960 | ||
c0c3707f | 19961 | #include <unistd.h> |
6ec2e0f5 SDJ |
19962 | int |
19963 | main () | |
88b48903 | 19964 | { |
6ec2e0f5 | 19965 | int size = getdtablesize(); |
c0c3707f CB |
19966 | if (dup2 (0, getdtablesize()) != -1) |
19967 | return 1; | |
19968 | if (size != getdtablesize()) | |
19969 | return 2; | |
6ec2e0f5 SDJ |
19970 | |
19971 | ; | |
19972 | return 0; | |
88b48903 WN |
19973 | } |
19974 | _ACEOF | |
19975 | if ac_fn_c_try_run "$LINENO"; then : | |
6ec2e0f5 | 19976 | gl_cv_func_getdtablesize_works=yes |
88b48903 | 19977 | else |
6ec2e0f5 | 19978 | gl_cv_func_getdtablesize_works=no |
88b48903 WN |
19979 | fi |
19980 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
19981 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
19982 | fi | |
19983 | ||
c0c3707f CB |
19984 | ;; |
19985 | esac | |
88b48903 WN |
19986 | |
19987 | fi | |
6ec2e0f5 SDJ |
19988 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5 |
19989 | $as_echo "$gl_cv_func_getdtablesize_works" >&6; } | |
19990 | case "$gl_cv_func_getdtablesize_works" in | |
c0c3707f | 19991 | *yes | "no (limitation)") ;; |
6ec2e0f5 | 19992 | *) REPLACE_GETDTABLESIZE=1 ;; |
88b48903 WN |
19993 | esac |
19994 | else | |
6ec2e0f5 | 19995 | HAVE_GETDTABLESIZE=0 |
88b48903 WN |
19996 | fi |
19997 | ||
6ec2e0f5 | 19998 | if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then |
88b48903 WN |
19999 | |
20000 | ||
20001 | ||
20002 | ||
20003 | ||
20004 | ||
20005 | ||
20006 | ||
6ec2e0f5 | 20007 | gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext" |
88b48903 | 20008 | |
6ec2e0f5 | 20009 | : |
88b48903 WN |
20010 | fi |
20011 | ||
20012 | ||
20013 | ||
20014 | ||
20015 | ||
6ec2e0f5 | 20016 | GNULIB_GETDTABLESIZE=1 |
88b48903 WN |
20017 | |
20018 | ||
20019 | ||
88b48903 | 20020 | |
88b48903 | 20021 | |
6ec2e0f5 | 20022 | $as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h |
88b48903 | 20023 | |
88b48903 | 20024 | |
88b48903 | 20025 | |
88b48903 | 20026 | |
88b48903 | 20027 | |
88b48903 | 20028 | |
88b48903 | 20029 | |
88b48903 WN |
20030 | |
20031 | ||
6ec2e0f5 SDJ |
20032 | if test $ac_cv_have_decl_getlogin_r = no; then |
20033 | HAVE_DECL_GETLOGIN_R=0 | |
20034 | fi | |
88b48903 | 20035 | |
88b48903 | 20036 | |
6ec2e0f5 SDJ |
20037 | if test $ac_cv_func_getlogin_r = no; then |
20038 | HAVE_GETLOGIN_R=0 | |
20039 | else | |
20040 | HAVE_GETLOGIN_R=1 | |
20041 | ||
20042 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getlogin_r works with small buffers" >&5 | |
20043 | $as_echo_n "checking whether getlogin_r works with small buffers... " >&6; } | |
d0ac1c44 | 20044 | if ${gl_cv_func_getlogin_r_works+:} false; then : |
6ec2e0f5 SDJ |
20045 | $as_echo_n "(cached) " >&6 |
20046 | else | |
88b48903 | 20047 | |
6ec2e0f5 | 20048 | case "$host_os" in |
c0c3707f CB |
20049 | # Guess no on Mac OS X, OSF/1. |
20050 | darwin* | osf*) gl_cv_func_getlogin_r_works="guessing no" ;; | |
20051 | # Guess yes otherwise. | |
20052 | *) gl_cv_func_getlogin_r_works="guessing yes" ;; | |
6ec2e0f5 SDJ |
20053 | esac |
20054 | if test "$cross_compiling" = yes; then : | |
20055 | : | |
88b48903 WN |
20056 | else |
20057 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20058 | /* end confdefs.h. */ | |
20059 | ||
6ec2e0f5 | 20060 | #include <stddef.h> |
c0c3707f | 20061 | #include <string.h> |
6ec2e0f5 SDJ |
20062 | #include <unistd.h> |
20063 | #if !HAVE_DECL_GETLOGIN_R | |
88b48903 | 20064 | extern |
6ec2e0f5 | 20065 | # ifdef __cplusplus |
88b48903 | 20066 | "C" |
6ec2e0f5 SDJ |
20067 | # endif |
20068 | int getlogin_r (char *, size_t); | |
88b48903 | 20069 | #endif |
6ec2e0f5 SDJ |
20070 | int |
20071 | main (void) | |
88b48903 WN |
20072 | { |
20073 | int result = 0; | |
6ec2e0f5 SDJ |
20074 | char buf[100]; |
20075 | ||
20076 | if (getlogin_r (buf, 0) == 0) | |
c0c3707f | 20077 | result |= 1; |
6ec2e0f5 | 20078 | if (getlogin_r (buf, 1) == 0) |
c0c3707f CB |
20079 | result |= 2; |
20080 | if (getlogin_r (buf, 100) == 0) | |
20081 | { | |
20082 | size_t n = strlen (buf); | |
20083 | if (getlogin_r (buf, n) == 0) | |
20084 | result |= 4; | |
20085 | } | |
88b48903 WN |
20086 | return result; |
20087 | } | |
20088 | _ACEOF | |
20089 | if ac_fn_c_try_run "$LINENO"; then : | |
6ec2e0f5 | 20090 | gl_cv_func_getlogin_r_works=yes |
88b48903 | 20091 | else |
c0c3707f | 20092 | gl_cv_func_getlogin_r_works=no |
88b48903 WN |
20093 | fi |
20094 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
20095 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
20096 | fi | |
20097 | ||
20098 | ||
4a626d0a | 20099 | fi |
6ec2e0f5 SDJ |
20100 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getlogin_r_works" >&5 |
20101 | $as_echo "$gl_cv_func_getlogin_r_works" >&6; } | |
20102 | case "$gl_cv_func_getlogin_r_works" in | |
20103 | *yes) ;; | |
20104 | *) REPLACE_GETLOGIN_R=1 ;; | |
20105 | esac | |
20106 | fi | |
20107 | ||
20108 | if test $HAVE_GETLOGIN_R = 0 || test $REPLACE_GETLOGIN_R = 1; then | |
20109 | ||
20110 | ||
20111 | ||
20112 | ||
20113 | ||
20114 | ||
20115 | ||
20116 | ||
20117 | gl_LIBOBJS="$gl_LIBOBJS getlogin_r.$ac_objext" | |
4a626d0a | 20118 | |
4a626d0a | 20119 | |
4a626d0a | 20120 | |
4a626d0a | 20121 | |
4a626d0a PA |
20122 | fi |
20123 | ||
20124 | ||
4a626d0a PA |
20125 | |
20126 | ||
20127 | ||
6ec2e0f5 | 20128 | GNULIB_GETLOGIN_R=1 |
4a626d0a PA |
20129 | |
20130 | ||
20131 | ||
20132 | ||
20133 | ||
6ec2e0f5 | 20134 | $as_echo "#define GNULIB_TEST_GETLOGIN_R 1" >>confdefs.h |
4a626d0a | 20135 | |
4a626d0a PA |
20136 | |
20137 | ||
20138 | ||
20139 | ||
472fa5ee | 20140 | |
4a626d0a | 20141 | |
6ec2e0f5 SDJ |
20142 | ac_found=0 |
20143 | ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h> | |
20144 | " | |
d0ac1c44 | 20145 | if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then : |
6ec2e0f5 SDJ |
20146 | ac_have_decl=1 |
20147 | else | |
20148 | ac_have_decl=0 | |
20149 | fi | |
20150 | ||
20151 | cat >>confdefs.h <<_ACEOF | |
20152 | #define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl | |
20153 | _ACEOF | |
20154 | if test $ac_have_decl = 1; then : | |
20155 | ac_found=1 | |
20156 | fi | |
20157 | ||
20158 | ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h> | |
20159 | " | |
d0ac1c44 | 20160 | if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then : |
6ec2e0f5 SDJ |
20161 | ac_have_decl=1 |
20162 | else | |
20163 | ac_have_decl=0 | |
20164 | fi | |
20165 | ||
20166 | cat >>confdefs.h <<_ACEOF | |
20167 | #define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl | |
20168 | _ACEOF | |
20169 | if test $ac_have_decl = 1; then : | |
20170 | ac_found=1 | |
20171 | fi | |
4a626d0a | 20172 | |
6ec2e0f5 SDJ |
20173 | ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h> |
20174 | " | |
d0ac1c44 | 20175 | if test "x$ac_cv_have_decl___argv" = xyes; then : |
6ec2e0f5 SDJ |
20176 | ac_have_decl=1 |
20177 | else | |
20178 | ac_have_decl=0 | |
20179 | fi | |
4a626d0a | 20180 | |
6ec2e0f5 SDJ |
20181 | cat >>confdefs.h <<_ACEOF |
20182 | #define HAVE_DECL___ARGV $ac_have_decl | |
20183 | _ACEOF | |
20184 | if test $ac_have_decl = 1; then : | |
20185 | ac_found=1 | |
20186 | fi | |
4a626d0a PA |
20187 | |
20188 | ||
6ec2e0f5 SDJ |
20189 | # Incur the cost of this test only if none of the above worked. |
20190 | if test $ac_found = 0; then | |
20191 | # On OpenBSD 5.1, using the global __progname variable appears to be | |
20192 | # the only way to implement getprogname. | |
20193 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5 | |
20194 | $as_echo_n "checking whether __progname is defined in default libraries... " >&6; } | |
d0ac1c44 | 20195 | if ${gl_cv_var___progname+:} false; then : |
6ec2e0f5 SDJ |
20196 | $as_echo_n "(cached) " >&6 |
20197 | else | |
4a626d0a | 20198 | |
6ec2e0f5 SDJ |
20199 | gl_cv_var___progname= |
20200 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20201 | /* end confdefs.h. */ | |
20202 | extern char *__progname; | |
20203 | int | |
20204 | main () | |
20205 | { | |
20206 | return *__progname; | |
20207 | ||
20208 | ; | |
20209 | return 0; | |
20210 | } | |
20211 | _ACEOF | |
20212 | if ac_fn_c_try_link "$LINENO"; then : | |
20213 | gl_cv_var___progname=yes | |
20214 | ||
20215 | fi | |
20216 | rm -f core conftest.err conftest.$ac_objext \ | |
20217 | conftest$ac_exeext conftest.$ac_ext | |
20218 | ||
20219 | ||
20220 | fi | |
20221 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5 | |
20222 | $as_echo "$gl_cv_var___progname" >&6; } | |
20223 | if test "$gl_cv_var___progname" = yes; then | |
20224 | ||
20225 | $as_echo "#define HAVE_VAR___PROGNAME 1" >>confdefs.h | |
20226 | ||
20227 | fi | |
20228 | fi | |
4a626d0a PA |
20229 | |
20230 | ||
20231 | ||
20232 | ||
20233 | ||
20234 | ||
20235 | ||
20236 | ||
472fa5ee | 20237 | |
4a626d0a PA |
20238 | |
20239 | gl_gettimeofday_timezone=void | |
20240 | if test $ac_cv_func_gettimeofday != yes; then | |
20241 | HAVE_GETTIMEOFDAY=0 | |
20242 | else | |
20243 | ||
20244 | ||
20245 | ||
c0c3707f | 20246 | |
4a626d0a PA |
20247 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5 |
20248 | $as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; } | |
d0ac1c44 | 20249 | if ${gl_cv_func_gettimeofday_clobber+:} false; then : |
4a626d0a PA |
20250 | $as_echo_n "(cached) " >&6 |
20251 | else | |
20252 | if test "$cross_compiling" = yes; then : | |
20253 | # When cross-compiling: | |
20254 | case "$host_os" in | |
c0c3707f CB |
20255 | # Guess all is fine on glibc systems. |
20256 | *-gnu* | gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; | |
20257 | # Guess all is fine on musl systems. | |
20258 | *-musl*) gl_cv_func_gettimeofday_clobber="guessing no" ;; | |
20259 | # Guess no on native Windows. | |
20260 | mingw*) gl_cv_func_gettimeofday_clobber="guessing no" ;; | |
20261 | # If we don't know, obey --enable-cross-guesses. | |
20262 | *) gl_cv_func_gettimeofday_clobber="$gl_cross_guess_inverted" ;; | |
4a626d0a PA |
20263 | esac |
20264 | ||
20265 | else | |
20266 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20267 | /* end confdefs.h. */ | |
20268 | #include <string.h> | |
20269 | #include <sys/time.h> | |
20270 | #include <time.h> | |
20271 | #include <stdlib.h> | |
20272 | ||
20273 | int | |
20274 | main () | |
20275 | { | |
20276 | ||
20277 | time_t t = 0; | |
20278 | struct tm *lt; | |
20279 | struct tm saved_lt; | |
20280 | struct timeval tv; | |
20281 | lt = localtime (&t); | |
20282 | saved_lt = *lt; | |
20283 | gettimeofday (&tv, NULL); | |
20284 | return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; | |
20285 | ||
20286 | ; | |
20287 | return 0; | |
20288 | } | |
20289 | _ACEOF | |
20290 | if ac_fn_c_try_run "$LINENO"; then : | |
20291 | gl_cv_func_gettimeofday_clobber=no | |
20292 | else | |
20293 | gl_cv_func_gettimeofday_clobber=yes | |
20294 | fi | |
20295 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
20296 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
20297 | fi | |
20298 | ||
20299 | fi | |
20300 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5 | |
20301 | $as_echo "$gl_cv_func_gettimeofday_clobber" >&6; } | |
20302 | ||
20303 | case "$gl_cv_func_gettimeofday_clobber" in | |
20304 | *yes) | |
20305 | REPLACE_GETTIMEOFDAY=1 | |
20306 | ||
c0c3707f | 20307 | $as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h |
4a626d0a | 20308 | |
5e8754f9 | 20309 | |
c0c3707f CB |
20310 | |
20311 | ||
20312 | NEED_LOCALTIME_BUFFER=1 | |
20313 | REPLACE_GMTIME=1 | |
20314 | REPLACE_LOCALTIME=1 | |
5e8754f9 | 20315 | |
4a626d0a PA |
20316 | ;; |
20317 | esac | |
20318 | ||
20319 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5 | |
20320 | $as_echo_n "checking for gettimeofday with POSIX signature... " >&6; } | |
d0ac1c44 | 20321 | if ${gl_cv_func_gettimeofday_posix_signature+:} false; then : |
4a626d0a PA |
20322 | $as_echo_n "(cached) " >&6 |
20323 | else | |
20324 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20325 | /* end confdefs.h. */ | |
20326 | #include <sys/time.h> | |
20327 | struct timeval c; | |
20328 | int gettimeofday (struct timeval *restrict, void *restrict); | |
20329 | ||
20330 | int | |
20331 | main () | |
20332 | { | |
20333 | /* glibc uses struct timezone * rather than the POSIX void * | |
20334 | if _GNU_SOURCE is defined. However, since the only portable | |
20335 | use of gettimeofday uses NULL as the second parameter, and | |
20336 | since the glibc definition is actually more typesafe, it is | |
20337 | not worth wrapping this to get a compliant signature. */ | |
20338 | int (*f) (struct timeval *restrict, void *restrict) | |
20339 | = gettimeofday; | |
20340 | int x = f (&c, 0); | |
20341 | return !(x | c.tv_sec | c.tv_usec); | |
20342 | ||
20343 | ; | |
20344 | return 0; | |
20345 | } | |
20346 | _ACEOF | |
20347 | if ac_fn_c_try_compile "$LINENO"; then : | |
20348 | gl_cv_func_gettimeofday_posix_signature=yes | |
20349 | else | |
20350 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20351 | /* end confdefs.h. */ | |
20352 | #include <sys/time.h> | |
20353 | int gettimeofday (struct timeval *restrict, struct timezone *restrict); | |
20354 | ||
20355 | int | |
20356 | main () | |
20357 | { | |
20358 | ||
20359 | ; | |
20360 | return 0; | |
20361 | } | |
20362 | _ACEOF | |
20363 | if ac_fn_c_try_compile "$LINENO"; then : | |
20364 | gl_cv_func_gettimeofday_posix_signature=almost | |
20365 | else | |
20366 | gl_cv_func_gettimeofday_posix_signature=no | |
20367 | fi | |
20368 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
20369 | fi | |
20370 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
20371 | fi | |
20372 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5 | |
20373 | $as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; } | |
20374 | if test $gl_cv_func_gettimeofday_posix_signature = almost; then | |
20375 | gl_gettimeofday_timezone='struct timezone' | |
20376 | elif test $gl_cv_func_gettimeofday_posix_signature != yes; then | |
20377 | REPLACE_GETTIMEOFDAY=1 | |
20378 | fi | |
20379 | if test $REPLACE_STRUCT_TIMEVAL = 1; then | |
20380 | REPLACE_GETTIMEOFDAY=1 | |
20381 | fi | |
c0c3707f CB |
20382 | case "$host_os" in |
20383 | mingw*) REPLACE_GETTIMEOFDAY=1 ;; | |
20384 | esac | |
4a626d0a PA |
20385 | fi |
20386 | ||
20387 | cat >>confdefs.h <<_ACEOF | |
c0c3707f CB |
20388 | #define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone |
20389 | _ACEOF | |
88b48903 WN |
20390 | |
20391 | ||
c0c3707f | 20392 | if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then |
88b48903 | 20393 | |
6ec2e0f5 | 20394 | |
6ec2e0f5 | 20395 | |
6ec2e0f5 | 20396 | |
6ec2e0f5 | 20397 | |
6ec2e0f5 SDJ |
20398 | |
20399 | ||
6ec2e0f5 | 20400 | |
c0c3707f | 20401 | gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" |
6ec2e0f5 | 20402 | |
c0c3707f | 20403 | : |
5e8754f9 | 20404 | fi |
6ec2e0f5 SDJ |
20405 | |
20406 | ||
20407 | ||
6ec2e0f5 SDJ |
20408 | |
20409 | ||
5e8754f9 | 20410 | GNULIB_GETTIMEOFDAY=1 |
6ec2e0f5 SDJ |
20411 | |
20412 | ||
20413 | ||
7a6dbc2f SDJ |
20414 | |
20415 | ||
5e8754f9 | 20416 | $as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h |
6ec2e0f5 SDJ |
20417 | |
20418 | ||
20419 | ||
6ec2e0f5 | 20420 | |
6ec2e0f5 | 20421 | |
6ec2e0f5 SDJ |
20422 | |
20423 | ||
c0c3707f CB |
20424 | if test $ac_cv_func_glob = no; then |
20425 | HAVE_GLOB=0 | |
20426 | else | |
20427 | ||
20428 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU glob interface version 1 or 2" >&5 | |
20429 | $as_echo_n "checking for GNU glob interface version 1 or 2... " >&6; } | |
20430 | if ${gl_cv_gnu_glob_interface_version_1_2+:} false; then : | |
6ec2e0f5 SDJ |
20431 | $as_echo_n "(cached) " >&6 |
20432 | else | |
20433 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20434 | /* end confdefs.h. */ | |
20435 | #include <gnu-versions.h> | |
c0c3707f | 20436 | char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1 : -1]; |
6ec2e0f5 SDJ |
20437 | _ACEOF |
20438 | if ac_fn_c_try_compile "$LINENO"; then : | |
c0c3707f | 20439 | gl_cv_gnu_glob_interface_version_1_2=yes |
6ec2e0f5 | 20440 | else |
c0c3707f | 20441 | gl_cv_gnu_glob_interface_version_1_2=no |
6ec2e0f5 SDJ |
20442 | fi |
20443 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
20444 | fi | |
c0c3707f CB |
20445 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_gnu_glob_interface_version_1_2" >&5 |
20446 | $as_echo "$gl_cv_gnu_glob_interface_version_1_2" >&6; } | |
20447 | if test "$gl_cv_gnu_glob_interface_version_1_2" = "no"; then | |
20448 | REPLACE_GLOB=1 | |
6ec2e0f5 | 20449 | fi |
6ec2e0f5 | 20450 | |
c0c3707f CB |
20451 | if test $REPLACE_GLOB = 0; then |
20452 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether glob lists broken symlinks" >&5 | |
6ec2e0f5 | 20453 | $as_echo_n "checking whether glob lists broken symlinks... " >&6; } |
d0ac1c44 | 20454 | if ${gl_cv_glob_lists_symlinks+:} false; then : |
6ec2e0f5 SDJ |
20455 | $as_echo_n "(cached) " >&6 |
20456 | else | |
c0c3707f CB |
20457 | if test $cross_compiling != yes; then |
20458 | if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then | |
20459 | gl_cv_glob_lists_symlinks=maybe | |
20460 | else | |
20461 | # If we can't make a symlink, then we cannot test this issue. Be | |
20462 | # pessimistic about this. | |
20463 | gl_cv_glob_lists_symlinks=no | |
20464 | fi | |
20465 | if test $gl_cv_glob_lists_symlinks = maybe; then | |
20466 | if test "$cross_compiling" = yes; then : | |
20467 | : | |
5e8754f9 | 20468 | |
6ec2e0f5 SDJ |
20469 | else |
20470 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20471 | /* end confdefs.h. */ | |
6ec2e0f5 | 20472 | #include <stddef.h> |
c0c3707f | 20473 | #include <glob.h> |
6ec2e0f5 SDJ |
20474 | int |
20475 | main () | |
20476 | { | |
20477 | glob_t found; | |
c0c3707f CB |
20478 | if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH) |
20479 | return 1; | |
20480 | ||
6ec2e0f5 SDJ |
20481 | ; |
20482 | return 0; | |
20483 | } | |
4a626d0a | 20484 | _ACEOF |
6ec2e0f5 SDJ |
20485 | if ac_fn_c_try_run "$LINENO"; then : |
20486 | gl_cv_glob_lists_symlinks=yes | |
20487 | else | |
20488 | gl_cv_glob_lists_symlinks=no | |
20489 | fi | |
20490 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
20491 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
20492 | fi | |
88b48903 | 20493 | |
c0c3707f CB |
20494 | fi |
20495 | rm -f conf$$-globtest | |
20496 | else | |
20497 | gl_cv_glob_lists_symlinks="$gl_cross_guess_normal" | |
20498 | fi | |
20499 | ||
4a626d0a | 20500 | fi |
6ec2e0f5 SDJ |
20501 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_glob_lists_symlinks" >&5 |
20502 | $as_echo "$gl_cv_glob_lists_symlinks" >&6; } | |
c0c3707f CB |
20503 | case "$gl_cv_glob_lists_symlinks" in |
20504 | *yes) ;; | |
20505 | *) REPLACE_GLOB=1 ;; | |
20506 | esac | |
20507 | fi | |
20508 | ||
20509 | fi | |
88b48903 | 20510 | |
c0c3707f CB |
20511 | if test $ac_cv_func_glob_pattern_p = no; then |
20512 | HAVE_GLOB_PATTERN_P=0 | |
20513 | else | |
20514 | if test $REPLACE_GLOB = 1; then | |
20515 | REPLACE_GLOB_PATTERN_P=1 | |
6ec2e0f5 SDJ |
20516 | fi |
20517 | fi | |
4a626d0a | 20518 | |
c0c3707f | 20519 | if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then |
4a626d0a | 20520 | |
88b48903 | 20521 | |
c0c3707f | 20522 | GLOB_H='glob.h' |
6ec2e0f5 SDJ |
20523 | if test -n "$GLOB_H"; then |
20524 | GL_GENERATE_GLOB_H_TRUE= | |
20525 | GL_GENERATE_GLOB_H_FALSE='#' | |
20526 | else | |
20527 | GL_GENERATE_GLOB_H_TRUE='#' | |
20528 | GL_GENERATE_GLOB_H_FALSE= | |
20529 | fi | |
88b48903 | 20530 | |
88b48903 | 20531 | |
c0c3707f CB |
20532 | fi |
20533 | ||
20534 | if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then | |
472fa5ee SM |
20535 | |
20536 | ||
20537 | ||
20538 | ||
20539 | ||
20540 | ||
20541 | ||
20542 | ||
20543 | gl_LIBOBJS="$gl_LIBOBJS glob.$ac_objext" | |
20544 | ||
20545 | ||
20546 | ||
7a6dbc2f SDJ |
20547 | |
20548 | ||
20549 | ||
472fa5ee | 20550 | |
472fa5ee | 20551 | |
88b48903 | 20552 | |
c0c3707f | 20553 | gl_LIBOBJS="$gl_LIBOBJS globfree.$ac_objext" |
88b48903 WN |
20554 | |
20555 | ||
20556 | ||
725e2999 JB |
20557 | |
20558 | ||
20559 | ||
c0c3707f CB |
20560 | fi |
20561 | if test $HAVE_GLOB_PATTERN_P = 0 || test $REPLACE_GLOB_PATTERN_P = 1; then | |
20562 | ||
725e2999 JB |
20563 | |
20564 | ||
20565 | ||
20566 | ||
20567 | ||
20568 | ||
20569 | ||
c0c3707f | 20570 | gl_LIBOBJS="$gl_LIBOBJS glob_pattern_p.$ac_objext" |
725e2999 JB |
20571 | |
20572 | fi | |
20573 | ||
725e2999 JB |
20574 | |
20575 | ||
20576 | ||
20577 | ||
c0c3707f CB |
20578 | GNULIB_GLOB=1 |
20579 | ||
20580 | ||
20581 | ||
20582 | ||
20583 | ||
20584 | $as_echo "#define GNULIB_TEST_GLOB 1" >>confdefs.h | |
20585 | ||
20586 | ||
725e2999 JB |
20587 | |
20588 | ||
20589 | ||
5df4cba6 SM |
20590 | LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL" |
20591 | ||
20592 | ||
725e2999 | 20593 | |
725e2999 JB |
20594 | |
20595 | ||
20596 | ||
20597 | ||
725e2999 | 20598 | |
c0c3707f CB |
20599 | HAVE_INET_NTOP=1 |
20600 | INET_NTOP_LIB= | |
725e2999 JB |
20601 | |
20602 | ||
20603 | ||
20604 | ||
20605 | if test $ac_cv_header_sys_socket_h != yes; then | |
20606 | for ac_header in winsock2.h | |
20607 | do : | |
20608 | ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" | |
20609 | if test "x$ac_cv_header_winsock2_h" = xyes; then : | |
20610 | cat >>confdefs.h <<_ACEOF | |
20611 | #define HAVE_WINSOCK2_H 1 | |
20612 | _ACEOF | |
20613 | ||
20614 | fi | |
20615 | ||
20616 | done | |
20617 | ||
20618 | fi | |
20619 | if test "$ac_cv_header_winsock2_h" = yes; then | |
20620 | HAVE_WINSOCK2_H=1 | |
20621 | UNISTD_H_HAVE_WINSOCK2_H=1 | |
20622 | SYS_IOCTL_H_HAVE_WINSOCK2_H=1 | |
20623 | else | |
20624 | HAVE_WINSOCK2_H=0 | |
20625 | fi | |
20626 | ||
20627 | ||
20628 | if test $HAVE_WINSOCK2_H = 1; then | |
c0c3707f | 20629 | REPLACE_INET_NTOP=1 |
725e2999 JB |
20630 | ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <ws2tcpip.h> |
20631 | " | |
20632 | if test "x$ac_cv_have_decl_inet_ntop" = xyes; then : | |
20633 | ac_have_decl=1 | |
20634 | else | |
20635 | ac_have_decl=0 | |
20636 | fi | |
20637 | ||
20638 | cat >>confdefs.h <<_ACEOF | |
20639 | #define HAVE_DECL_INET_NTOP $ac_have_decl | |
20640 | _ACEOF | |
20641 | ||
20642 | if test $ac_cv_have_decl_inet_ntop = yes; then | |
725e2999 JB |
20643 | INET_NTOP_LIB="-lws2_32" |
20644 | else | |
20645 | HAVE_DECL_INET_NTOP=0 | |
725e2999 JB |
20646 | fi |
20647 | else | |
20648 | gl_save_LIBS=$LIBS | |
20649 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 | |
20650 | $as_echo_n "checking for library containing inet_ntop... " >&6; } | |
20651 | if ${ac_cv_search_inet_ntop+:} false; then : | |
20652 | $as_echo_n "(cached) " >&6 | |
20653 | else | |
20654 | ac_func_search_save_LIBS=$LIBS | |
20655 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20656 | /* end confdefs.h. */ | |
20657 | ||
20658 | /* Override any GCC internal prototype to avoid an error. | |
20659 | Use char because int might match the return type of a GCC | |
20660 | builtin and then its argument prototype would still apply. */ | |
20661 | #ifdef __cplusplus | |
20662 | extern "C" | |
20663 | #endif | |
20664 | char inet_ntop (); | |
20665 | int | |
20666 | main () | |
20667 | { | |
20668 | return inet_ntop (); | |
20669 | ; | |
20670 | return 0; | |
20671 | } | |
20672 | _ACEOF | |
c0c3707f | 20673 | for ac_lib in '' nsl resolv network; do |
725e2999 JB |
20674 | if test -z "$ac_lib"; then |
20675 | ac_res="none required" | |
20676 | else | |
20677 | ac_res=-l$ac_lib | |
20678 | LIBS="-l$ac_lib $ac_func_search_save_LIBS" | |
20679 | fi | |
20680 | if ac_fn_c_try_link "$LINENO"; then : | |
20681 | ac_cv_search_inet_ntop=$ac_res | |
20682 | fi | |
20683 | rm -f core conftest.err conftest.$ac_objext \ | |
20684 | conftest$ac_exeext | |
20685 | if ${ac_cv_search_inet_ntop+:} false; then : | |
20686 | break | |
20687 | fi | |
20688 | done | |
20689 | if ${ac_cv_search_inet_ntop+:} false; then : | |
20690 | ||
20691 | else | |
20692 | ac_cv_search_inet_ntop=no | |
20693 | fi | |
20694 | rm conftest.$ac_ext | |
20695 | LIBS=$ac_func_search_save_LIBS | |
20696 | fi | |
20697 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 | |
20698 | $as_echo "$ac_cv_search_inet_ntop" >&6; } | |
20699 | ac_res=$ac_cv_search_inet_ntop | |
20700 | if test "$ac_res" != no; then : | |
20701 | test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" | |
20702 | ||
20703 | else | |
20704 | for ac_func in inet_ntop | |
20705 | do : | |
20706 | ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop" | |
20707 | if test "x$ac_cv_func_inet_ntop" = xyes; then : | |
20708 | cat >>confdefs.h <<_ACEOF | |
20709 | #define HAVE_INET_NTOP 1 | |
20710 | _ACEOF | |
20711 | ||
20712 | fi | |
20713 | done | |
20714 | ||
20715 | if test $ac_cv_func_inet_ntop = no; then | |
20716 | HAVE_INET_NTOP=0 | |
20717 | fi | |
20718 | ||
20719 | fi | |
20720 | ||
20721 | LIBS=$gl_save_LIBS | |
20722 | ||
20723 | if test "$ac_cv_search_inet_ntop" != "no" \ | |
20724 | && test "$ac_cv_search_inet_ntop" != "none required"; then | |
20725 | INET_NTOP_LIB="$ac_cv_search_inet_ntop" | |
20726 | fi | |
20727 | ||
20728 | ||
725e2999 JB |
20729 | ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <arpa/inet.h> |
20730 | #if HAVE_NETDB_H | |
20731 | # include <netdb.h> | |
20732 | #endif | |
20733 | ||
20734 | " | |
20735 | if test "x$ac_cv_have_decl_inet_ntop" = xyes; then : | |
20736 | ac_have_decl=1 | |
20737 | else | |
20738 | ac_have_decl=0 | |
20739 | fi | |
20740 | ||
20741 | cat >>confdefs.h <<_ACEOF | |
20742 | #define HAVE_DECL_INET_NTOP $ac_have_decl | |
20743 | _ACEOF | |
20744 | ||
20745 | if test $ac_cv_have_decl_inet_ntop = no; then | |
20746 | HAVE_DECL_INET_NTOP=0 | |
20747 | fi | |
20748 | fi | |
20749 | ||
20750 | ||
20751 | if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then | |
20752 | ||
20753 | ||
20754 | ||
20755 | ||
20756 | ||
20757 | ||
20758 | ||
7a6dbc2f | 20759 | |
725e2999 | 20760 | gl_LIBOBJS="$gl_LIBOBJS inet_ntop.$ac_objext" |
7a6dbc2f SDJ |
20761 | |
20762 | ||
20763 | ||
7a6dbc2f | 20764 | |
725e2999 | 20765 | fi |
7a6dbc2f SDJ |
20766 | |
20767 | ||
20768 | ||
20769 | ||
7a6dbc2f | 20770 | |
725e2999 JB |
20771 | GNULIB_INET_NTOP=1 |
20772 | ||
7a6dbc2f SDJ |
20773 | |
20774 | ||
49e4877c PA |
20775 | |
20776 | ||
88b48903 WN |
20777 | |
20778 | ||
20779 | ||
20780 | ||
20781 | PRIPTR_PREFIX= | |
20782 | if test -n "$STDINT_H"; then | |
20783 | PRIPTR_PREFIX='"l"' | |
20784 | else | |
20785 | for glpfx in '' l ll I64; do | |
20786 | case $glpfx in | |
20787 | '') gltype1='int';; | |
20788 | l) gltype1='long int';; | |
20789 | ll) gltype1='long long int';; | |
20790 | I64) gltype1='__int64';; | |
20791 | esac | |
20792 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20793 | /* end confdefs.h. */ | |
20794 | #include <stdint.h> | |
20795 | extern intptr_t foo; | |
20796 | extern $gltype1 foo; | |
20797 | int | |
20798 | main () | |
20799 | { | |
20800 | ||
20801 | ; | |
20802 | return 0; | |
20803 | } | |
20804 | _ACEOF | |
20805 | if ac_fn_c_try_compile "$LINENO"; then : | |
20806 | PRIPTR_PREFIX='"'$glpfx'"' | |
20807 | fi | |
20808 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
20809 | test -n "$PRIPTR_PREFIX" && break | |
20810 | done | |
20811 | fi | |
20812 | ||
20813 | ||
20814 | ||
20815 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5 | |
20816 | $as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; } | |
d0ac1c44 | 20817 | if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then : |
88b48903 WN |
20818 | $as_echo_n "(cached) " >&6 |
20819 | else | |
20820 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20821 | /* end confdefs.h. */ | |
20822 | /* Work also in C++ mode. */ | |
20823 | #define __STDC_LIMIT_MACROS 1 | |
20824 | ||
20825 | /* Work if build is not clean. */ | |
20826 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H | |
20827 | ||
20828 | #include <limits.h> | |
20829 | #if HAVE_STDINT_H | |
20830 | #include <stdint.h> | |
20831 | #endif | |
20832 | ||
20833 | #if defined INT32_MAX && defined INTMAX_MAX | |
20834 | #define CONDITION (INT32_MAX < INTMAX_MAX) | |
88b48903 | 20835 | #else |
5df4cba6 | 20836 | #define CONDITION (sizeof (int) < sizeof (long long int)) |
88b48903 WN |
20837 | #endif |
20838 | int test[CONDITION ? 1 : -1]; | |
20839 | int | |
20840 | main () | |
20841 | { | |
20842 | ||
20843 | ; | |
20844 | return 0; | |
20845 | } | |
20846 | _ACEOF | |
20847 | if ac_fn_c_try_compile "$LINENO"; then : | |
20848 | gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes | |
20849 | else | |
20850 | gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no | |
20851 | fi | |
20852 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
20853 | fi | |
20854 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5 | |
20855 | $as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; } | |
20856 | if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then | |
20857 | INT32_MAX_LT_INTMAX_MAX=1; | |
20858 | else | |
20859 | INT32_MAX_LT_INTMAX_MAX=0; | |
20860 | fi | |
20861 | ||
20862 | ||
20863 | if test $APPLE_UNIVERSAL_BUILD = 0; then | |
20864 | ||
20865 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5 | |
20866 | $as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; } | |
d0ac1c44 | 20867 | if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then : |
88b48903 WN |
20868 | $as_echo_n "(cached) " >&6 |
20869 | else | |
20870 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20871 | /* end confdefs.h. */ | |
20872 | /* Work also in C++ mode. */ | |
20873 | #define __STDC_LIMIT_MACROS 1 | |
20874 | ||
20875 | /* Work if build is not clean. */ | |
20876 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H | |
20877 | ||
20878 | #include <limits.h> | |
20879 | #if HAVE_STDINT_H | |
20880 | #include <stdint.h> | |
20881 | #endif | |
20882 | ||
20883 | #if defined INT64_MAX | |
20884 | #define CONDITION (INT64_MAX == LONG_MAX) | |
88b48903 | 20885 | #else |
5df4cba6 | 20886 | #define CONDITION (sizeof (long long int) == sizeof (long int)) |
88b48903 WN |
20887 | #endif |
20888 | int test[CONDITION ? 1 : -1]; | |
20889 | int | |
20890 | main () | |
20891 | { | |
20892 | ||
20893 | ; | |
20894 | return 0; | |
20895 | } | |
20896 | _ACEOF | |
20897 | if ac_fn_c_try_compile "$LINENO"; then : | |
20898 | gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes | |
20899 | else | |
20900 | gl_cv_test_INT64_MAX_EQ_LONG_MAX=no | |
20901 | fi | |
20902 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
20903 | fi | |
20904 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5 | |
20905 | $as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; } | |
20906 | if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then | |
20907 | INT64_MAX_EQ_LONG_MAX=1; | |
20908 | else | |
20909 | INT64_MAX_EQ_LONG_MAX=0; | |
20910 | fi | |
20911 | ||
20912 | ||
20913 | else | |
20914 | INT64_MAX_EQ_LONG_MAX=-1 | |
20915 | fi | |
20916 | ||
20917 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5 | |
20918 | $as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; } | |
d0ac1c44 | 20919 | if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then : |
88b48903 WN |
20920 | $as_echo_n "(cached) " >&6 |
20921 | else | |
20922 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20923 | /* end confdefs.h. */ | |
20924 | /* Work also in C++ mode. */ | |
20925 | #define __STDC_LIMIT_MACROS 1 | |
20926 | ||
20927 | /* Work if build is not clean. */ | |
20928 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H | |
20929 | ||
20930 | #include <limits.h> | |
20931 | #if HAVE_STDINT_H | |
20932 | #include <stdint.h> | |
20933 | #endif | |
20934 | ||
20935 | #if defined UINT32_MAX && defined UINTMAX_MAX | |
20936 | #define CONDITION (UINT32_MAX < UINTMAX_MAX) | |
88b48903 | 20937 | #else |
5df4cba6 | 20938 | #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int)) |
88b48903 WN |
20939 | #endif |
20940 | int test[CONDITION ? 1 : -1]; | |
20941 | int | |
20942 | main () | |
20943 | { | |
20944 | ||
20945 | ; | |
20946 | return 0; | |
20947 | } | |
20948 | _ACEOF | |
20949 | if ac_fn_c_try_compile "$LINENO"; then : | |
20950 | gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes | |
20951 | else | |
20952 | gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no | |
20953 | fi | |
20954 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
20955 | fi | |
20956 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5 | |
20957 | $as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; } | |
20958 | if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then | |
20959 | UINT32_MAX_LT_UINTMAX_MAX=1; | |
20960 | else | |
20961 | UINT32_MAX_LT_UINTMAX_MAX=0; | |
20962 | fi | |
20963 | ||
20964 | ||
20965 | if test $APPLE_UNIVERSAL_BUILD = 0; then | |
20966 | ||
20967 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5 | |
20968 | $as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; } | |
d0ac1c44 | 20969 | if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then : |
88b48903 WN |
20970 | $as_echo_n "(cached) " >&6 |
20971 | else | |
20972 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
20973 | /* end confdefs.h. */ | |
20974 | /* Work also in C++ mode. */ | |
20975 | #define __STDC_LIMIT_MACROS 1 | |
20976 | ||
20977 | /* Work if build is not clean. */ | |
20978 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H | |
20979 | ||
20980 | #include <limits.h> | |
20981 | #if HAVE_STDINT_H | |
20982 | #include <stdint.h> | |
20983 | #endif | |
20984 | ||
20985 | #if defined UINT64_MAX | |
20986 | #define CONDITION (UINT64_MAX == ULONG_MAX) | |
88b48903 | 20987 | #else |
5df4cba6 | 20988 | #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int)) |
88b48903 WN |
20989 | #endif |
20990 | int test[CONDITION ? 1 : -1]; | |
20991 | int | |
20992 | main () | |
20993 | { | |
20994 | ||
20995 | ; | |
20996 | return 0; | |
20997 | } | |
20998 | _ACEOF | |
20999 | if ac_fn_c_try_compile "$LINENO"; then : | |
21000 | gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes | |
21001 | else | |
21002 | gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no | |
21003 | fi | |
21004 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21005 | fi | |
21006 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5 | |
21007 | $as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; } | |
21008 | if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then | |
21009 | UINT64_MAX_EQ_ULONG_MAX=1; | |
21010 | else | |
21011 | UINT64_MAX_EQ_ULONG_MAX=0; | |
21012 | fi | |
21013 | ||
21014 | ||
21015 | else | |
21016 | UINT64_MAX_EQ_ULONG_MAX=-1 | |
21017 | fi | |
21018 | ||
21019 | ||
21020 | ||
21021 | ||
21022 | ||
21023 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5 | |
21024 | $as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; } | |
d0ac1c44 | 21025 | if ${gl_cv_func_isnand_no_libm+:} false; then : |
88b48903 WN |
21026 | $as_echo_n "(cached) " >&6 |
21027 | else | |
21028 | ||
21029 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21030 | /* end confdefs.h. */ | |
21031 | #include <math.h> | |
21032 | #if __GNUC__ >= 4 | |
21033 | # undef isnand | |
21034 | # define isnand(x) __builtin_isnan ((double)(x)) | |
21035 | #else | |
21036 | # undef isnand | |
21037 | # define isnand(x) isnan ((double)(x)) | |
21038 | #endif | |
21039 | double x; | |
21040 | int | |
21041 | main () | |
21042 | { | |
21043 | return isnand (x); | |
21044 | ; | |
21045 | return 0; | |
21046 | } | |
21047 | _ACEOF | |
21048 | if ac_fn_c_try_link "$LINENO"; then : | |
21049 | gl_cv_func_isnand_no_libm=yes | |
21050 | else | |
21051 | gl_cv_func_isnand_no_libm=no | |
21052 | fi | |
21053 | rm -f core conftest.err conftest.$ac_objext \ | |
21054 | conftest$ac_exeext conftest.$ac_ext | |
21055 | ||
21056 | fi | |
21057 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5 | |
21058 | $as_echo "$gl_cv_func_isnand_no_libm" >&6; } | |
21059 | ||
21060 | gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm | |
21061 | if test $gl_cv_func_isnand_no_libm = yes; then | |
21062 | ||
21063 | $as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h | |
21064 | ||
21065 | fi | |
21066 | ||
21067 | if test $gl_func_isnand_no_libm != yes; then | |
21068 | ||
21069 | ||
21070 | ||
21071 | ||
21072 | ||
21073 | ||
21074 | ||
21075 | ||
21076 | gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext" | |
21077 | ||
21078 | ||
21079 | ||
21080 | ||
21081 | fi | |
21082 | ||
21083 | ||
21084 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5 | |
21085 | $as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; } | |
d0ac1c44 | 21086 | if ${gl_cv_func_isnanl_no_libm+:} false; then : |
88b48903 WN |
21087 | $as_echo_n "(cached) " >&6 |
21088 | else | |
21089 | ||
21090 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21091 | /* end confdefs.h. */ | |
21092 | #include <math.h> | |
21093 | #if __GNUC__ >= 4 | |
21094 | # undef isnanl | |
21095 | # define isnanl(x) __builtin_isnanl ((long double)(x)) | |
21096 | #elif defined isnan | |
21097 | # undef isnanl | |
21098 | # define isnanl(x) isnan ((long double)(x)) | |
21099 | #endif | |
21100 | long double x; | |
21101 | int | |
21102 | main () | |
21103 | { | |
21104 | return isnanl (x); | |
21105 | ; | |
21106 | return 0; | |
21107 | } | |
21108 | _ACEOF | |
21109 | if ac_fn_c_try_link "$LINENO"; then : | |
21110 | gl_cv_func_isnanl_no_libm=yes | |
21111 | else | |
21112 | gl_cv_func_isnanl_no_libm=no | |
21113 | fi | |
21114 | rm -f core conftest.err conftest.$ac_objext \ | |
21115 | conftest$ac_exeext conftest.$ac_ext | |
21116 | ||
21117 | fi | |
21118 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5 | |
21119 | $as_echo "$gl_cv_func_isnanl_no_libm" >&6; } | |
21120 | ||
21121 | gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm | |
21122 | if test $gl_func_isnanl_no_libm = yes; then | |
21123 | ||
21124 | ||
21125 | ||
21126 | ||
21127 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5 | |
21128 | $as_echo_n "checking whether isnanl works... " >&6; } | |
d0ac1c44 | 21129 | if ${gl_cv_func_isnanl_works+:} false; then : |
88b48903 WN |
21130 | $as_echo_n "(cached) " >&6 |
21131 | else | |
21132 | ||
21133 | if test "$cross_compiling" = yes; then : | |
c0c3707f CB |
21134 | case "$host_os" in |
21135 | mingw*) # Guess yes on mingw, no on MSVC. | |
21136 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21137 | /* end confdefs.h. */ | |
21138 | ||
21139 | #ifdef __MINGW32__ | |
21140 | Known | |
21141 | #endif | |
21142 | ||
21143 | _ACEOF | |
21144 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
21145 | $EGREP "Known" >/dev/null 2>&1; then : | |
4a626d0a | 21146 | gl_cv_func_isnanl_works="guessing yes" |
c0c3707f CB |
21147 | else |
21148 | gl_cv_func_isnanl_works="guessing no" | |
21149 | fi | |
21150 | rm -f conftest* | |
21151 | ||
21152 | ;; | |
21153 | *) gl_cv_func_isnanl_works="guessing yes" ;; | |
21154 | esac | |
21155 | ||
88b48903 WN |
21156 | else |
21157 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21158 | /* end confdefs.h. */ | |
21159 | ||
21160 | #include <float.h> | |
21161 | #include <limits.h> | |
21162 | #include <math.h> | |
21163 | #if __GNUC__ >= 4 | |
21164 | # undef isnanl | |
21165 | # define isnanl(x) __builtin_isnanl ((long double)(x)) | |
21166 | #elif defined isnan | |
21167 | # undef isnanl | |
21168 | # define isnanl(x) isnan ((long double)(x)) | |
21169 | #endif | |
21170 | #define NWORDS \ | |
21171 | ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) | |
21172 | typedef union { unsigned int word[NWORDS]; long double value; } | |
21173 | memory_long_double; | |
21174 | /* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the | |
21175 | runtime type conversion. */ | |
21176 | #ifdef __sgi | |
21177 | static long double NaNl () | |
21178 | { | |
21179 | double zero = 0.0; | |
21180 | return zero / zero; | |
21181 | } | |
21182 | #else | |
21183 | # define NaNl() (0.0L / 0.0L) | |
21184 | #endif | |
21185 | int main () | |
21186 | { | |
21187 | int result = 0; | |
21188 | ||
21189 | if (!isnanl (NaNl ())) | |
21190 | result |= 1; | |
21191 | ||
21192 | { | |
21193 | memory_long_double m; | |
21194 | unsigned int i; | |
21195 | ||
21196 | /* The isnanl function should be immune against changes in the sign bit and | |
21197 | in the mantissa bits. The xor operation twiddles a bit that can only be | |
21198 | a sign bit or a mantissa bit (since the exponent never extends to | |
21199 | bit 31). */ | |
21200 | m.value = NaNl (); | |
21201 | m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); | |
21202 | for (i = 0; i < NWORDS; i++) | |
21203 | m.word[i] |= 1; | |
21204 | if (!isnanl (m.value)) | |
21205 | result |= 1; | |
21206 | } | |
21207 | ||
21208 | #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 | |
21209 | /* Representation of an 80-bit 'long double' as an initializer for a sequence | |
21210 | of 'unsigned int' words. */ | |
21211 | # ifdef WORDS_BIGENDIAN | |
21212 | # define LDBL80_WORDS(exponent,manthi,mantlo) \ | |
21213 | { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ | |
4a626d0a | 21214 | ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ |
88b48903 WN |
21215 | (unsigned int) (mantlo) << 16 \ |
21216 | } | |
21217 | # else | |
21218 | # define LDBL80_WORDS(exponent,manthi,mantlo) \ | |
21219 | { mantlo, manthi, exponent } | |
21220 | # endif | |
21221 | { /* Quiet NaN. */ | |
21222 | static memory_long_double x = | |
21223 | { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; | |
21224 | if (!isnanl (x.value)) | |
21225 | result |= 2; | |
21226 | } | |
21227 | { | |
21228 | /* Signalling NaN. */ | |
21229 | static memory_long_double x = | |
21230 | { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; | |
21231 | if (!isnanl (x.value)) | |
21232 | result |= 2; | |
21233 | } | |
4a626d0a | 21234 | /* isnanl should return something even for noncanonical values. */ |
88b48903 WN |
21235 | { /* Pseudo-NaN. */ |
21236 | static memory_long_double x = | |
21237 | { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; | |
4a626d0a | 21238 | if (isnanl (x.value) && !isnanl (x.value)) |
88b48903 WN |
21239 | result |= 4; |
21240 | } | |
21241 | { /* Pseudo-Infinity. */ | |
21242 | static memory_long_double x = | |
21243 | { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; | |
4a626d0a | 21244 | if (isnanl (x.value) && !isnanl (x.value)) |
88b48903 WN |
21245 | result |= 8; |
21246 | } | |
21247 | { /* Pseudo-Zero. */ | |
21248 | static memory_long_double x = | |
21249 | { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; | |
4a626d0a | 21250 | if (isnanl (x.value) && !isnanl (x.value)) |
88b48903 WN |
21251 | result |= 16; |
21252 | } | |
21253 | { /* Unnormalized number. */ | |
21254 | static memory_long_double x = | |
21255 | { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; | |
4a626d0a | 21256 | if (isnanl (x.value) && !isnanl (x.value)) |
88b48903 WN |
21257 | result |= 32; |
21258 | } | |
21259 | { /* Pseudo-Denormal. */ | |
21260 | static memory_long_double x = | |
21261 | { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; | |
4a626d0a | 21262 | if (isnanl (x.value) && !isnanl (x.value)) |
88b48903 WN |
21263 | result |= 64; |
21264 | } | |
21265 | #endif | |
21266 | ||
21267 | return result; | |
21268 | } | |
21269 | _ACEOF | |
21270 | if ac_fn_c_try_run "$LINENO"; then : | |
21271 | gl_cv_func_isnanl_works=yes | |
21272 | else | |
21273 | gl_cv_func_isnanl_works=no | |
21274 | fi | |
21275 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
21276 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
21277 | fi | |
21278 | ||
21279 | ||
21280 | fi | |
21281 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5 | |
21282 | $as_echo "$gl_cv_func_isnanl_works" >&6; } | |
21283 | ||
21284 | case "$gl_cv_func_isnanl_works" in | |
21285 | *yes) ;; | |
21286 | *) gl_func_isnanl_no_libm=no ;; | |
21287 | esac | |
21288 | fi | |
21289 | if test $gl_func_isnanl_no_libm = yes; then | |
21290 | ||
21291 | $as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h | |
21292 | ||
21293 | fi | |
21294 | ||
21295 | if test $gl_func_isnanl_no_libm != yes; then | |
21296 | ||
21297 | ||
21298 | ||
21299 | ||
21300 | ||
21301 | ||
21302 | ||
21303 | ||
21304 | gl_LIBOBJS="$gl_LIBOBJS isnanl.$ac_objext" | |
21305 | ||
21306 | ||
21307 | ||
21308 | ||
c0c3707f | 21309 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5 |
88b48903 | 21310 | $as_echo_n "checking where to find the exponent in a 'long double'... " >&6; } |
d0ac1c44 | 21311 | if ${gl_cv_cc_long_double_expbit0+:} false; then : |
88b48903 WN |
21312 | $as_echo_n "(cached) " >&6 |
21313 | else | |
21314 | ||
21315 | if test "$cross_compiling" = yes; then : | |
21316 | ||
21317 | gl_cv_cc_long_double_expbit0="unknown" | |
c0c3707f CB |
21318 | case "$host_os" in |
21319 | mingw*) # On native Windows (little-endian), we know the result | |
21320 | # in two cases: mingw, MSVC. | |
21321 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21322 | /* end confdefs.h. */ | |
21323 | ||
21324 | #ifdef __MINGW32__ | |
21325 | Known | |
21326 | #endif | |
21327 | ||
21328 | _ACEOF | |
21329 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
21330 | $EGREP "Known" >/dev/null 2>&1; then : | |
21331 | gl_cv_cc_long_double_expbit0="word 2 bit 0" | |
21332 | fi | |
21333 | rm -f conftest* | |
21334 | ||
21335 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21336 | /* end confdefs.h. */ | |
21337 | ||
21338 | #ifdef _MSC_VER | |
21339 | Known | |
21340 | #endif | |
21341 | ||
21342 | _ACEOF | |
21343 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
21344 | $EGREP "Known" >/dev/null 2>&1; then : | |
21345 | gl_cv_cc_long_double_expbit0="word 1 bit 20" | |
21346 | fi | |
21347 | rm -f conftest* | |
21348 | ||
21349 | ;; | |
21350 | esac | |
88b48903 WN |
21351 | |
21352 | else | |
21353 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21354 | /* end confdefs.h. */ | |
21355 | ||
21356 | #include <float.h> | |
21357 | #include <stddef.h> | |
21358 | #include <stdio.h> | |
21359 | #include <string.h> | |
21360 | #define NWORDS \ | |
21361 | ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) | |
21362 | typedef union { long double value; unsigned int word[NWORDS]; } | |
21363 | memory_long_double; | |
21364 | static unsigned int ored_words[NWORDS]; | |
21365 | static unsigned int anded_words[NWORDS]; | |
21366 | static void add_to_ored_words (long double x) | |
21367 | { | |
21368 | memory_long_double m; | |
21369 | size_t i; | |
21370 | /* Clear it first, in case | |
21371 | sizeof (long double) < sizeof (memory_long_double). */ | |
21372 | memset (&m, 0, sizeof (memory_long_double)); | |
21373 | m.value = x; | |
21374 | for (i = 0; i < NWORDS; i++) | |
21375 | { | |
21376 | ored_words[i] |= m.word[i]; | |
21377 | anded_words[i] &= m.word[i]; | |
21378 | } | |
21379 | } | |
21380 | int main () | |
21381 | { | |
21382 | size_t j; | |
21383 | FILE *fp = fopen ("conftest.out", "w"); | |
21384 | if (fp == NULL) | |
21385 | return 1; | |
21386 | for (j = 0; j < NWORDS; j++) | |
21387 | anded_words[j] = ~ (unsigned int) 0; | |
21388 | add_to_ored_words (0.25L); | |
21389 | add_to_ored_words (0.5L); | |
21390 | add_to_ored_words (1.0L); | |
21391 | add_to_ored_words (2.0L); | |
21392 | add_to_ored_words (4.0L); | |
21393 | /* Remove bits that are common (e.g. if representation of the first mantissa | |
21394 | bit is explicit). */ | |
21395 | for (j = 0; j < NWORDS; j++) | |
21396 | ored_words[j] &= ~anded_words[j]; | |
21397 | /* Now find the nonzero word. */ | |
21398 | for (j = 0; j < NWORDS; j++) | |
21399 | if (ored_words[j] != 0) | |
21400 | break; | |
21401 | if (j < NWORDS) | |
21402 | { | |
21403 | size_t i; | |
21404 | for (i = j + 1; i < NWORDS; i++) | |
21405 | if (ored_words[i] != 0) | |
21406 | { | |
21407 | fprintf (fp, "unknown"); | |
21408 | return (fclose (fp) != 0); | |
21409 | } | |
21410 | for (i = 0; ; i++) | |
21411 | if ((ored_words[j] >> i) & 1) | |
21412 | { | |
21413 | fprintf (fp, "word %d bit %d", (int) j, (int) i); | |
21414 | return (fclose (fp) != 0); | |
21415 | } | |
21416 | } | |
21417 | fprintf (fp, "unknown"); | |
21418 | return (fclose (fp) != 0); | |
21419 | } | |
21420 | ||
21421 | _ACEOF | |
21422 | if ac_fn_c_try_run "$LINENO"; then : | |
21423 | gl_cv_cc_long_double_expbit0=`cat conftest.out` | |
21424 | else | |
21425 | gl_cv_cc_long_double_expbit0="unknown" | |
21426 | fi | |
21427 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
21428 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
21429 | fi | |
21430 | ||
21431 | rm -f conftest.out | |
21432 | ||
21433 | fi | |
21434 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5 | |
21435 | $as_echo "$gl_cv_cc_long_double_expbit0" >&6; } | |
21436 | case "$gl_cv_cc_long_double_expbit0" in | |
21437 | word*bit*) | |
21438 | word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` | |
21439 | bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'` | |
21440 | ||
21441 | cat >>confdefs.h <<_ACEOF | |
21442 | #define LDBL_EXPBIT0_WORD $word | |
21443 | _ACEOF | |
21444 | ||
21445 | ||
21446 | cat >>confdefs.h <<_ACEOF | |
21447 | #define LDBL_EXPBIT0_BIT $bit | |
21448 | _ACEOF | |
21449 | ||
21450 | ;; | |
21451 | esac | |
21452 | ||
21453 | ||
21454 | ||
21455 | fi | |
21456 | ||
21457 | ||
5df4cba6 SM |
21458 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the __inline keyword" >&5 |
21459 | $as_echo_n "checking whether the compiler supports the __inline keyword... " >&6; } | |
21460 | if ${gl_cv_c___inline+:} false; then : | |
21461 | $as_echo_n "(cached) " >&6 | |
21462 | else | |
21463 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21464 | /* end confdefs.h. */ | |
21465 | typedef int foo_t; | |
21466 | static __inline foo_t foo (void) { return 0; } | |
21467 | int | |
21468 | main () | |
21469 | { | |
21470 | return foo (); | |
21471 | ; | |
21472 | return 0; | |
21473 | } | |
21474 | _ACEOF | |
21475 | if ac_fn_c_try_compile "$LINENO"; then : | |
21476 | gl_cv_c___inline=yes | |
21477 | else | |
21478 | gl_cv_c___inline=no | |
21479 | fi | |
21480 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21481 | fi | |
21482 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c___inline" >&5 | |
21483 | $as_echo "$gl_cv_c___inline" >&6; } | |
21484 | if test $gl_cv_c___inline = yes; then | |
21485 | ||
21486 | $as_echo "#define HAVE___INLINE 1" >>confdefs.h | |
21487 | ||
21488 | fi | |
21489 | ||
21490 | ||
21491 | ||
21492 | ||
21493 | ||
21494 | LOCALCHARSET_TESTS_ENVIRONMENT= | |
21495 | ||
21496 | ||
21497 | ||
21498 | ||
21499 | ||
21500 | ||
21501 | ||
21502 | ||
21503 | ||
21504 | ||
21505 | ||
21506 | case "$host_os" in | |
21507 | solaris*) | |
21508 | ||
21509 | $as_echo "#define _LCONV_C99 1" >>confdefs.h | |
21510 | ||
21511 | ;; | |
21512 | esac | |
21513 | ||
21514 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5 | |
21515 | $as_echo_n "checking whether locale.h conforms to POSIX:2001... " >&6; } | |
21516 | if ${gl_cv_header_locale_h_posix2001+:} false; then : | |
21517 | $as_echo_n "(cached) " >&6 | |
21518 | else | |
21519 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21520 | /* end confdefs.h. */ | |
21521 | #include <locale.h> | |
21522 | int x = LC_MESSAGES; | |
21523 | int y = sizeof (((struct lconv *) 0)->decimal_point); | |
21524 | int | |
21525 | main () | |
21526 | { | |
21527 | ||
21528 | ; | |
21529 | return 0; | |
21530 | } | |
21531 | _ACEOF | |
21532 | if ac_fn_c_try_compile "$LINENO"; then : | |
21533 | gl_cv_header_locale_h_posix2001=yes | |
21534 | else | |
21535 | gl_cv_header_locale_h_posix2001=no | |
21536 | fi | |
21537 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21538 | fi | |
21539 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5 | |
21540 | $as_echo "$gl_cv_header_locale_h_posix2001" >&6; } | |
21541 | ||
21542 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5 | |
21543 | $as_echo_n "checking whether struct lconv is properly defined... " >&6; } | |
21544 | if ${gl_cv_sys_struct_lconv_ok+:} false; then : | |
c0c3707f CB |
21545 | $as_echo_n "(cached) " >&6 |
21546 | else | |
21547 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21548 | /* end confdefs.h. */ | |
5df4cba6 SM |
21549 | #include <locale.h> |
21550 | struct lconv l; | |
21551 | int x = sizeof (l.decimal_point); | |
21552 | int y = sizeof (l.int_p_cs_precedes); | |
c0c3707f CB |
21553 | int |
21554 | main () | |
21555 | { | |
5df4cba6 | 21556 | |
c0c3707f CB |
21557 | ; |
21558 | return 0; | |
21559 | } | |
21560 | _ACEOF | |
21561 | if ac_fn_c_try_compile "$LINENO"; then : | |
5df4cba6 | 21562 | gl_cv_sys_struct_lconv_ok=yes |
c0c3707f | 21563 | else |
5df4cba6 | 21564 | gl_cv_sys_struct_lconv_ok=no |
c0c3707f CB |
21565 | fi |
21566 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
5df4cba6 | 21567 | |
c0c3707f | 21568 | fi |
5df4cba6 SM |
21569 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5 |
21570 | $as_echo "$gl_cv_sys_struct_lconv_ok" >&6; } | |
21571 | if test $gl_cv_sys_struct_lconv_ok = no; then | |
21572 | case "$host_os" in | |
21573 | mingw*) | |
21574 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21575 | /* end confdefs.h. */ | |
c0c3707f | 21576 | |
5df4cba6 SM |
21577 | #ifdef _MSC_VER |
21578 | Special | |
21579 | #endif | |
21580 | ||
21581 | _ACEOF | |
21582 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
21583 | $EGREP "Special" >/dev/null 2>&1; then : | |
21584 | ||
21585 | else | |
21586 | REPLACE_STRUCT_LCONV=1 | |
21587 | fi | |
21588 | rm -f conftest* | |
c0c3707f | 21589 | |
5df4cba6 SM |
21590 | ;; |
21591 | *) REPLACE_STRUCT_LCONV=1 ;; | |
21592 | esac | |
c0c3707f | 21593 | fi |
88b48903 WN |
21594 | |
21595 | ||
88b48903 WN |
21596 | |
21597 | ||
472fa5ee | 21598 | |
5df4cba6 SM |
21599 | |
21600 | ||
21601 | ||
21602 | ||
21603 | if test $gl_cv_have_include_next = yes; then | |
21604 | gl_cv_next_locale_h='<'locale.h'>' | |
21605 | else | |
21606 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5 | |
21607 | $as_echo_n "checking absolute name of <locale.h>... " >&6; } | |
21608 | if ${gl_cv_next_locale_h+:} false; then : | |
21609 | $as_echo_n "(cached) " >&6 | |
21610 | else | |
21611 | ||
21612 | ||
21613 | ||
21614 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21615 | /* end confdefs.h. */ | |
21616 | #include <locale.h> | |
21617 | _ACEOF | |
21618 | case "$host_os" in | |
21619 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
21620 | *) gl_absname_cpp="$ac_cpp" ;; | |
21621 | esac | |
21622 | ||
21623 | case "$host_os" in | |
21624 | mingw*) | |
21625 | gl_dirsep_regex='[/\\]' | |
21626 | ;; | |
21627 | *) | |
21628 | gl_dirsep_regex='\/' | |
21629 | ;; | |
21630 | esac | |
21631 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
21632 | gl_header_literal_regex=`echo 'locale.h' \ | |
21633 | | sed -e "$gl_make_literal_regex_sed"` | |
21634 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
21635 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
21636 | s|^/[^/]|//&| | |
21637 | p | |
21638 | q | |
21639 | }' | |
21640 | ||
21641 | gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
21642 | sed -n "$gl_absolute_header_sed"` | |
21643 | ||
21644 | gl_header=$gl_cv_absolute_locale_h | |
21645 | gl_cv_next_locale_h='"'$gl_header'"' | |
21646 | ||
21647 | ||
21648 | fi | |
21649 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5 | |
21650 | $as_echo "$gl_cv_next_locale_h" >&6; } | |
21651 | fi | |
21652 | NEXT_LOCALE_H=$gl_cv_next_locale_h | |
21653 | ||
21654 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
21655 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
21656 | gl_next_as_first_directive='<'locale.h'>' | |
21657 | else | |
21658 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
21659 | gl_next_as_first_directive=$gl_cv_next_locale_h | |
21660 | fi | |
21661 | NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive | |
21662 | ||
21663 | ||
21664 | ||
21665 | ||
21666 | ||
21667 | ||
21668 | ||
21669 | ||
472fa5ee SM |
21670 | |
21671 | ||
21672 | ||
21673 | ||
88b48903 WN |
21674 | |
21675 | ||
2196f55f | 21676 | |
49e4877c | 21677 | |
c0c3707f CB |
21678 | |
21679 | ||
21680 | gl_LIBOBJS="$gl_LIBOBJS localtime-buffer.$ac_objext" | |
88b48903 WN |
21681 | |
21682 | ||
21683 | ||
5abebf3c CB |
21684 | if test "$gl_threads_api" = posix; then |
21685 | # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the | |
21686 | # pthread_rwlock_* functions. | |
c0c3707f | 21687 | has_rwlock=false |
5abebf3c CB |
21688 | ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h> |
21689 | " | |
21690 | if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then : | |
c0c3707f | 21691 | has_rwlock=true |
5abebf3c CB |
21692 | |
21693 | $as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h | |
21694 | ||
21695 | fi | |
21696 | ||
c0c3707f CB |
21697 | if $has_rwlock; then |
21698 | ||
21699 | ||
21700 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5 | |
21701 | $as_echo_n "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; } | |
21702 | if ${gl_cv_pthread_rwlock_rdlock_prefer_writer+:} false; then : | |
21703 | $as_echo_n "(cached) " >&6 | |
21704 | else | |
21705 | save_LIBS="$LIBS" | |
21706 | LIBS="$LIBS $LIBMULTITHREAD" | |
21707 | if test "$cross_compiling" = yes; then : | |
21708 | case "$host_os" in | |
21709 | # Guess no on glibc systems. | |
21710 | *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; | |
21711 | # Guess no on musl systems. | |
21712 | *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; | |
21713 | # Guess no on bionic systems. | |
21714 | *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; | |
21715 | # Guess yes on native Windows with the mingw-w64 winpthreads library. | |
21716 | # Guess no on native Windows with the gnulib windows-rwlock module. | |
21717 | mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then | |
21718 | gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes" | |
21719 | else | |
21720 | gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" | |
21721 | fi | |
21722 | ;; | |
21723 | # If we don't know, obey --enable-cross-guesses. | |
21724 | *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;; | |
21725 | esac | |
21726 | ||
21727 | else | |
21728 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21729 | /* end confdefs.h. */ | |
21730 | ||
21731 | #include <errno.h> | |
21732 | #include <pthread.h> | |
21733 | #include <stdlib.h> | |
21734 | #include <unistd.h> | |
21735 | ||
21736 | #define SUCCEED() exit (0) | |
21737 | #define FAILURE() exit (1) | |
21738 | #define UNEXPECTED(n) (exit (10 + (n))) | |
21739 | ||
21740 | /* The main thread creates the waiting writer and the requesting reader threads | |
21741 | in the default way; this guarantees that they have the same priority. | |
21742 | We can reuse the main thread as first reader thread. */ | |
21743 | ||
21744 | static pthread_rwlock_t lock; | |
21745 | static pthread_t reader1; | |
21746 | static pthread_t writer; | |
21747 | static pthread_t reader2; | |
21748 | static pthread_t timer; | |
21749 | /* Used to pass control from writer to reader2 and from reader2 to timer, | |
21750 | as in a relay race. | |
21751 | Passing control from one running thread to another running thread | |
21752 | is most likely faster than to create the second thread. */ | |
21753 | static pthread_mutex_t baton; | |
21754 | ||
21755 | static void * | |
21756 | timer_func (void *ignored) | |
21757 | { | |
21758 | /* Step 13 (can be before or after step 12): | |
21759 | The timer thread takes the baton, then waits a moment to make sure | |
21760 | it can tell whether the second reader thread is blocked at step 12. */ | |
21761 | if (pthread_mutex_lock (&baton)) | |
21762 | UNEXPECTED (13); | |
21763 | usleep (100000); | |
21764 | /* By the time we get here, it's clear that the second reader thread is | |
21765 | blocked at step 12. This is the desired behaviour. */ | |
21766 | SUCCEED (); | |
21767 | } | |
21768 | ||
21769 | static void * | |
21770 | reader2_func (void *ignored) | |
21771 | { | |
21772 | int err; | |
21773 | ||
21774 | /* Step 8 (can be before or after step 7): | |
21775 | The second reader thread takes the baton, then waits a moment to make sure | |
21776 | the writer thread has reached step 7. */ | |
21777 | if (pthread_mutex_lock (&baton)) | |
21778 | UNEXPECTED (8); | |
21779 | usleep (100000); | |
21780 | /* Step 9: The second reader thread requests the lock. */ | |
21781 | err = pthread_rwlock_tryrdlock (&lock); | |
21782 | if (err == 0) | |
21783 | FAILURE (); | |
21784 | else if (err != EBUSY) | |
21785 | UNEXPECTED (9); | |
21786 | /* Step 10: Launch a timer, to test whether the next call blocks. */ | |
21787 | if (pthread_create (&timer, NULL, timer_func, NULL)) | |
21788 | UNEXPECTED (10); | |
21789 | /* Step 11: Release the baton. */ | |
21790 | if (pthread_mutex_unlock (&baton)) | |
21791 | UNEXPECTED (11); | |
21792 | /* Step 12: The second reader thread requests the lock. */ | |
21793 | err = pthread_rwlock_rdlock (&lock); | |
21794 | if (err == 0) | |
21795 | FAILURE (); | |
21796 | else | |
21797 | UNEXPECTED (12); | |
21798 | } | |
21799 | ||
21800 | static void * | |
21801 | writer_func (void *ignored) | |
21802 | { | |
21803 | /* Step 4: Take the baton, so that the second reader thread does not go ahead | |
21804 | too early. */ | |
21805 | if (pthread_mutex_lock (&baton)) | |
21806 | UNEXPECTED (4); | |
21807 | /* Step 5: Create the second reader thread. */ | |
21808 | if (pthread_create (&reader2, NULL, reader2_func, NULL)) | |
21809 | UNEXPECTED (5); | |
21810 | /* Step 6: Release the baton. */ | |
21811 | if (pthread_mutex_unlock (&baton)) | |
21812 | UNEXPECTED (6); | |
21813 | /* Step 7: The writer thread requests the lock. */ | |
21814 | if (pthread_rwlock_wrlock (&lock)) | |
21815 | UNEXPECTED (7); | |
21816 | return NULL; | |
21817 | } | |
21818 | ||
21819 | int | |
21820 | main () | |
21821 | { | |
21822 | reader1 = pthread_self (); | |
21823 | ||
21824 | /* Step 1: The main thread initializes the lock and the baton. */ | |
21825 | if (pthread_rwlock_init (&lock, NULL)) | |
21826 | UNEXPECTED (1); | |
21827 | if (pthread_mutex_init (&baton, NULL)) | |
21828 | UNEXPECTED (1); | |
21829 | /* Step 2: The main thread acquires the lock as a reader. */ | |
21830 | if (pthread_rwlock_rdlock (&lock)) | |
21831 | UNEXPECTED (2); | |
21832 | /* Step 3: Create the writer thread. */ | |
21833 | if (pthread_create (&writer, NULL, writer_func, NULL)) | |
21834 | UNEXPECTED (3); | |
21835 | /* Job done. Go to sleep. */ | |
21836 | for (;;) | |
21837 | { | |
21838 | sleep (1); | |
21839 | } | |
21840 | } | |
21841 | ||
21842 | _ACEOF | |
21843 | if ac_fn_c_try_run "$LINENO"; then : | |
21844 | gl_cv_pthread_rwlock_rdlock_prefer_writer=yes | |
21845 | else | |
21846 | gl_cv_pthread_rwlock_rdlock_prefer_writer=no | |
21847 | fi | |
21848 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
21849 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
21850 | fi | |
21851 | ||
21852 | LIBS="$save_LIBS" | |
21853 | ||
21854 | fi | |
21855 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5 | |
21856 | $as_echo "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; } | |
21857 | case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in | |
21858 | *yes) | |
21859 | ||
21860 | $as_echo "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h | |
21861 | ||
21862 | ;; | |
21863 | esac | |
21864 | ||
21865 | fi | |
5abebf3c CB |
21866 | # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. |
21867 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
21868 | /* end confdefs.h. */ | |
21869 | ||
21870 | #include <pthread.h> | |
21871 | int | |
21872 | main () | |
21873 | { | |
21874 | ||
21875 | #if __FreeBSD__ == 4 | |
21876 | error "No, in FreeBSD 4.0 recursive mutexes actually don't work." | |
21877 | #elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \ | |
21878 | && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070) | |
21879 | error "No, in Mac OS X < 10.7 recursive mutexes actually don't work." | |
21880 | #else | |
21881 | int x = (int)PTHREAD_MUTEX_RECURSIVE; | |
21882 | return !x; | |
21883 | #endif | |
21884 | ||
21885 | ; | |
21886 | return 0; | |
21887 | } | |
21888 | _ACEOF | |
21889 | if ac_fn_c_try_compile "$LINENO"; then : | |
21890 | ||
21891 | $as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h | |
21892 | ||
21893 | fi | |
21894 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
21895 | fi | |
21896 | : | |
21897 | ||
21898 | ||
21899 | ||
21900 | cat >>confdefs.h <<_ACEOF | |
21901 | #define GNULIB_LOCK 1 | |
21902 | _ACEOF | |
21903 | ||
21904 | ||
21905 | ||
21906 | ||
88b48903 | 21907 | |
472fa5ee | 21908 | |
f45c62c4 YQ |
21909 | if test $ac_cv_func_lstat = yes; then |
21910 | ||
c0c3707f CB |
21911 | case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in |
21912 | solaris* | *no) | |
f45c62c4 YQ |
21913 | REPLACE_LSTAT=1 |
21914 | ;; | |
21915 | esac | |
21916 | else | |
21917 | HAVE_LSTAT=0 | |
21918 | fi | |
21919 | ||
21920 | if test $REPLACE_LSTAT = 1; then | |
21921 | ||
21922 | ||
21923 | ||
21924 | ||
21925 | ||
21926 | ||
21927 | ||
21928 | ||
21929 | gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext" | |
21930 | ||
21931 | : | |
21932 | fi | |
21933 | ||
21934 | ||
21935 | ||
21936 | ||
21937 | ||
21938 | GNULIB_LSTAT=1 | |
21939 | ||
21940 | ||
21941 | ||
21942 | ||
21943 | ||
21944 | $as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h | |
21945 | ||
21946 | ||
21947 | ||
21948 | ||
21949 | ||
21950 | ||
6a29c58e YQ |
21951 | if test $gl_cv_func_malloc_posix = yes; then |
21952 | ||
21953 | $as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h | |
21954 | ||
21955 | else | |
21956 | REPLACE_MALLOC=1 | |
21957 | fi | |
21958 | ||
21959 | if test $REPLACE_MALLOC = 1; then | |
21960 | ||
21961 | ||
21962 | ||
21963 | ||
21964 | ||
21965 | ||
21966 | ||
21967 | ||
21968 | gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" | |
21969 | ||
21970 | fi | |
21971 | ||
21972 | ||
21973 | ||
21974 | ||
21975 | ||
21976 | GNULIB_MALLOC_POSIX=1 | |
21977 | ||
21978 | ||
21979 | ||
21980 | ||
21981 | ||
21982 | $as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h | |
21983 | ||
21984 | ||
21985 | ||
21986 | ||
21987 | ||
21988 | ||
88b48903 WN |
21989 | |
21990 | ||
21991 | ||
21992 | ||
21993 | ||
88b48903 | 21994 | |
c971b7fa | 21995 | |
c971b7fa | 21996 | |
98399780 YQ |
21997 | |
21998 | ||
21999 | ||
88b48903 WN |
22000 | if test $gl_cv_have_include_next = yes; then |
22001 | gl_cv_next_math_h='<'math.h'>' | |
22002 | else | |
22003 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5 | |
22004 | $as_echo_n "checking absolute name of <math.h>... " >&6; } | |
d0ac1c44 | 22005 | if ${gl_cv_next_math_h+:} false; then : |
88b48903 WN |
22006 | $as_echo_n "(cached) " >&6 |
22007 | else | |
c971b7fa | 22008 | |
88b48903 | 22009 | if test $ac_cv_header_math_h = yes; then |
c971b7fa PA |
22010 | |
22011 | ||
4a626d0a PA |
22012 | |
22013 | ||
22014 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 | 22015 | /* end confdefs.h. */ |
88b48903 | 22016 | #include <math.h> |
8690e634 | 22017 | _ACEOF |
4a626d0a PA |
22018 | case "$host_os" in |
22019 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
22020 | *) gl_absname_cpp="$ac_cpp" ;; | |
22021 | esac | |
22022 | ||
22023 | case "$host_os" in | |
22024 | mingw*) | |
22025 | gl_dirsep_regex='[/\\]' | |
22026 | ;; | |
22027 | *) | |
22028 | gl_dirsep_regex='\/' | |
22029 | ;; | |
22030 | esac | |
22031 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
22032 | gl_header_literal_regex=`echo 'math.h' \ | |
22033 | | sed -e "$gl_make_literal_regex_sed"` | |
22034 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
22035 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
22036 | s|^/[^/]|//&| | |
22037 | p | |
22038 | q | |
22039 | }' | |
22040 | ||
22041 | gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
22042 | sed -n "$gl_absolute_header_sed"` | |
22043 | ||
22044 | gl_header=$gl_cv_absolute_math_h | |
22045 | gl_cv_next_math_h='"'$gl_header'"' | |
88b48903 WN |
22046 | else |
22047 | gl_cv_next_math_h='<'math.h'>' | |
22048 | fi | |
8690e634 | 22049 | |
c971b7fa | 22050 | |
88b48903 WN |
22051 | fi |
22052 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5 | |
22053 | $as_echo "$gl_cv_next_math_h" >&6; } | |
22054 | fi | |
22055 | NEXT_MATH_H=$gl_cv_next_math_h | |
c971b7fa | 22056 | |
88b48903 WN |
22057 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then |
22058 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
22059 | gl_next_as_first_directive='<'math.h'>' | |
22060 | else | |
22061 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
22062 | gl_next_as_first_directive=$gl_cv_next_math_h | |
22063 | fi | |
22064 | NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive | |
8690e634 | 22065 | |
c971b7fa | 22066 | |
c971b7fa PA |
22067 | |
22068 | ||
c971b7fa | 22069 | |
88b48903 WN |
22070 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5 |
22071 | $as_echo_n "checking whether NAN macro works... " >&6; } | |
d0ac1c44 | 22072 | if ${gl_cv_header_math_nan_works+:} false; then : |
c971b7fa PA |
22073 | $as_echo_n "(cached) " >&6 |
22074 | else | |
8690e634 JK |
22075 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
22076 | /* end confdefs.h. */ | |
88b48903 | 22077 | #include <math.h> |
c971b7fa PA |
22078 | int |
22079 | main () | |
22080 | { | |
88b48903 WN |
22081 | /* Solaris 10 has a broken definition of NAN. Other platforms |
22082 | fail to provide NAN, or provide it only in C99 mode; this | |
22083 | test only needs to fail when NAN is provided but wrong. */ | |
22084 | float f = 1.0f; | |
22085 | #ifdef NAN | |
22086 | f = NAN; | |
22087 | #endif | |
22088 | return f == 0; | |
c971b7fa PA |
22089 | ; |
22090 | return 0; | |
22091 | } | |
22092 | _ACEOF | |
22093 | if ac_fn_c_try_compile "$LINENO"; then : | |
88b48903 | 22094 | gl_cv_header_math_nan_works=yes |
8690e634 | 22095 | else |
88b48903 | 22096 | gl_cv_header_math_nan_works=no |
c971b7fa PA |
22097 | fi |
22098 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c971b7fa | 22099 | fi |
88b48903 WN |
22100 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5 |
22101 | $as_echo "$gl_cv_header_math_nan_works" >&6; } | |
22102 | if test $gl_cv_header_math_nan_works = no; then | |
22103 | REPLACE_NAN=1 | |
c971b7fa | 22104 | fi |
88b48903 WN |
22105 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5 |
22106 | $as_echo_n "checking whether HUGE_VAL works... " >&6; } | |
d0ac1c44 | 22107 | if ${gl_cv_header_math_huge_val_works+:} false; then : |
c971b7fa PA |
22108 | $as_echo_n "(cached) " >&6 |
22109 | else | |
8690e634 | 22110 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
c971b7fa | 22111 | /* end confdefs.h. */ |
88b48903 | 22112 | #include <math.h> |
c971b7fa PA |
22113 | int |
22114 | main () | |
22115 | { | |
88b48903 WN |
22116 | /* Solaris 10 has a broken definition of HUGE_VAL. */ |
22117 | double d = HUGE_VAL; | |
22118 | return d == 0; | |
c971b7fa PA |
22119 | ; |
22120 | return 0; | |
22121 | } | |
22122 | _ACEOF | |
22123 | if ac_fn_c_try_compile "$LINENO"; then : | |
88b48903 | 22124 | gl_cv_header_math_huge_val_works=yes |
8690e634 | 22125 | else |
88b48903 | 22126 | gl_cv_header_math_huge_val_works=no |
c971b7fa PA |
22127 | fi |
22128 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c971b7fa | 22129 | fi |
88b48903 WN |
22130 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5 |
22131 | $as_echo "$gl_cv_header_math_huge_val_works" >&6; } | |
22132 | if test $gl_cv_header_math_huge_val_works = no; then | |
22133 | REPLACE_HUGE_VAL=1 | |
8690e634 | 22134 | fi |
c971b7fa | 22135 | |
c971b7fa | 22136 | |
c971b7fa PA |
22137 | |
22138 | ||
22139 | ||
22140 | ||
22141 | ||
22142 | ||
c971b7fa | 22143 | |
c971b7fa | 22144 | |
c971b7fa | 22145 | |
c971b7fa PA |
22146 | |
22147 | ||
c971b7fa | 22148 | |
472fa5ee | 22149 | |
5df4cba6 SM |
22150 | |
22151 | ||
22152 | ||
22153 | if case "$host_os" in | |
22154 | mingw*) true ;; | |
22155 | *) test $ac_cv_func_mbsinit = yes ;; | |
22156 | esac \ | |
22157 | && test $ac_cv_func_mbrtowc = yes; then | |
472fa5ee SM |
22158 | |
22159 | ||
22160 | ||
22161 | ||
c0c3707f CB |
22162 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 |
22163 | $as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } | |
22164 | if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then : | |
22165 | $as_echo_n "(cached) " >&6 | |
22166 | else | |
472fa5ee | 22167 | |
c0c3707f CB |
22168 | case "$host_os" in |
22169 | # Guess no on AIX and OSF/1. | |
22170 | aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; | |
22171 | # Guess yes otherwise. | |
22172 | *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; | |
22173 | esac | |
22174 | if test $LOCALE_JA != none; then | |
22175 | if test "$cross_compiling" = yes; then : | |
472fa5ee | 22176 | : |
c0c3707f CB |
22177 | else |
22178 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22179 | /* end confdefs.h. */ | |
472fa5ee | 22180 | |
c0c3707f CB |
22181 | #include <locale.h> |
22182 | #include <string.h> | |
22183 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
22184 | <wchar.h>. | |
22185 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
22186 | included before <wchar.h>. */ | |
22187 | #include <stddef.h> | |
22188 | #include <stdio.h> | |
22189 | #include <time.h> | |
22190 | #include <wchar.h> | |
22191 | int main () | |
22192 | { | |
22193 | if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) | |
22194 | { | |
22195 | const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ | |
22196 | mbstate_t state; | |
22197 | wchar_t wc; | |
472fa5ee | 22198 | |
c0c3707f CB |
22199 | memset (&state, '\0', sizeof (mbstate_t)); |
22200 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
22201 | if (mbsinit (&state)) | |
22202 | return 2; | |
22203 | } | |
22204 | return 0; | |
22205 | } | |
22206 | _ACEOF | |
22207 | if ac_fn_c_try_run "$LINENO"; then : | |
22208 | gl_cv_func_mbrtowc_incomplete_state=yes | |
c971b7fa | 22209 | else |
c0c3707f CB |
22210 | gl_cv_func_mbrtowc_incomplete_state=no |
22211 | fi | |
22212 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
22213 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
22214 | fi | |
8690e634 | 22215 | |
c0c3707f CB |
22216 | else |
22217 | if test $LOCALE_FR_UTF8 != none; then | |
22218 | if test "$cross_compiling" = yes; then : | |
8690e634 JK |
22219 | : |
22220 | else | |
c971b7fa PA |
22221 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
22222 | /* end confdefs.h. */ | |
c971b7fa | 22223 | |
8690e634 JK |
22224 | #include <locale.h> |
22225 | #include <string.h> | |
22226 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
22227 | <wchar.h>. | |
22228 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
22229 | included before <wchar.h>. */ | |
22230 | #include <stddef.h> | |
22231 | #include <stdio.h> | |
22232 | #include <time.h> | |
22233 | #include <wchar.h> | |
22234 | int main () | |
c971b7fa | 22235 | { |
c0c3707f | 22236 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) |
8690e634 | 22237 | { |
c0c3707f | 22238 | const char input[] = "B\303\274\303\237er"; /* "Büßer" */ |
8690e634 JK |
22239 | mbstate_t state; |
22240 | wchar_t wc; | |
22241 | ||
22242 | memset (&state, '\0', sizeof (mbstate_t)); | |
22243 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
22244 | if (mbsinit (&state)) | |
c0c3707f | 22245 | return 2; |
8690e634 | 22246 | } |
c971b7fa PA |
22247 | return 0; |
22248 | } | |
22249 | _ACEOF | |
8690e634 JK |
22250 | if ac_fn_c_try_run "$LINENO"; then : |
22251 | gl_cv_func_mbrtowc_incomplete_state=yes | |
c971b7fa | 22252 | else |
8690e634 | 22253 | gl_cv_func_mbrtowc_incomplete_state=no |
c971b7fa | 22254 | fi |
8690e634 JK |
22255 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
22256 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c971b7fa | 22257 | fi |
c971b7fa | 22258 | |
c0c3707f | 22259 | fi |
8690e634 | 22260 | fi |
c971b7fa | 22261 | |
8690e634 JK |
22262 | fi |
22263 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 | |
22264 | $as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } | |
c971b7fa | 22265 | |
c971b7fa | 22266 | |
c971b7fa | 22267 | |
c971b7fa | 22268 | |
8690e634 JK |
22269 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 |
22270 | $as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } | |
d0ac1c44 | 22271 | if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then : |
c971b7fa PA |
22272 | $as_echo_n "(cached) " >&6 |
22273 | else | |
22274 | ||
8690e634 JK |
22275 | case "$host_os" in |
22276 | # Guess no on Solaris 8. | |
22277 | solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; | |
22278 | # Guess yes otherwise. | |
22279 | *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; | |
22280 | esac | |
22281 | if test $LOCALE_ZH_CN != none; then | |
22282 | if test "$cross_compiling" = yes; then : | |
22283 | : | |
22284 | else | |
22285 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c971b7fa PA |
22286 | /* end confdefs.h. */ |
22287 | ||
8690e634 JK |
22288 | #include <locale.h> |
22289 | #include <stdlib.h> | |
22290 | #include <string.h> | |
22291 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
22292 | <wchar.h>. | |
22293 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
22294 | included before <wchar.h>. */ | |
22295 | #include <stddef.h> | |
22296 | #include <stdio.h> | |
22297 | #include <time.h> | |
22298 | #include <wchar.h> | |
22299 | int main () | |
c971b7fa | 22300 | { |
8690e634 JK |
22301 | /* This fails on Solaris 8: |
22302 | mbrtowc returns 2, and sets wc to 0x00F0. | |
22303 | mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ | |
22304 | if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) | |
22305 | { | |
22306 | char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ | |
22307 | mbstate_t state; | |
22308 | wchar_t wc; | |
22309 | ||
22310 | memset (&state, '\0', sizeof (mbstate_t)); | |
22311 | if (mbrtowc (&wc, input + 3, 6, &state) != 4 | |
22312 | && mbtowc (&wc, input + 3, 6) == 4) | |
c0c3707f | 22313 | return 2; |
8690e634 | 22314 | } |
c971b7fa PA |
22315 | return 0; |
22316 | } | |
22317 | _ACEOF | |
8690e634 JK |
22318 | if ac_fn_c_try_run "$LINENO"; then : |
22319 | gl_cv_func_mbrtowc_sanitycheck=yes | |
c971b7fa | 22320 | else |
8690e634 | 22321 | gl_cv_func_mbrtowc_sanitycheck=no |
c971b7fa | 22322 | fi |
8690e634 JK |
22323 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
22324 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c971b7fa | 22325 | fi |
c971b7fa | 22326 | |
8690e634 | 22327 | fi |
c971b7fa | 22328 | |
8690e634 JK |
22329 | fi |
22330 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 | |
22331 | $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } | |
22332 | ||
22333 | REPLACE_MBSTATE_T=0 | |
22334 | case "$gl_cv_func_mbrtowc_incomplete_state" in | |
22335 | *yes) ;; | |
22336 | *) REPLACE_MBSTATE_T=1 ;; | |
22337 | esac | |
22338 | case "$gl_cv_func_mbrtowc_sanitycheck" in | |
22339 | *yes) ;; | |
22340 | *) REPLACE_MBSTATE_T=1 ;; | |
22341 | esac | |
c971b7fa | 22342 | else |
8690e634 | 22343 | REPLACE_MBSTATE_T=1 |
c971b7fa PA |
22344 | fi |
22345 | ||
22346 | ||
22347 | ||
8690e634 JK |
22348 | if test $ac_cv_func_mbrtowc = no; then |
22349 | HAVE_MBRTOWC=0 | |
22350 | ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" " | |
22351 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
22352 | <wchar.h>. | |
22353 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
22354 | included before <wchar.h>. */ | |
22355 | #include <stddef.h> | |
22356 | #include <stdio.h> | |
22357 | #include <time.h> | |
22358 | #include <wchar.h> | |
c971b7fa | 22359 | |
8690e634 | 22360 | " |
d0ac1c44 | 22361 | if test "x$ac_cv_have_decl_mbrtowc" = xyes; then : |
8690e634 JK |
22362 | ac_have_decl=1 |
22363 | else | |
22364 | ac_have_decl=0 | |
c971b7fa | 22365 | fi |
c971b7fa | 22366 | |
8690e634 JK |
22367 | cat >>confdefs.h <<_ACEOF |
22368 | #define HAVE_DECL_MBRTOWC $ac_have_decl | |
22369 | _ACEOF | |
c971b7fa | 22370 | |
8690e634 JK |
22371 | if test $ac_cv_have_decl_mbrtowc = yes; then |
22372 | REPLACE_MBRTOWC=1 | |
22373 | fi | |
22374 | else | |
22375 | if test $REPLACE_MBSTATE_T = 1; then | |
22376 | REPLACE_MBRTOWC=1 | |
22377 | else | |
c971b7fa PA |
22378 | |
22379 | ||
22380 | ||
8690e634 JK |
22381 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5 |
22382 | $as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; } | |
d0ac1c44 | 22383 | if ${gl_cv_func_mbrtowc_null_arg1+:} false; then : |
8690e634 | 22384 | $as_echo_n "(cached) " >&6 |
c971b7fa | 22385 | else |
c971b7fa | 22386 | |
8690e634 JK |
22387 | case "$host_os" in |
22388 | # Guess no on Solaris. | |
22389 | solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; | |
22390 | # Guess yes otherwise. | |
22391 | *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; | |
22392 | esac | |
22393 | if test $LOCALE_FR_UTF8 != none; then | |
22394 | if test "$cross_compiling" = yes; then : | |
22395 | : | |
22396 | else | |
22397 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c971b7fa PA |
22398 | /* end confdefs.h. */ |
22399 | ||
8690e634 JK |
22400 | #include <locale.h> |
22401 | #include <stdlib.h> | |
22402 | #include <string.h> | |
22403 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
22404 | <wchar.h>. | |
22405 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
22406 | included before <wchar.h>. */ | |
22407 | #include <stddef.h> | |
22408 | #include <stdio.h> | |
22409 | #include <time.h> | |
22410 | #include <wchar.h> | |
22411 | int main () | |
22412 | { | |
22413 | int result = 0; | |
22414 | ||
22415 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
22416 | { | |
22417 | char input[] = "\303\237er"; | |
22418 | mbstate_t state; | |
22419 | wchar_t wc; | |
22420 | size_t ret; | |
22421 | ||
22422 | memset (&state, '\0', sizeof (mbstate_t)); | |
22423 | wc = (wchar_t) 0xBADFACE; | |
22424 | ret = mbrtowc (&wc, input, 5, &state); | |
22425 | if (ret != 2) | |
22426 | result |= 1; | |
22427 | if (!mbsinit (&state)) | |
22428 | result |= 2; | |
c971b7fa | 22429 | |
8690e634 JK |
22430 | memset (&state, '\0', sizeof (mbstate_t)); |
22431 | ret = mbrtowc (NULL, input, 5, &state); | |
22432 | if (ret != 2) /* Solaris 7 fails here: ret is -1. */ | |
22433 | result |= 4; | |
22434 | if (!mbsinit (&state)) | |
22435 | result |= 8; | |
22436 | } | |
22437 | return result; | |
22438 | } | |
c971b7fa | 22439 | _ACEOF |
8690e634 JK |
22440 | if ac_fn_c_try_run "$LINENO"; then : |
22441 | gl_cv_func_mbrtowc_null_arg1=yes | |
22442 | else | |
22443 | gl_cv_func_mbrtowc_null_arg1=no | |
22444 | fi | |
22445 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
22446 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
22447 | fi | |
c971b7fa | 22448 | |
8690e634 | 22449 | fi |
c971b7fa | 22450 | |
c971b7fa | 22451 | fi |
8690e634 JK |
22452 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5 |
22453 | $as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; } | |
c971b7fa | 22454 | |
c971b7fa | 22455 | |
c971b7fa | 22456 | |
c971b7fa | 22457 | |
8690e634 JK |
22458 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5 |
22459 | $as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; } | |
d0ac1c44 | 22460 | if ${gl_cv_func_mbrtowc_null_arg2+:} false; then : |
8690e634 JK |
22461 | $as_echo_n "(cached) " >&6 |
22462 | else | |
c971b7fa | 22463 | |
8690e634 JK |
22464 | case "$host_os" in |
22465 | # Guess no on OSF/1. | |
22466 | osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;; | |
22467 | # Guess yes otherwise. | |
22468 | *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;; | |
22469 | esac | |
22470 | if test $LOCALE_FR_UTF8 != none; then | |
22471 | if test "$cross_compiling" = yes; then : | |
c971b7fa | 22472 | : |
8690e634 JK |
22473 | else |
22474 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22475 | /* end confdefs.h. */ | |
22476 | ||
22477 | #include <locale.h> | |
22478 | #include <string.h> | |
22479 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
22480 | <wchar.h>. | |
22481 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
22482 | included before <wchar.h>. */ | |
22483 | #include <stddef.h> | |
22484 | #include <stdio.h> | |
22485 | #include <time.h> | |
22486 | #include <wchar.h> | |
22487 | int main () | |
22488 | { | |
22489 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
22490 | { | |
22491 | mbstate_t state; | |
22492 | wchar_t wc; | |
22493 | int ret; | |
22494 | ||
22495 | memset (&state, '\0', sizeof (mbstate_t)); | |
22496 | wc = (wchar_t) 0xBADFACE; | |
22497 | mbrtowc (&wc, NULL, 5, &state); | |
22498 | /* Check that wc was not modified. */ | |
22499 | if (wc != (wchar_t) 0xBADFACE) | |
c0c3707f | 22500 | return 2; |
8690e634 JK |
22501 | } |
22502 | return 0; | |
22503 | } | |
22504 | _ACEOF | |
22505 | if ac_fn_c_try_run "$LINENO"; then : | |
22506 | gl_cv_func_mbrtowc_null_arg2=yes | |
22507 | else | |
22508 | gl_cv_func_mbrtowc_null_arg2=no | |
22509 | fi | |
22510 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
22511 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
22512 | fi | |
22513 | ||
22514 | fi | |
22515 | ||
22516 | fi | |
22517 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5 | |
22518 | $as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; } | |
c971b7fa PA |
22519 | |
22520 | ||
22521 | ||
22522 | ||
22523 | ||
22524 | ||
8690e634 JK |
22525 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5 |
22526 | $as_echo_n "checking whether mbrtowc has a correct return value... " >&6; } | |
d0ac1c44 | 22527 | if ${gl_cv_func_mbrtowc_retval+:} false; then : |
8690e634 JK |
22528 | $as_echo_n "(cached) " >&6 |
22529 | else | |
22530 | ||
22531 | case "$host_os" in | |
22532 | # Guess no on HP-UX, Solaris, native Windows. | |
22533 | hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; | |
22534 | # Guess yes otherwise. | |
22535 | *) gl_cv_func_mbrtowc_retval="guessing yes" ;; | |
22536 | esac | |
22537 | if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ | |
22538 | || { case "$host_os" in mingw*) true;; *) false;; esac; }; then | |
22539 | if test "$cross_compiling" = yes; then : | |
c971b7fa | 22540 | : |
8690e634 JK |
22541 | else |
22542 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22543 | /* end confdefs.h. */ | |
c971b7fa | 22544 | |
8690e634 JK |
22545 | #include <locale.h> |
22546 | #include <string.h> | |
22547 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
22548 | <wchar.h>. | |
22549 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
22550 | included before <wchar.h>. */ | |
22551 | #include <stddef.h> | |
22552 | #include <stdio.h> | |
22553 | #include <time.h> | |
22554 | #include <wchar.h> | |
22555 | int main () | |
22556 | { | |
22557 | int result = 0; | |
22558 | int found_some_locale = 0; | |
22559 | /* This fails on Solaris. */ | |
22560 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
22561 | { | |
22562 | char input[] = "B\303\274\303\237er"; /* "Büßer" */ | |
22563 | mbstate_t state; | |
22564 | wchar_t wc; | |
22565 | ||
22566 | memset (&state, '\0', sizeof (mbstate_t)); | |
22567 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
22568 | { | |
22569 | input[1] = '\0'; | |
22570 | if (mbrtowc (&wc, input + 2, 5, &state) != 1) | |
22571 | result |= 1; | |
22572 | } | |
22573 | found_some_locale = 1; | |
22574 | } | |
22575 | /* This fails on HP-UX 11.11. */ | |
22576 | if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) | |
22577 | { | |
22578 | char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ | |
22579 | mbstate_t state; | |
22580 | wchar_t wc; | |
22581 | ||
22582 | memset (&state, '\0', sizeof (mbstate_t)); | |
22583 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
22584 | { | |
22585 | input[1] = '\0'; | |
22586 | if (mbrtowc (&wc, input + 2, 5, &state) != 2) | |
22587 | result |= 2; | |
22588 | } | |
22589 | found_some_locale = 1; | |
22590 | } | |
5df4cba6 SM |
22591 | /* This fails on native Windows. */ |
22592 | if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) | |
22593 | { | |
22594 | char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ | |
22595 | mbstate_t state; | |
22596 | wchar_t wc; | |
22597 | ||
22598 | memset (&state, '\0', sizeof (mbstate_t)); | |
22599 | if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) | |
22600 | { | |
22601 | input[3] = '\0'; | |
22602 | if (mbrtowc (&wc, input + 4, 4, &state) != 1) | |
22603 | result |= 4; | |
22604 | } | |
22605 | found_some_locale = 1; | |
22606 | } | |
22607 | if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) | |
22608 | { | |
22609 | char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ | |
22610 | mbstate_t state; | |
22611 | wchar_t wc; | |
22612 | ||
22613 | memset (&state, '\0', sizeof (mbstate_t)); | |
22614 | if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) | |
22615 | { | |
22616 | input[3] = '\0'; | |
22617 | if (mbrtowc (&wc, input + 4, 4, &state) != 1) | |
22618 | result |= 8; | |
22619 | } | |
22620 | found_some_locale = 1; | |
22621 | } | |
22622 | if (setlocale (LC_ALL, "Chinese_China.936") != NULL) | |
22623 | { | |
22624 | char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ | |
22625 | mbstate_t state; | |
22626 | wchar_t wc; | |
22627 | ||
22628 | memset (&state, '\0', sizeof (mbstate_t)); | |
22629 | if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) | |
22630 | { | |
22631 | input[3] = '\0'; | |
22632 | if (mbrtowc (&wc, input + 4, 4, &state) != 1) | |
22633 | result |= 16; | |
22634 | } | |
22635 | found_some_locale = 1; | |
22636 | } | |
22637 | return (found_some_locale ? result : 77); | |
22638 | } | |
22639 | _ACEOF | |
22640 | if ac_fn_c_try_run "$LINENO"; then : | |
22641 | gl_cv_func_mbrtowc_retval=yes | |
22642 | else | |
22643 | if test $? != 77; then | |
22644 | gl_cv_func_mbrtowc_retval=no | |
22645 | fi | |
22646 | ||
22647 | fi | |
22648 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
22649 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
22650 | fi | |
22651 | ||
22652 | fi | |
22653 | ||
22654 | fi | |
22655 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5 | |
22656 | $as_echo "$gl_cv_func_mbrtowc_retval" >&6; } | |
22657 | ||
22658 | ||
22659 | ||
22660 | ||
22661 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5 | |
22662 | $as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; } | |
22663 | if ${gl_cv_func_mbrtowc_nul_retval+:} false; then : | |
22664 | $as_echo_n "(cached) " >&6 | |
22665 | else | |
22666 | ||
22667 | case "$host_os" in | |
22668 | # Guess no on Solaris 8 and 9. | |
22669 | solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; | |
22670 | # Guess yes otherwise. | |
22671 | *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; | |
22672 | esac | |
22673 | if test $LOCALE_ZH_CN != none; then | |
22674 | if test "$cross_compiling" = yes; then : | |
22675 | : | |
22676 | else | |
22677 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22678 | /* end confdefs.h. */ | |
22679 | ||
22680 | #include <locale.h> | |
22681 | #include <string.h> | |
22682 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
22683 | <wchar.h>. | |
22684 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
22685 | included before <wchar.h>. */ | |
22686 | #include <stddef.h> | |
22687 | #include <stdio.h> | |
22688 | #include <time.h> | |
22689 | #include <wchar.h> | |
22690 | int main () | |
22691 | { | |
22692 | /* This fails on Solaris 8 and 9. */ | |
22693 | if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) | |
22694 | { | |
22695 | mbstate_t state; | |
22696 | wchar_t wc; | |
22697 | ||
22698 | memset (&state, '\0', sizeof (mbstate_t)); | |
22699 | if (mbrtowc (&wc, "", 1, &state) != 0) | |
22700 | return 2; | |
22701 | } | |
22702 | return 0; | |
22703 | } | |
22704 | _ACEOF | |
22705 | if ac_fn_c_try_run "$LINENO"; then : | |
22706 | gl_cv_func_mbrtowc_nul_retval=yes | |
22707 | else | |
22708 | gl_cv_func_mbrtowc_nul_retval=no | |
22709 | fi | |
22710 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
22711 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
22712 | fi | |
22713 | ||
22714 | fi | |
22715 | ||
22716 | fi | |
22717 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5 | |
22718 | $as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; } | |
22719 | ||
22720 | ||
22721 | ||
22722 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc stores incomplete characters" >&5 | |
22723 | $as_echo_n "checking whether mbrtowc stores incomplete characters... " >&6; } | |
22724 | if ${gl_cv_func_mbrtowc_stores_incomplete+:} false; then : | |
22725 | $as_echo_n "(cached) " >&6 | |
22726 | else | |
22727 | ||
22728 | case "$host_os" in | |
22729 | # Guess yes on native Windows. | |
22730 | mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;; | |
22731 | *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;; | |
22732 | esac | |
22733 | case "$host_os" in | |
22734 | mingw*) | |
22735 | if test "$cross_compiling" = yes; then : | |
22736 | : | |
22737 | else | |
22738 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22739 | /* end confdefs.h. */ | |
22740 | ||
22741 | #include <locale.h> | |
22742 | #include <string.h> | |
22743 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
22744 | <wchar.h>. | |
22745 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
22746 | included before <wchar.h>. */ | |
22747 | #include <stddef.h> | |
22748 | #include <stdio.h> | |
22749 | #include <time.h> | |
22750 | #include <wchar.h> | |
22751 | int main () | |
22752 | { | |
22753 | int result = 0; | |
22754 | if (setlocale (LC_ALL, "French_France.65001") != NULL) | |
22755 | { | |
22756 | wchar_t wc = (wchar_t) 0xBADFACE; | |
22757 | mbstate_t state; | |
22758 | ||
22759 | memset (&state, '\0', sizeof (mbstate_t)); | |
22760 | if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2) | |
22761 | && wc != (wchar_t) 0xBADFACE) | |
22762 | result |= 1; | |
22763 | } | |
8690e634 JK |
22764 | if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) |
22765 | { | |
5df4cba6 | 22766 | wchar_t wc = (wchar_t) 0xBADFACE; |
8690e634 | 22767 | mbstate_t state; |
8690e634 JK |
22768 | |
22769 | memset (&state, '\0', sizeof (mbstate_t)); | |
5df4cba6 SM |
22770 | if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2) |
22771 | && wc != (wchar_t) 0xBADFACE) | |
22772 | result |= 2; | |
8690e634 JK |
22773 | } |
22774 | if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) | |
22775 | { | |
5df4cba6 | 22776 | wchar_t wc = (wchar_t) 0xBADFACE; |
8690e634 | 22777 | mbstate_t state; |
8690e634 JK |
22778 | |
22779 | memset (&state, '\0', sizeof (mbstate_t)); | |
5df4cba6 SM |
22780 | if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2) |
22781 | && wc != (wchar_t) 0xBADFACE) | |
22782 | result |= 4; | |
8690e634 JK |
22783 | } |
22784 | if (setlocale (LC_ALL, "Chinese_China.936") != NULL) | |
22785 | { | |
5df4cba6 | 22786 | wchar_t wc = (wchar_t) 0xBADFACE; |
8690e634 | 22787 | mbstate_t state; |
8690e634 JK |
22788 | |
22789 | memset (&state, '\0', sizeof (mbstate_t)); | |
5df4cba6 SM |
22790 | if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2) |
22791 | && wc != (wchar_t) 0xBADFACE) | |
22792 | result |= 8; | |
8690e634 | 22793 | } |
5df4cba6 | 22794 | return result; |
8690e634 JK |
22795 | } |
22796 | _ACEOF | |
22797 | if ac_fn_c_try_run "$LINENO"; then : | |
5df4cba6 | 22798 | gl_cv_func_mbrtowc_stores_incomplete=no |
8690e634 | 22799 | else |
5df4cba6 | 22800 | gl_cv_func_mbrtowc_stores_incomplete=yes |
8690e634 JK |
22801 | fi |
22802 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
22803 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
22804 | fi | |
c971b7fa | 22805 | |
5df4cba6 SM |
22806 | ;; |
22807 | *) | |
8690e634 | 22808 | |
5df4cba6 SM |
22809 | if test $LOCALE_FR_UTF8 != none; then |
22810 | if test "$cross_compiling" = yes; then : | |
8690e634 | 22811 | : |
c971b7fa PA |
22812 | else |
22813 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22814 | /* end confdefs.h. */ | |
22815 | ||
8690e634 | 22816 | #include <locale.h> |
c971b7fa | 22817 | #include <string.h> |
8690e634 JK |
22818 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before |
22819 | <wchar.h>. | |
22820 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
22821 | included before <wchar.h>. */ | |
22822 | #include <stddef.h> | |
22823 | #include <stdio.h> | |
22824 | #include <time.h> | |
22825 | #include <wchar.h> | |
22826 | int main () | |
c971b7fa | 22827 | { |
5df4cba6 | 22828 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) |
c971b7fa | 22829 | { |
5df4cba6 | 22830 | wchar_t wc = (wchar_t) 0xBADFACE; |
8690e634 | 22831 | mbstate_t state; |
c971b7fa | 22832 | |
8690e634 | 22833 | memset (&state, '\0', sizeof (mbstate_t)); |
5df4cba6 SM |
22834 | if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2) |
22835 | && wc != (wchar_t) 0xBADFACE) | |
22836 | return 1; | |
8690e634 | 22837 | } |
c971b7fa PA |
22838 | return 0; |
22839 | } | |
22840 | _ACEOF | |
22841 | if ac_fn_c_try_run "$LINENO"; then : | |
5df4cba6 | 22842 | gl_cv_func_mbrtowc_stores_incomplete=no |
c971b7fa | 22843 | else |
5df4cba6 | 22844 | gl_cv_func_mbrtowc_stores_incomplete=yes |
c971b7fa PA |
22845 | fi |
22846 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
22847 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
22848 | fi | |
22849 | ||
5df4cba6 SM |
22850 | fi |
22851 | ;; | |
22852 | esac | |
8690e634 | 22853 | |
c971b7fa | 22854 | fi |
5df4cba6 SM |
22855 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_stores_incomplete" >&5 |
22856 | $as_echo "$gl_cv_func_mbrtowc_stores_incomplete" >&6; } | |
8690e634 | 22857 | |
4a626d0a PA |
22858 | |
22859 | ||
22860 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5 | |
22861 | $as_echo_n "checking whether mbrtowc works on empty input... " >&6; } | |
d0ac1c44 | 22862 | if ${gl_cv_func_mbrtowc_empty_input+:} false; then : |
4a626d0a PA |
22863 | $as_echo_n "(cached) " >&6 |
22864 | else | |
22865 | ||
22866 | case "$host_os" in | |
c0c3707f CB |
22867 | # Guess no on AIX and glibc systems. |
22868 | aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;; | |
22869 | # Guess yes on native Windows. | |
22870 | mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; | |
22871 | *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; | |
4a626d0a PA |
22872 | esac |
22873 | if test "$cross_compiling" = yes; then : | |
22874 | : | |
22875 | else | |
22876 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22877 | /* end confdefs.h. */ | |
22878 | ||
22879 | #include <wchar.h> | |
22880 | static wchar_t wc; | |
22881 | static mbstate_t mbs; | |
22882 | int | |
22883 | main (void) | |
22884 | { | |
49e4877c | 22885 | return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2; |
4a626d0a PA |
22886 | } |
22887 | _ACEOF | |
22888 | if ac_fn_c_try_run "$LINENO"; then : | |
4a626d0a | 22889 | gl_cv_func_mbrtowc_empty_input=yes |
49e4877c PA |
22890 | else |
22891 | gl_cv_func_mbrtowc_empty_input=no | |
4a626d0a PA |
22892 | fi |
22893 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
22894 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
22895 | fi | |
22896 | ||
22897 | ||
22898 | fi | |
22899 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5 | |
22900 | $as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; } | |
22901 | ||
49e4877c | 22902 | |
c0c3707f | 22903 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5 |
49e4877c | 22904 | $as_echo_n "checking whether the C locale is free of encoding errors... " >&6; } |
5df4cba6 | 22905 | if ${gl_cv_func_mbrtowc_C_locale_sans_EILSEQ+:} false; then : |
49e4877c PA |
22906 | $as_echo_n "(cached) " >&6 |
22907 | else | |
22908 | ||
5df4cba6 | 22909 | gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal" |
49e4877c PA |
22910 | |
22911 | if test "$cross_compiling" = yes; then : | |
c0c3707f CB |
22912 | case "$host_os" in |
22913 | # Guess yes on native Windows. | |
5df4cba6 | 22914 | mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;; |
c0c3707f CB |
22915 | esac |
22916 | ||
49e4877c PA |
22917 | else |
22918 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
22919 | /* end confdefs.h. */ | |
22920 | #include <limits.h> | |
22921 | #include <locale.h> | |
22922 | #include <wchar.h> | |
22923 | ||
22924 | int | |
22925 | main () | |
22926 | { | |
22927 | ||
22928 | int i; | |
22929 | char *locale = setlocale (LC_ALL, "C"); | |
22930 | if (! locale) | |
c0c3707f | 22931 | return 2; |
49e4877c PA |
22932 | for (i = CHAR_MIN; i <= CHAR_MAX; i++) |
22933 | { | |
22934 | char c = i; | |
22935 | wchar_t wc; | |
22936 | mbstate_t mbs = { 0, }; | |
22937 | size_t ss = mbrtowc (&wc, &c, 1, &mbs); | |
22938 | if (1 < ss) | |
c0c3707f | 22939 | return 3; |
49e4877c PA |
22940 | } |
22941 | return 0; | |
22942 | ||
6ec2e0f5 SDJ |
22943 | ; |
22944 | return 0; | |
22945 | } | |
22946 | _ACEOF | |
22947 | if ac_fn_c_try_run "$LINENO"; then : | |
5df4cba6 | 22948 | gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes |
6ec2e0f5 | 22949 | else |
5df4cba6 | 22950 | gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no |
6ec2e0f5 SDJ |
22951 | fi |
22952 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
22953 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
22954 | fi | |
22955 | ||
c0c3707f | 22956 | |
6ec2e0f5 | 22957 | fi |
5df4cba6 SM |
22958 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&5 |
22959 | $as_echo "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&6; } | |
6ec2e0f5 SDJ |
22960 | |
22961 | case "$gl_cv_func_mbrtowc_null_arg1" in | |
22962 | *yes) ;; | |
22963 | *) | |
22964 | $as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h | |
22965 | ||
22966 | REPLACE_MBRTOWC=1 | |
22967 | ;; | |
22968 | esac | |
22969 | case "$gl_cv_func_mbrtowc_null_arg2" in | |
22970 | *yes) ;; | |
22971 | *) | |
22972 | $as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h | |
22973 | ||
22974 | REPLACE_MBRTOWC=1 | |
22975 | ;; | |
22976 | esac | |
22977 | case "$gl_cv_func_mbrtowc_retval" in | |
22978 | *yes) ;; | |
22979 | *) | |
22980 | $as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h | |
22981 | ||
22982 | REPLACE_MBRTOWC=1 | |
22983 | ;; | |
22984 | esac | |
22985 | case "$gl_cv_func_mbrtowc_nul_retval" in | |
22986 | *yes) ;; | |
22987 | *) | |
22988 | $as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h | |
22989 | ||
5df4cba6 SM |
22990 | REPLACE_MBRTOWC=1 |
22991 | ;; | |
22992 | esac | |
22993 | case "$gl_cv_func_mbrtowc_stores_incomplete" in | |
22994 | *no) ;; | |
22995 | *) | |
22996 | $as_echo "#define MBRTOWC_STORES_INCOMPLETE_BUG 1" >>confdefs.h | |
22997 | ||
22998 | REPLACE_MBRTOWC=1 | |
22999 | ;; | |
23000 | esac | |
23001 | case "$gl_cv_func_mbrtowc_empty_input" in | |
23002 | *yes) ;; | |
23003 | *) | |
23004 | $as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h | |
23005 | ||
23006 | REPLACE_MBRTOWC=1 | |
23007 | ;; | |
23008 | esac | |
23009 | case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in | |
23010 | *yes) ;; | |
23011 | *) | |
23012 | $as_echo "#define MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h | |
23013 | ||
23014 | REPLACE_MBRTOWC=1 | |
23015 | ;; | |
23016 | esac | |
23017 | fi | |
23018 | fi | |
23019 | if test $REPLACE_MBSTATE_T = 1; then | |
23020 | case "$host_os" in | |
23021 | mingw*) LIB_MBRTOWC= ;; | |
23022 | *) | |
23023 | ||
23024 | ||
23025 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 | |
23026 | $as_echo_n "checking whether imported symbols can be declared weak... " >&6; } | |
23027 | if ${gl_cv_have_weak+:} false; then : | |
23028 | $as_echo_n "(cached) " >&6 | |
23029 | else | |
23030 | gl_cv_have_weak=no | |
23031 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23032 | /* end confdefs.h. */ | |
23033 | extern void xyzzy (); | |
23034 | #pragma weak xyzzy | |
23035 | int | |
23036 | main () | |
23037 | { | |
23038 | xyzzy(); | |
23039 | ; | |
23040 | return 0; | |
23041 | } | |
23042 | _ACEOF | |
23043 | if ac_fn_c_try_link "$LINENO"; then : | |
23044 | gl_cv_have_weak=maybe | |
23045 | fi | |
23046 | rm -f core conftest.err conftest.$ac_objext \ | |
23047 | conftest$ac_exeext conftest.$ac_ext | |
23048 | if test $gl_cv_have_weak = maybe; then | |
23049 | if test "$cross_compiling" = yes; then : | |
23050 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23051 | /* end confdefs.h. */ | |
23052 | #ifdef __ELF__ | |
23053 | Extensible Linking Format | |
23054 | #endif | |
23055 | ||
23056 | _ACEOF | |
23057 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
23058 | $EGREP "Extensible Linking Format" >/dev/null 2>&1; then : | |
23059 | gl_cv_have_weak="guessing yes" | |
23060 | else | |
23061 | gl_cv_have_weak="guessing no" | |
23062 | fi | |
23063 | rm -f conftest* | |
23064 | ||
23065 | ||
23066 | else | |
23067 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23068 | /* end confdefs.h. */ | |
23069 | ||
23070 | #include <stdio.h> | |
23071 | #pragma weak fputs | |
23072 | int main () | |
23073 | { | |
23074 | return (fputs == NULL); | |
23075 | } | |
23076 | _ACEOF | |
23077 | if ac_fn_c_try_run "$LINENO"; then : | |
23078 | gl_cv_have_weak=yes | |
23079 | else | |
23080 | gl_cv_have_weak=no | |
23081 | fi | |
23082 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23083 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23084 | fi | |
23085 | ||
23086 | fi | |
23087 | case " $LDFLAGS " in | |
23088 | *" -static "*) gl_cv_have_weak=no ;; | |
23089 | esac | |
23090 | case "$gl_cv_have_weak" in | |
23091 | *yes) | |
23092 | case "$host_os" in | |
23093 | freebsd* | dragonfly*) | |
23094 | : > conftest1.c | |
23095 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1 | |
23096 | cat <<EOF > conftest2.c | |
23097 | #include <pthread.h> | |
23098 | #pragma weak pthread_mutexattr_gettype | |
23099 | int main () | |
23100 | { | |
23101 | return (pthread_mutexattr_gettype != NULL); | |
23102 | } | |
23103 | EOF | |
23104 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \ | |
23105 | || gl_cv_have_weak=no | |
23106 | rm -f conftest1.c libempty.so conftest2.c conftest | |
23107 | ;; | |
23108 | esac | |
23109 | ;; | |
23110 | esac | |
23111 | ||
23112 | fi | |
23113 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 | |
23114 | $as_echo "$gl_cv_have_weak" >&6; } | |
23115 | case "$gl_cv_have_weak" in | |
23116 | *yes) | |
23117 | ||
23118 | $as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h | |
23119 | ||
23120 | ;; | |
23121 | esac | |
23122 | ||
23123 | case "$gl_cv_have_weak" in | |
23124 | *yes) LIB_MBRTOWC= ;; | |
23125 | *) LIB_MBRTOWC="$LIBPTHREAD" ;; | |
23126 | esac | |
23127 | ;; | |
23128 | esac | |
23129 | else | |
23130 | LIB_MBRTOWC= | |
23131 | fi | |
23132 | ||
23133 | ||
23134 | if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then | |
23135 | ||
23136 | ||
23137 | ||
23138 | ||
23139 | ||
23140 | ||
23141 | ||
23142 | ||
23143 | gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext" | |
23144 | ||
23145 | if test $REPLACE_MBSTATE_T = 1; then | |
23146 | ||
23147 | ||
23148 | ||
23149 | ||
23150 | ||
23151 | ||
23152 | ||
23153 | ||
23154 | gl_LIBOBJS="$gl_LIBOBJS lc-charset-dispatch.$ac_objext" | |
23155 | ||
23156 | ||
23157 | ||
23158 | ||
23159 | ||
23160 | ||
23161 | ||
23162 | ||
23163 | ||
23164 | gl_LIBOBJS="$gl_LIBOBJS mbtowc-lock.$ac_objext" | |
23165 | ||
23166 | ||
23167 | ||
23168 | ||
23169 | CFLAG_VISIBILITY= | |
23170 | HAVE_VISIBILITY=0 | |
23171 | if test -n "$GCC"; then | |
23172 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5 | |
23173 | $as_echo_n "checking whether the -Werror option is usable... " >&6; } | |
23174 | if ${gl_cv_cc_vis_werror+:} false; then : | |
23175 | $as_echo_n "(cached) " >&6 | |
23176 | else | |
23177 | gl_save_CFLAGS="$CFLAGS" | |
23178 | CFLAGS="$CFLAGS -Werror" | |
23179 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23180 | /* end confdefs.h. */ | |
23181 | ||
23182 | int | |
23183 | main () | |
23184 | { | |
23185 | ||
23186 | ; | |
23187 | return 0; | |
23188 | } | |
23189 | _ACEOF | |
23190 | if ac_fn_c_try_compile "$LINENO"; then : | |
23191 | gl_cv_cc_vis_werror=yes | |
23192 | else | |
23193 | gl_cv_cc_vis_werror=no | |
23194 | fi | |
23195 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
23196 | CFLAGS="$gl_save_CFLAGS" | |
23197 | ||
23198 | fi | |
23199 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5 | |
23200 | $as_echo "$gl_cv_cc_vis_werror" >&6; } | |
23201 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5 | |
23202 | $as_echo_n "checking for simple visibility declarations... " >&6; } | |
23203 | if ${gl_cv_cc_visibility+:} false; then : | |
23204 | $as_echo_n "(cached) " >&6 | |
23205 | else | |
23206 | gl_save_CFLAGS="$CFLAGS" | |
23207 | CFLAGS="$CFLAGS -fvisibility=hidden" | |
23208 | if test $gl_cv_cc_vis_werror = yes; then | |
23209 | CFLAGS="$CFLAGS -Werror" | |
23210 | fi | |
23211 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23212 | /* end confdefs.h. */ | |
23213 | extern __attribute__((__visibility__("hidden"))) int hiddenvar; | |
23214 | extern __attribute__((__visibility__("default"))) int exportedvar; | |
23215 | extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); | |
23216 | extern __attribute__((__visibility__("default"))) int exportedfunc (void); | |
23217 | void dummyfunc (void) {} | |
23218 | ||
23219 | int | |
23220 | main () | |
23221 | { | |
6ec2e0f5 | 23222 | |
5df4cba6 SM |
23223 | ; |
23224 | return 0; | |
23225 | } | |
23226 | _ACEOF | |
23227 | if ac_fn_c_try_compile "$LINENO"; then : | |
23228 | gl_cv_cc_visibility=yes | |
23229 | else | |
23230 | gl_cv_cc_visibility=no | |
23231 | fi | |
23232 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
23233 | CFLAGS="$gl_save_CFLAGS" | |
6ec2e0f5 | 23234 | |
5df4cba6 SM |
23235 | fi |
23236 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5 | |
23237 | $as_echo "$gl_cv_cc_visibility" >&6; } | |
23238 | if test $gl_cv_cc_visibility = yes; then | |
23239 | CFLAG_VISIBILITY="-fvisibility=hidden" | |
23240 | HAVE_VISIBILITY=1 | |
6ec2e0f5 SDJ |
23241 | fi |
23242 | fi | |
23243 | ||
6ec2e0f5 SDJ |
23244 | |
23245 | ||
5df4cba6 SM |
23246 | cat >>confdefs.h <<_ACEOF |
23247 | #define HAVE_VISIBILITY $HAVE_VISIBILITY | |
23248 | _ACEOF | |
6ec2e0f5 SDJ |
23249 | |
23250 | ||
6ec2e0f5 | 23251 | |
5df4cba6 | 23252 | fi |
6ec2e0f5 | 23253 | |
c0c3707f | 23254 | |
6ec2e0f5 SDJ |
23255 | : |
23256 | ||
23257 | fi | |
23258 | ||
23259 | ||
23260 | ||
23261 | ||
23262 | ||
23263 | GNULIB_MBRTOWC=1 | |
23264 | ||
23265 | ||
23266 | ||
23267 | ||
23268 | ||
23269 | $as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h | |
23270 | ||
23271 | ||
23272 | ||
23273 | ||
23274 | ||
23275 | ||
23276 | ||
23277 | ||
23278 | ||
23279 | ||
23280 | ||
23281 | ||
23282 | ||
23283 | ||
5df4cba6 SM |
23284 | |
23285 | if case "$host_os" in | |
23286 | mingw*) true ;; | |
23287 | *) test $ac_cv_func_mbsinit = yes ;; | |
23288 | esac \ | |
23289 | && test $ac_cv_func_mbrtowc = yes; then | |
6ec2e0f5 SDJ |
23290 | |
23291 | ||
23292 | ||
c0c3707f | 23293 | |
6ec2e0f5 SDJ |
23294 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 |
23295 | $as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } | |
d0ac1c44 | 23296 | if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then : |
6ec2e0f5 SDJ |
23297 | $as_echo_n "(cached) " >&6 |
23298 | else | |
23299 | ||
23300 | case "$host_os" in | |
23301 | # Guess no on AIX and OSF/1. | |
23302 | aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; | |
23303 | # Guess yes otherwise. | |
23304 | *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; | |
23305 | esac | |
23306 | if test $LOCALE_JA != none; then | |
23307 | if test "$cross_compiling" = yes; then : | |
23308 | : | |
23309 | else | |
23310 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23311 | /* end confdefs.h. */ | |
23312 | ||
23313 | #include <locale.h> | |
23314 | #include <string.h> | |
23315 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
23316 | <wchar.h>. | |
23317 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
23318 | included before <wchar.h>. */ | |
23319 | #include <stddef.h> | |
23320 | #include <stdio.h> | |
23321 | #include <time.h> | |
23322 | #include <wchar.h> | |
23323 | int main () | |
23324 | { | |
23325 | if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) | |
23326 | { | |
23327 | const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ | |
23328 | mbstate_t state; | |
23329 | wchar_t wc; | |
23330 | ||
23331 | memset (&state, '\0', sizeof (mbstate_t)); | |
23332 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
23333 | if (mbsinit (&state)) | |
c0c3707f CB |
23334 | return 2; |
23335 | } | |
23336 | return 0; | |
23337 | } | |
23338 | _ACEOF | |
23339 | if ac_fn_c_try_run "$LINENO"; then : | |
23340 | gl_cv_func_mbrtowc_incomplete_state=yes | |
23341 | else | |
23342 | gl_cv_func_mbrtowc_incomplete_state=no | |
23343 | fi | |
23344 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23345 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23346 | fi | |
23347 | ||
23348 | else | |
23349 | if test $LOCALE_FR_UTF8 != none; then | |
23350 | if test "$cross_compiling" = yes; then : | |
23351 | : | |
23352 | else | |
23353 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23354 | /* end confdefs.h. */ | |
23355 | ||
23356 | #include <locale.h> | |
23357 | #include <string.h> | |
23358 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
23359 | <wchar.h>. | |
23360 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
23361 | included before <wchar.h>. */ | |
23362 | #include <stddef.h> | |
23363 | #include <stdio.h> | |
23364 | #include <time.h> | |
23365 | #include <wchar.h> | |
23366 | int main () | |
23367 | { | |
23368 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
23369 | { | |
23370 | const char input[] = "B\303\274\303\237er"; /* "Büßer" */ | |
23371 | mbstate_t state; | |
23372 | wchar_t wc; | |
23373 | ||
23374 | memset (&state, '\0', sizeof (mbstate_t)); | |
23375 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
23376 | if (mbsinit (&state)) | |
23377 | return 2; | |
6ec2e0f5 SDJ |
23378 | } |
23379 | return 0; | |
23380 | } | |
23381 | _ACEOF | |
23382 | if ac_fn_c_try_run "$LINENO"; then : | |
23383 | gl_cv_func_mbrtowc_incomplete_state=yes | |
23384 | else | |
23385 | gl_cv_func_mbrtowc_incomplete_state=no | |
23386 | fi | |
23387 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23388 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23389 | fi | |
23390 | ||
c0c3707f | 23391 | fi |
6ec2e0f5 SDJ |
23392 | fi |
23393 | ||
23394 | fi | |
23395 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 | |
23396 | $as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } | |
23397 | ||
23398 | ||
23399 | ||
23400 | ||
23401 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 | |
23402 | $as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } | |
d0ac1c44 | 23403 | if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then : |
6ec2e0f5 SDJ |
23404 | $as_echo_n "(cached) " >&6 |
23405 | else | |
23406 | ||
23407 | case "$host_os" in | |
23408 | # Guess no on Solaris 8. | |
23409 | solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; | |
23410 | # Guess yes otherwise. | |
23411 | *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; | |
23412 | esac | |
23413 | if test $LOCALE_ZH_CN != none; then | |
23414 | if test "$cross_compiling" = yes; then : | |
23415 | : | |
23416 | else | |
23417 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23418 | /* end confdefs.h. */ | |
23419 | ||
23420 | #include <locale.h> | |
23421 | #include <stdlib.h> | |
23422 | #include <string.h> | |
23423 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
23424 | <wchar.h>. | |
23425 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
23426 | included before <wchar.h>. */ | |
23427 | #include <stddef.h> | |
23428 | #include <stdio.h> | |
23429 | #include <time.h> | |
23430 | #include <wchar.h> | |
23431 | int main () | |
23432 | { | |
23433 | /* This fails on Solaris 8: | |
23434 | mbrtowc returns 2, and sets wc to 0x00F0. | |
23435 | mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ | |
23436 | if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) | |
23437 | { | |
23438 | char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ | |
23439 | mbstate_t state; | |
23440 | wchar_t wc; | |
23441 | ||
23442 | memset (&state, '\0', sizeof (mbstate_t)); | |
23443 | if (mbrtowc (&wc, input + 3, 6, &state) != 4 | |
23444 | && mbtowc (&wc, input + 3, 6) == 4) | |
c0c3707f | 23445 | return 2; |
6ec2e0f5 | 23446 | } |
49e4877c PA |
23447 | return 0; |
23448 | } | |
23449 | _ACEOF | |
23450 | if ac_fn_c_try_run "$LINENO"; then : | |
6ec2e0f5 | 23451 | gl_cv_func_mbrtowc_sanitycheck=yes |
49e4877c | 23452 | else |
6ec2e0f5 | 23453 | gl_cv_func_mbrtowc_sanitycheck=no |
49e4877c PA |
23454 | fi |
23455 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23456 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23457 | fi | |
23458 | ||
6ec2e0f5 SDJ |
23459 | fi |
23460 | ||
49e4877c | 23461 | fi |
6ec2e0f5 SDJ |
23462 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 |
23463 | $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } | |
49e4877c | 23464 | |
6ec2e0f5 SDJ |
23465 | REPLACE_MBSTATE_T=0 |
23466 | case "$gl_cv_func_mbrtowc_incomplete_state" in | |
23467 | *yes) ;; | |
23468 | *) REPLACE_MBSTATE_T=1 ;; | |
23469 | esac | |
23470 | case "$gl_cv_func_mbrtowc_sanitycheck" in | |
23471 | *yes) ;; | |
23472 | *) REPLACE_MBSTATE_T=1 ;; | |
23473 | esac | |
23474 | else | |
23475 | REPLACE_MBSTATE_T=1 | |
23476 | fi | |
8690e634 | 23477 | |
8690e634 | 23478 | |
8690e634 | 23479 | |
6ec2e0f5 SDJ |
23480 | if test $ac_cv_func_mbsinit = no; then |
23481 | HAVE_MBSINIT=0 | |
23482 | ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" " | |
23483 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
23484 | <wchar.h>. | |
23485 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
23486 | included before <wchar.h>. */ | |
23487 | #include <stddef.h> | |
23488 | #include <stdio.h> | |
23489 | #include <time.h> | |
23490 | #include <wchar.h> | |
8690e634 | 23491 | |
6ec2e0f5 | 23492 | " |
d0ac1c44 | 23493 | if test "x$ac_cv_have_decl_mbsinit" = xyes; then : |
6ec2e0f5 SDJ |
23494 | ac_have_decl=1 |
23495 | else | |
23496 | ac_have_decl=0 | |
23497 | fi | |
4a626d0a | 23498 | |
6ec2e0f5 SDJ |
23499 | cat >>confdefs.h <<_ACEOF |
23500 | #define HAVE_DECL_MBSINIT $ac_have_decl | |
23501 | _ACEOF | |
49e4877c | 23502 | |
6ec2e0f5 SDJ |
23503 | if test $ac_cv_have_decl_mbsinit = yes; then |
23504 | REPLACE_MBSINIT=1 | |
23505 | fi | |
23506 | else | |
23507 | if test $REPLACE_MBSTATE_T = 1; then | |
23508 | REPLACE_MBSINIT=1 | |
23509 | else | |
23510 | case "$host_os" in | |
23511 | mingw*) REPLACE_MBSINIT=1 ;; | |
8690e634 | 23512 | esac |
c971b7fa PA |
23513 | fi |
23514 | fi | |
23515 | ||
6ec2e0f5 | 23516 | if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then |
c971b7fa | 23517 | |
c971b7fa | 23518 | |
c971b7fa PA |
23519 | |
23520 | ||
23521 | ||
23522 | ||
23523 | ||
23524 | ||
6ec2e0f5 | 23525 | gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext" |
8690e634 JK |
23526 | |
23527 | ||
23528 | : | |
c971b7fa | 23529 | |
a512b375 | 23530 | fi |
c971b7fa | 23531 | |
8690e634 JK |
23532 | |
23533 | ||
23534 | ||
23535 | ||
6ec2e0f5 | 23536 | GNULIB_MBSINIT=1 |
8690e634 JK |
23537 | |
23538 | ||
23539 | ||
23540 | ||
8690e634 | 23541 | |
6ec2e0f5 | 23542 | $as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h |
8690e634 JK |
23543 | |
23544 | ||
23545 | ||
23546 | ||
23547 | ||
23548 | ||
23549 | ||
23550 | ||
23551 | ||
23552 | ||
23553 | ||
c971b7fa | 23554 | |
c971b7fa | 23555 | |
5df4cba6 SM |
23556 | |
23557 | if case "$host_os" in | |
23558 | mingw*) true ;; | |
23559 | *) test $ac_cv_func_mbsinit = yes ;; | |
23560 | esac \ | |
23561 | && test $ac_cv_func_mbrtowc = yes; then | |
c971b7fa | 23562 | |
8690e634 JK |
23563 | |
23564 | ||
c0c3707f | 23565 | |
8690e634 JK |
23566 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 |
23567 | $as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } | |
d0ac1c44 | 23568 | if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then : |
8690e634 JK |
23569 | $as_echo_n "(cached) " >&6 |
23570 | else | |
23571 | ||
23572 | case "$host_os" in | |
23573 | # Guess no on AIX and OSF/1. | |
23574 | aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; | |
23575 | # Guess yes otherwise. | |
23576 | *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; | |
23577 | esac | |
23578 | if test $LOCALE_JA != none; then | |
23579 | if test "$cross_compiling" = yes; then : | |
23580 | : | |
c971b7fa PA |
23581 | else |
23582 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23583 | /* end confdefs.h. */ | |
23584 | ||
8690e634 JK |
23585 | #include <locale.h> |
23586 | #include <string.h> | |
23587 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
23588 | <wchar.h>. | |
23589 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
23590 | included before <wchar.h>. */ | |
23591 | #include <stddef.h> | |
23592 | #include <stdio.h> | |
23593 | #include <time.h> | |
23594 | #include <wchar.h> | |
23595 | int main () | |
c971b7fa | 23596 | { |
8690e634 | 23597 | if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) |
c971b7fa | 23598 | { |
8690e634 JK |
23599 | const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ |
23600 | mbstate_t state; | |
23601 | wchar_t wc; | |
23602 | ||
23603 | memset (&state, '\0', sizeof (mbstate_t)); | |
23604 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
23605 | if (mbsinit (&state)) | |
c0c3707f CB |
23606 | return 2; |
23607 | } | |
23608 | return 0; | |
23609 | } | |
23610 | _ACEOF | |
23611 | if ac_fn_c_try_run "$LINENO"; then : | |
23612 | gl_cv_func_mbrtowc_incomplete_state=yes | |
23613 | else | |
23614 | gl_cv_func_mbrtowc_incomplete_state=no | |
23615 | fi | |
23616 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23617 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23618 | fi | |
23619 | ||
23620 | else | |
23621 | if test $LOCALE_FR_UTF8 != none; then | |
23622 | if test "$cross_compiling" = yes; then : | |
23623 | : | |
23624 | else | |
23625 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23626 | /* end confdefs.h. */ | |
23627 | ||
23628 | #include <locale.h> | |
23629 | #include <string.h> | |
23630 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
23631 | <wchar.h>. | |
23632 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
23633 | included before <wchar.h>. */ | |
23634 | #include <stddef.h> | |
23635 | #include <stdio.h> | |
23636 | #include <time.h> | |
23637 | #include <wchar.h> | |
23638 | int main () | |
23639 | { | |
23640 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
23641 | { | |
23642 | const char input[] = "B\303\274\303\237er"; /* "Büßer" */ | |
23643 | mbstate_t state; | |
23644 | wchar_t wc; | |
23645 | ||
23646 | memset (&state, '\0', sizeof (mbstate_t)); | |
23647 | if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) | |
23648 | if (mbsinit (&state)) | |
23649 | return 2; | |
c971b7fa | 23650 | } |
c971b7fa PA |
23651 | return 0; |
23652 | } | |
23653 | _ACEOF | |
23654 | if ac_fn_c_try_run "$LINENO"; then : | |
8690e634 | 23655 | gl_cv_func_mbrtowc_incomplete_state=yes |
c971b7fa | 23656 | else |
8690e634 | 23657 | gl_cv_func_mbrtowc_incomplete_state=no |
c971b7fa PA |
23658 | fi |
23659 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23660 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23661 | fi | |
23662 | ||
c0c3707f | 23663 | fi |
8690e634 | 23664 | fi |
c971b7fa PA |
23665 | |
23666 | fi | |
8690e634 JK |
23667 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 |
23668 | $as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } | |
c971b7fa PA |
23669 | |
23670 | ||
c971b7fa PA |
23671 | |
23672 | ||
8690e634 JK |
23673 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 |
23674 | $as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } | |
d0ac1c44 | 23675 | if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then : |
c971b7fa PA |
23676 | $as_echo_n "(cached) " >&6 |
23677 | else | |
8690e634 JK |
23678 | |
23679 | case "$host_os" in | |
23680 | # Guess no on Solaris 8. | |
23681 | solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; | |
23682 | # Guess yes otherwise. | |
23683 | *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; | |
23684 | esac | |
23685 | if test $LOCALE_ZH_CN != none; then | |
23686 | if test "$cross_compiling" = yes; then : | |
23687 | : | |
23688 | else | |
c971b7fa PA |
23689 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
23690 | /* end confdefs.h. */ | |
8690e634 JK |
23691 | |
23692 | #include <locale.h> | |
23693 | #include <stdlib.h> | |
23694 | #include <string.h> | |
23695 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
23696 | <wchar.h>. | |
23697 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
23698 | included before <wchar.h>. */ | |
c971b7fa | 23699 | #include <stddef.h> |
8690e634 JK |
23700 | #include <stdio.h> |
23701 | #include <time.h> | |
23702 | #include <wchar.h> | |
23703 | int main () | |
c971b7fa | 23704 | { |
8690e634 JK |
23705 | /* This fails on Solaris 8: |
23706 | mbrtowc returns 2, and sets wc to 0x00F0. | |
23707 | mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ | |
23708 | if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) | |
23709 | { | |
23710 | char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ | |
23711 | mbstate_t state; | |
23712 | wchar_t wc; | |
23713 | ||
23714 | memset (&state, '\0', sizeof (mbstate_t)); | |
23715 | if (mbrtowc (&wc, input + 3, 6, &state) != 4 | |
23716 | && mbtowc (&wc, input + 3, 6) == 4) | |
c0c3707f | 23717 | return 2; |
8690e634 | 23718 | } |
c971b7fa PA |
23719 | return 0; |
23720 | } | |
23721 | _ACEOF | |
8690e634 JK |
23722 | if ac_fn_c_try_run "$LINENO"; then : |
23723 | gl_cv_func_mbrtowc_sanitycheck=yes | |
c971b7fa | 23724 | else |
8690e634 | 23725 | gl_cv_func_mbrtowc_sanitycheck=no |
c971b7fa | 23726 | fi |
8690e634 JK |
23727 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
23728 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c971b7fa | 23729 | fi |
c971b7fa | 23730 | |
8690e634 JK |
23731 | fi |
23732 | ||
23733 | fi | |
23734 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5 | |
23735 | $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } | |
c971b7fa | 23736 | |
8690e634 JK |
23737 | REPLACE_MBSTATE_T=0 |
23738 | case "$gl_cv_func_mbrtowc_incomplete_state" in | |
23739 | *yes) ;; | |
23740 | *) REPLACE_MBSTATE_T=1 ;; | |
23741 | esac | |
23742 | case "$gl_cv_func_mbrtowc_sanitycheck" in | |
23743 | *yes) ;; | |
23744 | *) REPLACE_MBSTATE_T=1 ;; | |
23745 | esac | |
23746 | else | |
23747 | REPLACE_MBSTATE_T=1 | |
c971b7fa PA |
23748 | fi |
23749 | ||
c971b7fa | 23750 | |
8690e634 | 23751 | |
6ec2e0f5 SDJ |
23752 | if test $ac_cv_func_mbsrtowcs = no; then |
23753 | HAVE_MBSRTOWCS=0 | |
23754 | ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" " | |
8690e634 JK |
23755 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before |
23756 | <wchar.h>. | |
23757 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
23758 | included before <wchar.h>. */ | |
23759 | #include <stddef.h> | |
23760 | #include <stdio.h> | |
23761 | #include <time.h> | |
23762 | #include <wchar.h> | |
23763 | ||
23764 | " | |
d0ac1c44 | 23765 | if test "x$ac_cv_have_decl_mbsrtowcs" = xyes; then : |
8690e634 JK |
23766 | ac_have_decl=1 |
23767 | else | |
23768 | ac_have_decl=0 | |
c971b7fa | 23769 | fi |
c971b7fa | 23770 | |
8690e634 | 23771 | cat >>confdefs.h <<_ACEOF |
6ec2e0f5 | 23772 | #define HAVE_DECL_MBSRTOWCS $ac_have_decl |
c971b7fa | 23773 | _ACEOF |
c971b7fa | 23774 | |
6ec2e0f5 SDJ |
23775 | if test $ac_cv_have_decl_mbsrtowcs = yes; then |
23776 | REPLACE_MBSRTOWCS=1 | |
8690e634 JK |
23777 | fi |
23778 | else | |
23779 | if test $REPLACE_MBSTATE_T = 1; then | |
6ec2e0f5 | 23780 | REPLACE_MBSRTOWCS=1 |
8690e634 | 23781 | else |
6ec2e0f5 SDJ |
23782 | |
23783 | ||
23784 | ||
23785 | ||
23786 | ||
23787 | ||
23788 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5 | |
23789 | $as_echo_n "checking whether mbsrtowcs works... " >&6; } | |
d0ac1c44 | 23790 | if ${gl_cv_func_mbsrtowcs_works+:} false; then : |
6ec2e0f5 SDJ |
23791 | $as_echo_n "(cached) " >&6 |
23792 | else | |
23793 | ||
23794 | case "$host_os" in | |
23795 | # Guess no on HP-UX, Solaris, mingw. | |
23796 | hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;; | |
23797 | # Guess yes otherwise. | |
23798 | *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; | |
23799 | esac | |
23800 | if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then | |
23801 | if test "$cross_compiling" = yes; then : | |
23802 | : | |
23803 | else | |
23804 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23805 | /* end confdefs.h. */ | |
23806 | ||
23807 | #include <locale.h> | |
23808 | #include <string.h> | |
23809 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | |
23810 | <wchar.h>. | |
23811 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | |
23812 | included before <wchar.h>. */ | |
23813 | #include <stddef.h> | |
23814 | #include <stdio.h> | |
23815 | #include <time.h> | |
23816 | #include <wchar.h> | |
23817 | int main () | |
23818 | { | |
23819 | int result = 0; | |
23820 | /* Test whether the function supports a NULL destination argument. | |
23821 | This fails on native Windows. */ | |
23822 | if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) | |
23823 | { | |
23824 | const char input[] = "\337er"; | |
23825 | const char *src = input; | |
23826 | mbstate_t state; | |
23827 | ||
23828 | memset (&state, '\0', sizeof (mbstate_t)); | |
23829 | if (mbsrtowcs (NULL, &src, 1, &state) != 3 | |
23830 | || src != input) | |
23831 | result |= 1; | |
23832 | } | |
23833 | /* Test whether the function works when started with a conversion state | |
23834 | in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ | |
23835 | if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) | |
23836 | { | |
23837 | const char input[] = "B\303\274\303\237er"; | |
23838 | mbstate_t state; | |
23839 | ||
23840 | memset (&state, '\0', sizeof (mbstate_t)); | |
23841 | if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) | |
23842 | if (!mbsinit (&state)) | |
23843 | { | |
23844 | const char *src = input + 2; | |
23845 | if (mbsrtowcs (NULL, &src, 10, &state) != 4) | |
23846 | result |= 2; | |
23847 | } | |
23848 | } | |
23849 | if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) | |
23850 | { | |
23851 | const char input[] = "<\306\374\313\334\270\354>"; | |
23852 | mbstate_t state; | |
23853 | ||
23854 | memset (&state, '\0', sizeof (mbstate_t)); | |
23855 | if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) | |
23856 | if (!mbsinit (&state)) | |
23857 | { | |
23858 | const char *src = input + 4; | |
23859 | if (mbsrtowcs (NULL, &src, 10, &state) != 3) | |
23860 | result |= 4; | |
23861 | } | |
23862 | } | |
23863 | if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) | |
23864 | { | |
23865 | const char input[] = "B\250\271\201\060\211\070er"; | |
23866 | mbstate_t state; | |
23867 | ||
23868 | memset (&state, '\0', sizeof (mbstate_t)); | |
23869 | if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) | |
23870 | if (!mbsinit (&state)) | |
23871 | { | |
23872 | const char *src = input + 2; | |
23873 | if (mbsrtowcs (NULL, &src, 10, &state) != 4) | |
23874 | result |= 8; | |
23875 | } | |
23876 | } | |
23877 | return result; | |
23878 | } | |
23879 | _ACEOF | |
23880 | if ac_fn_c_try_run "$LINENO"; then : | |
23881 | gl_cv_func_mbsrtowcs_works=yes | |
23882 | else | |
23883 | gl_cv_func_mbsrtowcs_works=no | |
23884 | fi | |
23885 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
23886 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
23887 | fi | |
23888 | ||
23889 | fi | |
23890 | ||
23891 | fi | |
23892 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5 | |
23893 | $as_echo "$gl_cv_func_mbsrtowcs_works" >&6; } | |
23894 | ||
23895 | case "$gl_cv_func_mbsrtowcs_works" in | |
23896 | *yes) ;; | |
23897 | *) REPLACE_MBSRTOWCS=1 ;; | |
8690e634 JK |
23898 | esac |
23899 | fi | |
23900 | fi | |
c971b7fa | 23901 | |
6ec2e0f5 | 23902 | if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then |
c971b7fa PA |
23903 | |
23904 | ||
23905 | ||
23906 | ||
23907 | ||
23908 | ||
23909 | ||
23910 | ||
6ec2e0f5 SDJ |
23911 | gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext" |
23912 | ||
23913 | ||
23914 | ||
23915 | ||
23916 | ||
23917 | ||
23918 | ||
23919 | ||
23920 | ||
23921 | gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext" | |
c971b7fa PA |
23922 | |
23923 | ||
8690e634 | 23924 | : |
c971b7fa | 23925 | |
a512b375 | 23926 | fi |
c971b7fa | 23927 | |
c971b7fa | 23928 | |
c971b7fa | 23929 | |
c971b7fa PA |
23930 | |
23931 | ||
6ec2e0f5 | 23932 | GNULIB_MBSRTOWCS=1 |
c971b7fa | 23933 | |
c971b7fa PA |
23934 | |
23935 | ||
23936 | ||
23937 | ||
6ec2e0f5 | 23938 | $as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h |
c971b7fa PA |
23939 | |
23940 | ||
c971b7fa | 23941 | |
c971b7fa | 23942 | |
6ec2e0f5 | 23943 | if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then |
c971b7fa PA |
23944 | |
23945 | ||
23946 | ||
c971b7fa | 23947 | |
c971b7fa PA |
23948 | |
23949 | ||
23950 | ||
23951 | ||
6ec2e0f5 | 23952 | gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext" |
8690e634 | 23953 | |
c971b7fa | 23954 | |
6ec2e0f5 SDJ |
23955 | for ac_header in bp-sym.h |
23956 | do : | |
23957 | ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default" | |
d0ac1c44 | 23958 | if test "x$ac_cv_header_bp_sym_h" = xyes; then : |
6ec2e0f5 SDJ |
23959 | cat >>confdefs.h <<_ACEOF |
23960 | #define HAVE_BP_SYM_H 1 | |
23961 | _ACEOF | |
c971b7fa | 23962 | |
6ec2e0f5 | 23963 | fi |
c971b7fa | 23964 | |
6ec2e0f5 SDJ |
23965 | done |
23966 | ||
23967 | ||
23968 | fi | |
23969 | ||
23970 | ||
23971 | ||
23972 | ||
23973 | ||
23974 | GNULIB_MEMCHR=1 | |
23975 | ||
23976 | ||
23977 | ||
23978 | ||
23979 | ||
23980 | $as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h | |
23981 | ||
23982 | ||
23983 | ||
23984 | ||
23985 | ||
23986 | if test $HAVE_DECL_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then | |
23987 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works in linear time" >&5 | |
23988 | $as_echo_n "checking whether memmem works in linear time... " >&6; } | |
d0ac1c44 | 23989 | if ${gl_cv_func_memmem_works_fast+:} false; then : |
8690e634 JK |
23990 | $as_echo_n "(cached) " >&6 |
23991 | else | |
6ec2e0f5 SDJ |
23992 | if test "$cross_compiling" = yes; then : |
23993 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
23994 | /* end confdefs.h. */ | |
23995 | ||
23996 | #include <features.h> | |
23997 | #ifdef __GNU_LIBRARY__ | |
23998 | #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)) \ | |
23999 | && !defined __UCLIBC__ | |
24000 | Lucky user | |
24001 | #endif | |
24002 | #endif | |
24003 | #ifdef __CYGWIN__ | |
24004 | #include <cygwin/version.h> | |
24005 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 0) | |
24006 | Lucky user | |
24007 | #endif | |
24008 | #endif | |
24009 | ||
24010 | _ACEOF | |
24011 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
24012 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
24013 | gl_cv_func_memmem_works_fast="guessing yes" | |
24014 | else | |
c0c3707f | 24015 | gl_cv_func_memmem_works_fast="$gl_cross_guess_normal" |
6ec2e0f5 SDJ |
24016 | fi |
24017 | rm -f conftest* | |
24018 | ||
c971b7fa | 24019 | |
8690e634 JK |
24020 | else |
24021 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c971b7fa | 24022 | /* end confdefs.h. */ |
c971b7fa | 24023 | |
6ec2e0f5 SDJ |
24024 | #include <signal.h> /* for signal */ |
24025 | #include <string.h> /* for memmem */ | |
24026 | #include <stdlib.h> /* for malloc */ | |
24027 | #include <unistd.h> /* for alarm */ | |
24028 | static void quit (int sig) { _exit (sig + 128); } | |
24029 | ||
24030 | int | |
24031 | main () | |
8690e634 | 24032 | { |
8690e634 | 24033 | |
6ec2e0f5 SDJ |
24034 | int result = 0; |
24035 | size_t m = 1000000; | |
24036 | char *haystack = (char *) malloc (2 * m + 1); | |
24037 | char *needle = (char *) malloc (m + 1); | |
24038 | /* Failure to compile this test due to missing alarm is okay, | |
24039 | since all such platforms (mingw) also lack memmem. */ | |
24040 | signal (SIGALRM, quit); | |
24041 | alarm (5); | |
24042 | /* Check for quadratic performance. */ | |
24043 | if (haystack && needle) | |
24044 | { | |
24045 | memset (haystack, 'A', 2 * m); | |
24046 | haystack[2 * m] = 'B'; | |
24047 | memset (needle, 'A', m); | |
24048 | needle[m] = 'B'; | |
24049 | if (!memmem (haystack, 2 * m + 1, needle, m + 1)) | |
24050 | result |= 1; | |
24051 | } | |
c0c3707f CB |
24052 | /* Free allocated memory, in case some sanitizer is watching. */ |
24053 | free (haystack); | |
24054 | free (needle); | |
6ec2e0f5 SDJ |
24055 | return result; |
24056 | ||
24057 | ; | |
c971b7fa PA |
24058 | return 0; |
24059 | } | |
24060 | _ACEOF | |
8690e634 | 24061 | if ac_fn_c_try_run "$LINENO"; then : |
6ec2e0f5 | 24062 | gl_cv_func_memmem_works_fast=yes |
8690e634 | 24063 | else |
6ec2e0f5 | 24064 | gl_cv_func_memmem_works_fast=no |
8690e634 JK |
24065 | fi |
24066 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24067 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c971b7fa | 24068 | fi |
c971b7fa PA |
24069 | |
24070 | ||
8690e634 | 24071 | fi |
6ec2e0f5 SDJ |
24072 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_fast" >&5 |
24073 | $as_echo "$gl_cv_func_memmem_works_fast" >&6; } | |
24074 | case "$gl_cv_func_memmem_works_fast" in | |
24075 | *yes) ;; | |
24076 | *) | |
24077 | REPLACE_MEMMEM=1 | |
24078 | ;; | |
24079 | esac | |
24080 | fi | |
c971b7fa | 24081 | |
6ec2e0f5 | 24082 | if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then |
8690e634 JK |
24083 | |
24084 | ||
24085 | ||
6ec2e0f5 SDJ |
24086 | |
24087 | ||
24088 | ||
24089 | ||
24090 | ||
24091 | gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext" | |
24092 | ||
24093 | fi | |
24094 | ||
24095 | ||
24096 | ||
24097 | ||
24098 | for ac_func in memmem | |
24099 | do : | |
24100 | ac_fn_c_check_func "$LINENO" "memmem" "ac_cv_func_memmem" | |
d0ac1c44 | 24101 | if test "x$ac_cv_func_memmem" = xyes; then : |
6ec2e0f5 SDJ |
24102 | cat >>confdefs.h <<_ACEOF |
24103 | #define HAVE_MEMMEM 1 | |
24104 | _ACEOF | |
24105 | ||
24106 | fi | |
24107 | done | |
24108 | ||
24109 | if test $ac_cv_func_memmem = yes; then | |
24110 | HAVE_MEMMEM=1 | |
24111 | else | |
24112 | HAVE_MEMMEM=0 | |
24113 | fi | |
24114 | ||
24115 | if test $ac_cv_have_decl_memmem = no; then | |
24116 | HAVE_DECL_MEMMEM=0 | |
24117 | else | |
24118 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memmem works" >&5 | |
24119 | $as_echo_n "checking whether memmem works... " >&6; } | |
d0ac1c44 | 24120 | if ${gl_cv_func_memmem_works_always+:} false; then : |
c971b7fa PA |
24121 | $as_echo_n "(cached) " >&6 |
24122 | else | |
6ec2e0f5 SDJ |
24123 | if test "$cross_compiling" = yes; then : |
24124 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24125 | /* end confdefs.h. */ | |
24126 | ||
24127 | #ifdef __GNU_LIBRARY__ | |
24128 | #include <features.h> | |
24129 | #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \ | |
24130 | || __GLIBC_MINOR__ > 12)) \ | |
24131 | || (__GLIBC__ > 2)) \ | |
24132 | || defined __UCLIBC__ | |
24133 | Lucky user | |
24134 | #endif | |
24135 | #elif defined __CYGWIN__ | |
24136 | #include <cygwin/version.h> | |
24137 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) | |
24138 | Lucky user | |
24139 | #endif | |
24140 | #else | |
24141 | Lucky user | |
24142 | #endif | |
24143 | ||
24144 | _ACEOF | |
24145 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
24146 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
24147 | gl_cv_func_memmem_works_always="guessing yes" | |
24148 | else | |
c0c3707f | 24149 | gl_cv_func_memmem_works_always="$gl_cross_guess_normal" |
6ec2e0f5 SDJ |
24150 | fi |
24151 | rm -f conftest* | |
24152 | ||
8690e634 | 24153 | |
8690e634 | 24154 | else |
c971b7fa PA |
24155 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
24156 | /* end confdefs.h. */ | |
c971b7fa | 24157 | |
6ec2e0f5 SDJ |
24158 | #include <string.h> /* for memmem */ |
24159 | #define P "_EF_BF_BD" | |
24160 | #define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P | |
24161 | #define NEEDLE P P P P P | |
24162 | ||
24163 | int | |
24164 | main () | |
c971b7fa | 24165 | { |
8690e634 | 24166 | |
6ec2e0f5 SDJ |
24167 | int result = 0; |
24168 | if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE))) | |
24169 | result |= 1; | |
24170 | /* Check for empty needle behavior. */ | |
24171 | { | |
24172 | const char *haystack = "AAA"; | |
24173 | if (memmem (haystack, 3, NULL, 0) != haystack) | |
24174 | result |= 2; | |
8690e634 | 24175 | } |
6ec2e0f5 SDJ |
24176 | return result; |
24177 | ||
24178 | ; | |
c971b7fa PA |
24179 | return 0; |
24180 | } | |
24181 | _ACEOF | |
8690e634 | 24182 | if ac_fn_c_try_run "$LINENO"; then : |
6ec2e0f5 | 24183 | gl_cv_func_memmem_works_always=yes |
c971b7fa | 24184 | else |
6ec2e0f5 | 24185 | gl_cv_func_memmem_works_always=no |
c971b7fa | 24186 | fi |
8690e634 JK |
24187 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ |
24188 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
c971b7fa | 24189 | fi |
8690e634 | 24190 | |
8690e634 JK |
24191 | |
24192 | fi | |
6ec2e0f5 SDJ |
24193 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memmem_works_always" >&5 |
24194 | $as_echo "$gl_cv_func_memmem_works_always" >&6; } | |
24195 | case "$gl_cv_func_memmem_works_always" in | |
8690e634 | 24196 | *yes) ;; |
6ec2e0f5 SDJ |
24197 | *) |
24198 | REPLACE_MEMMEM=1 | |
24199 | ;; | |
8690e634 | 24200 | esac |
c971b7fa | 24201 | fi |
6ec2e0f5 | 24202 | : |
c971b7fa | 24203 | |
6ec2e0f5 | 24204 | if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then |
c971b7fa | 24205 | |
c971b7fa | 24206 | |
8690e634 | 24207 | |
c971b7fa | 24208 | |
6ec2e0f5 SDJ |
24209 | |
24210 | ||
24211 | ||
24212 | ||
24213 | gl_LIBOBJS="$gl_LIBOBJS memmem.$ac_objext" | |
24214 | ||
24215 | fi | |
24216 | ||
24217 | ||
24218 | ||
24219 | ||
24220 | ||
24221 | GNULIB_MEMMEM=1 | |
24222 | ||
24223 | ||
24224 | ||
24225 | ||
24226 | ||
24227 | $as_echo "#define GNULIB_TEST_MEMMEM 1" >>confdefs.h | |
24228 | ||
24229 | ||
24230 | ||
24231 | ||
24232 | ||
24233 | ||
24234 | ||
24235 | ||
24236 | ||
24237 | for ac_func in mempcpy | |
24238 | do : | |
24239 | ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy" | |
d0ac1c44 | 24240 | if test "x$ac_cv_func_mempcpy" = xyes; then : |
6ec2e0f5 SDJ |
24241 | cat >>confdefs.h <<_ACEOF |
24242 | #define HAVE_MEMPCPY 1 | |
8690e634 | 24243 | _ACEOF |
c971b7fa | 24244 | |
6ec2e0f5 SDJ |
24245 | fi |
24246 | done | |
c971b7fa | 24247 | |
6ec2e0f5 SDJ |
24248 | if test $ac_cv_func_mempcpy = no; then |
24249 | HAVE_MEMPCPY=0 | |
24250 | fi | |
8690e634 | 24251 | |
6ec2e0f5 | 24252 | if test $HAVE_MEMPCPY = 0; then |
8690e634 JK |
24253 | |
24254 | ||
24255 | ||
24256 | ||
8690e634 | 24257 | |
6ec2e0f5 SDJ |
24258 | |
24259 | ||
24260 | ||
24261 | gl_LIBOBJS="$gl_LIBOBJS mempcpy.$ac_objext" | |
24262 | ||
24263 | ||
8690e634 | 24264 | : |
c971b7fa | 24265 | |
6ec2e0f5 | 24266 | fi |
c971b7fa | 24267 | |
8690e634 | 24268 | |
8690e634 | 24269 | |
8690e634 | 24270 | |
6ec2e0f5 SDJ |
24271 | |
24272 | GNULIB_MEMPCPY=1 | |
24273 | ||
24274 | ||
24275 | ||
24276 | ||
24277 | ||
24278 | $as_echo "#define GNULIB_TEST_MEMPCPY 1" >>confdefs.h | |
24279 | ||
24280 | ||
24281 | ||
24282 | ||
24283 | ||
24284 | ||
24285 | ||
24286 | ||
24287 | if test $ac_cv_have_decl_memrchr = no; then | |
24288 | HAVE_DECL_MEMRCHR=0 | |
24289 | fi | |
24290 | ||
24291 | for ac_func in memrchr | |
24292 | do : | |
24293 | ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr" | |
d0ac1c44 | 24294 | if test "x$ac_cv_func_memrchr" = xyes; then : |
6ec2e0f5 SDJ |
24295 | cat >>confdefs.h <<_ACEOF |
24296 | #define HAVE_MEMRCHR 1 | |
c971b7fa | 24297 | _ACEOF |
6ec2e0f5 | 24298 | |
c971b7fa | 24299 | fi |
6ec2e0f5 | 24300 | done |
8690e634 | 24301 | |
8690e634 | 24302 | |
6ec2e0f5 | 24303 | if test $ac_cv_func_memrchr = no; then |
8690e634 | 24304 | |
6ec2e0f5 SDJ |
24305 | |
24306 | ||
24307 | ||
24308 | ||
24309 | ||
24310 | ||
24311 | ||
24312 | gl_LIBOBJS="$gl_LIBOBJS memrchr.$ac_objext" | |
24313 | ||
24314 | : | |
c971b7fa PA |
24315 | fi |
24316 | ||
24317 | ||
c971b7fa | 24318 | |
c971b7fa | 24319 | |
c971b7fa | 24320 | |
6ec2e0f5 SDJ |
24321 | GNULIB_MEMRCHR=1 |
24322 | ||
24323 | ||
24324 | ||
24325 | ||
24326 | ||
24327 | $as_echo "#define GNULIB_TEST_MEMRCHR 1" >>confdefs.h | |
24328 | ||
24329 | ||
24330 | ||
24331 | ||
2d8adcbd | 24332 | |
8a99096f SM |
24333 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing slash" >&5 |
24334 | $as_echo_n "checking whether mkdir handles trailing slash... " >&6; } | |
24335 | if ${gl_cv_func_mkdir_trailing_slash_works+:} false; then : | |
24336 | $as_echo_n "(cached) " >&6 | |
24337 | else | |
24338 | rm -rf conftest.dir | |
24339 | if test "$cross_compiling" = yes; then : | |
24340 | case "$host_os" in | |
c0c3707f CB |
24341 | # Guess yes on Linux systems. |
24342 | linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; | |
24343 | # Guess yes on glibc systems. | |
24344 | *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; | |
24345 | # Guess yes on MSVC, no on mingw. | |
24346 | mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24347 | /* end confdefs.h. */ | |
24348 | ||
24349 | #ifdef _MSC_VER | |
24350 | Known | |
24351 | #endif | |
24352 | ||
24353 | _ACEOF | |
24354 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
24355 | $EGREP "Known" >/dev/null 2>&1; then : | |
24356 | gl_cv_func_mkdir_trailing_slash_works="guessing yes" | |
24357 | else | |
24358 | gl_cv_func_mkdir_trailing_slash_works="guessing no" | |
24359 | fi | |
24360 | rm -f conftest* | |
24361 | ||
24362 | ;; | |
24363 | # If we don't know, obey --enable-cross-guesses. | |
24364 | *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;; | |
8a99096f SM |
24365 | esac |
24366 | ||
24367 | else | |
24368 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24369 | /* end confdefs.h. */ | |
24370 | ||
24371 | # include <sys/types.h> | |
24372 | # include <sys/stat.h> | |
24373 | ||
24374 | int | |
24375 | main () | |
24376 | { | |
24377 | return mkdir ("conftest.dir/", 0700); | |
24378 | ; | |
24379 | return 0; | |
24380 | } | |
24381 | _ACEOF | |
24382 | if ac_fn_c_try_run "$LINENO"; then : | |
24383 | gl_cv_func_mkdir_trailing_slash_works=yes | |
24384 | else | |
24385 | gl_cv_func_mkdir_trailing_slash_works=no | |
24386 | fi | |
24387 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24388 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24389 | fi | |
24390 | ||
24391 | rm -rf conftest.dir | |
24392 | ||
24393 | ||
24394 | fi | |
24395 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_slash_works" >&5 | |
24396 | $as_echo "$gl_cv_func_mkdir_trailing_slash_works" >&6; } | |
24397 | case "$gl_cv_func_mkdir_trailing_slash_works" in | |
24398 | *yes) ;; | |
24399 | *) | |
24400 | REPLACE_MKDIR=1 | |
24401 | ;; | |
24402 | esac | |
24403 | ||
24404 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing dot" >&5 | |
24405 | $as_echo_n "checking whether mkdir handles trailing dot... " >&6; } | |
24406 | if ${gl_cv_func_mkdir_trailing_dot_works+:} false; then : | |
24407 | $as_echo_n "(cached) " >&6 | |
24408 | else | |
24409 | rm -rf conftest.dir | |
24410 | if test "$cross_compiling" = yes; then : | |
24411 | case "$host_os" in | |
c0c3707f CB |
24412 | # Guess yes on glibc systems. |
24413 | *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;; | |
24414 | # Guess yes on musl systems. | |
24415 | *-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;; | |
24416 | # Guess no on native Windows. | |
24417 | mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;; | |
24418 | # If we don't know, obey --enable-cross-guesses. | |
24419 | *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;; | |
8a99096f SM |
24420 | esac |
24421 | ||
24422 | else | |
24423 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24424 | /* end confdefs.h. */ | |
24425 | ||
24426 | # include <sys/types.h> | |
24427 | # include <sys/stat.h> | |
24428 | ||
24429 | int | |
24430 | main () | |
24431 | { | |
24432 | return !mkdir ("conftest.dir/./", 0700); | |
24433 | ; | |
24434 | return 0; | |
24435 | } | |
24436 | _ACEOF | |
24437 | if ac_fn_c_try_run "$LINENO"; then : | |
24438 | gl_cv_func_mkdir_trailing_dot_works=yes | |
24439 | else | |
24440 | gl_cv_func_mkdir_trailing_dot_works=no | |
24441 | fi | |
24442 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24443 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24444 | fi | |
24445 | ||
24446 | rm -rf conftest.dir | |
24447 | ||
24448 | ||
24449 | fi | |
24450 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_dot_works" >&5 | |
24451 | $as_echo "$gl_cv_func_mkdir_trailing_dot_works" >&6; } | |
24452 | case "$gl_cv_func_mkdir_trailing_dot_works" in | |
24453 | *yes) ;; | |
24454 | *) | |
24455 | REPLACE_MKDIR=1 | |
24456 | ||
24457 | $as_echo "#define FUNC_MKDIR_DOT_BUG 1" >>confdefs.h | |
24458 | ||
24459 | ;; | |
24460 | esac | |
24461 | ||
24462 | if test $REPLACE_MKDIR = 1; then | |
24463 | ||
24464 | ||
24465 | ||
24466 | ||
24467 | ||
24468 | ||
24469 | ||
24470 | ||
24471 | gl_LIBOBJS="$gl_LIBOBJS mkdir.$ac_objext" | |
24472 | ||
24473 | fi | |
24474 | ||
24475 | ||
e8d8cce6 SM |
24476 | for ac_func in mkdtemp |
24477 | do : | |
24478 | ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp" | |
24479 | if test "x$ac_cv_func_mkdtemp" = xyes; then : | |
24480 | cat >>confdefs.h <<_ACEOF | |
24481 | #define HAVE_MKDTEMP 1 | |
24482 | _ACEOF | |
24483 | ||
24484 | fi | |
24485 | done | |
24486 | ||
24487 | if test $ac_cv_func_mkdtemp = no; then | |
24488 | HAVE_MKDTEMP=0 | |
24489 | fi | |
24490 | ||
24491 | if test $HAVE_MKDTEMP = 0; then | |
24492 | ||
24493 | ||
24494 | ||
24495 | ||
24496 | ||
24497 | ||
24498 | ||
24499 | ||
24500 | gl_LIBOBJS="$gl_LIBOBJS mkdtemp.$ac_objext" | |
24501 | ||
24502 | : | |
24503 | ||
24504 | fi | |
24505 | ||
24506 | ||
24507 | ||
24508 | ||
24509 | ||
24510 | GNULIB_MKDTEMP=1 | |
24511 | ||
24512 | ||
24513 | ||
24514 | ||
24515 | ||
24516 | $as_echo "#define GNULIB_TEST_MKDTEMP 1" >>confdefs.h | |
24517 | ||
24518 | ||
24519 | ||
24520 | ||
24521 | ||
2d8adcbd MM |
24522 | |
24523 | ||
b3279b60 TT |
24524 | |
24525 | ||
b3279b60 TT |
24526 | if test $ac_cv_func_mkostemp != yes; then |
24527 | HAVE_MKOSTEMP=0 | |
24528 | fi | |
2d8adcbd | 24529 | |
b3279b60 | 24530 | if test $HAVE_MKOSTEMP = 0; then |
2d8adcbd | 24531 | |
2d8adcbd | 24532 | |
2d8adcbd | 24533 | |
2d8adcbd | 24534 | |
2d8adcbd MM |
24535 | |
24536 | ||
24537 | ||
24538 | ||
b3279b60 | 24539 | gl_LIBOBJS="$gl_LIBOBJS mkostemp.$ac_objext" |
2d8adcbd MM |
24540 | |
24541 | ||
24542 | ||
b3279b60 | 24543 | fi |
2d8adcbd | 24544 | |
2d8adcbd | 24545 | |
b3279b60 TT |
24546 | cat >>confdefs.h <<_ACEOF |
24547 | #define GNULIB_MKOSTEMP 1 | |
24548 | _ACEOF | |
2d8adcbd MM |
24549 | |
24550 | ||
2d8adcbd MM |
24551 | |
24552 | ||
24553 | ||
24554 | ||
24555 | ||
b3279b60 | 24556 | GNULIB_MKOSTEMP=1 |
2d8adcbd MM |
24557 | |
24558 | ||
24559 | ||
24560 | ||
24561 | ||
b3279b60 | 24562 | $as_echo "#define GNULIB_TEST_MKOSTEMP 1" >>confdefs.h |
2d8adcbd MM |
24563 | |
24564 | ||
24565 | ||
24566 | ||
6ec2e0f5 SDJ |
24567 | if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then |
24568 | ||
24569 | ||
24570 | ||
c971b7fa | 24571 | |
c971b7fa | 24572 | |
c971b7fa PA |
24573 | |
24574 | ||
8690e634 | 24575 | |
6ec2e0f5 | 24576 | gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext" |
8690e634 | 24577 | |
6ec2e0f5 | 24578 | fi |
8690e634 | 24579 | |
6ec2e0f5 | 24580 | if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then |
8690e634 JK |
24581 | |
24582 | ||
24583 | ||
24584 | ||
24585 | ||
24586 | ||
8690e634 JK |
24587 | |
24588 | ||
6ec2e0f5 | 24589 | gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext" |
8690e634 | 24590 | |
a512b375 | 24591 | fi |
8690e634 JK |
24592 | |
24593 | ||
c0c3707f CB |
24594 | cat >>confdefs.h <<_ACEOF |
24595 | #define GNULIB_MSVC_NOTHROW 1 | |
24596 | _ACEOF | |
24597 | ||
24598 | ||
24599 | ||
24600 | ||
725e2999 JB |
24601 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5 |
24602 | $as_echo_n "checking whether <netinet/in.h> is self-contained... " >&6; } | |
24603 | if ${gl_cv_header_netinet_in_h_selfcontained+:} false; then : | |
24604 | $as_echo_n "(cached) " >&6 | |
24605 | else | |
24606 | ||
24607 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24608 | /* end confdefs.h. */ | |
24609 | #include <netinet/in.h> | |
24610 | int | |
24611 | main () | |
24612 | { | |
24613 | ||
24614 | ; | |
24615 | return 0; | |
24616 | } | |
24617 | _ACEOF | |
24618 | if ac_fn_c_try_compile "$LINENO"; then : | |
24619 | gl_cv_header_netinet_in_h_selfcontained=yes | |
24620 | else | |
24621 | gl_cv_header_netinet_in_h_selfcontained=no | |
24622 | fi | |
24623 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
24624 | ||
24625 | fi | |
24626 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5 | |
24627 | $as_echo "$gl_cv_header_netinet_in_h_selfcontained" >&6; } | |
24628 | if test $gl_cv_header_netinet_in_h_selfcontained = yes; then | |
24629 | NETINET_IN_H='' | |
24630 | else | |
24631 | NETINET_IN_H='netinet/in.h' | |
24632 | for ac_header in netinet/in.h | |
24633 | do : | |
24634 | ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" | |
24635 | if test "x$ac_cv_header_netinet_in_h" = xyes; then : | |
24636 | cat >>confdefs.h <<_ACEOF | |
24637 | #define HAVE_NETINET_IN_H 1 | |
24638 | _ACEOF | |
24639 | ||
24640 | fi | |
24641 | ||
24642 | done | |
24643 | ||
24644 | ||
24645 | ||
24646 | ||
24647 | ||
24648 | ||
24649 | ||
725e2999 JB |
24650 | |
24651 | ||
24652 | ||
24653 | if test $gl_cv_have_include_next = yes; then | |
24654 | gl_cv_next_netinet_in_h='<'netinet/in.h'>' | |
24655 | else | |
24656 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5 | |
24657 | $as_echo_n "checking absolute name of <netinet/in.h>... " >&6; } | |
24658 | if ${gl_cv_next_netinet_in_h+:} false; then : | |
24659 | $as_echo_n "(cached) " >&6 | |
24660 | else | |
24661 | ||
24662 | if test $ac_cv_header_netinet_in_h = yes; then | |
24663 | ||
24664 | ||
24665 | ||
24666 | ||
24667 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24668 | /* end confdefs.h. */ | |
24669 | #include <netinet/in.h> | |
24670 | _ACEOF | |
24671 | case "$host_os" in | |
24672 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
24673 | *) gl_absname_cpp="$ac_cpp" ;; | |
24674 | esac | |
24675 | ||
24676 | case "$host_os" in | |
24677 | mingw*) | |
24678 | gl_dirsep_regex='[/\\]' | |
24679 | ;; | |
24680 | *) | |
24681 | gl_dirsep_regex='\/' | |
24682 | ;; | |
24683 | esac | |
24684 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
24685 | gl_header_literal_regex=`echo 'netinet/in.h' \ | |
24686 | | sed -e "$gl_make_literal_regex_sed"` | |
24687 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
24688 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
24689 | s|^/[^/]|//&| | |
24690 | p | |
24691 | q | |
24692 | }' | |
24693 | ||
24694 | gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
24695 | sed -n "$gl_absolute_header_sed"` | |
24696 | ||
24697 | gl_header=$gl_cv_absolute_netinet_in_h | |
24698 | gl_cv_next_netinet_in_h='"'$gl_header'"' | |
24699 | else | |
24700 | gl_cv_next_netinet_in_h='<'netinet/in.h'>' | |
24701 | fi | |
24702 | ||
24703 | ||
24704 | fi | |
24705 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5 | |
24706 | $as_echo "$gl_cv_next_netinet_in_h" >&6; } | |
24707 | fi | |
24708 | NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h | |
24709 | ||
24710 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
24711 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
24712 | gl_next_as_first_directive='<'netinet/in.h'>' | |
24713 | else | |
24714 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
24715 | gl_next_as_first_directive=$gl_cv_next_netinet_in_h | |
24716 | fi | |
24717 | NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive | |
24718 | ||
24719 | ||
24720 | ||
24721 | ||
24722 | if test $ac_cv_header_netinet_in_h = yes; then | |
24723 | HAVE_NETINET_IN_H=1 | |
24724 | else | |
24725 | HAVE_NETINET_IN_H=0 | |
24726 | fi | |
24727 | ||
24728 | fi | |
24729 | ||
24730 | if test -n "$NETINET_IN_H"; then | |
24731 | GL_GENERATE_NETINET_IN_H_TRUE= | |
24732 | GL_GENERATE_NETINET_IN_H_FALSE='#' | |
24733 | else | |
24734 | GL_GENERATE_NETINET_IN_H_TRUE='#' | |
24735 | GL_GENERATE_NETINET_IN_H_FALSE= | |
24736 | fi | |
24737 | ||
24738 | ||
24739 | ||
24740 | ||
8690e634 | 24741 | |
c0c3707f | 24742 | |
6ec2e0f5 SDJ |
24743 | case "$host_os" in |
24744 | mingw* | pw*) | |
24745 | REPLACE_OPEN=1 | |
24746 | ;; | |
24747 | *) | |
24748 | ||
c0c3707f CB |
24749 | if test "$gl_cv_macro_O_CLOEXEC" != yes; then |
24750 | REPLACE_OPEN=1 | |
24751 | fi | |
472fa5ee SM |
24752 | |
24753 | ||
c0c3707f | 24754 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5 |
6ec2e0f5 | 24755 | $as_echo_n "checking whether open recognizes a trailing slash... " >&6; } |
d0ac1c44 | 24756 | if ${gl_cv_func_open_slash+:} false; then : |
6ec2e0f5 SDJ |
24757 | $as_echo_n "(cached) " >&6 |
24758 | else | |
24759 | # Assume that if we have lstat, we can also check symlinks. | |
c0c3707f CB |
24760 | if test $ac_cv_func_lstat = yes; then |
24761 | touch conftest.tmp | |
24762 | ln -s conftest.tmp conftest.lnk | |
24763 | fi | |
24764 | if test "$cross_compiling" = yes; then : | |
8690e634 | 24765 | |
c0c3707f CB |
24766 | case "$host_os" in |
24767 | freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) | |
24768 | gl_cv_func_open_slash="guessing no" ;; | |
24769 | *) | |
24770 | gl_cv_func_open_slash="guessing yes" ;; | |
24771 | esac | |
8690e634 | 24772 | |
6ec2e0f5 SDJ |
24773 | else |
24774 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
24775 | /* end confdefs.h. */ | |
24776 | ||
24777 | #include <fcntl.h> | |
24778 | #if HAVE_UNISTD_H | |
24779 | # include <unistd.h> | |
24780 | #endif | |
24781 | int main () | |
24782 | { | |
24783 | int result = 0; | |
24784 | #if HAVE_LSTAT | |
24785 | if (open ("conftest.lnk/", O_RDONLY) != -1) | |
24786 | result |= 1; | |
24787 | #endif | |
24788 | if (open ("conftest.sl/", O_CREAT, 0600) >= 0) | |
24789 | result |= 2; | |
24790 | return result; | |
24791 | } | |
24792 | _ACEOF | |
24793 | if ac_fn_c_try_run "$LINENO"; then : | |
24794 | gl_cv_func_open_slash=yes | |
24795 | else | |
24796 | gl_cv_func_open_slash=no | |
24797 | fi | |
24798 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
24799 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
24800 | fi | |
8690e634 | 24801 | |
c0c3707f | 24802 | rm -f conftest.sl conftest.tmp conftest.lnk |
8690e634 | 24803 | |
6ec2e0f5 SDJ |
24804 | fi |
24805 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5 | |
24806 | $as_echo "$gl_cv_func_open_slash" >&6; } | |
c0c3707f CB |
24807 | case "$gl_cv_func_open_slash" in |
24808 | *no) | |
8690e634 | 24809 | |
6ec2e0f5 | 24810 | $as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h |
8690e634 | 24811 | |
6ec2e0f5 SDJ |
24812 | ;; |
24813 | esac | |
8690e634 | 24814 | |
c0c3707f CB |
24815 | case "$gl_cv_func_open_slash" in |
24816 | *no) | |
24817 | REPLACE_OPEN=1 | |
24818 | ;; | |
24819 | esac | |
24820 | ;; | |
24821 | esac | |
472fa5ee | 24822 | |
c0c3707f | 24823 | if test $REPLACE_OPEN = 0; then |
472fa5ee SM |
24824 | |
24825 | ||
24826 | ||
6ec2e0f5 SDJ |
24827 | if test $ac_cv_func_fchdir = no; then |
24828 | HAVE_FCHDIR=0 | |
24829 | fi | |
c971b7fa | 24830 | |
6ec2e0f5 SDJ |
24831 | if test $HAVE_FCHDIR = 0; then |
24832 | REPLACE_OPEN=1 | |
24833 | fi | |
24834 | fi | |
c971b7fa PA |
24835 | |
24836 | ||
24837 | ||
6ec2e0f5 | 24838 | if test $REPLACE_OPEN = 1; then |
c971b7fa PA |
24839 | |
24840 | ||
24841 | ||
24842 | ||
24843 | ||
c971b7fa PA |
24844 | |
24845 | ||
c971b7fa | 24846 | |
6ec2e0f5 | 24847 | gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" |
c971b7fa | 24848 | |
c971b7fa PA |
24849 | |
24850 | ||
6ec2e0f5 SDJ |
24851 | : |
24852 | ||
a512b375 | 24853 | fi |
c971b7fa PA |
24854 | |
24855 | ||
24856 | ||
24857 | ||
24858 | ||
6ec2e0f5 | 24859 | GNULIB_OPEN=1 |
c971b7fa PA |
24860 | |
24861 | ||
24862 | ||
24863 | ||
24864 | ||
6ec2e0f5 | 24865 | $as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h |
c971b7fa PA |
24866 | |
24867 | ||
24868 | ||
24869 | ||
24870 | ||
c971b7fa | 24871 | |
c971b7fa | 24872 | |
472fa5ee | 24873 | |
63ce7108 | 24874 | |
c0c3707f CB |
24875 | case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in |
24876 | yes+*yes+yes) | |
6ec2e0f5 SDJ |
24877 | ;; |
24878 | yes+*) | |
c0c3707f | 24879 | # Solaris 10 lacks O_CLOEXEC. |
6ec2e0f5 SDJ |
24880 | # Solaris 9 has *at functions, but uniformly mishandles trailing |
24881 | # slash in all of them. | |
24882 | REPLACE_OPENAT=1 | |
24883 | ;; | |
24884 | *) | |
24885 | HAVE_OPENAT=0 | |
24886 | ;; | |
24887 | esac | |
63ce7108 | 24888 | |
6ec2e0f5 | 24889 | if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then |
63ce7108 | 24890 | |
63ce7108 | 24891 | |
63ce7108 | 24892 | |
63ce7108 | 24893 | |
63ce7108 TT |
24894 | |
24895 | ||
63ce7108 | 24896 | |
63ce7108 | 24897 | |
6ec2e0f5 | 24898 | gl_LIBOBJS="$gl_LIBOBJS openat.$ac_objext" |
63ce7108 TT |
24899 | |
24900 | ||
24901 | ||
6ec2e0f5 | 24902 | : |
63ce7108 | 24903 | |
6ec2e0f5 | 24904 | fi |
63ce7108 TT |
24905 | |
24906 | ||
6ec2e0f5 SDJ |
24907 | cat >>confdefs.h <<_ACEOF |
24908 | #define GNULIB_OPENAT 1 | |
24909 | _ACEOF | |
63ce7108 | 24910 | |
63ce7108 | 24911 | |
63ce7108 TT |
24912 | |
24913 | ||
24914 | ||
24915 | ||
6ec2e0f5 | 24916 | GNULIB_OPENAT=1 |
63ce7108 | 24917 | |
63ce7108 | 24918 | |
63ce7108 | 24919 | |
63ce7108 | 24920 | |
63ce7108 | 24921 | |
6ec2e0f5 | 24922 | $as_echo "#define GNULIB_TEST_OPENAT 1" >>confdefs.h |
63ce7108 TT |
24923 | |
24924 | ||
63ce7108 | 24925 | |
63ce7108 | 24926 | |
63ce7108 | 24927 | |
63ce7108 | 24928 | |
6ec2e0f5 SDJ |
24929 | for ac_func in opendir |
24930 | do : | |
24931 | ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir" | |
d0ac1c44 | 24932 | if test "x$ac_cv_func_opendir" = xyes; then : |
6ec2e0f5 SDJ |
24933 | cat >>confdefs.h <<_ACEOF |
24934 | #define HAVE_OPENDIR 1 | |
63ce7108 | 24935 | _ACEOF |
6ec2e0f5 | 24936 | |
63ce7108 | 24937 | fi |
6ec2e0f5 | 24938 | done |
63ce7108 | 24939 | |
6ec2e0f5 SDJ |
24940 | if test $ac_cv_func_opendir = no; then |
24941 | HAVE_OPENDIR=0 | |
24942 | fi | |
63ce7108 | 24943 | |
6ec2e0f5 SDJ |
24944 | |
24945 | ||
24946 | ||
24947 | if test $ac_cv_func_fchdir = no; then | |
24948 | HAVE_FCHDIR=0 | |
63ce7108 | 24949 | fi |
63ce7108 | 24950 | |
6ec2e0f5 SDJ |
24951 | if test $HAVE_FCHDIR = 0; then |
24952 | if test $HAVE_OPENDIR = 1; then | |
24953 | REPLACE_OPENDIR=1 | |
24954 | fi | |
24955 | fi | |
24956 | ||
24957 | case $host_os,$HAVE_OPENDIR in | |
24958 | os2*,1) | |
24959 | REPLACE_OPENDIR=1;; | |
24960 | esac | |
24961 | ||
24962 | if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then | |
63ce7108 TT |
24963 | |
24964 | ||
24965 | ||
24966 | ||
24967 | ||
24968 | ||
24969 | ||
24970 | ||
6ec2e0f5 | 24971 | gl_LIBOBJS="$gl_LIBOBJS opendir.$ac_objext" |
63ce7108 TT |
24972 | |
24973 | fi | |
24974 | ||
24975 | ||
24976 | ||
24977 | ||
24978 | ||
6ec2e0f5 | 24979 | GNULIB_OPENDIR=1 |
63ce7108 TT |
24980 | |
24981 | ||
24982 | ||
24983 | ||
63ce7108 | 24984 | |
6ec2e0f5 | 24985 | $as_echo "#define GNULIB_TEST_OPENDIR 1" >>confdefs.h |
63ce7108 TT |
24986 | |
24987 | ||
24988 | ||
24989 | ||
24990 | ||
24991 | ||
24992 | ||
2196f55f YQ |
24993 | |
24994 | ||
8424cc97 SM |
24995 | |
24996 | for ac_func in rawmemchr | |
24997 | do : | |
24998 | ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr" | |
d0ac1c44 | 24999 | if test "x$ac_cv_func_rawmemchr" = xyes; then : |
8424cc97 SM |
25000 | cat >>confdefs.h <<_ACEOF |
25001 | #define HAVE_RAWMEMCHR 1 | |
25002 | _ACEOF | |
25003 | ||
25004 | fi | |
25005 | done | |
25006 | ||
25007 | if test $ac_cv_func_rawmemchr = no; then | |
25008 | HAVE_RAWMEMCHR=0 | |
25009 | fi | |
25010 | ||
25011 | if test $HAVE_RAWMEMCHR = 0; then | |
25012 | ||
25013 | ||
25014 | ||
25015 | ||
25016 | ||
25017 | ||
25018 | ||
25019 | ||
25020 | gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext" | |
25021 | ||
25022 | : | |
25023 | fi | |
25024 | ||
25025 | ||
25026 | ||
25027 | ||
25028 | ||
25029 | GNULIB_RAWMEMCHR=1 | |
25030 | ||
25031 | ||
25032 | ||
25033 | ||
25034 | ||
25035 | $as_echo "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h | |
25036 | ||
25037 | ||
25038 | ||
25039 | ||
25040 | ||
25041 | ||
6ec2e0f5 SDJ |
25042 | for ac_func in readdir |
25043 | do : | |
25044 | ac_fn_c_check_func "$LINENO" "readdir" "ac_cv_func_readdir" | |
d0ac1c44 | 25045 | if test "x$ac_cv_func_readdir" = xyes; then : |
6ec2e0f5 SDJ |
25046 | cat >>confdefs.h <<_ACEOF |
25047 | #define HAVE_READDIR 1 | |
25048 | _ACEOF | |
25049 | ||
25050 | fi | |
25051 | done | |
25052 | ||
25053 | if test $ac_cv_func_readdir = no; then | |
25054 | HAVE_READDIR=0 | |
25055 | fi | |
25056 | ||
25057 | if test $HAVE_READDIR = 0; then | |
25058 | ||
25059 | ||
25060 | ||
25061 | ||
25062 | ||
25063 | ||
25064 | ||
25065 | ||
25066 | gl_LIBOBJS="$gl_LIBOBJS readdir.$ac_objext" | |
25067 | ||
25068 | fi | |
25069 | ||
25070 | ||
25071 | ||
25072 | ||
25073 | ||
25074 | GNULIB_READDIR=1 | |
25075 | ||
25076 | ||
25077 | ||
25078 | ||
25079 | ||
25080 | $as_echo "#define GNULIB_TEST_READDIR 1" >>confdefs.h | |
25081 | ||
25082 | ||
25083 | ||
25084 | ||
25085 | ||
25086 | ||
2196f55f YQ |
25087 | if test $ac_cv_func_readlink = no; then |
25088 | HAVE_READLINK=0 | |
25089 | else | |
25090 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5 | |
25091 | $as_echo_n "checking whether readlink signature is correct... " >&6; } | |
d0ac1c44 | 25092 | if ${gl_cv_decl_readlink_works+:} false; then : |
2196f55f YQ |
25093 | $as_echo_n "(cached) " >&6 |
25094 | else | |
25095 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25096 | /* end confdefs.h. */ | |
25097 | #include <unistd.h> | |
25098 | /* Cause compilation failure if original declaration has wrong type. */ | |
25099 | ssize_t readlink (const char *, char *, size_t); | |
25100 | int | |
25101 | main () | |
25102 | { | |
25103 | ||
25104 | ; | |
25105 | return 0; | |
25106 | } | |
25107 | _ACEOF | |
25108 | if ac_fn_c_try_compile "$LINENO"; then : | |
25109 | gl_cv_decl_readlink_works=yes | |
25110 | else | |
25111 | gl_cv_decl_readlink_works=no | |
25112 | fi | |
25113 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
25114 | fi | |
25115 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5 | |
25116 | $as_echo "$gl_cv_decl_readlink_works" >&6; } | |
25117 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5 | |
25118 | $as_echo_n "checking whether readlink handles trailing slash correctly... " >&6; } | |
d0ac1c44 | 25119 | if ${gl_cv_func_readlink_works+:} false; then : |
2196f55f YQ |
25120 | $as_echo_n "(cached) " >&6 |
25121 | else | |
25122 | # We have readlink, so assume ln -s works. | |
25123 | ln -s conftest.no-such conftest.link | |
25124 | ln -s conftest.link conftest.lnk2 | |
25125 | if test "$cross_compiling" = yes; then : | |
25126 | case "$host_os" in | |
c0c3707f CB |
25127 | # Guess yes on Linux systems. |
25128 | linux-* | linux) gl_cv_func_readlink_works="guessing yes" ;; | |
25129 | # Guess yes on glibc systems. | |
25130 | *-gnu* | gnu*) gl_cv_func_readlink_works="guessing yes" ;; | |
25131 | # If we don't know, obey --enable-cross-guesses. | |
25132 | *) gl_cv_func_readlink_works="$gl_cross_guess_normal" ;; | |
2196f55f YQ |
25133 | esac |
25134 | ||
25135 | else | |
25136 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25137 | /* end confdefs.h. */ | |
25138 | #include <unistd.h> | |
25139 | ||
25140 | int | |
25141 | main () | |
25142 | { | |
25143 | char buf[20]; | |
25144 | return readlink ("conftest.lnk2/", buf, sizeof buf) != -1; | |
25145 | ; | |
25146 | return 0; | |
25147 | } | |
25148 | _ACEOF | |
25149 | if ac_fn_c_try_run "$LINENO"; then : | |
25150 | gl_cv_func_readlink_works=yes | |
25151 | else | |
25152 | gl_cv_func_readlink_works=no | |
25153 | fi | |
25154 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25155 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25156 | fi | |
25157 | ||
25158 | rm -f conftest.link conftest.lnk2 | |
25159 | fi | |
25160 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5 | |
25161 | $as_echo "$gl_cv_func_readlink_works" >&6; } | |
25162 | case "$gl_cv_func_readlink_works" in | |
25163 | *yes) | |
25164 | if test "$gl_cv_decl_readlink_works" != yes; then | |
25165 | REPLACE_READLINK=1 | |
25166 | fi | |
25167 | ;; | |
25168 | *) | |
25169 | ||
25170 | $as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h | |
25171 | ||
25172 | REPLACE_READLINK=1 | |
25173 | ;; | |
25174 | esac | |
25175 | fi | |
25176 | ||
25177 | if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then | |
25178 | ||
25179 | ||
25180 | ||
25181 | ||
25182 | ||
25183 | ||
25184 | ||
25185 | ||
25186 | gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext" | |
25187 | ||
25188 | ||
25189 | : | |
25190 | ||
25191 | fi | |
25192 | ||
25193 | ||
25194 | ||
25195 | ||
25196 | ||
25197 | GNULIB_READLINK=1 | |
25198 | ||
25199 | ||
25200 | ||
25201 | ||
25202 | ||
25203 | $as_echo "#define GNULIB_TEST_READLINK 1" >>confdefs.h | |
25204 | ||
25205 | ||
25206 | ||
25207 | ||
6a29c58e YQ |
25208 | |
25209 | ||
6ec2e0f5 SDJ |
25210 | if test $gl_cv_func_malloc_posix = yes; then |
25211 | ||
25212 | $as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h | |
25213 | ||
25214 | else | |
25215 | REPLACE_REALLOC=1 | |
25216 | fi | |
25217 | ||
25218 | if test $REPLACE_REALLOC = 1; then | |
25219 | ||
25220 | ||
25221 | ||
25222 | ||
25223 | ||
25224 | ||
25225 | ||
25226 | ||
25227 | gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext" | |
25228 | ||
25229 | fi | |
25230 | ||
25231 | ||
25232 | ||
25233 | ||
25234 | ||
25235 | GNULIB_REALLOC_POSIX=1 | |
25236 | ||
25237 | ||
25238 | ||
25239 | ||
25240 | ||
25241 | $as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h | |
25242 | ||
25243 | ||
25244 | ||
25245 | ||
25246 | ||
25247 | ||
6a29c58e YQ |
25248 | |
25249 | ||
25250 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on destination" >&5 | |
25251 | $as_echo_n "checking whether rename honors trailing slash on destination... " >&6; } | |
d0ac1c44 | 25252 | if ${gl_cv_func_rename_slash_dst_works+:} false; then : |
6a29c58e YQ |
25253 | $as_echo_n "(cached) " >&6 |
25254 | else | |
25255 | rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk | |
25256 | touch conftest.f && touch conftest.f1 && mkdir conftest.d1 || | |
d0ac1c44 | 25257 | as_fn_error $? "cannot create temporary files" "$LINENO" 5 |
6a29c58e YQ |
25258 | # Assume that if we have lstat, we can also check symlinks. |
25259 | if test $ac_cv_func_lstat = yes; then | |
25260 | ln -s conftest.f conftest.lnk | |
25261 | fi | |
25262 | if test "$cross_compiling" = yes; then : | |
25263 | case "$host_os" in | |
c0c3707f CB |
25264 | # Guess yes on Linux systems. |
25265 | linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;; | |
25266 | # Guess yes on glibc systems. | |
25267 | *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;; | |
25268 | # Guess no on native Windows. | |
25269 | mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;; | |
25270 | # If we don't know, obey --enable-cross-guesses. | |
25271 | *) gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;; | |
6a29c58e YQ |
25272 | esac |
25273 | ||
25274 | else | |
25275 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25276 | /* end confdefs.h. */ | |
25277 | ||
25278 | # include <stdio.h> | |
25279 | # include <stdlib.h> | |
25280 | ||
25281 | int | |
25282 | main () | |
25283 | { | |
25284 | int result = 0; | |
25285 | if (rename ("conftest.f1", "conftest.f2/") == 0) | |
25286 | result |= 1; | |
25287 | if (rename ("conftest.d1", "conftest.d2/") != 0) | |
25288 | result |= 2; | |
25289 | #if HAVE_LSTAT | |
25290 | if (rename ("conftest.f", "conftest.lnk/") == 0) | |
25291 | result |= 4; | |
25292 | #endif | |
25293 | return result; | |
25294 | ||
25295 | ; | |
25296 | return 0; | |
25297 | } | |
25298 | _ACEOF | |
25299 | if ac_fn_c_try_run "$LINENO"; then : | |
25300 | gl_cv_func_rename_slash_dst_works=yes | |
25301 | else | |
25302 | gl_cv_func_rename_slash_dst_works=no | |
25303 | fi | |
25304 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25305 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25306 | fi | |
25307 | ||
25308 | rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk | |
25309 | ||
25310 | fi | |
25311 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_dst_works" >&5 | |
25312 | $as_echo "$gl_cv_func_rename_slash_dst_works" >&6; } | |
25313 | case "$gl_cv_func_rename_slash_dst_works" in | |
25314 | *yes) ;; | |
25315 | *) | |
25316 | REPLACE_RENAME=1 | |
25317 | ||
25318 | $as_echo "#define RENAME_TRAILING_SLASH_DEST_BUG 1" >>confdefs.h | |
25319 | ||
25320 | ;; | |
25321 | esac | |
25322 | ||
25323 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on source" >&5 | |
25324 | $as_echo_n "checking whether rename honors trailing slash on source... " >&6; } | |
d0ac1c44 | 25325 | if ${gl_cv_func_rename_slash_src_works+:} false; then : |
6a29c58e YQ |
25326 | $as_echo_n "(cached) " >&6 |
25327 | else | |
25328 | rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk | |
25329 | touch conftest.f && touch conftest.f1 && mkdir conftest.d1 || | |
d0ac1c44 | 25330 | as_fn_error $? "cannot create temporary files" "$LINENO" 5 |
6a29c58e YQ |
25331 | # Assume that if we have lstat, we can also check symlinks. |
25332 | if test $ac_cv_func_lstat = yes; then | |
25333 | ln -s conftest.f conftest.lnk | |
25334 | fi | |
25335 | if test "$cross_compiling" = yes; then : | |
25336 | case "$host_os" in | |
c0c3707f CB |
25337 | # Guess yes on Linux systems. |
25338 | linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;; | |
25339 | # Guess yes on glibc systems. | |
25340 | *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;; | |
25341 | # Guess yes on native Windows. | |
25342 | mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;; | |
25343 | # If we don't know, obey --enable-cross-guesses. | |
25344 | *) gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;; | |
6a29c58e YQ |
25345 | esac |
25346 | ||
25347 | else | |
25348 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25349 | /* end confdefs.h. */ | |
25350 | ||
25351 | # include <stdio.h> | |
25352 | # include <stdlib.h> | |
25353 | ||
25354 | int | |
25355 | main () | |
25356 | { | |
25357 | int result = 0; | |
25358 | if (rename ("conftest.f1/", "conftest.d3") == 0) | |
25359 | result |= 1; | |
25360 | if (rename ("conftest.d1/", "conftest.d2") != 0) | |
25361 | result |= 2; | |
25362 | #if HAVE_LSTAT | |
25363 | if (rename ("conftest.lnk/", "conftest.f") == 0) | |
25364 | result |= 4; | |
25365 | #endif | |
25366 | return result; | |
25367 | ||
25368 | ; | |
25369 | return 0; | |
25370 | } | |
25371 | _ACEOF | |
25372 | if ac_fn_c_try_run "$LINENO"; then : | |
25373 | gl_cv_func_rename_slash_src_works=yes | |
25374 | else | |
25375 | gl_cv_func_rename_slash_src_works=no | |
25376 | fi | |
25377 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25378 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25379 | fi | |
25380 | ||
25381 | rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk | |
25382 | ||
25383 | fi | |
25384 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_src_works" >&5 | |
25385 | $as_echo "$gl_cv_func_rename_slash_src_works" >&6; } | |
25386 | case "$gl_cv_func_rename_slash_src_works" in | |
25387 | *yes) ;; | |
25388 | *) | |
25389 | REPLACE_RENAME=1 | |
25390 | ||
25391 | $as_echo "#define RENAME_TRAILING_SLASH_SOURCE_BUG 1" >>confdefs.h | |
25392 | ||
25393 | ;; | |
25394 | esac | |
25395 | ||
25396 | ||
25397 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages hard links correctly" >&5 | |
25398 | $as_echo_n "checking whether rename manages hard links correctly... " >&6; } | |
d0ac1c44 | 25399 | if ${gl_cv_func_rename_link_works+:} false; then : |
6a29c58e YQ |
25400 | $as_echo_n "(cached) " >&6 |
25401 | else | |
25402 | if test $ac_cv_func_link = yes; then | |
c0c3707f CB |
25403 | if test $cross_compiling != yes; then |
25404 | rm -rf conftest.f conftest.f1 conftest.f2 | |
25405 | if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 && | |
25406 | set x `ls -i conftest.f conftest.f1` && test "" = ""; then | |
25407 | if test "$cross_compiling" = yes; then : | |
25408 | : | |
6a29c58e YQ |
25409 | |
25410 | else | |
25411 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25412 | /* end confdefs.h. */ | |
25413 | ||
c0c3707f CB |
25414 | # include <errno.h> |
25415 | # include <stdio.h> | |
25416 | # include <stdlib.h> | |
25417 | # include <unistd.h> | |
6a29c58e YQ |
25418 | |
25419 | int | |
25420 | main () | |
25421 | { | |
25422 | int result = 0; | |
c0c3707f CB |
25423 | if (rename ("conftest.f", "conftest.f1")) |
25424 | result |= 1; | |
25425 | if (unlink ("conftest.f1")) | |
25426 | result |= 2; | |
25427 | ||
25428 | /* Allow either the POSIX-required behavior, where the | |
25429 | previous rename kept conftest.f, or the (better) NetBSD | |
25430 | behavior, where it removed conftest.f. */ | |
25431 | if (rename ("conftest.f", "conftest.f") != 0 | |
25432 | && errno != ENOENT) | |
25433 | result |= 4; | |
25434 | ||
25435 | if (rename ("conftest.f1", "conftest.f1") == 0) | |
25436 | result |= 8; | |
25437 | if (rename ("conftest.f2", "conftest.f2") != 0) | |
25438 | result |= 16; | |
25439 | return result; | |
6a29c58e YQ |
25440 | |
25441 | ; | |
25442 | return 0; | |
25443 | } | |
25444 | _ACEOF | |
25445 | if ac_fn_c_try_run "$LINENO"; then : | |
25446 | gl_cv_func_rename_link_works=yes | |
25447 | else | |
25448 | gl_cv_func_rename_link_works=no | |
25449 | fi | |
25450 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25451 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25452 | fi | |
25453 | ||
c0c3707f CB |
25454 | else |
25455 | gl_cv_func_rename_link_works="guessing no" | |
25456 | fi | |
25457 | rm -rf conftest.f conftest.f1 conftest.f2 | |
6a29c58e | 25458 | else |
c0c3707f CB |
25459 | case "$host_os" in |
25460 | # Guess yes on Linux systems. | |
25461 | linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;; | |
25462 | # Guess yes on glibc systems. | |
25463 | *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;; | |
25464 | # Guess yes on native Windows. | |
25465 | mingw*) gl_cv_func_rename_link_works="guessing yes" ;; | |
25466 | # If we don't know, obey --enable-cross-guesses. | |
25467 | *) gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;; | |
25468 | esac | |
6a29c58e | 25469 | fi |
6a29c58e YQ |
25470 | else |
25471 | gl_cv_func_rename_link_works=yes | |
25472 | fi | |
25473 | ||
25474 | fi | |
25475 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_link_works" >&5 | |
25476 | $as_echo "$gl_cv_func_rename_link_works" >&6; } | |
25477 | case "$gl_cv_func_rename_link_works" in | |
25478 | *yes) ;; | |
25479 | *) | |
25480 | REPLACE_RENAME=1 | |
25481 | ||
25482 | $as_echo "#define RENAME_HARD_LINK_BUG 1" >>confdefs.h | |
25483 | ||
25484 | ;; | |
25485 | esac | |
25486 | ||
25487 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages existing destinations correctly" >&5 | |
25488 | $as_echo_n "checking whether rename manages existing destinations correctly... " >&6; } | |
d0ac1c44 | 25489 | if ${gl_cv_func_rename_dest_works+:} false; then : |
6a29c58e YQ |
25490 | $as_echo_n "(cached) " >&6 |
25491 | else | |
25492 | rm -rf conftest.f conftest.d1 conftest.d2 | |
25493 | touch conftest.f && mkdir conftest.d1 conftest.d2 || | |
d0ac1c44 | 25494 | as_fn_error $? "cannot create temporary files" "$LINENO" 5 |
6a29c58e YQ |
25495 | if test "$cross_compiling" = yes; then : |
25496 | case "$host_os" in | |
c0c3707f CB |
25497 | # Guess yes on Linux systems. |
25498 | linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;; | |
25499 | # Guess yes on glibc systems. | |
25500 | *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;; | |
25501 | # Guess no on native Windows. | |
25502 | mingw*) gl_cv_func_rename_dest_works="guessing no" ;; | |
25503 | # If we don't know, obey --enable-cross-guesses. | |
25504 | *) gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;; | |
6a29c58e YQ |
25505 | esac |
25506 | ||
25507 | else | |
25508 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25509 | /* end confdefs.h. */ | |
25510 | ||
25511 | # include <stdio.h> | |
25512 | # include <stdlib.h> | |
25513 | ||
25514 | int | |
25515 | main () | |
25516 | { | |
25517 | int result = 0; | |
25518 | if (rename ("conftest.d1", "conftest.d2") != 0) | |
25519 | result |= 1; | |
25520 | if (rename ("conftest.d2", "conftest.f") == 0) | |
25521 | result |= 2; | |
25522 | return result; | |
25523 | ||
25524 | ; | |
25525 | return 0; | |
25526 | } | |
25527 | _ACEOF | |
25528 | if ac_fn_c_try_run "$LINENO"; then : | |
25529 | gl_cv_func_rename_dest_works=yes | |
25530 | else | |
25531 | gl_cv_func_rename_dest_works=no | |
25532 | fi | |
25533 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25534 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25535 | fi | |
25536 | ||
25537 | rm -rf conftest.f conftest.d1 conftest.d2 | |
25538 | ||
25539 | fi | |
25540 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_dest_works" >&5 | |
25541 | $as_echo "$gl_cv_func_rename_dest_works" >&6; } | |
25542 | case "$gl_cv_func_rename_dest_works" in | |
25543 | *yes) ;; | |
25544 | *) | |
25545 | REPLACE_RENAME=1 | |
25546 | ||
25547 | $as_echo "#define RENAME_DEST_EXISTS_BUG 1" >>confdefs.h | |
25548 | ||
25549 | ;; | |
25550 | esac | |
25551 | ||
25552 | if test $REPLACE_RENAME = 1; then | |
25553 | ||
25554 | ||
25555 | ||
25556 | ||
25557 | ||
25558 | ||
25559 | ||
25560 | ||
25561 | gl_LIBOBJS="$gl_LIBOBJS rename.$ac_objext" | |
25562 | ||
25563 | fi | |
25564 | ||
25565 | ||
25566 | ||
25567 | ||
25568 | ||
25569 | GNULIB_RENAME=1 | |
25570 | ||
25571 | ||
25572 | ||
25573 | ||
25574 | ||
25575 | $as_echo "#define GNULIB_TEST_RENAME 1" >>confdefs.h | |
25576 | ||
25577 | ||
25578 | ||
25579 | ||
25580 | ||
25581 | ||
6ec2e0f5 SDJ |
25582 | for ac_func in rewinddir |
25583 | do : | |
25584 | ac_fn_c_check_func "$LINENO" "rewinddir" "ac_cv_func_rewinddir" | |
d0ac1c44 | 25585 | if test "x$ac_cv_func_rewinddir" = xyes; then : |
6ec2e0f5 SDJ |
25586 | cat >>confdefs.h <<_ACEOF |
25587 | #define HAVE_REWINDDIR 1 | |
25588 | _ACEOF | |
25589 | ||
25590 | fi | |
25591 | done | |
25592 | ||
25593 | if test $ac_cv_func_rewinddir = no; then | |
25594 | HAVE_REWINDDIR=0 | |
25595 | fi | |
25596 | ||
25597 | if test $HAVE_REWINDDIR = 0; then | |
25598 | ||
25599 | ||
25600 | ||
25601 | ||
25602 | ||
25603 | ||
25604 | ||
25605 | ||
25606 | gl_LIBOBJS="$gl_LIBOBJS rewinddir.$ac_objext" | |
25607 | ||
25608 | fi | |
25609 | ||
25610 | ||
25611 | ||
25612 | ||
25613 | ||
25614 | GNULIB_REWINDDIR=1 | |
25615 | ||
25616 | ||
25617 | ||
25618 | ||
25619 | ||
25620 | $as_echo "#define GNULIB_TEST_REWINDDIR 1" >>confdefs.h | |
25621 | ||
25622 | ||
25623 | ||
25624 | ||
25625 | ||
25626 | ||
6a29c58e YQ |
25627 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rmdir works" >&5 |
25628 | $as_echo_n "checking whether rmdir works... " >&6; } | |
d0ac1c44 | 25629 | if ${gl_cv_func_rmdir_works+:} false; then : |
6a29c58e YQ |
25630 | $as_echo_n "(cached) " >&6 |
25631 | else | |
25632 | mkdir conftest.dir | |
25633 | touch conftest.file | |
25634 | if test "$cross_compiling" = yes; then : | |
25635 | case "$host_os" in | |
c0c3707f CB |
25636 | # Guess yes on Linux systems. |
25637 | linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;; | |
25638 | # Guess yes on glibc systems. | |
25639 | *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;; | |
25640 | # Guess no on native Windows. | |
25641 | mingw*) gl_cv_func_rmdir_works="guessing no" ;; | |
25642 | # If we don't know, obey --enable-cross-guesses. | |
25643 | *) gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;; | |
6a29c58e YQ |
25644 | esac |
25645 | ||
25646 | else | |
25647 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25648 | /* end confdefs.h. */ | |
25649 | #include <stdio.h> | |
25650 | #include <errno.h> | |
25651 | #if HAVE_UNISTD_H | |
25652 | # include <unistd.h> | |
25653 | #else /* on Windows with MSVC */ | |
25654 | # include <direct.h> | |
25655 | #endif | |
25656 | ||
25657 | int | |
25658 | main () | |
25659 | { | |
25660 | int result = 0; | |
25661 | if (!rmdir ("conftest.file/")) | |
25662 | result |= 1; | |
25663 | else if (errno != ENOTDIR) | |
25664 | result |= 2; | |
25665 | if (!rmdir ("conftest.dir/./")) | |
25666 | result |= 4; | |
25667 | return result; | |
25668 | ||
25669 | ; | |
25670 | return 0; | |
25671 | } | |
25672 | _ACEOF | |
25673 | if ac_fn_c_try_run "$LINENO"; then : | |
25674 | gl_cv_func_rmdir_works=yes | |
25675 | else | |
25676 | gl_cv_func_rmdir_works=no | |
25677 | fi | |
25678 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25679 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25680 | fi | |
25681 | ||
25682 | rm -rf conftest.dir conftest.file | |
25683 | fi | |
25684 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_works" >&5 | |
25685 | $as_echo "$gl_cv_func_rmdir_works" >&6; } | |
25686 | case "$gl_cv_func_rmdir_works" in | |
25687 | *yes) ;; | |
25688 | *) | |
25689 | REPLACE_RMDIR=1 | |
25690 | ;; | |
25691 | esac | |
25692 | ||
25693 | if test $REPLACE_RMDIR = 1; then | |
25694 | ||
25695 | ||
25696 | ||
25697 | ||
25698 | ||
25699 | ||
25700 | ||
25701 | ||
25702 | gl_LIBOBJS="$gl_LIBOBJS rmdir.$ac_objext" | |
25703 | ||
25704 | fi | |
25705 | ||
25706 | ||
25707 | ||
25708 | ||
25709 | ||
25710 | GNULIB_RMDIR=1 | |
25711 | ||
25712 | ||
25713 | ||
25714 | ||
25715 | ||
25716 | $as_echo "#define GNULIB_TEST_RMDIR 1" >>confdefs.h | |
25717 | ||
25718 | ||
25719 | ||
25720 | ||
0750520d | 25721 | |
5e8754f9 SDJ |
25722 | |
25723 | ||
25724 | ||
3d99e817 AK |
25725 | if test $ac_cv_func_setenv = no; then |
25726 | HAVE_SETENV=0 | |
25727 | else | |
25728 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5 | |
25729 | $as_echo_n "checking whether setenv validates arguments... " >&6; } | |
d0ac1c44 | 25730 | if ${gl_cv_func_setenv_works+:} false; then : |
3d99e817 AK |
25731 | $as_echo_n "(cached) " >&6 |
25732 | else | |
25733 | if test "$cross_compiling" = yes; then : | |
25734 | case "$host_os" in | |
c0c3707f CB |
25735 | # Guess yes on glibc systems. |
25736 | *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;; | |
25737 | # Guess yes on musl systems. | |
25738 | *-musl*) gl_cv_func_setenv_works="guessing yes" ;; | |
25739 | # If we don't know, obey --enable-cross-guesses. | |
25740 | *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;; | |
3d99e817 AK |
25741 | esac |
25742 | ||
25743 | else | |
25744 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25745 | /* end confdefs.h. */ | |
25746 | ||
25747 | #include <stdlib.h> | |
25748 | #include <errno.h> | |
25749 | #include <string.h> | |
25750 | ||
25751 | int | |
25752 | main () | |
25753 | { | |
25754 | ||
25755 | int result = 0; | |
25756 | { | |
25757 | if (setenv ("", "", 0) != -1) | |
25758 | result |= 1; | |
25759 | else if (errno != EINVAL) | |
25760 | result |= 2; | |
25761 | } | |
25762 | { | |
25763 | if (setenv ("a", "=", 1) != 0) | |
25764 | result |= 4; | |
25765 | else if (strcmp (getenv ("a"), "=") != 0) | |
25766 | result |= 8; | |
25767 | } | |
25768 | return result; | |
25769 | ||
25770 | ; | |
25771 | return 0; | |
25772 | } | |
25773 | _ACEOF | |
25774 | if ac_fn_c_try_run "$LINENO"; then : | |
25775 | gl_cv_func_setenv_works=yes | |
25776 | else | |
25777 | gl_cv_func_setenv_works=no | |
25778 | fi | |
25779 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25780 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25781 | fi | |
25782 | ||
25783 | fi | |
25784 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5 | |
25785 | $as_echo "$gl_cv_func_setenv_works" >&6; } | |
25786 | case "$gl_cv_func_setenv_works" in | |
25787 | *yes) ;; | |
25788 | *) | |
25789 | REPLACE_SETENV=1 | |
25790 | ;; | |
25791 | esac | |
25792 | fi | |
25793 | ||
25794 | if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then | |
25795 | ||
25796 | ||
25797 | ||
25798 | ||
25799 | ||
25800 | ||
25801 | ||
25802 | ||
25803 | gl_LIBOBJS="$gl_LIBOBJS setenv.$ac_objext" | |
25804 | ||
25805 | fi | |
25806 | ||
25807 | ||
25808 | ||
25809 | ||
25810 | ||
25811 | GNULIB_SETENV=1 | |
25812 | ||
25813 | ||
25814 | ||
25815 | ||
25816 | ||
25817 | $as_echo "#define GNULIB_TEST_SETENV 1" >>confdefs.h | |
25818 | ||
25819 | ||
25820 | ||
25821 | ||
25822 | ||
0750520d PA |
25823 | |
25824 | ||
25825 | ||
5df4cba6 SM |
25826 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5 |
25827 | $as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; } | |
25828 | if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then : | |
25829 | $as_echo_n "(cached) " >&6 | |
25830 | else | |
25831 | case "$host_os" in | |
25832 | # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin. | |
25833 | *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*) | |
25834 | gl_cv_func_setlocale_null_all_mtsafe=no ;; | |
25835 | # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows. | |
25836 | *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*) | |
25837 | gl_cv_func_setlocale_null_all_mtsafe=yes ;; | |
25838 | # If we don't know, obey --enable-cross-guesses. | |
25839 | *) | |
25840 | gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;; | |
25841 | esac | |
25842 | ||
25843 | fi | |
25844 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5 | |
25845 | $as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; } | |
25846 | case "$host_os" in | |
25847 | mingw*) ;; | |
25848 | *) | |
25849 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then | |
25850 | gl_cv_func_setlocale_null_all_mtsafe="trivially yes" | |
25851 | fi | |
25852 | ;; | |
25853 | esac | |
25854 | case "$gl_cv_func_setlocale_null_all_mtsafe" in | |
25855 | *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;; | |
25856 | *) SETLOCALE_NULL_ALL_MTSAFE=0 ;; | |
25857 | esac | |
25858 | ||
25859 | cat >>confdefs.h <<_ACEOF | |
25860 | #define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE | |
25861 | _ACEOF | |
25862 | ||
25863 | ||
25864 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5 | |
25865 | $as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; } | |
25866 | if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then : | |
25867 | $as_echo_n "(cached) " >&6 | |
25868 | else | |
25869 | case "$host_os" in | |
25870 | # Guess no on OpenBSD, AIX. | |
25871 | openbsd* | aix*) | |
25872 | gl_cv_func_setlocale_null_one_mtsafe=no ;; | |
25873 | # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows. | |
25874 | *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*) | |
25875 | gl_cv_func_setlocale_null_one_mtsafe=yes ;; | |
25876 | # If we don't know, obey --enable-cross-guesses. | |
25877 | *) | |
25878 | gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;; | |
25879 | esac | |
25880 | ||
25881 | fi | |
25882 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5 | |
25883 | $as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; } | |
25884 | case "$host_os" in | |
25885 | mingw*) ;; | |
25886 | *) | |
25887 | if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then | |
25888 | gl_cv_func_setlocale_null_one_mtsafe="trivially yes" | |
25889 | fi | |
25890 | ;; | |
25891 | esac | |
25892 | case "$gl_cv_func_setlocale_null_one_mtsafe" in | |
25893 | *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;; | |
25894 | *) SETLOCALE_NULL_ONE_MTSAFE=0 ;; | |
25895 | esac | |
25896 | ||
25897 | cat >>confdefs.h <<_ACEOF | |
25898 | #define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE | |
25899 | _ACEOF | |
25900 | ||
25901 | ||
25902 | if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then | |
25903 | case "$host_os" in | |
25904 | mingw*) LIB_SETLOCALE_NULL= ;; | |
25905 | *) | |
25906 | ||
25907 | ||
25908 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 | |
25909 | $as_echo_n "checking whether imported symbols can be declared weak... " >&6; } | |
25910 | if ${gl_cv_have_weak+:} false; then : | |
25911 | $as_echo_n "(cached) " >&6 | |
25912 | else | |
25913 | gl_cv_have_weak=no | |
25914 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25915 | /* end confdefs.h. */ | |
25916 | extern void xyzzy (); | |
25917 | #pragma weak xyzzy | |
25918 | int | |
25919 | main () | |
25920 | { | |
25921 | xyzzy(); | |
25922 | ; | |
25923 | return 0; | |
25924 | } | |
25925 | _ACEOF | |
25926 | if ac_fn_c_try_link "$LINENO"; then : | |
25927 | gl_cv_have_weak=maybe | |
25928 | fi | |
25929 | rm -f core conftest.err conftest.$ac_objext \ | |
25930 | conftest$ac_exeext conftest.$ac_ext | |
25931 | if test $gl_cv_have_weak = maybe; then | |
25932 | if test "$cross_compiling" = yes; then : | |
25933 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25934 | /* end confdefs.h. */ | |
25935 | #ifdef __ELF__ | |
25936 | Extensible Linking Format | |
25937 | #endif | |
25938 | ||
25939 | _ACEOF | |
25940 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
25941 | $EGREP "Extensible Linking Format" >/dev/null 2>&1; then : | |
25942 | gl_cv_have_weak="guessing yes" | |
25943 | else | |
25944 | gl_cv_have_weak="guessing no" | |
25945 | fi | |
25946 | rm -f conftest* | |
25947 | ||
25948 | ||
25949 | else | |
25950 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
25951 | /* end confdefs.h. */ | |
25952 | ||
25953 | #include <stdio.h> | |
25954 | #pragma weak fputs | |
25955 | int main () | |
25956 | { | |
25957 | return (fputs == NULL); | |
25958 | } | |
25959 | _ACEOF | |
25960 | if ac_fn_c_try_run "$LINENO"; then : | |
25961 | gl_cv_have_weak=yes | |
25962 | else | |
25963 | gl_cv_have_weak=no | |
25964 | fi | |
25965 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
25966 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
25967 | fi | |
25968 | ||
25969 | fi | |
25970 | case " $LDFLAGS " in | |
25971 | *" -static "*) gl_cv_have_weak=no ;; | |
25972 | esac | |
25973 | case "$gl_cv_have_weak" in | |
25974 | *yes) | |
25975 | case "$host_os" in | |
25976 | freebsd* | dragonfly*) | |
25977 | : > conftest1.c | |
25978 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1 | |
25979 | cat <<EOF > conftest2.c | |
25980 | #include <pthread.h> | |
25981 | #pragma weak pthread_mutexattr_gettype | |
25982 | int main () | |
25983 | { | |
25984 | return (pthread_mutexattr_gettype != NULL); | |
25985 | } | |
25986 | EOF | |
25987 | $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \ | |
25988 | || gl_cv_have_weak=no | |
25989 | rm -f conftest1.c libempty.so conftest2.c conftest | |
25990 | ;; | |
25991 | esac | |
25992 | ;; | |
25993 | esac | |
25994 | ||
25995 | fi | |
25996 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 | |
25997 | $as_echo "$gl_cv_have_weak" >&6; } | |
25998 | case "$gl_cv_have_weak" in | |
25999 | *yes) | |
26000 | ||
26001 | $as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h | |
26002 | ||
26003 | ;; | |
26004 | esac | |
26005 | ||
26006 | case "$gl_cv_have_weak" in | |
26007 | *yes) LIB_SETLOCALE_NULL= ;; | |
26008 | *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;; | |
26009 | esac | |
26010 | ;; | |
26011 | esac | |
26012 | else | |
26013 | LIB_SETLOCALE_NULL= | |
26014 | fi | |
26015 | ||
26016 | ||
26017 | if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then | |
26018 | ||
26019 | ||
26020 | ||
26021 | ||
26022 | ||
26023 | ||
26024 | ||
26025 | ||
26026 | gl_LIBOBJS="$gl_LIBOBJS setlocale-lock.$ac_objext" | |
26027 | ||
26028 | ||
26029 | ||
26030 | ||
26031 | CFLAG_VISIBILITY= | |
26032 | HAVE_VISIBILITY=0 | |
26033 | if test -n "$GCC"; then | |
26034 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5 | |
26035 | $as_echo_n "checking whether the -Werror option is usable... " >&6; } | |
26036 | if ${gl_cv_cc_vis_werror+:} false; then : | |
26037 | $as_echo_n "(cached) " >&6 | |
26038 | else | |
26039 | gl_save_CFLAGS="$CFLAGS" | |
26040 | CFLAGS="$CFLAGS -Werror" | |
26041 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26042 | /* end confdefs.h. */ | |
26043 | ||
26044 | int | |
26045 | main () | |
26046 | { | |
26047 | ||
26048 | ; | |
26049 | return 0; | |
26050 | } | |
26051 | _ACEOF | |
26052 | if ac_fn_c_try_compile "$LINENO"; then : | |
26053 | gl_cv_cc_vis_werror=yes | |
26054 | else | |
26055 | gl_cv_cc_vis_werror=no | |
26056 | fi | |
26057 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
26058 | CFLAGS="$gl_save_CFLAGS" | |
26059 | ||
26060 | fi | |
26061 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5 | |
26062 | $as_echo "$gl_cv_cc_vis_werror" >&6; } | |
26063 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5 | |
26064 | $as_echo_n "checking for simple visibility declarations... " >&6; } | |
26065 | if ${gl_cv_cc_visibility+:} false; then : | |
26066 | $as_echo_n "(cached) " >&6 | |
26067 | else | |
26068 | gl_save_CFLAGS="$CFLAGS" | |
26069 | CFLAGS="$CFLAGS -fvisibility=hidden" | |
26070 | if test $gl_cv_cc_vis_werror = yes; then | |
26071 | CFLAGS="$CFLAGS -Werror" | |
26072 | fi | |
26073 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26074 | /* end confdefs.h. */ | |
26075 | extern __attribute__((__visibility__("hidden"))) int hiddenvar; | |
26076 | extern __attribute__((__visibility__("default"))) int exportedvar; | |
26077 | extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); | |
26078 | extern __attribute__((__visibility__("default"))) int exportedfunc (void); | |
26079 | void dummyfunc (void) {} | |
26080 | ||
26081 | int | |
26082 | main () | |
26083 | { | |
26084 | ||
26085 | ; | |
26086 | return 0; | |
26087 | } | |
26088 | _ACEOF | |
26089 | if ac_fn_c_try_compile "$LINENO"; then : | |
26090 | gl_cv_cc_visibility=yes | |
26091 | else | |
26092 | gl_cv_cc_visibility=no | |
26093 | fi | |
26094 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
26095 | CFLAGS="$gl_save_CFLAGS" | |
26096 | ||
26097 | fi | |
26098 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5 | |
26099 | $as_echo "$gl_cv_cc_visibility" >&6; } | |
26100 | if test $gl_cv_cc_visibility = yes; then | |
26101 | CFLAG_VISIBILITY="-fvisibility=hidden" | |
26102 | HAVE_VISIBILITY=1 | |
26103 | fi | |
26104 | fi | |
26105 | ||
26106 | ||
26107 | ||
26108 | cat >>confdefs.h <<_ACEOF | |
26109 | #define HAVE_VISIBILITY $HAVE_VISIBILITY | |
26110 | _ACEOF | |
26111 | ||
26112 | ||
26113 | ||
26114 | fi | |
26115 | ||
26116 | ||
26117 | ||
26118 | ||
26119 | ||
26120 | GNULIB_SETLOCALE_NULL=1 | |
26121 | ||
26122 | ||
26123 | ||
26124 | ||
26125 | ||
26126 | $as_echo "#define GNULIB_TEST_SETLOCALE_NULL 1" >>confdefs.h | |
26127 | ||
26128 | ||
26129 | ||
26130 | ||
26131 | ||
26132 | ||
26133 | ||
26134 | ||
0750520d PA |
26135 | |
26136 | ||
26137 | ||
26138 | ||
26139 | ||
26140 | ||
26141 | if test $gl_cv_have_include_next = yes; then | |
26142 | gl_cv_next_signal_h='<'signal.h'>' | |
26143 | else | |
26144 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5 | |
26145 | $as_echo_n "checking absolute name of <signal.h>... " >&6; } | |
d0ac1c44 | 26146 | if ${gl_cv_next_signal_h+:} false; then : |
0750520d PA |
26147 | $as_echo_n "(cached) " >&6 |
26148 | else | |
26149 | ||
26150 | ||
26151 | ||
26152 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26153 | /* end confdefs.h. */ | |
26154 | #include <signal.h> | |
26155 | _ACEOF | |
26156 | case "$host_os" in | |
26157 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
26158 | *) gl_absname_cpp="$ac_cpp" ;; | |
26159 | esac | |
26160 | ||
26161 | case "$host_os" in | |
26162 | mingw*) | |
26163 | gl_dirsep_regex='[/\\]' | |
26164 | ;; | |
26165 | *) | |
26166 | gl_dirsep_regex='\/' | |
26167 | ;; | |
26168 | esac | |
26169 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
26170 | gl_header_literal_regex=`echo 'signal.h' \ | |
26171 | | sed -e "$gl_make_literal_regex_sed"` | |
26172 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
26173 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
26174 | s|^/[^/]|//&| | |
26175 | p | |
26176 | q | |
26177 | }' | |
26178 | ||
26179 | gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
26180 | sed -n "$gl_absolute_header_sed"` | |
26181 | ||
26182 | gl_header=$gl_cv_absolute_signal_h | |
26183 | gl_cv_next_signal_h='"'$gl_header'"' | |
26184 | ||
26185 | ||
26186 | fi | |
26187 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5 | |
26188 | $as_echo "$gl_cv_next_signal_h" >&6; } | |
26189 | fi | |
26190 | NEXT_SIGNAL_H=$gl_cv_next_signal_h | |
26191 | ||
26192 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
26193 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
26194 | gl_next_as_first_directive='<'signal.h'>' | |
26195 | else | |
26196 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
26197 | gl_next_as_first_directive=$gl_cv_next_signal_h | |
26198 | fi | |
26199 | NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive | |
26200 | ||
26201 | ||
26202 | ||
26203 | ||
26204 | ||
26205 | # AIX declares sig_atomic_t to already include volatile, and C89 compilers | |
26206 | # then choke on 'volatile sig_atomic_t'. C99 requires that it compile. | |
26207 | ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" " | |
26208 | #include <signal.h> | |
26209 | ||
26210 | " | |
d0ac1c44 | 26211 | if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes; then : |
0750520d PA |
26212 | |
26213 | else | |
26214 | HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0 | |
26215 | fi | |
26216 | ||
26217 | ||
26218 | ||
26219 | ||
26220 | ||
26221 | ||
26222 | ||
26223 | ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" " | |
26224 | #include <signal.h> | |
26225 | ||
26226 | " | |
d0ac1c44 | 26227 | if test "x$ac_cv_type_sighandler_t" = xyes; then : |
0750520d PA |
26228 | |
26229 | else | |
26230 | HAVE_SIGHANDLER_T=0 | |
26231 | fi | |
26232 | ||
26233 | ||
26234 | ||
0750520d | 26235 | |
0750520d PA |
26236 | |
26237 | ||
725e2999 JB |
26238 | ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " |
26239 | /* <sys/types.h> is not needed according to POSIX, but the | |
26240 | <sys/socket.h> in i386-unknown-freebsd4.10 and | |
26241 | powerpc-apple-darwin5.5 required it. */ | |
26242 | #include <sys/types.h> | |
26243 | #if HAVE_SYS_SOCKET_H | |
26244 | # include <sys/socket.h> | |
26245 | #elif HAVE_WS2TCPIP_H | |
26246 | # include <ws2tcpip.h> | |
26247 | #endif | |
26248 | ||
26249 | " | |
26250 | if test "x$ac_cv_type_socklen_t" = xyes; then : | |
26251 | ||
26252 | else | |
26253 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 | |
26254 | $as_echo_n "checking for socklen_t equivalent... " >&6; } | |
c0c3707f | 26255 | if ${gl_cv_socklen_t_equiv+:} false; then : |
725e2999 JB |
26256 | $as_echo_n "(cached) " >&6 |
26257 | else | |
26258 | # Systems have either "struct sockaddr *" or | |
26259 | # "void *" as the second argument to getpeername | |
26260 | gl_cv_socklen_t_equiv= | |
26261 | for arg2 in "struct sockaddr" void; do | |
26262 | for t in int size_t "unsigned int" "long int" "unsigned long int"; do | |
26263 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26264 | /* end confdefs.h. */ | |
26265 | #include <sys/types.h> | |
26266 | #include <sys/socket.h> | |
26267 | ||
26268 | int getpeername (int, $arg2 *, $t *); | |
26269 | int | |
26270 | main () | |
26271 | { | |
26272 | $t len; | |
26273 | getpeername (0, 0, &len); | |
26274 | ; | |
26275 | return 0; | |
26276 | } | |
26277 | _ACEOF | |
26278 | if ac_fn_c_try_compile "$LINENO"; then : | |
26279 | gl_cv_socklen_t_equiv="$t" | |
26280 | fi | |
26281 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
26282 | test "$gl_cv_socklen_t_equiv" != "" && break | |
26283 | done | |
26284 | test "$gl_cv_socklen_t_equiv" != "" && break | |
26285 | done | |
c0c3707f CB |
26286 | if test "$gl_cv_socklen_t_equiv" = ""; then |
26287 | as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5 | |
26288 | fi | |
725e2999 JB |
26289 | |
26290 | fi | |
c0c3707f | 26291 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5 |
725e2999 JB |
26292 | $as_echo "$gl_cv_socklen_t_equiv" >&6; } |
26293 | ||
26294 | cat >>confdefs.h <<_ACEOF | |
26295 | #define socklen_t $gl_cv_socklen_t_equiv | |
26296 | _ACEOF | |
26297 | ||
26298 | fi | |
26299 | ||
0750520d | 26300 | |
63ce7108 TT |
26301 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5 |
26302 | $as_echo_n "checking for ssize_t... " >&6; } | |
d0ac1c44 | 26303 | if ${gt_cv_ssize_t+:} false; then : |
63ce7108 TT |
26304 | $as_echo_n "(cached) " >&6 |
26305 | else | |
26306 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26307 | /* end confdefs.h. */ | |
26308 | #include <sys/types.h> | |
26309 | int | |
26310 | main () | |
26311 | { | |
26312 | int x = sizeof (ssize_t *) + sizeof (ssize_t); | |
26313 | return !x; | |
26314 | ; | |
26315 | return 0; | |
26316 | } | |
26317 | _ACEOF | |
26318 | if ac_fn_c_try_compile "$LINENO"; then : | |
26319 | gt_cv_ssize_t=yes | |
26320 | else | |
26321 | gt_cv_ssize_t=no | |
26322 | fi | |
26323 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
26324 | fi | |
26325 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5 | |
26326 | $as_echo "$gt_cv_ssize_t" >&6; } | |
26327 | if test $gt_cv_ssize_t = no; then | |
26328 | ||
26329 | $as_echo "#define ssize_t int" >>confdefs.h | |
26330 | ||
26331 | fi | |
26332 | ||
26333 | ||
26334 | ||
26335 | ||
472fa5ee | 26336 | |
c0c3707f CB |
26337 | case "$host_os" in |
26338 | mingw*) | |
26339 | REPLACE_STAT=1 | |
26340 | ;; | |
26341 | *) | |
26342 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 | |
26343 | $as_echo_n "checking whether stat handles trailing slashes on files... " >&6; } | |
26344 | if ${gl_cv_func_stat_file_slash+:} false; then : | |
2196f55f YQ |
26345 | $as_echo_n "(cached) " >&6 |
26346 | else | |
c0c3707f CB |
26347 | touch conftest.tmp |
26348 | # Assume that if we have lstat, we can also check symlinks. | |
26349 | if test $ac_cv_func_lstat = yes; then | |
26350 | ln -s conftest.tmp conftest.lnk | |
26351 | fi | |
26352 | if test "$cross_compiling" = yes; then : | |
26353 | case "$host_os" in | |
26354 | # Guess yes on Linux systems. | |
26355 | linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;; | |
26356 | # Guess yes on glibc systems. | |
26357 | *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; | |
26358 | # If we don't know, obey --enable-cross-guesses. | |
26359 | *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;; | |
26360 | esac | |
26361 | ||
2196f55f YQ |
26362 | else |
26363 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26364 | /* end confdefs.h. */ | |
26365 | #include <sys/stat.h> | |
26366 | ||
26367 | int | |
26368 | main () | |
26369 | { | |
c0c3707f CB |
26370 | int result = 0; |
26371 | struct stat st; | |
26372 | if (!stat ("conftest.tmp/", &st)) | |
26373 | result |= 1; | |
26374 | #if HAVE_LSTAT | |
26375 | if (!stat ("conftest.lnk/", &st)) | |
26376 | result |= 2; | |
26377 | #endif | |
26378 | return result; | |
26379 | ||
2196f55f YQ |
26380 | ; |
26381 | return 0; | |
26382 | } | |
26383 | _ACEOF | |
26384 | if ac_fn_c_try_run "$LINENO"; then : | |
c0c3707f | 26385 | gl_cv_func_stat_file_slash=yes |
2196f55f | 26386 | else |
c0c3707f | 26387 | gl_cv_func_stat_file_slash=no |
2196f55f YQ |
26388 | fi |
26389 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
26390 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
26391 | fi | |
26392 | ||
c0c3707f | 26393 | rm -f conftest.tmp conftest.lnk |
2196f55f | 26394 | fi |
c0c3707f CB |
26395 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5 |
26396 | $as_echo "$gl_cv_func_stat_file_slash" >&6; } | |
26397 | case $gl_cv_func_stat_file_slash in | |
26398 | *no) | |
26399 | REPLACE_STAT=1 | |
26400 | ||
26401 | $as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h | |
26402 | ;; | |
26403 | esac | |
26404 | case $host_os in | |
26405 | solaris*) | |
26406 | REPLACE_FSTAT=1 ;; | |
26407 | esac | |
26408 | ;; | |
26409 | esac | |
26410 | ||
26411 | if test $REPLACE_STAT = 1; then | |
26412 | ||
26413 | ||
26414 | ||
26415 | ||
26416 | ||
26417 | ||
26418 | ||
26419 | ||
26420 | gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext" | |
26421 | ||
26422 | case "$host_os" in | |
26423 | mingw*) | |
26424 | ||
26425 | ||
26426 | ||
26427 | ||
26428 | ||
26429 | ||
26430 | ||
26431 | ||
26432 | gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" | |
26433 | ||
26434 | ;; | |
26435 | esac | |
26436 | ||
26437 | ||
26438 | : | |
26439 | ||
26440 | fi | |
26441 | ||
26442 | ||
26443 | ||
26444 | ||
26445 | ||
26446 | GNULIB_STAT=1 | |
26447 | ||
26448 | ||
26449 | ||
26450 | ||
26451 | ||
26452 | $as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h | |
26453 | ||
26454 | ||
26455 | ||
26456 | ||
7a6dbc2f | 26457 | |
c0c3707f CB |
26458 | |
26459 | ||
26460 | 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> | |
26461 | #include <sys/stat.h> | |
26462 | " | |
26463 | if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then : | |
26464 | ||
26465 | cat >>confdefs.h <<_ACEOF | |
26466 | #define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1 | |
26467 | _ACEOF | |
26468 | ||
26469 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5 | |
26470 | $as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; } | |
26471 | if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then : | |
26472 | $as_echo_n "(cached) " >&6 | |
2196f55f | 26473 | else |
5e8754f9 SDJ |
26474 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
26475 | /* end confdefs.h. */ | |
c0c3707f CB |
26476 | |
26477 | #include <sys/types.h> | |
26478 | #include <sys/stat.h> | |
26479 | #if HAVE_SYS_TIME_H | |
26480 | # include <sys/time.h> | |
26481 | #endif | |
26482 | #include <time.h> | |
26483 | struct timespec ts; | |
26484 | struct stat st; | |
7a6dbc2f | 26485 | |
5e8754f9 SDJ |
26486 | int |
26487 | main () | |
26488 | { | |
c0c3707f CB |
26489 | |
26490 | st.st_atim = ts; | |
7a6dbc2f | 26491 | |
5e8754f9 SDJ |
26492 | ; |
26493 | return 0; | |
26494 | } | |
26495 | _ACEOF | |
c0c3707f CB |
26496 | if ac_fn_c_try_compile "$LINENO"; then : |
26497 | ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes | |
5e8754f9 | 26498 | else |
c0c3707f | 26499 | ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no |
2196f55f | 26500 | fi |
c0c3707f | 26501 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
2196f55f | 26502 | fi |
c0c3707f CB |
26503 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5 |
26504 | $as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; } | |
26505 | if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then | |
2196f55f | 26506 | |
c0c3707f | 26507 | $as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h |
2196f55f | 26508 | |
c0c3707f CB |
26509 | fi |
26510 | else | |
26511 | 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> | |
26512 | #include <sys/stat.h> | |
26513 | " | |
26514 | if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then : | |
2196f55f | 26515 | |
c0c3707f CB |
26516 | cat >>confdefs.h <<_ACEOF |
26517 | #define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1 | |
26518 | _ACEOF | |
2196f55f | 26519 | |
c0c3707f CB |
26520 | |
26521 | else | |
26522 | ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h> | |
26523 | #include <sys/stat.h> | |
26524 | " | |
26525 | if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then : | |
26526 | ||
26527 | cat >>confdefs.h <<_ACEOF | |
26528 | #define HAVE_STRUCT_STAT_ST_ATIMENSEC 1 | |
26529 | _ACEOF | |
2196f55f YQ |
26530 | |
26531 | ||
c0c3707f CB |
26532 | else |
26533 | 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> | |
26534 | #include <sys/stat.h> | |
26535 | " | |
26536 | if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then : | |
2196f55f | 26537 | |
c0c3707f CB |
26538 | cat >>confdefs.h <<_ACEOF |
26539 | #define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1 | |
26540 | _ACEOF | |
2196f55f YQ |
26541 | |
26542 | ||
c0c3707f | 26543 | fi |
2196f55f | 26544 | |
c0c3707f | 26545 | fi |
2196f55f | 26546 | |
c0c3707f | 26547 | fi |
2196f55f | 26548 | |
c0c3707f | 26549 | fi |
2196f55f YQ |
26550 | |
26551 | ||
26552 | ||
26553 | ||
26554 | ||
c0c3707f CB |
26555 | 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> |
26556 | #include <sys/stat.h> | |
26557 | " | |
26558 | if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes; then : | |
2196f55f | 26559 | |
c0c3707f CB |
26560 | cat >>confdefs.h <<_ACEOF |
26561 | #define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1 | |
26562 | _ACEOF | |
2196f55f YQ |
26563 | |
26564 | ||
c0c3707f CB |
26565 | else |
26566 | ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h> | |
26567 | #include <sys/stat.h> | |
26568 | " | |
26569 | if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes; then : | |
2196f55f | 26570 | |
c0c3707f CB |
26571 | cat >>confdefs.h <<_ACEOF |
26572 | #define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1 | |
26573 | _ACEOF | |
2196f55f | 26574 | |
2196f55f | 26575 | |
c0c3707f CB |
26576 | else |
26577 | 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> | |
26578 | #include <sys/stat.h> | |
26579 | " | |
26580 | if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes; then : | |
26581 | ||
26582 | cat >>confdefs.h <<_ACEOF | |
26583 | #define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1 | |
26584 | _ACEOF | |
26585 | ||
26586 | ||
26587 | fi | |
26588 | ||
26589 | fi | |
5e8754f9 | 26590 | |
c0c3707f | 26591 | fi |
2196f55f YQ |
26592 | |
26593 | ||
26594 | ||
725e2999 JB |
26595 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5 |
26596 | $as_echo_n "checking for working stdalign.h... " >&6; } | |
26597 | if ${gl_cv_header_working_stdalign_h+:} false; then : | |
26598 | $as_echo_n "(cached) " >&6 | |
26599 | else | |
26600 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26601 | /* end confdefs.h. */ | |
26602 | #include <stdalign.h> | |
26603 | #include <stddef.h> | |
26604 | ||
26605 | /* Test that alignof yields a result consistent with offsetof. | |
26606 | This catches GCC bug 52023 | |
c0c3707f | 26607 | <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */ |
725e2999 JB |
26608 | #ifdef __cplusplus |
26609 | template <class t> struct alignof_helper { char a; t b; }; | |
26610 | # define ao(type) offsetof (alignof_helper<type>, b) | |
26611 | #else | |
26612 | # define ao(type) offsetof (struct { char a; type b; }, b) | |
26613 | #endif | |
26614 | char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1]; | |
26615 | char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1]; | |
26616 | char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1]; | |
26617 | ||
26618 | /* Test _Alignas only on platforms where gnulib can help. */ | |
26619 | #if \ | |
26620 | ((defined __cplusplus && 201103 <= __cplusplus) \ | |
26621 | || (defined __APPLE__ && defined __MACH__ \ | |
26622 | ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ | |
26623 | : __GNUC__) \ | |
c0c3707f CB |
26624 | || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ |
26625 | || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \ | |
725e2999 JB |
26626 | || 1300 <= _MSC_VER) |
26627 | struct alignas_test { char c; char alignas (8) alignas_8; }; | |
26628 | char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 | |
26629 | ? 1 : -1]; | |
26630 | #endif | |
26631 | ||
26632 | int | |
26633 | main () | |
26634 | { | |
26635 | ||
26636 | ; | |
26637 | return 0; | |
26638 | } | |
26639 | _ACEOF | |
26640 | if ac_fn_c_try_compile "$LINENO"; then : | |
26641 | gl_cv_header_working_stdalign_h=yes | |
26642 | else | |
26643 | gl_cv_header_working_stdalign_h=no | |
26644 | fi | |
26645 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
26646 | fi | |
26647 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5 | |
26648 | $as_echo "$gl_cv_header_working_stdalign_h" >&6; } | |
26649 | ||
26650 | if test $gl_cv_header_working_stdalign_h = yes; then | |
26651 | STDALIGN_H='' | |
26652 | else | |
26653 | STDALIGN_H='stdalign.h' | |
26654 | fi | |
26655 | ||
26656 | ||
26657 | if test -n "$STDALIGN_H"; then | |
26658 | GL_GENERATE_STDALIGN_H_TRUE= | |
26659 | GL_GENERATE_STDALIGN_H_FALSE='#' | |
26660 | else | |
26661 | GL_GENERATE_STDALIGN_H_TRUE='#' | |
26662 | GL_GENERATE_STDALIGN_H_FALSE= | |
26663 | fi | |
26664 | ||
26665 | ||
26666 | ||
2196f55f YQ |
26667 | |
26668 | ||
63ce7108 | 26669 | |
c0c3707f CB |
26670 | if test "$ac_cv_header_stdbool_h" = yes; then |
26671 | case "$host_os" in | |
26672 | solaris*) | |
26673 | if test -z "$GCC"; then | |
26674 | STDBOOL_H='stdbool.h' | |
26675 | else | |
26676 | STDBOOL_H='' | |
26677 | fi | |
26678 | ;; | |
26679 | *) | |
26680 | STDBOOL_H='' | |
26681 | ;; | |
26682 | esac | |
63ce7108 TT |
26683 | else |
26684 | STDBOOL_H='stdbool.h' | |
26685 | fi | |
26686 | ||
26687 | if test -n "$STDBOOL_H"; then | |
26688 | GL_GENERATE_STDBOOL_H_TRUE= | |
26689 | GL_GENERATE_STDBOOL_H_FALSE='#' | |
26690 | else | |
26691 | GL_GENERATE_STDBOOL_H_TRUE='#' | |
26692 | GL_GENERATE_STDBOOL_H_FALSE= | |
26693 | fi | |
26694 | ||
26695 | ||
26696 | if test "$ac_cv_type__Bool" = yes; then | |
26697 | HAVE__BOOL=1 | |
26698 | else | |
26699 | HAVE__BOOL=0 | |
26700 | fi | |
26701 | ||
26702 | ||
26703 | ||
26704 | ||
26705 | ||
26706 | STDDEF_H= | |
4a626d0a | 26707 | |
c0c3707f CB |
26708 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5 |
26709 | $as_echo_n "checking for good max_align_t... " >&6; } | |
26710 | if ${gl_cv_type_max_align_t+:} false; then : | |
26711 | $as_echo_n "(cached) " >&6 | |
26712 | else | |
26713 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26714 | /* end confdefs.h. */ | |
26715 | #include <stddef.h> | |
26716 | unsigned int s = sizeof (max_align_t); | |
26717 | #if defined __GNUC__ || defined __IBM__ALIGNOF__ | |
26718 | int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; | |
26719 | int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; | |
26720 | #endif | |
26721 | ||
26722 | int | |
26723 | main () | |
26724 | { | |
4a626d0a | 26725 | |
c0c3707f CB |
26726 | ; |
26727 | return 0; | |
26728 | } | |
26729 | _ACEOF | |
26730 | if ac_fn_c_try_compile "$LINENO"; then : | |
26731 | gl_cv_type_max_align_t=yes | |
4a626d0a | 26732 | else |
c0c3707f | 26733 | gl_cv_type_max_align_t=no |
4a626d0a | 26734 | fi |
c0c3707f CB |
26735 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext |
26736 | ||
26737 | fi | |
26738 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5 | |
26739 | $as_echo "$gl_cv_type_max_align_t" >&6; } | |
26740 | if test $gl_cv_type_max_align_t = no; then | |
26741 | HAVE_MAX_ALIGN_T=0 | |
26742 | STDDEF_H=stddef.h | |
26743 | fi | |
4a626d0a | 26744 | |
63ce7108 TT |
26745 | if test $gt_cv_c_wchar_t = no; then |
26746 | HAVE_WCHAR_T=0 | |
26747 | STDDEF_H=stddef.h | |
26748 | fi | |
c0c3707f | 26749 | |
63ce7108 TT |
26750 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 |
26751 | $as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; } | |
d0ac1c44 | 26752 | if ${gl_cv_decl_null_works+:} false; then : |
63ce7108 TT |
26753 | $as_echo_n "(cached) " >&6 |
26754 | else | |
26755 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26756 | /* end confdefs.h. */ | |
26757 | #include <stddef.h> | |
26758 | int test[2 * (sizeof NULL == sizeof (void *)) -1]; | |
26759 | ||
26760 | int | |
26761 | main () | |
26762 | { | |
26763 | ||
26764 | ; | |
26765 | return 0; | |
26766 | } | |
26767 | _ACEOF | |
26768 | if ac_fn_c_try_compile "$LINENO"; then : | |
26769 | gl_cv_decl_null_works=yes | |
26770 | else | |
26771 | gl_cv_decl_null_works=no | |
26772 | fi | |
26773 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
26774 | fi | |
26775 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 | |
26776 | $as_echo "$gl_cv_decl_null_works" >&6; } | |
26777 | if test $gl_cv_decl_null_works = no; then | |
26778 | REPLACE_NULL=1 | |
26779 | STDDEF_H=stddef.h | |
26780 | fi | |
26781 | ||
c0c3707f | 26782 | |
63ce7108 TT |
26783 | if test -n "$STDDEF_H"; then |
26784 | GL_GENERATE_STDDEF_H_TRUE= | |
26785 | GL_GENERATE_STDDEF_H_FALSE='#' | |
26786 | else | |
26787 | GL_GENERATE_STDDEF_H_TRUE='#' | |
26788 | GL_GENERATE_STDDEF_H_FALSE= | |
26789 | fi | |
26790 | ||
26791 | if test -n "$STDDEF_H"; then | |
26792 | ||
26793 | ||
26794 | ||
26795 | ||
26796 | ||
26797 | ||
26798 | ||
26799 | ||
26800 | if test $gl_cv_have_include_next = yes; then | |
26801 | gl_cv_next_stddef_h='<'stddef.h'>' | |
26802 | else | |
26803 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5 | |
26804 | $as_echo_n "checking absolute name of <stddef.h>... " >&6; } | |
d0ac1c44 | 26805 | if ${gl_cv_next_stddef_h+:} false; then : |
63ce7108 TT |
26806 | $as_echo_n "(cached) " >&6 |
26807 | else | |
26808 | ||
4a626d0a PA |
26809 | |
26810 | ||
26811 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
63ce7108 TT |
26812 | /* end confdefs.h. */ |
26813 | #include <stddef.h> | |
63ce7108 | 26814 | _ACEOF |
4a626d0a PA |
26815 | case "$host_os" in |
26816 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
26817 | *) gl_absname_cpp="$ac_cpp" ;; | |
26818 | esac | |
63ce7108 | 26819 | |
4a626d0a PA |
26820 | case "$host_os" in |
26821 | mingw*) | |
26822 | gl_dirsep_regex='[/\\]' | |
26823 | ;; | |
26824 | *) | |
26825 | gl_dirsep_regex='\/' | |
26826 | ;; | |
26827 | esac | |
26828 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
26829 | gl_header_literal_regex=`echo 'stddef.h' \ | |
26830 | | sed -e "$gl_make_literal_regex_sed"` | |
26831 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
26832 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
26833 | s|^/[^/]|//&| | |
26834 | p | |
26835 | q | |
26836 | }' | |
63ce7108 | 26837 | |
4a626d0a PA |
26838 | gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
26839 | sed -n "$gl_absolute_header_sed"` | |
26840 | ||
26841 | gl_header=$gl_cv_absolute_stddef_h | |
26842 | gl_cv_next_stddef_h='"'$gl_header'"' | |
63ce7108 TT |
26843 | |
26844 | ||
26845 | fi | |
26846 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 | |
26847 | $as_echo "$gl_cv_next_stddef_h" >&6; } | |
26848 | fi | |
26849 | NEXT_STDDEF_H=$gl_cv_next_stddef_h | |
26850 | ||
26851 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
26852 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
26853 | gl_next_as_first_directive='<'stddef.h'>' | |
26854 | else | |
26855 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
26856 | gl_next_as_first_directive=$gl_cv_next_stddef_h | |
26857 | fi | |
26858 | NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive | |
26859 | ||
26860 | ||
26861 | ||
26862 | ||
26863 | fi | |
26864 | ||
26865 | ||
26866 | ||
26867 | ||
49e4877c | 26868 | $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h |
63ce7108 TT |
26869 | |
26870 | ||
26871 | ||
98399780 YQ |
26872 | |
26873 | ||
26874 | ||
26875 | ||
26876 | ||
4a626d0a PA |
26877 | |
26878 | ||
6a29c58e YQ |
26879 | if test $gl_cv_have_include_next = yes; then |
26880 | gl_cv_next_stdio_h='<'stdio.h'>' | |
26881 | else | |
26882 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5 | |
26883 | $as_echo_n "checking absolute name of <stdio.h>... " >&6; } | |
d0ac1c44 | 26884 | if ${gl_cv_next_stdio_h+:} false; then : |
6a29c58e YQ |
26885 | $as_echo_n "(cached) " >&6 |
26886 | else | |
26887 | ||
4a626d0a PA |
26888 | |
26889 | ||
26890 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6a29c58e YQ |
26891 | /* end confdefs.h. */ |
26892 | #include <stdio.h> | |
6a29c58e | 26893 | _ACEOF |
4a626d0a PA |
26894 | case "$host_os" in |
26895 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
26896 | *) gl_absname_cpp="$ac_cpp" ;; | |
26897 | esac | |
26898 | ||
26899 | case "$host_os" in | |
26900 | mingw*) | |
26901 | gl_dirsep_regex='[/\\]' | |
26902 | ;; | |
26903 | *) | |
26904 | gl_dirsep_regex='\/' | |
26905 | ;; | |
26906 | esac | |
26907 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
26908 | gl_header_literal_regex=`echo 'stdio.h' \ | |
26909 | | sed -e "$gl_make_literal_regex_sed"` | |
26910 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
26911 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
26912 | s|^/[^/]|//&| | |
26913 | p | |
26914 | q | |
26915 | }' | |
6a29c58e | 26916 | |
4a626d0a PA |
26917 | gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
26918 | sed -n "$gl_absolute_header_sed"` | |
6a29c58e | 26919 | |
4a626d0a PA |
26920 | gl_header=$gl_cv_absolute_stdio_h |
26921 | gl_cv_next_stdio_h='"'$gl_header'"' | |
6a29c58e YQ |
26922 | |
26923 | ||
26924 | fi | |
26925 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5 | |
26926 | $as_echo "$gl_cv_next_stdio_h" >&6; } | |
26927 | fi | |
26928 | NEXT_STDIO_H=$gl_cv_next_stdio_h | |
26929 | ||
26930 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
26931 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
26932 | gl_next_as_first_directive='<'stdio.h'>' | |
26933 | else | |
26934 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
26935 | gl_next_as_first_directive=$gl_cv_next_stdio_h | |
26936 | fi | |
26937 | NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive | |
26938 | ||
26939 | ||
26940 | ||
26941 | ||
26942 | ||
4a626d0a PA |
26943 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5 |
26944 | $as_echo_n "checking which flavor of printf attribute matches inttypes macros... " >&6; } | |
d0ac1c44 | 26945 | if ${gl_cv_func_printf_attribute_flavor+:} false; then : |
4a626d0a PA |
26946 | $as_echo_n "(cached) " >&6 |
26947 | else | |
26948 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
26949 | /* end confdefs.h. */ | |
26950 | ||
26951 | #define __STDC_FORMAT_MACROS 1 | |
26952 | #include <stdio.h> | |
26953 | #include <inttypes.h> | |
26954 | /* For non-mingw systems, compilation will trivially succeed. | |
26955 | For mingw, compilation will succeed for older mingw (system | |
26956 | printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ | |
c0c3707f | 26957 | #if (defined _WIN32 && ! defined __CYGWIN__) && \ |
4a626d0a PA |
26958 | (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) |
26959 | extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; | |
26960 | #endif | |
26961 | ||
26962 | int | |
26963 | main () | |
26964 | { | |
26965 | ||
26966 | ; | |
26967 | return 0; | |
26968 | } | |
26969 | _ACEOF | |
26970 | if ac_fn_c_try_compile "$LINENO"; then : | |
26971 | gl_cv_func_printf_attribute_flavor=system | |
26972 | else | |
26973 | gl_cv_func_printf_attribute_flavor=gnu | |
26974 | fi | |
26975 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
26976 | fi | |
26977 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5 | |
26978 | $as_echo "$gl_cv_func_printf_attribute_flavor" >&6; } | |
26979 | if test "$gl_cv_func_printf_attribute_flavor" = gnu; then | |
26980 | ||
26981 | $as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h | |
26982 | ||
26983 | fi | |
26984 | ||
6a29c58e YQ |
26985 | GNULIB_FSCANF=1 |
26986 | ||
26987 | ||
26988 | cat >>confdefs.h <<_ACEOF | |
26989 | #define GNULIB_FSCANF 1 | |
26990 | _ACEOF | |
26991 | ||
26992 | ||
26993 | GNULIB_SCANF=1 | |
26994 | ||
26995 | ||
26996 | cat >>confdefs.h <<_ACEOF | |
26997 | #define GNULIB_SCANF 1 | |
26998 | _ACEOF | |
26999 | ||
27000 | ||
27001 | GNULIB_FGETC=1 | |
27002 | GNULIB_GETC=1 | |
27003 | GNULIB_GETCHAR=1 | |
27004 | GNULIB_FGETS=1 | |
27005 | GNULIB_FREAD=1 | |
27006 | ||
27007 | ||
27008 | GNULIB_FPRINTF=1 | |
27009 | GNULIB_PRINTF=1 | |
27010 | GNULIB_VFPRINTF=1 | |
27011 | GNULIB_VPRINTF=1 | |
27012 | GNULIB_FPUTC=1 | |
27013 | GNULIB_PUTC=1 | |
27014 | GNULIB_PUTCHAR=1 | |
27015 | GNULIB_FPUTS=1 | |
27016 | GNULIB_PUTS=1 | |
27017 | GNULIB_FWRITE=1 | |
27018 | ||
27019 | ||
27020 | ||
27021 | ||
6a29c58e | 27022 | |
6a29c58e YQ |
27023 | |
27024 | ||
27025 | ||
27026 | ||
27027 | ||
27028 | ||
27029 | ||
27030 | ||
27031 | ||
27032 | ||
27033 | ||
27034 | ||
98399780 YQ |
27035 | if test $gl_cv_have_include_next = yes; then |
27036 | gl_cv_next_stdlib_h='<'stdlib.h'>' | |
27037 | else | |
27038 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5 | |
27039 | $as_echo_n "checking absolute name of <stdlib.h>... " >&6; } | |
d0ac1c44 | 27040 | if ${gl_cv_next_stdlib_h+:} false; then : |
98399780 YQ |
27041 | $as_echo_n "(cached) " >&6 |
27042 | else | |
27043 | ||
4a626d0a PA |
27044 | |
27045 | ||
27046 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
98399780 YQ |
27047 | /* end confdefs.h. */ |
27048 | #include <stdlib.h> | |
98399780 | 27049 | _ACEOF |
4a626d0a PA |
27050 | case "$host_os" in |
27051 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
27052 | *) gl_absname_cpp="$ac_cpp" ;; | |
27053 | esac | |
27054 | ||
27055 | case "$host_os" in | |
27056 | mingw*) | |
27057 | gl_dirsep_regex='[/\\]' | |
27058 | ;; | |
27059 | *) | |
27060 | gl_dirsep_regex='\/' | |
27061 | ;; | |
27062 | esac | |
27063 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
27064 | gl_header_literal_regex=`echo 'stdlib.h' \ | |
27065 | | sed -e "$gl_make_literal_regex_sed"` | |
27066 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
27067 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
27068 | s|^/[^/]|//&| | |
27069 | p | |
27070 | q | |
27071 | }' | |
98399780 | 27072 | |
4a626d0a PA |
27073 | gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | |
27074 | sed -n "$gl_absolute_header_sed"` | |
98399780 | 27075 | |
4a626d0a PA |
27076 | gl_header=$gl_cv_absolute_stdlib_h |
27077 | gl_cv_next_stdlib_h='"'$gl_header'"' | |
98399780 YQ |
27078 | |
27079 | ||
27080 | fi | |
27081 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5 | |
27082 | $as_echo "$gl_cv_next_stdlib_h" >&6; } | |
27083 | fi | |
27084 | NEXT_STDLIB_H=$gl_cv_next_stdlib_h | |
27085 | ||
27086 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
27087 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
27088 | gl_next_as_first_directive='<'stdlib.h'>' | |
27089 | else | |
27090 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
27091 | gl_next_as_first_directive=$gl_cv_next_stdlib_h | |
27092 | fi | |
27093 | NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive | |
27094 | ||
27095 | ||
27096 | ||
27097 | ||
27098 | ||
27099 | ||
98399780 | 27100 | |
98399780 YQ |
27101 | |
27102 | ||
27103 | ||
27104 | ||
27105 | ||
27106 | ||
8424cc97 SM |
27107 | for ac_func in strchrnul |
27108 | do : | |
27109 | ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul" | |
d0ac1c44 | 27110 | if test "x$ac_cv_func_strchrnul" = xyes; then : |
8424cc97 SM |
27111 | cat >>confdefs.h <<_ACEOF |
27112 | #define HAVE_STRCHRNUL 1 | |
27113 | _ACEOF | |
27114 | ||
27115 | fi | |
27116 | done | |
27117 | ||
27118 | if test $ac_cv_func_strchrnul = no; then | |
27119 | HAVE_STRCHRNUL=0 | |
27120 | else | |
27121 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strchrnul works" >&5 | |
27122 | $as_echo_n "checking whether strchrnul works... " >&6; } | |
d0ac1c44 | 27123 | if ${gl_cv_func_strchrnul_works+:} false; then : |
8424cc97 SM |
27124 | $as_echo_n "(cached) " >&6 |
27125 | else | |
27126 | if test "$cross_compiling" = yes; then : | |
27127 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27128 | /* end confdefs.h. */ | |
27129 | ||
27130 | #if defined __CYGWIN__ | |
27131 | #include <cygwin/version.h> | |
27132 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9) | |
27133 | Lucky user | |
27134 | #endif | |
27135 | #else | |
27136 | Lucky user | |
27137 | #endif | |
27138 | ||
27139 | _ACEOF | |
27140 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
27141 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
27142 | gl_cv_func_strchrnul_works="guessing yes" | |
27143 | else | |
27144 | gl_cv_func_strchrnul_works="guessing no" | |
27145 | fi | |
27146 | rm -f conftest* | |
27147 | ||
27148 | ||
27149 | else | |
27150 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27151 | /* end confdefs.h. */ | |
27152 | ||
27153 | #include <string.h> /* for strchrnul */ | |
27154 | ||
27155 | int | |
27156 | main () | |
27157 | { | |
27158 | const char *buf = "a"; | |
27159 | return strchrnul (buf, 'b') != buf + 1; | |
27160 | ||
27161 | ; | |
27162 | return 0; | |
27163 | } | |
27164 | _ACEOF | |
27165 | if ac_fn_c_try_run "$LINENO"; then : | |
27166 | gl_cv_func_strchrnul_works=yes | |
27167 | else | |
27168 | gl_cv_func_strchrnul_works=no | |
27169 | fi | |
27170 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
27171 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
27172 | fi | |
27173 | ||
27174 | ||
27175 | fi | |
27176 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strchrnul_works" >&5 | |
27177 | $as_echo "$gl_cv_func_strchrnul_works" >&6; } | |
27178 | case "$gl_cv_func_strchrnul_works" in | |
27179 | *yes) ;; | |
27180 | *) REPLACE_STRCHRNUL=1 ;; | |
27181 | esac | |
27182 | fi | |
27183 | ||
27184 | if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then | |
27185 | ||
27186 | ||
27187 | ||
27188 | ||
27189 | ||
27190 | ||
27191 | ||
27192 | ||
27193 | gl_LIBOBJS="$gl_LIBOBJS strchrnul.$ac_objext" | |
27194 | ||
27195 | : | |
27196 | fi | |
27197 | ||
27198 | ||
27199 | ||
27200 | ||
27201 | ||
27202 | GNULIB_STRCHRNUL=1 | |
27203 | ||
27204 | ||
27205 | ||
27206 | ||
27207 | ||
27208 | $as_echo "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h | |
27209 | ||
27210 | ||
27211 | ||
27212 | ||
27213 | ||
27214 | ||
27215 | ||
6ec2e0f5 SDJ |
27216 | if test $ac_cv_func_strdup = yes; then |
27217 | if test $gl_cv_func_malloc_posix != yes; then | |
27218 | REPLACE_STRDUP=1 | |
27219 | fi | |
27220 | fi | |
27221 | ||
27222 | if test $ac_cv_have_decl_strdup = no; then | |
27223 | HAVE_DECL_STRDUP=0 | |
27224 | fi | |
27225 | ||
27226 | if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then | |
27227 | ||
27228 | ||
27229 | ||
27230 | ||
27231 | ||
27232 | ||
27233 | ||
27234 | ||
27235 | gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext" | |
27236 | ||
27237 | : | |
27238 | fi | |
27239 | ||
27240 | ||
27241 | ||
27242 | ||
27243 | ||
27244 | GNULIB_STRDUP=1 | |
27245 | ||
27246 | ||
27247 | ||
27248 | ||
27249 | ||
27250 | $as_echo "#define GNULIB_TEST_STRDUP 1" >>confdefs.h | |
27251 | ||
27252 | ||
27253 | ||
27254 | ||
27255 | ||
27256 | ||
27257 | ||
27258 | ||
5abebf3c CB |
27259 | |
27260 | ||
6ec2e0f5 SDJ |
27261 | if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then |
27262 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5 | |
27263 | $as_echo_n "checking for working strerror function... " >&6; } | |
d0ac1c44 | 27264 | if ${gl_cv_func_working_strerror+:} false; then : |
6ec2e0f5 SDJ |
27265 | $as_echo_n "(cached) " >&6 |
27266 | else | |
27267 | if test "$cross_compiling" = yes; then : | |
27268 | case "$host_os" in | |
c0c3707f CB |
27269 | # Guess yes on glibc systems. |
27270 | *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;; | |
27271 | # Guess yes on musl systems. | |
27272 | *-musl*) gl_cv_func_working_strerror="guessing yes" ;; | |
27273 | # If we don't know, obey --enable-cross-guesses. | |
27274 | *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;; | |
6ec2e0f5 SDJ |
27275 | esac |
27276 | ||
27277 | else | |
27278 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27279 | /* end confdefs.h. */ | |
27280 | #include <string.h> | |
27281 | ||
27282 | int | |
27283 | main () | |
27284 | { | |
27285 | if (!*strerror (-2)) return 1; | |
27286 | ; | |
27287 | return 0; | |
27288 | } | |
27289 | _ACEOF | |
27290 | if ac_fn_c_try_run "$LINENO"; then : | |
27291 | gl_cv_func_working_strerror=yes | |
27292 | else | |
27293 | gl_cv_func_working_strerror=no | |
27294 | fi | |
27295 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
27296 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
27297 | fi | |
27298 | ||
27299 | ||
27300 | fi | |
27301 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5 | |
27302 | $as_echo "$gl_cv_func_working_strerror" >&6; } | |
27303 | case "$gl_cv_func_working_strerror" in | |
27304 | *yes) ;; | |
27305 | *) | |
27306 | REPLACE_STRERROR=1 | |
27307 | ;; | |
27308 | esac | |
27309 | ||
5abebf3c CB |
27310 | case "$gl_cv_func_strerror_r_works" in |
27311 | *no) REPLACE_STRERROR=1 ;; | |
27312 | esac | |
27313 | ||
6ec2e0f5 SDJ |
27314 | else |
27315 | REPLACE_STRERROR=1 | |
27316 | fi | |
27317 | ||
27318 | if test $REPLACE_STRERROR = 1; then | |
27319 | ||
27320 | ||
27321 | ||
27322 | ||
27323 | ||
27324 | ||
27325 | ||
27326 | ||
27327 | gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext" | |
27328 | ||
27329 | fi | |
27330 | ||
27331 | ||
27332 | cat >>confdefs.h <<_ACEOF | |
27333 | #define GNULIB_STRERROR 1 | |
27334 | _ACEOF | |
27335 | ||
27336 | ||
27337 | ||
27338 | ||
27339 | ||
27340 | ||
27341 | ||
27342 | GNULIB_STRERROR=1 | |
27343 | ||
27344 | ||
27345 | ||
27346 | ||
27347 | ||
27348 | $as_echo "#define GNULIB_TEST_STRERROR 1" >>confdefs.h | |
27349 | ||
27350 | ||
27351 | ||
27352 | ||
27353 | ||
27354 | if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then | |
27355 | ||
27356 | ||
27357 | ||
27358 | ||
27359 | ||
27360 | ||
27361 | ||
27362 | ||
27363 | gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext" | |
27364 | ||
27365 | ||
27366 | ||
27367 | ||
27368 | ||
27369 | if test $ac_cv_header_sys_socket_h != yes; then | |
27370 | for ac_header in winsock2.h | |
27371 | do : | |
27372 | ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" | |
d0ac1c44 | 27373 | if test "x$ac_cv_header_winsock2_h" = xyes; then : |
6ec2e0f5 SDJ |
27374 | cat >>confdefs.h <<_ACEOF |
27375 | #define HAVE_WINSOCK2_H 1 | |
27376 | _ACEOF | |
27377 | ||
27378 | fi | |
27379 | ||
27380 | done | |
27381 | ||
27382 | fi | |
27383 | if test "$ac_cv_header_winsock2_h" = yes; then | |
27384 | HAVE_WINSOCK2_H=1 | |
27385 | UNISTD_H_HAVE_WINSOCK2_H=1 | |
27386 | SYS_IOCTL_H_HAVE_WINSOCK2_H=1 | |
27387 | else | |
27388 | HAVE_WINSOCK2_H=0 | |
27389 | fi | |
27390 | ||
27391 | ||
27392 | fi | |
27393 | ||
27394 | ||
27395 | ||
27396 | ||
98399780 | 27397 | |
5abebf3c | 27398 | |
5abebf3c | 27399 | |
c0c3707f CB |
27400 | if test $ac_cv_have_decl_strerror_r = no; then |
27401 | HAVE_DECL_STRERROR_R=0 | |
27402 | fi | |
5abebf3c CB |
27403 | |
27404 | if test $ac_cv_func_strerror_r = yes; then | |
27405 | if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then | |
27406 | if test $gl_cv_func_strerror_r_posix_signature = yes; then | |
27407 | case "$gl_cv_func_strerror_r_works" in | |
27408 | *no) REPLACE_STRERROR_R=1 ;; | |
27409 | esac | |
27410 | else | |
27411 | REPLACE_STRERROR_R=1 | |
27412 | fi | |
27413 | else | |
27414 | REPLACE_STRERROR_R=1 | |
27415 | fi | |
27416 | fi | |
27417 | ||
5abebf3c CB |
27418 | if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then |
27419 | ||
27420 | ||
27421 | ||
27422 | ||
27423 | ||
27424 | ||
27425 | ||
27426 | ||
27427 | gl_LIBOBJS="$gl_LIBOBJS strerror_r.$ac_objext" | |
27428 | ||
27429 | ||
27430 | ||
5abebf3c CB |
27431 | |
27432 | ||
27433 | ||
c0c3707f | 27434 | fi |
5abebf3c CB |
27435 | |
27436 | ||
27437 | ||
27438 | ||
5abebf3c | 27439 | |
c0c3707f | 27440 | GNULIB_STRERROR_R=1 |
5abebf3c CB |
27441 | |
27442 | ||
27443 | ||
27444 | ||
5abebf3c | 27445 | |
c0c3707f | 27446 | $as_echo "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h |
5abebf3c CB |
27447 | |
27448 | ||
27449 | ||
27450 | ||
5abebf3c | 27451 | |
c0c3707f CB |
27452 | cat >>confdefs.h <<_ACEOF |
27453 | #define GNULIB_STRERROR_R_POSIX 1 | |
27454 | _ACEOF | |
5abebf3c CB |
27455 | |
27456 | ||
27457 | ||
27458 | ||
27459 | ||
27460 | ||
27461 | ||
63ce7108 TT |
27462 | if test $REPLACE_STRSTR = 0; then |
27463 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works in linear time" >&5 | |
27464 | $as_echo_n "checking whether strstr works in linear time... " >&6; } | |
d0ac1c44 | 27465 | if ${gl_cv_func_strstr_linear+:} false; then : |
63ce7108 TT |
27466 | $as_echo_n "(cached) " >&6 |
27467 | else | |
27468 | if test "$cross_compiling" = yes; then : | |
27469 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27470 | /* end confdefs.h. */ | |
27471 | ||
27472 | #include <features.h> | |
27473 | #ifdef __GNU_LIBRARY__ | |
27474 | #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ | |
27475 | && !(defined __i386__ || defined __x86_64__) \ | |
27476 | && !defined __UCLIBC__ | |
27477 | Lucky user | |
27478 | #endif | |
27479 | #endif | |
27480 | #ifdef __CYGWIN__ | |
27481 | #include <cygwin/version.h> | |
27482 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) | |
27483 | Lucky user | |
27484 | #endif | |
27485 | #endif | |
27486 | ||
27487 | _ACEOF | |
27488 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
27489 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
27490 | gl_cv_func_strstr_linear="guessing yes" | |
c971b7fa | 27491 | else |
c0c3707f | 27492 | gl_cv_func_strstr_linear="$gl_cross_guess_normal" |
c971b7fa PA |
27493 | fi |
27494 | rm -f conftest* | |
27495 | ||
27496 | ||
27497 | else | |
27498 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27499 | /* end confdefs.h. */ | |
27500 | ||
49e4877c PA |
27501 | #ifdef __MVS__ |
27502 | /* z/OS does not deliver signals while strstr() is running (thanks to | |
27503 | restrictions on its LE runtime), which prevents us from limiting the | |
27504 | running time of this test. */ | |
27505 | # error "This test does not work properly on z/OS" | |
27506 | #endif | |
c971b7fa | 27507 | #include <signal.h> /* for signal */ |
63ce7108 | 27508 | #include <string.h> /* for strstr */ |
c971b7fa PA |
27509 | #include <stdlib.h> /* for malloc */ |
27510 | #include <unistd.h> /* for alarm */ | |
49e4877c | 27511 | static void quit (int sig) { _exit (sig + 128); } |
c971b7fa PA |
27512 | |
27513 | int | |
27514 | main () | |
27515 | { | |
27516 | ||
27517 | int result = 0; | |
27518 | size_t m = 1000000; | |
63ce7108 TT |
27519 | char *haystack = (char *) malloc (2 * m + 2); |
27520 | char *needle = (char *) malloc (m + 2); | |
c971b7fa | 27521 | /* Failure to compile this test due to missing alarm is okay, |
63ce7108 | 27522 | since all such platforms (mingw) also have quadratic strstr. */ |
c971b7fa PA |
27523 | signal (SIGALRM, quit); |
27524 | alarm (5); | |
27525 | /* Check for quadratic performance. */ | |
27526 | if (haystack && needle) | |
27527 | { | |
27528 | memset (haystack, 'A', 2 * m); | |
27529 | haystack[2 * m] = 'B'; | |
63ce7108 | 27530 | haystack[2 * m + 1] = 0; |
c971b7fa PA |
27531 | memset (needle, 'A', m); |
27532 | needle[m] = 'B'; | |
63ce7108 TT |
27533 | needle[m + 1] = 0; |
27534 | if (!strstr (haystack, needle)) | |
c971b7fa PA |
27535 | result |= 1; |
27536 | } | |
c0c3707f CB |
27537 | /* Free allocated memory, in case some sanitizer is watching. */ |
27538 | free (haystack); | |
27539 | free (needle); | |
c971b7fa PA |
27540 | return result; |
27541 | ||
27542 | ; | |
27543 | return 0; | |
27544 | } | |
27545 | _ACEOF | |
27546 | if ac_fn_c_try_run "$LINENO"; then : | |
63ce7108 | 27547 | gl_cv_func_strstr_linear=yes |
c971b7fa | 27548 | else |
63ce7108 | 27549 | gl_cv_func_strstr_linear=no |
c971b7fa PA |
27550 | fi |
27551 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
27552 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
27553 | fi | |
27554 | ||
27555 | ||
27556 | fi | |
63ce7108 TT |
27557 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_linear" >&5 |
27558 | $as_echo "$gl_cv_func_strstr_linear" >&6; } | |
27559 | case "$gl_cv_func_strstr_linear" in | |
40a73391 JK |
27560 | *yes) ;; |
27561 | *) | |
63ce7108 | 27562 | REPLACE_STRSTR=1 |
40a73391 JK |
27563 | ;; |
27564 | esac | |
c971b7fa PA |
27565 | fi |
27566 | ||
63ce7108 | 27567 | if test $REPLACE_STRSTR = 1; then |
c971b7fa PA |
27568 | |
27569 | ||
27570 | ||
27571 | ||
27572 | ||
27573 | ||
27574 | ||
27575 | ||
63ce7108 | 27576 | gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext" |
c971b7fa | 27577 | |
a512b375 | 27578 | fi |
c971b7fa PA |
27579 | |
27580 | ||
27581 | ||
c0c3707f | 27582 | if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then |
63ce7108 | 27583 | REPLACE_STRSTR=1 |
c971b7fa | 27584 | else |
c0c3707f | 27585 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5 |
63ce7108 | 27586 | $as_echo_n "checking whether strstr works... " >&6; } |
d0ac1c44 | 27587 | if ${gl_cv_func_strstr_works_always+:} false; then : |
c971b7fa PA |
27588 | $as_echo_n "(cached) " >&6 |
27589 | else | |
27590 | if test "$cross_compiling" = yes; then : | |
c0c3707f | 27591 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
c971b7fa PA |
27592 | /* end confdefs.h. */ |
27593 | ||
27594 | #ifdef __GNU_LIBRARY__ | |
27595 | #include <features.h> | |
63ce7108 | 27596 | #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ |
c971b7fa PA |
27597 | || defined __UCLIBC__ |
27598 | Lucky user | |
27599 | #endif | |
27600 | #elif defined __CYGWIN__ | |
27601 | #include <cygwin/version.h> | |
27602 | #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) | |
27603 | Lucky user | |
27604 | #endif | |
27605 | #else | |
27606 | Lucky user | |
27607 | #endif | |
27608 | ||
27609 | _ACEOF | |
27610 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
27611 | $EGREP "Lucky user" >/dev/null 2>&1; then : | |
63ce7108 | 27612 | gl_cv_func_strstr_works_always="guessing yes" |
c971b7fa | 27613 | else |
c0c3707f | 27614 | gl_cv_func_strstr_works_always="$gl_cross_guess_normal" |
c971b7fa PA |
27615 | fi |
27616 | rm -f conftest* | |
27617 | ||
27618 | ||
27619 | else | |
27620 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27621 | /* end confdefs.h. */ | |
27622 | ||
63ce7108 | 27623 | #include <string.h> /* for strstr */ |
c0c3707f CB |
27624 | #ifdef __GNU_LIBRARY__ |
27625 | #include <features.h> | |
27626 | #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28 | |
27627 | Unlucky user | |
27628 | #endif | |
27629 | #endif | |
c971b7fa PA |
27630 | #define P "_EF_BF_BD" |
27631 | #define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P | |
27632 | #define NEEDLE P P P P P | |
27633 | ||
27634 | int | |
27635 | main () | |
27636 | { | |
63ce7108 | 27637 | return !!strstr (HAYSTACK, NEEDLE); |
c971b7fa PA |
27638 | |
27639 | ; | |
27640 | return 0; | |
27641 | } | |
27642 | _ACEOF | |
27643 | if ac_fn_c_try_run "$LINENO"; then : | |
63ce7108 | 27644 | gl_cv_func_strstr_works_always=yes |
c971b7fa | 27645 | else |
63ce7108 | 27646 | gl_cv_func_strstr_works_always=no |
c971b7fa PA |
27647 | fi |
27648 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
27649 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
27650 | fi | |
27651 | ||
27652 | ||
27653 | fi | |
63ce7108 TT |
27654 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5 |
27655 | $as_echo "$gl_cv_func_strstr_works_always" >&6; } | |
27656 | case "$gl_cv_func_strstr_works_always" in | |
40a73391 JK |
27657 | *yes) ;; |
27658 | *) | |
63ce7108 | 27659 | REPLACE_STRSTR=1 |
40a73391 JK |
27660 | ;; |
27661 | esac | |
c971b7fa | 27662 | fi |
8839a007 | 27663 | |
63ce7108 | 27664 | if test $REPLACE_STRSTR = 1; then |
8839a007 | 27665 | |
8690e634 JK |
27666 | |
27667 | ||
8690e634 JK |
27668 | |
27669 | ||
27670 | ||
27671 | ||
27672 | ||
63ce7108 | 27673 | gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext" |
8690e634 | 27674 | |
8690e634 JK |
27675 | fi |
27676 | ||
8690e634 JK |
27677 | |
27678 | ||
8690e634 | 27679 | |
8690e634 | 27680 | |
63ce7108 | 27681 | GNULIB_STRSTR=1 |
8690e634 JK |
27682 | |
27683 | ||
27684 | ||
8690e634 JK |
27685 | |
27686 | ||
63ce7108 | 27687 | $as_echo "#define GNULIB_TEST_STRSTR 1" >>confdefs.h |
8690e634 JK |
27688 | |
27689 | ||
27690 | ||
27691 | ||
27692 | ||
27693 | ||
27694 | ||
421693b0 PA |
27695 | for ac_func in strtok_r |
27696 | do : | |
27697 | ac_fn_c_check_func "$LINENO" "strtok_r" "ac_cv_func_strtok_r" | |
d0ac1c44 | 27698 | if test "x$ac_cv_func_strtok_r" = xyes; then : |
421693b0 PA |
27699 | cat >>confdefs.h <<_ACEOF |
27700 | #define HAVE_STRTOK_R 1 | |
27701 | _ACEOF | |
27702 | ||
27703 | fi | |
27704 | done | |
27705 | ||
27706 | if test $ac_cv_func_strtok_r = yes; then | |
27707 | HAVE_STRTOK_R=1 | |
27708 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtok_r works" >&5 | |
27709 | $as_echo_n "checking whether strtok_r works... " >&6; } | |
d0ac1c44 | 27710 | if ${gl_cv_func_strtok_r_works+:} false; then : |
421693b0 PA |
27711 | $as_echo_n "(cached) " >&6 |
27712 | else | |
27713 | if test "$cross_compiling" = yes; then : | |
c0c3707f CB |
27714 | case "$host_os" in |
27715 | # Guess no on glibc systems. | |
27716 | *-gnu* | gnu*) gl_cv_func_strtok_r_works="guessing no" ;; | |
27717 | # Guess yes on native Windows. | |
27718 | mingw*) gl_cv_func_strtok_r_works="guessing yes" ;; | |
27719 | *) gl_cv_func_strtok_r_works="guessing yes" ;; | |
421693b0 PA |
27720 | esac |
27721 | ||
27722 | else | |
27723 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27724 | /* end confdefs.h. */ | |
27725 | ||
27726 | #ifndef __OPTIMIZE__ | |
27727 | # define __OPTIMIZE__ 1 | |
27728 | #endif | |
27729 | #undef __OPTIMIZE_SIZE__ | |
27730 | #undef __NO_INLINE__ | |
27731 | #include <stdlib.h> | |
27732 | #include <string.h> | |
27733 | ||
27734 | int | |
27735 | main () | |
27736 | { | |
27737 | static const char dummy[] = "\177\01a"; | |
27738 | char delimiters[] = "xxxxxxxx"; | |
27739 | char *save_ptr = (char *) dummy; | |
27740 | strtok_r (delimiters, "x", &save_ptr); | |
27741 | strtok_r (NULL, "x", &save_ptr); | |
27742 | return 0; | |
27743 | ||
27744 | ; | |
27745 | return 0; | |
27746 | } | |
27747 | ||
27748 | _ACEOF | |
27749 | if ac_fn_c_try_run "$LINENO"; then : | |
27750 | gl_cv_func_strtok_r_works=yes | |
27751 | else | |
27752 | gl_cv_func_strtok_r_works=no | |
27753 | fi | |
27754 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
27755 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
27756 | fi | |
27757 | ||
27758 | ||
27759 | fi | |
27760 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtok_r_works" >&5 | |
27761 | $as_echo "$gl_cv_func_strtok_r_works" >&6; } | |
27762 | case "$gl_cv_func_strtok_r_works" in | |
27763 | *no) | |
27764 | UNDEFINE_STRTOK_R=1 | |
27765 | ;; | |
27766 | esac | |
27767 | else | |
27768 | HAVE_STRTOK_R=0 | |
27769 | fi | |
27770 | ||
27771 | if test $ac_cv_have_decl_strtok_r = no; then | |
27772 | HAVE_DECL_STRTOK_R=0 | |
27773 | fi | |
27774 | ||
27775 | if test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1; then | |
27776 | ||
27777 | ||
27778 | ||
27779 | ||
27780 | ||
27781 | ||
27782 | ||
27783 | ||
27784 | gl_LIBOBJS="$gl_LIBOBJS strtok_r.$ac_objext" | |
27785 | ||
27786 | ||
27787 | : | |
27788 | ||
27789 | fi | |
27790 | ||
27791 | ||
27792 | ||
27793 | ||
27794 | ||
27795 | GNULIB_STRTOK_R=1 | |
27796 | ||
27797 | ||
27798 | ||
27799 | ||
27800 | ||
27801 | $as_echo "#define GNULIB_TEST_STRTOK_R 1" >>confdefs.h | |
27802 | ||
27803 | ||
27804 | ||
27805 | ||
27806 | ||
27807 | ||
27808 | ||
8690e634 JK |
27809 | |
27810 | ||
27811 | ||
27812 | ||
27813 | ||
8690e634 | 27814 | |
09607c9e | 27815 | |
725e2999 JB |
27816 | |
27817 | ||
09607c9e TT |
27818 | |
27819 | ||
27820 | ||
27821 | if test $gl_cv_have_include_next = yes; then | |
27822 | gl_cv_next_sys_stat_h='<'sys/stat.h'>' | |
27823 | else | |
27824 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5 | |
27825 | $as_echo_n "checking absolute name of <sys/stat.h>... " >&6; } | |
d0ac1c44 | 27826 | if ${gl_cv_next_sys_stat_h+:} false; then : |
09607c9e TT |
27827 | $as_echo_n "(cached) " >&6 |
27828 | else | |
27829 | ||
27830 | if test $ac_cv_header_sys_stat_h = yes; then | |
27831 | ||
27832 | ||
4a626d0a PA |
27833 | |
27834 | ||
27835 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
09607c9e TT |
27836 | /* end confdefs.h. */ |
27837 | #include <sys/stat.h> | |
09607c9e | 27838 | _ACEOF |
4a626d0a PA |
27839 | case "$host_os" in |
27840 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
27841 | *) gl_absname_cpp="$ac_cpp" ;; | |
27842 | esac | |
27843 | ||
27844 | case "$host_os" in | |
27845 | mingw*) | |
27846 | gl_dirsep_regex='[/\\]' | |
27847 | ;; | |
27848 | *) | |
27849 | gl_dirsep_regex='\/' | |
27850 | ;; | |
27851 | esac | |
27852 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
27853 | gl_header_literal_regex=`echo 'sys/stat.h' \ | |
27854 | | sed -e "$gl_make_literal_regex_sed"` | |
27855 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
27856 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
27857 | s|^/[^/]|//&| | |
27858 | p | |
27859 | q | |
27860 | }' | |
27861 | ||
27862 | gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
27863 | sed -n "$gl_absolute_header_sed"` | |
27864 | ||
27865 | gl_header=$gl_cv_absolute_sys_stat_h | |
27866 | gl_cv_next_sys_stat_h='"'$gl_header'"' | |
09607c9e TT |
27867 | else |
27868 | gl_cv_next_sys_stat_h='<'sys/stat.h'>' | |
27869 | fi | |
27870 | ||
27871 | ||
27872 | fi | |
27873 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5 | |
27874 | $as_echo "$gl_cv_next_sys_stat_h" >&6; } | |
27875 | fi | |
27876 | NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h | |
27877 | ||
27878 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
27879 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
27880 | gl_next_as_first_directive='<'sys/stat.h'>' | |
27881 | else | |
27882 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
27883 | gl_next_as_first_directive=$gl_cv_next_sys_stat_h | |
27884 | fi | |
27885 | NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive | |
27886 | ||
27887 | ||
27888 | ||
27889 | ||
27890 | ||
27891 | ||
27892 | ||
27893 | ||
c0c3707f CB |
27894 | WINDOWS_STAT_TIMESPEC=0 |
27895 | ||
27896 | ||
2196f55f | 27897 | |
09607c9e TT |
27898 | |
27899 | ||
09607c9e | 27900 | |
09607c9e | 27901 | |
09607c9e TT |
27902 | |
27903 | ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h> | |
27904 | #include <sys/stat.h> | |
27905 | " | |
d0ac1c44 | 27906 | if test "x$ac_cv_type_nlink_t" = xyes; then : |
09607c9e TT |
27907 | |
27908 | else | |
27909 | ||
c0c3707f | 27910 | $as_echo "#define nlink_t int" >>confdefs.h |
09607c9e | 27911 | |
c0c3707f | 27912 | fi |
09607c9e TT |
27913 | |
27914 | ||
27915 | ||
27916 | ||
27917 | ||
27918 | ||
27919 | ||
27920 | ||
27921 | ||
27922 | ||
725e2999 JB |
27923 | |
27924 | ||
27925 | ||
27926 | ||
27927 | ||
27928 | ||
725e2999 JB |
27929 | |
27930 | ||
27931 | ||
27932 | ||
27933 | ||
27934 | ||
27935 | ||
27936 | ||
27937 | if test $gl_cv_have_include_next = yes; then | |
27938 | gl_cv_next_sys_uio_h='<'sys/uio.h'>' | |
27939 | else | |
27940 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5 | |
27941 | $as_echo_n "checking absolute name of <sys/uio.h>... " >&6; } | |
27942 | if ${gl_cv_next_sys_uio_h+:} false; then : | |
27943 | $as_echo_n "(cached) " >&6 | |
27944 | else | |
27945 | ||
27946 | if test $ac_cv_header_sys_uio_h = yes; then | |
27947 | ||
27948 | ||
27949 | ||
27950 | ||
27951 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
27952 | /* end confdefs.h. */ | |
27953 | #include <sys/uio.h> | |
27954 | _ACEOF | |
27955 | case "$host_os" in | |
27956 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
27957 | *) gl_absname_cpp="$ac_cpp" ;; | |
27958 | esac | |
27959 | ||
27960 | case "$host_os" in | |
27961 | mingw*) | |
27962 | gl_dirsep_regex='[/\\]' | |
27963 | ;; | |
27964 | *) | |
27965 | gl_dirsep_regex='\/' | |
27966 | ;; | |
27967 | esac | |
27968 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
27969 | gl_header_literal_regex=`echo 'sys/uio.h' \ | |
27970 | | sed -e "$gl_make_literal_regex_sed"` | |
27971 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
27972 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
27973 | s|^/[^/]|//&| | |
27974 | p | |
27975 | q | |
27976 | }' | |
27977 | ||
27978 | gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
27979 | sed -n "$gl_absolute_header_sed"` | |
27980 | ||
27981 | gl_header=$gl_cv_absolute_sys_uio_h | |
27982 | gl_cv_next_sys_uio_h='"'$gl_header'"' | |
27983 | else | |
27984 | gl_cv_next_sys_uio_h='<'sys/uio.h'>' | |
27985 | fi | |
27986 | ||
27987 | ||
27988 | fi | |
27989 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5 | |
27990 | $as_echo "$gl_cv_next_sys_uio_h" >&6; } | |
27991 | fi | |
27992 | NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h | |
27993 | ||
27994 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
27995 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
27996 | gl_next_as_first_directive='<'sys/uio.h'>' | |
27997 | else | |
27998 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
27999 | gl_next_as_first_directive=$gl_cv_next_sys_uio_h | |
28000 | fi | |
28001 | NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive | |
28002 | ||
28003 | ||
28004 | ||
28005 | ||
28006 | if test $ac_cv_header_sys_uio_h = yes; then | |
28007 | HAVE_SYS_UIO_H=1 | |
28008 | else | |
28009 | HAVE_SYS_UIO_H=0 | |
28010 | fi | |
28011 | ||
28012 | ||
28013 | ||
28014 | ||
28015 | ||
2d8adcbd MM |
28016 | : |
28017 | ||
28018 | ||
28019 | ||
28020 | ||
09607c9e TT |
28021 | |
28022 | ||
28023 | ||
8839a007 PA |
28024 | |
28025 | ||
28026 | ||
28027 | ||
09607c9e | 28028 | |
c0c3707f CB |
28029 | 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, |
28030 | gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has | |
28031 | been included before. */ | |
28032 | #if defined __MINGW32__ | |
28033 | # include <unistd.h> | |
28034 | #endif | |
28035 | #include <time.h> | |
09607c9e | 28036 | |
f8e27d88 CB |
28037 | " |
28038 | if test "x$ac_cv_have_decl_localtime_r" = xyes; then : | |
28039 | ac_have_decl=1 | |
28040 | else | |
28041 | ac_have_decl=0 | |
28042 | fi | |
28043 | ||
28044 | cat >>confdefs.h <<_ACEOF | |
28045 | #define HAVE_DECL_LOCALTIME_R $ac_have_decl | |
28046 | _ACEOF | |
28047 | ||
28048 | if test $ac_cv_have_decl_localtime_r = no; then | |
28049 | HAVE_DECL_LOCALTIME_R=0 | |
28050 | fi | |
28051 | ||
28052 | ||
f8e27d88 CB |
28053 | if test $ac_cv_func_localtime_r = yes; then |
28054 | HAVE_LOCALTIME_R=1 | |
28055 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5 | |
28056 | $as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; } | |
28057 | if ${gl_cv_time_r_posix+:} false; then : | |
28058 | $as_echo_n "(cached) " >&6 | |
28059 | else | |
28060 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28061 | /* end confdefs.h. */ | |
c0c3707f CB |
28062 | /* mingw's <time.h> provides the functions asctime_r, ctime_r, |
28063 | gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has | |
28064 | been included before. */ | |
28065 | #if defined __MINGW32__ | |
28066 | # include <unistd.h> | |
28067 | #endif | |
28068 | #include <time.h> | |
28069 | ||
f8e27d88 CB |
28070 | int |
28071 | main () | |
28072 | { | |
28073 | /* We don't need to append 'restrict's to the argument types, | |
28074 | even though the POSIX signature has the 'restrict's, | |
28075 | since C99 says they can't affect type compatibility. */ | |
28076 | struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; | |
28077 | if (ptr) return 0; | |
28078 | /* Check the return type is a pointer. | |
28079 | On HP-UX 10 it is 'int'. */ | |
28080 | *localtime_r (0, 0); | |
28081 | ; | |
28082 | return 0; | |
28083 | } | |
28084 | ||
28085 | _ACEOF | |
28086 | if ac_fn_c_try_compile "$LINENO"; then : | |
28087 | gl_cv_time_r_posix=yes | |
28088 | else | |
28089 | gl_cv_time_r_posix=no | |
28090 | fi | |
28091 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
28092 | ||
28093 | fi | |
28094 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5 | |
28095 | $as_echo "$gl_cv_time_r_posix" >&6; } | |
28096 | if test $gl_cv_time_r_posix = yes; then | |
28097 | REPLACE_LOCALTIME_R=0 | |
28098 | else | |
28099 | REPLACE_LOCALTIME_R=1 | |
28100 | fi | |
28101 | else | |
28102 | HAVE_LOCALTIME_R=0 | |
c0c3707f CB |
28103 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r exists as an inline function" >&5 |
28104 | $as_echo_n "checking whether localtime_r exists as an inline function... " >&6; } | |
28105 | if ${gl_cv_func_localtime_r_inline+:} false; then : | |
28106 | $as_echo_n "(cached) " >&6 | |
28107 | else | |
28108 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28109 | /* end confdefs.h. */ | |
28110 | /* mingw's <time.h> provides the functions asctime_r, ctime_r, | |
28111 | gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has | |
28112 | been included before. */ | |
28113 | #if defined __MINGW32__ | |
28114 | # include <unistd.h> | |
28115 | #endif | |
28116 | #include <time.h> | |
28117 | ||
28118 | int | |
28119 | main () | |
28120 | { | |
28121 | time_t a; | |
28122 | struct tm r; | |
28123 | localtime_r (&a, &r); | |
28124 | ||
28125 | ; | |
28126 | return 0; | |
28127 | } | |
28128 | ||
28129 | _ACEOF | |
28130 | if ac_fn_c_try_link "$LINENO"; then : | |
28131 | gl_cv_func_localtime_r_inline=yes | |
28132 | else | |
28133 | gl_cv_func_localtime_r_inline=no | |
28134 | fi | |
28135 | rm -f core conftest.err conftest.$ac_objext \ | |
28136 | conftest$ac_exeext conftest.$ac_ext | |
28137 | ||
28138 | fi | |
28139 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_localtime_r_inline" >&5 | |
28140 | $as_echo "$gl_cv_func_localtime_r_inline" >&6; } | |
28141 | if test $gl_cv_func_localtime_r_inline = yes; then | |
28142 | REPLACE_LOCALTIME_R=1 | |
28143 | fi | |
f8e27d88 CB |
28144 | fi |
28145 | ||
28146 | if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then | |
28147 | ||
28148 | ||
28149 | ||
28150 | ||
28151 | ||
28152 | ||
28153 | ||
28154 | ||
28155 | gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext" | |
28156 | ||
28157 | ||
28158 | : | |
28159 | ||
28160 | fi | |
28161 | ||
28162 | ||
28163 | ||
28164 | ||
28165 | ||
28166 | GNULIB_TIME_R=1 | |
28167 | ||
28168 | ||
28169 | ||
28170 | ||
28171 | ||
28172 | $as_echo "#define GNULIB_TEST_TIME_R 1" >>confdefs.h | |
28173 | ||
28174 | ||
28175 | ||
28176 | ||
28177 | ||
28178 | ||
28179 | ||
28180 | ||
28181 | ||
5abebf3c CB |
28182 | |
28183 | ||
28184 | ||
8839a007 PA |
28185 | |
28186 | ||
28187 | ||
28188 | if test $gl_cv_have_include_next = yes; then | |
28189 | gl_cv_next_unistd_h='<'unistd.h'>' | |
28190 | else | |
28191 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5 | |
28192 | $as_echo_n "checking absolute name of <unistd.h>... " >&6; } | |
d0ac1c44 | 28193 | if ${gl_cv_next_unistd_h+:} false; then : |
8839a007 PA |
28194 | $as_echo_n "(cached) " >&6 |
28195 | else | |
28196 | ||
28197 | if test $ac_cv_header_unistd_h = yes; then | |
28198 | ||
28199 | ||
4a626d0a PA |
28200 | |
28201 | ||
28202 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8839a007 PA |
28203 | /* end confdefs.h. */ |
28204 | #include <unistd.h> | |
8839a007 | 28205 | _ACEOF |
4a626d0a PA |
28206 | case "$host_os" in |
28207 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
28208 | *) gl_absname_cpp="$ac_cpp" ;; | |
28209 | esac | |
28210 | ||
28211 | case "$host_os" in | |
28212 | mingw*) | |
28213 | gl_dirsep_regex='[/\\]' | |
28214 | ;; | |
28215 | *) | |
28216 | gl_dirsep_regex='\/' | |
28217 | ;; | |
28218 | esac | |
28219 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
28220 | gl_header_literal_regex=`echo 'unistd.h' \ | |
28221 | | sed -e "$gl_make_literal_regex_sed"` | |
28222 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
28223 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
28224 | s|^/[^/]|//&| | |
28225 | p | |
28226 | q | |
28227 | }' | |
28228 | ||
28229 | gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
28230 | sed -n "$gl_absolute_header_sed"` | |
28231 | ||
28232 | gl_header=$gl_cv_absolute_unistd_h | |
28233 | gl_cv_next_unistd_h='"'$gl_header'"' | |
8839a007 PA |
28234 | else |
28235 | gl_cv_next_unistd_h='<'unistd.h'>' | |
28236 | fi | |
28237 | ||
28238 | ||
28239 | fi | |
28240 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5 | |
28241 | $as_echo "$gl_cv_next_unistd_h" >&6; } | |
28242 | fi | |
28243 | NEXT_UNISTD_H=$gl_cv_next_unistd_h | |
28244 | ||
28245 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
28246 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
28247 | gl_next_as_first_directive='<'unistd.h'>' | |
28248 | else | |
28249 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
28250 | gl_next_as_first_directive=$gl_cv_next_unistd_h | |
28251 | fi | |
28252 | NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive | |
28253 | ||
28254 | ||
28255 | ||
28256 | ||
28257 | if test $ac_cv_header_unistd_h = yes; then | |
28258 | HAVE_UNISTD_H=1 | |
28259 | else | |
28260 | HAVE_UNISTD_H=0 | |
28261 | fi | |
28262 | ||
28263 | ||
28264 | ||
28265 | ||
28266 | ||
28267 | ||
28268 | ||
472fa5ee SM |
28269 | |
28270 | ||
28271 | ||
28272 | ||
28273 | ||
8839a007 | 28274 | |
6ec2e0f5 SDJ |
28275 | |
28276 | ||
28277 | ||
3d99e817 AK |
28278 | if test $ac_cv_have_decl_unsetenv = no; then |
28279 | HAVE_DECL_UNSETENV=0 | |
28280 | fi | |
28281 | for ac_func in unsetenv | |
28282 | do : | |
28283 | ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" | |
d0ac1c44 | 28284 | if test "x$ac_cv_func_unsetenv" = xyes; then : |
3d99e817 AK |
28285 | cat >>confdefs.h <<_ACEOF |
28286 | #define HAVE_UNSETENV 1 | |
28287 | _ACEOF | |
28288 | ||
28289 | fi | |
28290 | done | |
28291 | ||
28292 | if test $ac_cv_func_unsetenv = no; then | |
28293 | HAVE_UNSETENV=0 | |
28294 | else | |
28295 | HAVE_UNSETENV=1 | |
28296 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5 | |
28297 | $as_echo_n "checking for unsetenv() return type... " >&6; } | |
d0ac1c44 | 28298 | if ${gt_cv_func_unsetenv_ret+:} false; then : |
3d99e817 AK |
28299 | $as_echo_n "(cached) " >&6 |
28300 | else | |
28301 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28302 | /* end confdefs.h. */ | |
28303 | ||
28304 | #undef _BSD | |
28305 | #define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */ | |
28306 | #include <stdlib.h> | |
28307 | extern | |
28308 | #ifdef __cplusplus | |
28309 | "C" | |
28310 | #endif | |
28311 | int unsetenv (const char *name); | |
28312 | ||
28313 | int | |
28314 | main () | |
28315 | { | |
28316 | ||
28317 | ; | |
28318 | return 0; | |
28319 | } | |
28320 | _ACEOF | |
28321 | if ac_fn_c_try_compile "$LINENO"; then : | |
28322 | gt_cv_func_unsetenv_ret='int' | |
28323 | else | |
28324 | gt_cv_func_unsetenv_ret='void' | |
28325 | fi | |
28326 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
28327 | fi | |
28328 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5 | |
28329 | $as_echo "$gt_cv_func_unsetenv_ret" >&6; } | |
28330 | if test $gt_cv_func_unsetenv_ret = 'void'; then | |
28331 | ||
28332 | $as_echo "#define VOID_UNSETENV 1" >>confdefs.h | |
28333 | ||
28334 | REPLACE_UNSETENV=1 | |
28335 | fi | |
28336 | ||
28337 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5 | |
28338 | $as_echo_n "checking whether unsetenv obeys POSIX... " >&6; } | |
d0ac1c44 | 28339 | if ${gl_cv_func_unsetenv_works+:} false; then : |
3d99e817 AK |
28340 | $as_echo_n "(cached) " >&6 |
28341 | else | |
28342 | if test "$cross_compiling" = yes; then : | |
28343 | case "$host_os" in | |
28344 | # Guess yes on glibc systems. | |
28345 | *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;; | |
c0c3707f CB |
28346 | # If we don't know, obey --enable-cross-guesses. |
28347 | *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;; | |
3d99e817 AK |
28348 | esac |
28349 | ||
28350 | else | |
28351 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28352 | /* end confdefs.h. */ | |
28353 | ||
28354 | #include <stdlib.h> | |
28355 | #include <errno.h> | |
28356 | extern char **environ; | |
28357 | ||
28358 | int | |
28359 | main () | |
28360 | { | |
28361 | ||
28362 | char entry1[] = "a=1"; | |
28363 | char entry2[] = "b=2"; | |
28364 | char *env[] = { entry1, entry2, NULL }; | |
28365 | if (putenv ((char *) "a=1")) return 1; | |
28366 | if (putenv (entry2)) return 2; | |
28367 | entry2[0] = 'a'; | |
28368 | unsetenv ("a"); | |
28369 | if (getenv ("a")) return 3; | |
28370 | if (!unsetenv ("") || errno != EINVAL) return 4; | |
28371 | entry2[0] = 'b'; | |
28372 | environ = env; | |
28373 | if (!getenv ("a")) return 5; | |
28374 | entry2[0] = 'a'; | |
28375 | unsetenv ("a"); | |
28376 | if (getenv ("a")) return 6; | |
28377 | ||
28378 | ; | |
28379 | return 0; | |
28380 | } | |
28381 | _ACEOF | |
28382 | if ac_fn_c_try_run "$LINENO"; then : | |
28383 | gl_cv_func_unsetenv_works=yes | |
28384 | else | |
28385 | gl_cv_func_unsetenv_works=no | |
28386 | fi | |
28387 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
28388 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
28389 | fi | |
28390 | ||
28391 | fi | |
28392 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5 | |
28393 | $as_echo "$gl_cv_func_unsetenv_works" >&6; } | |
28394 | case "$gl_cv_func_unsetenv_works" in | |
28395 | *yes) ;; | |
28396 | *) | |
28397 | REPLACE_UNSETENV=1 | |
28398 | ;; | |
28399 | esac | |
28400 | fi | |
28401 | ||
28402 | if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then | |
28403 | ||
28404 | ||
28405 | ||
28406 | ||
28407 | ||
28408 | ||
28409 | ||
28410 | ||
28411 | gl_LIBOBJS="$gl_LIBOBJS unsetenv.$ac_objext" | |
28412 | ||
28413 | ||
28414 | ||
28415 | ||
28416 | ||
28417 | fi | |
28418 | ||
28419 | ||
28420 | ||
28421 | ||
28422 | ||
28423 | GNULIB_UNSETENV=1 | |
28424 | ||
28425 | ||
28426 | ||
28427 | ||
28428 | ||
28429 | $as_echo "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h | |
28430 | ||
28431 | ||
28432 | ||
28433 | ||
28434 | ||
28435 | ||
8839a007 PA |
28436 | |
28437 | ||
28438 | ||
28439 | ||
28440 | ||
28441 | ||
28442 | ||
8690e634 JK |
28443 | |
28444 | ||
28445 | if test $gl_cv_have_include_next = yes; then | |
28446 | gl_cv_next_wchar_h='<'wchar.h'>' | |
28447 | else | |
28448 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5 | |
28449 | $as_echo_n "checking absolute name of <wchar.h>... " >&6; } | |
d0ac1c44 | 28450 | if ${gl_cv_next_wchar_h+:} false; then : |
8690e634 JK |
28451 | $as_echo_n "(cached) " >&6 |
28452 | else | |
28453 | ||
28454 | if test $ac_cv_header_wchar_h = yes; then | |
28455 | ||
28456 | ||
4a626d0a PA |
28457 | |
28458 | ||
28459 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
8690e634 JK |
28460 | /* end confdefs.h. */ |
28461 | #include <wchar.h> | |
8690e634 | 28462 | _ACEOF |
4a626d0a PA |
28463 | case "$host_os" in |
28464 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
28465 | *) gl_absname_cpp="$ac_cpp" ;; | |
28466 | esac | |
28467 | ||
28468 | case "$host_os" in | |
28469 | mingw*) | |
28470 | gl_dirsep_regex='[/\\]' | |
28471 | ;; | |
28472 | *) | |
28473 | gl_dirsep_regex='\/' | |
28474 | ;; | |
28475 | esac | |
28476 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
28477 | gl_header_literal_regex=`echo 'wchar.h' \ | |
28478 | | sed -e "$gl_make_literal_regex_sed"` | |
28479 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
28480 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
28481 | s|^/[^/]|//&| | |
28482 | p | |
28483 | q | |
28484 | }' | |
28485 | ||
28486 | gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
28487 | sed -n "$gl_absolute_header_sed"` | |
28488 | ||
28489 | gl_header=$gl_cv_absolute_wchar_h | |
28490 | gl_cv_next_wchar_h='"'$gl_header'"' | |
8690e634 JK |
28491 | else |
28492 | gl_cv_next_wchar_h='<'wchar.h'>' | |
28493 | fi | |
28494 | ||
28495 | ||
28496 | fi | |
28497 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5 | |
28498 | $as_echo "$gl_cv_next_wchar_h" >&6; } | |
28499 | fi | |
28500 | NEXT_WCHAR_H=$gl_cv_next_wchar_h | |
28501 | ||
28502 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
28503 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
28504 | gl_next_as_first_directive='<'wchar.h'>' | |
28505 | else | |
28506 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
28507 | gl_next_as_first_directive=$gl_cv_next_wchar_h | |
28508 | fi | |
28509 | NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive | |
28510 | ||
28511 | ||
28512 | ||
28513 | ||
28514 | if test $ac_cv_header_wchar_h = yes; then | |
28515 | HAVE_WCHAR_H=1 | |
28516 | else | |
28517 | HAVE_WCHAR_H=0 | |
28518 | fi | |
28519 | ||
c971b7fa PA |
28520 | |
28521 | ||
28522 | ||
28523 | ||
8690e634 JK |
28524 | if test $gt_cv_c_wint_t = yes; then |
28525 | HAVE_WINT_T=1 | |
28526 | else | |
28527 | HAVE_WINT_T=0 | |
28528 | fi | |
c971b7fa PA |
28529 | |
28530 | ||
28531 | ||
8690e634 JK |
28532 | |
28533 | ||
28534 | ||
28535 | ||
28536 | ||
472fa5ee SM |
28537 | |
28538 | ||
28539 | ||
28540 | ||
28541 | ||
8690e634 JK |
28542 | if test $ac_cv_func_iswcntrl = yes; then |
28543 | HAVE_ISWCNTRL=1 | |
28544 | else | |
28545 | HAVE_ISWCNTRL=0 | |
28546 | fi | |
28547 | ||
28548 | ||
28549 | ||
8690e634 JK |
28550 | if test $gt_cv_c_wint_t = yes; then |
28551 | HAVE_WINT_T=1 | |
28552 | else | |
28553 | HAVE_WINT_T=0 | |
28554 | fi | |
28555 | ||
28556 | ||
28557 | ||
28558 | ||
28559 | ||
28560 | ||
c971b7fa | 28561 | |
8690e634 | 28562 | |
472fa5ee SM |
28563 | |
28564 | ||
c971b7fa PA |
28565 | |
28566 | ||
28567 | ||
28568 | if test $gl_cv_have_include_next = yes; then | |
8690e634 | 28569 | gl_cv_next_wctype_h='<'wctype.h'>' |
c971b7fa | 28570 | else |
8690e634 JK |
28571 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5 |
28572 | $as_echo_n "checking absolute name of <wctype.h>... " >&6; } | |
d0ac1c44 | 28573 | if ${gl_cv_next_wctype_h+:} false; then : |
c971b7fa PA |
28574 | $as_echo_n "(cached) " >&6 |
28575 | else | |
28576 | ||
8690e634 JK |
28577 | if test $ac_cv_header_wctype_h = yes; then |
28578 | ||
28579 | ||
4a626d0a PA |
28580 | |
28581 | ||
28582 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
c971b7fa | 28583 | /* end confdefs.h. */ |
8690e634 | 28584 | #include <wctype.h> |
c971b7fa | 28585 | _ACEOF |
4a626d0a PA |
28586 | case "$host_os" in |
28587 | aix*) gl_absname_cpp="$ac_cpp -C" ;; | |
28588 | *) gl_absname_cpp="$ac_cpp" ;; | |
28589 | esac | |
28590 | ||
28591 | case "$host_os" in | |
28592 | mingw*) | |
28593 | gl_dirsep_regex='[/\\]' | |
28594 | ;; | |
28595 | *) | |
28596 | gl_dirsep_regex='\/' | |
28597 | ;; | |
28598 | esac | |
28599 | gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' | |
28600 | gl_header_literal_regex=`echo 'wctype.h' \ | |
28601 | | sed -e "$gl_make_literal_regex_sed"` | |
28602 | gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ | |
28603 | s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ | |
28604 | s|^/[^/]|//&| | |
28605 | p | |
28606 | q | |
28607 | }' | |
28608 | ||
28609 | gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | | |
28610 | sed -n "$gl_absolute_header_sed"` | |
28611 | ||
28612 | gl_header=$gl_cv_absolute_wctype_h | |
28613 | gl_cv_next_wctype_h='"'$gl_header'"' | |
8690e634 JK |
28614 | else |
28615 | gl_cv_next_wctype_h='<'wctype.h'>' | |
28616 | fi | |
c971b7fa PA |
28617 | |
28618 | ||
28619 | fi | |
8690e634 JK |
28620 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 |
28621 | $as_echo "$gl_cv_next_wctype_h" >&6; } | |
c971b7fa | 28622 | fi |
8690e634 | 28623 | NEXT_WCTYPE_H=$gl_cv_next_wctype_h |
c971b7fa PA |
28624 | |
28625 | if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then | |
28626 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' | |
8690e634 | 28627 | gl_next_as_first_directive='<'wctype.h'>' |
c971b7fa PA |
28628 | else |
28629 | # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' | |
8690e634 | 28630 | gl_next_as_first_directive=$gl_cv_next_wctype_h |
c971b7fa | 28631 | fi |
8690e634 JK |
28632 | NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive |
28633 | ||
28634 | ||
28635 | ||
28636 | ||
28637 | if test $ac_cv_header_wctype_h = yes; then | |
28638 | if test $ac_cv_func_iswcntrl = yes; then | |
28639 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 | |
28640 | $as_echo_n "checking whether iswcntrl works... " >&6; } | |
d0ac1c44 | 28641 | if ${gl_cv_func_iswcntrl_works+:} false; then : |
8690e634 JK |
28642 | $as_echo_n "(cached) " >&6 |
28643 | else | |
28644 | ||
28645 | if test "$cross_compiling" = yes; then : | |
c0c3707f | 28646 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8690e634 JK |
28647 | /* end confdefs.h. */ |
28648 | #include <stdlib.h> | |
28649 | #if __GNU_LIBRARY__ == 1 | |
28650 | Linux libc5 i18n is broken. | |
28651 | #endif | |
28652 | int | |
28653 | main () | |
28654 | { | |
28655 | ||
28656 | ; | |
28657 | return 0; | |
28658 | } | |
28659 | _ACEOF | |
28660 | if ac_fn_c_try_compile "$LINENO"; then : | |
28661 | gl_cv_func_iswcntrl_works="guessing yes" | |
28662 | else | |
28663 | gl_cv_func_iswcntrl_works="guessing no" | |
28664 | fi | |
28665 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
28666 | ||
28667 | else | |
28668 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28669 | /* end confdefs.h. */ | |
28670 | ||
28671 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be | |
28672 | included before <wchar.h>. | |
28673 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> | |
28674 | must be included before <wchar.h>. */ | |
28675 | #include <stddef.h> | |
28676 | #include <stdio.h> | |
28677 | #include <time.h> | |
28678 | #include <wchar.h> | |
28679 | #include <wctype.h> | |
28680 | int main () { return iswprint ('x') == 0; } | |
28681 | ||
28682 | _ACEOF | |
28683 | if ac_fn_c_try_run "$LINENO"; then : | |
28684 | gl_cv_func_iswcntrl_works=yes | |
28685 | else | |
28686 | gl_cv_func_iswcntrl_works=no | |
28687 | fi | |
28688 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ | |
28689 | conftest.$ac_objext conftest.beam conftest.$ac_ext | |
28690 | fi | |
28691 | ||
28692 | ||
28693 | fi | |
28694 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 | |
28695 | $as_echo "$gl_cv_func_iswcntrl_works" >&6; } | |
28696 | fi | |
28697 | HAVE_WCTYPE_H=1 | |
28698 | else | |
28699 | HAVE_WCTYPE_H=0 | |
28700 | fi | |
28701 | ||
28702 | ||
c0c3707f CB |
28703 | if test $GNULIB_OVERRIDES_WINT_T = 1; then |
28704 | REPLACE_ISWCNTRL=1 | |
28705 | else | |
28706 | case "$gl_cv_func_iswcntrl_works" in | |
28707 | *yes) REPLACE_ISWCNTRL=0 ;; | |
28708 | *) REPLACE_ISWCNTRL=1 ;; | |
28709 | esac | |
28710 | fi | |
8690e634 JK |
28711 | |
28712 | ||
28713 | if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then | |
28714 | : | |
28715 | fi | |
28716 | ||
28717 | if test $REPLACE_ISWCNTRL = 1; then | |
28718 | REPLACE_TOWLOWER=1 | |
28719 | else | |
28720 | for ac_func in towlower | |
28721 | do : | |
28722 | ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" | |
d0ac1c44 | 28723 | if test "x$ac_cv_func_towlower" = xyes; then : |
8690e634 JK |
28724 | cat >>confdefs.h <<_ACEOF |
28725 | #define HAVE_TOWLOWER 1 | |
28726 | _ACEOF | |
28727 | ||
28728 | fi | |
28729 | done | |
28730 | ||
28731 | if test $ac_cv_func_towlower = yes; then | |
28732 | REPLACE_TOWLOWER=0 | |
28733 | else | |
28734 | ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be | |
28735 | included before <wchar.h>. | |
28736 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> | |
28737 | must be included before <wchar.h>. */ | |
28738 | #include <stddef.h> | |
28739 | #include <stdio.h> | |
28740 | #include <time.h> | |
28741 | #include <wchar.h> | |
28742 | #if HAVE_WCTYPE_H | |
28743 | # include <wctype.h> | |
28744 | #endif | |
28745 | ||
28746 | " | |
d0ac1c44 | 28747 | if test "x$ac_cv_have_decl_towlower" = xyes; then : |
8690e634 JK |
28748 | ac_have_decl=1 |
28749 | else | |
28750 | ac_have_decl=0 | |
28751 | fi | |
28752 | ||
28753 | cat >>confdefs.h <<_ACEOF | |
28754 | #define HAVE_DECL_TOWLOWER $ac_have_decl | |
28755 | _ACEOF | |
28756 | ||
28757 | if test $ac_cv_have_decl_towlower = yes; then | |
28758 | REPLACE_TOWLOWER=1 | |
28759 | else | |
28760 | REPLACE_TOWLOWER=0 | |
28761 | fi | |
28762 | fi | |
28763 | fi | |
28764 | ||
28765 | ||
28766 | if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then | |
28767 | : | |
28768 | fi | |
28769 | ||
28770 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 | |
28771 | $as_echo_n "checking for wctype_t... " >&6; } | |
d0ac1c44 | 28772 | if ${gl_cv_type_wctype_t+:} false; then : |
8690e634 JK |
28773 | $as_echo_n "(cached) " >&6 |
28774 | else | |
28775 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28776 | /* end confdefs.h. */ | |
28777 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be | |
28778 | included before <wchar.h>. | |
28779 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> | |
28780 | must be included before <wchar.h>. */ | |
28781 | #include <stddef.h> | |
28782 | #include <stdio.h> | |
28783 | #include <time.h> | |
28784 | #include <wchar.h> | |
28785 | #if HAVE_WCTYPE_H | |
28786 | # include <wctype.h> | |
28787 | #endif | |
28788 | wctype_t a; | |
28789 | ||
28790 | int | |
28791 | main () | |
28792 | { | |
28793 | ||
28794 | ; | |
28795 | return 0; | |
28796 | } | |
28797 | _ACEOF | |
28798 | if ac_fn_c_try_compile "$LINENO"; then : | |
28799 | gl_cv_type_wctype_t=yes | |
28800 | else | |
28801 | gl_cv_type_wctype_t=no | |
28802 | fi | |
28803 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c971b7fa | 28804 | |
8690e634 JK |
28805 | fi |
28806 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 | |
28807 | $as_echo "$gl_cv_type_wctype_t" >&6; } | |
28808 | if test $gl_cv_type_wctype_t = no; then | |
28809 | HAVE_WCTYPE_T=0 | |
28810 | fi | |
28811 | ||
28812 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 | |
28813 | $as_echo_n "checking for wctrans_t... " >&6; } | |
d0ac1c44 | 28814 | if ${gl_cv_type_wctrans_t+:} false; then : |
8690e634 JK |
28815 | $as_echo_n "(cached) " >&6 |
28816 | else | |
28817 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
28818 | /* end confdefs.h. */ | |
28819 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be | |
28820 | included before <wchar.h>. | |
28821 | BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> | |
28822 | must be included before <wchar.h>. */ | |
28823 | #include <stddef.h> | |
28824 | #include <stdio.h> | |
28825 | #include <time.h> | |
28826 | #include <wchar.h> | |
28827 | #include <wctype.h> | |
28828 | wctrans_t a; | |
c971b7fa | 28829 | |
8690e634 JK |
28830 | int |
28831 | main () | |
28832 | { | |
c971b7fa | 28833 | |
8690e634 JK |
28834 | ; |
28835 | return 0; | |
28836 | } | |
28837 | _ACEOF | |
28838 | if ac_fn_c_try_compile "$LINENO"; then : | |
28839 | gl_cv_type_wctrans_t=yes | |
28840 | else | |
28841 | gl_cv_type_wctrans_t=no | |
28842 | fi | |
28843 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
c971b7fa | 28844 | |
8690e634 JK |
28845 | fi |
28846 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 | |
28847 | $as_echo "$gl_cv_type_wctrans_t" >&6; } | |
28848 | if test $gl_cv_type_wctrans_t = no; then | |
28849 | HAVE_WCTRANS_T=0 | |
c971b7fa PA |
28850 | fi |
28851 | ||
28852 | ||
5e8754f9 | 28853 | |
5e8754f9 | 28854 | |
c971b7fa | 28855 | |
c0c3707f CB |
28856 | |
28857 | case "$host_os" in | |
28858 | mingw*) | |
28859 | ||
28860 | ||
28861 | ||
28862 | ||
28863 | ||
28864 | ||
28865 | ||
28866 | ||
28867 | gl_LIBOBJS="$gl_LIBOBJS windows-mutex.$ac_objext" | |
28868 | ||
28869 | ;; | |
28870 | esac | |
28871 | ||
28872 | case "$host_os" in | |
28873 | mingw*) | |
28874 | ||
28875 | ||
28876 | ||
28877 | ||
28878 | ||
28879 | ||
28880 | ||
28881 | ||
28882 | gl_LIBOBJS="$gl_LIBOBJS windows-once.$ac_objext" | |
28883 | ||
28884 | ;; | |
28885 | esac | |
28886 | ||
28887 | case "$host_os" in | |
28888 | mingw*) | |
28889 | ||
28890 | ||
c971b7fa PA |
28891 | |
28892 | ||
c0c3707f CB |
28893 | |
28894 | ||
28895 | ||
28896 | ||
28897 | gl_LIBOBJS="$gl_LIBOBJS windows-recmutex.$ac_objext" | |
28898 | ||
28899 | ;; | |
28900 | esac | |
28901 | ||
28902 | case "$host_os" in | |
28903 | mingw*) | |
28904 | ||
28905 | ||
28906 | ||
28907 | ||
28908 | ||
28909 | ||
28910 | ||
28911 | ||
28912 | gl_LIBOBJS="$gl_LIBOBJS windows-rwlock.$ac_objext" | |
28913 | ||
28914 | ;; | |
28915 | esac | |
c971b7fa PA |
28916 | # End of code from modules |
28917 | ||
28918 | ||
28919 | ||
28920 | ||
28921 | ||
28922 | ||
28923 | ||
28924 | ||
28925 | ||
28926 | gltests_libdeps= | |
28927 | gltests_ltlibdeps= | |
28928 | ||
28929 | ||
28930 | ||
28931 | ||
28932 | ||
28933 | ||
28934 | ||
28935 | ||
28936 | ||
5df4cba6 | 28937 | |
c971b7fa PA |
28938 | gl_source_base='tests' |
28939 | 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 | |
28940 | ||
28941 | gl_module_indicator_condition=$gltests_WITNESS | |
28942 | ||
28943 | ||
28944 | ||
28945 | ||
28946 | ||
28947 | ||
28948 | ||
28949 | ||
28950 | ||
28951 | LIBGNU_LIBDEPS="$gl_libdeps" | |
28952 | ||
28953 | LIBGNU_LTLIBDEPS="$gl_ltlibdeps" | |
28954 | ||
28955 | ||
28956 | ||
d0ac1c44 | 28957 | am__api_version='1.15' |
c971b7fa PA |
28958 | |
28959 | # Find a good install program. We prefer a C program (faster), | |
28960 | # so one script is as good as another. But avoid the broken or | |
28961 | # incompatible versions: | |
28962 | # SysV /etc/install, /usr/sbin/install | |
28963 | # SunOS /usr/etc/install | |
28964 | # IRIX /sbin/install | |
28965 | # AIX /bin/install | |
28966 | # AmigaOS /C/install, which installs bootblocks on floppy discs | |
28967 | # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag | |
28968 | # AFS /usr/afsws/bin/install, which mishandles nonexistent args | |
28969 | # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" | |
28970 | # OS/2's system install, which has a completely different semantic | |
28971 | # ./install, which can be erroneously created by make from ./install.sh. | |
28972 | # Reject install programs that cannot install multiple files. | |
28973 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 | |
28974 | $as_echo_n "checking for a BSD-compatible install... " >&6; } | |
28975 | if test -z "$INSTALL"; then | |
d0ac1c44 | 28976 | if ${ac_cv_path_install+:} false; then : |
c971b7fa PA |
28977 | $as_echo_n "(cached) " >&6 |
28978 | else | |
28979 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
28980 | for as_dir in $PATH | |
28981 | do | |
28982 | IFS=$as_save_IFS | |
28983 | test -z "$as_dir" && as_dir=. | |
28984 | # Account for people who put trailing slashes in PATH elements. | |
28985 | case $as_dir/ in #(( | |
28986 | ./ | .// | /[cC]/* | \ | |
28987 | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ | |
28988 | ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ | |
28989 | /usr/ucb/* ) ;; | |
28990 | *) | |
28991 | # OSF1 and SCO ODT 3.0 have their own names for install. | |
28992 | # Don't use installbsd from OSF since it installs stuff as root | |
28993 | # by default. | |
28994 | for ac_prog in ginstall scoinst install; do | |
28995 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 28996 | if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then |
c971b7fa PA |
28997 | if test $ac_prog = install && |
28998 | grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then | |
28999 | # AIX install. It has an incompatible calling convention. | |
29000 | : | |
29001 | elif test $ac_prog = install && | |
29002 | grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then | |
29003 | # program-specific install script used by HP pwplus--don't use. | |
29004 | : | |
29005 | else | |
29006 | rm -rf conftest.one conftest.two conftest.dir | |
29007 | echo one > conftest.one | |
29008 | echo two > conftest.two | |
29009 | mkdir conftest.dir | |
29010 | if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && | |
29011 | test -s conftest.one && test -s conftest.two && | |
29012 | test -s conftest.dir/conftest.one && | |
29013 | test -s conftest.dir/conftest.two | |
29014 | then | |
29015 | ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" | |
29016 | break 3 | |
29017 | fi | |
29018 | fi | |
29019 | fi | |
29020 | done | |
29021 | done | |
29022 | ;; | |
29023 | esac | |
29024 | ||
29025 | done | |
29026 | IFS=$as_save_IFS | |
29027 | ||
29028 | rm -rf conftest.one conftest.two conftest.dir | |
29029 | ||
29030 | fi | |
29031 | if test "${ac_cv_path_install+set}" = set; then | |
29032 | INSTALL=$ac_cv_path_install | |
29033 | else | |
29034 | # As a last resort, use the slow shell script. Don't cache a | |
29035 | # value for INSTALL within a source directory, because that will | |
29036 | # break other packages using the cache if that directory is | |
29037 | # removed, or if the value is a relative name. | |
29038 | INSTALL=$ac_install_sh | |
29039 | fi | |
29040 | fi | |
29041 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 | |
29042 | $as_echo "$INSTALL" >&6; } | |
29043 | ||
29044 | # Use test -z because SunOS4 sh mishandles braces in ${var-val}. | |
29045 | # It thinks the first close brace ends the variable substitution. | |
29046 | test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' | |
29047 | ||
29048 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' | |
29049 | ||
29050 | test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' | |
29051 | ||
29052 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 | |
29053 | $as_echo_n "checking whether build environment is sane... " >&6; } | |
c971b7fa PA |
29054 | # Reject unsafe characters in $srcdir or the absolute working directory |
29055 | # name. Accept space and tab only in the latter. | |
29056 | am_lf=' | |
29057 | ' | |
29058 | case `pwd` in | |
29059 | *[\\\"\#\$\&\'\`$am_lf]*) | |
d0ac1c44 | 29060 | as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; |
c971b7fa PA |
29061 | esac |
29062 | case $srcdir in | |
29063 | *[\\\"\#\$\&\'\`$am_lf\ \ ]*) | |
d0ac1c44 | 29064 | as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; |
c971b7fa PA |
29065 | esac |
29066 | ||
d0ac1c44 | 29067 | # Do 'set' in a subshell so we don't clobber the current shell's |
c971b7fa PA |
29068 | # arguments. Must try -L first in case configure is actually a |
29069 | # symlink; some systems play weird games with the mod time of symlinks | |
29070 | # (eg FreeBSD returns the mod time of the symlink's containing | |
29071 | # directory). | |
29072 | if ( | |
d0ac1c44 SM |
29073 | am_has_slept=no |
29074 | for am_try in 1 2; do | |
29075 | echo "timestamp, slept: $am_has_slept" > conftest.file | |
29076 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` | |
29077 | if test "$*" = "X"; then | |
29078 | # -L didn't work. | |
29079 | set X `ls -t "$srcdir/configure" conftest.file` | |
29080 | fi | |
29081 | if test "$*" != "X $srcdir/configure conftest.file" \ | |
29082 | && test "$*" != "X conftest.file $srcdir/configure"; then | |
29083 | ||
29084 | # If neither matched, then we have a broken ls. This can happen | |
29085 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
29086 | # broken ls alias from the environment. This has actually | |
29087 | # happened. Such a system could not be considered "sane". | |
29088 | as_fn_error $? "ls -t appears to fail. Make sure there is not a broken | |
29089 | alias in your environment" "$LINENO" 5 | |
29090 | fi | |
29091 | if test "$2" = conftest.file || test $am_try -eq 2; then | |
29092 | break | |
29093 | fi | |
29094 | # Just in case. | |
29095 | sleep 1 | |
29096 | am_has_slept=yes | |
29097 | done | |
c971b7fa PA |
29098 | test "$2" = conftest.file |
29099 | ) | |
29100 | then | |
29101 | # Ok. | |
29102 | : | |
29103 | else | |
d0ac1c44 | 29104 | as_fn_error $? "newly created file is older than distributed files! |
c971b7fa PA |
29105 | Check your system clock" "$LINENO" 5 |
29106 | fi | |
29107 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
29108 | $as_echo "yes" >&6; } | |
d0ac1c44 SM |
29109 | # If we didn't sleep, we still need to ensure time stamps of config.status and |
29110 | # generated files are strictly newer. | |
29111 | am_sleep_pid= | |
29112 | if grep 'slept: no' conftest.file >/dev/null 2>&1; then | |
29113 | ( sleep 1 ) & | |
29114 | am_sleep_pid=$! | |
29115 | fi | |
29116 | ||
29117 | rm -f conftest.file | |
29118 | ||
c971b7fa PA |
29119 | test "$program_prefix" != NONE && |
29120 | program_transform_name="s&^&$program_prefix&;$program_transform_name" | |
29121 | # Use a double $ so make ignores it. | |
29122 | test "$program_suffix" != NONE && | |
29123 | program_transform_name="s&\$&$program_suffix&;$program_transform_name" | |
29124 | # Double any \ or $. | |
29125 | # By default was `s,x,x', remove it if useless. | |
29126 | ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' | |
29127 | program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` | |
29128 | ||
c0c3707f CB |
29129 | # Expand $ac_aux_dir to an absolute path. |
29130 | am_aux_dir=`cd "$ac_aux_dir" && pwd` | |
29131 | ||
c971b7fa PA |
29132 | if test x"${MISSING+set}" != xset; then |
29133 | case $am_aux_dir in | |
29134 | *\ * | *\ *) | |
29135 | MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; | |
29136 | *) | |
29137 | MISSING="\${SHELL} $am_aux_dir/missing" ;; | |
29138 | esac | |
29139 | fi | |
29140 | # Use eval to expand $SHELL | |
d0ac1c44 SM |
29141 | if eval "$MISSING --is-lightweight"; then |
29142 | am_missing_run="$MISSING " | |
c971b7fa PA |
29143 | else |
29144 | am_missing_run= | |
d0ac1c44 SM |
29145 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 |
29146 | $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} | |
c971b7fa PA |
29147 | fi |
29148 | ||
d0ac1c44 | 29149 | if test x"${install_sh+set}" != xset; then |
c971b7fa PA |
29150 | case $am_aux_dir in |
29151 | *\ * | *\ *) | |
29152 | install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; | |
29153 | *) | |
29154 | install_sh="\${SHELL} $am_aux_dir/install-sh" | |
29155 | esac | |
29156 | fi | |
29157 | ||
d0ac1c44 SM |
29158 | # Installed binaries are usually stripped using 'strip' when the user |
29159 | # run "make install-strip". However 'strip' might not be the right | |
c971b7fa | 29160 | # tool to use in cross-compilation environments, therefore Automake |
d0ac1c44 | 29161 | # will honor the 'STRIP' environment variable to overrule this program. |
c971b7fa PA |
29162 | if test "$cross_compiling" != no; then |
29163 | if test -n "$ac_tool_prefix"; then | |
29164 | # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. | |
29165 | set dummy ${ac_tool_prefix}strip; ac_word=$2 | |
29166 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
29167 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 29168 | if ${ac_cv_prog_STRIP+:} false; then : |
c971b7fa PA |
29169 | $as_echo_n "(cached) " >&6 |
29170 | else | |
29171 | if test -n "$STRIP"; then | |
29172 | ac_cv_prog_STRIP="$STRIP" # Let the user override the test. | |
29173 | else | |
29174 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
29175 | for as_dir in $PATH | |
29176 | do | |
29177 | IFS=$as_save_IFS | |
29178 | test -z "$as_dir" && as_dir=. | |
29179 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 29180 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
29181 | ac_cv_prog_STRIP="${ac_tool_prefix}strip" |
29182 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
29183 | break 2 | |
29184 | fi | |
29185 | done | |
29186 | done | |
29187 | IFS=$as_save_IFS | |
29188 | ||
29189 | fi | |
29190 | fi | |
29191 | STRIP=$ac_cv_prog_STRIP | |
29192 | if test -n "$STRIP"; then | |
29193 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 | |
29194 | $as_echo "$STRIP" >&6; } | |
29195 | else | |
29196 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
29197 | $as_echo "no" >&6; } | |
29198 | fi | |
29199 | ||
29200 | ||
29201 | fi | |
29202 | if test -z "$ac_cv_prog_STRIP"; then | |
29203 | ac_ct_STRIP=$STRIP | |
29204 | # Extract the first word of "strip", so it can be a program name with args. | |
29205 | set dummy strip; ac_word=$2 | |
29206 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
29207 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 29208 | if ${ac_cv_prog_ac_ct_STRIP+:} false; then : |
c971b7fa PA |
29209 | $as_echo_n "(cached) " >&6 |
29210 | else | |
29211 | if test -n "$ac_ct_STRIP"; then | |
29212 | ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. | |
29213 | else | |
29214 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
29215 | for as_dir in $PATH | |
29216 | do | |
29217 | IFS=$as_save_IFS | |
29218 | test -z "$as_dir" && as_dir=. | |
29219 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 29220 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
29221 | ac_cv_prog_ac_ct_STRIP="strip" |
29222 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
29223 | break 2 | |
29224 | fi | |
29225 | done | |
29226 | done | |
29227 | IFS=$as_save_IFS | |
29228 | ||
29229 | fi | |
29230 | fi | |
29231 | ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP | |
29232 | if test -n "$ac_ct_STRIP"; then | |
29233 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 | |
29234 | $as_echo "$ac_ct_STRIP" >&6; } | |
29235 | else | |
29236 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
29237 | $as_echo "no" >&6; } | |
29238 | fi | |
29239 | ||
29240 | if test "x$ac_ct_STRIP" = x; then | |
29241 | STRIP=":" | |
29242 | else | |
29243 | case $cross_compiling:$ac_tool_warned in | |
29244 | yes:) | |
29245 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
29246 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
29247 | ac_tool_warned=yes ;; | |
29248 | esac | |
29249 | STRIP=$ac_ct_STRIP | |
29250 | fi | |
29251 | else | |
29252 | STRIP="$ac_cv_prog_STRIP" | |
29253 | fi | |
29254 | ||
29255 | fi | |
29256 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" | |
29257 | ||
c971b7fa PA |
29258 | for ac_prog in gawk mawk nawk awk |
29259 | do | |
29260 | # Extract the first word of "$ac_prog", so it can be a program name with args. | |
29261 | set dummy $ac_prog; ac_word=$2 | |
29262 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
29263 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 29264 | if ${ac_cv_prog_AWK+:} false; then : |
c971b7fa PA |
29265 | $as_echo_n "(cached) " >&6 |
29266 | else | |
29267 | if test -n "$AWK"; then | |
29268 | ac_cv_prog_AWK="$AWK" # Let the user override the test. | |
29269 | else | |
29270 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
29271 | for as_dir in $PATH | |
29272 | do | |
29273 | IFS=$as_save_IFS | |
29274 | test -z "$as_dir" && as_dir=. | |
29275 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 29276 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
29277 | ac_cv_prog_AWK="$ac_prog" |
29278 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
29279 | break 2 | |
29280 | fi | |
29281 | done | |
29282 | done | |
29283 | IFS=$as_save_IFS | |
29284 | ||
29285 | fi | |
29286 | fi | |
29287 | AWK=$ac_cv_prog_AWK | |
29288 | if test -n "$AWK"; then | |
29289 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 | |
29290 | $as_echo "$AWK" >&6; } | |
29291 | else | |
29292 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
29293 | $as_echo "no" >&6; } | |
29294 | fi | |
29295 | ||
29296 | ||
29297 | test -n "$AWK" && break | |
29298 | done | |
29299 | ||
29300 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 | |
29301 | $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } | |
29302 | set x ${MAKE-make} | |
29303 | ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` | |
d0ac1c44 | 29304 | if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : |
c971b7fa PA |
29305 | $as_echo_n "(cached) " >&6 |
29306 | else | |
29307 | cat >conftest.make <<\_ACEOF | |
29308 | SHELL = /bin/sh | |
29309 | all: | |
29310 | @echo '@@@%%%=$(MAKE)=@@@%%%' | |
29311 | _ACEOF | |
d0ac1c44 | 29312 | # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. |
c971b7fa PA |
29313 | case `${MAKE-make} -f conftest.make 2>/dev/null` in |
29314 | *@@@%%%=?*=@@@%%%*) | |
29315 | eval ac_cv_prog_make_${ac_make}_set=yes;; | |
29316 | *) | |
29317 | eval ac_cv_prog_make_${ac_make}_set=no;; | |
29318 | esac | |
29319 | rm -f conftest.make | |
29320 | fi | |
29321 | if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then | |
29322 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
29323 | $as_echo "yes" >&6; } | |
29324 | SET_MAKE= | |
29325 | else | |
29326 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
29327 | $as_echo "no" >&6; } | |
29328 | SET_MAKE="MAKE=${MAKE-make}" | |
29329 | fi | |
29330 | ||
29331 | rm -rf .tst 2>/dev/null | |
29332 | mkdir .tst 2>/dev/null | |
29333 | if test -d .tst; then | |
29334 | am__leading_dot=. | |
29335 | else | |
29336 | am__leading_dot=_ | |
29337 | fi | |
29338 | rmdir .tst 2>/dev/null | |
29339 | ||
29340 | DEPDIR="${am__leading_dot}deps" | |
29341 | ||
29342 | ac_config_commands="$ac_config_commands depfiles" | |
29343 | ||
29344 | ||
29345 | am_make=${MAKE-make} | |
29346 | cat > confinc << 'END' | |
29347 | am__doit: | |
29348 | @echo this is the am__doit target | |
29349 | .PHONY: am__doit | |
29350 | END | |
29351 | # If we don't find an include directive, just comment out the code. | |
29352 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 | |
29353 | $as_echo_n "checking for style of include used by $am_make... " >&6; } | |
29354 | am__include="#" | |
29355 | am__quote= | |
29356 | _am_result=none | |
29357 | # First try GNU make style include. | |
29358 | echo "include confinc" > confmf | |
d0ac1c44 | 29359 | # Ignore all kinds of additional output from 'make'. |
c971b7fa PA |
29360 | case `$am_make -s -f confmf 2> /dev/null` in #( |
29361 | *the\ am__doit\ target*) | |
29362 | am__include=include | |
29363 | am__quote= | |
29364 | _am_result=GNU | |
29365 | ;; | |
29366 | esac | |
29367 | # Now try BSD make style include. | |
29368 | if test "$am__include" = "#"; then | |
29369 | echo '.include "confinc"' > confmf | |
29370 | case `$am_make -s -f confmf 2> /dev/null` in #( | |
29371 | *the\ am__doit\ target*) | |
29372 | am__include=.include | |
29373 | am__quote="\"" | |
29374 | _am_result=BSD | |
29375 | ;; | |
29376 | esac | |
29377 | fi | |
29378 | ||
29379 | ||
29380 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 | |
29381 | $as_echo "$_am_result" >&6; } | |
29382 | rm -f confinc confmf | |
29383 | ||
29384 | # Check whether --enable-dependency-tracking was given. | |
29385 | if test "${enable_dependency_tracking+set}" = set; then : | |
29386 | enableval=$enable_dependency_tracking; | |
29387 | fi | |
29388 | ||
29389 | if test "x$enable_dependency_tracking" != xno; then | |
29390 | am_depcomp="$ac_aux_dir/depcomp" | |
29391 | AMDEPBACKSLASH='\' | |
d0ac1c44 | 29392 | am__nodep='_no' |
c971b7fa PA |
29393 | fi |
29394 | if test "x$enable_dependency_tracking" != xno; then | |
29395 | AMDEP_TRUE= | |
29396 | AMDEP_FALSE='#' | |
29397 | else | |
29398 | AMDEP_TRUE='#' | |
29399 | AMDEP_FALSE= | |
29400 | fi | |
29401 | ||
29402 | ||
d0ac1c44 SM |
29403 | # Check whether --enable-silent-rules was given. |
29404 | if test "${enable_silent_rules+set}" = set; then : | |
29405 | enableval=$enable_silent_rules; | |
29406 | fi | |
29407 | ||
29408 | case $enable_silent_rules in # ((( | |
29409 | yes) AM_DEFAULT_VERBOSITY=0;; | |
29410 | no) AM_DEFAULT_VERBOSITY=1;; | |
29411 | *) AM_DEFAULT_VERBOSITY=1;; | |
29412 | esac | |
29413 | am_make=${MAKE-make} | |
29414 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 | |
29415 | $as_echo_n "checking whether $am_make supports nested variables... " >&6; } | |
29416 | if ${am_cv_make_support_nested_variables+:} false; then : | |
29417 | $as_echo_n "(cached) " >&6 | |
29418 | else | |
29419 | if $as_echo 'TRUE=$(BAR$(V)) | |
29420 | BAR0=false | |
29421 | BAR1=true | |
29422 | V=1 | |
29423 | am__doit: | |
29424 | @$(TRUE) | |
29425 | .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then | |
29426 | am_cv_make_support_nested_variables=yes | |
29427 | else | |
29428 | am_cv_make_support_nested_variables=no | |
29429 | fi | |
29430 | fi | |
29431 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 | |
29432 | $as_echo "$am_cv_make_support_nested_variables" >&6; } | |
29433 | if test $am_cv_make_support_nested_variables = yes; then | |
29434 | AM_V='$(V)' | |
29435 | AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' | |
29436 | else | |
29437 | AM_V=$AM_DEFAULT_VERBOSITY | |
29438 | AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY | |
29439 | fi | |
29440 | AM_BACKSLASH='\' | |
29441 | ||
c971b7fa PA |
29442 | if test "`cd $srcdir && pwd`" != "`pwd`"; then |
29443 | # Use -I$(srcdir) only when $(srcdir) != ., so that make's output | |
29444 | # is not polluted with repeated "-I." | |
29445 | am__isrc=' -I$(srcdir)' | |
29446 | # test to see if srcdir already configured | |
29447 | if test -f $srcdir/config.status; then | |
d0ac1c44 | 29448 | as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 |
c971b7fa PA |
29449 | fi |
29450 | fi | |
29451 | ||
29452 | # test whether we have cygpath | |
29453 | if test -z "$CYGPATH_W"; then | |
29454 | if (cygpath --version) >/dev/null 2>/dev/null; then | |
29455 | CYGPATH_W='cygpath -w' | |
29456 | else | |
29457 | CYGPATH_W=echo | |
29458 | fi | |
29459 | fi | |
29460 | ||
29461 | ||
29462 | # Define the identity of the package. | |
d0ac1c44 SM |
29463 | PACKAGE='libgnu' |
29464 | VERSION='UNUSED-VERSION' | |
c971b7fa PA |
29465 | |
29466 | ||
29467 | # Some tools Automake needs. | |
29468 | ||
29469 | ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} | |
29470 | ||
29471 | ||
29472 | AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} | |
29473 | ||
29474 | ||
29475 | AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} | |
29476 | ||
29477 | ||
29478 | AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} | |
29479 | ||
29480 | ||
29481 | MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} | |
29482 | ||
d0ac1c44 SM |
29483 | # For better backward compatibility. To be removed once Automake 1.9.x |
29484 | # dies out for good. For more background, see: | |
29485 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> | |
29486 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> | |
29487 | mkdir_p='$(MKDIR_P)' | |
29488 | ||
29489 | # We need awk for the "check" target (and possibly the TAP driver). The | |
29490 | # system "awk" is bad on some platforms. | |
29491 | # Always define AMTAR for backward compatibility. Yes, it's still used | |
29492 | # in the wild :-( We should find a proper way to deprecate it ... | |
29493 | AMTAR='$${TAR-tar}' | |
29494 | ||
29495 | ||
29496 | # We'll loop over all known methods to create a tar archive until one works. | |
29497 | _am_tools='gnutar pax cpio none' | |
c971b7fa | 29498 | |
d0ac1c44 | 29499 | am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' |
c971b7fa | 29500 | |
c971b7fa PA |
29501 | |
29502 | ||
29503 | ||
29504 | ||
29505 | depcc="$CC" am_compiler_list= | |
29506 | ||
29507 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 | |
29508 | $as_echo_n "checking dependency style of $depcc... " >&6; } | |
d0ac1c44 | 29509 | if ${am_cv_CC_dependencies_compiler_type+:} false; then : |
c971b7fa PA |
29510 | $as_echo_n "(cached) " >&6 |
29511 | else | |
29512 | if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then | |
29513 | # We make a subdir and do the tests there. Otherwise we can end up | |
29514 | # making bogus files that we don't know about and never remove. For | |
29515 | # instance it was reported that on HP-UX the gcc test will end up | |
d0ac1c44 SM |
29516 | # making a dummy file named 'D' -- because '-MD' means "put the output |
29517 | # in D". | |
29518 | rm -rf conftest.dir | |
c971b7fa PA |
29519 | mkdir conftest.dir |
29520 | # Copy depcomp to subdir because otherwise we won't find it if we're | |
29521 | # using a relative directory. | |
29522 | cp "$am_depcomp" conftest.dir | |
29523 | cd conftest.dir | |
29524 | # We will build objects and dependencies in a subdirectory because | |
29525 | # it helps to detect inapplicable dependency modes. For instance | |
29526 | # both Tru64's cc and ICC support -MD to output dependencies as a | |
29527 | # side effect of compilation, but ICC will put the dependencies in | |
29528 | # the current directory while Tru64 will put them in the object | |
29529 | # directory. | |
29530 | mkdir sub | |
29531 | ||
29532 | am_cv_CC_dependencies_compiler_type=none | |
29533 | if test "$am_compiler_list" = ""; then | |
29534 | am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` | |
29535 | fi | |
29536 | am__universal=false | |
29537 | case " $depcc " in #( | |
29538 | *\ -arch\ *\ -arch\ *) am__universal=true ;; | |
29539 | esac | |
29540 | ||
29541 | for depmode in $am_compiler_list; do | |
29542 | # Setup a source with many dependencies, because some compilers | |
29543 | # like to wrap large dependency lists on column 80 (with \), and | |
29544 | # we should not choose a depcomp mode which is confused by this. | |
29545 | # | |
29546 | # We need to recreate these files for each test, as the compiler may | |
29547 | # overwrite some of them when testing with obscure command lines. | |
29548 | # This happens at least with the AIX C compiler. | |
29549 | : > sub/conftest.c | |
29550 | for i in 1 2 3 4 5 6; do | |
29551 | echo '#include "conftst'$i'.h"' >> sub/conftest.c | |
d0ac1c44 SM |
29552 | # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with |
29553 | # Solaris 10 /bin/sh. | |
29554 | echo '/* dummy */' > sub/conftst$i.h | |
c971b7fa PA |
29555 | done |
29556 | echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf | |
29557 | ||
d0ac1c44 | 29558 | # We check with '-c' and '-o' for the sake of the "dashmstdout" |
c971b7fa | 29559 | # mode. It turns out that the SunPro C++ compiler does not properly |
d0ac1c44 SM |
29560 | # handle '-M -o', and we need to detect this. Also, some Intel |
29561 | # versions had trouble with output in subdirs. | |
c971b7fa PA |
29562 | am__obj=sub/conftest.${OBJEXT-o} |
29563 | am__minus_obj="-o $am__obj" | |
29564 | case $depmode in | |
29565 | gcc) | |
29566 | # This depmode causes a compiler race in universal mode. | |
29567 | test "$am__universal" = false || continue | |
29568 | ;; | |
29569 | nosideeffect) | |
d0ac1c44 SM |
29570 | # After this tag, mechanisms are not by side-effect, so they'll |
29571 | # only be used when explicitly requested. | |
c971b7fa PA |
29572 | if test "x$enable_dependency_tracking" = xyes; then |
29573 | continue | |
29574 | else | |
29575 | break | |
29576 | fi | |
29577 | ;; | |
d0ac1c44 SM |
29578 | msvc7 | msvc7msys | msvisualcpp | msvcmsys) |
29579 | # This compiler won't grok '-c -o', but also, the minuso test has | |
c971b7fa PA |
29580 | # not run yet. These depmodes are late enough in the game, and |
29581 | # so weak that their functioning should not be impacted. | |
29582 | am__obj=conftest.${OBJEXT-o} | |
29583 | am__minus_obj= | |
29584 | ;; | |
29585 | none) break ;; | |
29586 | esac | |
29587 | if depmode=$depmode \ | |
29588 | source=sub/conftest.c object=$am__obj \ | |
29589 | depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ | |
29590 | $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ | |
29591 | >/dev/null 2>conftest.err && | |
29592 | grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && | |
29593 | grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && | |
29594 | grep $am__obj sub/conftest.Po > /dev/null 2>&1 && | |
29595 | ${MAKE-make} -s -f confmf > /dev/null 2>&1; then | |
29596 | # icc doesn't choke on unknown options, it will just issue warnings | |
29597 | # or remarks (even with -Werror). So we grep stderr for any message | |
29598 | # that says an option was ignored or not supported. | |
29599 | # When given -MP, icc 7.0 and 7.1 complain thusly: | |
29600 | # icc: Command line warning: ignoring option '-M'; no argument required | |
29601 | # The diagnosis changed in icc 8.0: | |
29602 | # icc: Command line remark: option '-MP' not supported | |
29603 | if (grep 'ignoring option' conftest.err || | |
29604 | grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else | |
29605 | am_cv_CC_dependencies_compiler_type=$depmode | |
29606 | break | |
29607 | fi | |
29608 | fi | |
29609 | done | |
29610 | ||
29611 | cd .. | |
29612 | rm -rf conftest.dir | |
29613 | else | |
29614 | am_cv_CC_dependencies_compiler_type=none | |
29615 | fi | |
29616 | ||
29617 | fi | |
29618 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 | |
29619 | $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } | |
29620 | CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type | |
29621 | ||
29622 | if | |
29623 | test "x$enable_dependency_tracking" != xno \ | |
29624 | && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then | |
29625 | am__fastdepCC_TRUE= | |
29626 | am__fastdepCC_FALSE='#' | |
29627 | else | |
29628 | am__fastdepCC_TRUE='#' | |
29629 | am__fastdepCC_FALSE= | |
29630 | fi | |
29631 | ||
29632 | ||
29633 | ||
d0ac1c44 SM |
29634 | # POSIX will say in a future version that running "rm -f" with no argument |
29635 | # is OK; and we want to be able to make that assumption in our Makefile | |
29636 | # recipes. So use an aggressive probe to check that the usage we want is | |
29637 | # actually supported "in the wild" to an acceptable degree. | |
29638 | # See automake bug#10828. | |
29639 | # To make any issue more visible, cause the running configure to be aborted | |
29640 | # by default if the 'rm' program in use doesn't match our expectations; the | |
29641 | # user can still override this though. | |
29642 | if rm -f && rm -fr && rm -rf; then : OK; else | |
29643 | cat >&2 <<'END' | |
29644 | Oops! | |
29645 | ||
29646 | Your 'rm' program seems unable to run without file operands specified | |
29647 | on the command line, even when the '-f' option is present. This is contrary | |
29648 | to the behaviour of most rm programs out there, and not conforming with | |
29649 | the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> | |
29650 | ||
29651 | Please tell bug-automake@gnu.org about your system, including the value | |
29652 | of your $PATH and any error possibly output before this message. This | |
29653 | can help us improve future automake versions. | |
29654 | ||
29655 | END | |
29656 | if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then | |
29657 | echo 'Configuration will proceed anyway, since you have set the' >&2 | |
29658 | echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 | |
29659 | echo >&2 | |
29660 | else | |
29661 | cat >&2 <<'END' | |
29662 | Aborting the configuration process, to ensure you take notice of the issue. | |
29663 | ||
29664 | You can download and install GNU coreutils to get an 'rm' implementation | |
29665 | that behaves properly: <http://www.gnu.org/software/coreutils/>. | |
29666 | ||
29667 | If you want to complete the configuration process using your problematic | |
29668 | 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM | |
29669 | to "yes", and re-run configure. | |
29670 | ||
29671 | END | |
29672 | as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 | |
29673 | fi | |
29674 | fi | |
29675 | ||
c971b7fa | 29676 | |
39be3c7e SM |
29677 | # Check whether --enable-silent-rules was given. |
29678 | if test "${enable_silent_rules+set}" = set; then : | |
29679 | enableval=$enable_silent_rules; | |
29680 | fi | |
29681 | ||
d0ac1c44 SM |
29682 | case $enable_silent_rules in # ((( |
29683 | yes) AM_DEFAULT_VERBOSITY=0;; | |
29684 | no) AM_DEFAULT_VERBOSITY=1;; | |
29685 | *) AM_DEFAULT_VERBOSITY=0;; | |
39be3c7e | 29686 | esac |
d0ac1c44 SM |
29687 | am_make=${MAKE-make} |
29688 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 | |
29689 | $as_echo_n "checking whether $am_make supports nested variables... " >&6; } | |
29690 | if ${am_cv_make_support_nested_variables+:} false; then : | |
29691 | $as_echo_n "(cached) " >&6 | |
29692 | else | |
29693 | if $as_echo 'TRUE=$(BAR$(V)) | |
29694 | BAR0=false | |
29695 | BAR1=true | |
29696 | V=1 | |
29697 | am__doit: | |
29698 | @$(TRUE) | |
29699 | .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then | |
29700 | am_cv_make_support_nested_variables=yes | |
29701 | else | |
29702 | am_cv_make_support_nested_variables=no | |
29703 | fi | |
29704 | fi | |
29705 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 | |
29706 | $as_echo "$am_cv_make_support_nested_variables" >&6; } | |
29707 | if test $am_cv_make_support_nested_variables = yes; then | |
29708 | AM_V='$(V)' | |
29709 | AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' | |
29710 | else | |
29711 | AM_V=$AM_DEFAULT_VERBOSITY | |
29712 | AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY | |
29713 | fi | |
39be3c7e SM |
29714 | AM_BACKSLASH='\' |
29715 | ||
29716 | ||
c971b7fa PA |
29717 | # --------------------- # |
29718 | # Checks for programs. # | |
29719 | # --------------------- # | |
29720 | ||
29721 | ||
29722 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 | |
29723 | $as_echo_n "checking whether ln -s works... " >&6; } | |
29724 | LN_S=$as_ln_s | |
29725 | if test "$LN_S" = "ln -s"; then | |
29726 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | |
29727 | $as_echo "yes" >&6; } | |
29728 | else | |
29729 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 | |
29730 | $as_echo "no, using $LN_S" >&6; } | |
29731 | fi | |
29732 | ||
29733 | if test -n "$ac_tool_prefix"; then | |
29734 | # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. | |
29735 | set dummy ${ac_tool_prefix}ranlib; ac_word=$2 | |
29736 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
29737 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 29738 | if ${ac_cv_prog_RANLIB+:} false; then : |
c971b7fa PA |
29739 | $as_echo_n "(cached) " >&6 |
29740 | else | |
29741 | if test -n "$RANLIB"; then | |
29742 | ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. | |
29743 | else | |
29744 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
29745 | for as_dir in $PATH | |
29746 | do | |
29747 | IFS=$as_save_IFS | |
29748 | test -z "$as_dir" && as_dir=. | |
29749 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 29750 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
29751 | ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" |
29752 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
29753 | break 2 | |
29754 | fi | |
29755 | done | |
29756 | done | |
29757 | IFS=$as_save_IFS | |
29758 | ||
29759 | fi | |
29760 | fi | |
29761 | RANLIB=$ac_cv_prog_RANLIB | |
29762 | if test -n "$RANLIB"; then | |
29763 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 | |
29764 | $as_echo "$RANLIB" >&6; } | |
29765 | else | |
29766 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
29767 | $as_echo "no" >&6; } | |
29768 | fi | |
29769 | ||
29770 | ||
29771 | fi | |
29772 | if test -z "$ac_cv_prog_RANLIB"; then | |
29773 | ac_ct_RANLIB=$RANLIB | |
29774 | # Extract the first word of "ranlib", so it can be a program name with args. | |
29775 | set dummy ranlib; ac_word=$2 | |
29776 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
29777 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 29778 | if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : |
c971b7fa PA |
29779 | $as_echo_n "(cached) " >&6 |
29780 | else | |
29781 | if test -n "$ac_ct_RANLIB"; then | |
29782 | ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. | |
29783 | else | |
29784 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
29785 | for as_dir in $PATH | |
29786 | do | |
29787 | IFS=$as_save_IFS | |
29788 | test -z "$as_dir" && as_dir=. | |
29789 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 29790 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
29791 | ac_cv_prog_ac_ct_RANLIB="ranlib" |
29792 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
29793 | break 2 | |
29794 | fi | |
29795 | done | |
29796 | done | |
29797 | IFS=$as_save_IFS | |
29798 | ||
29799 | fi | |
29800 | fi | |
29801 | ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB | |
29802 | if test -n "$ac_ct_RANLIB"; then | |
29803 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 | |
29804 | $as_echo "$ac_ct_RANLIB" >&6; } | |
29805 | else | |
29806 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
29807 | $as_echo "no" >&6; } | |
29808 | fi | |
29809 | ||
29810 | if test "x$ac_ct_RANLIB" = x; then | |
29811 | RANLIB=":" | |
29812 | else | |
29813 | case $cross_compiling:$ac_tool_warned in | |
29814 | yes:) | |
29815 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
29816 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
29817 | ac_tool_warned=yes ;; | |
29818 | esac | |
29819 | RANLIB=$ac_ct_RANLIB | |
29820 | fi | |
29821 | else | |
29822 | RANLIB="$ac_cv_prog_RANLIB" | |
29823 | fi | |
29824 | ||
29825 | ||
29826 | if test -n "$ac_tool_prefix"; then | |
29827 | # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. | |
29828 | set dummy ${ac_tool_prefix}ar; ac_word=$2 | |
29829 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
29830 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 29831 | if ${ac_cv_prog_AR+:} false; then : |
c971b7fa PA |
29832 | $as_echo_n "(cached) " >&6 |
29833 | else | |
29834 | if test -n "$AR"; then | |
29835 | ac_cv_prog_AR="$AR" # Let the user override the test. | |
29836 | else | |
29837 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
29838 | for as_dir in $PATH | |
29839 | do | |
29840 | IFS=$as_save_IFS | |
29841 | test -z "$as_dir" && as_dir=. | |
29842 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 29843 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
29844 | ac_cv_prog_AR="${ac_tool_prefix}ar" |
29845 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
29846 | break 2 | |
29847 | fi | |
29848 | done | |
29849 | done | |
29850 | IFS=$as_save_IFS | |
29851 | ||
29852 | fi | |
29853 | fi | |
29854 | AR=$ac_cv_prog_AR | |
29855 | if test -n "$AR"; then | |
29856 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 | |
29857 | $as_echo "$AR" >&6; } | |
29858 | else | |
29859 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
29860 | $as_echo "no" >&6; } | |
29861 | fi | |
29862 | ||
29863 | ||
29864 | fi | |
29865 | if test -z "$ac_cv_prog_AR"; then | |
29866 | ac_ct_AR=$AR | |
29867 | # Extract the first word of "ar", so it can be a program name with args. | |
29868 | set dummy ar; ac_word=$2 | |
29869 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
29870 | $as_echo_n "checking for $ac_word... " >&6; } | |
d0ac1c44 | 29871 | if ${ac_cv_prog_ac_ct_AR+:} false; then : |
c971b7fa PA |
29872 | $as_echo_n "(cached) " >&6 |
29873 | else | |
29874 | if test -n "$ac_ct_AR"; then | |
29875 | ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. | |
29876 | else | |
29877 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
29878 | for as_dir in $PATH | |
29879 | do | |
29880 | IFS=$as_save_IFS | |
29881 | test -z "$as_dir" && as_dir=. | |
29882 | for ac_exec_ext in '' $ac_executable_extensions; do | |
d0ac1c44 | 29883 | if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
c971b7fa PA |
29884 | ac_cv_prog_ac_ct_AR="ar" |
29885 | $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
29886 | break 2 | |
29887 | fi | |
29888 | done | |
29889 | done | |
29890 | IFS=$as_save_IFS | |
29891 | ||
29892 | fi | |
29893 | fi | |
29894 | ac_ct_AR=$ac_cv_prog_ac_ct_AR | |
29895 | if test -n "$ac_ct_AR"; then | |
29896 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 | |
29897 | $as_echo "$ac_ct_AR" >&6; } | |
29898 | else | |
29899 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
29900 | $as_echo "no" >&6; } | |
29901 | fi | |
29902 | ||
29903 | if test "x$ac_ct_AR" = x; then | |
29904 | AR="" | |
29905 | else | |
29906 | case $cross_compiling:$ac_tool_warned in | |
29907 | yes:) | |
29908 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
29909 | $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
29910 | ac_tool_warned=yes ;; | |
29911 | esac | |
29912 | AR=$ac_ct_AR | |
29913 | fi | |
29914 | else | |
29915 | AR="$ac_cv_prog_AR" | |
29916 | fi | |
29917 | ||
29918 | ||
29919 | # ---------------------- # | |
29920 | # Checks for libraries. # | |
29921 | # ---------------------- # | |
29922 | ||
29923 | ac_config_files="$ac_config_files Makefile import/Makefile" | |
29924 | ||
29925 | ac_config_commands="$ac_config_commands default" | |
29926 | ||
29927 | cat >confcache <<\_ACEOF | |
29928 | # This file is a shell script that caches the results of configure | |
29929 | # tests run on this system so they can be shared between configure | |
29930 | # scripts and configure runs, see configure's option --config-cache. | |
29931 | # It is not useful on other systems. If it contains results you don't | |
29932 | # want to keep, you may remove or edit it. | |
29933 | # | |
29934 | # config.status only pays attention to the cache file if you give it | |
29935 | # the --recheck option to rerun configure. | |
29936 | # | |
29937 | # `ac_cv_env_foo' variables (set or unset) will be overridden when | |
29938 | # loading this file, other *unset* `ac_cv_foo' will be assigned the | |
29939 | # following values. | |
29940 | ||
29941 | _ACEOF | |
29942 | ||
29943 | # The following way of writing the cache mishandles newlines in values, | |
29944 | # but we know of no workaround that is simple, portable, and efficient. | |
29945 | # So, we kill variables containing newlines. | |
29946 | # Ultrix sh set writes to stderr and can't be redirected directly, | |
29947 | # and sets the high bit in the cache file unless we assign to the vars. | |
29948 | ( | |
29949 | for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do | |
29950 | eval ac_val=\$$ac_var | |
29951 | case $ac_val in #( | |
29952 | *${as_nl}*) | |
29953 | case $ac_var in #( | |
29954 | *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 | |
29955 | $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; | |
29956 | esac | |
29957 | case $ac_var in #( | |
29958 | _ | IFS | as_nl) ;; #( | |
29959 | BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( | |
29960 | *) { eval $ac_var=; unset $ac_var;} ;; | |
29961 | esac ;; | |
29962 | esac | |
29963 | done | |
29964 | ||
29965 | (set) 2>&1 | | |
29966 | case $as_nl`(ac_space=' '; set) 2>&1` in #( | |
29967 | *${as_nl}ac_space=\ *) | |
29968 | # `set' does not quote correctly, so add quotes: double-quote | |
29969 | # substitution turns \\\\ into \\, and sed turns \\ into \. | |
29970 | sed -n \ | |
29971 | "s/'/'\\\\''/g; | |
29972 | s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" | |
29973 | ;; #( | |
29974 | *) | |
29975 | # `set' quotes correctly as required by POSIX, so do not add quotes. | |
29976 | sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" | |
29977 | ;; | |
29978 | esac | | |
29979 | sort | |
29980 | ) | | |
29981 | sed ' | |
29982 | /^ac_cv_env_/b end | |
29983 | t clear | |
29984 | :clear | |
29985 | s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ | |
29986 | t end | |
29987 | s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ | |
29988 | :end' >>confcache | |
29989 | if diff "$cache_file" confcache >/dev/null 2>&1; then :; else | |
29990 | if test -w "$cache_file"; then | |
d0ac1c44 | 29991 | if test "x$cache_file" != "x/dev/null"; then |
c971b7fa PA |
29992 | { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 |
29993 | $as_echo "$as_me: updating cache $cache_file" >&6;} | |
d0ac1c44 SM |
29994 | if test ! -f "$cache_file" || test -h "$cache_file"; then |
29995 | cat confcache >"$cache_file" | |
29996 | else | |
29997 | case $cache_file in #( | |
29998 | */* | ?:*) | |
29999 | mv -f confcache "$cache_file"$$ && | |
30000 | mv -f "$cache_file"$$ "$cache_file" ;; #( | |
30001 | *) | |
30002 | mv -f confcache "$cache_file" ;; | |
30003 | esac | |
30004 | fi | |
30005 | fi | |
c971b7fa PA |
30006 | else |
30007 | { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 | |
30008 | $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} | |
30009 | fi | |
30010 | fi | |
30011 | rm -f confcache | |
30012 | ||
30013 | test "x$prefix" = xNONE && prefix=$ac_default_prefix | |
30014 | # Let make expand exec_prefix. | |
30015 | test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' | |
30016 | ||
30017 | DEFS=-DHAVE_CONFIG_H | |
30018 | ||
30019 | ac_libobjs= | |
30020 | ac_ltlibobjs= | |
30021 | for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue | |
30022 | # 1. Remove the extension, and $U if already installed. | |
30023 | ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' | |
30024 | ac_i=`$as_echo "$ac_i" | sed "$ac_script"` | |
30025 | # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR | |
30026 | # will be set to the directory where LIBOBJS objects are built. | |
30027 | as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" | |
30028 | as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' | |
30029 | done | |
30030 | LIBOBJS=$ac_libobjs | |
30031 | ||
30032 | LTLIBOBJS=$ac_ltlibobjs | |
30033 | ||
30034 | ||
30035 | if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then | |
d0ac1c44 | 30036 | as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. |
c971b7fa PA |
30037 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
30038 | fi | |
30039 | if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then | |
d0ac1c44 | 30040 | as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined. |
c971b7fa PA |
30041 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
30042 | fi | |
8690e634 | 30043 | if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then |
d0ac1c44 | 30044 | as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined. |
8690e634 JK |
30045 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
30046 | fi | |
18848e28 | 30047 | if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then |
d0ac1c44 | 30048 | as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined. |
18848e28 GF |
30049 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
30050 | fi | |
88b48903 | 30051 | if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then |
d0ac1c44 | 30052 | as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined. |
88b48903 WN |
30053 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
30054 | fi | |
8690e634 | 30055 | if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then |
d0ac1c44 | 30056 | as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined. |
8690e634 JK |
30057 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
30058 | fi | |
c0c3707f CB |
30059 | if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then |
30060 | as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined. | |
30061 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
30062 | fi | |
30063 | if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then | |
30064 | as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined. | |
30065 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
30066 | fi | |
6ec2e0f5 | 30067 | if test -z "${GL_GENERATE_GLOB_H_TRUE}" && test -z "${GL_GENERATE_GLOB_H_FALSE}"; then |
d0ac1c44 | 30068 | as_fn_error $? "conditional \"GL_GENERATE_GLOB_H\" was never defined. |
6ec2e0f5 SDJ |
30069 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
30070 | fi | |
49e4877c | 30071 | if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then |
d0ac1c44 | 30072 | as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. |
49e4877c PA |
30073 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
30074 | fi | |
30075 | if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then | |
d0ac1c44 | 30076 | as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. |
49e4877c PA |
30077 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
30078 | fi | |
c971b7fa | 30079 | if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then |
d0ac1c44 | 30080 | as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined. |
c971b7fa PA |
30081 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
30082 | fi | |
88b48903 WN |
30083 | |
30084 | ||
5df4cba6 SM |
30085 | if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then |
30086 | as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. | |
30087 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
30088 | fi | |
725e2999 JB |
30089 | if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then |
30090 | as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined. | |
30091 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
30092 | fi | |
30093 | if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then | |
30094 | as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined. | |
30095 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 | |
30096 | fi | |
8690e634 | 30097 | if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then |
d0ac1c44 | 30098 | as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined. |
8690e634 JK |
30099 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
30100 | fi | |
c971b7fa | 30101 | if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then |
d0ac1c44 | 30102 | as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined. |
c971b7fa PA |
30103 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
30104 | fi | |
30105 | ||
30106 | gl_libobjs= | |
30107 | gl_ltlibobjs= | |
30108 | if test -n "$gl_LIBOBJS"; then | |
30109 | # Remove the extension. | |
30110 | sed_drop_objext='s/\.o$//;s/\.obj$//' | |
30111 | for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do | |
30112 | gl_libobjs="$gl_libobjs $i.$ac_objext" | |
30113 | gl_ltlibobjs="$gl_ltlibobjs $i.lo" | |
30114 | done | |
30115 | fi | |
30116 | gl_LIBOBJS=$gl_libobjs | |
30117 | ||
30118 | gl_LTLIBOBJS=$gl_ltlibobjs | |
30119 | ||
30120 | ||
30121 | ||
30122 | gltests_libobjs= | |
30123 | gltests_ltlibobjs= | |
30124 | if test -n "$gltests_LIBOBJS"; then | |
30125 | # Remove the extension. | |
30126 | sed_drop_objext='s/\.o$//;s/\.obj$//' | |
30127 | for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do | |
30128 | gltests_libobjs="$gltests_libobjs $i.$ac_objext" | |
30129 | gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" | |
30130 | done | |
30131 | fi | |
30132 | gltests_LIBOBJS=$gltests_libobjs | |
30133 | ||
30134 | gltests_LTLIBOBJS=$gltests_ltlibobjs | |
30135 | ||
30136 | ||
d0ac1c44 SM |
30137 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 |
30138 | $as_echo_n "checking that generated files are newer than configure... " >&6; } | |
30139 | if test -n "$am_sleep_pid"; then | |
30140 | # Hide warnings about reused PIDs. | |
30141 | wait $am_sleep_pid 2>/dev/null | |
30142 | fi | |
30143 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 | |
30144 | $as_echo "done" >&6; } | |
c971b7fa | 30145 | if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then |
d0ac1c44 | 30146 | as_fn_error $? "conditional \"AMDEP\" was never defined. |
c971b7fa PA |
30147 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
30148 | fi | |
30149 | if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then | |
d0ac1c44 | 30150 | as_fn_error $? "conditional \"am__fastdepCC\" was never defined. |
c971b7fa PA |
30151 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
30152 | fi | |
30153 | if test -n "$EXEEXT"; then | |
30154 | am__EXEEXT_TRUE= | |
30155 | am__EXEEXT_FALSE='#' | |
30156 | else | |
30157 | am__EXEEXT_TRUE='#' | |
30158 | am__EXEEXT_FALSE= | |
30159 | fi | |
30160 | ||
30161 | ||
d0ac1c44 | 30162 | : "${CONFIG_STATUS=./config.status}" |
c971b7fa PA |
30163 | ac_write_fail=0 |
30164 | ac_clean_files_save=$ac_clean_files | |
30165 | ac_clean_files="$ac_clean_files $CONFIG_STATUS" | |
30166 | { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 | |
30167 | $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} | |
30168 | as_write_fail=0 | |
30169 | cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 | |
30170 | #! $SHELL | |
30171 | # Generated by $as_me. | |
30172 | # Run this file to recreate the current configuration. | |
30173 | # Compiler output produced by configure, useful for debugging | |
30174 | # configure, is in config.log if it exists. | |
30175 | ||
30176 | debug=false | |
30177 | ac_cs_recheck=false | |
30178 | ac_cs_silent=false | |
30179 | ||
30180 | SHELL=\${CONFIG_SHELL-$SHELL} | |
30181 | export SHELL | |
30182 | _ASEOF | |
30183 | cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 | |
30184 | ## -------------------- ## | |
30185 | ## M4sh Initialization. ## | |
30186 | ## -------------------- ## | |
30187 | ||
30188 | # Be more Bourne compatible | |
30189 | DUALCASE=1; export DUALCASE # for MKS sh | |
30190 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : | |
30191 | emulate sh | |
30192 | NULLCMD=: | |
30193 | # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which | |
30194 | # is contrary to our usage. Disable this feature. | |
30195 | alias -g '${1+"$@"}'='"$@"' | |
30196 | setopt NO_GLOB_SUBST | |
30197 | else | |
30198 | case `(set -o) 2>/dev/null` in #( | |
30199 | *posix*) : | |
30200 | set -o posix ;; #( | |
30201 | *) : | |
30202 | ;; | |
30203 | esac | |
30204 | fi | |
30205 | ||
30206 | ||
30207 | as_nl=' | |
30208 | ' | |
30209 | export as_nl | |
30210 | # Printing a long string crashes Solaris 7 /usr/bin/printf. | |
30211 | as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' | |
30212 | as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo | |
30213 | as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo | |
30214 | # Prefer a ksh shell builtin over an external printf program on Solaris, | |
30215 | # but without wasting forks for bash or zsh. | |
30216 | if test -z "$BASH_VERSION$ZSH_VERSION" \ | |
30217 | && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then | |
30218 | as_echo='print -r --' | |
30219 | as_echo_n='print -rn --' | |
30220 | elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then | |
30221 | as_echo='printf %s\n' | |
30222 | as_echo_n='printf %s' | |
30223 | else | |
30224 | if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then | |
30225 | as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' | |
30226 | as_echo_n='/usr/ucb/echo -n' | |
30227 | else | |
30228 | as_echo_body='eval expr "X$1" : "X\\(.*\\)"' | |
30229 | as_echo_n_body='eval | |
30230 | arg=$1; | |
30231 | case $arg in #( | |
30232 | *"$as_nl"*) | |
30233 | expr "X$arg" : "X\\(.*\\)$as_nl"; | |
30234 | arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; | |
30235 | esac; | |
30236 | expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" | |
30237 | ' | |
30238 | export as_echo_n_body | |
30239 | as_echo_n='sh -c $as_echo_n_body as_echo' | |
30240 | fi | |
30241 | export as_echo_body | |
30242 | as_echo='sh -c $as_echo_body as_echo' | |
30243 | fi | |
30244 | ||
30245 | # The user is always right. | |
30246 | if test "${PATH_SEPARATOR+set}" != set; then | |
30247 | PATH_SEPARATOR=: | |
30248 | (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { | |
30249 | (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || | |
30250 | PATH_SEPARATOR=';' | |
30251 | } | |
30252 | fi | |
30253 | ||
30254 | ||
30255 | # IFS | |
30256 | # We need space, tab and new line, in precisely that order. Quoting is | |
30257 | # there to prevent editors from complaining about space-tab. | |
30258 | # (If _AS_PATH_WALK were called with IFS unset, it would disable word | |
30259 | # splitting by setting IFS to empty value.) | |
30260 | IFS=" "" $as_nl" | |
30261 | ||
30262 | # Find who we are. Look in the path if we contain no directory separator. | |
d0ac1c44 | 30263 | as_myself= |
c971b7fa PA |
30264 | case $0 in #(( |
30265 | *[\\/]* ) as_myself=$0 ;; | |
30266 | *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
30267 | for as_dir in $PATH | |
30268 | do | |
30269 | IFS=$as_save_IFS | |
30270 | test -z "$as_dir" && as_dir=. | |
30271 | test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break | |
30272 | done | |
30273 | IFS=$as_save_IFS | |
30274 | ||
30275 | ;; | |
30276 | esac | |
30277 | # We did not find ourselves, most probably we were run as `sh COMMAND' | |
30278 | # in which case we are not to be found in the path. | |
30279 | if test "x$as_myself" = x; then | |
30280 | as_myself=$0 | |
30281 | fi | |
30282 | if test ! -f "$as_myself"; then | |
30283 | $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 | |
30284 | exit 1 | |
30285 | fi | |
30286 | ||
30287 | # Unset variables that we do not need and which cause bugs (e.g. in | |
30288 | # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" | |
30289 | # suppresses any "Segmentation fault" message there. '((' could | |
30290 | # trigger a bug in pdksh 5.2.14. | |
30291 | for as_var in BASH_ENV ENV MAIL MAILPATH | |
30292 | do eval test x\${$as_var+set} = xset \ | |
30293 | && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : | |
30294 | done | |
30295 | PS1='$ ' | |
30296 | PS2='> ' | |
30297 | PS4='+ ' | |
30298 | ||
30299 | # NLS nuisances. | |
30300 | LC_ALL=C | |
30301 | export LC_ALL | |
30302 | LANGUAGE=C | |
30303 | export LANGUAGE | |
30304 | ||
30305 | # CDPATH. | |
30306 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH | |
30307 | ||
30308 | ||
d0ac1c44 SM |
30309 | # as_fn_error STATUS ERROR [LINENO LOG_FD] |
30310 | # ---------------------------------------- | |
c971b7fa PA |
30311 | # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are |
30312 | # provided, also output the error to LOG_FD, referencing LINENO. Then exit the | |
d0ac1c44 | 30313 | # script with STATUS, using 1 if that was 0. |
c971b7fa PA |
30314 | as_fn_error () |
30315 | { | |
d0ac1c44 SM |
30316 | as_status=$1; test $as_status -eq 0 && as_status=1 |
30317 | if test "$4"; then | |
30318 | as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack | |
30319 | $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 | |
c971b7fa | 30320 | fi |
d0ac1c44 | 30321 | $as_echo "$as_me: error: $2" >&2 |
c971b7fa PA |
30322 | as_fn_exit $as_status |
30323 | } # as_fn_error | |
30324 | ||
30325 | ||
30326 | # as_fn_set_status STATUS | |
30327 | # ----------------------- | |
30328 | # Set $? to STATUS, without forking. | |
30329 | as_fn_set_status () | |
30330 | { | |
30331 | return $1 | |
30332 | } # as_fn_set_status | |
30333 | ||
30334 | # as_fn_exit STATUS | |
30335 | # ----------------- | |
30336 | # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. | |
30337 | as_fn_exit () | |
30338 | { | |
30339 | set +e | |
30340 | as_fn_set_status $1 | |
30341 | exit $1 | |
30342 | } # as_fn_exit | |
30343 | ||
30344 | # as_fn_unset VAR | |
30345 | # --------------- | |
30346 | # Portably unset VAR. | |
30347 | as_fn_unset () | |
30348 | { | |
30349 | { eval $1=; unset $1;} | |
30350 | } | |
30351 | as_unset=as_fn_unset | |
30352 | # as_fn_append VAR VALUE | |
30353 | # ---------------------- | |
30354 | # Append the text in VALUE to the end of the definition contained in VAR. Take | |
30355 | # advantage of any shell optimizations that allow amortized linear growth over | |
30356 | # repeated appends, instead of the typical quadratic growth present in naive | |
30357 | # implementations. | |
30358 | if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : | |
30359 | eval 'as_fn_append () | |
30360 | { | |
30361 | eval $1+=\$2 | |
30362 | }' | |
30363 | else | |
30364 | as_fn_append () | |
30365 | { | |
30366 | eval $1=\$$1\$2 | |
30367 | } | |
30368 | fi # as_fn_append | |
30369 | ||
30370 | # as_fn_arith ARG... | |
30371 | # ------------------ | |
30372 | # Perform arithmetic evaluation on the ARGs, and store the result in the | |
30373 | # global $as_val. Take advantage of shells that can avoid forks. The arguments | |
30374 | # must be portable across $(()) and expr. | |
30375 | if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : | |
30376 | eval 'as_fn_arith () | |
30377 | { | |
30378 | as_val=$(( $* )) | |
30379 | }' | |
30380 | else | |
30381 | as_fn_arith () | |
30382 | { | |
30383 | as_val=`expr "$@" || test $? -eq 1` | |
30384 | } | |
30385 | fi # as_fn_arith | |
30386 | ||
30387 | ||
30388 | if expr a : '\(a\)' >/dev/null 2>&1 && | |
30389 | test "X`expr 00001 : '.*\(...\)'`" = X001; then | |
30390 | as_expr=expr | |
30391 | else | |
30392 | as_expr=false | |
30393 | fi | |
30394 | ||
30395 | if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then | |
30396 | as_basename=basename | |
30397 | else | |
30398 | as_basename=false | |
30399 | fi | |
30400 | ||
30401 | if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then | |
30402 | as_dirname=dirname | |
30403 | else | |
30404 | as_dirname=false | |
30405 | fi | |
30406 | ||
30407 | as_me=`$as_basename -- "$0" || | |
30408 | $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ | |
30409 | X"$0" : 'X\(//\)$' \| \ | |
30410 | X"$0" : 'X\(/\)' \| . 2>/dev/null || | |
30411 | $as_echo X/"$0" | | |
30412 | sed '/^.*\/\([^/][^/]*\)\/*$/{ | |
30413 | s//\1/ | |
30414 | q | |
30415 | } | |
30416 | /^X\/\(\/\/\)$/{ | |
30417 | s//\1/ | |
30418 | q | |
30419 | } | |
30420 | /^X\/\(\/\).*/{ | |
30421 | s//\1/ | |
30422 | q | |
30423 | } | |
30424 | s/.*/./; q'` | |
30425 | ||
30426 | # Avoid depending upon Character Ranges. | |
30427 | as_cr_letters='abcdefghijklmnopqrstuvwxyz' | |
30428 | as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
30429 | as_cr_Letters=$as_cr_letters$as_cr_LETTERS | |
30430 | as_cr_digits='0123456789' | |
30431 | as_cr_alnum=$as_cr_Letters$as_cr_digits | |
30432 | ||
30433 | ECHO_C= ECHO_N= ECHO_T= | |
30434 | case `echo -n x` in #((((( | |
30435 | -n*) | |
30436 | case `echo 'xy\c'` in | |
30437 | *c*) ECHO_T=' ';; # ECHO_T is single tab character. | |
30438 | xy) ECHO_C='\c';; | |
30439 | *) echo `echo ksh88 bug on AIX 6.1` > /dev/null | |
30440 | ECHO_T=' ';; | |
30441 | esac;; | |
30442 | *) | |
30443 | ECHO_N='-n';; | |
30444 | esac | |
30445 | ||
30446 | rm -f conf$$ conf$$.exe conf$$.file | |
30447 | if test -d conf$$.dir; then | |
30448 | rm -f conf$$.dir/conf$$.file | |
30449 | else | |
30450 | rm -f conf$$.dir | |
30451 | mkdir conf$$.dir 2>/dev/null | |
30452 | fi | |
30453 | if (echo >conf$$.file) 2>/dev/null; then | |
30454 | if ln -s conf$$.file conf$$ 2>/dev/null; then | |
30455 | as_ln_s='ln -s' | |
30456 | # ... but there are two gotchas: | |
30457 | # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. | |
30458 | # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. | |
d0ac1c44 | 30459 | # In both cases, we have to default to `cp -pR'. |
c971b7fa | 30460 | ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || |
d0ac1c44 | 30461 | as_ln_s='cp -pR' |
c971b7fa PA |
30462 | elif ln conf$$.file conf$$ 2>/dev/null; then |
30463 | as_ln_s=ln | |
30464 | else | |
d0ac1c44 | 30465 | as_ln_s='cp -pR' |
c971b7fa PA |
30466 | fi |
30467 | else | |
d0ac1c44 | 30468 | as_ln_s='cp -pR' |
c971b7fa PA |
30469 | fi |
30470 | rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file | |
30471 | rmdir conf$$.dir 2>/dev/null | |
30472 | ||
30473 | ||
30474 | # as_fn_mkdir_p | |
30475 | # ------------- | |
30476 | # Create "$as_dir" as a directory, including parents if necessary. | |
30477 | as_fn_mkdir_p () | |
30478 | { | |
30479 | ||
30480 | case $as_dir in #( | |
30481 | -*) as_dir=./$as_dir;; | |
30482 | esac | |
30483 | test -d "$as_dir" || eval $as_mkdir_p || { | |
30484 | as_dirs= | |
30485 | while :; do | |
30486 | case $as_dir in #( | |
30487 | *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( | |
30488 | *) as_qdir=$as_dir;; | |
30489 | esac | |
30490 | as_dirs="'$as_qdir' $as_dirs" | |
30491 | as_dir=`$as_dirname -- "$as_dir" || | |
30492 | $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
30493 | X"$as_dir" : 'X\(//\)[^/]' \| \ | |
30494 | X"$as_dir" : 'X\(//\)$' \| \ | |
30495 | X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || | |
30496 | $as_echo X"$as_dir" | | |
30497 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
30498 | s//\1/ | |
30499 | q | |
30500 | } | |
30501 | /^X\(\/\/\)[^/].*/{ | |
30502 | s//\1/ | |
30503 | q | |
30504 | } | |
30505 | /^X\(\/\/\)$/{ | |
30506 | s//\1/ | |
30507 | q | |
30508 | } | |
30509 | /^X\(\/\).*/{ | |
30510 | s//\1/ | |
30511 | q | |
30512 | } | |
30513 | s/.*/./; q'` | |
30514 | test -d "$as_dir" && break | |
30515 | done | |
30516 | test -z "$as_dirs" || eval "mkdir $as_dirs" | |
d0ac1c44 | 30517 | } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" |
c971b7fa PA |
30518 | |
30519 | ||
30520 | } # as_fn_mkdir_p | |
30521 | if mkdir -p . 2>/dev/null; then | |
30522 | as_mkdir_p='mkdir -p "$as_dir"' | |
30523 | else | |
30524 | test -d ./-p && rmdir ./-p | |
30525 | as_mkdir_p=false | |
30526 | fi | |
30527 | ||
d0ac1c44 SM |
30528 | |
30529 | # as_fn_executable_p FILE | |
30530 | # ----------------------- | |
30531 | # Test if FILE is an executable regular file. | |
30532 | as_fn_executable_p () | |
30533 | { | |
30534 | test -f "$1" && test -x "$1" | |
30535 | } # as_fn_executable_p | |
30536 | as_test_x='test -x' | |
30537 | as_executable_p=as_fn_executable_p | |
c971b7fa PA |
30538 | |
30539 | # Sed expression to map a string onto a valid CPP name. | |
30540 | as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" | |
30541 | ||
30542 | # Sed expression to map a string onto a valid variable name. | |
30543 | as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" | |
30544 | ||
30545 | ||
30546 | exec 6>&1 | |
30547 | ## ----------------------------------- ## | |
30548 | ## Main body of $CONFIG_STATUS script. ## | |
30549 | ## ----------------------------------- ## | |
30550 | _ASEOF | |
30551 | test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 | |
30552 | ||
30553 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
30554 | # Save the log message, to keep $0 and so on meaningful, and to | |
30555 | # report actual input values of CONFIG_FILES etc. instead of their | |
30556 | # values after options handling. | |
30557 | ac_log=" | |
d0ac1c44 SM |
30558 | This file was extended by libgnu $as_me UNUSED-VERSION, which was |
30559 | generated by GNU Autoconf 2.69. Invocation command line was | |
c971b7fa PA |
30560 | |
30561 | CONFIG_FILES = $CONFIG_FILES | |
30562 | CONFIG_HEADERS = $CONFIG_HEADERS | |
30563 | CONFIG_LINKS = $CONFIG_LINKS | |
30564 | CONFIG_COMMANDS = $CONFIG_COMMANDS | |
30565 | $ $0 $@ | |
30566 | ||
30567 | on `(hostname || uname -n) 2>/dev/null | sed 1q` | |
30568 | " | |
30569 | ||
30570 | _ACEOF | |
30571 | ||
30572 | case $ac_config_files in *" | |
30573 | "*) set x $ac_config_files; shift; ac_config_files=$*;; | |
30574 | esac | |
30575 | ||
30576 | case $ac_config_headers in *" | |
30577 | "*) set x $ac_config_headers; shift; ac_config_headers=$*;; | |
30578 | esac | |
30579 | ||
30580 | ||
30581 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
30582 | # Files that config.status was made for. | |
30583 | config_files="$ac_config_files" | |
30584 | config_headers="$ac_config_headers" | |
30585 | config_commands="$ac_config_commands" | |
30586 | ||
30587 | _ACEOF | |
30588 | ||
30589 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
30590 | ac_cs_usage="\ | |
30591 | \`$as_me' instantiates files and other configuration actions | |
30592 | from templates according to the current configuration. Unless the files | |
30593 | and actions are specified as TAGs, all are instantiated by default. | |
30594 | ||
30595 | Usage: $0 [OPTION]... [TAG]... | |
30596 | ||
30597 | -h, --help print this help, then exit | |
30598 | -V, --version print version number and configuration settings, then exit | |
d0ac1c44 | 30599 | --config print configuration, then exit |
c971b7fa PA |
30600 | -q, --quiet, --silent |
30601 | do not print progress messages | |
30602 | -d, --debug don't remove temporary files | |
30603 | --recheck update $as_me by reconfiguring in the same conditions | |
30604 | --file=FILE[:TEMPLATE] | |
30605 | instantiate the configuration file FILE | |
30606 | --header=FILE[:TEMPLATE] | |
30607 | instantiate the configuration header FILE | |
30608 | ||
30609 | Configuration files: | |
30610 | $config_files | |
30611 | ||
30612 | Configuration headers: | |
30613 | $config_headers | |
30614 | ||
30615 | Configuration commands: | |
30616 | $config_commands | |
30617 | ||
30618 | Report bugs to the package provider." | |
30619 | ||
30620 | _ACEOF | |
30621 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
d0ac1c44 | 30622 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
c971b7fa | 30623 | ac_cs_version="\\ |
d0ac1c44 SM |
30624 | libgnu config.status UNUSED-VERSION |
30625 | configured by $0, generated by GNU Autoconf 2.69, | |
30626 | with options \\"\$ac_cs_config\\" | |
c971b7fa | 30627 | |
d0ac1c44 | 30628 | Copyright (C) 2012 Free Software Foundation, Inc. |
c971b7fa PA |
30629 | This config.status script is free software; the Free Software Foundation |
30630 | gives unlimited permission to copy, distribute and modify it." | |
30631 | ||
30632 | ac_pwd='$ac_pwd' | |
30633 | srcdir='$srcdir' | |
30634 | INSTALL='$INSTALL' | |
30635 | MKDIR_P='$MKDIR_P' | |
30636 | AWK='$AWK' | |
30637 | test -n "\$AWK" || AWK=awk | |
30638 | _ACEOF | |
30639 | ||
30640 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
30641 | # The default lists apply if the user does not specify any file. | |
30642 | ac_need_defaults=: | |
30643 | while test $# != 0 | |
30644 | do | |
30645 | case $1 in | |
d0ac1c44 | 30646 | --*=?*) |
c971b7fa PA |
30647 | ac_option=`expr "X$1" : 'X\([^=]*\)='` |
30648 | ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` | |
30649 | ac_shift=: | |
30650 | ;; | |
d0ac1c44 SM |
30651 | --*=) |
30652 | ac_option=`expr "X$1" : 'X\([^=]*\)='` | |
30653 | ac_optarg= | |
30654 | ac_shift=: | |
30655 | ;; | |
c971b7fa PA |
30656 | *) |
30657 | ac_option=$1 | |
30658 | ac_optarg=$2 | |
30659 | ac_shift=shift | |
30660 | ;; | |
30661 | esac | |
30662 | ||
30663 | case $ac_option in | |
30664 | # Handling of the options. | |
30665 | -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) | |
30666 | ac_cs_recheck=: ;; | |
30667 | --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) | |
30668 | $as_echo "$ac_cs_version"; exit ;; | |
d0ac1c44 SM |
30669 | --config | --confi | --conf | --con | --co | --c ) |
30670 | $as_echo "$ac_cs_config"; exit ;; | |
c971b7fa PA |
30671 | --debug | --debu | --deb | --de | --d | -d ) |
30672 | debug=: ;; | |
30673 | --file | --fil | --fi | --f ) | |
30674 | $ac_shift | |
30675 | case $ac_optarg in | |
30676 | *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; | |
d0ac1c44 | 30677 | '') as_fn_error $? "missing file argument" ;; |
c971b7fa PA |
30678 | esac |
30679 | as_fn_append CONFIG_FILES " '$ac_optarg'" | |
30680 | ac_need_defaults=false;; | |
30681 | --header | --heade | --head | --hea ) | |
30682 | $ac_shift | |
30683 | case $ac_optarg in | |
30684 | *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; | |
30685 | esac | |
30686 | as_fn_append CONFIG_HEADERS " '$ac_optarg'" | |
30687 | ac_need_defaults=false;; | |
30688 | --he | --h) | |
30689 | # Conflict between --help and --header | |
d0ac1c44 | 30690 | as_fn_error $? "ambiguous option: \`$1' |
c971b7fa PA |
30691 | Try \`$0 --help' for more information.";; |
30692 | --help | --hel | -h ) | |
30693 | $as_echo "$ac_cs_usage"; exit ;; | |
30694 | -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | |
30695 | | -silent | --silent | --silen | --sile | --sil | --si | --s) | |
30696 | ac_cs_silent=: ;; | |
30697 | ||
30698 | # This is an error. | |
d0ac1c44 | 30699 | -*) as_fn_error $? "unrecognized option: \`$1' |
c971b7fa PA |
30700 | Try \`$0 --help' for more information." ;; |
30701 | ||
30702 | *) as_fn_append ac_config_targets " $1" | |
30703 | ac_need_defaults=false ;; | |
30704 | ||
30705 | esac | |
30706 | shift | |
30707 | done | |
30708 | ||
30709 | ac_configure_extra_args= | |
30710 | ||
30711 | if $ac_cs_silent; then | |
30712 | exec 6>/dev/null | |
30713 | ac_configure_extra_args="$ac_configure_extra_args --silent" | |
30714 | fi | |
30715 | ||
30716 | _ACEOF | |
30717 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
30718 | if \$ac_cs_recheck; then | |
d0ac1c44 | 30719 | set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion |
c971b7fa PA |
30720 | shift |
30721 | \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 | |
30722 | CONFIG_SHELL='$SHELL' | |
30723 | export CONFIG_SHELL | |
30724 | exec "\$@" | |
30725 | fi | |
30726 | ||
30727 | _ACEOF | |
30728 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
30729 | exec 5>>config.log | |
30730 | { | |
30731 | echo | |
30732 | sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX | |
30733 | ## Running $as_me. ## | |
30734 | _ASBOX | |
30735 | $as_echo "$ac_log" | |
30736 | } >&5 | |
30737 | ||
30738 | _ACEOF | |
30739 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
30740 | # | |
30741 | # INIT-COMMANDS | |
30742 | # | |
30743 | AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" | |
30744 | ||
30745 | _ACEOF | |
30746 | ||
30747 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
30748 | ||
30749 | # Handling of arguments. | |
30750 | for ac_config_target in $ac_config_targets | |
30751 | do | |
30752 | case $ac_config_target in | |
30753 | "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; | |
30754 | "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; | |
30755 | "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; | |
30756 | "import/Makefile") CONFIG_FILES="$CONFIG_FILES import/Makefile" ;; | |
30757 | "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; | |
30758 | ||
d0ac1c44 | 30759 | *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; |
c971b7fa PA |
30760 | esac |
30761 | done | |
30762 | ||
30763 | ||
30764 | # If the user did not use the arguments to specify the items to instantiate, | |
30765 | # then the envvar interface is used. Set only those that are not. | |
30766 | # We use the long form for the default assignment because of an extremely | |
30767 | # bizarre bug on SunOS 4.1.3. | |
30768 | if $ac_need_defaults; then | |
30769 | test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files | |
30770 | test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers | |
30771 | test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands | |
30772 | fi | |
30773 | ||
30774 | # Have a temporary directory for convenience. Make it in the build tree | |
30775 | # simply because there is no reason against having it here, and in addition, | |
30776 | # creating and moving files from /tmp can sometimes cause problems. | |
30777 | # Hook for its removal unless debugging. | |
30778 | # Note that there is a small window in which the directory will not be cleaned: | |
30779 | # after its creation but before its name has been assigned to `$tmp'. | |
30780 | $debug || | |
30781 | { | |
d0ac1c44 | 30782 | tmp= ac_tmp= |
c971b7fa | 30783 | trap 'exit_status=$? |
d0ac1c44 SM |
30784 | : "${ac_tmp:=$tmp}" |
30785 | { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status | |
c971b7fa PA |
30786 | ' 0 |
30787 | trap 'as_fn_exit 1' 1 2 13 15 | |
30788 | } | |
30789 | # Create a (secure) tmp directory for tmp files. | |
30790 | ||
30791 | { | |
30792 | tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && | |
d0ac1c44 | 30793 | test -d "$tmp" |
c971b7fa PA |
30794 | } || |
30795 | { | |
30796 | tmp=./conf$$-$RANDOM | |
30797 | (umask 077 && mkdir "$tmp") | |
d0ac1c44 SM |
30798 | } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 |
30799 | ac_tmp=$tmp | |
c971b7fa PA |
30800 | |
30801 | # Set up the scripts for CONFIG_FILES section. | |
30802 | # No need to generate them if there are no CONFIG_FILES. | |
30803 | # This happens for instance with `./config.status config.h'. | |
30804 | if test -n "$CONFIG_FILES"; then | |
30805 | ||
30806 | ||
30807 | ac_cr=`echo X | tr X '\015'` | |
30808 | # On cygwin, bash can eat \r inside `` if the user requested igncr. | |
30809 | # But we know of no other shell where ac_cr would be empty at this | |
30810 | # point, so we can use a bashism as a fallback. | |
30811 | if test "x$ac_cr" = x; then | |
30812 | eval ac_cr=\$\'\\r\' | |
30813 | fi | |
30814 | ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` | |
30815 | if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then | |
d0ac1c44 | 30816 | ac_cs_awk_cr='\\r' |
c971b7fa PA |
30817 | else |
30818 | ac_cs_awk_cr=$ac_cr | |
30819 | fi | |
30820 | ||
d0ac1c44 | 30821 | echo 'BEGIN {' >"$ac_tmp/subs1.awk" && |
c971b7fa PA |
30822 | _ACEOF |
30823 | ||
30824 | ||
30825 | { | |
30826 | echo "cat >conf$$subs.awk <<_ACEOF" && | |
30827 | echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && | |
30828 | echo "_ACEOF" | |
30829 | } >conf$$subs.sh || | |
d0ac1c44 SM |
30830 | as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 |
30831 | ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` | |
c971b7fa PA |
30832 | ac_delim='%!_!# ' |
30833 | for ac_last_try in false false false false false :; do | |
30834 | . ./conf$$subs.sh || | |
d0ac1c44 | 30835 | as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 |
c971b7fa PA |
30836 | |
30837 | ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` | |
30838 | if test $ac_delim_n = $ac_delim_num; then | |
30839 | break | |
30840 | elif $ac_last_try; then | |
d0ac1c44 | 30841 | as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 |
c971b7fa PA |
30842 | else |
30843 | ac_delim="$ac_delim!$ac_delim _$ac_delim!! " | |
30844 | fi | |
30845 | done | |
30846 | rm -f conf$$subs.sh | |
30847 | ||
30848 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
d0ac1c44 | 30849 | cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && |
c971b7fa PA |
30850 | _ACEOF |
30851 | sed -n ' | |
30852 | h | |
30853 | s/^/S["/; s/!.*/"]=/ | |
30854 | p | |
30855 | g | |
30856 | s/^[^!]*!// | |
30857 | :repl | |
30858 | t repl | |
30859 | s/'"$ac_delim"'$// | |
30860 | t delim | |
30861 | :nl | |
30862 | h | |
d0ac1c44 | 30863 | s/\(.\{148\}\)..*/\1/ |
c971b7fa PA |
30864 | t more1 |
30865 | s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ | |
30866 | p | |
30867 | n | |
30868 | b repl | |
30869 | :more1 | |
30870 | s/["\\]/\\&/g; s/^/"/; s/$/"\\/ | |
30871 | p | |
30872 | g | |
30873 | s/.\{148\}// | |
30874 | t nl | |
30875 | :delim | |
30876 | h | |
d0ac1c44 | 30877 | s/\(.\{148\}\)..*/\1/ |
c971b7fa PA |
30878 | t more2 |
30879 | s/["\\]/\\&/g; s/^/"/; s/$/"/ | |
30880 | p | |
30881 | b | |
30882 | :more2 | |
30883 | s/["\\]/\\&/g; s/^/"/; s/$/"\\/ | |
30884 | p | |
30885 | g | |
30886 | s/.\{148\}// | |
30887 | t delim | |
30888 | ' <conf$$subs.awk | sed ' | |
30889 | /^[^""]/{ | |
30890 | N | |
30891 | s/\n// | |
30892 | } | |
30893 | ' >>$CONFIG_STATUS || ac_write_fail=1 | |
30894 | rm -f conf$$subs.awk | |
30895 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
30896 | _ACAWK | |
d0ac1c44 | 30897 | cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && |
c971b7fa PA |
30898 | for (key in S) S_is_set[key] = 1 |
30899 | FS = "\a" | |
30900 | ||
30901 | } | |
30902 | { | |
30903 | line = $ 0 | |
30904 | nfields = split(line, field, "@") | |
30905 | substed = 0 | |
30906 | len = length(field[1]) | |
30907 | for (i = 2; i < nfields; i++) { | |
30908 | key = field[i] | |
30909 | keylen = length(key) | |
30910 | if (S_is_set[key]) { | |
30911 | value = S[key] | |
30912 | line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) | |
30913 | len += length(value) + length(field[++i]) | |
30914 | substed = 1 | |
30915 | } else | |
30916 | len += 1 + keylen | |
30917 | } | |
30918 | ||
30919 | print line | |
30920 | } | |
30921 | ||
30922 | _ACAWK | |
30923 | _ACEOF | |
30924 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
30925 | if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then | |
30926 | sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" | |
30927 | else | |
30928 | cat | |
d0ac1c44 SM |
30929 | fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ |
30930 | || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 | |
c971b7fa PA |
30931 | _ACEOF |
30932 | ||
d0ac1c44 SM |
30933 | # VPATH may cause trouble with some makes, so we remove sole $(srcdir), |
30934 | # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and | |
c971b7fa PA |
30935 | # trailing colons and then remove the whole line if VPATH becomes empty |
30936 | # (actually we leave an empty line to preserve line numbers). | |
30937 | if test "x$srcdir" = x.; then | |
d0ac1c44 SM |
30938 | ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ |
30939 | h | |
30940 | s/// | |
30941 | s/^/:/ | |
30942 | s/[ ]*$/:/ | |
30943 | s/:\$(srcdir):/:/g | |
30944 | s/:\${srcdir}:/:/g | |
30945 | s/:@srcdir@:/:/g | |
30946 | s/^:*// | |
c971b7fa | 30947 | s/:*$// |
d0ac1c44 SM |
30948 | x |
30949 | s/\(=[ ]*\).*/\1/ | |
30950 | G | |
30951 | s/\n// | |
c971b7fa PA |
30952 | s/^[^=]*=[ ]*$// |
30953 | }' | |
30954 | fi | |
30955 | ||
30956 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
30957 | fi # test -n "$CONFIG_FILES" | |
30958 | ||
30959 | # Set up the scripts for CONFIG_HEADERS section. | |
30960 | # No need to generate them if there are no CONFIG_HEADERS. | |
30961 | # This happens for instance with `./config.status Makefile'. | |
30962 | if test -n "$CONFIG_HEADERS"; then | |
d0ac1c44 | 30963 | cat >"$ac_tmp/defines.awk" <<\_ACAWK || |
c971b7fa PA |
30964 | BEGIN { |
30965 | _ACEOF | |
30966 | ||
30967 | # Transform confdefs.h into an awk script `defines.awk', embedded as | |
30968 | # here-document in config.status, that substitutes the proper values into | |
30969 | # config.h.in to produce config.h. | |
30970 | ||
30971 | # Create a delimiter string that does not exist in confdefs.h, to ease | |
30972 | # handling of long lines. | |
30973 | ac_delim='%!_!# ' | |
30974 | for ac_last_try in false false :; do | |
d0ac1c44 SM |
30975 | ac_tt=`sed -n "/$ac_delim/p" confdefs.h` |
30976 | if test -z "$ac_tt"; then | |
c971b7fa PA |
30977 | break |
30978 | elif $ac_last_try; then | |
d0ac1c44 | 30979 | as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 |
c971b7fa PA |
30980 | else |
30981 | ac_delim="$ac_delim!$ac_delim _$ac_delim!! " | |
30982 | fi | |
30983 | done | |
30984 | ||
30985 | # For the awk script, D is an array of macro values keyed by name, | |
30986 | # likewise P contains macro parameters if any. Preserve backslash | |
30987 | # newline sequences. | |
30988 | ||
30989 | ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* | |
30990 | sed -n ' | |
30991 | s/.\{148\}/&'"$ac_delim"'/g | |
30992 | t rset | |
30993 | :rset | |
30994 | s/^[ ]*#[ ]*define[ ][ ]*/ / | |
30995 | t def | |
30996 | d | |
30997 | :def | |
30998 | s/\\$// | |
30999 | t bsnl | |
31000 | s/["\\]/\\&/g | |
31001 | s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ | |
31002 | D["\1"]=" \3"/p | |
31003 | s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p | |
31004 | d | |
31005 | :bsnl | |
31006 | s/["\\]/\\&/g | |
31007 | s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ | |
31008 | D["\1"]=" \3\\\\\\n"\\/p | |
31009 | t cont | |
31010 | s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p | |
31011 | t cont | |
31012 | d | |
31013 | :cont | |
31014 | n | |
31015 | s/.\{148\}/&'"$ac_delim"'/g | |
31016 | t clear | |
31017 | :clear | |
31018 | s/\\$// | |
31019 | t bsnlc | |
31020 | s/["\\]/\\&/g; s/^/"/; s/$/"/p | |
31021 | d | |
31022 | :bsnlc | |
31023 | s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p | |
31024 | b cont | |
31025 | ' <confdefs.h | sed ' | |
31026 | s/'"$ac_delim"'/"\\\ | |
31027 | "/g' >>$CONFIG_STATUS || ac_write_fail=1 | |
31028 | ||
31029 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
31030 | for (key in D) D_is_set[key] = 1 | |
31031 | FS = "\a" | |
31032 | } | |
31033 | /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { | |
31034 | line = \$ 0 | |
31035 | split(line, arg, " ") | |
31036 | if (arg[1] == "#") { | |
31037 | defundef = arg[2] | |
31038 | mac1 = arg[3] | |
31039 | } else { | |
31040 | defundef = substr(arg[1], 2) | |
31041 | mac1 = arg[2] | |
31042 | } | |
31043 | split(mac1, mac2, "(") #) | |
31044 | macro = mac2[1] | |
31045 | prefix = substr(line, 1, index(line, defundef) - 1) | |
31046 | if (D_is_set[macro]) { | |
31047 | # Preserve the white space surrounding the "#". | |
31048 | print prefix "define", macro P[macro] D[macro] | |
31049 | next | |
31050 | } else { | |
31051 | # Replace #undef with comments. This is necessary, for example, | |
31052 | # in the case of _POSIX_SOURCE, which is predefined and required | |
31053 | # on some systems where configure will not decide to define it. | |
31054 | if (defundef == "undef") { | |
31055 | print "/*", prefix defundef, macro, "*/" | |
31056 | next | |
31057 | } | |
31058 | } | |
31059 | } | |
31060 | { print } | |
31061 | _ACAWK | |
31062 | _ACEOF | |
31063 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
d0ac1c44 | 31064 | as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 |
c971b7fa PA |
31065 | fi # test -n "$CONFIG_HEADERS" |
31066 | ||
31067 | ||
31068 | eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" | |
31069 | shift | |
31070 | for ac_tag | |
31071 | do | |
31072 | case $ac_tag in | |
31073 | :[FHLC]) ac_mode=$ac_tag; continue;; | |
31074 | esac | |
31075 | case $ac_mode$ac_tag in | |
31076 | :[FHL]*:*);; | |
d0ac1c44 | 31077 | :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; |
c971b7fa PA |
31078 | :[FH]-) ac_tag=-:-;; |
31079 | :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; | |
31080 | esac | |
31081 | ac_save_IFS=$IFS | |
31082 | IFS=: | |
31083 | set x $ac_tag | |
31084 | IFS=$ac_save_IFS | |
31085 | shift | |
31086 | ac_file=$1 | |
31087 | shift | |
31088 | ||
31089 | case $ac_mode in | |
31090 | :L) ac_source=$1;; | |
31091 | :[FH]) | |
31092 | ac_file_inputs= | |
31093 | for ac_f | |
31094 | do | |
31095 | case $ac_f in | |
d0ac1c44 | 31096 | -) ac_f="$ac_tmp/stdin";; |
c971b7fa PA |
31097 | *) # Look for the file first in the build tree, then in the source tree |
31098 | # (if the path is not absolute). The absolute path cannot be DOS-style, | |
31099 | # because $ac_f cannot contain `:'. | |
31100 | test -f "$ac_f" || | |
31101 | case $ac_f in | |
31102 | [\\/$]*) false;; | |
31103 | *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; | |
31104 | esac || | |
d0ac1c44 | 31105 | as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; |
c971b7fa PA |
31106 | esac |
31107 | case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac | |
31108 | as_fn_append ac_file_inputs " '$ac_f'" | |
31109 | done | |
31110 | ||
31111 | # Let's still pretend it is `configure' which instantiates (i.e., don't | |
31112 | # use $as_me), people would be surprised to read: | |
31113 | # /* config.h. Generated by config.status. */ | |
31114 | configure_input='Generated from '` | |
31115 | $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' | |
31116 | `' by configure.' | |
31117 | if test x"$ac_file" != x-; then | |
31118 | configure_input="$ac_file. $configure_input" | |
31119 | { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 | |
31120 | $as_echo "$as_me: creating $ac_file" >&6;} | |
31121 | fi | |
31122 | # Neutralize special characters interpreted by sed in replacement strings. | |
31123 | case $configure_input in #( | |
31124 | *\&* | *\|* | *\\* ) | |
31125 | ac_sed_conf_input=`$as_echo "$configure_input" | | |
31126 | sed 's/[\\\\&|]/\\\\&/g'`;; #( | |
31127 | *) ac_sed_conf_input=$configure_input;; | |
31128 | esac | |
31129 | ||
31130 | case $ac_tag in | |
d0ac1c44 SM |
31131 | *:-:* | *:-) cat >"$ac_tmp/stdin" \ |
31132 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; | |
c971b7fa PA |
31133 | esac |
31134 | ;; | |
31135 | esac | |
31136 | ||
31137 | ac_dir=`$as_dirname -- "$ac_file" || | |
31138 | $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
31139 | X"$ac_file" : 'X\(//\)[^/]' \| \ | |
31140 | X"$ac_file" : 'X\(//\)$' \| \ | |
31141 | X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || | |
31142 | $as_echo X"$ac_file" | | |
31143 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
31144 | s//\1/ | |
31145 | q | |
31146 | } | |
31147 | /^X\(\/\/\)[^/].*/{ | |
31148 | s//\1/ | |
31149 | q | |
31150 | } | |
31151 | /^X\(\/\/\)$/{ | |
31152 | s//\1/ | |
31153 | q | |
31154 | } | |
31155 | /^X\(\/\).*/{ | |
31156 | s//\1/ | |
31157 | q | |
31158 | } | |
31159 | s/.*/./; q'` | |
31160 | as_dir="$ac_dir"; as_fn_mkdir_p | |
31161 | ac_builddir=. | |
31162 | ||
31163 | case "$ac_dir" in | |
31164 | .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; | |
31165 | *) | |
31166 | ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` | |
31167 | # A ".." for each directory in $ac_dir_suffix. | |
31168 | ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` | |
31169 | case $ac_top_builddir_sub in | |
31170 | "") ac_top_builddir_sub=. ac_top_build_prefix= ;; | |
31171 | *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; | |
31172 | esac ;; | |
31173 | esac | |
31174 | ac_abs_top_builddir=$ac_pwd | |
31175 | ac_abs_builddir=$ac_pwd$ac_dir_suffix | |
31176 | # for backward compatibility: | |
31177 | ac_top_builddir=$ac_top_build_prefix | |
31178 | ||
31179 | case $srcdir in | |
31180 | .) # We are building in place. | |
31181 | ac_srcdir=. | |
31182 | ac_top_srcdir=$ac_top_builddir_sub | |
31183 | ac_abs_top_srcdir=$ac_pwd ;; | |
31184 | [\\/]* | ?:[\\/]* ) # Absolute name. | |
31185 | ac_srcdir=$srcdir$ac_dir_suffix; | |
31186 | ac_top_srcdir=$srcdir | |
31187 | ac_abs_top_srcdir=$srcdir ;; | |
31188 | *) # Relative name. | |
31189 | ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix | |
31190 | ac_top_srcdir=$ac_top_build_prefix$srcdir | |
31191 | ac_abs_top_srcdir=$ac_pwd/$srcdir ;; | |
31192 | esac | |
31193 | ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix | |
31194 | ||
31195 | ||
31196 | case $ac_mode in | |
31197 | :F) | |
31198 | # | |
31199 | # CONFIG_FILE | |
31200 | # | |
31201 | ||
31202 | case $INSTALL in | |
31203 | [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; | |
31204 | *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; | |
31205 | esac | |
31206 | ac_MKDIR_P=$MKDIR_P | |
31207 | case $MKDIR_P in | |
31208 | [\\/$]* | ?:[\\/]* ) ;; | |
31209 | */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; | |
31210 | esac | |
31211 | _ACEOF | |
31212 | ||
31213 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
31214 | # If the template does not know about datarootdir, expand it. | |
31215 | # FIXME: This hack should be removed a few years after 2.60. | |
31216 | ac_datarootdir_hack=; ac_datarootdir_seen= | |
31217 | ac_sed_dataroot=' | |
31218 | /datarootdir/ { | |
31219 | p | |
31220 | q | |
31221 | } | |
31222 | /@datadir@/p | |
31223 | /@docdir@/p | |
31224 | /@infodir@/p | |
31225 | /@localedir@/p | |
31226 | /@mandir@/p' | |
31227 | case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in | |
31228 | *datarootdir*) ac_datarootdir_seen=yes;; | |
31229 | *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) | |
31230 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 | |
31231 | $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} | |
31232 | _ACEOF | |
31233 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
31234 | ac_datarootdir_hack=' | |
31235 | s&@datadir@&$datadir&g | |
31236 | s&@docdir@&$docdir&g | |
31237 | s&@infodir@&$infodir&g | |
31238 | s&@localedir@&$localedir&g | |
31239 | s&@mandir@&$mandir&g | |
31240 | s&\\\${datarootdir}&$datarootdir&g' ;; | |
31241 | esac | |
31242 | _ACEOF | |
31243 | ||
31244 | # Neutralize VPATH when `$srcdir' = `.'. | |
31245 | # Shell code in configure.ac might set extrasub. | |
31246 | # FIXME: do we really want to maintain this feature? | |
31247 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
31248 | ac_sed_extra="$ac_vpsub | |
31249 | $extrasub | |
31250 | _ACEOF | |
31251 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |
31252 | :t | |
31253 | /@[a-zA-Z_][a-zA-Z_0-9]*@/!b | |
31254 | s|@configure_input@|$ac_sed_conf_input|;t t | |
31255 | s&@top_builddir@&$ac_top_builddir_sub&;t t | |
31256 | s&@top_build_prefix@&$ac_top_build_prefix&;t t | |
31257 | s&@srcdir@&$ac_srcdir&;t t | |
31258 | s&@abs_srcdir@&$ac_abs_srcdir&;t t | |
31259 | s&@top_srcdir@&$ac_top_srcdir&;t t | |
31260 | s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t | |
31261 | s&@builddir@&$ac_builddir&;t t | |
31262 | s&@abs_builddir@&$ac_abs_builddir&;t t | |
31263 | s&@abs_top_builddir@&$ac_abs_top_builddir&;t t | |
31264 | s&@INSTALL@&$ac_INSTALL&;t t | |
31265 | s&@MKDIR_P@&$ac_MKDIR_P&;t t | |
31266 | $ac_datarootdir_hack | |
31267 | " | |
d0ac1c44 SM |
31268 | eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ |
31269 | >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 | |
c971b7fa PA |
31270 | |
31271 | test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && | |
d0ac1c44 SM |
31272 | { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && |
31273 | { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ | |
31274 | "$ac_tmp/out"`; test -z "$ac_out"; } && | |
c971b7fa | 31275 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' |
d0ac1c44 | 31276 | which seems to be undefined. Please make sure it is defined" >&5 |
c971b7fa | 31277 | $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' |
d0ac1c44 | 31278 | which seems to be undefined. Please make sure it is defined" >&2;} |
c971b7fa | 31279 | |
d0ac1c44 | 31280 | rm -f "$ac_tmp/stdin" |
c971b7fa | 31281 | case $ac_file in |
d0ac1c44 SM |
31282 | -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; |
31283 | *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; | |
c971b7fa | 31284 | esac \ |
d0ac1c44 | 31285 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 |
c971b7fa PA |
31286 | ;; |
31287 | :H) | |
31288 | # | |
31289 | # CONFIG_HEADER | |
31290 | # | |
31291 | if test x"$ac_file" != x-; then | |
31292 | { | |
31293 | $as_echo "/* $configure_input */" \ | |
d0ac1c44 SM |
31294 | && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" |
31295 | } >"$ac_tmp/config.h" \ | |
31296 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 | |
31297 | if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then | |
c971b7fa PA |
31298 | { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 |
31299 | $as_echo "$as_me: $ac_file is unchanged" >&6;} | |
31300 | else | |
31301 | rm -f "$ac_file" | |
d0ac1c44 SM |
31302 | mv "$ac_tmp/config.h" "$ac_file" \ |
31303 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 | |
c971b7fa PA |
31304 | fi |
31305 | else | |
31306 | $as_echo "/* $configure_input */" \ | |
d0ac1c44 SM |
31307 | && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ |
31308 | || as_fn_error $? "could not create -" "$LINENO" 5 | |
c971b7fa PA |
31309 | fi |
31310 | # Compute "$ac_file"'s index in $config_headers. | |
31311 | _am_arg="$ac_file" | |
31312 | _am_stamp_count=1 | |
31313 | for _am_header in $config_headers :; do | |
31314 | case $_am_header in | |
31315 | $_am_arg | $_am_arg:* ) | |
31316 | break ;; | |
31317 | * ) | |
31318 | _am_stamp_count=`expr $_am_stamp_count + 1` ;; | |
31319 | esac | |
31320 | done | |
31321 | echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || | |
31322 | $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
31323 | X"$_am_arg" : 'X\(//\)[^/]' \| \ | |
31324 | X"$_am_arg" : 'X\(//\)$' \| \ | |
31325 | X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || | |
31326 | $as_echo X"$_am_arg" | | |
31327 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
31328 | s//\1/ | |
31329 | q | |
31330 | } | |
31331 | /^X\(\/\/\)[^/].*/{ | |
31332 | s//\1/ | |
31333 | q | |
31334 | } | |
31335 | /^X\(\/\/\)$/{ | |
31336 | s//\1/ | |
31337 | q | |
31338 | } | |
31339 | /^X\(\/\).*/{ | |
31340 | s//\1/ | |
31341 | q | |
31342 | } | |
31343 | s/.*/./; q'`/stamp-h$_am_stamp_count | |
31344 | ;; | |
31345 | ||
31346 | :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 | |
31347 | $as_echo "$as_me: executing $ac_file commands" >&6;} | |
31348 | ;; | |
31349 | esac | |
31350 | ||
31351 | ||
31352 | case $ac_file$ac_mode in | |
31353 | "depfiles":C) test x"$AMDEP_TRUE" != x"" || { | |
d0ac1c44 | 31354 | # Older Autoconf quotes --file arguments for eval, but not when files |
c971b7fa PA |
31355 | # are listed without --file. Let's play safe and only enable the eval |
31356 | # if we detect the quoting. | |
31357 | case $CONFIG_FILES in | |
31358 | *\'*) eval set x "$CONFIG_FILES" ;; | |
31359 | *) set x $CONFIG_FILES ;; | |
31360 | esac | |
31361 | shift | |
31362 | for mf | |
31363 | do | |
31364 | # Strip MF so we end up with the name of the file. | |
31365 | mf=`echo "$mf" | sed -e 's/:.*$//'` | |
31366 | # Check whether this is an Automake generated Makefile or not. | |
d0ac1c44 | 31367 | # We used to match only the files named 'Makefile.in', but |
c971b7fa PA |
31368 | # some people rename them; so instead we look at the file content. |
31369 | # Grep'ing the first line is not enough: some people post-process | |
31370 | # each Makefile.in and add a new line on top of each file to say so. | |
31371 | # Grep'ing the whole file is not good either: AIX grep has a line | |
31372 | # limit of 2048, but all sed's we know have understand at least 4000. | |
31373 | if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then | |
31374 | dirpart=`$as_dirname -- "$mf" || | |
31375 | $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
31376 | X"$mf" : 'X\(//\)[^/]' \| \ | |
31377 | X"$mf" : 'X\(//\)$' \| \ | |
31378 | X"$mf" : 'X\(/\)' \| . 2>/dev/null || | |
31379 | $as_echo X"$mf" | | |
31380 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
31381 | s//\1/ | |
31382 | q | |
31383 | } | |
31384 | /^X\(\/\/\)[^/].*/{ | |
31385 | s//\1/ | |
31386 | q | |
31387 | } | |
31388 | /^X\(\/\/\)$/{ | |
31389 | s//\1/ | |
31390 | q | |
31391 | } | |
31392 | /^X\(\/\).*/{ | |
31393 | s//\1/ | |
31394 | q | |
31395 | } | |
31396 | s/.*/./; q'` | |
31397 | else | |
31398 | continue | |
31399 | fi | |
31400 | # Extract the definition of DEPDIR, am__include, and am__quote | |
d0ac1c44 | 31401 | # from the Makefile without running 'make'. |
c971b7fa PA |
31402 | DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` |
31403 | test -z "$DEPDIR" && continue | |
31404 | am__include=`sed -n 's/^am__include = //p' < "$mf"` | |
d0ac1c44 | 31405 | test -z "$am__include" && continue |
c971b7fa | 31406 | am__quote=`sed -n 's/^am__quote = //p' < "$mf"` |
c971b7fa PA |
31407 | # Find all dependency output files, they are included files with |
31408 | # $(DEPDIR) in their names. We invoke sed twice because it is the | |
31409 | # simplest approach to changing $(DEPDIR) to its actual value in the | |
31410 | # expansion. | |
31411 | for file in `sed -n " | |
31412 | s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ | |
d0ac1c44 | 31413 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do |
c971b7fa PA |
31414 | # Make sure the directory exists. |
31415 | test -f "$dirpart/$file" && continue | |
31416 | fdir=`$as_dirname -- "$file" || | |
31417 | $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
31418 | X"$file" : 'X\(//\)[^/]' \| \ | |
31419 | X"$file" : 'X\(//\)$' \| \ | |
31420 | X"$file" : 'X\(/\)' \| . 2>/dev/null || | |
31421 | $as_echo X"$file" | | |
31422 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
31423 | s//\1/ | |
31424 | q | |
31425 | } | |
31426 | /^X\(\/\/\)[^/].*/{ | |
31427 | s//\1/ | |
31428 | q | |
31429 | } | |
31430 | /^X\(\/\/\)$/{ | |
31431 | s//\1/ | |
31432 | q | |
31433 | } | |
31434 | /^X\(\/\).*/{ | |
31435 | s//\1/ | |
31436 | q | |
31437 | } | |
31438 | s/.*/./; q'` | |
31439 | as_dir=$dirpart/$fdir; as_fn_mkdir_p | |
31440 | # echo "creating $dirpart/$file" | |
31441 | echo '# dummy' > "$dirpart/$file" | |
31442 | done | |
31443 | done | |
31444 | } | |
31445 | ;; | |
31446 | "default":C) | |
31447 | case x$CONFIG_HEADERS in | |
31448 | xconfig.h:config.in) | |
31449 | echo > stamp-h ;; | |
31450 | esac | |
31451 | ;; | |
31452 | ||
31453 | esac | |
31454 | done # for ac_tag | |
31455 | ||
31456 | ||
31457 | as_fn_exit 0 | |
31458 | _ACEOF | |
31459 | ac_clean_files=$ac_clean_files_save | |
31460 | ||
31461 | test $ac_write_fail = 0 || | |
d0ac1c44 | 31462 | as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 |
c971b7fa PA |
31463 | |
31464 | ||
31465 | # configure is writing to config.log, and then calls config.status. | |
31466 | # config.status does its own redirection, appending to config.log. | |
31467 | # Unfortunately, on DOS this fails, as config.log is still kept open | |
31468 | # by configure, so config.status won't be able to write to it; its | |
31469 | # output is simply discarded. So we exec the FD to /dev/null, | |
31470 | # effectively closing config.log, so it can be properly (re)opened and | |
31471 | # appended to by config.status. When coming back to configure, we | |
31472 | # need to make the FD available again. | |
31473 | if test "$no_create" != yes; then | |
31474 | ac_cs_success=: | |
31475 | ac_config_status_args= | |
31476 | test "$silent" = yes && | |
31477 | ac_config_status_args="$ac_config_status_args --quiet" | |
31478 | exec 5>/dev/null | |
31479 | $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false | |
31480 | exec 5>>config.log | |
31481 | # Use ||, not &&, to avoid exiting from the if with $? = 1, which | |
31482 | # would make configure fail if this is the last instruction. | |
d0ac1c44 | 31483 | $ac_cs_success || as_fn_exit 1 |
c971b7fa PA |
31484 | fi |
31485 | if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then | |
31486 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 | |
31487 | $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} | |
31488 | fi | |
31489 | ||
31490 | ||
31491 | exit 0 |