]> granicus.if.org Git - postgresql/blob - configure
Use a consistent error message style for user mappings.
[postgresql] / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by GNU Autoconf 2.69 for PostgreSQL 10devel.
4 #
5 # Report bugs to <pgsql-bugs@postgresql.org>.
6 #
7 #
8 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
9 #
10 #
11 # This configure script is free software; the Free Software Foundation
12 # gives unlimited permission to copy, distribute and modify it.
13 #
14 # Copyright (c) 1996-2017, PostgreSQL Global Development Group
15 ## -------------------- ##
16 ## M4sh Initialization. ##
17 ## -------------------- ##
18
19 # Be more Bourne compatible
20 DUALCASE=1; export DUALCASE # for MKS sh
21 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
22   emulate sh
23   NULLCMD=:
24   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
25   # is contrary to our usage.  Disable this feature.
26   alias -g '${1+"$@"}'='"$@"'
27   setopt NO_GLOB_SUBST
28 else
29   case `(set -o) 2>/dev/null` in #(
30   *posix*) :
31     set -o posix ;; #(
32   *) :
33      ;;
34 esac
35 fi
36
37
38 as_nl='
39 '
40 export as_nl
41 # Printing a long string crashes Solaris 7 /usr/bin/printf.
42 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
43 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
44 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
45 # Prefer a ksh shell builtin over an external printf program on Solaris,
46 # but without wasting forks for bash or zsh.
47 if test -z "$BASH_VERSION$ZSH_VERSION" \
48     && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
49   as_echo='print -r --'
50   as_echo_n='print -rn --'
51 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
52   as_echo='printf %s\n'
53   as_echo_n='printf %s'
54 else
55   if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
56     as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
57     as_echo_n='/usr/ucb/echo -n'
58   else
59     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
60     as_echo_n_body='eval
61       arg=$1;
62       case $arg in #(
63       *"$as_nl"*)
64         expr "X$arg" : "X\\(.*\\)$as_nl";
65         arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
66       esac;
67       expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
68     '
69     export as_echo_n_body
70     as_echo_n='sh -c $as_echo_n_body as_echo'
71   fi
72   export as_echo_body
73   as_echo='sh -c $as_echo_body as_echo'
74 fi
75
76 # The user is always right.
77 if test "${PATH_SEPARATOR+set}" != set; then
78   PATH_SEPARATOR=:
79   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
80     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
81       PATH_SEPARATOR=';'
82   }
83 fi
84
85
86 # IFS
87 # We need space, tab and new line, in precisely that order.  Quoting is
88 # there to prevent editors from complaining about space-tab.
89 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
90 # splitting by setting IFS to empty value.)
91 IFS=" ""        $as_nl"
92
93 # Find who we are.  Look in the path if we contain no directory separator.
94 as_myself=
95 case $0 in #((
96   *[\\/]* ) as_myself=$0 ;;
97   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
98 for as_dir in $PATH
99 do
100   IFS=$as_save_IFS
101   test -z "$as_dir" && as_dir=.
102     test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
103   done
104 IFS=$as_save_IFS
105
106      ;;
107 esac
108 # We did not find ourselves, most probably we were run as `sh COMMAND'
109 # in which case we are not to be found in the path.
110 if test "x$as_myself" = x; then
111   as_myself=$0
112 fi
113 if test ! -f "$as_myself"; then
114   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
115   exit 1
116 fi
117
118 # Unset variables that we do not need and which cause bugs (e.g. in
119 # pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
120 # suppresses any "Segmentation fault" message there.  '((' could
121 # trigger a bug in pdksh 5.2.14.
122 for as_var in BASH_ENV ENV MAIL MAILPATH
123 do eval test x\${$as_var+set} = xset \
124   && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
125 done
126 PS1='$ '
127 PS2='> '
128 PS4='+ '
129
130 # NLS nuisances.
131 LC_ALL=C
132 export LC_ALL
133 LANGUAGE=C
134 export LANGUAGE
135
136 # CDPATH.
137 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
138
139 # Use a proper internal environment variable to ensure we don't fall
140   # into an infinite loop, continuously re-executing ourselves.
141   if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
142     _as_can_reexec=no; export _as_can_reexec;
143     # We cannot yet assume a decent shell, so we have to provide a
144 # neutralization value for shells without unset; and this also
145 # works around shells that cannot unset nonexistent variables.
146 # Preserve -v and -x to the replacement shell.
147 BASH_ENV=/dev/null
148 ENV=/dev/null
149 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
150 case $- in # ((((
151   *v*x* | *x*v* ) as_opts=-vx ;;
152   *v* ) as_opts=-v ;;
153   *x* ) as_opts=-x ;;
154   * ) as_opts= ;;
155 esac
156 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
157 # Admittedly, this is quite paranoid, since all the known shells bail
158 # out after a failed `exec'.
159 $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
160 as_fn_exit 255
161   fi
162   # We don't want this to propagate to other subprocesses.
163           { _as_can_reexec=; unset _as_can_reexec;}
164 if test "x$CONFIG_SHELL" = x; then
165   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
166   emulate sh
167   NULLCMD=:
168   # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
169   # is contrary to our usage.  Disable this feature.
170   alias -g '\${1+\"\$@\"}'='\"\$@\"'
171   setopt NO_GLOB_SUBST
172 else
173   case \`(set -o) 2>/dev/null\` in #(
174   *posix*) :
175     set -o posix ;; #(
176   *) :
177      ;;
178 esac
179 fi
180 "
181   as_required="as_fn_return () { (exit \$1); }
182 as_fn_success () { as_fn_return 0; }
183 as_fn_failure () { as_fn_return 1; }
184 as_fn_ret_success () { return 0; }
185 as_fn_ret_failure () { return 1; }
186
187 exitcode=0
188 as_fn_success || { exitcode=1; echo as_fn_success failed.; }
189 as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
190 as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
191 as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
192 if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
193
194 else
195   exitcode=1; echo positional parameters were not saved.
196 fi
197 test x\$exitcode = x0 || exit 1
198 test -x / || exit 1"
199   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
200   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
201   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
202   test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
203 test \$(( 1 + 1 )) = 2 || exit 1"
204   if (eval "$as_required") 2>/dev/null; then :
205   as_have_required=yes
206 else
207   as_have_required=no
208 fi
209   if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
210
211 else
212   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
213 as_found=false
214 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
215 do
216   IFS=$as_save_IFS
217   test -z "$as_dir" && as_dir=.
218   as_found=:
219   case $as_dir in #(
220          /*)
221            for as_base in sh bash ksh sh5; do
222              # Try only shells that exist, to save several forks.
223              as_shell=$as_dir/$as_base
224              if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
225                     { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
226   CONFIG_SHELL=$as_shell as_have_required=yes
227                    if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
228   break 2
229 fi
230 fi
231            done;;
232        esac
233   as_found=false
234 done
235 $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
236               { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
237   CONFIG_SHELL=$SHELL as_have_required=yes
238 fi; }
239 IFS=$as_save_IFS
240
241
242       if test "x$CONFIG_SHELL" != x; then :
243   export CONFIG_SHELL
244              # We cannot yet assume a decent shell, so we have to provide a
245 # neutralization value for shells without unset; and this also
246 # works around shells that cannot unset nonexistent variables.
247 # Preserve -v and -x to the replacement shell.
248 BASH_ENV=/dev/null
249 ENV=/dev/null
250 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
251 case $- in # ((((
252   *v*x* | *x*v* ) as_opts=-vx ;;
253   *v* ) as_opts=-v ;;
254   *x* ) as_opts=-x ;;
255   * ) as_opts= ;;
256 esac
257 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
258 # Admittedly, this is quite paranoid, since all the known shells bail
259 # out after a failed `exec'.
260 $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
261 exit 255
262 fi
263
264     if test x$as_have_required = xno; then :
265   $as_echo "$0: This script requires a shell more modern than all"
266   $as_echo "$0: the shells that I found on your system."
267   if test x${ZSH_VERSION+set} = xset ; then
268     $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
269     $as_echo "$0: be upgraded to zsh 4.3.4 or later."
270   else
271     $as_echo "$0: Please tell bug-autoconf@gnu.org and
272 $0: pgsql-bugs@postgresql.org about your system, including
273 $0: any error possibly output before this message. Then
274 $0: install a modern shell, or manually run the script
275 $0: under such a shell if you do have one."
276   fi
277   exit 1
278 fi
279 fi
280 fi
281 SHELL=${CONFIG_SHELL-/bin/sh}
282 export SHELL
283 # Unset more variables known to interfere with behavior of common tools.
284 CLICOLOR_FORCE= GREP_OPTIONS=
285 unset CLICOLOR_FORCE GREP_OPTIONS
286
287 ## --------------------- ##
288 ## M4sh Shell Functions. ##
289 ## --------------------- ##
290 # as_fn_unset VAR
291 # ---------------
292 # Portably unset VAR.
293 as_fn_unset ()
294 {
295   { eval $1=; unset $1;}
296 }
297 as_unset=as_fn_unset
298
299 # as_fn_set_status STATUS
300 # -----------------------
301 # Set $? to STATUS, without forking.
302 as_fn_set_status ()
303 {
304   return $1
305 } # as_fn_set_status
306
307 # as_fn_exit STATUS
308 # -----------------
309 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
310 as_fn_exit ()
311 {
312   set +e
313   as_fn_set_status $1
314   exit $1
315 } # as_fn_exit
316
317 # as_fn_mkdir_p
318 # -------------
319 # Create "$as_dir" as a directory, including parents if necessary.
320 as_fn_mkdir_p ()
321 {
322
323   case $as_dir in #(
324   -*) as_dir=./$as_dir;;
325   esac
326   test -d "$as_dir" || eval $as_mkdir_p || {
327     as_dirs=
328     while :; do
329       case $as_dir in #(
330       *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
331       *) as_qdir=$as_dir;;
332       esac
333       as_dirs="'$as_qdir' $as_dirs"
334       as_dir=`$as_dirname -- "$as_dir" ||
335 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
336          X"$as_dir" : 'X\(//\)[^/]' \| \
337          X"$as_dir" : 'X\(//\)$' \| \
338          X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
339 $as_echo X"$as_dir" |
340     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
341             s//\1/
342             q
343           }
344           /^X\(\/\/\)[^/].*/{
345             s//\1/
346             q
347           }
348           /^X\(\/\/\)$/{
349             s//\1/
350             q
351           }
352           /^X\(\/\).*/{
353             s//\1/
354             q
355           }
356           s/.*/./; q'`
357       test -d "$as_dir" && break
358     done
359     test -z "$as_dirs" || eval "mkdir $as_dirs"
360   } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
361
362
363 } # as_fn_mkdir_p
364
365 # as_fn_executable_p FILE
366 # -----------------------
367 # Test if FILE is an executable regular file.
368 as_fn_executable_p ()
369 {
370   test -f "$1" && test -x "$1"
371 } # as_fn_executable_p
372 # as_fn_append VAR VALUE
373 # ----------------------
374 # Append the text in VALUE to the end of the definition contained in VAR. Take
375 # advantage of any shell optimizations that allow amortized linear growth over
376 # repeated appends, instead of the typical quadratic growth present in naive
377 # implementations.
378 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
379   eval 'as_fn_append ()
380   {
381     eval $1+=\$2
382   }'
383 else
384   as_fn_append ()
385   {
386     eval $1=\$$1\$2
387   }
388 fi # as_fn_append
389
390 # as_fn_arith ARG...
391 # ------------------
392 # Perform arithmetic evaluation on the ARGs, and store the result in the
393 # global $as_val. Take advantage of shells that can avoid forks. The arguments
394 # must be portable across $(()) and expr.
395 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
396   eval 'as_fn_arith ()
397   {
398     as_val=$(( $* ))
399   }'
400 else
401   as_fn_arith ()
402   {
403     as_val=`expr "$@" || test $? -eq 1`
404   }
405 fi # as_fn_arith
406
407
408 # as_fn_error STATUS ERROR [LINENO LOG_FD]
409 # ----------------------------------------
410 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
411 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
412 # script with STATUS, using 1 if that was 0.
413 as_fn_error ()
414 {
415   as_status=$1; test $as_status -eq 0 && as_status=1
416   if test "$4"; then
417     as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
418     $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
419   fi
420   $as_echo "$as_me: error: $2" >&2
421   as_fn_exit $as_status
422 } # as_fn_error
423
424 if expr a : '\(a\)' >/dev/null 2>&1 &&
425    test "X`expr 00001 : '.*\(...\)'`" = X001; then
426   as_expr=expr
427 else
428   as_expr=false
429 fi
430
431 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
432   as_basename=basename
433 else
434   as_basename=false
435 fi
436
437 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
438   as_dirname=dirname
439 else
440   as_dirname=false
441 fi
442
443 as_me=`$as_basename -- "$0" ||
444 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
445          X"$0" : 'X\(//\)$' \| \
446          X"$0" : 'X\(/\)' \| . 2>/dev/null ||
447 $as_echo X/"$0" |
448     sed '/^.*\/\([^/][^/]*\)\/*$/{
449             s//\1/
450             q
451           }
452           /^X\/\(\/\/\)$/{
453             s//\1/
454             q
455           }
456           /^X\/\(\/\).*/{
457             s//\1/
458             q
459           }
460           s/.*/./; q'`
461
462 # Avoid depending upon Character Ranges.
463 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
464 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
465 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
466 as_cr_digits='0123456789'
467 as_cr_alnum=$as_cr_Letters$as_cr_digits
468
469
470   as_lineno_1=$LINENO as_lineno_1a=$LINENO
471   as_lineno_2=$LINENO as_lineno_2a=$LINENO
472   eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
473   test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
474   # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
475   sed -n '
476     p
477     /[$]LINENO/=
478   ' <$as_myself |
479     sed '
480       s/[$]LINENO.*/&-/
481       t lineno
482       b
483       :lineno
484       N
485       :loop
486       s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
487       t loop
488       s/-\n.*//
489     ' >$as_me.lineno &&
490   chmod +x "$as_me.lineno" ||
491     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
492
493   # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
494   # already done that, so ensure we don't try to do so again and fall
495   # in an infinite loop.  This has already happened in practice.
496   _as_can_reexec=no; export _as_can_reexec
497   # Don't try to exec as it changes $[0], causing all sort of problems
498   # (the dirname of $[0] is not the place where we might find the
499   # original and so on.  Autoconf is especially sensitive to this).
500   . "./$as_me.lineno"
501   # Exit status is that of the last command.
502   exit
503 }
504
505 ECHO_C= ECHO_N= ECHO_T=
506 case `echo -n x` in #(((((
507 -n*)
508   case `echo 'xy\c'` in
509   *c*) ECHO_T=' ';;     # ECHO_T is single tab character.
510   xy)  ECHO_C='\c';;
511   *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
512        ECHO_T=' ';;
513   esac;;
514 *)
515   ECHO_N='-n';;
516 esac
517
518 rm -f conf$$ conf$$.exe conf$$.file
519 if test -d conf$$.dir; then
520   rm -f conf$$.dir/conf$$.file
521 else
522   rm -f conf$$.dir
523   mkdir conf$$.dir 2>/dev/null
524 fi
525 if (echo >conf$$.file) 2>/dev/null; then
526   if ln -s conf$$.file conf$$ 2>/dev/null; then
527     as_ln_s='ln -s'
528     # ... but there are two gotchas:
529     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
530     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
531     # In both cases, we have to default to `cp -pR'.
532     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
533       as_ln_s='cp -pR'
534   elif ln conf$$.file conf$$ 2>/dev/null; then
535     as_ln_s=ln
536   else
537     as_ln_s='cp -pR'
538   fi
539 else
540   as_ln_s='cp -pR'
541 fi
542 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
543 rmdir conf$$.dir 2>/dev/null
544
545 if mkdir -p . 2>/dev/null; then
546   as_mkdir_p='mkdir -p "$as_dir"'
547 else
548   test -d ./-p && rmdir ./-p
549   as_mkdir_p=false
550 fi
551
552 as_test_x='test -x'
553 as_executable_p=as_fn_executable_p
554
555 # Sed expression to map a string onto a valid CPP name.
556 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
557
558 # Sed expression to map a string onto a valid variable name.
559 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
560
561
562 test -n "$DJDIR" || exec 7<&0 </dev/null
563 exec 6>&1
564
565 # Name of the host.
566 # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
567 # so uname gets run too.
568 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
569
570 #
571 # Initializations.
572 #
573 ac_default_prefix=/usr/local
574 ac_clean_files=
575 ac_config_libobj_dir=.
576 LIBOBJS=
577 cross_compiling=no
578 subdirs=
579 MFLAGS=
580 MAKEFLAGS=
581
582 # Identity of this package.
583 PACKAGE_NAME='PostgreSQL'
584 PACKAGE_TARNAME='postgresql'
585 PACKAGE_VERSION='10devel'
586 PACKAGE_STRING='PostgreSQL 10devel'
587 PACKAGE_BUGREPORT='pgsql-bugs@postgresql.org'
588 PACKAGE_URL=''
589
590 ac_unique_file="src/backend/access/common/heaptuple.c"
591 ac_default_prefix=/usr/local/pgsql
592 # Factoring default headers for most tests.
593 ac_includes_default="\
594 #include <stdio.h>
595 #ifdef HAVE_SYS_TYPES_H
596 # include <sys/types.h>
597 #endif
598 #ifdef HAVE_SYS_STAT_H
599 # include <sys/stat.h>
600 #endif
601 #ifdef STDC_HEADERS
602 # include <stdlib.h>
603 # include <stddef.h>
604 #else
605 # ifdef HAVE_STDLIB_H
606 #  include <stdlib.h>
607 # endif
608 #endif
609 #ifdef HAVE_STRING_H
610 # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
611 #  include <memory.h>
612 # endif
613 # include <string.h>
614 #endif
615 #ifdef HAVE_STRINGS_H
616 # include <strings.h>
617 #endif
618 #ifdef HAVE_INTTYPES_H
619 # include <inttypes.h>
620 #endif
621 #ifdef HAVE_STDINT_H
622 # include <stdint.h>
623 #endif
624 #ifdef HAVE_UNISTD_H
625 # include <unistd.h>
626 #endif"
627
628 ac_subst_vars='LTLIBOBJS
629 vpath_build
630 PG_VERSION_NUM
631 PROVE
632 OSX
633 XSLTPROC
634 XMLLINT
635 DBTOEPUB
636 COLLATEINDEX
637 DOCBOOKSTYLE
638 have_docbook
639 JADE
640 NSGMLS
641 TCL_SHLIB_LD_LIBS
642 TCL_SHARED_BUILD
643 TCL_LIB_SPEC
644 TCL_LIBS
645 TCL_INCLUDE_SPEC
646 TCL_CONFIG_SH
647 TCLSH
648 XGETTEXT
649 MSGMERGE
650 MSGFMT_FLAGS
651 MSGFMT
652 PG_CRC32C_OBJS
653 CFLAGS_SSE42
654 have_win32_dbghelp
655 HAVE_IPV6
656 LIBOBJS
657 UUID_LIBS
658 LDAP_LIBS_BE
659 LDAP_LIBS_FE
660 PTHREAD_CFLAGS
661 PTHREAD_LIBS
662 PTHREAD_CC
663 ax_pthread_config
664 ZIC
665 python_additional_libs
666 python_libspec
667 python_libdir
668 python_includespec
669 python_version
670 python_majorversion
671 PYTHON
672 perl_embed_ldflags
673 perl_useshrplib
674 perl_privlibexp
675 perl_archlibexp
676 PERL
677 FLEXFLAGS
678 FLEX
679 BISONFLAGS
680 BISON
681 MKDIR_P
682 AWK
683 LN_S
684 TAR
685 install_bin
686 INSTALL_DATA
687 INSTALL_SCRIPT
688 INSTALL_PROGRAM
689 WINDRES
690 DLLWRAP
691 DLLTOOL
692 AR
693 STRIP_SHARED_LIB
694 STRIP_STATIC_LIB
695 STRIP
696 RANLIB
697 with_gnu_ld
698 LD
699 LDFLAGS_SL
700 LDFLAGS_EX
701 ELF_SYS
702 EGREP
703 GREP
704 with_zlib
705 with_system_tzdata
706 with_libxslt
707 with_libxml
708 XML2_CONFIG
709 UUID_EXTRA_OBJS
710 with_uuid
711 with_systemd
712 with_selinux
713 with_openssl
714 krb_srvtab
715 with_python
716 with_perl
717 with_tcl
718 enable_thread_safety
719 INCLUDES
720 autodepend
721 TAS
722 GCC
723 CPP
724 CFLAGS_VECTOR
725 SUN_STUDIO_CC
726 OBJEXT
727 EXEEXT
728 ac_ct_CC
729 CPPFLAGS
730 LDFLAGS
731 CFLAGS
732 CC
733 enable_tap_tests
734 enable_dtrace
735 DTRACEFLAGS
736 DTRACE
737 enable_coverage
738 GENHTML
739 LCOV
740 GCOV
741 enable_debug
742 enable_strong_random
743 enable_rpath
744 default_port
745 WANTED_LANGUAGES
746 enable_nls
747 PORTNAME
748 host_os
749 host_vendor
750 host_cpu
751 host
752 build_os
753 build_vendor
754 build_cpu
755 build
756 PG_MAJORVERSION
757 configure_args
758 target_alias
759 host_alias
760 build_alias
761 LIBS
762 ECHO_T
763 ECHO_N
764 ECHO_C
765 DEFS
766 mandir
767 localedir
768 libdir
769 psdir
770 pdfdir
771 dvidir
772 htmldir
773 infodir
774 docdir
775 oldincludedir
776 includedir
777 localstatedir
778 sharedstatedir
779 sysconfdir
780 datadir
781 datarootdir
782 libexecdir
783 sbindir
784 bindir
785 program_transform_name
786 prefix
787 exec_prefix
788 PACKAGE_URL
789 PACKAGE_BUGREPORT
790 PACKAGE_STRING
791 PACKAGE_VERSION
792 PACKAGE_TARNAME
793 PACKAGE_NAME
794 PATH_SEPARATOR
795 SHELL'
796 ac_subst_files=''
797 ac_user_opts='
798 enable_option_checking
799 with_extra_version
800 with_template
801 with_includes
802 with_libraries
803 with_libs
804 enable_integer_datetimes
805 enable_nls
806 with_pgport
807 enable_rpath
808 enable_spinlocks
809 enable_atomics
810 enable_strong_random
811 enable_debug
812 enable_profiling
813 enable_coverage
814 enable_dtrace
815 enable_tap_tests
816 with_blocksize
817 with_segsize
818 with_wal_blocksize
819 with_wal_segsize
820 with_CC
821 enable_depend
822 enable_cassert
823 enable_thread_safety
824 with_tcl
825 with_tclconfig
826 with_perl
827 with_python
828 with_gssapi
829 with_krb_srvnam
830 with_pam
831 with_bsd_auth
832 with_ldap
833 with_bonjour
834 with_openssl
835 with_selinux
836 with_systemd
837 with_readline
838 with_libedit_preferred
839 with_uuid
840 with_ossp_uuid
841 with_libxml
842 with_libxslt
843 with_system_tzdata
844 with_zlib
845 with_gnu_ld
846 enable_largefile
847 enable_float4_byval
848 enable_float8_byval
849 '
850       ac_precious_vars='build_alias
851 host_alias
852 target_alias
853 CC
854 CFLAGS
855 LDFLAGS
856 LIBS
857 CPPFLAGS
858 CPP
859 LDFLAGS_EX
860 LDFLAGS_SL
861 DOCBOOKSTYLE'
862
863
864 # Initialize some variables set by options.
865 ac_init_help=
866 ac_init_version=false
867 ac_unrecognized_opts=
868 ac_unrecognized_sep=
869 # The variables have the same names as the options, with
870 # dashes changed to underlines.
871 cache_file=/dev/null
872 exec_prefix=NONE
873 no_create=
874 no_recursion=
875 prefix=NONE
876 program_prefix=NONE
877 program_suffix=NONE
878 program_transform_name=s,x,x,
879 silent=
880 site=
881 srcdir=
882 verbose=
883 x_includes=NONE
884 x_libraries=NONE
885
886 # Installation directory options.
887 # These are left unexpanded so users can "make install exec_prefix=/foo"
888 # and all the variables that are supposed to be based on exec_prefix
889 # by default will actually change.
890 # Use braces instead of parens because sh, perl, etc. also accept them.
891 # (The list follows the same order as the GNU Coding Standards.)
892 bindir='${exec_prefix}/bin'
893 sbindir='${exec_prefix}/sbin'
894 libexecdir='${exec_prefix}/libexec'
895 datarootdir='${prefix}/share'
896 datadir='${datarootdir}'
897 sysconfdir='${prefix}/etc'
898 sharedstatedir='${prefix}/com'
899 localstatedir='${prefix}/var'
900 includedir='${prefix}/include'
901 oldincludedir='/usr/include'
902 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
903 infodir='${datarootdir}/info'
904 htmldir='${docdir}'
905 dvidir='${docdir}'
906 pdfdir='${docdir}'
907 psdir='${docdir}'
908 libdir='${exec_prefix}/lib'
909 localedir='${datarootdir}/locale'
910 mandir='${datarootdir}/man'
911
912 ac_prev=
913 ac_dashdash=
914 for ac_option
915 do
916   # If the previous option needs an argument, assign it.
917   if test -n "$ac_prev"; then
918     eval $ac_prev=\$ac_option
919     ac_prev=
920     continue
921   fi
922
923   case $ac_option in
924   *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
925   *=)   ac_optarg= ;;
926   *)    ac_optarg=yes ;;
927   esac
928
929   # Accept the important Cygnus configure options, so we can diagnose typos.
930
931   case $ac_dashdash$ac_option in
932   --)
933     ac_dashdash=yes ;;
934
935   -bindir | --bindir | --bindi | --bind | --bin | --bi)
936     ac_prev=bindir ;;
937   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
938     bindir=$ac_optarg ;;
939
940   -build | --build | --buil | --bui | --bu)
941     ac_prev=build_alias ;;
942   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
943     build_alias=$ac_optarg ;;
944
945   -cache-file | --cache-file | --cache-fil | --cache-fi \
946   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
947     ac_prev=cache_file ;;
948   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
949   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
950     cache_file=$ac_optarg ;;
951
952   --config-cache | -C)
953     cache_file=config.cache ;;
954
955   -datadir | --datadir | --datadi | --datad)
956     ac_prev=datadir ;;
957   -datadir=* | --datadir=* | --datadi=* | --datad=*)
958     datadir=$ac_optarg ;;
959
960   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
961   | --dataroo | --dataro | --datar)
962     ac_prev=datarootdir ;;
963   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
964   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
965     datarootdir=$ac_optarg ;;
966
967   -disable-* | --disable-*)
968     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
969     # Reject names that are not valid shell variable names.
970     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
971       as_fn_error $? "invalid feature name: $ac_useropt"
972     ac_useropt_orig=$ac_useropt
973     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
974     case $ac_user_opts in
975       *"
976 "enable_$ac_useropt"
977 "*) ;;
978       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
979          ac_unrecognized_sep=', ';;
980     esac
981     eval enable_$ac_useropt=no ;;
982
983   -docdir | --docdir | --docdi | --doc | --do)
984     ac_prev=docdir ;;
985   -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
986     docdir=$ac_optarg ;;
987
988   -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
989     ac_prev=dvidir ;;
990   -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
991     dvidir=$ac_optarg ;;
992
993   -enable-* | --enable-*)
994     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
995     # Reject names that are not valid shell variable names.
996     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
997       as_fn_error $? "invalid feature name: $ac_useropt"
998     ac_useropt_orig=$ac_useropt
999     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1000     case $ac_user_opts in
1001       *"
1002 "enable_$ac_useropt"
1003 "*) ;;
1004       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
1005          ac_unrecognized_sep=', ';;
1006     esac
1007     eval enable_$ac_useropt=\$ac_optarg ;;
1008
1009   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
1010   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
1011   | --exec | --exe | --ex)
1012     ac_prev=exec_prefix ;;
1013   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
1014   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
1015   | --exec=* | --exe=* | --ex=*)
1016     exec_prefix=$ac_optarg ;;
1017
1018   -gas | --gas | --ga | --g)
1019     # Obsolete; use --with-gas.
1020     with_gas=yes ;;
1021
1022   -help | --help | --hel | --he | -h)
1023     ac_init_help=long ;;
1024   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
1025     ac_init_help=recursive ;;
1026   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
1027     ac_init_help=short ;;
1028
1029   -host | --host | --hos | --ho)
1030     ac_prev=host_alias ;;
1031   -host=* | --host=* | --hos=* | --ho=*)
1032     host_alias=$ac_optarg ;;
1033
1034   -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
1035     ac_prev=htmldir ;;
1036   -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
1037   | --ht=*)
1038     htmldir=$ac_optarg ;;
1039
1040   -includedir | --includedir | --includedi | --included | --include \
1041   | --includ | --inclu | --incl | --inc)
1042     ac_prev=includedir ;;
1043   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
1044   | --includ=* | --inclu=* | --incl=* | --inc=*)
1045     includedir=$ac_optarg ;;
1046
1047   -infodir | --infodir | --infodi | --infod | --info | --inf)
1048     ac_prev=infodir ;;
1049   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
1050     infodir=$ac_optarg ;;
1051
1052   -libdir | --libdir | --libdi | --libd)
1053     ac_prev=libdir ;;
1054   -libdir=* | --libdir=* | --libdi=* | --libd=*)
1055     libdir=$ac_optarg ;;
1056
1057   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
1058   | --libexe | --libex | --libe)
1059     ac_prev=libexecdir ;;
1060   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
1061   | --libexe=* | --libex=* | --libe=*)
1062     libexecdir=$ac_optarg ;;
1063
1064   -localedir | --localedir | --localedi | --localed | --locale)
1065     ac_prev=localedir ;;
1066   -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
1067     localedir=$ac_optarg ;;
1068
1069   -localstatedir | --localstatedir | --localstatedi | --localstated \
1070   | --localstate | --localstat | --localsta | --localst | --locals)
1071     ac_prev=localstatedir ;;
1072   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
1073   | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
1074     localstatedir=$ac_optarg ;;
1075
1076   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
1077     ac_prev=mandir ;;
1078   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
1079     mandir=$ac_optarg ;;
1080
1081   -nfp | --nfp | --nf)
1082     # Obsolete; use --without-fp.
1083     with_fp=no ;;
1084
1085   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1086   | --no-cr | --no-c | -n)
1087     no_create=yes ;;
1088
1089   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1090   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1091     no_recursion=yes ;;
1092
1093   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
1094   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
1095   | --oldin | --oldi | --old | --ol | --o)
1096     ac_prev=oldincludedir ;;
1097   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1098   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1099   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1100     oldincludedir=$ac_optarg ;;
1101
1102   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1103     ac_prev=prefix ;;
1104   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1105     prefix=$ac_optarg ;;
1106
1107   -program-prefix | --program-prefix | --program-prefi | --program-pref \
1108   | --program-pre | --program-pr | --program-p)
1109     ac_prev=program_prefix ;;
1110   -program-prefix=* | --program-prefix=* | --program-prefi=* \
1111   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1112     program_prefix=$ac_optarg ;;
1113
1114   -program-suffix | --program-suffix | --program-suffi | --program-suff \
1115   | --program-suf | --program-su | --program-s)
1116     ac_prev=program_suffix ;;
1117   -program-suffix=* | --program-suffix=* | --program-suffi=* \
1118   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1119     program_suffix=$ac_optarg ;;
1120
1121   -program-transform-name | --program-transform-name \
1122   | --program-transform-nam | --program-transform-na \
1123   | --program-transform-n | --program-transform- \
1124   | --program-transform | --program-transfor \
1125   | --program-transfo | --program-transf \
1126   | --program-trans | --program-tran \
1127   | --progr-tra | --program-tr | --program-t)
1128     ac_prev=program_transform_name ;;
1129   -program-transform-name=* | --program-transform-name=* \
1130   | --program-transform-nam=* | --program-transform-na=* \
1131   | --program-transform-n=* | --program-transform-=* \
1132   | --program-transform=* | --program-transfor=* \
1133   | --program-transfo=* | --program-transf=* \
1134   | --program-trans=* | --program-tran=* \
1135   | --progr-tra=* | --program-tr=* | --program-t=*)
1136     program_transform_name=$ac_optarg ;;
1137
1138   -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
1139     ac_prev=pdfdir ;;
1140   -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
1141     pdfdir=$ac_optarg ;;
1142
1143   -psdir | --psdir | --psdi | --psd | --ps)
1144     ac_prev=psdir ;;
1145   -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
1146     psdir=$ac_optarg ;;
1147
1148   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1149   | -silent | --silent | --silen | --sile | --sil)
1150     silent=yes ;;
1151
1152   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1153     ac_prev=sbindir ;;
1154   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1155   | --sbi=* | --sb=*)
1156     sbindir=$ac_optarg ;;
1157
1158   -sharedstatedir | --sharedstatedir | --sharedstatedi \
1159   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1160   | --sharedst | --shareds | --shared | --share | --shar \
1161   | --sha | --sh)
1162     ac_prev=sharedstatedir ;;
1163   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1164   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1165   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1166   | --sha=* | --sh=*)
1167     sharedstatedir=$ac_optarg ;;
1168
1169   -site | --site | --sit)
1170     ac_prev=site ;;
1171   -site=* | --site=* | --sit=*)
1172     site=$ac_optarg ;;
1173
1174   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1175     ac_prev=srcdir ;;
1176   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1177     srcdir=$ac_optarg ;;
1178
1179   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1180   | --syscon | --sysco | --sysc | --sys | --sy)
1181     ac_prev=sysconfdir ;;
1182   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1183   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1184     sysconfdir=$ac_optarg ;;
1185
1186   -target | --target | --targe | --targ | --tar | --ta | --t)
1187     ac_prev=target_alias ;;
1188   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1189     target_alias=$ac_optarg ;;
1190
1191   -v | -verbose | --verbose | --verbos | --verbo | --verb)
1192     verbose=yes ;;
1193
1194   -version | --version | --versio | --versi | --vers | -V)
1195     ac_init_version=: ;;
1196
1197   -with-* | --with-*)
1198     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1199     # Reject names that are not valid shell variable names.
1200     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1201       as_fn_error $? "invalid package name: $ac_useropt"
1202     ac_useropt_orig=$ac_useropt
1203     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1204     case $ac_user_opts in
1205       *"
1206 "with_$ac_useropt"
1207 "*) ;;
1208       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1209          ac_unrecognized_sep=', ';;
1210     esac
1211     eval with_$ac_useropt=\$ac_optarg ;;
1212
1213   -without-* | --without-*)
1214     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1215     # Reject names that are not valid shell variable names.
1216     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1217       as_fn_error $? "invalid package name: $ac_useropt"
1218     ac_useropt_orig=$ac_useropt
1219     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1220     case $ac_user_opts in
1221       *"
1222 "with_$ac_useropt"
1223 "*) ;;
1224       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1225          ac_unrecognized_sep=', ';;
1226     esac
1227     eval with_$ac_useropt=no ;;
1228
1229   --x)
1230     # Obsolete; use --with-x.
1231     with_x=yes ;;
1232
1233   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1234   | --x-incl | --x-inc | --x-in | --x-i)
1235     ac_prev=x_includes ;;
1236   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1237   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1238     x_includes=$ac_optarg ;;
1239
1240   -x-libraries | --x-libraries | --x-librarie | --x-librari \
1241   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1242     ac_prev=x_libraries ;;
1243   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1244   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1245     x_libraries=$ac_optarg ;;
1246
1247   -*) as_fn_error $? "unrecognized option: \`$ac_option'
1248 Try \`$0 --help' for more information"
1249     ;;
1250
1251   *=*)
1252     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1253     # Reject names that are not valid shell variable names.
1254     case $ac_envvar in #(
1255       '' | [0-9]* | *[!_$as_cr_alnum]* )
1256       as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
1257     esac
1258     eval $ac_envvar=\$ac_optarg
1259     export $ac_envvar ;;
1260
1261   *)
1262     # FIXME: should be removed in autoconf 3.0.
1263     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
1264     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1265       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1266     : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
1267     ;;
1268
1269   esac
1270 done
1271
1272 if test -n "$ac_prev"; then
1273   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1274   as_fn_error $? "missing argument to $ac_option"
1275 fi
1276
1277 if test -n "$ac_unrecognized_opts"; then
1278   case $enable_option_checking in
1279     no) ;;
1280     fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
1281     *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1282   esac
1283 fi
1284
1285 # Check all directory arguments for consistency.
1286 for ac_var in   exec_prefix prefix bindir sbindir libexecdir datarootdir \
1287                 datadir sysconfdir sharedstatedir localstatedir includedir \
1288                 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1289                 libdir localedir mandir
1290 do
1291   eval ac_val=\$$ac_var
1292   # Remove trailing slashes.
1293   case $ac_val in
1294     */ )
1295       ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1296       eval $ac_var=\$ac_val;;
1297   esac
1298   # Be sure to have absolute directory names.
1299   case $ac_val in
1300     [\\/$]* | ?:[\\/]* )  continue;;
1301     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1302   esac
1303   as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
1304 done
1305
1306 # There might be people who depend on the old broken behavior: `$host'
1307 # used to hold the argument of --host etc.
1308 # FIXME: To remove some day.
1309 build=$build_alias
1310 host=$host_alias
1311 target=$target_alias
1312
1313 # FIXME: To remove some day.
1314 if test "x$host_alias" != x; then
1315   if test "x$build_alias" = x; then
1316     cross_compiling=maybe
1317   elif test "x$build_alias" != "x$host_alias"; then
1318     cross_compiling=yes
1319   fi
1320 fi
1321
1322 ac_tool_prefix=
1323 test -n "$host_alias" && ac_tool_prefix=$host_alias-
1324
1325 test "$silent" = yes && exec 6>/dev/null
1326
1327
1328 ac_pwd=`pwd` && test -n "$ac_pwd" &&
1329 ac_ls_di=`ls -di .` &&
1330 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1331   as_fn_error $? "working directory cannot be determined"
1332 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1333   as_fn_error $? "pwd does not report name of working directory"
1334
1335
1336 # Find the source files, if location was not specified.
1337 if test -z "$srcdir"; then
1338   ac_srcdir_defaulted=yes
1339   # Try the directory containing this script, then the parent directory.
1340   ac_confdir=`$as_dirname -- "$as_myself" ||
1341 $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1342          X"$as_myself" : 'X\(//\)[^/]' \| \
1343          X"$as_myself" : 'X\(//\)$' \| \
1344          X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1345 $as_echo X"$as_myself" |
1346     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1347             s//\1/
1348             q
1349           }
1350           /^X\(\/\/\)[^/].*/{
1351             s//\1/
1352             q
1353           }
1354           /^X\(\/\/\)$/{
1355             s//\1/
1356             q
1357           }
1358           /^X\(\/\).*/{
1359             s//\1/
1360             q
1361           }
1362           s/.*/./; q'`
1363   srcdir=$ac_confdir
1364   if test ! -r "$srcdir/$ac_unique_file"; then
1365     srcdir=..
1366   fi
1367 else
1368   ac_srcdir_defaulted=no
1369 fi
1370 if test ! -r "$srcdir/$ac_unique_file"; then
1371   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1372   as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
1373 fi
1374 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1375 ac_abs_confdir=`(
1376         cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
1377         pwd)`
1378 # When building in place, set srcdir=.
1379 if test "$ac_abs_confdir" = "$ac_pwd"; then
1380   srcdir=.
1381 fi
1382 # Remove unnecessary trailing slashes from srcdir.
1383 # Double slashes in file names in object file debugging info
1384 # mess up M-x gdb in Emacs.
1385 case $srcdir in
1386 */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1387 esac
1388 for ac_var in $ac_precious_vars; do
1389   eval ac_env_${ac_var}_set=\${${ac_var}+set}
1390   eval ac_env_${ac_var}_value=\$${ac_var}
1391   eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1392   eval ac_cv_env_${ac_var}_value=\$${ac_var}
1393 done
1394
1395 #
1396 # Report the --help message.
1397 #
1398 if test "$ac_init_help" = "long"; then
1399   # Omit some internal or obsolete options to make the list less imposing.
1400   # This message is too long to be a string in the A/UX 3.1 sh.
1401   cat <<_ACEOF
1402 \`configure' configures PostgreSQL 10devel to adapt to many kinds of systems.
1403
1404 Usage: $0 [OPTION]... [VAR=VALUE]...
1405
1406 To assign environment variables (e.g., CC, CFLAGS...), specify them as
1407 VAR=VALUE.  See below for descriptions of some of the useful variables.
1408
1409 Defaults for the options are specified in brackets.
1410
1411 Configuration:
1412   -h, --help              display this help and exit
1413       --help=short        display options specific to this package
1414       --help=recursive    display the short help of all the included packages
1415   -V, --version           display version information and exit
1416   -q, --quiet, --silent   do not print \`checking ...' messages
1417       --cache-file=FILE   cache test results in FILE [disabled]
1418   -C, --config-cache      alias for \`--cache-file=config.cache'
1419   -n, --no-create         do not create output files
1420       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
1421
1422 Installation directories:
1423   --prefix=PREFIX         install architecture-independent files in PREFIX
1424                           [$ac_default_prefix]
1425   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
1426                           [PREFIX]
1427
1428 By default, \`make install' will install all the files in
1429 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
1430 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1431 for instance \`--prefix=\$HOME'.
1432
1433 For better control, use the options below.
1434
1435 Fine tuning of the installation directories:
1436   --bindir=DIR            user executables [EPREFIX/bin]
1437   --sbindir=DIR           system admin executables [EPREFIX/sbin]
1438   --libexecdir=DIR        program executables [EPREFIX/libexec]
1439   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1440   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1441   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1442   --libdir=DIR            object code libraries [EPREFIX/lib]
1443   --includedir=DIR        C header files [PREFIX/include]
1444   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
1445   --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
1446   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
1447   --infodir=DIR           info documentation [DATAROOTDIR/info]
1448   --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
1449   --mandir=DIR            man documentation [DATAROOTDIR/man]
1450   --docdir=DIR            documentation root [DATAROOTDIR/doc/postgresql]
1451   --htmldir=DIR           html documentation [DOCDIR]
1452   --dvidir=DIR            dvi documentation [DOCDIR]
1453   --pdfdir=DIR            pdf documentation [DOCDIR]
1454   --psdir=DIR             ps documentation [DOCDIR]
1455 _ACEOF
1456
1457   cat <<\_ACEOF
1458
1459 System types:
1460   --build=BUILD     configure for building on BUILD [guessed]
1461   --host=HOST       cross-compile to build programs to run on HOST [BUILD]
1462 _ACEOF
1463 fi
1464
1465 if test -n "$ac_init_help"; then
1466   case $ac_init_help in
1467      short | recursive ) echo "Configuration of PostgreSQL 10devel:";;
1468    esac
1469   cat <<\_ACEOF
1470
1471 Optional Features:
1472   --disable-option-checking  ignore unrecognized --enable/--with options
1473   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1474   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
1475   --disable-integer-datetimes
1476                           obsolete option, no longer supported
1477   --enable-nls[=LANGUAGES]
1478                           enable Native Language Support
1479   --disable-rpath         do not embed shared library search path in
1480                           executables
1481   --disable-spinlocks     do not use spinlocks
1482   --disable-atomics       do not use atomic operations
1483   --disable-strong-random do not use a strong random number source
1484   --enable-debug          build with debugging symbols (-g)
1485   --enable-profiling      build with profiling enabled
1486   --enable-coverage       build with coverage testing instrumentation
1487   --enable-dtrace         build with DTrace support
1488   --enable-tap-tests      enable TAP tests (requires Perl and IPC::Run)
1489   --enable-depend         turn on automatic dependency tracking
1490   --enable-cassert        enable assertion checks (for debugging)
1491   --disable-thread-safety disable thread-safety in client libraries
1492   --disable-largefile     omit support for large files
1493   --disable-float4-byval  disable float4 passed by value
1494   --disable-float8-byval  disable float8 passed by value
1495
1496 Optional Packages:
1497   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1498   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
1499   --with-extra-version=STRING
1500                           append STRING to version
1501   --with-template=NAME    override operating system template
1502   --with-includes=DIRS    look for additional header files in DIRS
1503   --with-libraries=DIRS   look for additional libraries in DIRS
1504   --with-libs=DIRS        alternative spelling of --with-libraries
1505   --with-pgport=PORTNUM   set default port number [5432]
1506   --with-blocksize=BLOCKSIZE
1507                           set table block size in kB [8]
1508   --with-segsize=SEGSIZE  set table segment size in GB [1]
1509   --with-wal-blocksize=BLOCKSIZE
1510                           set WAL block size in kB [8]
1511   --with-wal-segsize=SEGSIZE
1512                           set WAL segment size in MB [16]
1513   --with-CC=CMD           set compiler (deprecated)
1514   --with-tcl              build Tcl modules (PL/Tcl)
1515   --with-tclconfig=DIR    tclConfig.sh is in DIR
1516   --with-perl             build Perl modules (PL/Perl)
1517   --with-python           build Python modules (PL/Python)
1518   --with-gssapi           build with GSSAPI support
1519   --with-krb-srvnam=NAME  default service principal name in Kerberos (GSSAPI)
1520                           [postgres]
1521   --with-pam              build with PAM support
1522   --with-bsd-auth         build with BSD Authentication support
1523   --with-ldap             build with LDAP support
1524   --with-bonjour          build with Bonjour support
1525   --with-openssl          build with OpenSSL support
1526   --with-selinux          build with SELinux support
1527   --with-systemd          build with systemd support
1528   --without-readline      do not use GNU Readline nor BSD Libedit for editing
1529   --with-libedit-preferred
1530                           prefer BSD Libedit over GNU Readline
1531   --with-uuid=LIB         build contrib/uuid-ossp using LIB (bsd,e2fs,ossp)
1532   --with-ossp-uuid        obsolete spelling of --with-uuid=ossp
1533   --with-libxml           build with XML support
1534   --with-libxslt          use XSLT support when building contrib/xml2
1535   --with-system-tzdata=DIR
1536                           use system time zone data in DIR
1537   --without-zlib          do not use Zlib
1538   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
1539
1540 Some influential environment variables:
1541   CC          C compiler command
1542   CFLAGS      C compiler flags
1543   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
1544               nonstandard directory <lib dir>
1545   LIBS        libraries to pass to the linker, e.g. -l<library>
1546   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1547               you have headers in a nonstandard directory <include dir>
1548   CPP         C preprocessor
1549   LDFLAGS_EX  extra linker flags for linking executables only
1550   LDFLAGS_SL  extra linker flags for linking shared libraries only
1551   DOCBOOKSTYLE
1552               location of DocBook stylesheets
1553
1554 Use these variables to override the choices made by `configure' or to help
1555 it to find libraries and programs with nonstandard names/locations.
1556
1557 Report bugs to <pgsql-bugs@postgresql.org>.
1558 _ACEOF
1559 ac_status=$?
1560 fi
1561
1562 if test "$ac_init_help" = "recursive"; then
1563   # If there are subdirs, report their specific --help.
1564   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1565     test -d "$ac_dir" ||
1566       { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1567       continue
1568     ac_builddir=.
1569
1570 case "$ac_dir" in
1571 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1572 *)
1573   ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
1574   # A ".." for each directory in $ac_dir_suffix.
1575   ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1576   case $ac_top_builddir_sub in
1577   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1578   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1579   esac ;;
1580 esac
1581 ac_abs_top_builddir=$ac_pwd
1582 ac_abs_builddir=$ac_pwd$ac_dir_suffix
1583 # for backward compatibility:
1584 ac_top_builddir=$ac_top_build_prefix
1585
1586 case $srcdir in
1587   .)  # We are building in place.
1588     ac_srcdir=.
1589     ac_top_srcdir=$ac_top_builddir_sub
1590     ac_abs_top_srcdir=$ac_pwd ;;
1591   [\\/]* | ?:[\\/]* )  # Absolute name.
1592     ac_srcdir=$srcdir$ac_dir_suffix;
1593     ac_top_srcdir=$srcdir
1594     ac_abs_top_srcdir=$srcdir ;;
1595   *) # Relative name.
1596     ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1597     ac_top_srcdir=$ac_top_build_prefix$srcdir
1598     ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1599 esac
1600 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1601
1602     cd "$ac_dir" || { ac_status=$?; continue; }
1603     # Check for guested configure.
1604     if test -f "$ac_srcdir/configure.gnu"; then
1605       echo &&
1606       $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1607     elif test -f "$ac_srcdir/configure"; then
1608       echo &&
1609       $SHELL "$ac_srcdir/configure" --help=recursive
1610     else
1611       $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1612     fi || ac_status=$?
1613     cd "$ac_pwd" || { ac_status=$?; break; }
1614   done
1615 fi
1616
1617 test -n "$ac_init_help" && exit $ac_status
1618 if $ac_init_version; then
1619   cat <<\_ACEOF
1620 PostgreSQL configure 10devel
1621 generated by GNU Autoconf 2.69
1622
1623 Copyright (C) 2012 Free Software Foundation, Inc.
1624 This configure script is free software; the Free Software Foundation
1625 gives unlimited permission to copy, distribute and modify it.
1626
1627 Copyright (c) 1996-2017, PostgreSQL Global Development Group
1628 _ACEOF
1629   exit
1630 fi
1631
1632 ## ------------------------ ##
1633 ## Autoconf initialization. ##
1634 ## ------------------------ ##
1635
1636 # ac_fn_c_try_compile LINENO
1637 # --------------------------
1638 # Try to compile conftest.$ac_ext, and return whether this succeeded.
1639 ac_fn_c_try_compile ()
1640 {
1641   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1642   rm -f conftest.$ac_objext
1643   if { { ac_try="$ac_compile"
1644 case "(($ac_try" in
1645   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1646   *) ac_try_echo=$ac_try;;
1647 esac
1648 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1649 $as_echo "$ac_try_echo"; } >&5
1650   (eval "$ac_compile") 2>conftest.err
1651   ac_status=$?
1652   if test -s conftest.err; then
1653     grep -v '^ *+' conftest.err >conftest.er1
1654     cat conftest.er1 >&5
1655     mv -f conftest.er1 conftest.err
1656   fi
1657   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1658   test $ac_status = 0; } && {
1659          test -z "$ac_c_werror_flag" ||
1660          test ! -s conftest.err
1661        } && test -s conftest.$ac_objext; then :
1662   ac_retval=0
1663 else
1664   $as_echo "$as_me: failed program was:" >&5
1665 sed 's/^/| /' conftest.$ac_ext >&5
1666
1667         ac_retval=1
1668 fi
1669   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1670   as_fn_set_status $ac_retval
1671
1672 } # ac_fn_c_try_compile
1673
1674 # ac_fn_c_try_link LINENO
1675 # -----------------------
1676 # Try to link conftest.$ac_ext, and return whether this succeeded.
1677 ac_fn_c_try_link ()
1678 {
1679   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1680   rm -f conftest.$ac_objext conftest$ac_exeext
1681   if { { ac_try="$ac_link"
1682 case "(($ac_try" in
1683   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1684   *) ac_try_echo=$ac_try;;
1685 esac
1686 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1687 $as_echo "$ac_try_echo"; } >&5
1688   (eval "$ac_link") 2>conftest.err
1689   ac_status=$?
1690   if test -s conftest.err; then
1691     grep -v '^ *+' conftest.err >conftest.er1
1692     cat conftest.er1 >&5
1693     mv -f conftest.er1 conftest.err
1694   fi
1695   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1696   test $ac_status = 0; } && {
1697          test -z "$ac_c_werror_flag" ||
1698          test ! -s conftest.err
1699        } && test -s conftest$ac_exeext && {
1700          test "$cross_compiling" = yes ||
1701          test -x conftest$ac_exeext
1702        }; then :
1703   ac_retval=0
1704 else
1705   $as_echo "$as_me: failed program was:" >&5
1706 sed 's/^/| /' conftest.$ac_ext >&5
1707
1708         ac_retval=1
1709 fi
1710   # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1711   # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1712   # interfere with the next link command; also delete a directory that is
1713   # left behind by Apple's compiler.  We do this before executing the actions.
1714   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1715   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1716   as_fn_set_status $ac_retval
1717
1718 } # ac_fn_c_try_link
1719
1720 # ac_fn_c_try_cpp LINENO
1721 # ----------------------
1722 # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
1723 ac_fn_c_try_cpp ()
1724 {
1725   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1726   if { { ac_try="$ac_cpp conftest.$ac_ext"
1727 case "(($ac_try" in
1728   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1729   *) ac_try_echo=$ac_try;;
1730 esac
1731 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1732 $as_echo "$ac_try_echo"; } >&5
1733   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
1734   ac_status=$?
1735   if test -s conftest.err; then
1736     grep -v '^ *+' conftest.err >conftest.er1
1737     cat conftest.er1 >&5
1738     mv -f conftest.er1 conftest.err
1739   fi
1740   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1741   test $ac_status = 0; } > conftest.i && {
1742          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
1743          test ! -s conftest.err
1744        }; then :
1745   ac_retval=0
1746 else
1747   $as_echo "$as_me: failed program was:" >&5
1748 sed 's/^/| /' conftest.$ac_ext >&5
1749
1750     ac_retval=1
1751 fi
1752   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1753   as_fn_set_status $ac_retval
1754
1755 } # ac_fn_c_try_cpp
1756
1757 # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
1758 # -------------------------------------------------------
1759 # Tests whether HEADER exists, giving a warning if it cannot be compiled using
1760 # the include files in INCLUDES and setting the cache variable VAR
1761 # accordingly.
1762 ac_fn_c_check_header_mongrel ()
1763 {
1764   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1765   if eval \${$3+:} false; then :
1766   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1767 $as_echo_n "checking for $2... " >&6; }
1768 if eval \${$3+:} false; then :
1769   $as_echo_n "(cached) " >&6
1770 fi
1771 eval ac_res=\$$3
1772                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1773 $as_echo "$ac_res" >&6; }
1774 else
1775   # Is the header compilable?
1776 { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
1777 $as_echo_n "checking $2 usability... " >&6; }
1778 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1779 /* end confdefs.h.  */
1780 $4
1781 #include <$2>
1782 _ACEOF
1783 if ac_fn_c_try_compile "$LINENO"; then :
1784   ac_header_compiler=yes
1785 else
1786   ac_header_compiler=no
1787 fi
1788 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1789 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
1790 $as_echo "$ac_header_compiler" >&6; }
1791
1792 # Is the header present?
1793 { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
1794 $as_echo_n "checking $2 presence... " >&6; }
1795 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1796 /* end confdefs.h.  */
1797 #include <$2>
1798 _ACEOF
1799 if ac_fn_c_try_cpp "$LINENO"; then :
1800   ac_header_preproc=yes
1801 else
1802   ac_header_preproc=no
1803 fi
1804 rm -f conftest.err conftest.i conftest.$ac_ext
1805 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
1806 $as_echo "$ac_header_preproc" >&6; }
1807
1808 # So?  What about this header?
1809 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
1810   yes:no: )
1811     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
1812 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
1813     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1814 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1815     ;;
1816   no:yes:* )
1817     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
1818 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
1819     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
1820 $as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
1821     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
1822 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
1823     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
1824 $as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
1825     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1826 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1827 ( $as_echo "## ---------------------------------------- ##
1828 ## Report this to pgsql-bugs@postgresql.org ##
1829 ## ---------------------------------------- ##"
1830      ) | sed "s/^/$as_me: WARNING:     /" >&2
1831     ;;
1832 esac
1833   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1834 $as_echo_n "checking for $2... " >&6; }
1835 if eval \${$3+:} false; then :
1836   $as_echo_n "(cached) " >&6
1837 else
1838   eval "$3=\$ac_header_compiler"
1839 fi
1840 eval ac_res=\$$3
1841                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1842 $as_echo "$ac_res" >&6; }
1843 fi
1844   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1845
1846 } # ac_fn_c_check_header_mongrel
1847
1848 # ac_fn_c_try_run LINENO
1849 # ----------------------
1850 # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
1851 # that executables *can* be run.
1852 ac_fn_c_try_run ()
1853 {
1854   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1855   if { { ac_try="$ac_link"
1856 case "(($ac_try" in
1857   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1858   *) ac_try_echo=$ac_try;;
1859 esac
1860 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1861 $as_echo "$ac_try_echo"; } >&5
1862   (eval "$ac_link") 2>&5
1863   ac_status=$?
1864   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1865   test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
1866   { { case "(($ac_try" in
1867   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1868   *) ac_try_echo=$ac_try;;
1869 esac
1870 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1871 $as_echo "$ac_try_echo"; } >&5
1872   (eval "$ac_try") 2>&5
1873   ac_status=$?
1874   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1875   test $ac_status = 0; }; }; then :
1876   ac_retval=0
1877 else
1878   $as_echo "$as_me: program exited with status $ac_status" >&5
1879        $as_echo "$as_me: failed program was:" >&5
1880 sed 's/^/| /' conftest.$ac_ext >&5
1881
1882        ac_retval=$ac_status
1883 fi
1884   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1885   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1886   as_fn_set_status $ac_retval
1887
1888 } # ac_fn_c_try_run
1889
1890 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
1891 # -------------------------------------------------------
1892 # Tests whether HEADER exists and can be compiled using the include files in
1893 # INCLUDES, setting the cache variable VAR accordingly.
1894 ac_fn_c_check_header_compile ()
1895 {
1896   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1897   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1898 $as_echo_n "checking for $2... " >&6; }
1899 if eval \${$3+:} false; then :
1900   $as_echo_n "(cached) " >&6
1901 else
1902   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1903 /* end confdefs.h.  */
1904 $4
1905 #include <$2>
1906 _ACEOF
1907 if ac_fn_c_try_compile "$LINENO"; then :
1908   eval "$3=yes"
1909 else
1910   eval "$3=no"
1911 fi
1912 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1913 fi
1914 eval ac_res=\$$3
1915                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1916 $as_echo "$ac_res" >&6; }
1917   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1918
1919 } # ac_fn_c_check_header_compile
1920
1921 # ac_fn_c_check_func LINENO FUNC VAR
1922 # ----------------------------------
1923 # Tests whether FUNC exists, setting the cache variable VAR accordingly
1924 ac_fn_c_check_func ()
1925 {
1926   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1927   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1928 $as_echo_n "checking for $2... " >&6; }
1929 if eval \${$3+:} false; then :
1930   $as_echo_n "(cached) " >&6
1931 else
1932   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1933 /* end confdefs.h.  */
1934 /* Define $2 to an innocuous variant, in case <limits.h> declares $2.
1935    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
1936 #define $2 innocuous_$2
1937
1938 /* System header to define __stub macros and hopefully few prototypes,
1939     which can conflict with char $2 (); below.
1940     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
1941     <limits.h> exists even on freestanding compilers.  */
1942
1943 #ifdef __STDC__
1944 # include <limits.h>
1945 #else
1946 # include <assert.h>
1947 #endif
1948
1949 #undef $2
1950
1951 /* Override any GCC internal prototype to avoid an error.
1952    Use char because int might match the return type of a GCC
1953    builtin and then its argument prototype would still apply.  */
1954 #ifdef __cplusplus
1955 extern "C"
1956 #endif
1957 char $2 ();
1958 /* The GNU C library defines this for functions which it implements
1959     to always fail with ENOSYS.  Some functions are actually named
1960     something starting with __ and the normal name is an alias.  */
1961 #if defined __stub_$2 || defined __stub___$2
1962 choke me
1963 #endif
1964
1965 int
1966 main ()
1967 {
1968 return $2 ();
1969   ;
1970   return 0;
1971 }
1972 _ACEOF
1973 if ac_fn_c_try_link "$LINENO"; then :
1974   eval "$3=yes"
1975 else
1976   eval "$3=no"
1977 fi
1978 rm -f core conftest.err conftest.$ac_objext \
1979     conftest$ac_exeext conftest.$ac_ext
1980 fi
1981 eval ac_res=\$$3
1982                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1983 $as_echo "$ac_res" >&6; }
1984   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1985
1986 } # ac_fn_c_check_func
1987
1988 # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
1989 # ----------------------------------------------------
1990 # Tries to find if the field MEMBER exists in type AGGR, after including
1991 # INCLUDES, setting cache variable VAR accordingly.
1992 ac_fn_c_check_member ()
1993 {
1994   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1995   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
1996 $as_echo_n "checking for $2.$3... " >&6; }
1997 if eval \${$4+:} false; then :
1998   $as_echo_n "(cached) " >&6
1999 else
2000   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2001 /* end confdefs.h.  */
2002 $5
2003 int
2004 main ()
2005 {
2006 static $2 ac_aggr;
2007 if (ac_aggr.$3)
2008 return 0;
2009   ;
2010   return 0;
2011 }
2012 _ACEOF
2013 if ac_fn_c_try_compile "$LINENO"; then :
2014   eval "$4=yes"
2015 else
2016   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2017 /* end confdefs.h.  */
2018 $5
2019 int
2020 main ()
2021 {
2022 static $2 ac_aggr;
2023 if (sizeof ac_aggr.$3)
2024 return 0;
2025   ;
2026   return 0;
2027 }
2028 _ACEOF
2029 if ac_fn_c_try_compile "$LINENO"; then :
2030   eval "$4=yes"
2031 else
2032   eval "$4=no"
2033 fi
2034 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2035 fi
2036 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2037 fi
2038 eval ac_res=\$$4
2039                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2040 $as_echo "$ac_res" >&6; }
2041   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2042
2043 } # ac_fn_c_check_member
2044
2045 # ac_fn_c_check_type LINENO TYPE VAR INCLUDES
2046 # -------------------------------------------
2047 # Tests whether TYPE exists after having included INCLUDES, setting cache
2048 # variable VAR accordingly.
2049 ac_fn_c_check_type ()
2050 {
2051   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2052   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2053 $as_echo_n "checking for $2... " >&6; }
2054 if eval \${$3+:} false; then :
2055   $as_echo_n "(cached) " >&6
2056 else
2057   eval "$3=no"
2058   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2059 /* end confdefs.h.  */
2060 $4
2061 int
2062 main ()
2063 {
2064 if (sizeof ($2))
2065          return 0;
2066   ;
2067   return 0;
2068 }
2069 _ACEOF
2070 if ac_fn_c_try_compile "$LINENO"; then :
2071   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2072 /* end confdefs.h.  */
2073 $4
2074 int
2075 main ()
2076 {
2077 if (sizeof (($2)))
2078             return 0;
2079   ;
2080   return 0;
2081 }
2082 _ACEOF
2083 if ac_fn_c_try_compile "$LINENO"; then :
2084
2085 else
2086   eval "$3=yes"
2087 fi
2088 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2089 fi
2090 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2091 fi
2092 eval ac_res=\$$3
2093                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2094 $as_echo "$ac_res" >&6; }
2095   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2096
2097 } # ac_fn_c_check_type
2098
2099 # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
2100 # --------------------------------------------
2101 # Tries to find the compile-time value of EXPR in a program that includes
2102 # INCLUDES, setting VAR accordingly. Returns whether the value could be
2103 # computed
2104 ac_fn_c_compute_int ()
2105 {
2106   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2107   if test "$cross_compiling" = yes; then
2108     # Depending upon the size, compute the lo and hi bounds.
2109 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2110 /* end confdefs.h.  */
2111 $4
2112 int
2113 main ()
2114 {
2115 static int test_array [1 - 2 * !(($2) >= 0)];
2116 test_array [0] = 0;
2117 return test_array [0];
2118
2119   ;
2120   return 0;
2121 }
2122 _ACEOF
2123 if ac_fn_c_try_compile "$LINENO"; then :
2124   ac_lo=0 ac_mid=0
2125   while :; do
2126     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2127 /* end confdefs.h.  */
2128 $4
2129 int
2130 main ()
2131 {
2132 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
2133 test_array [0] = 0;
2134 return test_array [0];
2135
2136   ;
2137   return 0;
2138 }
2139 _ACEOF
2140 if ac_fn_c_try_compile "$LINENO"; then :
2141   ac_hi=$ac_mid; break
2142 else
2143   as_fn_arith $ac_mid + 1 && ac_lo=$as_val
2144                         if test $ac_lo -le $ac_mid; then
2145                           ac_lo= ac_hi=
2146                           break
2147                         fi
2148                         as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
2149 fi
2150 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2151   done
2152 else
2153   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2154 /* end confdefs.h.  */
2155 $4
2156 int
2157 main ()
2158 {
2159 static int test_array [1 - 2 * !(($2) < 0)];
2160 test_array [0] = 0;
2161 return test_array [0];
2162
2163   ;
2164   return 0;
2165 }
2166 _ACEOF
2167 if ac_fn_c_try_compile "$LINENO"; then :
2168   ac_hi=-1 ac_mid=-1
2169   while :; do
2170     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2171 /* end confdefs.h.  */
2172 $4
2173 int
2174 main ()
2175 {
2176 static int test_array [1 - 2 * !(($2) >= $ac_mid)];
2177 test_array [0] = 0;
2178 return test_array [0];
2179
2180   ;
2181   return 0;
2182 }
2183 _ACEOF
2184 if ac_fn_c_try_compile "$LINENO"; then :
2185   ac_lo=$ac_mid; break
2186 else
2187   as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
2188                         if test $ac_mid -le $ac_hi; then
2189                           ac_lo= ac_hi=
2190                           break
2191                         fi
2192                         as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
2193 fi
2194 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2195   done
2196 else
2197   ac_lo= ac_hi=
2198 fi
2199 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2200 fi
2201 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2202 # Binary search between lo and hi bounds.
2203 while test "x$ac_lo" != "x$ac_hi"; do
2204   as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
2205   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2206 /* end confdefs.h.  */
2207 $4
2208 int
2209 main ()
2210 {
2211 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
2212 test_array [0] = 0;
2213 return test_array [0];
2214
2215   ;
2216   return 0;
2217 }
2218 _ACEOF
2219 if ac_fn_c_try_compile "$LINENO"; then :
2220   ac_hi=$ac_mid
2221 else
2222   as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
2223 fi
2224 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2225 done
2226 case $ac_lo in #((
2227 ?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
2228 '') ac_retval=1 ;;
2229 esac
2230   else
2231     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2232 /* end confdefs.h.  */
2233 $4
2234 static long int longval () { return $2; }
2235 static unsigned long int ulongval () { return $2; }
2236 #include <stdio.h>
2237 #include <stdlib.h>
2238 int
2239 main ()
2240 {
2241
2242   FILE *f = fopen ("conftest.val", "w");
2243   if (! f)
2244     return 1;
2245   if (($2) < 0)
2246     {
2247       long int i = longval ();
2248       if (i != ($2))
2249         return 1;
2250       fprintf (f, "%ld", i);
2251     }
2252   else
2253     {
2254       unsigned long int i = ulongval ();
2255       if (i != ($2))
2256         return 1;
2257       fprintf (f, "%lu", i);
2258     }
2259   /* Do not output a trailing newline, as this causes \r\n confusion
2260      on some platforms.  */
2261   return ferror (f) || fclose (f) != 0;
2262
2263   ;
2264   return 0;
2265 }
2266 _ACEOF
2267 if ac_fn_c_try_run "$LINENO"; then :
2268   echo >>conftest.val; read $3 <conftest.val; ac_retval=0
2269 else
2270   ac_retval=1
2271 fi
2272 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
2273   conftest.$ac_objext conftest.beam conftest.$ac_ext
2274 rm -f conftest.val
2275
2276   fi
2277   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2278   as_fn_set_status $ac_retval
2279
2280 } # ac_fn_c_compute_int
2281
2282 # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
2283 # ---------------------------------------------
2284 # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
2285 # accordingly.
2286 ac_fn_c_check_decl ()
2287 {
2288   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2289   as_decl_name=`echo $2|sed 's/ *(.*//'`
2290   as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
2291   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
2292 $as_echo_n "checking whether $as_decl_name is declared... " >&6; }
2293 if eval \${$3+:} false; then :
2294   $as_echo_n "(cached) " >&6
2295 else
2296   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2297 /* end confdefs.h.  */
2298 $4
2299 int
2300 main ()
2301 {
2302 #ifndef $as_decl_name
2303 #ifdef __cplusplus
2304   (void) $as_decl_use;
2305 #else
2306   (void) $as_decl_name;
2307 #endif
2308 #endif
2309
2310   ;
2311   return 0;
2312 }
2313 _ACEOF
2314 if ac_fn_c_try_compile "$LINENO"; then :
2315   eval "$3=yes"
2316 else
2317   eval "$3=no"
2318 fi
2319 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2320 fi
2321 eval ac_res=\$$3
2322                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2323 $as_echo "$ac_res" >&6; }
2324   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2325
2326 } # ac_fn_c_check_decl
2327 cat >config.log <<_ACEOF
2328 This file contains any messages produced by compilers while
2329 running configure, to aid debugging if configure makes a mistake.
2330
2331 It was created by PostgreSQL $as_me 10devel, which was
2332 generated by GNU Autoconf 2.69.  Invocation command line was
2333
2334   $ $0 $@
2335
2336 _ACEOF
2337 exec 5>>config.log
2338 {
2339 cat <<_ASUNAME
2340 ## --------- ##
2341 ## Platform. ##
2342 ## --------- ##
2343
2344 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
2345 uname -m = `(uname -m) 2>/dev/null || echo unknown`
2346 uname -r = `(uname -r) 2>/dev/null || echo unknown`
2347 uname -s = `(uname -s) 2>/dev/null || echo unknown`
2348 uname -v = `(uname -v) 2>/dev/null || echo unknown`
2349
2350 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
2351 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
2352
2353 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
2354 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
2355 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
2356 /usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
2357 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
2358 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
2359 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
2360
2361 _ASUNAME
2362
2363 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2364 for as_dir in $PATH
2365 do
2366   IFS=$as_save_IFS
2367   test -z "$as_dir" && as_dir=.
2368     $as_echo "PATH: $as_dir"
2369   done
2370 IFS=$as_save_IFS
2371
2372 } >&5
2373
2374 cat >&5 <<_ACEOF
2375
2376
2377 ## ----------- ##
2378 ## Core tests. ##
2379 ## ----------- ##
2380
2381 _ACEOF
2382
2383
2384 # Keep a trace of the command line.
2385 # Strip out --no-create and --no-recursion so they do not pile up.
2386 # Strip out --silent because we don't want to record it for future runs.
2387 # Also quote any args containing shell meta-characters.
2388 # Make two passes to allow for proper duplicate-argument suppression.
2389 ac_configure_args=
2390 ac_configure_args0=
2391 ac_configure_args1=
2392 ac_must_keep_next=false
2393 for ac_pass in 1 2
2394 do
2395   for ac_arg
2396   do
2397     case $ac_arg in
2398     -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
2399     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
2400     | -silent | --silent | --silen | --sile | --sil)
2401       continue ;;
2402     *\'*)
2403       ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
2404     esac
2405     case $ac_pass in
2406     1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2407     2)
2408       as_fn_append ac_configure_args1 " '$ac_arg'"
2409       if test $ac_must_keep_next = true; then
2410         ac_must_keep_next=false # Got value, back to normal.
2411       else
2412         case $ac_arg in
2413           *=* | --config-cache | -C | -disable-* | --disable-* \
2414           | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
2415           | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
2416           | -with-* | --with-* | -without-* | --without-* | --x)
2417             case "$ac_configure_args0 " in
2418               "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
2419             esac
2420             ;;
2421           -* ) ac_must_keep_next=true ;;
2422         esac
2423       fi
2424       as_fn_append ac_configure_args " '$ac_arg'"
2425       ;;
2426     esac
2427   done
2428 done
2429 { ac_configure_args0=; unset ac_configure_args0;}
2430 { ac_configure_args1=; unset ac_configure_args1;}
2431
2432 # When interrupted or exit'd, cleanup temporary files, and complete
2433 # config.log.  We remove comments because anyway the quotes in there
2434 # would cause problems or look ugly.
2435 # WARNING: Use '\'' to represent an apostrophe within the trap.
2436 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
2437 trap 'exit_status=$?
2438   # Save into config.log some information that might help in debugging.
2439   {
2440     echo
2441
2442     $as_echo "## ---------------- ##
2443 ## Cache variables. ##
2444 ## ---------------- ##"
2445     echo
2446     # The following way of writing the cache mishandles newlines in values,
2447 (
2448   for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
2449     eval ac_val=\$$ac_var
2450     case $ac_val in #(
2451     *${as_nl}*)
2452       case $ac_var in #(
2453       *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
2454 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2455       esac
2456       case $ac_var in #(
2457       _ | IFS | as_nl) ;; #(
2458       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
2459       *) { eval $ac_var=; unset $ac_var;} ;;
2460       esac ;;
2461     esac
2462   done
2463   (set) 2>&1 |
2464     case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
2465     *${as_nl}ac_space=\ *)
2466       sed -n \
2467         "s/'\''/'\''\\\\'\'''\''/g;
2468           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
2469       ;; #(
2470     *)
2471       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
2472       ;;
2473     esac |
2474     sort
2475 )
2476     echo
2477
2478     $as_echo "## ----------------- ##
2479 ## Output variables. ##
2480 ## ----------------- ##"
2481     echo
2482     for ac_var in $ac_subst_vars
2483     do
2484       eval ac_val=\$$ac_var
2485       case $ac_val in
2486       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2487       esac
2488       $as_echo "$ac_var='\''$ac_val'\''"
2489     done | sort
2490     echo
2491
2492     if test -n "$ac_subst_files"; then
2493       $as_echo "## ------------------- ##
2494 ## File substitutions. ##
2495 ## ------------------- ##"
2496       echo
2497       for ac_var in $ac_subst_files
2498       do
2499         eval ac_val=\$$ac_var
2500         case $ac_val in
2501         *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2502         esac
2503         $as_echo "$ac_var='\''$ac_val'\''"
2504       done | sort
2505       echo
2506     fi
2507
2508     if test -s confdefs.h; then
2509       $as_echo "## ----------- ##
2510 ## confdefs.h. ##
2511 ## ----------- ##"
2512       echo
2513       cat confdefs.h
2514       echo
2515     fi
2516     test "$ac_signal" != 0 &&
2517       $as_echo "$as_me: caught signal $ac_signal"
2518     $as_echo "$as_me: exit $exit_status"
2519   } >&5
2520   rm -f core *.core core.conftest.* &&
2521     rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
2522     exit $exit_status
2523 ' 0
2524 for ac_signal in 1 2 13 15; do
2525   trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
2526 done
2527 ac_signal=0
2528
2529 # confdefs.h avoids OS command line length limits that DEFS can exceed.
2530 rm -f -r conftest* confdefs.h
2531
2532 $as_echo "/* confdefs.h */" > confdefs.h
2533
2534 # Predefined preprocessor variables.
2535
2536 cat >>confdefs.h <<_ACEOF
2537 #define PACKAGE_NAME "$PACKAGE_NAME"
2538 _ACEOF
2539
2540 cat >>confdefs.h <<_ACEOF
2541 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
2542 _ACEOF
2543
2544 cat >>confdefs.h <<_ACEOF
2545 #define PACKAGE_VERSION "$PACKAGE_VERSION"
2546 _ACEOF
2547
2548 cat >>confdefs.h <<_ACEOF
2549 #define PACKAGE_STRING "$PACKAGE_STRING"
2550 _ACEOF
2551
2552 cat >>confdefs.h <<_ACEOF
2553 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
2554 _ACEOF
2555
2556 cat >>confdefs.h <<_ACEOF
2557 #define PACKAGE_URL "$PACKAGE_URL"
2558 _ACEOF
2559
2560
2561 # Let the site file select an alternate cache file if it wants to.
2562 # Prefer an explicitly selected file to automatically selected ones.
2563 ac_site_file1=NONE
2564 ac_site_file2=NONE
2565 if test -n "$CONFIG_SITE"; then
2566   # We do not want a PATH search for config.site.
2567   case $CONFIG_SITE in #((
2568     -*)  ac_site_file1=./$CONFIG_SITE;;
2569     */*) ac_site_file1=$CONFIG_SITE;;
2570     *)   ac_site_file1=./$CONFIG_SITE;;
2571   esac
2572 elif test "x$prefix" != xNONE; then
2573   ac_site_file1=$prefix/share/config.site
2574   ac_site_file2=$prefix/etc/config.site
2575 else
2576   ac_site_file1=$ac_default_prefix/share/config.site
2577   ac_site_file2=$ac_default_prefix/etc/config.site
2578 fi
2579 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
2580 do
2581   test "x$ac_site_file" = xNONE && continue
2582   if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
2583     { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2584 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
2585     sed 's/^/| /' "$ac_site_file" >&5
2586     . "$ac_site_file" \
2587       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2588 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2589 as_fn_error $? "failed to load site script $ac_site_file
2590 See \`config.log' for more details" "$LINENO" 5; }
2591   fi
2592 done
2593
2594 if test -r "$cache_file"; then
2595   # Some versions of bash will fail to source /dev/null (special files
2596   # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
2597   if test /dev/null != "$cache_file" && test -f "$cache_file"; then
2598     { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
2599 $as_echo "$as_me: loading cache $cache_file" >&6;}
2600     case $cache_file in
2601       [\\/]* | ?:[\\/]* ) . "$cache_file";;
2602       *)                      . "./$cache_file";;
2603     esac
2604   fi
2605 else
2606   { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
2607 $as_echo "$as_me: creating cache $cache_file" >&6;}
2608   >$cache_file
2609 fi
2610
2611 # Check that the precious variables saved in the cache have kept the same
2612 # value.
2613 ac_cache_corrupted=false
2614 for ac_var in $ac_precious_vars; do
2615   eval ac_old_set=\$ac_cv_env_${ac_var}_set
2616   eval ac_new_set=\$ac_env_${ac_var}_set
2617   eval ac_old_val=\$ac_cv_env_${ac_var}_value
2618   eval ac_new_val=\$ac_env_${ac_var}_value
2619   case $ac_old_set,$ac_new_set in
2620     set,)
2621       { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
2622 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
2623       ac_cache_corrupted=: ;;
2624     ,set)
2625       { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
2626 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
2627       ac_cache_corrupted=: ;;
2628     ,);;
2629     *)
2630       if test "x$ac_old_val" != "x$ac_new_val"; then
2631         # differences in whitespace do not lead to failure.
2632         ac_old_val_w=`echo x $ac_old_val`
2633         ac_new_val_w=`echo x $ac_new_val`
2634         if test "$ac_old_val_w" != "$ac_new_val_w"; then
2635           { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
2636 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
2637           ac_cache_corrupted=:
2638         else
2639           { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
2640 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
2641           eval $ac_var=\$ac_old_val
2642         fi
2643         { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
2644 $as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
2645         { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
2646 $as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
2647       fi;;
2648   esac
2649   # Pass precious variables to config.status.
2650   if test "$ac_new_set" = set; then
2651     case $ac_new_val in
2652     *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
2653     *) ac_arg=$ac_var=$ac_new_val ;;
2654     esac
2655     case " $ac_configure_args " in
2656       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
2657       *) as_fn_append ac_configure_args " '$ac_arg'" ;;
2658     esac
2659   fi
2660 done
2661 if $ac_cache_corrupted; then
2662   { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2663 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2664   { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
2665 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
2666   as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
2667 fi
2668 ## -------------------- ##
2669 ## Main body of script. ##
2670 ## -------------------- ##
2671
2672 ac_ext=c
2673 ac_cpp='$CPP $CPPFLAGS'
2674 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2675 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2676 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2677
2678
2679
2680
2681
2682
2683 ac_aux_dir=
2684 for ac_dir in config "$srcdir"/config; do
2685   if test -f "$ac_dir/install-sh"; then
2686     ac_aux_dir=$ac_dir
2687     ac_install_sh="$ac_aux_dir/install-sh -c"
2688     break
2689   elif test -f "$ac_dir/install.sh"; then
2690     ac_aux_dir=$ac_dir
2691     ac_install_sh="$ac_aux_dir/install.sh -c"
2692     break
2693   elif test -f "$ac_dir/shtool"; then
2694     ac_aux_dir=$ac_dir
2695     ac_install_sh="$ac_aux_dir/shtool install -c"
2696     break
2697   fi
2698 done
2699 if test -z "$ac_aux_dir"; then
2700   as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5
2701 fi
2702
2703 # These three variables are undocumented and unsupported,
2704 # and are intended to be withdrawn in a future Autoconf release.
2705 # They can cause serious problems if a builder's source tree is in a directory
2706 # whose full name contains unusual characters.
2707 ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
2708 ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
2709 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
2710
2711
2712
2713 configure_args=$ac_configure_args
2714
2715
2716 PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`
2717
2718
2719 cat >>confdefs.h <<_ACEOF
2720 #define PG_MAJORVERSION "$PG_MAJORVERSION"
2721 _ACEOF
2722
2723
2724
2725
2726
2727 # Check whether --with-extra-version was given.
2728 if test "${with_extra_version+set}" = set; then :
2729   withval=$with_extra_version;
2730   case $withval in
2731     yes)
2732       as_fn_error $? "argument required for --with-extra-version option" "$LINENO" 5
2733       ;;
2734     no)
2735       as_fn_error $? "argument required for --with-extra-version option" "$LINENO" 5
2736       ;;
2737     *)
2738       PG_VERSION="$PACKAGE_VERSION$withval"
2739       ;;
2740   esac
2741
2742 else
2743   PG_VERSION="$PACKAGE_VERSION"
2744 fi
2745
2746
2747
2748 cat >>confdefs.h <<_ACEOF
2749 #define PG_VERSION "$PG_VERSION"
2750 _ACEOF
2751
2752
2753 # Make sure we can run config.sub.
2754 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
2755   as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
2756
2757 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
2758 $as_echo_n "checking build system type... " >&6; }
2759 if ${ac_cv_build+:} false; then :
2760   $as_echo_n "(cached) " >&6
2761 else
2762   ac_build_alias=$build_alias
2763 test "x$ac_build_alias" = x &&
2764   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
2765 test "x$ac_build_alias" = x &&
2766   as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
2767 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
2768   as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
2769
2770 fi
2771 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
2772 $as_echo "$ac_cv_build" >&6; }
2773 case $ac_cv_build in
2774 *-*-*) ;;
2775 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
2776 esac
2777 build=$ac_cv_build
2778 ac_save_IFS=$IFS; IFS='-'
2779 set x $ac_cv_build
2780 shift
2781 build_cpu=$1
2782 build_vendor=$2
2783 shift; shift
2784 # Remember, the first character of IFS is used to create $*,
2785 # except with old shells:
2786 build_os=$*
2787 IFS=$ac_save_IFS
2788 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
2789
2790
2791 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
2792 $as_echo_n "checking host system type... " >&6; }
2793 if ${ac_cv_host+:} false; then :
2794   $as_echo_n "(cached) " >&6
2795 else
2796   if test "x$host_alias" = x; then
2797   ac_cv_host=$ac_cv_build
2798 else
2799   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
2800     as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
2801 fi
2802
2803 fi
2804 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
2805 $as_echo "$ac_cv_host" >&6; }
2806 case $ac_cv_host in
2807 *-*-*) ;;
2808 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
2809 esac
2810 host=$ac_cv_host
2811 ac_save_IFS=$IFS; IFS='-'
2812 set x $ac_cv_host
2813 shift
2814 host_cpu=$1
2815 host_vendor=$2
2816 shift; shift
2817 # Remember, the first character of IFS is used to create $*,
2818 # except with old shells:
2819 host_os=$*
2820 IFS=$ac_save_IFS
2821 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
2822
2823
2824
2825 template=
2826 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which template to use" >&5
2827 $as_echo_n "checking which template to use... " >&6; }
2828
2829
2830
2831
2832 # Check whether --with-template was given.
2833 if test "${with_template+set}" = set; then :
2834   withval=$with_template;
2835   case $withval in
2836     yes)
2837       as_fn_error $? "argument required for --with-template option" "$LINENO" 5
2838       ;;
2839     no)
2840       as_fn_error $? "argument required for --with-template option" "$LINENO" 5
2841       ;;
2842     *)
2843
2844   case $withval in
2845     list)   echo; ls "$srcdir/src/template"; exit;;
2846     *)      if test -f "$srcdir/src/template/$with_template" ; then
2847               template=$withval
2848             else
2849               as_fn_error $? "'$withval' is not a valid template name. Use 'list' for a list." "$LINENO" 5
2850             fi;;
2851   esac
2852
2853       ;;
2854   esac
2855
2856 else
2857
2858 # --with-template not given
2859
2860 case $host_os in
2861      aix*) template=aix ;;
2862   cygwin*) template=cygwin ;;
2863   darwin*) template=darwin ;;
2864 dragonfly*) template=netbsd ;;
2865  freebsd*) template=freebsd ;;
2866     hpux*) template=hpux ;;
2867  linux*|gnu*|k*bsd*-gnu)
2868            template=linux ;;
2869    mingw*) template=win32 ;;
2870   netbsd*) template=netbsd ;;
2871  openbsd*) template=openbsd ;;
2872  solaris*) template=solaris ;;
2873 esac
2874
2875   if test x"$template" = x"" ; then
2876     as_fn_error $? "
2877 *******************************************************************
2878 PostgreSQL has apparently not been ported to your platform yet.
2879 To try a manual configuration, look into the src/template directory
2880 for a similar platform and use the '--with-template=' option.
2881
2882 Please also contact <pgsql-bugs@postgresql.org> to see about
2883 rectifying this.  Include the above 'checking host system type...'
2884 line.
2885 *******************************************************************
2886 " "$LINENO" 5
2887   fi
2888
2889
2890 fi
2891
2892
2893
2894 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $template" >&5
2895 $as_echo "$template" >&6; }
2896
2897 PORTNAME=$template
2898
2899
2900 # Initialize default assumption that we do not need separate assembly code
2901 # for TAS (test-and-set).  This can be overridden by the template file
2902 # when it's executed.
2903 need_tas=no
2904 tas_file=dummy.s
2905
2906
2907
2908 ##
2909 ## Command line options
2910 ##
2911
2912 #
2913 # Add non-standard directories to the include path
2914 #
2915
2916
2917
2918 # Check whether --with-includes was given.
2919 if test "${with_includes+set}" = set; then :
2920   withval=$with_includes;
2921   case $withval in
2922     yes)
2923       as_fn_error $? "argument required for --with-includes option" "$LINENO" 5
2924       ;;
2925     no)
2926       as_fn_error $? "argument required for --with-includes option" "$LINENO" 5
2927       ;;
2928     *)
2929
2930       ;;
2931   esac
2932
2933 fi
2934
2935
2936
2937
2938 #
2939 # Add non-standard directories to the library search path
2940 #
2941
2942
2943
2944 # Check whether --with-libraries was given.
2945 if test "${with_libraries+set}" = set; then :
2946   withval=$with_libraries;
2947   case $withval in
2948     yes)
2949       as_fn_error $? "argument required for --with-libraries option" "$LINENO" 5
2950       ;;
2951     no)
2952       as_fn_error $? "argument required for --with-libraries option" "$LINENO" 5
2953       ;;
2954     *)
2955       LIBRARY_DIRS=$withval
2956       ;;
2957   esac
2958
2959 fi
2960
2961
2962
2963
2964
2965
2966 # Check whether --with-libs was given.
2967 if test "${with_libs+set}" = set; then :
2968   withval=$with_libs;
2969   case $withval in
2970     yes)
2971       as_fn_error $? "argument required for --with-libs option" "$LINENO" 5
2972       ;;
2973     no)
2974       as_fn_error $? "argument required for --with-libs option" "$LINENO" 5
2975       ;;
2976     *)
2977       LIBRARY_DIRS=$withval
2978       ;;
2979   esac
2980
2981 fi
2982
2983
2984
2985
2986 #
2987 # 64-bit integer date/time storage is now the only option, but to avoid
2988 # unnecessary breakage of build scripts, continue to accept an explicit
2989 # "--enable-integer-datetimes" switch.
2990 #
2991
2992
2993 # Check whether --enable-integer-datetimes was given.
2994 if test "${enable_integer_datetimes+set}" = set; then :
2995   enableval=$enable_integer_datetimes;
2996   case $enableval in
2997     yes)
2998       :
2999       ;;
3000     no)
3001       as_fn_error $? "--disable-integer-datetimes is no longer supported" "$LINENO" 5
3002       ;;
3003     *)
3004       as_fn_error $? "no argument expected for --enable-integer-datetimes option" "$LINENO" 5
3005       ;;
3006   esac
3007
3008 else
3009   enable_integer_datetimes=yes
3010
3011 fi
3012
3013
3014
3015
3016 #
3017 # NLS
3018 #
3019 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is wanted" >&5
3020 $as_echo_n "checking whether NLS is wanted... " >&6; }
3021
3022
3023 # Check whether --enable-nls was given.
3024 if test "${enable_nls+set}" = set; then :
3025   enableval=$enable_nls;
3026   case $enableval in
3027     yes)
3028       :
3029       ;;
3030     no)
3031       :
3032       ;;
3033     *)
3034       enable_nls=yes
3035 WANTED_LANGUAGES=$enableval
3036       ;;
3037   esac
3038
3039 else
3040   enable_nls=no
3041 fi
3042
3043
3044
3045 if test "$enable_nls" = yes; then
3046
3047 $as_echo "#define ENABLE_NLS 1" >>confdefs.h
3048
3049 fi
3050
3051 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_nls" >&5
3052 $as_echo "$enable_nls" >&6; }
3053
3054
3055
3056 #
3057 # Default port number (--with-pgport), default 5432
3058 #
3059 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for default port number" >&5
3060 $as_echo_n "checking for default port number... " >&6; }
3061
3062
3063
3064 # Check whether --with-pgport was given.
3065 if test "${with_pgport+set}" = set; then :
3066   withval=$with_pgport;
3067   case $withval in
3068     yes)
3069       as_fn_error $? "argument required for --with-pgport option" "$LINENO" 5
3070       ;;
3071     no)
3072       as_fn_error $? "argument required for --with-pgport option" "$LINENO" 5
3073       ;;
3074     *)
3075       default_port=$withval
3076       ;;
3077   esac
3078
3079 else
3080   default_port=5432
3081 fi
3082
3083
3084 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $default_port" >&5
3085 $as_echo "$default_port" >&6; }
3086 # Need both of these because some places want an integer and some a string
3087
3088 cat >>confdefs.h <<_ACEOF
3089 #define DEF_PGPORT ${default_port}
3090 _ACEOF
3091
3092
3093 cat >>confdefs.h <<_ACEOF
3094 #define DEF_PGPORT_STR "${default_port}"
3095 _ACEOF
3096
3097
3098
3099 # It's worth validating port; you can get very confusing errors otherwise
3100 if test x"$default_port" = x""; then
3101   as_fn_error $? "invalid --with-pgport specification: empty string" "$LINENO" 5
3102 elif test ! x`echo "$default_port" | sed -e 's/[0-9]*//'` = x""; then
3103   as_fn_error $? "invalid --with-pgport specification: must be a number" "$LINENO" 5
3104 elif test ! x`echo "$default_port" | sed -e 's/^0.//'` = x"$default_port"; then
3105   as_fn_error $? "invalid --with-pgport specification: must not have leading 0" "$LINENO" 5
3106 elif test "$default_port" -lt "1" -o "$default_port" -gt "65535"; then
3107   as_fn_error $? "invalid --with-pgport specification: must be between 1 and 65535" "$LINENO" 5
3108 fi
3109
3110 #
3111 # '-rpath'-like feature can be disabled
3112 #
3113
3114
3115 # Check whether --enable-rpath was given.
3116 if test "${enable_rpath+set}" = set; then :
3117   enableval=$enable_rpath;
3118   case $enableval in
3119     yes)
3120       :
3121       ;;
3122     no)
3123       :
3124       ;;
3125     *)
3126       as_fn_error $? "no argument expected for --enable-rpath option" "$LINENO" 5
3127       ;;
3128   esac
3129
3130 else
3131   enable_rpath=yes
3132
3133 fi
3134
3135
3136
3137
3138 #
3139 # Spinlocks
3140 #
3141
3142
3143 # Check whether --enable-spinlocks was given.
3144 if test "${enable_spinlocks+set}" = set; then :
3145   enableval=$enable_spinlocks;
3146   case $enableval in
3147     yes)
3148       :
3149       ;;
3150     no)
3151       :
3152       ;;
3153     *)
3154       as_fn_error $? "no argument expected for --enable-spinlocks option" "$LINENO" 5
3155       ;;
3156   esac
3157
3158 else
3159   enable_spinlocks=yes
3160
3161 fi
3162
3163
3164
3165 #
3166 # Atomic operations
3167 #
3168
3169
3170 # Check whether --enable-atomics was given.
3171 if test "${enable_atomics+set}" = set; then :
3172   enableval=$enable_atomics;
3173   case $enableval in
3174     yes)
3175       :
3176       ;;
3177     no)
3178       :
3179       ;;
3180     *)
3181       as_fn_error $? "no argument expected for --enable-atomics option" "$LINENO" 5
3182       ;;
3183   esac
3184
3185 else
3186   enable_atomics=yes
3187
3188 fi
3189
3190
3191
3192 #
3193 # Random number generation
3194 #
3195
3196
3197 # Check whether --enable-strong-random was given.
3198 if test "${enable_strong_random+set}" = set; then :
3199   enableval=$enable_strong_random;
3200   case $enableval in
3201     yes)
3202       :
3203       ;;
3204     no)
3205       :
3206       ;;
3207     *)
3208       as_fn_error $? "no argument expected for --enable-strong-random option" "$LINENO" 5
3209       ;;
3210   esac
3211
3212 else
3213   enable_strong_random=yes
3214
3215 fi
3216
3217
3218
3219
3220 #
3221 # --enable-debug adds -g to compiler flags
3222 #
3223
3224
3225 # Check whether --enable-debug was given.
3226 if test "${enable_debug+set}" = set; then :
3227   enableval=$enable_debug;
3228   case $enableval in
3229     yes)
3230       :
3231       ;;
3232     no)
3233       :
3234       ;;
3235     *)
3236       as_fn_error $? "no argument expected for --enable-debug option" "$LINENO" 5
3237       ;;
3238   esac
3239
3240 else
3241   enable_debug=no
3242
3243 fi
3244
3245
3246
3247
3248 #
3249 # --enable-profiling enables gcc profiling
3250 #
3251
3252
3253 # Check whether --enable-profiling was given.
3254 if test "${enable_profiling+set}" = set; then :
3255   enableval=$enable_profiling;
3256   case $enableval in
3257     yes)
3258       :
3259       ;;
3260     no)
3261       :
3262       ;;
3263     *)
3264       as_fn_error $? "no argument expected for --enable-profiling option" "$LINENO" 5
3265       ;;
3266   esac
3267
3268 else
3269   enable_profiling=no
3270
3271 fi
3272
3273
3274
3275 #
3276 # --enable-coverage enables generation of code coverage metrics with gcov
3277 #
3278
3279
3280 # Check whether --enable-coverage was given.
3281 if test "${enable_coverage+set}" = set; then :
3282   enableval=$enable_coverage;
3283   case $enableval in
3284     yes)
3285       for ac_prog in gcov
3286 do
3287   # Extract the first word of "$ac_prog", so it can be a program name with args.
3288 set dummy $ac_prog; ac_word=$2
3289 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3290 $as_echo_n "checking for $ac_word... " >&6; }
3291 if ${ac_cv_prog_GCOV+:} false; then :
3292   $as_echo_n "(cached) " >&6
3293 else
3294   if test -n "$GCOV"; then
3295   ac_cv_prog_GCOV="$GCOV" # Let the user override the test.
3296 else
3297 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3298 for as_dir in $PATH
3299 do
3300   IFS=$as_save_IFS
3301   test -z "$as_dir" && as_dir=.
3302     for ac_exec_ext in '' $ac_executable_extensions; do
3303   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3304     ac_cv_prog_GCOV="$ac_prog"
3305     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3306     break 2
3307   fi
3308 done
3309   done
3310 IFS=$as_save_IFS
3311
3312 fi
3313 fi
3314 GCOV=$ac_cv_prog_GCOV
3315 if test -n "$GCOV"; then
3316   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5
3317 $as_echo "$GCOV" >&6; }
3318 else
3319   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3320 $as_echo "no" >&6; }
3321 fi
3322
3323
3324   test -n "$GCOV" && break
3325 done
3326
3327 if test -z "$GCOV"; then
3328   as_fn_error $? "gcov not found" "$LINENO" 5
3329 fi
3330 for ac_prog in lcov
3331 do
3332   # Extract the first word of "$ac_prog", so it can be a program name with args.
3333 set dummy $ac_prog; ac_word=$2
3334 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3335 $as_echo_n "checking for $ac_word... " >&6; }
3336 if ${ac_cv_prog_LCOV+:} false; then :
3337   $as_echo_n "(cached) " >&6
3338 else
3339   if test -n "$LCOV"; then
3340   ac_cv_prog_LCOV="$LCOV" # Let the user override the test.
3341 else
3342 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3343 for as_dir in $PATH
3344 do
3345   IFS=$as_save_IFS
3346   test -z "$as_dir" && as_dir=.
3347     for ac_exec_ext in '' $ac_executable_extensions; do
3348   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3349     ac_cv_prog_LCOV="$ac_prog"
3350     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3351     break 2
3352   fi
3353 done
3354   done
3355 IFS=$as_save_IFS
3356
3357 fi
3358 fi
3359 LCOV=$ac_cv_prog_LCOV
3360 if test -n "$LCOV"; then
3361   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5
3362 $as_echo "$LCOV" >&6; }
3363 else
3364   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3365 $as_echo "no" >&6; }
3366 fi
3367
3368
3369   test -n "$LCOV" && break
3370 done
3371
3372 if test -z "$LCOV"; then
3373   as_fn_error $? "lcov not found" "$LINENO" 5
3374 fi
3375 for ac_prog in genhtml
3376 do
3377   # Extract the first word of "$ac_prog", so it can be a program name with args.
3378 set dummy $ac_prog; ac_word=$2
3379 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3380 $as_echo_n "checking for $ac_word... " >&6; }
3381 if ${ac_cv_prog_GENHTML+:} false; then :
3382   $as_echo_n "(cached) " >&6
3383 else
3384   if test -n "$GENHTML"; then
3385   ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test.
3386 else
3387 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3388 for as_dir in $PATH
3389 do
3390   IFS=$as_save_IFS
3391   test -z "$as_dir" && as_dir=.
3392     for ac_exec_ext in '' $ac_executable_extensions; do
3393   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3394     ac_cv_prog_GENHTML="$ac_prog"
3395     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3396     break 2
3397   fi
3398 done
3399   done
3400 IFS=$as_save_IFS
3401
3402 fi
3403 fi
3404 GENHTML=$ac_cv_prog_GENHTML
3405 if test -n "$GENHTML"; then
3406   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5
3407 $as_echo "$GENHTML" >&6; }
3408 else
3409   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3410 $as_echo "no" >&6; }
3411 fi
3412
3413
3414   test -n "$GENHTML" && break
3415 done
3416
3417 if test -z "$GENHTML"; then
3418   as_fn_error $? "genhtml not found" "$LINENO" 5
3419 fi
3420       ;;
3421     no)
3422       :
3423       ;;
3424     *)
3425       as_fn_error $? "no argument expected for --enable-coverage option" "$LINENO" 5
3426       ;;
3427   esac
3428
3429 else
3430   enable_coverage=no
3431
3432 fi
3433
3434
3435
3436
3437 #
3438 # DTrace
3439 #
3440
3441
3442 # Check whether --enable-dtrace was given.
3443 if test "${enable_dtrace+set}" = set; then :
3444   enableval=$enable_dtrace;
3445   case $enableval in
3446     yes)
3447       for ac_prog in dtrace
3448 do
3449   # Extract the first word of "$ac_prog", so it can be a program name with args.
3450 set dummy $ac_prog; ac_word=$2
3451 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3452 $as_echo_n "checking for $ac_word... " >&6; }
3453 if ${ac_cv_prog_DTRACE+:} false; then :
3454   $as_echo_n "(cached) " >&6
3455 else
3456   if test -n "$DTRACE"; then
3457   ac_cv_prog_DTRACE="$DTRACE" # Let the user override the test.
3458 else
3459 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3460 for as_dir in $PATH
3461 do
3462   IFS=$as_save_IFS
3463   test -z "$as_dir" && as_dir=.
3464     for ac_exec_ext in '' $ac_executable_extensions; do
3465   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3466     ac_cv_prog_DTRACE="$ac_prog"
3467     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3468     break 2
3469   fi
3470 done
3471   done
3472 IFS=$as_save_IFS
3473
3474 fi
3475 fi
3476 DTRACE=$ac_cv_prog_DTRACE
3477 if test -n "$DTRACE"; then
3478   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5
3479 $as_echo "$DTRACE" >&6; }
3480 else
3481   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3482 $as_echo "no" >&6; }
3483 fi
3484
3485
3486   test -n "$DTRACE" && break
3487 done
3488
3489 if test -z "$DTRACE"; then
3490   as_fn_error $? "dtrace not found" "$LINENO" 5
3491 fi
3492
3493       ;;
3494     no)
3495       :
3496       ;;
3497     *)
3498       as_fn_error $? "no argument expected for --enable-dtrace option" "$LINENO" 5
3499       ;;
3500   esac
3501
3502 else
3503   enable_dtrace=no
3504
3505 fi
3506
3507
3508
3509
3510 #
3511 # TAP tests
3512 #
3513
3514
3515 # Check whether --enable-tap-tests was given.
3516 if test "${enable_tap_tests+set}" = set; then :
3517   enableval=$enable_tap_tests;
3518   case $enableval in
3519     yes)
3520       :
3521       ;;
3522     no)
3523       :
3524       ;;
3525     *)
3526       as_fn_error $? "no argument expected for --enable-tap-tests option" "$LINENO" 5
3527       ;;
3528   esac
3529
3530 else
3531   enable_tap_tests=no
3532
3533 fi
3534
3535
3536
3537
3538 #
3539 # Block size
3540 #
3541 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for block size" >&5
3542 $as_echo_n "checking for block size... " >&6; }
3543
3544
3545
3546 # Check whether --with-blocksize was given.
3547 if test "${with_blocksize+set}" = set; then :
3548   withval=$with_blocksize;
3549   case $withval in
3550     yes)
3551       as_fn_error $? "argument required for --with-blocksize option" "$LINENO" 5
3552       ;;
3553     no)
3554       as_fn_error $? "argument required for --with-blocksize option" "$LINENO" 5
3555       ;;
3556     *)
3557       blocksize=$withval
3558       ;;
3559   esac
3560
3561 else
3562   blocksize=8
3563 fi
3564
3565
3566 case ${blocksize} in
3567   1) BLCKSZ=1024;;
3568   2) BLCKSZ=2048;;
3569   4) BLCKSZ=4096;;
3570   8) BLCKSZ=8192;;
3571  16) BLCKSZ=16384;;
3572  32) BLCKSZ=32768;;
3573   *) as_fn_error $? "Invalid block size. Allowed values are 1,2,4,8,16,32." "$LINENO" 5
3574 esac
3575 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${blocksize}kB" >&5
3576 $as_echo "${blocksize}kB" >&6; }
3577
3578
3579 cat >>confdefs.h <<_ACEOF
3580 #define BLCKSZ ${BLCKSZ}
3581 _ACEOF
3582
3583
3584 #
3585 # Relation segment size
3586 #
3587 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for segment size" >&5
3588 $as_echo_n "checking for segment size... " >&6; }
3589
3590
3591
3592 # Check whether --with-segsize was given.
3593 if test "${with_segsize+set}" = set; then :
3594   withval=$with_segsize;
3595   case $withval in
3596     yes)
3597       as_fn_error $? "argument required for --with-segsize option" "$LINENO" 5
3598       ;;
3599     no)
3600       as_fn_error $? "argument required for --with-segsize option" "$LINENO" 5
3601       ;;
3602     *)
3603       segsize=$withval
3604       ;;
3605   esac
3606
3607 else
3608   segsize=1
3609 fi
3610
3611
3612 # this expression is set up to avoid unnecessary integer overflow
3613 # blocksize is already guaranteed to be a factor of 1024
3614 RELSEG_SIZE=`expr '(' 1024 / ${blocksize} ')' '*' ${segsize} '*' 1024`
3615 test $? -eq 0 || exit 1
3616 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${segsize}GB" >&5
3617 $as_echo "${segsize}GB" >&6; }
3618
3619
3620 cat >>confdefs.h <<_ACEOF
3621 #define RELSEG_SIZE ${RELSEG_SIZE}
3622 _ACEOF
3623
3624
3625 #
3626 # WAL block size
3627 #
3628 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAL block size" >&5
3629 $as_echo_n "checking for WAL block size... " >&6; }
3630
3631
3632
3633 # Check whether --with-wal-blocksize was given.
3634 if test "${with_wal_blocksize+set}" = set; then :
3635   withval=$with_wal_blocksize;
3636   case $withval in
3637     yes)
3638       as_fn_error $? "argument required for --with-wal-blocksize option" "$LINENO" 5
3639       ;;
3640     no)
3641       as_fn_error $? "argument required for --with-wal-blocksize option" "$LINENO" 5
3642       ;;
3643     *)
3644       wal_blocksize=$withval
3645       ;;
3646   esac
3647
3648 else
3649   wal_blocksize=8
3650 fi
3651
3652
3653 case ${wal_blocksize} in
3654   1) XLOG_BLCKSZ=1024;;
3655   2) XLOG_BLCKSZ=2048;;
3656   4) XLOG_BLCKSZ=4096;;
3657   8) XLOG_BLCKSZ=8192;;
3658  16) XLOG_BLCKSZ=16384;;
3659  32) XLOG_BLCKSZ=32768;;
3660  64) XLOG_BLCKSZ=65536;;
3661   *) as_fn_error $? "Invalid WAL block size. Allowed values are 1,2,4,8,16,32,64." "$LINENO" 5
3662 esac
3663 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${wal_blocksize}kB" >&5
3664 $as_echo "${wal_blocksize}kB" >&6; }
3665
3666
3667 cat >>confdefs.h <<_ACEOF
3668 #define XLOG_BLCKSZ ${XLOG_BLCKSZ}
3669 _ACEOF
3670
3671
3672 #
3673 # WAL segment size
3674 #
3675 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAL segment size" >&5
3676 $as_echo_n "checking for WAL segment size... " >&6; }
3677
3678
3679
3680 # Check whether --with-wal-segsize was given.
3681 if test "${with_wal_segsize+set}" = set; then :
3682   withval=$with_wal_segsize;
3683   case $withval in
3684     yes)
3685       as_fn_error $? "argument required for --with-wal-segsize option" "$LINENO" 5
3686       ;;
3687     no)
3688       as_fn_error $? "argument required for --with-wal-segsize option" "$LINENO" 5
3689       ;;
3690     *)
3691       wal_segsize=$withval
3692       ;;
3693   esac
3694
3695 else
3696   wal_segsize=16
3697 fi
3698
3699
3700 case ${wal_segsize} in
3701   1) ;;
3702   2) ;;
3703   4) ;;
3704   8) ;;
3705  16) ;;
3706  32) ;;
3707  64) ;;
3708   *) as_fn_error $? "Invalid WAL segment size. Allowed values are 1,2,4,8,16,32,64." "$LINENO" 5
3709 esac
3710 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${wal_segsize}MB" >&5
3711 $as_echo "${wal_segsize}MB" >&6; }
3712
3713
3714 cat >>confdefs.h <<_ACEOF
3715 #define XLOG_SEG_SIZE (${wal_segsize} * 1024 * 1024)
3716 _ACEOF
3717
3718
3719 #
3720 # C compiler
3721 #
3722
3723 # For historical reasons you can also use --with-CC to specify the C compiler
3724 # to use, although the standard way to do this is to set the CC environment
3725 # variable.
3726
3727
3728
3729 # Check whether --with-CC was given.
3730 if test "${with_CC+set}" = set; then :
3731   withval=$with_CC;
3732   case $withval in
3733     yes)
3734       as_fn_error $? "argument required for --with-CC option" "$LINENO" 5
3735       ;;
3736     no)
3737       as_fn_error $? "argument required for --with-CC option" "$LINENO" 5
3738       ;;
3739     *)
3740       CC=$with_CC
3741       ;;
3742   esac
3743
3744 fi
3745
3746
3747
3748 case $template in
3749   aix) pgac_cc_list="gcc xlc";;
3750     *) pgac_cc_list="gcc cc";;
3751 esac
3752
3753 ac_ext=c
3754 ac_cpp='$CPP $CPPFLAGS'
3755 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3756 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3757 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3758 if test -n "$ac_tool_prefix"; then
3759   for ac_prog in $pgac_cc_list
3760   do
3761     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3762 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3763 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3764 $as_echo_n "checking for $ac_word... " >&6; }
3765 if ${ac_cv_prog_CC+:} false; then :
3766   $as_echo_n "(cached) " >&6
3767 else
3768   if test -n "$CC"; then
3769   ac_cv_prog_CC="$CC" # Let the user override the test.
3770 else
3771 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3772 for as_dir in $PATH
3773 do
3774   IFS=$as_save_IFS
3775   test -z "$as_dir" && as_dir=.
3776     for ac_exec_ext in '' $ac_executable_extensions; do
3777   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3778     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3779     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3780     break 2
3781   fi
3782 done
3783   done
3784 IFS=$as_save_IFS
3785
3786 fi
3787 fi
3788 CC=$ac_cv_prog_CC
3789 if test -n "$CC"; then
3790   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3791 $as_echo "$CC" >&6; }
3792 else
3793   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3794 $as_echo "no" >&6; }
3795 fi
3796
3797
3798     test -n "$CC" && break
3799   done
3800 fi
3801 if test -z "$CC"; then
3802   ac_ct_CC=$CC
3803   for ac_prog in $pgac_cc_list
3804 do
3805   # Extract the first word of "$ac_prog", so it can be a program name with args.
3806 set dummy $ac_prog; ac_word=$2
3807 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3808 $as_echo_n "checking for $ac_word... " >&6; }
3809 if ${ac_cv_prog_ac_ct_CC+:} false; then :
3810   $as_echo_n "(cached) " >&6
3811 else
3812   if test -n "$ac_ct_CC"; then
3813   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3814 else
3815 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3816 for as_dir in $PATH
3817 do
3818   IFS=$as_save_IFS
3819   test -z "$as_dir" && as_dir=.
3820     for ac_exec_ext in '' $ac_executable_extensions; do
3821   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3822     ac_cv_prog_ac_ct_CC="$ac_prog"
3823     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3824     break 2
3825   fi
3826 done
3827   done
3828 IFS=$as_save_IFS
3829
3830 fi
3831 fi
3832 ac_ct_CC=$ac_cv_prog_ac_ct_CC
3833 if test -n "$ac_ct_CC"; then
3834   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3835 $as_echo "$ac_ct_CC" >&6; }
3836 else
3837   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3838 $as_echo "no" >&6; }
3839 fi
3840
3841
3842   test -n "$ac_ct_CC" && break
3843 done
3844
3845   if test "x$ac_ct_CC" = x; then
3846     CC=""
3847   else
3848     case $cross_compiling:$ac_tool_warned in
3849 yes:)
3850 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3851 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3852 ac_tool_warned=yes ;;
3853 esac
3854     CC=$ac_ct_CC
3855   fi
3856 fi
3857
3858
3859 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3860 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3861 as_fn_error $? "no acceptable C compiler found in \$PATH
3862 See \`config.log' for more details" "$LINENO" 5; }
3863
3864 # Provide some information about the compiler.
3865 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
3866 set X $ac_compile
3867 ac_compiler=$2
3868 for ac_option in --version -v -V -qversion; do
3869   { { ac_try="$ac_compiler $ac_option >&5"
3870 case "(($ac_try" in
3871   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3872   *) ac_try_echo=$ac_try;;
3873 esac
3874 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3875 $as_echo "$ac_try_echo"; } >&5
3876   (eval "$ac_compiler $ac_option >&5") 2>conftest.err
3877   ac_status=$?
3878   if test -s conftest.err; then
3879     sed '10a\
3880 ... rest of stderr output deleted ...
3881          10q' conftest.err >conftest.er1
3882     cat conftest.er1 >&5
3883   fi
3884   rm -f conftest.er1 conftest.err
3885   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3886   test $ac_status = 0; }
3887 done
3888
3889 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3890 /* end confdefs.h.  */
3891
3892 int
3893 main ()
3894 {
3895
3896   ;
3897   return 0;
3898 }
3899 _ACEOF
3900 ac_clean_files_save=$ac_clean_files
3901 ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
3902 # Try to create an executable without -o first, disregard a.out.
3903 # It will help us diagnose broken compilers, and finding out an intuition
3904 # of exeext.
3905 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
3906 $as_echo_n "checking whether the C compiler works... " >&6; }
3907 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
3908
3909 # The possible output files:
3910 ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
3911
3912 ac_rmfiles=
3913 for ac_file in $ac_files
3914 do
3915   case $ac_file in
3916     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3917     * ) ac_rmfiles="$ac_rmfiles $ac_file";;
3918   esac
3919 done
3920 rm -f $ac_rmfiles
3921
3922 if { { ac_try="$ac_link_default"
3923 case "(($ac_try" in
3924   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3925   *) ac_try_echo=$ac_try;;
3926 esac
3927 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3928 $as_echo "$ac_try_echo"; } >&5
3929   (eval "$ac_link_default") 2>&5
3930   ac_status=$?
3931   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3932   test $ac_status = 0; }; then :
3933   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
3934 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
3935 # in a Makefile.  We should not override ac_cv_exeext if it was cached,
3936 # so that the user can short-circuit this test for compilers unknown to
3937 # Autoconf.
3938 for ac_file in $ac_files ''
3939 do
3940   test -f "$ac_file" || continue
3941   case $ac_file in
3942     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
3943         ;;
3944     [ab].out )
3945         # We found the default executable, but exeext='' is most
3946         # certainly right.
3947         break;;
3948     *.* )
3949         if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
3950         then :; else
3951            ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3952         fi
3953         # We set ac_cv_exeext here because the later test for it is not
3954         # safe: cross compilers may not add the suffix if given an `-o'
3955         # argument, so we may need to know it at that point already.
3956         # Even if this section looks crufty: it has the advantage of
3957         # actually working.
3958         break;;
3959     * )
3960         break;;
3961   esac
3962 done
3963 test "$ac_cv_exeext" = no && ac_cv_exeext=
3964
3965 else
3966   ac_file=''
3967 fi
3968 if test -z "$ac_file"; then :
3969   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3970 $as_echo "no" >&6; }
3971 $as_echo "$as_me: failed program was:" >&5
3972 sed 's/^/| /' conftest.$ac_ext >&5
3973
3974 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3975 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3976 as_fn_error 77 "C compiler cannot create executables
3977 See \`config.log' for more details" "$LINENO" 5; }
3978 else
3979   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3980 $as_echo "yes" >&6; }
3981 fi
3982 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
3983 $as_echo_n "checking for C compiler default output file name... " >&6; }
3984 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
3985 $as_echo "$ac_file" >&6; }
3986 ac_exeext=$ac_cv_exeext
3987
3988 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
3989 ac_clean_files=$ac_clean_files_save
3990 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
3991 $as_echo_n "checking for suffix of executables... " >&6; }
3992 if { { ac_try="$ac_link"
3993 case "(($ac_try" in
3994   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3995   *) ac_try_echo=$ac_try;;
3996 esac
3997 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3998 $as_echo "$ac_try_echo"; } >&5
3999   (eval "$ac_link") 2>&5
4000   ac_status=$?
4001   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4002   test $ac_status = 0; }; then :
4003   # If both `conftest.exe' and `conftest' are `present' (well, observable)
4004 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
4005 # work properly (i.e., refer to `conftest.exe'), while it won't with
4006 # `rm'.
4007 for ac_file in conftest.exe conftest conftest.*; do
4008   test -f "$ac_file" || continue
4009   case $ac_file in
4010     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4011     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4012           break;;
4013     * ) break;;
4014   esac
4015 done
4016 else
4017   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4018 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4019 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
4020 See \`config.log' for more details" "$LINENO" 5; }
4021 fi
4022 rm -f conftest conftest$ac_cv_exeext
4023 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
4024 $as_echo "$ac_cv_exeext" >&6; }
4025
4026 rm -f conftest.$ac_ext
4027 EXEEXT=$ac_cv_exeext
4028 ac_exeext=$EXEEXT
4029 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4030 /* end confdefs.h.  */
4031 #include <stdio.h>
4032 int
4033 main ()
4034 {
4035 FILE *f = fopen ("conftest.out", "w");
4036  return ferror (f) || fclose (f) != 0;
4037
4038   ;
4039   return 0;
4040 }
4041 _ACEOF
4042 ac_clean_files="$ac_clean_files conftest.out"
4043 # Check that the compiler produces executables we can run.  If not, either
4044 # the compiler is broken, or we cross compile.
4045 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
4046 $as_echo_n "checking whether we are cross compiling... " >&6; }
4047 if test "$cross_compiling" != yes; then
4048   { { ac_try="$ac_link"
4049 case "(($ac_try" in
4050   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4051   *) ac_try_echo=$ac_try;;
4052 esac
4053 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4054 $as_echo "$ac_try_echo"; } >&5
4055   (eval "$ac_link") 2>&5
4056   ac_status=$?
4057   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4058   test $ac_status = 0; }
4059   if { ac_try='./conftest$ac_cv_exeext'
4060   { { case "(($ac_try" in
4061   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4062   *) ac_try_echo=$ac_try;;
4063 esac
4064 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4065 $as_echo "$ac_try_echo"; } >&5
4066   (eval "$ac_try") 2>&5
4067   ac_status=$?
4068   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4069   test $ac_status = 0; }; }; then
4070     cross_compiling=no
4071   else
4072     if test "$cross_compiling" = maybe; then
4073         cross_compiling=yes
4074     else
4075         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4076 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4077 as_fn_error $? "cannot run C compiled programs.
4078 If you meant to cross compile, use \`--host'.
4079 See \`config.log' for more details" "$LINENO" 5; }
4080     fi
4081   fi
4082 fi
4083 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
4084 $as_echo "$cross_compiling" >&6; }
4085
4086 rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
4087 ac_clean_files=$ac_clean_files_save
4088 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
4089 $as_echo_n "checking for suffix of object files... " >&6; }
4090 if ${ac_cv_objext+:} false; then :
4091   $as_echo_n "(cached) " >&6
4092 else
4093   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4094 /* end confdefs.h.  */
4095
4096 int
4097 main ()
4098 {
4099
4100   ;
4101   return 0;
4102 }
4103 _ACEOF
4104 rm -f conftest.o conftest.obj
4105 if { { ac_try="$ac_compile"
4106 case "(($ac_try" in
4107   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4108   *) ac_try_echo=$ac_try;;
4109 esac
4110 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4111 $as_echo "$ac_try_echo"; } >&5
4112   (eval "$ac_compile") 2>&5
4113   ac_status=$?
4114   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4115   test $ac_status = 0; }; then :
4116   for ac_file in conftest.o conftest.obj conftest.*; do
4117   test -f "$ac_file" || continue;
4118   case $ac_file in
4119     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
4120     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
4121        break;;
4122   esac
4123 done
4124 else
4125   $as_echo "$as_me: failed program was:" >&5
4126 sed 's/^/| /' conftest.$ac_ext >&5
4127
4128 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4129 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4130 as_fn_error $? "cannot compute suffix of object files: cannot compile
4131 See \`config.log' for more details" "$LINENO" 5; }
4132 fi
4133 rm -f conftest.$ac_cv_objext conftest.$ac_ext
4134 fi
4135 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
4136 $as_echo "$ac_cv_objext" >&6; }
4137 OBJEXT=$ac_cv_objext
4138 ac_objext=$OBJEXT
4139 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
4140 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
4141 if ${ac_cv_c_compiler_gnu+:} false; then :
4142   $as_echo_n "(cached) " >&6
4143 else
4144   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4145 /* end confdefs.h.  */
4146
4147 int
4148 main ()
4149 {
4150 #ifndef __GNUC__
4151        choke me
4152 #endif
4153
4154   ;
4155   return 0;
4156 }
4157 _ACEOF
4158 if ac_fn_c_try_compile "$LINENO"; then :
4159   ac_compiler_gnu=yes
4160 else
4161   ac_compiler_gnu=no
4162 fi
4163 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4164 ac_cv_c_compiler_gnu=$ac_compiler_gnu
4165
4166 fi
4167 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4168 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
4169 if test $ac_compiler_gnu = yes; then
4170   GCC=yes
4171 else
4172   GCC=
4173 fi
4174 ac_test_CFLAGS=${CFLAGS+set}
4175 ac_save_CFLAGS=$CFLAGS
4176 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4177 $as_echo_n "checking whether $CC accepts -g... " >&6; }
4178 if ${ac_cv_prog_cc_g+:} false; then :
4179   $as_echo_n "(cached) " >&6
4180 else
4181   ac_save_c_werror_flag=$ac_c_werror_flag
4182    ac_c_werror_flag=yes
4183    ac_cv_prog_cc_g=no
4184    CFLAGS="-g"
4185    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4186 /* end confdefs.h.  */
4187
4188 int
4189 main ()
4190 {
4191
4192   ;
4193   return 0;
4194 }
4195 _ACEOF
4196 if ac_fn_c_try_compile "$LINENO"; then :
4197   ac_cv_prog_cc_g=yes
4198 else
4199   CFLAGS=""
4200       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4201 /* end confdefs.h.  */
4202
4203 int
4204 main ()
4205 {
4206
4207   ;
4208   return 0;
4209 }
4210 _ACEOF
4211 if ac_fn_c_try_compile "$LINENO"; then :
4212
4213 else
4214   ac_c_werror_flag=$ac_save_c_werror_flag
4215          CFLAGS="-g"
4216          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4217 /* end confdefs.h.  */
4218
4219 int
4220 main ()
4221 {
4222
4223   ;
4224   return 0;
4225 }
4226 _ACEOF
4227 if ac_fn_c_try_compile "$LINENO"; then :
4228   ac_cv_prog_cc_g=yes
4229 fi
4230 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4231 fi
4232 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4233 fi
4234 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4235    ac_c_werror_flag=$ac_save_c_werror_flag
4236 fi
4237 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4238 $as_echo "$ac_cv_prog_cc_g" >&6; }
4239 if test "$ac_test_CFLAGS" = set; then
4240   CFLAGS=$ac_save_CFLAGS
4241 elif test $ac_cv_prog_cc_g = yes; then
4242   if test "$GCC" = yes; then
4243     CFLAGS="-g -O2"
4244   else
4245     CFLAGS="-g"
4246   fi
4247 else
4248   if test "$GCC" = yes; then
4249     CFLAGS="-O2"
4250   else
4251     CFLAGS=
4252   fi
4253 fi
4254 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
4255 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
4256 if ${ac_cv_prog_cc_c89+:} false; then :
4257   $as_echo_n "(cached) " >&6
4258 else
4259   ac_cv_prog_cc_c89=no
4260 ac_save_CC=$CC
4261 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4262 /* end confdefs.h.  */
4263 #include <stdarg.h>
4264 #include <stdio.h>
4265 struct stat;
4266 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4267 struct buf { int x; };
4268 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4269 static char *e (p, i)
4270      char **p;
4271      int i;
4272 {
4273   return p[i];
4274 }
4275 static char *f (char * (*g) (char **, int), char **p, ...)
4276 {
4277   char *s;
4278   va_list v;
4279   va_start (v,p);
4280   s = g (p, va_arg (v,int));
4281   va_end (v);
4282   return s;
4283 }
4284
4285 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
4286    function prototypes and stuff, but not '\xHH' hex character constants.
4287    These don't provoke an error unfortunately, instead are silently treated
4288    as 'x'.  The following induces an error, until -std is added to get
4289    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
4290    array size at least.  It's necessary to write '\x00'==0 to get something
4291    that's true only with -std.  */
4292 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
4293
4294 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
4295    inside strings and character constants.  */
4296 #define FOO(x) 'x'
4297 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
4298
4299 int test (int i, double x);
4300 struct s1 {int (*f) (int a);};
4301 struct s2 {int (*f) (double a);};
4302 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4303 int argc;
4304 char **argv;
4305 int
4306 main ()
4307 {
4308 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4309   ;
4310   return 0;
4311 }
4312 _ACEOF
4313 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
4314         -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4315 do
4316   CC="$ac_save_CC $ac_arg"
4317   if ac_fn_c_try_compile "$LINENO"; then :
4318   ac_cv_prog_cc_c89=$ac_arg
4319 fi
4320 rm -f core conftest.err conftest.$ac_objext
4321   test "x$ac_cv_prog_cc_c89" != "xno" && break
4322 done
4323 rm -f conftest.$ac_ext
4324 CC=$ac_save_CC
4325
4326 fi
4327 # AC_CACHE_VAL
4328 case "x$ac_cv_prog_cc_c89" in
4329   x)
4330     { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4331 $as_echo "none needed" >&6; } ;;
4332   xno)
4333     { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4334 $as_echo "unsupported" >&6; } ;;
4335   *)
4336     CC="$CC $ac_cv_prog_cc_c89"
4337     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
4338 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
4339 esac
4340 if test "x$ac_cv_prog_cc_c89" != xno; then :
4341
4342 fi
4343
4344 ac_ext=c
4345 ac_cpp='$CPP $CPPFLAGS'
4346 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4347 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4348 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4349
4350
4351 # Check if it's Intel's compiler, which (usually) pretends to be gcc,
4352 # but has idiosyncrasies of its own.  We assume icc will define
4353 # __INTEL_COMPILER regardless of CFLAGS.
4354
4355 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4356 /* end confdefs.h.  */
4357
4358 int
4359 main ()
4360 {
4361 #ifndef __INTEL_COMPILER
4362 choke me
4363 #endif
4364   ;
4365   return 0;
4366 }
4367 _ACEOF
4368 if ac_fn_c_try_compile "$LINENO"; then :
4369   ICC=yes
4370 else
4371   ICC=no
4372 fi
4373 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4374
4375 # Check if it's Sun Studio compiler. We assume that
4376 # __SUNPRO_C will be defined for Sun Studio compilers
4377 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4378 /* end confdefs.h.  */
4379
4380 int
4381 main ()
4382 {
4383 #ifndef __SUNPRO_C
4384 choke me
4385 #endif
4386   ;
4387   return 0;
4388 }
4389 _ACEOF
4390 if ac_fn_c_try_compile "$LINENO"; then :
4391   SUN_STUDIO_CC=yes
4392 else
4393   SUN_STUDIO_CC=no
4394 fi
4395 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4396
4397
4398
4399 unset CFLAGS
4400
4401 #
4402 # Read the template
4403 #
4404 . "$srcdir/src/template/$template" || exit
4405
4406 # CFLAGS are selected so:
4407 # If the user specifies something in the environment, that is used.
4408 # else:  If the template file set something, that is used.
4409 # else:  If coverage was enabled, don't set anything.
4410 # else:  If the compiler is GCC, then we use -O2.
4411 # else:  If the compiler is something else, then we use -O, unless debugging.
4412
4413 if test "$ac_env_CFLAGS_set" = set; then
4414   CFLAGS=$ac_env_CFLAGS_value
4415 elif test "${CFLAGS+set}" = set; then
4416   : # (keep what template set)
4417 elif test "$enable_coverage" = yes; then
4418   : # no optimization by default
4419 elif test "$GCC" = yes; then
4420   CFLAGS="-O2"
4421 else
4422   # if the user selected debug mode, don't use -O
4423   if test "$enable_debug" != yes; then
4424     CFLAGS="-O"
4425   fi
4426 fi
4427
4428 # CFLAGS we determined above will be added back at the end
4429 user_CFLAGS=$CFLAGS
4430 CFLAGS=""
4431
4432 # set CFLAGS_VECTOR from the environment, if available
4433 if test "$ac_env_CFLAGS_VECTOR_set" = set; then
4434   CFLAGS_VECTOR=$ac_env_CFLAGS_VECTOR_value
4435 fi
4436
4437 # Some versions of GCC support some additional useful warning flags.
4438 # Check whether they are supported, and add them to CFLAGS if so.
4439 # ICC pretends to be GCC but it's lying; it doesn't support these flags,
4440 # but has its own.  Also check other compiler-specific flags here.
4441
4442 if test "$GCC" = yes -a "$ICC" = no; then
4443   CFLAGS="-Wall -Wmissing-prototypes -Wpointer-arith"
4444   # These work in some but not all gcc versions
4445   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wdeclaration-after-statement" >&5
4446 $as_echo_n "checking whether $CC supports -Wdeclaration-after-statement... " >&6; }
4447 if ${pgac_cv_prog_cc_cflags__Wdeclaration_after_statement+:} false; then :
4448   $as_echo_n "(cached) " >&6
4449 else
4450   pgac_save_CFLAGS=$CFLAGS
4451 CFLAGS="$pgac_save_CFLAGS -Wdeclaration-after-statement"
4452 ac_save_c_werror_flag=$ac_c_werror_flag
4453 ac_c_werror_flag=yes
4454 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4455 /* end confdefs.h.  */
4456
4457 int
4458 main ()
4459 {
4460
4461   ;
4462   return 0;
4463 }
4464 _ACEOF
4465 if ac_fn_c_try_compile "$LINENO"; then :
4466   pgac_cv_prog_cc_cflags__Wdeclaration_after_statement=yes
4467 else
4468   pgac_cv_prog_cc_cflags__Wdeclaration_after_statement=no
4469 fi
4470 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4471 ac_c_werror_flag=$ac_save_c_werror_flag
4472 CFLAGS="$pgac_save_CFLAGS"
4473 fi
4474 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" >&5
4475 $as_echo "$pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" >&6; }
4476 if test x"$pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" = x"yes"; then
4477   CFLAGS="$CFLAGS -Wdeclaration-after-statement"
4478 fi
4479
4480   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wendif-labels" >&5
4481 $as_echo_n "checking whether $CC supports -Wendif-labels... " >&6; }
4482 if ${pgac_cv_prog_cc_cflags__Wendif_labels+:} false; then :
4483   $as_echo_n "(cached) " >&6
4484 else
4485   pgac_save_CFLAGS=$CFLAGS
4486 CFLAGS="$pgac_save_CFLAGS -Wendif-labels"
4487 ac_save_c_werror_flag=$ac_c_werror_flag
4488 ac_c_werror_flag=yes
4489 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4490 /* end confdefs.h.  */
4491
4492 int
4493 main ()
4494 {
4495
4496   ;
4497   return 0;
4498 }
4499 _ACEOF
4500 if ac_fn_c_try_compile "$LINENO"; then :
4501   pgac_cv_prog_cc_cflags__Wendif_labels=yes
4502 else
4503   pgac_cv_prog_cc_cflags__Wendif_labels=no
4504 fi
4505 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4506 ac_c_werror_flag=$ac_save_c_werror_flag
4507 CFLAGS="$pgac_save_CFLAGS"
4508 fi
4509 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wendif_labels" >&5
4510 $as_echo "$pgac_cv_prog_cc_cflags__Wendif_labels" >&6; }
4511 if test x"$pgac_cv_prog_cc_cflags__Wendif_labels" = x"yes"; then
4512   CFLAGS="$CFLAGS -Wendif-labels"
4513 fi
4514
4515   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wmissing-format-attribute" >&5
4516 $as_echo_n "checking whether $CC supports -Wmissing-format-attribute... " >&6; }
4517 if ${pgac_cv_prog_cc_cflags__Wmissing_format_attribute+:} false; then :
4518   $as_echo_n "(cached) " >&6
4519 else
4520   pgac_save_CFLAGS=$CFLAGS
4521 CFLAGS="$pgac_save_CFLAGS -Wmissing-format-attribute"
4522 ac_save_c_werror_flag=$ac_c_werror_flag
4523 ac_c_werror_flag=yes
4524 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4525 /* end confdefs.h.  */
4526
4527 int
4528 main ()
4529 {
4530
4531   ;
4532   return 0;
4533 }
4534 _ACEOF
4535 if ac_fn_c_try_compile "$LINENO"; then :
4536   pgac_cv_prog_cc_cflags__Wmissing_format_attribute=yes
4537 else
4538   pgac_cv_prog_cc_cflags__Wmissing_format_attribute=no
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 CFLAGS="$pgac_save_CFLAGS"
4543 fi
4544 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wmissing_format_attribute" >&5
4545 $as_echo "$pgac_cv_prog_cc_cflags__Wmissing_format_attribute" >&6; }
4546 if test x"$pgac_cv_prog_cc_cflags__Wmissing_format_attribute" = x"yes"; then
4547   CFLAGS="$CFLAGS -Wmissing-format-attribute"
4548 fi
4549
4550   # This was included in -Wall/-Wformat in older GCC versions
4551   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wformat-security" >&5
4552 $as_echo_n "checking whether $CC supports -Wformat-security... " >&6; }
4553 if ${pgac_cv_prog_cc_cflags__Wformat_security+:} false; then :
4554   $as_echo_n "(cached) " >&6
4555 else
4556   pgac_save_CFLAGS=$CFLAGS
4557 CFLAGS="$pgac_save_CFLAGS -Wformat-security"
4558 ac_save_c_werror_flag=$ac_c_werror_flag
4559 ac_c_werror_flag=yes
4560 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4561 /* end confdefs.h.  */
4562
4563 int
4564 main ()
4565 {
4566
4567   ;
4568   return 0;
4569 }
4570 _ACEOF
4571 if ac_fn_c_try_compile "$LINENO"; then :
4572   pgac_cv_prog_cc_cflags__Wformat_security=yes
4573 else
4574   pgac_cv_prog_cc_cflags__Wformat_security=no
4575 fi
4576 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4577 ac_c_werror_flag=$ac_save_c_werror_flag
4578 CFLAGS="$pgac_save_CFLAGS"
4579 fi
4580 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wformat_security" >&5
4581 $as_echo "$pgac_cv_prog_cc_cflags__Wformat_security" >&6; }
4582 if test x"$pgac_cv_prog_cc_cflags__Wformat_security" = x"yes"; then
4583   CFLAGS="$CFLAGS -Wformat-security"
4584 fi
4585
4586   # Disable strict-aliasing rules; needed for gcc 3.3+
4587   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-strict-aliasing" >&5
4588 $as_echo_n "checking whether $CC supports -fno-strict-aliasing... " >&6; }
4589 if ${pgac_cv_prog_cc_cflags__fno_strict_aliasing+:} false; then :
4590   $as_echo_n "(cached) " >&6
4591 else
4592   pgac_save_CFLAGS=$CFLAGS
4593 CFLAGS="$pgac_save_CFLAGS -fno-strict-aliasing"
4594 ac_save_c_werror_flag=$ac_c_werror_flag
4595 ac_c_werror_flag=yes
4596 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4597 /* end confdefs.h.  */
4598
4599 int
4600 main ()
4601 {
4602
4603   ;
4604   return 0;
4605 }
4606 _ACEOF
4607 if ac_fn_c_try_compile "$LINENO"; then :
4608   pgac_cv_prog_cc_cflags__fno_strict_aliasing=yes
4609 else
4610   pgac_cv_prog_cc_cflags__fno_strict_aliasing=no
4611 fi
4612 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4613 ac_c_werror_flag=$ac_save_c_werror_flag
4614 CFLAGS="$pgac_save_CFLAGS"
4615 fi
4616 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&5
4617 $as_echo "$pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&6; }
4618 if test x"$pgac_cv_prog_cc_cflags__fno_strict_aliasing" = x"yes"; then
4619   CFLAGS="$CFLAGS -fno-strict-aliasing"
4620 fi
4621
4622   # Disable optimizations that assume no overflow; needed for gcc 4.3+
4623   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fwrapv" >&5
4624 $as_echo_n "checking whether $CC supports -fwrapv... " >&6; }
4625 if ${pgac_cv_prog_cc_cflags__fwrapv+:} false; then :
4626   $as_echo_n "(cached) " >&6
4627 else
4628   pgac_save_CFLAGS=$CFLAGS
4629 CFLAGS="$pgac_save_CFLAGS -fwrapv"
4630 ac_save_c_werror_flag=$ac_c_werror_flag
4631 ac_c_werror_flag=yes
4632 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4633 /* end confdefs.h.  */
4634
4635 int
4636 main ()
4637 {
4638
4639   ;
4640   return 0;
4641 }
4642 _ACEOF
4643 if ac_fn_c_try_compile "$LINENO"; then :
4644   pgac_cv_prog_cc_cflags__fwrapv=yes
4645 else
4646   pgac_cv_prog_cc_cflags__fwrapv=no
4647 fi
4648 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4649 ac_c_werror_flag=$ac_save_c_werror_flag
4650 CFLAGS="$pgac_save_CFLAGS"
4651 fi
4652 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fwrapv" >&5
4653 $as_echo "$pgac_cv_prog_cc_cflags__fwrapv" >&6; }
4654 if test x"$pgac_cv_prog_cc_cflags__fwrapv" = x"yes"; then
4655   CFLAGS="$CFLAGS -fwrapv"
4656 fi
4657
4658   # Disable FP optimizations that cause various errors on gcc 4.5+ or maybe 4.6+
4659   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fexcess-precision=standard" >&5
4660 $as_echo_n "checking whether $CC supports -fexcess-precision=standard... " >&6; }
4661 if ${pgac_cv_prog_cc_cflags__fexcess_precision_standard+:} false; then :
4662   $as_echo_n "(cached) " >&6
4663 else
4664   pgac_save_CFLAGS=$CFLAGS
4665 CFLAGS="$pgac_save_CFLAGS -fexcess-precision=standard"
4666 ac_save_c_werror_flag=$ac_c_werror_flag
4667 ac_c_werror_flag=yes
4668 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4669 /* end confdefs.h.  */
4670
4671 int
4672 main ()
4673 {
4674
4675   ;
4676   return 0;
4677 }
4678 _ACEOF
4679 if ac_fn_c_try_compile "$LINENO"; then :
4680   pgac_cv_prog_cc_cflags__fexcess_precision_standard=yes
4681 else
4682   pgac_cv_prog_cc_cflags__fexcess_precision_standard=no
4683 fi
4684 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4685 ac_c_werror_flag=$ac_save_c_werror_flag
4686 CFLAGS="$pgac_save_CFLAGS"
4687 fi
4688 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fexcess_precision_standard" >&5
4689 $as_echo "$pgac_cv_prog_cc_cflags__fexcess_precision_standard" >&6; }
4690 if test x"$pgac_cv_prog_cc_cflags__fexcess_precision_standard" = x"yes"; then
4691   CFLAGS="$CFLAGS -fexcess-precision=standard"
4692 fi
4693
4694   # Optimization flags for specific files that benefit from vectorization
4695   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -funroll-loops" >&5
4696 $as_echo_n "checking whether $CC supports -funroll-loops... " >&6; }
4697 if ${pgac_cv_prog_cc_cflags__funroll_loops+:} false; then :
4698   $as_echo_n "(cached) " >&6
4699 else
4700   pgac_save_CFLAGS=$CFLAGS
4701 CFLAGS="$pgac_save_CFLAGS -funroll-loops"
4702 ac_save_c_werror_flag=$ac_c_werror_flag
4703 ac_c_werror_flag=yes
4704 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4705 /* end confdefs.h.  */
4706
4707 int
4708 main ()
4709 {
4710
4711   ;
4712   return 0;
4713 }
4714 _ACEOF
4715 if ac_fn_c_try_compile "$LINENO"; then :
4716   pgac_cv_prog_cc_cflags__funroll_loops=yes
4717 else
4718   pgac_cv_prog_cc_cflags__funroll_loops=no
4719 fi
4720 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4721 ac_c_werror_flag=$ac_save_c_werror_flag
4722 CFLAGS="$pgac_save_CFLAGS"
4723 fi
4724 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__funroll_loops" >&5
4725 $as_echo "$pgac_cv_prog_cc_cflags__funroll_loops" >&6; }
4726 if test x"$pgac_cv_prog_cc_cflags__funroll_loops" = x"yes"; then
4727   CFLAGS_VECTOR="${CFLAGS_VECTOR} -funroll-loops"
4728 fi
4729
4730   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -ftree-vectorize" >&5
4731 $as_echo_n "checking whether $CC supports -ftree-vectorize... " >&6; }
4732 if ${pgac_cv_prog_cc_cflags__ftree_vectorize+:} false; then :
4733   $as_echo_n "(cached) " >&6
4734 else
4735   pgac_save_CFLAGS=$CFLAGS
4736 CFLAGS="$pgac_save_CFLAGS -ftree-vectorize"
4737 ac_save_c_werror_flag=$ac_c_werror_flag
4738 ac_c_werror_flag=yes
4739 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4740 /* end confdefs.h.  */
4741
4742 int
4743 main ()
4744 {
4745
4746   ;
4747   return 0;
4748 }
4749 _ACEOF
4750 if ac_fn_c_try_compile "$LINENO"; then :
4751   pgac_cv_prog_cc_cflags__ftree_vectorize=yes
4752 else
4753   pgac_cv_prog_cc_cflags__ftree_vectorize=no
4754 fi
4755 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4756 ac_c_werror_flag=$ac_save_c_werror_flag
4757 CFLAGS="$pgac_save_CFLAGS"
4758 fi
4759 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__ftree_vectorize" >&5
4760 $as_echo "$pgac_cv_prog_cc_cflags__ftree_vectorize" >&6; }
4761 if test x"$pgac_cv_prog_cc_cflags__ftree_vectorize" = x"yes"; then
4762   CFLAGS_VECTOR="${CFLAGS_VECTOR} -ftree-vectorize"
4763 fi
4764
4765   # We want to suppress clang's unhelpful unused-command-line-argument warnings
4766   # but gcc won't complain about unrecognized -Wno-foo switches, so we have to
4767   # test for the positive form and if that works, add the negative form
4768   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wunused-command-line-argument" >&5
4769 $as_echo_n "checking whether $CC supports -Wunused-command-line-argument... " >&6; }
4770 if ${pgac_cv_prog_cc_cflags__Wunused_command_line_argument+:} false; then :
4771   $as_echo_n "(cached) " >&6
4772 else
4773   pgac_save_CFLAGS=$CFLAGS
4774 CFLAGS="$pgac_save_CFLAGS -Wunused-command-line-argument"
4775 ac_save_c_werror_flag=$ac_c_werror_flag
4776 ac_c_werror_flag=yes
4777 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4778 /* end confdefs.h.  */
4779
4780 int
4781 main ()
4782 {
4783
4784   ;
4785   return 0;
4786 }
4787 _ACEOF
4788 if ac_fn_c_try_compile "$LINENO"; then :
4789   pgac_cv_prog_cc_cflags__Wunused_command_line_argument=yes
4790 else
4791   pgac_cv_prog_cc_cflags__Wunused_command_line_argument=no
4792 fi
4793 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4794 ac_c_werror_flag=$ac_save_c_werror_flag
4795 CFLAGS="$pgac_save_CFLAGS"
4796 fi
4797 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wunused_command_line_argument" >&5
4798 $as_echo "$pgac_cv_prog_cc_cflags__Wunused_command_line_argument" >&6; }
4799 if test x"$pgac_cv_prog_cc_cflags__Wunused_command_line_argument" = x"yes"; then
4800   NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
4801 fi
4802
4803   if test -n "$NOT_THE_CFLAGS"; then
4804     CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
4805   fi
4806 elif test "$ICC" = yes; then
4807   # Intel's compiler has a bug/misoptimization in checking for
4808   # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
4809   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mp1" >&5
4810 $as_echo_n "checking whether $CC supports -mp1... " >&6; }
4811 if ${pgac_cv_prog_cc_cflags__mp1+:} false; then :
4812   $as_echo_n "(cached) " >&6
4813 else
4814   pgac_save_CFLAGS=$CFLAGS
4815 CFLAGS="$pgac_save_CFLAGS -mp1"
4816 ac_save_c_werror_flag=$ac_c_werror_flag
4817 ac_c_werror_flag=yes
4818 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4819 /* end confdefs.h.  */
4820
4821 int
4822 main ()
4823 {
4824
4825   ;
4826   return 0;
4827 }
4828 _ACEOF
4829 if ac_fn_c_try_compile "$LINENO"; then :
4830   pgac_cv_prog_cc_cflags__mp1=yes
4831 else
4832   pgac_cv_prog_cc_cflags__mp1=no
4833 fi
4834 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4835 ac_c_werror_flag=$ac_save_c_werror_flag
4836 CFLAGS="$pgac_save_CFLAGS"
4837 fi
4838 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__mp1" >&5
4839 $as_echo "$pgac_cv_prog_cc_cflags__mp1" >&6; }
4840 if test x"$pgac_cv_prog_cc_cflags__mp1" = x"yes"; then
4841   CFLAGS="$CFLAGS -mp1"
4842 fi
4843
4844   # Make sure strict aliasing is off (though this is said to be the default)
4845   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-strict-aliasing" >&5
4846 $as_echo_n "checking whether $CC supports -fno-strict-aliasing... " >&6; }
4847 if ${pgac_cv_prog_cc_cflags__fno_strict_aliasing+:} false; then :
4848   $as_echo_n "(cached) " >&6
4849 else
4850   pgac_save_CFLAGS=$CFLAGS
4851 CFLAGS="$pgac_save_CFLAGS -fno-strict-aliasing"
4852 ac_save_c_werror_flag=$ac_c_werror_flag
4853 ac_c_werror_flag=yes
4854 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4855 /* end confdefs.h.  */
4856
4857 int
4858 main ()
4859 {
4860
4861   ;
4862   return 0;
4863 }
4864 _ACEOF
4865 if ac_fn_c_try_compile "$LINENO"; then :
4866   pgac_cv_prog_cc_cflags__fno_strict_aliasing=yes
4867 else
4868   pgac_cv_prog_cc_cflags__fno_strict_aliasing=no
4869 fi
4870 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4871 ac_c_werror_flag=$ac_save_c_werror_flag
4872 CFLAGS="$pgac_save_CFLAGS"
4873 fi
4874 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&5
4875 $as_echo "$pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&6; }
4876 if test x"$pgac_cv_prog_cc_cflags__fno_strict_aliasing" = x"yes"; then
4877   CFLAGS="$CFLAGS -fno-strict-aliasing"
4878 fi
4879
4880 elif test "$PORTNAME" = "aix"; then
4881   # AIX's xlc has to have strict aliasing turned off too
4882   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -qnoansialias" >&5
4883 $as_echo_n "checking whether $CC supports -qnoansialias... " >&6; }
4884 if ${pgac_cv_prog_cc_cflags__qnoansialias+:} false; then :
4885   $as_echo_n "(cached) " >&6
4886 else
4887   pgac_save_CFLAGS=$CFLAGS
4888 CFLAGS="$pgac_save_CFLAGS -qnoansialias"
4889 ac_save_c_werror_flag=$ac_c_werror_flag
4890 ac_c_werror_flag=yes
4891 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4892 /* end confdefs.h.  */
4893
4894 int
4895 main ()
4896 {
4897
4898   ;
4899   return 0;
4900 }
4901 _ACEOF
4902 if ac_fn_c_try_compile "$LINENO"; then :
4903   pgac_cv_prog_cc_cflags__qnoansialias=yes
4904 else
4905   pgac_cv_prog_cc_cflags__qnoansialias=no
4906 fi
4907 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4908 ac_c_werror_flag=$ac_save_c_werror_flag
4909 CFLAGS="$pgac_save_CFLAGS"
4910 fi
4911 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__qnoansialias" >&5
4912 $as_echo "$pgac_cv_prog_cc_cflags__qnoansialias" >&6; }
4913 if test x"$pgac_cv_prog_cc_cflags__qnoansialias" = x"yes"; then
4914   CFLAGS="$CFLAGS -qnoansialias"
4915 fi
4916
4917   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -qlonglong" >&5
4918 $as_echo_n "checking whether $CC supports -qlonglong... " >&6; }
4919 if ${pgac_cv_prog_cc_cflags__qlonglong+:} false; then :
4920   $as_echo_n "(cached) " >&6
4921 else
4922   pgac_save_CFLAGS=$CFLAGS
4923 CFLAGS="$pgac_save_CFLAGS -qlonglong"
4924 ac_save_c_werror_flag=$ac_c_werror_flag
4925 ac_c_werror_flag=yes
4926 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4927 /* end confdefs.h.  */
4928
4929 int
4930 main ()
4931 {
4932
4933   ;
4934   return 0;
4935 }
4936 _ACEOF
4937 if ac_fn_c_try_compile "$LINENO"; then :
4938   pgac_cv_prog_cc_cflags__qlonglong=yes
4939 else
4940   pgac_cv_prog_cc_cflags__qlonglong=no
4941 fi
4942 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4943 ac_c_werror_flag=$ac_save_c_werror_flag
4944 CFLAGS="$pgac_save_CFLAGS"
4945 fi
4946 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__qlonglong" >&5
4947 $as_echo "$pgac_cv_prog_cc_cflags__qlonglong" >&6; }
4948 if test x"$pgac_cv_prog_cc_cflags__qlonglong" = x"yes"; then
4949   CFLAGS="$CFLAGS -qlonglong"
4950 fi
4951
4952 elif test "$PORTNAME" = "hpux"; then
4953   # On some versions of HP-UX, libm functions do not set errno by default.
4954   # Fix that by using +Olibmerrno if the compiler recognizes it.
4955   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports +Olibmerrno" >&5
4956 $as_echo_n "checking whether $CC supports +Olibmerrno... " >&6; }
4957 if ${pgac_cv_prog_cc_cflags_pOlibmerrno+:} false; then :
4958   $as_echo_n "(cached) " >&6
4959 else
4960   pgac_save_CFLAGS=$CFLAGS
4961 CFLAGS="$pgac_save_CFLAGS +Olibmerrno"
4962 ac_save_c_werror_flag=$ac_c_werror_flag
4963 ac_c_werror_flag=yes
4964 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4965 /* end confdefs.h.  */
4966
4967 int
4968 main ()
4969 {
4970
4971   ;
4972   return 0;
4973 }
4974 _ACEOF
4975 if ac_fn_c_try_compile "$LINENO"; then :
4976   pgac_cv_prog_cc_cflags_pOlibmerrno=yes
4977 else
4978   pgac_cv_prog_cc_cflags_pOlibmerrno=no
4979 fi
4980 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4981 ac_c_werror_flag=$ac_save_c_werror_flag
4982 CFLAGS="$pgac_save_CFLAGS"
4983 fi
4984 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags_pOlibmerrno" >&5
4985 $as_echo "$pgac_cv_prog_cc_cflags_pOlibmerrno" >&6; }
4986 if test x"$pgac_cv_prog_cc_cflags_pOlibmerrno" = x"yes"; then
4987   CFLAGS="$CFLAGS +Olibmerrno"
4988 fi
4989
4990 fi
4991
4992 CFLAGS_VECTOR=$CFLAGS_VECTOR
4993
4994
4995 # supply -g if --enable-debug
4996 if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
4997   CFLAGS="$CFLAGS -g"
4998 fi
4999
5000 # enable code coverage if --enable-coverage
5001 if test "$enable_coverage" = yes; then
5002   if test "$GCC" = yes; then
5003     CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
5004   else
5005     as_fn_error $? "--enable-coverage is supported only when using GCC" "$LINENO" 5
5006   fi
5007 fi
5008
5009 # enable profiling if --enable-profiling
5010 if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then
5011   if test "$GCC" = yes; then
5012
5013 $as_echo "#define PROFILE_PID_DIR 1" >>confdefs.h
5014
5015     CFLAGS="$CFLAGS -pg $PLATFORM_PROFILE_FLAGS"
5016   else
5017     as_fn_error $? "--enable-profiling is supported only when using GCC" "$LINENO" 5
5018   fi
5019 fi
5020
5021 # We already have this in Makefile.win32, but configure needs it too
5022 if test "$PORTNAME" = "win32"; then
5023   CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32 -DEXEC_BACKEND"
5024 fi
5025
5026 # Now that we're done automatically adding stuff to CFLAGS, put back the
5027 # user-specified flags (if any) at the end.  This lets users override
5028 # the automatic additions.
5029 CFLAGS="$CFLAGS $user_CFLAGS"
5030
5031 # Check if the compiler still works with the final flag settings
5032 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler still works" >&5
5033 $as_echo_n "checking whether the C compiler still works... " >&6; }
5034 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5035 /* end confdefs.h.  */
5036
5037 int
5038 main ()
5039 {
5040 return 0;
5041   ;
5042   return 0;
5043 }
5044 _ACEOF
5045 if ac_fn_c_try_link "$LINENO"; then :
5046   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5047 $as_echo "yes" >&6; }
5048 else
5049   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5050 $as_echo "no" >&6; }
5051    as_fn_error $? "cannot proceed" "$LINENO" 5
5052 fi
5053 rm -f core conftest.err conftest.$ac_objext \
5054     conftest$ac_exeext conftest.$ac_ext
5055
5056 # Defend against gcc -ffast-math
5057 if test "$GCC" = yes; then
5058 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5059 /* end confdefs.h.  */
5060
5061 int
5062 main ()
5063 {
5064 #ifdef __FAST_MATH__
5065 choke me
5066 #endif
5067   ;
5068   return 0;
5069 }
5070 _ACEOF
5071 if ac_fn_c_try_compile "$LINENO"; then :
5072
5073 else
5074   as_fn_error $? "do not put -ffast-math in CFLAGS" "$LINENO" 5
5075 fi
5076 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5077 fi
5078
5079 ac_ext=c
5080 ac_cpp='$CPP $CPPFLAGS'
5081 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5082 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5083 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5084 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
5085 $as_echo_n "checking how to run the C preprocessor... " >&6; }
5086 # On Suns, sometimes $CPP names a directory.
5087 if test -n "$CPP" && test -d "$CPP"; then
5088   CPP=
5089 fi
5090 if test -z "$CPP"; then
5091   if ${ac_cv_prog_CPP+:} false; then :
5092   $as_echo_n "(cached) " >&6
5093 else
5094       # Double quotes because CPP needs to be expanded
5095     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
5096     do
5097       ac_preproc_ok=false
5098 for ac_c_preproc_warn_flag in '' yes
5099 do
5100   # Use a header file that comes with gcc, so configuring glibc
5101   # with a fresh cross-compiler works.
5102   # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5103   # <limits.h> exists even on freestanding compilers.
5104   # On the NeXT, cc -E runs the code through the compiler's parser,
5105   # not just through cpp. "Syntax error" is here to catch this case.
5106   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5107 /* end confdefs.h.  */
5108 #ifdef __STDC__
5109 # include <limits.h>
5110 #else
5111 # include <assert.h>
5112 #endif
5113                      Syntax error
5114 _ACEOF
5115 if ac_fn_c_try_cpp "$LINENO"; then :
5116
5117 else
5118   # Broken: fails on valid input.
5119 continue
5120 fi
5121 rm -f conftest.err conftest.i conftest.$ac_ext
5122
5123   # OK, works on sane cases.  Now check whether nonexistent headers
5124   # can be detected and how.
5125   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5126 /* end confdefs.h.  */
5127 #include <ac_nonexistent.h>
5128 _ACEOF
5129 if ac_fn_c_try_cpp "$LINENO"; then :
5130   # Broken: success on invalid input.
5131 continue
5132 else
5133   # Passes both tests.
5134 ac_preproc_ok=:
5135 break
5136 fi
5137 rm -f conftest.err conftest.i conftest.$ac_ext
5138
5139 done
5140 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
5141 rm -f conftest.i conftest.err conftest.$ac_ext
5142 if $ac_preproc_ok; then :
5143   break
5144 fi
5145
5146     done
5147     ac_cv_prog_CPP=$CPP
5148
5149 fi
5150   CPP=$ac_cv_prog_CPP
5151 else
5152   ac_cv_prog_CPP=$CPP
5153 fi
5154 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
5155 $as_echo "$CPP" >&6; }
5156 ac_preproc_ok=false
5157 for ac_c_preproc_warn_flag in '' yes
5158 do
5159   # Use a header file that comes with gcc, so configuring glibc
5160   # with a fresh cross-compiler works.
5161   # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5162   # <limits.h> exists even on freestanding compilers.
5163   # On the NeXT, cc -E runs the code through the compiler's parser,
5164   # not just through cpp. "Syntax error" is here to catch this case.
5165   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5166 /* end confdefs.h.  */
5167 #ifdef __STDC__
5168 # include <limits.h>
5169 #else
5170 # include <assert.h>
5171 #endif
5172                      Syntax error
5173 _ACEOF
5174 if ac_fn_c_try_cpp "$LINENO"; then :
5175
5176 else
5177   # Broken: fails on valid input.
5178 continue
5179 fi
5180 rm -f conftest.err conftest.i conftest.$ac_ext
5181
5182   # OK, works on sane cases.  Now check whether nonexistent headers
5183   # can be detected and how.
5184   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5185 /* end confdefs.h.  */
5186 #include <ac_nonexistent.h>
5187 _ACEOF
5188 if ac_fn_c_try_cpp "$LINENO"; then :
5189   # Broken: success on invalid input.
5190 continue
5191 else
5192   # Passes both tests.
5193 ac_preproc_ok=:
5194 break
5195 fi
5196 rm -f conftest.err conftest.i conftest.$ac_ext
5197
5198 done
5199 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
5200 rm -f conftest.i conftest.err conftest.$ac_ext
5201 if $ac_preproc_ok; then :
5202
5203 else
5204   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5205 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5206 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
5207 See \`config.log' for more details" "$LINENO" 5; }
5208 fi
5209
5210 ac_ext=c
5211 ac_cpp='$CPP $CPPFLAGS'
5212 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5213 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5214 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5215
5216
5217
5218
5219 #
5220 # Set up TAS assembly code if needed; the template file has now had its
5221 # chance to request this.
5222 #
5223 ac_config_links="$ac_config_links src/backend/port/tas.s:src/backend/port/tas/${tas_file}"
5224
5225
5226 if test "$need_tas" = yes ; then
5227   TAS=tas.o
5228 else
5229   TAS=""
5230 fi
5231
5232
5233
5234 #
5235 # Automatic dependency tracking
5236 #
5237
5238
5239 # Check whether --enable-depend was given.
5240 if test "${enable_depend+set}" = set; then :
5241   enableval=$enable_depend;
5242   case $enableval in
5243     yes)
5244       autodepend=yes
5245       ;;
5246     no)
5247       :
5248       ;;
5249     *)
5250       as_fn_error $? "no argument expected for --enable-depend option" "$LINENO" 5
5251       ;;
5252   esac
5253
5254 else
5255   enable_depend=no
5256
5257 fi
5258
5259
5260
5261
5262
5263 #
5264 # Enable assert checks
5265 #
5266
5267
5268 # Check whether --enable-cassert was given.
5269 if test "${enable_cassert+set}" = set; then :
5270   enableval=$enable_cassert;
5271   case $enableval in
5272     yes)
5273
5274 $as_echo "#define USE_ASSERT_CHECKING 1" >>confdefs.h
5275
5276       ;;
5277     no)
5278       :
5279       ;;
5280     *)
5281       as_fn_error $? "no argument expected for --enable-cassert option" "$LINENO" 5
5282       ;;
5283   esac
5284
5285 else
5286   enable_cassert=no
5287
5288 fi
5289
5290
5291
5292
5293 #
5294 # Include directories
5295 #
5296 ac_save_IFS=$IFS
5297 IFS="${IFS}${PATH_SEPARATOR}"
5298 # SRCH_INC comes from the template file
5299 for dir in $with_includes $SRCH_INC; do
5300   if test -d "$dir"; then
5301     INCLUDES="$INCLUDES -I$dir"
5302   else
5303     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Include directory $dir does not exist." >&5
5304 $as_echo "$as_me: WARNING: *** Include directory $dir does not exist." >&2;}
5305   fi
5306 done
5307 IFS=$ac_save_IFS
5308
5309
5310
5311 #
5312 # Library directories
5313 #
5314 ac_save_IFS=$IFS
5315 IFS="${IFS}${PATH_SEPARATOR}"
5316 # LIBRARY_DIRS comes from command line, SRCH_LIB from template file.
5317 for dir in $LIBRARY_DIRS $SRCH_LIB; do
5318   if test -d "$dir"; then
5319     LIBDIRS="$LIBDIRS -L$dir"
5320   else
5321     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Library directory $dir does not exist." >&5
5322 $as_echo "$as_me: WARNING: *** Library directory $dir does not exist." >&2;}
5323   fi
5324 done
5325 IFS=$ac_save_IFS
5326
5327 #
5328 # Enable thread-safe client libraries
5329 #
5330 { $as_echo "$as_me:${as_lineno-$LINENO}: checking allow thread-safe client libraries" >&5
5331 $as_echo_n "checking allow thread-safe client libraries... " >&6; }
5332
5333
5334 # Check whether --enable-thread-safety was given.
5335 if test "${enable_thread_safety+set}" = set; then :
5336   enableval=$enable_thread_safety;
5337   case $enableval in
5338     yes)
5339       :
5340       ;;
5341     no)
5342       :
5343       ;;
5344     *)
5345       as_fn_error $? "no argument expected for --enable-thread-safety option" "$LINENO" 5
5346       ;;
5347   esac
5348
5349 else
5350   enable_thread_safety=yes
5351
5352 fi
5353
5354
5355 if test "$enable_thread_safety" = yes; then
5356
5357 $as_echo "#define ENABLE_THREAD_SAFETY 1" >>confdefs.h
5358
5359 fi
5360 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_thread_safety" >&5
5361 $as_echo "$enable_thread_safety" >&6; }
5362
5363
5364 #
5365 # Optionally build Tcl modules (PL/Tcl)
5366 #
5367 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Tcl" >&5
5368 $as_echo_n "checking whether to build with Tcl... " >&6; }
5369
5370
5371
5372 # Check whether --with-tcl was given.
5373 if test "${with_tcl+set}" = set; then :
5374   withval=$with_tcl;
5375   case $withval in
5376     yes)
5377       :
5378       ;;
5379     no)
5380       :
5381       ;;
5382     *)
5383       as_fn_error $? "no argument expected for --with-tcl option" "$LINENO" 5
5384       ;;
5385   esac
5386
5387 else
5388   with_tcl=no
5389
5390 fi
5391
5392
5393 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_tcl" >&5
5394 $as_echo "$with_tcl" >&6; }
5395
5396
5397 # We see if the path to the Tcl/Tk configuration scripts is specified.
5398 # This will override the use of tclsh to find the paths to search.
5399
5400
5401
5402
5403 # Check whether --with-tclconfig was given.
5404 if test "${with_tclconfig+set}" = set; then :
5405   withval=$with_tclconfig;
5406   case $withval in
5407     yes)
5408       as_fn_error $? "argument required for --with-tclconfig option" "$LINENO" 5
5409       ;;
5410     no)
5411       as_fn_error $? "argument required for --with-tclconfig option" "$LINENO" 5
5412       ;;
5413     *)
5414
5415       ;;
5416   esac
5417
5418 fi
5419
5420
5421
5422 #
5423 # Optionally build Perl modules (PL/Perl)
5424 #
5425 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Perl modules" >&5
5426 $as_echo_n "checking whether to build Perl modules... " >&6; }
5427
5428
5429
5430 # Check whether --with-perl was given.
5431 if test "${with_perl+set}" = set; then :
5432   withval=$with_perl;
5433   case $withval in
5434     yes)
5435       :
5436       ;;
5437     no)
5438       :
5439       ;;
5440     *)
5441       as_fn_error $? "no argument expected for --with-perl option" "$LINENO" 5
5442       ;;
5443   esac
5444
5445 else
5446   with_perl=no
5447
5448 fi
5449
5450
5451 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_perl" >&5
5452 $as_echo "$with_perl" >&6; }
5453
5454
5455 #
5456 # Optionally build Python modules (PL/Python)
5457 #
5458 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Python modules" >&5
5459 $as_echo_n "checking whether to build Python modules... " >&6; }
5460
5461
5462
5463 # Check whether --with-python was given.
5464 if test "${with_python+set}" = set; then :
5465   withval=$with_python;
5466   case $withval in
5467     yes)
5468       :
5469       ;;
5470     no)
5471       :
5472       ;;
5473     *)
5474       as_fn_error $? "no argument expected for --with-python option" "$LINENO" 5
5475       ;;
5476   esac
5477
5478 else
5479   with_python=no
5480
5481 fi
5482
5483
5484 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_python" >&5
5485 $as_echo "$with_python" >&6; }
5486
5487
5488 #
5489 # GSSAPI
5490 #
5491 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with GSSAPI support" >&5
5492 $as_echo_n "checking whether to build with GSSAPI support... " >&6; }
5493
5494
5495
5496 # Check whether --with-gssapi was given.
5497 if test "${with_gssapi+set}" = set; then :
5498   withval=$with_gssapi;
5499   case $withval in
5500     yes)
5501
5502
5503 $as_echo "#define ENABLE_GSS 1" >>confdefs.h
5504
5505   krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab"
5506
5507       ;;
5508     no)
5509       :
5510       ;;
5511     *)
5512       as_fn_error $? "no argument expected for --with-gssapi option" "$LINENO" 5
5513       ;;
5514   esac
5515
5516 else
5517   with_gssapi=no
5518
5519 fi
5520
5521
5522 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gssapi" >&5
5523 $as_echo "$with_gssapi" >&6; }
5524
5525
5526
5527
5528
5529 #
5530 # Kerberos configuration parameters
5531 #
5532
5533
5534
5535 # Check whether --with-krb-srvnam was given.
5536 if test "${with_krb_srvnam+set}" = set; then :
5537   withval=$with_krb_srvnam;
5538   case $withval in
5539     yes)
5540       as_fn_error $? "argument required for --with-krb-srvnam option" "$LINENO" 5
5541       ;;
5542     no)
5543       as_fn_error $? "argument required for --with-krb-srvnam option" "$LINENO" 5
5544       ;;
5545     *)
5546
5547       ;;
5548   esac
5549
5550 else
5551   with_krb_srvnam="postgres"
5552 fi
5553
5554
5555
5556 cat >>confdefs.h <<_ACEOF
5557 #define PG_KRB_SRVNAM "$with_krb_srvnam"
5558 _ACEOF
5559
5560
5561
5562 #
5563 # PAM
5564 #
5565 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with PAM support" >&5
5566 $as_echo_n "checking whether to build with PAM support... " >&6; }
5567
5568
5569
5570 # Check whether --with-pam was given.
5571 if test "${with_pam+set}" = set; then :
5572   withval=$with_pam;
5573   case $withval in
5574     yes)
5575
5576 $as_echo "#define USE_PAM 1" >>confdefs.h
5577
5578       ;;
5579     no)
5580       :
5581       ;;
5582     *)
5583       as_fn_error $? "no argument expected for --with-pam option" "$LINENO" 5
5584       ;;
5585   esac
5586
5587 else
5588   with_pam=no
5589
5590 fi
5591
5592
5593 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pam" >&5
5594 $as_echo "$with_pam" >&6; }
5595
5596
5597 #
5598 # BSD AUTH
5599 #
5600 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with BSD Authentication support" >&5
5601 $as_echo_n "checking whether to build with BSD Authentication support... " >&6; }
5602
5603
5604
5605 # Check whether --with-bsd-auth was given.
5606 if test "${with_bsd_auth+set}" = set; then :
5607   withval=$with_bsd_auth;
5608   case $withval in
5609     yes)
5610
5611 $as_echo "#define USE_BSD_AUTH 1" >>confdefs.h
5612
5613       ;;
5614     no)
5615       :
5616       ;;
5617     *)
5618       as_fn_error $? "no argument expected for --with-bsd-auth option" "$LINENO" 5
5619       ;;
5620   esac
5621
5622 else
5623   with_bsd_auth=no
5624
5625 fi
5626
5627
5628 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_bsd_auth" >&5
5629 $as_echo "$with_bsd_auth" >&6; }
5630
5631
5632 #
5633 # LDAP
5634 #
5635 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with LDAP support" >&5
5636 $as_echo_n "checking whether to build with LDAP support... " >&6; }
5637
5638
5639
5640 # Check whether --with-ldap was given.
5641 if test "${with_ldap+set}" = set; then :
5642   withval=$with_ldap;
5643   case $withval in
5644     yes)
5645
5646 $as_echo "#define USE_LDAP 1" >>confdefs.h
5647
5648       ;;
5649     no)
5650       :
5651       ;;
5652     *)
5653       as_fn_error $? "no argument expected for --with-ldap option" "$LINENO" 5
5654       ;;
5655   esac
5656
5657 else
5658   with_ldap=no
5659
5660 fi
5661
5662
5663 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ldap" >&5
5664 $as_echo "$with_ldap" >&6; }
5665
5666
5667 #
5668 # Bonjour
5669 #
5670 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Bonjour support" >&5
5671 $as_echo_n "checking whether to build with Bonjour support... " >&6; }
5672
5673
5674
5675 # Check whether --with-bonjour was given.
5676 if test "${with_bonjour+set}" = set; then :
5677   withval=$with_bonjour;
5678   case $withval in
5679     yes)
5680
5681 $as_echo "#define USE_BONJOUR 1" >>confdefs.h
5682
5683       ;;
5684     no)
5685       :
5686       ;;
5687     *)
5688       as_fn_error $? "no argument expected for --with-bonjour option" "$LINENO" 5
5689       ;;
5690   esac
5691
5692 else
5693   with_bonjour=no
5694
5695 fi
5696
5697
5698 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_bonjour" >&5
5699 $as_echo "$with_bonjour" >&6; }
5700
5701
5702 #
5703 # OpenSSL
5704 #
5705 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with OpenSSL support" >&5
5706 $as_echo_n "checking whether to build with OpenSSL support... " >&6; }
5707
5708
5709
5710 # Check whether --with-openssl was given.
5711 if test "${with_openssl+set}" = set; then :
5712   withval=$with_openssl;
5713   case $withval in
5714     yes)
5715
5716 $as_echo "#define USE_OPENSSL 1" >>confdefs.h
5717
5718       ;;
5719     no)
5720       :
5721       ;;
5722     *)
5723       as_fn_error $? "no argument expected for --with-openssl option" "$LINENO" 5
5724       ;;
5725   esac
5726
5727 else
5728   with_openssl=no
5729
5730 fi
5731
5732
5733 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_openssl" >&5
5734 $as_echo "$with_openssl" >&6; }
5735
5736
5737 #
5738 # SELinux
5739 #
5740 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with SELinux support" >&5
5741 $as_echo_n "checking whether to build with SELinux support... " >&6; }
5742
5743
5744
5745 # Check whether --with-selinux was given.
5746 if test "${with_selinux+set}" = set; then :
5747   withval=$with_selinux;
5748   case $withval in
5749     yes)
5750       :
5751       ;;
5752     no)
5753       :
5754       ;;
5755     *)
5756       as_fn_error $? "no argument expected for --with-selinux option" "$LINENO" 5
5757       ;;
5758   esac
5759
5760 else
5761   with_selinux=no
5762
5763 fi
5764
5765
5766
5767 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_selinux" >&5
5768 $as_echo "$with_selinux" >&6; }
5769
5770 #
5771 # Systemd
5772 #
5773 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with systemd support" >&5
5774 $as_echo_n "checking whether to build with systemd support... " >&6; }
5775
5776
5777
5778 # Check whether --with-systemd was given.
5779 if test "${with_systemd+set}" = set; then :
5780   withval=$with_systemd;
5781   case $withval in
5782     yes)
5783
5784 $as_echo "#define USE_SYSTEMD 1" >>confdefs.h
5785
5786       ;;
5787     no)
5788       :
5789       ;;
5790     *)
5791       as_fn_error $? "no argument expected for --with-systemd option" "$LINENO" 5
5792       ;;
5793   esac
5794
5795 else
5796   with_systemd=no
5797
5798 fi
5799
5800
5801
5802 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_systemd" >&5
5803 $as_echo "$with_systemd" >&6; }
5804
5805 #
5806 # Readline
5807 #
5808
5809
5810
5811 # Check whether --with-readline was given.
5812 if test "${with_readline+set}" = set; then :
5813   withval=$with_readline;
5814   case $withval in
5815     yes)
5816       :
5817       ;;
5818     no)
5819       :
5820       ;;
5821     *)
5822       as_fn_error $? "no argument expected for --with-readline option" "$LINENO" 5
5823       ;;
5824   esac
5825
5826 else
5827   with_readline=yes
5828
5829 fi
5830
5831
5832 # readline on MinGW has problems with backslashes in psql and other bugs.
5833 # This is particularly a problem with non-US code pages.
5834 # Therefore disable its use until we understand the cause. 2004-07-20
5835 if test "$PORTNAME" = "win32"; then
5836   if test "$with_readline" = yes; then
5837     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Readline does not work on MinGW --- disabling" >&5
5838 $as_echo "$as_me: WARNING: *** Readline does not work on MinGW --- disabling" >&2;}
5839     with_readline=no
5840   fi
5841 fi
5842
5843
5844 #
5845 # Prefer libedit
5846 #
5847
5848
5849
5850 # Check whether --with-libedit-preferred was given.
5851 if test "${with_libedit_preferred+set}" = set; then :
5852   withval=$with_libedit_preferred;
5853   case $withval in
5854     yes)
5855       :
5856       ;;
5857     no)
5858       :
5859       ;;
5860     *)
5861       as_fn_error $? "no argument expected for --with-libedit-preferred option" "$LINENO" 5
5862       ;;
5863   esac
5864
5865 else
5866   with_libedit_preferred=no
5867
5868 fi
5869
5870
5871
5872
5873 #
5874 # UUID library
5875 #
5876 # There are at least three UUID libraries in common use: the FreeBSD/NetBSD
5877 # library, the e2fsprogs libuuid (now part of util-linux-ng), and the OSSP
5878 # UUID library.  More than one of these might be present on a given platform,
5879 # so we make the user say which one she wants.
5880 #
5881
5882
5883
5884 # Check whether --with-uuid was given.
5885 if test "${with_uuid+set}" = set; then :
5886   withval=$with_uuid;
5887   case $withval in
5888     yes)
5889       as_fn_error $? "argument required for --with-uuid option" "$LINENO" 5
5890       ;;
5891     no)
5892       as_fn_error $? "argument required for --with-uuid option" "$LINENO" 5
5893       ;;
5894     *)
5895
5896       ;;
5897   esac
5898
5899 fi
5900
5901
5902 if test x"$with_uuid" = x"" ; then
5903   with_uuid=no
5904 fi
5905
5906
5907
5908 # Check whether --with-ossp-uuid was given.
5909 if test "${with_ossp_uuid+set}" = set; then :
5910   withval=$with_ossp_uuid;
5911   case $withval in
5912     yes)
5913       :
5914       ;;
5915     no)
5916       :
5917       ;;
5918     *)
5919       as_fn_error $? "no argument expected for --with-ossp-uuid option" "$LINENO" 5
5920       ;;
5921   esac
5922
5923 else
5924   with_ossp_uuid=no
5925
5926 fi
5927
5928
5929 if test "$with_ossp_uuid" = yes ; then
5930   with_uuid=ossp
5931 fi
5932
5933 if test "$with_uuid" = bsd ; then
5934
5935 $as_echo "#define HAVE_UUID_BSD 1" >>confdefs.h
5936
5937   UUID_EXTRA_OBJS="md5.o sha1.o"
5938 elif test "$with_uuid" = e2fs ; then
5939
5940 $as_echo "#define HAVE_UUID_E2FS 1" >>confdefs.h
5941
5942   UUID_EXTRA_OBJS="md5.o sha1.o"
5943 elif test "$with_uuid" = ossp ; then
5944
5945 $as_echo "#define HAVE_UUID_OSSP 1" >>confdefs.h
5946
5947   UUID_EXTRA_OBJS=""
5948 elif test "$with_uuid" = no ; then
5949   UUID_EXTRA_OBJS=""
5950 else
5951   as_fn_error $? "--with-uuid must specify one of bsd, e2fs, or ossp" "$LINENO" 5
5952 fi
5953
5954
5955
5956
5957 #
5958 # XML
5959 #
5960
5961
5962
5963 # Check whether --with-libxml was given.
5964 if test "${with_libxml+set}" = set; then :
5965   withval=$with_libxml;
5966   case $withval in
5967     yes)
5968
5969 $as_echo "#define USE_LIBXML 1" >>confdefs.h
5970
5971       ;;
5972     no)
5973       :
5974       ;;
5975     *)
5976       as_fn_error $? "no argument expected for --with-libxml option" "$LINENO" 5
5977       ;;
5978   esac
5979
5980 else
5981   with_libxml=no
5982
5983 fi
5984
5985
5986
5987 if test "$with_libxml" = yes ; then
5988   for ac_prog in xml2-config
5989 do
5990   # Extract the first word of "$ac_prog", so it can be a program name with args.
5991 set dummy $ac_prog; ac_word=$2
5992 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5993 $as_echo_n "checking for $ac_word... " >&6; }
5994 if ${ac_cv_prog_XML2_CONFIG+:} false; then :
5995   $as_echo_n "(cached) " >&6
5996 else
5997   if test -n "$XML2_CONFIG"; then
5998   ac_cv_prog_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test.
5999 else
6000 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6001 for as_dir in $PATH
6002 do
6003   IFS=$as_save_IFS
6004   test -z "$as_dir" && as_dir=.
6005     for ac_exec_ext in '' $ac_executable_extensions; do
6006   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6007     ac_cv_prog_XML2_CONFIG="$ac_prog"
6008     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6009     break 2
6010   fi
6011 done
6012   done
6013 IFS=$as_save_IFS
6014
6015 fi
6016 fi
6017 XML2_CONFIG=$ac_cv_prog_XML2_CONFIG
6018 if test -n "$XML2_CONFIG"; then
6019   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5
6020 $as_echo "$XML2_CONFIG" >&6; }
6021 else
6022   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6023 $as_echo "no" >&6; }
6024 fi
6025
6026
6027   test -n "$XML2_CONFIG" && break
6028 done
6029
6030   if test -n "$XML2_CONFIG"; then
6031     for pgac_option in `$XML2_CONFIG --cflags`; do
6032       case $pgac_option in
6033         -I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";;
6034       esac
6035     done
6036     for pgac_option in `$XML2_CONFIG --libs`; do
6037       case $pgac_option in
6038         -L*) LDFLAGS="$LDFLAGS $pgac_option";;
6039       esac
6040     done
6041   fi
6042 fi
6043
6044
6045
6046 #
6047 # XSLT
6048 #
6049
6050
6051
6052 # Check whether --with-libxslt was given.
6053 if test "${with_libxslt+set}" = set; then :
6054   withval=$with_libxslt;
6055   case $withval in
6056     yes)
6057
6058 $as_echo "#define USE_LIBXSLT 1" >>confdefs.h
6059
6060       ;;
6061     no)
6062       :
6063       ;;
6064     *)
6065       as_fn_error $? "no argument expected for --with-libxslt option" "$LINENO" 5
6066       ;;
6067   esac
6068
6069 else
6070   with_libxslt=no
6071
6072 fi
6073
6074
6075
6076
6077
6078
6079 #
6080 # tzdata
6081 #
6082
6083
6084
6085 # Check whether --with-system-tzdata was given.
6086 if test "${with_system_tzdata+set}" = set; then :
6087   withval=$with_system_tzdata;
6088   case $withval in
6089     yes)
6090       as_fn_error $? "argument required for --with-system-tzdata option" "$LINENO" 5
6091       ;;
6092     no)
6093       as_fn_error $? "argument required for --with-system-tzdata option" "$LINENO" 5
6094       ;;
6095     *)
6096
6097       ;;
6098   esac
6099
6100 fi
6101
6102
6103
6104
6105 #
6106 # Zlib
6107 #
6108
6109
6110
6111 # Check whether --with-zlib was given.
6112 if test "${with_zlib+set}" = set; then :
6113   withval=$with_zlib;
6114   case $withval in
6115     yes)
6116       :
6117       ;;
6118     no)
6119       :
6120       ;;
6121     *)
6122       as_fn_error $? "no argument expected for --with-zlib option" "$LINENO" 5
6123       ;;
6124   esac
6125
6126 else
6127   with_zlib=yes
6128
6129 fi
6130
6131
6132
6133
6134 #
6135 # Elf
6136 #
6137
6138 # Assume system is ELF if it predefines __ELF__ as 1,
6139 # otherwise believe host_os based default.
6140 case $host_os in
6141     freebsd1*|freebsd2*) elf=no;;
6142     freebsd3*|freebsd4*) elf=yes;;
6143 esac
6144
6145
6146 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
6147 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
6148 if ${ac_cv_path_GREP+:} false; then :
6149   $as_echo_n "(cached) " >&6
6150 else
6151   if test -z "$GREP"; then
6152   ac_path_GREP_found=false
6153   # Loop through the user's path and test for each of PROGNAME-LIST
6154   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6155 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
6156 do
6157   IFS=$as_save_IFS
6158   test -z "$as_dir" && as_dir=.
6159     for ac_prog in grep ggrep; do
6160     for ac_exec_ext in '' $ac_executable_extensions; do
6161       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
6162       as_fn_executable_p "$ac_path_GREP" || continue
6163 # Check for GNU ac_path_GREP and select it if it is found.
6164   # Check for GNU $ac_path_GREP
6165 case `"$ac_path_GREP" --version 2>&1` in
6166 *GNU*)
6167   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
6168 *)
6169   ac_count=0
6170   $as_echo_n 0123456789 >"conftest.in"
6171   while :
6172   do
6173     cat "conftest.in" "conftest.in" >"conftest.tmp"
6174     mv "conftest.tmp" "conftest.in"
6175     cp "conftest.in" "conftest.nl"
6176     $as_echo 'GREP' >> "conftest.nl"
6177     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
6178     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
6179     as_fn_arith $ac_count + 1 && ac_count=$as_val
6180     if test $ac_count -gt ${ac_path_GREP_max-0}; then
6181       # Best one so far, save it but keep looking for a better one
6182       ac_cv_path_GREP="$ac_path_GREP"
6183       ac_path_GREP_max=$ac_count
6184     fi
6185     # 10*(2^10) chars as input seems more than enough
6186     test $ac_count -gt 10 && break
6187   done
6188   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
6189 esac
6190
6191       $ac_path_GREP_found && break 3
6192     done
6193   done
6194   done
6195 IFS=$as_save_IFS
6196   if test -z "$ac_cv_path_GREP"; then
6197     as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
6198   fi
6199 else
6200   ac_cv_path_GREP=$GREP
6201 fi
6202
6203 fi
6204 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
6205 $as_echo "$ac_cv_path_GREP" >&6; }
6206  GREP="$ac_cv_path_GREP"
6207
6208
6209 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
6210 $as_echo_n "checking for egrep... " >&6; }
6211 if ${ac_cv_path_EGREP+:} false; then :
6212   $as_echo_n "(cached) " >&6
6213 else
6214   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
6215    then ac_cv_path_EGREP="$GREP -E"
6216    else
6217      if test -z "$EGREP"; then
6218   ac_path_EGREP_found=false
6219   # Loop through the user's path and test for each of PROGNAME-LIST
6220   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6221 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
6222 do
6223   IFS=$as_save_IFS
6224   test -z "$as_dir" && as_dir=.
6225     for ac_prog in egrep; do
6226     for ac_exec_ext in '' $ac_executable_extensions; do
6227       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
6228       as_fn_executable_p "$ac_path_EGREP" || continue
6229 # Check for GNU ac_path_EGREP and select it if it is found.
6230   # Check for GNU $ac_path_EGREP
6231 case `"$ac_path_EGREP" --version 2>&1` in
6232 *GNU*)
6233   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
6234 *)
6235   ac_count=0
6236   $as_echo_n 0123456789 >"conftest.in"
6237   while :
6238   do
6239     cat "conftest.in" "conftest.in" >"conftest.tmp"
6240     mv "conftest.tmp" "conftest.in"
6241     cp "conftest.in" "conftest.nl"
6242     $as_echo 'EGREP' >> "conftest.nl"
6243     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
6244     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
6245     as_fn_arith $ac_count + 1 && ac_count=$as_val
6246     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
6247       # Best one so far, save it but keep looking for a better one
6248       ac_cv_path_EGREP="$ac_path_EGREP"
6249       ac_path_EGREP_max=$ac_count
6250     fi
6251     # 10*(2^10) chars as input seems more than enough
6252     test $ac_count -gt 10 && break
6253   done
6254   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
6255 esac
6256
6257       $ac_path_EGREP_found && break 3
6258     done
6259   done
6260   done
6261 IFS=$as_save_IFS
6262   if test -z "$ac_cv_path_EGREP"; then
6263     as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
6264   fi
6265 else
6266   ac_cv_path_EGREP=$EGREP
6267 fi
6268
6269    fi
6270 fi
6271 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
6272 $as_echo "$ac_cv_path_EGREP" >&6; }
6273  EGREP="$ac_cv_path_EGREP"
6274
6275
6276 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6277 /* end confdefs.h.  */
6278 #if __ELF__
6279   yes
6280 #endif
6281
6282 _ACEOF
6283 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6284   $EGREP "yes" >/dev/null 2>&1; then :
6285   ELF_SYS=true
6286 else
6287   if test "X$elf" = "Xyes" ; then
6288   ELF_SYS=true
6289 else
6290   ELF_SYS=
6291 fi
6292 fi
6293 rm -f conftest*
6294
6295
6296
6297 #
6298 # Assignments
6299 #
6300
6301 CPPFLAGS="$CPPFLAGS $INCLUDES"
6302 LDFLAGS="$LDFLAGS $LIBDIRS"
6303
6304
6305
6306
6307
6308 # Check whether --with-gnu-ld was given.
6309 if test "${with_gnu_ld+set}" = set; then :
6310   withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
6311 else
6312   with_gnu_ld=no
6313 fi
6314
6315 ac_prog=ld
6316 if test "$GCC" = yes; then
6317   # Check if gcc -print-prog-name=ld gives a path.
6318   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5
6319 $as_echo_n "checking for ld used by GCC... " >&6; }
6320   case $host in
6321   *-*-mingw*)
6322     # gcc leaves a trailing carriage return which upsets mingw
6323     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
6324   *)
6325     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
6326   esac
6327   case "$ac_prog" in
6328     # Accept absolute paths.
6329     [\\/]* | [A-Za-z]:[\\/]*)
6330       re_direlt='/[^/][^/]*/\.\./'
6331       # Canonicalize the path of ld
6332       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
6333       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
6334         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
6335       done
6336       test -z "$LD" && LD="$ac_prog"
6337       ;;
6338   "")
6339     # If it fails, then pretend we aren't using GCC.
6340     ac_prog=ld
6341     ;;
6342   *)
6343     # If it is relative, then search for the first ld in PATH.
6344     with_gnu_ld=unknown
6345     ;;
6346   esac
6347 elif test "$with_gnu_ld" = yes; then
6348   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
6349 $as_echo_n "checking for GNU ld... " >&6; }
6350 else
6351   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
6352 $as_echo_n "checking for non-GNU ld... " >&6; }
6353 fi
6354 if ${ac_cv_path_LD+:} false; then :
6355   $as_echo_n "(cached) " >&6
6356 else
6357   if test -z "$LD"; then
6358   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
6359   for ac_dir in $PATH; do
6360     test -z "$ac_dir" && ac_dir=.
6361     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
6362       ac_cv_path_LD="$ac_dir/$ac_prog"
6363       # Check to see if the program is GNU ld.  I'd rather use --version,
6364       # but apparently some GNU ld's only accept -v.
6365       # Break only if it was the GNU/non-GNU ld that we prefer.
6366       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
6367         test "$with_gnu_ld" != no && break
6368       else
6369         test "$with_gnu_ld" != yes && break
6370       fi
6371     fi
6372   done
6373   IFS="$ac_save_ifs"
6374 else
6375   ac_cv_path_LD="$LD" # Let the user override the test with a path.
6376 fi
6377 fi
6378
6379 LD="$ac_cv_path_LD"
6380 if test -n "$LD"; then
6381   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
6382 $as_echo "$LD" >&6; }
6383 else
6384   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6385 $as_echo "no" >&6; }
6386 fi
6387 test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
6388 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
6389 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
6390 if ${ac_cv_prog_gnu_ld+:} false; then :
6391   $as_echo_n "(cached) " >&6
6392 else
6393   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
6394 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
6395   ac_cv_prog_gnu_ld=yes
6396 else
6397   ac_cv_prog_gnu_ld=no
6398 fi
6399 fi
6400 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gnu_ld" >&5
6401 $as_echo "$ac_cv_prog_gnu_ld" >&6; }
6402 with_gnu_ld=$ac_cv_prog_gnu_ld
6403
6404
6405
6406
6407 if test -n "$ac_tool_prefix"; then
6408   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
6409 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
6410 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6411 $as_echo_n "checking for $ac_word... " >&6; }
6412 if ${ac_cv_prog_RANLIB+:} false; then :
6413   $as_echo_n "(cached) " >&6
6414 else
6415   if test -n "$RANLIB"; then
6416   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
6417 else
6418 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6419 for as_dir in $PATH
6420 do
6421   IFS=$as_save_IFS
6422   test -z "$as_dir" && as_dir=.
6423     for ac_exec_ext in '' $ac_executable_extensions; do
6424   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6425     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
6426     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6427     break 2
6428   fi
6429 done
6430   done
6431 IFS=$as_save_IFS
6432
6433 fi
6434 fi
6435 RANLIB=$ac_cv_prog_RANLIB
6436 if test -n "$RANLIB"; then
6437   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
6438 $as_echo "$RANLIB" >&6; }
6439 else
6440   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6441 $as_echo "no" >&6; }
6442 fi
6443
6444
6445 fi
6446 if test -z "$ac_cv_prog_RANLIB"; then
6447   ac_ct_RANLIB=$RANLIB
6448   # Extract the first word of "ranlib", so it can be a program name with args.
6449 set dummy ranlib; ac_word=$2
6450 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6451 $as_echo_n "checking for $ac_word... " >&6; }
6452 if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
6453   $as_echo_n "(cached) " >&6
6454 else
6455   if test -n "$ac_ct_RANLIB"; then
6456   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
6457 else
6458 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6459 for as_dir in $PATH
6460 do
6461   IFS=$as_save_IFS
6462   test -z "$as_dir" && as_dir=.
6463     for ac_exec_ext in '' $ac_executable_extensions; do
6464   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6465     ac_cv_prog_ac_ct_RANLIB="ranlib"
6466     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6467     break 2
6468   fi
6469 done
6470   done
6471 IFS=$as_save_IFS
6472
6473 fi
6474 fi
6475 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
6476 if test -n "$ac_ct_RANLIB"; then
6477   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
6478 $as_echo "$ac_ct_RANLIB" >&6; }
6479 else
6480   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6481 $as_echo "no" >&6; }
6482 fi
6483
6484   if test "x$ac_ct_RANLIB" = x; then
6485     RANLIB=":"
6486   else
6487     case $cross_compiling:$ac_tool_warned in
6488 yes:)
6489 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6490 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6491 ac_tool_warned=yes ;;
6492 esac
6493     RANLIB=$ac_ct_RANLIB
6494   fi
6495 else
6496   RANLIB="$ac_cv_prog_RANLIB"
6497 fi
6498
6499
6500   if test -n "$ac_tool_prefix"; then
6501   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
6502 set dummy ${ac_tool_prefix}strip; ac_word=$2
6503 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6504 $as_echo_n "checking for $ac_word... " >&6; }
6505 if ${ac_cv_prog_STRIP+:} false; then :
6506   $as_echo_n "(cached) " >&6
6507 else
6508   if test -n "$STRIP"; then
6509   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
6510 else
6511 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6512 for as_dir in $PATH
6513 do
6514   IFS=$as_save_IFS
6515   test -z "$as_dir" && as_dir=.
6516     for ac_exec_ext in '' $ac_executable_extensions; do
6517   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6518     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
6519     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6520     break 2
6521   fi
6522 done
6523   done
6524 IFS=$as_save_IFS
6525
6526 fi
6527 fi
6528 STRIP=$ac_cv_prog_STRIP
6529 if test -n "$STRIP"; then
6530   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
6531 $as_echo "$STRIP" >&6; }
6532 else
6533   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6534 $as_echo "no" >&6; }
6535 fi
6536
6537
6538 fi
6539 if test -z "$ac_cv_prog_STRIP"; then
6540   ac_ct_STRIP=$STRIP
6541   # Extract the first word of "strip", so it can be a program name with args.
6542 set dummy strip; ac_word=$2
6543 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6544 $as_echo_n "checking for $ac_word... " >&6; }
6545 if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
6546   $as_echo_n "(cached) " >&6
6547 else
6548   if test -n "$ac_ct_STRIP"; then
6549   ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
6550 else
6551 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6552 for as_dir in $PATH
6553 do
6554   IFS=$as_save_IFS
6555   test -z "$as_dir" && as_dir=.
6556     for ac_exec_ext in '' $ac_executable_extensions; do
6557   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6558     ac_cv_prog_ac_ct_STRIP="strip"
6559     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6560     break 2
6561   fi
6562 done
6563   done
6564 IFS=$as_save_IFS
6565
6566 fi
6567 fi
6568 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
6569 if test -n "$ac_ct_STRIP"; then
6570   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
6571 $as_echo "$ac_ct_STRIP" >&6; }
6572 else
6573   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6574 $as_echo "no" >&6; }
6575 fi
6576
6577   if test "x$ac_ct_STRIP" = x; then
6578     STRIP=":"
6579   else
6580     case $cross_compiling:$ac_tool_warned in
6581 yes:)
6582 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6583 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6584 ac_tool_warned=yes ;;
6585 esac
6586     STRIP=$ac_ct_STRIP
6587   fi
6588 else
6589   STRIP="$ac_cv_prog_STRIP"
6590 fi
6591
6592
6593   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is possible to strip libraries" >&5
6594 $as_echo_n "checking whether it is possible to strip libraries... " >&6; }
6595   if test x"$STRIP" != x"" && "$STRIP" -V 2>&1 | grep "GNU strip" >/dev/null; then
6596     STRIP_STATIC_LIB="$STRIP -x"
6597     STRIP_SHARED_LIB="$STRIP --strip-unneeded"
6598     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6599 $as_echo "yes" >&6; }
6600   else
6601     case $host_os in
6602       darwin*)
6603         STRIP="$STRIP -x"
6604         STRIP_STATIC_LIB=$STRIP
6605         STRIP_SHARED_LIB=$STRIP
6606         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6607 $as_echo "yes" >&6; }
6608         ;;
6609       *)
6610         STRIP_STATIC_LIB=:
6611         STRIP_SHARED_LIB=:
6612         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6613 $as_echo "no" >&6; }
6614         ;;
6615     esac
6616   fi
6617
6618
6619
6620 if test -n "$ac_tool_prefix"; then
6621   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
6622 set dummy ${ac_tool_prefix}ar; ac_word=$2
6623 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6624 $as_echo_n "checking for $ac_word... " >&6; }
6625 if ${ac_cv_prog_AR+:} false; then :
6626   $as_echo_n "(cached) " >&6
6627 else
6628   if test -n "$AR"; then
6629   ac_cv_prog_AR="$AR" # Let the user override the test.
6630 else
6631 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6632 for as_dir in $PATH
6633 do
6634   IFS=$as_save_IFS
6635   test -z "$as_dir" && as_dir=.
6636     for ac_exec_ext in '' $ac_executable_extensions; do
6637   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6638     ac_cv_prog_AR="${ac_tool_prefix}ar"
6639     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6640     break 2
6641   fi
6642 done
6643   done
6644 IFS=$as_save_IFS
6645
6646 fi
6647 fi
6648 AR=$ac_cv_prog_AR
6649 if test -n "$AR"; then
6650   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
6651 $as_echo "$AR" >&6; }
6652 else
6653   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6654 $as_echo "no" >&6; }
6655 fi
6656
6657
6658 fi
6659 if test -z "$ac_cv_prog_AR"; then
6660   ac_ct_AR=$AR
6661   # Extract the first word of "ar", so it can be a program name with args.
6662 set dummy ar; ac_word=$2
6663 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6664 $as_echo_n "checking for $ac_word... " >&6; }
6665 if ${ac_cv_prog_ac_ct_AR+:} false; then :
6666   $as_echo_n "(cached) " >&6
6667 else
6668   if test -n "$ac_ct_AR"; then
6669   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
6670 else
6671 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6672 for as_dir in $PATH
6673 do
6674   IFS=$as_save_IFS
6675   test -z "$as_dir" && as_dir=.
6676     for ac_exec_ext in '' $ac_executable_extensions; do
6677   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6678     ac_cv_prog_ac_ct_AR="ar"
6679     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6680     break 2
6681   fi
6682 done
6683   done
6684 IFS=$as_save_IFS
6685
6686 fi
6687 fi
6688 ac_ct_AR=$ac_cv_prog_ac_ct_AR
6689 if test -n "$ac_ct_AR"; then
6690   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
6691 $as_echo "$ac_ct_AR" >&6; }
6692 else
6693   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6694 $as_echo "no" >&6; }
6695 fi
6696
6697   if test "x$ac_ct_AR" = x; then
6698     AR="ar"
6699   else
6700     case $cross_compiling:$ac_tool_warned in
6701 yes:)
6702 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6703 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6704 ac_tool_warned=yes ;;
6705 esac
6706     AR=$ac_ct_AR
6707   fi
6708 else
6709   AR="$ac_cv_prog_AR"
6710 fi
6711
6712 if test "$PORTNAME" = "win32"; then
6713   if test -n "$ac_tool_prefix"; then
6714   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
6715 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
6716 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6717 $as_echo_n "checking for $ac_word... " >&6; }
6718 if ${ac_cv_prog_DLLTOOL+:} false; then :
6719   $as_echo_n "(cached) " >&6
6720 else
6721   if test -n "$DLLTOOL"; then
6722   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
6723 else
6724 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6725 for as_dir in $PATH
6726 do
6727   IFS=$as_save_IFS
6728   test -z "$as_dir" && as_dir=.
6729     for ac_exec_ext in '' $ac_executable_extensions; do
6730   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6731     ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
6732     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6733     break 2
6734   fi
6735 done
6736   done
6737 IFS=$as_save_IFS
6738
6739 fi
6740 fi
6741 DLLTOOL=$ac_cv_prog_DLLTOOL
6742 if test -n "$DLLTOOL"; then
6743   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
6744 $as_echo "$DLLTOOL" >&6; }
6745 else
6746   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6747 $as_echo "no" >&6; }
6748 fi
6749
6750
6751 fi
6752 if test -z "$ac_cv_prog_DLLTOOL"; then
6753   ac_ct_DLLTOOL=$DLLTOOL
6754   # Extract the first word of "dlltool", so it can be a program name with args.
6755 set dummy dlltool; ac_word=$2
6756 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6757 $as_echo_n "checking for $ac_word... " >&6; }
6758 if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
6759   $as_echo_n "(cached) " >&6
6760 else
6761   if test -n "$ac_ct_DLLTOOL"; then
6762   ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
6763 else
6764 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6765 for as_dir in $PATH
6766 do
6767   IFS=$as_save_IFS
6768   test -z "$as_dir" && as_dir=.
6769     for ac_exec_ext in '' $ac_executable_extensions; do
6770   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6771     ac_cv_prog_ac_ct_DLLTOOL="dlltool"
6772     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6773     break 2
6774   fi
6775 done
6776   done
6777 IFS=$as_save_IFS
6778
6779 fi
6780 fi
6781 ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
6782 if test -n "$ac_ct_DLLTOOL"; then
6783   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
6784 $as_echo "$ac_ct_DLLTOOL" >&6; }
6785 else
6786   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6787 $as_echo "no" >&6; }
6788 fi
6789
6790   if test "x$ac_ct_DLLTOOL" = x; then
6791     DLLTOOL="dlltool"
6792   else
6793     case $cross_compiling:$ac_tool_warned in
6794 yes:)
6795 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6796 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6797 ac_tool_warned=yes ;;
6798 esac
6799     DLLTOOL=$ac_ct_DLLTOOL
6800   fi
6801 else
6802   DLLTOOL="$ac_cv_prog_DLLTOOL"
6803 fi
6804
6805   if test -n "$ac_tool_prefix"; then
6806   # Extract the first word of "${ac_tool_prefix}dllwrap", so it can be a program name with args.
6807 set dummy ${ac_tool_prefix}dllwrap; ac_word=$2
6808 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6809 $as_echo_n "checking for $ac_word... " >&6; }
6810 if ${ac_cv_prog_DLLWRAP+:} false; then :
6811   $as_echo_n "(cached) " >&6
6812 else
6813   if test -n "$DLLWRAP"; then
6814   ac_cv_prog_DLLWRAP="$DLLWRAP" # Let the user override the test.
6815 else
6816 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6817 for as_dir in $PATH
6818 do
6819   IFS=$as_save_IFS
6820   test -z "$as_dir" && as_dir=.
6821     for ac_exec_ext in '' $ac_executable_extensions; do
6822   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6823     ac_cv_prog_DLLWRAP="${ac_tool_prefix}dllwrap"
6824     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6825     break 2
6826   fi
6827 done
6828   done
6829 IFS=$as_save_IFS
6830
6831 fi
6832 fi
6833 DLLWRAP=$ac_cv_prog_DLLWRAP
6834 if test -n "$DLLWRAP"; then
6835   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLWRAP" >&5
6836 $as_echo "$DLLWRAP" >&6; }
6837 else
6838   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6839 $as_echo "no" >&6; }
6840 fi
6841
6842
6843 fi
6844 if test -z "$ac_cv_prog_DLLWRAP"; then
6845   ac_ct_DLLWRAP=$DLLWRAP
6846   # Extract the first word of "dllwrap", so it can be a program name with args.
6847 set dummy dllwrap; ac_word=$2
6848 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6849 $as_echo_n "checking for $ac_word... " >&6; }
6850 if ${ac_cv_prog_ac_ct_DLLWRAP+:} false; then :
6851   $as_echo_n "(cached) " >&6
6852 else
6853   if test -n "$ac_ct_DLLWRAP"; then
6854   ac_cv_prog_ac_ct_DLLWRAP="$ac_ct_DLLWRAP" # Let the user override the test.
6855 else
6856 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6857 for as_dir in $PATH
6858 do
6859   IFS=$as_save_IFS
6860   test -z "$as_dir" && as_dir=.
6861     for ac_exec_ext in '' $ac_executable_extensions; do
6862   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6863     ac_cv_prog_ac_ct_DLLWRAP="dllwrap"
6864     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6865     break 2
6866   fi
6867 done
6868   done
6869 IFS=$as_save_IFS
6870
6871 fi
6872 fi
6873 ac_ct_DLLWRAP=$ac_cv_prog_ac_ct_DLLWRAP
6874 if test -n "$ac_ct_DLLWRAP"; then
6875   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLWRAP" >&5
6876 $as_echo "$ac_ct_DLLWRAP" >&6; }
6877 else
6878   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6879 $as_echo "no" >&6; }
6880 fi
6881
6882   if test "x$ac_ct_DLLWRAP" = x; then
6883     DLLWRAP="dllwrap"
6884   else
6885     case $cross_compiling:$ac_tool_warned in
6886 yes:)
6887 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6888 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6889 ac_tool_warned=yes ;;
6890 esac
6891     DLLWRAP=$ac_ct_DLLWRAP
6892   fi
6893 else
6894   DLLWRAP="$ac_cv_prog_DLLWRAP"
6895 fi
6896
6897   if test -n "$ac_tool_prefix"; then
6898   # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
6899 set dummy ${ac_tool_prefix}windres; ac_word=$2
6900 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6901 $as_echo_n "checking for $ac_word... " >&6; }
6902 if ${ac_cv_prog_WINDRES+:} false; then :
6903   $as_echo_n "(cached) " >&6
6904 else
6905   if test -n "$WINDRES"; then
6906   ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
6907 else
6908 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6909 for as_dir in $PATH
6910 do
6911   IFS=$as_save_IFS
6912   test -z "$as_dir" && as_dir=.
6913     for ac_exec_ext in '' $ac_executable_extensions; do
6914   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6915     ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
6916     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6917     break 2
6918   fi
6919 done
6920   done
6921 IFS=$as_save_IFS
6922
6923 fi
6924 fi
6925 WINDRES=$ac_cv_prog_WINDRES
6926 if test -n "$WINDRES"; then
6927   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5
6928 $as_echo "$WINDRES" >&6; }
6929 else
6930   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6931 $as_echo "no" >&6; }
6932 fi
6933
6934
6935 fi
6936 if test -z "$ac_cv_prog_WINDRES"; then
6937   ac_ct_WINDRES=$WINDRES
6938   # Extract the first word of "windres", so it can be a program name with args.
6939 set dummy windres; ac_word=$2
6940 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6941 $as_echo_n "checking for $ac_word... " >&6; }
6942 if ${ac_cv_prog_ac_ct_WINDRES+:} false; then :
6943   $as_echo_n "(cached) " >&6
6944 else
6945   if test -n "$ac_ct_WINDRES"; then
6946   ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
6947 else
6948 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6949 for as_dir in $PATH
6950 do
6951   IFS=$as_save_IFS
6952   test -z "$as_dir" && as_dir=.
6953     for ac_exec_ext in '' $ac_executable_extensions; do
6954   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6955     ac_cv_prog_ac_ct_WINDRES="windres"
6956     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6957     break 2
6958   fi
6959 done
6960   done
6961 IFS=$as_save_IFS
6962
6963 fi
6964 fi
6965 ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
6966 if test -n "$ac_ct_WINDRES"; then
6967   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5
6968 $as_echo "$ac_ct_WINDRES" >&6; }
6969 else
6970   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6971 $as_echo "no" >&6; }
6972 fi
6973
6974   if test "x$ac_ct_WINDRES" = x; then
6975     WINDRES="windres"
6976   else
6977     case $cross_compiling:$ac_tool_warned in
6978 yes:)
6979 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6980 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6981 ac_tool_warned=yes ;;
6982 esac
6983     WINDRES=$ac_ct_WINDRES
6984   fi
6985 else
6986   WINDRES="$ac_cv_prog_WINDRES"
6987 fi
6988
6989 fi
6990
6991 # Find a good install program.  We prefer a C program (faster),
6992 # so one script is as good as another.  But avoid the broken or
6993 # incompatible versions:
6994 # SysV /etc/install, /usr/sbin/install
6995 # SunOS /usr/etc/install
6996 # IRIX /sbin/install
6997 # AIX /bin/install
6998 # AmigaOS /C/install, which installs bootblocks on floppy discs
6999 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
7000 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
7001 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
7002 # OS/2's system install, which has a completely different semantic
7003 # ./install, which can be erroneously created by make from ./install.sh.
7004 # Reject install programs that cannot install multiple files.
7005 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
7006 $as_echo_n "checking for a BSD-compatible install... " >&6; }
7007 if test -z "$INSTALL"; then
7008 if ${ac_cv_path_install+:} false; then :
7009   $as_echo_n "(cached) " >&6
7010 else
7011   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7012 for as_dir in $PATH
7013 do
7014   IFS=$as_save_IFS
7015   test -z "$as_dir" && as_dir=.
7016     # Account for people who put trailing slashes in PATH elements.
7017 case $as_dir/ in #((
7018   ./ | .// | /[cC]/* | \
7019   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
7020   ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
7021   /usr/ucb/* ) ;;
7022   *)
7023     # OSF1 and SCO ODT 3.0 have their own names for install.
7024     # Don't use installbsd from OSF since it installs stuff as root
7025     # by default.
7026     for ac_prog in ginstall scoinst install; do
7027       for ac_exec_ext in '' $ac_executable_extensions; do
7028         if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
7029           if test $ac_prog = install &&
7030             grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
7031             # AIX install.  It has an incompatible calling convention.
7032             :
7033           elif test $ac_prog = install &&
7034             grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
7035             # program-specific install script used by HP pwplus--don't use.
7036             :
7037           else
7038             rm -rf conftest.one conftest.two conftest.dir
7039             echo one > conftest.one
7040             echo two > conftest.two
7041             mkdir conftest.dir
7042             if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
7043               test -s conftest.one && test -s conftest.two &&
7044               test -s conftest.dir/conftest.one &&
7045               test -s conftest.dir/conftest.two
7046             then
7047               ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
7048               break 3
7049             fi
7050           fi
7051         fi
7052       done
7053     done
7054     ;;
7055 esac
7056
7057   done
7058 IFS=$as_save_IFS
7059
7060 rm -rf conftest.one conftest.two conftest.dir
7061
7062 fi
7063   if test "${ac_cv_path_install+set}" = set; then
7064     INSTALL=$ac_cv_path_install
7065   else
7066     # As a last resort, use the slow shell script.  Don't cache a
7067     # value for INSTALL within a source directory, because that will
7068     # break other packages using the cache if that directory is
7069     # removed, or if the value is a relative name.
7070     INSTALL=$ac_install_sh
7071   fi
7072 fi
7073 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
7074 $as_echo "$INSTALL" >&6; }
7075
7076 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
7077 # It thinks the first close brace ends the variable substitution.
7078 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
7079
7080 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
7081
7082 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
7083
7084 # When Autoconf chooses install-sh as install program it tries to generate
7085 # a relative path to it in each makefile where it substitutes it. This clashes
7086 # with our Makefile.global concept. This workaround helps.
7087 case $INSTALL in
7088   *install-sh*) install_bin='';;
7089   *) install_bin=$INSTALL;;
7090 esac
7091
7092
7093 # Extract the first word of "tar", so it can be a program name with args.
7094 set dummy tar; ac_word=$2
7095 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7096 $as_echo_n "checking for $ac_word... " >&6; }
7097 if ${ac_cv_path_TAR+:} false; then :
7098   $as_echo_n "(cached) " >&6
7099 else
7100   case $TAR in
7101   [\\/]* | ?:[\\/]*)
7102   ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
7103   ;;
7104   *)
7105   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7106 for as_dir in $PATH
7107 do
7108   IFS=$as_save_IFS
7109   test -z "$as_dir" && as_dir=.
7110     for ac_exec_ext in '' $ac_executable_extensions; do
7111   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7112     ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext"
7113     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7114     break 2
7115   fi
7116 done
7117   done
7118 IFS=$as_save_IFS
7119
7120   ;;
7121 esac
7122 fi
7123 TAR=$ac_cv_path_TAR
7124 if test -n "$TAR"; then
7125   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5
7126 $as_echo "$TAR" >&6; }
7127 else
7128   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7129 $as_echo "no" >&6; }
7130 fi
7131
7132
7133 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
7134 $as_echo_n "checking whether ln -s works... " >&6; }
7135 LN_S=$as_ln_s
7136 if test "$LN_S" = "ln -s"; then
7137   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7138 $as_echo "yes" >&6; }
7139 else
7140   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
7141 $as_echo "no, using $LN_S" >&6; }
7142 fi
7143
7144 for ac_prog in gawk mawk nawk awk
7145 do
7146   # Extract the first word of "$ac_prog", so it can be a program name with args.
7147 set dummy $ac_prog; ac_word=$2
7148 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7149 $as_echo_n "checking for $ac_word... " >&6; }
7150 if ${ac_cv_prog_AWK+:} false; then :
7151   $as_echo_n "(cached) " >&6
7152 else
7153   if test -n "$AWK"; then
7154   ac_cv_prog_AWK="$AWK" # Let the user override the test.
7155 else
7156 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7157 for as_dir in $PATH
7158 do
7159   IFS=$as_save_IFS
7160   test -z "$as_dir" && as_dir=.
7161     for ac_exec_ext in '' $ac_executable_extensions; do
7162   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7163     ac_cv_prog_AWK="$ac_prog"
7164     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7165     break 2
7166   fi
7167 done
7168   done
7169 IFS=$as_save_IFS
7170
7171 fi
7172 fi
7173 AWK=$ac_cv_prog_AWK
7174 if test -n "$AWK"; then
7175   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
7176 $as_echo "$AWK" >&6; }
7177 else
7178   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7179 $as_echo "no" >&6; }
7180 fi
7181
7182
7183   test -n "$AWK" && break
7184 done
7185
7186 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
7187 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
7188 if test -z "$MKDIR_P"; then
7189   if ${ac_cv_path_mkdir+:} false; then :
7190   $as_echo_n "(cached) " >&6
7191 else
7192   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7193 for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
7194 do
7195   IFS=$as_save_IFS
7196   test -z "$as_dir" && as_dir=.
7197     for ac_prog in mkdir gmkdir; do
7198          for ac_exec_ext in '' $ac_executable_extensions; do
7199            as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
7200            case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
7201              'mkdir (GNU coreutils) '* | \
7202              'mkdir (coreutils) '* | \
7203              'mkdir (fileutils) '4.1*)
7204                ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
7205                break 3;;
7206            esac
7207          done
7208        done
7209   done
7210 IFS=$as_save_IFS
7211
7212 fi
7213
7214   test -d ./--version && rmdir ./--version
7215   if test "${ac_cv_path_mkdir+set}" = set; then
7216     MKDIR_P="$ac_cv_path_mkdir -p"
7217   else
7218     # As a last resort, use the slow shell script.  Don't cache a
7219     # value for MKDIR_P within a source directory, because that will
7220     # break other packages using the cache if that directory is
7221     # removed, or if the value is a relative name.
7222     MKDIR_P="$ac_install_sh -d"
7223   fi
7224 fi
7225 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
7226 $as_echo "$MKDIR_P" >&6; }
7227
7228 # When Autoconf chooses install-sh as mkdir -p program it tries to generate
7229 # a relative path to it in each makefile where it substitutes it. This clashes
7230 # with our Makefile.global concept. This workaround helps.
7231 case $MKDIR_P in
7232   *install-sh*) MKDIR_P='\${SHELL} \${top_srcdir}/config/install-sh -c -d';;
7233 esac
7234
7235 # Let the user override the search
7236 if test -z "$BISON"; then
7237   for ac_prog in bison
7238 do
7239   # Extract the first word of "$ac_prog", so it can be a program name with args.
7240 set dummy $ac_prog; ac_word=$2
7241 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7242 $as_echo_n "checking for $ac_word... " >&6; }
7243 if ${ac_cv_path_BISON+:} false; then :
7244   $as_echo_n "(cached) " >&6
7245 else
7246   case $BISON in
7247   [\\/]* | ?:[\\/]*)
7248   ac_cv_path_BISON="$BISON" # Let the user override the test with a path.
7249   ;;
7250   *)
7251   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7252 for as_dir in $PATH
7253 do
7254   IFS=$as_save_IFS
7255   test -z "$as_dir" && as_dir=.
7256     for ac_exec_ext in '' $ac_executable_extensions; do
7257   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7258     ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext"
7259     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7260     break 2
7261   fi
7262 done
7263   done
7264 IFS=$as_save_IFS
7265
7266   ;;
7267 esac
7268 fi
7269 BISON=$ac_cv_path_BISON
7270 if test -n "$BISON"; then
7271   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5
7272 $as_echo "$BISON" >&6; }
7273 else
7274   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7275 $as_echo "no" >&6; }
7276 fi
7277
7278
7279   test -n "$BISON" && break
7280 done
7281
7282 fi
7283
7284 if test "$BISON"; then
7285   pgac_bison_version=`$BISON --version 2>/dev/null | sed q`
7286   { $as_echo "$as_me:${as_lineno-$LINENO}: using $pgac_bison_version" >&5
7287 $as_echo "$as_me: using $pgac_bison_version" >&6;}
7288   if echo "$pgac_bison_version" | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'
7289   then
7290     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7291 *** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
7292 *** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&5
7293 $as_echo "$as_me: WARNING:
7294 *** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
7295 *** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&2;}
7296     BISON=""
7297   fi
7298   # Bison >=3.0 issues warnings about %name-prefix="base_yy", instead
7299   # of the now preferred %name-prefix "base_yy", but the latter
7300   # doesn't work with Bison 2.3 or less.  So for now we silence the
7301   # deprecation warnings.
7302   if echo "$pgac_bison_version" | $AWK '{ if ($4 >= 3) exit 0; else exit 1;}'
7303   then
7304     BISONFLAGS="$BISONFLAGS -Wno-deprecated"
7305   fi
7306 fi
7307
7308 if test -z "$BISON"; then
7309   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7310 *** Without Bison you will not be able to build PostgreSQL from Git nor
7311 *** change any of the parser definition files.  You can obtain Bison from
7312 *** a GNU mirror site.  (If you are using the official distribution of
7313 *** PostgreSQL then you do not need to worry about this, because the Bison
7314 *** output is pre-generated.)" >&5
7315 $as_echo "$as_me: WARNING:
7316 *** Without Bison you will not be able to build PostgreSQL from Git nor
7317 *** change any of the parser definition files.  You can obtain Bison from
7318 *** a GNU mirror site.  (If you are using the official distribution of
7319 *** PostgreSQL then you do not need to worry about this, because the Bison
7320 *** output is pre-generated.)" >&2;}
7321 fi
7322 # We don't need AC_SUBST(BISON) because AC_PATH_PROG did it
7323
7324
7325 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flex" >&5
7326 $as_echo_n "checking for flex... " >&6; }
7327 if ${pgac_cv_path_flex+:} false; then :
7328   $as_echo_n "(cached) " >&6
7329 else
7330   # Let the user override the test
7331 if test -n "$FLEX"; then
7332   pgac_cv_path_flex=$FLEX
7333 else
7334   pgac_save_IFS=$IFS
7335   IFS=$PATH_SEPARATOR
7336   for pgac_dir in $PATH; do
7337     IFS=$pgac_save_IFS
7338     if test -z "$pgac_dir" || test x"$pgac_dir" = x"."; then
7339       pgac_dir=`pwd`
7340     fi
7341     for pgac_prog in flex lex; do
7342       pgac_candidate="$pgac_dir/$pgac_prog"
7343       if test -f "$pgac_candidate" \
7344         && $pgac_candidate --version </dev/null >/dev/null 2>&1
7345       then
7346         echo '%%'  > conftest.l
7347         if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
7348           pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
7349           if echo "$pgac_flex_version" | sed 's/[.a-z]/ /g' | $AWK '{ if ($1 == 2 && ($2 > 5 || ($2 == 5 && $3 >= 31))) exit 0; else exit 1;}'
7350           then
7351             pgac_cv_path_flex=$pgac_candidate
7352             break 2
7353           else
7354             { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7355 *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
7356 *** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&5
7357 $as_echo "$as_me: WARNING:
7358 *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
7359 *** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&2;}
7360           fi
7361         fi
7362       fi
7363     done
7364   done
7365   rm -f conftest.l lex.yy.c
7366   : ${pgac_cv_path_flex=no}
7367 fi
7368
7369 fi
7370 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_path_flex" >&5
7371 $as_echo "$pgac_cv_path_flex" >&6; }
7372 if test x"$pgac_cv_path_flex" = x"no"; then
7373   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7374 *** Without Flex you will not be able to build PostgreSQL from Git nor
7375 *** change any of the scanner definition files.  You can obtain Flex from
7376 *** a GNU mirror site.  (If you are using the official distribution of
7377 *** PostgreSQL then you do not need to worry about this because the Flex
7378 *** output is pre-generated.)" >&5
7379 $as_echo "$as_me: WARNING:
7380 *** Without Flex you will not be able to build PostgreSQL from Git nor
7381 *** change any of the scanner definition files.  You can obtain Flex from
7382 *** a GNU mirror site.  (If you are using the official distribution of
7383 *** PostgreSQL then you do not need to worry about this because the Flex
7384 *** output is pre-generated.)" >&2;}
7385
7386   FLEX=
7387 else
7388   FLEX=$pgac_cv_path_flex
7389   pgac_flex_version=`$FLEX --version 2>/dev/null`
7390   { $as_echo "$as_me:${as_lineno-$LINENO}: using $pgac_flex_version" >&5
7391 $as_echo "$as_me: using $pgac_flex_version" >&6;}
7392 fi
7393
7394
7395
7396
7397
7398 # Let the user override the search
7399 if test -z "$PERL"; then
7400   # Extract the first word of "perl", so it can be a program name with args.
7401 set dummy perl; ac_word=$2
7402 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7403 $as_echo_n "checking for $ac_word... " >&6; }
7404 if ${ac_cv_path_PERL+:} false; then :
7405   $as_echo_n "(cached) " >&6
7406 else
7407   case $PERL in
7408   [\\/]* | ?:[\\/]*)
7409   ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
7410   ;;
7411   *)
7412   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7413 for as_dir in $PATH
7414 do
7415   IFS=$as_save_IFS
7416   test -z "$as_dir" && as_dir=.
7417     for ac_exec_ext in '' $ac_executable_extensions; do
7418   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7419     ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
7420     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7421     break 2
7422   fi
7423 done
7424   done
7425 IFS=$as_save_IFS
7426
7427   ;;
7428 esac
7429 fi
7430 PERL=$ac_cv_path_PERL
7431 if test -n "$PERL"; then
7432   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
7433 $as_echo "$PERL" >&6; }
7434 else
7435   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7436 $as_echo "no" >&6; }
7437 fi
7438
7439
7440 fi
7441
7442 if test "$PERL"; then
7443   pgac_perl_version=`$PERL -v 2>/dev/null | sed -n 's/This is perl.*v[a-z ]*\([0-9]\.[0-9][0-9.]*\).*$/\1/p'`
7444   { $as_echo "$as_me:${as_lineno-$LINENO}: using perl $pgac_perl_version" >&5
7445 $as_echo "$as_me: using perl $pgac_perl_version" >&6;}
7446   if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \
7447     $AWK '{ if ($1 == 5 && $2 >= 8) exit 1; else exit 0;}'
7448   then
7449     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7450 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
7451 *** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&5
7452 $as_echo "$as_me: WARNING:
7453 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
7454 *** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&2;}
7455     PERL=""
7456   fi
7457 fi
7458
7459 if test -z "$PERL"; then
7460   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7461 *** Without Perl you will not be able to build PostgreSQL from Git.
7462 *** You can obtain Perl from any CPAN mirror site.
7463 *** (If you are using the official distribution of PostgreSQL then you do not
7464 *** need to worry about this, because the Perl output is pre-generated.)" >&5
7465 $as_echo "$as_me: WARNING:
7466 *** Without Perl you will not be able to build PostgreSQL from Git.
7467 *** You can obtain Perl from any CPAN mirror site.
7468 *** (If you are using the official distribution of PostgreSQL then you do not
7469 *** need to worry about this, because the Perl output is pre-generated.)" >&2;}
7470 fi
7471
7472 if test "$with_perl" = yes; then
7473   if test -z "$PERL"; then
7474     as_fn_error $? "Perl not found" "$LINENO" 5
7475   fi
7476
7477 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl archlibexp" >&5
7478 $as_echo_n "checking for Perl archlibexp... " >&6; }
7479 perl_archlibexp=`$PERL -MConfig -e 'print $Config{archlibexp}'`
7480 test "$PORTNAME" = "win32" && perl_archlibexp=`echo $perl_archlibexp | sed 's,\\\\,/,g'`
7481 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_archlibexp" >&5
7482 $as_echo "$perl_archlibexp" >&6; }
7483 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl privlibexp" >&5
7484 $as_echo_n "checking for Perl privlibexp... " >&6; }
7485 perl_privlibexp=`$PERL -MConfig -e 'print $Config{privlibexp}'`
7486 test "$PORTNAME" = "win32" && perl_privlibexp=`echo $perl_privlibexp | sed 's,\\\\,/,g'`
7487 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_privlibexp" >&5
7488 $as_echo "$perl_privlibexp" >&6; }
7489 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl useshrplib" >&5
7490 $as_echo_n "checking for Perl useshrplib... " >&6; }
7491 perl_useshrplib=`$PERL -MConfig -e 'print $Config{useshrplib}'`
7492 test "$PORTNAME" = "win32" && perl_useshrplib=`echo $perl_useshrplib | sed 's,\\\\,/,g'`
7493 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_useshrplib" >&5
7494 $as_echo "$perl_useshrplib" >&6; }
7495   if test "$perl_useshrplib" != yes && test "$perl_useshrplib" != true; then
7496     as_fn_error $? "cannot build PL/Perl because libperl is not a shared library
7497 You might have to rebuild your Perl installation.  Refer to the
7498 documentation for details.  Use --without-perl to disable building
7499 PL/Perl." "$LINENO" 5
7500   fi
7501
7502 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flags to link embedded Perl" >&5
7503 $as_echo_n "checking for flags to link embedded Perl... " >&6; }
7504 if test "$PORTNAME" = "win32" ; then
7505 perl_lib=`basename $perl_archlibexp/CORE/perl[5-9]*.lib .lib`
7506 test -e "$perl_archlibexp/CORE/$perl_lib.lib" && perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
7507 else
7508 pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
7509 pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
7510 perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e "s/ -arch [-a-zA-Z0-9_]*//g"`
7511 fi
7512 if test -z "$perl_embed_ldflags" ; then
7513         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7514 $as_echo "no" >&6; }
7515         as_fn_error $? "could not determine flags for linking embedded Perl.
7516 This probably means that ExtUtils::Embed or ExtUtils::MakeMaker is not
7517 installed." "$LINENO" 5
7518 else
7519         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_embed_ldflags" >&5
7520 $as_echo "$perl_embed_ldflags" >&6; }
7521 fi
7522
7523 fi
7524
7525 if test "$with_python" = yes; then
7526   # Extract the first word of "python", so it can be a program name with args.
7527 set dummy python; ac_word=$2
7528 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7529 $as_echo_n "checking for $ac_word... " >&6; }
7530 if ${ac_cv_path_PYTHON+:} false; then :
7531   $as_echo_n "(cached) " >&6
7532 else
7533   case $PYTHON in
7534   [\\/]* | ?:[\\/]*)
7535   ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
7536   ;;
7537   *)
7538   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7539 for as_dir in $PATH
7540 do
7541   IFS=$as_save_IFS
7542   test -z "$as_dir" && as_dir=.
7543     for ac_exec_ext in '' $ac_executable_extensions; do
7544   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7545     ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
7546     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7547     break 2
7548   fi
7549 done
7550   done
7551 IFS=$as_save_IFS
7552
7553   ;;
7554 esac
7555 fi
7556 PYTHON=$ac_cv_path_PYTHON
7557 if test -n "$PYTHON"; then
7558   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
7559 $as_echo "$PYTHON" >&6; }
7560 else
7561   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7562 $as_echo "no" >&6; }
7563 fi
7564
7565
7566 if test x"$PYTHON" = x""; then
7567   as_fn_error $? "Python not found" "$LINENO" 5
7568 fi
7569
7570
7571 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python distutils module" >&5
7572 $as_echo_n "checking for Python distutils module... " >&6; }
7573 if "${PYTHON}" -c 'import distutils' 2>&5
7574 then
7575     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7576 $as_echo "yes" >&6; }
7577 else
7578     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7579 $as_echo "no" >&6; }
7580     as_fn_error $? "distutils module not found" "$LINENO" 5
7581 fi
7582 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python configuration directory" >&5
7583 $as_echo_n "checking Python configuration directory... " >&6; }
7584 python_majorversion=`${PYTHON} -c "import sys; print(sys.version[0])"`
7585 python_minorversion=`${PYTHON} -c "import sys; print(sys.version[2])"`
7586 python_version=`${PYTHON} -c "import sys; print(sys.version[:3])"`
7587 python_configdir=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBPL'))))"`
7588 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $python_configdir" >&5
7589 $as_echo "$python_configdir" >&6; }
7590
7591 # Reject unsupported Python versions as soon as practical.
7592 if test "$python_majorversion" -lt 3 -a "$python_minorversion" -lt 4; then
7593   as_fn_error $? "Python version $python_version is too old (version 2.4 or later is required)" "$LINENO" 5
7594 fi
7595
7596 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python include directories" >&5
7597 $as_echo_n "checking Python include directories... " >&6; }
7598 python_includespec=`${PYTHON} -c "
7599 import distutils.sysconfig
7600 a = '-I' + distutils.sysconfig.get_python_inc(False)
7601 b = '-I' + distutils.sysconfig.get_python_inc(True)
7602 if a == b:
7603     print(a)
7604 else:
7605     print(a + ' ' + b)"`
7606 if test "$PORTNAME" = win32 ; then
7607     python_includespec=`echo $python_includespec | sed 's,[\],/,g'`
7608 fi
7609 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $python_includespec" >&5
7610 $as_echo "$python_includespec" >&6; }
7611
7612
7613
7614 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link an embedded Python application" >&5
7615 $as_echo_n "checking how to link an embedded Python application... " >&6; }
7616
7617 python_libdir=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBDIR'))))"`
7618 python_ldlibrary=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LDLIBRARY'))))"`
7619
7620 # If LDLIBRARY exists and has a shlib extension, use it verbatim.
7621 ldlibrary=`echo "${python_ldlibrary}" | sed -e 's/\.so$//' -e 's/\.dll$//' -e 's/\.dylib$//' -e 's/\.sl$//'`
7622 if test -e "${python_libdir}/${python_ldlibrary}" -a x"${python_ldlibrary}" != x"${ldlibrary}"
7623 then
7624         ldlibrary=`echo "${ldlibrary}" | sed "s/^lib//"`
7625         found_shlib=1
7626 else
7627         # Otherwise, guess the base name of the shlib.
7628         # LDVERSION was added in Python 3.2, before that use VERSION,
7629         # or failing that, $python_version from _PGAC_CHECK_PYTHON_DIRS.
7630         python_ldversion=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LDVERSION'))))"`
7631         if test x"${python_ldversion}" != x""; then
7632                 ldlibrary="python${python_ldversion}"
7633         else
7634                 python_version_var=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('VERSION'))))"`
7635                 if test x"${python_version_var}" != x""; then
7636                         ldlibrary="python${python_version_var}"
7637                 else
7638                         ldlibrary="python${python_version}"
7639                 fi
7640         fi
7641         # Search for a likely-looking file.
7642         found_shlib=0
7643         for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib
7644         do
7645                 # We don't know the platform DLSUFFIX here, so check 'em all.
7646                 for e in .so .dll .dylib .sl; do
7647                         if test -e "$d/lib${ldlibrary}$e"; then
7648                                 python_libdir="$d"
7649                                 found_shlib=1
7650                                 break 2
7651                         fi
7652                 done
7653         done
7654         # Some platforms (OpenBSD) require us to accept a bare versioned shlib
7655         # (".so.n.n") as well. However, check this only after failing to find
7656         # ".so" anywhere, because yet other platforms (Debian) put the .so
7657         # symlink in a different directory from the underlying versioned shlib.
7658         if test "$found_shlib" != 1; then
7659                 for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib
7660                 do
7661                         for f in "$d/lib${ldlibrary}.so."* ; do
7662                                 if test -e "$f"; then
7663                                         python_libdir="$d"
7664                                         found_shlib=1
7665                                         break 2
7666                                 fi
7667                         done
7668                 done
7669         fi
7670         # As usual, Windows has its own ideas.  Possible default library
7671         # locations include c:/Windows/System32 and (for Cygwin) /usr/bin,
7672         # and the "lib" prefix might not be there.
7673         if test "$found_shlib" != 1 -a \( "$PORTNAME" = win32 -o "$PORTNAME" = cygwin \); then
7674                 for d in "${python_libdir}" "${python_configdir}" c:/Windows/System32 /usr/bin
7675                 do
7676                         for f in "$d/lib${ldlibrary}.dll" "$d/${ldlibrary}.dll" ; do
7677                                 if test -e "$f"; then
7678                                         python_libdir="$d"
7679                                         found_shlib=1
7680                                         break 2
7681                                 fi
7682                         done
7683                 done
7684         fi
7685 fi
7686 if test "$found_shlib" != 1; then
7687         as_fn_error $? "could not find shared library for Python
7688 You might have to rebuild your Python installation.  Refer to the
7689 documentation for details.  Use --without-python to disable building
7690 PL/Python." "$LINENO" 5
7691 fi
7692 python_libspec="-L${python_libdir} -l${ldlibrary}"
7693
7694 python_additional_libs=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','BASEMODLIBS'))))"`
7695
7696 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${python_libspec} ${python_additional_libs}" >&5
7697 $as_echo "${python_libspec} ${python_additional_libs}" >&6; }
7698
7699
7700
7701 fi
7702
7703 if test "$cross_compiling" = yes && test -z "$with_system_tzdata"; then
7704   # Extract the first word of "zic", so it can be a program name with args.
7705 set dummy zic; ac_word=$2
7706 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7707 $as_echo_n "checking for $ac_word... " >&6; }
7708 if ${ac_cv_path_ZIC+:} false; then :
7709   $as_echo_n "(cached) " >&6
7710 else
7711   case $ZIC in
7712   [\\/]* | ?:[\\/]*)
7713   ac_cv_path_ZIC="$ZIC" # Let the user override the test with a path.
7714   ;;
7715   *)
7716   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7717 for as_dir in $PATH
7718 do
7719   IFS=$as_save_IFS
7720   test -z "$as_dir" && as_dir=.
7721     for ac_exec_ext in '' $ac_executable_extensions; do
7722   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7723     ac_cv_path_ZIC="$as_dir/$ac_word$ac_exec_ext"
7724     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7725     break 2
7726   fi
7727 done
7728   done
7729 IFS=$as_save_IFS
7730
7731   ;;
7732 esac
7733 fi
7734 ZIC=$ac_cv_path_ZIC
7735 if test -n "$ZIC"; then
7736   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIC" >&5
7737 $as_echo "$ZIC" >&6; }
7738 else
7739   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7740 $as_echo "no" >&6; }
7741 fi
7742
7743
7744   if test -z "$ZIC"; then
7745     as_fn_error $? "
7746 When cross-compiling, either use the option --with-system-tzdata to use
7747 existing time-zone data, or set the environment variable ZIC to a zic
7748 program to use during the build." "$LINENO" 5
7749   fi
7750 fi
7751
7752 #
7753 # Pthreads
7754 #
7755 # For each platform, we need to know about any special compile and link
7756 # libraries, and whether the normal C function names are thread-safe.
7757 # See the comment at the top of src/port/thread.c for more information.
7758 # WIN32 doesn't need the pthread tests;  it always uses threads
7759 #
7760 # These tests are run before the library-tests, because linking with the
7761 # other libraries can pull in the pthread functions as a side-effect.  We
7762 # want to use the -pthread or similar flags directly, and not rely on
7763 # the side-effects of linking with some other library.
7764 #
7765 # note: We have to use AS_IF here rather than plain if. The AC_CHECK_HEADER
7766 # invocation below is the first one in the script, and autoconf generates
7767 # additional code for that, which must not be inside the if-block. AS_IF
7768 # knows how to do that.
7769 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
7770 $as_echo_n "checking for ANSI C header files... " >&6; }
7771 if ${ac_cv_header_stdc+:} false; then :
7772   $as_echo_n "(cached) " >&6
7773 else
7774   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7775 /* end confdefs.h.  */
7776 #include <stdlib.h>
7777 #include <stdarg.h>
7778 #include <string.h>
7779 #include <float.h>
7780
7781 int
7782 main ()
7783 {
7784
7785   ;
7786   return 0;
7787 }
7788 _ACEOF
7789 if ac_fn_c_try_compile "$LINENO"; then :
7790   ac_cv_header_stdc=yes
7791 else
7792   ac_cv_header_stdc=no
7793 fi
7794 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7795
7796 if test $ac_cv_header_stdc = yes; then
7797   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
7798   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7799 /* end confdefs.h.  */
7800 #include <string.h>
7801
7802 _ACEOF
7803 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7804   $EGREP "memchr" >/dev/null 2>&1; then :
7805
7806 else
7807   ac_cv_header_stdc=no
7808 fi
7809 rm -f conftest*
7810
7811 fi
7812
7813 if test $ac_cv_header_stdc = yes; then
7814   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
7815   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7816 /* end confdefs.h.  */
7817 #include <stdlib.h>
7818
7819 _ACEOF
7820 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7821   $EGREP "free" >/dev/null 2>&1; then :
7822
7823 else
7824   ac_cv_header_stdc=no
7825 fi
7826 rm -f conftest*
7827
7828 fi
7829
7830 if test $ac_cv_header_stdc = yes; then
7831   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
7832   if test "$cross_compiling" = yes; then :
7833   :
7834 else
7835   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7836 /* end confdefs.h.  */
7837 #include <ctype.h>
7838 #include <stdlib.h>
7839 #if ((' ' & 0x0FF) == 0x020)
7840 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
7841 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
7842 #else
7843 # define ISLOWER(c) \
7844                    (('a' <= (c) && (c) <= 'i') \
7845                      || ('j' <= (c) && (c) <= 'r') \
7846                      || ('s' <= (c) && (c) <= 'z'))
7847 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
7848 #endif
7849
7850 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
7851 int
7852 main ()
7853 {
7854   int i;
7855   for (i = 0; i < 256; i++)
7856     if (XOR (islower (i), ISLOWER (i))
7857         || toupper (i) != TOUPPER (i))
7858       return 2;
7859   return 0;
7860 }
7861 _ACEOF
7862 if ac_fn_c_try_run "$LINENO"; then :
7863
7864 else
7865   ac_cv_header_stdc=no
7866 fi
7867 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7868   conftest.$ac_objext conftest.beam conftest.$ac_ext
7869 fi
7870
7871 fi
7872 fi
7873 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
7874 $as_echo "$ac_cv_header_stdc" >&6; }
7875 if test $ac_cv_header_stdc = yes; then
7876
7877 $as_echo "#define STDC_HEADERS 1" >>confdefs.h
7878
7879 fi
7880
7881 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
7882 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
7883                   inttypes.h stdint.h unistd.h
7884 do :
7885   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7886 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
7887 "
7888 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7889   cat >>confdefs.h <<_ACEOF
7890 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7891 _ACEOF
7892
7893 fi
7894
7895 done
7896
7897
7898 if test "$enable_thread_safety" = yes -a "$PORTNAME" != "win32"; then :
7899    # then
7900
7901
7902
7903 ac_ext=c
7904 ac_cpp='$CPP $CPPFLAGS'
7905 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7906 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7907 ac_compiler_gnu=$ac_cv_c_compiler_gnu
7908
7909 ax_pthread_ok=no
7910
7911 # We used to check for pthread.h first, but this fails if pthread.h
7912 # requires special compiler flags (e.g. on Tru64 or Sequent).
7913 # It gets checked for in the link test anyway.
7914
7915 # First of all, check if the user has set any of the PTHREAD_LIBS,
7916 # etcetera environment variables, and if threads linking works using
7917 # them:
7918 if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
7919         save_CFLAGS="$CFLAGS"
7920         CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
7921         save_LIBS="$LIBS"
7922         LIBS="$PTHREAD_LIBS $LIBS"
7923         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5
7924 $as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; }
7925         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7926 /* end confdefs.h.  */
7927
7928 /* Override any GCC internal prototype to avoid an error.
7929    Use char because int might match the return type of a GCC
7930    builtin and then its argument prototype would still apply.  */
7931 #ifdef __cplusplus
7932 extern "C"
7933 #endif
7934 char pthread_join ();
7935 int
7936 main ()
7937 {
7938 return pthread_join ();
7939   ;
7940   return 0;
7941 }
7942 _ACEOF
7943 if ac_fn_c_try_link "$LINENO"; then :
7944   ax_pthread_ok=yes
7945 fi
7946 rm -f core conftest.err conftest.$ac_objext \
7947     conftest$ac_exeext conftest.$ac_ext
7948         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
7949 $as_echo "$ax_pthread_ok" >&6; }
7950         if test x"$ax_pthread_ok" = xno; then
7951                 PTHREAD_LIBS=""
7952                 PTHREAD_CFLAGS=""
7953         fi
7954         LIBS="$save_LIBS"
7955         CFLAGS="$save_CFLAGS"
7956 fi
7957
7958 # We must check for the threads library under a number of different
7959 # names; the ordering is very important because some systems
7960 # (e.g. DEC) have both -lpthread and -lpthreads, where one of the
7961 # libraries is broken (non-POSIX).
7962
7963 # Create a list of thread flags to try.  Items starting with a "-" are
7964 # C compiler flags, and other items are library names, except for "none"
7965 # which indicates that we try without any flags at all, and "pthread-config"
7966 # which is a program returning the flags for the Pth emulation library.
7967
7968 ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mt -mthreads pthread --thread-safe pthread-config"
7969
7970 # The ordering *is* (sometimes) important.  Some notes on the
7971 # individual items follow:
7972
7973 # pthreads: AIX (must check this before -lpthread)
7974 # none: in case threads are in libc; should be tried before -Kthread and
7975 #       other compiler flags to prevent continual compiler warnings
7976 # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
7977 # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
7978 # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
7979 # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
7980 # -pthreads: Solaris/gcc
7981 # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
7982 #      doesn't hurt to check since this sometimes defines pthreads and
7983 #      -D_REENTRANT too), HP C (must be checked before -lpthread, which
7984 #      is present but should not be used directly)
7985 # -mthreads: Mingw32/gcc, Lynx/gcc
7986 # pthread: Linux, etcetera
7987 # --thread-safe: KAI C++
7988 # pthread-config: use pthread-config program (for GNU Pth library)
7989
7990 case $host_os in
7991
7992         hpux*)
7993
7994         # From the cc(1) man page: "[-mt] Sets various -D flags to enable
7995         # multi-threading and also sets -lpthread."
7996
7997         ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
7998         ;;
7999
8000         openedition*)
8001
8002         # IBM z/OS requires a feature-test macro to be defined in order to
8003         # enable POSIX threads at all, so give the user a hint if this is
8004         # not set. (We don't define these ourselves, as they can affect
8005         # other portions of the system API in unpredictable ways.)
8006
8007         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8008 /* end confdefs.h.  */
8009
8010 #            if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
8011              AX_PTHREAD_ZOS_MISSING
8012 #            endif
8013
8014 _ACEOF
8015 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8016   $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then :
8017   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5
8018 $as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;}
8019 fi
8020 rm -f conftest*
8021
8022         ;;
8023
8024         solaris*)
8025
8026         # Newer versions of Solaris require the "-mt -lpthread" pair, and we
8027         # check that first.  On some older versions, libc contains stubbed
8028         # (non-functional) versions of the pthreads routines, so link-based
8029         # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
8030         # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
8031         # a function called by this macro, so we could check for that, but
8032         # who knows whether they'll stub that too in a future libc.)  So
8033         # we'll look for -pthreads and -lpthread shortly thereafter.
8034
8035         ax_pthread_flags="-mt,pthread -pthreads -pthread pthread $ax_pthread_flags"
8036         ;;
8037 esac
8038
8039 # Older versions of Clang only give a warning instead of an error for an
8040 # unrecognized option, unless we specify -Werror. (We throw in some extra
8041 # Clang warning flags for good measure.)
8042
8043 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler needs certain flags to reject unknown flags" >&5
8044 $as_echo_n "checking if compiler needs certain flags to reject unknown flags... " >&6; }
8045 if ${ax_cv_PTHREAD_REJECT_UNKNOWN+:} false; then :
8046   $as_echo_n "(cached) " >&6
8047 else
8048   ax_cv_PTHREAD_REJECT_UNKNOWN=unknown
8049      save_CFLAGS="$CFLAGS"
8050      ax_pthread_extra_flags="-Wunknown-warning-option -Wunused-command-line-argument"
8051      CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wfoobaz -foobaz"
8052      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8053 /* end confdefs.h.  */
8054 int foo(void);
8055 int
8056 main ()
8057 {
8058 foo()
8059   ;
8060   return 0;
8061 }
8062 _ACEOF
8063 if ac_fn_c_try_compile "$LINENO"; then :
8064   ax_cv_PTHREAD_REJECT_UNKNOWN="-Werror $ax_pthread_extra_flags"
8065 else
8066   ax_cv_PTHREAD_REJECT_UNKNOWN=no
8067 fi
8068 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8069      CFLAGS="$save_CFLAGS"
8070
8071 fi
8072 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_REJECT_UNKNOWN" >&5
8073 $as_echo "$ax_cv_PTHREAD_REJECT_UNKNOWN" >&6; }
8074 ax_pthread_extra_flags=
8075 if test "x$ax_cv_PTHREAD_REJECT_UNKNOWN" != "xno"; then :
8076   ax_pthread_extra_flags="$ax_cv_PTHREAD_REJECT_UNKNOWN"
8077 fi
8078
8079 if test x"$ax_pthread_ok" = xno; then
8080 for flag in $ax_pthread_flags; do
8081
8082         case $flag in
8083                 none)
8084                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
8085 $as_echo_n "checking whether pthreads work without any flags... " >&6; }
8086                 ;;
8087
8088                 -mt,pthread)
8089                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5
8090 $as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; }
8091                 PTHREAD_CFLAGS="-mt"
8092                 PTHREAD_LIBS="-lpthread"
8093                 ;;
8094
8095                 -*)
8096                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5
8097 $as_echo_n "checking whether pthreads work with $flag... " >&6; }
8098                 PTHREAD_CFLAGS="$flag"
8099                 ;;
8100
8101                 pthread-config)
8102                 # Extract the first word of "pthread-config", so it can be a program name with args.
8103 set dummy pthread-config; ac_word=$2
8104 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8105 $as_echo_n "checking for $ac_word... " >&6; }
8106 if ${ac_cv_prog_ax_pthread_config+:} false; then :
8107   $as_echo_n "(cached) " >&6
8108 else
8109   if test -n "$ax_pthread_config"; then
8110   ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
8111 else
8112 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8113 for as_dir in $PATH
8114 do
8115   IFS=$as_save_IFS
8116   test -z "$as_dir" && as_dir=.
8117     for ac_exec_ext in '' $ac_executable_extensions; do
8118   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8119     ac_cv_prog_ax_pthread_config="yes"
8120     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8121     break 2
8122   fi
8123 done
8124   done
8125 IFS=$as_save_IFS
8126
8127   test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
8128 fi
8129 fi
8130 ax_pthread_config=$ac_cv_prog_ax_pthread_config
8131 if test -n "$ax_pthread_config"; then
8132   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
8133 $as_echo "$ax_pthread_config" >&6; }
8134 else
8135   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8136 $as_echo "no" >&6; }
8137 fi
8138
8139
8140                 if test x"$ax_pthread_config" = xno; then continue; fi
8141                 PTHREAD_CFLAGS="`pthread-config --cflags`"
8142                 PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
8143                 ;;
8144
8145                 *)
8146                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5
8147 $as_echo_n "checking for the pthreads library -l$flag... " >&6; }
8148                 PTHREAD_LIBS="-l$flag"
8149                 ;;
8150         esac
8151
8152         save_LIBS="$LIBS"
8153         save_CFLAGS="$CFLAGS"
8154         LIBS="$PTHREAD_LIBS $LIBS"
8155         CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
8156
8157         # Check for various functions.  We must include pthread.h,
8158         # since some functions may be macros.  (On the Sequent, we
8159         # need a special flag -Kthread to make this header compile.)
8160         # We check for pthread_join because it is in -lpthread on IRIX
8161         # while pthread_create is in libc.  We check for pthread_attr_init
8162         # due to DEC craziness with -lpthreads.  We check for
8163         # pthread_cleanup_push because it is one of the few pthread
8164         # functions on Solaris that doesn't have a non-functional libc stub.
8165         # We try pthread_create on general principles.
8166         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8167 /* end confdefs.h.  */
8168 #include <pthread.h>
8169                         static void routine(void *a) { a = 0; }
8170                         static void *start_routine(void *a) { return a; }
8171 int
8172 main ()
8173 {
8174 pthread_t th; pthread_attr_t attr;
8175                         pthread_create(&th, 0, start_routine, 0);
8176                         pthread_join(th, 0);
8177                         pthread_attr_init(&attr);
8178                         pthread_cleanup_push(routine, 0);
8179                         pthread_cleanup_pop(0) /* ; */
8180   ;
8181   return 0;
8182 }
8183 _ACEOF
8184 if ac_fn_c_try_link "$LINENO"; then :
8185   ax_pthread_ok=yes
8186 fi
8187 rm -f core conftest.err conftest.$ac_objext \
8188     conftest$ac_exeext conftest.$ac_ext
8189
8190         LIBS="$save_LIBS"
8191         CFLAGS="$save_CFLAGS"
8192
8193         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
8194 $as_echo "$ax_pthread_ok" >&6; }
8195         if test "x$ax_pthread_ok" = xyes; then
8196                 break;
8197         fi
8198
8199         PTHREAD_LIBS=""
8200         PTHREAD_CFLAGS=""
8201 done
8202 fi
8203
8204 # Various other checks:
8205 if test "x$ax_pthread_ok" = xyes; then
8206         save_LIBS="$LIBS"
8207         LIBS="$PTHREAD_LIBS $LIBS"
8208         save_CFLAGS="$CFLAGS"
8209         CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
8210
8211         # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
8212         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
8213 $as_echo_n "checking for joinable pthread attribute... " >&6; }
8214 if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then :
8215   $as_echo_n "(cached) " >&6
8216 else
8217   ax_cv_PTHREAD_JOINABLE_ATTR=unknown
8218              for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
8219                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8220 /* end confdefs.h.  */
8221 #include <pthread.h>
8222 int
8223 main ()
8224 {
8225 int attr = $attr; return attr /* ; */
8226   ;
8227   return 0;
8228 }
8229 _ACEOF
8230 if ac_fn_c_try_link "$LINENO"; then :
8231   ax_cv_PTHREAD_JOINABLE_ATTR=$attr; break
8232 fi
8233 rm -f core conftest.err conftest.$ac_objext \
8234     conftest$ac_exeext conftest.$ac_ext
8235              done
8236
8237 fi
8238 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5
8239 $as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; }
8240         if test "$ax_cv_PTHREAD_JOINABLE_ATTR" != unknown && \
8241                test "$ax_cv_PTHREAD_JOINABLE_ATTR" != PTHREAD_CREATE_JOINABLE; then :
8242
8243 cat >>confdefs.h <<_ACEOF
8244 #define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR
8245 _ACEOF
8246
8247 fi
8248
8249         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5
8250 $as_echo_n "checking if more special flags are required for pthreads... " >&6; }
8251 if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then :
8252   $as_echo_n "(cached) " >&6
8253 else
8254   ax_cv_PTHREAD_SPECIAL_FLAGS=no
8255              ax_pthread_special_flags_added=no
8256              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8257 /* end confdefs.h.  */
8258
8259 #                 if !defined(_REENTRANT) && !defined(_THREAD_SAFE)
8260                   AX_PTHREAD_NEED_SPECIAL_FLAG
8261 #                 endif
8262
8263 _ACEOF
8264 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8265   $EGREP "AX_PTHREAD_NEED_SPECIAL_FLAG" >/dev/null 2>&1; then :
8266   case $host_os in
8267                   aix* | freebsd*)
8268                   ax_cv_PTHREAD_SPECIAL_FLAGS="-D_THREAD_SAFE"
8269                   ;;
8270                   darwin* | hpux* | osf* | solaris*)
8271                   ax_cv_PTHREAD_SPECIAL_FLAGS="-D_REENTRANT"
8272                   ;;
8273                   esac
8274
8275 fi
8276 rm -f conftest*
8277
8278
8279 fi
8280 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5
8281 $as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; }
8282         if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
8283                test "x$ax_pthread_special_flags_added" != "xyes"; then :
8284   PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
8285                ax_pthread_special_flags_added=yes
8286 fi
8287
8288         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5
8289 $as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; }
8290 if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then :
8291   $as_echo_n "(cached) " >&6
8292 else
8293   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8294 /* end confdefs.h.  */
8295 #include <pthread.h>
8296 int
8297 main ()
8298 {
8299 int i = PTHREAD_PRIO_INHERIT;
8300   ;
8301   return 0;
8302 }
8303 _ACEOF
8304 if ac_fn_c_try_link "$LINENO"; then :
8305   ax_cv_PTHREAD_PRIO_INHERIT=yes
8306 else
8307   ax_cv_PTHREAD_PRIO_INHERIT=no
8308 fi
8309 rm -f core conftest.err conftest.$ac_objext \
8310     conftest$ac_exeext conftest.$ac_ext
8311
8312 fi
8313 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5
8314 $as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; }
8315         if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then :
8316
8317 $as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h
8318
8319 fi
8320
8321         LIBS="$save_LIBS"
8322         CFLAGS="$save_CFLAGS"
8323
8324         # More AIX lossage: compile with *_r variant
8325         if test "x$GCC" != xyes; then
8326             case $host_os in
8327                 aix*)
8328                 case "x/$CC" in #(
8329   x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) :
8330     #handle absolute path differently from PATH based program lookup
8331                    case "x$CC" in #(
8332   x/*) :
8333     if as_fn_executable_p ${CC}_r; then :
8334   PTHREAD_CC="${CC}_r"
8335 fi ;; #(
8336   *) :
8337     for ac_prog in ${CC}_r
8338 do
8339   # Extract the first word of "$ac_prog", so it can be a program name with args.
8340 set dummy $ac_prog; ac_word=$2
8341 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8342 $as_echo_n "checking for $ac_word... " >&6; }
8343 if ${ac_cv_prog_PTHREAD_CC+:} false; then :
8344   $as_echo_n "(cached) " >&6
8345 else
8346   if test -n "$PTHREAD_CC"; then
8347   ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
8348 else
8349 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8350 for as_dir in $PATH
8351 do
8352   IFS=$as_save_IFS
8353   test -z "$as_dir" && as_dir=.
8354     for ac_exec_ext in '' $ac_executable_extensions; do
8355   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8356     ac_cv_prog_PTHREAD_CC="$ac_prog"
8357     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8358     break 2
8359   fi
8360 done
8361   done
8362 IFS=$as_save_IFS
8363
8364 fi
8365 fi
8366 PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
8367 if test -n "$PTHREAD_CC"; then
8368   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
8369 $as_echo "$PTHREAD_CC" >&6; }
8370 else
8371   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8372 $as_echo "no" >&6; }
8373 fi
8374
8375
8376   test -n "$PTHREAD_CC" && break
8377 done
8378 test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
8379  ;;
8380 esac ;; #(
8381   *) :
8382      ;;
8383 esac
8384                 ;;
8385             esac
8386         fi
8387 fi
8388
8389 test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
8390
8391
8392
8393
8394
8395 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
8396 if test x"$ax_pthread_ok" = xyes; then
8397
8398 $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
8399
8400         :
8401 else
8402         ax_pthread_ok=no
8403
8404 fi
8405 ac_ext=c
8406 ac_cpp='$CPP $CPPFLAGS'
8407 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8408 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8409 ac_compiler_gnu=$ac_cv_c_compiler_gnu
8410
8411         # set thread flags
8412
8413 # Some platforms use these, so just define them.  They can't hurt if they
8414 # are not supported.  For example, on Solaris -D_POSIX_PTHREAD_SEMANTICS
8415 # enables 5-arg getpwuid_r, among other things.
8416 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
8417
8418 # Check for *_r functions
8419 _CFLAGS="$CFLAGS"
8420 _LIBS="$LIBS"
8421 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
8422 LIBS="$LIBS $PTHREAD_LIBS"
8423
8424 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
8425 if test "x$ac_cv_header_pthread_h" = xyes; then :
8426
8427 else
8428   as_fn_error $? "
8429 pthread.h not found;  use --disable-thread-safety to disable thread safety" "$LINENO" 5
8430 fi
8431
8432
8433
8434 for ac_func in strerror_r getpwuid_r gethostbyname_r
8435 do :
8436   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
8437 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
8438 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
8439   cat >>confdefs.h <<_ACEOF
8440 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
8441 _ACEOF
8442
8443 fi
8444 done
8445
8446
8447 # Do test here with the proper thread flags
8448 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns int" >&5
8449 $as_echo_n "checking whether strerror_r returns int... " >&6; }
8450 if ${pgac_cv_func_strerror_r_int+:} false; then :
8451   $as_echo_n "(cached) " >&6
8452 else
8453   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8454 /* end confdefs.h.  */
8455 #include <string.h>
8456 int
8457 main ()
8458 {
8459 #ifndef _AIX
8460 int strerror_r(int, char *, size_t);
8461 #else
8462 /* Older AIX has 'int' for the third argument so we don't test the args. */
8463 int strerror_r();
8464 #endif
8465   ;
8466   return 0;
8467 }
8468 _ACEOF
8469 if ac_fn_c_try_compile "$LINENO"; then :
8470   pgac_cv_func_strerror_r_int=yes
8471 else
8472   pgac_cv_func_strerror_r_int=no
8473 fi
8474 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8475 fi
8476 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_strerror_r_int" >&5
8477 $as_echo "$pgac_cv_func_strerror_r_int" >&6; }
8478 if test x"$pgac_cv_func_strerror_r_int" = xyes ; then
8479
8480 $as_echo "#define STRERROR_R_INT 1" >>confdefs.h
8481
8482 fi
8483
8484
8485 CFLAGS="$_CFLAGS"
8486 LIBS="$_LIBS"
8487
8488
8489 else
8490    # else
8491 # do not use values from template file
8492 PTHREAD_CFLAGS=
8493 PTHREAD_LIBS=
8494
8495 fi # fi
8496
8497
8498
8499
8500
8501 ##
8502 ## Libraries
8503 ##
8504 ## Most libraries are included only if they demonstrably provide a function
8505 ## we need, but libm is an exception: always include it, because there are
8506 ## too many compilers that play cute optimization games that will break
8507 ## probes for standard functions such as pow().
8508 ##
8509
8510 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5
8511 $as_echo_n "checking for main in -lm... " >&6; }
8512 if ${ac_cv_lib_m_main+:} false; then :
8513   $as_echo_n "(cached) " >&6
8514 else
8515   ac_check_lib_save_LIBS=$LIBS
8516 LIBS="-lm  $LIBS"
8517 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8518 /* end confdefs.h.  */
8519
8520
8521 int
8522 main ()
8523 {
8524 return main ();
8525   ;
8526   return 0;
8527 }
8528 _ACEOF
8529 if ac_fn_c_try_link "$LINENO"; then :
8530   ac_cv_lib_m_main=yes
8531 else
8532   ac_cv_lib_m_main=no
8533 fi
8534 rm -f core conftest.err conftest.$ac_objext \
8535     conftest$ac_exeext conftest.$ac_ext
8536 LIBS=$ac_check_lib_save_LIBS
8537 fi
8538 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5
8539 $as_echo "$ac_cv_lib_m_main" >&6; }
8540 if test "x$ac_cv_lib_m_main" = xyes; then :
8541   cat >>confdefs.h <<_ACEOF
8542 #define HAVE_LIBM 1
8543 _ACEOF
8544
8545   LIBS="-lm $LIBS"
8546
8547 fi
8548
8549 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setproctitle" >&5
8550 $as_echo_n "checking for library containing setproctitle... " >&6; }
8551 if ${ac_cv_search_setproctitle+:} false; then :
8552   $as_echo_n "(cached) " >&6
8553 else
8554   ac_func_search_save_LIBS=$LIBS
8555 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8556 /* end confdefs.h.  */
8557
8558 /* Override any GCC internal prototype to avoid an error.
8559    Use char because int might match the return type of a GCC
8560    builtin and then its argument prototype would still apply.  */
8561 #ifdef __cplusplus
8562 extern "C"
8563 #endif
8564 char setproctitle ();
8565 int
8566 main ()
8567 {
8568 return setproctitle ();
8569   ;
8570   return 0;
8571 }
8572 _ACEOF
8573 for ac_lib in '' util; do
8574   if test -z "$ac_lib"; then
8575     ac_res="none required"
8576   else
8577     ac_res=-l$ac_lib
8578     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8579   fi
8580   if ac_fn_c_try_link "$LINENO"; then :
8581   ac_cv_search_setproctitle=$ac_res
8582 fi
8583 rm -f core conftest.err conftest.$ac_objext \
8584     conftest$ac_exeext
8585   if ${ac_cv_search_setproctitle+:} false; then :
8586   break
8587 fi
8588 done
8589 if ${ac_cv_search_setproctitle+:} false; then :
8590
8591 else
8592   ac_cv_search_setproctitle=no
8593 fi
8594 rm conftest.$ac_ext
8595 LIBS=$ac_func_search_save_LIBS
8596 fi
8597 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setproctitle" >&5
8598 $as_echo "$ac_cv_search_setproctitle" >&6; }
8599 ac_res=$ac_cv_search_setproctitle
8600 if test "$ac_res" != no; then :
8601   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8602
8603 fi
8604
8605 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
8606 $as_echo_n "checking for library containing dlopen... " >&6; }
8607 if ${ac_cv_search_dlopen+:} false; then :
8608   $as_echo_n "(cached) " >&6
8609 else
8610   ac_func_search_save_LIBS=$LIBS
8611 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8612 /* end confdefs.h.  */
8613
8614 /* Override any GCC internal prototype to avoid an error.
8615    Use char because int might match the return type of a GCC
8616    builtin and then its argument prototype would still apply.  */
8617 #ifdef __cplusplus
8618 extern "C"
8619 #endif
8620 char dlopen ();
8621 int
8622 main ()
8623 {
8624 return dlopen ();
8625   ;
8626   return 0;
8627 }
8628 _ACEOF
8629 for ac_lib in '' dl; do
8630   if test -z "$ac_lib"; then
8631     ac_res="none required"
8632   else
8633     ac_res=-l$ac_lib
8634     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8635   fi
8636   if ac_fn_c_try_link "$LINENO"; then :
8637   ac_cv_search_dlopen=$ac_res
8638 fi
8639 rm -f core conftest.err conftest.$ac_objext \
8640     conftest$ac_exeext
8641   if ${ac_cv_search_dlopen+:} false; then :
8642   break
8643 fi
8644 done
8645 if ${ac_cv_search_dlopen+:} false; then :
8646
8647 else
8648   ac_cv_search_dlopen=no
8649 fi
8650 rm conftest.$ac_ext
8651 LIBS=$ac_func_search_save_LIBS
8652 fi
8653 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
8654 $as_echo "$ac_cv_search_dlopen" >&6; }
8655 ac_res=$ac_cv_search_dlopen
8656 if test "$ac_res" != no; then :
8657   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8658
8659 fi
8660
8661 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
8662 $as_echo_n "checking for library containing socket... " >&6; }
8663 if ${ac_cv_search_socket+:} false; then :
8664   $as_echo_n "(cached) " >&6
8665 else
8666   ac_func_search_save_LIBS=$LIBS
8667 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8668 /* end confdefs.h.  */
8669
8670 /* Override any GCC internal prototype to avoid an error.
8671    Use char because int might match the return type of a GCC
8672    builtin and then its argument prototype would still apply.  */
8673 #ifdef __cplusplus
8674 extern "C"
8675 #endif
8676 char socket ();
8677 int
8678 main ()
8679 {
8680 return socket ();
8681   ;
8682   return 0;
8683 }
8684 _ACEOF
8685 for ac_lib in '' socket ws2_32; do
8686   if test -z "$ac_lib"; then
8687     ac_res="none required"
8688   else
8689     ac_res=-l$ac_lib
8690     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8691   fi
8692   if ac_fn_c_try_link "$LINENO"; then :
8693   ac_cv_search_socket=$ac_res
8694 fi
8695 rm -f core conftest.err conftest.$ac_objext \
8696     conftest$ac_exeext
8697   if ${ac_cv_search_socket+:} false; then :
8698   break
8699 fi
8700 done
8701 if ${ac_cv_search_socket+:} false; then :
8702
8703 else
8704   ac_cv_search_socket=no
8705 fi
8706 rm conftest.$ac_ext
8707 LIBS=$ac_func_search_save_LIBS
8708 fi
8709 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
8710 $as_echo "$ac_cv_search_socket" >&6; }
8711 ac_res=$ac_cv_search_socket
8712 if test "$ac_res" != no; then :
8713   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8714
8715 fi
8716
8717 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shl_load" >&5
8718 $as_echo_n "checking for library containing shl_load... " >&6; }
8719 if ${ac_cv_search_shl_load+:} false; then :
8720   $as_echo_n "(cached) " >&6
8721 else
8722   ac_func_search_save_LIBS=$LIBS
8723 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8724 /* end confdefs.h.  */
8725
8726 /* Override any GCC internal prototype to avoid an error.
8727    Use char because int might match the return type of a GCC
8728    builtin and then its argument prototype would still apply.  */
8729 #ifdef __cplusplus
8730 extern "C"
8731 #endif
8732 char shl_load ();
8733 int
8734 main ()
8735 {
8736 return shl_load ();
8737   ;
8738   return 0;
8739 }
8740 _ACEOF
8741 for ac_lib in '' dld; do
8742   if test -z "$ac_lib"; then
8743     ac_res="none required"
8744   else
8745     ac_res=-l$ac_lib
8746     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8747   fi
8748   if ac_fn_c_try_link "$LINENO"; then :
8749   ac_cv_search_shl_load=$ac_res
8750 fi
8751 rm -f core conftest.err conftest.$ac_objext \
8752     conftest$ac_exeext
8753   if ${ac_cv_search_shl_load+:} false; then :
8754   break
8755 fi
8756 done
8757 if ${ac_cv_search_shl_load+:} false; then :
8758
8759 else
8760   ac_cv_search_shl_load=no
8761 fi
8762 rm conftest.$ac_ext
8763 LIBS=$ac_func_search_save_LIBS
8764 fi
8765 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shl_load" >&5
8766 $as_echo "$ac_cv_search_shl_load" >&6; }
8767 ac_res=$ac_cv_search_shl_load
8768 if test "$ac_res" != no; then :
8769   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8770
8771 fi
8772
8773 # We only use libld in port/dynloader/aix.c
8774 case $host_os in
8775      aix*)
8776         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldopen" >&5
8777 $as_echo_n "checking for library containing ldopen... " >&6; }
8778 if ${ac_cv_search_ldopen+:} false; then :
8779   $as_echo_n "(cached) " >&6
8780 else
8781   ac_func_search_save_LIBS=$LIBS
8782 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8783 /* end confdefs.h.  */
8784
8785 /* Override any GCC internal prototype to avoid an error.
8786    Use char because int might match the return type of a GCC
8787    builtin and then its argument prototype would still apply.  */
8788 #ifdef __cplusplus
8789 extern "C"
8790 #endif
8791 char ldopen ();
8792 int
8793 main ()
8794 {
8795 return ldopen ();
8796   ;
8797   return 0;
8798 }
8799 _ACEOF
8800 for ac_lib in '' ld; do
8801   if test -z "$ac_lib"; then
8802     ac_res="none required"
8803   else
8804     ac_res=-l$ac_lib
8805     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8806   fi
8807   if ac_fn_c_try_link "$LINENO"; then :
8808   ac_cv_search_ldopen=$ac_res
8809 fi
8810 rm -f core conftest.err conftest.$ac_objext \
8811     conftest$ac_exeext
8812   if ${ac_cv_search_ldopen+:} false; then :
8813   break
8814 fi
8815 done
8816 if ${ac_cv_search_ldopen+:} false; then :
8817
8818 else
8819   ac_cv_search_ldopen=no
8820 fi
8821 rm conftest.$ac_ext
8822 LIBS=$ac_func_search_save_LIBS
8823 fi
8824 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldopen" >&5
8825 $as_echo "$ac_cv_search_ldopen" >&6; }
8826 ac_res=$ac_cv_search_ldopen
8827 if test "$ac_res" != no; then :
8828   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8829
8830 fi
8831
8832         ;;
8833 esac
8834 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getopt_long" >&5
8835 $as_echo_n "checking for library containing getopt_long... " >&6; }
8836 if ${ac_cv_search_getopt_long+:} false; then :
8837   $as_echo_n "(cached) " >&6
8838 else
8839   ac_func_search_save_LIBS=$LIBS
8840 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8841 /* end confdefs.h.  */
8842
8843 /* Override any GCC internal prototype to avoid an error.
8844    Use char because int might match the return type of a GCC
8845    builtin and then its argument prototype would still apply.  */
8846 #ifdef __cplusplus
8847 extern "C"
8848 #endif
8849 char getopt_long ();
8850 int
8851 main ()
8852 {
8853 return getopt_long ();
8854   ;
8855   return 0;
8856 }
8857 _ACEOF
8858 for ac_lib in '' getopt gnugetopt; do
8859   if test -z "$ac_lib"; then
8860     ac_res="none required"
8861   else
8862     ac_res=-l$ac_lib
8863     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8864   fi
8865   if ac_fn_c_try_link "$LINENO"; then :
8866   ac_cv_search_getopt_long=$ac_res
8867 fi
8868 rm -f core conftest.err conftest.$ac_objext \
8869     conftest$ac_exeext
8870   if ${ac_cv_search_getopt_long+:} false; then :
8871   break
8872 fi
8873 done
8874 if ${ac_cv_search_getopt_long+:} false; then :
8875
8876 else
8877   ac_cv_search_getopt_long=no
8878 fi
8879 rm conftest.$ac_ext
8880 LIBS=$ac_func_search_save_LIBS
8881 fi
8882 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getopt_long" >&5
8883 $as_echo "$ac_cv_search_getopt_long" >&6; }
8884 ac_res=$ac_cv_search_getopt_long
8885 if test "$ac_res" != no; then :
8886   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8887
8888 fi
8889
8890 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
8891 $as_echo_n "checking for library containing crypt... " >&6; }
8892 if ${ac_cv_search_crypt+:} false; then :
8893   $as_echo_n "(cached) " >&6
8894 else
8895   ac_func_search_save_LIBS=$LIBS
8896 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8897 /* end confdefs.h.  */
8898
8899 /* Override any GCC internal prototype to avoid an error.
8900    Use char because int might match the return type of a GCC
8901    builtin and then its argument prototype would still apply.  */
8902 #ifdef __cplusplus
8903 extern "C"
8904 #endif
8905 char crypt ();
8906 int
8907 main ()
8908 {
8909 return crypt ();
8910   ;
8911   return 0;
8912 }
8913 _ACEOF
8914 for ac_lib in '' crypt; do
8915   if test -z "$ac_lib"; then
8916     ac_res="none required"
8917   else
8918     ac_res=-l$ac_lib
8919     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8920   fi
8921   if ac_fn_c_try_link "$LINENO"; then :
8922   ac_cv_search_crypt=$ac_res
8923 fi
8924 rm -f core conftest.err conftest.$ac_objext \
8925     conftest$ac_exeext
8926   if ${ac_cv_search_crypt+:} false; then :
8927   break
8928 fi
8929 done
8930 if ${ac_cv_search_crypt+:} false; then :
8931
8932 else
8933   ac_cv_search_crypt=no
8934 fi
8935 rm conftest.$ac_ext
8936 LIBS=$ac_func_search_save_LIBS
8937 fi
8938 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5
8939 $as_echo "$ac_cv_search_crypt" >&6; }
8940 ac_res=$ac_cv_search_crypt
8941 if test "$ac_res" != no; then :
8942   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8943
8944 fi
8945
8946 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5
8947 $as_echo_n "checking for library containing shm_open... " >&6; }
8948 if ${ac_cv_search_shm_open+:} false; then :
8949   $as_echo_n "(cached) " >&6
8950 else
8951   ac_func_search_save_LIBS=$LIBS
8952 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8953 /* end confdefs.h.  */
8954
8955 /* Override any GCC internal prototype to avoid an error.
8956    Use char because int might match the return type of a GCC
8957    builtin and then its argument prototype would still apply.  */
8958 #ifdef __cplusplus
8959 extern "C"
8960 #endif
8961 char shm_open ();
8962 int
8963 main ()
8964 {
8965 return shm_open ();
8966   ;
8967   return 0;
8968 }
8969 _ACEOF
8970 for ac_lib in '' rt; do
8971   if test -z "$ac_lib"; then
8972     ac_res="none required"
8973   else
8974     ac_res=-l$ac_lib
8975     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8976   fi
8977   if ac_fn_c_try_link "$LINENO"; then :
8978   ac_cv_search_shm_open=$ac_res
8979 fi
8980 rm -f core conftest.err conftest.$ac_objext \
8981     conftest$ac_exeext
8982   if ${ac_cv_search_shm_open+:} false; then :
8983   break
8984 fi
8985 done
8986 if ${ac_cv_search_shm_open+:} false; then :
8987
8988 else
8989   ac_cv_search_shm_open=no
8990 fi
8991 rm conftest.$ac_ext
8992 LIBS=$ac_func_search_save_LIBS
8993 fi
8994 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_open" >&5
8995 $as_echo "$ac_cv_search_shm_open" >&6; }
8996 ac_res=$ac_cv_search_shm_open
8997 if test "$ac_res" != no; then :
8998   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8999
9000 fi
9001
9002 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_unlink" >&5
9003 $as_echo_n "checking for library containing shm_unlink... " >&6; }
9004 if ${ac_cv_search_shm_unlink+:} false; then :
9005   $as_echo_n "(cached) " >&6
9006 else
9007   ac_func_search_save_LIBS=$LIBS
9008 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9009 /* end confdefs.h.  */
9010
9011 /* Override any GCC internal prototype to avoid an error.
9012    Use char because int might match the return type of a GCC
9013    builtin and then its argument prototype would still apply.  */
9014 #ifdef __cplusplus
9015 extern "C"
9016 #endif
9017 char shm_unlink ();
9018 int
9019 main ()
9020 {
9021 return shm_unlink ();
9022   ;
9023   return 0;
9024 }
9025 _ACEOF
9026 for ac_lib in '' rt; do
9027   if test -z "$ac_lib"; then
9028     ac_res="none required"
9029   else
9030     ac_res=-l$ac_lib
9031     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9032   fi
9033   if ac_fn_c_try_link "$LINENO"; then :
9034   ac_cv_search_shm_unlink=$ac_res
9035 fi
9036 rm -f core conftest.err conftest.$ac_objext \
9037     conftest$ac_exeext
9038   if ${ac_cv_search_shm_unlink+:} false; then :
9039   break
9040 fi
9041 done
9042 if ${ac_cv_search_shm_unlink+:} false; then :
9043
9044 else
9045   ac_cv_search_shm_unlink=no
9046 fi
9047 rm conftest.$ac_ext
9048 LIBS=$ac_func_search_save_LIBS
9049 fi
9050 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_unlink" >&5
9051 $as_echo "$ac_cv_search_shm_unlink" >&6; }
9052 ac_res=$ac_cv_search_shm_unlink
9053 if test "$ac_res" != no; then :
9054   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9055
9056 fi
9057
9058 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
9059 $as_echo_n "checking for library containing clock_gettime... " >&6; }
9060 if ${ac_cv_search_clock_gettime+:} false; then :
9061   $as_echo_n "(cached) " >&6
9062 else
9063   ac_func_search_save_LIBS=$LIBS
9064 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9065 /* end confdefs.h.  */
9066
9067 /* Override any GCC internal prototype to avoid an error.
9068    Use char because int might match the return type of a GCC
9069    builtin and then its argument prototype would still apply.  */
9070 #ifdef __cplusplus
9071 extern "C"
9072 #endif
9073 char clock_gettime ();
9074 int
9075 main ()
9076 {
9077 return clock_gettime ();
9078   ;
9079   return 0;
9080 }
9081 _ACEOF
9082 for ac_lib in '' rt posix4; do
9083   if test -z "$ac_lib"; then
9084     ac_res="none required"
9085   else
9086     ac_res=-l$ac_lib
9087     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9088   fi
9089   if ac_fn_c_try_link "$LINENO"; then :
9090   ac_cv_search_clock_gettime=$ac_res
9091 fi
9092 rm -f core conftest.err conftest.$ac_objext \
9093     conftest$ac_exeext
9094   if ${ac_cv_search_clock_gettime+:} false; then :
9095   break
9096 fi
9097 done
9098 if ${ac_cv_search_clock_gettime+:} false; then :
9099
9100 else
9101   ac_cv_search_clock_gettime=no
9102 fi
9103 rm conftest.$ac_ext
9104 LIBS=$ac_func_search_save_LIBS
9105 fi
9106 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
9107 $as_echo "$ac_cv_search_clock_gettime" >&6; }
9108 ac_res=$ac_cv_search_clock_gettime
9109 if test "$ac_res" != no; then :
9110   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9111
9112 fi
9113
9114 # Solaris:
9115 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fdatasync" >&5
9116 $as_echo_n "checking for library containing fdatasync... " >&6; }
9117 if ${ac_cv_search_fdatasync+:} false; then :
9118   $as_echo_n "(cached) " >&6
9119 else
9120   ac_func_search_save_LIBS=$LIBS
9121 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9122 /* end confdefs.h.  */
9123
9124 /* Override any GCC internal prototype to avoid an error.
9125    Use char because int might match the return type of a GCC
9126    builtin and then its argument prototype would still apply.  */
9127 #ifdef __cplusplus
9128 extern "C"
9129 #endif
9130 char fdatasync ();
9131 int
9132 main ()
9133 {
9134 return fdatasync ();
9135   ;
9136   return 0;
9137 }
9138 _ACEOF
9139 for ac_lib in '' rt posix4; do
9140   if test -z "$ac_lib"; then
9141     ac_res="none required"
9142   else
9143     ac_res=-l$ac_lib
9144     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9145   fi
9146   if ac_fn_c_try_link "$LINENO"; then :
9147   ac_cv_search_fdatasync=$ac_res
9148 fi
9149 rm -f core conftest.err conftest.$ac_objext \
9150     conftest$ac_exeext
9151   if ${ac_cv_search_fdatasync+:} false; then :
9152   break
9153 fi
9154 done
9155 if ${ac_cv_search_fdatasync+:} false; then :
9156
9157 else
9158   ac_cv_search_fdatasync=no
9159 fi
9160 rm conftest.$ac_ext
9161 LIBS=$ac_func_search_save_LIBS
9162 fi
9163 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fdatasync" >&5
9164 $as_echo "$ac_cv_search_fdatasync" >&6; }
9165 ac_res=$ac_cv_search_fdatasync
9166 if test "$ac_res" != no; then :
9167   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9168
9169 fi
9170
9171 # Required for thread_test.c on Solaris
9172 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_yield" >&5
9173 $as_echo_n "checking for library containing sched_yield... " >&6; }
9174 if ${ac_cv_search_sched_yield+:} false; then :
9175   $as_echo_n "(cached) " >&6
9176 else
9177   ac_func_search_save_LIBS=$LIBS
9178 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9179 /* end confdefs.h.  */
9180
9181 /* Override any GCC internal prototype to avoid an error.
9182    Use char because int might match the return type of a GCC
9183    builtin and then its argument prototype would still apply.  */
9184 #ifdef __cplusplus
9185 extern "C"
9186 #endif
9187 char sched_yield ();
9188 int
9189 main ()
9190 {
9191 return sched_yield ();
9192   ;
9193   return 0;
9194 }
9195 _ACEOF
9196 for ac_lib in '' rt; do
9197   if test -z "$ac_lib"; then
9198     ac_res="none required"
9199   else
9200     ac_res=-l$ac_lib
9201     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9202   fi
9203   if ac_fn_c_try_link "$LINENO"; then :
9204   ac_cv_search_sched_yield=$ac_res
9205 fi
9206 rm -f core conftest.err conftest.$ac_objext \
9207     conftest$ac_exeext
9208   if ${ac_cv_search_sched_yield+:} false; then :
9209   break
9210 fi
9211 done
9212 if ${ac_cv_search_sched_yield+:} false; then :
9213
9214 else
9215   ac_cv_search_sched_yield=no
9216 fi
9217 rm conftest.$ac_ext
9218 LIBS=$ac_func_search_save_LIBS
9219 fi
9220 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_yield" >&5
9221 $as_echo "$ac_cv_search_sched_yield" >&6; }
9222 ac_res=$ac_cv_search_sched_yield
9223 if test "$ac_res" != no; then :
9224   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9225
9226 fi
9227
9228 # Required for thread_test.c on Solaris 2.5:
9229 # Other ports use it too (HP-UX) so test unconditionally
9230 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname_r" >&5
9231 $as_echo_n "checking for library containing gethostbyname_r... " >&6; }
9232 if ${ac_cv_search_gethostbyname_r+:} false; then :
9233   $as_echo_n "(cached) " >&6
9234 else
9235   ac_func_search_save_LIBS=$LIBS
9236 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9237 /* end confdefs.h.  */
9238
9239 /* Override any GCC internal prototype to avoid an error.
9240    Use char because int might match the return type of a GCC
9241    builtin and then its argument prototype would still apply.  */
9242 #ifdef __cplusplus
9243 extern "C"
9244 #endif
9245 char gethostbyname_r ();
9246 int
9247 main ()
9248 {
9249 return gethostbyname_r ();
9250   ;
9251   return 0;
9252 }
9253 _ACEOF
9254 for ac_lib in '' nsl; do
9255   if test -z "$ac_lib"; then
9256     ac_res="none required"
9257   else
9258     ac_res=-l$ac_lib
9259     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9260   fi
9261   if ac_fn_c_try_link "$LINENO"; then :
9262   ac_cv_search_gethostbyname_r=$ac_res
9263 fi
9264 rm -f core conftest.err conftest.$ac_objext \
9265     conftest$ac_exeext
9266   if ${ac_cv_search_gethostbyname_r+:} false; then :
9267   break
9268 fi
9269 done
9270 if ${ac_cv_search_gethostbyname_r+:} false; then :
9271
9272 else
9273   ac_cv_search_gethostbyname_r=no
9274 fi
9275 rm conftest.$ac_ext
9276 LIBS=$ac_func_search_save_LIBS
9277 fi
9278 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname_r" >&5
9279 $as_echo "$ac_cv_search_gethostbyname_r" >&6; }
9280 ac_res=$ac_cv_search_gethostbyname_r
9281 if test "$ac_res" != no; then :
9282   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9283
9284 fi
9285
9286 # Cygwin:
9287 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shmget" >&5
9288 $as_echo_n "checking for library containing shmget... " >&6; }
9289 if ${ac_cv_search_shmget+:} false; then :
9290   $as_echo_n "(cached) " >&6
9291 else
9292   ac_func_search_save_LIBS=$LIBS
9293 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9294 /* end confdefs.h.  */
9295
9296 /* Override any GCC internal prototype to avoid an error.
9297    Use char because int might match the return type of a GCC
9298    builtin and then its argument prototype would still apply.  */
9299 #ifdef __cplusplus
9300 extern "C"
9301 #endif
9302 char shmget ();
9303 int
9304 main ()
9305 {
9306 return shmget ();
9307   ;
9308   return 0;
9309 }
9310 _ACEOF
9311 for ac_lib in '' cygipc; do
9312   if test -z "$ac_lib"; then
9313     ac_res="none required"
9314   else
9315     ac_res=-l$ac_lib
9316     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9317   fi
9318   if ac_fn_c_try_link "$LINENO"; then :
9319   ac_cv_search_shmget=$ac_res
9320 fi
9321 rm -f core conftest.err conftest.$ac_objext \
9322     conftest$ac_exeext
9323   if ${ac_cv_search_shmget+:} false; then :
9324   break
9325 fi
9326 done
9327 if ${ac_cv_search_shmget+:} false; then :
9328
9329 else
9330   ac_cv_search_shmget=no
9331 fi
9332 rm conftest.$ac_ext
9333 LIBS=$ac_func_search_save_LIBS
9334 fi
9335 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shmget" >&5
9336 $as_echo "$ac_cv_search_shmget" >&6; }
9337 ac_res=$ac_cv_search_shmget
9338 if test "$ac_res" != no; then :
9339   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9340
9341 fi
9342
9343
9344 if test "$with_readline" = yes; then
9345
9346
9347 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing readline" >&5
9348 $as_echo_n "checking for library containing readline... " >&6; }
9349 if ${pgac_cv_check_readline+:} false; then :
9350   $as_echo_n "(cached) " >&6
9351 else
9352   pgac_cv_check_readline=no
9353 pgac_save_LIBS=$LIBS
9354 if test x"$with_libedit_preferred" != x"yes"
9355 then    READLINE_ORDER="-lreadline -ledit"
9356 else    READLINE_ORDER="-ledit -lreadline"
9357 fi
9358 for pgac_rllib in $READLINE_ORDER ; do
9359   for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
9360     LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS"
9361     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9362 /* end confdefs.h.  */
9363
9364 /* Override any GCC internal prototype to avoid an error.
9365    Use char because int might match the return type of a GCC
9366    builtin and then its argument prototype would still apply.  */
9367 #ifdef __cplusplus
9368 extern "C"
9369 #endif
9370 char readline ();
9371 int
9372 main ()
9373 {
9374 return readline ();
9375   ;
9376   return 0;
9377 }
9378 _ACEOF
9379 if ac_fn_c_try_link "$LINENO"; then :
9380
9381       # Older NetBSD, OpenBSD, and Irix have a broken linker that does not
9382       # recognize dependent libraries; assume curses is needed if we didn't
9383       # find any dependency.
9384       case $host_os in
9385         netbsd* | openbsd* | irix*)
9386           if test x"$pgac_lib" = x"" ; then
9387             pgac_lib=" -lcurses"
9388           fi ;;
9389       esac
9390
9391       pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"
9392       break
9393
9394 fi
9395 rm -f core conftest.err conftest.$ac_objext \
9396     conftest$ac_exeext conftest.$ac_ext
9397   done
9398   if test "$pgac_cv_check_readline" != no ; then
9399     break
9400   fi
9401 done
9402 LIBS=$pgac_save_LIBS
9403
9404 fi
9405 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_readline" >&5
9406 $as_echo "$pgac_cv_check_readline" >&6; }
9407 if test "$pgac_cv_check_readline" != no ; then
9408   LIBS="$pgac_cv_check_readline $LIBS"
9409
9410 $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
9411
9412 fi
9413
9414
9415   if test x"$pgac_cv_check_readline" = x"no"; then
9416     as_fn_error $? "readline library not found
9417 If you have readline already installed, see config.log for details on the
9418 failure.  It is possible the compiler isn't looking in the proper directory.
9419 Use --without-readline to disable readline support." "$LINENO" 5
9420   fi
9421 fi
9422
9423 if test "$with_zlib" = yes; then
9424   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5
9425 $as_echo_n "checking for inflate in -lz... " >&6; }
9426 if ${ac_cv_lib_z_inflate+:} false; then :
9427   $as_echo_n "(cached) " >&6
9428 else
9429   ac_check_lib_save_LIBS=$LIBS
9430 LIBS="-lz  $LIBS"
9431 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9432 /* end confdefs.h.  */
9433
9434 /* Override any GCC internal prototype to avoid an error.
9435    Use char because int might match the return type of a GCC
9436    builtin and then its argument prototype would still apply.  */
9437 #ifdef __cplusplus
9438 extern "C"
9439 #endif
9440 char inflate ();
9441 int
9442 main ()
9443 {
9444 return inflate ();
9445   ;
9446   return 0;
9447 }
9448 _ACEOF
9449 if ac_fn_c_try_link "$LINENO"; then :
9450   ac_cv_lib_z_inflate=yes
9451 else
9452   ac_cv_lib_z_inflate=no
9453 fi
9454 rm -f core conftest.err conftest.$ac_objext \
9455     conftest$ac_exeext conftest.$ac_ext
9456 LIBS=$ac_check_lib_save_LIBS
9457 fi
9458 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5
9459 $as_echo "$ac_cv_lib_z_inflate" >&6; }
9460 if test "x$ac_cv_lib_z_inflate" = xyes; then :
9461   cat >>confdefs.h <<_ACEOF
9462 #define HAVE_LIBZ 1
9463 _ACEOF
9464
9465   LIBS="-lz $LIBS"
9466
9467 else
9468   as_fn_error $? "zlib library not found
9469 If you have zlib already installed, see config.log for details on the
9470 failure.  It is possible the compiler isn't looking in the proper directory.
9471 Use --without-zlib to disable zlib support." "$LINENO" 5
9472 fi
9473
9474 fi
9475
9476 if test "$enable_spinlocks" = yes; then
9477
9478 $as_echo "#define HAVE_SPINLOCKS 1" >>confdefs.h
9479
9480 else
9481   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9482 *** Not using spinlocks will cause poor performance." >&5
9483 $as_echo "$as_me: WARNING:
9484 *** Not using spinlocks will cause poor performance." >&2;}
9485 fi
9486
9487 if test "$enable_atomics" = yes; then
9488
9489 $as_echo "#define HAVE_ATOMICS 1" >>confdefs.h
9490
9491 else
9492   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9493 *** Not using atomic operations will cause poor performance." >&5
9494 $as_echo "$as_me: WARNING:
9495 *** Not using atomic operations will cause poor performance." >&2;}
9496 fi
9497
9498 if test "$with_gssapi" = yes ; then
9499   if test "$PORTNAME" != "win32"; then
9500     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gss_init_sec_context" >&5
9501 $as_echo_n "checking for library containing gss_init_sec_context... " >&6; }
9502 if ${ac_cv_search_gss_init_sec_context+:} false; then :
9503   $as_echo_n "(cached) " >&6
9504 else
9505   ac_func_search_save_LIBS=$LIBS
9506 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9507 /* end confdefs.h.  */
9508
9509 /* Override any GCC internal prototype to avoid an error.
9510    Use char because int might match the return type of a GCC
9511    builtin and then its argument prototype would still apply.  */
9512 #ifdef __cplusplus
9513 extern "C"
9514 #endif
9515 char gss_init_sec_context ();
9516 int
9517 main ()
9518 {
9519 return gss_init_sec_context ();
9520   ;
9521   return 0;
9522 }
9523 _ACEOF
9524 for ac_lib in '' gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'; do
9525   if test -z "$ac_lib"; then
9526     ac_res="none required"
9527   else
9528     ac_res=-l$ac_lib
9529     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9530   fi
9531   if ac_fn_c_try_link "$LINENO"; then :
9532   ac_cv_search_gss_init_sec_context=$ac_res
9533 fi
9534 rm -f core conftest.err conftest.$ac_objext \
9535     conftest$ac_exeext
9536   if ${ac_cv_search_gss_init_sec_context+:} false; then :
9537   break
9538 fi
9539 done
9540 if ${ac_cv_search_gss_init_sec_context+:} false; then :
9541
9542 else
9543   ac_cv_search_gss_init_sec_context=no
9544 fi
9545 rm conftest.$ac_ext
9546 LIBS=$ac_func_search_save_LIBS
9547 fi
9548 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gss_init_sec_context" >&5
9549 $as_echo "$ac_cv_search_gss_init_sec_context" >&6; }
9550 ac_res=$ac_cv_search_gss_init_sec_context
9551 if test "$ac_res" != no; then :
9552   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9553
9554 else
9555   as_fn_error $? "could not find function 'gss_init_sec_context' required for GSSAPI" "$LINENO" 5
9556 fi
9557
9558   else
9559     LIBS="$LIBS -lgssapi32"
9560   fi
9561 fi
9562
9563 if test "$with_openssl" = yes ; then
9564     if test "$PORTNAME" != "win32"; then
9565      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5
9566 $as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; }
9567 if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then :
9568   $as_echo_n "(cached) " >&6
9569 else
9570   ac_check_lib_save_LIBS=$LIBS
9571 LIBS="-lcrypto  $LIBS"
9572 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9573 /* end confdefs.h.  */
9574
9575 /* Override any GCC internal prototype to avoid an error.
9576    Use char because int might match the return type of a GCC
9577    builtin and then its argument prototype would still apply.  */
9578 #ifdef __cplusplus
9579 extern "C"
9580 #endif
9581 char CRYPTO_new_ex_data ();
9582 int
9583 main ()
9584 {
9585 return CRYPTO_new_ex_data ();
9586   ;
9587   return 0;
9588 }
9589 _ACEOF
9590 if ac_fn_c_try_link "$LINENO"; then :
9591   ac_cv_lib_crypto_CRYPTO_new_ex_data=yes
9592 else
9593   ac_cv_lib_crypto_CRYPTO_new_ex_data=no
9594 fi
9595 rm -f core conftest.err conftest.$ac_objext \
9596     conftest$ac_exeext conftest.$ac_ext
9597 LIBS=$ac_check_lib_save_LIBS
9598 fi
9599 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5
9600 $as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; }
9601 if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then :
9602   cat >>confdefs.h <<_ACEOF
9603 #define HAVE_LIBCRYPTO 1
9604 _ACEOF
9605
9606   LIBS="-lcrypto $LIBS"
9607
9608 else
9609   as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5
9610 fi
9611
9612      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl" >&5
9613 $as_echo_n "checking for SSL_new in -lssl... " >&6; }
9614 if ${ac_cv_lib_ssl_SSL_new+:} false; then :
9615   $as_echo_n "(cached) " >&6
9616 else
9617   ac_check_lib_save_LIBS=$LIBS
9618 LIBS="-lssl  $LIBS"
9619 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9620 /* end confdefs.h.  */
9621
9622 /* Override any GCC internal prototype to avoid an error.
9623    Use char because int might match the return type of a GCC
9624    builtin and then its argument prototype would still apply.  */
9625 #ifdef __cplusplus
9626 extern "C"
9627 #endif
9628 char SSL_new ();
9629 int
9630 main ()
9631 {
9632 return SSL_new ();
9633   ;
9634   return 0;
9635 }
9636 _ACEOF
9637 if ac_fn_c_try_link "$LINENO"; then :
9638   ac_cv_lib_ssl_SSL_new=yes
9639 else
9640   ac_cv_lib_ssl_SSL_new=no
9641 fi
9642 rm -f core conftest.err conftest.$ac_objext \
9643     conftest$ac_exeext conftest.$ac_ext
9644 LIBS=$ac_check_lib_save_LIBS
9645 fi
9646 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_new" >&5
9647 $as_echo "$ac_cv_lib_ssl_SSL_new" >&6; }
9648 if test "x$ac_cv_lib_ssl_SSL_new" = xyes; then :
9649   cat >>confdefs.h <<_ACEOF
9650 #define HAVE_LIBSSL 1
9651 _ACEOF
9652
9653   LIBS="-lssl $LIBS"
9654
9655 else
9656   as_fn_error $? "library 'ssl' is required for OpenSSL" "$LINENO" 5
9657 fi
9658
9659   else
9660      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing CRYPTO_new_ex_data" >&5
9661 $as_echo_n "checking for library containing CRYPTO_new_ex_data... " >&6; }
9662 if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
9663   $as_echo_n "(cached) " >&6
9664 else
9665   ac_func_search_save_LIBS=$LIBS
9666 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9667 /* end confdefs.h.  */
9668
9669 /* Override any GCC internal prototype to avoid an error.
9670    Use char because int might match the return type of a GCC
9671    builtin and then its argument prototype would still apply.  */
9672 #ifdef __cplusplus
9673 extern "C"
9674 #endif
9675 char CRYPTO_new_ex_data ();
9676 int
9677 main ()
9678 {
9679 return CRYPTO_new_ex_data ();
9680   ;
9681   return 0;
9682 }
9683 _ACEOF
9684 for ac_lib in '' eay32 crypto; do
9685   if test -z "$ac_lib"; then
9686     ac_res="none required"
9687   else
9688     ac_res=-l$ac_lib
9689     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9690   fi
9691   if ac_fn_c_try_link "$LINENO"; then :
9692   ac_cv_search_CRYPTO_new_ex_data=$ac_res
9693 fi
9694 rm -f core conftest.err conftest.$ac_objext \
9695     conftest$ac_exeext
9696   if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
9697   break
9698 fi
9699 done
9700 if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
9701
9702 else
9703   ac_cv_search_CRYPTO_new_ex_data=no
9704 fi
9705 rm conftest.$ac_ext
9706 LIBS=$ac_func_search_save_LIBS
9707 fi
9708 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_CRYPTO_new_ex_data" >&5
9709 $as_echo "$ac_cv_search_CRYPTO_new_ex_data" >&6; }
9710 ac_res=$ac_cv_search_CRYPTO_new_ex_data
9711 if test "$ac_res" != no; then :
9712   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9713
9714 else
9715   as_fn_error $? "library 'eay32' or 'crypto' is required for OpenSSL" "$LINENO" 5
9716 fi
9717
9718      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_new" >&5
9719 $as_echo_n "checking for library containing SSL_new... " >&6; }
9720 if ${ac_cv_search_SSL_new+:} false; then :
9721   $as_echo_n "(cached) " >&6
9722 else
9723   ac_func_search_save_LIBS=$LIBS
9724 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9725 /* end confdefs.h.  */
9726
9727 /* Override any GCC internal prototype to avoid an error.
9728    Use char because int might match the return type of a GCC
9729    builtin and then its argument prototype would still apply.  */
9730 #ifdef __cplusplus
9731 extern "C"
9732 #endif
9733 char SSL_new ();
9734 int
9735 main ()
9736 {
9737 return SSL_new ();
9738   ;
9739   return 0;
9740 }
9741 _ACEOF
9742 for ac_lib in '' ssleay32 ssl; do
9743   if test -z "$ac_lib"; then
9744     ac_res="none required"
9745   else
9746     ac_res=-l$ac_lib
9747     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9748   fi
9749   if ac_fn_c_try_link "$LINENO"; then :
9750   ac_cv_search_SSL_new=$ac_res
9751 fi
9752 rm -f core conftest.err conftest.$ac_objext \
9753     conftest$ac_exeext
9754   if ${ac_cv_search_SSL_new+:} false; then :
9755   break
9756 fi
9757 done
9758 if ${ac_cv_search_SSL_new+:} false; then :
9759
9760 else
9761   ac_cv_search_SSL_new=no
9762 fi
9763 rm conftest.$ac_ext
9764 LIBS=$ac_func_search_save_LIBS
9765 fi
9766 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SSL_new" >&5
9767 $as_echo "$ac_cv_search_SSL_new" >&6; }
9768 ac_res=$ac_cv_search_SSL_new
9769 if test "$ac_res" != no; then :
9770   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9771
9772 else
9773   as_fn_error $? "library 'ssleay32' or 'ssl' is required for OpenSSL" "$LINENO" 5
9774 fi
9775
9776   fi
9777   for ac_func in SSL_get_current_compression
9778 do :
9779   ac_fn_c_check_func "$LINENO" "SSL_get_current_compression" "ac_cv_func_SSL_get_current_compression"
9780 if test "x$ac_cv_func_SSL_get_current_compression" = xyes; then :
9781   cat >>confdefs.h <<_ACEOF
9782 #define HAVE_SSL_GET_CURRENT_COMPRESSION 1
9783 _ACEOF
9784
9785 fi
9786 done
9787
9788   # Functions introduced in OpenSSL 1.1.0. We used to check for
9789   # OPENSSL_VERSION_NUMBER, but that didn't work with 1.1.0, because LibreSSL
9790   # defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it
9791   # doesn't have these OpenSSL 1.1.0 functions. So check for individual
9792   # functions.
9793   for ac_func in OPENSSL_init_ssl BIO_get_data BIO_meth_new ASN1_STRING_get0_data RAND_OpenSSL
9794 do :
9795   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
9796 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
9797 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
9798   cat >>confdefs.h <<_ACEOF
9799 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
9800 _ACEOF
9801
9802 fi
9803 done
9804
9805   # OpenSSL versions before 1.1.0 required setting callback functions, for
9806   # thread-safety. In 1.1.0, it's no longer required, and CRYPTO_lock()
9807   # function was removed.
9808   for ac_func in CRYPTO_lock
9809 do :
9810   ac_fn_c_check_func "$LINENO" "CRYPTO_lock" "ac_cv_func_CRYPTO_lock"
9811 if test "x$ac_cv_func_CRYPTO_lock" = xyes; then :
9812   cat >>confdefs.h <<_ACEOF
9813 #define HAVE_CRYPTO_LOCK 1
9814 _ACEOF
9815
9816 fi
9817 done
9818
9819 fi
9820
9821 if test "$with_pam" = yes ; then
9822   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5
9823 $as_echo_n "checking for pam_start in -lpam... " >&6; }
9824 if ${ac_cv_lib_pam_pam_start+:} false; then :
9825   $as_echo_n "(cached) " >&6
9826 else
9827   ac_check_lib_save_LIBS=$LIBS
9828 LIBS="-lpam  $LIBS"
9829 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9830 /* end confdefs.h.  */
9831
9832 /* Override any GCC internal prototype to avoid an error.
9833    Use char because int might match the return type of a GCC
9834    builtin and then its argument prototype would still apply.  */
9835 #ifdef __cplusplus
9836 extern "C"
9837 #endif
9838 char pam_start ();
9839 int
9840 main ()
9841 {
9842 return pam_start ();
9843   ;
9844   return 0;
9845 }
9846 _ACEOF
9847 if ac_fn_c_try_link "$LINENO"; then :
9848   ac_cv_lib_pam_pam_start=yes
9849 else
9850   ac_cv_lib_pam_pam_start=no
9851 fi
9852 rm -f core conftest.err conftest.$ac_objext \
9853     conftest$ac_exeext conftest.$ac_ext
9854 LIBS=$ac_check_lib_save_LIBS
9855 fi
9856 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5
9857 $as_echo "$ac_cv_lib_pam_pam_start" >&6; }
9858 if test "x$ac_cv_lib_pam_pam_start" = xyes; then :
9859   cat >>confdefs.h <<_ACEOF
9860 #define HAVE_LIBPAM 1
9861 _ACEOF
9862
9863   LIBS="-lpam $LIBS"
9864
9865 else
9866   as_fn_error $? "library 'pam' is required for PAM" "$LINENO" 5
9867 fi
9868
9869 fi
9870
9871 if test "$with_libxml" = yes ; then
9872   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlSaveToBuffer in -lxml2" >&5
9873 $as_echo_n "checking for xmlSaveToBuffer in -lxml2... " >&6; }
9874 if ${ac_cv_lib_xml2_xmlSaveToBuffer+:} false; then :
9875   $as_echo_n "(cached) " >&6
9876 else
9877   ac_check_lib_save_LIBS=$LIBS
9878 LIBS="-lxml2  $LIBS"
9879 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9880 /* end confdefs.h.  */
9881
9882 /* Override any GCC internal prototype to avoid an error.
9883    Use char because int might match the return type of a GCC
9884    builtin and then its argument prototype would still apply.  */
9885 #ifdef __cplusplus
9886 extern "C"
9887 #endif
9888 char xmlSaveToBuffer ();
9889 int
9890 main ()
9891 {
9892 return xmlSaveToBuffer ();
9893   ;
9894   return 0;
9895 }
9896 _ACEOF
9897 if ac_fn_c_try_link "$LINENO"; then :
9898   ac_cv_lib_xml2_xmlSaveToBuffer=yes
9899 else
9900   ac_cv_lib_xml2_xmlSaveToBuffer=no
9901 fi
9902 rm -f core conftest.err conftest.$ac_objext \
9903     conftest$ac_exeext conftest.$ac_ext
9904 LIBS=$ac_check_lib_save_LIBS
9905 fi
9906 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlSaveToBuffer" >&5
9907 $as_echo "$ac_cv_lib_xml2_xmlSaveToBuffer" >&6; }
9908 if test "x$ac_cv_lib_xml2_xmlSaveToBuffer" = xyes; then :
9909   cat >>confdefs.h <<_ACEOF
9910 #define HAVE_LIBXML2 1
9911 _ACEOF
9912
9913   LIBS="-lxml2 $LIBS"
9914
9915 else
9916   as_fn_error $? "library 'xml2' (version >= 2.6.23) is required for XML support" "$LINENO" 5
9917 fi
9918
9919 fi
9920
9921 if test "$with_libxslt" = yes ; then
9922   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xsltCleanupGlobals in -lxslt" >&5
9923 $as_echo_n "checking for xsltCleanupGlobals in -lxslt... " >&6; }
9924 if ${ac_cv_lib_xslt_xsltCleanupGlobals+:} false; then :
9925   $as_echo_n "(cached) " >&6
9926 else
9927   ac_check_lib_save_LIBS=$LIBS
9928 LIBS="-lxslt  $LIBS"
9929 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9930 /* end confdefs.h.  */
9931
9932 /* Override any GCC internal prototype to avoid an error.
9933    Use char because int might match the return type of a GCC
9934    builtin and then its argument prototype would still apply.  */
9935 #ifdef __cplusplus
9936 extern "C"
9937 #endif
9938 char xsltCleanupGlobals ();
9939 int
9940 main ()
9941 {
9942 return xsltCleanupGlobals ();
9943   ;
9944   return 0;
9945 }
9946 _ACEOF
9947 if ac_fn_c_try_link "$LINENO"; then :
9948   ac_cv_lib_xslt_xsltCleanupGlobals=yes
9949 else
9950   ac_cv_lib_xslt_xsltCleanupGlobals=no
9951 fi
9952 rm -f core conftest.err conftest.$ac_objext \
9953     conftest$ac_exeext conftest.$ac_ext
9954 LIBS=$ac_check_lib_save_LIBS
9955 fi
9956 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xslt_xsltCleanupGlobals" >&5
9957 $as_echo "$ac_cv_lib_xslt_xsltCleanupGlobals" >&6; }
9958 if test "x$ac_cv_lib_xslt_xsltCleanupGlobals" = xyes; then :
9959   cat >>confdefs.h <<_ACEOF
9960 #define HAVE_LIBXSLT 1
9961 _ACEOF
9962
9963   LIBS="-lxslt $LIBS"
9964
9965 else
9966   as_fn_error $? "library 'xslt' is required for XSLT support" "$LINENO" 5
9967 fi
9968
9969 fi
9970
9971 # Note: We can test for libldap_r only after we know PTHREAD_LIBS
9972 if test "$with_ldap" = yes ; then
9973   _LIBS="$LIBS"
9974   if test "$PORTNAME" != "win32"; then
9975     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
9976 $as_echo_n "checking for ldap_bind in -lldap... " >&6; }
9977 if ${ac_cv_lib_ldap_ldap_bind+:} false; then :
9978   $as_echo_n "(cached) " >&6
9979 else
9980   ac_check_lib_save_LIBS=$LIBS
9981 LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
9982 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9983 /* end confdefs.h.  */
9984
9985 /* Override any GCC internal prototype to avoid an error.
9986    Use char because int might match the return type of a GCC
9987    builtin and then its argument prototype would still apply.  */
9988 #ifdef __cplusplus
9989 extern "C"
9990 #endif
9991 char ldap_bind ();
9992 int
9993 main ()
9994 {
9995 return ldap_bind ();
9996   ;
9997   return 0;
9998 }
9999 _ACEOF
10000 if ac_fn_c_try_link "$LINENO"; then :
10001   ac_cv_lib_ldap_ldap_bind=yes
10002 else
10003   ac_cv_lib_ldap_ldap_bind=no
10004 fi
10005 rm -f core conftest.err conftest.$ac_objext \
10006     conftest$ac_exeext conftest.$ac_ext
10007 LIBS=$ac_check_lib_save_LIBS
10008 fi
10009 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
10010 $as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
10011 if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
10012   cat >>confdefs.h <<_ACEOF
10013 #define HAVE_LIBLDAP 1
10014 _ACEOF
10015
10016   LIBS="-lldap $LIBS"
10017
10018 else
10019   as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
10020 fi
10021
10022     LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
10023     if test "$enable_thread_safety" = yes; then
10024       # on some platforms ldap_r fails to link without PTHREAD_LIBS
10025       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_simple_bind in -lldap_r" >&5
10026 $as_echo_n "checking for ldap_simple_bind in -lldap_r... " >&6; }
10027 if ${ac_cv_lib_ldap_r_ldap_simple_bind+:} false; then :
10028   $as_echo_n "(cached) " >&6
10029 else
10030   ac_check_lib_save_LIBS=$LIBS
10031 LIBS="-lldap_r $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $LIBS"
10032 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10033 /* end confdefs.h.  */
10034
10035 /* Override any GCC internal prototype to avoid an error.
10036    Use char because int might match the return type of a GCC
10037    builtin and then its argument prototype would still apply.  */
10038 #ifdef __cplusplus
10039 extern "C"
10040 #endif
10041 char ldap_simple_bind ();
10042 int
10043 main ()
10044 {
10045 return ldap_simple_bind ();
10046   ;
10047   return 0;
10048 }
10049 _ACEOF
10050 if ac_fn_c_try_link "$LINENO"; then :
10051   ac_cv_lib_ldap_r_ldap_simple_bind=yes
10052 else
10053   ac_cv_lib_ldap_r_ldap_simple_bind=no
10054 fi
10055 rm -f core conftest.err conftest.$ac_objext \
10056     conftest$ac_exeext conftest.$ac_ext
10057 LIBS=$ac_check_lib_save_LIBS
10058 fi
10059 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_r_ldap_simple_bind" >&5
10060 $as_echo "$ac_cv_lib_ldap_r_ldap_simple_bind" >&6; }
10061 if test "x$ac_cv_lib_ldap_r_ldap_simple_bind" = xyes; then :
10062   cat >>confdefs.h <<_ACEOF
10063 #define HAVE_LIBLDAP_R 1
10064 _ACEOF
10065
10066   LIBS="-lldap_r $LIBS"
10067
10068 else
10069   as_fn_error $? "library 'ldap_r' is required for LDAP" "$LINENO" 5
10070 fi
10071
10072       LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS"
10073     else
10074       LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
10075     fi
10076   else
10077     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lwldap32" >&5
10078 $as_echo_n "checking for ldap_bind in -lwldap32... " >&6; }
10079 if ${ac_cv_lib_wldap32_ldap_bind+:} false; then :
10080   $as_echo_n "(cached) " >&6
10081 else
10082   ac_check_lib_save_LIBS=$LIBS
10083 LIBS="-lwldap32  $LIBS"
10084 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10085 /* end confdefs.h.  */
10086
10087 /* Override any GCC internal prototype to avoid an error.
10088    Use char because int might match the return type of a GCC
10089    builtin and then its argument prototype would still apply.  */
10090 #ifdef __cplusplus
10091 extern "C"
10092 #endif
10093 char ldap_bind ();
10094 int
10095 main ()
10096 {
10097 return ldap_bind ();
10098   ;
10099   return 0;
10100 }
10101 _ACEOF
10102 if ac_fn_c_try_link "$LINENO"; then :
10103   ac_cv_lib_wldap32_ldap_bind=yes
10104 else
10105   ac_cv_lib_wldap32_ldap_bind=no
10106 fi
10107 rm -f core conftest.err conftest.$ac_objext \
10108     conftest$ac_exeext conftest.$ac_ext
10109 LIBS=$ac_check_lib_save_LIBS
10110 fi
10111 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wldap32_ldap_bind" >&5
10112 $as_echo "$ac_cv_lib_wldap32_ldap_bind" >&6; }
10113 if test "x$ac_cv_lib_wldap32_ldap_bind" = xyes; then :
10114   cat >>confdefs.h <<_ACEOF
10115 #define HAVE_LIBWLDAP32 1
10116 _ACEOF
10117
10118   LIBS="-lwldap32 $LIBS"
10119
10120 else
10121   as_fn_error $? "library 'wldap32' is required for LDAP" "$LINENO" 5
10122 fi
10123
10124     LDAP_LIBS_FE="-lwldap32"
10125     LDAP_LIBS_BE="-lwldap32"
10126   fi
10127   LIBS="$_LIBS"
10128 fi
10129
10130
10131
10132 # for contrib/sepgsql
10133 if test "$with_selinux" = yes; then
10134   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_compute_create_name in -lselinux" >&5
10135 $as_echo_n "checking for security_compute_create_name in -lselinux... " >&6; }
10136 if ${ac_cv_lib_selinux_security_compute_create_name+:} false; then :
10137   $as_echo_n "(cached) " >&6
10138 else
10139   ac_check_lib_save_LIBS=$LIBS
10140 LIBS="-lselinux  $LIBS"
10141 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10142 /* end confdefs.h.  */
10143
10144 /* Override any GCC internal prototype to avoid an error.
10145    Use char because int might match the return type of a GCC
10146    builtin and then its argument prototype would still apply.  */
10147 #ifdef __cplusplus
10148 extern "C"
10149 #endif
10150 char security_compute_create_name ();
10151 int
10152 main ()
10153 {
10154 return security_compute_create_name ();
10155   ;
10156   return 0;
10157 }
10158 _ACEOF
10159 if ac_fn_c_try_link "$LINENO"; then :
10160   ac_cv_lib_selinux_security_compute_create_name=yes
10161 else
10162   ac_cv_lib_selinux_security_compute_create_name=no
10163 fi
10164 rm -f core conftest.err conftest.$ac_objext \
10165     conftest$ac_exeext conftest.$ac_ext
10166 LIBS=$ac_check_lib_save_LIBS
10167 fi
10168 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_compute_create_name" >&5
10169 $as_echo "$ac_cv_lib_selinux_security_compute_create_name" >&6; }
10170 if test "x$ac_cv_lib_selinux_security_compute_create_name" = xyes; then :
10171   cat >>confdefs.h <<_ACEOF
10172 #define HAVE_LIBSELINUX 1
10173 _ACEOF
10174
10175   LIBS="-lselinux $LIBS"
10176
10177 else
10178   as_fn_error $? "library 'libselinux', version 2.1.10 or newer, is required for SELinux support" "$LINENO" 5
10179 fi
10180
10181 fi
10182
10183 # for contrib/uuid-ossp
10184 if test "$with_uuid" = bsd ; then
10185   # On BSD, the UUID functions are in libc
10186   ac_fn_c_check_func "$LINENO" "uuid_to_string" "ac_cv_func_uuid_to_string"
10187 if test "x$ac_cv_func_uuid_to_string" = xyes; then :
10188   UUID_LIBS=""
10189 else
10190   as_fn_error $? "BSD UUID functions are not present" "$LINENO" 5
10191 fi
10192
10193 elif test "$with_uuid" = e2fs ; then
10194   # On macOS, the UUID functions are in libc
10195   ac_fn_c_check_func "$LINENO" "uuid_generate" "ac_cv_func_uuid_generate"
10196 if test "x$ac_cv_func_uuid_generate" = xyes; then :
10197   UUID_LIBS=""
10198 else
10199   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5
10200 $as_echo_n "checking for uuid_generate in -luuid... " >&6; }
10201 if ${ac_cv_lib_uuid_uuid_generate+:} false; then :
10202   $as_echo_n "(cached) " >&6
10203 else
10204   ac_check_lib_save_LIBS=$LIBS
10205 LIBS="-luuid  $LIBS"
10206 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10207 /* end confdefs.h.  */
10208
10209 /* Override any GCC internal prototype to avoid an error.
10210    Use char because int might match the return type of a GCC
10211    builtin and then its argument prototype would still apply.  */
10212 #ifdef __cplusplus
10213 extern "C"
10214 #endif
10215 char uuid_generate ();
10216 int
10217 main ()
10218 {
10219 return uuid_generate ();
10220   ;
10221   return 0;
10222 }
10223 _ACEOF
10224 if ac_fn_c_try_link "$LINENO"; then :
10225   ac_cv_lib_uuid_uuid_generate=yes
10226 else
10227   ac_cv_lib_uuid_uuid_generate=no
10228 fi
10229 rm -f core conftest.err conftest.$ac_objext \
10230     conftest$ac_exeext conftest.$ac_ext
10231 LIBS=$ac_check_lib_save_LIBS
10232 fi
10233 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5
10234 $as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; }
10235 if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then :
10236   UUID_LIBS="-luuid"
10237 else
10238   as_fn_error $? "library 'uuid' is required for E2FS UUID" "$LINENO" 5
10239 fi
10240
10241 fi
10242
10243 elif test "$with_uuid" = ossp ; then
10244   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_export in -lossp-uuid" >&5
10245 $as_echo_n "checking for uuid_export in -lossp-uuid... " >&6; }
10246 if ${ac_cv_lib_ossp_uuid_uuid_export+:} false; then :
10247   $as_echo_n "(cached) " >&6
10248 else
10249   ac_check_lib_save_LIBS=$LIBS
10250 LIBS="-lossp-uuid  $LIBS"
10251 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10252 /* end confdefs.h.  */
10253
10254 /* Override any GCC internal prototype to avoid an error.
10255    Use char because int might match the return type of a GCC
10256    builtin and then its argument prototype would still apply.  */
10257 #ifdef __cplusplus
10258 extern "C"
10259 #endif
10260 char uuid_export ();
10261 int
10262 main ()
10263 {
10264 return uuid_export ();
10265   ;
10266   return 0;
10267 }
10268 _ACEOF
10269 if ac_fn_c_try_link "$LINENO"; then :
10270   ac_cv_lib_ossp_uuid_uuid_export=yes
10271 else
10272   ac_cv_lib_ossp_uuid_uuid_export=no
10273 fi
10274 rm -f core conftest.err conftest.$ac_objext \
10275     conftest$ac_exeext conftest.$ac_ext
10276 LIBS=$ac_check_lib_save_LIBS
10277 fi
10278 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossp_uuid_uuid_export" >&5
10279 $as_echo "$ac_cv_lib_ossp_uuid_uuid_export" >&6; }
10280 if test "x$ac_cv_lib_ossp_uuid_uuid_export" = xyes; then :
10281   UUID_LIBS="-lossp-uuid"
10282 else
10283   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_export in -luuid" >&5
10284 $as_echo_n "checking for uuid_export in -luuid... " >&6; }
10285 if ${ac_cv_lib_uuid_uuid_export+:} false; then :
10286   $as_echo_n "(cached) " >&6
10287 else
10288   ac_check_lib_save_LIBS=$LIBS
10289 LIBS="-luuid  $LIBS"
10290 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10291 /* end confdefs.h.  */
10292
10293 /* Override any GCC internal prototype to avoid an error.
10294    Use char because int might match the return type of a GCC
10295    builtin and then its argument prototype would still apply.  */
10296 #ifdef __cplusplus
10297 extern "C"
10298 #endif
10299 char uuid_export ();
10300 int
10301 main ()
10302 {
10303 return uuid_export ();
10304   ;
10305   return 0;
10306 }
10307 _ACEOF
10308 if ac_fn_c_try_link "$LINENO"; then :
10309   ac_cv_lib_uuid_uuid_export=yes
10310 else
10311   ac_cv_lib_uuid_uuid_export=no
10312 fi
10313 rm -f core conftest.err conftest.$ac_objext \
10314     conftest$ac_exeext conftest.$ac_ext
10315 LIBS=$ac_check_lib_save_LIBS
10316 fi
10317 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_export" >&5
10318 $as_echo "$ac_cv_lib_uuid_uuid_export" >&6; }
10319 if test "x$ac_cv_lib_uuid_uuid_export" = xyes; then :
10320   UUID_LIBS="-luuid"
10321 else
10322   as_fn_error $? "library 'ossp-uuid' or 'uuid' is required for OSSP UUID" "$LINENO" 5
10323 fi
10324
10325 fi
10326
10327 fi
10328
10329
10330
10331 ##
10332 ## Header files
10333 ##
10334
10335 for ac_header in atomic.h crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h
10336 do :
10337   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
10338 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
10339 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
10340   cat >>confdefs.h <<_ACEOF
10341 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
10342 _ACEOF
10343
10344 fi
10345
10346 done
10347
10348
10349 # On BSD, test for net/if.h will fail unless sys/socket.h
10350 # is included first.
10351 for ac_header in net/if.h
10352 do :
10353   ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "$ac_includes_default
10354 #include <sys/socket.h>
10355
10356 "
10357 if test "x$ac_cv_header_net_if_h" = xyes; then :
10358   cat >>confdefs.h <<_ACEOF
10359 #define HAVE_NET_IF_H 1
10360 _ACEOF
10361
10362 fi
10363
10364 done
10365
10366
10367 # On OpenBSD, test for sys/ucred.h will fail unless sys/param.h
10368 # is included first.
10369 for ac_header in sys/ucred.h
10370 do :
10371   ac_fn_c_check_header_compile "$LINENO" "sys/ucred.h" "ac_cv_header_sys_ucred_h" "$ac_includes_default
10372 #include <sys/param.h>
10373
10374 "
10375 if test "x$ac_cv_header_sys_ucred_h" = xyes; then :
10376   cat >>confdefs.h <<_ACEOF
10377 #define HAVE_SYS_UCRED_H 1
10378 _ACEOF
10379
10380 fi
10381
10382 done
10383
10384
10385 # At least on IRIX, test for netinet/tcp.h will fail unless
10386 # netinet/in.h is included first.
10387 for ac_header in netinet/tcp.h
10388 do :
10389   ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default
10390 #include <netinet/in.h>
10391
10392 "
10393 if test "x$ac_cv_header_netinet_tcp_h" = xyes; then :
10394   cat >>confdefs.h <<_ACEOF
10395 #define HAVE_NETINET_TCP_H 1
10396 _ACEOF
10397
10398 fi
10399
10400 done
10401
10402
10403 if expr x"$pgac_cv_check_readline" : 'x-lreadline' >/dev/null ; then
10404   for ac_header in readline/readline.h
10405 do :
10406   ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
10407 if test "x$ac_cv_header_readline_readline_h" = xyes; then :
10408   cat >>confdefs.h <<_ACEOF
10409 #define HAVE_READLINE_READLINE_H 1
10410 _ACEOF
10411
10412 else
10413   for ac_header in readline.h
10414 do :
10415   ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
10416 if test "x$ac_cv_header_readline_h" = xyes; then :
10417   cat >>confdefs.h <<_ACEOF
10418 #define HAVE_READLINE_H 1
10419 _ACEOF
10420
10421 else
10422   as_fn_error $? "readline header not found
10423 If you have readline already installed, see config.log for details on the
10424 failure.  It is possible the compiler isn't looking in the proper directory.
10425 Use --without-readline to disable readline support." "$LINENO" 5
10426 fi
10427
10428 done
10429
10430 fi
10431
10432 done
10433
10434   for ac_header in readline/history.h
10435 do :
10436   ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
10437 if test "x$ac_cv_header_readline_history_h" = xyes; then :
10438   cat >>confdefs.h <<_ACEOF
10439 #define HAVE_READLINE_HISTORY_H 1
10440 _ACEOF
10441
10442 else
10443   for ac_header in history.h
10444 do :
10445   ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
10446 if test "x$ac_cv_header_history_h" = xyes; then :
10447   cat >>confdefs.h <<_ACEOF
10448 #define HAVE_HISTORY_H 1
10449 _ACEOF
10450
10451 else
10452   as_fn_error $? "history header not found
10453 If you have readline already installed, see config.log for details on the
10454 failure.  It is possible the compiler isn't looking in the proper directory.
10455 Use --without-readline to disable readline support." "$LINENO" 5
10456 fi
10457
10458 done
10459
10460 fi
10461
10462 done
10463
10464 fi
10465
10466 if expr x"$pgac_cv_check_readline" : 'x-ledit' >/dev/null ; then
10467 # Some installations of libedit usurp /usr/include/readline/, which seems
10468 # bad practice, since in combined installations readline will have its headers
10469 # there.  We might have to resort to AC_EGREP checks to make sure we found
10470 # the proper header...
10471   for ac_header in editline/readline.h
10472 do :
10473   ac_fn_c_check_header_mongrel "$LINENO" "editline/readline.h" "ac_cv_header_editline_readline_h" "$ac_includes_default"
10474 if test "x$ac_cv_header_editline_readline_h" = xyes; then :
10475   cat >>confdefs.h <<_ACEOF
10476 #define HAVE_EDITLINE_READLINE_H 1
10477 _ACEOF
10478
10479 else
10480   for ac_header in readline.h
10481 do :
10482   ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
10483 if test "x$ac_cv_header_readline_h" = xyes; then :
10484   cat >>confdefs.h <<_ACEOF
10485 #define HAVE_READLINE_H 1
10486 _ACEOF
10487
10488 else
10489   for ac_header in readline/readline.h
10490 do :
10491   ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
10492 if test "x$ac_cv_header_readline_readline_h" = xyes; then :
10493   cat >>confdefs.h <<_ACEOF
10494 #define HAVE_READLINE_READLINE_H 1
10495 _ACEOF
10496
10497 else
10498   as_fn_error $? "readline header not found
10499 If you have libedit already installed, see config.log for details on the
10500 failure.  It is possible the compiler isn't looking in the proper directory.
10501 Use --without-readline to disable libedit support." "$LINENO" 5
10502 fi
10503
10504 done
10505
10506 fi
10507
10508 done
10509
10510 fi
10511
10512 done
10513
10514 # Note: in a libedit installation, history.h is sometimes a dummy, and may
10515 # not be there at all.  Hence, don't complain if not found.  We must check
10516 # though, since in yet other versions it is an independent header.
10517   for ac_header in editline/history.h
10518 do :
10519   ac_fn_c_check_header_mongrel "$LINENO" "editline/history.h" "ac_cv_header_editline_history_h" "$ac_includes_default"
10520 if test "x$ac_cv_header_editline_history_h" = xyes; then :
10521   cat >>confdefs.h <<_ACEOF
10522 #define HAVE_EDITLINE_HISTORY_H 1
10523 _ACEOF
10524
10525 else
10526   for ac_header in history.h
10527 do :
10528   ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
10529 if test "x$ac_cv_header_history_h" = xyes; then :
10530   cat >>confdefs.h <<_ACEOF
10531 #define HAVE_HISTORY_H 1
10532 _ACEOF
10533
10534 else
10535   for ac_header in readline/history.h
10536 do :
10537   ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
10538 if test "x$ac_cv_header_readline_history_h" = xyes; then :
10539   cat >>confdefs.h <<_ACEOF
10540 #define HAVE_READLINE_HISTORY_H 1
10541 _ACEOF
10542
10543 fi
10544
10545 done
10546
10547 fi
10548
10549 done
10550
10551 fi
10552
10553 done
10554
10555 fi
10556
10557 if test "$with_zlib" = yes; then
10558   ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
10559 if test "x$ac_cv_header_zlib_h" = xyes; then :
10560
10561 else
10562   as_fn_error $? "zlib header not found
10563 If you have zlib already installed, see config.log for details on the
10564 failure.  It is possible the compiler isn't looking in the proper directory.
10565 Use --without-zlib to disable zlib support." "$LINENO" 5
10566 fi
10567
10568
10569 fi
10570
10571 if test "$with_gssapi" = yes ; then
10572   for ac_header in gssapi/gssapi.h
10573 do :
10574   ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default"
10575 if test "x$ac_cv_header_gssapi_gssapi_h" = xyes; then :
10576   cat >>confdefs.h <<_ACEOF
10577 #define HAVE_GSSAPI_GSSAPI_H 1
10578 _ACEOF
10579
10580 else
10581   for ac_header in gssapi.h
10582 do :
10583   ac_fn_c_check_header_mongrel "$LINENO" "gssapi.h" "ac_cv_header_gssapi_h" "$ac_includes_default"
10584 if test "x$ac_cv_header_gssapi_h" = xyes; then :
10585   cat >>confdefs.h <<_ACEOF
10586 #define HAVE_GSSAPI_H 1
10587 _ACEOF
10588
10589 else
10590   as_fn_error $? "gssapi.h header file is required for GSSAPI" "$LINENO" 5
10591 fi
10592
10593 done
10594
10595 fi
10596
10597 done
10598
10599 fi
10600
10601 if test "$with_openssl" = yes ; then
10602   ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default"
10603 if test "x$ac_cv_header_openssl_ssl_h" = xyes; then :
10604
10605 else
10606   as_fn_error $? "header file <openssl/ssl.h> is required for OpenSSL" "$LINENO" 5
10607 fi
10608
10609
10610   ac_fn_c_check_header_mongrel "$LINENO" "openssl/err.h" "ac_cv_header_openssl_err_h" "$ac_includes_default"
10611 if test "x$ac_cv_header_openssl_err_h" = xyes; then :
10612
10613 else
10614   as_fn_error $? "header file <openssl/err.h> is required for OpenSSL" "$LINENO" 5
10615 fi
10616
10617
10618 fi
10619
10620 if test "$with_pam" = yes ; then
10621   for ac_header in security/pam_appl.h
10622 do :
10623   ac_fn_c_check_header_mongrel "$LINENO" "security/pam_appl.h" "ac_cv_header_security_pam_appl_h" "$ac_includes_default"
10624 if test "x$ac_cv_header_security_pam_appl_h" = xyes; then :
10625   cat >>confdefs.h <<_ACEOF
10626 #define HAVE_SECURITY_PAM_APPL_H 1
10627 _ACEOF
10628
10629 else
10630   for ac_header in pam/pam_appl.h
10631 do :
10632   ac_fn_c_check_header_mongrel "$LINENO" "pam/pam_appl.h" "ac_cv_header_pam_pam_appl_h" "$ac_includes_default"
10633 if test "x$ac_cv_header_pam_pam_appl_h" = xyes; then :
10634   cat >>confdefs.h <<_ACEOF
10635 #define HAVE_PAM_PAM_APPL_H 1
10636 _ACEOF
10637
10638 else
10639   as_fn_error $? "header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM." "$LINENO" 5
10640 fi
10641
10642 done
10643
10644 fi
10645
10646 done
10647
10648 fi
10649
10650 if test "$with_bsd_auth" = yes ; then
10651   ac_fn_c_check_header_mongrel "$LINENO" "bsd_auth.h" "ac_cv_header_bsd_auth_h" "$ac_includes_default"
10652 if test "x$ac_cv_header_bsd_auth_h" = xyes; then :
10653
10654 else
10655   as_fn_error $? "header file <bsd_auth.h> is required for BSD Authentication support" "$LINENO" 5
10656 fi
10657
10658
10659 fi
10660
10661 if test "$with_systemd" = yes ; then
10662   ac_fn_c_check_header_mongrel "$LINENO" "systemd/sd-daemon.h" "ac_cv_header_systemd_sd_daemon_h" "$ac_includes_default"
10663 if test "x$ac_cv_header_systemd_sd_daemon_h" = xyes; then :
10664
10665 else
10666   as_fn_error $? "header file <systemd/sd-daemon.h> is required for systemd support" "$LINENO" 5
10667 fi
10668
10669
10670 fi
10671
10672 if test "$with_libxml" = yes ; then
10673   ac_fn_c_check_header_mongrel "$LINENO" "libxml/parser.h" "ac_cv_header_libxml_parser_h" "$ac_includes_default"
10674 if test "x$ac_cv_header_libxml_parser_h" = xyes; then :
10675
10676 else
10677   as_fn_error $? "header file <libxml/parser.h> is required for XML support" "$LINENO" 5
10678 fi
10679
10680
10681 fi
10682
10683 if test "$with_libxslt" = yes ; then
10684   ac_fn_c_check_header_mongrel "$LINENO" "libxslt/xslt.h" "ac_cv_header_libxslt_xslt_h" "$ac_includes_default"
10685 if test "x$ac_cv_header_libxslt_xslt_h" = xyes; then :
10686
10687 else
10688   as_fn_error $? "header file <libxslt/xslt.h> is required for XSLT support" "$LINENO" 5
10689 fi
10690
10691
10692 fi
10693
10694 if test "$with_ldap" = yes ; then
10695   if test "$PORTNAME" != "win32"; then
10696      for ac_header in ldap.h
10697 do :
10698   ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default"
10699 if test "x$ac_cv_header_ldap_h" = xyes; then :
10700   cat >>confdefs.h <<_ACEOF
10701 #define HAVE_LDAP_H 1
10702 _ACEOF
10703
10704 else
10705   as_fn_error $? "header file <ldap.h> is required for LDAP" "$LINENO" 5
10706 fi
10707
10708 done
10709
10710      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compatible LDAP implementation" >&5
10711 $as_echo_n "checking for compatible LDAP implementation... " >&6; }
10712 if ${pgac_cv_ldap_safe+:} false; then :
10713   $as_echo_n "(cached) " >&6
10714 else
10715   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10716 /* end confdefs.h.  */
10717 #include <ldap.h>
10718 #if !defined(LDAP_VENDOR_VERSION) || \
10719      (defined(LDAP_API_FEATURE_X_OPENLDAP) && \
10720       LDAP_VENDOR_VERSION >= 20424 && LDAP_VENDOR_VERSION <= 20431)
10721 choke me
10722 #endif
10723 int
10724 main ()
10725 {
10726
10727   ;
10728   return 0;
10729 }
10730 _ACEOF
10731 if ac_fn_c_try_compile "$LINENO"; then :
10732   pgac_cv_ldap_safe=yes
10733 else
10734   pgac_cv_ldap_safe=no
10735 fi
10736 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10737 fi
10738 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_ldap_safe" >&5
10739 $as_echo "$pgac_cv_ldap_safe" >&6; }
10740
10741 if test "$pgac_cv_ldap_safe" != yes; then
10742   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
10743 *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
10744 *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
10745 *** also uses LDAP will crash on exit." >&5
10746 $as_echo "$as_me: WARNING:
10747 *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
10748 *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
10749 *** also uses LDAP will crash on exit." >&2;}
10750 fi
10751   else
10752      for ac_header in winldap.h
10753 do :
10754   ac_fn_c_check_header_compile "$LINENO" "winldap.h" "ac_cv_header_winldap_h" "$ac_includes_default
10755 #include <windows.h>
10756
10757 "
10758 if test "x$ac_cv_header_winldap_h" = xyes; then :
10759   cat >>confdefs.h <<_ACEOF
10760 #define HAVE_WINLDAP_H 1
10761 _ACEOF
10762
10763 else
10764   as_fn_error $? "header file <winldap.h> is required for LDAP" "$LINENO" 5
10765 fi
10766
10767 done
10768
10769   fi
10770 fi
10771
10772 if test "$with_bonjour" = yes ; then
10773   ac_fn_c_check_header_mongrel "$LINENO" "dns_sd.h" "ac_cv_header_dns_sd_h" "$ac_includes_default"
10774 if test "x$ac_cv_header_dns_sd_h" = xyes; then :
10775
10776 else
10777   as_fn_error $? "header file <dns_sd.h> is required for Bonjour" "$LINENO" 5
10778 fi
10779
10780
10781 fi
10782
10783 # for contrib/uuid-ossp
10784 if test "$with_uuid" = bsd ; then
10785   for ac_header in uuid.h
10786 do :
10787   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
10788 if test "x$ac_cv_header_uuid_h" = xyes; then :
10789   cat >>confdefs.h <<_ACEOF
10790 #define HAVE_UUID_H 1
10791 _ACEOF
10792  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10793 /* end confdefs.h.  */
10794 #include <uuid.h>
10795
10796 _ACEOF
10797 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10798   $EGREP "uuid_to_string" >/dev/null 2>&1; then :
10799
10800 else
10801   as_fn_error $? "header file <uuid.h> does not match BSD UUID library" "$LINENO" 5
10802 fi
10803 rm -f conftest*
10804
10805 else
10806   as_fn_error $? "header file <uuid.h> is required for BSD UUID" "$LINENO" 5
10807 fi
10808
10809 done
10810
10811 elif test "$with_uuid" = e2fs ; then
10812   for ac_header in uuid/uuid.h
10813 do :
10814   ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
10815 if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
10816   cat >>confdefs.h <<_ACEOF
10817 #define HAVE_UUID_UUID_H 1
10818 _ACEOF
10819  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10820 /* end confdefs.h.  */
10821 #include <uuid/uuid.h>
10822
10823 _ACEOF
10824 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10825   $EGREP "uuid_generate" >/dev/null 2>&1; then :
10826
10827 else
10828   as_fn_error $? "header file <uuid/uuid.h> does not match E2FS UUID library" "$LINENO" 5
10829 fi
10830 rm -f conftest*
10831
10832 else
10833   for ac_header in uuid.h
10834 do :
10835   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
10836 if test "x$ac_cv_header_uuid_h" = xyes; then :
10837   cat >>confdefs.h <<_ACEOF
10838 #define HAVE_UUID_H 1
10839 _ACEOF
10840  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10841 /* end confdefs.h.  */
10842 #include <uuid.h>
10843
10844 _ACEOF
10845 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10846   $EGREP "uuid_generate" >/dev/null 2>&1; then :
10847
10848 else
10849   as_fn_error $? "header file <uuid.h> does not match E2FS UUID library" "$LINENO" 5
10850 fi
10851 rm -f conftest*
10852
10853 else
10854   as_fn_error $? "header file <uuid/uuid.h> or <uuid.h> is required for E2FS UUID" "$LINENO" 5
10855 fi
10856
10857 done
10858
10859 fi
10860
10861 done
10862
10863 elif test "$with_uuid" = ossp ; then
10864   for ac_header in ossp/uuid.h
10865 do :
10866   ac_fn_c_check_header_mongrel "$LINENO" "ossp/uuid.h" "ac_cv_header_ossp_uuid_h" "$ac_includes_default"
10867 if test "x$ac_cv_header_ossp_uuid_h" = xyes; then :
10868   cat >>confdefs.h <<_ACEOF
10869 #define HAVE_OSSP_UUID_H 1
10870 _ACEOF
10871  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10872 /* end confdefs.h.  */
10873 #include <ossp/uuid.h>
10874
10875 _ACEOF
10876 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10877   $EGREP "uuid_export" >/dev/null 2>&1; then :
10878
10879 else
10880   as_fn_error $? "header file <ossp/uuid.h> does not match OSSP UUID library" "$LINENO" 5
10881 fi
10882 rm -f conftest*
10883
10884 else
10885   for ac_header in uuid.h
10886 do :
10887   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
10888 if test "x$ac_cv_header_uuid_h" = xyes; then :
10889   cat >>confdefs.h <<_ACEOF
10890 #define HAVE_UUID_H 1
10891 _ACEOF
10892  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10893 /* end confdefs.h.  */
10894 #include <uuid.h>
10895
10896 _ACEOF
10897 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10898   $EGREP "uuid_export" >/dev/null 2>&1; then :
10899
10900 else
10901   as_fn_error $? "header file <uuid.h> does not match OSSP UUID library" "$LINENO" 5
10902 fi
10903 rm -f conftest*
10904
10905 else
10906   as_fn_error $? "header file <ossp/uuid.h> or <uuid.h> is required for OSSP UUID" "$LINENO" 5
10907 fi
10908
10909 done
10910
10911 fi
10912
10913 done
10914
10915 fi
10916
10917 if test "$PORTNAME" = "win32" ; then
10918    for ac_header in crtdefs.h
10919 do :
10920   ac_fn_c_check_header_mongrel "$LINENO" "crtdefs.h" "ac_cv_header_crtdefs_h" "$ac_includes_default"
10921 if test "x$ac_cv_header_crtdefs_h" = xyes; then :
10922   cat >>confdefs.h <<_ACEOF
10923 #define HAVE_CRTDEFS_H 1
10924 _ACEOF
10925
10926 fi
10927
10928 done
10929
10930 fi
10931
10932 ##
10933 ## Types, structures, compiler characteristics
10934 ##
10935
10936   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
10937 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
10938 if ${ac_cv_c_bigendian+:} false; then :
10939   $as_echo_n "(cached) " >&6
10940 else
10941   ac_cv_c_bigendian=unknown
10942     # See if we're dealing with a universal compiler.
10943     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10944 /* end confdefs.h.  */
10945 #ifndef __APPLE_CC__
10946                not a universal capable compiler
10947              #endif
10948              typedef int dummy;
10949
10950 _ACEOF
10951 if ac_fn_c_try_compile "$LINENO"; then :
10952
10953         # Check for potential -arch flags.  It is not universal unless
10954         # there are at least two -arch flags with different values.
10955         ac_arch=
10956         ac_prev=
10957         for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
10958          if test -n "$ac_prev"; then
10959            case $ac_word in
10960              i?86 | x86_64 | ppc | ppc64)
10961                if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
10962                  ac_arch=$ac_word
10963                else
10964                  ac_cv_c_bigendian=universal
10965                  break
10966                fi
10967                ;;
10968            esac
10969            ac_prev=
10970          elif test "x$ac_word" = "x-arch"; then
10971            ac_prev=arch
10972          fi
10973        done
10974 fi
10975 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10976     if test $ac_cv_c_bigendian = unknown; then
10977       # See if sys/param.h defines the BYTE_ORDER macro.
10978       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10979 /* end confdefs.h.  */
10980 #include <sys/types.h>
10981              #include <sys/param.h>
10982
10983 int
10984 main ()
10985 {
10986 #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
10987                      && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
10988                      && LITTLE_ENDIAN)
10989               bogus endian macros
10990              #endif
10991
10992   ;
10993   return 0;
10994 }
10995 _ACEOF
10996 if ac_fn_c_try_compile "$LINENO"; then :
10997   # It does; now see whether it defined to BIG_ENDIAN or not.
10998          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10999 /* end confdefs.h.  */
11000 #include <sys/types.h>
11001                 #include <sys/param.h>
11002
11003 int
11004 main ()
11005 {
11006 #if BYTE_ORDER != BIG_ENDIAN
11007                  not big endian
11008                 #endif
11009
11010   ;
11011   return 0;
11012 }
11013 _ACEOF
11014 if ac_fn_c_try_compile "$LINENO"; then :
11015   ac_cv_c_bigendian=yes
11016 else
11017   ac_cv_c_bigendian=no
11018 fi
11019 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11020 fi
11021 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11022     fi
11023     if test $ac_cv_c_bigendian = unknown; then
11024       # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
11025       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11026 /* end confdefs.h.  */
11027 #include <limits.h>
11028
11029 int
11030 main ()
11031 {
11032 #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
11033               bogus endian macros
11034              #endif
11035
11036   ;
11037   return 0;
11038 }
11039 _ACEOF
11040 if ac_fn_c_try_compile "$LINENO"; then :
11041   # It does; now see whether it defined to _BIG_ENDIAN or not.
11042          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11043 /* end confdefs.h.  */
11044 #include <limits.h>
11045
11046 int
11047 main ()
11048 {
11049 #ifndef _BIG_ENDIAN
11050                  not big endian
11051                 #endif
11052
11053   ;
11054   return 0;
11055 }
11056 _ACEOF
11057 if ac_fn_c_try_compile "$LINENO"; then :
11058   ac_cv_c_bigendian=yes
11059 else
11060   ac_cv_c_bigendian=no
11061 fi
11062 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11063 fi
11064 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11065     fi
11066     if test $ac_cv_c_bigendian = unknown; then
11067       # Compile a test program.
11068       if test "$cross_compiling" = yes; then :
11069   # Try to guess by grepping values from an object file.
11070          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11071 /* end confdefs.h.  */
11072 short int ascii_mm[] =
11073                   { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
11074                 short int ascii_ii[] =
11075                   { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
11076                 int use_ascii (int i) {
11077                   return ascii_mm[i] + ascii_ii[i];
11078                 }
11079                 short int ebcdic_ii[] =
11080                   { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
11081                 short int ebcdic_mm[] =
11082                   { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
11083                 int use_ebcdic (int i) {
11084                   return ebcdic_mm[i] + ebcdic_ii[i];
11085                 }
11086                 extern int foo;
11087
11088 int
11089 main ()
11090 {
11091 return use_ascii (foo) == use_ebcdic (foo);
11092   ;
11093   return 0;
11094 }
11095 _ACEOF
11096 if ac_fn_c_try_compile "$LINENO"; then :
11097   if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
11098               ac_cv_c_bigendian=yes
11099             fi
11100             if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
11101               if test "$ac_cv_c_bigendian" = unknown; then
11102                 ac_cv_c_bigendian=no
11103               else
11104                 # finding both strings is unlikely to happen, but who knows?
11105                 ac_cv_c_bigendian=unknown
11106               fi
11107             fi
11108 fi
11109 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11110 else
11111   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11112 /* end confdefs.h.  */
11113 $ac_includes_default
11114 int
11115 main ()
11116 {
11117
11118              /* Are we little or big endian?  From Harbison&Steele.  */
11119              union
11120              {
11121                long int l;
11122                char c[sizeof (long int)];
11123              } u;
11124              u.l = 1;
11125              return u.c[sizeof (long int) - 1] == 1;
11126
11127   ;
11128   return 0;
11129 }
11130 _ACEOF
11131 if ac_fn_c_try_run "$LINENO"; then :
11132   ac_cv_c_bigendian=no
11133 else
11134   ac_cv_c_bigendian=yes
11135 fi
11136 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11137   conftest.$ac_objext conftest.beam conftest.$ac_ext
11138 fi
11139
11140     fi
11141 fi
11142 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
11143 $as_echo "$ac_cv_c_bigendian" >&6; }
11144  case $ac_cv_c_bigendian in #(
11145    yes)
11146      $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
11147 ;; #(
11148    no)
11149       ;; #(
11150    universal)
11151
11152 $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
11153
11154      ;; #(
11155    *)
11156      as_fn_error $? "unknown endianness
11157  presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
11158  esac
11159
11160 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
11161 $as_echo_n "checking for inline... " >&6; }
11162 if ${ac_cv_c_inline+:} false; then :
11163   $as_echo_n "(cached) " >&6
11164 else
11165   ac_cv_c_inline=no
11166 for ac_kw in inline __inline__ __inline; do
11167   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11168 /* end confdefs.h.  */
11169 #ifndef __cplusplus
11170 typedef int foo_t;
11171 static $ac_kw foo_t static_foo () {return 0; }
11172 $ac_kw foo_t foo () {return 0; }
11173 #endif
11174
11175 _ACEOF
11176 if ac_fn_c_try_compile "$LINENO"; then :
11177   ac_cv_c_inline=$ac_kw
11178 fi
11179 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11180   test "$ac_cv_c_inline" != no && break
11181 done
11182
11183 fi
11184 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
11185 $as_echo "$ac_cv_c_inline" >&6; }
11186
11187 case $ac_cv_c_inline in
11188   inline | yes) ;;
11189   *)
11190     case $ac_cv_c_inline in
11191       no) ac_val=;;
11192       *) ac_val=$ac_cv_c_inline;;
11193     esac
11194     cat >>confdefs.h <<_ACEOF
11195 #ifndef __cplusplus
11196 #define inline $ac_val
11197 #endif
11198 _ACEOF
11199     ;;
11200 esac
11201
11202 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf format archetype" >&5
11203 $as_echo_n "checking for printf format archetype... " >&6; }
11204 if ${pgac_cv_printf_archetype+:} false; then :
11205   $as_echo_n "(cached) " >&6
11206 else
11207   ac_save_c_werror_flag=$ac_c_werror_flag
11208 ac_c_werror_flag=yes
11209 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11210 /* end confdefs.h.  */
11211 extern int
11212 pgac_write(int ignore, const char *fmt,...)
11213 __attribute__((format(gnu_printf, 2, 3)));
11214 int
11215 main ()
11216 {
11217
11218   ;
11219   return 0;
11220 }
11221 _ACEOF
11222 if ac_fn_c_try_compile "$LINENO"; then :
11223   pgac_cv_printf_archetype=gnu_printf
11224 else
11225   pgac_cv_printf_archetype=printf
11226 fi
11227 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11228 ac_c_werror_flag=$ac_save_c_werror_flag
11229 fi
11230 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_printf_archetype" >&5
11231 $as_echo "$pgac_cv_printf_archetype" >&6; }
11232
11233 cat >>confdefs.h <<_ACEOF
11234 #define PG_PRINTF_ATTRIBUTE $pgac_cv_printf_archetype
11235 _ACEOF
11236
11237
11238
11239   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array members" >&5
11240 $as_echo_n "checking for flexible array members... " >&6; }
11241 if ${ac_cv_c_flexmember+:} false; then :
11242   $as_echo_n "(cached) " >&6
11243 else
11244   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11245 /* end confdefs.h.  */
11246 #include <stdlib.h>
11247             #include <stdio.h>
11248             #include <stddef.h>
11249             struct s { int n; double d[]; };
11250 int
11251 main ()
11252 {
11253 int m = getchar ();
11254             struct s *p = malloc (offsetof (struct s, d)
11255                                   + m * sizeof (double));
11256             p->d[0] = 0.0;
11257             return p->d != (double *) NULL;
11258   ;
11259   return 0;
11260 }
11261 _ACEOF
11262 if ac_fn_c_try_compile "$LINENO"; then :
11263   ac_cv_c_flexmember=yes
11264 else
11265   ac_cv_c_flexmember=no
11266 fi
11267 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11268 fi
11269 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
11270 $as_echo "$ac_cv_c_flexmember" >&6; }
11271   if test $ac_cv_c_flexmember = yes; then
11272
11273 $as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
11274
11275   else
11276     $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
11277
11278   fi
11279
11280 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed types" >&5
11281 $as_echo_n "checking for signed types... " >&6; }
11282 if ${pgac_cv_c_signed+:} false; then :
11283   $as_echo_n "(cached) " >&6
11284 else
11285   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11286 /* end confdefs.h.  */
11287
11288 int
11289 main ()
11290 {
11291 signed char c; signed short s; signed int i;
11292   ;
11293   return 0;
11294 }
11295 _ACEOF
11296 if ac_fn_c_try_compile "$LINENO"; then :
11297   pgac_cv_c_signed=yes
11298 else
11299   pgac_cv_c_signed=no
11300 fi
11301 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11302 fi
11303 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_signed" >&5
11304 $as_echo "$pgac_cv_c_signed" >&6; }
11305 if test x"$pgac_cv_c_signed" = xno ; then
11306
11307 $as_echo "#define signed /**/" >>confdefs.h
11308
11309 fi
11310 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __func__" >&5
11311 $as_echo_n "checking for __func__... " >&6; }
11312 if ${pgac_cv_funcname_func_support+:} false; then :
11313   $as_echo_n "(cached) " >&6
11314 else
11315   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11316 /* end confdefs.h.  */
11317 #include <stdio.h>
11318 int
11319 main ()
11320 {
11321 printf("%s\n", __func__);
11322   ;
11323   return 0;
11324 }
11325 _ACEOF
11326 if ac_fn_c_try_compile "$LINENO"; then :
11327   pgac_cv_funcname_func_support=yes
11328 else
11329   pgac_cv_funcname_func_support=no
11330 fi
11331 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11332 fi
11333 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_func_support" >&5
11334 $as_echo "$pgac_cv_funcname_func_support" >&6; }
11335 if test x"$pgac_cv_funcname_func_support" = xyes ; then
11336
11337 $as_echo "#define HAVE_FUNCNAME__FUNC 1" >>confdefs.h
11338
11339 else
11340 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __FUNCTION__" >&5
11341 $as_echo_n "checking for __FUNCTION__... " >&6; }
11342 if ${pgac_cv_funcname_function_support+:} false; then :
11343   $as_echo_n "(cached) " >&6
11344 else
11345   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11346 /* end confdefs.h.  */
11347 #include <stdio.h>
11348 int
11349 main ()
11350 {
11351 printf("%s\n", __FUNCTION__);
11352   ;
11353   return 0;
11354 }
11355 _ACEOF
11356 if ac_fn_c_try_compile "$LINENO"; then :
11357   pgac_cv_funcname_function_support=yes
11358 else
11359   pgac_cv_funcname_function_support=no
11360 fi
11361 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11362 fi
11363 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_function_support" >&5
11364 $as_echo "$pgac_cv_funcname_function_support" >&6; }
11365 if test x"$pgac_cv_funcname_function_support" = xyes ; then
11366
11367 $as_echo "#define HAVE_FUNCNAME__FUNCTION 1" >>confdefs.h
11368
11369 fi
11370 fi
11371 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Static_assert" >&5
11372 $as_echo_n "checking for _Static_assert... " >&6; }
11373 if ${pgac_cv__static_assert+:} false; then :
11374   $as_echo_n "(cached) " >&6
11375 else
11376   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11377 /* end confdefs.h.  */
11378
11379 int
11380 main ()
11381 {
11382 ({ _Static_assert(1, "foo"); })
11383   ;
11384   return 0;
11385 }
11386 _ACEOF
11387 if ac_fn_c_try_link "$LINENO"; then :
11388   pgac_cv__static_assert=yes
11389 else
11390   pgac_cv__static_assert=no
11391 fi
11392 rm -f core conftest.err conftest.$ac_objext \
11393     conftest$ac_exeext conftest.$ac_ext
11394 fi
11395 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__static_assert" >&5
11396 $as_echo "$pgac_cv__static_assert" >&6; }
11397 if test x"$pgac_cv__static_assert" = xyes ; then
11398
11399 $as_echo "#define HAVE__STATIC_ASSERT 1" >>confdefs.h
11400
11401 fi
11402 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_types_compatible_p" >&5
11403 $as_echo_n "checking for __builtin_types_compatible_p... " >&6; }
11404 if ${pgac_cv__types_compatible+:} false; then :
11405   $as_echo_n "(cached) " >&6
11406 else
11407   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11408 /* end confdefs.h.  */
11409
11410 int
11411 main ()
11412 {
11413  int x; static int y[__builtin_types_compatible_p(__typeof__(x), int)];
11414   ;
11415   return 0;
11416 }
11417 _ACEOF
11418 if ac_fn_c_try_compile "$LINENO"; then :
11419   pgac_cv__types_compatible=yes
11420 else
11421   pgac_cv__types_compatible=no
11422 fi
11423 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11424 fi
11425 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__types_compatible" >&5
11426 $as_echo "$pgac_cv__types_compatible" >&6; }
11427 if test x"$pgac_cv__types_compatible" = xyes ; then
11428
11429 $as_echo "#define HAVE__BUILTIN_TYPES_COMPATIBLE_P 1" >>confdefs.h
11430
11431 fi
11432 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap32" >&5
11433 $as_echo_n "checking for __builtin_bswap32... " >&6; }
11434 if ${pgac_cv__builtin_bswap32+:} false; then :
11435   $as_echo_n "(cached) " >&6
11436 else
11437   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11438 /* end confdefs.h.  */
11439 static unsigned long int x = __builtin_bswap32(0xaabbccdd);
11440
11441 _ACEOF
11442 if ac_fn_c_try_compile "$LINENO"; then :
11443   pgac_cv__builtin_bswap32=yes
11444 else
11445   pgac_cv__builtin_bswap32=no
11446 fi
11447 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11448 fi
11449 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_bswap32" >&5
11450 $as_echo "$pgac_cv__builtin_bswap32" >&6; }
11451 if test x"$pgac_cv__builtin_bswap32" = xyes ; then
11452
11453 $as_echo "#define HAVE__BUILTIN_BSWAP32 1" >>confdefs.h
11454
11455 fi
11456 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap64" >&5
11457 $as_echo_n "checking for __builtin_bswap64... " >&6; }
11458 if ${pgac_cv__builtin_bswap64+:} false; then :
11459   $as_echo_n "(cached) " >&6
11460 else
11461   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11462 /* end confdefs.h.  */
11463 static unsigned long int x = __builtin_bswap64(0xaabbccddeeff0011);
11464
11465 _ACEOF
11466 if ac_fn_c_try_compile "$LINENO"; then :
11467   pgac_cv__builtin_bswap64=yes
11468 else
11469   pgac_cv__builtin_bswap64=no
11470 fi
11471 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11472 fi
11473 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_bswap64" >&5
11474 $as_echo "$pgac_cv__builtin_bswap64" >&6; }
11475 if test x"$pgac_cv__builtin_bswap64" = xyes ; then
11476
11477 $as_echo "#define HAVE__BUILTIN_BSWAP64 1" >>confdefs.h
11478
11479 fi
11480 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_constant_p" >&5
11481 $as_echo_n "checking for __builtin_constant_p... " >&6; }
11482 if ${pgac_cv__builtin_constant_p+:} false; then :
11483   $as_echo_n "(cached) " >&6
11484 else
11485   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11486 /* end confdefs.h.  */
11487 static int x; static int y[__builtin_constant_p(x) ? x : 1];
11488
11489 _ACEOF
11490 if ac_fn_c_try_compile "$LINENO"; then :
11491   pgac_cv__builtin_constant_p=yes
11492 else
11493   pgac_cv__builtin_constant_p=no
11494 fi
11495 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11496 fi
11497 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_constant_p" >&5
11498 $as_echo "$pgac_cv__builtin_constant_p" >&6; }
11499 if test x"$pgac_cv__builtin_constant_p" = xyes ; then
11500
11501 $as_echo "#define HAVE__BUILTIN_CONSTANT_P 1" >>confdefs.h
11502
11503 fi
11504 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_unreachable" >&5
11505 $as_echo_n "checking for __builtin_unreachable... " >&6; }
11506 if ${pgac_cv__builtin_unreachable+:} false; then :
11507   $as_echo_n "(cached) " >&6
11508 else
11509   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11510 /* end confdefs.h.  */
11511
11512 int
11513 main ()
11514 {
11515 __builtin_unreachable();
11516   ;
11517   return 0;
11518 }
11519 _ACEOF
11520 if ac_fn_c_try_link "$LINENO"; then :
11521   pgac_cv__builtin_unreachable=yes
11522 else
11523   pgac_cv__builtin_unreachable=no
11524 fi
11525 rm -f core conftest.err conftest.$ac_objext \
11526     conftest$ac_exeext conftest.$ac_ext
11527 fi
11528 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_unreachable" >&5
11529 $as_echo "$pgac_cv__builtin_unreachable" >&6; }
11530 if test x"$pgac_cv__builtin_unreachable" = xyes ; then
11531
11532 $as_echo "#define HAVE__BUILTIN_UNREACHABLE 1" >>confdefs.h
11533
11534 fi
11535 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for computed goto support" >&5
11536 $as_echo_n "checking for computed goto support... " >&6; }
11537 if ${pgac_cv_computed_goto+:} false; then :
11538   $as_echo_n "(cached) " >&6
11539 else
11540   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11541 /* end confdefs.h.  */
11542
11543 int
11544 main ()
11545 {
11546 void *labeladdrs[] = {&&my_label};
11547   goto *labeladdrs[0];
11548   my_label:
11549   return 1;
11550
11551   ;
11552   return 0;
11553 }
11554 _ACEOF
11555 if ac_fn_c_try_compile "$LINENO"; then :
11556   pgac_cv_computed_goto=yes
11557 else
11558   pgac_cv_computed_goto=no
11559 fi
11560 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11561 fi
11562 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_computed_goto" >&5
11563 $as_echo "$pgac_cv_computed_goto" >&6; }
11564 if test x"$pgac_cv_computed_goto" = xyes ; then
11565
11566 $as_echo "#define HAVE_COMPUTED_GOTO 1" >>confdefs.h
11567
11568 fi
11569 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __VA_ARGS__" >&5
11570 $as_echo_n "checking for __VA_ARGS__... " >&6; }
11571 if ${pgac_cv__va_args+:} false; then :
11572   $as_echo_n "(cached) " >&6
11573 else
11574   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11575 /* end confdefs.h.  */
11576 #include <stdio.h>
11577 int
11578 main ()
11579 {
11580 #define debug(...) fprintf(stderr, __VA_ARGS__)
11581 debug("%s", "blarg");
11582
11583   ;
11584   return 0;
11585 }
11586 _ACEOF
11587 if ac_fn_c_try_compile "$LINENO"; then :
11588   pgac_cv__va_args=yes
11589 else
11590   pgac_cv__va_args=no
11591 fi
11592 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11593 fi
11594 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__va_args" >&5
11595 $as_echo "$pgac_cv__va_args" >&6; }
11596 if test x"$pgac_cv__va_args" = xyes ; then
11597
11598 $as_echo "#define HAVE__VA_ARGS 1" >>confdefs.h
11599
11600 fi
11601 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
11602 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
11603 if ${ac_cv_struct_tm+:} false; then :
11604   $as_echo_n "(cached) " >&6
11605 else
11606   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11607 /* end confdefs.h.  */
11608 #include <sys/types.h>
11609 #include <time.h>
11610
11611 int
11612 main ()
11613 {
11614 struct tm tm;
11615                                      int *p = &tm.tm_sec;
11616                                      return !p;
11617   ;
11618   return 0;
11619 }
11620 _ACEOF
11621 if ac_fn_c_try_compile "$LINENO"; then :
11622   ac_cv_struct_tm=time.h
11623 else
11624   ac_cv_struct_tm=sys/time.h
11625 fi
11626 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11627 fi
11628 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
11629 $as_echo "$ac_cv_struct_tm" >&6; }
11630 if test $ac_cv_struct_tm = sys/time.h; then
11631
11632 $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
11633
11634 fi
11635
11636 ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h>
11637 #include <$ac_cv_struct_tm>
11638
11639 "
11640 if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
11641
11642 cat >>confdefs.h <<_ACEOF
11643 #define HAVE_STRUCT_TM_TM_ZONE 1
11644 _ACEOF
11645
11646
11647 fi
11648
11649 if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
11650
11651 $as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h
11652
11653 fi
11654 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
11655 $as_echo_n "checking for tzname... " >&6; }
11656 if ${ac_cv_var_tzname+:} false; then :
11657   $as_echo_n "(cached) " >&6
11658 else
11659   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11660 /* end confdefs.h.  */
11661 #include <stdlib.h>
11662 #include <time.h>
11663 #ifndef tzname /* For SGI.  */
11664 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
11665 #endif
11666
11667 int
11668 main ()
11669 {
11670 atoi(*tzname);
11671   ;
11672   return 0;
11673 }
11674 _ACEOF
11675 if ac_fn_c_try_link "$LINENO"; then :
11676   ac_cv_var_tzname=yes
11677 else
11678   ac_cv_var_tzname=no
11679 fi
11680 rm -f core conftest.err conftest.$ac_objext \
11681     conftest$ac_exeext conftest.$ac_ext
11682 fi
11683 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5
11684 $as_echo "$ac_cv_var_tzname" >&6; }
11685 if test $ac_cv_var_tzname = yes; then
11686
11687 $as_echo "#define HAVE_TZNAME 1" >>confdefs.h
11688
11689 fi
11690
11691 ac_fn_c_check_type "$LINENO" "union semun" "ac_cv_type_union_semun" "#include <sys/types.h>
11692 #ifdef HAVE_SYS_IPC_H
11693 #include <sys/ipc.h>
11694 #endif
11695 #ifdef HAVE_SYS_SEM_H
11696 #include <sys/sem.h>
11697 #endif
11698 "
11699 if test "x$ac_cv_type_union_semun" = xyes; then :
11700
11701 cat >>confdefs.h <<_ACEOF
11702 #define HAVE_UNION_SEMUN 1
11703 _ACEOF
11704
11705
11706 fi
11707
11708 ac_fn_c_check_type "$LINENO" "struct sockaddr_un" "ac_cv_type_struct_sockaddr_un" "#include <sys/types.h>
11709 #ifdef HAVE_SYS_UN_H
11710 #include <sys/un.h>
11711 #endif
11712
11713 "
11714 if test "x$ac_cv_type_struct_sockaddr_un" = xyes; then :
11715
11716 $as_echo "#define HAVE_UNIX_SOCKETS 1" >>confdefs.h
11717
11718 fi
11719
11720 ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include <sys/types.h>
11721 #include <sys/socket.h>
11722
11723 "
11724 if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
11725
11726 cat >>confdefs.h <<_ACEOF
11727 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
11728 _ACEOF
11729
11730
11731 fi
11732
11733 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
11734 #include <sys/socket.h>
11735
11736 "
11737 if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
11738
11739 cat >>confdefs.h <<_ACEOF
11740 #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
11741 _ACEOF
11742
11743
11744 fi
11745 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_family" "ac_cv_member_struct_sockaddr_storage___ss_family" "#include <sys/types.h>
11746 #include <sys/socket.h>
11747
11748 "
11749 if test "x$ac_cv_member_struct_sockaddr_storage___ss_family" = xyes; then :
11750
11751 cat >>confdefs.h <<_ACEOF
11752 #define HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY 1
11753 _ACEOF
11754
11755
11756 fi
11757 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_len" "ac_cv_member_struct_sockaddr_storage_ss_len" "#include <sys/types.h>
11758 #include <sys/socket.h>
11759
11760 "
11761 if test "x$ac_cv_member_struct_sockaddr_storage_ss_len" = xyes; then :
11762
11763 cat >>confdefs.h <<_ACEOF
11764 #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1
11765 _ACEOF
11766
11767
11768 fi
11769 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_len" "ac_cv_member_struct_sockaddr_storage___ss_len" "#include <sys/types.h>
11770 #include <sys/socket.h>
11771
11772 "
11773 if test "x$ac_cv_member_struct_sockaddr_storage___ss_len" = xyes; then :
11774
11775 cat >>confdefs.h <<_ACEOF
11776 #define HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN 1
11777 _ACEOF
11778
11779
11780 fi
11781 ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include <sys/types.h>
11782 #include <sys/socket.h>
11783
11784 "
11785 if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then :
11786
11787 cat >>confdefs.h <<_ACEOF
11788 #define HAVE_STRUCT_SOCKADDR_SA_LEN 1
11789 _ACEOF
11790
11791
11792 fi
11793
11794 ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "#include <sys/types.h>
11795 #include <sys/socket.h>
11796 #include <netdb.h>
11797
11798 "
11799 if test "x$ac_cv_type_struct_addrinfo" = xyes; then :
11800
11801 cat >>confdefs.h <<_ACEOF
11802 #define HAVE_STRUCT_ADDRINFO 1
11803 _ACEOF
11804
11805
11806 fi
11807
11808
11809   ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
11810 if test "x$ac_cv_type_intptr_t" = xyes; then :
11811
11812 $as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h
11813
11814 else
11815   for ac_type in 'int' 'long int' 'long long int'; do
11816        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11817 /* end confdefs.h.  */
11818 $ac_includes_default
11819 int
11820 main ()
11821 {
11822 static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
11823 test_array [0] = 0;
11824 return test_array [0];
11825
11826   ;
11827   return 0;
11828 }
11829 _ACEOF
11830 if ac_fn_c_try_compile "$LINENO"; then :
11831
11832 cat >>confdefs.h <<_ACEOF
11833 #define intptr_t $ac_type
11834 _ACEOF
11835
11836           ac_type=
11837 fi
11838 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11839        test -z "$ac_type" && break
11840      done
11841 fi
11842
11843
11844
11845   ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
11846 if test "x$ac_cv_type_uintptr_t" = xyes; then :
11847
11848 $as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
11849
11850 else
11851   for ac_type in 'unsigned int' 'unsigned long int' \
11852         'unsigned long long int'; do
11853        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11854 /* end confdefs.h.  */
11855 $ac_includes_default
11856 int
11857 main ()
11858 {
11859 static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
11860 test_array [0] = 0;
11861 return test_array [0];
11862
11863   ;
11864   return 0;
11865 }
11866 _ACEOF
11867 if ac_fn_c_try_compile "$LINENO"; then :
11868
11869 cat >>confdefs.h <<_ACEOF
11870 #define uintptr_t $ac_type
11871 _ACEOF
11872
11873           ac_type=
11874 fi
11875 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11876        test -z "$ac_type" && break
11877      done
11878 fi
11879
11880
11881
11882   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
11883 $as_echo_n "checking for unsigned long long int... " >&6; }
11884 if ${ac_cv_type_unsigned_long_long_int+:} false; then :
11885   $as_echo_n "(cached) " >&6
11886 else
11887   ac_cv_type_unsigned_long_long_int=yes
11888      if test "x${ac_cv_prog_cc_c99-no}" = xno; then
11889        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11890 /* end confdefs.h.  */
11891
11892   /* For now, do not test the preprocessor; as of 2007 there are too many
11893          implementations with broken preprocessors.  Perhaps this can
11894          be revisited in 2012.  In the meantime, code should not expect
11895          #if to work with literals wider than 32 bits.  */
11896       /* Test literals.  */
11897       long long int ll = 9223372036854775807ll;
11898       long long int nll = -9223372036854775807LL;
11899       unsigned long long int ull = 18446744073709551615ULL;
11900       /* Test constant expressions.   */
11901       typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
11902                      ? 1 : -1)];
11903       typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
11904                      ? 1 : -1)];
11905       int i = 63;
11906 int
11907 main ()
11908 {
11909 /* Test availability of runtime routines for shift and division.  */
11910       long long int llmax = 9223372036854775807ll;
11911       unsigned long long int ullmax = 18446744073709551615ull;
11912       return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
11913               | (llmax / ll) | (llmax % ll)
11914               | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
11915               | (ullmax / ull) | (ullmax % ull));
11916   ;
11917   return 0;
11918 }
11919
11920 _ACEOF
11921 if ac_fn_c_try_link "$LINENO"; then :
11922
11923 else
11924   ac_cv_type_unsigned_long_long_int=no
11925 fi
11926 rm -f core conftest.err conftest.$ac_objext \
11927     conftest$ac_exeext conftest.$ac_ext
11928      fi
11929 fi
11930 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
11931 $as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
11932   if test $ac_cv_type_unsigned_long_long_int = yes; then
11933
11934 $as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
11935
11936   fi
11937
11938
11939
11940   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
11941 $as_echo_n "checking for long long int... " >&6; }
11942 if ${ac_cv_type_long_long_int+:} false; then :
11943   $as_echo_n "(cached) " >&6
11944 else
11945   ac_cv_type_long_long_int=yes
11946       if test "x${ac_cv_prog_cc_c99-no}" = xno; then
11947         ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
11948         if test $ac_cv_type_long_long_int = yes; then
11949                                   if test "$cross_compiling" = yes; then :
11950   :
11951 else
11952   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11953 /* end confdefs.h.  */
11954 #include <limits.h>
11955                  #ifndef LLONG_MAX
11956                  # define HALF \
11957                           (1LL << (sizeof (long long int) * CHAR_BIT - 2))
11958                  # define LLONG_MAX (HALF - 1 + HALF)
11959                  #endif
11960 int
11961 main ()
11962 {
11963 long long int n = 1;
11964                  int i;
11965                  for (i = 0; ; i++)
11966                    {
11967                      long long int m = n << i;
11968                      if (m >> i != n)
11969                        return 1;
11970                      if (LLONG_MAX / 2 < m)
11971                        break;
11972                    }
11973                  return 0;
11974   ;
11975   return 0;
11976 }
11977 _ACEOF
11978 if ac_fn_c_try_run "$LINENO"; then :
11979
11980 else
11981   ac_cv_type_long_long_int=no
11982 fi
11983 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11984   conftest.$ac_objext conftest.beam conftest.$ac_ext
11985 fi
11986
11987         fi
11988       fi
11989 fi
11990 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
11991 $as_echo "$ac_cv_type_long_long_int" >&6; }
11992   if test $ac_cv_type_long_long_int = yes; then
11993
11994 $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
11995
11996   fi
11997
11998
11999 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale_t" >&5
12000 $as_echo_n "checking for locale_t... " >&6; }
12001 if ${pgac_cv_type_locale_t+:} false; then :
12002   $as_echo_n "(cached) " >&6
12003 else
12004   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12005 /* end confdefs.h.  */
12006 #include <locale.h>
12007 locale_t x;
12008 int
12009 main ()
12010 {
12011
12012   ;
12013   return 0;
12014 }
12015 _ACEOF
12016 if ac_fn_c_try_compile "$LINENO"; then :
12017   pgac_cv_type_locale_t=yes
12018 else
12019   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12020 /* end confdefs.h.  */
12021 #include <xlocale.h>
12022 locale_t x;
12023 int
12024 main ()
12025 {
12026
12027   ;
12028   return 0;
12029 }
12030 _ACEOF
12031 if ac_fn_c_try_compile "$LINENO"; then :
12032   pgac_cv_type_locale_t='yes (in xlocale.h)'
12033 else
12034   pgac_cv_type_locale_t=no
12035 fi
12036 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12037 fi
12038 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12039 fi
12040 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_locale_t" >&5
12041 $as_echo "$pgac_cv_type_locale_t" >&6; }
12042 if test "$pgac_cv_type_locale_t" != no; then
12043
12044 $as_echo "#define HAVE_LOCALE_T 1" >>confdefs.h
12045
12046 fi
12047 if test "$pgac_cv_type_locale_t" = 'yes (in xlocale.h)'; then
12048
12049 $as_echo "#define LOCALE_T_IN_XLOCALE 1" >>confdefs.h
12050
12051 fi
12052
12053 ac_fn_c_check_type "$LINENO" "struct cmsgcred" "ac_cv_type_struct_cmsgcred" "#include <sys/socket.h>
12054 #include <sys/param.h>
12055 #ifdef HAVE_SYS_UCRED_H
12056 #include <sys/ucred.h>
12057 #endif
12058 "
12059 if test "x$ac_cv_type_struct_cmsgcred" = xyes; then :
12060
12061 cat >>confdefs.h <<_ACEOF
12062 #define HAVE_STRUCT_CMSGCRED 1
12063 _ACEOF
12064
12065
12066 fi
12067
12068
12069 ac_fn_c_check_type "$LINENO" "struct option" "ac_cv_type_struct_option" "#ifdef HAVE_GETOPT_H
12070 #include <getopt.h>
12071 #endif
12072 "
12073 if test "x$ac_cv_type_struct_option" = xyes; then :
12074
12075 cat >>confdefs.h <<_ACEOF
12076 #define HAVE_STRUCT_OPTION 1
12077 _ACEOF
12078
12079
12080 fi
12081
12082
12083 if test "$with_zlib" = yes; then
12084   # Check that <zlib.h> defines z_streamp (versions before about 1.0.4
12085   # did not).  While we could work around the lack of z_streamp, it
12086   # seems unwise to encourage people to use such old zlib versions...
12087   ac_fn_c_check_type "$LINENO" "z_streamp" "ac_cv_type_z_streamp" "#include <zlib.h>
12088 "
12089 if test "x$ac_cv_type_z_streamp" = xyes; then :
12090
12091 else
12092   as_fn_error $? "zlib version is too old
12093 Use --without-zlib to disable zlib support." "$LINENO" 5
12094 fi
12095
12096 fi
12097
12098 # On PPC, check if assembler supports LWARX instruction's mutex hint bit
12099 case $host_cpu in
12100   ppc*|powerpc*)
12101     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether assembler supports lwarx hint bit" >&5
12102 $as_echo_n "checking whether assembler supports lwarx hint bit... " >&6; }
12103     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12104 /* end confdefs.h.  */
12105
12106 int
12107 main ()
12108 {
12109 int a = 0; int *p = &a; int r;
12110          __asm__ __volatile__ (" lwarx %0,0,%1,1\n" : "=&r"(r) : "r"(p));
12111   ;
12112   return 0;
12113 }
12114 _ACEOF
12115 if ac_fn_c_try_compile "$LINENO"; then :
12116   pgac_cv_have_ppc_mutex_hint=yes
12117 else
12118   pgac_cv_have_ppc_mutex_hint=no
12119 fi
12120 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12121     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_have_ppc_mutex_hint" >&5
12122 $as_echo "$pgac_cv_have_ppc_mutex_hint" >&6; }
12123     if test x"$pgac_cv_have_ppc_mutex_hint" = xyes ; then
12124
12125 $as_echo "#define HAVE_PPC_LWARX_MUTEX_HINT 1" >>confdefs.h
12126
12127     fi
12128   ;;
12129 esac
12130
12131 # Check largefile support.  You might think this is a system service not a
12132 # compiler characteristic, but you'd be wrong.  We must check this before
12133 # probing existence of related functions such as fseeko, since the largefile
12134 # defines can affect what is generated for that.
12135 if test "$PORTNAME" != "win32"; then
12136    # Check whether --enable-largefile was given.
12137 if test "${enable_largefile+set}" = set; then :
12138   enableval=$enable_largefile;
12139 fi
12140
12141 if test "$enable_largefile" != no; then
12142
12143   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
12144 $as_echo_n "checking for special C compiler options needed for large files... " >&6; }
12145 if ${ac_cv_sys_largefile_CC+:} false; then :
12146   $as_echo_n "(cached) " >&6
12147 else
12148   ac_cv_sys_largefile_CC=no
12149      if test "$GCC" != yes; then
12150        ac_save_CC=$CC
12151        while :; do
12152          # IRIX 6.2 and later do not support large files by default,
12153          # so use the C compiler's -n32 option if that helps.
12154          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12155 /* end confdefs.h.  */
12156 #include <sys/types.h>
12157  /* Check that off_t can represent 2**63 - 1 correctly.
12158     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12159     since some C++ compilers masquerading as C compilers
12160     incorrectly reject 9223372036854775807.  */
12161 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12162   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12163                        && LARGE_OFF_T % 2147483647 == 1)
12164                       ? 1 : -1];
12165 int
12166 main ()
12167 {
12168
12169   ;
12170   return 0;
12171 }
12172 _ACEOF
12173          if ac_fn_c_try_compile "$LINENO"; then :
12174   break
12175 fi
12176 rm -f core conftest.err conftest.$ac_objext
12177          CC="$CC -n32"
12178          if ac_fn_c_try_compile "$LINENO"; then :
12179   ac_cv_sys_largefile_CC=' -n32'; break
12180 fi
12181 rm -f core conftest.err conftest.$ac_objext
12182          break
12183        done
12184        CC=$ac_save_CC
12185        rm -f conftest.$ac_ext
12186     fi
12187 fi
12188 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
12189 $as_echo "$ac_cv_sys_largefile_CC" >&6; }
12190   if test "$ac_cv_sys_largefile_CC" != no; then
12191     CC=$CC$ac_cv_sys_largefile_CC
12192   fi
12193
12194   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
12195 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
12196 if ${ac_cv_sys_file_offset_bits+:} false; then :
12197   $as_echo_n "(cached) " >&6
12198 else
12199   while :; do
12200   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12201 /* end confdefs.h.  */
12202 #include <sys/types.h>
12203  /* Check that off_t can represent 2**63 - 1 correctly.
12204     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12205     since some C++ compilers masquerading as C compilers
12206     incorrectly reject 9223372036854775807.  */
12207 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12208   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12209                        && LARGE_OFF_T % 2147483647 == 1)
12210                       ? 1 : -1];
12211 int
12212 main ()
12213 {
12214
12215   ;
12216   return 0;
12217 }
12218 _ACEOF
12219 if ac_fn_c_try_compile "$LINENO"; then :
12220   ac_cv_sys_file_offset_bits=no; break
12221 fi
12222 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12223   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12224 /* end confdefs.h.  */
12225 #define _FILE_OFFSET_BITS 64
12226 #include <sys/types.h>
12227  /* Check that off_t can represent 2**63 - 1 correctly.
12228     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12229     since some C++ compilers masquerading as C compilers
12230     incorrectly reject 9223372036854775807.  */
12231 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12232   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12233                        && LARGE_OFF_T % 2147483647 == 1)
12234                       ? 1 : -1];
12235 int
12236 main ()
12237 {
12238
12239   ;
12240   return 0;
12241 }
12242 _ACEOF
12243 if ac_fn_c_try_compile "$LINENO"; then :
12244   ac_cv_sys_file_offset_bits=64; break
12245 fi
12246 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12247   ac_cv_sys_file_offset_bits=unknown
12248   break
12249 done
12250 fi
12251 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
12252 $as_echo "$ac_cv_sys_file_offset_bits" >&6; }
12253 case $ac_cv_sys_file_offset_bits in #(
12254   no | unknown) ;;
12255   *)
12256 cat >>confdefs.h <<_ACEOF
12257 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
12258 _ACEOF
12259 ;;
12260 esac
12261 rm -rf conftest*
12262   if test $ac_cv_sys_file_offset_bits = unknown; then
12263     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
12264 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
12265 if ${ac_cv_sys_large_files+:} false; then :
12266   $as_echo_n "(cached) " >&6
12267 else
12268   while :; do
12269   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12270 /* end confdefs.h.  */
12271 #include <sys/types.h>
12272  /* Check that off_t can represent 2**63 - 1 correctly.
12273     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12274     since some C++ compilers masquerading as C compilers
12275     incorrectly reject 9223372036854775807.  */
12276 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12277   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12278                        && LARGE_OFF_T % 2147483647 == 1)
12279                       ? 1 : -1];
12280 int
12281 main ()
12282 {
12283
12284   ;
12285   return 0;
12286 }
12287 _ACEOF
12288 if ac_fn_c_try_compile "$LINENO"; then :
12289   ac_cv_sys_large_files=no; break
12290 fi
12291 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12292   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12293 /* end confdefs.h.  */
12294 #define _LARGE_FILES 1
12295 #include <sys/types.h>
12296  /* Check that off_t can represent 2**63 - 1 correctly.
12297     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12298     since some C++ compilers masquerading as C compilers
12299     incorrectly reject 9223372036854775807.  */
12300 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12301   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12302                        && LARGE_OFF_T % 2147483647 == 1)
12303                       ? 1 : -1];
12304 int
12305 main ()
12306 {
12307
12308   ;
12309   return 0;
12310 }
12311 _ACEOF
12312 if ac_fn_c_try_compile "$LINENO"; then :
12313   ac_cv_sys_large_files=1; break
12314 fi
12315 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12316   ac_cv_sys_large_files=unknown
12317   break
12318 done
12319 fi
12320 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
12321 $as_echo "$ac_cv_sys_large_files" >&6; }
12322 case $ac_cv_sys_large_files in #(
12323   no | unknown) ;;
12324   *)
12325 cat >>confdefs.h <<_ACEOF
12326 #define _LARGE_FILES $ac_cv_sys_large_files
12327 _ACEOF
12328 ;;
12329 esac
12330 rm -rf conftest*
12331   fi
12332
12333
12334 fi
12335
12336
12337 fi
12338
12339 # Check for largefile support (must be after AC_SYS_LARGEFILE)
12340 # The cast to long int works around a bug in the HP C Compiler
12341 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
12342 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
12343 # This bug is HP SR number 8606223364.
12344 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
12345 $as_echo_n "checking size of off_t... " >&6; }
12346 if ${ac_cv_sizeof_off_t+:} false; then :
12347   $as_echo_n "(cached) " >&6
12348 else
12349   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t"        "$ac_includes_default"; then :
12350
12351 else
12352   if test "$ac_cv_type_off_t" = yes; then
12353      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
12354 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
12355 as_fn_error 77 "cannot compute sizeof (off_t)
12356 See \`config.log' for more details" "$LINENO" 5; }
12357    else
12358      ac_cv_sizeof_off_t=0
12359    fi
12360 fi
12361
12362 fi
12363 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
12364 $as_echo "$ac_cv_sizeof_off_t" >&6; }
12365
12366
12367
12368 cat >>confdefs.h <<_ACEOF
12369 #define SIZEOF_OFF_T $ac_cv_sizeof_off_t
12370 _ACEOF
12371
12372
12373
12374 # If we don't have largefile support, can't handle segsize >= 2GB.
12375 if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then
12376    as_fn_error $? "Large file support is not enabled. Segment size cannot be larger than 1GB." "$LINENO" 5
12377 fi
12378
12379
12380 ##
12381 ## Functions, global variables
12382 ##
12383
12384 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int timezone" >&5
12385 $as_echo_n "checking for int timezone... " >&6; }
12386 if ${pgac_cv_var_int_timezone+:} false; then :
12387   $as_echo_n "(cached) " >&6
12388 else
12389   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12390 /* end confdefs.h.  */
12391 #include <time.h>
12392 int res;
12393 int
12394 main ()
12395 {
12396 #ifndef __CYGWIN__
12397 res = timezone / 60;
12398 #else
12399 res = _timezone / 60;
12400 #endif
12401   ;
12402   return 0;
12403 }
12404 _ACEOF
12405 if ac_fn_c_try_link "$LINENO"; then :
12406   pgac_cv_var_int_timezone=yes
12407 else
12408   pgac_cv_var_int_timezone=no
12409 fi
12410 rm -f core conftest.err conftest.$ac_objext \
12411     conftest$ac_exeext conftest.$ac_ext
12412 fi
12413 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_timezone" >&5
12414 $as_echo "$pgac_cv_var_int_timezone" >&6; }
12415 if test x"$pgac_cv_var_int_timezone" = xyes ; then
12416
12417 $as_echo "#define HAVE_INT_TIMEZONE 1" >>confdefs.h
12418
12419 fi
12420 { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for accept()" >&5
12421 $as_echo_n "checking types of arguments for accept()... " >&6; }
12422  if ${ac_cv_func_accept_return+:} false; then :
12423   $as_echo_n "(cached) " >&6
12424 else
12425    if ${ac_cv_func_accept_arg1+:} false; then :
12426   $as_echo_n "(cached) " >&6
12427 else
12428     if ${ac_cv_func_accept_arg2+:} false; then :
12429   $as_echo_n "(cached) " >&6
12430 else
12431      if ${ac_cv_func_accept_arg3+:} false; then :
12432   $as_echo_n "(cached) " >&6
12433 else
12434       for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET WSAAPI'; do
12435       for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do
12436        for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
12437         for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
12438          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12439 /* end confdefs.h.  */
12440 #include <sys/types.h>
12441 #include <sys/socket.h>
12442 extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);
12443 _ACEOF
12444 if ac_fn_c_try_compile "$LINENO"; then :
12445   ac_not_found=no; break 4
12446 else
12447   ac_not_found=yes
12448 fi
12449 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12450        done
12451       done
12452      done
12453     done
12454     if test "$ac_not_found" = yes; then
12455       as_fn_error $? "could not determine argument types" "$LINENO" 5
12456     fi
12457     if test "$ac_cv_func_accept_arg3" = "void"; then
12458       ac_cv_func_accept_arg3=int
12459     fi
12460
12461 fi
12462
12463 fi
12464
12465 fi
12466
12467 fi
12468  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&5
12469 $as_echo "$ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&6; }
12470
12471 cat >>confdefs.h <<_ACEOF
12472 #define ACCEPT_TYPE_RETURN $ac_cv_func_accept_return
12473 _ACEOF
12474
12475
12476 cat >>confdefs.h <<_ACEOF
12477 #define ACCEPT_TYPE_ARG1 $ac_cv_func_accept_arg1
12478 _ACEOF
12479
12480
12481 cat >>confdefs.h <<_ACEOF
12482 #define ACCEPT_TYPE_ARG2 $ac_cv_func_accept_arg2
12483 _ACEOF
12484
12485
12486 cat >>confdefs.h <<_ACEOF
12487 #define ACCEPT_TYPE_ARG3 $ac_cv_func_accept_arg3
12488 _ACEOF
12489
12490
12491 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday takes only one argument" >&5
12492 $as_echo_n "checking whether gettimeofday takes only one argument... " >&6; }
12493 if ${pgac_cv_func_gettimeofday_1arg+:} false; then :
12494   $as_echo_n "(cached) " >&6
12495 else
12496   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12497 /* end confdefs.h.  */
12498 #include <sys/time.h>
12499 int
12500 main ()
12501 {
12502 struct timeval *tp;
12503 struct timezone *tzp;
12504 gettimeofday(tp,tzp);
12505   ;
12506   return 0;
12507 }
12508 _ACEOF
12509 if ac_fn_c_try_compile "$LINENO"; then :
12510   pgac_cv_func_gettimeofday_1arg=no
12511 else
12512   pgac_cv_func_gettimeofday_1arg=yes
12513 fi
12514 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12515 fi
12516 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_gettimeofday_1arg" >&5
12517 $as_echo "$pgac_cv_func_gettimeofday_1arg" >&6; }
12518 if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
12519
12520 $as_echo "#define GETTIMEOFDAY_1ARG 1" >>confdefs.h
12521
12522 fi
12523
12524 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wcstombs_l declaration" >&5
12525 $as_echo_n "checking for wcstombs_l declaration... " >&6; }
12526 if ${pgac_cv_func_wcstombs_l+:} false; then :
12527   $as_echo_n "(cached) " >&6
12528 else
12529   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12530 /* end confdefs.h.  */
12531 #include <stdlib.h>
12532 #include <locale.h>
12533 int
12534 main ()
12535 {
12536 #ifndef wcstombs_l
12537 (void) wcstombs_l;
12538 #endif
12539   ;
12540   return 0;
12541 }
12542 _ACEOF
12543 if ac_fn_c_try_compile "$LINENO"; then :
12544   pgac_cv_func_wcstombs_l='yes'
12545 else
12546   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12547 /* end confdefs.h.  */
12548 #include <stdlib.h>
12549 #include <locale.h>
12550 #include <xlocale.h>
12551 int
12552 main ()
12553 {
12554 #ifndef wcstombs_l
12555 (void) wcstombs_l;
12556 #endif
12557   ;
12558   return 0;
12559 }
12560 _ACEOF
12561 if ac_fn_c_try_compile "$LINENO"; then :
12562   pgac_cv_func_wcstombs_l='yes (in xlocale.h)'
12563 else
12564   pgac_cv_func_wcstombs_l='no'
12565 fi
12566 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12567 fi
12568 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12569 fi
12570 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_wcstombs_l" >&5
12571 $as_echo "$pgac_cv_func_wcstombs_l" >&6; }
12572 if test "$pgac_cv_func_wcstombs_l" = 'yes (in xlocale.h)'; then
12573
12574 $as_echo "#define WCSTOMBS_L_IN_XLOCALE 1" >>confdefs.h
12575
12576 fi
12577
12578 # Some versions of libedit contain strlcpy(), setproctitle(), and other
12579 # symbols that that library has no business exposing to the world.  Pending
12580 # acquisition of a clue by those developers, ignore libedit (including its
12581 # possible alias of libreadline) while checking for everything else.
12582 LIBS_including_readline="$LIBS"
12583 LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
12584
12585 for ac_func in cbrt clock_gettime dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat pthread_is_threaded_np readlink setproctitle setsid shm_open symlink sync_file_range towlower utime utimes wcstombs wcstombs_l
12586 do :
12587   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
12588 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
12589 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
12590   cat >>confdefs.h <<_ACEOF
12591 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
12592 _ACEOF
12593
12594 fi
12595 done
12596
12597
12598 ac_fn_c_check_func "$LINENO" "fseeko" "ac_cv_func_fseeko"
12599 if test "x$ac_cv_func_fseeko" = xyes; then :
12600   $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
12601
12602 else
12603   case " $LIBOBJS " in
12604   *" fseeko.$ac_objext "* ) ;;
12605   *) LIBOBJS="$LIBOBJS fseeko.$ac_objext"
12606  ;;
12607 esac
12608
12609 fi
12610
12611
12612 case $host_os in
12613         # NetBSD uses a custom fseeko/ftello built on fsetpos/fgetpos
12614         # Mingw uses macros to access Win32 API calls
12615         netbsd*|mingw*)
12616
12617 $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
12618
12619                 ac_cv_func_fseeko=yes;;
12620         *)
12621                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
12622 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
12623 if ${ac_cv_sys_largefile_source+:} false; then :
12624   $as_echo_n "(cached) " >&6
12625 else
12626   while :; do
12627   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12628 /* end confdefs.h.  */
12629 #include <sys/types.h> /* for off_t */
12630      #include <stdio.h>
12631 int
12632 main ()
12633 {
12634 int (*fp) (FILE *, off_t, int) = fseeko;
12635      return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
12636   ;
12637   return 0;
12638 }
12639 _ACEOF
12640 if ac_fn_c_try_link "$LINENO"; then :
12641   ac_cv_sys_largefile_source=no; break
12642 fi
12643 rm -f core conftest.err conftest.$ac_objext \
12644     conftest$ac_exeext conftest.$ac_ext
12645   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12646 /* end confdefs.h.  */
12647 #define _LARGEFILE_SOURCE 1
12648 #include <sys/types.h> /* for off_t */
12649      #include <stdio.h>
12650 int
12651 main ()
12652 {
12653 int (*fp) (FILE *, off_t, int) = fseeko;
12654      return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
12655   ;
12656   return 0;
12657 }
12658 _ACEOF
12659 if ac_fn_c_try_link "$LINENO"; then :
12660   ac_cv_sys_largefile_source=1; break
12661 fi
12662 rm -f core conftest.err conftest.$ac_objext \
12663     conftest$ac_exeext conftest.$ac_ext
12664   ac_cv_sys_largefile_source=unknown
12665   break
12666 done
12667 fi
12668 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
12669 $as_echo "$ac_cv_sys_largefile_source" >&6; }
12670 case $ac_cv_sys_largefile_source in #(
12671   no | unknown) ;;
12672   *)
12673 cat >>confdefs.h <<_ACEOF
12674 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
12675 _ACEOF
12676 ;;
12677 esac
12678 rm -rf conftest*
12679
12680 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
12681 # in glibc 2.1.3, but that breaks too many other things.
12682 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
12683 if test $ac_cv_sys_largefile_source != unknown; then
12684
12685 $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
12686
12687 fi
12688 ;;
12689 esac
12690
12691 # posix_fadvise() is a no-op on Solaris, so don't incur function overhead
12692 # by calling it, 2009-04-02
12693 # http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/posix_fadvise.c
12694 if test "$PORTNAME" != "solaris"; then
12695 for ac_func in posix_fadvise
12696 do :
12697   ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise"
12698 if test "x$ac_cv_func_posix_fadvise" = xyes; then :
12699   cat >>confdefs.h <<_ACEOF
12700 #define HAVE_POSIX_FADVISE 1
12701 _ACEOF
12702
12703 fi
12704 done
12705
12706 ac_fn_c_check_decl "$LINENO" "posix_fadvise" "ac_cv_have_decl_posix_fadvise" "#include <fcntl.h>
12707 "
12708 if test "x$ac_cv_have_decl_posix_fadvise" = xyes; then :
12709   ac_have_decl=1
12710 else
12711   ac_have_decl=0
12712 fi
12713
12714 cat >>confdefs.h <<_ACEOF
12715 #define HAVE_DECL_POSIX_FADVISE $ac_have_decl
12716 _ACEOF
12717
12718 fi
12719
12720 ac_fn_c_check_decl "$LINENO" "fdatasync" "ac_cv_have_decl_fdatasync" "#include <unistd.h>
12721 "
12722 if test "x$ac_cv_have_decl_fdatasync" = xyes; then :
12723   ac_have_decl=1
12724 else
12725   ac_have_decl=0
12726 fi
12727
12728 cat >>confdefs.h <<_ACEOF
12729 #define HAVE_DECL_FDATASYNC $ac_have_decl
12730 _ACEOF
12731
12732 ac_fn_c_check_decl "$LINENO" "strlcat" "ac_cv_have_decl_strlcat" "$ac_includes_default"
12733 if test "x$ac_cv_have_decl_strlcat" = xyes; then :
12734   ac_have_decl=1
12735 else
12736   ac_have_decl=0
12737 fi
12738
12739 cat >>confdefs.h <<_ACEOF
12740 #define HAVE_DECL_STRLCAT $ac_have_decl
12741 _ACEOF
12742 ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" "$ac_includes_default"
12743 if test "x$ac_cv_have_decl_strlcpy" = xyes; then :
12744   ac_have_decl=1
12745 else
12746   ac_have_decl=0
12747 fi
12748
12749 cat >>confdefs.h <<_ACEOF
12750 #define HAVE_DECL_STRLCPY $ac_have_decl
12751 _ACEOF
12752
12753 # This is probably only present on macOS, but may as well check always
12754 ac_fn_c_check_decl "$LINENO" "F_FULLFSYNC" "ac_cv_have_decl_F_FULLFSYNC" "#include <fcntl.h>
12755 "
12756 if test "x$ac_cv_have_decl_F_FULLFSYNC" = xyes; then :
12757   ac_have_decl=1
12758 else
12759   ac_have_decl=0
12760 fi
12761
12762 cat >>confdefs.h <<_ACEOF
12763 #define HAVE_DECL_F_FULLFSYNC $ac_have_decl
12764 _ACEOF
12765
12766
12767 HAVE_IPV6=no
12768 ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "$ac_includes_default
12769 #include <netinet/in.h>
12770 "
12771 if test "x$ac_cv_type_struct_sockaddr_in6" = xyes; then :
12772
12773 $as_echo "#define HAVE_IPV6 1" >>confdefs.h
12774
12775          HAVE_IPV6=yes
12776 fi
12777
12778
12779
12780 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PS_STRINGS" >&5
12781 $as_echo_n "checking for PS_STRINGS... " >&6; }
12782 if ${pgac_cv_var_PS_STRINGS+:} false; then :
12783   $as_echo_n "(cached) " >&6
12784 else
12785   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12786 /* end confdefs.h.  */
12787 #include <machine/vmparam.h>
12788 #include <sys/exec.h>
12789
12790 int
12791 main ()
12792 {
12793 PS_STRINGS->ps_nargvstr = 1;
12794 PS_STRINGS->ps_argvstr = "foo";
12795   ;
12796   return 0;
12797 }
12798 _ACEOF
12799 if ac_fn_c_try_link "$LINENO"; then :
12800   pgac_cv_var_PS_STRINGS=yes
12801 else
12802   pgac_cv_var_PS_STRINGS=no
12803 fi
12804 rm -f core conftest.err conftest.$ac_objext \
12805     conftest$ac_exeext conftest.$ac_ext
12806 fi
12807 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_PS_STRINGS" >&5
12808 $as_echo "$pgac_cv_var_PS_STRINGS" >&6; }
12809 if test "$pgac_cv_var_PS_STRINGS" = yes ; then
12810
12811 $as_echo "#define HAVE_PS_STRINGS 1" >>confdefs.h
12812
12813 fi
12814
12815
12816 # We use our snprintf.c emulation if either snprintf() or vsnprintf()
12817 # is missing.  Yes, there are machines that have only one.  We may
12818 # also decide to use snprintf.c if snprintf() is present but does not
12819 # have all the features we need --- see below.
12820
12821 if test "$PORTNAME" = "win32"; then
12822   # Win32 gets snprintf.c built unconditionally.
12823   #
12824   # To properly translate all NLS languages strings, we must support the
12825   # *printf() %$ format, which allows *printf() arguments to be selected
12826   # by position in the translated string.
12827   #
12828   # libintl versions < 0.13 use the native *printf() functions, and Win32
12829   # *printf() doesn't understand %$, so we must use our /port versions,
12830   # which do understand %$. libintl versions >= 0.13 include their own
12831   # *printf versions on Win32.  The libintl 0.13 release note text is:
12832   #
12833   #   C format strings with positions, as they arise when a translator
12834   #   needs to reorder a sentence, are now supported on all platforms.
12835   #   On those few platforms (NetBSD and Woe32) for which the native
12836   #   printf()/fprintf()/... functions don't support such format
12837   #   strings, replacements are provided through <libintl.h>.
12838   #
12839   # We could use libintl >= 0.13's *printf() if we were sure that we had
12840   # a litint >= 0.13 at runtime, but seeing that there is no clean way
12841   # to guarantee that, it is best to just use our own, so we are sure to
12842   # get %$ support. In include/port.h we disable the *printf() macros
12843   # that might have been defined by libintl.
12844   #
12845   # We do this unconditionally whether NLS is used or not so we are sure
12846   # that all Win32 libraries and binaries behave the same.
12847   pgac_need_repl_snprintf=yes
12848 else
12849   pgac_need_repl_snprintf=no
12850   for ac_func in snprintf
12851 do :
12852   ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
12853 if test "x$ac_cv_func_snprintf" = xyes; then :
12854   cat >>confdefs.h <<_ACEOF
12855 #define HAVE_SNPRINTF 1
12856 _ACEOF
12857
12858 else
12859   pgac_need_repl_snprintf=yes
12860 fi
12861 done
12862
12863   for ac_func in vsnprintf
12864 do :
12865   ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf"
12866 if test "x$ac_cv_func_vsnprintf" = xyes; then :
12867   cat >>confdefs.h <<_ACEOF
12868 #define HAVE_VSNPRINTF 1
12869 _ACEOF
12870
12871 else
12872   pgac_need_repl_snprintf=yes
12873 fi
12874 done
12875
12876 fi
12877
12878
12879 # Check whether <stdio.h> declares snprintf() and vsnprintf(); if not,
12880 # include/c.h will provide declarations.  Note this is a separate test
12881 # from whether the functions exist in the C library --- there are
12882 # systems that have the functions but don't bother to declare them :-(
12883
12884 ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default"
12885 if test "x$ac_cv_have_decl_snprintf" = xyes; then :
12886   ac_have_decl=1
12887 else
12888   ac_have_decl=0
12889 fi
12890
12891 cat >>confdefs.h <<_ACEOF
12892 #define HAVE_DECL_SNPRINTF $ac_have_decl
12893 _ACEOF
12894 ac_fn_c_check_decl "$LINENO" "vsnprintf" "ac_cv_have_decl_vsnprintf" "$ac_includes_default"
12895 if test "x$ac_cv_have_decl_vsnprintf" = xyes; then :
12896   ac_have_decl=1
12897 else
12898   ac_have_decl=0
12899 fi
12900
12901 cat >>confdefs.h <<_ACEOF
12902 #define HAVE_DECL_VSNPRINTF $ac_have_decl
12903 _ACEOF
12904
12905
12906
12907 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf" >&5
12908 $as_echo_n "checking for isinf... " >&6; }
12909 if ${ac_cv_func_isinf+:} false; then :
12910   $as_echo_n "(cached) " >&6
12911 else
12912   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12913 /* end confdefs.h.  */
12914
12915 #include <math.h>
12916 double glob_double;
12917
12918 int
12919 main ()
12920 {
12921 return isinf(glob_double) ? 0 : 1;
12922   ;
12923   return 0;
12924 }
12925 _ACEOF
12926 if ac_fn_c_try_link "$LINENO"; then :
12927   ac_cv_func_isinf=yes
12928 else
12929   ac_cv_func_isinf=no
12930 fi
12931 rm -f core conftest.err conftest.$ac_objext \
12932     conftest$ac_exeext conftest.$ac_ext
12933 fi
12934 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_isinf" >&5
12935 $as_echo "$ac_cv_func_isinf" >&6; }
12936
12937 if test $ac_cv_func_isinf = yes ; then
12938
12939 $as_echo "#define HAVE_ISINF 1" >>confdefs.h
12940
12941 else
12942   case " $LIBOBJS " in
12943   *" isinf.$ac_objext "* ) ;;
12944   *) LIBOBJS="$LIBOBJS isinf.$ac_objext"
12945  ;;
12946 esac
12947
12948   # Look for a way to implement a substitute for isinf()
12949   for ac_func in fpclass fp_class fp_class_d class
12950 do :
12951   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
12952 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
12953 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
12954   cat >>confdefs.h <<_ACEOF
12955 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
12956 _ACEOF
12957  break
12958 fi
12959 done
12960
12961 fi
12962
12963 ac_fn_c_check_func "$LINENO" "crypt" "ac_cv_func_crypt"
12964 if test "x$ac_cv_func_crypt" = xyes; then :
12965   $as_echo "#define HAVE_CRYPT 1" >>confdefs.h
12966
12967 else
12968   case " $LIBOBJS " in
12969   *" crypt.$ac_objext "* ) ;;
12970   *) LIBOBJS="$LIBOBJS crypt.$ac_objext"
12971  ;;
12972 esac
12973
12974 fi
12975
12976 ac_fn_c_check_func "$LINENO" "fls" "ac_cv_func_fls"
12977 if test "x$ac_cv_func_fls" = xyes; then :
12978   $as_echo "#define HAVE_FLS 1" >>confdefs.h
12979
12980 else
12981   case " $LIBOBJS " in
12982   *" fls.$ac_objext "* ) ;;
12983   *) LIBOBJS="$LIBOBJS fls.$ac_objext"
12984  ;;
12985 esac
12986
12987 fi
12988
12989 ac_fn_c_check_func "$LINENO" "getopt" "ac_cv_func_getopt"
12990 if test "x$ac_cv_func_getopt" = xyes; then :
12991   $as_echo "#define HAVE_GETOPT 1" >>confdefs.h
12992
12993 else
12994   case " $LIBOBJS " in
12995   *" getopt.$ac_objext "* ) ;;
12996   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
12997  ;;
12998 esac
12999
13000 fi
13001
13002 ac_fn_c_check_func "$LINENO" "getrusage" "ac_cv_func_getrusage"
13003 if test "x$ac_cv_func_getrusage" = xyes; then :
13004   $as_echo "#define HAVE_GETRUSAGE 1" >>confdefs.h
13005
13006 else
13007   case " $LIBOBJS " in
13008   *" getrusage.$ac_objext "* ) ;;
13009   *) LIBOBJS="$LIBOBJS getrusage.$ac_objext"
13010  ;;
13011 esac
13012
13013 fi
13014
13015 ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton"
13016 if test "x$ac_cv_func_inet_aton" = xyes; then :
13017   $as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
13018
13019 else
13020   case " $LIBOBJS " in
13021   *" inet_aton.$ac_objext "* ) ;;
13022   *) LIBOBJS="$LIBOBJS inet_aton.$ac_objext"
13023  ;;
13024 esac
13025
13026 fi
13027
13028 ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
13029 if test "x$ac_cv_func_mkdtemp" = xyes; then :
13030   $as_echo "#define HAVE_MKDTEMP 1" >>confdefs.h
13031
13032 else
13033   case " $LIBOBJS " in
13034   *" mkdtemp.$ac_objext "* ) ;;
13035   *) LIBOBJS="$LIBOBJS mkdtemp.$ac_objext"
13036  ;;
13037 esac
13038
13039 fi
13040
13041 ac_fn_c_check_func "$LINENO" "random" "ac_cv_func_random"
13042 if test "x$ac_cv_func_random" = xyes; then :
13043   $as_echo "#define HAVE_RANDOM 1" >>confdefs.h
13044
13045 else
13046   case " $LIBOBJS " in
13047   *" random.$ac_objext "* ) ;;
13048   *) LIBOBJS="$LIBOBJS random.$ac_objext"
13049  ;;
13050 esac
13051
13052 fi
13053
13054 ac_fn_c_check_func "$LINENO" "rint" "ac_cv_func_rint"
13055 if test "x$ac_cv_func_rint" = xyes; then :
13056   $as_echo "#define HAVE_RINT 1" >>confdefs.h
13057
13058 else
13059   case " $LIBOBJS " in
13060   *" rint.$ac_objext "* ) ;;
13061   *) LIBOBJS="$LIBOBJS rint.$ac_objext"
13062  ;;
13063 esac
13064
13065 fi
13066
13067 ac_fn_c_check_func "$LINENO" "srandom" "ac_cv_func_srandom"
13068 if test "x$ac_cv_func_srandom" = xyes; then :
13069   $as_echo "#define HAVE_SRANDOM 1" >>confdefs.h
13070
13071 else
13072   case " $LIBOBJS " in
13073   *" srandom.$ac_objext "* ) ;;
13074   *) LIBOBJS="$LIBOBJS srandom.$ac_objext"
13075  ;;
13076 esac
13077
13078 fi
13079
13080 ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror"
13081 if test "x$ac_cv_func_strerror" = xyes; then :
13082   $as_echo "#define HAVE_STRERROR 1" >>confdefs.h
13083
13084 else
13085   case " $LIBOBJS " in
13086   *" strerror.$ac_objext "* ) ;;
13087   *) LIBOBJS="$LIBOBJS strerror.$ac_objext"
13088  ;;
13089 esac
13090
13091 fi
13092
13093 ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat"
13094 if test "x$ac_cv_func_strlcat" = xyes; then :
13095   $as_echo "#define HAVE_STRLCAT 1" >>confdefs.h
13096
13097 else
13098   case " $LIBOBJS " in
13099   *" strlcat.$ac_objext "* ) ;;
13100   *) LIBOBJS="$LIBOBJS strlcat.$ac_objext"
13101  ;;
13102 esac
13103
13104 fi
13105
13106 ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy"
13107 if test "x$ac_cv_func_strlcpy" = xyes; then :
13108   $as_echo "#define HAVE_STRLCPY 1" >>confdefs.h
13109
13110 else
13111   case " $LIBOBJS " in
13112   *" strlcpy.$ac_objext "* ) ;;
13113   *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext"
13114  ;;
13115 esac
13116
13117 fi
13118
13119
13120
13121 case $host_os in
13122
13123         # Windows uses a specialised env handler
13124         # and doesn't need a replacement getpeereid because it doesn't use
13125         # Unix sockets.
13126         mingw*)
13127
13128 $as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
13129
13130
13131 $as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
13132
13133                 ac_cv_func_unsetenv=yes
13134                 ac_cv_func_getpeereid=yes;;
13135         *)
13136                 ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
13137 if test "x$ac_cv_func_unsetenv" = xyes; then :
13138   $as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
13139
13140 else
13141   case " $LIBOBJS " in
13142   *" unsetenv.$ac_objext "* ) ;;
13143   *) LIBOBJS="$LIBOBJS unsetenv.$ac_objext"
13144  ;;
13145 esac
13146
13147 fi
13148
13149 ac_fn_c_check_func "$LINENO" "getpeereid" "ac_cv_func_getpeereid"
13150 if test "x$ac_cv_func_getpeereid" = xyes; then :
13151   $as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
13152
13153 else
13154   case " $LIBOBJS " in
13155   *" getpeereid.$ac_objext "* ) ;;
13156   *) LIBOBJS="$LIBOBJS getpeereid.$ac_objext"
13157  ;;
13158 esac
13159
13160 fi
13161
13162
13163                 ;;
13164 esac
13165
13166 # System's version of getaddrinfo(), if any, may be used only if we found
13167 # a definition for struct addrinfo; see notes in src/include/getaddrinfo.h.
13168 # We use only our own getaddrinfo.c on Windows, but it's time to revisit that.
13169 if test x"$ac_cv_type_struct_addrinfo" = xyes && \
13170    test "$PORTNAME" != "win32"; then
13171   ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo"
13172 if test "x$ac_cv_func_getaddrinfo" = xyes; then :
13173   $as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
13174
13175 else
13176   case " $LIBOBJS " in
13177   *" getaddrinfo.$ac_objext "* ) ;;
13178   *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext"
13179  ;;
13180 esac
13181
13182 fi
13183
13184
13185 else
13186   case " $LIBOBJS " in
13187   *" getaddrinfo.$ac_objext "* ) ;;
13188   *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext"
13189  ;;
13190 esac
13191
13192 fi
13193
13194 # Similarly, use system's getopt_long() only if system provides struct option.
13195 if test x"$ac_cv_type_struct_option" = xyes ; then
13196   ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long"
13197 if test "x$ac_cv_func_getopt_long" = xyes; then :
13198   $as_echo "#define HAVE_GETOPT_LONG 1" >>confdefs.h
13199
13200 else
13201   case " $LIBOBJS " in
13202   *" getopt_long.$ac_objext "* ) ;;
13203   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
13204  ;;
13205 esac
13206
13207 fi
13208
13209
13210 else
13211   case " $LIBOBJS " in
13212   *" getopt_long.$ac_objext "* ) ;;
13213   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
13214  ;;
13215 esac
13216
13217 fi
13218
13219 # Solaris' getopt() doesn't do what we want for long options, so always use
13220 # our version on that platform.
13221 if test "$PORTNAME" = "solaris"; then
13222   case " $LIBOBJS " in
13223   *" getopt.$ac_objext "* ) ;;
13224   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
13225  ;;
13226 esac
13227
13228 fi
13229
13230 # mingw has adopted a GNU-centric interpretation of optind/optreset,
13231 # so always use our version on Windows.
13232 if test "$PORTNAME" = "win32"; then
13233   case " $LIBOBJS " in
13234   *" getopt.$ac_objext "* ) ;;
13235   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
13236  ;;
13237 esac
13238
13239   case " $LIBOBJS " in
13240   *" getopt_long.$ac_objext "* ) ;;
13241   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
13242  ;;
13243 esac
13244
13245 fi
13246
13247 # Win32 (really MinGW) support
13248 if test "$PORTNAME" = "win32"; then
13249   ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
13250 if test "x$ac_cv_func_gettimeofday" = xyes; then :
13251   $as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
13252
13253 else
13254   case " $LIBOBJS " in
13255   *" gettimeofday.$ac_objext "* ) ;;
13256   *) LIBOBJS="$LIBOBJS gettimeofday.$ac_objext"
13257  ;;
13258 esac
13259
13260 fi
13261
13262
13263   case " $LIBOBJS " in
13264   *" dirmod.$ac_objext "* ) ;;
13265   *) LIBOBJS="$LIBOBJS dirmod.$ac_objext"
13266  ;;
13267 esac
13268
13269   case " $LIBOBJS " in
13270   *" kill.$ac_objext "* ) ;;
13271   *) LIBOBJS="$LIBOBJS kill.$ac_objext"
13272  ;;
13273 esac
13274
13275   case " $LIBOBJS " in
13276   *" open.$ac_objext "* ) ;;
13277   *) LIBOBJS="$LIBOBJS open.$ac_objext"
13278  ;;
13279 esac
13280
13281   case " $LIBOBJS " in
13282   *" system.$ac_objext "* ) ;;
13283   *) LIBOBJS="$LIBOBJS system.$ac_objext"
13284  ;;
13285 esac
13286
13287   case " $LIBOBJS " in
13288   *" win32env.$ac_objext "* ) ;;
13289   *) LIBOBJS="$LIBOBJS win32env.$ac_objext"
13290  ;;
13291 esac
13292
13293   case " $LIBOBJS " in
13294   *" win32error.$ac_objext "* ) ;;
13295   *) LIBOBJS="$LIBOBJS win32error.$ac_objext"
13296  ;;
13297 esac
13298
13299   case " $LIBOBJS " in
13300   *" win32security.$ac_objext "* ) ;;
13301   *) LIBOBJS="$LIBOBJS win32security.$ac_objext"
13302  ;;
13303 esac
13304
13305   case " $LIBOBJS " in
13306   *" win32setlocale.$ac_objext "* ) ;;
13307   *) LIBOBJS="$LIBOBJS win32setlocale.$ac_objext"
13308  ;;
13309 esac
13310
13311
13312 $as_echo "#define HAVE_SYMLINK 1" >>confdefs.h
13313
13314   ac_fn_c_check_type "$LINENO" "MINIDUMP_TYPE" "ac_cv_type_MINIDUMP_TYPE" "
13315 #define WIN32_LEAN_AND_MEAN
13316 #include <windows.h>
13317 #include <string.h>
13318 #include <dbghelp.h>
13319 "
13320 if test "x$ac_cv_type_MINIDUMP_TYPE" = xyes; then :
13321
13322 cat >>confdefs.h <<_ACEOF
13323 #define HAVE_MINIDUMP_TYPE 1
13324 _ACEOF
13325
13326 pgac_minidump_type=yes
13327 else
13328   pgac_minidump_type=no
13329 fi
13330
13331 fi
13332 if test x"$pgac_minidump_type" = x"yes" ; then
13333   have_win32_dbghelp=yes
13334
13335 else
13336   have_win32_dbghelp=no
13337
13338 fi
13339
13340 # Cygwin needs only a bit of that
13341 if test "$PORTNAME" = "cygwin"; then
13342   case " $LIBOBJS " in
13343   *" dirmod.$ac_objext "* ) ;;
13344   *) LIBOBJS="$LIBOBJS dirmod.$ac_objext"
13345  ;;
13346 esac
13347
13348 fi
13349
13350 ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include <signal.h>
13351 /* NetBSD declares sys_siglist in unistd.h.  */
13352 #ifdef HAVE_UNISTD_H
13353 # include <unistd.h>
13354 #endif
13355
13356 "
13357 if test "x$ac_cv_have_decl_sys_siglist" = xyes; then :
13358   ac_have_decl=1
13359 else
13360   ac_have_decl=0
13361 fi
13362
13363 cat >>confdefs.h <<_ACEOF
13364 #define HAVE_DECL_SYS_SIGLIST $ac_have_decl
13365 _ACEOF
13366
13367
13368 ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog"
13369 if test "x$ac_cv_func_syslog" = xyes; then :
13370   ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default"
13371 if test "x$ac_cv_header_syslog_h" = xyes; then :
13372
13373 $as_echo "#define HAVE_SYSLOG 1" >>confdefs.h
13374
13375 fi
13376
13377
13378 fi
13379
13380
13381 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opterr" >&5
13382 $as_echo_n "checking for opterr... " >&6; }
13383 if ${pgac_cv_var_int_opterr+:} false; then :
13384   $as_echo_n "(cached) " >&6
13385 else
13386   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13387 /* end confdefs.h.  */
13388 #include <unistd.h>
13389 int
13390 main ()
13391 {
13392 extern int opterr; opterr = 1;
13393   ;
13394   return 0;
13395 }
13396 _ACEOF
13397 if ac_fn_c_try_link "$LINENO"; then :
13398   pgac_cv_var_int_opterr=yes
13399 else
13400   pgac_cv_var_int_opterr=no
13401 fi
13402 rm -f core conftest.err conftest.$ac_objext \
13403     conftest$ac_exeext conftest.$ac_ext
13404 fi
13405 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_opterr" >&5
13406 $as_echo "$pgac_cv_var_int_opterr" >&6; }
13407 if test x"$pgac_cv_var_int_opterr" = x"yes"; then
13408
13409 $as_echo "#define HAVE_INT_OPTERR 1" >>confdefs.h
13410
13411 fi
13412
13413 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for optreset" >&5
13414 $as_echo_n "checking for optreset... " >&6; }
13415 if ${pgac_cv_var_int_optreset+:} false; then :
13416   $as_echo_n "(cached) " >&6
13417 else
13418   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13419 /* end confdefs.h.  */
13420 #include <unistd.h>
13421 int
13422 main ()
13423 {
13424 extern int optreset; optreset = 1;
13425   ;
13426   return 0;
13427 }
13428 _ACEOF
13429 if ac_fn_c_try_link "$LINENO"; then :
13430   pgac_cv_var_int_optreset=yes
13431 else
13432   pgac_cv_var_int_optreset=no
13433 fi
13434 rm -f core conftest.err conftest.$ac_objext \
13435     conftest$ac_exeext conftest.$ac_ext
13436 fi
13437 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_optreset" >&5
13438 $as_echo "$pgac_cv_var_int_optreset" >&6; }
13439 if test x"$pgac_cv_var_int_optreset" = x"yes"; then
13440
13441 $as_echo "#define HAVE_INT_OPTRESET 1" >>confdefs.h
13442
13443 fi
13444
13445 for ac_func in strtoll strtoq
13446 do :
13447   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13448 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13449 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
13450   cat >>confdefs.h <<_ACEOF
13451 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
13452 _ACEOF
13453  break
13454 fi
13455 done
13456
13457 for ac_func in strtoull strtouq
13458 do :
13459   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13460 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13461 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
13462   cat >>confdefs.h <<_ACEOF
13463 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
13464 _ACEOF
13465  break
13466 fi
13467 done
13468
13469
13470 # Lastly, restore full LIBS list and check for readline/libedit symbols
13471 LIBS="$LIBS_including_readline"
13472
13473 if test "$with_readline" = yes; then
13474   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_append_character" >&5
13475 $as_echo_n "checking for rl_completion_append_character... " >&6; }
13476 if ${pgac_cv_var_rl_completion_append_character+:} false; then :
13477   $as_echo_n "(cached) " >&6
13478 else
13479   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13480 /* end confdefs.h.  */
13481 #include <stdio.h>
13482 #ifdef HAVE_READLINE_READLINE_H
13483 # include <readline/readline.h>
13484 #elif defined(HAVE_READLINE_H)
13485 # include <readline.h>
13486 #endif
13487
13488 int
13489 main ()
13490 {
13491 rl_completion_append_character = 'x';
13492   ;
13493   return 0;
13494 }
13495 _ACEOF
13496 if ac_fn_c_try_link "$LINENO"; then :
13497   pgac_cv_var_rl_completion_append_character=yes
13498 else
13499   pgac_cv_var_rl_completion_append_character=no
13500 fi
13501 rm -f core conftest.err conftest.$ac_objext \
13502     conftest$ac_exeext conftest.$ac_ext
13503 fi
13504 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_rl_completion_append_character" >&5
13505 $as_echo "$pgac_cv_var_rl_completion_append_character" >&6; }
13506 if test x"$pgac_cv_var_rl_completion_append_character" = x"yes"; then
13507
13508 $as_echo "#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1" >>confdefs.h
13509
13510 fi
13511   for ac_func in rl_completion_matches rl_filename_completion_function rl_reset_screen_size
13512 do :
13513   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13514 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13515 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
13516   cat >>confdefs.h <<_ACEOF
13517 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
13518 _ACEOF
13519
13520 fi
13521 done
13522
13523   for ac_func in append_history history_truncate_file
13524 do :
13525   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13526 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13527 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
13528   cat >>confdefs.h <<_ACEOF
13529 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
13530 _ACEOF
13531
13532 fi
13533 done
13534
13535 fi
13536
13537
13538 # This test makes sure that run tests work at all.  Sometimes a shared
13539 # library is found by the linker, but the runtime linker can't find it.
13540 # This check should come after all modifications of compiler or linker
13541 # variables, and before any other run tests.
13542 { $as_echo "$as_me:${as_lineno-$LINENO}: checking test program" >&5
13543 $as_echo_n "checking test program... " >&6; }
13544 if test "$cross_compiling" = yes; then :
13545   { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling" >&5
13546 $as_echo "cross-compiling" >&6; }
13547 else
13548   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13549 /* end confdefs.h.  */
13550 int main() { return 0; }
13551 _ACEOF
13552 if ac_fn_c_try_run "$LINENO"; then :
13553   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
13554 $as_echo "ok" >&6; }
13555 else
13556   { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
13557 $as_echo "failed" >&6; }
13558 as_fn_error $? "
13559 Could not execute a simple test program.  This may be a problem
13560 related to locating shared libraries.  Check the file 'config.log'
13561 for the exact reason." "$LINENO" 5
13562 fi
13563 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13564   conftest.$ac_objext conftest.beam conftest.$ac_ext
13565 fi
13566
13567
13568 # --------------------
13569 # Run tests below here
13570 # --------------------
13571
13572 # Force use of our snprintf if system's doesn't do arg control
13573 # See comment above at snprintf test for details.
13574 if test "$enable_nls" = yes -a "$pgac_need_repl_snprintf" = no; then
13575   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf supports argument control" >&5
13576 $as_echo_n "checking whether snprintf supports argument control... " >&6; }
13577 if ${pgac_cv_snprintf_arg_control+:} false; then :
13578   $as_echo_n "(cached) " >&6
13579 else
13580   if test "$cross_compiling" = yes; then :
13581   pgac_cv_snprintf_arg_control=cross
13582 else
13583   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13584 /* end confdefs.h.  */
13585 #include <stdio.h>
13586 #include <string.h>
13587
13588 int main()
13589 {
13590   char buf[100];
13591
13592   /* can it swap arguments? */
13593   snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
13594   if (strcmp(buf, "4 3") != 0)
13595     return 1;
13596   return 0;
13597 }
13598 _ACEOF
13599 if ac_fn_c_try_run "$LINENO"; then :
13600   pgac_cv_snprintf_arg_control=yes
13601 else
13602   pgac_cv_snprintf_arg_control=no
13603 fi
13604 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13605   conftest.$ac_objext conftest.beam conftest.$ac_ext
13606 fi
13607
13608
13609 fi
13610 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_arg_control" >&5
13611 $as_echo "$pgac_cv_snprintf_arg_control" >&6; }
13612
13613   if test $pgac_cv_snprintf_arg_control != yes ; then
13614     pgac_need_repl_snprintf=yes
13615   fi
13616 fi
13617
13618
13619
13620
13621 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long int is 64 bits" >&5
13622 $as_echo_n "checking whether long int is 64 bits... " >&6; }
13623 if ${pgac_cv_type_long_int_64+:} false; then :
13624   $as_echo_n "(cached) " >&6
13625 else
13626   if test "$cross_compiling" = yes; then :
13627   # If cross-compiling, check the size reported by the compiler and
13628 # trust that the arithmetic works.
13629 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13630 /* end confdefs.h.  */
13631
13632 int
13633 main ()
13634 {
13635 static int test_array [1 - 2 * !(sizeof(long int) == 8)];
13636 test_array [0] = 0;
13637 return test_array [0];
13638
13639   ;
13640   return 0;
13641 }
13642 _ACEOF
13643 if ac_fn_c_try_compile "$LINENO"; then :
13644   pgac_cv_type_long_int_64=yes
13645 else
13646   pgac_cv_type_long_int_64=no
13647 fi
13648 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13649 else
13650   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13651 /* end confdefs.h.  */
13652 typedef long int ac_int64;
13653
13654 /*
13655  * These are globals to discourage the compiler from folding all the
13656  * arithmetic tests down to compile-time constants.
13657  */
13658 ac_int64 a = 20000001;
13659 ac_int64 b = 40000005;
13660
13661 int does_int64_work()
13662 {
13663   ac_int64 c,d;
13664
13665   if (sizeof(ac_int64) != 8)
13666     return 0;                   /* definitely not the right size */
13667
13668   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
13669   c = a * b;
13670   d = (c + b) / b;
13671   if (d != a+1)
13672     return 0;
13673   return 1;
13674 }
13675
13676 int
13677 main() {
13678   return (! does_int64_work());
13679 }
13680 _ACEOF
13681 if ac_fn_c_try_run "$LINENO"; then :
13682   pgac_cv_type_long_int_64=yes
13683 else
13684   pgac_cv_type_long_int_64=no
13685 fi
13686 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13687   conftest.$ac_objext conftest.beam conftest.$ac_ext
13688 fi
13689
13690 fi
13691 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_long_int_64" >&5
13692 $as_echo "$pgac_cv_type_long_int_64" >&6; }
13693
13694 HAVE_LONG_INT_64=$pgac_cv_type_long_int_64
13695 if test x"$pgac_cv_type_long_int_64" = xyes ; then
13696
13697 $as_echo "#define HAVE_LONG_INT_64 1" >>confdefs.h
13698
13699 fi
13700
13701
13702 if test x"$HAVE_LONG_INT_64" = x"yes" ; then
13703   pg_int64_type="long int"
13704 else
13705   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long long int is 64 bits" >&5
13706 $as_echo_n "checking whether long long int is 64 bits... " >&6; }
13707 if ${pgac_cv_type_long_long_int_64+:} false; then :
13708   $as_echo_n "(cached) " >&6
13709 else
13710   if test "$cross_compiling" = yes; then :
13711   # If cross-compiling, check the size reported by the compiler and
13712 # trust that the arithmetic works.
13713 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13714 /* end confdefs.h.  */
13715
13716 int
13717 main ()
13718 {
13719 static int test_array [1 - 2 * !(sizeof(long long int) == 8)];
13720 test_array [0] = 0;
13721 return test_array [0];
13722
13723   ;
13724   return 0;
13725 }
13726 _ACEOF
13727 if ac_fn_c_try_compile "$LINENO"; then :
13728   pgac_cv_type_long_long_int_64=yes
13729 else
13730   pgac_cv_type_long_long_int_64=no
13731 fi
13732 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13733 else
13734   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13735 /* end confdefs.h.  */
13736 typedef long long int ac_int64;
13737
13738 /*
13739  * These are globals to discourage the compiler from folding all the
13740  * arithmetic tests down to compile-time constants.
13741  */
13742 ac_int64 a = 20000001;
13743 ac_int64 b = 40000005;
13744
13745 int does_int64_work()
13746 {
13747   ac_int64 c,d;
13748
13749   if (sizeof(ac_int64) != 8)
13750     return 0;                   /* definitely not the right size */
13751
13752   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
13753   c = a * b;
13754   d = (c + b) / b;
13755   if (d != a+1)
13756     return 0;
13757   return 1;
13758 }
13759
13760 int
13761 main() {
13762   return (! does_int64_work());
13763 }
13764 _ACEOF
13765 if ac_fn_c_try_run "$LINENO"; then :
13766   pgac_cv_type_long_long_int_64=yes
13767 else
13768   pgac_cv_type_long_long_int_64=no
13769 fi
13770 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13771   conftest.$ac_objext conftest.beam conftest.$ac_ext
13772 fi
13773
13774 fi
13775 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_long_long_int_64" >&5
13776 $as_echo "$pgac_cv_type_long_long_int_64" >&6; }
13777
13778 HAVE_LONG_LONG_INT_64=$pgac_cv_type_long_long_int_64
13779 if test x"$pgac_cv_type_long_long_int_64" = xyes ; then
13780
13781 $as_echo "#define HAVE_LONG_LONG_INT_64 1" >>confdefs.h
13782
13783 fi
13784
13785   if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then
13786     pg_int64_type="long long int"
13787   else
13788     as_fn_error $? "Cannot find a working 64-bit integer type." "$LINENO" 5
13789   fi
13790 fi
13791
13792
13793 cat >>confdefs.h <<_ACEOF
13794 #define PG_INT64_TYPE $pg_int64_type
13795 _ACEOF
13796
13797
13798
13799 if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then
13800   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13801 /* end confdefs.h.  */
13802
13803 #define INT64CONST(x)  x##LL
13804 long long int foo = INT64CONST(0x1234567890123456);
13805
13806 _ACEOF
13807 if ac_fn_c_try_compile "$LINENO"; then :
13808
13809 $as_echo "#define HAVE_LL_CONSTANTS 1" >>confdefs.h
13810
13811 fi
13812 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13813 fi
13814
13815
13816 # If we found "long int" is 64 bits, assume snprintf handles it.  If
13817 # we found we need to use "long long int", better check.  We cope with
13818 # snprintfs that use %lld, %qd, or %I64d as the format.  If none of these
13819 # work, fall back to our own snprintf emulation (which we know uses %lld).
13820
13821 if test "$HAVE_LONG_LONG_INT_64" = yes ; then
13822   if test $pgac_need_repl_snprintf = no; then
13823     { $as_echo "$as_me:${as_lineno-$LINENO}: checking snprintf length modifier for long long int" >&5
13824 $as_echo_n "checking snprintf length modifier for long long int... " >&6; }
13825 if ${pgac_cv_snprintf_long_long_int_modifier+:} false; then :
13826   $as_echo_n "(cached) " >&6
13827 else
13828   for pgac_modifier in 'll' 'q' 'I64'; do
13829 if test "$cross_compiling" = yes; then :
13830   pgac_cv_snprintf_long_long_int_modifier=cross; break
13831 else
13832   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13833 /* end confdefs.h.  */
13834 #include <stdio.h>
13835 #include <string.h>
13836 typedef long long int ac_int64;
13837 #define INT64_FORMAT "%${pgac_modifier}d"
13838
13839 ac_int64 a = 20000001;
13840 ac_int64 b = 40000005;
13841
13842 int does_int64_snprintf_work()
13843 {
13844   ac_int64 c;
13845   char buf[100];
13846
13847   if (sizeof(ac_int64) != 8)
13848     return 0;                   /* doesn't look like the right size */
13849
13850   c = a * b;
13851   snprintf(buf, 100, INT64_FORMAT, c);
13852   if (strcmp(buf, "800000140000005") != 0)
13853     return 0;                   /* either multiply or snprintf is busted */
13854   return 1;
13855 }
13856
13857 int
13858 main() {
13859   return (! does_int64_snprintf_work());
13860 }
13861 _ACEOF
13862 if ac_fn_c_try_run "$LINENO"; then :
13863   pgac_cv_snprintf_long_long_int_modifier=$pgac_modifier; break
13864 fi
13865 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13866   conftest.$ac_objext conftest.beam conftest.$ac_ext
13867 fi
13868
13869 done
13870 fi
13871
13872 LONG_LONG_INT_MODIFIER=''
13873
13874 case $pgac_cv_snprintf_long_long_int_modifier in
13875   cross) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot test (not on host machine)" >&5
13876 $as_echo "cannot test (not on host machine)" >&6; };;
13877   ?*)    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_long_long_int_modifier" >&5
13878 $as_echo "$pgac_cv_snprintf_long_long_int_modifier" >&6; }
13879          LONG_LONG_INT_MODIFIER=$pgac_cv_snprintf_long_long_int_modifier;;
13880   *)     { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
13881 $as_echo "none" >&6; };;
13882 esac
13883     if test "$LONG_LONG_INT_MODIFIER" = ""; then
13884       # Force usage of our own snprintf, since system snprintf is broken
13885       pgac_need_repl_snprintf=yes
13886       LONG_LONG_INT_MODIFIER='ll'
13887     fi
13888   else
13889     # Here if we previously decided we needed to use our own snprintf
13890     LONG_LONG_INT_MODIFIER='ll'
13891   fi
13892 else
13893   # Here if we are not using 'long long int' at all
13894   LONG_LONG_INT_MODIFIER='l'
13895 fi
13896
13897 INT64_MODIFIER="\"$LONG_LONG_INT_MODIFIER\""
13898
13899
13900 cat >>confdefs.h <<_ACEOF
13901 #define INT64_MODIFIER $INT64_MODIFIER
13902 _ACEOF
13903
13904
13905 # Also force use of our snprintf if the system's doesn't support the %z flag.
13906 if test "$pgac_need_repl_snprintf" = no; then
13907   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf supports the %z modifier" >&5
13908 $as_echo_n "checking whether snprintf supports the %z modifier... " >&6; }
13909 if ${pgac_cv_snprintf_size_t_support+:} false; then :
13910   $as_echo_n "(cached) " >&6
13911 else
13912   if test "$cross_compiling" = yes; then :
13913   pgac_cv_snprintf_size_t_support=cross
13914 else
13915   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13916 /* end confdefs.h.  */
13917 #include <stdio.h>
13918 #include <string.h>
13919
13920 int main()
13921 {
13922   char bufz[100];
13923   char buf64[100];
13924
13925   /*
13926    * Print the largest unsigned number fitting in a size_t using both %zu
13927    * and the previously-determined format for 64-bit integers.  Note that
13928    * we don't run this code unless we know snprintf handles 64-bit ints.
13929    */
13930   bufz[0] = '\0';  /* in case snprintf fails to emit anything */
13931   snprintf(bufz, sizeof(bufz), "%zu", ~((size_t) 0));
13932   snprintf(buf64, sizeof(buf64), "%" INT64_MODIFIER "u",
13933     (unsigned PG_INT64_TYPE) ~((size_t) 0));
13934   if (strcmp(bufz, buf64) != 0)
13935     return 1;
13936   return 0;
13937 }
13938 _ACEOF
13939 if ac_fn_c_try_run "$LINENO"; then :
13940   pgac_cv_snprintf_size_t_support=yes
13941 else
13942   pgac_cv_snprintf_size_t_support=no
13943 fi
13944 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13945   conftest.$ac_objext conftest.beam conftest.$ac_ext
13946 fi
13947
13948
13949 fi
13950 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_size_t_support" >&5
13951 $as_echo "$pgac_cv_snprintf_size_t_support" >&6; }
13952
13953   if test "$pgac_cv_snprintf_size_t_support" != yes; then
13954     pgac_need_repl_snprintf=yes
13955   fi
13956 fi
13957
13958 # Now we have checked all the reasons to replace snprintf
13959 if test $pgac_need_repl_snprintf = yes; then
13960
13961 $as_echo "#define USE_REPL_SNPRINTF 1" >>confdefs.h
13962
13963   case " $LIBOBJS " in
13964   *" snprintf.$ac_objext "* ) ;;
13965   *) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
13966  ;;
13967 esac
13968
13969 fi
13970
13971 # Check size of void *, size_t (enables tweaks for > 32bit address space)
13972 # The cast to long int works around a bug in the HP C Compiler
13973 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
13974 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
13975 # This bug is HP SR number 8606223364.
13976 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
13977 $as_echo_n "checking size of void *... " >&6; }
13978 if ${ac_cv_sizeof_void_p+:} false; then :
13979   $as_echo_n "(cached) " >&6
13980 else
13981   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p"        "$ac_includes_default"; then :
13982
13983 else
13984   if test "$ac_cv_type_void_p" = yes; then
13985      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13986 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13987 as_fn_error 77 "cannot compute sizeof (void *)
13988 See \`config.log' for more details" "$LINENO" 5; }
13989    else
13990      ac_cv_sizeof_void_p=0
13991    fi
13992 fi
13993
13994 fi
13995 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
13996 $as_echo "$ac_cv_sizeof_void_p" >&6; }
13997
13998
13999
14000 cat >>confdefs.h <<_ACEOF
14001 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
14002 _ACEOF
14003
14004
14005 # The cast to long int works around a bug in the HP C Compiler
14006 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
14007 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
14008 # This bug is HP SR number 8606223364.
14009 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
14010 $as_echo_n "checking size of size_t... " >&6; }
14011 if ${ac_cv_sizeof_size_t+:} false; then :
14012   $as_echo_n "(cached) " >&6
14013 else
14014   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t"        "$ac_includes_default"; then :
14015
14016 else
14017   if test "$ac_cv_type_size_t" = yes; then
14018      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14019 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14020 as_fn_error 77 "cannot compute sizeof (size_t)
14021 See \`config.log' for more details" "$LINENO" 5; }
14022    else
14023      ac_cv_sizeof_size_t=0
14024    fi
14025 fi
14026
14027 fi
14028 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
14029 $as_echo "$ac_cv_sizeof_size_t" >&6; }
14030
14031
14032
14033 cat >>confdefs.h <<_ACEOF
14034 #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
14035 _ACEOF
14036
14037
14038 # The cast to long int works around a bug in the HP C Compiler
14039 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
14040 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
14041 # This bug is HP SR number 8606223364.
14042 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
14043 $as_echo_n "checking size of long... " >&6; }
14044 if ${ac_cv_sizeof_long+:} false; then :
14045   $as_echo_n "(cached) " >&6
14046 else
14047   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long"        "$ac_includes_default"; then :
14048
14049 else
14050   if test "$ac_cv_type_long" = yes; then
14051      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14052 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14053 as_fn_error 77 "cannot compute sizeof (long)
14054 See \`config.log' for more details" "$LINENO" 5; }
14055    else
14056      ac_cv_sizeof_long=0
14057    fi
14058 fi
14059
14060 fi
14061 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
14062 $as_echo "$ac_cv_sizeof_long" >&6; }
14063
14064
14065
14066 cat >>confdefs.h <<_ACEOF
14067 #define SIZEOF_LONG $ac_cv_sizeof_long
14068 _ACEOF
14069
14070
14071
14072 # Decide whether float4 is passed by value: user-selectable, enabled by default
14073 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float4 passed by value" >&5
14074 $as_echo_n "checking whether to build with float4 passed by value... " >&6; }
14075
14076
14077 # Check whether --enable-float4-byval was given.
14078 if test "${enable_float4_byval+set}" = set; then :
14079   enableval=$enable_float4_byval;
14080   case $enableval in
14081     yes)
14082
14083 $as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
14084
14085                float4passbyval=true
14086       ;;
14087     no)
14088       float4passbyval=false
14089       ;;
14090     *)
14091       as_fn_error $? "no argument expected for --enable-float4-byval option" "$LINENO" 5
14092       ;;
14093   esac
14094
14095 else
14096   enable_float4_byval=yes
14097
14098 $as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
14099
14100                float4passbyval=true
14101 fi
14102
14103
14104 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float4_byval" >&5
14105 $as_echo "$enable_float4_byval" >&6; }
14106
14107 cat >>confdefs.h <<_ACEOF
14108 #define FLOAT4PASSBYVAL $float4passbyval
14109 _ACEOF
14110
14111
14112 # Decide whether float8 is passed by value.
14113 # Note: this setting also controls int8 and related types such as timestamp.
14114 # If sizeof(Datum) >= 8, this is user-selectable, enabled by default.
14115 # If not, trying to select it is an error.
14116 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float8 passed by value" >&5
14117 $as_echo_n "checking whether to build with float8 passed by value... " >&6; }
14118 if test $ac_cv_sizeof_void_p -ge 8 ; then
14119
14120
14121 # Check whether --enable-float8-byval was given.
14122 if test "${enable_float8_byval+set}" = set; then :
14123   enableval=$enable_float8_byval;
14124   case $enableval in
14125     yes)
14126       :
14127       ;;
14128     no)
14129       :
14130       ;;
14131     *)
14132       as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5
14133       ;;
14134   esac
14135
14136 else
14137   enable_float8_byval=yes
14138
14139 fi
14140
14141
14142 else
14143
14144
14145 # Check whether --enable-float8-byval was given.
14146 if test "${enable_float8_byval+set}" = set; then :
14147   enableval=$enable_float8_byval;
14148   case $enableval in
14149     yes)
14150       :
14151       ;;
14152     no)
14153       :
14154       ;;
14155     *)
14156       as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5
14157       ;;
14158   esac
14159
14160 else
14161   enable_float8_byval=no
14162
14163 fi
14164
14165
14166   if test "$enable_float8_byval" = yes ; then
14167     as_fn_error $? "--enable-float8-byval is not supported on 32-bit platforms." "$LINENO" 5
14168   fi
14169 fi
14170 if test "$enable_float8_byval" = yes ; then
14171
14172 $as_echo "#define USE_FLOAT8_BYVAL 1" >>confdefs.h
14173
14174   float8passbyval=true
14175 else
14176   float8passbyval=false
14177 fi
14178 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float8_byval" >&5
14179 $as_echo "$enable_float8_byval" >&6; }
14180
14181 cat >>confdefs.h <<_ACEOF
14182 #define FLOAT8PASSBYVAL $float8passbyval
14183 _ACEOF
14184
14185
14186 # Determine memory alignment requirements for the basic C data types.
14187
14188 # The cast to long int works around a bug in the HP C Compiler,
14189 # see AC_CHECK_SIZEOF for more information.
14190 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of short" >&5
14191 $as_echo_n "checking alignment of short... " >&6; }
14192 if ${ac_cv_alignof_short+:} false; then :
14193   $as_echo_n "(cached) " >&6
14194 else
14195   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_short"        "$ac_includes_default
14196 #ifndef offsetof
14197 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
14198 #endif
14199 typedef struct { char x; short y; } ac__type_alignof_;"; then :
14200
14201 else
14202   if test "$ac_cv_type_short" = yes; then
14203      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14204 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14205 as_fn_error 77 "cannot compute alignment of short
14206 See \`config.log' for more details" "$LINENO" 5; }
14207    else
14208      ac_cv_alignof_short=0
14209    fi
14210 fi
14211
14212 fi
14213 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_short" >&5
14214 $as_echo "$ac_cv_alignof_short" >&6; }
14215
14216
14217
14218 cat >>confdefs.h <<_ACEOF
14219 #define ALIGNOF_SHORT $ac_cv_alignof_short
14220 _ACEOF
14221
14222
14223 # The cast to long int works around a bug in the HP C Compiler,
14224 # see AC_CHECK_SIZEOF for more information.
14225 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of int" >&5
14226 $as_echo_n "checking alignment of int... " >&6; }
14227 if ${ac_cv_alignof_int+:} false; then :
14228   $as_echo_n "(cached) " >&6
14229 else
14230   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_int"        "$ac_includes_default
14231 #ifndef offsetof
14232 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
14233 #endif
14234 typedef struct { char x; int y; } ac__type_alignof_;"; then :
14235
14236 else
14237   if test "$ac_cv_type_int" = yes; then
14238      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14239 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14240 as_fn_error 77 "cannot compute alignment of int
14241 See \`config.log' for more details" "$LINENO" 5; }
14242    else
14243      ac_cv_alignof_int=0
14244    fi
14245 fi
14246
14247 fi
14248 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_int" >&5
14249 $as_echo "$ac_cv_alignof_int" >&6; }
14250
14251
14252
14253 cat >>confdefs.h <<_ACEOF
14254 #define ALIGNOF_INT $ac_cv_alignof_int
14255 _ACEOF
14256
14257
14258 # The cast to long int works around a bug in the HP C Compiler,
14259 # see AC_CHECK_SIZEOF for more information.
14260 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of long" >&5
14261 $as_echo_n "checking alignment of long... " >&6; }
14262 if ${ac_cv_alignof_long+:} false; then :
14263   $as_echo_n "(cached) " >&6
14264 else
14265   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long"        "$ac_includes_default
14266 #ifndef offsetof
14267 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
14268 #endif
14269 typedef struct { char x; long y; } ac__type_alignof_;"; then :
14270
14271 else
14272   if test "$ac_cv_type_long" = yes; then
14273      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14274 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14275 as_fn_error 77 "cannot compute alignment of long
14276 See \`config.log' for more details" "$LINENO" 5; }
14277    else
14278      ac_cv_alignof_long=0
14279    fi
14280 fi
14281
14282 fi
14283 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long" >&5
14284 $as_echo "$ac_cv_alignof_long" >&6; }
14285
14286
14287
14288 cat >>confdefs.h <<_ACEOF
14289 #define ALIGNOF_LONG $ac_cv_alignof_long
14290 _ACEOF
14291
14292
14293 if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then
14294   # The cast to long int works around a bug in the HP C Compiler,
14295 # see AC_CHECK_SIZEOF for more information.
14296 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of long long int" >&5
14297 $as_echo_n "checking alignment of long long int... " >&6; }
14298 if ${ac_cv_alignof_long_long_int+:} false; then :
14299   $as_echo_n "(cached) " >&6
14300 else
14301   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long_long_int"        "$ac_includes_default
14302 #ifndef offsetof
14303 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
14304 #endif
14305 typedef struct { char x; long long int y; } ac__type_alignof_;"; then :
14306
14307 else
14308   if test "$ac_cv_type_long_long_int" = yes; then
14309      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14310 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14311 as_fn_error 77 "cannot compute alignment of long long int
14312 See \`config.log' for more details" "$LINENO" 5; }
14313    else
14314      ac_cv_alignof_long_long_int=0
14315    fi
14316 fi
14317
14318 fi
14319 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long_long_int" >&5
14320 $as_echo "$ac_cv_alignof_long_long_int" >&6; }
14321
14322
14323
14324 cat >>confdefs.h <<_ACEOF
14325 #define ALIGNOF_LONG_LONG_INT $ac_cv_alignof_long_long_int
14326 _ACEOF
14327
14328
14329 fi
14330 # The cast to long int works around a bug in the HP C Compiler,
14331 # see AC_CHECK_SIZEOF for more information.
14332 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of double" >&5
14333 $as_echo_n "checking alignment of double... " >&6; }
14334 if ${ac_cv_alignof_double+:} false; then :
14335   $as_echo_n "(cached) " >&6
14336 else
14337   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_double"        "$ac_includes_default
14338 #ifndef offsetof
14339 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
14340 #endif
14341 typedef struct { char x; double y; } ac__type_alignof_;"; then :
14342
14343 else
14344   if test "$ac_cv_type_double" = yes; then
14345      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14346 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14347 as_fn_error 77 "cannot compute alignment of double
14348 See \`config.log' for more details" "$LINENO" 5; }
14349    else
14350      ac_cv_alignof_double=0
14351    fi
14352 fi
14353
14354 fi
14355 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_double" >&5
14356 $as_echo "$ac_cv_alignof_double" >&6; }
14357
14358
14359
14360 cat >>confdefs.h <<_ACEOF
14361 #define ALIGNOF_DOUBLE $ac_cv_alignof_double
14362 _ACEOF
14363
14364
14365
14366 # Compute maximum alignment of any basic type.
14367 # We assume long's alignment is at least as strong as char, short, or int;
14368 # but we must check long long (if it exists) and double.
14369
14370 MAX_ALIGNOF=$ac_cv_alignof_long
14371 if test $MAX_ALIGNOF -lt $ac_cv_alignof_double ; then
14372   MAX_ALIGNOF=$ac_cv_alignof_double
14373 fi
14374 if test x"$HAVE_LONG_LONG_INT_64" = xyes && test $MAX_ALIGNOF -lt $ac_cv_alignof_long_long_int ; then
14375   MAX_ALIGNOF="$ac_cv_alignof_long_long_int"
14376 fi
14377
14378 cat >>confdefs.h <<_ACEOF
14379 #define MAXIMUM_ALIGNOF $MAX_ALIGNOF
14380 _ACEOF
14381
14382
14383
14384 # Some platforms predefine the types int8, int16, etc.  Only check
14385 # a (hopefully) representative subset.
14386 ac_fn_c_check_type "$LINENO" "int8" "ac_cv_type_int8" "#include <stdio.h>
14387 "
14388 if test "x$ac_cv_type_int8" = xyes; then :
14389
14390 cat >>confdefs.h <<_ACEOF
14391 #define HAVE_INT8 1
14392 _ACEOF
14393
14394
14395 fi
14396 ac_fn_c_check_type "$LINENO" "uint8" "ac_cv_type_uint8" "#include <stdio.h>
14397 "
14398 if test "x$ac_cv_type_uint8" = xyes; then :
14399
14400 cat >>confdefs.h <<_ACEOF
14401 #define HAVE_UINT8 1
14402 _ACEOF
14403
14404
14405 fi
14406 ac_fn_c_check_type "$LINENO" "int64" "ac_cv_type_int64" "#include <stdio.h>
14407 "
14408 if test "x$ac_cv_type_int64" = xyes; then :
14409
14410 cat >>confdefs.h <<_ACEOF
14411 #define HAVE_INT64 1
14412 _ACEOF
14413
14414
14415 fi
14416 ac_fn_c_check_type "$LINENO" "uint64" "ac_cv_type_uint64" "#include <stdio.h>
14417 "
14418 if test "x$ac_cv_type_uint64" = xyes; then :
14419
14420 cat >>confdefs.h <<_ACEOF
14421 #define HAVE_UINT64 1
14422 _ACEOF
14423
14424
14425 fi
14426
14427
14428 # Check for extensions offering the integer scalar type __int128.
14429 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __int128" >&5
14430 $as_echo_n "checking for __int128... " >&6; }
14431 if ${pgac_cv__128bit_int+:} false; then :
14432   $as_echo_n "(cached) " >&6
14433 else
14434   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14435 /* end confdefs.h.  */
14436
14437 /*
14438  * These are globals to discourage the compiler from folding all the
14439  * arithmetic tests down to compile-time constants.  We do not have
14440  * convenient support for 64bit literals at this point...
14441  */
14442 __int128 a = 48828125;
14443 __int128 b = 97656255;
14444
14445 int
14446 main ()
14447 {
14448
14449 __int128 c,d;
14450 a = (a << 12) + 1; /* 200000000001 */
14451 b = (b << 12) + 5; /* 400000000005 */
14452 /* use the most relevant arithmetic ops */
14453 c = a * b;
14454 d = (c + b) / b;
14455 /* return different values, to prevent optimizations */
14456 if (d != a+1)
14457   return 0;
14458 return 1;
14459
14460   ;
14461   return 0;
14462 }
14463 _ACEOF
14464 if ac_fn_c_try_link "$LINENO"; then :
14465   pgac_cv__128bit_int=yes
14466 else
14467   pgac_cv__128bit_int=no
14468 fi
14469 rm -f core conftest.err conftest.$ac_objext \
14470     conftest$ac_exeext conftest.$ac_ext
14471 fi
14472 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__128bit_int" >&5
14473 $as_echo "$pgac_cv__128bit_int" >&6; }
14474 if test x"$pgac_cv__128bit_int" = xyes ; then
14475
14476 $as_echo "#define PG_INT128_TYPE __int128" >>confdefs.h
14477
14478 fi
14479
14480 # Check for various atomic operations now that we have checked how to declare
14481 # 64bit integers.
14482 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync char locking functions" >&5
14483 $as_echo_n "checking for builtin __sync char locking functions... " >&6; }
14484 if ${pgac_cv_gcc_sync_char_tas+:} false; then :
14485   $as_echo_n "(cached) " >&6
14486 else
14487   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14488 /* end confdefs.h.  */
14489
14490 int
14491 main ()
14492 {
14493 char lock = 0;
14494    __sync_lock_test_and_set(&lock, 1);
14495    __sync_lock_release(&lock);
14496   ;
14497   return 0;
14498 }
14499 _ACEOF
14500 if ac_fn_c_try_link "$LINENO"; then :
14501   pgac_cv_gcc_sync_char_tas="yes"
14502 else
14503   pgac_cv_gcc_sync_char_tas="no"
14504 fi
14505 rm -f core conftest.err conftest.$ac_objext \
14506     conftest$ac_exeext conftest.$ac_ext
14507 fi
14508 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_char_tas" >&5
14509 $as_echo "$pgac_cv_gcc_sync_char_tas" >&6; }
14510 if test x"$pgac_cv_gcc_sync_char_tas" = x"yes"; then
14511
14512 $as_echo "#define HAVE_GCC__SYNC_CHAR_TAS 1" >>confdefs.h
14513
14514 fi
14515 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int32 locking functions" >&5
14516 $as_echo_n "checking for builtin __sync int32 locking functions... " >&6; }
14517 if ${pgac_cv_gcc_sync_int32_tas+:} false; then :
14518   $as_echo_n "(cached) " >&6
14519 else
14520   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14521 /* end confdefs.h.  */
14522
14523 int
14524 main ()
14525 {
14526 int lock = 0;
14527    __sync_lock_test_and_set(&lock, 1);
14528    __sync_lock_release(&lock);
14529   ;
14530   return 0;
14531 }
14532 _ACEOF
14533 if ac_fn_c_try_link "$LINENO"; then :
14534   pgac_cv_gcc_sync_int32_tas="yes"
14535 else
14536   pgac_cv_gcc_sync_int32_tas="no"
14537 fi
14538 rm -f core conftest.err conftest.$ac_objext \
14539     conftest$ac_exeext conftest.$ac_ext
14540 fi
14541 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int32_tas" >&5
14542 $as_echo "$pgac_cv_gcc_sync_int32_tas" >&6; }
14543 if test x"$pgac_cv_gcc_sync_int32_tas" = x"yes"; then
14544
14545 $as_echo "#define HAVE_GCC__SYNC_INT32_TAS 1" >>confdefs.h
14546
14547 fi
14548 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int32 atomic operations" >&5
14549 $as_echo_n "checking for builtin __sync int32 atomic operations... " >&6; }
14550 if ${pgac_cv_gcc_sync_int32_cas+:} false; then :
14551   $as_echo_n "(cached) " >&6
14552 else
14553   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14554 /* end confdefs.h.  */
14555
14556 int
14557 main ()
14558 {
14559 int val = 0;
14560    __sync_val_compare_and_swap(&val, 0, 37);
14561   ;
14562   return 0;
14563 }
14564 _ACEOF
14565 if ac_fn_c_try_link "$LINENO"; then :
14566   pgac_cv_gcc_sync_int32_cas="yes"
14567 else
14568   pgac_cv_gcc_sync_int32_cas="no"
14569 fi
14570 rm -f core conftest.err conftest.$ac_objext \
14571     conftest$ac_exeext conftest.$ac_ext
14572 fi
14573 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int32_cas" >&5
14574 $as_echo "$pgac_cv_gcc_sync_int32_cas" >&6; }
14575 if test x"$pgac_cv_gcc_sync_int32_cas" = x"yes"; then
14576
14577 $as_echo "#define HAVE_GCC__SYNC_INT32_CAS 1" >>confdefs.h
14578
14579 fi
14580 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int64 atomic operations" >&5
14581 $as_echo_n "checking for builtin __sync int64 atomic operations... " >&6; }
14582 if ${pgac_cv_gcc_sync_int64_cas+:} false; then :
14583   $as_echo_n "(cached) " >&6
14584 else
14585   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14586 /* end confdefs.h.  */
14587
14588 int
14589 main ()
14590 {
14591 PG_INT64_TYPE lock = 0;
14592    __sync_val_compare_and_swap(&lock, 0, (PG_INT64_TYPE) 37);
14593   ;
14594   return 0;
14595 }
14596 _ACEOF
14597 if ac_fn_c_try_link "$LINENO"; then :
14598   pgac_cv_gcc_sync_int64_cas="yes"
14599 else
14600   pgac_cv_gcc_sync_int64_cas="no"
14601 fi
14602 rm -f core conftest.err conftest.$ac_objext \
14603     conftest$ac_exeext conftest.$ac_ext
14604 fi
14605 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int64_cas" >&5
14606 $as_echo "$pgac_cv_gcc_sync_int64_cas" >&6; }
14607 if test x"$pgac_cv_gcc_sync_int64_cas" = x"yes"; then
14608
14609 $as_echo "#define HAVE_GCC__SYNC_INT64_CAS 1" >>confdefs.h
14610
14611 fi
14612 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic int32 atomic operations" >&5
14613 $as_echo_n "checking for builtin __atomic int32 atomic operations... " >&6; }
14614 if ${pgac_cv_gcc_atomic_int32_cas+:} false; then :
14615   $as_echo_n "(cached) " >&6
14616 else
14617   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14618 /* end confdefs.h.  */
14619
14620 int
14621 main ()
14622 {
14623 int val = 0;
14624    int expect = 0;
14625    __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
14626   ;
14627   return 0;
14628 }
14629 _ACEOF
14630 if ac_fn_c_try_link "$LINENO"; then :
14631   pgac_cv_gcc_atomic_int32_cas="yes"
14632 else
14633   pgac_cv_gcc_atomic_int32_cas="no"
14634 fi
14635 rm -f core conftest.err conftest.$ac_objext \
14636     conftest$ac_exeext conftest.$ac_ext
14637 fi
14638 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_atomic_int32_cas" >&5
14639 $as_echo "$pgac_cv_gcc_atomic_int32_cas" >&6; }
14640 if test x"$pgac_cv_gcc_atomic_int32_cas" = x"yes"; then
14641
14642 $as_echo "#define HAVE_GCC__ATOMIC_INT32_CAS 1" >>confdefs.h
14643
14644 fi
14645 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic int64 atomic operations" >&5
14646 $as_echo_n "checking for builtin __atomic int64 atomic operations... " >&6; }
14647 if ${pgac_cv_gcc_atomic_int64_cas+:} false; then :
14648   $as_echo_n "(cached) " >&6
14649 else
14650   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14651 /* end confdefs.h.  */
14652
14653 int
14654 main ()
14655 {
14656 PG_INT64_TYPE val = 0;
14657    PG_INT64_TYPE expect = 0;
14658    __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
14659   ;
14660   return 0;
14661 }
14662 _ACEOF
14663 if ac_fn_c_try_link "$LINENO"; then :
14664   pgac_cv_gcc_atomic_int64_cas="yes"
14665 else
14666   pgac_cv_gcc_atomic_int64_cas="no"
14667 fi
14668 rm -f core conftest.err conftest.$ac_objext \
14669     conftest$ac_exeext conftest.$ac_ext
14670 fi
14671 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_atomic_int64_cas" >&5
14672 $as_echo "$pgac_cv_gcc_atomic_int64_cas" >&6; }
14673 if test x"$pgac_cv_gcc_atomic_int64_cas" = x"yes"; then
14674
14675 $as_echo "#define HAVE_GCC__ATOMIC_INT64_CAS 1" >>confdefs.h
14676
14677 fi
14678
14679
14680 # Check for x86 cpuid instruction
14681 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __get_cpuid" >&5
14682 $as_echo_n "checking for __get_cpuid... " >&6; }
14683 if ${pgac_cv__get_cpuid+:} false; then :
14684   $as_echo_n "(cached) " >&6
14685 else
14686   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14687 /* end confdefs.h.  */
14688 #include <cpuid.h>
14689 int
14690 main ()
14691 {
14692 unsigned int exx[4] = {0, 0, 0, 0};
14693   __get_cpuid(1, &exx[0], &exx[1], &exx[2], &exx[3]);
14694
14695   ;
14696   return 0;
14697 }
14698 _ACEOF
14699 if ac_fn_c_try_link "$LINENO"; then :
14700   pgac_cv__get_cpuid="yes"
14701 else
14702   pgac_cv__get_cpuid="no"
14703 fi
14704 rm -f core conftest.err conftest.$ac_objext \
14705     conftest$ac_exeext conftest.$ac_ext
14706 fi
14707 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__get_cpuid" >&5
14708 $as_echo "$pgac_cv__get_cpuid" >&6; }
14709 if test x"$pgac_cv__get_cpuid" = x"yes"; then
14710
14711 $as_echo "#define HAVE__GET_CPUID 1" >>confdefs.h
14712
14713 fi
14714
14715 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __cpuid" >&5
14716 $as_echo_n "checking for __cpuid... " >&6; }
14717 if ${pgac_cv__cpuid+:} false; then :
14718   $as_echo_n "(cached) " >&6
14719 else
14720   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14721 /* end confdefs.h.  */
14722 #include <intrin.h>
14723 int
14724 main ()
14725 {
14726 unsigned int exx[4] = {0, 0, 0, 0};
14727   __get_cpuid(exx[0], 1);
14728
14729   ;
14730   return 0;
14731 }
14732 _ACEOF
14733 if ac_fn_c_try_link "$LINENO"; then :
14734   pgac_cv__cpuid="yes"
14735 else
14736   pgac_cv__cpuid="no"
14737 fi
14738 rm -f core conftest.err conftest.$ac_objext \
14739     conftest$ac_exeext conftest.$ac_ext
14740 fi
14741 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__cpuid" >&5
14742 $as_echo "$pgac_cv__cpuid" >&6; }
14743 if test x"$pgac_cv__cpuid" = x"yes"; then
14744
14745 $as_echo "#define HAVE__CPUID 1" >>confdefs.h
14746
14747 fi
14748
14749 # Check for Intel SSE 4.2 intrinsics to do CRC calculations.
14750 #
14751 # First check if the _mm_crc32_u8 and _mm_crc32_u64 intrinsics can be used
14752 # with the default compiler flags. If not, check if adding the -msse4.2
14753 # flag helps. CFLAGS_SSE42 is set to -msse4.2 if that's required.
14754 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=" >&5
14755 $as_echo_n "checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=... " >&6; }
14756 if ${pgac_cv_sse42_crc32_intrinsics_+:} false; then :
14757   $as_echo_n "(cached) " >&6
14758 else
14759   pgac_save_CFLAGS=$CFLAGS
14760 CFLAGS="$pgac_save_CFLAGS "
14761 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14762 /* end confdefs.h.  */
14763 #include <nmmintrin.h>
14764 int
14765 main ()
14766 {
14767 unsigned int crc = 0;
14768    crc = _mm_crc32_u8(crc, 0);
14769    crc = _mm_crc32_u32(crc, 0);
14770    /* return computed value, to prevent the above being optimized away */
14771    return crc == 0;
14772   ;
14773   return 0;
14774 }
14775 _ACEOF
14776 if ac_fn_c_try_link "$LINENO"; then :
14777   pgac_cv_sse42_crc32_intrinsics_=yes
14778 else
14779   pgac_cv_sse42_crc32_intrinsics_=no
14780 fi
14781 rm -f core conftest.err conftest.$ac_objext \
14782     conftest$ac_exeext conftest.$ac_ext
14783 CFLAGS="$pgac_save_CFLAGS"
14784 fi
14785 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_sse42_crc32_intrinsics_" >&5
14786 $as_echo "$pgac_cv_sse42_crc32_intrinsics_" >&6; }
14787 if test x"$pgac_cv_sse42_crc32_intrinsics_" = x"yes"; then
14788   CFLAGS_SSE42=""
14789   pgac_sse42_crc32_intrinsics=yes
14790 fi
14791
14792 if test x"$pgac_sse42_crc32_intrinsics" != x"yes"; then
14793   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=-msse4.2" >&5
14794 $as_echo_n "checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=-msse4.2... " >&6; }
14795 if ${pgac_cv_sse42_crc32_intrinsics__msse4_2+:} false; then :
14796   $as_echo_n "(cached) " >&6
14797 else
14798   pgac_save_CFLAGS=$CFLAGS
14799 CFLAGS="$pgac_save_CFLAGS -msse4.2"
14800 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14801 /* end confdefs.h.  */
14802 #include <nmmintrin.h>
14803 int
14804 main ()
14805 {
14806 unsigned int crc = 0;
14807    crc = _mm_crc32_u8(crc, 0);
14808    crc = _mm_crc32_u32(crc, 0);
14809    /* return computed value, to prevent the above being optimized away */
14810    return crc == 0;
14811   ;
14812   return 0;
14813 }
14814 _ACEOF
14815 if ac_fn_c_try_link "$LINENO"; then :
14816   pgac_cv_sse42_crc32_intrinsics__msse4_2=yes
14817 else
14818   pgac_cv_sse42_crc32_intrinsics__msse4_2=no
14819 fi
14820 rm -f core conftest.err conftest.$ac_objext \
14821     conftest$ac_exeext conftest.$ac_ext
14822 CFLAGS="$pgac_save_CFLAGS"
14823 fi
14824 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_sse42_crc32_intrinsics__msse4_2" >&5
14825 $as_echo "$pgac_cv_sse42_crc32_intrinsics__msse4_2" >&6; }
14826 if test x"$pgac_cv_sse42_crc32_intrinsics__msse4_2" = x"yes"; then
14827   CFLAGS_SSE42="-msse4.2"
14828   pgac_sse42_crc32_intrinsics=yes
14829 fi
14830
14831 fi
14832
14833
14834 # Are we targeting a processor that supports SSE 4.2? gcc, clang and icc all
14835 # define __SSE4_2__ in that case.
14836 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14837 /* end confdefs.h.  */
14838
14839 int
14840 main ()
14841 {
14842
14843 #ifndef __SSE4_2__
14844 #error __SSE4_2__ not defined
14845 #endif
14846
14847   ;
14848   return 0;
14849 }
14850 _ACEOF
14851 if ac_fn_c_try_compile "$LINENO"; then :
14852   SSE4_2_TARGETED=1
14853 fi
14854 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14855
14856 # Select CRC-32C implementation.
14857 #
14858 # If we are targeting a processor that has SSE 4.2 instructions, we can use the
14859 # special CRC instructions for calculating CRC-32C. If we're not targeting such
14860 # a processor, but we can nevertheless produce code that uses the SSE
14861 # intrinsics, perhaps with some extra CFLAGS, compile both implementations and
14862 # select which one to use at runtime, depending on whether SSE 4.2 is supported
14863 # by the processor we're running on.
14864 #
14865 # You can override this logic by setting the appropriate USE_*_CRC32 flag to 1
14866 # in the template or configure command line.
14867 if test x"$USE_SSE42_CRC32C" = x"" && test x"$USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" = x"" && test x"$USE_SLICING_BY_8_CRC32C" = x""; then
14868   if test x"$pgac_sse42_crc32_intrinsics" = x"yes" && test x"$SSE4_2_TARGETED" = x"1" ; then
14869     USE_SSE42_CRC32C=1
14870   else
14871     # the CPUID instruction is needed for the runtime check.
14872     if test x"$pgac_sse42_crc32_intrinsics" = x"yes" && (test x"$pgac_cv__get_cpuid" = x"yes" || test x"$pgac_cv__cpuid" = x"yes"); then
14873       USE_SSE42_CRC32C_WITH_RUNTIME_CHECK=1
14874     else
14875       # fall back to slicing-by-8 algorithm which doesn't require any special
14876       # CPU support.
14877       USE_SLICING_BY_8_CRC32C=1
14878     fi
14879   fi
14880 fi
14881
14882 # Set PG_CRC32C_OBJS appropriately depending on the selected implementation.
14883 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which CRC-32C implementation to use" >&5
14884 $as_echo_n "checking which CRC-32C implementation to use... " >&6; }
14885 if test x"$USE_SSE42_CRC32C" = x"1"; then
14886
14887 $as_echo "#define USE_SSE42_CRC32C 1" >>confdefs.h
14888
14889   PG_CRC32C_OBJS="pg_crc32c_sse42.o"
14890   { $as_echo "$as_me:${as_lineno-$LINENO}: result: SSE 4.2" >&5
14891 $as_echo "SSE 4.2" >&6; }
14892 else
14893   if test x"$USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" = x"1"; then
14894
14895 $as_echo "#define USE_SSE42_CRC32C_WITH_RUNTIME_CHECK 1" >>confdefs.h
14896
14897     PG_CRC32C_OBJS="pg_crc32c_sse42.o pg_crc32c_sb8.o pg_crc32c_choose.o"
14898     { $as_echo "$as_me:${as_lineno-$LINENO}: result: SSE 4.2 with runtime check" >&5
14899 $as_echo "SSE 4.2 with runtime check" >&6; }
14900   else
14901
14902 $as_echo "#define USE_SLICING_BY_8_CRC32C 1" >>confdefs.h
14903
14904     PG_CRC32C_OBJS="pg_crc32c_sb8.o"
14905     { $as_echo "$as_me:${as_lineno-$LINENO}: result: slicing-by-8" >&5
14906 $as_echo "slicing-by-8" >&6; }
14907   fi
14908 fi
14909
14910
14911
14912 # Select semaphore implementation type.
14913 if test "$PORTNAME" != "win32"; then
14914   if test x"$PREFERRED_SEMAPHORES" = x"NAMED_POSIX" ; then
14915     # Need sem_open for this
14916     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_open" >&5
14917 $as_echo_n "checking for library containing sem_open... " >&6; }
14918 if ${ac_cv_search_sem_open+:} false; then :
14919   $as_echo_n "(cached) " >&6
14920 else
14921   ac_func_search_save_LIBS=$LIBS
14922 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14923 /* end confdefs.h.  */
14924
14925 /* Override any GCC internal prototype to avoid an error.
14926    Use char because int might match the return type of a GCC
14927    builtin and then its argument prototype would still apply.  */
14928 #ifdef __cplusplus
14929 extern "C"
14930 #endif
14931 char sem_open ();
14932 int
14933 main ()
14934 {
14935 return sem_open ();
14936   ;
14937   return 0;
14938 }
14939 _ACEOF
14940 for ac_lib in '' rt pthread; do
14941   if test -z "$ac_lib"; then
14942     ac_res="none required"
14943   else
14944     ac_res=-l$ac_lib
14945     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
14946   fi
14947   if ac_fn_c_try_link "$LINENO"; then :
14948   ac_cv_search_sem_open=$ac_res
14949 fi
14950 rm -f core conftest.err conftest.$ac_objext \
14951     conftest$ac_exeext
14952   if ${ac_cv_search_sem_open+:} false; then :
14953   break
14954 fi
14955 done
14956 if ${ac_cv_search_sem_open+:} false; then :
14957
14958 else
14959   ac_cv_search_sem_open=no
14960 fi
14961 rm conftest.$ac_ext
14962 LIBS=$ac_func_search_save_LIBS
14963 fi
14964 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_open" >&5
14965 $as_echo "$ac_cv_search_sem_open" >&6; }
14966 ac_res=$ac_cv_search_sem_open
14967 if test "$ac_res" != no; then :
14968   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
14969   USE_NAMED_POSIX_SEMAPHORES=1
14970 fi
14971
14972   fi
14973   if test x"$PREFERRED_SEMAPHORES" = x"UNNAMED_POSIX" ; then
14974     # Need sem_init for this
14975     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5
14976 $as_echo_n "checking for library containing sem_init... " >&6; }
14977 if ${ac_cv_search_sem_init+:} false; then :
14978   $as_echo_n "(cached) " >&6
14979 else
14980   ac_func_search_save_LIBS=$LIBS
14981 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14982 /* end confdefs.h.  */
14983
14984 /* Override any GCC internal prototype to avoid an error.
14985    Use char because int might match the return type of a GCC
14986    builtin and then its argument prototype would still apply.  */
14987 #ifdef __cplusplus
14988 extern "C"
14989 #endif
14990 char sem_init ();
14991 int
14992 main ()
14993 {
14994 return sem_init ();
14995   ;
14996   return 0;
14997 }
14998 _ACEOF
14999 for ac_lib in '' rt pthread; do
15000   if test -z "$ac_lib"; then
15001     ac_res="none required"
15002   else
15003     ac_res=-l$ac_lib
15004     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
15005   fi
15006   if ac_fn_c_try_link "$LINENO"; then :
15007   ac_cv_search_sem_init=$ac_res
15008 fi
15009 rm -f core conftest.err conftest.$ac_objext \
15010     conftest$ac_exeext
15011   if ${ac_cv_search_sem_init+:} false; then :
15012   break
15013 fi
15014 done
15015 if ${ac_cv_search_sem_init+:} false; then :
15016
15017 else
15018   ac_cv_search_sem_init=no
15019 fi
15020 rm conftest.$ac_ext
15021 LIBS=$ac_func_search_save_LIBS
15022 fi
15023 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_init" >&5
15024 $as_echo "$ac_cv_search_sem_init" >&6; }
15025 ac_res=$ac_cv_search_sem_init
15026 if test "$ac_res" != no; then :
15027   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
15028   USE_UNNAMED_POSIX_SEMAPHORES=1
15029 fi
15030
15031   fi
15032   { $as_echo "$as_me:${as_lineno-$LINENO}: checking which semaphore API to use" >&5
15033 $as_echo_n "checking which semaphore API to use... " >&6; }
15034   if test x"$USE_NAMED_POSIX_SEMAPHORES" = x"1" ; then
15035
15036 $as_echo "#define USE_NAMED_POSIX_SEMAPHORES 1" >>confdefs.h
15037
15038     SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
15039     sematype="named POSIX"
15040   else
15041     if test x"$USE_UNNAMED_POSIX_SEMAPHORES" = x"1" ; then
15042
15043 $as_echo "#define USE_UNNAMED_POSIX_SEMAPHORES 1" >>confdefs.h
15044
15045       SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
15046       sematype="unnamed POSIX"
15047     else
15048
15049 $as_echo "#define USE_SYSV_SEMAPHORES 1" >>confdefs.h
15050
15051       SEMA_IMPLEMENTATION="src/backend/port/sysv_sema.c"
15052       sematype="System V"
15053     fi
15054   fi
15055   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sematype" >&5
15056 $as_echo "$sematype" >&6; }
15057 else
15058
15059 $as_echo "#define USE_WIN32_SEMAPHORES 1" >>confdefs.h
15060
15061   SEMA_IMPLEMENTATION="src/backend/port/win32_sema.c"
15062 fi
15063
15064
15065 # Select shared-memory implementation type.
15066 if test "$PORTNAME" != "win32"; then
15067
15068 $as_echo "#define USE_SYSV_SHARED_MEMORY 1" >>confdefs.h
15069
15070   SHMEM_IMPLEMENTATION="src/backend/port/sysv_shmem.c"
15071 else
15072
15073 $as_echo "#define USE_WIN32_SHARED_MEMORY 1" >>confdefs.h
15074
15075   SHMEM_IMPLEMENTATION="src/backend/port/win32_shmem.c"
15076 fi
15077
15078 # Select random number source
15079 #
15080 # You can override this logic by setting the appropriate USE_*RANDOM flag to 1
15081 # in the template or configure command line.
15082
15083 # If not selected manually, try to select a source automatically.
15084 if test "$enable_strong_random" = "yes" && test x"$USE_OPENSSL_RANDOM" = x"" && test x"$USE_WIN32_RANDOM" = x"" && test x"$USE_DEV_URANDOM" = x"" ; then
15085   if test x"$with_openssl" = x"yes" ; then
15086     USE_OPENSSL_RANDOM=1
15087   elif test "$PORTNAME" = "win32" ; then
15088     USE_WIN32_RANDOM=1
15089   else
15090     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/urandom" >&5
15091 $as_echo_n "checking for /dev/urandom... " >&6; }
15092 if ${ac_cv_file__dev_urandom+:} false; then :
15093   $as_echo_n "(cached) " >&6
15094 else
15095   test "$cross_compiling" = yes &&
15096   as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
15097 if test -r "/dev/urandom"; then
15098   ac_cv_file__dev_urandom=yes
15099 else
15100   ac_cv_file__dev_urandom=no
15101 fi
15102 fi
15103 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_urandom" >&5
15104 $as_echo "$ac_cv_file__dev_urandom" >&6; }
15105 if test "x$ac_cv_file__dev_urandom" = xyes; then :
15106
15107 fi
15108
15109
15110     if test x"$ac_cv_file__dev_urandom" = x"yes" ; then
15111       USE_DEV_URANDOM=1
15112     fi
15113   fi
15114 fi
15115
15116 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which random number source to use" >&5
15117 $as_echo_n "checking which random number source to use... " >&6; }
15118 if test "$enable_strong_random" = yes ; then
15119   if test x"$USE_OPENSSL_RANDOM" = x"1" ; then
15120
15121 $as_echo "#define USE_OPENSSL_RANDOM 1" >>confdefs.h
15122
15123     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL" >&5
15124 $as_echo "OpenSSL" >&6; }
15125   elif test x"$USE_WIN32_RANDOM" = x"1" ; then
15126
15127 $as_echo "#define USE_WIN32_RANDOM 1" >>confdefs.h
15128
15129     { $as_echo "$as_me:${as_lineno-$LINENO}: result: Windows native" >&5
15130 $as_echo "Windows native" >&6; }
15131   elif test x"$USE_DEV_URANDOM" = x"1" ; then
15132
15133 $as_echo "#define USE_DEV_URANDOM 1" >>confdefs.h
15134
15135     { $as_echo "$as_me:${as_lineno-$LINENO}: result: /dev/urandom" >&5
15136 $as_echo "/dev/urandom" >&6; }
15137   else
15138     as_fn_error $? "
15139 no source of strong random numbers was found
15140 PostgreSQL can use OpenSSL or /dev/urandom as a source of random numbers,
15141 for authentication protocols. You can use --disable-strong-random to use a
15142 built-in pseudo random number generator, but that may be insecure." "$LINENO" 5
15143   fi
15144
15145 $as_echo "#define HAVE_STRONG_RANDOM 1" >>confdefs.h
15146
15147 else
15148     { $as_echo "$as_me:${as_lineno-$LINENO}: result: weak builtin PRNG" >&5
15149 $as_echo "weak builtin PRNG" >&6; }
15150     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
15151 *** Not using a strong random number source may be insecure." >&5
15152 $as_echo "$as_me: WARNING:
15153 *** Not using a strong random number source may be insecure." >&2;}
15154 fi
15155
15156 # If not set in template file, set bytes to use libc memset()
15157 if test x"$MEMSET_LOOP_LIMIT" = x"" ; then
15158   MEMSET_LOOP_LIMIT=1024
15159 fi
15160
15161 cat >>confdefs.h <<_ACEOF
15162 #define MEMSET_LOOP_LIMIT ${MEMSET_LOOP_LIMIT}
15163 _ACEOF
15164
15165
15166
15167 if test "$enable_nls" = yes ; then
15168
15169   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing bind_textdomain_codeset" >&5
15170 $as_echo_n "checking for library containing bind_textdomain_codeset... " >&6; }
15171 if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
15172   $as_echo_n "(cached) " >&6
15173 else
15174   ac_func_search_save_LIBS=$LIBS
15175 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15176 /* end confdefs.h.  */
15177
15178 /* Override any GCC internal prototype to avoid an error.
15179    Use char because int might match the return type of a GCC
15180    builtin and then its argument prototype would still apply.  */
15181 #ifdef __cplusplus
15182 extern "C"
15183 #endif
15184 char bind_textdomain_codeset ();
15185 int
15186 main ()
15187 {
15188 return bind_textdomain_codeset ();
15189   ;
15190   return 0;
15191 }
15192 _ACEOF
15193 for ac_lib in '' intl; do
15194   if test -z "$ac_lib"; then
15195     ac_res="none required"
15196   else
15197     ac_res=-l$ac_lib
15198     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
15199   fi
15200   if ac_fn_c_try_link "$LINENO"; then :
15201   ac_cv_search_bind_textdomain_codeset=$ac_res
15202 fi
15203 rm -f core conftest.err conftest.$ac_objext \
15204     conftest$ac_exeext
15205   if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
15206   break
15207 fi
15208 done
15209 if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
15210
15211 else
15212   ac_cv_search_bind_textdomain_codeset=no
15213 fi
15214 rm conftest.$ac_ext
15215 LIBS=$ac_func_search_save_LIBS
15216 fi
15217 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_bind_textdomain_codeset" >&5
15218 $as_echo "$ac_cv_search_bind_textdomain_codeset" >&6; }
15219 ac_res=$ac_cv_search_bind_textdomain_codeset
15220 if test "$ac_res" != no; then :
15221   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
15222
15223 else
15224   as_fn_error $? "a gettext implementation is required for NLS" "$LINENO" 5
15225 fi
15226
15227   ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
15228 if test "x$ac_cv_header_libintl_h" = xyes; then :
15229
15230 else
15231   as_fn_error $? "header file <libintl.h> is required for NLS" "$LINENO" 5
15232 fi
15233
15234
15235   for ac_prog in msgfmt
15236 do
15237   # Extract the first word of "$ac_prog", so it can be a program name with args.
15238 set dummy $ac_prog; ac_word=$2
15239 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15240 $as_echo_n "checking for $ac_word... " >&6; }
15241 if ${ac_cv_prog_MSGFMT+:} false; then :
15242   $as_echo_n "(cached) " >&6
15243 else
15244   if test -n "$MSGFMT"; then
15245   ac_cv_prog_MSGFMT="$MSGFMT" # Let the user override the test.
15246 else
15247 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15248 for as_dir in $PATH
15249 do
15250   IFS=$as_save_IFS
15251   test -z "$as_dir" && as_dir=.
15252     for ac_exec_ext in '' $ac_executable_extensions; do
15253   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15254     ac_cv_prog_MSGFMT="$ac_prog"
15255     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15256     break 2
15257   fi
15258 done
15259   done
15260 IFS=$as_save_IFS
15261
15262 fi
15263 fi
15264 MSGFMT=$ac_cv_prog_MSGFMT
15265 if test -n "$MSGFMT"; then
15266   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
15267 $as_echo "$MSGFMT" >&6; }
15268 else
15269   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15270 $as_echo "no" >&6; }
15271 fi
15272
15273
15274   test -n "$MSGFMT" && break
15275 done
15276
15277   if test -z "$MSGFMT"; then
15278     as_fn_error $? "msgfmt is required for NLS" "$LINENO" 5
15279   fi
15280   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msgfmt flags" >&5
15281 $as_echo_n "checking for msgfmt flags... " >&6; }
15282 if ${pgac_cv_msgfmt_flags+:} false; then :
15283   $as_echo_n "(cached) " >&6
15284 else
15285   if test x"$MSGFMT" != x"" && "$MSGFMT" --version 2>&1 | grep "GNU" >/dev/null; then
15286     pgac_cv_msgfmt_flags=-c
15287 fi
15288 fi
15289 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_msgfmt_flags" >&5
15290 $as_echo "$pgac_cv_msgfmt_flags" >&6; }
15291   MSGFMT_FLAGS=$pgac_cv_msgfmt_flags
15292
15293   for ac_prog in msgmerge
15294 do
15295   # Extract the first word of "$ac_prog", so it can be a program name with args.
15296 set dummy $ac_prog; ac_word=$2
15297 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15298 $as_echo_n "checking for $ac_word... " >&6; }
15299 if ${ac_cv_prog_MSGMERGE+:} false; then :
15300   $as_echo_n "(cached) " >&6
15301 else
15302   if test -n "$MSGMERGE"; then
15303   ac_cv_prog_MSGMERGE="$MSGMERGE" # Let the user override the test.
15304 else
15305 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15306 for as_dir in $PATH
15307 do
15308   IFS=$as_save_IFS
15309   test -z "$as_dir" && as_dir=.
15310     for ac_exec_ext in '' $ac_executable_extensions; do
15311   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15312     ac_cv_prog_MSGMERGE="$ac_prog"
15313     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15314     break 2
15315   fi
15316 done
15317   done
15318 IFS=$as_save_IFS
15319
15320 fi
15321 fi
15322 MSGMERGE=$ac_cv_prog_MSGMERGE
15323 if test -n "$MSGMERGE"; then
15324   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
15325 $as_echo "$MSGMERGE" >&6; }
15326 else
15327   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15328 $as_echo "no" >&6; }
15329 fi
15330
15331
15332   test -n "$MSGMERGE" && break
15333 done
15334
15335   for ac_prog in xgettext
15336 do
15337   # Extract the first word of "$ac_prog", so it can be a program name with args.
15338 set dummy $ac_prog; ac_word=$2
15339 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15340 $as_echo_n "checking for $ac_word... " >&6; }
15341 if ${ac_cv_prog_XGETTEXT+:} false; then :
15342   $as_echo_n "(cached) " >&6
15343 else
15344   if test -n "$XGETTEXT"; then
15345   ac_cv_prog_XGETTEXT="$XGETTEXT" # Let the user override the test.
15346 else
15347 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15348 for as_dir in $PATH
15349 do
15350   IFS=$as_save_IFS
15351   test -z "$as_dir" && as_dir=.
15352     for ac_exec_ext in '' $ac_executable_extensions; do
15353   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15354     ac_cv_prog_XGETTEXT="$ac_prog"
15355     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15356     break 2
15357   fi
15358 done
15359   done
15360 IFS=$as_save_IFS
15361
15362 fi
15363 fi
15364 XGETTEXT=$ac_cv_prog_XGETTEXT
15365 if test -n "$XGETTEXT"; then
15366   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
15367 $as_echo "$XGETTEXT" >&6; }
15368 else
15369   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15370 $as_echo "no" >&6; }
15371 fi
15372
15373
15374   test -n "$XGETTEXT" && break
15375 done
15376
15377
15378 fi
15379
15380 # Check for Tcl configuration script tclConfig.sh
15381 if test "$with_tcl" = yes; then
15382     for ac_prog in tclsh tcl tclsh8.6 tclsh86 tclsh8.5 tclsh85 tclsh8.4 tclsh84
15383 do
15384   # Extract the first word of "$ac_prog", so it can be a program name with args.
15385 set dummy $ac_prog; ac_word=$2
15386 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15387 $as_echo_n "checking for $ac_word... " >&6; }
15388 if ${ac_cv_path_TCLSH+:} false; then :
15389   $as_echo_n "(cached) " >&6
15390 else
15391   case $TCLSH in
15392   [\\/]* | ?:[\\/]*)
15393   ac_cv_path_TCLSH="$TCLSH" # Let the user override the test with a path.
15394   ;;
15395   *)
15396   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15397 for as_dir in $PATH
15398 do
15399   IFS=$as_save_IFS
15400   test -z "$as_dir" && as_dir=.
15401     for ac_exec_ext in '' $ac_executable_extensions; do
15402   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15403     ac_cv_path_TCLSH="$as_dir/$ac_word$ac_exec_ext"
15404     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15405     break 2
15406   fi
15407 done
15408   done
15409 IFS=$as_save_IFS
15410
15411   ;;
15412 esac
15413 fi
15414 TCLSH=$ac_cv_path_TCLSH
15415 if test -n "$TCLSH"; then
15416   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLSH" >&5
15417 $as_echo "$TCLSH" >&6; }
15418 else
15419   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15420 $as_echo "no" >&6; }
15421 fi
15422
15423
15424   test -n "$TCLSH" && break
15425 done
15426
15427 if test x"$TCLSH" = x""; then
15428   as_fn_error $? "Tcl shell not found" "$LINENO" 5
15429 fi
15430
15431 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclConfig.sh" >&5
15432 $as_echo_n "checking for tclConfig.sh... " >&6; }
15433 # Let user override test
15434 if test -z "$TCL_CONFIG_SH"; then
15435     pgac_test_dirs="$with_tclconfig"
15436
15437     set X $pgac_test_dirs; shift
15438     if test $# -eq 0; then
15439         test -z "$TCLSH" && as_fn_error $? "unable to locate tclConfig.sh because no Tcl shell was found" "$LINENO" 5
15440         set X `echo 'puts $auto_path' | $TCLSH`; shift
15441     fi
15442
15443     for pgac_dir do
15444         if test -r "$pgac_dir/tclConfig.sh"; then
15445             TCL_CONFIG_SH=$pgac_dir/tclConfig.sh
15446             break
15447         fi
15448     done
15449 fi
15450
15451 if test -z "$TCL_CONFIG_SH"; then
15452     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15453 $as_echo "no" >&6; }
15454     as_fn_error $? "file 'tclConfig.sh' is required for Tcl" "$LINENO" 5
15455 else
15456     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCL_CONFIG_SH" >&5
15457 $as_echo "$TCL_CONFIG_SH" >&6; }
15458 fi
15459
15460
15461
15462     . "$TCL_CONFIG_SH"
15463 eval TCL_INCLUDE_SPEC=\"$TCL_INCLUDE_SPEC\"
15464 eval TCL_LIBS=\"$TCL_LIBS\"
15465 eval TCL_LIB_SPEC=\"$TCL_LIB_SPEC\"
15466 eval TCL_SHARED_BUILD=\"$TCL_SHARED_BUILD\"
15467
15468         if test "$TCL_SHARED_BUILD" != 1; then
15469       as_fn_error $? "cannot build PL/Tcl because Tcl is not a shared library
15470 Use --without-tcl to disable building PL/Tcl." "$LINENO" 5
15471     fi
15472     # now that we have TCL_INCLUDE_SPEC, we can check for <tcl.h>
15473     ac_save_CPPFLAGS=$CPPFLAGS
15474     CPPFLAGS="$TCL_INCLUDE_SPEC $CPPFLAGS"
15475     ac_fn_c_check_header_mongrel "$LINENO" "tcl.h" "ac_cv_header_tcl_h" "$ac_includes_default"
15476 if test "x$ac_cv_header_tcl_h" = xyes; then :
15477
15478 else
15479   as_fn_error $? "header file <tcl.h> is required for Tcl" "$LINENO" 5
15480 fi
15481
15482
15483     CPPFLAGS=$ac_save_CPPFLAGS
15484 fi
15485
15486 # check for <perl.h>
15487 if test "$with_perl" = yes; then
15488   ac_save_CPPFLAGS=$CPPFLAGS
15489   CPPFLAGS="$CPPFLAGS -I$perl_archlibexp/CORE"
15490   ac_fn_c_check_header_compile "$LINENO" "perl.h" "ac_cv_header_perl_h" "#include <EXTERN.h>
15491 "
15492 if test "x$ac_cv_header_perl_h" = xyes; then :
15493
15494 else
15495   as_fn_error $? "header file <perl.h> is required for Perl" "$LINENO" 5
15496 fi
15497
15498
15499   # While we're at it, check that we can link to libperl.
15500   # On most platforms, if perl.h is there then libperl.so will be too, but at
15501   # this writing Debian packages them separately.  There is no known reason to
15502   # waste cycles on separate probes for the Tcl or Python libraries, though.
15503   pgac_save_LIBS=$LIBS
15504   LIBS="$perl_embed_ldflags"
15505   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libperl" >&5
15506 $as_echo_n "checking for libperl... " >&6; }
15507   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15508 /* end confdefs.h.  */
15509
15510 #include <EXTERN.h>
15511 #include <perl.h>
15512
15513 int
15514 main ()
15515 {
15516 perl_alloc();
15517   ;
15518   return 0;
15519 }
15520 _ACEOF
15521 if ac_fn_c_try_link "$LINENO"; then :
15522   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15523 $as_echo "yes" >&6; }
15524 else
15525   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15526 $as_echo "no" >&6; }
15527      as_fn_error $? "libperl library is required for Perl" "$LINENO" 5
15528 fi
15529 rm -f core conftest.err conftest.$ac_objext \
15530     conftest$ac_exeext conftest.$ac_ext
15531   LIBS=$pgac_save_LIBS
15532   CPPFLAGS=$ac_save_CPPFLAGS
15533 fi
15534
15535 # check for <Python.h>
15536 if test "$with_python" = yes; then
15537   ac_save_CPPFLAGS=$CPPFLAGS
15538   CPPFLAGS="$python_includespec $CPPFLAGS"
15539   ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
15540 if test "x$ac_cv_header_Python_h" = xyes; then :
15541
15542 else
15543   as_fn_error $? "header file <Python.h> is required for Python" "$LINENO" 5
15544 fi
15545
15546
15547   CPPFLAGS=$ac_save_CPPFLAGS
15548 fi
15549
15550 #
15551 # Check for DocBook and tools
15552 #
15553 for ac_prog in onsgmls nsgmls
15554 do
15555   # Extract the first word of "$ac_prog", so it can be a program name with args.
15556 set dummy $ac_prog; ac_word=$2
15557 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15558 $as_echo_n "checking for $ac_word... " >&6; }
15559 if ${ac_cv_prog_NSGMLS+:} false; then :
15560   $as_echo_n "(cached) " >&6
15561 else
15562   if test -n "$NSGMLS"; then
15563   ac_cv_prog_NSGMLS="$NSGMLS" # Let the user override the test.
15564 else
15565 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15566 for as_dir in $PATH
15567 do
15568   IFS=$as_save_IFS
15569   test -z "$as_dir" && as_dir=.
15570     for ac_exec_ext in '' $ac_executable_extensions; do
15571   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15572     ac_cv_prog_NSGMLS="$ac_prog"
15573     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15574     break 2
15575   fi
15576 done
15577   done
15578 IFS=$as_save_IFS
15579
15580 fi
15581 fi
15582 NSGMLS=$ac_cv_prog_NSGMLS
15583 if test -n "$NSGMLS"; then
15584   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NSGMLS" >&5
15585 $as_echo "$NSGMLS" >&6; }
15586 else
15587   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15588 $as_echo "no" >&6; }
15589 fi
15590
15591
15592   test -n "$NSGMLS" && break
15593 done
15594
15595 for ac_prog in openjade jade
15596 do
15597   # Extract the first word of "$ac_prog", so it can be a program name with args.
15598 set dummy $ac_prog; ac_word=$2
15599 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15600 $as_echo_n "checking for $ac_word... " >&6; }
15601 if ${ac_cv_prog_JADE+:} false; then :
15602   $as_echo_n "(cached) " >&6
15603 else
15604   if test -n "$JADE"; then
15605   ac_cv_prog_JADE="$JADE" # Let the user override the test.
15606 else
15607 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15608 for as_dir in $PATH
15609 do
15610   IFS=$as_save_IFS
15611   test -z "$as_dir" && as_dir=.
15612     for ac_exec_ext in '' $ac_executable_extensions; do
15613   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15614     ac_cv_prog_JADE="$ac_prog"
15615     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15616     break 2
15617   fi
15618 done
15619   done
15620 IFS=$as_save_IFS
15621
15622 fi
15623 fi
15624 JADE=$ac_cv_prog_JADE
15625 if test -n "$JADE"; then
15626   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JADE" >&5
15627 $as_echo "$JADE" >&6; }
15628 else
15629   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15630 $as_echo "no" >&6; }
15631 fi
15632
15633
15634   test -n "$JADE" && break
15635 done
15636
15637
15638 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook V4.2" >&5
15639 $as_echo_n "checking for DocBook V4.2... " >&6; }
15640 if ${pgac_cv_check_docbook+:} false; then :
15641   $as_echo_n "(cached) " >&6
15642 else
15643   cat >conftest.sgml <<EOF
15644 <!doctype book PUBLIC "-//OASIS//DTD DocBook V4.2//EN">
15645 <book>
15646  <title>test</title>
15647  <chapter>
15648   <title>random</title>
15649    <sect1>
15650     <title>testsect</title>
15651     <para>text</para>
15652   </sect1>
15653  </chapter>
15654 </book>
15655 EOF
15656
15657 pgac_cv_check_docbook=no
15658
15659 if test -n "$NSGMLS"; then
15660   $NSGMLS -s conftest.sgml 1>&5 2>&1
15661   if test $? -eq 0; then
15662     pgac_cv_check_docbook=yes
15663   fi
15664 fi
15665 rm -f conftest.sgml
15666 fi
15667 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_docbook" >&5
15668 $as_echo "$pgac_cv_check_docbook" >&6; }
15669
15670 have_docbook=$pgac_cv_check_docbook
15671
15672
15673 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook stylesheets" >&5
15674 $as_echo_n "checking for DocBook stylesheets... " >&6; }
15675 if ${pgac_cv_path_stylesheets+:} false; then :
15676   $as_echo_n "(cached) " >&6
15677 else
15678   if test -n "$DOCBOOKSTYLE"; then
15679   pgac_cv_path_stylesheets=$DOCBOOKSTYLE
15680 else
15681   for pgac_prefix in /usr /usr/local /opt /sw; do
15682     for pgac_infix in share lib; do
15683       for pgac_postfix in \
15684         sgml/stylesheets/nwalsh-modular \
15685         sgml/stylesheets/docbook \
15686         sgml/stylesheets/dsssl/docbook \
15687         sgml/docbook-dsssl \
15688         sgml/docbook/dsssl/modular \
15689         sgml/docbook/stylesheet/dsssl/modular \
15690         sgml/docbook/dsssl-stylesheets \
15691         sgml/dsssl/docbook-dsssl-nwalsh
15692       do
15693         pgac_candidate=$pgac_prefix/$pgac_infix/$pgac_postfix
15694         if test -r "$pgac_candidate/html/docbook.dsl" \
15695            && test -r "$pgac_candidate/print/docbook.dsl"
15696         then
15697           pgac_cv_path_stylesheets=$pgac_candidate
15698           break 3
15699         fi
15700       done
15701     done
15702   done
15703 fi
15704 fi
15705
15706 DOCBOOKSTYLE=$pgac_cv_path_stylesheets
15707
15708 if test -n "$DOCBOOKSTYLE"; then
15709   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCBOOKSTYLE" >&5
15710 $as_echo "$DOCBOOKSTYLE" >&6; }
15711 else
15712   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15713 $as_echo "no" >&6; }
15714 fi
15715 if test -n "$DOCBOOKSTYLE" -a -r "$DOCBOOKSTYLE/bin/collateindex.pl"; then
15716   COLLATEINDEX="$DOCBOOKSTYLE/bin/collateindex.pl"
15717
15718 else
15719   # Extract the first word of "collateindex.pl", so it can be a program name with args.
15720 set dummy collateindex.pl; ac_word=$2
15721 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15722 $as_echo_n "checking for $ac_word... " >&6; }
15723 if ${ac_cv_path_COLLATEINDEX+:} false; then :
15724   $as_echo_n "(cached) " >&6
15725 else
15726   case $COLLATEINDEX in
15727   [\\/]* | ?:[\\/]*)
15728   ac_cv_path_COLLATEINDEX="$COLLATEINDEX" # Let the user override the test with a path.
15729   ;;
15730   *)
15731   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15732 for as_dir in $PATH
15733 do
15734   IFS=$as_save_IFS
15735   test -z "$as_dir" && as_dir=.
15736     for ac_exec_ext in '' $ac_executable_extensions; do
15737   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15738     ac_cv_path_COLLATEINDEX="$as_dir/$ac_word$ac_exec_ext"
15739     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15740     break 2
15741   fi
15742 done
15743   done
15744 IFS=$as_save_IFS
15745
15746   ;;
15747 esac
15748 fi
15749 COLLATEINDEX=$ac_cv_path_COLLATEINDEX
15750 if test -n "$COLLATEINDEX"; then
15751   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COLLATEINDEX" >&5
15752 $as_echo "$COLLATEINDEX" >&6; }
15753 else
15754   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15755 $as_echo "no" >&6; }
15756 fi
15757
15758
15759 fi
15760 for ac_prog in dbtoepub
15761 do
15762   # Extract the first word of "$ac_prog", so it can be a program name with args.
15763 set dummy $ac_prog; ac_word=$2
15764 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15765 $as_echo_n "checking for $ac_word... " >&6; }
15766 if ${ac_cv_prog_DBTOEPUB+:} false; then :
15767   $as_echo_n "(cached) " >&6
15768 else
15769   if test -n "$DBTOEPUB"; then
15770   ac_cv_prog_DBTOEPUB="$DBTOEPUB" # Let the user override the test.
15771 else
15772 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15773 for as_dir in $PATH
15774 do
15775   IFS=$as_save_IFS
15776   test -z "$as_dir" && as_dir=.
15777     for ac_exec_ext in '' $ac_executable_extensions; do
15778   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15779     ac_cv_prog_DBTOEPUB="$ac_prog"
15780     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15781     break 2
15782   fi
15783 done
15784   done
15785 IFS=$as_save_IFS
15786
15787 fi
15788 fi
15789 DBTOEPUB=$ac_cv_prog_DBTOEPUB
15790 if test -n "$DBTOEPUB"; then
15791   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
15792 $as_echo "$DBTOEPUB" >&6; }
15793 else
15794   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15795 $as_echo "no" >&6; }
15796 fi
15797
15798
15799   test -n "$DBTOEPUB" && break
15800 done
15801
15802 for ac_prog in xmllint
15803 do
15804   # Extract the first word of "$ac_prog", so it can be a program name with args.
15805 set dummy $ac_prog; ac_word=$2
15806 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15807 $as_echo_n "checking for $ac_word... " >&6; }
15808 if ${ac_cv_prog_XMLLINT+:} false; then :
15809   $as_echo_n "(cached) " >&6
15810 else
15811   if test -n "$XMLLINT"; then
15812   ac_cv_prog_XMLLINT="$XMLLINT" # Let the user override the test.
15813 else
15814 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15815 for as_dir in $PATH
15816 do
15817   IFS=$as_save_IFS
15818   test -z "$as_dir" && as_dir=.
15819     for ac_exec_ext in '' $ac_executable_extensions; do
15820   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15821     ac_cv_prog_XMLLINT="$ac_prog"
15822     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15823     break 2
15824   fi
15825 done
15826   done
15827 IFS=$as_save_IFS
15828
15829 fi
15830 fi
15831 XMLLINT=$ac_cv_prog_XMLLINT
15832 if test -n "$XMLLINT"; then
15833   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
15834 $as_echo "$XMLLINT" >&6; }
15835 else
15836   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15837 $as_echo "no" >&6; }
15838 fi
15839
15840
15841   test -n "$XMLLINT" && break
15842 done
15843
15844 for ac_prog in xsltproc
15845 do
15846   # Extract the first word of "$ac_prog", so it can be a program name with args.
15847 set dummy $ac_prog; ac_word=$2
15848 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15849 $as_echo_n "checking for $ac_word... " >&6; }
15850 if ${ac_cv_prog_XSLTPROC+:} false; then :
15851   $as_echo_n "(cached) " >&6
15852 else
15853   if test -n "$XSLTPROC"; then
15854   ac_cv_prog_XSLTPROC="$XSLTPROC" # Let the user override the test.
15855 else
15856 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15857 for as_dir in $PATH
15858 do
15859   IFS=$as_save_IFS
15860   test -z "$as_dir" && as_dir=.
15861     for ac_exec_ext in '' $ac_executable_extensions; do
15862   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15863     ac_cv_prog_XSLTPROC="$ac_prog"
15864     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15865     break 2
15866   fi
15867 done
15868   done
15869 IFS=$as_save_IFS
15870
15871 fi
15872 fi
15873 XSLTPROC=$ac_cv_prog_XSLTPROC
15874 if test -n "$XSLTPROC"; then
15875   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
15876 $as_echo "$XSLTPROC" >&6; }
15877 else
15878   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15879 $as_echo "no" >&6; }
15880 fi
15881
15882
15883   test -n "$XSLTPROC" && break
15884 done
15885
15886 for ac_prog in osx sgml2xml sx
15887 do
15888   # Extract the first word of "$ac_prog", so it can be a program name with args.
15889 set dummy $ac_prog; ac_word=$2
15890 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15891 $as_echo_n "checking for $ac_word... " >&6; }
15892 if ${ac_cv_prog_OSX+:} false; then :
15893   $as_echo_n "(cached) " >&6
15894 else
15895   if test -n "$OSX"; then
15896   ac_cv_prog_OSX="$OSX" # Let the user override the test.
15897 else
15898 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15899 for as_dir in $PATH
15900 do
15901   IFS=$as_save_IFS
15902   test -z "$as_dir" && as_dir=.
15903     for ac_exec_ext in '' $ac_executable_extensions; do
15904   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15905     ac_cv_prog_OSX="$ac_prog"
15906     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15907     break 2
15908   fi
15909 done
15910   done
15911 IFS=$as_save_IFS
15912
15913 fi
15914 fi
15915 OSX=$ac_cv_prog_OSX
15916 if test -n "$OSX"; then
15917   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OSX" >&5
15918 $as_echo "$OSX" >&6; }
15919 else
15920   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15921 $as_echo "no" >&6; }
15922 fi
15923
15924
15925   test -n "$OSX" && break
15926 done
15927
15928
15929 #
15930 # Check for test tools
15931 #
15932 if test "$enable_tap_tests" = yes; then
15933   for ac_prog in prove
15934 do
15935   # Extract the first word of "$ac_prog", so it can be a program name with args.
15936 set dummy $ac_prog; ac_word=$2
15937 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15938 $as_echo_n "checking for $ac_word... " >&6; }
15939 if ${ac_cv_prog_PROVE+:} false; then :
15940   $as_echo_n "(cached) " >&6
15941 else
15942   if test -n "$PROVE"; then
15943   ac_cv_prog_PROVE="$PROVE" # Let the user override the test.
15944 else
15945 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15946 for as_dir in $PATH
15947 do
15948   IFS=$as_save_IFS
15949   test -z "$as_dir" && as_dir=.
15950     for ac_exec_ext in '' $ac_executable_extensions; do
15951   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15952     ac_cv_prog_PROVE="$ac_prog"
15953     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15954     break 2
15955   fi
15956 done
15957   done
15958 IFS=$as_save_IFS
15959
15960 fi
15961 fi
15962 PROVE=$ac_cv_prog_PROVE
15963 if test -n "$PROVE"; then
15964   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROVE" >&5
15965 $as_echo "$PROVE" >&6; }
15966 else
15967   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15968 $as_echo "no" >&6; }
15969 fi
15970
15971
15972   test -n "$PROVE" && break
15973 done
15974
15975   if test -z "$PROVE"; then
15976     as_fn_error $? "prove not found" "$LINENO" 5
15977   fi
15978   if test -z "$PERL"; then
15979     as_fn_error $? "Perl not found" "$LINENO" 5
15980   fi
15981 fi
15982
15983 # Thread testing
15984
15985 # We have to run the thread test near the end so we have all our symbols
15986 # defined.  Cross compiling throws a warning.
15987 #
15988 if test "$enable_thread_safety" = yes; then
15989 if test "$PORTNAME" != "win32"
15990 then
15991 { $as_echo "$as_me:${as_lineno-$LINENO}: checking thread safety of required library functions" >&5
15992 $as_echo_n "checking thread safety of required library functions... " >&6; }
15993
15994 _CFLAGS="$CFLAGS"
15995 _LIBS="$LIBS"
15996 CFLAGS="$CFLAGS $PTHREAD_CFLAGS -DIN_CONFIGURE"
15997 LIBS="$LIBS $PTHREAD_LIBS"
15998 if test "$cross_compiling" = yes; then :
15999   { $as_echo "$as_me:${as_lineno-$LINENO}: result: maybe" >&5
16000 $as_echo "maybe" >&6; }
16001   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
16002 *** Skipping thread test program because of cross-compile build.
16003 *** Run the program in src/test/thread on the target machine.
16004 " >&5
16005 $as_echo "$as_me: WARNING:
16006 *** Skipping thread test program because of cross-compile build.
16007 *** Run the program in src/test/thread on the target machine.
16008 " >&2;}
16009 else
16010   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16011 /* end confdefs.h.  */
16012 #include "$srcdir/src/test/thread/thread_test.c"
16013 _ACEOF
16014 if ac_fn_c_try_run "$LINENO"; then :
16015   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
16016 $as_echo "yes" >&6; }
16017 else
16018   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
16019 $as_echo "no" >&6; }
16020   as_fn_error $? "thread test program failed
16021 This platform is not thread-safe.  Check the file 'config.log' or compile
16022 and run src/test/thread/thread_test for the exact reason.
16023 Use --disable-thread-safety to disable thread safety." "$LINENO" 5
16024 fi
16025 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16026   conftest.$ac_objext conftest.beam conftest.$ac_ext
16027 fi
16028
16029 CFLAGS="$_CFLAGS"
16030 LIBS="$_LIBS"
16031 else
16032 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** skipping thread test on Win32" >&5
16033 $as_echo "$as_me: WARNING: *** skipping thread test on Win32" >&2;}
16034 fi
16035 fi
16036
16037 # If compiler will take -Wl,--as-needed (or various platform-specific
16038 # spellings thereof) then add that to LDFLAGS.  This is much easier than
16039 # trying to filter LIBS to the minimum for each executable.
16040 # On (at least) some Red-Hat-derived systems, this switch breaks linking to
16041 # libreadline; therefore we postpone testing it until we know what library
16042 # dependencies readline has.  The test code will try to link with $LIBS.
16043 if test "$with_readline" = yes; then
16044   link_test_func=readline
16045 else
16046   link_test_func=exit
16047 fi
16048
16049 if test "$PORTNAME" = "darwin"; then
16050   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,-dead_strip_dylibs" >&5
16051 $as_echo_n "checking whether $CC supports -Wl,-dead_strip_dylibs... " >&6; }
16052 if ${pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs+:} false; then :
16053   $as_echo_n "(cached) " >&6
16054 else
16055   pgac_save_LDFLAGS=$LDFLAGS
16056 LDFLAGS="$pgac_save_LDFLAGS -Wl,-dead_strip_dylibs"
16057 if test "$cross_compiling" = yes; then :
16058   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs="assuming no"
16059 else
16060   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16061 /* end confdefs.h.  */
16062 extern void $link_test_func (); void (*fptr) () = $link_test_func;
16063 int
16064 main ()
16065 {
16066
16067   ;
16068   return 0;
16069 }
16070 _ACEOF
16071 if ac_fn_c_try_run "$LINENO"; then :
16072   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=yes
16073 else
16074   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=no
16075 fi
16076 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16077   conftest.$ac_objext conftest.beam conftest.$ac_ext
16078 fi
16079
16080 LDFLAGS="$pgac_save_LDFLAGS"
16081 fi
16082 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&5
16083 $as_echo "$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&6; }
16084 if test x"$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" = x"yes"; then
16085   LDFLAGS="$LDFLAGS -Wl,-dead_strip_dylibs"
16086 fi
16087
16088 elif test "$PORTNAME" = "openbsd"; then
16089   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,-Bdynamic" >&5
16090 $as_echo_n "checking whether $CC supports -Wl,-Bdynamic... " >&6; }
16091 if ${pgac_cv_prog_cc_ldflags__Wl__Bdynamic+:} false; then :
16092   $as_echo_n "(cached) " >&6
16093 else
16094   pgac_save_LDFLAGS=$LDFLAGS
16095 LDFLAGS="$pgac_save_LDFLAGS -Wl,-Bdynamic"
16096 if test "$cross_compiling" = yes; then :
16097   pgac_cv_prog_cc_ldflags__Wl__Bdynamic="assuming no"
16098 else
16099   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16100 /* end confdefs.h.  */
16101 extern void $link_test_func (); void (*fptr) () = $link_test_func;
16102 int
16103 main ()
16104 {
16105
16106   ;
16107   return 0;
16108 }
16109 _ACEOF
16110 if ac_fn_c_try_run "$LINENO"; then :
16111   pgac_cv_prog_cc_ldflags__Wl__Bdynamic=yes
16112 else
16113   pgac_cv_prog_cc_ldflags__Wl__Bdynamic=no
16114 fi
16115 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16116   conftest.$ac_objext conftest.beam conftest.$ac_ext
16117 fi
16118
16119 LDFLAGS="$pgac_save_LDFLAGS"
16120 fi
16121 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&5
16122 $as_echo "$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&6; }
16123 if test x"$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" = x"yes"; then
16124   LDFLAGS="$LDFLAGS -Wl,-Bdynamic"
16125 fi
16126
16127 else
16128   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,--as-needed" >&5
16129 $as_echo_n "checking whether $CC supports -Wl,--as-needed... " >&6; }
16130 if ${pgac_cv_prog_cc_ldflags__Wl___as_needed+:} false; then :
16131   $as_echo_n "(cached) " >&6
16132 else
16133   pgac_save_LDFLAGS=$LDFLAGS
16134 LDFLAGS="$pgac_save_LDFLAGS -Wl,--as-needed"
16135 if test "$cross_compiling" = yes; then :
16136   pgac_cv_prog_cc_ldflags__Wl___as_needed="assuming no"
16137 else
16138   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16139 /* end confdefs.h.  */
16140 extern void $link_test_func (); void (*fptr) () = $link_test_func;
16141 int
16142 main ()
16143 {
16144
16145   ;
16146   return 0;
16147 }
16148 _ACEOF
16149 if ac_fn_c_try_run "$LINENO"; then :
16150   pgac_cv_prog_cc_ldflags__Wl___as_needed=yes
16151 else
16152   pgac_cv_prog_cc_ldflags__Wl___as_needed=no
16153 fi
16154 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16155   conftest.$ac_objext conftest.beam conftest.$ac_ext
16156 fi
16157
16158 LDFLAGS="$pgac_save_LDFLAGS"
16159 fi
16160 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl___as_needed" >&5
16161 $as_echo "$pgac_cv_prog_cc_ldflags__Wl___as_needed" >&6; }
16162 if test x"$pgac_cv_prog_cc_ldflags__Wl___as_needed" = x"yes"; then
16163   LDFLAGS="$LDFLAGS -Wl,--as-needed"
16164 fi
16165
16166 fi
16167
16168 # Create compiler version string
16169 if test x"$GCC" = x"yes" ; then
16170   cc_string=`${CC} --version | sed q`
16171   case $cc_string in [A-Za-z]*) ;; *) cc_string="GCC $cc_string";; esac
16172 elif test x"$SUN_STUDIO_CC" = x"yes" ; then
16173   cc_string=`${CC} -V 2>&1 | sed q`
16174 else
16175   cc_string=$CC
16176 fi
16177
16178
16179 cat >>confdefs.h <<_ACEOF
16180 #define PG_VERSION_STR "PostgreSQL $PG_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"
16181 _ACEOF
16182
16183
16184 # Supply a numeric version string for use by 3rd party add-ons
16185 # awk -F is a regex on some platforms, and not on others, so make "." a tab
16186 PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |
16187 tr '.' '        ' |
16188 $AWK '{printf "%d%02d%02d", $1, $2, (NF >= 3) ? $3 : 0}'`"
16189
16190 cat >>confdefs.h <<_ACEOF
16191 #define PG_VERSION_NUM $PG_VERSION_NUM
16192 _ACEOF
16193
16194
16195
16196
16197 # Begin output steps
16198
16199 { $as_echo "$as_me:${as_lineno-$LINENO}: using compiler=$cc_string" >&5
16200 $as_echo "$as_me: using compiler=$cc_string" >&6;}
16201 { $as_echo "$as_me:${as_lineno-$LINENO}: using CFLAGS=$CFLAGS" >&5
16202 $as_echo "$as_me: using CFLAGS=$CFLAGS" >&6;}
16203 { $as_echo "$as_me:${as_lineno-$LINENO}: using CPPFLAGS=$CPPFLAGS" >&5
16204 $as_echo "$as_me: using CPPFLAGS=$CPPFLAGS" >&6;}
16205 { $as_echo "$as_me:${as_lineno-$LINENO}: using LDFLAGS=$LDFLAGS" >&5
16206 $as_echo "$as_me: using LDFLAGS=$LDFLAGS" >&6;}
16207
16208 # prepare build tree if outside source tree
16209 # Note 1: test -ef might not exist, but it's more reliable than `pwd`.
16210 # Note 2: /bin/pwd might be better than shell's built-in at getting
16211 #         a symlink-free name.
16212 if ( test "$srcdir" -ef . ) >/dev/null 2>&1 || test "`cd $srcdir && /bin/pwd`" = "`/bin/pwd`"; then
16213   vpath_build=no
16214 else
16215   vpath_build=yes
16216   if test "$no_create" != yes; then
16217     $as_echo_n "preparing build tree... " >&6
16218     pgac_abs_top_srcdir=`cd "$srcdir" && pwd`
16219     $SHELL "$ac_aux_dir/prep_buildtree" "$pgac_abs_top_srcdir" "." \
16220       || as_fn_error $? "failed" "$LINENO" 5
16221     { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
16222 $as_echo "done" >&6; }
16223   fi
16224 fi
16225
16226
16227
16228 ac_config_files="$ac_config_files GNUmakefile src/Makefile.global"
16229
16230
16231 ac_config_links="$ac_config_links src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION} src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION} src/include/dynloader.h:src/backend/port/dynloader/${template}.h src/include/pg_config_os.h:src/include/port/${template}.h src/Makefile.port:src/makefiles/Makefile.${template}"
16232
16233
16234 if test "$PORTNAME" = "win32"; then
16235 ac_config_commands="$ac_config_commands check_win32_symlinks"
16236
16237 fi
16238
16239 ac_config_headers="$ac_config_headers src/include/pg_config.h"
16240
16241
16242 ac_config_headers="$ac_config_headers src/include/pg_config_ext.h"
16243
16244
16245 ac_config_headers="$ac_config_headers src/interfaces/ecpg/include/ecpg_config.h"
16246
16247
16248 cat >confcache <<\_ACEOF
16249 # This file is a shell script that caches the results of configure
16250 # tests run on this system so they can be shared between configure
16251 # scripts and configure runs, see configure's option --config-cache.
16252 # It is not useful on other systems.  If it contains results you don't
16253 # want to keep, you may remove or edit it.
16254 #
16255 # config.status only pays attention to the cache file if you give it
16256 # the --recheck option to rerun configure.
16257 #
16258 # `ac_cv_env_foo' variables (set or unset) will be overridden when
16259 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16260 # following values.
16261
16262 _ACEOF
16263
16264 # The following way of writing the cache mishandles newlines in values,
16265 # but we know of no workaround that is simple, portable, and efficient.
16266 # So, we kill variables containing newlines.
16267 # Ultrix sh set writes to stderr and can't be redirected directly,
16268 # and sets the high bit in the cache file unless we assign to the vars.
16269 (
16270   for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
16271     eval ac_val=\$$ac_var
16272     case $ac_val in #(
16273     *${as_nl}*)
16274       case $ac_var in #(
16275       *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
16276 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
16277       esac
16278       case $ac_var in #(
16279       _ | IFS | as_nl) ;; #(
16280       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
16281       *) { eval $ac_var=; unset $ac_var;} ;;
16282       esac ;;
16283     esac
16284   done
16285
16286   (set) 2>&1 |
16287     case $as_nl`(ac_space=' '; set) 2>&1` in #(
16288     *${as_nl}ac_space=\ *)
16289       # `set' does not quote correctly, so add quotes: double-quote
16290       # substitution turns \\\\ into \\, and sed turns \\ into \.
16291       sed -n \
16292         "s/'/'\\\\''/g;
16293           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16294       ;; #(
16295     *)
16296       # `set' quotes correctly as required by POSIX, so do not add quotes.
16297       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
16298       ;;
16299     esac |
16300     sort
16301 ) |
16302   sed '
16303      /^ac_cv_env_/b end
16304      t clear
16305      :clear
16306      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16307      t end
16308      s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16309      :end' >>confcache
16310 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
16311   if test -w "$cache_file"; then
16312     if test "x$cache_file" != "x/dev/null"; then
16313       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
16314 $as_echo "$as_me: updating cache $cache_file" >&6;}
16315       if test ! -f "$cache_file" || test -h "$cache_file"; then
16316         cat confcache >"$cache_file"
16317       else
16318         case $cache_file in #(
16319         */* | ?:*)
16320           mv -f confcache "$cache_file"$$ &&
16321           mv -f "$cache_file"$$ "$cache_file" ;; #(
16322         *)
16323           mv -f confcache "$cache_file" ;;
16324         esac
16325       fi
16326     fi
16327   else
16328     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
16329 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
16330   fi
16331 fi
16332 rm -f confcache
16333
16334 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16335 # Let make expand exec_prefix.
16336 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16337
16338 DEFS=-DHAVE_CONFIG_H
16339
16340 ac_libobjs=
16341 ac_ltlibobjs=
16342 U=
16343 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
16344   # 1. Remove the extension, and $U if already installed.
16345   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
16346   ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
16347   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
16348   #    will be set to the directory where LIBOBJS objects are built.
16349   as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
16350   as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
16351 done
16352 LIBOBJS=$ac_libobjs
16353
16354 LTLIBOBJS=$ac_ltlibobjs
16355
16356
16357
16358
16359 : "${CONFIG_STATUS=./config.status}"
16360 ac_write_fail=0
16361 ac_clean_files_save=$ac_clean_files
16362 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16363 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
16364 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
16365 as_write_fail=0
16366 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
16367 #! $SHELL
16368 # Generated by $as_me.
16369 # Run this file to recreate the current configuration.
16370 # Compiler output produced by configure, useful for debugging
16371 # configure, is in config.log if it exists.
16372
16373 debug=false
16374 ac_cs_recheck=false
16375 ac_cs_silent=false
16376
16377 SHELL=\${CONFIG_SHELL-$SHELL}
16378 export SHELL
16379 _ASEOF
16380 cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
16381 ## -------------------- ##
16382 ## M4sh Initialization. ##
16383 ## -------------------- ##
16384
16385 # Be more Bourne compatible
16386 DUALCASE=1; export DUALCASE # for MKS sh
16387 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
16388   emulate sh
16389   NULLCMD=:
16390   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
16391   # is contrary to our usage.  Disable this feature.
16392   alias -g '${1+"$@"}'='"$@"'
16393   setopt NO_GLOB_SUBST
16394 else
16395   case `(set -o) 2>/dev/null` in #(
16396   *posix*) :
16397     set -o posix ;; #(
16398   *) :
16399      ;;
16400 esac
16401 fi
16402
16403
16404 as_nl='
16405 '
16406 export as_nl
16407 # Printing a long string crashes Solaris 7 /usr/bin/printf.
16408 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
16409 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
16410 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
16411 # Prefer a ksh shell builtin over an external printf program on Solaris,
16412 # but without wasting forks for bash or zsh.
16413 if test -z "$BASH_VERSION$ZSH_VERSION" \
16414     && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
16415   as_echo='print -r --'
16416   as_echo_n='print -rn --'
16417 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
16418   as_echo='printf %s\n'
16419   as_echo_n='printf %s'
16420 else
16421   if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
16422     as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
16423     as_echo_n='/usr/ucb/echo -n'
16424   else
16425     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
16426     as_echo_n_body='eval
16427       arg=$1;
16428       case $arg in #(
16429       *"$as_nl"*)
16430         expr "X$arg" : "X\\(.*\\)$as_nl";
16431         arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
16432       esac;
16433       expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
16434     '
16435     export as_echo_n_body
16436     as_echo_n='sh -c $as_echo_n_body as_echo'
16437   fi
16438   export as_echo_body
16439   as_echo='sh -c $as_echo_body as_echo'
16440 fi
16441
16442 # The user is always right.
16443 if test "${PATH_SEPARATOR+set}" != set; then
16444   PATH_SEPARATOR=:
16445   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
16446     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
16447       PATH_SEPARATOR=';'
16448   }
16449 fi
16450
16451
16452 # IFS
16453 # We need space, tab and new line, in precisely that order.  Quoting is
16454 # there to prevent editors from complaining about space-tab.
16455 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
16456 # splitting by setting IFS to empty value.)
16457 IFS=" ""        $as_nl"
16458
16459 # Find who we are.  Look in the path if we contain no directory separator.
16460 as_myself=
16461 case $0 in #((
16462   *[\\/]* ) as_myself=$0 ;;
16463   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
16464 for as_dir in $PATH
16465 do
16466   IFS=$as_save_IFS
16467   test -z "$as_dir" && as_dir=.
16468     test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
16469   done
16470 IFS=$as_save_IFS
16471
16472      ;;
16473 esac
16474 # We did not find ourselves, most probably we were run as `sh COMMAND'
16475 # in which case we are not to be found in the path.
16476 if test "x$as_myself" = x; then
16477   as_myself=$0
16478 fi
16479 if test ! -f "$as_myself"; then
16480   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
16481   exit 1
16482 fi
16483
16484 # Unset variables that we do not need and which cause bugs (e.g. in
16485 # pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
16486 # suppresses any "Segmentation fault" message there.  '((' could
16487 # trigger a bug in pdksh 5.2.14.
16488 for as_var in BASH_ENV ENV MAIL MAILPATH
16489 do eval test x\${$as_var+set} = xset \
16490   && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
16491 done
16492 PS1='$ '
16493 PS2='> '
16494 PS4='+ '
16495
16496 # NLS nuisances.
16497 LC_ALL=C
16498 export LC_ALL
16499 LANGUAGE=C
16500 export LANGUAGE
16501
16502 # CDPATH.
16503 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
16504
16505
16506 # as_fn_error STATUS ERROR [LINENO LOG_FD]
16507 # ----------------------------------------
16508 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
16509 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
16510 # script with STATUS, using 1 if that was 0.
16511 as_fn_error ()
16512 {
16513   as_status=$1; test $as_status -eq 0 && as_status=1
16514   if test "$4"; then
16515     as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
16516     $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
16517   fi
16518   $as_echo "$as_me: error: $2" >&2
16519   as_fn_exit $as_status
16520 } # as_fn_error
16521
16522
16523 # as_fn_set_status STATUS
16524 # -----------------------
16525 # Set $? to STATUS, without forking.
16526 as_fn_set_status ()
16527 {
16528   return $1
16529 } # as_fn_set_status
16530
16531 # as_fn_exit STATUS
16532 # -----------------
16533 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
16534 as_fn_exit ()
16535 {
16536   set +e
16537   as_fn_set_status $1
16538   exit $1
16539 } # as_fn_exit
16540
16541 # as_fn_unset VAR
16542 # ---------------
16543 # Portably unset VAR.
16544 as_fn_unset ()
16545 {
16546   { eval $1=; unset $1;}
16547 }
16548 as_unset=as_fn_unset
16549 # as_fn_append VAR VALUE
16550 # ----------------------
16551 # Append the text in VALUE to the end of the definition contained in VAR. Take
16552 # advantage of any shell optimizations that allow amortized linear growth over
16553 # repeated appends, instead of the typical quadratic growth present in naive
16554 # implementations.
16555 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
16556   eval 'as_fn_append ()
16557   {
16558     eval $1+=\$2
16559   }'
16560 else
16561   as_fn_append ()
16562   {
16563     eval $1=\$$1\$2
16564   }
16565 fi # as_fn_append
16566
16567 # as_fn_arith ARG...
16568 # ------------------
16569 # Perform arithmetic evaluation on the ARGs, and store the result in the
16570 # global $as_val. Take advantage of shells that can avoid forks. The arguments
16571 # must be portable across $(()) and expr.
16572 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
16573   eval 'as_fn_arith ()
16574   {
16575     as_val=$(( $* ))
16576   }'
16577 else
16578   as_fn_arith ()
16579   {
16580     as_val=`expr "$@" || test $? -eq 1`
16581   }
16582 fi # as_fn_arith
16583
16584
16585 if expr a : '\(a\)' >/dev/null 2>&1 &&
16586    test "X`expr 00001 : '.*\(...\)'`" = X001; then
16587   as_expr=expr
16588 else
16589   as_expr=false
16590 fi
16591
16592 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
16593   as_basename=basename
16594 else
16595   as_basename=false
16596 fi
16597
16598 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
16599   as_dirname=dirname
16600 else
16601   as_dirname=false
16602 fi
16603
16604 as_me=`$as_basename -- "$0" ||
16605 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
16606          X"$0" : 'X\(//\)$' \| \
16607          X"$0" : 'X\(/\)' \| . 2>/dev/null ||
16608 $as_echo X/"$0" |
16609     sed '/^.*\/\([^/][^/]*\)\/*$/{
16610             s//\1/
16611             q
16612           }
16613           /^X\/\(\/\/\)$/{
16614             s//\1/
16615             q
16616           }
16617           /^X\/\(\/\).*/{
16618             s//\1/
16619             q
16620           }
16621           s/.*/./; q'`
16622
16623 # Avoid depending upon Character Ranges.
16624 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
16625 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
16626 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
16627 as_cr_digits='0123456789'
16628 as_cr_alnum=$as_cr_Letters$as_cr_digits
16629
16630 ECHO_C= ECHO_N= ECHO_T=
16631 case `echo -n x` in #(((((
16632 -n*)
16633   case `echo 'xy\c'` in
16634   *c*) ECHO_T=' ';;     # ECHO_T is single tab character.
16635   xy)  ECHO_C='\c';;
16636   *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
16637        ECHO_T=' ';;
16638   esac;;
16639 *)
16640   ECHO_N='-n';;
16641 esac
16642
16643 rm -f conf$$ conf$$.exe conf$$.file
16644 if test -d conf$$.dir; then
16645   rm -f conf$$.dir/conf$$.file
16646 else
16647   rm -f conf$$.dir
16648   mkdir conf$$.dir 2>/dev/null
16649 fi
16650 if (echo >conf$$.file) 2>/dev/null; then
16651   if ln -s conf$$.file conf$$ 2>/dev/null; then
16652     as_ln_s='ln -s'
16653     # ... but there are two gotchas:
16654     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
16655     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
16656     # In both cases, we have to default to `cp -pR'.
16657     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
16658       as_ln_s='cp -pR'
16659   elif ln conf$$.file conf$$ 2>/dev/null; then
16660     as_ln_s=ln
16661   else
16662     as_ln_s='cp -pR'
16663   fi
16664 else
16665   as_ln_s='cp -pR'
16666 fi
16667 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
16668 rmdir conf$$.dir 2>/dev/null
16669
16670
16671 # as_fn_mkdir_p
16672 # -------------
16673 # Create "$as_dir" as a directory, including parents if necessary.
16674 as_fn_mkdir_p ()
16675 {
16676
16677   case $as_dir in #(
16678   -*) as_dir=./$as_dir;;
16679   esac
16680   test -d "$as_dir" || eval $as_mkdir_p || {
16681     as_dirs=
16682     while :; do
16683       case $as_dir in #(
16684       *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
16685       *) as_qdir=$as_dir;;
16686       esac
16687       as_dirs="'$as_qdir' $as_dirs"
16688       as_dir=`$as_dirname -- "$as_dir" ||
16689 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16690          X"$as_dir" : 'X\(//\)[^/]' \| \
16691          X"$as_dir" : 'X\(//\)$' \| \
16692          X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
16693 $as_echo X"$as_dir" |
16694     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
16695             s//\1/
16696             q
16697           }
16698           /^X\(\/\/\)[^/].*/{
16699             s//\1/
16700             q
16701           }
16702           /^X\(\/\/\)$/{
16703             s//\1/
16704             q
16705           }
16706           /^X\(\/\).*/{
16707             s//\1/
16708             q
16709           }
16710           s/.*/./; q'`
16711       test -d "$as_dir" && break
16712     done
16713     test -z "$as_dirs" || eval "mkdir $as_dirs"
16714   } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
16715
16716
16717 } # as_fn_mkdir_p
16718 if mkdir -p . 2>/dev/null; then
16719   as_mkdir_p='mkdir -p "$as_dir"'
16720 else
16721   test -d ./-p && rmdir ./-p
16722   as_mkdir_p=false
16723 fi
16724
16725
16726 # as_fn_executable_p FILE
16727 # -----------------------
16728 # Test if FILE is an executable regular file.
16729 as_fn_executable_p ()
16730 {
16731   test -f "$1" && test -x "$1"
16732 } # as_fn_executable_p
16733 as_test_x='test -x'
16734 as_executable_p=as_fn_executable_p
16735
16736 # Sed expression to map a string onto a valid CPP name.
16737 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
16738
16739 # Sed expression to map a string onto a valid variable name.
16740 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
16741
16742
16743 exec 6>&1
16744 ## ----------------------------------- ##
16745 ## Main body of $CONFIG_STATUS script. ##
16746 ## ----------------------------------- ##
16747 _ASEOF
16748 test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
16749
16750 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16751 # Save the log message, to keep $0 and so on meaningful, and to
16752 # report actual input values of CONFIG_FILES etc. instead of their
16753 # values after options handling.
16754 ac_log="
16755 This file was extended by PostgreSQL $as_me 10devel, which was
16756 generated by GNU Autoconf 2.69.  Invocation command line was
16757
16758   CONFIG_FILES    = $CONFIG_FILES
16759   CONFIG_HEADERS  = $CONFIG_HEADERS
16760   CONFIG_LINKS    = $CONFIG_LINKS
16761   CONFIG_COMMANDS = $CONFIG_COMMANDS
16762   $ $0 $@
16763
16764 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16765 "
16766
16767 _ACEOF
16768
16769 case $ac_config_files in *"
16770 "*) set x $ac_config_files; shift; ac_config_files=$*;;
16771 esac
16772
16773 case $ac_config_headers in *"
16774 "*) set x $ac_config_headers; shift; ac_config_headers=$*;;
16775 esac
16776
16777
16778 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16779 # Files that config.status was made for.
16780 config_files="$ac_config_files"
16781 config_headers="$ac_config_headers"
16782 config_links="$ac_config_links"
16783 config_commands="$ac_config_commands"
16784
16785 _ACEOF
16786
16787 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16788 ac_cs_usage="\
16789 \`$as_me' instantiates files and other configuration actions
16790 from templates according to the current configuration.  Unless the files
16791 and actions are specified as TAGs, all are instantiated by default.
16792
16793 Usage: $0 [OPTION]... [TAG]...
16794
16795   -h, --help       print this help, then exit
16796   -V, --version    print version number and configuration settings, then exit
16797       --config     print configuration, then exit
16798   -q, --quiet, --silent
16799                    do not print progress messages
16800   -d, --debug      don't remove temporary files
16801       --recheck    update $as_me by reconfiguring in the same conditions
16802       --file=FILE[:TEMPLATE]
16803                    instantiate the configuration file FILE
16804       --header=FILE[:TEMPLATE]
16805                    instantiate the configuration header FILE
16806
16807 Configuration files:
16808 $config_files
16809
16810 Configuration headers:
16811 $config_headers
16812
16813 Configuration links:
16814 $config_links
16815
16816 Configuration commands:
16817 $config_commands
16818
16819 Report bugs to <pgsql-bugs@postgresql.org>."
16820
16821 _ACEOF
16822 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16823 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
16824 ac_cs_version="\\
16825 PostgreSQL config.status 10devel
16826 configured by $0, generated by GNU Autoconf 2.69,
16827   with options \\"\$ac_cs_config\\"
16828
16829 Copyright (C) 2012 Free Software Foundation, Inc.
16830 This config.status script is free software; the Free Software Foundation
16831 gives unlimited permission to copy, distribute and modify it."
16832
16833 ac_pwd='$ac_pwd'
16834 srcdir='$srcdir'
16835 INSTALL='$INSTALL'
16836 MKDIR_P='$MKDIR_P'
16837 AWK='$AWK'
16838 test -n "\$AWK" || AWK=awk
16839 _ACEOF
16840
16841 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16842 # The default lists apply if the user does not specify any file.
16843 ac_need_defaults=:
16844 while test $# != 0
16845 do
16846   case $1 in
16847   --*=?*)
16848     ac_option=`expr "X$1" : 'X\([^=]*\)='`
16849     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
16850     ac_shift=:
16851     ;;
16852   --*=)
16853     ac_option=`expr "X$1" : 'X\([^=]*\)='`
16854     ac_optarg=
16855     ac_shift=:
16856     ;;
16857   *)
16858     ac_option=$1
16859     ac_optarg=$2
16860     ac_shift=shift
16861     ;;
16862   esac
16863
16864   case $ac_option in
16865   # Handling of the options.
16866   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16867     ac_cs_recheck=: ;;
16868   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
16869     $as_echo "$ac_cs_version"; exit ;;
16870   --config | --confi | --conf | --con | --co | --c )
16871     $as_echo "$ac_cs_config"; exit ;;
16872   --debug | --debu | --deb | --de | --d | -d )
16873     debug=: ;;
16874   --file | --fil | --fi | --f )
16875     $ac_shift
16876     case $ac_optarg in
16877     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
16878     '') as_fn_error $? "missing file argument" ;;
16879     esac
16880     as_fn_append CONFIG_FILES " '$ac_optarg'"
16881     ac_need_defaults=false;;
16882   --header | --heade | --head | --hea )
16883     $ac_shift
16884     case $ac_optarg in
16885     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
16886     esac
16887     as_fn_append CONFIG_HEADERS " '$ac_optarg'"
16888     ac_need_defaults=false;;
16889   --he | --h)
16890     # Conflict between --help and --header
16891     as_fn_error $? "ambiguous option: \`$1'
16892 Try \`$0 --help' for more information.";;
16893   --help | --hel | -h )
16894     $as_echo "$ac_cs_usage"; exit ;;
16895   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
16896   | -silent | --silent | --silen | --sile | --sil | --si | --s)
16897     ac_cs_silent=: ;;
16898
16899   # This is an error.
16900   -*) as_fn_error $? "unrecognized option: \`$1'
16901 Try \`$0 --help' for more information." ;;
16902
16903   *) as_fn_append ac_config_targets " $1"
16904      ac_need_defaults=false ;;
16905
16906   esac
16907   shift
16908 done
16909
16910 ac_configure_extra_args=
16911
16912 if $ac_cs_silent; then
16913   exec 6>/dev/null
16914   ac_configure_extra_args="$ac_configure_extra_args --silent"
16915 fi
16916
16917 _ACEOF
16918 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16919 if \$ac_cs_recheck; then
16920   set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
16921   shift
16922   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
16923   CONFIG_SHELL='$SHELL'
16924   export CONFIG_SHELL
16925   exec "\$@"
16926 fi
16927
16928 _ACEOF
16929 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16930 exec 5>>config.log
16931 {
16932   echo
16933   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
16934 ## Running $as_me. ##
16935 _ASBOX
16936   $as_echo "$ac_log"
16937 } >&5
16938
16939 _ACEOF
16940 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16941 _ACEOF
16942
16943 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16944
16945 # Handling of arguments.
16946 for ac_config_target in $ac_config_targets
16947 do
16948   case $ac_config_target in
16949     "src/backend/port/tas.s") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/tas.s:src/backend/port/tas/${tas_file}" ;;
16950     "GNUmakefile") CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;;
16951     "src/Makefile.global") CONFIG_FILES="$CONFIG_FILES src/Makefile.global" ;;
16952     "src/backend/port/dynloader.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c" ;;
16953     "src/backend/port/pg_sema.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}" ;;
16954     "src/backend/port/pg_shmem.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}" ;;
16955     "src/include/dynloader.h") CONFIG_LINKS="$CONFIG_LINKS src/include/dynloader.h:src/backend/port/dynloader/${template}.h" ;;
16956     "src/include/pg_config_os.h") CONFIG_LINKS="$CONFIG_LINKS src/include/pg_config_os.h:src/include/port/${template}.h" ;;
16957     "src/Makefile.port") CONFIG_LINKS="$CONFIG_LINKS src/Makefile.port:src/makefiles/Makefile.${template}" ;;
16958     "check_win32_symlinks") CONFIG_COMMANDS="$CONFIG_COMMANDS check_win32_symlinks" ;;
16959     "src/include/pg_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config.h" ;;
16960     "src/include/pg_config_ext.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config_ext.h" ;;
16961     "src/interfaces/ecpg/include/ecpg_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/interfaces/ecpg/include/ecpg_config.h" ;;
16962
16963   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
16964   esac
16965 done
16966
16967
16968 # If the user did not use the arguments to specify the items to instantiate,
16969 # then the envvar interface is used.  Set only those that are not.
16970 # We use the long form for the default assignment because of an extremely
16971 # bizarre bug on SunOS 4.1.3.
16972 if $ac_need_defaults; then
16973   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16974   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16975   test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
16976   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16977 fi
16978
16979 # Have a temporary directory for convenience.  Make it in the build tree
16980 # simply because there is no reason against having it here, and in addition,
16981 # creating and moving files from /tmp can sometimes cause problems.
16982 # Hook for its removal unless debugging.
16983 # Note that there is a small window in which the directory will not be cleaned:
16984 # after its creation but before its name has been assigned to `$tmp'.
16985 $debug ||
16986 {
16987   tmp= ac_tmp=
16988   trap 'exit_status=$?
16989   : "${ac_tmp:=$tmp}"
16990   { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
16991 ' 0
16992   trap 'as_fn_exit 1' 1 2 13 15
16993 }
16994 # Create a (secure) tmp directory for tmp files.
16995
16996 {
16997   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
16998   test -d "$tmp"
16999 }  ||
17000 {
17001   tmp=./conf$$-$RANDOM
17002   (umask 077 && mkdir "$tmp")
17003 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
17004 ac_tmp=$tmp
17005
17006 # Set up the scripts for CONFIG_FILES section.
17007 # No need to generate them if there are no CONFIG_FILES.
17008 # This happens for instance with `./config.status config.h'.
17009 if test -n "$CONFIG_FILES"; then
17010
17011
17012 ac_cr=`echo X | tr X '\015'`
17013 # On cygwin, bash can eat \r inside `` if the user requested igncr.
17014 # But we know of no other shell where ac_cr would be empty at this
17015 # point, so we can use a bashism as a fallback.
17016 if test "x$ac_cr" = x; then
17017   eval ac_cr=\$\'\\r\'
17018 fi
17019 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
17020 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
17021   ac_cs_awk_cr='\\r'
17022 else
17023   ac_cs_awk_cr=$ac_cr
17024 fi
17025
17026 echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
17027 _ACEOF
17028
17029
17030 {
17031   echo "cat >conf$$subs.awk <<_ACEOF" &&
17032   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
17033   echo "_ACEOF"
17034 } >conf$$subs.sh ||
17035   as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
17036 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
17037 ac_delim='%!_!# '
17038 for ac_last_try in false false false false false :; do
17039   . ./conf$$subs.sh ||
17040     as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
17041
17042   ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
17043   if test $ac_delim_n = $ac_delim_num; then
17044     break
17045   elif $ac_last_try; then
17046     as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
17047   else
17048     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
17049   fi
17050 done
17051 rm -f conf$$subs.sh
17052
17053 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
17054 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
17055 _ACEOF
17056 sed -n '
17057 h
17058 s/^/S["/; s/!.*/"]=/
17059 p
17060 g
17061 s/^[^!]*!//
17062 :repl
17063 t repl
17064 s/'"$ac_delim"'$//
17065 t delim
17066 :nl
17067 h
17068 s/\(.\{148\}\)..*/\1/
17069 t more1
17070 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
17071 p
17072 n
17073 b repl
17074 :more1
17075 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
17076 p
17077 g
17078 s/.\{148\}//
17079 t nl
17080 :delim
17081 h
17082 s/\(.\{148\}\)..*/\1/
17083 t more2
17084 s/["\\]/\\&/g; s/^/"/; s/$/"/
17085 p
17086 b
17087 :more2
17088 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
17089 p
17090 g
17091 s/.\{148\}//
17092 t delim
17093 ' <conf$$subs.awk | sed '
17094 /^[^""]/{
17095   N
17096   s/\n//
17097 }
17098 ' >>$CONFIG_STATUS || ac_write_fail=1
17099 rm -f conf$$subs.awk
17100 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
17101 _ACAWK
17102 cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
17103   for (key in S) S_is_set[key] = 1
17104   FS = "\a"
17105
17106 }
17107 {
17108   line = $ 0
17109   nfields = split(line, field, "@")
17110   substed = 0
17111   len = length(field[1])
17112   for (i = 2; i < nfields; i++) {
17113     key = field[i]
17114     keylen = length(key)
17115     if (S_is_set[key]) {
17116       value = S[key]
17117       line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
17118       len += length(value) + length(field[++i])
17119       substed = 1
17120     } else
17121       len += 1 + keylen
17122   }
17123
17124   print line
17125 }
17126
17127 _ACAWK
17128 _ACEOF
17129 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
17130 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
17131   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
17132 else
17133   cat
17134 fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
17135   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
17136 _ACEOF
17137
17138 # VPATH may cause trouble with some makes, so we remove sole $(srcdir),
17139 # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
17140 # trailing colons and then remove the whole line if VPATH becomes empty
17141 # (actually we leave an empty line to preserve line numbers).
17142 if test "x$srcdir" = x.; then
17143   ac_vpsub='/^[  ]*VPATH[        ]*=[    ]*/{
17144 h
17145 s///
17146 s/^/:/
17147 s/[      ]*$/:/
17148 s/:\$(srcdir):/:/g
17149 s/:\${srcdir}:/:/g
17150 s/:@srcdir@:/:/g
17151 s/^:*//
17152 s/:*$//
17153 x
17154 s/\(=[   ]*\).*/\1/
17155 G
17156 s/\n//
17157 s/^[^=]*=[       ]*$//
17158 }'
17159 fi
17160
17161 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
17162 fi # test -n "$CONFIG_FILES"
17163
17164 # Set up the scripts for CONFIG_HEADERS section.
17165 # No need to generate them if there are no CONFIG_HEADERS.
17166 # This happens for instance with `./config.status Makefile'.
17167 if test -n "$CONFIG_HEADERS"; then
17168 cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
17169 BEGIN {
17170 _ACEOF
17171
17172 # Transform confdefs.h into an awk script `defines.awk', embedded as
17173 # here-document in config.status, that substitutes the proper values into
17174 # config.h.in to produce config.h.
17175
17176 # Create a delimiter string that does not exist in confdefs.h, to ease
17177 # handling of long lines.
17178 ac_delim='%!_!# '
17179 for ac_last_try in false false :; do
17180   ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
17181   if test -z "$ac_tt"; then
17182     break
17183   elif $ac_last_try; then
17184     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
17185   else
17186     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
17187   fi
17188 done
17189
17190 # For the awk script, D is an array of macro values keyed by name,
17191 # likewise P contains macro parameters if any.  Preserve backslash
17192 # newline sequences.
17193
17194 ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
17195 sed -n '
17196 s/.\{148\}/&'"$ac_delim"'/g
17197 t rset
17198 :rset
17199 s/^[     ]*#[    ]*define[       ][      ]*/ /
17200 t def
17201 d
17202 :def
17203 s/\\$//
17204 t bsnl
17205 s/["\\]/\\&/g
17206 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
17207 D["\1"]=" \3"/p
17208 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2"/p
17209 d
17210 :bsnl
17211 s/["\\]/\\&/g
17212 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
17213 D["\1"]=" \3\\\\\\n"\\/p
17214 t cont
17215 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
17216 t cont
17217 d
17218 :cont
17219 n
17220 s/.\{148\}/&'"$ac_delim"'/g
17221 t clear
17222 :clear
17223 s/\\$//
17224 t bsnlc
17225 s/["\\]/\\&/g; s/^/"/; s/$/"/p
17226 d
17227 :bsnlc
17228 s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
17229 b cont
17230 ' <confdefs.h | sed '
17231 s/'"$ac_delim"'/"\\\
17232 "/g' >>$CONFIG_STATUS || ac_write_fail=1
17233
17234 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
17235   for (key in D) D_is_set[key] = 1
17236   FS = "\a"
17237 }
17238 /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
17239   line = \$ 0
17240   split(line, arg, " ")
17241   if (arg[1] == "#") {
17242     defundef = arg[2]
17243     mac1 = arg[3]
17244   } else {
17245     defundef = substr(arg[1], 2)
17246     mac1 = arg[2]
17247   }
17248   split(mac1, mac2, "(") #)
17249   macro = mac2[1]
17250   prefix = substr(line, 1, index(line, defundef) - 1)
17251   if (D_is_set[macro]) {
17252     # Preserve the white space surrounding the "#".
17253     print prefix "define", macro P[macro] D[macro]
17254     next
17255   } else {
17256     # Replace #undef with comments.  This is necessary, for example,
17257     # in the case of _POSIX_SOURCE, which is predefined and required
17258     # on some systems where configure will not decide to define it.
17259     if (defundef == "undef") {
17260       print "/*", prefix defundef, macro, "*/"
17261       next
17262     }
17263   }
17264 }
17265 { print }
17266 _ACAWK
17267 _ACEOF
17268 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
17269   as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
17270 fi # test -n "$CONFIG_HEADERS"
17271
17272
17273 eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS  :L $CONFIG_LINKS  :C $CONFIG_COMMANDS"
17274 shift
17275 for ac_tag
17276 do
17277   case $ac_tag in
17278   :[FHLC]) ac_mode=$ac_tag; continue;;
17279   esac
17280   case $ac_mode$ac_tag in
17281   :[FHL]*:*);;
17282   :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
17283   :[FH]-) ac_tag=-:-;;
17284   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
17285   esac
17286   ac_save_IFS=$IFS
17287   IFS=:
17288   set x $ac_tag
17289   IFS=$ac_save_IFS
17290   shift
17291   ac_file=$1
17292   shift
17293
17294   case $ac_mode in
17295   :L) ac_source=$1;;
17296   :[FH])
17297     ac_file_inputs=
17298     for ac_f
17299     do
17300       case $ac_f in
17301       -) ac_f="$ac_tmp/stdin";;
17302       *) # Look for the file first in the build tree, then in the source tree
17303          # (if the path is not absolute).  The absolute path cannot be DOS-style,
17304          # because $ac_f cannot contain `:'.
17305          test -f "$ac_f" ||
17306            case $ac_f in
17307            [\\/$]*) false;;
17308            *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
17309            esac ||
17310            as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
17311       esac
17312       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
17313       as_fn_append ac_file_inputs " '$ac_f'"
17314     done
17315
17316     # Let's still pretend it is `configure' which instantiates (i.e., don't
17317     # use $as_me), people would be surprised to read:
17318     #    /* config.h.  Generated by config.status.  */
17319     configure_input='Generated from '`
17320           $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
17321         `' by configure.'
17322     if test x"$ac_file" != x-; then
17323       configure_input="$ac_file.  $configure_input"
17324       { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
17325 $as_echo "$as_me: creating $ac_file" >&6;}
17326     fi
17327     # Neutralize special characters interpreted by sed in replacement strings.
17328     case $configure_input in #(
17329     *\&* | *\|* | *\\* )
17330        ac_sed_conf_input=`$as_echo "$configure_input" |
17331        sed 's/[\\\\&|]/\\\\&/g'`;; #(
17332     *) ac_sed_conf_input=$configure_input;;
17333     esac
17334
17335     case $ac_tag in
17336     *:-:* | *:-) cat >"$ac_tmp/stdin" \
17337       || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
17338     esac
17339     ;;
17340   esac
17341
17342   ac_dir=`$as_dirname -- "$ac_file" ||
17343 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17344          X"$ac_file" : 'X\(//\)[^/]' \| \
17345          X"$ac_file" : 'X\(//\)$' \| \
17346          X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
17347 $as_echo X"$ac_file" |
17348     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
17349             s//\1/
17350             q
17351           }
17352           /^X\(\/\/\)[^/].*/{
17353             s//\1/
17354             q
17355           }
17356           /^X\(\/\/\)$/{
17357             s//\1/
17358             q
17359           }
17360           /^X\(\/\).*/{
17361             s//\1/
17362             q
17363           }
17364           s/.*/./; q'`
17365   as_dir="$ac_dir"; as_fn_mkdir_p
17366   ac_builddir=.
17367
17368 case "$ac_dir" in
17369 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
17370 *)
17371   ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
17372   # A ".." for each directory in $ac_dir_suffix.
17373   ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
17374   case $ac_top_builddir_sub in
17375   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
17376   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
17377   esac ;;
17378 esac
17379 ac_abs_top_builddir=$ac_pwd
17380 ac_abs_builddir=$ac_pwd$ac_dir_suffix
17381 # for backward compatibility:
17382 ac_top_builddir=$ac_top_build_prefix
17383
17384 case $srcdir in
17385   .)  # We are building in place.
17386     ac_srcdir=.
17387     ac_top_srcdir=$ac_top_builddir_sub
17388     ac_abs_top_srcdir=$ac_pwd ;;
17389   [\\/]* | ?:[\\/]* )  # Absolute name.
17390     ac_srcdir=$srcdir$ac_dir_suffix;
17391     ac_top_srcdir=$srcdir
17392     ac_abs_top_srcdir=$srcdir ;;
17393   *) # Relative name.
17394     ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
17395     ac_top_srcdir=$ac_top_build_prefix$srcdir
17396     ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
17397 esac
17398 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
17399
17400
17401   case $ac_mode in
17402   :F)
17403   #
17404   # CONFIG_FILE
17405   #
17406
17407   case $INSTALL in
17408   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
17409   *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
17410   esac
17411   ac_MKDIR_P=$MKDIR_P
17412   case $MKDIR_P in
17413   [\\/$]* | ?:[\\/]* ) ;;
17414   */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
17415   esac
17416 _ACEOF
17417
17418 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
17419 # If the template does not know about datarootdir, expand it.
17420 # FIXME: This hack should be removed a few years after 2.60.
17421 ac_datarootdir_hack=; ac_datarootdir_seen=
17422 ac_sed_dataroot='
17423 /datarootdir/ {
17424   p
17425   q
17426 }
17427 /@datadir@/p
17428 /@docdir@/p
17429 /@infodir@/p
17430 /@localedir@/p
17431 /@mandir@/p'
17432 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
17433 *datarootdir*) ac_datarootdir_seen=yes;;
17434 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
17435   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
17436 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
17437 _ACEOF
17438 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
17439   ac_datarootdir_hack='
17440   s&@datadir@&$datadir&g
17441   s&@docdir@&$docdir&g
17442   s&@infodir@&$infodir&g
17443   s&@localedir@&$localedir&g
17444   s&@mandir@&$mandir&g
17445   s&\\\${datarootdir}&$datarootdir&g' ;;
17446 esac
17447 _ACEOF
17448
17449 # Neutralize VPATH when `$srcdir' = `.'.
17450 # Shell code in configure.ac might set extrasub.
17451 # FIXME: do we really want to maintain this feature?
17452 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
17453 ac_sed_extra="$ac_vpsub
17454 $extrasub
17455 _ACEOF
17456 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
17457 :t
17458 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17459 s|@configure_input@|$ac_sed_conf_input|;t t
17460 s&@top_builddir@&$ac_top_builddir_sub&;t t
17461 s&@top_build_prefix@&$ac_top_build_prefix&;t t
17462 s&@srcdir@&$ac_srcdir&;t t
17463 s&@abs_srcdir@&$ac_abs_srcdir&;t t
17464 s&@top_srcdir@&$ac_top_srcdir&;t t
17465 s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
17466 s&@builddir@&$ac_builddir&;t t
17467 s&@abs_builddir@&$ac_abs_builddir&;t t
17468 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
17469 s&@INSTALL@&$ac_INSTALL&;t t
17470 s&@MKDIR_P@&$ac_MKDIR_P&;t t
17471 $ac_datarootdir_hack
17472 "
17473 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
17474   >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
17475
17476 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
17477   { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
17478   { ac_out=`sed -n '/^[  ]*datarootdir[  ]*:*=/p' \
17479       "$ac_tmp/out"`; test -z "$ac_out"; } &&
17480   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
17481 which seems to be undefined.  Please make sure it is defined" >&5
17482 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
17483 which seems to be undefined.  Please make sure it is defined" >&2;}
17484
17485   rm -f "$ac_tmp/stdin"
17486   case $ac_file in
17487   -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
17488   *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
17489   esac \
17490   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
17491  ;;
17492   :H)
17493   #
17494   # CONFIG_HEADER
17495   #
17496   if test x"$ac_file" != x-; then
17497     {
17498       $as_echo "/* $configure_input  */" \
17499       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
17500     } >"$ac_tmp/config.h" \
17501       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
17502     if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
17503       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
17504 $as_echo "$as_me: $ac_file is unchanged" >&6;}
17505     else
17506       rm -f "$ac_file"
17507       mv "$ac_tmp/config.h" "$ac_file" \
17508         || as_fn_error $? "could not create $ac_file" "$LINENO" 5
17509     fi
17510   else
17511     $as_echo "/* $configure_input  */" \
17512       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
17513       || as_fn_error $? "could not create -" "$LINENO" 5
17514   fi
17515  ;;
17516   :L)
17517   #
17518   # CONFIG_LINK
17519   #
17520
17521   if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
17522     :
17523   else
17524     # Prefer the file from the source tree if names are identical.
17525     if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
17526       ac_source=$srcdir/$ac_source
17527     fi
17528
17529     { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
17530 $as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
17531
17532     if test ! -r "$ac_source"; then
17533       as_fn_error $? "$ac_source: file not found" "$LINENO" 5
17534     fi
17535     rm -f "$ac_file"
17536
17537     # Try a relative symlink, then a hard link, then a copy.
17538     case $ac_source in
17539     [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
17540         *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
17541     esac
17542     ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
17543       ln "$ac_source" "$ac_file" 2>/dev/null ||
17544       cp -p "$ac_source" "$ac_file" ||
17545       as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
17546   fi
17547  ;;
17548   :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
17549 $as_echo "$as_me: executing $ac_file commands" >&6;}
17550  ;;
17551   esac
17552
17553
17554   case $ac_file$ac_mode in
17555     "check_win32_symlinks":C)
17556 # Links sometimes fail undetected on Mingw -
17557 # so here we detect it and warn the user
17558 for FILE in $CONFIG_LINKS
17559  do
17560         # test -e works for symlinks in the MinGW console
17561         test -e `expr "$FILE" : '\([^:]*\)'` || { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** link for $FILE -- please fix by hand" >&5
17562 $as_echo "$as_me: WARNING: *** link for $FILE -- please fix by hand" >&2;}
17563  done
17564  ;;
17565     "src/include/pg_config.h":H)
17566 # Update timestamp for pg_config.h (see Makefile.global)
17567 echo >src/include/stamp-h
17568  ;;
17569     "src/include/pg_config_ext.h":H)
17570 # Update timestamp for pg_config_ext.h (see Makefile.global)
17571 echo >src/include/stamp-ext-h
17572  ;;
17573     "src/interfaces/ecpg/include/ecpg_config.h":H) echo >src/interfaces/ecpg/include/stamp-h ;;
17574
17575   esac
17576 done # for ac_tag
17577
17578
17579 as_fn_exit 0
17580 _ACEOF
17581 ac_clean_files=$ac_clean_files_save
17582
17583 test $ac_write_fail = 0 ||
17584   as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
17585
17586
17587 # configure is writing to config.log, and then calls config.status.
17588 # config.status does its own redirection, appending to config.log.
17589 # Unfortunately, on DOS this fails, as config.log is still kept open
17590 # by configure, so config.status won't be able to write to it; its
17591 # output is simply discarded.  So we exec the FD to /dev/null,
17592 # effectively closing config.log, so it can be properly (re)opened and
17593 # appended to by config.status.  When coming back to configure, we
17594 # need to make the FD available again.
17595 if test "$no_create" != yes; then
17596   ac_cs_success=:
17597   ac_config_status_args=
17598   test "$silent" = yes &&
17599     ac_config_status_args="$ac_config_status_args --quiet"
17600   exec 5>/dev/null
17601   $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
17602   exec 5>>config.log
17603   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17604   # would make configure fail if this is the last instruction.
17605   $ac_cs_success || as_fn_exit 1
17606 fi
17607 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
17608   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
17609 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
17610 fi
17611