]> granicus.if.org Git - postgresql/blob - configure
Use clock_gettime(), if available, in instr_time measurements.
[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-2016, 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                           disable 64-bit integer date/time support
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-2016, 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: enabled by default.
2988 #
2989 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with 64-bit integer date/time support" >&5
2990 $as_echo_n "checking whether to build with 64-bit integer date/time support... " >&6; }
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 $as_echo "#define USE_INTEGER_DATETIMES 1" >>confdefs.h
3000
3001       ;;
3002     no)
3003       :
3004       ;;
3005     *)
3006       as_fn_error $? "no argument expected for --enable-integer-datetimes option" "$LINENO" 5
3007       ;;
3008   esac
3009
3010 else
3011   enable_integer_datetimes=yes
3012
3013 $as_echo "#define USE_INTEGER_DATETIMES 1" >>confdefs.h
3014
3015 fi
3016
3017
3018 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_integer_datetimes" >&5
3019 $as_echo "$enable_integer_datetimes" >&6; }
3020
3021
3022 #
3023 # NLS
3024 #
3025 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is wanted" >&5
3026 $as_echo_n "checking whether NLS is wanted... " >&6; }
3027
3028
3029 # Check whether --enable-nls was given.
3030 if test "${enable_nls+set}" = set; then :
3031   enableval=$enable_nls;
3032   case $enableval in
3033     yes)
3034       :
3035       ;;
3036     no)
3037       :
3038       ;;
3039     *)
3040       enable_nls=yes
3041 WANTED_LANGUAGES=$enableval
3042       ;;
3043   esac
3044
3045 else
3046   enable_nls=no
3047 fi
3048
3049
3050
3051 if test "$enable_nls" = yes; then
3052
3053 $as_echo "#define ENABLE_NLS 1" >>confdefs.h
3054
3055 fi
3056
3057 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_nls" >&5
3058 $as_echo "$enable_nls" >&6; }
3059
3060
3061
3062 #
3063 # Default port number (--with-pgport), default 5432
3064 #
3065 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for default port number" >&5
3066 $as_echo_n "checking for default port number... " >&6; }
3067
3068
3069
3070 # Check whether --with-pgport was given.
3071 if test "${with_pgport+set}" = set; then :
3072   withval=$with_pgport;
3073   case $withval in
3074     yes)
3075       as_fn_error $? "argument required for --with-pgport option" "$LINENO" 5
3076       ;;
3077     no)
3078       as_fn_error $? "argument required for --with-pgport option" "$LINENO" 5
3079       ;;
3080     *)
3081       default_port=$withval
3082       ;;
3083   esac
3084
3085 else
3086   default_port=5432
3087 fi
3088
3089
3090 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $default_port" >&5
3091 $as_echo "$default_port" >&6; }
3092 # Need both of these because some places want an integer and some a string
3093
3094 cat >>confdefs.h <<_ACEOF
3095 #define DEF_PGPORT ${default_port}
3096 _ACEOF
3097
3098
3099 cat >>confdefs.h <<_ACEOF
3100 #define DEF_PGPORT_STR "${default_port}"
3101 _ACEOF
3102
3103
3104
3105 # It's worth validating port; you can get very confusing errors otherwise
3106 if test x"$default_port" = x""; then
3107   as_fn_error $? "invalid --with-pgport specification: empty string" "$LINENO" 5
3108 elif test ! x`echo "$default_port" | sed -e 's/[0-9]*//'` = x""; then
3109   as_fn_error $? "invalid --with-pgport specification: must be a number" "$LINENO" 5
3110 elif test ! x`echo "$default_port" | sed -e 's/^0.//'` = x"$default_port"; then
3111   as_fn_error $? "invalid --with-pgport specification: must not have leading 0" "$LINENO" 5
3112 elif test "$default_port" -lt "1" -o "$default_port" -gt "65535"; then
3113   as_fn_error $? "invalid --with-pgport specification: must be between 1 and 65535" "$LINENO" 5
3114 fi
3115
3116 #
3117 # '-rpath'-like feature can be disabled
3118 #
3119
3120
3121 # Check whether --enable-rpath was given.
3122 if test "${enable_rpath+set}" = set; then :
3123   enableval=$enable_rpath;
3124   case $enableval in
3125     yes)
3126       :
3127       ;;
3128     no)
3129       :
3130       ;;
3131     *)
3132       as_fn_error $? "no argument expected for --enable-rpath option" "$LINENO" 5
3133       ;;
3134   esac
3135
3136 else
3137   enable_rpath=yes
3138
3139 fi
3140
3141
3142
3143
3144 #
3145 # Spinlocks
3146 #
3147
3148
3149 # Check whether --enable-spinlocks was given.
3150 if test "${enable_spinlocks+set}" = set; then :
3151   enableval=$enable_spinlocks;
3152   case $enableval in
3153     yes)
3154       :
3155       ;;
3156     no)
3157       :
3158       ;;
3159     *)
3160       as_fn_error $? "no argument expected for --enable-spinlocks option" "$LINENO" 5
3161       ;;
3162   esac
3163
3164 else
3165   enable_spinlocks=yes
3166
3167 fi
3168
3169
3170
3171 #
3172 # Atomic operations
3173 #
3174
3175
3176 # Check whether --enable-atomics was given.
3177 if test "${enable_atomics+set}" = set; then :
3178   enableval=$enable_atomics;
3179   case $enableval in
3180     yes)
3181       :
3182       ;;
3183     no)
3184       :
3185       ;;
3186     *)
3187       as_fn_error $? "no argument expected for --enable-atomics option" "$LINENO" 5
3188       ;;
3189   esac
3190
3191 else
3192   enable_atomics=yes
3193
3194 fi
3195
3196
3197
3198 #
3199 # Random number generation
3200 #
3201
3202
3203 # Check whether --enable-strong-random was given.
3204 if test "${enable_strong_random+set}" = set; then :
3205   enableval=$enable_strong_random;
3206   case $enableval in
3207     yes)
3208       :
3209       ;;
3210     no)
3211       :
3212       ;;
3213     *)
3214       as_fn_error $? "no argument expected for --enable-strong-random option" "$LINENO" 5
3215       ;;
3216   esac
3217
3218 else
3219   enable_strong_random=yes
3220
3221 fi
3222
3223
3224
3225
3226 #
3227 # --enable-debug adds -g to compiler flags
3228 #
3229
3230
3231 # Check whether --enable-debug was given.
3232 if test "${enable_debug+set}" = set; then :
3233   enableval=$enable_debug;
3234   case $enableval in
3235     yes)
3236       :
3237       ;;
3238     no)
3239       :
3240       ;;
3241     *)
3242       as_fn_error $? "no argument expected for --enable-debug option" "$LINENO" 5
3243       ;;
3244   esac
3245
3246 else
3247   enable_debug=no
3248
3249 fi
3250
3251
3252
3253
3254 #
3255 # --enable-profiling enables gcc profiling
3256 #
3257
3258
3259 # Check whether --enable-profiling was given.
3260 if test "${enable_profiling+set}" = set; then :
3261   enableval=$enable_profiling;
3262   case $enableval in
3263     yes)
3264       :
3265       ;;
3266     no)
3267       :
3268       ;;
3269     *)
3270       as_fn_error $? "no argument expected for --enable-profiling option" "$LINENO" 5
3271       ;;
3272   esac
3273
3274 else
3275   enable_profiling=no
3276
3277 fi
3278
3279
3280
3281 #
3282 # --enable-coverage enables generation of code coverage metrics with gcov
3283 #
3284
3285
3286 # Check whether --enable-coverage was given.
3287 if test "${enable_coverage+set}" = set; then :
3288   enableval=$enable_coverage;
3289   case $enableval in
3290     yes)
3291       for ac_prog in gcov
3292 do
3293   # Extract the first word of "$ac_prog", so it can be a program name with args.
3294 set dummy $ac_prog; ac_word=$2
3295 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3296 $as_echo_n "checking for $ac_word... " >&6; }
3297 if ${ac_cv_prog_GCOV+:} false; then :
3298   $as_echo_n "(cached) " >&6
3299 else
3300   if test -n "$GCOV"; then
3301   ac_cv_prog_GCOV="$GCOV" # Let the user override the test.
3302 else
3303 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3304 for as_dir in $PATH
3305 do
3306   IFS=$as_save_IFS
3307   test -z "$as_dir" && as_dir=.
3308     for ac_exec_ext in '' $ac_executable_extensions; do
3309   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3310     ac_cv_prog_GCOV="$ac_prog"
3311     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3312     break 2
3313   fi
3314 done
3315   done
3316 IFS=$as_save_IFS
3317
3318 fi
3319 fi
3320 GCOV=$ac_cv_prog_GCOV
3321 if test -n "$GCOV"; then
3322   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5
3323 $as_echo "$GCOV" >&6; }
3324 else
3325   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3326 $as_echo "no" >&6; }
3327 fi
3328
3329
3330   test -n "$GCOV" && break
3331 done
3332
3333 if test -z "$GCOV"; then
3334   as_fn_error $? "gcov not found" "$LINENO" 5
3335 fi
3336 for ac_prog in lcov
3337 do
3338   # Extract the first word of "$ac_prog", so it can be a program name with args.
3339 set dummy $ac_prog; ac_word=$2
3340 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3341 $as_echo_n "checking for $ac_word... " >&6; }
3342 if ${ac_cv_prog_LCOV+:} false; then :
3343   $as_echo_n "(cached) " >&6
3344 else
3345   if test -n "$LCOV"; then
3346   ac_cv_prog_LCOV="$LCOV" # Let the user override the test.
3347 else
3348 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3349 for as_dir in $PATH
3350 do
3351   IFS=$as_save_IFS
3352   test -z "$as_dir" && as_dir=.
3353     for ac_exec_ext in '' $ac_executable_extensions; do
3354   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3355     ac_cv_prog_LCOV="$ac_prog"
3356     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3357     break 2
3358   fi
3359 done
3360   done
3361 IFS=$as_save_IFS
3362
3363 fi
3364 fi
3365 LCOV=$ac_cv_prog_LCOV
3366 if test -n "$LCOV"; then
3367   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5
3368 $as_echo "$LCOV" >&6; }
3369 else
3370   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3371 $as_echo "no" >&6; }
3372 fi
3373
3374
3375   test -n "$LCOV" && break
3376 done
3377
3378 if test -z "$LCOV"; then
3379   as_fn_error $? "lcov not found" "$LINENO" 5
3380 fi
3381 for ac_prog in genhtml
3382 do
3383   # Extract the first word of "$ac_prog", so it can be a program name with args.
3384 set dummy $ac_prog; ac_word=$2
3385 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3386 $as_echo_n "checking for $ac_word... " >&6; }
3387 if ${ac_cv_prog_GENHTML+:} false; then :
3388   $as_echo_n "(cached) " >&6
3389 else
3390   if test -n "$GENHTML"; then
3391   ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test.
3392 else
3393 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3394 for as_dir in $PATH
3395 do
3396   IFS=$as_save_IFS
3397   test -z "$as_dir" && as_dir=.
3398     for ac_exec_ext in '' $ac_executable_extensions; do
3399   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3400     ac_cv_prog_GENHTML="$ac_prog"
3401     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3402     break 2
3403   fi
3404 done
3405   done
3406 IFS=$as_save_IFS
3407
3408 fi
3409 fi
3410 GENHTML=$ac_cv_prog_GENHTML
3411 if test -n "$GENHTML"; then
3412   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5
3413 $as_echo "$GENHTML" >&6; }
3414 else
3415   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3416 $as_echo "no" >&6; }
3417 fi
3418
3419
3420   test -n "$GENHTML" && break
3421 done
3422
3423 if test -z "$GENHTML"; then
3424   as_fn_error $? "genhtml not found" "$LINENO" 5
3425 fi
3426       ;;
3427     no)
3428       :
3429       ;;
3430     *)
3431       as_fn_error $? "no argument expected for --enable-coverage option" "$LINENO" 5
3432       ;;
3433   esac
3434
3435 else
3436   enable_coverage=no
3437
3438 fi
3439
3440
3441
3442
3443 #
3444 # DTrace
3445 #
3446
3447
3448 # Check whether --enable-dtrace was given.
3449 if test "${enable_dtrace+set}" = set; then :
3450   enableval=$enable_dtrace;
3451   case $enableval in
3452     yes)
3453       for ac_prog in dtrace
3454 do
3455   # Extract the first word of "$ac_prog", so it can be a program name with args.
3456 set dummy $ac_prog; ac_word=$2
3457 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3458 $as_echo_n "checking for $ac_word... " >&6; }
3459 if ${ac_cv_prog_DTRACE+:} false; then :
3460   $as_echo_n "(cached) " >&6
3461 else
3462   if test -n "$DTRACE"; then
3463   ac_cv_prog_DTRACE="$DTRACE" # Let the user override the test.
3464 else
3465 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3466 for as_dir in $PATH
3467 do
3468   IFS=$as_save_IFS
3469   test -z "$as_dir" && as_dir=.
3470     for ac_exec_ext in '' $ac_executable_extensions; do
3471   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3472     ac_cv_prog_DTRACE="$ac_prog"
3473     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3474     break 2
3475   fi
3476 done
3477   done
3478 IFS=$as_save_IFS
3479
3480 fi
3481 fi
3482 DTRACE=$ac_cv_prog_DTRACE
3483 if test -n "$DTRACE"; then
3484   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5
3485 $as_echo "$DTRACE" >&6; }
3486 else
3487   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3488 $as_echo "no" >&6; }
3489 fi
3490
3491
3492   test -n "$DTRACE" && break
3493 done
3494
3495 if test -z "$DTRACE"; then
3496   as_fn_error $? "dtrace not found" "$LINENO" 5
3497 fi
3498
3499       ;;
3500     no)
3501       :
3502       ;;
3503     *)
3504       as_fn_error $? "no argument expected for --enable-dtrace option" "$LINENO" 5
3505       ;;
3506   esac
3507
3508 else
3509   enable_dtrace=no
3510
3511 fi
3512
3513
3514
3515
3516 #
3517 # TAP tests
3518 #
3519
3520
3521 # Check whether --enable-tap-tests was given.
3522 if test "${enable_tap_tests+set}" = set; then :
3523   enableval=$enable_tap_tests;
3524   case $enableval in
3525     yes)
3526       :
3527       ;;
3528     no)
3529       :
3530       ;;
3531     *)
3532       as_fn_error $? "no argument expected for --enable-tap-tests option" "$LINENO" 5
3533       ;;
3534   esac
3535
3536 else
3537   enable_tap_tests=no
3538
3539 fi
3540
3541
3542
3543
3544 #
3545 # Block size
3546 #
3547 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for block size" >&5
3548 $as_echo_n "checking for block size... " >&6; }
3549
3550
3551
3552 # Check whether --with-blocksize was given.
3553 if test "${with_blocksize+set}" = set; then :
3554   withval=$with_blocksize;
3555   case $withval in
3556     yes)
3557       as_fn_error $? "argument required for --with-blocksize option" "$LINENO" 5
3558       ;;
3559     no)
3560       as_fn_error $? "argument required for --with-blocksize option" "$LINENO" 5
3561       ;;
3562     *)
3563       blocksize=$withval
3564       ;;
3565   esac
3566
3567 else
3568   blocksize=8
3569 fi
3570
3571
3572 case ${blocksize} in
3573   1) BLCKSZ=1024;;
3574   2) BLCKSZ=2048;;
3575   4) BLCKSZ=4096;;
3576   8) BLCKSZ=8192;;
3577  16) BLCKSZ=16384;;
3578  32) BLCKSZ=32768;;
3579   *) as_fn_error $? "Invalid block size. Allowed values are 1,2,4,8,16,32." "$LINENO" 5
3580 esac
3581 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${blocksize}kB" >&5
3582 $as_echo "${blocksize}kB" >&6; }
3583
3584
3585 cat >>confdefs.h <<_ACEOF
3586 #define BLCKSZ ${BLCKSZ}
3587 _ACEOF
3588
3589
3590 #
3591 # Relation segment size
3592 #
3593 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for segment size" >&5
3594 $as_echo_n "checking for segment size... " >&6; }
3595
3596
3597
3598 # Check whether --with-segsize was given.
3599 if test "${with_segsize+set}" = set; then :
3600   withval=$with_segsize;
3601   case $withval in
3602     yes)
3603       as_fn_error $? "argument required for --with-segsize option" "$LINENO" 5
3604       ;;
3605     no)
3606       as_fn_error $? "argument required for --with-segsize option" "$LINENO" 5
3607       ;;
3608     *)
3609       segsize=$withval
3610       ;;
3611   esac
3612
3613 else
3614   segsize=1
3615 fi
3616
3617
3618 # this expression is set up to avoid unnecessary integer overflow
3619 # blocksize is already guaranteed to be a factor of 1024
3620 RELSEG_SIZE=`expr '(' 1024 / ${blocksize} ')' '*' ${segsize} '*' 1024`
3621 test $? -eq 0 || exit 1
3622 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${segsize}GB" >&5
3623 $as_echo "${segsize}GB" >&6; }
3624
3625
3626 cat >>confdefs.h <<_ACEOF
3627 #define RELSEG_SIZE ${RELSEG_SIZE}
3628 _ACEOF
3629
3630
3631 #
3632 # WAL block size
3633 #
3634 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAL block size" >&5
3635 $as_echo_n "checking for WAL block size... " >&6; }
3636
3637
3638
3639 # Check whether --with-wal-blocksize was given.
3640 if test "${with_wal_blocksize+set}" = set; then :
3641   withval=$with_wal_blocksize;
3642   case $withval in
3643     yes)
3644       as_fn_error $? "argument required for --with-wal-blocksize option" "$LINENO" 5
3645       ;;
3646     no)
3647       as_fn_error $? "argument required for --with-wal-blocksize option" "$LINENO" 5
3648       ;;
3649     *)
3650       wal_blocksize=$withval
3651       ;;
3652   esac
3653
3654 else
3655   wal_blocksize=8
3656 fi
3657
3658
3659 case ${wal_blocksize} in
3660   1) XLOG_BLCKSZ=1024;;
3661   2) XLOG_BLCKSZ=2048;;
3662   4) XLOG_BLCKSZ=4096;;
3663   8) XLOG_BLCKSZ=8192;;
3664  16) XLOG_BLCKSZ=16384;;
3665  32) XLOG_BLCKSZ=32768;;
3666  64) XLOG_BLCKSZ=65536;;
3667   *) as_fn_error $? "Invalid WAL block size. Allowed values are 1,2,4,8,16,32,64." "$LINENO" 5
3668 esac
3669 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${wal_blocksize}kB" >&5
3670 $as_echo "${wal_blocksize}kB" >&6; }
3671
3672
3673 cat >>confdefs.h <<_ACEOF
3674 #define XLOG_BLCKSZ ${XLOG_BLCKSZ}
3675 _ACEOF
3676
3677
3678 #
3679 # WAL segment size
3680 #
3681 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAL segment size" >&5
3682 $as_echo_n "checking for WAL segment size... " >&6; }
3683
3684
3685
3686 # Check whether --with-wal-segsize was given.
3687 if test "${with_wal_segsize+set}" = set; then :
3688   withval=$with_wal_segsize;
3689   case $withval in
3690     yes)
3691       as_fn_error $? "argument required for --with-wal-segsize option" "$LINENO" 5
3692       ;;
3693     no)
3694       as_fn_error $? "argument required for --with-wal-segsize option" "$LINENO" 5
3695       ;;
3696     *)
3697       wal_segsize=$withval
3698       ;;
3699   esac
3700
3701 else
3702   wal_segsize=16
3703 fi
3704
3705
3706 case ${wal_segsize} in
3707   1) ;;
3708   2) ;;
3709   4) ;;
3710   8) ;;
3711  16) ;;
3712  32) ;;
3713  64) ;;
3714   *) as_fn_error $? "Invalid WAL segment size. Allowed values are 1,2,4,8,16,32,64." "$LINENO" 5
3715 esac
3716 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${wal_segsize}MB" >&5
3717 $as_echo "${wal_segsize}MB" >&6; }
3718
3719
3720 cat >>confdefs.h <<_ACEOF
3721 #define XLOG_SEG_SIZE (${wal_segsize} * 1024 * 1024)
3722 _ACEOF
3723
3724
3725 #
3726 # C compiler
3727 #
3728
3729 # For historical reasons you can also use --with-CC to specify the C compiler
3730 # to use, although the standard way to do this is to set the CC environment
3731 # variable.
3732
3733
3734
3735 # Check whether --with-CC was given.
3736 if test "${with_CC+set}" = set; then :
3737   withval=$with_CC;
3738   case $withval in
3739     yes)
3740       as_fn_error $? "argument required for --with-CC option" "$LINENO" 5
3741       ;;
3742     no)
3743       as_fn_error $? "argument required for --with-CC option" "$LINENO" 5
3744       ;;
3745     *)
3746       CC=$with_CC
3747       ;;
3748   esac
3749
3750 fi
3751
3752
3753
3754 case $template in
3755   aix) pgac_cc_list="gcc xlc";;
3756     *) pgac_cc_list="gcc cc";;
3757 esac
3758
3759 ac_ext=c
3760 ac_cpp='$CPP $CPPFLAGS'
3761 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3762 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3763 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3764 if test -n "$ac_tool_prefix"; then
3765   for ac_prog in $pgac_cc_list
3766   do
3767     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3768 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3769 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3770 $as_echo_n "checking for $ac_word... " >&6; }
3771 if ${ac_cv_prog_CC+:} false; then :
3772   $as_echo_n "(cached) " >&6
3773 else
3774   if test -n "$CC"; then
3775   ac_cv_prog_CC="$CC" # Let the user override the test.
3776 else
3777 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3778 for as_dir in $PATH
3779 do
3780   IFS=$as_save_IFS
3781   test -z "$as_dir" && as_dir=.
3782     for ac_exec_ext in '' $ac_executable_extensions; do
3783   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3784     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3785     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3786     break 2
3787   fi
3788 done
3789   done
3790 IFS=$as_save_IFS
3791
3792 fi
3793 fi
3794 CC=$ac_cv_prog_CC
3795 if test -n "$CC"; then
3796   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3797 $as_echo "$CC" >&6; }
3798 else
3799   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3800 $as_echo "no" >&6; }
3801 fi
3802
3803
3804     test -n "$CC" && break
3805   done
3806 fi
3807 if test -z "$CC"; then
3808   ac_ct_CC=$CC
3809   for ac_prog in $pgac_cc_list
3810 do
3811   # Extract the first word of "$ac_prog", so it can be a program name with args.
3812 set dummy $ac_prog; ac_word=$2
3813 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3814 $as_echo_n "checking for $ac_word... " >&6; }
3815 if ${ac_cv_prog_ac_ct_CC+:} false; then :
3816   $as_echo_n "(cached) " >&6
3817 else
3818   if test -n "$ac_ct_CC"; then
3819   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3820 else
3821 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3822 for as_dir in $PATH
3823 do
3824   IFS=$as_save_IFS
3825   test -z "$as_dir" && as_dir=.
3826     for ac_exec_ext in '' $ac_executable_extensions; do
3827   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3828     ac_cv_prog_ac_ct_CC="$ac_prog"
3829     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3830     break 2
3831   fi
3832 done
3833   done
3834 IFS=$as_save_IFS
3835
3836 fi
3837 fi
3838 ac_ct_CC=$ac_cv_prog_ac_ct_CC
3839 if test -n "$ac_ct_CC"; then
3840   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3841 $as_echo "$ac_ct_CC" >&6; }
3842 else
3843   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3844 $as_echo "no" >&6; }
3845 fi
3846
3847
3848   test -n "$ac_ct_CC" && break
3849 done
3850
3851   if test "x$ac_ct_CC" = x; then
3852     CC=""
3853   else
3854     case $cross_compiling:$ac_tool_warned in
3855 yes:)
3856 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3857 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3858 ac_tool_warned=yes ;;
3859 esac
3860     CC=$ac_ct_CC
3861   fi
3862 fi
3863
3864
3865 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3866 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3867 as_fn_error $? "no acceptable C compiler found in \$PATH
3868 See \`config.log' for more details" "$LINENO" 5; }
3869
3870 # Provide some information about the compiler.
3871 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
3872 set X $ac_compile
3873 ac_compiler=$2
3874 for ac_option in --version -v -V -qversion; do
3875   { { ac_try="$ac_compiler $ac_option >&5"
3876 case "(($ac_try" in
3877   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3878   *) ac_try_echo=$ac_try;;
3879 esac
3880 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3881 $as_echo "$ac_try_echo"; } >&5
3882   (eval "$ac_compiler $ac_option >&5") 2>conftest.err
3883   ac_status=$?
3884   if test -s conftest.err; then
3885     sed '10a\
3886 ... rest of stderr output deleted ...
3887          10q' conftest.err >conftest.er1
3888     cat conftest.er1 >&5
3889   fi
3890   rm -f conftest.er1 conftest.err
3891   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3892   test $ac_status = 0; }
3893 done
3894
3895 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3896 /* end confdefs.h.  */
3897
3898 int
3899 main ()
3900 {
3901
3902   ;
3903   return 0;
3904 }
3905 _ACEOF
3906 ac_clean_files_save=$ac_clean_files
3907 ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
3908 # Try to create an executable without -o first, disregard a.out.
3909 # It will help us diagnose broken compilers, and finding out an intuition
3910 # of exeext.
3911 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
3912 $as_echo_n "checking whether the C compiler works... " >&6; }
3913 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
3914
3915 # The possible output files:
3916 ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
3917
3918 ac_rmfiles=
3919 for ac_file in $ac_files
3920 do
3921   case $ac_file in
3922     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3923     * ) ac_rmfiles="$ac_rmfiles $ac_file";;
3924   esac
3925 done
3926 rm -f $ac_rmfiles
3927
3928 if { { ac_try="$ac_link_default"
3929 case "(($ac_try" in
3930   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3931   *) ac_try_echo=$ac_try;;
3932 esac
3933 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3934 $as_echo "$ac_try_echo"; } >&5
3935   (eval "$ac_link_default") 2>&5
3936   ac_status=$?
3937   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3938   test $ac_status = 0; }; then :
3939   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
3940 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
3941 # in a Makefile.  We should not override ac_cv_exeext if it was cached,
3942 # so that the user can short-circuit this test for compilers unknown to
3943 # Autoconf.
3944 for ac_file in $ac_files ''
3945 do
3946   test -f "$ac_file" || continue
3947   case $ac_file in
3948     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
3949         ;;
3950     [ab].out )
3951         # We found the default executable, but exeext='' is most
3952         # certainly right.
3953         break;;
3954     *.* )
3955         if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
3956         then :; else
3957            ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3958         fi
3959         # We set ac_cv_exeext here because the later test for it is not
3960         # safe: cross compilers may not add the suffix if given an `-o'
3961         # argument, so we may need to know it at that point already.
3962         # Even if this section looks crufty: it has the advantage of
3963         # actually working.
3964         break;;
3965     * )
3966         break;;
3967   esac
3968 done
3969 test "$ac_cv_exeext" = no && ac_cv_exeext=
3970
3971 else
3972   ac_file=''
3973 fi
3974 if test -z "$ac_file"; then :
3975   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3976 $as_echo "no" >&6; }
3977 $as_echo "$as_me: failed program was:" >&5
3978 sed 's/^/| /' conftest.$ac_ext >&5
3979
3980 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3981 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3982 as_fn_error 77 "C compiler cannot create executables
3983 See \`config.log' for more details" "$LINENO" 5; }
3984 else
3985   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3986 $as_echo "yes" >&6; }
3987 fi
3988 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
3989 $as_echo_n "checking for C compiler default output file name... " >&6; }
3990 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
3991 $as_echo "$ac_file" >&6; }
3992 ac_exeext=$ac_cv_exeext
3993
3994 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
3995 ac_clean_files=$ac_clean_files_save
3996 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
3997 $as_echo_n "checking for suffix of executables... " >&6; }
3998 if { { ac_try="$ac_link"
3999 case "(($ac_try" in
4000   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4001   *) ac_try_echo=$ac_try;;
4002 esac
4003 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4004 $as_echo "$ac_try_echo"; } >&5
4005   (eval "$ac_link") 2>&5
4006   ac_status=$?
4007   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4008   test $ac_status = 0; }; then :
4009   # If both `conftest.exe' and `conftest' are `present' (well, observable)
4010 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
4011 # work properly (i.e., refer to `conftest.exe'), while it won't with
4012 # `rm'.
4013 for ac_file in conftest.exe conftest conftest.*; do
4014   test -f "$ac_file" || continue
4015   case $ac_file in
4016     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4017     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4018           break;;
4019     * ) break;;
4020   esac
4021 done
4022 else
4023   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4024 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4025 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
4026 See \`config.log' for more details" "$LINENO" 5; }
4027 fi
4028 rm -f conftest conftest$ac_cv_exeext
4029 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
4030 $as_echo "$ac_cv_exeext" >&6; }
4031
4032 rm -f conftest.$ac_ext
4033 EXEEXT=$ac_cv_exeext
4034 ac_exeext=$EXEEXT
4035 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4036 /* end confdefs.h.  */
4037 #include <stdio.h>
4038 int
4039 main ()
4040 {
4041 FILE *f = fopen ("conftest.out", "w");
4042  return ferror (f) || fclose (f) != 0;
4043
4044   ;
4045   return 0;
4046 }
4047 _ACEOF
4048 ac_clean_files="$ac_clean_files conftest.out"
4049 # Check that the compiler produces executables we can run.  If not, either
4050 # the compiler is broken, or we cross compile.
4051 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
4052 $as_echo_n "checking whether we are cross compiling... " >&6; }
4053 if test "$cross_compiling" != yes; then
4054   { { ac_try="$ac_link"
4055 case "(($ac_try" in
4056   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4057   *) ac_try_echo=$ac_try;;
4058 esac
4059 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4060 $as_echo "$ac_try_echo"; } >&5
4061   (eval "$ac_link") 2>&5
4062   ac_status=$?
4063   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4064   test $ac_status = 0; }
4065   if { ac_try='./conftest$ac_cv_exeext'
4066   { { case "(($ac_try" in
4067   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4068   *) ac_try_echo=$ac_try;;
4069 esac
4070 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4071 $as_echo "$ac_try_echo"; } >&5
4072   (eval "$ac_try") 2>&5
4073   ac_status=$?
4074   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4075   test $ac_status = 0; }; }; then
4076     cross_compiling=no
4077   else
4078     if test "$cross_compiling" = maybe; then
4079         cross_compiling=yes
4080     else
4081         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4082 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4083 as_fn_error $? "cannot run C compiled programs.
4084 If you meant to cross compile, use \`--host'.
4085 See \`config.log' for more details" "$LINENO" 5; }
4086     fi
4087   fi
4088 fi
4089 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
4090 $as_echo "$cross_compiling" >&6; }
4091
4092 rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
4093 ac_clean_files=$ac_clean_files_save
4094 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
4095 $as_echo_n "checking for suffix of object files... " >&6; }
4096 if ${ac_cv_objext+:} false; then :
4097   $as_echo_n "(cached) " >&6
4098 else
4099   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4100 /* end confdefs.h.  */
4101
4102 int
4103 main ()
4104 {
4105
4106   ;
4107   return 0;
4108 }
4109 _ACEOF
4110 rm -f conftest.o conftest.obj
4111 if { { ac_try="$ac_compile"
4112 case "(($ac_try" in
4113   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4114   *) ac_try_echo=$ac_try;;
4115 esac
4116 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4117 $as_echo "$ac_try_echo"; } >&5
4118   (eval "$ac_compile") 2>&5
4119   ac_status=$?
4120   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4121   test $ac_status = 0; }; then :
4122   for ac_file in conftest.o conftest.obj conftest.*; do
4123   test -f "$ac_file" || continue;
4124   case $ac_file in
4125     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
4126     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
4127        break;;
4128   esac
4129 done
4130 else
4131   $as_echo "$as_me: failed program was:" >&5
4132 sed 's/^/| /' conftest.$ac_ext >&5
4133
4134 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4135 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4136 as_fn_error $? "cannot compute suffix of object files: cannot compile
4137 See \`config.log' for more details" "$LINENO" 5; }
4138 fi
4139 rm -f conftest.$ac_cv_objext conftest.$ac_ext
4140 fi
4141 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
4142 $as_echo "$ac_cv_objext" >&6; }
4143 OBJEXT=$ac_cv_objext
4144 ac_objext=$OBJEXT
4145 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
4146 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
4147 if ${ac_cv_c_compiler_gnu+:} false; then :
4148   $as_echo_n "(cached) " >&6
4149 else
4150   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4151 /* end confdefs.h.  */
4152
4153 int
4154 main ()
4155 {
4156 #ifndef __GNUC__
4157        choke me
4158 #endif
4159
4160   ;
4161   return 0;
4162 }
4163 _ACEOF
4164 if ac_fn_c_try_compile "$LINENO"; then :
4165   ac_compiler_gnu=yes
4166 else
4167   ac_compiler_gnu=no
4168 fi
4169 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4170 ac_cv_c_compiler_gnu=$ac_compiler_gnu
4171
4172 fi
4173 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4174 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
4175 if test $ac_compiler_gnu = yes; then
4176   GCC=yes
4177 else
4178   GCC=
4179 fi
4180 ac_test_CFLAGS=${CFLAGS+set}
4181 ac_save_CFLAGS=$CFLAGS
4182 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4183 $as_echo_n "checking whether $CC accepts -g... " >&6; }
4184 if ${ac_cv_prog_cc_g+:} false; then :
4185   $as_echo_n "(cached) " >&6
4186 else
4187   ac_save_c_werror_flag=$ac_c_werror_flag
4188    ac_c_werror_flag=yes
4189    ac_cv_prog_cc_g=no
4190    CFLAGS="-g"
4191    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4192 /* end confdefs.h.  */
4193
4194 int
4195 main ()
4196 {
4197
4198   ;
4199   return 0;
4200 }
4201 _ACEOF
4202 if ac_fn_c_try_compile "$LINENO"; then :
4203   ac_cv_prog_cc_g=yes
4204 else
4205   CFLAGS=""
4206       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4207 /* end confdefs.h.  */
4208
4209 int
4210 main ()
4211 {
4212
4213   ;
4214   return 0;
4215 }
4216 _ACEOF
4217 if ac_fn_c_try_compile "$LINENO"; then :
4218
4219 else
4220   ac_c_werror_flag=$ac_save_c_werror_flag
4221          CFLAGS="-g"
4222          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4223 /* end confdefs.h.  */
4224
4225 int
4226 main ()
4227 {
4228
4229   ;
4230   return 0;
4231 }
4232 _ACEOF
4233 if ac_fn_c_try_compile "$LINENO"; then :
4234   ac_cv_prog_cc_g=yes
4235 fi
4236 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4237 fi
4238 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4239 fi
4240 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4241    ac_c_werror_flag=$ac_save_c_werror_flag
4242 fi
4243 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4244 $as_echo "$ac_cv_prog_cc_g" >&6; }
4245 if test "$ac_test_CFLAGS" = set; then
4246   CFLAGS=$ac_save_CFLAGS
4247 elif test $ac_cv_prog_cc_g = yes; then
4248   if test "$GCC" = yes; then
4249     CFLAGS="-g -O2"
4250   else
4251     CFLAGS="-g"
4252   fi
4253 else
4254   if test "$GCC" = yes; then
4255     CFLAGS="-O2"
4256   else
4257     CFLAGS=
4258   fi
4259 fi
4260 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
4261 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
4262 if ${ac_cv_prog_cc_c89+:} false; then :
4263   $as_echo_n "(cached) " >&6
4264 else
4265   ac_cv_prog_cc_c89=no
4266 ac_save_CC=$CC
4267 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4268 /* end confdefs.h.  */
4269 #include <stdarg.h>
4270 #include <stdio.h>
4271 struct stat;
4272 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4273 struct buf { int x; };
4274 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4275 static char *e (p, i)
4276      char **p;
4277      int i;
4278 {
4279   return p[i];
4280 }
4281 static char *f (char * (*g) (char **, int), char **p, ...)
4282 {
4283   char *s;
4284   va_list v;
4285   va_start (v,p);
4286   s = g (p, va_arg (v,int));
4287   va_end (v);
4288   return s;
4289 }
4290
4291 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
4292    function prototypes and stuff, but not '\xHH' hex character constants.
4293    These don't provoke an error unfortunately, instead are silently treated
4294    as 'x'.  The following induces an error, until -std is added to get
4295    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
4296    array size at least.  It's necessary to write '\x00'==0 to get something
4297    that's true only with -std.  */
4298 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
4299
4300 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
4301    inside strings and character constants.  */
4302 #define FOO(x) 'x'
4303 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
4304
4305 int test (int i, double x);
4306 struct s1 {int (*f) (int a);};
4307 struct s2 {int (*f) (double a);};
4308 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4309 int argc;
4310 char **argv;
4311 int
4312 main ()
4313 {
4314 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4315   ;
4316   return 0;
4317 }
4318 _ACEOF
4319 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
4320         -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4321 do
4322   CC="$ac_save_CC $ac_arg"
4323   if ac_fn_c_try_compile "$LINENO"; then :
4324   ac_cv_prog_cc_c89=$ac_arg
4325 fi
4326 rm -f core conftest.err conftest.$ac_objext
4327   test "x$ac_cv_prog_cc_c89" != "xno" && break
4328 done
4329 rm -f conftest.$ac_ext
4330 CC=$ac_save_CC
4331
4332 fi
4333 # AC_CACHE_VAL
4334 case "x$ac_cv_prog_cc_c89" in
4335   x)
4336     { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4337 $as_echo "none needed" >&6; } ;;
4338   xno)
4339     { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4340 $as_echo "unsupported" >&6; } ;;
4341   *)
4342     CC="$CC $ac_cv_prog_cc_c89"
4343     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
4344 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
4345 esac
4346 if test "x$ac_cv_prog_cc_c89" != xno; then :
4347
4348 fi
4349
4350 ac_ext=c
4351 ac_cpp='$CPP $CPPFLAGS'
4352 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4353 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4354 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4355
4356
4357 # Check if it's Intel's compiler, which (usually) pretends to be gcc,
4358 # but has idiosyncrasies of its own.  We assume icc will define
4359 # __INTEL_COMPILER regardless of CFLAGS.
4360
4361 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4362 /* end confdefs.h.  */
4363
4364 int
4365 main ()
4366 {
4367 #ifndef __INTEL_COMPILER
4368 choke me
4369 #endif
4370   ;
4371   return 0;
4372 }
4373 _ACEOF
4374 if ac_fn_c_try_compile "$LINENO"; then :
4375   ICC=yes
4376 else
4377   ICC=no
4378 fi
4379 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4380
4381 # Check if it's Sun Studio compiler. We assume that
4382 # __SUNPRO_C will be defined for Sun Studio compilers
4383 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4384 /* end confdefs.h.  */
4385
4386 int
4387 main ()
4388 {
4389 #ifndef __SUNPRO_C
4390 choke me
4391 #endif
4392   ;
4393   return 0;
4394 }
4395 _ACEOF
4396 if ac_fn_c_try_compile "$LINENO"; then :
4397   SUN_STUDIO_CC=yes
4398 else
4399   SUN_STUDIO_CC=no
4400 fi
4401 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4402
4403
4404
4405 unset CFLAGS
4406
4407 #
4408 # Read the template
4409 #
4410 . "$srcdir/src/template/$template" || exit
4411
4412 # CFLAGS are selected so:
4413 # If the user specifies something in the environment, that is used.
4414 # else:  If the template file set something, that is used.
4415 # else:  If coverage was enabled, don't set anything.
4416 # else:  If the compiler is GCC, then we use -O2.
4417 # else:  If the compiler is something else, then we use -O, unless debugging.
4418
4419 if test "$ac_env_CFLAGS_set" = set; then
4420   CFLAGS=$ac_env_CFLAGS_value
4421 elif test "${CFLAGS+set}" = set; then
4422   : # (keep what template set)
4423 elif test "$enable_coverage" = yes; then
4424   : # no optimization by default
4425 elif test "$GCC" = yes; then
4426   CFLAGS="-O2"
4427 else
4428   # if the user selected debug mode, don't use -O
4429   if test "$enable_debug" != yes; then
4430     CFLAGS="-O"
4431   fi
4432 fi
4433
4434 # CFLAGS we determined above will be added back at the end
4435 user_CFLAGS=$CFLAGS
4436 CFLAGS=""
4437
4438 # set CFLAGS_VECTOR from the environment, if available
4439 if test "$ac_env_CFLAGS_VECTOR_set" = set; then
4440   CFLAGS_VECTOR=$ac_env_CFLAGS_VECTOR_value
4441 fi
4442
4443 # Some versions of GCC support some additional useful warning flags.
4444 # Check whether they are supported, and add them to CFLAGS if so.
4445 # ICC pretends to be GCC but it's lying; it doesn't support these flags,
4446 # but has its own.  Also check other compiler-specific flags here.
4447
4448 if test "$GCC" = yes -a "$ICC" = no; then
4449   CFLAGS="-Wall -Wmissing-prototypes -Wpointer-arith"
4450   # These work in some but not all gcc versions
4451   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wdeclaration-after-statement" >&5
4452 $as_echo_n "checking whether $CC supports -Wdeclaration-after-statement... " >&6; }
4453 if ${pgac_cv_prog_cc_cflags__Wdeclaration_after_statement+:} false; then :
4454   $as_echo_n "(cached) " >&6
4455 else
4456   pgac_save_CFLAGS=$CFLAGS
4457 CFLAGS="$pgac_save_CFLAGS -Wdeclaration-after-statement"
4458 ac_save_c_werror_flag=$ac_c_werror_flag
4459 ac_c_werror_flag=yes
4460 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4461 /* end confdefs.h.  */
4462
4463 int
4464 main ()
4465 {
4466
4467   ;
4468   return 0;
4469 }
4470 _ACEOF
4471 if ac_fn_c_try_compile "$LINENO"; then :
4472   pgac_cv_prog_cc_cflags__Wdeclaration_after_statement=yes
4473 else
4474   pgac_cv_prog_cc_cflags__Wdeclaration_after_statement=no
4475 fi
4476 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4477 ac_c_werror_flag=$ac_save_c_werror_flag
4478 CFLAGS="$pgac_save_CFLAGS"
4479 fi
4480 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" >&5
4481 $as_echo "$pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" >&6; }
4482 if test x"$pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" = x"yes"; then
4483   CFLAGS="$CFLAGS -Wdeclaration-after-statement"
4484 fi
4485
4486   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wendif-labels" >&5
4487 $as_echo_n "checking whether $CC supports -Wendif-labels... " >&6; }
4488 if ${pgac_cv_prog_cc_cflags__Wendif_labels+:} false; then :
4489   $as_echo_n "(cached) " >&6
4490 else
4491   pgac_save_CFLAGS=$CFLAGS
4492 CFLAGS="$pgac_save_CFLAGS -Wendif-labels"
4493 ac_save_c_werror_flag=$ac_c_werror_flag
4494 ac_c_werror_flag=yes
4495 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4496 /* end confdefs.h.  */
4497
4498 int
4499 main ()
4500 {
4501
4502   ;
4503   return 0;
4504 }
4505 _ACEOF
4506 if ac_fn_c_try_compile "$LINENO"; then :
4507   pgac_cv_prog_cc_cflags__Wendif_labels=yes
4508 else
4509   pgac_cv_prog_cc_cflags__Wendif_labels=no
4510 fi
4511 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4512 ac_c_werror_flag=$ac_save_c_werror_flag
4513 CFLAGS="$pgac_save_CFLAGS"
4514 fi
4515 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wendif_labels" >&5
4516 $as_echo "$pgac_cv_prog_cc_cflags__Wendif_labels" >&6; }
4517 if test x"$pgac_cv_prog_cc_cflags__Wendif_labels" = x"yes"; then
4518   CFLAGS="$CFLAGS -Wendif-labels"
4519 fi
4520
4521   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wmissing-format-attribute" >&5
4522 $as_echo_n "checking whether $CC supports -Wmissing-format-attribute... " >&6; }
4523 if ${pgac_cv_prog_cc_cflags__Wmissing_format_attribute+:} false; then :
4524   $as_echo_n "(cached) " >&6
4525 else
4526   pgac_save_CFLAGS=$CFLAGS
4527 CFLAGS="$pgac_save_CFLAGS -Wmissing-format-attribute"
4528 ac_save_c_werror_flag=$ac_c_werror_flag
4529 ac_c_werror_flag=yes
4530 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4531 /* end confdefs.h.  */
4532
4533 int
4534 main ()
4535 {
4536
4537   ;
4538   return 0;
4539 }
4540 _ACEOF
4541 if ac_fn_c_try_compile "$LINENO"; then :
4542   pgac_cv_prog_cc_cflags__Wmissing_format_attribute=yes
4543 else
4544   pgac_cv_prog_cc_cflags__Wmissing_format_attribute=no
4545 fi
4546 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4547 ac_c_werror_flag=$ac_save_c_werror_flag
4548 CFLAGS="$pgac_save_CFLAGS"
4549 fi
4550 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wmissing_format_attribute" >&5
4551 $as_echo "$pgac_cv_prog_cc_cflags__Wmissing_format_attribute" >&6; }
4552 if test x"$pgac_cv_prog_cc_cflags__Wmissing_format_attribute" = x"yes"; then
4553   CFLAGS="$CFLAGS -Wmissing-format-attribute"
4554 fi
4555
4556   # This was included in -Wall/-Wformat in older GCC versions
4557   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wformat-security" >&5
4558 $as_echo_n "checking whether $CC supports -Wformat-security... " >&6; }
4559 if ${pgac_cv_prog_cc_cflags__Wformat_security+:} false; then :
4560   $as_echo_n "(cached) " >&6
4561 else
4562   pgac_save_CFLAGS=$CFLAGS
4563 CFLAGS="$pgac_save_CFLAGS -Wformat-security"
4564 ac_save_c_werror_flag=$ac_c_werror_flag
4565 ac_c_werror_flag=yes
4566 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4567 /* end confdefs.h.  */
4568
4569 int
4570 main ()
4571 {
4572
4573   ;
4574   return 0;
4575 }
4576 _ACEOF
4577 if ac_fn_c_try_compile "$LINENO"; then :
4578   pgac_cv_prog_cc_cflags__Wformat_security=yes
4579 else
4580   pgac_cv_prog_cc_cflags__Wformat_security=no
4581 fi
4582 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4583 ac_c_werror_flag=$ac_save_c_werror_flag
4584 CFLAGS="$pgac_save_CFLAGS"
4585 fi
4586 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wformat_security" >&5
4587 $as_echo "$pgac_cv_prog_cc_cflags__Wformat_security" >&6; }
4588 if test x"$pgac_cv_prog_cc_cflags__Wformat_security" = x"yes"; then
4589   CFLAGS="$CFLAGS -Wformat-security"
4590 fi
4591
4592   # Disable strict-aliasing rules; needed for gcc 3.3+
4593   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-strict-aliasing" >&5
4594 $as_echo_n "checking whether $CC supports -fno-strict-aliasing... " >&6; }
4595 if ${pgac_cv_prog_cc_cflags__fno_strict_aliasing+:} false; then :
4596   $as_echo_n "(cached) " >&6
4597 else
4598   pgac_save_CFLAGS=$CFLAGS
4599 CFLAGS="$pgac_save_CFLAGS -fno-strict-aliasing"
4600 ac_save_c_werror_flag=$ac_c_werror_flag
4601 ac_c_werror_flag=yes
4602 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4603 /* end confdefs.h.  */
4604
4605 int
4606 main ()
4607 {
4608
4609   ;
4610   return 0;
4611 }
4612 _ACEOF
4613 if ac_fn_c_try_compile "$LINENO"; then :
4614   pgac_cv_prog_cc_cflags__fno_strict_aliasing=yes
4615 else
4616   pgac_cv_prog_cc_cflags__fno_strict_aliasing=no
4617 fi
4618 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4619 ac_c_werror_flag=$ac_save_c_werror_flag
4620 CFLAGS="$pgac_save_CFLAGS"
4621 fi
4622 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&5
4623 $as_echo "$pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&6; }
4624 if test x"$pgac_cv_prog_cc_cflags__fno_strict_aliasing" = x"yes"; then
4625   CFLAGS="$CFLAGS -fno-strict-aliasing"
4626 fi
4627
4628   # Disable optimizations that assume no overflow; needed for gcc 4.3+
4629   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fwrapv" >&5
4630 $as_echo_n "checking whether $CC supports -fwrapv... " >&6; }
4631 if ${pgac_cv_prog_cc_cflags__fwrapv+:} false; then :
4632   $as_echo_n "(cached) " >&6
4633 else
4634   pgac_save_CFLAGS=$CFLAGS
4635 CFLAGS="$pgac_save_CFLAGS -fwrapv"
4636 ac_save_c_werror_flag=$ac_c_werror_flag
4637 ac_c_werror_flag=yes
4638 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4639 /* end confdefs.h.  */
4640
4641 int
4642 main ()
4643 {
4644
4645   ;
4646   return 0;
4647 }
4648 _ACEOF
4649 if ac_fn_c_try_compile "$LINENO"; then :
4650   pgac_cv_prog_cc_cflags__fwrapv=yes
4651 else
4652   pgac_cv_prog_cc_cflags__fwrapv=no
4653 fi
4654 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4655 ac_c_werror_flag=$ac_save_c_werror_flag
4656 CFLAGS="$pgac_save_CFLAGS"
4657 fi
4658 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fwrapv" >&5
4659 $as_echo "$pgac_cv_prog_cc_cflags__fwrapv" >&6; }
4660 if test x"$pgac_cv_prog_cc_cflags__fwrapv" = x"yes"; then
4661   CFLAGS="$CFLAGS -fwrapv"
4662 fi
4663
4664   # Disable FP optimizations that cause various errors on gcc 4.5+ or maybe 4.6+
4665   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fexcess-precision=standard" >&5
4666 $as_echo_n "checking whether $CC supports -fexcess-precision=standard... " >&6; }
4667 if ${pgac_cv_prog_cc_cflags__fexcess_precision_standard+:} false; then :
4668   $as_echo_n "(cached) " >&6
4669 else
4670   pgac_save_CFLAGS=$CFLAGS
4671 CFLAGS="$pgac_save_CFLAGS -fexcess-precision=standard"
4672 ac_save_c_werror_flag=$ac_c_werror_flag
4673 ac_c_werror_flag=yes
4674 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4675 /* end confdefs.h.  */
4676
4677 int
4678 main ()
4679 {
4680
4681   ;
4682   return 0;
4683 }
4684 _ACEOF
4685 if ac_fn_c_try_compile "$LINENO"; then :
4686   pgac_cv_prog_cc_cflags__fexcess_precision_standard=yes
4687 else
4688   pgac_cv_prog_cc_cflags__fexcess_precision_standard=no
4689 fi
4690 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4691 ac_c_werror_flag=$ac_save_c_werror_flag
4692 CFLAGS="$pgac_save_CFLAGS"
4693 fi
4694 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fexcess_precision_standard" >&5
4695 $as_echo "$pgac_cv_prog_cc_cflags__fexcess_precision_standard" >&6; }
4696 if test x"$pgac_cv_prog_cc_cflags__fexcess_precision_standard" = x"yes"; then
4697   CFLAGS="$CFLAGS -fexcess-precision=standard"
4698 fi
4699
4700   # Optimization flags for specific files that benefit from vectorization
4701   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -funroll-loops" >&5
4702 $as_echo_n "checking whether $CC supports -funroll-loops... " >&6; }
4703 if ${pgac_cv_prog_cc_cflags__funroll_loops+:} false; then :
4704   $as_echo_n "(cached) " >&6
4705 else
4706   pgac_save_CFLAGS=$CFLAGS
4707 CFLAGS="$pgac_save_CFLAGS -funroll-loops"
4708 ac_save_c_werror_flag=$ac_c_werror_flag
4709 ac_c_werror_flag=yes
4710 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4711 /* end confdefs.h.  */
4712
4713 int
4714 main ()
4715 {
4716
4717   ;
4718   return 0;
4719 }
4720 _ACEOF
4721 if ac_fn_c_try_compile "$LINENO"; then :
4722   pgac_cv_prog_cc_cflags__funroll_loops=yes
4723 else
4724   pgac_cv_prog_cc_cflags__funroll_loops=no
4725 fi
4726 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4727 ac_c_werror_flag=$ac_save_c_werror_flag
4728 CFLAGS="$pgac_save_CFLAGS"
4729 fi
4730 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__funroll_loops" >&5
4731 $as_echo "$pgac_cv_prog_cc_cflags__funroll_loops" >&6; }
4732 if test x"$pgac_cv_prog_cc_cflags__funroll_loops" = x"yes"; then
4733   CFLAGS_VECTOR="${CFLAGS_VECTOR} -funroll-loops"
4734 fi
4735
4736   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -ftree-vectorize" >&5
4737 $as_echo_n "checking whether $CC supports -ftree-vectorize... " >&6; }
4738 if ${pgac_cv_prog_cc_cflags__ftree_vectorize+:} false; then :
4739   $as_echo_n "(cached) " >&6
4740 else
4741   pgac_save_CFLAGS=$CFLAGS
4742 CFLAGS="$pgac_save_CFLAGS -ftree-vectorize"
4743 ac_save_c_werror_flag=$ac_c_werror_flag
4744 ac_c_werror_flag=yes
4745 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4746 /* end confdefs.h.  */
4747
4748 int
4749 main ()
4750 {
4751
4752   ;
4753   return 0;
4754 }
4755 _ACEOF
4756 if ac_fn_c_try_compile "$LINENO"; then :
4757   pgac_cv_prog_cc_cflags__ftree_vectorize=yes
4758 else
4759   pgac_cv_prog_cc_cflags__ftree_vectorize=no
4760 fi
4761 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4762 ac_c_werror_flag=$ac_save_c_werror_flag
4763 CFLAGS="$pgac_save_CFLAGS"
4764 fi
4765 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__ftree_vectorize" >&5
4766 $as_echo "$pgac_cv_prog_cc_cflags__ftree_vectorize" >&6; }
4767 if test x"$pgac_cv_prog_cc_cflags__ftree_vectorize" = x"yes"; then
4768   CFLAGS_VECTOR="${CFLAGS_VECTOR} -ftree-vectorize"
4769 fi
4770
4771   # We want to suppress clang's unhelpful unused-command-line-argument warnings
4772   # but gcc won't complain about unrecognized -Wno-foo switches, so we have to
4773   # test for the positive form and if that works, add the negative form
4774   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wunused-command-line-argument" >&5
4775 $as_echo_n "checking whether $CC supports -Wunused-command-line-argument... " >&6; }
4776 if ${pgac_cv_prog_cc_cflags__Wunused_command_line_argument+:} false; then :
4777   $as_echo_n "(cached) " >&6
4778 else
4779   pgac_save_CFLAGS=$CFLAGS
4780 CFLAGS="$pgac_save_CFLAGS -Wunused-command-line-argument"
4781 ac_save_c_werror_flag=$ac_c_werror_flag
4782 ac_c_werror_flag=yes
4783 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4784 /* end confdefs.h.  */
4785
4786 int
4787 main ()
4788 {
4789
4790   ;
4791   return 0;
4792 }
4793 _ACEOF
4794 if ac_fn_c_try_compile "$LINENO"; then :
4795   pgac_cv_prog_cc_cflags__Wunused_command_line_argument=yes
4796 else
4797   pgac_cv_prog_cc_cflags__Wunused_command_line_argument=no
4798 fi
4799 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4800 ac_c_werror_flag=$ac_save_c_werror_flag
4801 CFLAGS="$pgac_save_CFLAGS"
4802 fi
4803 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wunused_command_line_argument" >&5
4804 $as_echo "$pgac_cv_prog_cc_cflags__Wunused_command_line_argument" >&6; }
4805 if test x"$pgac_cv_prog_cc_cflags__Wunused_command_line_argument" = x"yes"; then
4806   NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
4807 fi
4808
4809   if test -n "$NOT_THE_CFLAGS"; then
4810     CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
4811   fi
4812 elif test "$ICC" = yes; then
4813   # Intel's compiler has a bug/misoptimization in checking for
4814   # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
4815   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mp1" >&5
4816 $as_echo_n "checking whether $CC supports -mp1... " >&6; }
4817 if ${pgac_cv_prog_cc_cflags__mp1+:} false; then :
4818   $as_echo_n "(cached) " >&6
4819 else
4820   pgac_save_CFLAGS=$CFLAGS
4821 CFLAGS="$pgac_save_CFLAGS -mp1"
4822 ac_save_c_werror_flag=$ac_c_werror_flag
4823 ac_c_werror_flag=yes
4824 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4825 /* end confdefs.h.  */
4826
4827 int
4828 main ()
4829 {
4830
4831   ;
4832   return 0;
4833 }
4834 _ACEOF
4835 if ac_fn_c_try_compile "$LINENO"; then :
4836   pgac_cv_prog_cc_cflags__mp1=yes
4837 else
4838   pgac_cv_prog_cc_cflags__mp1=no
4839 fi
4840 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4841 ac_c_werror_flag=$ac_save_c_werror_flag
4842 CFLAGS="$pgac_save_CFLAGS"
4843 fi
4844 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__mp1" >&5
4845 $as_echo "$pgac_cv_prog_cc_cflags__mp1" >&6; }
4846 if test x"$pgac_cv_prog_cc_cflags__mp1" = x"yes"; then
4847   CFLAGS="$CFLAGS -mp1"
4848 fi
4849
4850   # Make sure strict aliasing is off (though this is said to be the default)
4851   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-strict-aliasing" >&5
4852 $as_echo_n "checking whether $CC supports -fno-strict-aliasing... " >&6; }
4853 if ${pgac_cv_prog_cc_cflags__fno_strict_aliasing+:} false; then :
4854   $as_echo_n "(cached) " >&6
4855 else
4856   pgac_save_CFLAGS=$CFLAGS
4857 CFLAGS="$pgac_save_CFLAGS -fno-strict-aliasing"
4858 ac_save_c_werror_flag=$ac_c_werror_flag
4859 ac_c_werror_flag=yes
4860 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4861 /* end confdefs.h.  */
4862
4863 int
4864 main ()
4865 {
4866
4867   ;
4868   return 0;
4869 }
4870 _ACEOF
4871 if ac_fn_c_try_compile "$LINENO"; then :
4872   pgac_cv_prog_cc_cflags__fno_strict_aliasing=yes
4873 else
4874   pgac_cv_prog_cc_cflags__fno_strict_aliasing=no
4875 fi
4876 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4877 ac_c_werror_flag=$ac_save_c_werror_flag
4878 CFLAGS="$pgac_save_CFLAGS"
4879 fi
4880 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&5
4881 $as_echo "$pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&6; }
4882 if test x"$pgac_cv_prog_cc_cflags__fno_strict_aliasing" = x"yes"; then
4883   CFLAGS="$CFLAGS -fno-strict-aliasing"
4884 fi
4885
4886 elif test "$PORTNAME" = "aix"; then
4887   # AIX's xlc has to have strict aliasing turned off too
4888   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -qnoansialias" >&5
4889 $as_echo_n "checking whether $CC supports -qnoansialias... " >&6; }
4890 if ${pgac_cv_prog_cc_cflags__qnoansialias+:} false; then :
4891   $as_echo_n "(cached) " >&6
4892 else
4893   pgac_save_CFLAGS=$CFLAGS
4894 CFLAGS="$pgac_save_CFLAGS -qnoansialias"
4895 ac_save_c_werror_flag=$ac_c_werror_flag
4896 ac_c_werror_flag=yes
4897 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4898 /* end confdefs.h.  */
4899
4900 int
4901 main ()
4902 {
4903
4904   ;
4905   return 0;
4906 }
4907 _ACEOF
4908 if ac_fn_c_try_compile "$LINENO"; then :
4909   pgac_cv_prog_cc_cflags__qnoansialias=yes
4910 else
4911   pgac_cv_prog_cc_cflags__qnoansialias=no
4912 fi
4913 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4914 ac_c_werror_flag=$ac_save_c_werror_flag
4915 CFLAGS="$pgac_save_CFLAGS"
4916 fi
4917 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__qnoansialias" >&5
4918 $as_echo "$pgac_cv_prog_cc_cflags__qnoansialias" >&6; }
4919 if test x"$pgac_cv_prog_cc_cflags__qnoansialias" = x"yes"; then
4920   CFLAGS="$CFLAGS -qnoansialias"
4921 fi
4922
4923   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -qlonglong" >&5
4924 $as_echo_n "checking whether $CC supports -qlonglong... " >&6; }
4925 if ${pgac_cv_prog_cc_cflags__qlonglong+:} false; then :
4926   $as_echo_n "(cached) " >&6
4927 else
4928   pgac_save_CFLAGS=$CFLAGS
4929 CFLAGS="$pgac_save_CFLAGS -qlonglong"
4930 ac_save_c_werror_flag=$ac_c_werror_flag
4931 ac_c_werror_flag=yes
4932 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4933 /* end confdefs.h.  */
4934
4935 int
4936 main ()
4937 {
4938
4939   ;
4940   return 0;
4941 }
4942 _ACEOF
4943 if ac_fn_c_try_compile "$LINENO"; then :
4944   pgac_cv_prog_cc_cflags__qlonglong=yes
4945 else
4946   pgac_cv_prog_cc_cflags__qlonglong=no
4947 fi
4948 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4949 ac_c_werror_flag=$ac_save_c_werror_flag
4950 CFLAGS="$pgac_save_CFLAGS"
4951 fi
4952 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__qlonglong" >&5
4953 $as_echo "$pgac_cv_prog_cc_cflags__qlonglong" >&6; }
4954 if test x"$pgac_cv_prog_cc_cflags__qlonglong" = x"yes"; then
4955   CFLAGS="$CFLAGS -qlonglong"
4956 fi
4957
4958 elif test "$PORTNAME" = "hpux"; then
4959   # On some versions of HP-UX, libm functions do not set errno by default.
4960   # Fix that by using +Olibmerrno if the compiler recognizes it.
4961   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports +Olibmerrno" >&5
4962 $as_echo_n "checking whether $CC supports +Olibmerrno... " >&6; }
4963 if ${pgac_cv_prog_cc_cflags_pOlibmerrno+:} false; then :
4964   $as_echo_n "(cached) " >&6
4965 else
4966   pgac_save_CFLAGS=$CFLAGS
4967 CFLAGS="$pgac_save_CFLAGS +Olibmerrno"
4968 ac_save_c_werror_flag=$ac_c_werror_flag
4969 ac_c_werror_flag=yes
4970 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4971 /* end confdefs.h.  */
4972
4973 int
4974 main ()
4975 {
4976
4977   ;
4978   return 0;
4979 }
4980 _ACEOF
4981 if ac_fn_c_try_compile "$LINENO"; then :
4982   pgac_cv_prog_cc_cflags_pOlibmerrno=yes
4983 else
4984   pgac_cv_prog_cc_cflags_pOlibmerrno=no
4985 fi
4986 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4987 ac_c_werror_flag=$ac_save_c_werror_flag
4988 CFLAGS="$pgac_save_CFLAGS"
4989 fi
4990 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags_pOlibmerrno" >&5
4991 $as_echo "$pgac_cv_prog_cc_cflags_pOlibmerrno" >&6; }
4992 if test x"$pgac_cv_prog_cc_cflags_pOlibmerrno" = x"yes"; then
4993   CFLAGS="$CFLAGS +Olibmerrno"
4994 fi
4995
4996 fi
4997
4998 CFLAGS_VECTOR=$CFLAGS_VECTOR
4999
5000
5001 # supply -g if --enable-debug
5002 if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
5003   CFLAGS="$CFLAGS -g"
5004 fi
5005
5006 # enable code coverage if --enable-coverage
5007 if test "$enable_coverage" = yes; then
5008   if test "$GCC" = yes; then
5009     CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
5010   else
5011     as_fn_error $? "--enable-coverage is supported only when using GCC" "$LINENO" 5
5012   fi
5013 fi
5014
5015 # enable profiling if --enable-profiling
5016 if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then
5017   if test "$GCC" = yes; then
5018
5019 $as_echo "#define PROFILE_PID_DIR 1" >>confdefs.h
5020
5021     CFLAGS="$CFLAGS -pg $PLATFORM_PROFILE_FLAGS"
5022   else
5023     as_fn_error $? "--enable-profiling is supported only when using GCC" "$LINENO" 5
5024   fi
5025 fi
5026
5027 # We already have this in Makefile.win32, but configure needs it too
5028 if test "$PORTNAME" = "win32"; then
5029   CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32 -DEXEC_BACKEND"
5030 fi
5031
5032 # Now that we're done automatically adding stuff to CFLAGS, put back the
5033 # user-specified flags (if any) at the end.  This lets users override
5034 # the automatic additions.
5035 CFLAGS="$CFLAGS $user_CFLAGS"
5036
5037 # Check if the compiler still works with the final flag settings
5038 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler still works" >&5
5039 $as_echo_n "checking whether the C compiler still works... " >&6; }
5040 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5041 /* end confdefs.h.  */
5042
5043 int
5044 main ()
5045 {
5046 return 0;
5047   ;
5048   return 0;
5049 }
5050 _ACEOF
5051 if ac_fn_c_try_link "$LINENO"; then :
5052   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5053 $as_echo "yes" >&6; }
5054 else
5055   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5056 $as_echo "no" >&6; }
5057    as_fn_error $? "cannot proceed" "$LINENO" 5
5058 fi
5059 rm -f core conftest.err conftest.$ac_objext \
5060     conftest$ac_exeext conftest.$ac_ext
5061
5062 # Defend against gcc -ffast-math
5063 if test "$GCC" = yes; then
5064 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5065 /* end confdefs.h.  */
5066
5067 int
5068 main ()
5069 {
5070 #ifdef __FAST_MATH__
5071 choke me
5072 #endif
5073   ;
5074   return 0;
5075 }
5076 _ACEOF
5077 if ac_fn_c_try_compile "$LINENO"; then :
5078
5079 else
5080   as_fn_error $? "do not put -ffast-math in CFLAGS" "$LINENO" 5
5081 fi
5082 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5083 fi
5084
5085 ac_ext=c
5086 ac_cpp='$CPP $CPPFLAGS'
5087 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5088 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5089 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5090 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
5091 $as_echo_n "checking how to run the C preprocessor... " >&6; }
5092 # On Suns, sometimes $CPP names a directory.
5093 if test -n "$CPP" && test -d "$CPP"; then
5094   CPP=
5095 fi
5096 if test -z "$CPP"; then
5097   if ${ac_cv_prog_CPP+:} false; then :
5098   $as_echo_n "(cached) " >&6
5099 else
5100       # Double quotes because CPP needs to be expanded
5101     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
5102     do
5103       ac_preproc_ok=false
5104 for ac_c_preproc_warn_flag in '' yes
5105 do
5106   # Use a header file that comes with gcc, so configuring glibc
5107   # with a fresh cross-compiler works.
5108   # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5109   # <limits.h> exists even on freestanding compilers.
5110   # On the NeXT, cc -E runs the code through the compiler's parser,
5111   # not just through cpp. "Syntax error" is here to catch this case.
5112   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5113 /* end confdefs.h.  */
5114 #ifdef __STDC__
5115 # include <limits.h>
5116 #else
5117 # include <assert.h>
5118 #endif
5119                      Syntax error
5120 _ACEOF
5121 if ac_fn_c_try_cpp "$LINENO"; then :
5122
5123 else
5124   # Broken: fails on valid input.
5125 continue
5126 fi
5127 rm -f conftest.err conftest.i conftest.$ac_ext
5128
5129   # OK, works on sane cases.  Now check whether nonexistent headers
5130   # can be detected and how.
5131   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5132 /* end confdefs.h.  */
5133 #include <ac_nonexistent.h>
5134 _ACEOF
5135 if ac_fn_c_try_cpp "$LINENO"; then :
5136   # Broken: success on invalid input.
5137 continue
5138 else
5139   # Passes both tests.
5140 ac_preproc_ok=:
5141 break
5142 fi
5143 rm -f conftest.err conftest.i conftest.$ac_ext
5144
5145 done
5146 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
5147 rm -f conftest.i conftest.err conftest.$ac_ext
5148 if $ac_preproc_ok; then :
5149   break
5150 fi
5151
5152     done
5153     ac_cv_prog_CPP=$CPP
5154
5155 fi
5156   CPP=$ac_cv_prog_CPP
5157 else
5158   ac_cv_prog_CPP=$CPP
5159 fi
5160 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
5161 $as_echo "$CPP" >&6; }
5162 ac_preproc_ok=false
5163 for ac_c_preproc_warn_flag in '' yes
5164 do
5165   # Use a header file that comes with gcc, so configuring glibc
5166   # with a fresh cross-compiler works.
5167   # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5168   # <limits.h> exists even on freestanding compilers.
5169   # On the NeXT, cc -E runs the code through the compiler's parser,
5170   # not just through cpp. "Syntax error" is here to catch this case.
5171   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5172 /* end confdefs.h.  */
5173 #ifdef __STDC__
5174 # include <limits.h>
5175 #else
5176 # include <assert.h>
5177 #endif
5178                      Syntax error
5179 _ACEOF
5180 if ac_fn_c_try_cpp "$LINENO"; then :
5181
5182 else
5183   # Broken: fails on valid input.
5184 continue
5185 fi
5186 rm -f conftest.err conftest.i conftest.$ac_ext
5187
5188   # OK, works on sane cases.  Now check whether nonexistent headers
5189   # can be detected and how.
5190   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5191 /* end confdefs.h.  */
5192 #include <ac_nonexistent.h>
5193 _ACEOF
5194 if ac_fn_c_try_cpp "$LINENO"; then :
5195   # Broken: success on invalid input.
5196 continue
5197 else
5198   # Passes both tests.
5199 ac_preproc_ok=:
5200 break
5201 fi
5202 rm -f conftest.err conftest.i conftest.$ac_ext
5203
5204 done
5205 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
5206 rm -f conftest.i conftest.err conftest.$ac_ext
5207 if $ac_preproc_ok; then :
5208
5209 else
5210   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5211 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5212 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
5213 See \`config.log' for more details" "$LINENO" 5; }
5214 fi
5215
5216 ac_ext=c
5217 ac_cpp='$CPP $CPPFLAGS'
5218 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5219 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5220 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5221
5222
5223
5224
5225 #
5226 # Set up TAS assembly code if needed; the template file has now had its
5227 # chance to request this.
5228 #
5229 ac_config_links="$ac_config_links src/backend/port/tas.s:src/backend/port/tas/${tas_file}"
5230
5231
5232 if test "$need_tas" = yes ; then
5233   TAS=tas.o
5234 else
5235   TAS=""
5236 fi
5237
5238
5239
5240 #
5241 # Automatic dependency tracking
5242 #
5243
5244
5245 # Check whether --enable-depend was given.
5246 if test "${enable_depend+set}" = set; then :
5247   enableval=$enable_depend;
5248   case $enableval in
5249     yes)
5250       autodepend=yes
5251       ;;
5252     no)
5253       :
5254       ;;
5255     *)
5256       as_fn_error $? "no argument expected for --enable-depend option" "$LINENO" 5
5257       ;;
5258   esac
5259
5260 else
5261   enable_depend=no
5262
5263 fi
5264
5265
5266
5267
5268
5269 #
5270 # Enable assert checks
5271 #
5272
5273
5274 # Check whether --enable-cassert was given.
5275 if test "${enable_cassert+set}" = set; then :
5276   enableval=$enable_cassert;
5277   case $enableval in
5278     yes)
5279
5280 $as_echo "#define USE_ASSERT_CHECKING 1" >>confdefs.h
5281
5282       ;;
5283     no)
5284       :
5285       ;;
5286     *)
5287       as_fn_error $? "no argument expected for --enable-cassert option" "$LINENO" 5
5288       ;;
5289   esac
5290
5291 else
5292   enable_cassert=no
5293
5294 fi
5295
5296
5297
5298
5299 #
5300 # Include directories
5301 #
5302 ac_save_IFS=$IFS
5303 IFS="${IFS}${PATH_SEPARATOR}"
5304 # SRCH_INC comes from the template file
5305 for dir in $with_includes $SRCH_INC; do
5306   if test -d "$dir"; then
5307     INCLUDES="$INCLUDES -I$dir"
5308   else
5309     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Include directory $dir does not exist." >&5
5310 $as_echo "$as_me: WARNING: *** Include directory $dir does not exist." >&2;}
5311   fi
5312 done
5313 IFS=$ac_save_IFS
5314
5315
5316
5317 #
5318 # Library directories
5319 #
5320 ac_save_IFS=$IFS
5321 IFS="${IFS}${PATH_SEPARATOR}"
5322 # LIBRARY_DIRS comes from command line, SRCH_LIB from template file.
5323 for dir in $LIBRARY_DIRS $SRCH_LIB; do
5324   if test -d "$dir"; then
5325     LIBDIRS="$LIBDIRS -L$dir"
5326   else
5327     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Library directory $dir does not exist." >&5
5328 $as_echo "$as_me: WARNING: *** Library directory $dir does not exist." >&2;}
5329   fi
5330 done
5331 IFS=$ac_save_IFS
5332
5333 #
5334 # Enable thread-safe client libraries
5335 #
5336 { $as_echo "$as_me:${as_lineno-$LINENO}: checking allow thread-safe client libraries" >&5
5337 $as_echo_n "checking allow thread-safe client libraries... " >&6; }
5338
5339
5340 # Check whether --enable-thread-safety was given.
5341 if test "${enable_thread_safety+set}" = set; then :
5342   enableval=$enable_thread_safety;
5343   case $enableval in
5344     yes)
5345       :
5346       ;;
5347     no)
5348       :
5349       ;;
5350     *)
5351       as_fn_error $? "no argument expected for --enable-thread-safety option" "$LINENO" 5
5352       ;;
5353   esac
5354
5355 else
5356   enable_thread_safety=yes
5357
5358 fi
5359
5360
5361 if test "$enable_thread_safety" = yes; then
5362
5363 $as_echo "#define ENABLE_THREAD_SAFETY 1" >>confdefs.h
5364
5365 fi
5366 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_thread_safety" >&5
5367 $as_echo "$enable_thread_safety" >&6; }
5368
5369
5370 #
5371 # Optionally build Tcl modules (PL/Tcl)
5372 #
5373 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Tcl" >&5
5374 $as_echo_n "checking whether to build with Tcl... " >&6; }
5375
5376
5377
5378 # Check whether --with-tcl was given.
5379 if test "${with_tcl+set}" = set; then :
5380   withval=$with_tcl;
5381   case $withval in
5382     yes)
5383       :
5384       ;;
5385     no)
5386       :
5387       ;;
5388     *)
5389       as_fn_error $? "no argument expected for --with-tcl option" "$LINENO" 5
5390       ;;
5391   esac
5392
5393 else
5394   with_tcl=no
5395
5396 fi
5397
5398
5399 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_tcl" >&5
5400 $as_echo "$with_tcl" >&6; }
5401
5402
5403 # We see if the path to the Tcl/Tk configuration scripts is specified.
5404 # This will override the use of tclsh to find the paths to search.
5405
5406
5407
5408
5409 # Check whether --with-tclconfig was given.
5410 if test "${with_tclconfig+set}" = set; then :
5411   withval=$with_tclconfig;
5412   case $withval in
5413     yes)
5414       as_fn_error $? "argument required for --with-tclconfig option" "$LINENO" 5
5415       ;;
5416     no)
5417       as_fn_error $? "argument required for --with-tclconfig option" "$LINENO" 5
5418       ;;
5419     *)
5420
5421       ;;
5422   esac
5423
5424 fi
5425
5426
5427
5428 #
5429 # Optionally build Perl modules (PL/Perl)
5430 #
5431 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Perl modules" >&5
5432 $as_echo_n "checking whether to build Perl modules... " >&6; }
5433
5434
5435
5436 # Check whether --with-perl was given.
5437 if test "${with_perl+set}" = set; then :
5438   withval=$with_perl;
5439   case $withval in
5440     yes)
5441       :
5442       ;;
5443     no)
5444       :
5445       ;;
5446     *)
5447       as_fn_error $? "no argument expected for --with-perl option" "$LINENO" 5
5448       ;;
5449   esac
5450
5451 else
5452   with_perl=no
5453
5454 fi
5455
5456
5457 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_perl" >&5
5458 $as_echo "$with_perl" >&6; }
5459
5460
5461 #
5462 # Optionally build Python modules (PL/Python)
5463 #
5464 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Python modules" >&5
5465 $as_echo_n "checking whether to build Python modules... " >&6; }
5466
5467
5468
5469 # Check whether --with-python was given.
5470 if test "${with_python+set}" = set; then :
5471   withval=$with_python;
5472   case $withval in
5473     yes)
5474       :
5475       ;;
5476     no)
5477       :
5478       ;;
5479     *)
5480       as_fn_error $? "no argument expected for --with-python option" "$LINENO" 5
5481       ;;
5482   esac
5483
5484 else
5485   with_python=no
5486
5487 fi
5488
5489
5490 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_python" >&5
5491 $as_echo "$with_python" >&6; }
5492
5493
5494 #
5495 # GSSAPI
5496 #
5497 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with GSSAPI support" >&5
5498 $as_echo_n "checking whether to build with GSSAPI support... " >&6; }
5499
5500
5501
5502 # Check whether --with-gssapi was given.
5503 if test "${with_gssapi+set}" = set; then :
5504   withval=$with_gssapi;
5505   case $withval in
5506     yes)
5507
5508
5509 $as_echo "#define ENABLE_GSS 1" >>confdefs.h
5510
5511   krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab"
5512
5513       ;;
5514     no)
5515       :
5516       ;;
5517     *)
5518       as_fn_error $? "no argument expected for --with-gssapi option" "$LINENO" 5
5519       ;;
5520   esac
5521
5522 else
5523   with_gssapi=no
5524
5525 fi
5526
5527
5528 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gssapi" >&5
5529 $as_echo "$with_gssapi" >&6; }
5530
5531
5532
5533
5534
5535 #
5536 # Kerberos configuration parameters
5537 #
5538
5539
5540
5541 # Check whether --with-krb-srvnam was given.
5542 if test "${with_krb_srvnam+set}" = set; then :
5543   withval=$with_krb_srvnam;
5544   case $withval in
5545     yes)
5546       as_fn_error $? "argument required for --with-krb-srvnam option" "$LINENO" 5
5547       ;;
5548     no)
5549       as_fn_error $? "argument required for --with-krb-srvnam option" "$LINENO" 5
5550       ;;
5551     *)
5552
5553       ;;
5554   esac
5555
5556 else
5557   with_krb_srvnam="postgres"
5558 fi
5559
5560
5561
5562 cat >>confdefs.h <<_ACEOF
5563 #define PG_KRB_SRVNAM "$with_krb_srvnam"
5564 _ACEOF
5565
5566
5567
5568 #
5569 # PAM
5570 #
5571 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with PAM support" >&5
5572 $as_echo_n "checking whether to build with PAM support... " >&6; }
5573
5574
5575
5576 # Check whether --with-pam was given.
5577 if test "${with_pam+set}" = set; then :
5578   withval=$with_pam;
5579   case $withval in
5580     yes)
5581
5582 $as_echo "#define USE_PAM 1" >>confdefs.h
5583
5584       ;;
5585     no)
5586       :
5587       ;;
5588     *)
5589       as_fn_error $? "no argument expected for --with-pam option" "$LINENO" 5
5590       ;;
5591   esac
5592
5593 else
5594   with_pam=no
5595
5596 fi
5597
5598
5599 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pam" >&5
5600 $as_echo "$with_pam" >&6; }
5601
5602
5603 #
5604 # BSD AUTH
5605 #
5606 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with BSD Authentication support" >&5
5607 $as_echo_n "checking whether to build with BSD Authentication support... " >&6; }
5608
5609
5610
5611 # Check whether --with-bsd-auth was given.
5612 if test "${with_bsd_auth+set}" = set; then :
5613   withval=$with_bsd_auth;
5614   case $withval in
5615     yes)
5616
5617 $as_echo "#define USE_BSD_AUTH 1" >>confdefs.h
5618
5619       ;;
5620     no)
5621       :
5622       ;;
5623     *)
5624       as_fn_error $? "no argument expected for --with-bsd-auth option" "$LINENO" 5
5625       ;;
5626   esac
5627
5628 else
5629   with_bsd_auth=no
5630
5631 fi
5632
5633
5634 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_bsd_auth" >&5
5635 $as_echo "$with_bsd_auth" >&6; }
5636
5637
5638 #
5639 # LDAP
5640 #
5641 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with LDAP support" >&5
5642 $as_echo_n "checking whether to build with LDAP support... " >&6; }
5643
5644
5645
5646 # Check whether --with-ldap was given.
5647 if test "${with_ldap+set}" = set; then :
5648   withval=$with_ldap;
5649   case $withval in
5650     yes)
5651
5652 $as_echo "#define USE_LDAP 1" >>confdefs.h
5653
5654       ;;
5655     no)
5656       :
5657       ;;
5658     *)
5659       as_fn_error $? "no argument expected for --with-ldap option" "$LINENO" 5
5660       ;;
5661   esac
5662
5663 else
5664   with_ldap=no
5665
5666 fi
5667
5668
5669 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ldap" >&5
5670 $as_echo "$with_ldap" >&6; }
5671
5672
5673 #
5674 # Bonjour
5675 #
5676 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Bonjour support" >&5
5677 $as_echo_n "checking whether to build with Bonjour support... " >&6; }
5678
5679
5680
5681 # Check whether --with-bonjour was given.
5682 if test "${with_bonjour+set}" = set; then :
5683   withval=$with_bonjour;
5684   case $withval in
5685     yes)
5686
5687 $as_echo "#define USE_BONJOUR 1" >>confdefs.h
5688
5689       ;;
5690     no)
5691       :
5692       ;;
5693     *)
5694       as_fn_error $? "no argument expected for --with-bonjour option" "$LINENO" 5
5695       ;;
5696   esac
5697
5698 else
5699   with_bonjour=no
5700
5701 fi
5702
5703
5704 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_bonjour" >&5
5705 $as_echo "$with_bonjour" >&6; }
5706
5707
5708 #
5709 # OpenSSL
5710 #
5711 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with OpenSSL support" >&5
5712 $as_echo_n "checking whether to build with OpenSSL support... " >&6; }
5713
5714
5715
5716 # Check whether --with-openssl was given.
5717 if test "${with_openssl+set}" = set; then :
5718   withval=$with_openssl;
5719   case $withval in
5720     yes)
5721
5722 $as_echo "#define USE_OPENSSL 1" >>confdefs.h
5723
5724       ;;
5725     no)
5726       :
5727       ;;
5728     *)
5729       as_fn_error $? "no argument expected for --with-openssl option" "$LINENO" 5
5730       ;;
5731   esac
5732
5733 else
5734   with_openssl=no
5735
5736 fi
5737
5738
5739 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_openssl" >&5
5740 $as_echo "$with_openssl" >&6; }
5741
5742
5743 #
5744 # SELinux
5745 #
5746 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with SELinux support" >&5
5747 $as_echo_n "checking whether to build with SELinux support... " >&6; }
5748
5749
5750
5751 # Check whether --with-selinux was given.
5752 if test "${with_selinux+set}" = set; then :
5753   withval=$with_selinux;
5754   case $withval in
5755     yes)
5756       :
5757       ;;
5758     no)
5759       :
5760       ;;
5761     *)
5762       as_fn_error $? "no argument expected for --with-selinux option" "$LINENO" 5
5763       ;;
5764   esac
5765
5766 else
5767   with_selinux=no
5768
5769 fi
5770
5771
5772
5773 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_selinux" >&5
5774 $as_echo "$with_selinux" >&6; }
5775
5776 #
5777 # Systemd
5778 #
5779 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with systemd support" >&5
5780 $as_echo_n "checking whether to build with systemd support... " >&6; }
5781
5782
5783
5784 # Check whether --with-systemd was given.
5785 if test "${with_systemd+set}" = set; then :
5786   withval=$with_systemd;
5787   case $withval in
5788     yes)
5789
5790 $as_echo "#define USE_SYSTEMD 1" >>confdefs.h
5791
5792       ;;
5793     no)
5794       :
5795       ;;
5796     *)
5797       as_fn_error $? "no argument expected for --with-systemd option" "$LINENO" 5
5798       ;;
5799   esac
5800
5801 else
5802   with_systemd=no
5803
5804 fi
5805
5806
5807
5808 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_systemd" >&5
5809 $as_echo "$with_systemd" >&6; }
5810
5811 #
5812 # Readline
5813 #
5814
5815
5816
5817 # Check whether --with-readline was given.
5818 if test "${with_readline+set}" = set; then :
5819   withval=$with_readline;
5820   case $withval in
5821     yes)
5822       :
5823       ;;
5824     no)
5825       :
5826       ;;
5827     *)
5828       as_fn_error $? "no argument expected for --with-readline option" "$LINENO" 5
5829       ;;
5830   esac
5831
5832 else
5833   with_readline=yes
5834
5835 fi
5836
5837
5838 # readline on MinGW has problems with backslashes in psql and other bugs.
5839 # This is particularly a problem with non-US code pages.
5840 # Therefore disable its use until we understand the cause. 2004-07-20
5841 if test "$PORTNAME" = "win32"; then
5842   if test "$with_readline" = yes; then
5843     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Readline does not work on MinGW --- disabling" >&5
5844 $as_echo "$as_me: WARNING: *** Readline does not work on MinGW --- disabling" >&2;}
5845     with_readline=no
5846   fi
5847 fi
5848
5849
5850 #
5851 # Prefer libedit
5852 #
5853
5854
5855
5856 # Check whether --with-libedit-preferred was given.
5857 if test "${with_libedit_preferred+set}" = set; then :
5858   withval=$with_libedit_preferred;
5859   case $withval in
5860     yes)
5861       :
5862       ;;
5863     no)
5864       :
5865       ;;
5866     *)
5867       as_fn_error $? "no argument expected for --with-libedit-preferred option" "$LINENO" 5
5868       ;;
5869   esac
5870
5871 else
5872   with_libedit_preferred=no
5873
5874 fi
5875
5876
5877
5878
5879 #
5880 # UUID library
5881 #
5882 # There are at least three UUID libraries in common use: the FreeBSD/NetBSD
5883 # library, the e2fsprogs libuuid (now part of util-linux-ng), and the OSSP
5884 # UUID library.  More than one of these might be present on a given platform,
5885 # so we make the user say which one she wants.
5886 #
5887
5888
5889
5890 # Check whether --with-uuid was given.
5891 if test "${with_uuid+set}" = set; then :
5892   withval=$with_uuid;
5893   case $withval in
5894     yes)
5895       as_fn_error $? "argument required for --with-uuid option" "$LINENO" 5
5896       ;;
5897     no)
5898       as_fn_error $? "argument required for --with-uuid option" "$LINENO" 5
5899       ;;
5900     *)
5901
5902       ;;
5903   esac
5904
5905 fi
5906
5907
5908 if test x"$with_uuid" = x"" ; then
5909   with_uuid=no
5910 fi
5911
5912
5913
5914 # Check whether --with-ossp-uuid was given.
5915 if test "${with_ossp_uuid+set}" = set; then :
5916   withval=$with_ossp_uuid;
5917   case $withval in
5918     yes)
5919       :
5920       ;;
5921     no)
5922       :
5923       ;;
5924     *)
5925       as_fn_error $? "no argument expected for --with-ossp-uuid option" "$LINENO" 5
5926       ;;
5927   esac
5928
5929 else
5930   with_ossp_uuid=no
5931
5932 fi
5933
5934
5935 if test "$with_ossp_uuid" = yes ; then
5936   with_uuid=ossp
5937 fi
5938
5939 if test "$with_uuid" = bsd ; then
5940
5941 $as_echo "#define HAVE_UUID_BSD 1" >>confdefs.h
5942
5943   UUID_EXTRA_OBJS="md5.o sha1.o"
5944 elif test "$with_uuid" = e2fs ; then
5945
5946 $as_echo "#define HAVE_UUID_E2FS 1" >>confdefs.h
5947
5948   UUID_EXTRA_OBJS="md5.o sha1.o"
5949 elif test "$with_uuid" = ossp ; then
5950
5951 $as_echo "#define HAVE_UUID_OSSP 1" >>confdefs.h
5952
5953   UUID_EXTRA_OBJS=""
5954 elif test "$with_uuid" = no ; then
5955   UUID_EXTRA_OBJS=""
5956 else
5957   as_fn_error $? "--with-uuid must specify one of bsd, e2fs, or ossp" "$LINENO" 5
5958 fi
5959
5960
5961
5962
5963 #
5964 # XML
5965 #
5966
5967
5968
5969 # Check whether --with-libxml was given.
5970 if test "${with_libxml+set}" = set; then :
5971   withval=$with_libxml;
5972   case $withval in
5973     yes)
5974
5975 $as_echo "#define USE_LIBXML 1" >>confdefs.h
5976
5977       ;;
5978     no)
5979       :
5980       ;;
5981     *)
5982       as_fn_error $? "no argument expected for --with-libxml option" "$LINENO" 5
5983       ;;
5984   esac
5985
5986 else
5987   with_libxml=no
5988
5989 fi
5990
5991
5992
5993 if test "$with_libxml" = yes ; then
5994   for ac_prog in xml2-config
5995 do
5996   # Extract the first word of "$ac_prog", so it can be a program name with args.
5997 set dummy $ac_prog; ac_word=$2
5998 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5999 $as_echo_n "checking for $ac_word... " >&6; }
6000 if ${ac_cv_prog_XML2_CONFIG+:} false; then :
6001   $as_echo_n "(cached) " >&6
6002 else
6003   if test -n "$XML2_CONFIG"; then
6004   ac_cv_prog_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test.
6005 else
6006 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6007 for as_dir in $PATH
6008 do
6009   IFS=$as_save_IFS
6010   test -z "$as_dir" && as_dir=.
6011     for ac_exec_ext in '' $ac_executable_extensions; do
6012   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6013     ac_cv_prog_XML2_CONFIG="$ac_prog"
6014     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6015     break 2
6016   fi
6017 done
6018   done
6019 IFS=$as_save_IFS
6020
6021 fi
6022 fi
6023 XML2_CONFIG=$ac_cv_prog_XML2_CONFIG
6024 if test -n "$XML2_CONFIG"; then
6025   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5
6026 $as_echo "$XML2_CONFIG" >&6; }
6027 else
6028   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6029 $as_echo "no" >&6; }
6030 fi
6031
6032
6033   test -n "$XML2_CONFIG" && break
6034 done
6035
6036   if test -n "$XML2_CONFIG"; then
6037     for pgac_option in `$XML2_CONFIG --cflags`; do
6038       case $pgac_option in
6039         -I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";;
6040       esac
6041     done
6042     for pgac_option in `$XML2_CONFIG --libs`; do
6043       case $pgac_option in
6044         -L*) LDFLAGS="$LDFLAGS $pgac_option";;
6045       esac
6046     done
6047   fi
6048 fi
6049
6050
6051
6052 #
6053 # XSLT
6054 #
6055
6056
6057
6058 # Check whether --with-libxslt was given.
6059 if test "${with_libxslt+set}" = set; then :
6060   withval=$with_libxslt;
6061   case $withval in
6062     yes)
6063
6064 $as_echo "#define USE_LIBXSLT 1" >>confdefs.h
6065
6066       ;;
6067     no)
6068       :
6069       ;;
6070     *)
6071       as_fn_error $? "no argument expected for --with-libxslt option" "$LINENO" 5
6072       ;;
6073   esac
6074
6075 else
6076   with_libxslt=no
6077
6078 fi
6079
6080
6081
6082
6083
6084
6085 #
6086 # tzdata
6087 #
6088
6089
6090
6091 # Check whether --with-system-tzdata was given.
6092 if test "${with_system_tzdata+set}" = set; then :
6093   withval=$with_system_tzdata;
6094   case $withval in
6095     yes)
6096       as_fn_error $? "argument required for --with-system-tzdata option" "$LINENO" 5
6097       ;;
6098     no)
6099       as_fn_error $? "argument required for --with-system-tzdata option" "$LINENO" 5
6100       ;;
6101     *)
6102
6103       ;;
6104   esac
6105
6106 fi
6107
6108
6109
6110
6111 #
6112 # Zlib
6113 #
6114
6115
6116
6117 # Check whether --with-zlib was given.
6118 if test "${with_zlib+set}" = set; then :
6119   withval=$with_zlib;
6120   case $withval in
6121     yes)
6122       :
6123       ;;
6124     no)
6125       :
6126       ;;
6127     *)
6128       as_fn_error $? "no argument expected for --with-zlib option" "$LINENO" 5
6129       ;;
6130   esac
6131
6132 else
6133   with_zlib=yes
6134
6135 fi
6136
6137
6138
6139
6140 #
6141 # Elf
6142 #
6143
6144 # Assume system is ELF if it predefines __ELF__ as 1,
6145 # otherwise believe host_os based default.
6146 case $host_os in
6147     freebsd1*|freebsd2*) elf=no;;
6148     freebsd3*|freebsd4*) elf=yes;;
6149 esac
6150
6151
6152 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
6153 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
6154 if ${ac_cv_path_GREP+:} false; then :
6155   $as_echo_n "(cached) " >&6
6156 else
6157   if test -z "$GREP"; then
6158   ac_path_GREP_found=false
6159   # Loop through the user's path and test for each of PROGNAME-LIST
6160   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6161 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
6162 do
6163   IFS=$as_save_IFS
6164   test -z "$as_dir" && as_dir=.
6165     for ac_prog in grep ggrep; do
6166     for ac_exec_ext in '' $ac_executable_extensions; do
6167       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
6168       as_fn_executable_p "$ac_path_GREP" || continue
6169 # Check for GNU ac_path_GREP and select it if it is found.
6170   # Check for GNU $ac_path_GREP
6171 case `"$ac_path_GREP" --version 2>&1` in
6172 *GNU*)
6173   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
6174 *)
6175   ac_count=0
6176   $as_echo_n 0123456789 >"conftest.in"
6177   while :
6178   do
6179     cat "conftest.in" "conftest.in" >"conftest.tmp"
6180     mv "conftest.tmp" "conftest.in"
6181     cp "conftest.in" "conftest.nl"
6182     $as_echo 'GREP' >> "conftest.nl"
6183     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
6184     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
6185     as_fn_arith $ac_count + 1 && ac_count=$as_val
6186     if test $ac_count -gt ${ac_path_GREP_max-0}; then
6187       # Best one so far, save it but keep looking for a better one
6188       ac_cv_path_GREP="$ac_path_GREP"
6189       ac_path_GREP_max=$ac_count
6190     fi
6191     # 10*(2^10) chars as input seems more than enough
6192     test $ac_count -gt 10 && break
6193   done
6194   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
6195 esac
6196
6197       $ac_path_GREP_found && break 3
6198     done
6199   done
6200   done
6201 IFS=$as_save_IFS
6202   if test -z "$ac_cv_path_GREP"; then
6203     as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
6204   fi
6205 else
6206   ac_cv_path_GREP=$GREP
6207 fi
6208
6209 fi
6210 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
6211 $as_echo "$ac_cv_path_GREP" >&6; }
6212  GREP="$ac_cv_path_GREP"
6213
6214
6215 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
6216 $as_echo_n "checking for egrep... " >&6; }
6217 if ${ac_cv_path_EGREP+:} false; then :
6218   $as_echo_n "(cached) " >&6
6219 else
6220   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
6221    then ac_cv_path_EGREP="$GREP -E"
6222    else
6223      if test -z "$EGREP"; then
6224   ac_path_EGREP_found=false
6225   # Loop through the user's path and test for each of PROGNAME-LIST
6226   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6227 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
6228 do
6229   IFS=$as_save_IFS
6230   test -z "$as_dir" && as_dir=.
6231     for ac_prog in egrep; do
6232     for ac_exec_ext in '' $ac_executable_extensions; do
6233       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
6234       as_fn_executable_p "$ac_path_EGREP" || continue
6235 # Check for GNU ac_path_EGREP and select it if it is found.
6236   # Check for GNU $ac_path_EGREP
6237 case `"$ac_path_EGREP" --version 2>&1` in
6238 *GNU*)
6239   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
6240 *)
6241   ac_count=0
6242   $as_echo_n 0123456789 >"conftest.in"
6243   while :
6244   do
6245     cat "conftest.in" "conftest.in" >"conftest.tmp"
6246     mv "conftest.tmp" "conftest.in"
6247     cp "conftest.in" "conftest.nl"
6248     $as_echo 'EGREP' >> "conftest.nl"
6249     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
6250     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
6251     as_fn_arith $ac_count + 1 && ac_count=$as_val
6252     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
6253       # Best one so far, save it but keep looking for a better one
6254       ac_cv_path_EGREP="$ac_path_EGREP"
6255       ac_path_EGREP_max=$ac_count
6256     fi
6257     # 10*(2^10) chars as input seems more than enough
6258     test $ac_count -gt 10 && break
6259   done
6260   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
6261 esac
6262
6263       $ac_path_EGREP_found && break 3
6264     done
6265   done
6266   done
6267 IFS=$as_save_IFS
6268   if test -z "$ac_cv_path_EGREP"; then
6269     as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
6270   fi
6271 else
6272   ac_cv_path_EGREP=$EGREP
6273 fi
6274
6275    fi
6276 fi
6277 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
6278 $as_echo "$ac_cv_path_EGREP" >&6; }
6279  EGREP="$ac_cv_path_EGREP"
6280
6281
6282 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6283 /* end confdefs.h.  */
6284 #if __ELF__
6285   yes
6286 #endif
6287
6288 _ACEOF
6289 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6290   $EGREP "yes" >/dev/null 2>&1; then :
6291   ELF_SYS=true
6292 else
6293   if test "X$elf" = "Xyes" ; then
6294   ELF_SYS=true
6295 else
6296   ELF_SYS=
6297 fi
6298 fi
6299 rm -f conftest*
6300
6301
6302
6303 #
6304 # Assignments
6305 #
6306
6307 CPPFLAGS="$CPPFLAGS $INCLUDES"
6308 LDFLAGS="$LDFLAGS $LIBDIRS"
6309
6310
6311
6312
6313
6314 # Check whether --with-gnu-ld was given.
6315 if test "${with_gnu_ld+set}" = set; then :
6316   withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
6317 else
6318   with_gnu_ld=no
6319 fi
6320
6321 ac_prog=ld
6322 if test "$GCC" = yes; then
6323   # Check if gcc -print-prog-name=ld gives a path.
6324   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5
6325 $as_echo_n "checking for ld used by GCC... " >&6; }
6326   case $host in
6327   *-*-mingw*)
6328     # gcc leaves a trailing carriage return which upsets mingw
6329     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
6330   *)
6331     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
6332   esac
6333   case "$ac_prog" in
6334     # Accept absolute paths.
6335     [\\/]* | [A-Za-z]:[\\/]*)
6336       re_direlt='/[^/][^/]*/\.\./'
6337       # Canonicalize the path of ld
6338       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
6339       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
6340         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
6341       done
6342       test -z "$LD" && LD="$ac_prog"
6343       ;;
6344   "")
6345     # If it fails, then pretend we aren't using GCC.
6346     ac_prog=ld
6347     ;;
6348   *)
6349     # If it is relative, then search for the first ld in PATH.
6350     with_gnu_ld=unknown
6351     ;;
6352   esac
6353 elif test "$with_gnu_ld" = yes; then
6354   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
6355 $as_echo_n "checking for GNU ld... " >&6; }
6356 else
6357   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
6358 $as_echo_n "checking for non-GNU ld... " >&6; }
6359 fi
6360 if ${ac_cv_path_LD+:} false; then :
6361   $as_echo_n "(cached) " >&6
6362 else
6363   if test -z "$LD"; then
6364   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
6365   for ac_dir in $PATH; do
6366     test -z "$ac_dir" && ac_dir=.
6367     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
6368       ac_cv_path_LD="$ac_dir/$ac_prog"
6369       # Check to see if the program is GNU ld.  I'd rather use --version,
6370       # but apparently some GNU ld's only accept -v.
6371       # Break only if it was the GNU/non-GNU ld that we prefer.
6372       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
6373         test "$with_gnu_ld" != no && break
6374       else
6375         test "$with_gnu_ld" != yes && break
6376       fi
6377     fi
6378   done
6379   IFS="$ac_save_ifs"
6380 else
6381   ac_cv_path_LD="$LD" # Let the user override the test with a path.
6382 fi
6383 fi
6384
6385 LD="$ac_cv_path_LD"
6386 if test -n "$LD"; then
6387   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
6388 $as_echo "$LD" >&6; }
6389 else
6390   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6391 $as_echo "no" >&6; }
6392 fi
6393 test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
6394 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
6395 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
6396 if ${ac_cv_prog_gnu_ld+:} false; then :
6397   $as_echo_n "(cached) " >&6
6398 else
6399   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
6400 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
6401   ac_cv_prog_gnu_ld=yes
6402 else
6403   ac_cv_prog_gnu_ld=no
6404 fi
6405 fi
6406 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gnu_ld" >&5
6407 $as_echo "$ac_cv_prog_gnu_ld" >&6; }
6408 with_gnu_ld=$ac_cv_prog_gnu_ld
6409
6410
6411
6412
6413 if test -n "$ac_tool_prefix"; then
6414   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
6415 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
6416 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6417 $as_echo_n "checking for $ac_word... " >&6; }
6418 if ${ac_cv_prog_RANLIB+:} false; then :
6419   $as_echo_n "(cached) " >&6
6420 else
6421   if test -n "$RANLIB"; then
6422   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
6423 else
6424 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6425 for as_dir in $PATH
6426 do
6427   IFS=$as_save_IFS
6428   test -z "$as_dir" && as_dir=.
6429     for ac_exec_ext in '' $ac_executable_extensions; do
6430   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6431     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
6432     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6433     break 2
6434   fi
6435 done
6436   done
6437 IFS=$as_save_IFS
6438
6439 fi
6440 fi
6441 RANLIB=$ac_cv_prog_RANLIB
6442 if test -n "$RANLIB"; then
6443   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
6444 $as_echo "$RANLIB" >&6; }
6445 else
6446   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6447 $as_echo "no" >&6; }
6448 fi
6449
6450
6451 fi
6452 if test -z "$ac_cv_prog_RANLIB"; then
6453   ac_ct_RANLIB=$RANLIB
6454   # Extract the first word of "ranlib", so it can be a program name with args.
6455 set dummy ranlib; ac_word=$2
6456 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6457 $as_echo_n "checking for $ac_word... " >&6; }
6458 if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
6459   $as_echo_n "(cached) " >&6
6460 else
6461   if test -n "$ac_ct_RANLIB"; then
6462   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
6463 else
6464 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6465 for as_dir in $PATH
6466 do
6467   IFS=$as_save_IFS
6468   test -z "$as_dir" && as_dir=.
6469     for ac_exec_ext in '' $ac_executable_extensions; do
6470   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6471     ac_cv_prog_ac_ct_RANLIB="ranlib"
6472     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6473     break 2
6474   fi
6475 done
6476   done
6477 IFS=$as_save_IFS
6478
6479 fi
6480 fi
6481 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
6482 if test -n "$ac_ct_RANLIB"; then
6483   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
6484 $as_echo "$ac_ct_RANLIB" >&6; }
6485 else
6486   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6487 $as_echo "no" >&6; }
6488 fi
6489
6490   if test "x$ac_ct_RANLIB" = x; then
6491     RANLIB=":"
6492   else
6493     case $cross_compiling:$ac_tool_warned in
6494 yes:)
6495 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6496 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6497 ac_tool_warned=yes ;;
6498 esac
6499     RANLIB=$ac_ct_RANLIB
6500   fi
6501 else
6502   RANLIB="$ac_cv_prog_RANLIB"
6503 fi
6504
6505
6506   if test -n "$ac_tool_prefix"; then
6507   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
6508 set dummy ${ac_tool_prefix}strip; ac_word=$2
6509 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6510 $as_echo_n "checking for $ac_word... " >&6; }
6511 if ${ac_cv_prog_STRIP+:} false; then :
6512   $as_echo_n "(cached) " >&6
6513 else
6514   if test -n "$STRIP"; then
6515   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
6516 else
6517 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6518 for as_dir in $PATH
6519 do
6520   IFS=$as_save_IFS
6521   test -z "$as_dir" && as_dir=.
6522     for ac_exec_ext in '' $ac_executable_extensions; do
6523   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6524     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
6525     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6526     break 2
6527   fi
6528 done
6529   done
6530 IFS=$as_save_IFS
6531
6532 fi
6533 fi
6534 STRIP=$ac_cv_prog_STRIP
6535 if test -n "$STRIP"; then
6536   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
6537 $as_echo "$STRIP" >&6; }
6538 else
6539   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6540 $as_echo "no" >&6; }
6541 fi
6542
6543
6544 fi
6545 if test -z "$ac_cv_prog_STRIP"; then
6546   ac_ct_STRIP=$STRIP
6547   # Extract the first word of "strip", so it can be a program name with args.
6548 set dummy strip; ac_word=$2
6549 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6550 $as_echo_n "checking for $ac_word... " >&6; }
6551 if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
6552   $as_echo_n "(cached) " >&6
6553 else
6554   if test -n "$ac_ct_STRIP"; then
6555   ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
6556 else
6557 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6558 for as_dir in $PATH
6559 do
6560   IFS=$as_save_IFS
6561   test -z "$as_dir" && as_dir=.
6562     for ac_exec_ext in '' $ac_executable_extensions; do
6563   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6564     ac_cv_prog_ac_ct_STRIP="strip"
6565     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6566     break 2
6567   fi
6568 done
6569   done
6570 IFS=$as_save_IFS
6571
6572 fi
6573 fi
6574 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
6575 if test -n "$ac_ct_STRIP"; then
6576   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
6577 $as_echo "$ac_ct_STRIP" >&6; }
6578 else
6579   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6580 $as_echo "no" >&6; }
6581 fi
6582
6583   if test "x$ac_ct_STRIP" = x; then
6584     STRIP=":"
6585   else
6586     case $cross_compiling:$ac_tool_warned in
6587 yes:)
6588 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6589 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6590 ac_tool_warned=yes ;;
6591 esac
6592     STRIP=$ac_ct_STRIP
6593   fi
6594 else
6595   STRIP="$ac_cv_prog_STRIP"
6596 fi
6597
6598
6599   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is possible to strip libraries" >&5
6600 $as_echo_n "checking whether it is possible to strip libraries... " >&6; }
6601   if test x"$STRIP" != x"" && "$STRIP" -V 2>&1 | grep "GNU strip" >/dev/null; then
6602     STRIP_STATIC_LIB="$STRIP -x"
6603     STRIP_SHARED_LIB="$STRIP --strip-unneeded"
6604     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6605 $as_echo "yes" >&6; }
6606   else
6607     case $host_os in
6608       darwin*)
6609         STRIP="$STRIP -x"
6610         STRIP_STATIC_LIB=$STRIP
6611         STRIP_SHARED_LIB=$STRIP
6612         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6613 $as_echo "yes" >&6; }
6614         ;;
6615       *)
6616         STRIP_STATIC_LIB=:
6617         STRIP_SHARED_LIB=:
6618         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6619 $as_echo "no" >&6; }
6620         ;;
6621     esac
6622   fi
6623
6624
6625
6626 if test -n "$ac_tool_prefix"; then
6627   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
6628 set dummy ${ac_tool_prefix}ar; ac_word=$2
6629 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6630 $as_echo_n "checking for $ac_word... " >&6; }
6631 if ${ac_cv_prog_AR+:} false; then :
6632   $as_echo_n "(cached) " >&6
6633 else
6634   if test -n "$AR"; then
6635   ac_cv_prog_AR="$AR" # Let the user override the test.
6636 else
6637 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6638 for as_dir in $PATH
6639 do
6640   IFS=$as_save_IFS
6641   test -z "$as_dir" && as_dir=.
6642     for ac_exec_ext in '' $ac_executable_extensions; do
6643   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6644     ac_cv_prog_AR="${ac_tool_prefix}ar"
6645     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6646     break 2
6647   fi
6648 done
6649   done
6650 IFS=$as_save_IFS
6651
6652 fi
6653 fi
6654 AR=$ac_cv_prog_AR
6655 if test -n "$AR"; then
6656   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
6657 $as_echo "$AR" >&6; }
6658 else
6659   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6660 $as_echo "no" >&6; }
6661 fi
6662
6663
6664 fi
6665 if test -z "$ac_cv_prog_AR"; then
6666   ac_ct_AR=$AR
6667   # Extract the first word of "ar", so it can be a program name with args.
6668 set dummy ar; ac_word=$2
6669 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6670 $as_echo_n "checking for $ac_word... " >&6; }
6671 if ${ac_cv_prog_ac_ct_AR+:} false; then :
6672   $as_echo_n "(cached) " >&6
6673 else
6674   if test -n "$ac_ct_AR"; then
6675   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
6676 else
6677 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6678 for as_dir in $PATH
6679 do
6680   IFS=$as_save_IFS
6681   test -z "$as_dir" && as_dir=.
6682     for ac_exec_ext in '' $ac_executable_extensions; do
6683   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6684     ac_cv_prog_ac_ct_AR="ar"
6685     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6686     break 2
6687   fi
6688 done
6689   done
6690 IFS=$as_save_IFS
6691
6692 fi
6693 fi
6694 ac_ct_AR=$ac_cv_prog_ac_ct_AR
6695 if test -n "$ac_ct_AR"; then
6696   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
6697 $as_echo "$ac_ct_AR" >&6; }
6698 else
6699   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6700 $as_echo "no" >&6; }
6701 fi
6702
6703   if test "x$ac_ct_AR" = x; then
6704     AR="ar"
6705   else
6706     case $cross_compiling:$ac_tool_warned in
6707 yes:)
6708 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6709 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6710 ac_tool_warned=yes ;;
6711 esac
6712     AR=$ac_ct_AR
6713   fi
6714 else
6715   AR="$ac_cv_prog_AR"
6716 fi
6717
6718 if test "$PORTNAME" = "win32"; then
6719   if test -n "$ac_tool_prefix"; then
6720   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
6721 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
6722 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6723 $as_echo_n "checking for $ac_word... " >&6; }
6724 if ${ac_cv_prog_DLLTOOL+:} false; then :
6725   $as_echo_n "(cached) " >&6
6726 else
6727   if test -n "$DLLTOOL"; then
6728   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
6729 else
6730 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6731 for as_dir in $PATH
6732 do
6733   IFS=$as_save_IFS
6734   test -z "$as_dir" && as_dir=.
6735     for ac_exec_ext in '' $ac_executable_extensions; do
6736   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6737     ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
6738     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6739     break 2
6740   fi
6741 done
6742   done
6743 IFS=$as_save_IFS
6744
6745 fi
6746 fi
6747 DLLTOOL=$ac_cv_prog_DLLTOOL
6748 if test -n "$DLLTOOL"; then
6749   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
6750 $as_echo "$DLLTOOL" >&6; }
6751 else
6752   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6753 $as_echo "no" >&6; }
6754 fi
6755
6756
6757 fi
6758 if test -z "$ac_cv_prog_DLLTOOL"; then
6759   ac_ct_DLLTOOL=$DLLTOOL
6760   # Extract the first word of "dlltool", so it can be a program name with args.
6761 set dummy dlltool; ac_word=$2
6762 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6763 $as_echo_n "checking for $ac_word... " >&6; }
6764 if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
6765   $as_echo_n "(cached) " >&6
6766 else
6767   if test -n "$ac_ct_DLLTOOL"; then
6768   ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
6769 else
6770 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6771 for as_dir in $PATH
6772 do
6773   IFS=$as_save_IFS
6774   test -z "$as_dir" && as_dir=.
6775     for ac_exec_ext in '' $ac_executable_extensions; do
6776   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6777     ac_cv_prog_ac_ct_DLLTOOL="dlltool"
6778     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6779     break 2
6780   fi
6781 done
6782   done
6783 IFS=$as_save_IFS
6784
6785 fi
6786 fi
6787 ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
6788 if test -n "$ac_ct_DLLTOOL"; then
6789   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
6790 $as_echo "$ac_ct_DLLTOOL" >&6; }
6791 else
6792   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6793 $as_echo "no" >&6; }
6794 fi
6795
6796   if test "x$ac_ct_DLLTOOL" = x; then
6797     DLLTOOL="dlltool"
6798   else
6799     case $cross_compiling:$ac_tool_warned in
6800 yes:)
6801 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6802 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6803 ac_tool_warned=yes ;;
6804 esac
6805     DLLTOOL=$ac_ct_DLLTOOL
6806   fi
6807 else
6808   DLLTOOL="$ac_cv_prog_DLLTOOL"
6809 fi
6810
6811   if test -n "$ac_tool_prefix"; then
6812   # Extract the first word of "${ac_tool_prefix}dllwrap", so it can be a program name with args.
6813 set dummy ${ac_tool_prefix}dllwrap; ac_word=$2
6814 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6815 $as_echo_n "checking for $ac_word... " >&6; }
6816 if ${ac_cv_prog_DLLWRAP+:} false; then :
6817   $as_echo_n "(cached) " >&6
6818 else
6819   if test -n "$DLLWRAP"; then
6820   ac_cv_prog_DLLWRAP="$DLLWRAP" # Let the user override the test.
6821 else
6822 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6823 for as_dir in $PATH
6824 do
6825   IFS=$as_save_IFS
6826   test -z "$as_dir" && as_dir=.
6827     for ac_exec_ext in '' $ac_executable_extensions; do
6828   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6829     ac_cv_prog_DLLWRAP="${ac_tool_prefix}dllwrap"
6830     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6831     break 2
6832   fi
6833 done
6834   done
6835 IFS=$as_save_IFS
6836
6837 fi
6838 fi
6839 DLLWRAP=$ac_cv_prog_DLLWRAP
6840 if test -n "$DLLWRAP"; then
6841   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLWRAP" >&5
6842 $as_echo "$DLLWRAP" >&6; }
6843 else
6844   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6845 $as_echo "no" >&6; }
6846 fi
6847
6848
6849 fi
6850 if test -z "$ac_cv_prog_DLLWRAP"; then
6851   ac_ct_DLLWRAP=$DLLWRAP
6852   # Extract the first word of "dllwrap", so it can be a program name with args.
6853 set dummy dllwrap; ac_word=$2
6854 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6855 $as_echo_n "checking for $ac_word... " >&6; }
6856 if ${ac_cv_prog_ac_ct_DLLWRAP+:} false; then :
6857   $as_echo_n "(cached) " >&6
6858 else
6859   if test -n "$ac_ct_DLLWRAP"; then
6860   ac_cv_prog_ac_ct_DLLWRAP="$ac_ct_DLLWRAP" # Let the user override the test.
6861 else
6862 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6863 for as_dir in $PATH
6864 do
6865   IFS=$as_save_IFS
6866   test -z "$as_dir" && as_dir=.
6867     for ac_exec_ext in '' $ac_executable_extensions; do
6868   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6869     ac_cv_prog_ac_ct_DLLWRAP="dllwrap"
6870     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6871     break 2
6872   fi
6873 done
6874   done
6875 IFS=$as_save_IFS
6876
6877 fi
6878 fi
6879 ac_ct_DLLWRAP=$ac_cv_prog_ac_ct_DLLWRAP
6880 if test -n "$ac_ct_DLLWRAP"; then
6881   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLWRAP" >&5
6882 $as_echo "$ac_ct_DLLWRAP" >&6; }
6883 else
6884   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6885 $as_echo "no" >&6; }
6886 fi
6887
6888   if test "x$ac_ct_DLLWRAP" = x; then
6889     DLLWRAP="dllwrap"
6890   else
6891     case $cross_compiling:$ac_tool_warned in
6892 yes:)
6893 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6894 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6895 ac_tool_warned=yes ;;
6896 esac
6897     DLLWRAP=$ac_ct_DLLWRAP
6898   fi
6899 else
6900   DLLWRAP="$ac_cv_prog_DLLWRAP"
6901 fi
6902
6903   if test -n "$ac_tool_prefix"; then
6904   # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
6905 set dummy ${ac_tool_prefix}windres; ac_word=$2
6906 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6907 $as_echo_n "checking for $ac_word... " >&6; }
6908 if ${ac_cv_prog_WINDRES+:} false; then :
6909   $as_echo_n "(cached) " >&6
6910 else
6911   if test -n "$WINDRES"; then
6912   ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
6913 else
6914 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6915 for as_dir in $PATH
6916 do
6917   IFS=$as_save_IFS
6918   test -z "$as_dir" && as_dir=.
6919     for ac_exec_ext in '' $ac_executable_extensions; do
6920   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6921     ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
6922     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6923     break 2
6924   fi
6925 done
6926   done
6927 IFS=$as_save_IFS
6928
6929 fi
6930 fi
6931 WINDRES=$ac_cv_prog_WINDRES
6932 if test -n "$WINDRES"; then
6933   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5
6934 $as_echo "$WINDRES" >&6; }
6935 else
6936   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6937 $as_echo "no" >&6; }
6938 fi
6939
6940
6941 fi
6942 if test -z "$ac_cv_prog_WINDRES"; then
6943   ac_ct_WINDRES=$WINDRES
6944   # Extract the first word of "windres", so it can be a program name with args.
6945 set dummy windres; ac_word=$2
6946 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6947 $as_echo_n "checking for $ac_word... " >&6; }
6948 if ${ac_cv_prog_ac_ct_WINDRES+:} false; then :
6949   $as_echo_n "(cached) " >&6
6950 else
6951   if test -n "$ac_ct_WINDRES"; then
6952   ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
6953 else
6954 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6955 for as_dir in $PATH
6956 do
6957   IFS=$as_save_IFS
6958   test -z "$as_dir" && as_dir=.
6959     for ac_exec_ext in '' $ac_executable_extensions; do
6960   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6961     ac_cv_prog_ac_ct_WINDRES="windres"
6962     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6963     break 2
6964   fi
6965 done
6966   done
6967 IFS=$as_save_IFS
6968
6969 fi
6970 fi
6971 ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
6972 if test -n "$ac_ct_WINDRES"; then
6973   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5
6974 $as_echo "$ac_ct_WINDRES" >&6; }
6975 else
6976   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6977 $as_echo "no" >&6; }
6978 fi
6979
6980   if test "x$ac_ct_WINDRES" = x; then
6981     WINDRES="windres"
6982   else
6983     case $cross_compiling:$ac_tool_warned in
6984 yes:)
6985 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6986 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6987 ac_tool_warned=yes ;;
6988 esac
6989     WINDRES=$ac_ct_WINDRES
6990   fi
6991 else
6992   WINDRES="$ac_cv_prog_WINDRES"
6993 fi
6994
6995 fi
6996
6997 # Find a good install program.  We prefer a C program (faster),
6998 # so one script is as good as another.  But avoid the broken or
6999 # incompatible versions:
7000 # SysV /etc/install, /usr/sbin/install
7001 # SunOS /usr/etc/install
7002 # IRIX /sbin/install
7003 # AIX /bin/install
7004 # AmigaOS /C/install, which installs bootblocks on floppy discs
7005 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
7006 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
7007 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
7008 # OS/2's system install, which has a completely different semantic
7009 # ./install, which can be erroneously created by make from ./install.sh.
7010 # Reject install programs that cannot install multiple files.
7011 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
7012 $as_echo_n "checking for a BSD-compatible install... " >&6; }
7013 if test -z "$INSTALL"; then
7014 if ${ac_cv_path_install+:} false; then :
7015   $as_echo_n "(cached) " >&6
7016 else
7017   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7018 for as_dir in $PATH
7019 do
7020   IFS=$as_save_IFS
7021   test -z "$as_dir" && as_dir=.
7022     # Account for people who put trailing slashes in PATH elements.
7023 case $as_dir/ in #((
7024   ./ | .// | /[cC]/* | \
7025   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
7026   ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
7027   /usr/ucb/* ) ;;
7028   *)
7029     # OSF1 and SCO ODT 3.0 have their own names for install.
7030     # Don't use installbsd from OSF since it installs stuff as root
7031     # by default.
7032     for ac_prog in ginstall scoinst install; do
7033       for ac_exec_ext in '' $ac_executable_extensions; do
7034         if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
7035           if test $ac_prog = install &&
7036             grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
7037             # AIX install.  It has an incompatible calling convention.
7038             :
7039           elif test $ac_prog = install &&
7040             grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
7041             # program-specific install script used by HP pwplus--don't use.
7042             :
7043           else
7044             rm -rf conftest.one conftest.two conftest.dir
7045             echo one > conftest.one
7046             echo two > conftest.two
7047             mkdir conftest.dir
7048             if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
7049               test -s conftest.one && test -s conftest.two &&
7050               test -s conftest.dir/conftest.one &&
7051               test -s conftest.dir/conftest.two
7052             then
7053               ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
7054               break 3
7055             fi
7056           fi
7057         fi
7058       done
7059     done
7060     ;;
7061 esac
7062
7063   done
7064 IFS=$as_save_IFS
7065
7066 rm -rf conftest.one conftest.two conftest.dir
7067
7068 fi
7069   if test "${ac_cv_path_install+set}" = set; then
7070     INSTALL=$ac_cv_path_install
7071   else
7072     # As a last resort, use the slow shell script.  Don't cache a
7073     # value for INSTALL within a source directory, because that will
7074     # break other packages using the cache if that directory is
7075     # removed, or if the value is a relative name.
7076     INSTALL=$ac_install_sh
7077   fi
7078 fi
7079 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
7080 $as_echo "$INSTALL" >&6; }
7081
7082 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
7083 # It thinks the first close brace ends the variable substitution.
7084 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
7085
7086 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
7087
7088 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
7089
7090 # When Autoconf chooses install-sh as install program it tries to generate
7091 # a relative path to it in each makefile where it subsitutes it. This clashes
7092 # with our Makefile.global concept. This workaround helps.
7093 case $INSTALL in
7094   *install-sh*) install_bin='';;
7095   *) install_bin=$INSTALL;;
7096 esac
7097
7098
7099 # Extract the first word of "tar", so it can be a program name with args.
7100 set dummy tar; ac_word=$2
7101 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7102 $as_echo_n "checking for $ac_word... " >&6; }
7103 if ${ac_cv_path_TAR+:} false; then :
7104   $as_echo_n "(cached) " >&6
7105 else
7106   case $TAR in
7107   [\\/]* | ?:[\\/]*)
7108   ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
7109   ;;
7110   *)
7111   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7112 for as_dir in $PATH
7113 do
7114   IFS=$as_save_IFS
7115   test -z "$as_dir" && as_dir=.
7116     for ac_exec_ext in '' $ac_executable_extensions; do
7117   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7118     ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext"
7119     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7120     break 2
7121   fi
7122 done
7123   done
7124 IFS=$as_save_IFS
7125
7126   ;;
7127 esac
7128 fi
7129 TAR=$ac_cv_path_TAR
7130 if test -n "$TAR"; then
7131   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5
7132 $as_echo "$TAR" >&6; }
7133 else
7134   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7135 $as_echo "no" >&6; }
7136 fi
7137
7138
7139 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
7140 $as_echo_n "checking whether ln -s works... " >&6; }
7141 LN_S=$as_ln_s
7142 if test "$LN_S" = "ln -s"; then
7143   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7144 $as_echo "yes" >&6; }
7145 else
7146   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
7147 $as_echo "no, using $LN_S" >&6; }
7148 fi
7149
7150 for ac_prog in gawk mawk nawk awk
7151 do
7152   # Extract the first word of "$ac_prog", so it can be a program name with args.
7153 set dummy $ac_prog; ac_word=$2
7154 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7155 $as_echo_n "checking for $ac_word... " >&6; }
7156 if ${ac_cv_prog_AWK+:} false; then :
7157   $as_echo_n "(cached) " >&6
7158 else
7159   if test -n "$AWK"; then
7160   ac_cv_prog_AWK="$AWK" # Let the user override the test.
7161 else
7162 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7163 for as_dir in $PATH
7164 do
7165   IFS=$as_save_IFS
7166   test -z "$as_dir" && as_dir=.
7167     for ac_exec_ext in '' $ac_executable_extensions; do
7168   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7169     ac_cv_prog_AWK="$ac_prog"
7170     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7171     break 2
7172   fi
7173 done
7174   done
7175 IFS=$as_save_IFS
7176
7177 fi
7178 fi
7179 AWK=$ac_cv_prog_AWK
7180 if test -n "$AWK"; then
7181   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
7182 $as_echo "$AWK" >&6; }
7183 else
7184   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7185 $as_echo "no" >&6; }
7186 fi
7187
7188
7189   test -n "$AWK" && break
7190 done
7191
7192 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
7193 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
7194 if test -z "$MKDIR_P"; then
7195   if ${ac_cv_path_mkdir+:} false; then :
7196   $as_echo_n "(cached) " >&6
7197 else
7198   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7199 for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
7200 do
7201   IFS=$as_save_IFS
7202   test -z "$as_dir" && as_dir=.
7203     for ac_prog in mkdir gmkdir; do
7204          for ac_exec_ext in '' $ac_executable_extensions; do
7205            as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
7206            case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
7207              'mkdir (GNU coreutils) '* | \
7208              'mkdir (coreutils) '* | \
7209              'mkdir (fileutils) '4.1*)
7210                ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
7211                break 3;;
7212            esac
7213          done
7214        done
7215   done
7216 IFS=$as_save_IFS
7217
7218 fi
7219
7220   test -d ./--version && rmdir ./--version
7221   if test "${ac_cv_path_mkdir+set}" = set; then
7222     MKDIR_P="$ac_cv_path_mkdir -p"
7223   else
7224     # As a last resort, use the slow shell script.  Don't cache a
7225     # value for MKDIR_P within a source directory, because that will
7226     # break other packages using the cache if that directory is
7227     # removed, or if the value is a relative name.
7228     MKDIR_P="$ac_install_sh -d"
7229   fi
7230 fi
7231 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
7232 $as_echo "$MKDIR_P" >&6; }
7233
7234 # When Autoconf chooses install-sh as mkdir -p program it tries to generate
7235 # a relative path to it in each makefile where it subsitutes it. This clashes
7236 # with our Makefile.global concept. This workaround helps.
7237 case $MKDIR_P in
7238   *install-sh*) MKDIR_P='\${SHELL} \${top_srcdir}/config/install-sh -c -d';;
7239 esac
7240
7241 # Let the user override the search
7242 if test -z "$BISON"; then
7243   for ac_prog in bison
7244 do
7245   # Extract the first word of "$ac_prog", so it can be a program name with args.
7246 set dummy $ac_prog; ac_word=$2
7247 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7248 $as_echo_n "checking for $ac_word... " >&6; }
7249 if ${ac_cv_path_BISON+:} false; then :
7250   $as_echo_n "(cached) " >&6
7251 else
7252   case $BISON in
7253   [\\/]* | ?:[\\/]*)
7254   ac_cv_path_BISON="$BISON" # Let the user override the test with a path.
7255   ;;
7256   *)
7257   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7258 for as_dir in $PATH
7259 do
7260   IFS=$as_save_IFS
7261   test -z "$as_dir" && as_dir=.
7262     for ac_exec_ext in '' $ac_executable_extensions; do
7263   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7264     ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext"
7265     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7266     break 2
7267   fi
7268 done
7269   done
7270 IFS=$as_save_IFS
7271
7272   ;;
7273 esac
7274 fi
7275 BISON=$ac_cv_path_BISON
7276 if test -n "$BISON"; then
7277   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5
7278 $as_echo "$BISON" >&6; }
7279 else
7280   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7281 $as_echo "no" >&6; }
7282 fi
7283
7284
7285   test -n "$BISON" && break
7286 done
7287
7288 fi
7289
7290 if test "$BISON"; then
7291   pgac_bison_version=`$BISON --version 2>/dev/null | sed q`
7292   { $as_echo "$as_me:${as_lineno-$LINENO}: using $pgac_bison_version" >&5
7293 $as_echo "$as_me: using $pgac_bison_version" >&6;}
7294   if echo "$pgac_bison_version" | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'
7295   then
7296     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7297 *** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
7298 *** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&5
7299 $as_echo "$as_me: WARNING:
7300 *** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
7301 *** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&2;}
7302     BISON=""
7303   fi
7304   # Bison >=3.0 issues warnings about %name-prefix="base_yy", instead
7305   # of the now preferred %name-prefix "base_yy", but the latter
7306   # doesn't work with Bison 2.3 or less.  So for now we silence the
7307   # deprecation warnings.
7308   if echo "$pgac_bison_version" | $AWK '{ if ($4 >= 3) exit 0; else exit 1;}'
7309   then
7310     BISONFLAGS="$BISONFLAGS -Wno-deprecated"
7311   fi
7312 fi
7313
7314 if test -z "$BISON"; then
7315   { $as_echo "$as_me:${as_lineno-$LINENO}: 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.)" >&5
7321 $as_echo "$as_me: WARNING:
7322 *** Without Bison you will not be able to build PostgreSQL from Git nor
7323 *** change any of the parser definition files.  You can obtain Bison from
7324 *** a GNU mirror site.  (If you are using the official distribution of
7325 *** PostgreSQL then you do not need to worry about this, because the Bison
7326 *** output is pre-generated.)" >&2;}
7327 fi
7328 # We don't need AC_SUBST(BISON) because AC_PATH_PROG did it
7329
7330
7331 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flex" >&5
7332 $as_echo_n "checking for flex... " >&6; }
7333 if ${pgac_cv_path_flex+:} false; then :
7334   $as_echo_n "(cached) " >&6
7335 else
7336   # Let the user override the test
7337 if test -n "$FLEX"; then
7338   pgac_cv_path_flex=$FLEX
7339 else
7340   pgac_save_IFS=$IFS
7341   IFS=$PATH_SEPARATOR
7342   for pgac_dir in $PATH; do
7343     IFS=$pgac_save_IFS
7344     if test -z "$pgac_dir" || test x"$pgac_dir" = x"."; then
7345       pgac_dir=`pwd`
7346     fi
7347     for pgac_prog in flex lex; do
7348       pgac_candidate="$pgac_dir/$pgac_prog"
7349       if test -f "$pgac_candidate" \
7350         && $pgac_candidate --version </dev/null >/dev/null 2>&1
7351       then
7352         echo '%%'  > conftest.l
7353         if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
7354           pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
7355           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;}'
7356           then
7357             pgac_cv_path_flex=$pgac_candidate
7358             break 2
7359           else
7360             { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7361 *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
7362 *** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&5
7363 $as_echo "$as_me: WARNING:
7364 *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
7365 *** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&2;}
7366           fi
7367         fi
7368       fi
7369     done
7370   done
7371   rm -f conftest.l lex.yy.c
7372   : ${pgac_cv_path_flex=no}
7373 fi
7374
7375 fi
7376 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_path_flex" >&5
7377 $as_echo "$pgac_cv_path_flex" >&6; }
7378 if test x"$pgac_cv_path_flex" = x"no"; then
7379   { $as_echo "$as_me:${as_lineno-$LINENO}: 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.)" >&5
7385 $as_echo "$as_me: WARNING:
7386 *** Without Flex you will not be able to build PostgreSQL from Git nor
7387 *** change any of the scanner definition files.  You can obtain Flex from
7388 *** a GNU mirror site.  (If you are using the official distribution of
7389 *** PostgreSQL then you do not need to worry about this because the Flex
7390 *** output is pre-generated.)" >&2;}
7391
7392   FLEX=
7393 else
7394   FLEX=$pgac_cv_path_flex
7395   pgac_flex_version=`$FLEX --version 2>/dev/null`
7396   { $as_echo "$as_me:${as_lineno-$LINENO}: using $pgac_flex_version" >&5
7397 $as_echo "$as_me: using $pgac_flex_version" >&6;}
7398 fi
7399
7400
7401
7402
7403
7404 # Let the user override the search
7405 if test -z "$PERL"; then
7406   # Extract the first word of "perl", so it can be a program name with args.
7407 set dummy perl; ac_word=$2
7408 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7409 $as_echo_n "checking for $ac_word... " >&6; }
7410 if ${ac_cv_path_PERL+:} false; then :
7411   $as_echo_n "(cached) " >&6
7412 else
7413   case $PERL in
7414   [\\/]* | ?:[\\/]*)
7415   ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
7416   ;;
7417   *)
7418   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7419 for as_dir in $PATH
7420 do
7421   IFS=$as_save_IFS
7422   test -z "$as_dir" && as_dir=.
7423     for ac_exec_ext in '' $ac_executable_extensions; do
7424   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7425     ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
7426     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7427     break 2
7428   fi
7429 done
7430   done
7431 IFS=$as_save_IFS
7432
7433   ;;
7434 esac
7435 fi
7436 PERL=$ac_cv_path_PERL
7437 if test -n "$PERL"; then
7438   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
7439 $as_echo "$PERL" >&6; }
7440 else
7441   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7442 $as_echo "no" >&6; }
7443 fi
7444
7445
7446 fi
7447
7448 if test "$PERL"; then
7449   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'`
7450   { $as_echo "$as_me:${as_lineno-$LINENO}: using perl $pgac_perl_version" >&5
7451 $as_echo "$as_me: using perl $pgac_perl_version" >&6;}
7452   if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \
7453     $AWK '{ if ($1 == 5 && $2 >= 8) exit 1; else exit 0;}'
7454   then
7455     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7456 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
7457 *** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&5
7458 $as_echo "$as_me: WARNING:
7459 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
7460 *** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&2;}
7461     PERL=""
7462   fi
7463 fi
7464
7465 if test -z "$PERL"; then
7466   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7467 *** Without Perl you will not be able to build PostgreSQL from Git.
7468 *** You can obtain Perl from any CPAN mirror site.
7469 *** (If you are using the official distribution of PostgreSQL then you do not
7470 *** need to worry about this, because the Perl output is pre-generated.)" >&5
7471 $as_echo "$as_me: WARNING:
7472 *** Without Perl you will not be able to build PostgreSQL from Git.
7473 *** You can obtain Perl from any CPAN mirror site.
7474 *** (If you are using the official distribution of PostgreSQL then you do not
7475 *** need to worry about this, because the Perl output is pre-generated.)" >&2;}
7476 fi
7477
7478 if test "$with_perl" = yes; then
7479   if test -z "$PERL"; then
7480     as_fn_error $? "Perl not found" "$LINENO" 5
7481   fi
7482
7483 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl archlibexp" >&5
7484 $as_echo_n "checking for Perl archlibexp... " >&6; }
7485 perl_archlibexp=`$PERL -MConfig -e 'print $Config{archlibexp}'`
7486 test "$PORTNAME" = "win32" && perl_archlibexp=`echo $perl_archlibexp | sed 's,\\\\,/,g'`
7487 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_archlibexp" >&5
7488 $as_echo "$perl_archlibexp" >&6; }
7489 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl privlibexp" >&5
7490 $as_echo_n "checking for Perl privlibexp... " >&6; }
7491 perl_privlibexp=`$PERL -MConfig -e 'print $Config{privlibexp}'`
7492 test "$PORTNAME" = "win32" && perl_privlibexp=`echo $perl_privlibexp | sed 's,\\\\,/,g'`
7493 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_privlibexp" >&5
7494 $as_echo "$perl_privlibexp" >&6; }
7495 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl useshrplib" >&5
7496 $as_echo_n "checking for Perl useshrplib... " >&6; }
7497 perl_useshrplib=`$PERL -MConfig -e 'print $Config{useshrplib}'`
7498 test "$PORTNAME" = "win32" && perl_useshrplib=`echo $perl_useshrplib | sed 's,\\\\,/,g'`
7499 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_useshrplib" >&5
7500 $as_echo "$perl_useshrplib" >&6; }
7501   if test "$perl_useshrplib" != yes && test "$perl_useshrplib" != true; then
7502     as_fn_error $? "cannot build PL/Perl because libperl is not a shared library
7503 You might have to rebuild your Perl installation.  Refer to the
7504 documentation for details.  Use --without-perl to disable building
7505 PL/Perl." "$LINENO" 5
7506   fi
7507
7508 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flags to link embedded Perl" >&5
7509 $as_echo_n "checking for flags to link embedded Perl... " >&6; }
7510 if test "$PORTNAME" = "win32" ; then
7511 perl_lib=`basename $perl_archlibexp/CORE/perl[5-9]*.lib .lib`
7512 test -e "$perl_archlibexp/CORE/$perl_lib.lib" && perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
7513 else
7514 pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
7515 pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
7516 perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e "s/ -arch [-a-zA-Z0-9_]*//g"`
7517 fi
7518 if test -z "$perl_embed_ldflags" ; then
7519         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7520 $as_echo "no" >&6; }
7521         as_fn_error $? "could not determine flags for linking embedded Perl.
7522 This probably means that ExtUtils::Embed or ExtUtils::MakeMaker is not
7523 installed." "$LINENO" 5
7524 else
7525         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_embed_ldflags" >&5
7526 $as_echo "$perl_embed_ldflags" >&6; }
7527 fi
7528
7529 fi
7530
7531 if test "$with_python" = yes; then
7532   # Extract the first word of "python", so it can be a program name with args.
7533 set dummy python; ac_word=$2
7534 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7535 $as_echo_n "checking for $ac_word... " >&6; }
7536 if ${ac_cv_path_PYTHON+:} false; then :
7537   $as_echo_n "(cached) " >&6
7538 else
7539   case $PYTHON in
7540   [\\/]* | ?:[\\/]*)
7541   ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
7542   ;;
7543   *)
7544   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7545 for as_dir in $PATH
7546 do
7547   IFS=$as_save_IFS
7548   test -z "$as_dir" && as_dir=.
7549     for ac_exec_ext in '' $ac_executable_extensions; do
7550   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7551     ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
7552     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7553     break 2
7554   fi
7555 done
7556   done
7557 IFS=$as_save_IFS
7558
7559   ;;
7560 esac
7561 fi
7562 PYTHON=$ac_cv_path_PYTHON
7563 if test -n "$PYTHON"; then
7564   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
7565 $as_echo "$PYTHON" >&6; }
7566 else
7567   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7568 $as_echo "no" >&6; }
7569 fi
7570
7571
7572 if test x"$PYTHON" = x""; then
7573   as_fn_error $? "Python not found" "$LINENO" 5
7574 fi
7575
7576
7577 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python distutils module" >&5
7578 $as_echo_n "checking for Python distutils module... " >&6; }
7579 if "${PYTHON}" -c 'import distutils' 2>&5
7580 then
7581     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7582 $as_echo "yes" >&6; }
7583 else
7584     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7585 $as_echo "no" >&6; }
7586     as_fn_error $? "distutils module not found" "$LINENO" 5
7587 fi
7588 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python configuration directory" >&5
7589 $as_echo_n "checking Python configuration directory... " >&6; }
7590 python_majorversion=`${PYTHON} -c "import sys; print(sys.version[0])"`
7591 python_version=`${PYTHON} -c "import sys; print(sys.version[:3])"`
7592 python_configdir=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBPL'))))"`
7593 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $python_configdir" >&5
7594 $as_echo "$python_configdir" >&6; }
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 pwd.h sys/epoll.h sys/ioctl.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/socket.h sys/sockio.h sys/tas.h sys/time.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 #ifdef HAVE_SYS_SOCKET_H
10355 #include <sys/socket.h>
10356 #endif
10357
10358 "
10359 if test "x$ac_cv_header_net_if_h" = xyes; then :
10360   cat >>confdefs.h <<_ACEOF
10361 #define HAVE_NET_IF_H 1
10362 _ACEOF
10363
10364 fi
10365
10366 done
10367
10368
10369 # On OpenBSD, test for sys/ucred.h will fail unless sys/param.h
10370 # is included first.
10371 for ac_header in sys/ucred.h
10372 do :
10373   ac_fn_c_check_header_compile "$LINENO" "sys/ucred.h" "ac_cv_header_sys_ucred_h" "$ac_includes_default
10374 #include <sys/param.h>
10375
10376 "
10377 if test "x$ac_cv_header_sys_ucred_h" = xyes; then :
10378   cat >>confdefs.h <<_ACEOF
10379 #define HAVE_SYS_UCRED_H 1
10380 _ACEOF
10381
10382 fi
10383
10384 done
10385
10386
10387 # At least on IRIX, test for netinet/tcp.h will fail unless
10388 # netinet/in.h is included first.
10389 for ac_header in netinet/in.h
10390 do :
10391   ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
10392 if test "x$ac_cv_header_netinet_in_h" = xyes; then :
10393   cat >>confdefs.h <<_ACEOF
10394 #define HAVE_NETINET_IN_H 1
10395 _ACEOF
10396
10397 fi
10398
10399 done
10400
10401 for ac_header in netinet/tcp.h
10402 do :
10403   ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default
10404 #ifdef HAVE_NETINET_IN_H
10405 #include <netinet/in.h>
10406 #endif
10407
10408 "
10409 if test "x$ac_cv_header_netinet_tcp_h" = xyes; then :
10410   cat >>confdefs.h <<_ACEOF
10411 #define HAVE_NETINET_TCP_H 1
10412 _ACEOF
10413
10414 fi
10415
10416 done
10417
10418
10419 if expr x"$pgac_cv_check_readline" : 'x-lreadline' >/dev/null ; then
10420   for ac_header in readline/readline.h
10421 do :
10422   ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
10423 if test "x$ac_cv_header_readline_readline_h" = xyes; then :
10424   cat >>confdefs.h <<_ACEOF
10425 #define HAVE_READLINE_READLINE_H 1
10426 _ACEOF
10427
10428 else
10429   for ac_header in readline.h
10430 do :
10431   ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
10432 if test "x$ac_cv_header_readline_h" = xyes; then :
10433   cat >>confdefs.h <<_ACEOF
10434 #define HAVE_READLINE_H 1
10435 _ACEOF
10436
10437 else
10438   as_fn_error $? "readline header not found
10439 If you have readline already installed, see config.log for details on the
10440 failure.  It is possible the compiler isn't looking in the proper directory.
10441 Use --without-readline to disable readline support." "$LINENO" 5
10442 fi
10443
10444 done
10445
10446 fi
10447
10448 done
10449
10450   for ac_header in readline/history.h
10451 do :
10452   ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
10453 if test "x$ac_cv_header_readline_history_h" = xyes; then :
10454   cat >>confdefs.h <<_ACEOF
10455 #define HAVE_READLINE_HISTORY_H 1
10456 _ACEOF
10457
10458 else
10459   for ac_header in history.h
10460 do :
10461   ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
10462 if test "x$ac_cv_header_history_h" = xyes; then :
10463   cat >>confdefs.h <<_ACEOF
10464 #define HAVE_HISTORY_H 1
10465 _ACEOF
10466
10467 else
10468   as_fn_error $? "history header not found
10469 If you have readline already installed, see config.log for details on the
10470 failure.  It is possible the compiler isn't looking in the proper directory.
10471 Use --without-readline to disable readline support." "$LINENO" 5
10472 fi
10473
10474 done
10475
10476 fi
10477
10478 done
10479
10480 fi
10481
10482 if expr x"$pgac_cv_check_readline" : 'x-ledit' >/dev/null ; then
10483 # Some installations of libedit usurp /usr/include/readline/, which seems
10484 # bad practice, since in combined installations readline will have its headers
10485 # there.  We might have to resort to AC_EGREP checks to make sure we found
10486 # the proper header...
10487   for ac_header in editline/readline.h
10488 do :
10489   ac_fn_c_check_header_mongrel "$LINENO" "editline/readline.h" "ac_cv_header_editline_readline_h" "$ac_includes_default"
10490 if test "x$ac_cv_header_editline_readline_h" = xyes; then :
10491   cat >>confdefs.h <<_ACEOF
10492 #define HAVE_EDITLINE_READLINE_H 1
10493 _ACEOF
10494
10495 else
10496   for ac_header in readline.h
10497 do :
10498   ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
10499 if test "x$ac_cv_header_readline_h" = xyes; then :
10500   cat >>confdefs.h <<_ACEOF
10501 #define HAVE_READLINE_H 1
10502 _ACEOF
10503
10504 else
10505   for ac_header in readline/readline.h
10506 do :
10507   ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
10508 if test "x$ac_cv_header_readline_readline_h" = xyes; then :
10509   cat >>confdefs.h <<_ACEOF
10510 #define HAVE_READLINE_READLINE_H 1
10511 _ACEOF
10512
10513 else
10514   as_fn_error $? "readline header not found
10515 If you have libedit already installed, see config.log for details on the
10516 failure.  It is possible the compiler isn't looking in the proper directory.
10517 Use --without-readline to disable libedit support." "$LINENO" 5
10518 fi
10519
10520 done
10521
10522 fi
10523
10524 done
10525
10526 fi
10527
10528 done
10529
10530 # Note: in a libedit installation, history.h is sometimes a dummy, and may
10531 # not be there at all.  Hence, don't complain if not found.  We must check
10532 # though, since in yet other versions it is an independent header.
10533   for ac_header in editline/history.h
10534 do :
10535   ac_fn_c_check_header_mongrel "$LINENO" "editline/history.h" "ac_cv_header_editline_history_h" "$ac_includes_default"
10536 if test "x$ac_cv_header_editline_history_h" = xyes; then :
10537   cat >>confdefs.h <<_ACEOF
10538 #define HAVE_EDITLINE_HISTORY_H 1
10539 _ACEOF
10540
10541 else
10542   for ac_header in history.h
10543 do :
10544   ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
10545 if test "x$ac_cv_header_history_h" = xyes; then :
10546   cat >>confdefs.h <<_ACEOF
10547 #define HAVE_HISTORY_H 1
10548 _ACEOF
10549
10550 else
10551   for ac_header in readline/history.h
10552 do :
10553   ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
10554 if test "x$ac_cv_header_readline_history_h" = xyes; then :
10555   cat >>confdefs.h <<_ACEOF
10556 #define HAVE_READLINE_HISTORY_H 1
10557 _ACEOF
10558
10559 fi
10560
10561 done
10562
10563 fi
10564
10565 done
10566
10567 fi
10568
10569 done
10570
10571 fi
10572
10573 if test "$with_zlib" = yes; then
10574   ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
10575 if test "x$ac_cv_header_zlib_h" = xyes; then :
10576
10577 else
10578   as_fn_error $? "zlib header not found
10579 If you have zlib already installed, see config.log for details on the
10580 failure.  It is possible the compiler isn't looking in the proper directory.
10581 Use --without-zlib to disable zlib support." "$LINENO" 5
10582 fi
10583
10584
10585 fi
10586
10587 if test "$with_gssapi" = yes ; then
10588   for ac_header in gssapi/gssapi.h
10589 do :
10590   ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default"
10591 if test "x$ac_cv_header_gssapi_gssapi_h" = xyes; then :
10592   cat >>confdefs.h <<_ACEOF
10593 #define HAVE_GSSAPI_GSSAPI_H 1
10594 _ACEOF
10595
10596 else
10597   for ac_header in gssapi.h
10598 do :
10599   ac_fn_c_check_header_mongrel "$LINENO" "gssapi.h" "ac_cv_header_gssapi_h" "$ac_includes_default"
10600 if test "x$ac_cv_header_gssapi_h" = xyes; then :
10601   cat >>confdefs.h <<_ACEOF
10602 #define HAVE_GSSAPI_H 1
10603 _ACEOF
10604
10605 else
10606   as_fn_error $? "gssapi.h header file is required for GSSAPI" "$LINENO" 5
10607 fi
10608
10609 done
10610
10611 fi
10612
10613 done
10614
10615 fi
10616
10617 if test "$with_openssl" = yes ; then
10618   ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default"
10619 if test "x$ac_cv_header_openssl_ssl_h" = xyes; then :
10620
10621 else
10622   as_fn_error $? "header file <openssl/ssl.h> is required for OpenSSL" "$LINENO" 5
10623 fi
10624
10625
10626   ac_fn_c_check_header_mongrel "$LINENO" "openssl/err.h" "ac_cv_header_openssl_err_h" "$ac_includes_default"
10627 if test "x$ac_cv_header_openssl_err_h" = xyes; then :
10628
10629 else
10630   as_fn_error $? "header file <openssl/err.h> is required for OpenSSL" "$LINENO" 5
10631 fi
10632
10633
10634 fi
10635
10636 if test "$with_pam" = yes ; then
10637   for ac_header in security/pam_appl.h
10638 do :
10639   ac_fn_c_check_header_mongrel "$LINENO" "security/pam_appl.h" "ac_cv_header_security_pam_appl_h" "$ac_includes_default"
10640 if test "x$ac_cv_header_security_pam_appl_h" = xyes; then :
10641   cat >>confdefs.h <<_ACEOF
10642 #define HAVE_SECURITY_PAM_APPL_H 1
10643 _ACEOF
10644
10645 else
10646   for ac_header in pam/pam_appl.h
10647 do :
10648   ac_fn_c_check_header_mongrel "$LINENO" "pam/pam_appl.h" "ac_cv_header_pam_pam_appl_h" "$ac_includes_default"
10649 if test "x$ac_cv_header_pam_pam_appl_h" = xyes; then :
10650   cat >>confdefs.h <<_ACEOF
10651 #define HAVE_PAM_PAM_APPL_H 1
10652 _ACEOF
10653
10654 else
10655   as_fn_error $? "header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM." "$LINENO" 5
10656 fi
10657
10658 done
10659
10660 fi
10661
10662 done
10663
10664 fi
10665
10666 if test "$with_bsd_auth" = yes ; then
10667   ac_fn_c_check_header_mongrel "$LINENO" "bsd_auth.h" "ac_cv_header_bsd_auth_h" "$ac_includes_default"
10668 if test "x$ac_cv_header_bsd_auth_h" = xyes; then :
10669
10670 else
10671   as_fn_error $? "header file <bsd_auth.h> is required for BSD Authentication support" "$LINENO" 5
10672 fi
10673
10674
10675 fi
10676
10677 if test "$with_systemd" = yes ; then
10678   ac_fn_c_check_header_mongrel "$LINENO" "systemd/sd-daemon.h" "ac_cv_header_systemd_sd_daemon_h" "$ac_includes_default"
10679 if test "x$ac_cv_header_systemd_sd_daemon_h" = xyes; then :
10680
10681 else
10682   as_fn_error $? "header file <systemd/sd-daemon.h> is required for systemd support" "$LINENO" 5
10683 fi
10684
10685
10686 fi
10687
10688 if test "$with_libxml" = yes ; then
10689   ac_fn_c_check_header_mongrel "$LINENO" "libxml/parser.h" "ac_cv_header_libxml_parser_h" "$ac_includes_default"
10690 if test "x$ac_cv_header_libxml_parser_h" = xyes; then :
10691
10692 else
10693   as_fn_error $? "header file <libxml/parser.h> is required for XML support" "$LINENO" 5
10694 fi
10695
10696
10697 fi
10698
10699 if test "$with_libxslt" = yes ; then
10700   ac_fn_c_check_header_mongrel "$LINENO" "libxslt/xslt.h" "ac_cv_header_libxslt_xslt_h" "$ac_includes_default"
10701 if test "x$ac_cv_header_libxslt_xslt_h" = xyes; then :
10702
10703 else
10704   as_fn_error $? "header file <libxslt/xslt.h> is required for XSLT support" "$LINENO" 5
10705 fi
10706
10707
10708 fi
10709
10710 if test "$with_ldap" = yes ; then
10711   if test "$PORTNAME" != "win32"; then
10712      for ac_header in ldap.h
10713 do :
10714   ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default"
10715 if test "x$ac_cv_header_ldap_h" = xyes; then :
10716   cat >>confdefs.h <<_ACEOF
10717 #define HAVE_LDAP_H 1
10718 _ACEOF
10719
10720 else
10721   as_fn_error $? "header file <ldap.h> is required for LDAP" "$LINENO" 5
10722 fi
10723
10724 done
10725
10726      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compatible LDAP implementation" >&5
10727 $as_echo_n "checking for compatible LDAP implementation... " >&6; }
10728 if ${pgac_cv_ldap_safe+:} false; then :
10729   $as_echo_n "(cached) " >&6
10730 else
10731   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10732 /* end confdefs.h.  */
10733 #include <ldap.h>
10734 #if !defined(LDAP_VENDOR_VERSION) || \
10735      (defined(LDAP_API_FEATURE_X_OPENLDAP) && \
10736       LDAP_VENDOR_VERSION >= 20424 && LDAP_VENDOR_VERSION <= 20431)
10737 choke me
10738 #endif
10739 int
10740 main ()
10741 {
10742
10743   ;
10744   return 0;
10745 }
10746 _ACEOF
10747 if ac_fn_c_try_compile "$LINENO"; then :
10748   pgac_cv_ldap_safe=yes
10749 else
10750   pgac_cv_ldap_safe=no
10751 fi
10752 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10753 fi
10754 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_ldap_safe" >&5
10755 $as_echo "$pgac_cv_ldap_safe" >&6; }
10756
10757 if test "$pgac_cv_ldap_safe" != yes; then
10758   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
10759 *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
10760 *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
10761 *** also uses LDAP will crash on exit." >&5
10762 $as_echo "$as_me: WARNING:
10763 *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
10764 *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
10765 *** also uses LDAP will crash on exit." >&2;}
10766 fi
10767   else
10768      for ac_header in winldap.h
10769 do :
10770   ac_fn_c_check_header_compile "$LINENO" "winldap.h" "ac_cv_header_winldap_h" "$ac_includes_default
10771 #include <windows.h>
10772
10773 "
10774 if test "x$ac_cv_header_winldap_h" = xyes; then :
10775   cat >>confdefs.h <<_ACEOF
10776 #define HAVE_WINLDAP_H 1
10777 _ACEOF
10778
10779 else
10780   as_fn_error $? "header file <winldap.h> is required for LDAP" "$LINENO" 5
10781 fi
10782
10783 done
10784
10785   fi
10786 fi
10787
10788 if test "$with_bonjour" = yes ; then
10789   ac_fn_c_check_header_mongrel "$LINENO" "dns_sd.h" "ac_cv_header_dns_sd_h" "$ac_includes_default"
10790 if test "x$ac_cv_header_dns_sd_h" = xyes; then :
10791
10792 else
10793   as_fn_error $? "header file <dns_sd.h> is required for Bonjour" "$LINENO" 5
10794 fi
10795
10796
10797 fi
10798
10799 # for contrib/uuid-ossp
10800 if test "$with_uuid" = bsd ; then
10801   for ac_header in uuid.h
10802 do :
10803   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
10804 if test "x$ac_cv_header_uuid_h" = xyes; then :
10805   cat >>confdefs.h <<_ACEOF
10806 #define HAVE_UUID_H 1
10807 _ACEOF
10808  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10809 /* end confdefs.h.  */
10810 #include <uuid.h>
10811
10812 _ACEOF
10813 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10814   $EGREP "uuid_to_string" >/dev/null 2>&1; then :
10815
10816 else
10817   as_fn_error $? "header file <uuid.h> does not match BSD UUID library" "$LINENO" 5
10818 fi
10819 rm -f conftest*
10820
10821 else
10822   as_fn_error $? "header file <uuid.h> is required for BSD UUID" "$LINENO" 5
10823 fi
10824
10825 done
10826
10827 elif test "$with_uuid" = e2fs ; then
10828   for ac_header in uuid/uuid.h
10829 do :
10830   ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
10831 if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
10832   cat >>confdefs.h <<_ACEOF
10833 #define HAVE_UUID_UUID_H 1
10834 _ACEOF
10835  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10836 /* end confdefs.h.  */
10837 #include <uuid/uuid.h>
10838
10839 _ACEOF
10840 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10841   $EGREP "uuid_generate" >/dev/null 2>&1; then :
10842
10843 else
10844   as_fn_error $? "header file <uuid/uuid.h> does not match E2FS UUID library" "$LINENO" 5
10845 fi
10846 rm -f conftest*
10847
10848 else
10849   for ac_header in uuid.h
10850 do :
10851   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
10852 if test "x$ac_cv_header_uuid_h" = xyes; then :
10853   cat >>confdefs.h <<_ACEOF
10854 #define HAVE_UUID_H 1
10855 _ACEOF
10856  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10857 /* end confdefs.h.  */
10858 #include <uuid.h>
10859
10860 _ACEOF
10861 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10862   $EGREP "uuid_generate" >/dev/null 2>&1; then :
10863
10864 else
10865   as_fn_error $? "header file <uuid.h> does not match E2FS UUID library" "$LINENO" 5
10866 fi
10867 rm -f conftest*
10868
10869 else
10870   as_fn_error $? "header file <uuid/uuid.h> or <uuid.h> is required for E2FS UUID" "$LINENO" 5
10871 fi
10872
10873 done
10874
10875 fi
10876
10877 done
10878
10879 elif test "$with_uuid" = ossp ; then
10880   for ac_header in ossp/uuid.h
10881 do :
10882   ac_fn_c_check_header_mongrel "$LINENO" "ossp/uuid.h" "ac_cv_header_ossp_uuid_h" "$ac_includes_default"
10883 if test "x$ac_cv_header_ossp_uuid_h" = xyes; then :
10884   cat >>confdefs.h <<_ACEOF
10885 #define HAVE_OSSP_UUID_H 1
10886 _ACEOF
10887  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10888 /* end confdefs.h.  */
10889 #include <ossp/uuid.h>
10890
10891 _ACEOF
10892 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10893   $EGREP "uuid_export" >/dev/null 2>&1; then :
10894
10895 else
10896   as_fn_error $? "header file <ossp/uuid.h> does not match OSSP UUID library" "$LINENO" 5
10897 fi
10898 rm -f conftest*
10899
10900 else
10901   for ac_header in uuid.h
10902 do :
10903   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
10904 if test "x$ac_cv_header_uuid_h" = xyes; then :
10905   cat >>confdefs.h <<_ACEOF
10906 #define HAVE_UUID_H 1
10907 _ACEOF
10908  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10909 /* end confdefs.h.  */
10910 #include <uuid.h>
10911
10912 _ACEOF
10913 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10914   $EGREP "uuid_export" >/dev/null 2>&1; then :
10915
10916 else
10917   as_fn_error $? "header file <uuid.h> does not match OSSP UUID library" "$LINENO" 5
10918 fi
10919 rm -f conftest*
10920
10921 else
10922   as_fn_error $? "header file <ossp/uuid.h> or <uuid.h> is required for OSSP UUID" "$LINENO" 5
10923 fi
10924
10925 done
10926
10927 fi
10928
10929 done
10930
10931 fi
10932
10933 if test "$PORTNAME" = "win32" ; then
10934    for ac_header in crtdefs.h
10935 do :
10936   ac_fn_c_check_header_mongrel "$LINENO" "crtdefs.h" "ac_cv_header_crtdefs_h" "$ac_includes_default"
10937 if test "x$ac_cv_header_crtdefs_h" = xyes; then :
10938   cat >>confdefs.h <<_ACEOF
10939 #define HAVE_CRTDEFS_H 1
10940 _ACEOF
10941
10942 fi
10943
10944 done
10945
10946 fi
10947
10948 ##
10949 ## Types, structures, compiler characteristics
10950 ##
10951
10952   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
10953 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
10954 if ${ac_cv_c_bigendian+:} false; then :
10955   $as_echo_n "(cached) " >&6
10956 else
10957   ac_cv_c_bigendian=unknown
10958     # See if we're dealing with a universal compiler.
10959     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10960 /* end confdefs.h.  */
10961 #ifndef __APPLE_CC__
10962                not a universal capable compiler
10963              #endif
10964              typedef int dummy;
10965
10966 _ACEOF
10967 if ac_fn_c_try_compile "$LINENO"; then :
10968
10969         # Check for potential -arch flags.  It is not universal unless
10970         # there are at least two -arch flags with different values.
10971         ac_arch=
10972         ac_prev=
10973         for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
10974          if test -n "$ac_prev"; then
10975            case $ac_word in
10976              i?86 | x86_64 | ppc | ppc64)
10977                if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
10978                  ac_arch=$ac_word
10979                else
10980                  ac_cv_c_bigendian=universal
10981                  break
10982                fi
10983                ;;
10984            esac
10985            ac_prev=
10986          elif test "x$ac_word" = "x-arch"; then
10987            ac_prev=arch
10988          fi
10989        done
10990 fi
10991 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10992     if test $ac_cv_c_bigendian = unknown; then
10993       # See if sys/param.h defines the BYTE_ORDER macro.
10994       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10995 /* end confdefs.h.  */
10996 #include <sys/types.h>
10997              #include <sys/param.h>
10998
10999 int
11000 main ()
11001 {
11002 #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
11003                      && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
11004                      && LITTLE_ENDIAN)
11005               bogus endian macros
11006              #endif
11007
11008   ;
11009   return 0;
11010 }
11011 _ACEOF
11012 if ac_fn_c_try_compile "$LINENO"; then :
11013   # It does; now see whether it defined to BIG_ENDIAN or not.
11014          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11015 /* end confdefs.h.  */
11016 #include <sys/types.h>
11017                 #include <sys/param.h>
11018
11019 int
11020 main ()
11021 {
11022 #if BYTE_ORDER != BIG_ENDIAN
11023                  not big endian
11024                 #endif
11025
11026   ;
11027   return 0;
11028 }
11029 _ACEOF
11030 if ac_fn_c_try_compile "$LINENO"; then :
11031   ac_cv_c_bigendian=yes
11032 else
11033   ac_cv_c_bigendian=no
11034 fi
11035 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11036 fi
11037 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11038     fi
11039     if test $ac_cv_c_bigendian = unknown; then
11040       # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
11041       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11042 /* end confdefs.h.  */
11043 #include <limits.h>
11044
11045 int
11046 main ()
11047 {
11048 #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
11049               bogus endian macros
11050              #endif
11051
11052   ;
11053   return 0;
11054 }
11055 _ACEOF
11056 if ac_fn_c_try_compile "$LINENO"; then :
11057   # It does; now see whether it defined to _BIG_ENDIAN or not.
11058          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11059 /* end confdefs.h.  */
11060 #include <limits.h>
11061
11062 int
11063 main ()
11064 {
11065 #ifndef _BIG_ENDIAN
11066                  not big endian
11067                 #endif
11068
11069   ;
11070   return 0;
11071 }
11072 _ACEOF
11073 if ac_fn_c_try_compile "$LINENO"; then :
11074   ac_cv_c_bigendian=yes
11075 else
11076   ac_cv_c_bigendian=no
11077 fi
11078 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11079 fi
11080 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11081     fi
11082     if test $ac_cv_c_bigendian = unknown; then
11083       # Compile a test program.
11084       if test "$cross_compiling" = yes; then :
11085   # Try to guess by grepping values from an object file.
11086          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11087 /* end confdefs.h.  */
11088 short int ascii_mm[] =
11089                   { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
11090                 short int ascii_ii[] =
11091                   { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
11092                 int use_ascii (int i) {
11093                   return ascii_mm[i] + ascii_ii[i];
11094                 }
11095                 short int ebcdic_ii[] =
11096                   { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
11097                 short int ebcdic_mm[] =
11098                   { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
11099                 int use_ebcdic (int i) {
11100                   return ebcdic_mm[i] + ebcdic_ii[i];
11101                 }
11102                 extern int foo;
11103
11104 int
11105 main ()
11106 {
11107 return use_ascii (foo) == use_ebcdic (foo);
11108   ;
11109   return 0;
11110 }
11111 _ACEOF
11112 if ac_fn_c_try_compile "$LINENO"; then :
11113   if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
11114               ac_cv_c_bigendian=yes
11115             fi
11116             if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
11117               if test "$ac_cv_c_bigendian" = unknown; then
11118                 ac_cv_c_bigendian=no
11119               else
11120                 # finding both strings is unlikely to happen, but who knows?
11121                 ac_cv_c_bigendian=unknown
11122               fi
11123             fi
11124 fi
11125 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11126 else
11127   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11128 /* end confdefs.h.  */
11129 $ac_includes_default
11130 int
11131 main ()
11132 {
11133
11134              /* Are we little or big endian?  From Harbison&Steele.  */
11135              union
11136              {
11137                long int l;
11138                char c[sizeof (long int)];
11139              } u;
11140              u.l = 1;
11141              return u.c[sizeof (long int) - 1] == 1;
11142
11143   ;
11144   return 0;
11145 }
11146 _ACEOF
11147 if ac_fn_c_try_run "$LINENO"; then :
11148   ac_cv_c_bigendian=no
11149 else
11150   ac_cv_c_bigendian=yes
11151 fi
11152 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11153   conftest.$ac_objext conftest.beam conftest.$ac_ext
11154 fi
11155
11156     fi
11157 fi
11158 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
11159 $as_echo "$ac_cv_c_bigendian" >&6; }
11160  case $ac_cv_c_bigendian in #(
11161    yes)
11162      $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
11163 ;; #(
11164    no)
11165       ;; #(
11166    universal)
11167
11168 $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
11169
11170      ;; #(
11171    *)
11172      as_fn_error $? "unknown endianness
11173  presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
11174  esac
11175
11176 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
11177 $as_echo_n "checking for inline... " >&6; }
11178 if ${ac_cv_c_inline+:} false; then :
11179   $as_echo_n "(cached) " >&6
11180 else
11181   ac_cv_c_inline=no
11182 for ac_kw in inline __inline__ __inline; do
11183   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11184 /* end confdefs.h.  */
11185 #ifndef __cplusplus
11186 typedef int foo_t;
11187 static $ac_kw foo_t static_foo () {return 0; }
11188 $ac_kw foo_t foo () {return 0; }
11189 #endif
11190
11191 _ACEOF
11192 if ac_fn_c_try_compile "$LINENO"; then :
11193   ac_cv_c_inline=$ac_kw
11194 fi
11195 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11196   test "$ac_cv_c_inline" != no && break
11197 done
11198
11199 fi
11200 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
11201 $as_echo "$ac_cv_c_inline" >&6; }
11202
11203 case $ac_cv_c_inline in
11204   inline | yes) ;;
11205   *)
11206     case $ac_cv_c_inline in
11207       no) ac_val=;;
11208       *) ac_val=$ac_cv_c_inline;;
11209     esac
11210     cat >>confdefs.h <<_ACEOF
11211 #ifndef __cplusplus
11212 #define inline $ac_val
11213 #endif
11214 _ACEOF
11215     ;;
11216 esac
11217
11218 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf format archetype" >&5
11219 $as_echo_n "checking for printf format archetype... " >&6; }
11220 if ${pgac_cv_printf_archetype+:} false; then :
11221   $as_echo_n "(cached) " >&6
11222 else
11223   ac_save_c_werror_flag=$ac_c_werror_flag
11224 ac_c_werror_flag=yes
11225 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11226 /* end confdefs.h.  */
11227 extern int
11228 pgac_write(int ignore, const char *fmt,...)
11229 __attribute__((format(gnu_printf, 2, 3)));
11230 int
11231 main ()
11232 {
11233
11234   ;
11235   return 0;
11236 }
11237 _ACEOF
11238 if ac_fn_c_try_compile "$LINENO"; then :
11239   pgac_cv_printf_archetype=gnu_printf
11240 else
11241   pgac_cv_printf_archetype=printf
11242 fi
11243 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11244 ac_c_werror_flag=$ac_save_c_werror_flag
11245 fi
11246 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_printf_archetype" >&5
11247 $as_echo "$pgac_cv_printf_archetype" >&6; }
11248
11249 cat >>confdefs.h <<_ACEOF
11250 #define PG_PRINTF_ATTRIBUTE $pgac_cv_printf_archetype
11251 _ACEOF
11252
11253
11254
11255   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array members" >&5
11256 $as_echo_n "checking for flexible array members... " >&6; }
11257 if ${ac_cv_c_flexmember+:} false; then :
11258   $as_echo_n "(cached) " >&6
11259 else
11260   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11261 /* end confdefs.h.  */
11262 #include <stdlib.h>
11263             #include <stdio.h>
11264             #include <stddef.h>
11265             struct s { int n; double d[]; };
11266 int
11267 main ()
11268 {
11269 int m = getchar ();
11270             struct s *p = malloc (offsetof (struct s, d)
11271                                   + m * sizeof (double));
11272             p->d[0] = 0.0;
11273             return p->d != (double *) NULL;
11274   ;
11275   return 0;
11276 }
11277 _ACEOF
11278 if ac_fn_c_try_compile "$LINENO"; then :
11279   ac_cv_c_flexmember=yes
11280 else
11281   ac_cv_c_flexmember=no
11282 fi
11283 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11284 fi
11285 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
11286 $as_echo "$ac_cv_c_flexmember" >&6; }
11287   if test $ac_cv_c_flexmember = yes; then
11288
11289 $as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
11290
11291   else
11292     $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
11293
11294   fi
11295
11296 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed types" >&5
11297 $as_echo_n "checking for signed types... " >&6; }
11298 if ${pgac_cv_c_signed+:} false; then :
11299   $as_echo_n "(cached) " >&6
11300 else
11301   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11302 /* end confdefs.h.  */
11303
11304 int
11305 main ()
11306 {
11307 signed char c; signed short s; signed int i;
11308   ;
11309   return 0;
11310 }
11311 _ACEOF
11312 if ac_fn_c_try_compile "$LINENO"; then :
11313   pgac_cv_c_signed=yes
11314 else
11315   pgac_cv_c_signed=no
11316 fi
11317 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11318 fi
11319 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_signed" >&5
11320 $as_echo "$pgac_cv_c_signed" >&6; }
11321 if test x"$pgac_cv_c_signed" = xno ; then
11322
11323 $as_echo "#define signed /**/" >>confdefs.h
11324
11325 fi
11326 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __func__" >&5
11327 $as_echo_n "checking for __func__... " >&6; }
11328 if ${pgac_cv_funcname_func_support+:} false; then :
11329   $as_echo_n "(cached) " >&6
11330 else
11331   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11332 /* end confdefs.h.  */
11333 #include <stdio.h>
11334 int
11335 main ()
11336 {
11337 printf("%s\n", __func__);
11338   ;
11339   return 0;
11340 }
11341 _ACEOF
11342 if ac_fn_c_try_compile "$LINENO"; then :
11343   pgac_cv_funcname_func_support=yes
11344 else
11345   pgac_cv_funcname_func_support=no
11346 fi
11347 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11348 fi
11349 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_func_support" >&5
11350 $as_echo "$pgac_cv_funcname_func_support" >&6; }
11351 if test x"$pgac_cv_funcname_func_support" = xyes ; then
11352
11353 $as_echo "#define HAVE_FUNCNAME__FUNC 1" >>confdefs.h
11354
11355 else
11356 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __FUNCTION__" >&5
11357 $as_echo_n "checking for __FUNCTION__... " >&6; }
11358 if ${pgac_cv_funcname_function_support+:} false; then :
11359   $as_echo_n "(cached) " >&6
11360 else
11361   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11362 /* end confdefs.h.  */
11363 #include <stdio.h>
11364 int
11365 main ()
11366 {
11367 printf("%s\n", __FUNCTION__);
11368   ;
11369   return 0;
11370 }
11371 _ACEOF
11372 if ac_fn_c_try_compile "$LINENO"; then :
11373   pgac_cv_funcname_function_support=yes
11374 else
11375   pgac_cv_funcname_function_support=no
11376 fi
11377 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11378 fi
11379 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_function_support" >&5
11380 $as_echo "$pgac_cv_funcname_function_support" >&6; }
11381 if test x"$pgac_cv_funcname_function_support" = xyes ; then
11382
11383 $as_echo "#define HAVE_FUNCNAME__FUNCTION 1" >>confdefs.h
11384
11385 fi
11386 fi
11387 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Static_assert" >&5
11388 $as_echo_n "checking for _Static_assert... " >&6; }
11389 if ${pgac_cv__static_assert+:} false; then :
11390   $as_echo_n "(cached) " >&6
11391 else
11392   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11393 /* end confdefs.h.  */
11394
11395 int
11396 main ()
11397 {
11398 ({ _Static_assert(1, "foo"); })
11399   ;
11400   return 0;
11401 }
11402 _ACEOF
11403 if ac_fn_c_try_link "$LINENO"; then :
11404   pgac_cv__static_assert=yes
11405 else
11406   pgac_cv__static_assert=no
11407 fi
11408 rm -f core conftest.err conftest.$ac_objext \
11409     conftest$ac_exeext conftest.$ac_ext
11410 fi
11411 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__static_assert" >&5
11412 $as_echo "$pgac_cv__static_assert" >&6; }
11413 if test x"$pgac_cv__static_assert" = xyes ; then
11414
11415 $as_echo "#define HAVE__STATIC_ASSERT 1" >>confdefs.h
11416
11417 fi
11418 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_types_compatible_p" >&5
11419 $as_echo_n "checking for __builtin_types_compatible_p... " >&6; }
11420 if ${pgac_cv__types_compatible+:} false; then :
11421   $as_echo_n "(cached) " >&6
11422 else
11423   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11424 /* end confdefs.h.  */
11425
11426 int
11427 main ()
11428 {
11429  int x; static int y[__builtin_types_compatible_p(__typeof__(x), int)];
11430   ;
11431   return 0;
11432 }
11433 _ACEOF
11434 if ac_fn_c_try_compile "$LINENO"; then :
11435   pgac_cv__types_compatible=yes
11436 else
11437   pgac_cv__types_compatible=no
11438 fi
11439 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11440 fi
11441 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__types_compatible" >&5
11442 $as_echo "$pgac_cv__types_compatible" >&6; }
11443 if test x"$pgac_cv__types_compatible" = xyes ; then
11444
11445 $as_echo "#define HAVE__BUILTIN_TYPES_COMPATIBLE_P 1" >>confdefs.h
11446
11447 fi
11448 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap32" >&5
11449 $as_echo_n "checking for __builtin_bswap32... " >&6; }
11450 if ${pgac_cv__builtin_bswap32+:} false; then :
11451   $as_echo_n "(cached) " >&6
11452 else
11453   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11454 /* end confdefs.h.  */
11455 static unsigned long int x = __builtin_bswap32(0xaabbccdd);
11456
11457 _ACEOF
11458 if ac_fn_c_try_compile "$LINENO"; then :
11459   pgac_cv__builtin_bswap32=yes
11460 else
11461   pgac_cv__builtin_bswap32=no
11462 fi
11463 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11464 fi
11465 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_bswap32" >&5
11466 $as_echo "$pgac_cv__builtin_bswap32" >&6; }
11467 if test x"$pgac_cv__builtin_bswap32" = xyes ; then
11468
11469 $as_echo "#define HAVE__BUILTIN_BSWAP32 1" >>confdefs.h
11470
11471 fi
11472 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap64" >&5
11473 $as_echo_n "checking for __builtin_bswap64... " >&6; }
11474 if ${pgac_cv__builtin_bswap64+:} false; then :
11475   $as_echo_n "(cached) " >&6
11476 else
11477   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11478 /* end confdefs.h.  */
11479 static unsigned long int x = __builtin_bswap64(0xaabbccddeeff0011);
11480
11481 _ACEOF
11482 if ac_fn_c_try_compile "$LINENO"; then :
11483   pgac_cv__builtin_bswap64=yes
11484 else
11485   pgac_cv__builtin_bswap64=no
11486 fi
11487 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11488 fi
11489 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_bswap64" >&5
11490 $as_echo "$pgac_cv__builtin_bswap64" >&6; }
11491 if test x"$pgac_cv__builtin_bswap64" = xyes ; then
11492
11493 $as_echo "#define HAVE__BUILTIN_BSWAP64 1" >>confdefs.h
11494
11495 fi
11496 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_constant_p" >&5
11497 $as_echo_n "checking for __builtin_constant_p... " >&6; }
11498 if ${pgac_cv__builtin_constant_p+:} false; then :
11499   $as_echo_n "(cached) " >&6
11500 else
11501   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11502 /* end confdefs.h.  */
11503 static int x; static int y[__builtin_constant_p(x) ? x : 1];
11504
11505 _ACEOF
11506 if ac_fn_c_try_compile "$LINENO"; then :
11507   pgac_cv__builtin_constant_p=yes
11508 else
11509   pgac_cv__builtin_constant_p=no
11510 fi
11511 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11512 fi
11513 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_constant_p" >&5
11514 $as_echo "$pgac_cv__builtin_constant_p" >&6; }
11515 if test x"$pgac_cv__builtin_constant_p" = xyes ; then
11516
11517 $as_echo "#define HAVE__BUILTIN_CONSTANT_P 1" >>confdefs.h
11518
11519 fi
11520 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_unreachable" >&5
11521 $as_echo_n "checking for __builtin_unreachable... " >&6; }
11522 if ${pgac_cv__builtin_unreachable+:} false; then :
11523   $as_echo_n "(cached) " >&6
11524 else
11525   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11526 /* end confdefs.h.  */
11527
11528 int
11529 main ()
11530 {
11531 __builtin_unreachable();
11532   ;
11533   return 0;
11534 }
11535 _ACEOF
11536 if ac_fn_c_try_link "$LINENO"; then :
11537   pgac_cv__builtin_unreachable=yes
11538 else
11539   pgac_cv__builtin_unreachable=no
11540 fi
11541 rm -f core conftest.err conftest.$ac_objext \
11542     conftest$ac_exeext conftest.$ac_ext
11543 fi
11544 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_unreachable" >&5
11545 $as_echo "$pgac_cv__builtin_unreachable" >&6; }
11546 if test x"$pgac_cv__builtin_unreachable" = xyes ; then
11547
11548 $as_echo "#define HAVE__BUILTIN_UNREACHABLE 1" >>confdefs.h
11549
11550 fi
11551 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __VA_ARGS__" >&5
11552 $as_echo_n "checking for __VA_ARGS__... " >&6; }
11553 if ${pgac_cv__va_args+:} false; then :
11554   $as_echo_n "(cached) " >&6
11555 else
11556   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11557 /* end confdefs.h.  */
11558 #include <stdio.h>
11559 int
11560 main ()
11561 {
11562 #define debug(...) fprintf(stderr, __VA_ARGS__)
11563 debug("%s", "blarg");
11564
11565   ;
11566   return 0;
11567 }
11568 _ACEOF
11569 if ac_fn_c_try_compile "$LINENO"; then :
11570   pgac_cv__va_args=yes
11571 else
11572   pgac_cv__va_args=no
11573 fi
11574 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11575 fi
11576 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__va_args" >&5
11577 $as_echo "$pgac_cv__va_args" >&6; }
11578 if test x"$pgac_cv__va_args" = xyes ; then
11579
11580 $as_echo "#define HAVE__VA_ARGS 1" >>confdefs.h
11581
11582 fi
11583 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
11584 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
11585 if ${ac_cv_struct_tm+:} false; then :
11586   $as_echo_n "(cached) " >&6
11587 else
11588   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11589 /* end confdefs.h.  */
11590 #include <sys/types.h>
11591 #include <time.h>
11592
11593 int
11594 main ()
11595 {
11596 struct tm tm;
11597                                      int *p = &tm.tm_sec;
11598                                      return !p;
11599   ;
11600   return 0;
11601 }
11602 _ACEOF
11603 if ac_fn_c_try_compile "$LINENO"; then :
11604   ac_cv_struct_tm=time.h
11605 else
11606   ac_cv_struct_tm=sys/time.h
11607 fi
11608 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11609 fi
11610 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
11611 $as_echo "$ac_cv_struct_tm" >&6; }
11612 if test $ac_cv_struct_tm = sys/time.h; then
11613
11614 $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
11615
11616 fi
11617
11618 ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h>
11619 #include <$ac_cv_struct_tm>
11620
11621 "
11622 if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
11623
11624 cat >>confdefs.h <<_ACEOF
11625 #define HAVE_STRUCT_TM_TM_ZONE 1
11626 _ACEOF
11627
11628
11629 fi
11630
11631 if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
11632
11633 $as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h
11634
11635 fi
11636 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
11637 $as_echo_n "checking for tzname... " >&6; }
11638 if ${ac_cv_var_tzname+:} false; then :
11639   $as_echo_n "(cached) " >&6
11640 else
11641   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11642 /* end confdefs.h.  */
11643 #include <stdlib.h>
11644 #include <time.h>
11645 #ifndef tzname /* For SGI.  */
11646 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
11647 #endif
11648
11649 int
11650 main ()
11651 {
11652 atoi(*tzname);
11653   ;
11654   return 0;
11655 }
11656 _ACEOF
11657 if ac_fn_c_try_link "$LINENO"; then :
11658   ac_cv_var_tzname=yes
11659 else
11660   ac_cv_var_tzname=no
11661 fi
11662 rm -f core conftest.err conftest.$ac_objext \
11663     conftest$ac_exeext conftest.$ac_ext
11664 fi
11665 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5
11666 $as_echo "$ac_cv_var_tzname" >&6; }
11667 if test $ac_cv_var_tzname = yes; then
11668
11669 $as_echo "#define HAVE_TZNAME 1" >>confdefs.h
11670
11671 fi
11672
11673 ac_fn_c_check_type "$LINENO" "union semun" "ac_cv_type_union_semun" "#include <sys/types.h>
11674 #include <sys/ipc.h>
11675 #include <sys/sem.h>
11676 "
11677 if test "x$ac_cv_type_union_semun" = xyes; then :
11678
11679 cat >>confdefs.h <<_ACEOF
11680 #define HAVE_UNION_SEMUN 1
11681 _ACEOF
11682
11683
11684 fi
11685
11686 ac_fn_c_check_type "$LINENO" "struct sockaddr_un" "ac_cv_type_struct_sockaddr_un" "#include <sys/types.h>
11687 #ifdef HAVE_SYS_UN_H
11688 #include <sys/un.h>
11689 #endif
11690
11691 "
11692 if test "x$ac_cv_type_struct_sockaddr_un" = xyes; then :
11693
11694 $as_echo "#define HAVE_UNIX_SOCKETS 1" >>confdefs.h
11695
11696 fi
11697
11698 ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include <sys/types.h>
11699 #ifdef HAVE_SYS_SOCKET_H
11700 #include <sys/socket.h>
11701 #endif
11702
11703 "
11704 if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
11705
11706 cat >>confdefs.h <<_ACEOF
11707 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
11708 _ACEOF
11709
11710
11711 fi
11712
11713 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
11714 #ifdef HAVE_SYS_SOCKET_H
11715 #include <sys/socket.h>
11716 #endif
11717
11718 "
11719 if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
11720
11721 cat >>confdefs.h <<_ACEOF
11722 #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
11723 _ACEOF
11724
11725
11726 fi
11727 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_family" "ac_cv_member_struct_sockaddr_storage___ss_family" "#include <sys/types.h>
11728 #ifdef HAVE_SYS_SOCKET_H
11729 #include <sys/socket.h>
11730 #endif
11731
11732 "
11733 if test "x$ac_cv_member_struct_sockaddr_storage___ss_family" = xyes; then :
11734
11735 cat >>confdefs.h <<_ACEOF
11736 #define HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY 1
11737 _ACEOF
11738
11739
11740 fi
11741 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_len" "ac_cv_member_struct_sockaddr_storage_ss_len" "#include <sys/types.h>
11742 #ifdef HAVE_SYS_SOCKET_H
11743 #include <sys/socket.h>
11744 #endif
11745
11746 "
11747 if test "x$ac_cv_member_struct_sockaddr_storage_ss_len" = xyes; then :
11748
11749 cat >>confdefs.h <<_ACEOF
11750 #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1
11751 _ACEOF
11752
11753
11754 fi
11755 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_len" "ac_cv_member_struct_sockaddr_storage___ss_len" "#include <sys/types.h>
11756 #ifdef HAVE_SYS_SOCKET_H
11757 #include <sys/socket.h>
11758 #endif
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" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include <sys/types.h>
11770 #ifdef HAVE_SYS_SOCKET_H
11771 #include <sys/socket.h>
11772 #endif
11773
11774 "
11775 if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then :
11776
11777 cat >>confdefs.h <<_ACEOF
11778 #define HAVE_STRUCT_SOCKADDR_SA_LEN 1
11779 _ACEOF
11780
11781
11782 fi
11783
11784 ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "#include <sys/types.h>
11785 #include <sys/socket.h>
11786 #include <netdb.h>
11787
11788 "
11789 if test "x$ac_cv_type_struct_addrinfo" = xyes; then :
11790
11791 cat >>confdefs.h <<_ACEOF
11792 #define HAVE_STRUCT_ADDRINFO 1
11793 _ACEOF
11794
11795
11796 fi
11797
11798
11799   ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
11800 if test "x$ac_cv_type_intptr_t" = xyes; then :
11801
11802 $as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h
11803
11804 else
11805   for ac_type in 'int' 'long int' 'long long int'; do
11806        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11807 /* end confdefs.h.  */
11808 $ac_includes_default
11809 int
11810 main ()
11811 {
11812 static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
11813 test_array [0] = 0;
11814 return test_array [0];
11815
11816   ;
11817   return 0;
11818 }
11819 _ACEOF
11820 if ac_fn_c_try_compile "$LINENO"; then :
11821
11822 cat >>confdefs.h <<_ACEOF
11823 #define intptr_t $ac_type
11824 _ACEOF
11825
11826           ac_type=
11827 fi
11828 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11829        test -z "$ac_type" && break
11830      done
11831 fi
11832
11833
11834
11835   ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
11836 if test "x$ac_cv_type_uintptr_t" = xyes; then :
11837
11838 $as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
11839
11840 else
11841   for ac_type in 'unsigned int' 'unsigned long int' \
11842         'unsigned long long int'; do
11843        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11844 /* end confdefs.h.  */
11845 $ac_includes_default
11846 int
11847 main ()
11848 {
11849 static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
11850 test_array [0] = 0;
11851 return test_array [0];
11852
11853   ;
11854   return 0;
11855 }
11856 _ACEOF
11857 if ac_fn_c_try_compile "$LINENO"; then :
11858
11859 cat >>confdefs.h <<_ACEOF
11860 #define uintptr_t $ac_type
11861 _ACEOF
11862
11863           ac_type=
11864 fi
11865 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11866        test -z "$ac_type" && break
11867      done
11868 fi
11869
11870
11871
11872   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
11873 $as_echo_n "checking for unsigned long long int... " >&6; }
11874 if ${ac_cv_type_unsigned_long_long_int+:} false; then :
11875   $as_echo_n "(cached) " >&6
11876 else
11877   ac_cv_type_unsigned_long_long_int=yes
11878      if test "x${ac_cv_prog_cc_c99-no}" = xno; then
11879        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11880 /* end confdefs.h.  */
11881
11882   /* For now, do not test the preprocessor; as of 2007 there are too many
11883          implementations with broken preprocessors.  Perhaps this can
11884          be revisited in 2012.  In the meantime, code should not expect
11885          #if to work with literals wider than 32 bits.  */
11886       /* Test literals.  */
11887       long long int ll = 9223372036854775807ll;
11888       long long int nll = -9223372036854775807LL;
11889       unsigned long long int ull = 18446744073709551615ULL;
11890       /* Test constant expressions.   */
11891       typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
11892                      ? 1 : -1)];
11893       typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
11894                      ? 1 : -1)];
11895       int i = 63;
11896 int
11897 main ()
11898 {
11899 /* Test availability of runtime routines for shift and division.  */
11900       long long int llmax = 9223372036854775807ll;
11901       unsigned long long int ullmax = 18446744073709551615ull;
11902       return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
11903               | (llmax / ll) | (llmax % ll)
11904               | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
11905               | (ullmax / ull) | (ullmax % ull));
11906   ;
11907   return 0;
11908 }
11909
11910 _ACEOF
11911 if ac_fn_c_try_link "$LINENO"; then :
11912
11913 else
11914   ac_cv_type_unsigned_long_long_int=no
11915 fi
11916 rm -f core conftest.err conftest.$ac_objext \
11917     conftest$ac_exeext conftest.$ac_ext
11918      fi
11919 fi
11920 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
11921 $as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
11922   if test $ac_cv_type_unsigned_long_long_int = yes; then
11923
11924 $as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
11925
11926   fi
11927
11928
11929
11930   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
11931 $as_echo_n "checking for long long int... " >&6; }
11932 if ${ac_cv_type_long_long_int+:} false; then :
11933   $as_echo_n "(cached) " >&6
11934 else
11935   ac_cv_type_long_long_int=yes
11936       if test "x${ac_cv_prog_cc_c99-no}" = xno; then
11937         ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
11938         if test $ac_cv_type_long_long_int = yes; then
11939                                   if test "$cross_compiling" = yes; then :
11940   :
11941 else
11942   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11943 /* end confdefs.h.  */
11944 #include <limits.h>
11945                  #ifndef LLONG_MAX
11946                  # define HALF \
11947                           (1LL << (sizeof (long long int) * CHAR_BIT - 2))
11948                  # define LLONG_MAX (HALF - 1 + HALF)
11949                  #endif
11950 int
11951 main ()
11952 {
11953 long long int n = 1;
11954                  int i;
11955                  for (i = 0; ; i++)
11956                    {
11957                      long long int m = n << i;
11958                      if (m >> i != n)
11959                        return 1;
11960                      if (LLONG_MAX / 2 < m)
11961                        break;
11962                    }
11963                  return 0;
11964   ;
11965   return 0;
11966 }
11967 _ACEOF
11968 if ac_fn_c_try_run "$LINENO"; then :
11969
11970 else
11971   ac_cv_type_long_long_int=no
11972 fi
11973 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11974   conftest.$ac_objext conftest.beam conftest.$ac_ext
11975 fi
11976
11977         fi
11978       fi
11979 fi
11980 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
11981 $as_echo "$ac_cv_type_long_long_int" >&6; }
11982   if test $ac_cv_type_long_long_int = yes; then
11983
11984 $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
11985
11986   fi
11987
11988
11989 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale_t" >&5
11990 $as_echo_n "checking for locale_t... " >&6; }
11991 if ${pgac_cv_type_locale_t+:} false; then :
11992   $as_echo_n "(cached) " >&6
11993 else
11994   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11995 /* end confdefs.h.  */
11996 #include <locale.h>
11997 locale_t x;
11998 int
11999 main ()
12000 {
12001
12002   ;
12003   return 0;
12004 }
12005 _ACEOF
12006 if ac_fn_c_try_compile "$LINENO"; then :
12007   pgac_cv_type_locale_t=yes
12008 else
12009   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12010 /* end confdefs.h.  */
12011 #include <xlocale.h>
12012 locale_t x;
12013 int
12014 main ()
12015 {
12016
12017   ;
12018   return 0;
12019 }
12020 _ACEOF
12021 if ac_fn_c_try_compile "$LINENO"; then :
12022   pgac_cv_type_locale_t='yes (in xlocale.h)'
12023 else
12024   pgac_cv_type_locale_t=no
12025 fi
12026 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12027 fi
12028 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12029 fi
12030 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_locale_t" >&5
12031 $as_echo "$pgac_cv_type_locale_t" >&6; }
12032 if test "$pgac_cv_type_locale_t" != no; then
12033
12034 $as_echo "#define HAVE_LOCALE_T 1" >>confdefs.h
12035
12036 fi
12037 if test "$pgac_cv_type_locale_t" = 'yes (in xlocale.h)'; then
12038
12039 $as_echo "#define LOCALE_T_IN_XLOCALE 1" >>confdefs.h
12040
12041 fi
12042
12043 ac_fn_c_check_type "$LINENO" "struct cmsgcred" "ac_cv_type_struct_cmsgcred" "#include <sys/socket.h>
12044 #include <sys/param.h>
12045 #ifdef HAVE_SYS_UCRED_H
12046 #include <sys/ucred.h>
12047 #endif
12048 "
12049 if test "x$ac_cv_type_struct_cmsgcred" = xyes; then :
12050
12051 cat >>confdefs.h <<_ACEOF
12052 #define HAVE_STRUCT_CMSGCRED 1
12053 _ACEOF
12054
12055
12056 fi
12057
12058
12059 ac_fn_c_check_type "$LINENO" "struct option" "ac_cv_type_struct_option" "#ifdef HAVE_GETOPT_H
12060 #include <getopt.h>
12061 #endif
12062 "
12063 if test "x$ac_cv_type_struct_option" = xyes; then :
12064
12065 cat >>confdefs.h <<_ACEOF
12066 #define HAVE_STRUCT_OPTION 1
12067 _ACEOF
12068
12069
12070 fi
12071
12072
12073 if test "$with_zlib" = yes; then
12074   # Check that <zlib.h> defines z_streamp (versions before about 1.0.4
12075   # did not).  While we could work around the lack of z_streamp, it
12076   # seems unwise to encourage people to use such old zlib versions...
12077   ac_fn_c_check_type "$LINENO" "z_streamp" "ac_cv_type_z_streamp" "#include <zlib.h>
12078 "
12079 if test "x$ac_cv_type_z_streamp" = xyes; then :
12080
12081 else
12082   as_fn_error $? "zlib version is too old
12083 Use --without-zlib to disable zlib support." "$LINENO" 5
12084 fi
12085
12086 fi
12087
12088 # On PPC, check if assembler supports LWARX instruction's mutex hint bit
12089 case $host_cpu in
12090   ppc*|powerpc*)
12091     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether assembler supports lwarx hint bit" >&5
12092 $as_echo_n "checking whether assembler supports lwarx hint bit... " >&6; }
12093     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12094 /* end confdefs.h.  */
12095
12096 int
12097 main ()
12098 {
12099 int a = 0; int *p = &a; int r;
12100          __asm__ __volatile__ (" lwarx %0,0,%1,1\n" : "=&r"(r) : "r"(p));
12101   ;
12102   return 0;
12103 }
12104 _ACEOF
12105 if ac_fn_c_try_compile "$LINENO"; then :
12106   pgac_cv_have_ppc_mutex_hint=yes
12107 else
12108   pgac_cv_have_ppc_mutex_hint=no
12109 fi
12110 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12111     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_have_ppc_mutex_hint" >&5
12112 $as_echo "$pgac_cv_have_ppc_mutex_hint" >&6; }
12113     if test x"$pgac_cv_have_ppc_mutex_hint" = xyes ; then
12114
12115 $as_echo "#define HAVE_PPC_LWARX_MUTEX_HINT 1" >>confdefs.h
12116
12117     fi
12118   ;;
12119 esac
12120
12121 # Check largefile support.  You might think this is a system service not a
12122 # compiler characteristic, but you'd be wrong.  We must check this before
12123 # probing existence of related functions such as fseeko, since the largefile
12124 # defines can affect what is generated for that.
12125 if test "$PORTNAME" != "win32"; then
12126    # Check whether --enable-largefile was given.
12127 if test "${enable_largefile+set}" = set; then :
12128   enableval=$enable_largefile;
12129 fi
12130
12131 if test "$enable_largefile" != no; then
12132
12133   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
12134 $as_echo_n "checking for special C compiler options needed for large files... " >&6; }
12135 if ${ac_cv_sys_largefile_CC+:} false; then :
12136   $as_echo_n "(cached) " >&6
12137 else
12138   ac_cv_sys_largefile_CC=no
12139      if test "$GCC" != yes; then
12140        ac_save_CC=$CC
12141        while :; do
12142          # IRIX 6.2 and later do not support large files by default,
12143          # so use the C compiler's -n32 option if that helps.
12144          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12145 /* end confdefs.h.  */
12146 #include <sys/types.h>
12147  /* Check that off_t can represent 2**63 - 1 correctly.
12148     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12149     since some C++ compilers masquerading as C compilers
12150     incorrectly reject 9223372036854775807.  */
12151 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12152   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12153                        && LARGE_OFF_T % 2147483647 == 1)
12154                       ? 1 : -1];
12155 int
12156 main ()
12157 {
12158
12159   ;
12160   return 0;
12161 }
12162 _ACEOF
12163          if ac_fn_c_try_compile "$LINENO"; then :
12164   break
12165 fi
12166 rm -f core conftest.err conftest.$ac_objext
12167          CC="$CC -n32"
12168          if ac_fn_c_try_compile "$LINENO"; then :
12169   ac_cv_sys_largefile_CC=' -n32'; break
12170 fi
12171 rm -f core conftest.err conftest.$ac_objext
12172          break
12173        done
12174        CC=$ac_save_CC
12175        rm -f conftest.$ac_ext
12176     fi
12177 fi
12178 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
12179 $as_echo "$ac_cv_sys_largefile_CC" >&6; }
12180   if test "$ac_cv_sys_largefile_CC" != no; then
12181     CC=$CC$ac_cv_sys_largefile_CC
12182   fi
12183
12184   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
12185 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
12186 if ${ac_cv_sys_file_offset_bits+:} false; then :
12187   $as_echo_n "(cached) " >&6
12188 else
12189   while :; do
12190   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12191 /* end confdefs.h.  */
12192 #include <sys/types.h>
12193  /* Check that off_t can represent 2**63 - 1 correctly.
12194     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12195     since some C++ compilers masquerading as C compilers
12196     incorrectly reject 9223372036854775807.  */
12197 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12198   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12199                        && LARGE_OFF_T % 2147483647 == 1)
12200                       ? 1 : -1];
12201 int
12202 main ()
12203 {
12204
12205   ;
12206   return 0;
12207 }
12208 _ACEOF
12209 if ac_fn_c_try_compile "$LINENO"; then :
12210   ac_cv_sys_file_offset_bits=no; break
12211 fi
12212 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12213   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12214 /* end confdefs.h.  */
12215 #define _FILE_OFFSET_BITS 64
12216 #include <sys/types.h>
12217  /* Check that off_t can represent 2**63 - 1 correctly.
12218     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12219     since some C++ compilers masquerading as C compilers
12220     incorrectly reject 9223372036854775807.  */
12221 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12222   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12223                        && LARGE_OFF_T % 2147483647 == 1)
12224                       ? 1 : -1];
12225 int
12226 main ()
12227 {
12228
12229   ;
12230   return 0;
12231 }
12232 _ACEOF
12233 if ac_fn_c_try_compile "$LINENO"; then :
12234   ac_cv_sys_file_offset_bits=64; break
12235 fi
12236 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12237   ac_cv_sys_file_offset_bits=unknown
12238   break
12239 done
12240 fi
12241 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
12242 $as_echo "$ac_cv_sys_file_offset_bits" >&6; }
12243 case $ac_cv_sys_file_offset_bits in #(
12244   no | unknown) ;;
12245   *)
12246 cat >>confdefs.h <<_ACEOF
12247 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
12248 _ACEOF
12249 ;;
12250 esac
12251 rm -rf conftest*
12252   if test $ac_cv_sys_file_offset_bits = unknown; then
12253     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
12254 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
12255 if ${ac_cv_sys_large_files+:} false; then :
12256   $as_echo_n "(cached) " >&6
12257 else
12258   while :; do
12259   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12260 /* end confdefs.h.  */
12261 #include <sys/types.h>
12262  /* Check that off_t can represent 2**63 - 1 correctly.
12263     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12264     since some C++ compilers masquerading as C compilers
12265     incorrectly reject 9223372036854775807.  */
12266 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12267   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12268                        && LARGE_OFF_T % 2147483647 == 1)
12269                       ? 1 : -1];
12270 int
12271 main ()
12272 {
12273
12274   ;
12275   return 0;
12276 }
12277 _ACEOF
12278 if ac_fn_c_try_compile "$LINENO"; then :
12279   ac_cv_sys_large_files=no; break
12280 fi
12281 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12282   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12283 /* end confdefs.h.  */
12284 #define _LARGE_FILES 1
12285 #include <sys/types.h>
12286  /* Check that off_t can represent 2**63 - 1 correctly.
12287     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12288     since some C++ compilers masquerading as C compilers
12289     incorrectly reject 9223372036854775807.  */
12290 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12291   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12292                        && LARGE_OFF_T % 2147483647 == 1)
12293                       ? 1 : -1];
12294 int
12295 main ()
12296 {
12297
12298   ;
12299   return 0;
12300 }
12301 _ACEOF
12302 if ac_fn_c_try_compile "$LINENO"; then :
12303   ac_cv_sys_large_files=1; break
12304 fi
12305 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12306   ac_cv_sys_large_files=unknown
12307   break
12308 done
12309 fi
12310 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
12311 $as_echo "$ac_cv_sys_large_files" >&6; }
12312 case $ac_cv_sys_large_files in #(
12313   no | unknown) ;;
12314   *)
12315 cat >>confdefs.h <<_ACEOF
12316 #define _LARGE_FILES $ac_cv_sys_large_files
12317 _ACEOF
12318 ;;
12319 esac
12320 rm -rf conftest*
12321   fi
12322
12323
12324 fi
12325
12326
12327 fi
12328
12329 # Check for largefile support (must be after AC_SYS_LARGEFILE)
12330 # The cast to long int works around a bug in the HP C Compiler
12331 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
12332 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
12333 # This bug is HP SR number 8606223364.
12334 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
12335 $as_echo_n "checking size of off_t... " >&6; }
12336 if ${ac_cv_sizeof_off_t+:} false; then :
12337   $as_echo_n "(cached) " >&6
12338 else
12339   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t"        "$ac_includes_default"; then :
12340
12341 else
12342   if test "$ac_cv_type_off_t" = yes; then
12343      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
12344 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
12345 as_fn_error 77 "cannot compute sizeof (off_t)
12346 See \`config.log' for more details" "$LINENO" 5; }
12347    else
12348      ac_cv_sizeof_off_t=0
12349    fi
12350 fi
12351
12352 fi
12353 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
12354 $as_echo "$ac_cv_sizeof_off_t" >&6; }
12355
12356
12357
12358 cat >>confdefs.h <<_ACEOF
12359 #define SIZEOF_OFF_T $ac_cv_sizeof_off_t
12360 _ACEOF
12361
12362
12363
12364 # If we don't have largefile support, can't handle segsize >= 2GB.
12365 if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then
12366    as_fn_error $? "Large file support is not enabled. Segment size cannot be larger than 1GB." "$LINENO" 5
12367 fi
12368
12369
12370 ##
12371 ## Functions, global variables
12372 ##
12373
12374 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int timezone" >&5
12375 $as_echo_n "checking for int timezone... " >&6; }
12376 if ${pgac_cv_var_int_timezone+:} false; then :
12377   $as_echo_n "(cached) " >&6
12378 else
12379   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12380 /* end confdefs.h.  */
12381 #include <time.h>
12382 int res;
12383 int
12384 main ()
12385 {
12386 #ifndef __CYGWIN__
12387 res = timezone / 60;
12388 #else
12389 res = _timezone / 60;
12390 #endif
12391   ;
12392   return 0;
12393 }
12394 _ACEOF
12395 if ac_fn_c_try_link "$LINENO"; then :
12396   pgac_cv_var_int_timezone=yes
12397 else
12398   pgac_cv_var_int_timezone=no
12399 fi
12400 rm -f core conftest.err conftest.$ac_objext \
12401     conftest$ac_exeext conftest.$ac_ext
12402 fi
12403 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_timezone" >&5
12404 $as_echo "$pgac_cv_var_int_timezone" >&6; }
12405 if test x"$pgac_cv_var_int_timezone" = xyes ; then
12406
12407 $as_echo "#define HAVE_INT_TIMEZONE 1" >>confdefs.h
12408
12409 fi
12410 { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for accept()" >&5
12411 $as_echo_n "checking types of arguments for accept()... " >&6; }
12412  if ${ac_cv_func_accept_return+:} false; then :
12413   $as_echo_n "(cached) " >&6
12414 else
12415    if ${ac_cv_func_accept_arg1+:} false; then :
12416   $as_echo_n "(cached) " >&6
12417 else
12418     if ${ac_cv_func_accept_arg2+:} false; then :
12419   $as_echo_n "(cached) " >&6
12420 else
12421      if ${ac_cv_func_accept_arg3+:} false; then :
12422   $as_echo_n "(cached) " >&6
12423 else
12424       for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET WSAAPI'; do
12425       for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do
12426        for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
12427         for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
12428          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12429 /* end confdefs.h.  */
12430 #ifdef HAVE_SYS_TYPES_H
12431 #include <sys/types.h>
12432 #endif
12433 #ifdef HAVE_SYS_SOCKET_H
12434 #include <sys/socket.h>
12435 #endif
12436 extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);
12437 _ACEOF
12438 if ac_fn_c_try_compile "$LINENO"; then :
12439   ac_not_found=no; break 4
12440 else
12441   ac_not_found=yes
12442 fi
12443 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12444        done
12445       done
12446      done
12447     done
12448     if test "$ac_not_found" = yes; then
12449       as_fn_error $? "could not determine argument types" "$LINENO" 5
12450     fi
12451     if test "$ac_cv_func_accept_arg3" = "void"; then
12452       ac_cv_func_accept_arg3=int
12453     fi
12454
12455 fi
12456
12457 fi
12458
12459 fi
12460
12461 fi
12462  { $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
12463 $as_echo "$ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&6; }
12464
12465 cat >>confdefs.h <<_ACEOF
12466 #define ACCEPT_TYPE_RETURN $ac_cv_func_accept_return
12467 _ACEOF
12468
12469
12470 cat >>confdefs.h <<_ACEOF
12471 #define ACCEPT_TYPE_ARG1 $ac_cv_func_accept_arg1
12472 _ACEOF
12473
12474
12475 cat >>confdefs.h <<_ACEOF
12476 #define ACCEPT_TYPE_ARG2 $ac_cv_func_accept_arg2
12477 _ACEOF
12478
12479
12480 cat >>confdefs.h <<_ACEOF
12481 #define ACCEPT_TYPE_ARG3 $ac_cv_func_accept_arg3
12482 _ACEOF
12483
12484
12485 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday takes only one argument" >&5
12486 $as_echo_n "checking whether gettimeofday takes only one argument... " >&6; }
12487 if ${pgac_cv_func_gettimeofday_1arg+:} false; then :
12488   $as_echo_n "(cached) " >&6
12489 else
12490   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12491 /* end confdefs.h.  */
12492 #include <sys/time.h>
12493 int
12494 main ()
12495 {
12496 struct timeval *tp;
12497 struct timezone *tzp;
12498 gettimeofday(tp,tzp);
12499   ;
12500   return 0;
12501 }
12502 _ACEOF
12503 if ac_fn_c_try_compile "$LINENO"; then :
12504   pgac_cv_func_gettimeofday_1arg=no
12505 else
12506   pgac_cv_func_gettimeofday_1arg=yes
12507 fi
12508 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12509 fi
12510 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_gettimeofday_1arg" >&5
12511 $as_echo "$pgac_cv_func_gettimeofday_1arg" >&6; }
12512 if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
12513
12514 $as_echo "#define GETTIMEOFDAY_1ARG 1" >>confdefs.h
12515
12516 fi
12517
12518 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wcstombs_l declaration" >&5
12519 $as_echo_n "checking for wcstombs_l declaration... " >&6; }
12520 if ${pgac_cv_func_wcstombs_l+:} false; then :
12521   $as_echo_n "(cached) " >&6
12522 else
12523   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12524 /* end confdefs.h.  */
12525 #include <stdlib.h>
12526 #include <locale.h>
12527 int
12528 main ()
12529 {
12530 #ifndef wcstombs_l
12531 (void) wcstombs_l;
12532 #endif
12533   ;
12534   return 0;
12535 }
12536 _ACEOF
12537 if ac_fn_c_try_compile "$LINENO"; then :
12538   pgac_cv_func_wcstombs_l='yes'
12539 else
12540   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12541 /* end confdefs.h.  */
12542 #include <stdlib.h>
12543 #include <locale.h>
12544 #include <xlocale.h>
12545 int
12546 main ()
12547 {
12548 #ifndef wcstombs_l
12549 (void) wcstombs_l;
12550 #endif
12551   ;
12552   return 0;
12553 }
12554 _ACEOF
12555 if ac_fn_c_try_compile "$LINENO"; then :
12556   pgac_cv_func_wcstombs_l='yes (in xlocale.h)'
12557 else
12558   pgac_cv_func_wcstombs_l='no'
12559 fi
12560 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12561 fi
12562 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12563 fi
12564 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_wcstombs_l" >&5
12565 $as_echo "$pgac_cv_func_wcstombs_l" >&6; }
12566 if test "$pgac_cv_func_wcstombs_l" = 'yes (in xlocale.h)'; then
12567
12568 $as_echo "#define WCSTOMBS_L_IN_XLOCALE 1" >>confdefs.h
12569
12570 fi
12571
12572 # Some versions of libedit contain strlcpy(), setproctitle(), and other
12573 # symbols that that library has no business exposing to the world.  Pending
12574 # acquisition of a clue by those developers, ignore libedit (including its
12575 # possible alias of libreadline) while checking for everything else.
12576 LIBS_including_readline="$LIBS"
12577 LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
12578
12579 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
12580 do :
12581   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
12582 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
12583 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
12584   cat >>confdefs.h <<_ACEOF
12585 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
12586 _ACEOF
12587
12588 fi
12589 done
12590
12591
12592 ac_fn_c_check_func "$LINENO" "fseeko" "ac_cv_func_fseeko"
12593 if test "x$ac_cv_func_fseeko" = xyes; then :
12594   $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
12595
12596 else
12597   case " $LIBOBJS " in
12598   *" fseeko.$ac_objext "* ) ;;
12599   *) LIBOBJS="$LIBOBJS fseeko.$ac_objext"
12600  ;;
12601 esac
12602
12603 fi
12604
12605
12606 case $host_os in
12607         # NetBSD uses a custom fseeko/ftello built on fsetpos/fgetpos
12608         # Mingw uses macros to access Win32 API calls
12609         netbsd*|mingw*)
12610
12611 $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
12612
12613                 ac_cv_func_fseeko=yes;;
12614         *)
12615                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
12616 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
12617 if ${ac_cv_sys_largefile_source+:} false; then :
12618   $as_echo_n "(cached) " >&6
12619 else
12620   while :; do
12621   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12622 /* end confdefs.h.  */
12623 #include <sys/types.h> /* for off_t */
12624      #include <stdio.h>
12625 int
12626 main ()
12627 {
12628 int (*fp) (FILE *, off_t, int) = fseeko;
12629      return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
12630   ;
12631   return 0;
12632 }
12633 _ACEOF
12634 if ac_fn_c_try_link "$LINENO"; then :
12635   ac_cv_sys_largefile_source=no; break
12636 fi
12637 rm -f core conftest.err conftest.$ac_objext \
12638     conftest$ac_exeext conftest.$ac_ext
12639   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12640 /* end confdefs.h.  */
12641 #define _LARGEFILE_SOURCE 1
12642 #include <sys/types.h> /* for off_t */
12643      #include <stdio.h>
12644 int
12645 main ()
12646 {
12647 int (*fp) (FILE *, off_t, int) = fseeko;
12648      return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
12649   ;
12650   return 0;
12651 }
12652 _ACEOF
12653 if ac_fn_c_try_link "$LINENO"; then :
12654   ac_cv_sys_largefile_source=1; break
12655 fi
12656 rm -f core conftest.err conftest.$ac_objext \
12657     conftest$ac_exeext conftest.$ac_ext
12658   ac_cv_sys_largefile_source=unknown
12659   break
12660 done
12661 fi
12662 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
12663 $as_echo "$ac_cv_sys_largefile_source" >&6; }
12664 case $ac_cv_sys_largefile_source in #(
12665   no | unknown) ;;
12666   *)
12667 cat >>confdefs.h <<_ACEOF
12668 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
12669 _ACEOF
12670 ;;
12671 esac
12672 rm -rf conftest*
12673
12674 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
12675 # in glibc 2.1.3, but that breaks too many other things.
12676 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
12677 if test $ac_cv_sys_largefile_source != unknown; then
12678
12679 $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
12680
12681 fi
12682 ;;
12683 esac
12684
12685 # posix_fadvise() is a no-op on Solaris, so don't incur function overhead
12686 # by calling it, 2009-04-02
12687 # http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/posix_fadvise.c
12688 if test "$PORTNAME" != "solaris"; then
12689 for ac_func in posix_fadvise
12690 do :
12691   ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise"
12692 if test "x$ac_cv_func_posix_fadvise" = xyes; then :
12693   cat >>confdefs.h <<_ACEOF
12694 #define HAVE_POSIX_FADVISE 1
12695 _ACEOF
12696
12697 fi
12698 done
12699
12700 ac_fn_c_check_decl "$LINENO" "posix_fadvise" "ac_cv_have_decl_posix_fadvise" "#include <fcntl.h>
12701 "
12702 if test "x$ac_cv_have_decl_posix_fadvise" = xyes; then :
12703   ac_have_decl=1
12704 else
12705   ac_have_decl=0
12706 fi
12707
12708 cat >>confdefs.h <<_ACEOF
12709 #define HAVE_DECL_POSIX_FADVISE $ac_have_decl
12710 _ACEOF
12711
12712 fi
12713
12714 ac_fn_c_check_decl "$LINENO" "fdatasync" "ac_cv_have_decl_fdatasync" "#include <unistd.h>
12715 "
12716 if test "x$ac_cv_have_decl_fdatasync" = xyes; then :
12717   ac_have_decl=1
12718 else
12719   ac_have_decl=0
12720 fi
12721
12722 cat >>confdefs.h <<_ACEOF
12723 #define HAVE_DECL_FDATASYNC $ac_have_decl
12724 _ACEOF
12725
12726 ac_fn_c_check_decl "$LINENO" "strlcat" "ac_cv_have_decl_strlcat" "$ac_includes_default"
12727 if test "x$ac_cv_have_decl_strlcat" = xyes; then :
12728   ac_have_decl=1
12729 else
12730   ac_have_decl=0
12731 fi
12732
12733 cat >>confdefs.h <<_ACEOF
12734 #define HAVE_DECL_STRLCAT $ac_have_decl
12735 _ACEOF
12736 ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" "$ac_includes_default"
12737 if test "x$ac_cv_have_decl_strlcpy" = xyes; then :
12738   ac_have_decl=1
12739 else
12740   ac_have_decl=0
12741 fi
12742
12743 cat >>confdefs.h <<_ACEOF
12744 #define HAVE_DECL_STRLCPY $ac_have_decl
12745 _ACEOF
12746
12747 # This is probably only present on macOS, but may as well check always
12748 ac_fn_c_check_decl "$LINENO" "F_FULLFSYNC" "ac_cv_have_decl_F_FULLFSYNC" "#include <fcntl.h>
12749 "
12750 if test "x$ac_cv_have_decl_F_FULLFSYNC" = xyes; then :
12751   ac_have_decl=1
12752 else
12753   ac_have_decl=0
12754 fi
12755
12756 cat >>confdefs.h <<_ACEOF
12757 #define HAVE_DECL_F_FULLFSYNC $ac_have_decl
12758 _ACEOF
12759
12760
12761 HAVE_IPV6=no
12762 ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "$ac_includes_default
12763 #include <netinet/in.h>
12764 "
12765 if test "x$ac_cv_type_struct_sockaddr_in6" = xyes; then :
12766
12767 $as_echo "#define HAVE_IPV6 1" >>confdefs.h
12768
12769          HAVE_IPV6=yes
12770 fi
12771
12772
12773
12774 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PS_STRINGS" >&5
12775 $as_echo_n "checking for PS_STRINGS... " >&6; }
12776 if ${pgac_cv_var_PS_STRINGS+:} false; then :
12777   $as_echo_n "(cached) " >&6
12778 else
12779   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12780 /* end confdefs.h.  */
12781 #include <machine/vmparam.h>
12782 #include <sys/exec.h>
12783
12784 int
12785 main ()
12786 {
12787 PS_STRINGS->ps_nargvstr = 1;
12788 PS_STRINGS->ps_argvstr = "foo";
12789   ;
12790   return 0;
12791 }
12792 _ACEOF
12793 if ac_fn_c_try_link "$LINENO"; then :
12794   pgac_cv_var_PS_STRINGS=yes
12795 else
12796   pgac_cv_var_PS_STRINGS=no
12797 fi
12798 rm -f core conftest.err conftest.$ac_objext \
12799     conftest$ac_exeext conftest.$ac_ext
12800 fi
12801 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_PS_STRINGS" >&5
12802 $as_echo "$pgac_cv_var_PS_STRINGS" >&6; }
12803 if test "$pgac_cv_var_PS_STRINGS" = yes ; then
12804
12805 $as_echo "#define HAVE_PS_STRINGS 1" >>confdefs.h
12806
12807 fi
12808
12809
12810 # We use our snprintf.c emulation if either snprintf() or vsnprintf()
12811 # is missing.  Yes, there are machines that have only one.  We may
12812 # also decide to use snprintf.c if snprintf() is present but does not
12813 # have all the features we need --- see below.
12814
12815 if test "$PORTNAME" = "win32"; then
12816   # Win32 gets snprintf.c built unconditionally.
12817   #
12818   # To properly translate all NLS languages strings, we must support the
12819   # *printf() %$ format, which allows *printf() arguments to be selected
12820   # by position in the translated string.
12821   #
12822   # libintl versions < 0.13 use the native *printf() functions, and Win32
12823   # *printf() doesn't understand %$, so we must use our /port versions,
12824   # which do understand %$. libintl versions >= 0.13 include their own
12825   # *printf versions on Win32.  The libintl 0.13 release note text is:
12826   #
12827   #   C format strings with positions, as they arise when a translator
12828   #   needs to reorder a sentence, are now supported on all platforms.
12829   #   On those few platforms (NetBSD and Woe32) for which the native
12830   #   printf()/fprintf()/... functions don't support such format
12831   #   strings, replacements are provided through <libintl.h>.
12832   #
12833   # We could use libintl >= 0.13's *printf() if we were sure that we had
12834   # a litint >= 0.13 at runtime, but seeing that there is no clean way
12835   # to guarantee that, it is best to just use our own, so we are sure to
12836   # get %$ support. In include/port.h we disable the *printf() macros
12837   # that might have been defined by libintl.
12838   #
12839   # We do this unconditionally whether NLS is used or not so we are sure
12840   # that all Win32 libraries and binaries behave the same.
12841   pgac_need_repl_snprintf=yes
12842 else
12843   pgac_need_repl_snprintf=no
12844   for ac_func in snprintf
12845 do :
12846   ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
12847 if test "x$ac_cv_func_snprintf" = xyes; then :
12848   cat >>confdefs.h <<_ACEOF
12849 #define HAVE_SNPRINTF 1
12850 _ACEOF
12851
12852 else
12853   pgac_need_repl_snprintf=yes
12854 fi
12855 done
12856
12857   for ac_func in vsnprintf
12858 do :
12859   ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf"
12860 if test "x$ac_cv_func_vsnprintf" = xyes; then :
12861   cat >>confdefs.h <<_ACEOF
12862 #define HAVE_VSNPRINTF 1
12863 _ACEOF
12864
12865 else
12866   pgac_need_repl_snprintf=yes
12867 fi
12868 done
12869
12870 fi
12871
12872
12873 # Check whether <stdio.h> declares snprintf() and vsnprintf(); if not,
12874 # include/c.h will provide declarations.  Note this is a separate test
12875 # from whether the functions exist in the C library --- there are
12876 # systems that have the functions but don't bother to declare them :-(
12877
12878 ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default"
12879 if test "x$ac_cv_have_decl_snprintf" = xyes; then :
12880   ac_have_decl=1
12881 else
12882   ac_have_decl=0
12883 fi
12884
12885 cat >>confdefs.h <<_ACEOF
12886 #define HAVE_DECL_SNPRINTF $ac_have_decl
12887 _ACEOF
12888 ac_fn_c_check_decl "$LINENO" "vsnprintf" "ac_cv_have_decl_vsnprintf" "$ac_includes_default"
12889 if test "x$ac_cv_have_decl_vsnprintf" = xyes; then :
12890   ac_have_decl=1
12891 else
12892   ac_have_decl=0
12893 fi
12894
12895 cat >>confdefs.h <<_ACEOF
12896 #define HAVE_DECL_VSNPRINTF $ac_have_decl
12897 _ACEOF
12898
12899
12900
12901 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf" >&5
12902 $as_echo_n "checking for isinf... " >&6; }
12903 if ${ac_cv_func_isinf+:} false; then :
12904   $as_echo_n "(cached) " >&6
12905 else
12906   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12907 /* end confdefs.h.  */
12908
12909 #include <math.h>
12910 double glob_double;
12911
12912 int
12913 main ()
12914 {
12915 return isinf(glob_double) ? 0 : 1;
12916   ;
12917   return 0;
12918 }
12919 _ACEOF
12920 if ac_fn_c_try_link "$LINENO"; then :
12921   ac_cv_func_isinf=yes
12922 else
12923   ac_cv_func_isinf=no
12924 fi
12925 rm -f core conftest.err conftest.$ac_objext \
12926     conftest$ac_exeext conftest.$ac_ext
12927 fi
12928 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_isinf" >&5
12929 $as_echo "$ac_cv_func_isinf" >&6; }
12930
12931 if test $ac_cv_func_isinf = yes ; then
12932
12933 $as_echo "#define HAVE_ISINF 1" >>confdefs.h
12934
12935 else
12936   case " $LIBOBJS " in
12937   *" isinf.$ac_objext "* ) ;;
12938   *) LIBOBJS="$LIBOBJS isinf.$ac_objext"
12939  ;;
12940 esac
12941
12942   # Look for a way to implement a substitute for isinf()
12943   for ac_func in fpclass fp_class fp_class_d class
12944 do :
12945   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
12946 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
12947 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
12948   cat >>confdefs.h <<_ACEOF
12949 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
12950 _ACEOF
12951  break
12952 fi
12953 done
12954
12955 fi
12956
12957 ac_fn_c_check_func "$LINENO" "crypt" "ac_cv_func_crypt"
12958 if test "x$ac_cv_func_crypt" = xyes; then :
12959   $as_echo "#define HAVE_CRYPT 1" >>confdefs.h
12960
12961 else
12962   case " $LIBOBJS " in
12963   *" crypt.$ac_objext "* ) ;;
12964   *) LIBOBJS="$LIBOBJS crypt.$ac_objext"
12965  ;;
12966 esac
12967
12968 fi
12969
12970 ac_fn_c_check_func "$LINENO" "fls" "ac_cv_func_fls"
12971 if test "x$ac_cv_func_fls" = xyes; then :
12972   $as_echo "#define HAVE_FLS 1" >>confdefs.h
12973
12974 else
12975   case " $LIBOBJS " in
12976   *" fls.$ac_objext "* ) ;;
12977   *) LIBOBJS="$LIBOBJS fls.$ac_objext"
12978  ;;
12979 esac
12980
12981 fi
12982
12983 ac_fn_c_check_func "$LINENO" "getopt" "ac_cv_func_getopt"
12984 if test "x$ac_cv_func_getopt" = xyes; then :
12985   $as_echo "#define HAVE_GETOPT 1" >>confdefs.h
12986
12987 else
12988   case " $LIBOBJS " in
12989   *" getopt.$ac_objext "* ) ;;
12990   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
12991  ;;
12992 esac
12993
12994 fi
12995
12996 ac_fn_c_check_func "$LINENO" "getrusage" "ac_cv_func_getrusage"
12997 if test "x$ac_cv_func_getrusage" = xyes; then :
12998   $as_echo "#define HAVE_GETRUSAGE 1" >>confdefs.h
12999
13000 else
13001   case " $LIBOBJS " in
13002   *" getrusage.$ac_objext "* ) ;;
13003   *) LIBOBJS="$LIBOBJS getrusage.$ac_objext"
13004  ;;
13005 esac
13006
13007 fi
13008
13009 ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton"
13010 if test "x$ac_cv_func_inet_aton" = xyes; then :
13011   $as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
13012
13013 else
13014   case " $LIBOBJS " in
13015   *" inet_aton.$ac_objext "* ) ;;
13016   *) LIBOBJS="$LIBOBJS inet_aton.$ac_objext"
13017  ;;
13018 esac
13019
13020 fi
13021
13022 ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
13023 if test "x$ac_cv_func_mkdtemp" = xyes; then :
13024   $as_echo "#define HAVE_MKDTEMP 1" >>confdefs.h
13025
13026 else
13027   case " $LIBOBJS " in
13028   *" mkdtemp.$ac_objext "* ) ;;
13029   *) LIBOBJS="$LIBOBJS mkdtemp.$ac_objext"
13030  ;;
13031 esac
13032
13033 fi
13034
13035 ac_fn_c_check_func "$LINENO" "random" "ac_cv_func_random"
13036 if test "x$ac_cv_func_random" = xyes; then :
13037   $as_echo "#define HAVE_RANDOM 1" >>confdefs.h
13038
13039 else
13040   case " $LIBOBJS " in
13041   *" random.$ac_objext "* ) ;;
13042   *) LIBOBJS="$LIBOBJS random.$ac_objext"
13043  ;;
13044 esac
13045
13046 fi
13047
13048 ac_fn_c_check_func "$LINENO" "rint" "ac_cv_func_rint"
13049 if test "x$ac_cv_func_rint" = xyes; then :
13050   $as_echo "#define HAVE_RINT 1" >>confdefs.h
13051
13052 else
13053   case " $LIBOBJS " in
13054   *" rint.$ac_objext "* ) ;;
13055   *) LIBOBJS="$LIBOBJS rint.$ac_objext"
13056  ;;
13057 esac
13058
13059 fi
13060
13061 ac_fn_c_check_func "$LINENO" "srandom" "ac_cv_func_srandom"
13062 if test "x$ac_cv_func_srandom" = xyes; then :
13063   $as_echo "#define HAVE_SRANDOM 1" >>confdefs.h
13064
13065 else
13066   case " $LIBOBJS " in
13067   *" srandom.$ac_objext "* ) ;;
13068   *) LIBOBJS="$LIBOBJS srandom.$ac_objext"
13069  ;;
13070 esac
13071
13072 fi
13073
13074 ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror"
13075 if test "x$ac_cv_func_strerror" = xyes; then :
13076   $as_echo "#define HAVE_STRERROR 1" >>confdefs.h
13077
13078 else
13079   case " $LIBOBJS " in
13080   *" strerror.$ac_objext "* ) ;;
13081   *) LIBOBJS="$LIBOBJS strerror.$ac_objext"
13082  ;;
13083 esac
13084
13085 fi
13086
13087 ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat"
13088 if test "x$ac_cv_func_strlcat" = xyes; then :
13089   $as_echo "#define HAVE_STRLCAT 1" >>confdefs.h
13090
13091 else
13092   case " $LIBOBJS " in
13093   *" strlcat.$ac_objext "* ) ;;
13094   *) LIBOBJS="$LIBOBJS strlcat.$ac_objext"
13095  ;;
13096 esac
13097
13098 fi
13099
13100 ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy"
13101 if test "x$ac_cv_func_strlcpy" = xyes; then :
13102   $as_echo "#define HAVE_STRLCPY 1" >>confdefs.h
13103
13104 else
13105   case " $LIBOBJS " in
13106   *" strlcpy.$ac_objext "* ) ;;
13107   *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext"
13108  ;;
13109 esac
13110
13111 fi
13112
13113
13114
13115 case $host_os in
13116
13117         # Windows uses a specialised env handler
13118         # and doesn't need a replacement getpeereid because it doesn't use
13119         # Unix sockets.
13120         mingw*)
13121
13122 $as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
13123
13124
13125 $as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
13126
13127                 ac_cv_func_unsetenv=yes
13128                 ac_cv_func_getpeereid=yes;;
13129         *)
13130                 ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
13131 if test "x$ac_cv_func_unsetenv" = xyes; then :
13132   $as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
13133
13134 else
13135   case " $LIBOBJS " in
13136   *" unsetenv.$ac_objext "* ) ;;
13137   *) LIBOBJS="$LIBOBJS unsetenv.$ac_objext"
13138  ;;
13139 esac
13140
13141 fi
13142
13143 ac_fn_c_check_func "$LINENO" "getpeereid" "ac_cv_func_getpeereid"
13144 if test "x$ac_cv_func_getpeereid" = xyes; then :
13145   $as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
13146
13147 else
13148   case " $LIBOBJS " in
13149   *" getpeereid.$ac_objext "* ) ;;
13150   *) LIBOBJS="$LIBOBJS getpeereid.$ac_objext"
13151  ;;
13152 esac
13153
13154 fi
13155
13156
13157                 ;;
13158 esac
13159
13160 # System's version of getaddrinfo(), if any, may be used only if we found
13161 # a definition for struct addrinfo; see notes in src/include/getaddrinfo.h.
13162 # We use only our own getaddrinfo.c on Windows, but it's time to revisit that.
13163 if test x"$ac_cv_type_struct_addrinfo" = xyes && \
13164    test "$PORTNAME" != "win32"; then
13165   ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo"
13166 if test "x$ac_cv_func_getaddrinfo" = xyes; then :
13167   $as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
13168
13169 else
13170   case " $LIBOBJS " in
13171   *" getaddrinfo.$ac_objext "* ) ;;
13172   *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext"
13173  ;;
13174 esac
13175
13176 fi
13177
13178
13179 else
13180   case " $LIBOBJS " in
13181   *" getaddrinfo.$ac_objext "* ) ;;
13182   *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext"
13183  ;;
13184 esac
13185
13186 fi
13187
13188 # Similarly, use system's getopt_long() only if system provides struct option.
13189 if test x"$ac_cv_type_struct_option" = xyes ; then
13190   ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long"
13191 if test "x$ac_cv_func_getopt_long" = xyes; then :
13192   $as_echo "#define HAVE_GETOPT_LONG 1" >>confdefs.h
13193
13194 else
13195   case " $LIBOBJS " in
13196   *" getopt_long.$ac_objext "* ) ;;
13197   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
13198  ;;
13199 esac
13200
13201 fi
13202
13203
13204 else
13205   case " $LIBOBJS " in
13206   *" getopt_long.$ac_objext "* ) ;;
13207   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
13208  ;;
13209 esac
13210
13211 fi
13212
13213 # Solaris' getopt() doesn't do what we want for long options, so always use
13214 # our version on that platform.
13215 if test "$PORTNAME" = "solaris"; then
13216   case " $LIBOBJS " in
13217   *" getopt.$ac_objext "* ) ;;
13218   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
13219  ;;
13220 esac
13221
13222 fi
13223
13224 # mingw has adopted a GNU-centric interpretation of optind/optreset,
13225 # so always use our version on Windows.
13226 if test "$PORTNAME" = "win32"; then
13227   case " $LIBOBJS " in
13228   *" getopt.$ac_objext "* ) ;;
13229   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
13230  ;;
13231 esac
13232
13233   case " $LIBOBJS " in
13234   *" getopt_long.$ac_objext "* ) ;;
13235   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
13236  ;;
13237 esac
13238
13239 fi
13240
13241 # Win32 (really MinGW) support
13242 if test "$PORTNAME" = "win32"; then
13243   ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
13244 if test "x$ac_cv_func_gettimeofday" = xyes; then :
13245   $as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
13246
13247 else
13248   case " $LIBOBJS " in
13249   *" gettimeofday.$ac_objext "* ) ;;
13250   *) LIBOBJS="$LIBOBJS gettimeofday.$ac_objext"
13251  ;;
13252 esac
13253
13254 fi
13255
13256
13257   case " $LIBOBJS " in
13258   *" dirmod.$ac_objext "* ) ;;
13259   *) LIBOBJS="$LIBOBJS dirmod.$ac_objext"
13260  ;;
13261 esac
13262
13263   case " $LIBOBJS " in
13264   *" kill.$ac_objext "* ) ;;
13265   *) LIBOBJS="$LIBOBJS kill.$ac_objext"
13266  ;;
13267 esac
13268
13269   case " $LIBOBJS " in
13270   *" open.$ac_objext "* ) ;;
13271   *) LIBOBJS="$LIBOBJS open.$ac_objext"
13272  ;;
13273 esac
13274
13275   case " $LIBOBJS " in
13276   *" system.$ac_objext "* ) ;;
13277   *) LIBOBJS="$LIBOBJS system.$ac_objext"
13278  ;;
13279 esac
13280
13281   case " $LIBOBJS " in
13282   *" win32env.$ac_objext "* ) ;;
13283   *) LIBOBJS="$LIBOBJS win32env.$ac_objext"
13284  ;;
13285 esac
13286
13287   case " $LIBOBJS " in
13288   *" win32error.$ac_objext "* ) ;;
13289   *) LIBOBJS="$LIBOBJS win32error.$ac_objext"
13290  ;;
13291 esac
13292
13293   case " $LIBOBJS " in
13294   *" win32security.$ac_objext "* ) ;;
13295   *) LIBOBJS="$LIBOBJS win32security.$ac_objext"
13296  ;;
13297 esac
13298
13299   case " $LIBOBJS " in
13300   *" win32setlocale.$ac_objext "* ) ;;
13301   *) LIBOBJS="$LIBOBJS win32setlocale.$ac_objext"
13302  ;;
13303 esac
13304
13305
13306 $as_echo "#define HAVE_SYMLINK 1" >>confdefs.h
13307
13308   ac_fn_c_check_type "$LINENO" "MINIDUMP_TYPE" "ac_cv_type_MINIDUMP_TYPE" "
13309 #define WIN32_LEAN_AND_MEAN
13310 #include <windows.h>
13311 #include <string.h>
13312 #include <dbghelp.h>
13313 "
13314 if test "x$ac_cv_type_MINIDUMP_TYPE" = xyes; then :
13315
13316 cat >>confdefs.h <<_ACEOF
13317 #define HAVE_MINIDUMP_TYPE 1
13318 _ACEOF
13319
13320 pgac_minidump_type=yes
13321 else
13322   pgac_minidump_type=no
13323 fi
13324
13325 fi
13326 if test x"$pgac_minidump_type" = x"yes" ; then
13327   have_win32_dbghelp=yes
13328
13329 else
13330   have_win32_dbghelp=no
13331
13332 fi
13333
13334 # Cygwin needs only a bit of that
13335 if test "$PORTNAME" = "cygwin"; then
13336   case " $LIBOBJS " in
13337   *" dirmod.$ac_objext "* ) ;;
13338   *) LIBOBJS="$LIBOBJS dirmod.$ac_objext"
13339  ;;
13340 esac
13341
13342 fi
13343
13344 ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include <signal.h>
13345 /* NetBSD declares sys_siglist in unistd.h.  */
13346 #ifdef HAVE_UNISTD_H
13347 # include <unistd.h>
13348 #endif
13349
13350 "
13351 if test "x$ac_cv_have_decl_sys_siglist" = xyes; then :
13352   ac_have_decl=1
13353 else
13354   ac_have_decl=0
13355 fi
13356
13357 cat >>confdefs.h <<_ACEOF
13358 #define HAVE_DECL_SYS_SIGLIST $ac_have_decl
13359 _ACEOF
13360
13361
13362 ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog"
13363 if test "x$ac_cv_func_syslog" = xyes; then :
13364   ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default"
13365 if test "x$ac_cv_header_syslog_h" = xyes; then :
13366
13367 $as_echo "#define HAVE_SYSLOG 1" >>confdefs.h
13368
13369 fi
13370
13371
13372 fi
13373
13374
13375 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opterr" >&5
13376 $as_echo_n "checking for opterr... " >&6; }
13377 if ${pgac_cv_var_int_opterr+:} false; then :
13378   $as_echo_n "(cached) " >&6
13379 else
13380   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13381 /* end confdefs.h.  */
13382 #include <unistd.h>
13383 int
13384 main ()
13385 {
13386 extern int opterr; opterr = 1;
13387   ;
13388   return 0;
13389 }
13390 _ACEOF
13391 if ac_fn_c_try_link "$LINENO"; then :
13392   pgac_cv_var_int_opterr=yes
13393 else
13394   pgac_cv_var_int_opterr=no
13395 fi
13396 rm -f core conftest.err conftest.$ac_objext \
13397     conftest$ac_exeext conftest.$ac_ext
13398 fi
13399 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_opterr" >&5
13400 $as_echo "$pgac_cv_var_int_opterr" >&6; }
13401 if test x"$pgac_cv_var_int_opterr" = x"yes"; then
13402
13403 $as_echo "#define HAVE_INT_OPTERR 1" >>confdefs.h
13404
13405 fi
13406
13407 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for optreset" >&5
13408 $as_echo_n "checking for optreset... " >&6; }
13409 if ${pgac_cv_var_int_optreset+:} false; then :
13410   $as_echo_n "(cached) " >&6
13411 else
13412   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13413 /* end confdefs.h.  */
13414 #include <unistd.h>
13415 int
13416 main ()
13417 {
13418 extern int optreset; optreset = 1;
13419   ;
13420   return 0;
13421 }
13422 _ACEOF
13423 if ac_fn_c_try_link "$LINENO"; then :
13424   pgac_cv_var_int_optreset=yes
13425 else
13426   pgac_cv_var_int_optreset=no
13427 fi
13428 rm -f core conftest.err conftest.$ac_objext \
13429     conftest$ac_exeext conftest.$ac_ext
13430 fi
13431 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_optreset" >&5
13432 $as_echo "$pgac_cv_var_int_optreset" >&6; }
13433 if test x"$pgac_cv_var_int_optreset" = x"yes"; then
13434
13435 $as_echo "#define HAVE_INT_OPTRESET 1" >>confdefs.h
13436
13437 fi
13438
13439 for ac_func in strtoll strtoq
13440 do :
13441   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13442 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13443 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
13444   cat >>confdefs.h <<_ACEOF
13445 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
13446 _ACEOF
13447  break
13448 fi
13449 done
13450
13451 for ac_func in strtoull strtouq
13452 do :
13453   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13454 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13455 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
13456   cat >>confdefs.h <<_ACEOF
13457 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
13458 _ACEOF
13459  break
13460 fi
13461 done
13462
13463
13464 # Lastly, restore full LIBS list and check for readline/libedit symbols
13465 LIBS="$LIBS_including_readline"
13466
13467 if test "$with_readline" = yes; then
13468   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_append_character" >&5
13469 $as_echo_n "checking for rl_completion_append_character... " >&6; }
13470 if ${pgac_cv_var_rl_completion_append_character+:} false; then :
13471   $as_echo_n "(cached) " >&6
13472 else
13473   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13474 /* end confdefs.h.  */
13475 #include <stdio.h>
13476 #ifdef HAVE_READLINE_READLINE_H
13477 # include <readline/readline.h>
13478 #elif defined(HAVE_READLINE_H)
13479 # include <readline.h>
13480 #endif
13481
13482 int
13483 main ()
13484 {
13485 rl_completion_append_character = 'x';
13486   ;
13487   return 0;
13488 }
13489 _ACEOF
13490 if ac_fn_c_try_link "$LINENO"; then :
13491   pgac_cv_var_rl_completion_append_character=yes
13492 else
13493   pgac_cv_var_rl_completion_append_character=no
13494 fi
13495 rm -f core conftest.err conftest.$ac_objext \
13496     conftest$ac_exeext conftest.$ac_ext
13497 fi
13498 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_rl_completion_append_character" >&5
13499 $as_echo "$pgac_cv_var_rl_completion_append_character" >&6; }
13500 if test x"$pgac_cv_var_rl_completion_append_character" = x"yes"; then
13501
13502 $as_echo "#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1" >>confdefs.h
13503
13504 fi
13505   for ac_func in rl_completion_matches rl_filename_completion_function rl_reset_screen_size
13506 do :
13507   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13508 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13509 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
13510   cat >>confdefs.h <<_ACEOF
13511 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
13512 _ACEOF
13513
13514 fi
13515 done
13516
13517   for ac_func in append_history history_truncate_file
13518 do :
13519   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13520 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13521 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
13522   cat >>confdefs.h <<_ACEOF
13523 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
13524 _ACEOF
13525
13526 fi
13527 done
13528
13529 fi
13530
13531
13532 # This test makes sure that run tests work at all.  Sometimes a shared
13533 # library is found by the linker, but the runtime linker can't find it.
13534 # This check should come after all modifications of compiler or linker
13535 # variables, and before any other run tests.
13536 { $as_echo "$as_me:${as_lineno-$LINENO}: checking test program" >&5
13537 $as_echo_n "checking test program... " >&6; }
13538 if test "$cross_compiling" = yes; then :
13539   { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling" >&5
13540 $as_echo "cross-compiling" >&6; }
13541 else
13542   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13543 /* end confdefs.h.  */
13544 int main() { return 0; }
13545 _ACEOF
13546 if ac_fn_c_try_run "$LINENO"; then :
13547   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
13548 $as_echo "ok" >&6; }
13549 else
13550   { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
13551 $as_echo "failed" >&6; }
13552 as_fn_error $? "
13553 Could not execute a simple test program.  This may be a problem
13554 related to locating shared libraries.  Check the file 'config.log'
13555 for the exact reason." "$LINENO" 5
13556 fi
13557 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13558   conftest.$ac_objext conftest.beam conftest.$ac_ext
13559 fi
13560
13561
13562 # --------------------
13563 # Run tests below here
13564 # --------------------
13565
13566 # Force use of our snprintf if system's doesn't do arg control
13567 # See comment above at snprintf test for details.
13568 if test "$enable_nls" = yes -a "$pgac_need_repl_snprintf" = no; then
13569   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf supports argument control" >&5
13570 $as_echo_n "checking whether snprintf supports argument control... " >&6; }
13571 if ${pgac_cv_snprintf_arg_control+:} false; then :
13572   $as_echo_n "(cached) " >&6
13573 else
13574   if test "$cross_compiling" = yes; then :
13575   pgac_cv_snprintf_arg_control=cross
13576 else
13577   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13578 /* end confdefs.h.  */
13579 #include <stdio.h>
13580 #include <string.h>
13581
13582 int main()
13583 {
13584   char buf[100];
13585
13586   /* can it swap arguments? */
13587   snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
13588   if (strcmp(buf, "4 3") != 0)
13589     return 1;
13590   return 0;
13591 }
13592 _ACEOF
13593 if ac_fn_c_try_run "$LINENO"; then :
13594   pgac_cv_snprintf_arg_control=yes
13595 else
13596   pgac_cv_snprintf_arg_control=no
13597 fi
13598 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13599   conftest.$ac_objext conftest.beam conftest.$ac_ext
13600 fi
13601
13602
13603 fi
13604 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_arg_control" >&5
13605 $as_echo "$pgac_cv_snprintf_arg_control" >&6; }
13606
13607   if test $pgac_cv_snprintf_arg_control != yes ; then
13608     pgac_need_repl_snprintf=yes
13609   fi
13610 fi
13611
13612
13613
13614
13615 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long int is 64 bits" >&5
13616 $as_echo_n "checking whether long int is 64 bits... " >&6; }
13617 if ${pgac_cv_type_long_int_64+:} false; then :
13618   $as_echo_n "(cached) " >&6
13619 else
13620   if test "$cross_compiling" = yes; then :
13621   # If cross-compiling, check the size reported by the compiler and
13622 # trust that the arithmetic works.
13623 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13624 /* end confdefs.h.  */
13625
13626 int
13627 main ()
13628 {
13629 static int test_array [1 - 2 * !(sizeof(long int) == 8)];
13630 test_array [0] = 0;
13631 return test_array [0];
13632
13633   ;
13634   return 0;
13635 }
13636 _ACEOF
13637 if ac_fn_c_try_compile "$LINENO"; then :
13638   pgac_cv_type_long_int_64=yes
13639 else
13640   pgac_cv_type_long_int_64=no
13641 fi
13642 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13643 else
13644   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13645 /* end confdefs.h.  */
13646 typedef long int ac_int64;
13647
13648 /*
13649  * These are globals to discourage the compiler from folding all the
13650  * arithmetic tests down to compile-time constants.
13651  */
13652 ac_int64 a = 20000001;
13653 ac_int64 b = 40000005;
13654
13655 int does_int64_work()
13656 {
13657   ac_int64 c,d;
13658
13659   if (sizeof(ac_int64) != 8)
13660     return 0;                   /* definitely not the right size */
13661
13662   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
13663   c = a * b;
13664   d = (c + b) / b;
13665   if (d != a+1)
13666     return 0;
13667   return 1;
13668 }
13669
13670 int
13671 main() {
13672   return (! does_int64_work());
13673 }
13674 _ACEOF
13675 if ac_fn_c_try_run "$LINENO"; then :
13676   pgac_cv_type_long_int_64=yes
13677 else
13678   pgac_cv_type_long_int_64=no
13679 fi
13680 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13681   conftest.$ac_objext conftest.beam conftest.$ac_ext
13682 fi
13683
13684 fi
13685 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_long_int_64" >&5
13686 $as_echo "$pgac_cv_type_long_int_64" >&6; }
13687
13688 HAVE_LONG_INT_64=$pgac_cv_type_long_int_64
13689 if test x"$pgac_cv_type_long_int_64" = xyes ; then
13690
13691 $as_echo "#define HAVE_LONG_INT_64 1" >>confdefs.h
13692
13693 fi
13694
13695
13696 if test x"$HAVE_LONG_INT_64" = x"yes" ; then
13697   pg_int64_type="long int"
13698 else
13699   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long long int is 64 bits" >&5
13700 $as_echo_n "checking whether long long int is 64 bits... " >&6; }
13701 if ${pgac_cv_type_long_long_int_64+:} false; then :
13702   $as_echo_n "(cached) " >&6
13703 else
13704   if test "$cross_compiling" = yes; then :
13705   # If cross-compiling, check the size reported by the compiler and
13706 # trust that the arithmetic works.
13707 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13708 /* end confdefs.h.  */
13709
13710 int
13711 main ()
13712 {
13713 static int test_array [1 - 2 * !(sizeof(long long int) == 8)];
13714 test_array [0] = 0;
13715 return test_array [0];
13716
13717   ;
13718   return 0;
13719 }
13720 _ACEOF
13721 if ac_fn_c_try_compile "$LINENO"; then :
13722   pgac_cv_type_long_long_int_64=yes
13723 else
13724   pgac_cv_type_long_long_int_64=no
13725 fi
13726 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13727 else
13728   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13729 /* end confdefs.h.  */
13730 typedef long long int ac_int64;
13731
13732 /*
13733  * These are globals to discourage the compiler from folding all the
13734  * arithmetic tests down to compile-time constants.
13735  */
13736 ac_int64 a = 20000001;
13737 ac_int64 b = 40000005;
13738
13739 int does_int64_work()
13740 {
13741   ac_int64 c,d;
13742
13743   if (sizeof(ac_int64) != 8)
13744     return 0;                   /* definitely not the right size */
13745
13746   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
13747   c = a * b;
13748   d = (c + b) / b;
13749   if (d != a+1)
13750     return 0;
13751   return 1;
13752 }
13753
13754 int
13755 main() {
13756   return (! does_int64_work());
13757 }
13758 _ACEOF
13759 if ac_fn_c_try_run "$LINENO"; then :
13760   pgac_cv_type_long_long_int_64=yes
13761 else
13762   pgac_cv_type_long_long_int_64=no
13763 fi
13764 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13765   conftest.$ac_objext conftest.beam conftest.$ac_ext
13766 fi
13767
13768 fi
13769 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_long_long_int_64" >&5
13770 $as_echo "$pgac_cv_type_long_long_int_64" >&6; }
13771
13772 HAVE_LONG_LONG_INT_64=$pgac_cv_type_long_long_int_64
13773 if test x"$pgac_cv_type_long_long_int_64" = xyes ; then
13774
13775 $as_echo "#define HAVE_LONG_LONG_INT_64 1" >>confdefs.h
13776
13777 fi
13778
13779   if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then
13780     pg_int64_type="long long int"
13781   else
13782     as_fn_error $? "Cannot find a working 64-bit integer type." "$LINENO" 5
13783   fi
13784 fi
13785
13786
13787 cat >>confdefs.h <<_ACEOF
13788 #define PG_INT64_TYPE $pg_int64_type
13789 _ACEOF
13790
13791
13792
13793 if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then
13794   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13795 /* end confdefs.h.  */
13796
13797 #define INT64CONST(x)  x##LL
13798 long long int foo = INT64CONST(0x1234567890123456);
13799
13800 _ACEOF
13801 if ac_fn_c_try_compile "$LINENO"; then :
13802
13803 $as_echo "#define HAVE_LL_CONSTANTS 1" >>confdefs.h
13804
13805 fi
13806 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13807 fi
13808
13809
13810 # If we found "long int" is 64 bits, assume snprintf handles it.  If
13811 # we found we need to use "long long int", better check.  We cope with
13812 # snprintfs that use %lld, %qd, or %I64d as the format.  If none of these
13813 # work, fall back to our own snprintf emulation (which we know uses %lld).
13814
13815 if test "$HAVE_LONG_LONG_INT_64" = yes ; then
13816   if test $pgac_need_repl_snprintf = no; then
13817     { $as_echo "$as_me:${as_lineno-$LINENO}: checking snprintf length modifier for long long int" >&5
13818 $as_echo_n "checking snprintf length modifier for long long int... " >&6; }
13819 if ${pgac_cv_snprintf_long_long_int_modifier+:} false; then :
13820   $as_echo_n "(cached) " >&6
13821 else
13822   for pgac_modifier in 'll' 'q' 'I64'; do
13823 if test "$cross_compiling" = yes; then :
13824   pgac_cv_snprintf_long_long_int_modifier=cross; break
13825 else
13826   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13827 /* end confdefs.h.  */
13828 #include <stdio.h>
13829 #include <string.h>
13830 typedef long long int ac_int64;
13831 #define INT64_FORMAT "%${pgac_modifier}d"
13832
13833 ac_int64 a = 20000001;
13834 ac_int64 b = 40000005;
13835
13836 int does_int64_snprintf_work()
13837 {
13838   ac_int64 c;
13839   char buf[100];
13840
13841   if (sizeof(ac_int64) != 8)
13842     return 0;                   /* doesn't look like the right size */
13843
13844   c = a * b;
13845   snprintf(buf, 100, INT64_FORMAT, c);
13846   if (strcmp(buf, "800000140000005") != 0)
13847     return 0;                   /* either multiply or snprintf is busted */
13848   return 1;
13849 }
13850
13851 int
13852 main() {
13853   return (! does_int64_snprintf_work());
13854 }
13855 _ACEOF
13856 if ac_fn_c_try_run "$LINENO"; then :
13857   pgac_cv_snprintf_long_long_int_modifier=$pgac_modifier; break
13858 fi
13859 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13860   conftest.$ac_objext conftest.beam conftest.$ac_ext
13861 fi
13862
13863 done
13864 fi
13865
13866 LONG_LONG_INT_MODIFIER=''
13867
13868 case $pgac_cv_snprintf_long_long_int_modifier in
13869   cross) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot test (not on host machine)" >&5
13870 $as_echo "cannot test (not on host machine)" >&6; };;
13871   ?*)    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_long_long_int_modifier" >&5
13872 $as_echo "$pgac_cv_snprintf_long_long_int_modifier" >&6; }
13873          LONG_LONG_INT_MODIFIER=$pgac_cv_snprintf_long_long_int_modifier;;
13874   *)     { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
13875 $as_echo "none" >&6; };;
13876 esac
13877     if test "$LONG_LONG_INT_MODIFIER" = ""; then
13878       # Force usage of our own snprintf, since system snprintf is broken
13879       pgac_need_repl_snprintf=yes
13880       LONG_LONG_INT_MODIFIER='ll'
13881     fi
13882   else
13883     # Here if we previously decided we needed to use our own snprintf
13884     LONG_LONG_INT_MODIFIER='ll'
13885   fi
13886 else
13887   # Here if we are not using 'long long int' at all
13888   LONG_LONG_INT_MODIFIER='l'
13889 fi
13890
13891 INT64_MODIFIER="\"$LONG_LONG_INT_MODIFIER\""
13892
13893
13894 cat >>confdefs.h <<_ACEOF
13895 #define INT64_MODIFIER $INT64_MODIFIER
13896 _ACEOF
13897
13898
13899 # Also force use of our snprintf if the system's doesn't support the %z flag.
13900 if test "$pgac_need_repl_snprintf" = no; then
13901   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf supports the %z modifier" >&5
13902 $as_echo_n "checking whether snprintf supports the %z modifier... " >&6; }
13903 if ${pgac_cv_snprintf_size_t_support+:} false; then :
13904   $as_echo_n "(cached) " >&6
13905 else
13906   if test "$cross_compiling" = yes; then :
13907   pgac_cv_snprintf_size_t_support=cross
13908 else
13909   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13910 /* end confdefs.h.  */
13911 #include <stdio.h>
13912 #include <string.h>
13913
13914 int main()
13915 {
13916   char bufz[100];
13917   char buf64[100];
13918
13919   /*
13920    * Print the largest unsigned number fitting in a size_t using both %zu
13921    * and the previously-determined format for 64-bit integers.  Note that
13922    * we don't run this code unless we know snprintf handles 64-bit ints.
13923    */
13924   bufz[0] = '\0';  /* in case snprintf fails to emit anything */
13925   snprintf(bufz, sizeof(bufz), "%zu", ~((size_t) 0));
13926   snprintf(buf64, sizeof(buf64), "%" INT64_MODIFIER "u",
13927     (unsigned PG_INT64_TYPE) ~((size_t) 0));
13928   if (strcmp(bufz, buf64) != 0)
13929     return 1;
13930   return 0;
13931 }
13932 _ACEOF
13933 if ac_fn_c_try_run "$LINENO"; then :
13934   pgac_cv_snprintf_size_t_support=yes
13935 else
13936   pgac_cv_snprintf_size_t_support=no
13937 fi
13938 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13939   conftest.$ac_objext conftest.beam conftest.$ac_ext
13940 fi
13941
13942
13943 fi
13944 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_size_t_support" >&5
13945 $as_echo "$pgac_cv_snprintf_size_t_support" >&6; }
13946
13947   if test "$pgac_cv_snprintf_size_t_support" != yes; then
13948     pgac_need_repl_snprintf=yes
13949   fi
13950 fi
13951
13952 # Now we have checked all the reasons to replace snprintf
13953 if test $pgac_need_repl_snprintf = yes; then
13954
13955 $as_echo "#define USE_REPL_SNPRINTF 1" >>confdefs.h
13956
13957   case " $LIBOBJS " in
13958   *" snprintf.$ac_objext "* ) ;;
13959   *) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
13960  ;;
13961 esac
13962
13963 fi
13964
13965 # Check size of void *, size_t (enables tweaks for > 32bit address space)
13966 # The cast to long int works around a bug in the HP C Compiler
13967 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
13968 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
13969 # This bug is HP SR number 8606223364.
13970 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
13971 $as_echo_n "checking size of void *... " >&6; }
13972 if ${ac_cv_sizeof_void_p+:} false; then :
13973   $as_echo_n "(cached) " >&6
13974 else
13975   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p"        "$ac_includes_default"; then :
13976
13977 else
13978   if test "$ac_cv_type_void_p" = yes; then
13979      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13980 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13981 as_fn_error 77 "cannot compute sizeof (void *)
13982 See \`config.log' for more details" "$LINENO" 5; }
13983    else
13984      ac_cv_sizeof_void_p=0
13985    fi
13986 fi
13987
13988 fi
13989 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
13990 $as_echo "$ac_cv_sizeof_void_p" >&6; }
13991
13992
13993
13994 cat >>confdefs.h <<_ACEOF
13995 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
13996 _ACEOF
13997
13998
13999 # The cast to long int works around a bug in the HP C Compiler
14000 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
14001 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
14002 # This bug is HP SR number 8606223364.
14003 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
14004 $as_echo_n "checking size of size_t... " >&6; }
14005 if ${ac_cv_sizeof_size_t+:} false; then :
14006   $as_echo_n "(cached) " >&6
14007 else
14008   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t"        "$ac_includes_default"; then :
14009
14010 else
14011   if test "$ac_cv_type_size_t" = yes; then
14012      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14013 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14014 as_fn_error 77 "cannot compute sizeof (size_t)
14015 See \`config.log' for more details" "$LINENO" 5; }
14016    else
14017      ac_cv_sizeof_size_t=0
14018    fi
14019 fi
14020
14021 fi
14022 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
14023 $as_echo "$ac_cv_sizeof_size_t" >&6; }
14024
14025
14026
14027 cat >>confdefs.h <<_ACEOF
14028 #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
14029 _ACEOF
14030
14031
14032 # The cast to long int works around a bug in the HP C Compiler
14033 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
14034 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
14035 # This bug is HP SR number 8606223364.
14036 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
14037 $as_echo_n "checking size of long... " >&6; }
14038 if ${ac_cv_sizeof_long+:} false; then :
14039   $as_echo_n "(cached) " >&6
14040 else
14041   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long"        "$ac_includes_default"; then :
14042
14043 else
14044   if test "$ac_cv_type_long" = yes; then
14045      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14046 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14047 as_fn_error 77 "cannot compute sizeof (long)
14048 See \`config.log' for more details" "$LINENO" 5; }
14049    else
14050      ac_cv_sizeof_long=0
14051    fi
14052 fi
14053
14054 fi
14055 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
14056 $as_echo "$ac_cv_sizeof_long" >&6; }
14057
14058
14059
14060 cat >>confdefs.h <<_ACEOF
14061 #define SIZEOF_LONG $ac_cv_sizeof_long
14062 _ACEOF
14063
14064
14065
14066 # Decide whether float4 is passed by value: user-selectable, enabled by default
14067 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float4 passed by value" >&5
14068 $as_echo_n "checking whether to build with float4 passed by value... " >&6; }
14069
14070
14071 # Check whether --enable-float4-byval was given.
14072 if test "${enable_float4_byval+set}" = set; then :
14073   enableval=$enable_float4_byval;
14074   case $enableval in
14075     yes)
14076
14077 $as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
14078
14079                float4passbyval=true
14080       ;;
14081     no)
14082       float4passbyval=false
14083       ;;
14084     *)
14085       as_fn_error $? "no argument expected for --enable-float4-byval option" "$LINENO" 5
14086       ;;
14087   esac
14088
14089 else
14090   enable_float4_byval=yes
14091
14092 $as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
14093
14094                float4passbyval=true
14095 fi
14096
14097
14098 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float4_byval" >&5
14099 $as_echo "$enable_float4_byval" >&6; }
14100
14101 cat >>confdefs.h <<_ACEOF
14102 #define FLOAT4PASSBYVAL $float4passbyval
14103 _ACEOF
14104
14105
14106 # Decide whether float8 is passed by value.
14107 # Note: this setting also controls int8 and related types such as timestamp.
14108 # If sizeof(Datum) >= 8, this is user-selectable, enabled by default.
14109 # If not, trying to select it is an error.
14110 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float8 passed by value" >&5
14111 $as_echo_n "checking whether to build with float8 passed by value... " >&6; }
14112 if test $ac_cv_sizeof_void_p -ge 8 ; then
14113
14114
14115 # Check whether --enable-float8-byval was given.
14116 if test "${enable_float8_byval+set}" = set; then :
14117   enableval=$enable_float8_byval;
14118   case $enableval in
14119     yes)
14120       :
14121       ;;
14122     no)
14123       :
14124       ;;
14125     *)
14126       as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5
14127       ;;
14128   esac
14129
14130 else
14131   enable_float8_byval=yes
14132
14133 fi
14134
14135
14136 else
14137
14138
14139 # Check whether --enable-float8-byval was given.
14140 if test "${enable_float8_byval+set}" = set; then :
14141   enableval=$enable_float8_byval;
14142   case $enableval in
14143     yes)
14144       :
14145       ;;
14146     no)
14147       :
14148       ;;
14149     *)
14150       as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5
14151       ;;
14152   esac
14153
14154 else
14155   enable_float8_byval=no
14156
14157 fi
14158
14159
14160   if test "$enable_float8_byval" = yes ; then
14161     as_fn_error $? "--enable-float8-byval is not supported on 32-bit platforms." "$LINENO" 5
14162   fi
14163 fi
14164 if test "$enable_float8_byval" = yes ; then
14165
14166 $as_echo "#define USE_FLOAT8_BYVAL 1" >>confdefs.h
14167
14168   float8passbyval=true
14169 else
14170   float8passbyval=false
14171 fi
14172 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float8_byval" >&5
14173 $as_echo "$enable_float8_byval" >&6; }
14174
14175 cat >>confdefs.h <<_ACEOF
14176 #define FLOAT8PASSBYVAL $float8passbyval
14177 _ACEOF
14178
14179
14180 # Determine memory alignment requirements for the basic C data types.
14181
14182 # The cast to long int works around a bug in the HP C Compiler,
14183 # see AC_CHECK_SIZEOF for more information.
14184 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of short" >&5
14185 $as_echo_n "checking alignment of short... " >&6; }
14186 if ${ac_cv_alignof_short+:} false; then :
14187   $as_echo_n "(cached) " >&6
14188 else
14189   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_short"        "$ac_includes_default
14190 #ifndef offsetof
14191 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
14192 #endif
14193 typedef struct { char x; short y; } ac__type_alignof_;"; then :
14194
14195 else
14196   if test "$ac_cv_type_short" = yes; then
14197      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14198 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14199 as_fn_error 77 "cannot compute alignment of short
14200 See \`config.log' for more details" "$LINENO" 5; }
14201    else
14202      ac_cv_alignof_short=0
14203    fi
14204 fi
14205
14206 fi
14207 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_short" >&5
14208 $as_echo "$ac_cv_alignof_short" >&6; }
14209
14210
14211
14212 cat >>confdefs.h <<_ACEOF
14213 #define ALIGNOF_SHORT $ac_cv_alignof_short
14214 _ACEOF
14215
14216
14217 # The cast to long int works around a bug in the HP C Compiler,
14218 # see AC_CHECK_SIZEOF for more information.
14219 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of int" >&5
14220 $as_echo_n "checking alignment of int... " >&6; }
14221 if ${ac_cv_alignof_int+:} false; then :
14222   $as_echo_n "(cached) " >&6
14223 else
14224   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_int"        "$ac_includes_default
14225 #ifndef offsetof
14226 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
14227 #endif
14228 typedef struct { char x; int y; } ac__type_alignof_;"; then :
14229
14230 else
14231   if test "$ac_cv_type_int" = yes; then
14232      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14233 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14234 as_fn_error 77 "cannot compute alignment of int
14235 See \`config.log' for more details" "$LINENO" 5; }
14236    else
14237      ac_cv_alignof_int=0
14238    fi
14239 fi
14240
14241 fi
14242 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_int" >&5
14243 $as_echo "$ac_cv_alignof_int" >&6; }
14244
14245
14246
14247 cat >>confdefs.h <<_ACEOF
14248 #define ALIGNOF_INT $ac_cv_alignof_int
14249 _ACEOF
14250
14251
14252 # The cast to long int works around a bug in the HP C Compiler,
14253 # see AC_CHECK_SIZEOF for more information.
14254 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of long" >&5
14255 $as_echo_n "checking alignment of long... " >&6; }
14256 if ${ac_cv_alignof_long+:} false; then :
14257   $as_echo_n "(cached) " >&6
14258 else
14259   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long"        "$ac_includes_default
14260 #ifndef offsetof
14261 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
14262 #endif
14263 typedef struct { char x; long y; } ac__type_alignof_;"; then :
14264
14265 else
14266   if test "$ac_cv_type_long" = yes; then
14267      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14268 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14269 as_fn_error 77 "cannot compute alignment of long
14270 See \`config.log' for more details" "$LINENO" 5; }
14271    else
14272      ac_cv_alignof_long=0
14273    fi
14274 fi
14275
14276 fi
14277 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long" >&5
14278 $as_echo "$ac_cv_alignof_long" >&6; }
14279
14280
14281
14282 cat >>confdefs.h <<_ACEOF
14283 #define ALIGNOF_LONG $ac_cv_alignof_long
14284 _ACEOF
14285
14286
14287 if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then
14288   # The cast to long int works around a bug in the HP C Compiler,
14289 # see AC_CHECK_SIZEOF for more information.
14290 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of long long int" >&5
14291 $as_echo_n "checking alignment of long long int... " >&6; }
14292 if ${ac_cv_alignof_long_long_int+:} false; then :
14293   $as_echo_n "(cached) " >&6
14294 else
14295   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long_long_int"        "$ac_includes_default
14296 #ifndef offsetof
14297 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
14298 #endif
14299 typedef struct { char x; long long int y; } ac__type_alignof_;"; then :
14300
14301 else
14302   if test "$ac_cv_type_long_long_int" = yes; then
14303      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14304 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14305 as_fn_error 77 "cannot compute alignment of long long int
14306 See \`config.log' for more details" "$LINENO" 5; }
14307    else
14308      ac_cv_alignof_long_long_int=0
14309    fi
14310 fi
14311
14312 fi
14313 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long_long_int" >&5
14314 $as_echo "$ac_cv_alignof_long_long_int" >&6; }
14315
14316
14317
14318 cat >>confdefs.h <<_ACEOF
14319 #define ALIGNOF_LONG_LONG_INT $ac_cv_alignof_long_long_int
14320 _ACEOF
14321
14322
14323 fi
14324 # The cast to long int works around a bug in the HP C Compiler,
14325 # see AC_CHECK_SIZEOF for more information.
14326 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of double" >&5
14327 $as_echo_n "checking alignment of double... " >&6; }
14328 if ${ac_cv_alignof_double+:} false; then :
14329   $as_echo_n "(cached) " >&6
14330 else
14331   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_double"        "$ac_includes_default
14332 #ifndef offsetof
14333 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
14334 #endif
14335 typedef struct { char x; double y; } ac__type_alignof_;"; then :
14336
14337 else
14338   if test "$ac_cv_type_double" = yes; then
14339      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14340 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14341 as_fn_error 77 "cannot compute alignment of double
14342 See \`config.log' for more details" "$LINENO" 5; }
14343    else
14344      ac_cv_alignof_double=0
14345    fi
14346 fi
14347
14348 fi
14349 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_double" >&5
14350 $as_echo "$ac_cv_alignof_double" >&6; }
14351
14352
14353
14354 cat >>confdefs.h <<_ACEOF
14355 #define ALIGNOF_DOUBLE $ac_cv_alignof_double
14356 _ACEOF
14357
14358
14359
14360 # Compute maximum alignment of any basic type.
14361 # We assume long's alignment is at least as strong as char, short, or int;
14362 # but we must check long long (if it exists) and double.
14363
14364 MAX_ALIGNOF=$ac_cv_alignof_long
14365 if test $MAX_ALIGNOF -lt $ac_cv_alignof_double ; then
14366   MAX_ALIGNOF=$ac_cv_alignof_double
14367 fi
14368 if test x"$HAVE_LONG_LONG_INT_64" = xyes && test $MAX_ALIGNOF -lt $ac_cv_alignof_long_long_int ; then
14369   MAX_ALIGNOF="$ac_cv_alignof_long_long_int"
14370 fi
14371
14372 cat >>confdefs.h <<_ACEOF
14373 #define MAXIMUM_ALIGNOF $MAX_ALIGNOF
14374 _ACEOF
14375
14376
14377
14378 # Some platforms predefine the types int8, int16, etc.  Only check
14379 # a (hopefully) representative subset.
14380 ac_fn_c_check_type "$LINENO" "int8" "ac_cv_type_int8" "#include <stdio.h>
14381 "
14382 if test "x$ac_cv_type_int8" = xyes; then :
14383
14384 cat >>confdefs.h <<_ACEOF
14385 #define HAVE_INT8 1
14386 _ACEOF
14387
14388
14389 fi
14390 ac_fn_c_check_type "$LINENO" "uint8" "ac_cv_type_uint8" "#include <stdio.h>
14391 "
14392 if test "x$ac_cv_type_uint8" = xyes; then :
14393
14394 cat >>confdefs.h <<_ACEOF
14395 #define HAVE_UINT8 1
14396 _ACEOF
14397
14398
14399 fi
14400 ac_fn_c_check_type "$LINENO" "int64" "ac_cv_type_int64" "#include <stdio.h>
14401 "
14402 if test "x$ac_cv_type_int64" = xyes; then :
14403
14404 cat >>confdefs.h <<_ACEOF
14405 #define HAVE_INT64 1
14406 _ACEOF
14407
14408
14409 fi
14410 ac_fn_c_check_type "$LINENO" "uint64" "ac_cv_type_uint64" "#include <stdio.h>
14411 "
14412 if test "x$ac_cv_type_uint64" = xyes; then :
14413
14414 cat >>confdefs.h <<_ACEOF
14415 #define HAVE_UINT64 1
14416 _ACEOF
14417
14418
14419 fi
14420
14421
14422 # Check for extensions offering the integer scalar type __int128.
14423 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __int128" >&5
14424 $as_echo_n "checking for __int128... " >&6; }
14425 if ${pgac_cv__128bit_int+:} false; then :
14426   $as_echo_n "(cached) " >&6
14427 else
14428   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14429 /* end confdefs.h.  */
14430
14431 /*
14432  * These are globals to discourage the compiler from folding all the
14433  * arithmetic tests down to compile-time constants.  We do not have
14434  * convenient support for 64bit literals at this point...
14435  */
14436 __int128 a = 48828125;
14437 __int128 b = 97656255;
14438
14439 int
14440 main ()
14441 {
14442
14443 __int128 c,d;
14444 a = (a << 12) + 1; /* 200000000001 */
14445 b = (b << 12) + 5; /* 400000000005 */
14446 /* use the most relevant arithmetic ops */
14447 c = a * b;
14448 d = (c + b) / b;
14449 /* return different values, to prevent optimizations */
14450 if (d != a+1)
14451   return 0;
14452 return 1;
14453
14454   ;
14455   return 0;
14456 }
14457 _ACEOF
14458 if ac_fn_c_try_link "$LINENO"; then :
14459   pgac_cv__128bit_int=yes
14460 else
14461   pgac_cv__128bit_int=no
14462 fi
14463 rm -f core conftest.err conftest.$ac_objext \
14464     conftest$ac_exeext conftest.$ac_ext
14465 fi
14466 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__128bit_int" >&5
14467 $as_echo "$pgac_cv__128bit_int" >&6; }
14468 if test x"$pgac_cv__128bit_int" = xyes ; then
14469
14470 $as_echo "#define PG_INT128_TYPE __int128" >>confdefs.h
14471
14472 fi
14473
14474 # Check for various atomic operations now that we have checked how to declare
14475 # 64bit integers.
14476 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync char locking functions" >&5
14477 $as_echo_n "checking for builtin __sync char locking functions... " >&6; }
14478 if ${pgac_cv_gcc_sync_char_tas+:} false; then :
14479   $as_echo_n "(cached) " >&6
14480 else
14481   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14482 /* end confdefs.h.  */
14483
14484 int
14485 main ()
14486 {
14487 char lock = 0;
14488    __sync_lock_test_and_set(&lock, 1);
14489    __sync_lock_release(&lock);
14490   ;
14491   return 0;
14492 }
14493 _ACEOF
14494 if ac_fn_c_try_link "$LINENO"; then :
14495   pgac_cv_gcc_sync_char_tas="yes"
14496 else
14497   pgac_cv_gcc_sync_char_tas="no"
14498 fi
14499 rm -f core conftest.err conftest.$ac_objext \
14500     conftest$ac_exeext conftest.$ac_ext
14501 fi
14502 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_char_tas" >&5
14503 $as_echo "$pgac_cv_gcc_sync_char_tas" >&6; }
14504 if test x"$pgac_cv_gcc_sync_char_tas" = x"yes"; then
14505
14506 $as_echo "#define HAVE_GCC__SYNC_CHAR_TAS 1" >>confdefs.h
14507
14508 fi
14509 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int32 locking functions" >&5
14510 $as_echo_n "checking for builtin __sync int32 locking functions... " >&6; }
14511 if ${pgac_cv_gcc_sync_int32_tas+:} false; then :
14512   $as_echo_n "(cached) " >&6
14513 else
14514   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14515 /* end confdefs.h.  */
14516
14517 int
14518 main ()
14519 {
14520 int lock = 0;
14521    __sync_lock_test_and_set(&lock, 1);
14522    __sync_lock_release(&lock);
14523   ;
14524   return 0;
14525 }
14526 _ACEOF
14527 if ac_fn_c_try_link "$LINENO"; then :
14528   pgac_cv_gcc_sync_int32_tas="yes"
14529 else
14530   pgac_cv_gcc_sync_int32_tas="no"
14531 fi
14532 rm -f core conftest.err conftest.$ac_objext \
14533     conftest$ac_exeext conftest.$ac_ext
14534 fi
14535 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int32_tas" >&5
14536 $as_echo "$pgac_cv_gcc_sync_int32_tas" >&6; }
14537 if test x"$pgac_cv_gcc_sync_int32_tas" = x"yes"; then
14538
14539 $as_echo "#define HAVE_GCC__SYNC_INT32_TAS 1" >>confdefs.h
14540
14541 fi
14542 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int32 atomic operations" >&5
14543 $as_echo_n "checking for builtin __sync int32 atomic operations... " >&6; }
14544 if ${pgac_cv_gcc_sync_int32_cas+:} false; then :
14545   $as_echo_n "(cached) " >&6
14546 else
14547   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14548 /* end confdefs.h.  */
14549
14550 int
14551 main ()
14552 {
14553 int val = 0;
14554    __sync_val_compare_and_swap(&val, 0, 37);
14555   ;
14556   return 0;
14557 }
14558 _ACEOF
14559 if ac_fn_c_try_link "$LINENO"; then :
14560   pgac_cv_gcc_sync_int32_cas="yes"
14561 else
14562   pgac_cv_gcc_sync_int32_cas="no"
14563 fi
14564 rm -f core conftest.err conftest.$ac_objext \
14565     conftest$ac_exeext conftest.$ac_ext
14566 fi
14567 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int32_cas" >&5
14568 $as_echo "$pgac_cv_gcc_sync_int32_cas" >&6; }
14569 if test x"$pgac_cv_gcc_sync_int32_cas" = x"yes"; then
14570
14571 $as_echo "#define HAVE_GCC__SYNC_INT32_CAS 1" >>confdefs.h
14572
14573 fi
14574 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int64 atomic operations" >&5
14575 $as_echo_n "checking for builtin __sync int64 atomic operations... " >&6; }
14576 if ${pgac_cv_gcc_sync_int64_cas+:} false; then :
14577   $as_echo_n "(cached) " >&6
14578 else
14579   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14580 /* end confdefs.h.  */
14581
14582 int
14583 main ()
14584 {
14585 PG_INT64_TYPE lock = 0;
14586    __sync_val_compare_and_swap(&lock, 0, (PG_INT64_TYPE) 37);
14587   ;
14588   return 0;
14589 }
14590 _ACEOF
14591 if ac_fn_c_try_link "$LINENO"; then :
14592   pgac_cv_gcc_sync_int64_cas="yes"
14593 else
14594   pgac_cv_gcc_sync_int64_cas="no"
14595 fi
14596 rm -f core conftest.err conftest.$ac_objext \
14597     conftest$ac_exeext conftest.$ac_ext
14598 fi
14599 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int64_cas" >&5
14600 $as_echo "$pgac_cv_gcc_sync_int64_cas" >&6; }
14601 if test x"$pgac_cv_gcc_sync_int64_cas" = x"yes"; then
14602
14603 $as_echo "#define HAVE_GCC__SYNC_INT64_CAS 1" >>confdefs.h
14604
14605 fi
14606 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic int32 atomic operations" >&5
14607 $as_echo_n "checking for builtin __atomic int32 atomic operations... " >&6; }
14608 if ${pgac_cv_gcc_atomic_int32_cas+:} false; then :
14609   $as_echo_n "(cached) " >&6
14610 else
14611   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14612 /* end confdefs.h.  */
14613
14614 int
14615 main ()
14616 {
14617 int val = 0;
14618    int expect = 0;
14619    __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
14620   ;
14621   return 0;
14622 }
14623 _ACEOF
14624 if ac_fn_c_try_link "$LINENO"; then :
14625   pgac_cv_gcc_atomic_int32_cas="yes"
14626 else
14627   pgac_cv_gcc_atomic_int32_cas="no"
14628 fi
14629 rm -f core conftest.err conftest.$ac_objext \
14630     conftest$ac_exeext conftest.$ac_ext
14631 fi
14632 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_atomic_int32_cas" >&5
14633 $as_echo "$pgac_cv_gcc_atomic_int32_cas" >&6; }
14634 if test x"$pgac_cv_gcc_atomic_int32_cas" = x"yes"; then
14635
14636 $as_echo "#define HAVE_GCC__ATOMIC_INT32_CAS 1" >>confdefs.h
14637
14638 fi
14639 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic int64 atomic operations" >&5
14640 $as_echo_n "checking for builtin __atomic int64 atomic operations... " >&6; }
14641 if ${pgac_cv_gcc_atomic_int64_cas+:} false; then :
14642   $as_echo_n "(cached) " >&6
14643 else
14644   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14645 /* end confdefs.h.  */
14646
14647 int
14648 main ()
14649 {
14650 PG_INT64_TYPE val = 0;
14651    PG_INT64_TYPE expect = 0;
14652    __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
14653   ;
14654   return 0;
14655 }
14656 _ACEOF
14657 if ac_fn_c_try_link "$LINENO"; then :
14658   pgac_cv_gcc_atomic_int64_cas="yes"
14659 else
14660   pgac_cv_gcc_atomic_int64_cas="no"
14661 fi
14662 rm -f core conftest.err conftest.$ac_objext \
14663     conftest$ac_exeext conftest.$ac_ext
14664 fi
14665 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_atomic_int64_cas" >&5
14666 $as_echo "$pgac_cv_gcc_atomic_int64_cas" >&6; }
14667 if test x"$pgac_cv_gcc_atomic_int64_cas" = x"yes"; then
14668
14669 $as_echo "#define HAVE_GCC__ATOMIC_INT64_CAS 1" >>confdefs.h
14670
14671 fi
14672
14673
14674 # Check for x86 cpuid instruction
14675 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __get_cpuid" >&5
14676 $as_echo_n "checking for __get_cpuid... " >&6; }
14677 if ${pgac_cv__get_cpuid+:} false; then :
14678   $as_echo_n "(cached) " >&6
14679 else
14680   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14681 /* end confdefs.h.  */
14682 #include <cpuid.h>
14683 int
14684 main ()
14685 {
14686 unsigned int exx[4] = {0, 0, 0, 0};
14687   __get_cpuid(1, &exx[0], &exx[1], &exx[2], &exx[3]);
14688
14689   ;
14690   return 0;
14691 }
14692 _ACEOF
14693 if ac_fn_c_try_link "$LINENO"; then :
14694   pgac_cv__get_cpuid="yes"
14695 else
14696   pgac_cv__get_cpuid="no"
14697 fi
14698 rm -f core conftest.err conftest.$ac_objext \
14699     conftest$ac_exeext conftest.$ac_ext
14700 fi
14701 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__get_cpuid" >&5
14702 $as_echo "$pgac_cv__get_cpuid" >&6; }
14703 if test x"$pgac_cv__get_cpuid" = x"yes"; then
14704
14705 $as_echo "#define HAVE__GET_CPUID 1" >>confdefs.h
14706
14707 fi
14708
14709 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __cpuid" >&5
14710 $as_echo_n "checking for __cpuid... " >&6; }
14711 if ${pgac_cv__cpuid+:} false; then :
14712   $as_echo_n "(cached) " >&6
14713 else
14714   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14715 /* end confdefs.h.  */
14716 #include <intrin.h>
14717 int
14718 main ()
14719 {
14720 unsigned int exx[4] = {0, 0, 0, 0};
14721   __get_cpuid(exx[0], 1);
14722
14723   ;
14724   return 0;
14725 }
14726 _ACEOF
14727 if ac_fn_c_try_link "$LINENO"; then :
14728   pgac_cv__cpuid="yes"
14729 else
14730   pgac_cv__cpuid="no"
14731 fi
14732 rm -f core conftest.err conftest.$ac_objext \
14733     conftest$ac_exeext conftest.$ac_ext
14734 fi
14735 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__cpuid" >&5
14736 $as_echo "$pgac_cv__cpuid" >&6; }
14737 if test x"$pgac_cv__cpuid" = x"yes"; then
14738
14739 $as_echo "#define HAVE__CPUID 1" >>confdefs.h
14740
14741 fi
14742
14743 # Check for Intel SSE 4.2 intrinsics to do CRC calculations.
14744 #
14745 # First check if the _mm_crc32_u8 and _mm_crc32_u64 intrinsics can be used
14746 # with the default compiler flags. If not, check if adding the -msse4.2
14747 # flag helps. CFLAGS_SSE42 is set to -msse4.2 if that's required.
14748 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=" >&5
14749 $as_echo_n "checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=... " >&6; }
14750 if ${pgac_cv_sse42_crc32_intrinsics_+:} false; then :
14751   $as_echo_n "(cached) " >&6
14752 else
14753   pgac_save_CFLAGS=$CFLAGS
14754 CFLAGS="$pgac_save_CFLAGS "
14755 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14756 /* end confdefs.h.  */
14757 #include <nmmintrin.h>
14758 int
14759 main ()
14760 {
14761 unsigned int crc = 0;
14762    crc = _mm_crc32_u8(crc, 0);
14763    crc = _mm_crc32_u32(crc, 0);
14764    /* return computed value, to prevent the above being optimized away */
14765    return crc == 0;
14766   ;
14767   return 0;
14768 }
14769 _ACEOF
14770 if ac_fn_c_try_link "$LINENO"; then :
14771   pgac_cv_sse42_crc32_intrinsics_=yes
14772 else
14773   pgac_cv_sse42_crc32_intrinsics_=no
14774 fi
14775 rm -f core conftest.err conftest.$ac_objext \
14776     conftest$ac_exeext conftest.$ac_ext
14777 CFLAGS="$pgac_save_CFLAGS"
14778 fi
14779 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_sse42_crc32_intrinsics_" >&5
14780 $as_echo "$pgac_cv_sse42_crc32_intrinsics_" >&6; }
14781 if test x"$pgac_cv_sse42_crc32_intrinsics_" = x"yes"; then
14782   CFLAGS_SSE42=""
14783   pgac_sse42_crc32_intrinsics=yes
14784 fi
14785
14786 if test x"$pgac_sse42_crc32_intrinsics" != x"yes"; then
14787   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=-msse4.2" >&5
14788 $as_echo_n "checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=-msse4.2... " >&6; }
14789 if ${pgac_cv_sse42_crc32_intrinsics__msse4_2+:} false; then :
14790   $as_echo_n "(cached) " >&6
14791 else
14792   pgac_save_CFLAGS=$CFLAGS
14793 CFLAGS="$pgac_save_CFLAGS -msse4.2"
14794 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14795 /* end confdefs.h.  */
14796 #include <nmmintrin.h>
14797 int
14798 main ()
14799 {
14800 unsigned int crc = 0;
14801    crc = _mm_crc32_u8(crc, 0);
14802    crc = _mm_crc32_u32(crc, 0);
14803    /* return computed value, to prevent the above being optimized away */
14804    return crc == 0;
14805   ;
14806   return 0;
14807 }
14808 _ACEOF
14809 if ac_fn_c_try_link "$LINENO"; then :
14810   pgac_cv_sse42_crc32_intrinsics__msse4_2=yes
14811 else
14812   pgac_cv_sse42_crc32_intrinsics__msse4_2=no
14813 fi
14814 rm -f core conftest.err conftest.$ac_objext \
14815     conftest$ac_exeext conftest.$ac_ext
14816 CFLAGS="$pgac_save_CFLAGS"
14817 fi
14818 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_sse42_crc32_intrinsics__msse4_2" >&5
14819 $as_echo "$pgac_cv_sse42_crc32_intrinsics__msse4_2" >&6; }
14820 if test x"$pgac_cv_sse42_crc32_intrinsics__msse4_2" = x"yes"; then
14821   CFLAGS_SSE42="-msse4.2"
14822   pgac_sse42_crc32_intrinsics=yes
14823 fi
14824
14825 fi
14826
14827
14828 # Are we targeting a processor that supports SSE 4.2? gcc, clang and icc all
14829 # define __SSE4_2__ in that case.
14830 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14831 /* end confdefs.h.  */
14832
14833 int
14834 main ()
14835 {
14836
14837 #ifndef __SSE4_2__
14838 #error __SSE4_2__ not defined
14839 #endif
14840
14841   ;
14842   return 0;
14843 }
14844 _ACEOF
14845 if ac_fn_c_try_compile "$LINENO"; then :
14846   SSE4_2_TARGETED=1
14847 fi
14848 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14849
14850 # Select CRC-32C implementation.
14851 #
14852 # If we are targeting a processor that has SSE 4.2 instructions, we can use the
14853 # special CRC instructions for calculating CRC-32C. If we're not targeting such
14854 # a processor, but we can nevertheless produce code that uses the SSE
14855 # intrinsics, perhaps with some extra CFLAGS, compile both implementations and
14856 # select which one to use at runtime, depending on whether SSE 4.2 is supported
14857 # by the processor we're running on.
14858 #
14859 # You can override this logic by setting the appropriate USE_*_CRC32 flag to 1
14860 # in the template or configure command line.
14861 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
14862   if test x"$pgac_sse42_crc32_intrinsics" = x"yes" && test x"$SSE4_2_TARGETED" = x"1" ; then
14863     USE_SSE42_CRC32C=1
14864   else
14865     # the CPUID instruction is needed for the runtime check.
14866     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
14867       USE_SSE42_CRC32C_WITH_RUNTIME_CHECK=1
14868     else
14869       # fall back to slicing-by-8 algorithm which doesn't require any special
14870       # CPU support.
14871       USE_SLICING_BY_8_CRC32C=1
14872     fi
14873   fi
14874 fi
14875
14876 # Set PG_CRC32C_OBJS appropriately depending on the selected implementation.
14877 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which CRC-32C implementation to use" >&5
14878 $as_echo_n "checking which CRC-32C implementation to use... " >&6; }
14879 if test x"$USE_SSE42_CRC32C" = x"1"; then
14880
14881 $as_echo "#define USE_SSE42_CRC32C 1" >>confdefs.h
14882
14883   PG_CRC32C_OBJS="pg_crc32c_sse42.o"
14884   { $as_echo "$as_me:${as_lineno-$LINENO}: result: SSE 4.2" >&5
14885 $as_echo "SSE 4.2" >&6; }
14886 else
14887   if test x"$USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" = x"1"; then
14888
14889 $as_echo "#define USE_SSE42_CRC32C_WITH_RUNTIME_CHECK 1" >>confdefs.h
14890
14891     PG_CRC32C_OBJS="pg_crc32c_sse42.o pg_crc32c_sb8.o pg_crc32c_choose.o"
14892     { $as_echo "$as_me:${as_lineno-$LINENO}: result: SSE 4.2 with runtime check" >&5
14893 $as_echo "SSE 4.2 with runtime check" >&6; }
14894   else
14895
14896 $as_echo "#define USE_SLICING_BY_8_CRC32C 1" >>confdefs.h
14897
14898     PG_CRC32C_OBJS="pg_crc32c_sb8.o"
14899     { $as_echo "$as_me:${as_lineno-$LINENO}: result: slicing-by-8" >&5
14900 $as_echo "slicing-by-8" >&6; }
14901   fi
14902 fi
14903
14904
14905
14906 # Select semaphore implementation type.
14907 if test "$PORTNAME" != "win32"; then
14908   if test x"$PREFERRED_SEMAPHORES" = x"NAMED_POSIX" ; then
14909     # Need sem_open for this
14910     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_open" >&5
14911 $as_echo_n "checking for library containing sem_open... " >&6; }
14912 if ${ac_cv_search_sem_open+:} false; then :
14913   $as_echo_n "(cached) " >&6
14914 else
14915   ac_func_search_save_LIBS=$LIBS
14916 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14917 /* end confdefs.h.  */
14918
14919 /* Override any GCC internal prototype to avoid an error.
14920    Use char because int might match the return type of a GCC
14921    builtin and then its argument prototype would still apply.  */
14922 #ifdef __cplusplus
14923 extern "C"
14924 #endif
14925 char sem_open ();
14926 int
14927 main ()
14928 {
14929 return sem_open ();
14930   ;
14931   return 0;
14932 }
14933 _ACEOF
14934 for ac_lib in '' rt pthread; do
14935   if test -z "$ac_lib"; then
14936     ac_res="none required"
14937   else
14938     ac_res=-l$ac_lib
14939     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
14940   fi
14941   if ac_fn_c_try_link "$LINENO"; then :
14942   ac_cv_search_sem_open=$ac_res
14943 fi
14944 rm -f core conftest.err conftest.$ac_objext \
14945     conftest$ac_exeext
14946   if ${ac_cv_search_sem_open+:} false; then :
14947   break
14948 fi
14949 done
14950 if ${ac_cv_search_sem_open+:} false; then :
14951
14952 else
14953   ac_cv_search_sem_open=no
14954 fi
14955 rm conftest.$ac_ext
14956 LIBS=$ac_func_search_save_LIBS
14957 fi
14958 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_open" >&5
14959 $as_echo "$ac_cv_search_sem_open" >&6; }
14960 ac_res=$ac_cv_search_sem_open
14961 if test "$ac_res" != no; then :
14962   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
14963   USE_NAMED_POSIX_SEMAPHORES=1
14964 fi
14965
14966   fi
14967   if test x"$PREFERRED_SEMAPHORES" = x"UNNAMED_POSIX" ; then
14968     # Need sem_init for this
14969     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5
14970 $as_echo_n "checking for library containing sem_init... " >&6; }
14971 if ${ac_cv_search_sem_init+:} false; then :
14972   $as_echo_n "(cached) " >&6
14973 else
14974   ac_func_search_save_LIBS=$LIBS
14975 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14976 /* end confdefs.h.  */
14977
14978 /* Override any GCC internal prototype to avoid an error.
14979    Use char because int might match the return type of a GCC
14980    builtin and then its argument prototype would still apply.  */
14981 #ifdef __cplusplus
14982 extern "C"
14983 #endif
14984 char sem_init ();
14985 int
14986 main ()
14987 {
14988 return sem_init ();
14989   ;
14990   return 0;
14991 }
14992 _ACEOF
14993 for ac_lib in '' rt pthread; do
14994   if test -z "$ac_lib"; then
14995     ac_res="none required"
14996   else
14997     ac_res=-l$ac_lib
14998     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
14999   fi
15000   if ac_fn_c_try_link "$LINENO"; then :
15001   ac_cv_search_sem_init=$ac_res
15002 fi
15003 rm -f core conftest.err conftest.$ac_objext \
15004     conftest$ac_exeext
15005   if ${ac_cv_search_sem_init+:} false; then :
15006   break
15007 fi
15008 done
15009 if ${ac_cv_search_sem_init+:} false; then :
15010
15011 else
15012   ac_cv_search_sem_init=no
15013 fi
15014 rm conftest.$ac_ext
15015 LIBS=$ac_func_search_save_LIBS
15016 fi
15017 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_init" >&5
15018 $as_echo "$ac_cv_search_sem_init" >&6; }
15019 ac_res=$ac_cv_search_sem_init
15020 if test "$ac_res" != no; then :
15021   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
15022   USE_UNNAMED_POSIX_SEMAPHORES=1
15023 fi
15024
15025   fi
15026   { $as_echo "$as_me:${as_lineno-$LINENO}: checking which semaphore API to use" >&5
15027 $as_echo_n "checking which semaphore API to use... " >&6; }
15028   if test x"$USE_NAMED_POSIX_SEMAPHORES" = x"1" ; then
15029
15030 $as_echo "#define USE_NAMED_POSIX_SEMAPHORES 1" >>confdefs.h
15031
15032     SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
15033     sematype="named POSIX"
15034   else
15035     if test x"$USE_UNNAMED_POSIX_SEMAPHORES" = x"1" ; then
15036
15037 $as_echo "#define USE_UNNAMED_POSIX_SEMAPHORES 1" >>confdefs.h
15038
15039       SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
15040       sematype="unnamed POSIX"
15041     else
15042
15043 $as_echo "#define USE_SYSV_SEMAPHORES 1" >>confdefs.h
15044
15045       SEMA_IMPLEMENTATION="src/backend/port/sysv_sema.c"
15046       sematype="System V"
15047     fi
15048   fi
15049   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sematype" >&5
15050 $as_echo "$sematype" >&6; }
15051 else
15052
15053 $as_echo "#define USE_WIN32_SEMAPHORES 1" >>confdefs.h
15054
15055   SEMA_IMPLEMENTATION="src/backend/port/win32_sema.c"
15056 fi
15057
15058
15059 # Select shared-memory implementation type.
15060 if test "$PORTNAME" != "win32"; then
15061
15062 $as_echo "#define USE_SYSV_SHARED_MEMORY 1" >>confdefs.h
15063
15064   SHMEM_IMPLEMENTATION="src/backend/port/sysv_shmem.c"
15065 else
15066
15067 $as_echo "#define USE_WIN32_SHARED_MEMORY 1" >>confdefs.h
15068
15069   SHMEM_IMPLEMENTATION="src/backend/port/win32_shmem.c"
15070 fi
15071
15072 # Select random number source
15073 #
15074 # You can override this logic by setting the appropriate USE_*RANDOM flag to 1
15075 # in the template or configure command line.
15076
15077 # If not selected manually, try to select a source automatically.
15078 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
15079   if test x"$with_openssl" = x"yes" ; then
15080     USE_OPENSSL_RANDOM=1
15081   elif test "$PORTNAME" = "win32" ; then
15082     USE_WIN32_RANDOM=1
15083   else
15084     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/urandom" >&5
15085 $as_echo_n "checking for /dev/urandom... " >&6; }
15086 if ${ac_cv_file__dev_urandom+:} false; then :
15087   $as_echo_n "(cached) " >&6
15088 else
15089   test "$cross_compiling" = yes &&
15090   as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
15091 if test -r "/dev/urandom"; then
15092   ac_cv_file__dev_urandom=yes
15093 else
15094   ac_cv_file__dev_urandom=no
15095 fi
15096 fi
15097 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_urandom" >&5
15098 $as_echo "$ac_cv_file__dev_urandom" >&6; }
15099 if test "x$ac_cv_file__dev_urandom" = xyes; then :
15100
15101 fi
15102
15103
15104     if test x"$ac_cv_file__dev_urandom" = x"yes" ; then
15105       USE_DEV_URANDOM=1
15106     fi
15107   fi
15108 fi
15109
15110 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which random number source to use" >&5
15111 $as_echo_n "checking which random number source to use... " >&6; }
15112 if test "$enable_strong_random" = yes ; then
15113   if test x"$USE_OPENSSL_RANDOM" = x"1" ; then
15114
15115 $as_echo "#define USE_OPENSSL_RANDOM 1" >>confdefs.h
15116
15117     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL" >&5
15118 $as_echo "OpenSSL" >&6; }
15119   elif test x"$USE_WIN32_RANDOM" = x"1" ; then
15120
15121 $as_echo "#define USE_WIN32_RANDOM 1" >>confdefs.h
15122
15123     { $as_echo "$as_me:${as_lineno-$LINENO}: result: Windows native" >&5
15124 $as_echo "Windows native" >&6; }
15125   elif test x"$USE_DEV_URANDOM" = x"1" ; then
15126
15127 $as_echo "#define USE_DEV_URANDOM 1" >>confdefs.h
15128
15129     { $as_echo "$as_me:${as_lineno-$LINENO}: result: /dev/urandom" >&5
15130 $as_echo "/dev/urandom" >&6; }
15131   else
15132     as_fn_error $? "
15133 no source of strong random numbers was found
15134 PostgreSQL can use OpenSSL or /dev/urandom as a source of random numbers,
15135 for authentication protocols. You can use --disable-strong-random to use a
15136 built-in pseudo random number generator, but that may be insecure." "$LINENO" 5
15137   fi
15138
15139 $as_echo "#define HAVE_STRONG_RANDOM 1" >>confdefs.h
15140
15141 else
15142     { $as_echo "$as_me:${as_lineno-$LINENO}: result: weak builtin PRNG" >&5
15143 $as_echo "weak builtin PRNG" >&6; }
15144     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
15145 *** Not using a strong random number source may be insecure." >&5
15146 $as_echo "$as_me: WARNING:
15147 *** Not using a strong random number source may be insecure." >&2;}
15148 fi
15149
15150 # If not set in template file, set bytes to use libc memset()
15151 if test x"$MEMSET_LOOP_LIMIT" = x"" ; then
15152   MEMSET_LOOP_LIMIT=1024
15153 fi
15154
15155 cat >>confdefs.h <<_ACEOF
15156 #define MEMSET_LOOP_LIMIT ${MEMSET_LOOP_LIMIT}
15157 _ACEOF
15158
15159
15160
15161 if test "$enable_nls" = yes ; then
15162
15163   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing bind_textdomain_codeset" >&5
15164 $as_echo_n "checking for library containing bind_textdomain_codeset... " >&6; }
15165 if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
15166   $as_echo_n "(cached) " >&6
15167 else
15168   ac_func_search_save_LIBS=$LIBS
15169 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15170 /* end confdefs.h.  */
15171
15172 /* Override any GCC internal prototype to avoid an error.
15173    Use char because int might match the return type of a GCC
15174    builtin and then its argument prototype would still apply.  */
15175 #ifdef __cplusplus
15176 extern "C"
15177 #endif
15178 char bind_textdomain_codeset ();
15179 int
15180 main ()
15181 {
15182 return bind_textdomain_codeset ();
15183   ;
15184   return 0;
15185 }
15186 _ACEOF
15187 for ac_lib in '' intl; do
15188   if test -z "$ac_lib"; then
15189     ac_res="none required"
15190   else
15191     ac_res=-l$ac_lib
15192     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
15193   fi
15194   if ac_fn_c_try_link "$LINENO"; then :
15195   ac_cv_search_bind_textdomain_codeset=$ac_res
15196 fi
15197 rm -f core conftest.err conftest.$ac_objext \
15198     conftest$ac_exeext
15199   if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
15200   break
15201 fi
15202 done
15203 if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
15204
15205 else
15206   ac_cv_search_bind_textdomain_codeset=no
15207 fi
15208 rm conftest.$ac_ext
15209 LIBS=$ac_func_search_save_LIBS
15210 fi
15211 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_bind_textdomain_codeset" >&5
15212 $as_echo "$ac_cv_search_bind_textdomain_codeset" >&6; }
15213 ac_res=$ac_cv_search_bind_textdomain_codeset
15214 if test "$ac_res" != no; then :
15215   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
15216
15217 else
15218   as_fn_error $? "a gettext implementation is required for NLS" "$LINENO" 5
15219 fi
15220
15221   ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
15222 if test "x$ac_cv_header_libintl_h" = xyes; then :
15223
15224 else
15225   as_fn_error $? "header file <libintl.h> is required for NLS" "$LINENO" 5
15226 fi
15227
15228
15229   for ac_prog in msgfmt
15230 do
15231   # Extract the first word of "$ac_prog", so it can be a program name with args.
15232 set dummy $ac_prog; ac_word=$2
15233 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15234 $as_echo_n "checking for $ac_word... " >&6; }
15235 if ${ac_cv_prog_MSGFMT+:} false; then :
15236   $as_echo_n "(cached) " >&6
15237 else
15238   if test -n "$MSGFMT"; then
15239   ac_cv_prog_MSGFMT="$MSGFMT" # Let the user override the test.
15240 else
15241 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15242 for as_dir in $PATH
15243 do
15244   IFS=$as_save_IFS
15245   test -z "$as_dir" && as_dir=.
15246     for ac_exec_ext in '' $ac_executable_extensions; do
15247   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15248     ac_cv_prog_MSGFMT="$ac_prog"
15249     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15250     break 2
15251   fi
15252 done
15253   done
15254 IFS=$as_save_IFS
15255
15256 fi
15257 fi
15258 MSGFMT=$ac_cv_prog_MSGFMT
15259 if test -n "$MSGFMT"; then
15260   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
15261 $as_echo "$MSGFMT" >&6; }
15262 else
15263   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15264 $as_echo "no" >&6; }
15265 fi
15266
15267
15268   test -n "$MSGFMT" && break
15269 done
15270
15271   if test -z "$MSGFMT"; then
15272     as_fn_error $? "msgfmt is required for NLS" "$LINENO" 5
15273   fi
15274   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msgfmt flags" >&5
15275 $as_echo_n "checking for msgfmt flags... " >&6; }
15276 if ${pgac_cv_msgfmt_flags+:} false; then :
15277   $as_echo_n "(cached) " >&6
15278 else
15279   if test x"$MSGFMT" != x"" && "$MSGFMT" --version 2>&1 | grep "GNU" >/dev/null; then
15280     pgac_cv_msgfmt_flags=-c
15281 fi
15282 fi
15283 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_msgfmt_flags" >&5
15284 $as_echo "$pgac_cv_msgfmt_flags" >&6; }
15285   MSGFMT_FLAGS=$pgac_cv_msgfmt_flags
15286
15287   for ac_prog in msgmerge
15288 do
15289   # Extract the first word of "$ac_prog", so it can be a program name with args.
15290 set dummy $ac_prog; ac_word=$2
15291 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15292 $as_echo_n "checking for $ac_word... " >&6; }
15293 if ${ac_cv_prog_MSGMERGE+:} false; then :
15294   $as_echo_n "(cached) " >&6
15295 else
15296   if test -n "$MSGMERGE"; then
15297   ac_cv_prog_MSGMERGE="$MSGMERGE" # Let the user override the test.
15298 else
15299 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15300 for as_dir in $PATH
15301 do
15302   IFS=$as_save_IFS
15303   test -z "$as_dir" && as_dir=.
15304     for ac_exec_ext in '' $ac_executable_extensions; do
15305   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15306     ac_cv_prog_MSGMERGE="$ac_prog"
15307     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15308     break 2
15309   fi
15310 done
15311   done
15312 IFS=$as_save_IFS
15313
15314 fi
15315 fi
15316 MSGMERGE=$ac_cv_prog_MSGMERGE
15317 if test -n "$MSGMERGE"; then
15318   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
15319 $as_echo "$MSGMERGE" >&6; }
15320 else
15321   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15322 $as_echo "no" >&6; }
15323 fi
15324
15325
15326   test -n "$MSGMERGE" && break
15327 done
15328
15329   for ac_prog in xgettext
15330 do
15331   # Extract the first word of "$ac_prog", so it can be a program name with args.
15332 set dummy $ac_prog; ac_word=$2
15333 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15334 $as_echo_n "checking for $ac_word... " >&6; }
15335 if ${ac_cv_prog_XGETTEXT+:} false; then :
15336   $as_echo_n "(cached) " >&6
15337 else
15338   if test -n "$XGETTEXT"; then
15339   ac_cv_prog_XGETTEXT="$XGETTEXT" # Let the user override the test.
15340 else
15341 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15342 for as_dir in $PATH
15343 do
15344   IFS=$as_save_IFS
15345   test -z "$as_dir" && as_dir=.
15346     for ac_exec_ext in '' $ac_executable_extensions; do
15347   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15348     ac_cv_prog_XGETTEXT="$ac_prog"
15349     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15350     break 2
15351   fi
15352 done
15353   done
15354 IFS=$as_save_IFS
15355
15356 fi
15357 fi
15358 XGETTEXT=$ac_cv_prog_XGETTEXT
15359 if test -n "$XGETTEXT"; then
15360   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
15361 $as_echo "$XGETTEXT" >&6; }
15362 else
15363   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15364 $as_echo "no" >&6; }
15365 fi
15366
15367
15368   test -n "$XGETTEXT" && break
15369 done
15370
15371
15372 fi
15373
15374 # Check for Tcl configuration script tclConfig.sh
15375 if test "$with_tcl" = yes; then
15376     for ac_prog in tclsh tcl tclsh8.6 tclsh86 tclsh8.5 tclsh85 tclsh8.4 tclsh84
15377 do
15378   # Extract the first word of "$ac_prog", so it can be a program name with args.
15379 set dummy $ac_prog; ac_word=$2
15380 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15381 $as_echo_n "checking for $ac_word... " >&6; }
15382 if ${ac_cv_path_TCLSH+:} false; then :
15383   $as_echo_n "(cached) " >&6
15384 else
15385   case $TCLSH in
15386   [\\/]* | ?:[\\/]*)
15387   ac_cv_path_TCLSH="$TCLSH" # Let the user override the test with a path.
15388   ;;
15389   *)
15390   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15391 for as_dir in $PATH
15392 do
15393   IFS=$as_save_IFS
15394   test -z "$as_dir" && as_dir=.
15395     for ac_exec_ext in '' $ac_executable_extensions; do
15396   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15397     ac_cv_path_TCLSH="$as_dir/$ac_word$ac_exec_ext"
15398     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15399     break 2
15400   fi
15401 done
15402   done
15403 IFS=$as_save_IFS
15404
15405   ;;
15406 esac
15407 fi
15408 TCLSH=$ac_cv_path_TCLSH
15409 if test -n "$TCLSH"; then
15410   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLSH" >&5
15411 $as_echo "$TCLSH" >&6; }
15412 else
15413   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15414 $as_echo "no" >&6; }
15415 fi
15416
15417
15418   test -n "$TCLSH" && break
15419 done
15420
15421 if test x"$TCLSH" = x""; then
15422   as_fn_error $? "Tcl shell not found" "$LINENO" 5
15423 fi
15424
15425 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclConfig.sh" >&5
15426 $as_echo_n "checking for tclConfig.sh... " >&6; }
15427 # Let user override test
15428 if test -z "$TCL_CONFIG_SH"; then
15429     pgac_test_dirs="$with_tclconfig"
15430
15431     set X $pgac_test_dirs; shift
15432     if test $# -eq 0; then
15433         test -z "$TCLSH" && as_fn_error $? "unable to locate tclConfig.sh because no Tcl shell was found" "$LINENO" 5
15434         set X `echo 'puts $auto_path' | $TCLSH`; shift
15435     fi
15436
15437     for pgac_dir do
15438         if test -r "$pgac_dir/tclConfig.sh"; then
15439             TCL_CONFIG_SH=$pgac_dir/tclConfig.sh
15440             break
15441         fi
15442     done
15443 fi
15444
15445 if test -z "$TCL_CONFIG_SH"; then
15446     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15447 $as_echo "no" >&6; }
15448     as_fn_error $? "file 'tclConfig.sh' is required for Tcl" "$LINENO" 5
15449 else
15450     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCL_CONFIG_SH" >&5
15451 $as_echo "$TCL_CONFIG_SH" >&6; }
15452 fi
15453
15454
15455
15456     . "$TCL_CONFIG_SH"
15457 eval TCL_INCLUDE_SPEC=\"$TCL_INCLUDE_SPEC\"
15458 eval TCL_LIBS=\"$TCL_LIBS\"
15459 eval TCL_LIB_SPEC=\"$TCL_LIB_SPEC\"
15460 eval TCL_SHARED_BUILD=\"$TCL_SHARED_BUILD\"
15461
15462         if test "$TCL_SHARED_BUILD" != 1; then
15463       as_fn_error $? "cannot build PL/Tcl because Tcl is not a shared library
15464 Use --without-tcl to disable building PL/Tcl." "$LINENO" 5
15465     fi
15466     # now that we have TCL_INCLUDE_SPEC, we can check for <tcl.h>
15467     ac_save_CPPFLAGS=$CPPFLAGS
15468     CPPFLAGS="$TCL_INCLUDE_SPEC $CPPFLAGS"
15469     ac_fn_c_check_header_mongrel "$LINENO" "tcl.h" "ac_cv_header_tcl_h" "$ac_includes_default"
15470 if test "x$ac_cv_header_tcl_h" = xyes; then :
15471
15472 else
15473   as_fn_error $? "header file <tcl.h> is required for Tcl" "$LINENO" 5
15474 fi
15475
15476
15477     CPPFLAGS=$ac_save_CPPFLAGS
15478 fi
15479
15480 # check for <perl.h>
15481 if test "$with_perl" = yes; then
15482   ac_save_CPPFLAGS=$CPPFLAGS
15483   CPPFLAGS="$CPPFLAGS -I$perl_archlibexp/CORE"
15484   ac_fn_c_check_header_compile "$LINENO" "perl.h" "ac_cv_header_perl_h" "#include <EXTERN.h>
15485 "
15486 if test "x$ac_cv_header_perl_h" = xyes; then :
15487
15488 else
15489   as_fn_error $? "header file <perl.h> is required for Perl" "$LINENO" 5
15490 fi
15491
15492
15493   # While we're at it, check that we can link to libperl.
15494   # On most platforms, if perl.h is there then libperl.so will be too, but at
15495   # this writing Debian packages them separately.  There is no known reason to
15496   # waste cycles on separate probes for the Tcl or Python libraries, though.
15497   pgac_save_LIBS=$LIBS
15498   LIBS="$perl_embed_ldflags"
15499   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libperl" >&5
15500 $as_echo_n "checking for libperl... " >&6; }
15501   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15502 /* end confdefs.h.  */
15503
15504 #include <EXTERN.h>
15505 #include <perl.h>
15506
15507 int
15508 main ()
15509 {
15510 perl_alloc();
15511   ;
15512   return 0;
15513 }
15514 _ACEOF
15515 if ac_fn_c_try_link "$LINENO"; then :
15516   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15517 $as_echo "yes" >&6; }
15518 else
15519   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15520 $as_echo "no" >&6; }
15521      as_fn_error $? "libperl library is required for Perl" "$LINENO" 5
15522 fi
15523 rm -f core conftest.err conftest.$ac_objext \
15524     conftest$ac_exeext conftest.$ac_ext
15525   LIBS=$pgac_save_LIBS
15526   CPPFLAGS=$ac_save_CPPFLAGS
15527 fi
15528
15529 # check for <Python.h>
15530 if test "$with_python" = yes; then
15531   ac_save_CPPFLAGS=$CPPFLAGS
15532   CPPFLAGS="$python_includespec $CPPFLAGS"
15533   ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
15534 if test "x$ac_cv_header_Python_h" = xyes; then :
15535
15536 else
15537   as_fn_error $? "header file <Python.h> is required for Python" "$LINENO" 5
15538 fi
15539
15540
15541   CPPFLAGS=$ac_save_CPPFLAGS
15542 fi
15543
15544 #
15545 # Check for DocBook and tools
15546 #
15547 for ac_prog in onsgmls nsgmls
15548 do
15549   # Extract the first word of "$ac_prog", so it can be a program name with args.
15550 set dummy $ac_prog; ac_word=$2
15551 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15552 $as_echo_n "checking for $ac_word... " >&6; }
15553 if ${ac_cv_prog_NSGMLS+:} false; then :
15554   $as_echo_n "(cached) " >&6
15555 else
15556   if test -n "$NSGMLS"; then
15557   ac_cv_prog_NSGMLS="$NSGMLS" # Let the user override the test.
15558 else
15559 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15560 for as_dir in $PATH
15561 do
15562   IFS=$as_save_IFS
15563   test -z "$as_dir" && as_dir=.
15564     for ac_exec_ext in '' $ac_executable_extensions; do
15565   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15566     ac_cv_prog_NSGMLS="$ac_prog"
15567     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15568     break 2
15569   fi
15570 done
15571   done
15572 IFS=$as_save_IFS
15573
15574 fi
15575 fi
15576 NSGMLS=$ac_cv_prog_NSGMLS
15577 if test -n "$NSGMLS"; then
15578   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NSGMLS" >&5
15579 $as_echo "$NSGMLS" >&6; }
15580 else
15581   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15582 $as_echo "no" >&6; }
15583 fi
15584
15585
15586   test -n "$NSGMLS" && break
15587 done
15588
15589 for ac_prog in openjade jade
15590 do
15591   # Extract the first word of "$ac_prog", so it can be a program name with args.
15592 set dummy $ac_prog; ac_word=$2
15593 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15594 $as_echo_n "checking for $ac_word... " >&6; }
15595 if ${ac_cv_prog_JADE+:} false; then :
15596   $as_echo_n "(cached) " >&6
15597 else
15598   if test -n "$JADE"; then
15599   ac_cv_prog_JADE="$JADE" # Let the user override the test.
15600 else
15601 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15602 for as_dir in $PATH
15603 do
15604   IFS=$as_save_IFS
15605   test -z "$as_dir" && as_dir=.
15606     for ac_exec_ext in '' $ac_executable_extensions; do
15607   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15608     ac_cv_prog_JADE="$ac_prog"
15609     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15610     break 2
15611   fi
15612 done
15613   done
15614 IFS=$as_save_IFS
15615
15616 fi
15617 fi
15618 JADE=$ac_cv_prog_JADE
15619 if test -n "$JADE"; then
15620   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JADE" >&5
15621 $as_echo "$JADE" >&6; }
15622 else
15623   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15624 $as_echo "no" >&6; }
15625 fi
15626
15627
15628   test -n "$JADE" && break
15629 done
15630
15631
15632 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook V4.2" >&5
15633 $as_echo_n "checking for DocBook V4.2... " >&6; }
15634 if ${pgac_cv_check_docbook+:} false; then :
15635   $as_echo_n "(cached) " >&6
15636 else
15637   cat >conftest.sgml <<EOF
15638 <!doctype book PUBLIC "-//OASIS//DTD DocBook V4.2//EN">
15639 <book>
15640  <title>test</title>
15641  <chapter>
15642   <title>random</title>
15643    <sect1>
15644     <title>testsect</title>
15645     <para>text</para>
15646   </sect1>
15647  </chapter>
15648 </book>
15649 EOF
15650
15651 pgac_cv_check_docbook=no
15652
15653 if test -n "$NSGMLS"; then
15654   $NSGMLS -s conftest.sgml 1>&5 2>&1
15655   if test $? -eq 0; then
15656     pgac_cv_check_docbook=yes
15657   fi
15658 fi
15659 rm -f conftest.sgml
15660 fi
15661 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_docbook" >&5
15662 $as_echo "$pgac_cv_check_docbook" >&6; }
15663
15664 have_docbook=$pgac_cv_check_docbook
15665
15666
15667 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook stylesheets" >&5
15668 $as_echo_n "checking for DocBook stylesheets... " >&6; }
15669 if ${pgac_cv_path_stylesheets+:} false; then :
15670   $as_echo_n "(cached) " >&6
15671 else
15672   if test -n "$DOCBOOKSTYLE"; then
15673   pgac_cv_path_stylesheets=$DOCBOOKSTYLE
15674 else
15675   for pgac_prefix in /usr /usr/local /opt /sw; do
15676     for pgac_infix in share lib; do
15677       for pgac_postfix in \
15678         sgml/stylesheets/nwalsh-modular \
15679         sgml/stylesheets/docbook \
15680         sgml/stylesheets/dsssl/docbook \
15681         sgml/docbook-dsssl \
15682         sgml/docbook/dsssl/modular \
15683         sgml/docbook/stylesheet/dsssl/modular \
15684         sgml/docbook/dsssl-stylesheets \
15685         sgml/dsssl/docbook-dsssl-nwalsh
15686       do
15687         pgac_candidate=$pgac_prefix/$pgac_infix/$pgac_postfix
15688         if test -r "$pgac_candidate/html/docbook.dsl" \
15689            && test -r "$pgac_candidate/print/docbook.dsl"
15690         then
15691           pgac_cv_path_stylesheets=$pgac_candidate
15692           break 3
15693         fi
15694       done
15695     done
15696   done
15697 fi
15698 fi
15699
15700 DOCBOOKSTYLE=$pgac_cv_path_stylesheets
15701
15702 if test -n "$DOCBOOKSTYLE"; then
15703   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCBOOKSTYLE" >&5
15704 $as_echo "$DOCBOOKSTYLE" >&6; }
15705 else
15706   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15707 $as_echo "no" >&6; }
15708 fi
15709 if test -n "$DOCBOOKSTYLE" -a -r "$DOCBOOKSTYLE/bin/collateindex.pl"; then
15710   COLLATEINDEX="$DOCBOOKSTYLE/bin/collateindex.pl"
15711
15712 else
15713   # Extract the first word of "collateindex.pl", so it can be a program name with args.
15714 set dummy collateindex.pl; ac_word=$2
15715 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15716 $as_echo_n "checking for $ac_word... " >&6; }
15717 if ${ac_cv_path_COLLATEINDEX+:} false; then :
15718   $as_echo_n "(cached) " >&6
15719 else
15720   case $COLLATEINDEX in
15721   [\\/]* | ?:[\\/]*)
15722   ac_cv_path_COLLATEINDEX="$COLLATEINDEX" # Let the user override the test with a path.
15723   ;;
15724   *)
15725   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15726 for as_dir in $PATH
15727 do
15728   IFS=$as_save_IFS
15729   test -z "$as_dir" && as_dir=.
15730     for ac_exec_ext in '' $ac_executable_extensions; do
15731   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15732     ac_cv_path_COLLATEINDEX="$as_dir/$ac_word$ac_exec_ext"
15733     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15734     break 2
15735   fi
15736 done
15737   done
15738 IFS=$as_save_IFS
15739
15740   ;;
15741 esac
15742 fi
15743 COLLATEINDEX=$ac_cv_path_COLLATEINDEX
15744 if test -n "$COLLATEINDEX"; then
15745   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COLLATEINDEX" >&5
15746 $as_echo "$COLLATEINDEX" >&6; }
15747 else
15748   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15749 $as_echo "no" >&6; }
15750 fi
15751
15752
15753 fi
15754 for ac_prog in dbtoepub
15755 do
15756   # Extract the first word of "$ac_prog", so it can be a program name with args.
15757 set dummy $ac_prog; ac_word=$2
15758 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15759 $as_echo_n "checking for $ac_word... " >&6; }
15760 if ${ac_cv_prog_DBTOEPUB+:} false; then :
15761   $as_echo_n "(cached) " >&6
15762 else
15763   if test -n "$DBTOEPUB"; then
15764   ac_cv_prog_DBTOEPUB="$DBTOEPUB" # Let the user override the test.
15765 else
15766 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15767 for as_dir in $PATH
15768 do
15769   IFS=$as_save_IFS
15770   test -z "$as_dir" && as_dir=.
15771     for ac_exec_ext in '' $ac_executable_extensions; do
15772   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15773     ac_cv_prog_DBTOEPUB="$ac_prog"
15774     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15775     break 2
15776   fi
15777 done
15778   done
15779 IFS=$as_save_IFS
15780
15781 fi
15782 fi
15783 DBTOEPUB=$ac_cv_prog_DBTOEPUB
15784 if test -n "$DBTOEPUB"; then
15785   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
15786 $as_echo "$DBTOEPUB" >&6; }
15787 else
15788   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15789 $as_echo "no" >&6; }
15790 fi
15791
15792
15793   test -n "$DBTOEPUB" && break
15794 done
15795
15796 for ac_prog in xmllint
15797 do
15798   # Extract the first word of "$ac_prog", so it can be a program name with args.
15799 set dummy $ac_prog; ac_word=$2
15800 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15801 $as_echo_n "checking for $ac_word... " >&6; }
15802 if ${ac_cv_prog_XMLLINT+:} false; then :
15803   $as_echo_n "(cached) " >&6
15804 else
15805   if test -n "$XMLLINT"; then
15806   ac_cv_prog_XMLLINT="$XMLLINT" # Let the user override the test.
15807 else
15808 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15809 for as_dir in $PATH
15810 do
15811   IFS=$as_save_IFS
15812   test -z "$as_dir" && as_dir=.
15813     for ac_exec_ext in '' $ac_executable_extensions; do
15814   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15815     ac_cv_prog_XMLLINT="$ac_prog"
15816     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15817     break 2
15818   fi
15819 done
15820   done
15821 IFS=$as_save_IFS
15822
15823 fi
15824 fi
15825 XMLLINT=$ac_cv_prog_XMLLINT
15826 if test -n "$XMLLINT"; then
15827   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
15828 $as_echo "$XMLLINT" >&6; }
15829 else
15830   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15831 $as_echo "no" >&6; }
15832 fi
15833
15834
15835   test -n "$XMLLINT" && break
15836 done
15837
15838 for ac_prog in xsltproc
15839 do
15840   # Extract the first word of "$ac_prog", so it can be a program name with args.
15841 set dummy $ac_prog; ac_word=$2
15842 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15843 $as_echo_n "checking for $ac_word... " >&6; }
15844 if ${ac_cv_prog_XSLTPROC+:} false; then :
15845   $as_echo_n "(cached) " >&6
15846 else
15847   if test -n "$XSLTPROC"; then
15848   ac_cv_prog_XSLTPROC="$XSLTPROC" # Let the user override the test.
15849 else
15850 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15851 for as_dir in $PATH
15852 do
15853   IFS=$as_save_IFS
15854   test -z "$as_dir" && as_dir=.
15855     for ac_exec_ext in '' $ac_executable_extensions; do
15856   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15857     ac_cv_prog_XSLTPROC="$ac_prog"
15858     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15859     break 2
15860   fi
15861 done
15862   done
15863 IFS=$as_save_IFS
15864
15865 fi
15866 fi
15867 XSLTPROC=$ac_cv_prog_XSLTPROC
15868 if test -n "$XSLTPROC"; then
15869   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
15870 $as_echo "$XSLTPROC" >&6; }
15871 else
15872   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15873 $as_echo "no" >&6; }
15874 fi
15875
15876
15877   test -n "$XSLTPROC" && break
15878 done
15879
15880 for ac_prog in osx sgml2xml sx
15881 do
15882   # Extract the first word of "$ac_prog", so it can be a program name with args.
15883 set dummy $ac_prog; ac_word=$2
15884 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15885 $as_echo_n "checking for $ac_word... " >&6; }
15886 if ${ac_cv_prog_OSX+:} false; then :
15887   $as_echo_n "(cached) " >&6
15888 else
15889   if test -n "$OSX"; then
15890   ac_cv_prog_OSX="$OSX" # Let the user override the test.
15891 else
15892 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15893 for as_dir in $PATH
15894 do
15895   IFS=$as_save_IFS
15896   test -z "$as_dir" && as_dir=.
15897     for ac_exec_ext in '' $ac_executable_extensions; do
15898   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15899     ac_cv_prog_OSX="$ac_prog"
15900     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15901     break 2
15902   fi
15903 done
15904   done
15905 IFS=$as_save_IFS
15906
15907 fi
15908 fi
15909 OSX=$ac_cv_prog_OSX
15910 if test -n "$OSX"; then
15911   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OSX" >&5
15912 $as_echo "$OSX" >&6; }
15913 else
15914   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15915 $as_echo "no" >&6; }
15916 fi
15917
15918
15919   test -n "$OSX" && break
15920 done
15921
15922
15923 #
15924 # Check for test tools
15925 #
15926 if test "$enable_tap_tests" = yes; then
15927   for ac_prog in prove
15928 do
15929   # Extract the first word of "$ac_prog", so it can be a program name with args.
15930 set dummy $ac_prog; ac_word=$2
15931 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15932 $as_echo_n "checking for $ac_word... " >&6; }
15933 if ${ac_cv_prog_PROVE+:} false; then :
15934   $as_echo_n "(cached) " >&6
15935 else
15936   if test -n "$PROVE"; then
15937   ac_cv_prog_PROVE="$PROVE" # Let the user override the test.
15938 else
15939 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15940 for as_dir in $PATH
15941 do
15942   IFS=$as_save_IFS
15943   test -z "$as_dir" && as_dir=.
15944     for ac_exec_ext in '' $ac_executable_extensions; do
15945   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15946     ac_cv_prog_PROVE="$ac_prog"
15947     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15948     break 2
15949   fi
15950 done
15951   done
15952 IFS=$as_save_IFS
15953
15954 fi
15955 fi
15956 PROVE=$ac_cv_prog_PROVE
15957 if test -n "$PROVE"; then
15958   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROVE" >&5
15959 $as_echo "$PROVE" >&6; }
15960 else
15961   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15962 $as_echo "no" >&6; }
15963 fi
15964
15965
15966   test -n "$PROVE" && break
15967 done
15968
15969   if test -z "$PROVE"; then
15970     as_fn_error $? "prove not found" "$LINENO" 5
15971   fi
15972   if test -z "$PERL"; then
15973     as_fn_error $? "Perl not found" "$LINENO" 5
15974   fi
15975 fi
15976
15977 # Thread testing
15978
15979 # We have to run the thread test near the end so we have all our symbols
15980 # defined.  Cross compiling throws a warning.
15981 #
15982 if test "$enable_thread_safety" = yes; then
15983 if test "$PORTNAME" != "win32"
15984 then
15985 { $as_echo "$as_me:${as_lineno-$LINENO}: checking thread safety of required library functions" >&5
15986 $as_echo_n "checking thread safety of required library functions... " >&6; }
15987
15988 _CFLAGS="$CFLAGS"
15989 _LIBS="$LIBS"
15990 CFLAGS="$CFLAGS $PTHREAD_CFLAGS -DIN_CONFIGURE"
15991 LIBS="$LIBS $PTHREAD_LIBS"
15992 if test "$cross_compiling" = yes; then :
15993   { $as_echo "$as_me:${as_lineno-$LINENO}: result: maybe" >&5
15994 $as_echo "maybe" >&6; }
15995   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
15996 *** Skipping thread test program because of cross-compile build.
15997 *** Run the program in src/test/thread on the target machine.
15998 " >&5
15999 $as_echo "$as_me: WARNING:
16000 *** Skipping thread test program because of cross-compile build.
16001 *** Run the program in src/test/thread on the target machine.
16002 " >&2;}
16003 else
16004   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16005 /* end confdefs.h.  */
16006 #include "$srcdir/src/test/thread/thread_test.c"
16007 _ACEOF
16008 if ac_fn_c_try_run "$LINENO"; then :
16009   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
16010 $as_echo "yes" >&6; }
16011 else
16012   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
16013 $as_echo "no" >&6; }
16014   as_fn_error $? "thread test program failed
16015 This platform is not thread-safe.  Check the file 'config.log' or compile
16016 and run src/test/thread/thread_test for the exact reason.
16017 Use --disable-thread-safety to disable thread safety." "$LINENO" 5
16018 fi
16019 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16020   conftest.$ac_objext conftest.beam conftest.$ac_ext
16021 fi
16022
16023 CFLAGS="$_CFLAGS"
16024 LIBS="$_LIBS"
16025 else
16026 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** skipping thread test on Win32" >&5
16027 $as_echo "$as_me: WARNING: *** skipping thread test on Win32" >&2;}
16028 fi
16029 fi
16030
16031 # If compiler will take -Wl,--as-needed (or various platform-specific
16032 # spellings thereof) then add that to LDFLAGS.  This is much easier than
16033 # trying to filter LIBS to the minimum for each executable.
16034 # On (at least) some Red-Hat-derived systems, this switch breaks linking to
16035 # libreadline; therefore we postpone testing it until we know what library
16036 # dependencies readline has.  The test code will try to link with $LIBS.
16037 if test "$with_readline" = yes; then
16038   link_test_func=readline
16039 else
16040   link_test_func=exit
16041 fi
16042
16043 if test "$PORTNAME" = "darwin"; then
16044   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,-dead_strip_dylibs" >&5
16045 $as_echo_n "checking whether $CC supports -Wl,-dead_strip_dylibs... " >&6; }
16046 if ${pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs+:} false; then :
16047   $as_echo_n "(cached) " >&6
16048 else
16049   pgac_save_LDFLAGS=$LDFLAGS
16050 LDFLAGS="$pgac_save_LDFLAGS -Wl,-dead_strip_dylibs"
16051 if test "$cross_compiling" = yes; then :
16052   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs="assuming no"
16053 else
16054   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16055 /* end confdefs.h.  */
16056 extern void $link_test_func (); void (*fptr) () = $link_test_func;
16057 int
16058 main ()
16059 {
16060
16061   ;
16062   return 0;
16063 }
16064 _ACEOF
16065 if ac_fn_c_try_run "$LINENO"; then :
16066   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=yes
16067 else
16068   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=no
16069 fi
16070 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16071   conftest.$ac_objext conftest.beam conftest.$ac_ext
16072 fi
16073
16074 LDFLAGS="$pgac_save_LDFLAGS"
16075 fi
16076 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&5
16077 $as_echo "$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&6; }
16078 if test x"$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" = x"yes"; then
16079   LDFLAGS="$LDFLAGS -Wl,-dead_strip_dylibs"
16080 fi
16081
16082 elif test "$PORTNAME" = "openbsd"; then
16083   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,-Bdynamic" >&5
16084 $as_echo_n "checking whether $CC supports -Wl,-Bdynamic... " >&6; }
16085 if ${pgac_cv_prog_cc_ldflags__Wl__Bdynamic+:} false; then :
16086   $as_echo_n "(cached) " >&6
16087 else
16088   pgac_save_LDFLAGS=$LDFLAGS
16089 LDFLAGS="$pgac_save_LDFLAGS -Wl,-Bdynamic"
16090 if test "$cross_compiling" = yes; then :
16091   pgac_cv_prog_cc_ldflags__Wl__Bdynamic="assuming no"
16092 else
16093   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16094 /* end confdefs.h.  */
16095 extern void $link_test_func (); void (*fptr) () = $link_test_func;
16096 int
16097 main ()
16098 {
16099
16100   ;
16101   return 0;
16102 }
16103 _ACEOF
16104 if ac_fn_c_try_run "$LINENO"; then :
16105   pgac_cv_prog_cc_ldflags__Wl__Bdynamic=yes
16106 else
16107   pgac_cv_prog_cc_ldflags__Wl__Bdynamic=no
16108 fi
16109 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16110   conftest.$ac_objext conftest.beam conftest.$ac_ext
16111 fi
16112
16113 LDFLAGS="$pgac_save_LDFLAGS"
16114 fi
16115 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&5
16116 $as_echo "$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&6; }
16117 if test x"$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" = x"yes"; then
16118   LDFLAGS="$LDFLAGS -Wl,-Bdynamic"
16119 fi
16120
16121 else
16122   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,--as-needed" >&5
16123 $as_echo_n "checking whether $CC supports -Wl,--as-needed... " >&6; }
16124 if ${pgac_cv_prog_cc_ldflags__Wl___as_needed+:} false; then :
16125   $as_echo_n "(cached) " >&6
16126 else
16127   pgac_save_LDFLAGS=$LDFLAGS
16128 LDFLAGS="$pgac_save_LDFLAGS -Wl,--as-needed"
16129 if test "$cross_compiling" = yes; then :
16130   pgac_cv_prog_cc_ldflags__Wl___as_needed="assuming no"
16131 else
16132   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16133 /* end confdefs.h.  */
16134 extern void $link_test_func (); void (*fptr) () = $link_test_func;
16135 int
16136 main ()
16137 {
16138
16139   ;
16140   return 0;
16141 }
16142 _ACEOF
16143 if ac_fn_c_try_run "$LINENO"; then :
16144   pgac_cv_prog_cc_ldflags__Wl___as_needed=yes
16145 else
16146   pgac_cv_prog_cc_ldflags__Wl___as_needed=no
16147 fi
16148 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16149   conftest.$ac_objext conftest.beam conftest.$ac_ext
16150 fi
16151
16152 LDFLAGS="$pgac_save_LDFLAGS"
16153 fi
16154 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl___as_needed" >&5
16155 $as_echo "$pgac_cv_prog_cc_ldflags__Wl___as_needed" >&6; }
16156 if test x"$pgac_cv_prog_cc_ldflags__Wl___as_needed" = x"yes"; then
16157   LDFLAGS="$LDFLAGS -Wl,--as-needed"
16158 fi
16159
16160 fi
16161
16162 # Create compiler version string
16163 if test x"$GCC" = x"yes" ; then
16164   cc_string=`${CC} --version | sed q`
16165   case $cc_string in [A-Za-z]*) ;; *) cc_string="GCC $cc_string";; esac
16166 elif test x"$SUN_STUDIO_CC" = x"yes" ; then
16167   cc_string=`${CC} -V 2>&1 | sed q`
16168 else
16169   cc_string=$CC
16170 fi
16171
16172
16173 cat >>confdefs.h <<_ACEOF
16174 #define PG_VERSION_STR "PostgreSQL $PG_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"
16175 _ACEOF
16176
16177
16178 # Supply a numeric version string for use by 3rd party add-ons
16179 # awk -F is a regex on some platforms, and not on others, so make "." a tab
16180 PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |
16181 tr '.' '        ' |
16182 $AWK '{printf "%d%02d%02d", $1, $2, (NF >= 3) ? $3 : 0}'`"
16183
16184 cat >>confdefs.h <<_ACEOF
16185 #define PG_VERSION_NUM $PG_VERSION_NUM
16186 _ACEOF
16187
16188
16189
16190
16191 # Begin output steps
16192
16193 { $as_echo "$as_me:${as_lineno-$LINENO}: using compiler=$cc_string" >&5
16194 $as_echo "$as_me: using compiler=$cc_string" >&6;}
16195 { $as_echo "$as_me:${as_lineno-$LINENO}: using CFLAGS=$CFLAGS" >&5
16196 $as_echo "$as_me: using CFLAGS=$CFLAGS" >&6;}
16197 { $as_echo "$as_me:${as_lineno-$LINENO}: using CPPFLAGS=$CPPFLAGS" >&5
16198 $as_echo "$as_me: using CPPFLAGS=$CPPFLAGS" >&6;}
16199 { $as_echo "$as_me:${as_lineno-$LINENO}: using LDFLAGS=$LDFLAGS" >&5
16200 $as_echo "$as_me: using LDFLAGS=$LDFLAGS" >&6;}
16201
16202 # prepare build tree if outside source tree
16203 # Note 1: test -ef might not exist, but it's more reliable than `pwd`.
16204 # Note 2: /bin/pwd might be better than shell's built-in at getting
16205 #         a symlink-free name.
16206 if ( test "$srcdir" -ef . ) >/dev/null 2>&1 || test "`cd $srcdir && /bin/pwd`" = "`/bin/pwd`"; then
16207   vpath_build=no
16208 else
16209   vpath_build=yes
16210   if test "$no_create" != yes; then
16211     $as_echo_n "preparing build tree... " >&6
16212     pgac_abs_top_srcdir=`cd "$srcdir" && pwd`
16213     $SHELL "$ac_aux_dir/prep_buildtree" "$pgac_abs_top_srcdir" "." \
16214       || as_fn_error $? "failed" "$LINENO" 5
16215     { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
16216 $as_echo "done" >&6; }
16217   fi
16218 fi
16219
16220
16221
16222 ac_config_files="$ac_config_files GNUmakefile src/Makefile.global"
16223
16224
16225 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}"
16226
16227
16228 if test "$PORTNAME" = "win32"; then
16229 ac_config_commands="$ac_config_commands check_win32_symlinks"
16230
16231 fi
16232
16233 ac_config_headers="$ac_config_headers src/include/pg_config.h"
16234
16235
16236 ac_config_headers="$ac_config_headers src/include/pg_config_ext.h"
16237
16238
16239 ac_config_headers="$ac_config_headers src/interfaces/ecpg/include/ecpg_config.h"
16240
16241
16242 cat >confcache <<\_ACEOF
16243 # This file is a shell script that caches the results of configure
16244 # tests run on this system so they can be shared between configure
16245 # scripts and configure runs, see configure's option --config-cache.
16246 # It is not useful on other systems.  If it contains results you don't
16247 # want to keep, you may remove or edit it.
16248 #
16249 # config.status only pays attention to the cache file if you give it
16250 # the --recheck option to rerun configure.
16251 #
16252 # `ac_cv_env_foo' variables (set or unset) will be overridden when
16253 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16254 # following values.
16255
16256 _ACEOF
16257
16258 # The following way of writing the cache mishandles newlines in values,
16259 # but we know of no workaround that is simple, portable, and efficient.
16260 # So, we kill variables containing newlines.
16261 # Ultrix sh set writes to stderr and can't be redirected directly,
16262 # and sets the high bit in the cache file unless we assign to the vars.
16263 (
16264   for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
16265     eval ac_val=\$$ac_var
16266     case $ac_val in #(
16267     *${as_nl}*)
16268       case $ac_var in #(
16269       *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
16270 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
16271       esac
16272       case $ac_var in #(
16273       _ | IFS | as_nl) ;; #(
16274       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
16275       *) { eval $ac_var=; unset $ac_var;} ;;
16276       esac ;;
16277     esac
16278   done
16279
16280   (set) 2>&1 |
16281     case $as_nl`(ac_space=' '; set) 2>&1` in #(
16282     *${as_nl}ac_space=\ *)
16283       # `set' does not quote correctly, so add quotes: double-quote
16284       # substitution turns \\\\ into \\, and sed turns \\ into \.
16285       sed -n \
16286         "s/'/'\\\\''/g;
16287           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16288       ;; #(
16289     *)
16290       # `set' quotes correctly as required by POSIX, so do not add quotes.
16291       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
16292       ;;
16293     esac |
16294     sort
16295 ) |
16296   sed '
16297      /^ac_cv_env_/b end
16298      t clear
16299      :clear
16300      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16301      t end
16302      s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16303      :end' >>confcache
16304 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
16305   if test -w "$cache_file"; then
16306     if test "x$cache_file" != "x/dev/null"; then
16307       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
16308 $as_echo "$as_me: updating cache $cache_file" >&6;}
16309       if test ! -f "$cache_file" || test -h "$cache_file"; then
16310         cat confcache >"$cache_file"
16311       else
16312         case $cache_file in #(
16313         */* | ?:*)
16314           mv -f confcache "$cache_file"$$ &&
16315           mv -f "$cache_file"$$ "$cache_file" ;; #(
16316         *)
16317           mv -f confcache "$cache_file" ;;
16318         esac
16319       fi
16320     fi
16321   else
16322     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
16323 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
16324   fi
16325 fi
16326 rm -f confcache
16327
16328 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16329 # Let make expand exec_prefix.
16330 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16331
16332 DEFS=-DHAVE_CONFIG_H
16333
16334 ac_libobjs=
16335 ac_ltlibobjs=
16336 U=
16337 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
16338   # 1. Remove the extension, and $U if already installed.
16339   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
16340   ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
16341   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
16342   #    will be set to the directory where LIBOBJS objects are built.
16343   as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
16344   as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
16345 done
16346 LIBOBJS=$ac_libobjs
16347
16348 LTLIBOBJS=$ac_ltlibobjs
16349
16350
16351
16352
16353 : "${CONFIG_STATUS=./config.status}"
16354 ac_write_fail=0
16355 ac_clean_files_save=$ac_clean_files
16356 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16357 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
16358 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
16359 as_write_fail=0
16360 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
16361 #! $SHELL
16362 # Generated by $as_me.
16363 # Run this file to recreate the current configuration.
16364 # Compiler output produced by configure, useful for debugging
16365 # configure, is in config.log if it exists.
16366
16367 debug=false
16368 ac_cs_recheck=false
16369 ac_cs_silent=false
16370
16371 SHELL=\${CONFIG_SHELL-$SHELL}
16372 export SHELL
16373 _ASEOF
16374 cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
16375 ## -------------------- ##
16376 ## M4sh Initialization. ##
16377 ## -------------------- ##
16378
16379 # Be more Bourne compatible
16380 DUALCASE=1; export DUALCASE # for MKS sh
16381 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
16382   emulate sh
16383   NULLCMD=:
16384   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
16385   # is contrary to our usage.  Disable this feature.
16386   alias -g '${1+"$@"}'='"$@"'
16387   setopt NO_GLOB_SUBST
16388 else
16389   case `(set -o) 2>/dev/null` in #(
16390   *posix*) :
16391     set -o posix ;; #(
16392   *) :
16393      ;;
16394 esac
16395 fi
16396
16397
16398 as_nl='
16399 '
16400 export as_nl
16401 # Printing a long string crashes Solaris 7 /usr/bin/printf.
16402 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
16403 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
16404 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
16405 # Prefer a ksh shell builtin over an external printf program on Solaris,
16406 # but without wasting forks for bash or zsh.
16407 if test -z "$BASH_VERSION$ZSH_VERSION" \
16408     && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
16409   as_echo='print -r --'
16410   as_echo_n='print -rn --'
16411 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
16412   as_echo='printf %s\n'
16413   as_echo_n='printf %s'
16414 else
16415   if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
16416     as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
16417     as_echo_n='/usr/ucb/echo -n'
16418   else
16419     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
16420     as_echo_n_body='eval
16421       arg=$1;
16422       case $arg in #(
16423       *"$as_nl"*)
16424         expr "X$arg" : "X\\(.*\\)$as_nl";
16425         arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
16426       esac;
16427       expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
16428     '
16429     export as_echo_n_body
16430     as_echo_n='sh -c $as_echo_n_body as_echo'
16431   fi
16432   export as_echo_body
16433   as_echo='sh -c $as_echo_body as_echo'
16434 fi
16435
16436 # The user is always right.
16437 if test "${PATH_SEPARATOR+set}" != set; then
16438   PATH_SEPARATOR=:
16439   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
16440     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
16441       PATH_SEPARATOR=';'
16442   }
16443 fi
16444
16445
16446 # IFS
16447 # We need space, tab and new line, in precisely that order.  Quoting is
16448 # there to prevent editors from complaining about space-tab.
16449 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
16450 # splitting by setting IFS to empty value.)
16451 IFS=" ""        $as_nl"
16452
16453 # Find who we are.  Look in the path if we contain no directory separator.
16454 as_myself=
16455 case $0 in #((
16456   *[\\/]* ) as_myself=$0 ;;
16457   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
16458 for as_dir in $PATH
16459 do
16460   IFS=$as_save_IFS
16461   test -z "$as_dir" && as_dir=.
16462     test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
16463   done
16464 IFS=$as_save_IFS
16465
16466      ;;
16467 esac
16468 # We did not find ourselves, most probably we were run as `sh COMMAND'
16469 # in which case we are not to be found in the path.
16470 if test "x$as_myself" = x; then
16471   as_myself=$0
16472 fi
16473 if test ! -f "$as_myself"; then
16474   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
16475   exit 1
16476 fi
16477
16478 # Unset variables that we do not need and which cause bugs (e.g. in
16479 # pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
16480 # suppresses any "Segmentation fault" message there.  '((' could
16481 # trigger a bug in pdksh 5.2.14.
16482 for as_var in BASH_ENV ENV MAIL MAILPATH
16483 do eval test x\${$as_var+set} = xset \
16484   && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
16485 done
16486 PS1='$ '
16487 PS2='> '
16488 PS4='+ '
16489
16490 # NLS nuisances.
16491 LC_ALL=C
16492 export LC_ALL
16493 LANGUAGE=C
16494 export LANGUAGE
16495
16496 # CDPATH.
16497 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
16498
16499
16500 # as_fn_error STATUS ERROR [LINENO LOG_FD]
16501 # ----------------------------------------
16502 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
16503 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
16504 # script with STATUS, using 1 if that was 0.
16505 as_fn_error ()
16506 {
16507   as_status=$1; test $as_status -eq 0 && as_status=1
16508   if test "$4"; then
16509     as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
16510     $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
16511   fi
16512   $as_echo "$as_me: error: $2" >&2
16513   as_fn_exit $as_status
16514 } # as_fn_error
16515
16516
16517 # as_fn_set_status STATUS
16518 # -----------------------
16519 # Set $? to STATUS, without forking.
16520 as_fn_set_status ()
16521 {
16522   return $1
16523 } # as_fn_set_status
16524
16525 # as_fn_exit STATUS
16526 # -----------------
16527 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
16528 as_fn_exit ()
16529 {
16530   set +e
16531   as_fn_set_status $1
16532   exit $1
16533 } # as_fn_exit
16534
16535 # as_fn_unset VAR
16536 # ---------------
16537 # Portably unset VAR.
16538 as_fn_unset ()
16539 {
16540   { eval $1=; unset $1;}
16541 }
16542 as_unset=as_fn_unset
16543 # as_fn_append VAR VALUE
16544 # ----------------------
16545 # Append the text in VALUE to the end of the definition contained in VAR. Take
16546 # advantage of any shell optimizations that allow amortized linear growth over
16547 # repeated appends, instead of the typical quadratic growth present in naive
16548 # implementations.
16549 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
16550   eval 'as_fn_append ()
16551   {
16552     eval $1+=\$2
16553   }'
16554 else
16555   as_fn_append ()
16556   {
16557     eval $1=\$$1\$2
16558   }
16559 fi # as_fn_append
16560
16561 # as_fn_arith ARG...
16562 # ------------------
16563 # Perform arithmetic evaluation on the ARGs, and store the result in the
16564 # global $as_val. Take advantage of shells that can avoid forks. The arguments
16565 # must be portable across $(()) and expr.
16566 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
16567   eval 'as_fn_arith ()
16568   {
16569     as_val=$(( $* ))
16570   }'
16571 else
16572   as_fn_arith ()
16573   {
16574     as_val=`expr "$@" || test $? -eq 1`
16575   }
16576 fi # as_fn_arith
16577
16578
16579 if expr a : '\(a\)' >/dev/null 2>&1 &&
16580    test "X`expr 00001 : '.*\(...\)'`" = X001; then
16581   as_expr=expr
16582 else
16583   as_expr=false
16584 fi
16585
16586 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
16587   as_basename=basename
16588 else
16589   as_basename=false
16590 fi
16591
16592 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
16593   as_dirname=dirname
16594 else
16595   as_dirname=false
16596 fi
16597
16598 as_me=`$as_basename -- "$0" ||
16599 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
16600          X"$0" : 'X\(//\)$' \| \
16601          X"$0" : 'X\(/\)' \| . 2>/dev/null ||
16602 $as_echo X/"$0" |
16603     sed '/^.*\/\([^/][^/]*\)\/*$/{
16604             s//\1/
16605             q
16606           }
16607           /^X\/\(\/\/\)$/{
16608             s//\1/
16609             q
16610           }
16611           /^X\/\(\/\).*/{
16612             s//\1/
16613             q
16614           }
16615           s/.*/./; q'`
16616
16617 # Avoid depending upon Character Ranges.
16618 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
16619 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
16620 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
16621 as_cr_digits='0123456789'
16622 as_cr_alnum=$as_cr_Letters$as_cr_digits
16623
16624 ECHO_C= ECHO_N= ECHO_T=
16625 case `echo -n x` in #(((((
16626 -n*)
16627   case `echo 'xy\c'` in
16628   *c*) ECHO_T=' ';;     # ECHO_T is single tab character.
16629   xy)  ECHO_C='\c';;
16630   *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
16631        ECHO_T=' ';;
16632   esac;;
16633 *)
16634   ECHO_N='-n';;
16635 esac
16636
16637 rm -f conf$$ conf$$.exe conf$$.file
16638 if test -d conf$$.dir; then
16639   rm -f conf$$.dir/conf$$.file
16640 else
16641   rm -f conf$$.dir
16642   mkdir conf$$.dir 2>/dev/null
16643 fi
16644 if (echo >conf$$.file) 2>/dev/null; then
16645   if ln -s conf$$.file conf$$ 2>/dev/null; then
16646     as_ln_s='ln -s'
16647     # ... but there are two gotchas:
16648     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
16649     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
16650     # In both cases, we have to default to `cp -pR'.
16651     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
16652       as_ln_s='cp -pR'
16653   elif ln conf$$.file conf$$ 2>/dev/null; then
16654     as_ln_s=ln
16655   else
16656     as_ln_s='cp -pR'
16657   fi
16658 else
16659   as_ln_s='cp -pR'
16660 fi
16661 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
16662 rmdir conf$$.dir 2>/dev/null
16663
16664
16665 # as_fn_mkdir_p
16666 # -------------
16667 # Create "$as_dir" as a directory, including parents if necessary.
16668 as_fn_mkdir_p ()
16669 {
16670
16671   case $as_dir in #(
16672   -*) as_dir=./$as_dir;;
16673   esac
16674   test -d "$as_dir" || eval $as_mkdir_p || {
16675     as_dirs=
16676     while :; do
16677       case $as_dir in #(
16678       *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
16679       *) as_qdir=$as_dir;;
16680       esac
16681       as_dirs="'$as_qdir' $as_dirs"
16682       as_dir=`$as_dirname -- "$as_dir" ||
16683 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16684          X"$as_dir" : 'X\(//\)[^/]' \| \
16685          X"$as_dir" : 'X\(//\)$' \| \
16686          X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
16687 $as_echo X"$as_dir" |
16688     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
16689             s//\1/
16690             q
16691           }
16692           /^X\(\/\/\)[^/].*/{
16693             s//\1/
16694             q
16695           }
16696           /^X\(\/\/\)$/{
16697             s//\1/
16698             q
16699           }
16700           /^X\(\/\).*/{
16701             s//\1/
16702             q
16703           }
16704           s/.*/./; q'`
16705       test -d "$as_dir" && break
16706     done
16707     test -z "$as_dirs" || eval "mkdir $as_dirs"
16708   } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
16709
16710
16711 } # as_fn_mkdir_p
16712 if mkdir -p . 2>/dev/null; then
16713   as_mkdir_p='mkdir -p "$as_dir"'
16714 else
16715   test -d ./-p && rmdir ./-p
16716   as_mkdir_p=false
16717 fi
16718
16719
16720 # as_fn_executable_p FILE
16721 # -----------------------
16722 # Test if FILE is an executable regular file.
16723 as_fn_executable_p ()
16724 {
16725   test -f "$1" && test -x "$1"
16726 } # as_fn_executable_p
16727 as_test_x='test -x'
16728 as_executable_p=as_fn_executable_p
16729
16730 # Sed expression to map a string onto a valid CPP name.
16731 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
16732
16733 # Sed expression to map a string onto a valid variable name.
16734 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
16735
16736
16737 exec 6>&1
16738 ## ----------------------------------- ##
16739 ## Main body of $CONFIG_STATUS script. ##
16740 ## ----------------------------------- ##
16741 _ASEOF
16742 test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
16743
16744 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16745 # Save the log message, to keep $0 and so on meaningful, and to
16746 # report actual input values of CONFIG_FILES etc. instead of their
16747 # values after options handling.
16748 ac_log="
16749 This file was extended by PostgreSQL $as_me 10devel, which was
16750 generated by GNU Autoconf 2.69.  Invocation command line was
16751
16752   CONFIG_FILES    = $CONFIG_FILES
16753   CONFIG_HEADERS  = $CONFIG_HEADERS
16754   CONFIG_LINKS    = $CONFIG_LINKS
16755   CONFIG_COMMANDS = $CONFIG_COMMANDS
16756   $ $0 $@
16757
16758 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16759 "
16760
16761 _ACEOF
16762
16763 case $ac_config_files in *"
16764 "*) set x $ac_config_files; shift; ac_config_files=$*;;
16765 esac
16766
16767 case $ac_config_headers in *"
16768 "*) set x $ac_config_headers; shift; ac_config_headers=$*;;
16769 esac
16770
16771
16772 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16773 # Files that config.status was made for.
16774 config_files="$ac_config_files"
16775 config_headers="$ac_config_headers"
16776 config_links="$ac_config_links"
16777 config_commands="$ac_config_commands"
16778
16779 _ACEOF
16780
16781 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16782 ac_cs_usage="\
16783 \`$as_me' instantiates files and other configuration actions
16784 from templates according to the current configuration.  Unless the files
16785 and actions are specified as TAGs, all are instantiated by default.
16786
16787 Usage: $0 [OPTION]... [TAG]...
16788
16789   -h, --help       print this help, then exit
16790   -V, --version    print version number and configuration settings, then exit
16791       --config     print configuration, then exit
16792   -q, --quiet, --silent
16793                    do not print progress messages
16794   -d, --debug      don't remove temporary files
16795       --recheck    update $as_me by reconfiguring in the same conditions
16796       --file=FILE[:TEMPLATE]
16797                    instantiate the configuration file FILE
16798       --header=FILE[:TEMPLATE]
16799                    instantiate the configuration header FILE
16800
16801 Configuration files:
16802 $config_files
16803
16804 Configuration headers:
16805 $config_headers
16806
16807 Configuration links:
16808 $config_links
16809
16810 Configuration commands:
16811 $config_commands
16812
16813 Report bugs to <pgsql-bugs@postgresql.org>."
16814
16815 _ACEOF
16816 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16817 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
16818 ac_cs_version="\\
16819 PostgreSQL config.status 10devel
16820 configured by $0, generated by GNU Autoconf 2.69,
16821   with options \\"\$ac_cs_config\\"
16822
16823 Copyright (C) 2012 Free Software Foundation, Inc.
16824 This config.status script is free software; the Free Software Foundation
16825 gives unlimited permission to copy, distribute and modify it."
16826
16827 ac_pwd='$ac_pwd'
16828 srcdir='$srcdir'
16829 INSTALL='$INSTALL'
16830 MKDIR_P='$MKDIR_P'
16831 AWK='$AWK'
16832 test -n "\$AWK" || AWK=awk
16833 _ACEOF
16834
16835 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16836 # The default lists apply if the user does not specify any file.
16837 ac_need_defaults=:
16838 while test $# != 0
16839 do
16840   case $1 in
16841   --*=?*)
16842     ac_option=`expr "X$1" : 'X\([^=]*\)='`
16843     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
16844     ac_shift=:
16845     ;;
16846   --*=)
16847     ac_option=`expr "X$1" : 'X\([^=]*\)='`
16848     ac_optarg=
16849     ac_shift=:
16850     ;;
16851   *)
16852     ac_option=$1
16853     ac_optarg=$2
16854     ac_shift=shift
16855     ;;
16856   esac
16857
16858   case $ac_option in
16859   # Handling of the options.
16860   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16861     ac_cs_recheck=: ;;
16862   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
16863     $as_echo "$ac_cs_version"; exit ;;
16864   --config | --confi | --conf | --con | --co | --c )
16865     $as_echo "$ac_cs_config"; exit ;;
16866   --debug | --debu | --deb | --de | --d | -d )
16867     debug=: ;;
16868   --file | --fil | --fi | --f )
16869     $ac_shift
16870     case $ac_optarg in
16871     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
16872     '') as_fn_error $? "missing file argument" ;;
16873     esac
16874     as_fn_append CONFIG_FILES " '$ac_optarg'"
16875     ac_need_defaults=false;;
16876   --header | --heade | --head | --hea )
16877     $ac_shift
16878     case $ac_optarg in
16879     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
16880     esac
16881     as_fn_append CONFIG_HEADERS " '$ac_optarg'"
16882     ac_need_defaults=false;;
16883   --he | --h)
16884     # Conflict between --help and --header
16885     as_fn_error $? "ambiguous option: \`$1'
16886 Try \`$0 --help' for more information.";;
16887   --help | --hel | -h )
16888     $as_echo "$ac_cs_usage"; exit ;;
16889   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
16890   | -silent | --silent | --silen | --sile | --sil | --si | --s)
16891     ac_cs_silent=: ;;
16892
16893   # This is an error.
16894   -*) as_fn_error $? "unrecognized option: \`$1'
16895 Try \`$0 --help' for more information." ;;
16896
16897   *) as_fn_append ac_config_targets " $1"
16898      ac_need_defaults=false ;;
16899
16900   esac
16901   shift
16902 done
16903
16904 ac_configure_extra_args=
16905
16906 if $ac_cs_silent; then
16907   exec 6>/dev/null
16908   ac_configure_extra_args="$ac_configure_extra_args --silent"
16909 fi
16910
16911 _ACEOF
16912 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16913 if \$ac_cs_recheck; then
16914   set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
16915   shift
16916   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
16917   CONFIG_SHELL='$SHELL'
16918   export CONFIG_SHELL
16919   exec "\$@"
16920 fi
16921
16922 _ACEOF
16923 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16924 exec 5>>config.log
16925 {
16926   echo
16927   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
16928 ## Running $as_me. ##
16929 _ASBOX
16930   $as_echo "$ac_log"
16931 } >&5
16932
16933 _ACEOF
16934 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16935 _ACEOF
16936
16937 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16938
16939 # Handling of arguments.
16940 for ac_config_target in $ac_config_targets
16941 do
16942   case $ac_config_target in
16943     "src/backend/port/tas.s") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/tas.s:src/backend/port/tas/${tas_file}" ;;
16944     "GNUmakefile") CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;;
16945     "src/Makefile.global") CONFIG_FILES="$CONFIG_FILES src/Makefile.global" ;;
16946     "src/backend/port/dynloader.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c" ;;
16947     "src/backend/port/pg_sema.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}" ;;
16948     "src/backend/port/pg_shmem.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}" ;;
16949     "src/include/dynloader.h") CONFIG_LINKS="$CONFIG_LINKS src/include/dynloader.h:src/backend/port/dynloader/${template}.h" ;;
16950     "src/include/pg_config_os.h") CONFIG_LINKS="$CONFIG_LINKS src/include/pg_config_os.h:src/include/port/${template}.h" ;;
16951     "src/Makefile.port") CONFIG_LINKS="$CONFIG_LINKS src/Makefile.port:src/makefiles/Makefile.${template}" ;;
16952     "check_win32_symlinks") CONFIG_COMMANDS="$CONFIG_COMMANDS check_win32_symlinks" ;;
16953     "src/include/pg_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config.h" ;;
16954     "src/include/pg_config_ext.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config_ext.h" ;;
16955     "src/interfaces/ecpg/include/ecpg_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/interfaces/ecpg/include/ecpg_config.h" ;;
16956
16957   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
16958   esac
16959 done
16960
16961
16962 # If the user did not use the arguments to specify the items to instantiate,
16963 # then the envvar interface is used.  Set only those that are not.
16964 # We use the long form for the default assignment because of an extremely
16965 # bizarre bug on SunOS 4.1.3.
16966 if $ac_need_defaults; then
16967   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16968   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16969   test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
16970   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16971 fi
16972
16973 # Have a temporary directory for convenience.  Make it in the build tree
16974 # simply because there is no reason against having it here, and in addition,
16975 # creating and moving files from /tmp can sometimes cause problems.
16976 # Hook for its removal unless debugging.
16977 # Note that there is a small window in which the directory will not be cleaned:
16978 # after its creation but before its name has been assigned to `$tmp'.
16979 $debug ||
16980 {
16981   tmp= ac_tmp=
16982   trap 'exit_status=$?
16983   : "${ac_tmp:=$tmp}"
16984   { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
16985 ' 0
16986   trap 'as_fn_exit 1' 1 2 13 15
16987 }
16988 # Create a (secure) tmp directory for tmp files.
16989
16990 {
16991   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
16992   test -d "$tmp"
16993 }  ||
16994 {
16995   tmp=./conf$$-$RANDOM
16996   (umask 077 && mkdir "$tmp")
16997 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
16998 ac_tmp=$tmp
16999
17000 # Set up the scripts for CONFIG_FILES section.
17001 # No need to generate them if there are no CONFIG_FILES.
17002 # This happens for instance with `./config.status config.h'.
17003 if test -n "$CONFIG_FILES"; then
17004
17005
17006 ac_cr=`echo X | tr X '\015'`
17007 # On cygwin, bash can eat \r inside `` if the user requested igncr.
17008 # But we know of no other shell where ac_cr would be empty at this
17009 # point, so we can use a bashism as a fallback.
17010 if test "x$ac_cr" = x; then
17011   eval ac_cr=\$\'\\r\'
17012 fi
17013 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
17014 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
17015   ac_cs_awk_cr='\\r'
17016 else
17017   ac_cs_awk_cr=$ac_cr
17018 fi
17019
17020 echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
17021 _ACEOF
17022
17023
17024 {
17025   echo "cat >conf$$subs.awk <<_ACEOF" &&
17026   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
17027   echo "_ACEOF"
17028 } >conf$$subs.sh ||
17029   as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
17030 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
17031 ac_delim='%!_!# '
17032 for ac_last_try in false false false false false :; do
17033   . ./conf$$subs.sh ||
17034     as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
17035
17036   ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
17037   if test $ac_delim_n = $ac_delim_num; then
17038     break
17039   elif $ac_last_try; then
17040     as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
17041   else
17042     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
17043   fi
17044 done
17045 rm -f conf$$subs.sh
17046
17047 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
17048 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
17049 _ACEOF
17050 sed -n '
17051 h
17052 s/^/S["/; s/!.*/"]=/
17053 p
17054 g
17055 s/^[^!]*!//
17056 :repl
17057 t repl
17058 s/'"$ac_delim"'$//
17059 t delim
17060 :nl
17061 h
17062 s/\(.\{148\}\)..*/\1/
17063 t more1
17064 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
17065 p
17066 n
17067 b repl
17068 :more1
17069 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
17070 p
17071 g
17072 s/.\{148\}//
17073 t nl
17074 :delim
17075 h
17076 s/\(.\{148\}\)..*/\1/
17077 t more2
17078 s/["\\]/\\&/g; s/^/"/; s/$/"/
17079 p
17080 b
17081 :more2
17082 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
17083 p
17084 g
17085 s/.\{148\}//
17086 t delim
17087 ' <conf$$subs.awk | sed '
17088 /^[^""]/{
17089   N
17090   s/\n//
17091 }
17092 ' >>$CONFIG_STATUS || ac_write_fail=1
17093 rm -f conf$$subs.awk
17094 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
17095 _ACAWK
17096 cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
17097   for (key in S) S_is_set[key] = 1
17098   FS = "\a"
17099
17100 }
17101 {
17102   line = $ 0
17103   nfields = split(line, field, "@")
17104   substed = 0
17105   len = length(field[1])
17106   for (i = 2; i < nfields; i++) {
17107     key = field[i]
17108     keylen = length(key)
17109     if (S_is_set[key]) {
17110       value = S[key]
17111       line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
17112       len += length(value) + length(field[++i])
17113       substed = 1
17114     } else
17115       len += 1 + keylen
17116   }
17117
17118   print line
17119 }
17120
17121 _ACAWK
17122 _ACEOF
17123 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
17124 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
17125   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
17126 else
17127   cat
17128 fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
17129   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
17130 _ACEOF
17131
17132 # VPATH may cause trouble with some makes, so we remove sole $(srcdir),
17133 # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
17134 # trailing colons and then remove the whole line if VPATH becomes empty
17135 # (actually we leave an empty line to preserve line numbers).
17136 if test "x$srcdir" = x.; then
17137   ac_vpsub='/^[  ]*VPATH[        ]*=[    ]*/{
17138 h
17139 s///
17140 s/^/:/
17141 s/[      ]*$/:/
17142 s/:\$(srcdir):/:/g
17143 s/:\${srcdir}:/:/g
17144 s/:@srcdir@:/:/g
17145 s/^:*//
17146 s/:*$//
17147 x
17148 s/\(=[   ]*\).*/\1/
17149 G
17150 s/\n//
17151 s/^[^=]*=[       ]*$//
17152 }'
17153 fi
17154
17155 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
17156 fi # test -n "$CONFIG_FILES"
17157
17158 # Set up the scripts for CONFIG_HEADERS section.
17159 # No need to generate them if there are no CONFIG_HEADERS.
17160 # This happens for instance with `./config.status Makefile'.
17161 if test -n "$CONFIG_HEADERS"; then
17162 cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
17163 BEGIN {
17164 _ACEOF
17165
17166 # Transform confdefs.h into an awk script `defines.awk', embedded as
17167 # here-document in config.status, that substitutes the proper values into
17168 # config.h.in to produce config.h.
17169
17170 # Create a delimiter string that does not exist in confdefs.h, to ease
17171 # handling of long lines.
17172 ac_delim='%!_!# '
17173 for ac_last_try in false false :; do
17174   ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
17175   if test -z "$ac_tt"; then
17176     break
17177   elif $ac_last_try; then
17178     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
17179   else
17180     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
17181   fi
17182 done
17183
17184 # For the awk script, D is an array of macro values keyed by name,
17185 # likewise P contains macro parameters if any.  Preserve backslash
17186 # newline sequences.
17187
17188 ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
17189 sed -n '
17190 s/.\{148\}/&'"$ac_delim"'/g
17191 t rset
17192 :rset
17193 s/^[     ]*#[    ]*define[       ][      ]*/ /
17194 t def
17195 d
17196 :def
17197 s/\\$//
17198 t bsnl
17199 s/["\\]/\\&/g
17200 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
17201 D["\1"]=" \3"/p
17202 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2"/p
17203 d
17204 :bsnl
17205 s/["\\]/\\&/g
17206 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
17207 D["\1"]=" \3\\\\\\n"\\/p
17208 t cont
17209 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
17210 t cont
17211 d
17212 :cont
17213 n
17214 s/.\{148\}/&'"$ac_delim"'/g
17215 t clear
17216 :clear
17217 s/\\$//
17218 t bsnlc
17219 s/["\\]/\\&/g; s/^/"/; s/$/"/p
17220 d
17221 :bsnlc
17222 s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
17223 b cont
17224 ' <confdefs.h | sed '
17225 s/'"$ac_delim"'/"\\\
17226 "/g' >>$CONFIG_STATUS || ac_write_fail=1
17227
17228 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
17229   for (key in D) D_is_set[key] = 1
17230   FS = "\a"
17231 }
17232 /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
17233   line = \$ 0
17234   split(line, arg, " ")
17235   if (arg[1] == "#") {
17236     defundef = arg[2]
17237     mac1 = arg[3]
17238   } else {
17239     defundef = substr(arg[1], 2)
17240     mac1 = arg[2]
17241   }
17242   split(mac1, mac2, "(") #)
17243   macro = mac2[1]
17244   prefix = substr(line, 1, index(line, defundef) - 1)
17245   if (D_is_set[macro]) {
17246     # Preserve the white space surrounding the "#".
17247     print prefix "define", macro P[macro] D[macro]
17248     next
17249   } else {
17250     # Replace #undef with comments.  This is necessary, for example,
17251     # in the case of _POSIX_SOURCE, which is predefined and required
17252     # on some systems where configure will not decide to define it.
17253     if (defundef == "undef") {
17254       print "/*", prefix defundef, macro, "*/"
17255       next
17256     }
17257   }
17258 }
17259 { print }
17260 _ACAWK
17261 _ACEOF
17262 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
17263   as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
17264 fi # test -n "$CONFIG_HEADERS"
17265
17266
17267 eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS  :L $CONFIG_LINKS  :C $CONFIG_COMMANDS"
17268 shift
17269 for ac_tag
17270 do
17271   case $ac_tag in
17272   :[FHLC]) ac_mode=$ac_tag; continue;;
17273   esac
17274   case $ac_mode$ac_tag in
17275   :[FHL]*:*);;
17276   :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
17277   :[FH]-) ac_tag=-:-;;
17278   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
17279   esac
17280   ac_save_IFS=$IFS
17281   IFS=:
17282   set x $ac_tag
17283   IFS=$ac_save_IFS
17284   shift
17285   ac_file=$1
17286   shift
17287
17288   case $ac_mode in
17289   :L) ac_source=$1;;
17290   :[FH])
17291     ac_file_inputs=
17292     for ac_f
17293     do
17294       case $ac_f in
17295       -) ac_f="$ac_tmp/stdin";;
17296       *) # Look for the file first in the build tree, then in the source tree
17297          # (if the path is not absolute).  The absolute path cannot be DOS-style,
17298          # because $ac_f cannot contain `:'.
17299          test -f "$ac_f" ||
17300            case $ac_f in
17301            [\\/$]*) false;;
17302            *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
17303            esac ||
17304            as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
17305       esac
17306       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
17307       as_fn_append ac_file_inputs " '$ac_f'"
17308     done
17309
17310     # Let's still pretend it is `configure' which instantiates (i.e., don't
17311     # use $as_me), people would be surprised to read:
17312     #    /* config.h.  Generated by config.status.  */
17313     configure_input='Generated from '`
17314           $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
17315         `' by configure.'
17316     if test x"$ac_file" != x-; then
17317       configure_input="$ac_file.  $configure_input"
17318       { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
17319 $as_echo "$as_me: creating $ac_file" >&6;}
17320     fi
17321     # Neutralize special characters interpreted by sed in replacement strings.
17322     case $configure_input in #(
17323     *\&* | *\|* | *\\* )
17324        ac_sed_conf_input=`$as_echo "$configure_input" |
17325        sed 's/[\\\\&|]/\\\\&/g'`;; #(
17326     *) ac_sed_conf_input=$configure_input;;
17327     esac
17328
17329     case $ac_tag in
17330     *:-:* | *:-) cat >"$ac_tmp/stdin" \
17331       || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
17332     esac
17333     ;;
17334   esac
17335
17336   ac_dir=`$as_dirname -- "$ac_file" ||
17337 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17338          X"$ac_file" : 'X\(//\)[^/]' \| \
17339          X"$ac_file" : 'X\(//\)$' \| \
17340          X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
17341 $as_echo X"$ac_file" |
17342     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
17343             s//\1/
17344             q
17345           }
17346           /^X\(\/\/\)[^/].*/{
17347             s//\1/
17348             q
17349           }
17350           /^X\(\/\/\)$/{
17351             s//\1/
17352             q
17353           }
17354           /^X\(\/\).*/{
17355             s//\1/
17356             q
17357           }
17358           s/.*/./; q'`
17359   as_dir="$ac_dir"; as_fn_mkdir_p
17360   ac_builddir=.
17361
17362 case "$ac_dir" in
17363 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
17364 *)
17365   ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
17366   # A ".." for each directory in $ac_dir_suffix.
17367   ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
17368   case $ac_top_builddir_sub in
17369   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
17370   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
17371   esac ;;
17372 esac
17373 ac_abs_top_builddir=$ac_pwd
17374 ac_abs_builddir=$ac_pwd$ac_dir_suffix
17375 # for backward compatibility:
17376 ac_top_builddir=$ac_top_build_prefix
17377
17378 case $srcdir in
17379   .)  # We are building in place.
17380     ac_srcdir=.
17381     ac_top_srcdir=$ac_top_builddir_sub
17382     ac_abs_top_srcdir=$ac_pwd ;;
17383   [\\/]* | ?:[\\/]* )  # Absolute name.
17384     ac_srcdir=$srcdir$ac_dir_suffix;
17385     ac_top_srcdir=$srcdir
17386     ac_abs_top_srcdir=$srcdir ;;
17387   *) # Relative name.
17388     ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
17389     ac_top_srcdir=$ac_top_build_prefix$srcdir
17390     ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
17391 esac
17392 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
17393
17394
17395   case $ac_mode in
17396   :F)
17397   #
17398   # CONFIG_FILE
17399   #
17400
17401   case $INSTALL in
17402   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
17403   *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
17404   esac
17405   ac_MKDIR_P=$MKDIR_P
17406   case $MKDIR_P in
17407   [\\/$]* | ?:[\\/]* ) ;;
17408   */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
17409   esac
17410 _ACEOF
17411
17412 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
17413 # If the template does not know about datarootdir, expand it.
17414 # FIXME: This hack should be removed a few years after 2.60.
17415 ac_datarootdir_hack=; ac_datarootdir_seen=
17416 ac_sed_dataroot='
17417 /datarootdir/ {
17418   p
17419   q
17420 }
17421 /@datadir@/p
17422 /@docdir@/p
17423 /@infodir@/p
17424 /@localedir@/p
17425 /@mandir@/p'
17426 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
17427 *datarootdir*) ac_datarootdir_seen=yes;;
17428 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
17429   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
17430 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
17431 _ACEOF
17432 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
17433   ac_datarootdir_hack='
17434   s&@datadir@&$datadir&g
17435   s&@docdir@&$docdir&g
17436   s&@infodir@&$infodir&g
17437   s&@localedir@&$localedir&g
17438   s&@mandir@&$mandir&g
17439   s&\\\${datarootdir}&$datarootdir&g' ;;
17440 esac
17441 _ACEOF
17442
17443 # Neutralize VPATH when `$srcdir' = `.'.
17444 # Shell code in configure.ac might set extrasub.
17445 # FIXME: do we really want to maintain this feature?
17446 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
17447 ac_sed_extra="$ac_vpsub
17448 $extrasub
17449 _ACEOF
17450 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
17451 :t
17452 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17453 s|@configure_input@|$ac_sed_conf_input|;t t
17454 s&@top_builddir@&$ac_top_builddir_sub&;t t
17455 s&@top_build_prefix@&$ac_top_build_prefix&;t t
17456 s&@srcdir@&$ac_srcdir&;t t
17457 s&@abs_srcdir@&$ac_abs_srcdir&;t t
17458 s&@top_srcdir@&$ac_top_srcdir&;t t
17459 s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
17460 s&@builddir@&$ac_builddir&;t t
17461 s&@abs_builddir@&$ac_abs_builddir&;t t
17462 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
17463 s&@INSTALL@&$ac_INSTALL&;t t
17464 s&@MKDIR_P@&$ac_MKDIR_P&;t t
17465 $ac_datarootdir_hack
17466 "
17467 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
17468   >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
17469
17470 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
17471   { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
17472   { ac_out=`sed -n '/^[  ]*datarootdir[  ]*:*=/p' \
17473       "$ac_tmp/out"`; test -z "$ac_out"; } &&
17474   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
17475 which seems to be undefined.  Please make sure it is defined" >&5
17476 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
17477 which seems to be undefined.  Please make sure it is defined" >&2;}
17478
17479   rm -f "$ac_tmp/stdin"
17480   case $ac_file in
17481   -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
17482   *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
17483   esac \
17484   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
17485  ;;
17486   :H)
17487   #
17488   # CONFIG_HEADER
17489   #
17490   if test x"$ac_file" != x-; then
17491     {
17492       $as_echo "/* $configure_input  */" \
17493       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
17494     } >"$ac_tmp/config.h" \
17495       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
17496     if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
17497       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
17498 $as_echo "$as_me: $ac_file is unchanged" >&6;}
17499     else
17500       rm -f "$ac_file"
17501       mv "$ac_tmp/config.h" "$ac_file" \
17502         || as_fn_error $? "could not create $ac_file" "$LINENO" 5
17503     fi
17504   else
17505     $as_echo "/* $configure_input  */" \
17506       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
17507       || as_fn_error $? "could not create -" "$LINENO" 5
17508   fi
17509  ;;
17510   :L)
17511   #
17512   # CONFIG_LINK
17513   #
17514
17515   if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
17516     :
17517   else
17518     # Prefer the file from the source tree if names are identical.
17519     if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
17520       ac_source=$srcdir/$ac_source
17521     fi
17522
17523     { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
17524 $as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
17525
17526     if test ! -r "$ac_source"; then
17527       as_fn_error $? "$ac_source: file not found" "$LINENO" 5
17528     fi
17529     rm -f "$ac_file"
17530
17531     # Try a relative symlink, then a hard link, then a copy.
17532     case $ac_source in
17533     [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
17534         *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
17535     esac
17536     ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
17537       ln "$ac_source" "$ac_file" 2>/dev/null ||
17538       cp -p "$ac_source" "$ac_file" ||
17539       as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
17540   fi
17541  ;;
17542   :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
17543 $as_echo "$as_me: executing $ac_file commands" >&6;}
17544  ;;
17545   esac
17546
17547
17548   case $ac_file$ac_mode in
17549     "check_win32_symlinks":C)
17550 # Links sometimes fail undetected on Mingw -
17551 # so here we detect it and warn the user
17552 for FILE in $CONFIG_LINKS
17553  do
17554         # test -e works for symlinks in the MinGW console
17555         test -e `expr "$FILE" : '\([^:]*\)'` || { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** link for $FILE -- please fix by hand" >&5
17556 $as_echo "$as_me: WARNING: *** link for $FILE -- please fix by hand" >&2;}
17557  done
17558  ;;
17559     "src/include/pg_config.h":H)
17560 # Update timestamp for pg_config.h (see Makefile.global)
17561 echo >src/include/stamp-h
17562  ;;
17563     "src/include/pg_config_ext.h":H)
17564 # Update timestamp for pg_config_ext.h (see Makefile.global)
17565 echo >src/include/stamp-ext-h
17566  ;;
17567     "src/interfaces/ecpg/include/ecpg_config.h":H) echo >src/interfaces/ecpg/include/stamp-h ;;
17568
17569   esac
17570 done # for ac_tag
17571
17572
17573 as_fn_exit 0
17574 _ACEOF
17575 ac_clean_files=$ac_clean_files_save
17576
17577 test $ac_write_fail = 0 ||
17578   as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
17579
17580
17581 # configure is writing to config.log, and then calls config.status.
17582 # config.status does its own redirection, appending to config.log.
17583 # Unfortunately, on DOS this fails, as config.log is still kept open
17584 # by configure, so config.status won't be able to write to it; its
17585 # output is simply discarded.  So we exec the FD to /dev/null,
17586 # effectively closing config.log, so it can be properly (re)opened and
17587 # appended to by config.status.  When coming back to configure, we
17588 # need to make the FD available again.
17589 if test "$no_create" != yes; then
17590   ac_cs_success=:
17591   ac_config_status_args=
17592   test "$silent" = yes &&
17593     ac_config_status_args="$ac_config_status_args --quiet"
17594   exec 5>/dev/null
17595   $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
17596   exec 5>>config.log
17597   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17598   # would make configure fail if this is the last instruction.
17599   $ac_cs_success || as_fn_exit 1
17600 fi
17601 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
17602   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
17603 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
17604 fi
17605