]> granicus.if.org Git - postgresql/blob - configure
Rework handling of invalid indexes with REINDEX CONCURRENTLY
[postgresql] / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by GNU Autoconf 2.69 for PostgreSQL 12devel.
4 #
5 # Report bugs to <pgsql-bugs@lists.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-2019, 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@lists.postgresql.org about your system,
273 $0: including any error possibly output before this
274 $0: message. Then install a modern shell, or manually run
275 $0: the script 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='12devel'
586 PACKAGE_STRING='PostgreSQL 12devel'
587 PACKAGE_BUGREPORT='pgsql-bugs@lists.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_SYSROOT
631 PG_VERSION_NUM
632 PROVE
633 FOP
634 XSLTPROC
635 DBTOEPUB
636 have_docbook
637 XMLLINT
638 TCL_SHLIB_LD_LIBS
639 TCL_SHARED_BUILD
640 TCL_LIB_SPEC
641 TCL_LIBS
642 TCL_INCLUDE_SPEC
643 TCL_CONFIG_SH
644 TCLSH
645 XGETTEXT
646 MSGMERGE
647 MSGFMT_FLAGS
648 MSGFMT
649 PG_CRC32C_OBJS
650 CFLAGS_ARMV8_CRC32C
651 CFLAGS_SSE42
652 have_win32_dbghelp
653 LIBOBJS
654 UUID_LIBS
655 LDAP_LIBS_BE
656 LDAP_LIBS_FE
657 PTHREAD_CFLAGS
658 PTHREAD_LIBS
659 PTHREAD_CC
660 ax_pthread_config
661 SED
662 ZIC
663 python_additional_libs
664 python_libspec
665 python_libdir
666 python_includespec
667 python_version
668 python_majorversion
669 PYTHON
670 perl_embed_ldflags
671 perl_embed_ccflags
672 perl_includespec
673 perl_useshrplib
674 perl_privlibexp
675 perl_archlibexp
676 PERL
677 FLEXFLAGS
678 FLEX
679 BISONFLAGS
680 BISON
681 MKDIR_P
682 LN_S
683 TAR
684 install_bin
685 INSTALL_DATA
686 INSTALL_SCRIPT
687 INSTALL_PROGRAM
688 WINDRES
689 DLLWRAP
690 DLLTOOL
691 AR
692 STRIP_SHARED_LIB
693 STRIP_STATIC_LIB
694 STRIP
695 RANLIB
696 with_gnu_ld
697 LD
698 LDFLAGS_SL
699 LDFLAGS_EX
700 ELF_SYS
701 EGREP
702 GREP
703 with_zlib
704 with_system_tzdata
705 with_libxslt
706 with_libxml
707 XML2_CONFIG
708 UUID_EXTRA_OBJS
709 with_uuid
710 with_systemd
711 with_selinux
712 with_openssl
713 with_ldap
714 with_krb_srvnam
715 krb_srvtab
716 with_gssapi
717 with_python
718 with_perl
719 with_tcl
720 ICU_LIBS
721 ICU_CFLAGS
722 PKG_CONFIG_LIBDIR
723 PKG_CONFIG_PATH
724 PKG_CONFIG
725 with_icu
726 enable_thread_safety
727 INCLUDES
728 autodepend
729 TAS
730 GCC
731 CPP
732 BITCODE_CXXFLAGS
733 BITCODE_CFLAGS
734 CFLAGS_VECTOR
735 PERMIT_DECLARATION_AFTER_STATEMENT
736 LLVM_BINPATH
737 LLVM_CXXFLAGS
738 LLVM_CFLAGS
739 LLVM_CPPFLAGS
740 LLVM_LIBS
741 CLANG
742 LLVM_CONFIG
743 AWK
744 with_llvm
745 SUN_STUDIO_CC
746 ac_ct_CXX
747 CXXFLAGS
748 CXX
749 OBJEXT
750 EXEEXT
751 ac_ct_CC
752 CPPFLAGS
753 LDFLAGS
754 CFLAGS
755 CC
756 enable_tap_tests
757 enable_dtrace
758 DTRACEFLAGS
759 DTRACE
760 enable_coverage
761 GENHTML
762 LCOV
763 GCOV
764 enable_debug
765 enable_rpath
766 default_port
767 WANTED_LANGUAGES
768 enable_nls
769 PORTNAME
770 host_os
771 host_vendor
772 host_cpu
773 host
774 build_os
775 build_vendor
776 build_cpu
777 build
778 PG_MAJORVERSION
779 configure_args
780 target_alias
781 host_alias
782 build_alias
783 LIBS
784 ECHO_T
785 ECHO_N
786 ECHO_C
787 DEFS
788 mandir
789 localedir
790 libdir
791 psdir
792 pdfdir
793 dvidir
794 htmldir
795 infodir
796 docdir
797 oldincludedir
798 includedir
799 localstatedir
800 sharedstatedir
801 sysconfdir
802 datadir
803 datarootdir
804 libexecdir
805 sbindir
806 bindir
807 program_transform_name
808 prefix
809 exec_prefix
810 PACKAGE_URL
811 PACKAGE_BUGREPORT
812 PACKAGE_STRING
813 PACKAGE_VERSION
814 PACKAGE_TARNAME
815 PACKAGE_NAME
816 PATH_SEPARATOR
817 SHELL'
818 ac_subst_files=''
819 ac_user_opts='
820 enable_option_checking
821 with_extra_version
822 with_template
823 with_includes
824 with_libraries
825 with_libs
826 enable_integer_datetimes
827 enable_nls
828 with_pgport
829 enable_rpath
830 enable_spinlocks
831 enable_atomics
832 enable_debug
833 enable_profiling
834 enable_coverage
835 enable_dtrace
836 enable_tap_tests
837 with_blocksize
838 with_segsize
839 with_wal_blocksize
840 with_CC
841 with_llvm
842 enable_depend
843 enable_cassert
844 enable_thread_safety
845 with_icu
846 with_tcl
847 with_tclconfig
848 with_perl
849 with_python
850 with_gssapi
851 with_krb_srvnam
852 with_pam
853 with_bsd_auth
854 with_ldap
855 with_bonjour
856 with_openssl
857 with_selinux
858 with_systemd
859 with_readline
860 with_libedit_preferred
861 with_uuid
862 with_ossp_uuid
863 with_libxml
864 with_libxslt
865 with_system_tzdata
866 with_zlib
867 with_gnu_ld
868 enable_largefile
869 enable_float4_byval
870 enable_float8_byval
871 '
872       ac_precious_vars='build_alias
873 host_alias
874 target_alias
875 CC
876 CFLAGS
877 LDFLAGS
878 LIBS
879 CPPFLAGS
880 CXX
881 CXXFLAGS
882 CCC
883 LLVM_CONFIG
884 CLANG
885 CPP
886 PKG_CONFIG
887 PKG_CONFIG_PATH
888 PKG_CONFIG_LIBDIR
889 ICU_CFLAGS
890 ICU_LIBS
891 XML2_CONFIG
892 LDFLAGS_EX
893 LDFLAGS_SL
894 PERL
895 PYTHON
896 MSGFMT
897 TCLSH'
898
899
900 # Initialize some variables set by options.
901 ac_init_help=
902 ac_init_version=false
903 ac_unrecognized_opts=
904 ac_unrecognized_sep=
905 # The variables have the same names as the options, with
906 # dashes changed to underlines.
907 cache_file=/dev/null
908 exec_prefix=NONE
909 no_create=
910 no_recursion=
911 prefix=NONE
912 program_prefix=NONE
913 program_suffix=NONE
914 program_transform_name=s,x,x,
915 silent=
916 site=
917 srcdir=
918 verbose=
919 x_includes=NONE
920 x_libraries=NONE
921
922 # Installation directory options.
923 # These are left unexpanded so users can "make install exec_prefix=/foo"
924 # and all the variables that are supposed to be based on exec_prefix
925 # by default will actually change.
926 # Use braces instead of parens because sh, perl, etc. also accept them.
927 # (The list follows the same order as the GNU Coding Standards.)
928 bindir='${exec_prefix}/bin'
929 sbindir='${exec_prefix}/sbin'
930 libexecdir='${exec_prefix}/libexec'
931 datarootdir='${prefix}/share'
932 datadir='${datarootdir}'
933 sysconfdir='${prefix}/etc'
934 sharedstatedir='${prefix}/com'
935 localstatedir='${prefix}/var'
936 includedir='${prefix}/include'
937 oldincludedir='/usr/include'
938 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
939 infodir='${datarootdir}/info'
940 htmldir='${docdir}'
941 dvidir='${docdir}'
942 pdfdir='${docdir}'
943 psdir='${docdir}'
944 libdir='${exec_prefix}/lib'
945 localedir='${datarootdir}/locale'
946 mandir='${datarootdir}/man'
947
948 ac_prev=
949 ac_dashdash=
950 for ac_option
951 do
952   # If the previous option needs an argument, assign it.
953   if test -n "$ac_prev"; then
954     eval $ac_prev=\$ac_option
955     ac_prev=
956     continue
957   fi
958
959   case $ac_option in
960   *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
961   *=)   ac_optarg= ;;
962   *)    ac_optarg=yes ;;
963   esac
964
965   # Accept the important Cygnus configure options, so we can diagnose typos.
966
967   case $ac_dashdash$ac_option in
968   --)
969     ac_dashdash=yes ;;
970
971   -bindir | --bindir | --bindi | --bind | --bin | --bi)
972     ac_prev=bindir ;;
973   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
974     bindir=$ac_optarg ;;
975
976   -build | --build | --buil | --bui | --bu)
977     ac_prev=build_alias ;;
978   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
979     build_alias=$ac_optarg ;;
980
981   -cache-file | --cache-file | --cache-fil | --cache-fi \
982   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
983     ac_prev=cache_file ;;
984   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
985   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
986     cache_file=$ac_optarg ;;
987
988   --config-cache | -C)
989     cache_file=config.cache ;;
990
991   -datadir | --datadir | --datadi | --datad)
992     ac_prev=datadir ;;
993   -datadir=* | --datadir=* | --datadi=* | --datad=*)
994     datadir=$ac_optarg ;;
995
996   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
997   | --dataroo | --dataro | --datar)
998     ac_prev=datarootdir ;;
999   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
1000   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
1001     datarootdir=$ac_optarg ;;
1002
1003   -disable-* | --disable-*)
1004     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
1005     # Reject names that are not valid shell variable names.
1006     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1007       as_fn_error $? "invalid feature name: $ac_useropt"
1008     ac_useropt_orig=$ac_useropt
1009     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1010     case $ac_user_opts in
1011       *"
1012 "enable_$ac_useropt"
1013 "*) ;;
1014       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
1015          ac_unrecognized_sep=', ';;
1016     esac
1017     eval enable_$ac_useropt=no ;;
1018
1019   -docdir | --docdir | --docdi | --doc | --do)
1020     ac_prev=docdir ;;
1021   -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
1022     docdir=$ac_optarg ;;
1023
1024   -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
1025     ac_prev=dvidir ;;
1026   -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
1027     dvidir=$ac_optarg ;;
1028
1029   -enable-* | --enable-*)
1030     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
1031     # Reject names that are not valid shell variable names.
1032     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1033       as_fn_error $? "invalid feature name: $ac_useropt"
1034     ac_useropt_orig=$ac_useropt
1035     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1036     case $ac_user_opts in
1037       *"
1038 "enable_$ac_useropt"
1039 "*) ;;
1040       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
1041          ac_unrecognized_sep=', ';;
1042     esac
1043     eval enable_$ac_useropt=\$ac_optarg ;;
1044
1045   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
1046   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
1047   | --exec | --exe | --ex)
1048     ac_prev=exec_prefix ;;
1049   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
1050   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
1051   | --exec=* | --exe=* | --ex=*)
1052     exec_prefix=$ac_optarg ;;
1053
1054   -gas | --gas | --ga | --g)
1055     # Obsolete; use --with-gas.
1056     with_gas=yes ;;
1057
1058   -help | --help | --hel | --he | -h)
1059     ac_init_help=long ;;
1060   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
1061     ac_init_help=recursive ;;
1062   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
1063     ac_init_help=short ;;
1064
1065   -host | --host | --hos | --ho)
1066     ac_prev=host_alias ;;
1067   -host=* | --host=* | --hos=* | --ho=*)
1068     host_alias=$ac_optarg ;;
1069
1070   -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
1071     ac_prev=htmldir ;;
1072   -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
1073   | --ht=*)
1074     htmldir=$ac_optarg ;;
1075
1076   -includedir | --includedir | --includedi | --included | --include \
1077   | --includ | --inclu | --incl | --inc)
1078     ac_prev=includedir ;;
1079   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
1080   | --includ=* | --inclu=* | --incl=* | --inc=*)
1081     includedir=$ac_optarg ;;
1082
1083   -infodir | --infodir | --infodi | --infod | --info | --inf)
1084     ac_prev=infodir ;;
1085   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
1086     infodir=$ac_optarg ;;
1087
1088   -libdir | --libdir | --libdi | --libd)
1089     ac_prev=libdir ;;
1090   -libdir=* | --libdir=* | --libdi=* | --libd=*)
1091     libdir=$ac_optarg ;;
1092
1093   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
1094   | --libexe | --libex | --libe)
1095     ac_prev=libexecdir ;;
1096   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
1097   | --libexe=* | --libex=* | --libe=*)
1098     libexecdir=$ac_optarg ;;
1099
1100   -localedir | --localedir | --localedi | --localed | --locale)
1101     ac_prev=localedir ;;
1102   -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
1103     localedir=$ac_optarg ;;
1104
1105   -localstatedir | --localstatedir | --localstatedi | --localstated \
1106   | --localstate | --localstat | --localsta | --localst | --locals)
1107     ac_prev=localstatedir ;;
1108   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
1109   | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
1110     localstatedir=$ac_optarg ;;
1111
1112   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
1113     ac_prev=mandir ;;
1114   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
1115     mandir=$ac_optarg ;;
1116
1117   -nfp | --nfp | --nf)
1118     # Obsolete; use --without-fp.
1119     with_fp=no ;;
1120
1121   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1122   | --no-cr | --no-c | -n)
1123     no_create=yes ;;
1124
1125   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1126   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1127     no_recursion=yes ;;
1128
1129   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
1130   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
1131   | --oldin | --oldi | --old | --ol | --o)
1132     ac_prev=oldincludedir ;;
1133   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1134   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1135   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1136     oldincludedir=$ac_optarg ;;
1137
1138   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1139     ac_prev=prefix ;;
1140   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1141     prefix=$ac_optarg ;;
1142
1143   -program-prefix | --program-prefix | --program-prefi | --program-pref \
1144   | --program-pre | --program-pr | --program-p)
1145     ac_prev=program_prefix ;;
1146   -program-prefix=* | --program-prefix=* | --program-prefi=* \
1147   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1148     program_prefix=$ac_optarg ;;
1149
1150   -program-suffix | --program-suffix | --program-suffi | --program-suff \
1151   | --program-suf | --program-su | --program-s)
1152     ac_prev=program_suffix ;;
1153   -program-suffix=* | --program-suffix=* | --program-suffi=* \
1154   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1155     program_suffix=$ac_optarg ;;
1156
1157   -program-transform-name | --program-transform-name \
1158   | --program-transform-nam | --program-transform-na \
1159   | --program-transform-n | --program-transform- \
1160   | --program-transform | --program-transfor \
1161   | --program-transfo | --program-transf \
1162   | --program-trans | --program-tran \
1163   | --progr-tra | --program-tr | --program-t)
1164     ac_prev=program_transform_name ;;
1165   -program-transform-name=* | --program-transform-name=* \
1166   | --program-transform-nam=* | --program-transform-na=* \
1167   | --program-transform-n=* | --program-transform-=* \
1168   | --program-transform=* | --program-transfor=* \
1169   | --program-transfo=* | --program-transf=* \
1170   | --program-trans=* | --program-tran=* \
1171   | --progr-tra=* | --program-tr=* | --program-t=*)
1172     program_transform_name=$ac_optarg ;;
1173
1174   -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
1175     ac_prev=pdfdir ;;
1176   -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
1177     pdfdir=$ac_optarg ;;
1178
1179   -psdir | --psdir | --psdi | --psd | --ps)
1180     ac_prev=psdir ;;
1181   -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
1182     psdir=$ac_optarg ;;
1183
1184   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1185   | -silent | --silent | --silen | --sile | --sil)
1186     silent=yes ;;
1187
1188   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1189     ac_prev=sbindir ;;
1190   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1191   | --sbi=* | --sb=*)
1192     sbindir=$ac_optarg ;;
1193
1194   -sharedstatedir | --sharedstatedir | --sharedstatedi \
1195   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1196   | --sharedst | --shareds | --shared | --share | --shar \
1197   | --sha | --sh)
1198     ac_prev=sharedstatedir ;;
1199   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1200   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1201   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1202   | --sha=* | --sh=*)
1203     sharedstatedir=$ac_optarg ;;
1204
1205   -site | --site | --sit)
1206     ac_prev=site ;;
1207   -site=* | --site=* | --sit=*)
1208     site=$ac_optarg ;;
1209
1210   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1211     ac_prev=srcdir ;;
1212   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1213     srcdir=$ac_optarg ;;
1214
1215   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1216   | --syscon | --sysco | --sysc | --sys | --sy)
1217     ac_prev=sysconfdir ;;
1218   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1219   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1220     sysconfdir=$ac_optarg ;;
1221
1222   -target | --target | --targe | --targ | --tar | --ta | --t)
1223     ac_prev=target_alias ;;
1224   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1225     target_alias=$ac_optarg ;;
1226
1227   -v | -verbose | --verbose | --verbos | --verbo | --verb)
1228     verbose=yes ;;
1229
1230   -version | --version | --versio | --versi | --vers | -V)
1231     ac_init_version=: ;;
1232
1233   -with-* | --with-*)
1234     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1235     # Reject names that are not valid shell variable names.
1236     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1237       as_fn_error $? "invalid package name: $ac_useropt"
1238     ac_useropt_orig=$ac_useropt
1239     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1240     case $ac_user_opts in
1241       *"
1242 "with_$ac_useropt"
1243 "*) ;;
1244       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1245          ac_unrecognized_sep=', ';;
1246     esac
1247     eval with_$ac_useropt=\$ac_optarg ;;
1248
1249   -without-* | --without-*)
1250     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1251     # Reject names that are not valid shell variable names.
1252     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1253       as_fn_error $? "invalid package name: $ac_useropt"
1254     ac_useropt_orig=$ac_useropt
1255     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1256     case $ac_user_opts in
1257       *"
1258 "with_$ac_useropt"
1259 "*) ;;
1260       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1261          ac_unrecognized_sep=', ';;
1262     esac
1263     eval with_$ac_useropt=no ;;
1264
1265   --x)
1266     # Obsolete; use --with-x.
1267     with_x=yes ;;
1268
1269   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1270   | --x-incl | --x-inc | --x-in | --x-i)
1271     ac_prev=x_includes ;;
1272   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1273   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1274     x_includes=$ac_optarg ;;
1275
1276   -x-libraries | --x-libraries | --x-librarie | --x-librari \
1277   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1278     ac_prev=x_libraries ;;
1279   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1280   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1281     x_libraries=$ac_optarg ;;
1282
1283   -*) as_fn_error $? "unrecognized option: \`$ac_option'
1284 Try \`$0 --help' for more information"
1285     ;;
1286
1287   *=*)
1288     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1289     # Reject names that are not valid shell variable names.
1290     case $ac_envvar in #(
1291       '' | [0-9]* | *[!_$as_cr_alnum]* )
1292       as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
1293     esac
1294     eval $ac_envvar=\$ac_optarg
1295     export $ac_envvar ;;
1296
1297   *)
1298     # FIXME: should be removed in autoconf 3.0.
1299     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
1300     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1301       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1302     : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
1303     ;;
1304
1305   esac
1306 done
1307
1308 if test -n "$ac_prev"; then
1309   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1310   as_fn_error $? "missing argument to $ac_option"
1311 fi
1312
1313 if test -n "$ac_unrecognized_opts"; then
1314   case $enable_option_checking in
1315     no) ;;
1316     fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
1317     *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1318   esac
1319 fi
1320
1321 # Check all directory arguments for consistency.
1322 for ac_var in   exec_prefix prefix bindir sbindir libexecdir datarootdir \
1323                 datadir sysconfdir sharedstatedir localstatedir includedir \
1324                 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1325                 libdir localedir mandir
1326 do
1327   eval ac_val=\$$ac_var
1328   # Remove trailing slashes.
1329   case $ac_val in
1330     */ )
1331       ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1332       eval $ac_var=\$ac_val;;
1333   esac
1334   # Be sure to have absolute directory names.
1335   case $ac_val in
1336     [\\/$]* | ?:[\\/]* )  continue;;
1337     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1338   esac
1339   as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
1340 done
1341
1342 # There might be people who depend on the old broken behavior: `$host'
1343 # used to hold the argument of --host etc.
1344 # FIXME: To remove some day.
1345 build=$build_alias
1346 host=$host_alias
1347 target=$target_alias
1348
1349 # FIXME: To remove some day.
1350 if test "x$host_alias" != x; then
1351   if test "x$build_alias" = x; then
1352     cross_compiling=maybe
1353   elif test "x$build_alias" != "x$host_alias"; then
1354     cross_compiling=yes
1355   fi
1356 fi
1357
1358 ac_tool_prefix=
1359 test -n "$host_alias" && ac_tool_prefix=$host_alias-
1360
1361 test "$silent" = yes && exec 6>/dev/null
1362
1363
1364 ac_pwd=`pwd` && test -n "$ac_pwd" &&
1365 ac_ls_di=`ls -di .` &&
1366 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1367   as_fn_error $? "working directory cannot be determined"
1368 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1369   as_fn_error $? "pwd does not report name of working directory"
1370
1371
1372 # Find the source files, if location was not specified.
1373 if test -z "$srcdir"; then
1374   ac_srcdir_defaulted=yes
1375   # Try the directory containing this script, then the parent directory.
1376   ac_confdir=`$as_dirname -- "$as_myself" ||
1377 $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1378          X"$as_myself" : 'X\(//\)[^/]' \| \
1379          X"$as_myself" : 'X\(//\)$' \| \
1380          X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1381 $as_echo X"$as_myself" |
1382     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1383             s//\1/
1384             q
1385           }
1386           /^X\(\/\/\)[^/].*/{
1387             s//\1/
1388             q
1389           }
1390           /^X\(\/\/\)$/{
1391             s//\1/
1392             q
1393           }
1394           /^X\(\/\).*/{
1395             s//\1/
1396             q
1397           }
1398           s/.*/./; q'`
1399   srcdir=$ac_confdir
1400   if test ! -r "$srcdir/$ac_unique_file"; then
1401     srcdir=..
1402   fi
1403 else
1404   ac_srcdir_defaulted=no
1405 fi
1406 if test ! -r "$srcdir/$ac_unique_file"; then
1407   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1408   as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
1409 fi
1410 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1411 ac_abs_confdir=`(
1412         cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
1413         pwd)`
1414 # When building in place, set srcdir=.
1415 if test "$ac_abs_confdir" = "$ac_pwd"; then
1416   srcdir=.
1417 fi
1418 # Remove unnecessary trailing slashes from srcdir.
1419 # Double slashes in file names in object file debugging info
1420 # mess up M-x gdb in Emacs.
1421 case $srcdir in
1422 */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1423 esac
1424 for ac_var in $ac_precious_vars; do
1425   eval ac_env_${ac_var}_set=\${${ac_var}+set}
1426   eval ac_env_${ac_var}_value=\$${ac_var}
1427   eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1428   eval ac_cv_env_${ac_var}_value=\$${ac_var}
1429 done
1430
1431 #
1432 # Report the --help message.
1433 #
1434 if test "$ac_init_help" = "long"; then
1435   # Omit some internal or obsolete options to make the list less imposing.
1436   # This message is too long to be a string in the A/UX 3.1 sh.
1437   cat <<_ACEOF
1438 \`configure' configures PostgreSQL 12devel to adapt to many kinds of systems.
1439
1440 Usage: $0 [OPTION]... [VAR=VALUE]...
1441
1442 To assign environment variables (e.g., CC, CFLAGS...), specify them as
1443 VAR=VALUE.  See below for descriptions of some of the useful variables.
1444
1445 Defaults for the options are specified in brackets.
1446
1447 Configuration:
1448   -h, --help              display this help and exit
1449       --help=short        display options specific to this package
1450       --help=recursive    display the short help of all the included packages
1451   -V, --version           display version information and exit
1452   -q, --quiet, --silent   do not print \`checking ...' messages
1453       --cache-file=FILE   cache test results in FILE [disabled]
1454   -C, --config-cache      alias for \`--cache-file=config.cache'
1455   -n, --no-create         do not create output files
1456       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
1457
1458 Installation directories:
1459   --prefix=PREFIX         install architecture-independent files in PREFIX
1460                           [$ac_default_prefix]
1461   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
1462                           [PREFIX]
1463
1464 By default, \`make install' will install all the files in
1465 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
1466 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1467 for instance \`--prefix=\$HOME'.
1468
1469 For better control, use the options below.
1470
1471 Fine tuning of the installation directories:
1472   --bindir=DIR            user executables [EPREFIX/bin]
1473   --sbindir=DIR           system admin executables [EPREFIX/sbin]
1474   --libexecdir=DIR        program executables [EPREFIX/libexec]
1475   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1476   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1477   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1478   --libdir=DIR            object code libraries [EPREFIX/lib]
1479   --includedir=DIR        C header files [PREFIX/include]
1480   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
1481   --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
1482   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
1483   --infodir=DIR           info documentation [DATAROOTDIR/info]
1484   --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
1485   --mandir=DIR            man documentation [DATAROOTDIR/man]
1486   --docdir=DIR            documentation root [DATAROOTDIR/doc/postgresql]
1487   --htmldir=DIR           html documentation [DOCDIR]
1488   --dvidir=DIR            dvi documentation [DOCDIR]
1489   --pdfdir=DIR            pdf documentation [DOCDIR]
1490   --psdir=DIR             ps documentation [DOCDIR]
1491 _ACEOF
1492
1493   cat <<\_ACEOF
1494
1495 System types:
1496   --build=BUILD     configure for building on BUILD [guessed]
1497   --host=HOST       cross-compile to build programs to run on HOST [BUILD]
1498 _ACEOF
1499 fi
1500
1501 if test -n "$ac_init_help"; then
1502   case $ac_init_help in
1503      short | recursive ) echo "Configuration of PostgreSQL 12devel:";;
1504    esac
1505   cat <<\_ACEOF
1506
1507 Optional Features:
1508   --disable-option-checking  ignore unrecognized --enable/--with options
1509   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1510   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
1511   --disable-integer-datetimes
1512                           obsolete option, no longer supported
1513   --enable-nls[=LANGUAGES]
1514                           enable Native Language Support
1515   --disable-rpath         do not embed shared library search path in
1516                           executables
1517   --disable-spinlocks     do not use spinlocks
1518   --disable-atomics       do not use atomic operations
1519   --enable-debug          build with debugging symbols (-g)
1520   --enable-profiling      build with profiling enabled
1521   --enable-coverage       build with coverage testing instrumentation
1522   --enable-dtrace         build with DTrace support
1523   --enable-tap-tests      enable TAP tests (requires Perl and IPC::Run)
1524   --enable-depend         turn on automatic dependency tracking
1525   --enable-cassert        enable assertion checks (for debugging)
1526   --disable-thread-safety disable thread-safety in client libraries
1527   --disable-largefile     omit support for large files
1528   --disable-float4-byval  disable float4 passed by value
1529   --disable-float8-byval  disable float8 passed by value
1530
1531 Optional Packages:
1532   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1533   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
1534   --with-extra-version=STRING
1535                           append STRING to version
1536   --with-template=NAME    override operating system template
1537   --with-includes=DIRS    look for additional header files in DIRS
1538   --with-libraries=DIRS   look for additional libraries in DIRS
1539   --with-libs=DIRS        alternative spelling of --with-libraries
1540   --with-pgport=PORTNUM   set default port number [5432]
1541   --with-blocksize=BLOCKSIZE
1542                           set table block size in kB [8]
1543   --with-segsize=SEGSIZE  set table segment size in GB [1]
1544   --with-wal-blocksize=BLOCKSIZE
1545                           set WAL block size in kB [8]
1546   --with-CC=CMD           set compiler (deprecated)
1547   --with-llvm             build with LLVM based JIT support
1548   --with-icu              build with ICU support
1549   --with-tcl              build Tcl modules (PL/Tcl)
1550   --with-tclconfig=DIR    tclConfig.sh is in DIR
1551   --with-perl             build Perl modules (PL/Perl)
1552   --with-python           build Python modules (PL/Python)
1553   --with-gssapi           build with GSSAPI support
1554   --with-krb-srvnam=NAME  default service principal name in Kerberos (GSSAPI)
1555                           [postgres]
1556   --with-pam              build with PAM support
1557   --with-bsd-auth         build with BSD Authentication support
1558   --with-ldap             build with LDAP support
1559   --with-bonjour          build with Bonjour support
1560   --with-openssl          build with OpenSSL support
1561   --with-selinux          build with SELinux support
1562   --with-systemd          build with systemd support
1563   --without-readline      do not use GNU Readline nor BSD Libedit for editing
1564   --with-libedit-preferred
1565                           prefer BSD Libedit over GNU Readline
1566   --with-uuid=LIB         build contrib/uuid-ossp using LIB (bsd,e2fs,ossp)
1567   --with-ossp-uuid        obsolete spelling of --with-uuid=ossp
1568   --with-libxml           build with XML support
1569   --with-libxslt          use XSLT support when building contrib/xml2
1570   --with-system-tzdata=DIR
1571                           use system time zone data in DIR
1572   --without-zlib          do not use Zlib
1573   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
1574
1575 Some influential environment variables:
1576   CC          C compiler command
1577   CFLAGS      C compiler flags
1578   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
1579               nonstandard directory <lib dir>
1580   LIBS        libraries to pass to the linker, e.g. -l<library>
1581   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1582               you have headers in a nonstandard directory <include dir>
1583   CXX         C++ compiler command
1584   CXXFLAGS    C++ compiler flags
1585   LLVM_CONFIG path to llvm-config command
1586   CLANG       path to clang compiler to generate bitcode
1587   CPP         C preprocessor
1588   PKG_CONFIG  path to pkg-config utility
1589   PKG_CONFIG_PATH
1590               directories to add to pkg-config's search path
1591   PKG_CONFIG_LIBDIR
1592               path overriding pkg-config's built-in search path
1593   ICU_CFLAGS  C compiler flags for ICU, overriding pkg-config
1594   ICU_LIBS    linker flags for ICU, overriding pkg-config
1595   XML2_CONFIG path to xml2-config utility
1596   LDFLAGS_EX  extra linker flags for linking executables only
1597   LDFLAGS_SL  extra linker flags for linking shared libraries only
1598   PERL        Perl program
1599   PYTHON      Python program
1600   MSGFMT      msgfmt program for NLS
1601   TCLSH       Tcl interpreter program (tclsh)
1602
1603 Use these variables to override the choices made by `configure' or to help
1604 it to find libraries and programs with nonstandard names/locations.
1605
1606 Report bugs to <pgsql-bugs@lists.postgresql.org>.
1607 _ACEOF
1608 ac_status=$?
1609 fi
1610
1611 if test "$ac_init_help" = "recursive"; then
1612   # If there are subdirs, report their specific --help.
1613   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1614     test -d "$ac_dir" ||
1615       { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1616       continue
1617     ac_builddir=.
1618
1619 case "$ac_dir" in
1620 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1621 *)
1622   ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
1623   # A ".." for each directory in $ac_dir_suffix.
1624   ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1625   case $ac_top_builddir_sub in
1626   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1627   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1628   esac ;;
1629 esac
1630 ac_abs_top_builddir=$ac_pwd
1631 ac_abs_builddir=$ac_pwd$ac_dir_suffix
1632 # for backward compatibility:
1633 ac_top_builddir=$ac_top_build_prefix
1634
1635 case $srcdir in
1636   .)  # We are building in place.
1637     ac_srcdir=.
1638     ac_top_srcdir=$ac_top_builddir_sub
1639     ac_abs_top_srcdir=$ac_pwd ;;
1640   [\\/]* | ?:[\\/]* )  # Absolute name.
1641     ac_srcdir=$srcdir$ac_dir_suffix;
1642     ac_top_srcdir=$srcdir
1643     ac_abs_top_srcdir=$srcdir ;;
1644   *) # Relative name.
1645     ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1646     ac_top_srcdir=$ac_top_build_prefix$srcdir
1647     ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1648 esac
1649 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1650
1651     cd "$ac_dir" || { ac_status=$?; continue; }
1652     # Check for guested configure.
1653     if test -f "$ac_srcdir/configure.gnu"; then
1654       echo &&
1655       $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1656     elif test -f "$ac_srcdir/configure"; then
1657       echo &&
1658       $SHELL "$ac_srcdir/configure" --help=recursive
1659     else
1660       $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1661     fi || ac_status=$?
1662     cd "$ac_pwd" || { ac_status=$?; break; }
1663   done
1664 fi
1665
1666 test -n "$ac_init_help" && exit $ac_status
1667 if $ac_init_version; then
1668   cat <<\_ACEOF
1669 PostgreSQL configure 12devel
1670 generated by GNU Autoconf 2.69
1671
1672 Copyright (C) 2012 Free Software Foundation, Inc.
1673 This configure script is free software; the Free Software Foundation
1674 gives unlimited permission to copy, distribute and modify it.
1675
1676 Copyright (c) 1996-2019, PostgreSQL Global Development Group
1677 _ACEOF
1678   exit
1679 fi
1680
1681 ## ------------------------ ##
1682 ## Autoconf initialization. ##
1683 ## ------------------------ ##
1684
1685 # ac_fn_c_try_compile LINENO
1686 # --------------------------
1687 # Try to compile conftest.$ac_ext, and return whether this succeeded.
1688 ac_fn_c_try_compile ()
1689 {
1690   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1691   rm -f conftest.$ac_objext
1692   if { { ac_try="$ac_compile"
1693 case "(($ac_try" in
1694   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1695   *) ac_try_echo=$ac_try;;
1696 esac
1697 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1698 $as_echo "$ac_try_echo"; } >&5
1699   (eval "$ac_compile") 2>conftest.err
1700   ac_status=$?
1701   if test -s conftest.err; then
1702     grep -v '^ *+' conftest.err >conftest.er1
1703     cat conftest.er1 >&5
1704     mv -f conftest.er1 conftest.err
1705   fi
1706   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1707   test $ac_status = 0; } && {
1708          test -z "$ac_c_werror_flag" ||
1709          test ! -s conftest.err
1710        } && test -s conftest.$ac_objext; then :
1711   ac_retval=0
1712 else
1713   $as_echo "$as_me: failed program was:" >&5
1714 sed 's/^/| /' conftest.$ac_ext >&5
1715
1716         ac_retval=1
1717 fi
1718   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1719   as_fn_set_status $ac_retval
1720
1721 } # ac_fn_c_try_compile
1722
1723 # ac_fn_cxx_try_compile LINENO
1724 # ----------------------------
1725 # Try to compile conftest.$ac_ext, and return whether this succeeded.
1726 ac_fn_cxx_try_compile ()
1727 {
1728   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1729   rm -f conftest.$ac_objext
1730   if { { ac_try="$ac_compile"
1731 case "(($ac_try" in
1732   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1733   *) ac_try_echo=$ac_try;;
1734 esac
1735 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1736 $as_echo "$ac_try_echo"; } >&5
1737   (eval "$ac_compile") 2>conftest.err
1738   ac_status=$?
1739   if test -s conftest.err; then
1740     grep -v '^ *+' conftest.err >conftest.er1
1741     cat conftest.er1 >&5
1742     mv -f conftest.er1 conftest.err
1743   fi
1744   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1745   test $ac_status = 0; } && {
1746          test -z "$ac_cxx_werror_flag" ||
1747          test ! -s conftest.err
1748        } && test -s conftest.$ac_objext; then :
1749   ac_retval=0
1750 else
1751   $as_echo "$as_me: failed program was:" >&5
1752 sed 's/^/| /' conftest.$ac_ext >&5
1753
1754         ac_retval=1
1755 fi
1756   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1757   as_fn_set_status $ac_retval
1758
1759 } # ac_fn_cxx_try_compile
1760
1761 # ac_fn_c_try_link LINENO
1762 # -----------------------
1763 # Try to link conftest.$ac_ext, and return whether this succeeded.
1764 ac_fn_c_try_link ()
1765 {
1766   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1767   rm -f conftest.$ac_objext conftest$ac_exeext
1768   if { { ac_try="$ac_link"
1769 case "(($ac_try" in
1770   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1771   *) ac_try_echo=$ac_try;;
1772 esac
1773 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1774 $as_echo "$ac_try_echo"; } >&5
1775   (eval "$ac_link") 2>conftest.err
1776   ac_status=$?
1777   if test -s conftest.err; then
1778     grep -v '^ *+' conftest.err >conftest.er1
1779     cat conftest.er1 >&5
1780     mv -f conftest.er1 conftest.err
1781   fi
1782   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1783   test $ac_status = 0; } && {
1784          test -z "$ac_c_werror_flag" ||
1785          test ! -s conftest.err
1786        } && test -s conftest$ac_exeext && {
1787          test "$cross_compiling" = yes ||
1788          test -x conftest$ac_exeext
1789        }; then :
1790   ac_retval=0
1791 else
1792   $as_echo "$as_me: failed program was:" >&5
1793 sed 's/^/| /' conftest.$ac_ext >&5
1794
1795         ac_retval=1
1796 fi
1797   # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1798   # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1799   # interfere with the next link command; also delete a directory that is
1800   # left behind by Apple's compiler.  We do this before executing the actions.
1801   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1802   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1803   as_fn_set_status $ac_retval
1804
1805 } # ac_fn_c_try_link
1806
1807 # ac_fn_c_try_cpp LINENO
1808 # ----------------------
1809 # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
1810 ac_fn_c_try_cpp ()
1811 {
1812   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1813   if { { ac_try="$ac_cpp conftest.$ac_ext"
1814 case "(($ac_try" in
1815   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1816   *) ac_try_echo=$ac_try;;
1817 esac
1818 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1819 $as_echo "$ac_try_echo"; } >&5
1820   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
1821   ac_status=$?
1822   if test -s conftest.err; then
1823     grep -v '^ *+' conftest.err >conftest.er1
1824     cat conftest.er1 >&5
1825     mv -f conftest.er1 conftest.err
1826   fi
1827   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1828   test $ac_status = 0; } > conftest.i && {
1829          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
1830          test ! -s conftest.err
1831        }; then :
1832   ac_retval=0
1833 else
1834   $as_echo "$as_me: failed program was:" >&5
1835 sed 's/^/| /' conftest.$ac_ext >&5
1836
1837     ac_retval=1
1838 fi
1839   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1840   as_fn_set_status $ac_retval
1841
1842 } # ac_fn_c_try_cpp
1843
1844 # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
1845 # -------------------------------------------------------
1846 # Tests whether HEADER exists, giving a warning if it cannot be compiled using
1847 # the include files in INCLUDES and setting the cache variable VAR
1848 # accordingly.
1849 ac_fn_c_check_header_mongrel ()
1850 {
1851   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1852   if eval \${$3+:} false; then :
1853   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1854 $as_echo_n "checking for $2... " >&6; }
1855 if eval \${$3+:} false; then :
1856   $as_echo_n "(cached) " >&6
1857 fi
1858 eval ac_res=\$$3
1859                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1860 $as_echo "$ac_res" >&6; }
1861 else
1862   # Is the header compilable?
1863 { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
1864 $as_echo_n "checking $2 usability... " >&6; }
1865 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1866 /* end confdefs.h.  */
1867 $4
1868 #include <$2>
1869 _ACEOF
1870 if ac_fn_c_try_compile "$LINENO"; then :
1871   ac_header_compiler=yes
1872 else
1873   ac_header_compiler=no
1874 fi
1875 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1876 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
1877 $as_echo "$ac_header_compiler" >&6; }
1878
1879 # Is the header present?
1880 { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
1881 $as_echo_n "checking $2 presence... " >&6; }
1882 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1883 /* end confdefs.h.  */
1884 #include <$2>
1885 _ACEOF
1886 if ac_fn_c_try_cpp "$LINENO"; then :
1887   ac_header_preproc=yes
1888 else
1889   ac_header_preproc=no
1890 fi
1891 rm -f conftest.err conftest.i conftest.$ac_ext
1892 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
1893 $as_echo "$ac_header_preproc" >&6; }
1894
1895 # So?  What about this header?
1896 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
1897   yes:no: )
1898     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
1899 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
1900     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1901 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1902     ;;
1903   no:yes:* )
1904     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
1905 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
1906     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
1907 $as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
1908     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
1909 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
1910     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
1911 $as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
1912     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1913 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1914 ( $as_echo "## ---------------------------------------------- ##
1915 ## Report this to pgsql-bugs@lists.postgresql.org ##
1916 ## ---------------------------------------------- ##"
1917      ) | sed "s/^/$as_me: WARNING:     /" >&2
1918     ;;
1919 esac
1920   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1921 $as_echo_n "checking for $2... " >&6; }
1922 if eval \${$3+:} false; then :
1923   $as_echo_n "(cached) " >&6
1924 else
1925   eval "$3=\$ac_header_compiler"
1926 fi
1927 eval ac_res=\$$3
1928                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1929 $as_echo "$ac_res" >&6; }
1930 fi
1931   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1932
1933 } # ac_fn_c_check_header_mongrel
1934
1935 # ac_fn_c_try_run LINENO
1936 # ----------------------
1937 # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
1938 # that executables *can* be run.
1939 ac_fn_c_try_run ()
1940 {
1941   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1942   if { { ac_try="$ac_link"
1943 case "(($ac_try" in
1944   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1945   *) ac_try_echo=$ac_try;;
1946 esac
1947 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1948 $as_echo "$ac_try_echo"; } >&5
1949   (eval "$ac_link") 2>&5
1950   ac_status=$?
1951   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1952   test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
1953   { { case "(($ac_try" in
1954   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1955   *) ac_try_echo=$ac_try;;
1956 esac
1957 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1958 $as_echo "$ac_try_echo"; } >&5
1959   (eval "$ac_try") 2>&5
1960   ac_status=$?
1961   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1962   test $ac_status = 0; }; }; then :
1963   ac_retval=0
1964 else
1965   $as_echo "$as_me: program exited with status $ac_status" >&5
1966        $as_echo "$as_me: failed program was:" >&5
1967 sed 's/^/| /' conftest.$ac_ext >&5
1968
1969        ac_retval=$ac_status
1970 fi
1971   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1972   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1973   as_fn_set_status $ac_retval
1974
1975 } # ac_fn_c_try_run
1976
1977 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
1978 # -------------------------------------------------------
1979 # Tests whether HEADER exists and can be compiled using the include files in
1980 # INCLUDES, setting the cache variable VAR accordingly.
1981 ac_fn_c_check_header_compile ()
1982 {
1983   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1984   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1985 $as_echo_n "checking for $2... " >&6; }
1986 if eval \${$3+:} false; then :
1987   $as_echo_n "(cached) " >&6
1988 else
1989   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1990 /* end confdefs.h.  */
1991 $4
1992 #include <$2>
1993 _ACEOF
1994 if ac_fn_c_try_compile "$LINENO"; then :
1995   eval "$3=yes"
1996 else
1997   eval "$3=no"
1998 fi
1999 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2000 fi
2001 eval ac_res=\$$3
2002                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2003 $as_echo "$ac_res" >&6; }
2004   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2005
2006 } # ac_fn_c_check_header_compile
2007
2008 # ac_fn_c_check_func LINENO FUNC VAR
2009 # ----------------------------------
2010 # Tests whether FUNC exists, setting the cache variable VAR accordingly
2011 ac_fn_c_check_func ()
2012 {
2013   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2014   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2015 $as_echo_n "checking for $2... " >&6; }
2016 if eval \${$3+:} false; then :
2017   $as_echo_n "(cached) " >&6
2018 else
2019   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2020 /* end confdefs.h.  */
2021 /* Define $2 to an innocuous variant, in case <limits.h> declares $2.
2022    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
2023 #define $2 innocuous_$2
2024
2025 /* System header to define __stub macros and hopefully few prototypes,
2026     which can conflict with char $2 (); below.
2027     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
2028     <limits.h> exists even on freestanding compilers.  */
2029
2030 #ifdef __STDC__
2031 # include <limits.h>
2032 #else
2033 # include <assert.h>
2034 #endif
2035
2036 #undef $2
2037
2038 /* Override any GCC internal prototype to avoid an error.
2039    Use char because int might match the return type of a GCC
2040    builtin and then its argument prototype would still apply.  */
2041 #ifdef __cplusplus
2042 extern "C"
2043 #endif
2044 char $2 ();
2045 /* The GNU C library defines this for functions which it implements
2046     to always fail with ENOSYS.  Some functions are actually named
2047     something starting with __ and the normal name is an alias.  */
2048 #if defined __stub_$2 || defined __stub___$2
2049 choke me
2050 #endif
2051
2052 int
2053 main ()
2054 {
2055 return $2 ();
2056   ;
2057   return 0;
2058 }
2059 _ACEOF
2060 if ac_fn_c_try_link "$LINENO"; then :
2061   eval "$3=yes"
2062 else
2063   eval "$3=no"
2064 fi
2065 rm -f core conftest.err conftest.$ac_objext \
2066     conftest$ac_exeext conftest.$ac_ext
2067 fi
2068 eval ac_res=\$$3
2069                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2070 $as_echo "$ac_res" >&6; }
2071   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2072
2073 } # ac_fn_c_check_func
2074
2075 # ac_fn_c_check_type LINENO TYPE VAR INCLUDES
2076 # -------------------------------------------
2077 # Tests whether TYPE exists after having included INCLUDES, setting cache
2078 # variable VAR accordingly.
2079 ac_fn_c_check_type ()
2080 {
2081   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2082   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2083 $as_echo_n "checking for $2... " >&6; }
2084 if eval \${$3+:} false; then :
2085   $as_echo_n "(cached) " >&6
2086 else
2087   eval "$3=no"
2088   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2089 /* end confdefs.h.  */
2090 $4
2091 int
2092 main ()
2093 {
2094 if (sizeof ($2))
2095          return 0;
2096   ;
2097   return 0;
2098 }
2099 _ACEOF
2100 if ac_fn_c_try_compile "$LINENO"; then :
2101   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2102 /* end confdefs.h.  */
2103 $4
2104 int
2105 main ()
2106 {
2107 if (sizeof (($2)))
2108             return 0;
2109   ;
2110   return 0;
2111 }
2112 _ACEOF
2113 if ac_fn_c_try_compile "$LINENO"; then :
2114
2115 else
2116   eval "$3=yes"
2117 fi
2118 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2119 fi
2120 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2121 fi
2122 eval ac_res=\$$3
2123                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2124 $as_echo "$ac_res" >&6; }
2125   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2126
2127 } # ac_fn_c_check_type
2128
2129 # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
2130 # ----------------------------------------------------
2131 # Tries to find if the field MEMBER exists in type AGGR, after including
2132 # INCLUDES, setting cache variable VAR accordingly.
2133 ac_fn_c_check_member ()
2134 {
2135   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2136   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
2137 $as_echo_n "checking for $2.$3... " >&6; }
2138 if eval \${$4+:} false; then :
2139   $as_echo_n "(cached) " >&6
2140 else
2141   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2142 /* end confdefs.h.  */
2143 $5
2144 int
2145 main ()
2146 {
2147 static $2 ac_aggr;
2148 if (ac_aggr.$3)
2149 return 0;
2150   ;
2151   return 0;
2152 }
2153 _ACEOF
2154 if ac_fn_c_try_compile "$LINENO"; then :
2155   eval "$4=yes"
2156 else
2157   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2158 /* end confdefs.h.  */
2159 $5
2160 int
2161 main ()
2162 {
2163 static $2 ac_aggr;
2164 if (sizeof ac_aggr.$3)
2165 return 0;
2166   ;
2167   return 0;
2168 }
2169 _ACEOF
2170 if ac_fn_c_try_compile "$LINENO"; then :
2171   eval "$4=yes"
2172 else
2173   eval "$4=no"
2174 fi
2175 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2176 fi
2177 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2178 fi
2179 eval ac_res=\$$4
2180                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2181 $as_echo "$ac_res" >&6; }
2182   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2183
2184 } # ac_fn_c_check_member
2185
2186 # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
2187 # --------------------------------------------
2188 # Tries to find the compile-time value of EXPR in a program that includes
2189 # INCLUDES, setting VAR accordingly. Returns whether the value could be
2190 # computed
2191 ac_fn_c_compute_int ()
2192 {
2193   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2194   if test "$cross_compiling" = yes; then
2195     # Depending upon the size, compute the lo and hi bounds.
2196 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2197 /* end confdefs.h.  */
2198 $4
2199 int
2200 main ()
2201 {
2202 static int test_array [1 - 2 * !(($2) >= 0)];
2203 test_array [0] = 0;
2204 return test_array [0];
2205
2206   ;
2207   return 0;
2208 }
2209 _ACEOF
2210 if ac_fn_c_try_compile "$LINENO"; then :
2211   ac_lo=0 ac_mid=0
2212   while :; do
2213     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2214 /* end confdefs.h.  */
2215 $4
2216 int
2217 main ()
2218 {
2219 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
2220 test_array [0] = 0;
2221 return test_array [0];
2222
2223   ;
2224   return 0;
2225 }
2226 _ACEOF
2227 if ac_fn_c_try_compile "$LINENO"; then :
2228   ac_hi=$ac_mid; break
2229 else
2230   as_fn_arith $ac_mid + 1 && ac_lo=$as_val
2231                         if test $ac_lo -le $ac_mid; then
2232                           ac_lo= ac_hi=
2233                           break
2234                         fi
2235                         as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
2236 fi
2237 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2238   done
2239 else
2240   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2241 /* end confdefs.h.  */
2242 $4
2243 int
2244 main ()
2245 {
2246 static int test_array [1 - 2 * !(($2) < 0)];
2247 test_array [0] = 0;
2248 return test_array [0];
2249
2250   ;
2251   return 0;
2252 }
2253 _ACEOF
2254 if ac_fn_c_try_compile "$LINENO"; then :
2255   ac_hi=-1 ac_mid=-1
2256   while :; do
2257     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2258 /* end confdefs.h.  */
2259 $4
2260 int
2261 main ()
2262 {
2263 static int test_array [1 - 2 * !(($2) >= $ac_mid)];
2264 test_array [0] = 0;
2265 return test_array [0];
2266
2267   ;
2268   return 0;
2269 }
2270 _ACEOF
2271 if ac_fn_c_try_compile "$LINENO"; then :
2272   ac_lo=$ac_mid; break
2273 else
2274   as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
2275                         if test $ac_mid -le $ac_hi; then
2276                           ac_lo= ac_hi=
2277                           break
2278                         fi
2279                         as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
2280 fi
2281 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2282   done
2283 else
2284   ac_lo= ac_hi=
2285 fi
2286 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2287 fi
2288 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2289 # Binary search between lo and hi bounds.
2290 while test "x$ac_lo" != "x$ac_hi"; do
2291   as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
2292   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2293 /* end confdefs.h.  */
2294 $4
2295 int
2296 main ()
2297 {
2298 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
2299 test_array [0] = 0;
2300 return test_array [0];
2301
2302   ;
2303   return 0;
2304 }
2305 _ACEOF
2306 if ac_fn_c_try_compile "$LINENO"; then :
2307   ac_hi=$ac_mid
2308 else
2309   as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
2310 fi
2311 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2312 done
2313 case $ac_lo in #((
2314 ?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
2315 '') ac_retval=1 ;;
2316 esac
2317   else
2318     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2319 /* end confdefs.h.  */
2320 $4
2321 static long int longval () { return $2; }
2322 static unsigned long int ulongval () { return $2; }
2323 #include <stdio.h>
2324 #include <stdlib.h>
2325 int
2326 main ()
2327 {
2328
2329   FILE *f = fopen ("conftest.val", "w");
2330   if (! f)
2331     return 1;
2332   if (($2) < 0)
2333     {
2334       long int i = longval ();
2335       if (i != ($2))
2336         return 1;
2337       fprintf (f, "%ld", i);
2338     }
2339   else
2340     {
2341       unsigned long int i = ulongval ();
2342       if (i != ($2))
2343         return 1;
2344       fprintf (f, "%lu", i);
2345     }
2346   /* Do not output a trailing newline, as this causes \r\n confusion
2347      on some platforms.  */
2348   return ferror (f) || fclose (f) != 0;
2349
2350   ;
2351   return 0;
2352 }
2353 _ACEOF
2354 if ac_fn_c_try_run "$LINENO"; then :
2355   echo >>conftest.val; read $3 <conftest.val; ac_retval=0
2356 else
2357   ac_retval=1
2358 fi
2359 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
2360   conftest.$ac_objext conftest.beam conftest.$ac_ext
2361 rm -f conftest.val
2362
2363   fi
2364   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2365   as_fn_set_status $ac_retval
2366
2367 } # ac_fn_c_compute_int
2368
2369 # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
2370 # ---------------------------------------------
2371 # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
2372 # accordingly.
2373 ac_fn_c_check_decl ()
2374 {
2375   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2376   # Initialize each $ac_[]_AC_LANG_ABBREV[]_decl_warn_flag once.
2377       as_decl_name=`echo $2|sed 's/ *(.*//'`
2378   as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
2379   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
2380 $as_echo_n "checking whether $as_decl_name is declared... " >&6; }
2381 if eval \${$3+:} false; then :
2382   $as_echo_n "(cached) " >&6
2383 else
2384   ac_save_werror_flag=$ac_c_werror_flag
2385   ac_c_werror_flag="$ac_c_decl_warn_flag$ac_c_werror_flag"
2386   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2387 /* end confdefs.h.  */
2388 $4
2389 int
2390 main ()
2391 {
2392 #ifndef $as_decl_name
2393 #ifdef __cplusplus
2394   (void) $as_decl_use;
2395 #else
2396   (void) $as_decl_name;
2397 #endif
2398 #endif
2399
2400   ;
2401   return 0;
2402 }
2403 _ACEOF
2404 if ac_fn_c_try_compile "$LINENO"; then :
2405   eval "$3=yes"
2406 else
2407   eval "$3=no"
2408 fi
2409 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2410   ac_c_werror_flag=$ac_save_werror_flag
2411 fi
2412 eval ac_res=\$$3
2413                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2414 $as_echo "$ac_res" >&6; }
2415   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2416
2417 } # ac_fn_c_check_decl
2418 cat >config.log <<_ACEOF
2419 This file contains any messages produced by compilers while
2420 running configure, to aid debugging if configure makes a mistake.
2421
2422 It was created by PostgreSQL $as_me 12devel, which was
2423 generated by GNU Autoconf 2.69.  Invocation command line was
2424
2425   $ $0 $@
2426
2427 _ACEOF
2428 exec 5>>config.log
2429 {
2430 cat <<_ASUNAME
2431 ## --------- ##
2432 ## Platform. ##
2433 ## --------- ##
2434
2435 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
2436 uname -m = `(uname -m) 2>/dev/null || echo unknown`
2437 uname -r = `(uname -r) 2>/dev/null || echo unknown`
2438 uname -s = `(uname -s) 2>/dev/null || echo unknown`
2439 uname -v = `(uname -v) 2>/dev/null || echo unknown`
2440
2441 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
2442 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
2443
2444 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
2445 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
2446 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
2447 /usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
2448 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
2449 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
2450 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
2451
2452 _ASUNAME
2453
2454 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2455 for as_dir in $PATH
2456 do
2457   IFS=$as_save_IFS
2458   test -z "$as_dir" && as_dir=.
2459     $as_echo "PATH: $as_dir"
2460   done
2461 IFS=$as_save_IFS
2462
2463 } >&5
2464
2465 cat >&5 <<_ACEOF
2466
2467
2468 ## ----------- ##
2469 ## Core tests. ##
2470 ## ----------- ##
2471
2472 _ACEOF
2473
2474
2475 # Keep a trace of the command line.
2476 # Strip out --no-create and --no-recursion so they do not pile up.
2477 # Strip out --silent because we don't want to record it for future runs.
2478 # Also quote any args containing shell meta-characters.
2479 # Make two passes to allow for proper duplicate-argument suppression.
2480 ac_configure_args=
2481 ac_configure_args0=
2482 ac_configure_args1=
2483 ac_must_keep_next=false
2484 for ac_pass in 1 2
2485 do
2486   for ac_arg
2487   do
2488     case $ac_arg in
2489     -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
2490     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
2491     | -silent | --silent | --silen | --sile | --sil)
2492       continue ;;
2493     *\'*)
2494       ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
2495     esac
2496     case $ac_pass in
2497     1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2498     2)
2499       as_fn_append ac_configure_args1 " '$ac_arg'"
2500       if test $ac_must_keep_next = true; then
2501         ac_must_keep_next=false # Got value, back to normal.
2502       else
2503         case $ac_arg in
2504           *=* | --config-cache | -C | -disable-* | --disable-* \
2505           | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
2506           | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
2507           | -with-* | --with-* | -without-* | --without-* | --x)
2508             case "$ac_configure_args0 " in
2509               "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
2510             esac
2511             ;;
2512           -* ) ac_must_keep_next=true ;;
2513         esac
2514       fi
2515       as_fn_append ac_configure_args " '$ac_arg'"
2516       ;;
2517     esac
2518   done
2519 done
2520 { ac_configure_args0=; unset ac_configure_args0;}
2521 { ac_configure_args1=; unset ac_configure_args1;}
2522
2523 # When interrupted or exit'd, cleanup temporary files, and complete
2524 # config.log.  We remove comments because anyway the quotes in there
2525 # would cause problems or look ugly.
2526 # WARNING: Use '\'' to represent an apostrophe within the trap.
2527 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
2528 trap 'exit_status=$?
2529   # Save into config.log some information that might help in debugging.
2530   {
2531     echo
2532
2533     $as_echo "## ---------------- ##
2534 ## Cache variables. ##
2535 ## ---------------- ##"
2536     echo
2537     # The following way of writing the cache mishandles newlines in values,
2538 (
2539   for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
2540     eval ac_val=\$$ac_var
2541     case $ac_val in #(
2542     *${as_nl}*)
2543       case $ac_var in #(
2544       *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
2545 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2546       esac
2547       case $ac_var in #(
2548       _ | IFS | as_nl) ;; #(
2549       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
2550       *) { eval $ac_var=; unset $ac_var;} ;;
2551       esac ;;
2552     esac
2553   done
2554   (set) 2>&1 |
2555     case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
2556     *${as_nl}ac_space=\ *)
2557       sed -n \
2558         "s/'\''/'\''\\\\'\'''\''/g;
2559           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
2560       ;; #(
2561     *)
2562       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
2563       ;;
2564     esac |
2565     sort
2566 )
2567     echo
2568
2569     $as_echo "## ----------------- ##
2570 ## Output variables. ##
2571 ## ----------------- ##"
2572     echo
2573     for ac_var in $ac_subst_vars
2574     do
2575       eval ac_val=\$$ac_var
2576       case $ac_val in
2577       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2578       esac
2579       $as_echo "$ac_var='\''$ac_val'\''"
2580     done | sort
2581     echo
2582
2583     if test -n "$ac_subst_files"; then
2584       $as_echo "## ------------------- ##
2585 ## File substitutions. ##
2586 ## ------------------- ##"
2587       echo
2588       for ac_var in $ac_subst_files
2589       do
2590         eval ac_val=\$$ac_var
2591         case $ac_val in
2592         *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2593         esac
2594         $as_echo "$ac_var='\''$ac_val'\''"
2595       done | sort
2596       echo
2597     fi
2598
2599     if test -s confdefs.h; then
2600       $as_echo "## ----------- ##
2601 ## confdefs.h. ##
2602 ## ----------- ##"
2603       echo
2604       cat confdefs.h
2605       echo
2606     fi
2607     test "$ac_signal" != 0 &&
2608       $as_echo "$as_me: caught signal $ac_signal"
2609     $as_echo "$as_me: exit $exit_status"
2610   } >&5
2611   rm -f core *.core core.conftest.* &&
2612     rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
2613     exit $exit_status
2614 ' 0
2615 for ac_signal in 1 2 13 15; do
2616   trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
2617 done
2618 ac_signal=0
2619
2620 # confdefs.h avoids OS command line length limits that DEFS can exceed.
2621 rm -f -r conftest* confdefs.h
2622
2623 $as_echo "/* confdefs.h */" > confdefs.h
2624
2625 # Predefined preprocessor variables.
2626
2627 cat >>confdefs.h <<_ACEOF
2628 #define PACKAGE_NAME "$PACKAGE_NAME"
2629 _ACEOF
2630
2631 cat >>confdefs.h <<_ACEOF
2632 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
2633 _ACEOF
2634
2635 cat >>confdefs.h <<_ACEOF
2636 #define PACKAGE_VERSION "$PACKAGE_VERSION"
2637 _ACEOF
2638
2639 cat >>confdefs.h <<_ACEOF
2640 #define PACKAGE_STRING "$PACKAGE_STRING"
2641 _ACEOF
2642
2643 cat >>confdefs.h <<_ACEOF
2644 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
2645 _ACEOF
2646
2647 cat >>confdefs.h <<_ACEOF
2648 #define PACKAGE_URL "$PACKAGE_URL"
2649 _ACEOF
2650
2651
2652 # Let the site file select an alternate cache file if it wants to.
2653 # Prefer an explicitly selected file to automatically selected ones.
2654 ac_site_file1=NONE
2655 ac_site_file2=NONE
2656 if test -n "$CONFIG_SITE"; then
2657   # We do not want a PATH search for config.site.
2658   case $CONFIG_SITE in #((
2659     -*)  ac_site_file1=./$CONFIG_SITE;;
2660     */*) ac_site_file1=$CONFIG_SITE;;
2661     *)   ac_site_file1=./$CONFIG_SITE;;
2662   esac
2663 elif test "x$prefix" != xNONE; then
2664   ac_site_file1=$prefix/share/config.site
2665   ac_site_file2=$prefix/etc/config.site
2666 else
2667   ac_site_file1=$ac_default_prefix/share/config.site
2668   ac_site_file2=$ac_default_prefix/etc/config.site
2669 fi
2670 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
2671 do
2672   test "x$ac_site_file" = xNONE && continue
2673   if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
2674     { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2675 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
2676     sed 's/^/| /' "$ac_site_file" >&5
2677     . "$ac_site_file" \
2678       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2679 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2680 as_fn_error $? "failed to load site script $ac_site_file
2681 See \`config.log' for more details" "$LINENO" 5; }
2682   fi
2683 done
2684
2685 if test -r "$cache_file"; then
2686   # Some versions of bash will fail to source /dev/null (special files
2687   # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
2688   if test /dev/null != "$cache_file" && test -f "$cache_file"; then
2689     { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
2690 $as_echo "$as_me: loading cache $cache_file" >&6;}
2691     case $cache_file in
2692       [\\/]* | ?:[\\/]* ) . "$cache_file";;
2693       *)                      . "./$cache_file";;
2694     esac
2695   fi
2696 else
2697   { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
2698 $as_echo "$as_me: creating cache $cache_file" >&6;}
2699   >$cache_file
2700 fi
2701
2702 # Check that the precious variables saved in the cache have kept the same
2703 # value.
2704 ac_cache_corrupted=false
2705 for ac_var in $ac_precious_vars; do
2706   eval ac_old_set=\$ac_cv_env_${ac_var}_set
2707   eval ac_new_set=\$ac_env_${ac_var}_set
2708   eval ac_old_val=\$ac_cv_env_${ac_var}_value
2709   eval ac_new_val=\$ac_env_${ac_var}_value
2710   case $ac_old_set,$ac_new_set in
2711     set,)
2712       { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
2713 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
2714       ac_cache_corrupted=: ;;
2715     ,set)
2716       { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
2717 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
2718       ac_cache_corrupted=: ;;
2719     ,);;
2720     *)
2721       if test "x$ac_old_val" != "x$ac_new_val"; then
2722         # differences in whitespace do not lead to failure.
2723         ac_old_val_w=`echo x $ac_old_val`
2724         ac_new_val_w=`echo x $ac_new_val`
2725         if test "$ac_old_val_w" != "$ac_new_val_w"; then
2726           { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
2727 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
2728           ac_cache_corrupted=:
2729         else
2730           { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
2731 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
2732           eval $ac_var=\$ac_old_val
2733         fi
2734         { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
2735 $as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
2736         { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
2737 $as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
2738       fi;;
2739   esac
2740   # Pass precious variables to config.status.
2741   if test "$ac_new_set" = set; then
2742     case $ac_new_val in
2743     *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
2744     *) ac_arg=$ac_var=$ac_new_val ;;
2745     esac
2746     case " $ac_configure_args " in
2747       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
2748       *) as_fn_append ac_configure_args " '$ac_arg'" ;;
2749     esac
2750   fi
2751 done
2752 if $ac_cache_corrupted; then
2753   { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2754 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2755   { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
2756 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
2757   as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
2758 fi
2759 ## -------------------- ##
2760 ## Main body of script. ##
2761 ## -------------------- ##
2762
2763 ac_ext=c
2764 ac_cpp='$CPP $CPPFLAGS'
2765 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2766 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2767 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2768
2769
2770
2771
2772
2773
2774 ac_aux_dir=
2775 for ac_dir in config "$srcdir"/config; do
2776   if test -f "$ac_dir/install-sh"; then
2777     ac_aux_dir=$ac_dir
2778     ac_install_sh="$ac_aux_dir/install-sh -c"
2779     break
2780   elif test -f "$ac_dir/install.sh"; then
2781     ac_aux_dir=$ac_dir
2782     ac_install_sh="$ac_aux_dir/install.sh -c"
2783     break
2784   elif test -f "$ac_dir/shtool"; then
2785     ac_aux_dir=$ac_dir
2786     ac_install_sh="$ac_aux_dir/shtool install -c"
2787     break
2788   fi
2789 done
2790 if test -z "$ac_aux_dir"; then
2791   as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5
2792 fi
2793
2794 # These three variables are undocumented and unsupported,
2795 # and are intended to be withdrawn in a future Autoconf release.
2796 # They can cause serious problems if a builder's source tree is in a directory
2797 # whose full name contains unusual characters.
2798 ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
2799 ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
2800 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
2801
2802
2803
2804 configure_args=$ac_configure_args
2805
2806
2807 PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`
2808
2809
2810 cat >>confdefs.h <<_ACEOF
2811 #define PG_MAJORVERSION "$PG_MAJORVERSION"
2812 _ACEOF
2813
2814
2815
2816
2817
2818 # Check whether --with-extra-version was given.
2819 if test "${with_extra_version+set}" = set; then :
2820   withval=$with_extra_version;
2821   case $withval in
2822     yes)
2823       as_fn_error $? "argument required for --with-extra-version option" "$LINENO" 5
2824       ;;
2825     no)
2826       as_fn_error $? "argument required for --with-extra-version option" "$LINENO" 5
2827       ;;
2828     *)
2829       PG_VERSION="$PACKAGE_VERSION$withval"
2830       ;;
2831   esac
2832
2833 else
2834   PG_VERSION="$PACKAGE_VERSION"
2835 fi
2836
2837
2838
2839 cat >>confdefs.h <<_ACEOF
2840 #define PG_VERSION "$PG_VERSION"
2841 _ACEOF
2842
2843
2844 # Make sure we can run config.sub.
2845 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
2846   as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
2847
2848 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
2849 $as_echo_n "checking build system type... " >&6; }
2850 if ${ac_cv_build+:} false; then :
2851   $as_echo_n "(cached) " >&6
2852 else
2853   ac_build_alias=$build_alias
2854 test "x$ac_build_alias" = x &&
2855   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
2856 test "x$ac_build_alias" = x &&
2857   as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
2858 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
2859   as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
2860
2861 fi
2862 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
2863 $as_echo "$ac_cv_build" >&6; }
2864 case $ac_cv_build in
2865 *-*-*) ;;
2866 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
2867 esac
2868 build=$ac_cv_build
2869 ac_save_IFS=$IFS; IFS='-'
2870 set x $ac_cv_build
2871 shift
2872 build_cpu=$1
2873 build_vendor=$2
2874 shift; shift
2875 # Remember, the first character of IFS is used to create $*,
2876 # except with old shells:
2877 build_os=$*
2878 IFS=$ac_save_IFS
2879 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
2880
2881
2882 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
2883 $as_echo_n "checking host system type... " >&6; }
2884 if ${ac_cv_host+:} false; then :
2885   $as_echo_n "(cached) " >&6
2886 else
2887   if test "x$host_alias" = x; then
2888   ac_cv_host=$ac_cv_build
2889 else
2890   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
2891     as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
2892 fi
2893
2894 fi
2895 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
2896 $as_echo "$ac_cv_host" >&6; }
2897 case $ac_cv_host in
2898 *-*-*) ;;
2899 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
2900 esac
2901 host=$ac_cv_host
2902 ac_save_IFS=$IFS; IFS='-'
2903 set x $ac_cv_host
2904 shift
2905 host_cpu=$1
2906 host_vendor=$2
2907 shift; shift
2908 # Remember, the first character of IFS is used to create $*,
2909 # except with old shells:
2910 host_os=$*
2911 IFS=$ac_save_IFS
2912 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
2913
2914
2915
2916 template=
2917 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which template to use" >&5
2918 $as_echo_n "checking which template to use... " >&6; }
2919
2920
2921
2922
2923 # Check whether --with-template was given.
2924 if test "${with_template+set}" = set; then :
2925   withval=$with_template;
2926   case $withval in
2927     yes)
2928       as_fn_error $? "argument required for --with-template option" "$LINENO" 5
2929       ;;
2930     no)
2931       as_fn_error $? "argument required for --with-template option" "$LINENO" 5
2932       ;;
2933     *)
2934
2935   case $withval in
2936     list)   echo; ls "$srcdir/src/template"; exit;;
2937     *)      if test -f "$srcdir/src/template/$with_template" ; then
2938               template=$withval
2939             else
2940               as_fn_error $? "'$withval' is not a valid template name. Use 'list' for a list." "$LINENO" 5
2941             fi;;
2942   esac
2943
2944       ;;
2945   esac
2946
2947 else
2948
2949 # --with-template not given
2950
2951 case $host_os in
2952      aix*) template=aix ;;
2953   cygwin*) template=cygwin ;;
2954   darwin*) template=darwin ;;
2955 dragonfly*) template=netbsd ;;
2956  freebsd*) template=freebsd ;;
2957     hpux*) template=hpux ;;
2958  linux*|gnu*|k*bsd*-gnu)
2959            template=linux ;;
2960    mingw*) template=win32 ;;
2961   netbsd*) template=netbsd ;;
2962  openbsd*) template=openbsd ;;
2963  solaris*) template=solaris ;;
2964 esac
2965
2966   if test x"$template" = x"" ; then
2967     as_fn_error $? "
2968 *******************************************************************
2969 PostgreSQL has apparently not been ported to your platform yet.
2970 To try a manual configuration, look into the src/template directory
2971 for a similar platform and use the '--with-template=' option.
2972
2973 Please also contact <pgsql-bugs@lists.postgresql.org> to see about
2974 rectifying this.  Include the above 'checking host system type...'
2975 line.
2976 *******************************************************************
2977 " "$LINENO" 5
2978   fi
2979
2980
2981 fi
2982
2983
2984
2985 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $template" >&5
2986 $as_echo "$template" >&6; }
2987
2988 PORTNAME=$template
2989
2990
2991 # Initialize default assumption that we do not need separate assembly code
2992 # for TAS (test-and-set).  This can be overridden by the template file
2993 # when it's executed.
2994 need_tas=no
2995 tas_file=dummy.s
2996
2997
2998
2999 ##
3000 ## Command line options
3001 ##
3002
3003 #
3004 # Add non-standard directories to the include path
3005 #
3006
3007
3008
3009 # Check whether --with-includes was given.
3010 if test "${with_includes+set}" = set; then :
3011   withval=$with_includes;
3012   case $withval in
3013     yes)
3014       as_fn_error $? "argument required for --with-includes option" "$LINENO" 5
3015       ;;
3016     no)
3017       as_fn_error $? "argument required for --with-includes option" "$LINENO" 5
3018       ;;
3019     *)
3020
3021       ;;
3022   esac
3023
3024 fi
3025
3026
3027
3028
3029 #
3030 # Add non-standard directories to the library search path
3031 #
3032
3033
3034
3035 # Check whether --with-libraries was given.
3036 if test "${with_libraries+set}" = set; then :
3037   withval=$with_libraries;
3038   case $withval in
3039     yes)
3040       as_fn_error $? "argument required for --with-libraries option" "$LINENO" 5
3041       ;;
3042     no)
3043       as_fn_error $? "argument required for --with-libraries option" "$LINENO" 5
3044       ;;
3045     *)
3046       LIBRARY_DIRS=$withval
3047       ;;
3048   esac
3049
3050 fi
3051
3052
3053
3054
3055
3056
3057 # Check whether --with-libs was given.
3058 if test "${with_libs+set}" = set; then :
3059   withval=$with_libs;
3060   case $withval in
3061     yes)
3062       as_fn_error $? "argument required for --with-libs option" "$LINENO" 5
3063       ;;
3064     no)
3065       as_fn_error $? "argument required for --with-libs option" "$LINENO" 5
3066       ;;
3067     *)
3068       LIBRARY_DIRS=$withval
3069       ;;
3070   esac
3071
3072 fi
3073
3074
3075
3076
3077 #
3078 # 64-bit integer date/time storage is now the only option, but to avoid
3079 # unnecessary breakage of build scripts, continue to accept an explicit
3080 # "--enable-integer-datetimes" switch.
3081 #
3082
3083
3084 # Check whether --enable-integer-datetimes was given.
3085 if test "${enable_integer_datetimes+set}" = set; then :
3086   enableval=$enable_integer_datetimes;
3087   case $enableval in
3088     yes)
3089       :
3090       ;;
3091     no)
3092       as_fn_error $? "--disable-integer-datetimes is no longer supported" "$LINENO" 5
3093       ;;
3094     *)
3095       as_fn_error $? "no argument expected for --enable-integer-datetimes option" "$LINENO" 5
3096       ;;
3097   esac
3098
3099 else
3100   enable_integer_datetimes=yes
3101
3102 fi
3103
3104
3105
3106
3107 #
3108 # NLS
3109 #
3110 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is wanted" >&5
3111 $as_echo_n "checking whether NLS is wanted... " >&6; }
3112
3113
3114 # Check whether --enable-nls was given.
3115 if test "${enable_nls+set}" = set; then :
3116   enableval=$enable_nls;
3117   case $enableval in
3118     yes)
3119       :
3120       ;;
3121     no)
3122       :
3123       ;;
3124     *)
3125       enable_nls=yes
3126 WANTED_LANGUAGES=$enableval
3127       ;;
3128   esac
3129
3130 else
3131   enable_nls=no
3132 fi
3133
3134
3135
3136 if test "$enable_nls" = yes; then
3137
3138 $as_echo "#define ENABLE_NLS 1" >>confdefs.h
3139
3140 fi
3141
3142 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_nls" >&5
3143 $as_echo "$enable_nls" >&6; }
3144
3145
3146
3147 #
3148 # Default port number (--with-pgport), default 5432
3149 #
3150 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for default port number" >&5
3151 $as_echo_n "checking for default port number... " >&6; }
3152
3153
3154
3155 # Check whether --with-pgport was given.
3156 if test "${with_pgport+set}" = set; then :
3157   withval=$with_pgport;
3158   case $withval in
3159     yes)
3160       as_fn_error $? "argument required for --with-pgport option" "$LINENO" 5
3161       ;;
3162     no)
3163       as_fn_error $? "argument required for --with-pgport option" "$LINENO" 5
3164       ;;
3165     *)
3166       default_port=$withval
3167       ;;
3168   esac
3169
3170 else
3171   default_port=5432
3172 fi
3173
3174
3175 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $default_port" >&5
3176 $as_echo "$default_port" >&6; }
3177 # Need both of these because some places want an integer and some a string
3178
3179 cat >>confdefs.h <<_ACEOF
3180 #define DEF_PGPORT ${default_port}
3181 _ACEOF
3182
3183
3184 cat >>confdefs.h <<_ACEOF
3185 #define DEF_PGPORT_STR "${default_port}"
3186 _ACEOF
3187
3188
3189
3190 # It's worth validating port; you can get very confusing errors otherwise
3191 if test x"$default_port" = x""; then
3192   as_fn_error $? "invalid --with-pgport specification: empty string" "$LINENO" 5
3193 elif test ! x`echo "$default_port" | sed -e 's/[0-9]*//'` = x""; then
3194   as_fn_error $? "invalid --with-pgport specification: must be a number" "$LINENO" 5
3195 elif test ! x`echo "$default_port" | sed -e 's/^0.//'` = x"$default_port"; then
3196   as_fn_error $? "invalid --with-pgport specification: must not have leading 0" "$LINENO" 5
3197 elif test "$default_port" -lt "1" -o "$default_port" -gt "65535"; then
3198   as_fn_error $? "invalid --with-pgport specification: must be between 1 and 65535" "$LINENO" 5
3199 fi
3200
3201 #
3202 # '-rpath'-like feature can be disabled
3203 #
3204
3205
3206 # Check whether --enable-rpath was given.
3207 if test "${enable_rpath+set}" = set; then :
3208   enableval=$enable_rpath;
3209   case $enableval in
3210     yes)
3211       :
3212       ;;
3213     no)
3214       :
3215       ;;
3216     *)
3217       as_fn_error $? "no argument expected for --enable-rpath option" "$LINENO" 5
3218       ;;
3219   esac
3220
3221 else
3222   enable_rpath=yes
3223
3224 fi
3225
3226
3227
3228
3229 #
3230 # Spinlocks
3231 #
3232
3233
3234 # Check whether --enable-spinlocks was given.
3235 if test "${enable_spinlocks+set}" = set; then :
3236   enableval=$enable_spinlocks;
3237   case $enableval in
3238     yes)
3239       :
3240       ;;
3241     no)
3242       :
3243       ;;
3244     *)
3245       as_fn_error $? "no argument expected for --enable-spinlocks option" "$LINENO" 5
3246       ;;
3247   esac
3248
3249 else
3250   enable_spinlocks=yes
3251
3252 fi
3253
3254
3255
3256 #
3257 # Atomic operations
3258 #
3259
3260
3261 # Check whether --enable-atomics was given.
3262 if test "${enable_atomics+set}" = set; then :
3263   enableval=$enable_atomics;
3264   case $enableval in
3265     yes)
3266       :
3267       ;;
3268     no)
3269       :
3270       ;;
3271     *)
3272       as_fn_error $? "no argument expected for --enable-atomics option" "$LINENO" 5
3273       ;;
3274   esac
3275
3276 else
3277   enable_atomics=yes
3278
3279 fi
3280
3281
3282
3283 #
3284 # --enable-debug adds -g to compiler flags
3285 #
3286
3287
3288 # Check whether --enable-debug was given.
3289 if test "${enable_debug+set}" = set; then :
3290   enableval=$enable_debug;
3291   case $enableval in
3292     yes)
3293       :
3294       ;;
3295     no)
3296       :
3297       ;;
3298     *)
3299       as_fn_error $? "no argument expected for --enable-debug option" "$LINENO" 5
3300       ;;
3301   esac
3302
3303 else
3304   enable_debug=no
3305
3306 fi
3307
3308
3309
3310
3311 #
3312 # --enable-profiling enables gcc profiling
3313 #
3314
3315
3316 # Check whether --enable-profiling was given.
3317 if test "${enable_profiling+set}" = set; then :
3318   enableval=$enable_profiling;
3319   case $enableval in
3320     yes)
3321       :
3322       ;;
3323     no)
3324       :
3325       ;;
3326     *)
3327       as_fn_error $? "no argument expected for --enable-profiling option" "$LINENO" 5
3328       ;;
3329   esac
3330
3331 else
3332   enable_profiling=no
3333
3334 fi
3335
3336
3337
3338 #
3339 # --enable-coverage enables generation of code coverage metrics with gcov
3340 #
3341
3342
3343 # Check whether --enable-coverage was given.
3344 if test "${enable_coverage+set}" = set; then :
3345   enableval=$enable_coverage;
3346   case $enableval in
3347     yes)
3348       if test -z "$GCOV"; then
3349   for ac_prog in gcov
3350 do
3351   # Extract the first word of "$ac_prog", so it can be a program name with args.
3352 set dummy $ac_prog; ac_word=$2
3353 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3354 $as_echo_n "checking for $ac_word... " >&6; }
3355 if ${ac_cv_path_GCOV+:} false; then :
3356   $as_echo_n "(cached) " >&6
3357 else
3358   case $GCOV in
3359   [\\/]* | ?:[\\/]*)
3360   ac_cv_path_GCOV="$GCOV" # Let the user override the test with a path.
3361   ;;
3362   *)
3363   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3364 for as_dir in $PATH
3365 do
3366   IFS=$as_save_IFS
3367   test -z "$as_dir" && as_dir=.
3368     for ac_exec_ext in '' $ac_executable_extensions; do
3369   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3370     ac_cv_path_GCOV="$as_dir/$ac_word$ac_exec_ext"
3371     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3372     break 2
3373   fi
3374 done
3375   done
3376 IFS=$as_save_IFS
3377
3378   ;;
3379 esac
3380 fi
3381 GCOV=$ac_cv_path_GCOV
3382 if test -n "$GCOV"; then
3383   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5
3384 $as_echo "$GCOV" >&6; }
3385 else
3386   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3387 $as_echo "no" >&6; }
3388 fi
3389
3390
3391   test -n "$GCOV" && break
3392 done
3393
3394 else
3395   # Report the value of GCOV in configure's output in all cases.
3396   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCOV" >&5
3397 $as_echo_n "checking for GCOV... " >&6; }
3398   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5
3399 $as_echo "$GCOV" >&6; }
3400 fi
3401
3402 if test -z "$GCOV"; then
3403   as_fn_error $? "gcov not found" "$LINENO" 5
3404 fi
3405 if test -z "$LCOV"; then
3406   for ac_prog in lcov
3407 do
3408   # Extract the first word of "$ac_prog", so it can be a program name with args.
3409 set dummy $ac_prog; ac_word=$2
3410 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3411 $as_echo_n "checking for $ac_word... " >&6; }
3412 if ${ac_cv_path_LCOV+:} false; then :
3413   $as_echo_n "(cached) " >&6
3414 else
3415   case $LCOV in
3416   [\\/]* | ?:[\\/]*)
3417   ac_cv_path_LCOV="$LCOV" # Let the user override the test with a path.
3418   ;;
3419   *)
3420   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3421 for as_dir in $PATH
3422 do
3423   IFS=$as_save_IFS
3424   test -z "$as_dir" && as_dir=.
3425     for ac_exec_ext in '' $ac_executable_extensions; do
3426   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3427     ac_cv_path_LCOV="$as_dir/$ac_word$ac_exec_ext"
3428     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3429     break 2
3430   fi
3431 done
3432   done
3433 IFS=$as_save_IFS
3434
3435   ;;
3436 esac
3437 fi
3438 LCOV=$ac_cv_path_LCOV
3439 if test -n "$LCOV"; then
3440   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5
3441 $as_echo "$LCOV" >&6; }
3442 else
3443   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3444 $as_echo "no" >&6; }
3445 fi
3446
3447
3448   test -n "$LCOV" && break
3449 done
3450
3451 else
3452   # Report the value of LCOV in configure's output in all cases.
3453   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LCOV" >&5
3454 $as_echo_n "checking for LCOV... " >&6; }
3455   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5
3456 $as_echo "$LCOV" >&6; }
3457 fi
3458
3459 if test -z "$LCOV"; then
3460   as_fn_error $? "lcov not found" "$LINENO" 5
3461 fi
3462 if test -z "$GENHTML"; then
3463   for ac_prog in genhtml
3464 do
3465   # Extract the first word of "$ac_prog", so it can be a program name with args.
3466 set dummy $ac_prog; ac_word=$2
3467 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3468 $as_echo_n "checking for $ac_word... " >&6; }
3469 if ${ac_cv_path_GENHTML+:} false; then :
3470   $as_echo_n "(cached) " >&6
3471 else
3472   case $GENHTML in
3473   [\\/]* | ?:[\\/]*)
3474   ac_cv_path_GENHTML="$GENHTML" # Let the user override the test with a path.
3475   ;;
3476   *)
3477   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3478 for as_dir in $PATH
3479 do
3480   IFS=$as_save_IFS
3481   test -z "$as_dir" && as_dir=.
3482     for ac_exec_ext in '' $ac_executable_extensions; do
3483   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3484     ac_cv_path_GENHTML="$as_dir/$ac_word$ac_exec_ext"
3485     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3486     break 2
3487   fi
3488 done
3489   done
3490 IFS=$as_save_IFS
3491
3492   ;;
3493 esac
3494 fi
3495 GENHTML=$ac_cv_path_GENHTML
3496 if test -n "$GENHTML"; then
3497   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5
3498 $as_echo "$GENHTML" >&6; }
3499 else
3500   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3501 $as_echo "no" >&6; }
3502 fi
3503
3504
3505   test -n "$GENHTML" && break
3506 done
3507
3508 else
3509   # Report the value of GENHTML in configure's output in all cases.
3510   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GENHTML" >&5
3511 $as_echo_n "checking for GENHTML... " >&6; }
3512   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5
3513 $as_echo "$GENHTML" >&6; }
3514 fi
3515
3516 if test -z "$GENHTML"; then
3517   as_fn_error $? "genhtml not found" "$LINENO" 5
3518 fi
3519       ;;
3520     no)
3521       :
3522       ;;
3523     *)
3524       as_fn_error $? "no argument expected for --enable-coverage option" "$LINENO" 5
3525       ;;
3526   esac
3527
3528 else
3529   enable_coverage=no
3530
3531 fi
3532
3533
3534
3535
3536 #
3537 # DTrace
3538 #
3539
3540
3541 # Check whether --enable-dtrace was given.
3542 if test "${enable_dtrace+set}" = set; then :
3543   enableval=$enable_dtrace;
3544   case $enableval in
3545     yes)
3546       if test -z "$DTRACE"; then
3547   for ac_prog in dtrace
3548 do
3549   # Extract the first word of "$ac_prog", so it can be a program name with args.
3550 set dummy $ac_prog; ac_word=$2
3551 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3552 $as_echo_n "checking for $ac_word... " >&6; }
3553 if ${ac_cv_path_DTRACE+:} false; then :
3554   $as_echo_n "(cached) " >&6
3555 else
3556   case $DTRACE in
3557   [\\/]* | ?:[\\/]*)
3558   ac_cv_path_DTRACE="$DTRACE" # Let the user override the test with a path.
3559   ;;
3560   *)
3561   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3562 for as_dir in $PATH
3563 do
3564   IFS=$as_save_IFS
3565   test -z "$as_dir" && as_dir=.
3566     for ac_exec_ext in '' $ac_executable_extensions; do
3567   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3568     ac_cv_path_DTRACE="$as_dir/$ac_word$ac_exec_ext"
3569     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3570     break 2
3571   fi
3572 done
3573   done
3574 IFS=$as_save_IFS
3575
3576   ;;
3577 esac
3578 fi
3579 DTRACE=$ac_cv_path_DTRACE
3580 if test -n "$DTRACE"; then
3581   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5
3582 $as_echo "$DTRACE" >&6; }
3583 else
3584   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3585 $as_echo "no" >&6; }
3586 fi
3587
3588
3589   test -n "$DTRACE" && break
3590 done
3591
3592 else
3593   # Report the value of DTRACE in configure's output in all cases.
3594   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DTRACE" >&5
3595 $as_echo_n "checking for DTRACE... " >&6; }
3596   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5
3597 $as_echo "$DTRACE" >&6; }
3598 fi
3599
3600 if test -z "$DTRACE"; then
3601   as_fn_error $? "dtrace not found" "$LINENO" 5
3602 fi
3603
3604       ;;
3605     no)
3606       :
3607       ;;
3608     *)
3609       as_fn_error $? "no argument expected for --enable-dtrace option" "$LINENO" 5
3610       ;;
3611   esac
3612
3613 else
3614   enable_dtrace=no
3615
3616 fi
3617
3618
3619
3620
3621 #
3622 # TAP tests
3623 #
3624
3625
3626 # Check whether --enable-tap-tests was given.
3627 if test "${enable_tap_tests+set}" = set; then :
3628   enableval=$enable_tap_tests;
3629   case $enableval in
3630     yes)
3631       :
3632       ;;
3633     no)
3634       :
3635       ;;
3636     *)
3637       as_fn_error $? "no argument expected for --enable-tap-tests option" "$LINENO" 5
3638       ;;
3639   esac
3640
3641 else
3642   enable_tap_tests=no
3643
3644 fi
3645
3646
3647
3648
3649 #
3650 # Block size
3651 #
3652 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for block size" >&5
3653 $as_echo_n "checking for block size... " >&6; }
3654
3655
3656
3657 # Check whether --with-blocksize was given.
3658 if test "${with_blocksize+set}" = set; then :
3659   withval=$with_blocksize;
3660   case $withval in
3661     yes)
3662       as_fn_error $? "argument required for --with-blocksize option" "$LINENO" 5
3663       ;;
3664     no)
3665       as_fn_error $? "argument required for --with-blocksize option" "$LINENO" 5
3666       ;;
3667     *)
3668       blocksize=$withval
3669       ;;
3670   esac
3671
3672 else
3673   blocksize=8
3674 fi
3675
3676
3677 case ${blocksize} in
3678   1) BLCKSZ=1024;;
3679   2) BLCKSZ=2048;;
3680   4) BLCKSZ=4096;;
3681   8) BLCKSZ=8192;;
3682  16) BLCKSZ=16384;;
3683  32) BLCKSZ=32768;;
3684   *) as_fn_error $? "Invalid block size. Allowed values are 1,2,4,8,16,32." "$LINENO" 5
3685 esac
3686 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${blocksize}kB" >&5
3687 $as_echo "${blocksize}kB" >&6; }
3688
3689
3690 cat >>confdefs.h <<_ACEOF
3691 #define BLCKSZ ${BLCKSZ}
3692 _ACEOF
3693
3694
3695 #
3696 # Relation segment size
3697 #
3698 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for segment size" >&5
3699 $as_echo_n "checking for segment size... " >&6; }
3700
3701
3702
3703 # Check whether --with-segsize was given.
3704 if test "${with_segsize+set}" = set; then :
3705   withval=$with_segsize;
3706   case $withval in
3707     yes)
3708       as_fn_error $? "argument required for --with-segsize option" "$LINENO" 5
3709       ;;
3710     no)
3711       as_fn_error $? "argument required for --with-segsize option" "$LINENO" 5
3712       ;;
3713     *)
3714       segsize=$withval
3715       ;;
3716   esac
3717
3718 else
3719   segsize=1
3720 fi
3721
3722
3723 # this expression is set up to avoid unnecessary integer overflow
3724 # blocksize is already guaranteed to be a factor of 1024
3725 RELSEG_SIZE=`expr '(' 1024 / ${blocksize} ')' '*' ${segsize} '*' 1024`
3726 test $? -eq 0 || exit 1
3727 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${segsize}GB" >&5
3728 $as_echo "${segsize}GB" >&6; }
3729
3730
3731 cat >>confdefs.h <<_ACEOF
3732 #define RELSEG_SIZE ${RELSEG_SIZE}
3733 _ACEOF
3734
3735
3736 #
3737 # WAL block size
3738 #
3739 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAL block size" >&5
3740 $as_echo_n "checking for WAL block size... " >&6; }
3741
3742
3743
3744 # Check whether --with-wal-blocksize was given.
3745 if test "${with_wal_blocksize+set}" = set; then :
3746   withval=$with_wal_blocksize;
3747   case $withval in
3748     yes)
3749       as_fn_error $? "argument required for --with-wal-blocksize option" "$LINENO" 5
3750       ;;
3751     no)
3752       as_fn_error $? "argument required for --with-wal-blocksize option" "$LINENO" 5
3753       ;;
3754     *)
3755       wal_blocksize=$withval
3756       ;;
3757   esac
3758
3759 else
3760   wal_blocksize=8
3761 fi
3762
3763
3764 case ${wal_blocksize} in
3765   1) XLOG_BLCKSZ=1024;;
3766   2) XLOG_BLCKSZ=2048;;
3767   4) XLOG_BLCKSZ=4096;;
3768   8) XLOG_BLCKSZ=8192;;
3769  16) XLOG_BLCKSZ=16384;;
3770  32) XLOG_BLCKSZ=32768;;
3771  64) XLOG_BLCKSZ=65536;;
3772   *) as_fn_error $? "Invalid WAL block size. Allowed values are 1,2,4,8,16,32,64." "$LINENO" 5
3773 esac
3774 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${wal_blocksize}kB" >&5
3775 $as_echo "${wal_blocksize}kB" >&6; }
3776
3777
3778 cat >>confdefs.h <<_ACEOF
3779 #define XLOG_BLCKSZ ${XLOG_BLCKSZ}
3780 _ACEOF
3781
3782
3783 #
3784 # C compiler
3785 #
3786
3787 # For historical reasons you can also use --with-CC to specify the C compiler
3788 # to use, although the standard way to do this is to set the CC environment
3789 # variable.
3790
3791
3792
3793 # Check whether --with-CC was given.
3794 if test "${with_CC+set}" = set; then :
3795   withval=$with_CC;
3796   case $withval in
3797     yes)
3798       as_fn_error $? "argument required for --with-CC option" "$LINENO" 5
3799       ;;
3800     no)
3801       as_fn_error $? "argument required for --with-CC option" "$LINENO" 5
3802       ;;
3803     *)
3804       CC=$with_CC
3805       ;;
3806   esac
3807
3808 fi
3809
3810
3811
3812 case $template in
3813   aix) pgac_cc_list="gcc xlc"; pgac_cxx_list="g++ xlC";;
3814     *) pgac_cc_list="gcc cc"; pgac_cxx_list="g++ c++";;
3815 esac
3816
3817 ac_ext=c
3818 ac_cpp='$CPP $CPPFLAGS'
3819 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3820 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3821 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3822 if test -n "$ac_tool_prefix"; then
3823   for ac_prog in $pgac_cc_list
3824   do
3825     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3826 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3827 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3828 $as_echo_n "checking for $ac_word... " >&6; }
3829 if ${ac_cv_prog_CC+:} false; then :
3830   $as_echo_n "(cached) " >&6
3831 else
3832   if test -n "$CC"; then
3833   ac_cv_prog_CC="$CC" # Let the user override the test.
3834 else
3835 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3836 for as_dir in $PATH
3837 do
3838   IFS=$as_save_IFS
3839   test -z "$as_dir" && as_dir=.
3840     for ac_exec_ext in '' $ac_executable_extensions; do
3841   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3842     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3843     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3844     break 2
3845   fi
3846 done
3847   done
3848 IFS=$as_save_IFS
3849
3850 fi
3851 fi
3852 CC=$ac_cv_prog_CC
3853 if test -n "$CC"; then
3854   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3855 $as_echo "$CC" >&6; }
3856 else
3857   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3858 $as_echo "no" >&6; }
3859 fi
3860
3861
3862     test -n "$CC" && break
3863   done
3864 fi
3865 if test -z "$CC"; then
3866   ac_ct_CC=$CC
3867   for ac_prog in $pgac_cc_list
3868 do
3869   # Extract the first word of "$ac_prog", so it can be a program name with args.
3870 set dummy $ac_prog; ac_word=$2
3871 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3872 $as_echo_n "checking for $ac_word... " >&6; }
3873 if ${ac_cv_prog_ac_ct_CC+:} false; then :
3874   $as_echo_n "(cached) " >&6
3875 else
3876   if test -n "$ac_ct_CC"; then
3877   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3878 else
3879 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3880 for as_dir in $PATH
3881 do
3882   IFS=$as_save_IFS
3883   test -z "$as_dir" && as_dir=.
3884     for ac_exec_ext in '' $ac_executable_extensions; do
3885   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3886     ac_cv_prog_ac_ct_CC="$ac_prog"
3887     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3888     break 2
3889   fi
3890 done
3891   done
3892 IFS=$as_save_IFS
3893
3894 fi
3895 fi
3896 ac_ct_CC=$ac_cv_prog_ac_ct_CC
3897 if test -n "$ac_ct_CC"; then
3898   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3899 $as_echo "$ac_ct_CC" >&6; }
3900 else
3901   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3902 $as_echo "no" >&6; }
3903 fi
3904
3905
3906   test -n "$ac_ct_CC" && break
3907 done
3908
3909   if test "x$ac_ct_CC" = x; then
3910     CC=""
3911   else
3912     case $cross_compiling:$ac_tool_warned in
3913 yes:)
3914 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3915 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3916 ac_tool_warned=yes ;;
3917 esac
3918     CC=$ac_ct_CC
3919   fi
3920 fi
3921
3922
3923 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3924 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3925 as_fn_error $? "no acceptable C compiler found in \$PATH
3926 See \`config.log' for more details" "$LINENO" 5; }
3927
3928 # Provide some information about the compiler.
3929 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
3930 set X $ac_compile
3931 ac_compiler=$2
3932 for ac_option in --version -v -V -qversion; do
3933   { { ac_try="$ac_compiler $ac_option >&5"
3934 case "(($ac_try" in
3935   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3936   *) ac_try_echo=$ac_try;;
3937 esac
3938 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3939 $as_echo "$ac_try_echo"; } >&5
3940   (eval "$ac_compiler $ac_option >&5") 2>conftest.err
3941   ac_status=$?
3942   if test -s conftest.err; then
3943     sed '10a\
3944 ... rest of stderr output deleted ...
3945          10q' conftest.err >conftest.er1
3946     cat conftest.er1 >&5
3947   fi
3948   rm -f conftest.er1 conftest.err
3949   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3950   test $ac_status = 0; }
3951 done
3952
3953 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3954 /* end confdefs.h.  */
3955
3956 int
3957 main ()
3958 {
3959
3960   ;
3961   return 0;
3962 }
3963 _ACEOF
3964 ac_clean_files_save=$ac_clean_files
3965 ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
3966 # Try to create an executable without -o first, disregard a.out.
3967 # It will help us diagnose broken compilers, and finding out an intuition
3968 # of exeext.
3969 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
3970 $as_echo_n "checking whether the C compiler works... " >&6; }
3971 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
3972
3973 # The possible output files:
3974 ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
3975
3976 ac_rmfiles=
3977 for ac_file in $ac_files
3978 do
3979   case $ac_file in
3980     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3981     * ) ac_rmfiles="$ac_rmfiles $ac_file";;
3982   esac
3983 done
3984 rm -f $ac_rmfiles
3985
3986 if { { ac_try="$ac_link_default"
3987 case "(($ac_try" in
3988   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3989   *) ac_try_echo=$ac_try;;
3990 esac
3991 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3992 $as_echo "$ac_try_echo"; } >&5
3993   (eval "$ac_link_default") 2>&5
3994   ac_status=$?
3995   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3996   test $ac_status = 0; }; then :
3997   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
3998 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
3999 # in a Makefile.  We should not override ac_cv_exeext if it was cached,
4000 # so that the user can short-circuit this test for compilers unknown to
4001 # Autoconf.
4002 for ac_file in $ac_files ''
4003 do
4004   test -f "$ac_file" || continue
4005   case $ac_file in
4006     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
4007         ;;
4008     [ab].out )
4009         # We found the default executable, but exeext='' is most
4010         # certainly right.
4011         break;;
4012     *.* )
4013         if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
4014         then :; else
4015            ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4016         fi
4017         # We set ac_cv_exeext here because the later test for it is not
4018         # safe: cross compilers may not add the suffix if given an `-o'
4019         # argument, so we may need to know it at that point already.
4020         # Even if this section looks crufty: it has the advantage of
4021         # actually working.
4022         break;;
4023     * )
4024         break;;
4025   esac
4026 done
4027 test "$ac_cv_exeext" = no && ac_cv_exeext=
4028
4029 else
4030   ac_file=''
4031 fi
4032 if test -z "$ac_file"; then :
4033   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4034 $as_echo "no" >&6; }
4035 $as_echo "$as_me: failed program was:" >&5
4036 sed 's/^/| /' conftest.$ac_ext >&5
4037
4038 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4039 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4040 as_fn_error 77 "C compiler cannot create executables
4041 See \`config.log' for more details" "$LINENO" 5; }
4042 else
4043   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4044 $as_echo "yes" >&6; }
4045 fi
4046 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
4047 $as_echo_n "checking for C compiler default output file name... " >&6; }
4048 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
4049 $as_echo "$ac_file" >&6; }
4050 ac_exeext=$ac_cv_exeext
4051
4052 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
4053 ac_clean_files=$ac_clean_files_save
4054 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
4055 $as_echo_n "checking for suffix of executables... " >&6; }
4056 if { { ac_try="$ac_link"
4057 case "(($ac_try" in
4058   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4059   *) ac_try_echo=$ac_try;;
4060 esac
4061 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4062 $as_echo "$ac_try_echo"; } >&5
4063   (eval "$ac_link") 2>&5
4064   ac_status=$?
4065   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4066   test $ac_status = 0; }; then :
4067   # If both `conftest.exe' and `conftest' are `present' (well, observable)
4068 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
4069 # work properly (i.e., refer to `conftest.exe'), while it won't with
4070 # `rm'.
4071 for ac_file in conftest.exe conftest conftest.*; do
4072   test -f "$ac_file" || continue
4073   case $ac_file in
4074     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4075     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4076           break;;
4077     * ) break;;
4078   esac
4079 done
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 compute suffix of executables: cannot compile and link
4084 See \`config.log' for more details" "$LINENO" 5; }
4085 fi
4086 rm -f conftest conftest$ac_cv_exeext
4087 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
4088 $as_echo "$ac_cv_exeext" >&6; }
4089
4090 rm -f conftest.$ac_ext
4091 EXEEXT=$ac_cv_exeext
4092 ac_exeext=$EXEEXT
4093 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4094 /* end confdefs.h.  */
4095 #include <stdio.h>
4096 int
4097 main ()
4098 {
4099 FILE *f = fopen ("conftest.out", "w");
4100  return ferror (f) || fclose (f) != 0;
4101
4102   ;
4103   return 0;
4104 }
4105 _ACEOF
4106 ac_clean_files="$ac_clean_files conftest.out"
4107 # Check that the compiler produces executables we can run.  If not, either
4108 # the compiler is broken, or we cross compile.
4109 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
4110 $as_echo_n "checking whether we are cross compiling... " >&6; }
4111 if test "$cross_compiling" != yes; then
4112   { { ac_try="$ac_link"
4113 case "(($ac_try" in
4114   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4115   *) ac_try_echo=$ac_try;;
4116 esac
4117 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4118 $as_echo "$ac_try_echo"; } >&5
4119   (eval "$ac_link") 2>&5
4120   ac_status=$?
4121   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4122   test $ac_status = 0; }
4123   if { ac_try='./conftest$ac_cv_exeext'
4124   { { case "(($ac_try" in
4125   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4126   *) ac_try_echo=$ac_try;;
4127 esac
4128 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4129 $as_echo "$ac_try_echo"; } >&5
4130   (eval "$ac_try") 2>&5
4131   ac_status=$?
4132   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4133   test $ac_status = 0; }; }; then
4134     cross_compiling=no
4135   else
4136     if test "$cross_compiling" = maybe; then
4137         cross_compiling=yes
4138     else
4139         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4140 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4141 as_fn_error $? "cannot run C compiled programs.
4142 If you meant to cross compile, use \`--host'.
4143 See \`config.log' for more details" "$LINENO" 5; }
4144     fi
4145   fi
4146 fi
4147 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
4148 $as_echo "$cross_compiling" >&6; }
4149
4150 rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
4151 ac_clean_files=$ac_clean_files_save
4152 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
4153 $as_echo_n "checking for suffix of object files... " >&6; }
4154 if ${ac_cv_objext+:} false; then :
4155   $as_echo_n "(cached) " >&6
4156 else
4157   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4158 /* end confdefs.h.  */
4159
4160 int
4161 main ()
4162 {
4163
4164   ;
4165   return 0;
4166 }
4167 _ACEOF
4168 rm -f conftest.o conftest.obj
4169 if { { ac_try="$ac_compile"
4170 case "(($ac_try" in
4171   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4172   *) ac_try_echo=$ac_try;;
4173 esac
4174 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4175 $as_echo "$ac_try_echo"; } >&5
4176   (eval "$ac_compile") 2>&5
4177   ac_status=$?
4178   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4179   test $ac_status = 0; }; then :
4180   for ac_file in conftest.o conftest.obj conftest.*; do
4181   test -f "$ac_file" || continue;
4182   case $ac_file in
4183     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
4184     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
4185        break;;
4186   esac
4187 done
4188 else
4189   $as_echo "$as_me: failed program was:" >&5
4190 sed 's/^/| /' conftest.$ac_ext >&5
4191
4192 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4193 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4194 as_fn_error $? "cannot compute suffix of object files: cannot compile
4195 See \`config.log' for more details" "$LINENO" 5; }
4196 fi
4197 rm -f conftest.$ac_cv_objext conftest.$ac_ext
4198 fi
4199 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
4200 $as_echo "$ac_cv_objext" >&6; }
4201 OBJEXT=$ac_cv_objext
4202 ac_objext=$OBJEXT
4203 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
4204 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
4205 if ${ac_cv_c_compiler_gnu+:} false; then :
4206   $as_echo_n "(cached) " >&6
4207 else
4208   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4209 /* end confdefs.h.  */
4210
4211 int
4212 main ()
4213 {
4214 #ifndef __GNUC__
4215        choke me
4216 #endif
4217
4218   ;
4219   return 0;
4220 }
4221 _ACEOF
4222 if ac_fn_c_try_compile "$LINENO"; then :
4223   ac_compiler_gnu=yes
4224 else
4225   ac_compiler_gnu=no
4226 fi
4227 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4228 ac_cv_c_compiler_gnu=$ac_compiler_gnu
4229
4230 fi
4231 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4232 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
4233 if test $ac_compiler_gnu = yes; then
4234   GCC=yes
4235 else
4236   GCC=
4237 fi
4238 ac_test_CFLAGS=${CFLAGS+set}
4239 ac_save_CFLAGS=$CFLAGS
4240 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4241 $as_echo_n "checking whether $CC accepts -g... " >&6; }
4242 if ${ac_cv_prog_cc_g+:} false; then :
4243   $as_echo_n "(cached) " >&6
4244 else
4245   ac_save_c_werror_flag=$ac_c_werror_flag
4246    ac_c_werror_flag=yes
4247    ac_cv_prog_cc_g=no
4248    CFLAGS="-g"
4249    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4250 /* end confdefs.h.  */
4251
4252 int
4253 main ()
4254 {
4255
4256   ;
4257   return 0;
4258 }
4259 _ACEOF
4260 if ac_fn_c_try_compile "$LINENO"; then :
4261   ac_cv_prog_cc_g=yes
4262 else
4263   CFLAGS=""
4264       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4265 /* end confdefs.h.  */
4266
4267 int
4268 main ()
4269 {
4270
4271   ;
4272   return 0;
4273 }
4274 _ACEOF
4275 if ac_fn_c_try_compile "$LINENO"; then :
4276
4277 else
4278   ac_c_werror_flag=$ac_save_c_werror_flag
4279          CFLAGS="-g"
4280          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4281 /* end confdefs.h.  */
4282
4283 int
4284 main ()
4285 {
4286
4287   ;
4288   return 0;
4289 }
4290 _ACEOF
4291 if ac_fn_c_try_compile "$LINENO"; then :
4292   ac_cv_prog_cc_g=yes
4293 fi
4294 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4295 fi
4296 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4297 fi
4298 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4299    ac_c_werror_flag=$ac_save_c_werror_flag
4300 fi
4301 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4302 $as_echo "$ac_cv_prog_cc_g" >&6; }
4303 if test "$ac_test_CFLAGS" = set; then
4304   CFLAGS=$ac_save_CFLAGS
4305 elif test $ac_cv_prog_cc_g = yes; then
4306   if test "$GCC" = yes; then
4307     CFLAGS="-g -O2"
4308   else
4309     CFLAGS="-g"
4310   fi
4311 else
4312   if test "$GCC" = yes; then
4313     CFLAGS="-O2"
4314   else
4315     CFLAGS=
4316   fi
4317 fi
4318 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
4319 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
4320 if ${ac_cv_prog_cc_c89+:} false; then :
4321   $as_echo_n "(cached) " >&6
4322 else
4323   ac_cv_prog_cc_c89=no
4324 ac_save_CC=$CC
4325 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4326 /* end confdefs.h.  */
4327 #include <stdarg.h>
4328 #include <stdio.h>
4329 struct stat;
4330 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4331 struct buf { int x; };
4332 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4333 static char *e (p, i)
4334      char **p;
4335      int i;
4336 {
4337   return p[i];
4338 }
4339 static char *f (char * (*g) (char **, int), char **p, ...)
4340 {
4341   char *s;
4342   va_list v;
4343   va_start (v,p);
4344   s = g (p, va_arg (v,int));
4345   va_end (v);
4346   return s;
4347 }
4348
4349 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
4350    function prototypes and stuff, but not '\xHH' hex character constants.
4351    These don't provoke an error unfortunately, instead are silently treated
4352    as 'x'.  The following induces an error, until -std is added to get
4353    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
4354    array size at least.  It's necessary to write '\x00'==0 to get something
4355    that's true only with -std.  */
4356 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
4357
4358 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
4359    inside strings and character constants.  */
4360 #define FOO(x) 'x'
4361 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
4362
4363 int test (int i, double x);
4364 struct s1 {int (*f) (int a);};
4365 struct s2 {int (*f) (double a);};
4366 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4367 int argc;
4368 char **argv;
4369 int
4370 main ()
4371 {
4372 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4373   ;
4374   return 0;
4375 }
4376 _ACEOF
4377 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
4378         -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4379 do
4380   CC="$ac_save_CC $ac_arg"
4381   if ac_fn_c_try_compile "$LINENO"; then :
4382   ac_cv_prog_cc_c89=$ac_arg
4383 fi
4384 rm -f core conftest.err conftest.$ac_objext
4385   test "x$ac_cv_prog_cc_c89" != "xno" && break
4386 done
4387 rm -f conftest.$ac_ext
4388 CC=$ac_save_CC
4389
4390 fi
4391 # AC_CACHE_VAL
4392 case "x$ac_cv_prog_cc_c89" in
4393   x)
4394     { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4395 $as_echo "none needed" >&6; } ;;
4396   xno)
4397     { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4398 $as_echo "unsupported" >&6; } ;;
4399   *)
4400     CC="$CC $ac_cv_prog_cc_c89"
4401     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
4402 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
4403 esac
4404 if test "x$ac_cv_prog_cc_c89" != xno; then :
4405
4406 fi
4407
4408 ac_ext=c
4409 ac_cpp='$CPP $CPPFLAGS'
4410 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4411 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4412 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4413
4414    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
4415 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
4416 if ${ac_cv_prog_cc_c99+:} false; then :
4417   $as_echo_n "(cached) " >&6
4418 else
4419   ac_cv_prog_cc_c99=no
4420 ac_save_CC=$CC
4421 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4422 /* end confdefs.h.  */
4423 #include <stdarg.h>
4424 #include <stdbool.h>
4425 #include <stdlib.h>
4426 #include <wchar.h>
4427 #include <stdio.h>
4428
4429 // Check varargs macros.  These examples are taken from C99 6.10.3.5.
4430 #define debug(...) fprintf (stderr, __VA_ARGS__)
4431 #define showlist(...) puts (#__VA_ARGS__)
4432 #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
4433 static void
4434 test_varargs_macros (void)
4435 {
4436   int x = 1234;
4437   int y = 5678;
4438   debug ("Flag");
4439   debug ("X = %d\n", x);
4440   showlist (The first, second, and third items.);
4441   report (x>y, "x is %d but y is %d", x, y);
4442 }
4443
4444 // Check long long types.
4445 #define BIG64 18446744073709551615ull
4446 #define BIG32 4294967295ul
4447 #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
4448 #if !BIG_OK
4449   your preprocessor is broken;
4450 #endif
4451 #if BIG_OK
4452 #else
4453   your preprocessor is broken;
4454 #endif
4455 static long long int bignum = -9223372036854775807LL;
4456 static unsigned long long int ubignum = BIG64;
4457
4458 struct incomplete_array
4459 {
4460   int datasize;
4461   double data[];
4462 };
4463
4464 struct named_init {
4465   int number;
4466   const wchar_t *name;
4467   double average;
4468 };
4469
4470 typedef const char *ccp;
4471
4472 static inline int
4473 test_restrict (ccp restrict text)
4474 {
4475   // See if C++-style comments work.
4476   // Iterate through items via the restricted pointer.
4477   // Also check for declarations in for loops.
4478   for (unsigned int i = 0; *(text+i) != '\0'; ++i)
4479     continue;
4480   return 0;
4481 }
4482
4483 // Check varargs and va_copy.
4484 static void
4485 test_varargs (const char *format, ...)
4486 {
4487   va_list args;
4488   va_start (args, format);
4489   va_list args_copy;
4490   va_copy (args_copy, args);
4491
4492   const char *str;
4493   int number;
4494   float fnumber;
4495
4496   while (*format)
4497     {
4498       switch (*format++)
4499         {
4500         case 's': // string
4501           str = va_arg (args_copy, const char *);
4502           break;
4503         case 'd': // int
4504           number = va_arg (args_copy, int);
4505           break;
4506         case 'f': // float
4507           fnumber = va_arg (args_copy, double);
4508           break;
4509         default:
4510           break;
4511         }
4512     }
4513   va_end (args_copy);
4514   va_end (args);
4515 }
4516
4517 int
4518 main ()
4519 {
4520
4521   // Check bool.
4522   _Bool success = false;
4523
4524   // Check restrict.
4525   if (test_restrict ("String literal") == 0)
4526     success = true;
4527   char *restrict newvar = "Another string";
4528
4529   // Check varargs.
4530   test_varargs ("s, d' f .", "string", 65, 34.234);
4531   test_varargs_macros ();
4532
4533   // Check flexible array members.
4534   struct incomplete_array *ia =
4535     malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
4536   ia->datasize = 10;
4537   for (int i = 0; i < ia->datasize; ++i)
4538     ia->data[i] = i * 1.234;
4539
4540   // Check named initializers.
4541   struct named_init ni = {
4542     .number = 34,
4543     .name = L"Test wide string",
4544     .average = 543.34343,
4545   };
4546
4547   ni.number = 58;
4548
4549   int dynamic_array[ni.number];
4550   dynamic_array[ni.number - 1] = 543;
4551
4552   // work around unused variable warnings
4553   return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
4554           || dynamic_array[ni.number - 1] != 543);
4555
4556   ;
4557   return 0;
4558 }
4559 _ACEOF
4560 for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
4561 do
4562   CC="$ac_save_CC $ac_arg"
4563   if ac_fn_c_try_compile "$LINENO"; then :
4564   ac_cv_prog_cc_c99=$ac_arg
4565 fi
4566 rm -f core conftest.err conftest.$ac_objext
4567   test "x$ac_cv_prog_cc_c99" != "xno" && break
4568 done
4569 rm -f conftest.$ac_ext
4570 CC=$ac_save_CC
4571
4572 fi
4573 # AC_CACHE_VAL
4574 case "x$ac_cv_prog_cc_c99" in
4575   x)
4576     { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4577 $as_echo "none needed" >&6; } ;;
4578   xno)
4579     { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4580 $as_echo "unsupported" >&6; } ;;
4581   *)
4582     CC="$CC $ac_cv_prog_cc_c99"
4583     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
4584 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
4585 esac
4586 if test "x$ac_cv_prog_cc_c99" != xno; then :
4587
4588 fi
4589
4590
4591
4592 # Error out if the compiler does not support C99, as the codebase
4593 # relies on that.
4594 if test "$ac_cv_prog_cc_c99" = no; then
4595     as_fn_error $? "C compiler \"$CC\" does not support C99" "$LINENO" 5
4596 fi
4597
4598 ac_ext=cpp
4599 ac_cpp='$CXXCPP $CPPFLAGS'
4600 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4601 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4602 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
4603 if test -z "$CXX"; then
4604   if test -n "$CCC"; then
4605     CXX=$CCC
4606   else
4607     if test -n "$ac_tool_prefix"; then
4608   for ac_prog in $pgac_cxx_list
4609   do
4610     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4611 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4612 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4613 $as_echo_n "checking for $ac_word... " >&6; }
4614 if ${ac_cv_prog_CXX+:} false; then :
4615   $as_echo_n "(cached) " >&6
4616 else
4617   if test -n "$CXX"; then
4618   ac_cv_prog_CXX="$CXX" # Let the user override the test.
4619 else
4620 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4621 for as_dir in $PATH
4622 do
4623   IFS=$as_save_IFS
4624   test -z "$as_dir" && as_dir=.
4625     for ac_exec_ext in '' $ac_executable_extensions; do
4626   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4627     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
4628     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4629     break 2
4630   fi
4631 done
4632   done
4633 IFS=$as_save_IFS
4634
4635 fi
4636 fi
4637 CXX=$ac_cv_prog_CXX
4638 if test -n "$CXX"; then
4639   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
4640 $as_echo "$CXX" >&6; }
4641 else
4642   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4643 $as_echo "no" >&6; }
4644 fi
4645
4646
4647     test -n "$CXX" && break
4648   done
4649 fi
4650 if test -z "$CXX"; then
4651   ac_ct_CXX=$CXX
4652   for ac_prog in $pgac_cxx_list
4653 do
4654   # Extract the first word of "$ac_prog", so it can be a program name with args.
4655 set dummy $ac_prog; ac_word=$2
4656 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4657 $as_echo_n "checking for $ac_word... " >&6; }
4658 if ${ac_cv_prog_ac_ct_CXX+:} false; then :
4659   $as_echo_n "(cached) " >&6
4660 else
4661   if test -n "$ac_ct_CXX"; then
4662   ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
4663 else
4664 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4665 for as_dir in $PATH
4666 do
4667   IFS=$as_save_IFS
4668   test -z "$as_dir" && as_dir=.
4669     for ac_exec_ext in '' $ac_executable_extensions; do
4670   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4671     ac_cv_prog_ac_ct_CXX="$ac_prog"
4672     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4673     break 2
4674   fi
4675 done
4676   done
4677 IFS=$as_save_IFS
4678
4679 fi
4680 fi
4681 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
4682 if test -n "$ac_ct_CXX"; then
4683   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
4684 $as_echo "$ac_ct_CXX" >&6; }
4685 else
4686   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4687 $as_echo "no" >&6; }
4688 fi
4689
4690
4691   test -n "$ac_ct_CXX" && break
4692 done
4693
4694   if test "x$ac_ct_CXX" = x; then
4695     CXX="g++"
4696   else
4697     case $cross_compiling:$ac_tool_warned in
4698 yes:)
4699 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4700 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4701 ac_tool_warned=yes ;;
4702 esac
4703     CXX=$ac_ct_CXX
4704   fi
4705 fi
4706
4707   fi
4708 fi
4709 # Provide some information about the compiler.
4710 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
4711 set X $ac_compile
4712 ac_compiler=$2
4713 for ac_option in --version -v -V -qversion; do
4714   { { ac_try="$ac_compiler $ac_option >&5"
4715 case "(($ac_try" in
4716   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4717   *) ac_try_echo=$ac_try;;
4718 esac
4719 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4720 $as_echo "$ac_try_echo"; } >&5
4721   (eval "$ac_compiler $ac_option >&5") 2>conftest.err
4722   ac_status=$?
4723   if test -s conftest.err; then
4724     sed '10a\
4725 ... rest of stderr output deleted ...
4726          10q' conftest.err >conftest.er1
4727     cat conftest.er1 >&5
4728   fi
4729   rm -f conftest.er1 conftest.err
4730   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4731   test $ac_status = 0; }
4732 done
4733
4734 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
4735 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
4736 if ${ac_cv_cxx_compiler_gnu+:} false; then :
4737   $as_echo_n "(cached) " >&6
4738 else
4739   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4740 /* end confdefs.h.  */
4741
4742 int
4743 main ()
4744 {
4745 #ifndef __GNUC__
4746        choke me
4747 #endif
4748
4749   ;
4750   return 0;
4751 }
4752 _ACEOF
4753 if ac_fn_cxx_try_compile "$LINENO"; then :
4754   ac_compiler_gnu=yes
4755 else
4756   ac_compiler_gnu=no
4757 fi
4758 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4759 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
4760
4761 fi
4762 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
4763 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
4764 if test $ac_compiler_gnu = yes; then
4765   GXX=yes
4766 else
4767   GXX=
4768 fi
4769 ac_test_CXXFLAGS=${CXXFLAGS+set}
4770 ac_save_CXXFLAGS=$CXXFLAGS
4771 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
4772 $as_echo_n "checking whether $CXX accepts -g... " >&6; }
4773 if ${ac_cv_prog_cxx_g+:} false; then :
4774   $as_echo_n "(cached) " >&6
4775 else
4776   ac_save_cxx_werror_flag=$ac_cxx_werror_flag
4777    ac_cxx_werror_flag=yes
4778    ac_cv_prog_cxx_g=no
4779    CXXFLAGS="-g"
4780    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4781 /* end confdefs.h.  */
4782
4783 int
4784 main ()
4785 {
4786
4787   ;
4788   return 0;
4789 }
4790 _ACEOF
4791 if ac_fn_cxx_try_compile "$LINENO"; then :
4792   ac_cv_prog_cxx_g=yes
4793 else
4794   CXXFLAGS=""
4795       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4796 /* end confdefs.h.  */
4797
4798 int
4799 main ()
4800 {
4801
4802   ;
4803   return 0;
4804 }
4805 _ACEOF
4806 if ac_fn_cxx_try_compile "$LINENO"; then :
4807
4808 else
4809   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
4810          CXXFLAGS="-g"
4811          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4812 /* end confdefs.h.  */
4813
4814 int
4815 main ()
4816 {
4817
4818   ;
4819   return 0;
4820 }
4821 _ACEOF
4822 if ac_fn_cxx_try_compile "$LINENO"; then :
4823   ac_cv_prog_cxx_g=yes
4824 fi
4825 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4826 fi
4827 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4828 fi
4829 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4830    ac_cxx_werror_flag=$ac_save_cxx_werror_flag
4831 fi
4832 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
4833 $as_echo "$ac_cv_prog_cxx_g" >&6; }
4834 if test "$ac_test_CXXFLAGS" = set; then
4835   CXXFLAGS=$ac_save_CXXFLAGS
4836 elif test $ac_cv_prog_cxx_g = yes; then
4837   if test "$GXX" = yes; then
4838     CXXFLAGS="-g -O2"
4839   else
4840     CXXFLAGS="-g"
4841   fi
4842 else
4843   if test "$GXX" = yes; then
4844     CXXFLAGS="-O2"
4845   else
4846     CXXFLAGS=
4847   fi
4848 fi
4849 ac_ext=c
4850 ac_cpp='$CPP $CPPFLAGS'
4851 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4852 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4853 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4854
4855
4856 # Check if it's Intel's compiler, which (usually) pretends to be gcc,
4857 # but has idiosyncrasies of its own.  We assume icc will define
4858 # __INTEL_COMPILER regardless of CFLAGS.
4859
4860 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4861 /* end confdefs.h.  */
4862
4863 int
4864 main ()
4865 {
4866 #ifndef __INTEL_COMPILER
4867 choke me
4868 #endif
4869   ;
4870   return 0;
4871 }
4872 _ACEOF
4873 if ac_fn_c_try_compile "$LINENO"; then :
4874   ICC=yes
4875 else
4876   ICC=no
4877 fi
4878 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4879
4880 # Check if it's Sun Studio compiler. We assume that
4881 # __SUNPRO_C will be defined for Sun Studio compilers
4882 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4883 /* end confdefs.h.  */
4884
4885 int
4886 main ()
4887 {
4888 #ifndef __SUNPRO_C
4889 choke me
4890 #endif
4891   ;
4892   return 0;
4893 }
4894 _ACEOF
4895 if ac_fn_c_try_compile "$LINENO"; then :
4896   SUN_STUDIO_CC=yes
4897 else
4898   SUN_STUDIO_CC=no
4899 fi
4900 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4901
4902
4903
4904
4905 #
4906 # LLVM
4907 #
4908 # Checked early because subsequent tests depend on it.
4909
4910
4911
4912 # Check whether --with-llvm was given.
4913 if test "${with_llvm+set}" = set; then :
4914   withval=$with_llvm;
4915   case $withval in
4916     yes)
4917
4918 $as_echo "#define USE_LLVM 1" >>confdefs.h
4919
4920       ;;
4921     no)
4922       :
4923       ;;
4924     *)
4925       as_fn_error $? "no argument expected for --with-llvm option" "$LINENO" 5
4926       ;;
4927   esac
4928
4929 else
4930   with_llvm=no
4931
4932 fi
4933
4934
4935
4936 for ac_prog in gawk mawk nawk awk
4937 do
4938   # Extract the first word of "$ac_prog", so it can be a program name with args.
4939 set dummy $ac_prog; ac_word=$2
4940 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4941 $as_echo_n "checking for $ac_word... " >&6; }
4942 if ${ac_cv_prog_AWK+:} false; then :
4943   $as_echo_n "(cached) " >&6
4944 else
4945   if test -n "$AWK"; then
4946   ac_cv_prog_AWK="$AWK" # Let the user override the test.
4947 else
4948 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4949 for as_dir in $PATH
4950 do
4951   IFS=$as_save_IFS
4952   test -z "$as_dir" && as_dir=.
4953     for ac_exec_ext in '' $ac_executable_extensions; do
4954   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4955     ac_cv_prog_AWK="$ac_prog"
4956     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4957     break 2
4958   fi
4959 done
4960   done
4961 IFS=$as_save_IFS
4962
4963 fi
4964 fi
4965 AWK=$ac_cv_prog_AWK
4966 if test -n "$AWK"; then
4967   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
4968 $as_echo "$AWK" >&6; }
4969 else
4970   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4971 $as_echo "no" >&6; }
4972 fi
4973
4974
4975   test -n "$AWK" && break
4976 done
4977
4978 if test "$with_llvm" = yes; then :
4979
4980
4981
4982
4983
4984   if test -z "$LLVM_CONFIG"; then
4985   for ac_prog in llvm-config llvm-config-7 llvm-config-6.0 llvm-config-5.0 llvm-config-4.0 llvm-config-3.9
4986 do
4987   # Extract the first word of "$ac_prog", so it can be a program name with args.
4988 set dummy $ac_prog; ac_word=$2
4989 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4990 $as_echo_n "checking for $ac_word... " >&6; }
4991 if ${ac_cv_path_LLVM_CONFIG+:} false; then :
4992   $as_echo_n "(cached) " >&6
4993 else
4994   case $LLVM_CONFIG in
4995   [\\/]* | ?:[\\/]*)
4996   ac_cv_path_LLVM_CONFIG="$LLVM_CONFIG" # Let the user override the test with a path.
4997   ;;
4998   *)
4999   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5000 for as_dir in $PATH
5001 do
5002   IFS=$as_save_IFS
5003   test -z "$as_dir" && as_dir=.
5004     for ac_exec_ext in '' $ac_executable_extensions; do
5005   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5006     ac_cv_path_LLVM_CONFIG="$as_dir/$ac_word$ac_exec_ext"
5007     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5008     break 2
5009   fi
5010 done
5011   done
5012 IFS=$as_save_IFS
5013
5014   ;;
5015 esac
5016 fi
5017 LLVM_CONFIG=$ac_cv_path_LLVM_CONFIG
5018 if test -n "$LLVM_CONFIG"; then
5019   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_CONFIG" >&5
5020 $as_echo "$LLVM_CONFIG" >&6; }
5021 else
5022   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5023 $as_echo "no" >&6; }
5024 fi
5025
5026
5027   test -n "$LLVM_CONFIG" && break
5028 done
5029
5030 else
5031   # Report the value of LLVM_CONFIG in configure's output in all cases.
5032   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LLVM_CONFIG" >&5
5033 $as_echo_n "checking for LLVM_CONFIG... " >&6; }
5034   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_CONFIG" >&5
5035 $as_echo "$LLVM_CONFIG" >&6; }
5036 fi
5037
5038
5039   # no point continuing if llvm wasn't found
5040   if test -z "$LLVM_CONFIG"; then
5041     as_fn_error $? "llvm-config not found, but required when compiling --with-llvm, specify with LLVM_CONFIG=" "$LINENO" 5
5042   fi
5043   # check if detected $LLVM_CONFIG is executable
5044   pgac_llvm_version="$($LLVM_CONFIG --version 2> /dev/null || echo no)"
5045   if test "x$pgac_llvm_version" = "xno"; then
5046     as_fn_error $? "$LLVM_CONFIG does not work" "$LINENO" 5
5047   fi
5048   # and whether the version is supported
5049   if echo $pgac_llvm_version | $AWK -F '.' '{ if ($1 >= 4 || ($1 == 3 && $2 >= 9)) exit 1; else exit 0;}';then
5050     as_fn_error $? "$LLVM_CONFIG version is $pgac_llvm_version but at least 3.9 is required" "$LINENO" 5
5051   fi
5052
5053   # need clang to create some bitcode files
5054
5055   if test -z "$CLANG"; then
5056   for ac_prog in clang clang-7 clang-6.0 clang-5.0 clang-4.0 clang-3.9
5057 do
5058   # Extract the first word of "$ac_prog", so it can be a program name with args.
5059 set dummy $ac_prog; ac_word=$2
5060 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5061 $as_echo_n "checking for $ac_word... " >&6; }
5062 if ${ac_cv_path_CLANG+:} false; then :
5063   $as_echo_n "(cached) " >&6
5064 else
5065   case $CLANG in
5066   [\\/]* | ?:[\\/]*)
5067   ac_cv_path_CLANG="$CLANG" # Let the user override the test with a path.
5068   ;;
5069   *)
5070   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5071 for as_dir in $PATH
5072 do
5073   IFS=$as_save_IFS
5074   test -z "$as_dir" && as_dir=.
5075     for ac_exec_ext in '' $ac_executable_extensions; do
5076   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5077     ac_cv_path_CLANG="$as_dir/$ac_word$ac_exec_ext"
5078     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5079     break 2
5080   fi
5081 done
5082   done
5083 IFS=$as_save_IFS
5084
5085   ;;
5086 esac
5087 fi
5088 CLANG=$ac_cv_path_CLANG
5089 if test -n "$CLANG"; then
5090   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLANG" >&5
5091 $as_echo "$CLANG" >&6; }
5092 else
5093   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5094 $as_echo "no" >&6; }
5095 fi
5096
5097
5098   test -n "$CLANG" && break
5099 done
5100
5101 else
5102   # Report the value of CLANG in configure's output in all cases.
5103   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CLANG" >&5
5104 $as_echo_n "checking for CLANG... " >&6; }
5105   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLANG" >&5
5106 $as_echo "$CLANG" >&6; }
5107 fi
5108
5109   if test -z "$CLANG"; then
5110     as_fn_error $? "clang not found, but required when compiling --with-llvm, specify with CLANG=" "$LINENO" 5
5111   fi
5112   # make sure clang is executable
5113   if test "x$($CLANG --version 2> /dev/null || echo no)" = "xno"; then
5114     as_fn_error $? "$CLANG does not work" "$LINENO" 5
5115   fi
5116   # Could check clang version, but it doesn't seem that
5117   # important. Systems with a new enough LLVM version are usually
5118   # going to have a decent clang version too. It's also not entirely
5119   # clear what the minimum version is.
5120
5121   # Collect compiler flags necessary to build the LLVM dependent
5122   # shared library.
5123   for pgac_option in `$LLVM_CONFIG --cppflags`; do
5124     case $pgac_option in
5125       -I*|-D*) LLVM_CPPFLAGS="$pgac_option $LLVM_CPPFLAGS";;
5126     esac
5127   done
5128
5129   for pgac_option in `$LLVM_CONFIG --ldflags`; do
5130     case $pgac_option in
5131       -L*) LDFLAGS="$LDFLAGS $pgac_option";;
5132     esac
5133   done
5134
5135   # ABI influencing options, standard influencing options
5136   for pgac_option in `$LLVM_CONFIG --cxxflags`; do
5137     case $pgac_option in
5138       -fno-rtti*) LLVM_CXXFLAGS="$LLVM_CXXFLAGS $pgac_option";;
5139       -std=*) LLVM_CXXFLAGS="$LLVM_CXXFLAGS $pgac_option";;
5140     esac
5141   done
5142
5143   # Look for components we're interested in, collect necessary
5144   # libs. As some components are optional, we can't just list all of
5145   # them as it'd raise an error.
5146   pgac_components='';
5147   for pgac_component in `$LLVM_CONFIG --components`; do
5148     case $pgac_component in
5149       engine) pgac_components="$pgac_components $pgac_component";;
5150       debuginfodwarf) pgac_components="$pgac_components $pgac_component";;
5151       orcjit) pgac_components="$pgac_components $pgac_component";;
5152       passes) pgac_components="$pgac_components $pgac_component";;
5153       perfjitevents) pgac_components="$pgac_components $pgac_component";;
5154     esac
5155   done;
5156
5157   # And then get the libraries that need to be linked in for the
5158   # selected components.  They're large libraries, we only want to
5159   # link them into the LLVM using shared library.
5160   for pgac_option in `$LLVM_CONFIG --libs --system-libs $pgac_components`; do
5161     case $pgac_option in
5162       -l*) LLVM_LIBS="$LLVM_LIBS $pgac_option";;
5163     esac
5164   done
5165
5166   LLVM_BINPATH=`$LLVM_CONFIG --bindir`
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176 fi # fi
5177
5178
5179 unset CFLAGS
5180 unset CXXFLAGS
5181
5182 #
5183 # Read the template
5184 #
5185 . "$srcdir/src/template/$template" || exit
5186
5187 # C[XX]FLAGS are selected so:
5188 # If the user specifies something in the environment, that is used.
5189 # else:  If the template file set something, that is used.
5190 # else:  If coverage was enabled, don't set anything.
5191 # else:  If the compiler is GCC, then we use -O2.
5192 # else:  If the compiler is something else, then we use -O, unless debugging.
5193
5194 if test "$ac_env_CFLAGS_set" = set; then
5195   CFLAGS=$ac_env_CFLAGS_value
5196 elif test "${CFLAGS+set}" = set; then
5197   : # (keep what template set)
5198 elif test "$enable_coverage" = yes; then
5199   : # no optimization by default
5200 elif test "$GCC" = yes; then
5201   CFLAGS="-O2"
5202 else
5203   # if the user selected debug mode, don't use -O
5204   if test "$enable_debug" != yes; then
5205     CFLAGS="-O"
5206   fi
5207 fi
5208
5209 if test "$ac_env_CXXFLAGS_set" = set; then
5210   CXXFLAGS=$ac_env_CXXFLAGS_value
5211 elif test "${CXXFLAGS+set}" = set; then
5212   : # (keep what template set)
5213 elif test "$enable_coverage" = yes; then
5214   : # no optimization by default
5215 elif test "$GCC" = yes; then
5216   CXXFLAGS="-O2"
5217 else
5218   # if the user selected debug mode, don't use -O
5219   if test "$enable_debug" != yes; then
5220     CXXFLAGS="-O"
5221   fi
5222 fi
5223
5224 # When generating bitcode (for inlining) we always want to use -O2
5225 # even when --enable-debug is specified. The bitcode it's not going to
5226 # be used for line-by-line debugging, and JIT inlining doesn't work
5227 # without at least -O1 (otherwise clang will emit 'noinline'
5228 # attributes everywhere), which is bad for testing.  Still allow the
5229 # environment to override if done explicitly.
5230 if test "$ac_env_BITCODE_CFLAGS_set" = set; then
5231   BITCODE_CFLAGS=$ac_env_BITCODE_CFLAGS_value
5232 else
5233   BITCODE_CFLAGS="-O2 $BITCODE_CFLAGS"
5234 fi
5235 if test "$ac_env_BITCODE_CXXFLAGS_set" = set; then
5236   BITCODE_CXXFLAGS=$ac_env_BITCODE_CXXFLAGS_value
5237 else
5238   BITCODE_CXXFLAGS="-O2 $BITCODE_CXXFLAGS"
5239 fi
5240
5241 # C[XX]FLAGS we determined above will be added back at the end
5242 user_CFLAGS=$CFLAGS
5243 CFLAGS=""
5244 user_CXXFLAGS=$CXXFLAGS
5245 CXXFLAGS=""
5246 user_BITCODE_CFLAGS=$BITCODE_CFLAGS
5247 BITCODE_CFLAGS=""
5248 user_BITCODE_CXXFLAGS=$BITCODE_CXXFLAGS
5249 BITCODE_CXXFLAGS=""
5250
5251 # set CFLAGS_VECTOR from the environment, if available
5252 if test "$ac_env_CFLAGS_VECTOR_set" = set; then
5253   CFLAGS_VECTOR=$ac_env_CFLAGS_VECTOR_value
5254 fi
5255
5256 # Some versions of GCC support some additional useful warning flags.
5257 # Check whether they are supported, and add them to CFLAGS if so.
5258 # ICC pretends to be GCC but it's lying; it doesn't support these flags,
5259 # but has its own.  Also check other compiler-specific flags here.
5260
5261 if test "$GCC" = yes -a "$ICC" = no; then
5262   CFLAGS="-Wall -Wmissing-prototypes -Wpointer-arith"
5263   CXXFLAGS="-Wall -Wpointer-arith"
5264   # These work in some but not all gcc versions
5265   save_CFLAGS=$CFLAGS
5266
5267 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wdeclaration-after-statement, for CFLAGS" >&5
5268 $as_echo_n "checking whether ${CC} supports -Wdeclaration-after-statement, for CFLAGS... " >&6; }
5269 if ${pgac_cv_prog_CC_cflags__Wdeclaration_after_statement+:} false; then :
5270   $as_echo_n "(cached) " >&6
5271 else
5272   pgac_save_CFLAGS=$CFLAGS
5273 pgac_save_CC=$CC
5274 CC=${CC}
5275 CFLAGS="${CFLAGS} -Wdeclaration-after-statement"
5276 ac_save_c_werror_flag=$ac_c_werror_flag
5277 ac_c_werror_flag=yes
5278 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5279 /* end confdefs.h.  */
5280
5281 int
5282 main ()
5283 {
5284
5285   ;
5286   return 0;
5287 }
5288 _ACEOF
5289 if ac_fn_c_try_compile "$LINENO"; then :
5290   pgac_cv_prog_CC_cflags__Wdeclaration_after_statement=yes
5291 else
5292   pgac_cv_prog_CC_cflags__Wdeclaration_after_statement=no
5293 fi
5294 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5295 ac_c_werror_flag=$ac_save_c_werror_flag
5296 CFLAGS="$pgac_save_CFLAGS"
5297 CC="$pgac_save_CC"
5298 fi
5299 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" >&5
5300 $as_echo "$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" >&6; }
5301 if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then
5302   CFLAGS="${CFLAGS} -Wdeclaration-after-statement"
5303 fi
5304
5305
5306   # -Wdeclaration-after-statement isn't applicable for C++.  Specific C files
5307   # disable it, so AC_SUBST the negative form.
5308   PERMIT_DECLARATION_AFTER_STATEMENT=
5309   if test x"$save_CFLAGS" != x"$CFLAGS"; then
5310     PERMIT_DECLARATION_AFTER_STATEMENT=-Wno-declaration-after-statement
5311   fi
5312
5313   # Really don't want VLAs to be used in our dialect of C
5314
5315 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Werror=vla, for CFLAGS" >&5
5316 $as_echo_n "checking whether ${CC} supports -Werror=vla, for CFLAGS... " >&6; }
5317 if ${pgac_cv_prog_CC_cflags__Werror_vla+:} false; then :
5318   $as_echo_n "(cached) " >&6
5319 else
5320   pgac_save_CFLAGS=$CFLAGS
5321 pgac_save_CC=$CC
5322 CC=${CC}
5323 CFLAGS="${CFLAGS} -Werror=vla"
5324 ac_save_c_werror_flag=$ac_c_werror_flag
5325 ac_c_werror_flag=yes
5326 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5327 /* end confdefs.h.  */
5328
5329 int
5330 main ()
5331 {
5332
5333   ;
5334   return 0;
5335 }
5336 _ACEOF
5337 if ac_fn_c_try_compile "$LINENO"; then :
5338   pgac_cv_prog_CC_cflags__Werror_vla=yes
5339 else
5340   pgac_cv_prog_CC_cflags__Werror_vla=no
5341 fi
5342 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5343 ac_c_werror_flag=$ac_save_c_werror_flag
5344 CFLAGS="$pgac_save_CFLAGS"
5345 CC="$pgac_save_CC"
5346 fi
5347 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Werror_vla" >&5
5348 $as_echo "$pgac_cv_prog_CC_cflags__Werror_vla" >&6; }
5349 if test x"$pgac_cv_prog_CC_cflags__Werror_vla" = x"yes"; then
5350   CFLAGS="${CFLAGS} -Werror=vla"
5351 fi
5352
5353
5354   # -Wvla is not applicable for C++
5355
5356 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wendif-labels, for CFLAGS" >&5
5357 $as_echo_n "checking whether ${CC} supports -Wendif-labels, for CFLAGS... " >&6; }
5358 if ${pgac_cv_prog_CC_cflags__Wendif_labels+:} false; then :
5359   $as_echo_n "(cached) " >&6
5360 else
5361   pgac_save_CFLAGS=$CFLAGS
5362 pgac_save_CC=$CC
5363 CC=${CC}
5364 CFLAGS="${CFLAGS} -Wendif-labels"
5365 ac_save_c_werror_flag=$ac_c_werror_flag
5366 ac_c_werror_flag=yes
5367 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5368 /* end confdefs.h.  */
5369
5370 int
5371 main ()
5372 {
5373
5374   ;
5375   return 0;
5376 }
5377 _ACEOF
5378 if ac_fn_c_try_compile "$LINENO"; then :
5379   pgac_cv_prog_CC_cflags__Wendif_labels=yes
5380 else
5381   pgac_cv_prog_CC_cflags__Wendif_labels=no
5382 fi
5383 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5384 ac_c_werror_flag=$ac_save_c_werror_flag
5385 CFLAGS="$pgac_save_CFLAGS"
5386 CC="$pgac_save_CC"
5387 fi
5388 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wendif_labels" >&5
5389 $as_echo "$pgac_cv_prog_CC_cflags__Wendif_labels" >&6; }
5390 if test x"$pgac_cv_prog_CC_cflags__Wendif_labels" = x"yes"; then
5391   CFLAGS="${CFLAGS} -Wendif-labels"
5392 fi
5393
5394
5395   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -Wendif-labels, for CXXFLAGS" >&5
5396 $as_echo_n "checking whether ${CXX} supports -Wendif-labels, for CXXFLAGS... " >&6; }
5397 if ${pgac_cv_prog_CXX_cxxflags__Wendif_labels+:} false; then :
5398   $as_echo_n "(cached) " >&6
5399 else
5400   pgac_save_CXXFLAGS=$CXXFLAGS
5401 pgac_save_CXX=$CXX
5402 CXX=${CXX}
5403 CXXFLAGS="${CXXFLAGS} -Wendif-labels"
5404 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5405 ac_cxx_werror_flag=yes
5406 ac_ext=cpp
5407 ac_cpp='$CXXCPP $CPPFLAGS'
5408 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5409 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5410 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5411
5412 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5413 /* end confdefs.h.  */
5414
5415 int
5416 main ()
5417 {
5418
5419   ;
5420   return 0;
5421 }
5422 _ACEOF
5423 if ac_fn_cxx_try_compile "$LINENO"; then :
5424   pgac_cv_prog_CXX_cxxflags__Wendif_labels=yes
5425 else
5426   pgac_cv_prog_CXX_cxxflags__Wendif_labels=no
5427 fi
5428 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5429 ac_ext=c
5430 ac_cpp='$CPP $CPPFLAGS'
5431 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5432 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5433 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5434
5435 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5436 CXXFLAGS="$pgac_save_CXXFLAGS"
5437 CXX="$pgac_save_CXX"
5438 fi
5439 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__Wendif_labels" >&5
5440 $as_echo "$pgac_cv_prog_CXX_cxxflags__Wendif_labels" >&6; }
5441 if test x"$pgac_cv_prog_CXX_cxxflags__Wendif_labels" = x"yes"; then
5442   CXXFLAGS="${CXXFLAGS} -Wendif-labels"
5443 fi
5444
5445
5446
5447 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wmissing-format-attribute, for CFLAGS" >&5
5448 $as_echo_n "checking whether ${CC} supports -Wmissing-format-attribute, for CFLAGS... " >&6; }
5449 if ${pgac_cv_prog_CC_cflags__Wmissing_format_attribute+:} false; then :
5450   $as_echo_n "(cached) " >&6
5451 else
5452   pgac_save_CFLAGS=$CFLAGS
5453 pgac_save_CC=$CC
5454 CC=${CC}
5455 CFLAGS="${CFLAGS} -Wmissing-format-attribute"
5456 ac_save_c_werror_flag=$ac_c_werror_flag
5457 ac_c_werror_flag=yes
5458 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5459 /* end confdefs.h.  */
5460
5461 int
5462 main ()
5463 {
5464
5465   ;
5466   return 0;
5467 }
5468 _ACEOF
5469 if ac_fn_c_try_compile "$LINENO"; then :
5470   pgac_cv_prog_CC_cflags__Wmissing_format_attribute=yes
5471 else
5472   pgac_cv_prog_CC_cflags__Wmissing_format_attribute=no
5473 fi
5474 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5475 ac_c_werror_flag=$ac_save_c_werror_flag
5476 CFLAGS="$pgac_save_CFLAGS"
5477 CC="$pgac_save_CC"
5478 fi
5479 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wmissing_format_attribute" >&5
5480 $as_echo "$pgac_cv_prog_CC_cflags__Wmissing_format_attribute" >&6; }
5481 if test x"$pgac_cv_prog_CC_cflags__Wmissing_format_attribute" = x"yes"; then
5482   CFLAGS="${CFLAGS} -Wmissing-format-attribute"
5483 fi
5484
5485
5486   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -Wmissing-format-attribute, for CXXFLAGS" >&5
5487 $as_echo_n "checking whether ${CXX} supports -Wmissing-format-attribute, for CXXFLAGS... " >&6; }
5488 if ${pgac_cv_prog_CXX_cxxflags__Wmissing_format_attribute+:} false; then :
5489   $as_echo_n "(cached) " >&6
5490 else
5491   pgac_save_CXXFLAGS=$CXXFLAGS
5492 pgac_save_CXX=$CXX
5493 CXX=${CXX}
5494 CXXFLAGS="${CXXFLAGS} -Wmissing-format-attribute"
5495 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5496 ac_cxx_werror_flag=yes
5497 ac_ext=cpp
5498 ac_cpp='$CXXCPP $CPPFLAGS'
5499 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5500 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5501 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5502
5503 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5504 /* end confdefs.h.  */
5505
5506 int
5507 main ()
5508 {
5509
5510   ;
5511   return 0;
5512 }
5513 _ACEOF
5514 if ac_fn_cxx_try_compile "$LINENO"; then :
5515   pgac_cv_prog_CXX_cxxflags__Wmissing_format_attribute=yes
5516 else
5517   pgac_cv_prog_CXX_cxxflags__Wmissing_format_attribute=no
5518 fi
5519 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5520 ac_ext=c
5521 ac_cpp='$CPP $CPPFLAGS'
5522 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5523 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5524 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5525
5526 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5527 CXXFLAGS="$pgac_save_CXXFLAGS"
5528 CXX="$pgac_save_CXX"
5529 fi
5530 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__Wmissing_format_attribute" >&5
5531 $as_echo "$pgac_cv_prog_CXX_cxxflags__Wmissing_format_attribute" >&6; }
5532 if test x"$pgac_cv_prog_CXX_cxxflags__Wmissing_format_attribute" = x"yes"; then
5533   CXXFLAGS="${CXXFLAGS} -Wmissing-format-attribute"
5534 fi
5535
5536
5537   # This was included in -Wall/-Wformat in older GCC versions
5538
5539 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wformat-security, for CFLAGS" >&5
5540 $as_echo_n "checking whether ${CC} supports -Wformat-security, for CFLAGS... " >&6; }
5541 if ${pgac_cv_prog_CC_cflags__Wformat_security+:} false; then :
5542   $as_echo_n "(cached) " >&6
5543 else
5544   pgac_save_CFLAGS=$CFLAGS
5545 pgac_save_CC=$CC
5546 CC=${CC}
5547 CFLAGS="${CFLAGS} -Wformat-security"
5548 ac_save_c_werror_flag=$ac_c_werror_flag
5549 ac_c_werror_flag=yes
5550 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5551 /* end confdefs.h.  */
5552
5553 int
5554 main ()
5555 {
5556
5557   ;
5558   return 0;
5559 }
5560 _ACEOF
5561 if ac_fn_c_try_compile "$LINENO"; then :
5562   pgac_cv_prog_CC_cflags__Wformat_security=yes
5563 else
5564   pgac_cv_prog_CC_cflags__Wformat_security=no
5565 fi
5566 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5567 ac_c_werror_flag=$ac_save_c_werror_flag
5568 CFLAGS="$pgac_save_CFLAGS"
5569 CC="$pgac_save_CC"
5570 fi
5571 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wformat_security" >&5
5572 $as_echo "$pgac_cv_prog_CC_cflags__Wformat_security" >&6; }
5573 if test x"$pgac_cv_prog_CC_cflags__Wformat_security" = x"yes"; then
5574   CFLAGS="${CFLAGS} -Wformat-security"
5575 fi
5576
5577
5578   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -Wformat-security, for CXXFLAGS" >&5
5579 $as_echo_n "checking whether ${CXX} supports -Wformat-security, for CXXFLAGS... " >&6; }
5580 if ${pgac_cv_prog_CXX_cxxflags__Wformat_security+:} false; then :
5581   $as_echo_n "(cached) " >&6
5582 else
5583   pgac_save_CXXFLAGS=$CXXFLAGS
5584 pgac_save_CXX=$CXX
5585 CXX=${CXX}
5586 CXXFLAGS="${CXXFLAGS} -Wformat-security"
5587 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5588 ac_cxx_werror_flag=yes
5589 ac_ext=cpp
5590 ac_cpp='$CXXCPP $CPPFLAGS'
5591 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5592 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5593 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5594
5595 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5596 /* end confdefs.h.  */
5597
5598 int
5599 main ()
5600 {
5601
5602   ;
5603   return 0;
5604 }
5605 _ACEOF
5606 if ac_fn_cxx_try_compile "$LINENO"; then :
5607   pgac_cv_prog_CXX_cxxflags__Wformat_security=yes
5608 else
5609   pgac_cv_prog_CXX_cxxflags__Wformat_security=no
5610 fi
5611 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5612 ac_ext=c
5613 ac_cpp='$CPP $CPPFLAGS'
5614 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5615 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5616 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5617
5618 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5619 CXXFLAGS="$pgac_save_CXXFLAGS"
5620 CXX="$pgac_save_CXX"
5621 fi
5622 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__Wformat_security" >&5
5623 $as_echo "$pgac_cv_prog_CXX_cxxflags__Wformat_security" >&6; }
5624 if test x"$pgac_cv_prog_CXX_cxxflags__Wformat_security" = x"yes"; then
5625   CXXFLAGS="${CXXFLAGS} -Wformat-security"
5626 fi
5627
5628
5629   # Disable strict-aliasing rules; needed for gcc 3.3+
5630
5631 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -fno-strict-aliasing, for CFLAGS" >&5
5632 $as_echo_n "checking whether ${CC} supports -fno-strict-aliasing, for CFLAGS... " >&6; }
5633 if ${pgac_cv_prog_CC_cflags__fno_strict_aliasing+:} false; then :
5634   $as_echo_n "(cached) " >&6
5635 else
5636   pgac_save_CFLAGS=$CFLAGS
5637 pgac_save_CC=$CC
5638 CC=${CC}
5639 CFLAGS="${CFLAGS} -fno-strict-aliasing"
5640 ac_save_c_werror_flag=$ac_c_werror_flag
5641 ac_c_werror_flag=yes
5642 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5643 /* end confdefs.h.  */
5644
5645 int
5646 main ()
5647 {
5648
5649   ;
5650   return 0;
5651 }
5652 _ACEOF
5653 if ac_fn_c_try_compile "$LINENO"; then :
5654   pgac_cv_prog_CC_cflags__fno_strict_aliasing=yes
5655 else
5656   pgac_cv_prog_CC_cflags__fno_strict_aliasing=no
5657 fi
5658 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5659 ac_c_werror_flag=$ac_save_c_werror_flag
5660 CFLAGS="$pgac_save_CFLAGS"
5661 CC="$pgac_save_CC"
5662 fi
5663 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__fno_strict_aliasing" >&5
5664 $as_echo "$pgac_cv_prog_CC_cflags__fno_strict_aliasing" >&6; }
5665 if test x"$pgac_cv_prog_CC_cflags__fno_strict_aliasing" = x"yes"; then
5666   CFLAGS="${CFLAGS} -fno-strict-aliasing"
5667 fi
5668
5669
5670   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -fno-strict-aliasing, for CXXFLAGS" >&5
5671 $as_echo_n "checking whether ${CXX} supports -fno-strict-aliasing, for CXXFLAGS... " >&6; }
5672 if ${pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing+:} false; then :
5673   $as_echo_n "(cached) " >&6
5674 else
5675   pgac_save_CXXFLAGS=$CXXFLAGS
5676 pgac_save_CXX=$CXX
5677 CXX=${CXX}
5678 CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
5679 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5680 ac_cxx_werror_flag=yes
5681 ac_ext=cpp
5682 ac_cpp='$CXXCPP $CPPFLAGS'
5683 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5684 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5685 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5686
5687 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5688 /* end confdefs.h.  */
5689
5690 int
5691 main ()
5692 {
5693
5694   ;
5695   return 0;
5696 }
5697 _ACEOF
5698 if ac_fn_cxx_try_compile "$LINENO"; then :
5699   pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing=yes
5700 else
5701   pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing=no
5702 fi
5703 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5704 ac_ext=c
5705 ac_cpp='$CPP $CPPFLAGS'
5706 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5707 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5708 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5709
5710 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5711 CXXFLAGS="$pgac_save_CXXFLAGS"
5712 CXX="$pgac_save_CXX"
5713 fi
5714 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing" >&5
5715 $as_echo "$pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing" >&6; }
5716 if test x"$pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing" = x"yes"; then
5717   CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
5718 fi
5719
5720
5721   # Disable optimizations that assume no overflow; needed for gcc 4.3+
5722
5723 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -fwrapv, for CFLAGS" >&5
5724 $as_echo_n "checking whether ${CC} supports -fwrapv, for CFLAGS... " >&6; }
5725 if ${pgac_cv_prog_CC_cflags__fwrapv+:} false; then :
5726   $as_echo_n "(cached) " >&6
5727 else
5728   pgac_save_CFLAGS=$CFLAGS
5729 pgac_save_CC=$CC
5730 CC=${CC}
5731 CFLAGS="${CFLAGS} -fwrapv"
5732 ac_save_c_werror_flag=$ac_c_werror_flag
5733 ac_c_werror_flag=yes
5734 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5735 /* end confdefs.h.  */
5736
5737 int
5738 main ()
5739 {
5740
5741   ;
5742   return 0;
5743 }
5744 _ACEOF
5745 if ac_fn_c_try_compile "$LINENO"; then :
5746   pgac_cv_prog_CC_cflags__fwrapv=yes
5747 else
5748   pgac_cv_prog_CC_cflags__fwrapv=no
5749 fi
5750 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5751 ac_c_werror_flag=$ac_save_c_werror_flag
5752 CFLAGS="$pgac_save_CFLAGS"
5753 CC="$pgac_save_CC"
5754 fi
5755 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__fwrapv" >&5
5756 $as_echo "$pgac_cv_prog_CC_cflags__fwrapv" >&6; }
5757 if test x"$pgac_cv_prog_CC_cflags__fwrapv" = x"yes"; then
5758   CFLAGS="${CFLAGS} -fwrapv"
5759 fi
5760
5761
5762   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -fwrapv, for CXXFLAGS" >&5
5763 $as_echo_n "checking whether ${CXX} supports -fwrapv, for CXXFLAGS... " >&6; }
5764 if ${pgac_cv_prog_CXX_cxxflags__fwrapv+:} false; then :
5765   $as_echo_n "(cached) " >&6
5766 else
5767   pgac_save_CXXFLAGS=$CXXFLAGS
5768 pgac_save_CXX=$CXX
5769 CXX=${CXX}
5770 CXXFLAGS="${CXXFLAGS} -fwrapv"
5771 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5772 ac_cxx_werror_flag=yes
5773 ac_ext=cpp
5774 ac_cpp='$CXXCPP $CPPFLAGS'
5775 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5776 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5777 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5778
5779 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5780 /* end confdefs.h.  */
5781
5782 int
5783 main ()
5784 {
5785
5786   ;
5787   return 0;
5788 }
5789 _ACEOF
5790 if ac_fn_cxx_try_compile "$LINENO"; then :
5791   pgac_cv_prog_CXX_cxxflags__fwrapv=yes
5792 else
5793   pgac_cv_prog_CXX_cxxflags__fwrapv=no
5794 fi
5795 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5796 ac_ext=c
5797 ac_cpp='$CPP $CPPFLAGS'
5798 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5799 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5800 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5801
5802 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5803 CXXFLAGS="$pgac_save_CXXFLAGS"
5804 CXX="$pgac_save_CXX"
5805 fi
5806 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__fwrapv" >&5
5807 $as_echo "$pgac_cv_prog_CXX_cxxflags__fwrapv" >&6; }
5808 if test x"$pgac_cv_prog_CXX_cxxflags__fwrapv" = x"yes"; then
5809   CXXFLAGS="${CXXFLAGS} -fwrapv"
5810 fi
5811
5812
5813   # Disable FP optimizations that cause various errors on gcc 4.5+ or maybe 4.6+
5814
5815 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -fexcess-precision=standard, for CFLAGS" >&5
5816 $as_echo_n "checking whether ${CC} supports -fexcess-precision=standard, for CFLAGS... " >&6; }
5817 if ${pgac_cv_prog_CC_cflags__fexcess_precision_standard+:} false; then :
5818   $as_echo_n "(cached) " >&6
5819 else
5820   pgac_save_CFLAGS=$CFLAGS
5821 pgac_save_CC=$CC
5822 CC=${CC}
5823 CFLAGS="${CFLAGS} -fexcess-precision=standard"
5824 ac_save_c_werror_flag=$ac_c_werror_flag
5825 ac_c_werror_flag=yes
5826 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5827 /* end confdefs.h.  */
5828
5829 int
5830 main ()
5831 {
5832
5833   ;
5834   return 0;
5835 }
5836 _ACEOF
5837 if ac_fn_c_try_compile "$LINENO"; then :
5838   pgac_cv_prog_CC_cflags__fexcess_precision_standard=yes
5839 else
5840   pgac_cv_prog_CC_cflags__fexcess_precision_standard=no
5841 fi
5842 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5843 ac_c_werror_flag=$ac_save_c_werror_flag
5844 CFLAGS="$pgac_save_CFLAGS"
5845 CC="$pgac_save_CC"
5846 fi
5847 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__fexcess_precision_standard" >&5
5848 $as_echo "$pgac_cv_prog_CC_cflags__fexcess_precision_standard" >&6; }
5849 if test x"$pgac_cv_prog_CC_cflags__fexcess_precision_standard" = x"yes"; then
5850   CFLAGS="${CFLAGS} -fexcess-precision=standard"
5851 fi
5852
5853
5854   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -fexcess-precision=standard, for CXXFLAGS" >&5
5855 $as_echo_n "checking whether ${CXX} supports -fexcess-precision=standard, for CXXFLAGS... " >&6; }
5856 if ${pgac_cv_prog_CXX_cxxflags__fexcess_precision_standard+:} false; then :
5857   $as_echo_n "(cached) " >&6
5858 else
5859   pgac_save_CXXFLAGS=$CXXFLAGS
5860 pgac_save_CXX=$CXX
5861 CXX=${CXX}
5862 CXXFLAGS="${CXXFLAGS} -fexcess-precision=standard"
5863 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5864 ac_cxx_werror_flag=yes
5865 ac_ext=cpp
5866 ac_cpp='$CXXCPP $CPPFLAGS'
5867 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5868 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5869 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5870
5871 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5872 /* end confdefs.h.  */
5873
5874 int
5875 main ()
5876 {
5877
5878   ;
5879   return 0;
5880 }
5881 _ACEOF
5882 if ac_fn_cxx_try_compile "$LINENO"; then :
5883   pgac_cv_prog_CXX_cxxflags__fexcess_precision_standard=yes
5884 else
5885   pgac_cv_prog_CXX_cxxflags__fexcess_precision_standard=no
5886 fi
5887 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5888 ac_ext=c
5889 ac_cpp='$CPP $CPPFLAGS'
5890 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5891 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5892 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5893
5894 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5895 CXXFLAGS="$pgac_save_CXXFLAGS"
5896 CXX="$pgac_save_CXX"
5897 fi
5898 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__fexcess_precision_standard" >&5
5899 $as_echo "$pgac_cv_prog_CXX_cxxflags__fexcess_precision_standard" >&6; }
5900 if test x"$pgac_cv_prog_CXX_cxxflags__fexcess_precision_standard" = x"yes"; then
5901   CXXFLAGS="${CXXFLAGS} -fexcess-precision=standard"
5902 fi
5903
5904
5905   # Optimization flags for specific files that benefit from vectorization
5906   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -funroll-loops, for CFLAGS_VECTOR" >&5
5907 $as_echo_n "checking whether ${CC} supports -funroll-loops, for CFLAGS_VECTOR... " >&6; }
5908 if ${pgac_cv_prog_CC_cflags__funroll_loops+:} false; then :
5909   $as_echo_n "(cached) " >&6
5910 else
5911   pgac_save_CFLAGS=$CFLAGS
5912 pgac_save_CC=$CC
5913 CC=${CC}
5914 CFLAGS="${CFLAGS_VECTOR} -funroll-loops"
5915 ac_save_c_werror_flag=$ac_c_werror_flag
5916 ac_c_werror_flag=yes
5917 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5918 /* end confdefs.h.  */
5919
5920 int
5921 main ()
5922 {
5923
5924   ;
5925   return 0;
5926 }
5927 _ACEOF
5928 if ac_fn_c_try_compile "$LINENO"; then :
5929   pgac_cv_prog_CC_cflags__funroll_loops=yes
5930 else
5931   pgac_cv_prog_CC_cflags__funroll_loops=no
5932 fi
5933 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5934 ac_c_werror_flag=$ac_save_c_werror_flag
5935 CFLAGS="$pgac_save_CFLAGS"
5936 CC="$pgac_save_CC"
5937 fi
5938 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__funroll_loops" >&5
5939 $as_echo "$pgac_cv_prog_CC_cflags__funroll_loops" >&6; }
5940 if test x"$pgac_cv_prog_CC_cflags__funroll_loops" = x"yes"; then
5941   CFLAGS_VECTOR="${CFLAGS_VECTOR} -funroll-loops"
5942 fi
5943
5944
5945   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -ftree-vectorize, for CFLAGS_VECTOR" >&5
5946 $as_echo_n "checking whether ${CC} supports -ftree-vectorize, for CFLAGS_VECTOR... " >&6; }
5947 if ${pgac_cv_prog_CC_cflags__ftree_vectorize+:} false; then :
5948   $as_echo_n "(cached) " >&6
5949 else
5950   pgac_save_CFLAGS=$CFLAGS
5951 pgac_save_CC=$CC
5952 CC=${CC}
5953 CFLAGS="${CFLAGS_VECTOR} -ftree-vectorize"
5954 ac_save_c_werror_flag=$ac_c_werror_flag
5955 ac_c_werror_flag=yes
5956 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5957 /* end confdefs.h.  */
5958
5959 int
5960 main ()
5961 {
5962
5963   ;
5964   return 0;
5965 }
5966 _ACEOF
5967 if ac_fn_c_try_compile "$LINENO"; then :
5968   pgac_cv_prog_CC_cflags__ftree_vectorize=yes
5969 else
5970   pgac_cv_prog_CC_cflags__ftree_vectorize=no
5971 fi
5972 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5973 ac_c_werror_flag=$ac_save_c_werror_flag
5974 CFLAGS="$pgac_save_CFLAGS"
5975 CC="$pgac_save_CC"
5976 fi
5977 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__ftree_vectorize" >&5
5978 $as_echo "$pgac_cv_prog_CC_cflags__ftree_vectorize" >&6; }
5979 if test x"$pgac_cv_prog_CC_cflags__ftree_vectorize" = x"yes"; then
5980   CFLAGS_VECTOR="${CFLAGS_VECTOR} -ftree-vectorize"
5981 fi
5982
5983
5984   # We want to suppress clang's unhelpful unused-command-line-argument warnings
5985   # but gcc won't complain about unrecognized -Wno-foo switches, so we have to
5986   # test for the positive form and if that works, add the negative form
5987   NOT_THE_CFLAGS=""
5988   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS" >&5
5989 $as_echo_n "checking whether ${CC} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... " >&6; }
5990 if ${pgac_cv_prog_CC_cflags__Wunused_command_line_argument+:} false; then :
5991   $as_echo_n "(cached) " >&6
5992 else
5993   pgac_save_CFLAGS=$CFLAGS
5994 pgac_save_CC=$CC
5995 CC=${CC}
5996 CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
5997 ac_save_c_werror_flag=$ac_c_werror_flag
5998 ac_c_werror_flag=yes
5999 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6000 /* end confdefs.h.  */
6001
6002 int
6003 main ()
6004 {
6005
6006   ;
6007   return 0;
6008 }
6009 _ACEOF
6010 if ac_fn_c_try_compile "$LINENO"; then :
6011   pgac_cv_prog_CC_cflags__Wunused_command_line_argument=yes
6012 else
6013   pgac_cv_prog_CC_cflags__Wunused_command_line_argument=no
6014 fi
6015 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6016 ac_c_werror_flag=$ac_save_c_werror_flag
6017 CFLAGS="$pgac_save_CFLAGS"
6018 CC="$pgac_save_CC"
6019 fi
6020 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wunused_command_line_argument" >&5
6021 $as_echo "$pgac_cv_prog_CC_cflags__Wunused_command_line_argument" >&6; }
6022 if test x"$pgac_cv_prog_CC_cflags__Wunused_command_line_argument" = x"yes"; then
6023   NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
6024 fi
6025
6026
6027   if test -n "$NOT_THE_CFLAGS"; then
6028     CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
6029   fi
6030   # Similarly disable useless truncation warnings from gcc 8+
6031   NOT_THE_CFLAGS=""
6032   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wformat-truncation, for NOT_THE_CFLAGS" >&5
6033 $as_echo_n "checking whether ${CC} supports -Wformat-truncation, for NOT_THE_CFLAGS... " >&6; }
6034 if ${pgac_cv_prog_CC_cflags__Wformat_truncation+:} false; then :
6035   $as_echo_n "(cached) " >&6
6036 else
6037   pgac_save_CFLAGS=$CFLAGS
6038 pgac_save_CC=$CC
6039 CC=${CC}
6040 CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation"
6041 ac_save_c_werror_flag=$ac_c_werror_flag
6042 ac_c_werror_flag=yes
6043 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6044 /* end confdefs.h.  */
6045
6046 int
6047 main ()
6048 {
6049
6050   ;
6051   return 0;
6052 }
6053 _ACEOF
6054 if ac_fn_c_try_compile "$LINENO"; then :
6055   pgac_cv_prog_CC_cflags__Wformat_truncation=yes
6056 else
6057   pgac_cv_prog_CC_cflags__Wformat_truncation=no
6058 fi
6059 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6060 ac_c_werror_flag=$ac_save_c_werror_flag
6061 CFLAGS="$pgac_save_CFLAGS"
6062 CC="$pgac_save_CC"
6063 fi
6064 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wformat_truncation" >&5
6065 $as_echo "$pgac_cv_prog_CC_cflags__Wformat_truncation" >&6; }
6066 if test x"$pgac_cv_prog_CC_cflags__Wformat_truncation" = x"yes"; then
6067   NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation"
6068 fi
6069
6070
6071   if test -n "$NOT_THE_CFLAGS"; then
6072     CFLAGS="$CFLAGS -Wno-format-truncation"
6073   fi
6074   NOT_THE_CFLAGS=""
6075   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wstringop-truncation, for NOT_THE_CFLAGS" >&5
6076 $as_echo_n "checking whether ${CC} supports -Wstringop-truncation, for NOT_THE_CFLAGS... " >&6; }
6077 if ${pgac_cv_prog_CC_cflags__Wstringop_truncation+:} false; then :
6078   $as_echo_n "(cached) " >&6
6079 else
6080   pgac_save_CFLAGS=$CFLAGS
6081 pgac_save_CC=$CC
6082 CC=${CC}
6083 CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation"
6084 ac_save_c_werror_flag=$ac_c_werror_flag
6085 ac_c_werror_flag=yes
6086 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6087 /* end confdefs.h.  */
6088
6089 int
6090 main ()
6091 {
6092
6093   ;
6094   return 0;
6095 }
6096 _ACEOF
6097 if ac_fn_c_try_compile "$LINENO"; then :
6098   pgac_cv_prog_CC_cflags__Wstringop_truncation=yes
6099 else
6100   pgac_cv_prog_CC_cflags__Wstringop_truncation=no
6101 fi
6102 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6103 ac_c_werror_flag=$ac_save_c_werror_flag
6104 CFLAGS="$pgac_save_CFLAGS"
6105 CC="$pgac_save_CC"
6106 fi
6107 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wstringop_truncation" >&5
6108 $as_echo "$pgac_cv_prog_CC_cflags__Wstringop_truncation" >&6; }
6109 if test x"$pgac_cv_prog_CC_cflags__Wstringop_truncation" = x"yes"; then
6110   NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wstringop-truncation"
6111 fi
6112
6113
6114   if test -n "$NOT_THE_CFLAGS"; then
6115     CFLAGS="$CFLAGS -Wno-stringop-truncation"
6116   fi
6117 elif test "$ICC" = yes; then
6118   # Intel's compiler has a bug/misoptimization in checking for
6119   # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
6120
6121 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -mp1, for CFLAGS" >&5
6122 $as_echo_n "checking whether ${CC} supports -mp1, for CFLAGS... " >&6; }
6123 if ${pgac_cv_prog_CC_cflags__mp1+:} false; then :
6124   $as_echo_n "(cached) " >&6
6125 else
6126   pgac_save_CFLAGS=$CFLAGS
6127 pgac_save_CC=$CC
6128 CC=${CC}
6129 CFLAGS="${CFLAGS} -mp1"
6130 ac_save_c_werror_flag=$ac_c_werror_flag
6131 ac_c_werror_flag=yes
6132 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6133 /* end confdefs.h.  */
6134
6135 int
6136 main ()
6137 {
6138
6139   ;
6140   return 0;
6141 }
6142 _ACEOF
6143 if ac_fn_c_try_compile "$LINENO"; then :
6144   pgac_cv_prog_CC_cflags__mp1=yes
6145 else
6146   pgac_cv_prog_CC_cflags__mp1=no
6147 fi
6148 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6149 ac_c_werror_flag=$ac_save_c_werror_flag
6150 CFLAGS="$pgac_save_CFLAGS"
6151 CC="$pgac_save_CC"
6152 fi
6153 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__mp1" >&5
6154 $as_echo "$pgac_cv_prog_CC_cflags__mp1" >&6; }
6155 if test x"$pgac_cv_prog_CC_cflags__mp1" = x"yes"; then
6156   CFLAGS="${CFLAGS} -mp1"
6157 fi
6158
6159
6160   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -mp1, for CXXFLAGS" >&5
6161 $as_echo_n "checking whether ${CXX} supports -mp1, for CXXFLAGS... " >&6; }
6162 if ${pgac_cv_prog_CXX_cxxflags__mp1+:} false; then :
6163   $as_echo_n "(cached) " >&6
6164 else
6165   pgac_save_CXXFLAGS=$CXXFLAGS
6166 pgac_save_CXX=$CXX
6167 CXX=${CXX}
6168 CXXFLAGS="${CXXFLAGS} -mp1"
6169 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
6170 ac_cxx_werror_flag=yes
6171 ac_ext=cpp
6172 ac_cpp='$CXXCPP $CPPFLAGS'
6173 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6174 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6175 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6176
6177 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6178 /* end confdefs.h.  */
6179
6180 int
6181 main ()
6182 {
6183
6184   ;
6185   return 0;
6186 }
6187 _ACEOF
6188 if ac_fn_cxx_try_compile "$LINENO"; then :
6189   pgac_cv_prog_CXX_cxxflags__mp1=yes
6190 else
6191   pgac_cv_prog_CXX_cxxflags__mp1=no
6192 fi
6193 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6194 ac_ext=c
6195 ac_cpp='$CPP $CPPFLAGS'
6196 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6197 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6198 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6199
6200 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
6201 CXXFLAGS="$pgac_save_CXXFLAGS"
6202 CXX="$pgac_save_CXX"
6203 fi
6204 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__mp1" >&5
6205 $as_echo "$pgac_cv_prog_CXX_cxxflags__mp1" >&6; }
6206 if test x"$pgac_cv_prog_CXX_cxxflags__mp1" = x"yes"; then
6207   CXXFLAGS="${CXXFLAGS} -mp1"
6208 fi
6209
6210
6211   # Make sure strict aliasing is off (though this is said to be the default)
6212
6213 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -fno-strict-aliasing, for CFLAGS" >&5
6214 $as_echo_n "checking whether ${CC} supports -fno-strict-aliasing, for CFLAGS... " >&6; }
6215 if ${pgac_cv_prog_CC_cflags__fno_strict_aliasing+:} false; then :
6216   $as_echo_n "(cached) " >&6
6217 else
6218   pgac_save_CFLAGS=$CFLAGS
6219 pgac_save_CC=$CC
6220 CC=${CC}
6221 CFLAGS="${CFLAGS} -fno-strict-aliasing"
6222 ac_save_c_werror_flag=$ac_c_werror_flag
6223 ac_c_werror_flag=yes
6224 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6225 /* end confdefs.h.  */
6226
6227 int
6228 main ()
6229 {
6230
6231   ;
6232   return 0;
6233 }
6234 _ACEOF
6235 if ac_fn_c_try_compile "$LINENO"; then :
6236   pgac_cv_prog_CC_cflags__fno_strict_aliasing=yes
6237 else
6238   pgac_cv_prog_CC_cflags__fno_strict_aliasing=no
6239 fi
6240 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6241 ac_c_werror_flag=$ac_save_c_werror_flag
6242 CFLAGS="$pgac_save_CFLAGS"
6243 CC="$pgac_save_CC"
6244 fi
6245 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__fno_strict_aliasing" >&5
6246 $as_echo "$pgac_cv_prog_CC_cflags__fno_strict_aliasing" >&6; }
6247 if test x"$pgac_cv_prog_CC_cflags__fno_strict_aliasing" = x"yes"; then
6248   CFLAGS="${CFLAGS} -fno-strict-aliasing"
6249 fi
6250
6251
6252   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -fno-strict-aliasing, for CXXFLAGS" >&5
6253 $as_echo_n "checking whether ${CXX} supports -fno-strict-aliasing, for CXXFLAGS... " >&6; }
6254 if ${pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing+:} false; then :
6255   $as_echo_n "(cached) " >&6
6256 else
6257   pgac_save_CXXFLAGS=$CXXFLAGS
6258 pgac_save_CXX=$CXX
6259 CXX=${CXX}
6260 CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
6261 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
6262 ac_cxx_werror_flag=yes
6263 ac_ext=cpp
6264 ac_cpp='$CXXCPP $CPPFLAGS'
6265 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6266 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6267 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6268
6269 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6270 /* end confdefs.h.  */
6271
6272 int
6273 main ()
6274 {
6275
6276   ;
6277   return 0;
6278 }
6279 _ACEOF
6280 if ac_fn_cxx_try_compile "$LINENO"; then :
6281   pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing=yes
6282 else
6283   pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing=no
6284 fi
6285 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6286 ac_ext=c
6287 ac_cpp='$CPP $CPPFLAGS'
6288 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6289 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6290 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6291
6292 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
6293 CXXFLAGS="$pgac_save_CXXFLAGS"
6294 CXX="$pgac_save_CXX"
6295 fi
6296 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing" >&5
6297 $as_echo "$pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing" >&6; }
6298 if test x"$pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing" = x"yes"; then
6299   CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
6300 fi
6301
6302
6303 elif test "$PORTNAME" = "aix"; then
6304   # AIX's xlc has to have strict aliasing turned off too
6305
6306 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -qnoansialias, for CFLAGS" >&5
6307 $as_echo_n "checking whether ${CC} supports -qnoansialias, for CFLAGS... " >&6; }
6308 if ${pgac_cv_prog_CC_cflags__qnoansialias+:} false; then :
6309   $as_echo_n "(cached) " >&6
6310 else
6311   pgac_save_CFLAGS=$CFLAGS
6312 pgac_save_CC=$CC
6313 CC=${CC}
6314 CFLAGS="${CFLAGS} -qnoansialias"
6315 ac_save_c_werror_flag=$ac_c_werror_flag
6316 ac_c_werror_flag=yes
6317 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6318 /* end confdefs.h.  */
6319
6320 int
6321 main ()
6322 {
6323
6324   ;
6325   return 0;
6326 }
6327 _ACEOF
6328 if ac_fn_c_try_compile "$LINENO"; then :
6329   pgac_cv_prog_CC_cflags__qnoansialias=yes
6330 else
6331   pgac_cv_prog_CC_cflags__qnoansialias=no
6332 fi
6333 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6334 ac_c_werror_flag=$ac_save_c_werror_flag
6335 CFLAGS="$pgac_save_CFLAGS"
6336 CC="$pgac_save_CC"
6337 fi
6338 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__qnoansialias" >&5
6339 $as_echo "$pgac_cv_prog_CC_cflags__qnoansialias" >&6; }
6340 if test x"$pgac_cv_prog_CC_cflags__qnoansialias" = x"yes"; then
6341   CFLAGS="${CFLAGS} -qnoansialias"
6342 fi
6343
6344
6345   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -qnoansialias, for CXXFLAGS" >&5
6346 $as_echo_n "checking whether ${CXX} supports -qnoansialias, for CXXFLAGS... " >&6; }
6347 if ${pgac_cv_prog_CXX_cxxflags__qnoansialias+:} false; then :
6348   $as_echo_n "(cached) " >&6
6349 else
6350   pgac_save_CXXFLAGS=$CXXFLAGS
6351 pgac_save_CXX=$CXX
6352 CXX=${CXX}
6353 CXXFLAGS="${CXXFLAGS} -qnoansialias"
6354 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
6355 ac_cxx_werror_flag=yes
6356 ac_ext=cpp
6357 ac_cpp='$CXXCPP $CPPFLAGS'
6358 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6359 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6360 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6361
6362 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6363 /* end confdefs.h.  */
6364
6365 int
6366 main ()
6367 {
6368
6369   ;
6370   return 0;
6371 }
6372 _ACEOF
6373 if ac_fn_cxx_try_compile "$LINENO"; then :
6374   pgac_cv_prog_CXX_cxxflags__qnoansialias=yes
6375 else
6376   pgac_cv_prog_CXX_cxxflags__qnoansialias=no
6377 fi
6378 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6379 ac_ext=c
6380 ac_cpp='$CPP $CPPFLAGS'
6381 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6382 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6383 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6384
6385 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
6386 CXXFLAGS="$pgac_save_CXXFLAGS"
6387 CXX="$pgac_save_CXX"
6388 fi
6389 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__qnoansialias" >&5
6390 $as_echo "$pgac_cv_prog_CXX_cxxflags__qnoansialias" >&6; }
6391 if test x"$pgac_cv_prog_CXX_cxxflags__qnoansialias" = x"yes"; then
6392   CXXFLAGS="${CXXFLAGS} -qnoansialias"
6393 fi
6394
6395
6396
6397 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -qlonglong, for CFLAGS" >&5
6398 $as_echo_n "checking whether ${CC} supports -qlonglong, for CFLAGS... " >&6; }
6399 if ${pgac_cv_prog_CC_cflags__qlonglong+:} false; then :
6400   $as_echo_n "(cached) " >&6
6401 else
6402   pgac_save_CFLAGS=$CFLAGS
6403 pgac_save_CC=$CC
6404 CC=${CC}
6405 CFLAGS="${CFLAGS} -qlonglong"
6406 ac_save_c_werror_flag=$ac_c_werror_flag
6407 ac_c_werror_flag=yes
6408 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6409 /* end confdefs.h.  */
6410
6411 int
6412 main ()
6413 {
6414
6415   ;
6416   return 0;
6417 }
6418 _ACEOF
6419 if ac_fn_c_try_compile "$LINENO"; then :
6420   pgac_cv_prog_CC_cflags__qlonglong=yes
6421 else
6422   pgac_cv_prog_CC_cflags__qlonglong=no
6423 fi
6424 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6425 ac_c_werror_flag=$ac_save_c_werror_flag
6426 CFLAGS="$pgac_save_CFLAGS"
6427 CC="$pgac_save_CC"
6428 fi
6429 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__qlonglong" >&5
6430 $as_echo "$pgac_cv_prog_CC_cflags__qlonglong" >&6; }
6431 if test x"$pgac_cv_prog_CC_cflags__qlonglong" = x"yes"; then
6432   CFLAGS="${CFLAGS} -qlonglong"
6433 fi
6434
6435
6436   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -qlonglong, for CXXFLAGS" >&5
6437 $as_echo_n "checking whether ${CXX} supports -qlonglong, for CXXFLAGS... " >&6; }
6438 if ${pgac_cv_prog_CXX_cxxflags__qlonglong+:} false; then :
6439   $as_echo_n "(cached) " >&6
6440 else
6441   pgac_save_CXXFLAGS=$CXXFLAGS
6442 pgac_save_CXX=$CXX
6443 CXX=${CXX}
6444 CXXFLAGS="${CXXFLAGS} -qlonglong"
6445 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
6446 ac_cxx_werror_flag=yes
6447 ac_ext=cpp
6448 ac_cpp='$CXXCPP $CPPFLAGS'
6449 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6450 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6451 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6452
6453 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6454 /* end confdefs.h.  */
6455
6456 int
6457 main ()
6458 {
6459
6460   ;
6461   return 0;
6462 }
6463 _ACEOF
6464 if ac_fn_cxx_try_compile "$LINENO"; then :
6465   pgac_cv_prog_CXX_cxxflags__qlonglong=yes
6466 else
6467   pgac_cv_prog_CXX_cxxflags__qlonglong=no
6468 fi
6469 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6470 ac_ext=c
6471 ac_cpp='$CPP $CPPFLAGS'
6472 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6473 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6474 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6475
6476 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
6477 CXXFLAGS="$pgac_save_CXXFLAGS"
6478 CXX="$pgac_save_CXX"
6479 fi
6480 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__qlonglong" >&5
6481 $as_echo "$pgac_cv_prog_CXX_cxxflags__qlonglong" >&6; }
6482 if test x"$pgac_cv_prog_CXX_cxxflags__qlonglong" = x"yes"; then
6483   CXXFLAGS="${CXXFLAGS} -qlonglong"
6484 fi
6485
6486
6487 elif test "$PORTNAME" = "hpux"; then
6488   # On some versions of HP-UX, libm functions do not set errno by default.
6489   # Fix that by using +Olibmerrno if the compiler recognizes it.
6490
6491 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports +Olibmerrno, for CFLAGS" >&5
6492 $as_echo_n "checking whether ${CC} supports +Olibmerrno, for CFLAGS... " >&6; }
6493 if ${pgac_cv_prog_CC_cflags_pOlibmerrno+:} false; then :
6494   $as_echo_n "(cached) " >&6
6495 else
6496   pgac_save_CFLAGS=$CFLAGS
6497 pgac_save_CC=$CC
6498 CC=${CC}
6499 CFLAGS="${CFLAGS} +Olibmerrno"
6500 ac_save_c_werror_flag=$ac_c_werror_flag
6501 ac_c_werror_flag=yes
6502 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6503 /* end confdefs.h.  */
6504
6505 int
6506 main ()
6507 {
6508
6509   ;
6510   return 0;
6511 }
6512 _ACEOF
6513 if ac_fn_c_try_compile "$LINENO"; then :
6514   pgac_cv_prog_CC_cflags_pOlibmerrno=yes
6515 else
6516   pgac_cv_prog_CC_cflags_pOlibmerrno=no
6517 fi
6518 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6519 ac_c_werror_flag=$ac_save_c_werror_flag
6520 CFLAGS="$pgac_save_CFLAGS"
6521 CC="$pgac_save_CC"
6522 fi
6523 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags_pOlibmerrno" >&5
6524 $as_echo "$pgac_cv_prog_CC_cflags_pOlibmerrno" >&6; }
6525 if test x"$pgac_cv_prog_CC_cflags_pOlibmerrno" = x"yes"; then
6526   CFLAGS="${CFLAGS} +Olibmerrno"
6527 fi
6528
6529
6530   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports +Olibmerrno, for CXXFLAGS" >&5
6531 $as_echo_n "checking whether ${CXX} supports +Olibmerrno, for CXXFLAGS... " >&6; }
6532 if ${pgac_cv_prog_CXX_cxxflags_pOlibmerrno+:} false; then :
6533   $as_echo_n "(cached) " >&6
6534 else
6535   pgac_save_CXXFLAGS=$CXXFLAGS
6536 pgac_save_CXX=$CXX
6537 CXX=${CXX}
6538 CXXFLAGS="${CXXFLAGS} +Olibmerrno"
6539 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
6540 ac_cxx_werror_flag=yes
6541 ac_ext=cpp
6542 ac_cpp='$CXXCPP $CPPFLAGS'
6543 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6544 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6545 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6546
6547 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6548 /* end confdefs.h.  */
6549
6550 int
6551 main ()
6552 {
6553
6554   ;
6555   return 0;
6556 }
6557 _ACEOF
6558 if ac_fn_cxx_try_compile "$LINENO"; then :
6559   pgac_cv_prog_CXX_cxxflags_pOlibmerrno=yes
6560 else
6561   pgac_cv_prog_CXX_cxxflags_pOlibmerrno=no
6562 fi
6563 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6564 ac_ext=c
6565 ac_cpp='$CPP $CPPFLAGS'
6566 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6567 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6568 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6569
6570 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
6571 CXXFLAGS="$pgac_save_CXXFLAGS"
6572 CXX="$pgac_save_CXX"
6573 fi
6574 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags_pOlibmerrno" >&5
6575 $as_echo "$pgac_cv_prog_CXX_cxxflags_pOlibmerrno" >&6; }
6576 if test x"$pgac_cv_prog_CXX_cxxflags_pOlibmerrno" = x"yes"; then
6577   CXXFLAGS="${CXXFLAGS} +Olibmerrno"
6578 fi
6579
6580
6581 fi
6582
6583 CFLAGS_VECTOR=$CFLAGS_VECTOR
6584
6585
6586 # Determine flags used to emit bitcode for JIT inlining. Need to test
6587 # for behaviour changing compiler flags, to keep compatibility with
6588 # compiler used for normal postgres code.
6589 if test "$with_llvm" = yes ; then
6590   CLANGXX="$CLANG -xc++"
6591
6592   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -fno-strict-aliasing, for BITCODE_CFLAGS" >&5
6593 $as_echo_n "checking whether ${CLANG} supports -fno-strict-aliasing, for BITCODE_CFLAGS... " >&6; }
6594 if ${pgac_cv_prog_CLANG_cflags__fno_strict_aliasing+:} false; then :
6595   $as_echo_n "(cached) " >&6
6596 else
6597   pgac_save_CFLAGS=$CFLAGS
6598 pgac_save_CC=$CC
6599 CC=${CLANG}
6600 CFLAGS="${BITCODE_CFLAGS} -fno-strict-aliasing"
6601 ac_save_c_werror_flag=$ac_c_werror_flag
6602 ac_c_werror_flag=yes
6603 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6604 /* end confdefs.h.  */
6605
6606 int
6607 main ()
6608 {
6609
6610   ;
6611   return 0;
6612 }
6613 _ACEOF
6614 if ac_fn_c_try_compile "$LINENO"; then :
6615   pgac_cv_prog_CLANG_cflags__fno_strict_aliasing=yes
6616 else
6617   pgac_cv_prog_CLANG_cflags__fno_strict_aliasing=no
6618 fi
6619 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6620 ac_c_werror_flag=$ac_save_c_werror_flag
6621 CFLAGS="$pgac_save_CFLAGS"
6622 CC="$pgac_save_CC"
6623 fi
6624 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__fno_strict_aliasing" >&5
6625 $as_echo "$pgac_cv_prog_CLANG_cflags__fno_strict_aliasing" >&6; }
6626 if test x"$pgac_cv_prog_CLANG_cflags__fno_strict_aliasing" = x"yes"; then
6627   BITCODE_CFLAGS="${BITCODE_CFLAGS} -fno-strict-aliasing"
6628 fi
6629
6630   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANGXX} supports -fno-strict-aliasing, for BITCODE_CXXFLAGS" >&5
6631 $as_echo_n "checking whether ${CLANGXX} supports -fno-strict-aliasing, for BITCODE_CXXFLAGS... " >&6; }
6632 if ${pgac_cv_prog_CLANGXX_cxxflags__fno_strict_aliasing+:} false; then :
6633   $as_echo_n "(cached) " >&6
6634 else
6635   pgac_save_CXXFLAGS=$CXXFLAGS
6636 pgac_save_CXX=$CXX
6637 CXX=${CLANGXX}
6638 CXXFLAGS="${BITCODE_CXXFLAGS} -fno-strict-aliasing"
6639 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
6640 ac_cxx_werror_flag=yes
6641 ac_ext=cpp
6642 ac_cpp='$CXXCPP $CPPFLAGS'
6643 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6644 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6645 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6646
6647 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6648 /* end confdefs.h.  */
6649
6650 int
6651 main ()
6652 {
6653
6654   ;
6655   return 0;
6656 }
6657 _ACEOF
6658 if ac_fn_cxx_try_compile "$LINENO"; then :
6659   pgac_cv_prog_CLANGXX_cxxflags__fno_strict_aliasing=yes
6660 else
6661   pgac_cv_prog_CLANGXX_cxxflags__fno_strict_aliasing=no
6662 fi
6663 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6664 ac_ext=c
6665 ac_cpp='$CPP $CPPFLAGS'
6666 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6667 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6668 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6669
6670 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
6671 CXXFLAGS="$pgac_save_CXXFLAGS"
6672 CXX="$pgac_save_CXX"
6673 fi
6674 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANGXX_cxxflags__fno_strict_aliasing" >&5
6675 $as_echo "$pgac_cv_prog_CLANGXX_cxxflags__fno_strict_aliasing" >&6; }
6676 if test x"$pgac_cv_prog_CLANGXX_cxxflags__fno_strict_aliasing" = x"yes"; then
6677   BITCODE_CXXFLAGS="${BITCODE_CXXFLAGS} -fno-strict-aliasing"
6678 fi
6679
6680   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -fwrapv, for BITCODE_CFLAGS" >&5
6681 $as_echo_n "checking whether ${CLANG} supports -fwrapv, for BITCODE_CFLAGS... " >&6; }
6682 if ${pgac_cv_prog_CLANG_cflags__fwrapv+:} false; then :
6683   $as_echo_n "(cached) " >&6
6684 else
6685   pgac_save_CFLAGS=$CFLAGS
6686 pgac_save_CC=$CC
6687 CC=${CLANG}
6688 CFLAGS="${BITCODE_CFLAGS} -fwrapv"
6689 ac_save_c_werror_flag=$ac_c_werror_flag
6690 ac_c_werror_flag=yes
6691 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6692 /* end confdefs.h.  */
6693
6694 int
6695 main ()
6696 {
6697
6698   ;
6699   return 0;
6700 }
6701 _ACEOF
6702 if ac_fn_c_try_compile "$LINENO"; then :
6703   pgac_cv_prog_CLANG_cflags__fwrapv=yes
6704 else
6705   pgac_cv_prog_CLANG_cflags__fwrapv=no
6706 fi
6707 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6708 ac_c_werror_flag=$ac_save_c_werror_flag
6709 CFLAGS="$pgac_save_CFLAGS"
6710 CC="$pgac_save_CC"
6711 fi
6712 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__fwrapv" >&5
6713 $as_echo "$pgac_cv_prog_CLANG_cflags__fwrapv" >&6; }
6714 if test x"$pgac_cv_prog_CLANG_cflags__fwrapv" = x"yes"; then
6715   BITCODE_CFLAGS="${BITCODE_CFLAGS} -fwrapv"
6716 fi
6717
6718   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANGXX} supports -fwrapv, for BITCODE_CXXFLAGS" >&5
6719 $as_echo_n "checking whether ${CLANGXX} supports -fwrapv, for BITCODE_CXXFLAGS... " >&6; }
6720 if ${pgac_cv_prog_CLANGXX_cxxflags__fwrapv+:} false; then :
6721   $as_echo_n "(cached) " >&6
6722 else
6723   pgac_save_CXXFLAGS=$CXXFLAGS
6724 pgac_save_CXX=$CXX
6725 CXX=${CLANGXX}
6726 CXXFLAGS="${BITCODE_CXXFLAGS} -fwrapv"
6727 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
6728 ac_cxx_werror_flag=yes
6729 ac_ext=cpp
6730 ac_cpp='$CXXCPP $CPPFLAGS'
6731 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6732 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6733 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6734
6735 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6736 /* end confdefs.h.  */
6737
6738 int
6739 main ()
6740 {
6741
6742   ;
6743   return 0;
6744 }
6745 _ACEOF
6746 if ac_fn_cxx_try_compile "$LINENO"; then :
6747   pgac_cv_prog_CLANGXX_cxxflags__fwrapv=yes
6748 else
6749   pgac_cv_prog_CLANGXX_cxxflags__fwrapv=no
6750 fi
6751 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6752 ac_ext=c
6753 ac_cpp='$CPP $CPPFLAGS'
6754 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6755 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6756 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6757
6758 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
6759 CXXFLAGS="$pgac_save_CXXFLAGS"
6760 CXX="$pgac_save_CXX"
6761 fi
6762 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANGXX_cxxflags__fwrapv" >&5
6763 $as_echo "$pgac_cv_prog_CLANGXX_cxxflags__fwrapv" >&6; }
6764 if test x"$pgac_cv_prog_CLANGXX_cxxflags__fwrapv" = x"yes"; then
6765   BITCODE_CXXFLAGS="${BITCODE_CXXFLAGS} -fwrapv"
6766 fi
6767
6768   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -fexcess-precision=standard, for BITCODE_CFLAGS" >&5
6769 $as_echo_n "checking whether ${CLANG} supports -fexcess-precision=standard, for BITCODE_CFLAGS... " >&6; }
6770 if ${pgac_cv_prog_CLANG_cflags__fexcess_precision_standard+:} false; then :
6771   $as_echo_n "(cached) " >&6
6772 else
6773   pgac_save_CFLAGS=$CFLAGS
6774 pgac_save_CC=$CC
6775 CC=${CLANG}
6776 CFLAGS="${BITCODE_CFLAGS} -fexcess-precision=standard"
6777 ac_save_c_werror_flag=$ac_c_werror_flag
6778 ac_c_werror_flag=yes
6779 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6780 /* end confdefs.h.  */
6781
6782 int
6783 main ()
6784 {
6785
6786   ;
6787   return 0;
6788 }
6789 _ACEOF
6790 if ac_fn_c_try_compile "$LINENO"; then :
6791   pgac_cv_prog_CLANG_cflags__fexcess_precision_standard=yes
6792 else
6793   pgac_cv_prog_CLANG_cflags__fexcess_precision_standard=no
6794 fi
6795 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6796 ac_c_werror_flag=$ac_save_c_werror_flag
6797 CFLAGS="$pgac_save_CFLAGS"
6798 CC="$pgac_save_CC"
6799 fi
6800 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__fexcess_precision_standard" >&5
6801 $as_echo "$pgac_cv_prog_CLANG_cflags__fexcess_precision_standard" >&6; }
6802 if test x"$pgac_cv_prog_CLANG_cflags__fexcess_precision_standard" = x"yes"; then
6803   BITCODE_CFLAGS="${BITCODE_CFLAGS} -fexcess-precision=standard"
6804 fi
6805
6806   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANGXX} supports -fexcess-precision=standard, for BITCODE_CXXFLAGS" >&5
6807 $as_echo_n "checking whether ${CLANGXX} supports -fexcess-precision=standard, for BITCODE_CXXFLAGS... " >&6; }
6808 if ${pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard+:} false; then :
6809   $as_echo_n "(cached) " >&6
6810 else
6811   pgac_save_CXXFLAGS=$CXXFLAGS
6812 pgac_save_CXX=$CXX
6813 CXX=${CLANGXX}
6814 CXXFLAGS="${BITCODE_CXXFLAGS} -fexcess-precision=standard"
6815 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
6816 ac_cxx_werror_flag=yes
6817 ac_ext=cpp
6818 ac_cpp='$CXXCPP $CPPFLAGS'
6819 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6820 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6821 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6822
6823 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6824 /* end confdefs.h.  */
6825
6826 int
6827 main ()
6828 {
6829
6830   ;
6831   return 0;
6832 }
6833 _ACEOF
6834 if ac_fn_cxx_try_compile "$LINENO"; then :
6835   pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard=yes
6836 else
6837   pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard=no
6838 fi
6839 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6840 ac_ext=c
6841 ac_cpp='$CPP $CPPFLAGS'
6842 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6843 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6844 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6845
6846 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
6847 CXXFLAGS="$pgac_save_CXXFLAGS"
6848 CXX="$pgac_save_CXX"
6849 fi
6850 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard" >&5
6851 $as_echo "$pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard" >&6; }
6852 if test x"$pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard" = x"yes"; then
6853   BITCODE_CXXFLAGS="${BITCODE_CXXFLAGS} -fexcess-precision=standard"
6854 fi
6855
6856 fi
6857
6858 # supply -g if --enable-debug
6859 if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
6860   CFLAGS="$CFLAGS -g"
6861 fi
6862
6863 if test "$enable_debug" = yes && test "$ac_cv_prog_cxx_g" = yes; then
6864   CXXFLAGS="$CXXFLAGS -g"
6865 fi
6866
6867 # enable code coverage if --enable-coverage
6868 if test "$enable_coverage" = yes; then
6869   if test "$GCC" = yes; then
6870     CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
6871     CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
6872   else
6873     as_fn_error $? "--enable-coverage is supported only when using GCC" "$LINENO" 5
6874   fi
6875 fi
6876
6877 # enable profiling if --enable-profiling
6878 if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then
6879   if test "$GCC" = yes; then
6880
6881 $as_echo "#define PROFILE_PID_DIR 1" >>confdefs.h
6882
6883     CFLAGS="$CFLAGS -pg $PLATFORM_PROFILE_FLAGS"
6884     CXXFLAGS="$CXXFLAGS -pg $PLATFORM_PROFILE_FLAGS"
6885   else
6886     as_fn_error $? "--enable-profiling is supported only when using GCC" "$LINENO" 5
6887   fi
6888 fi
6889
6890 # We already have this in Makefile.win32, but configure needs it too
6891 if test "$PORTNAME" = "win32"; then
6892   CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32 -DEXEC_BACKEND"
6893 fi
6894
6895 # Now that we're done automatically adding stuff to C[XX]FLAGS, put back the
6896 # user-specified flags (if any) at the end.  This lets users override
6897 # the automatic additions.
6898 CFLAGS="$CFLAGS $user_CFLAGS"
6899 CXXFLAGS="$CXXFLAGS $user_CXXFLAGS"
6900 BITCODE_CFLAGS="$BITCODE_CFLAGS $user_BITCODE_CFLAGS"
6901 BITCODE_CXXFLAGS="$BITCODE_CXXFLAGS $user_BITCODE_CXXFLAGS"
6902
6903 BITCODE_CFLAGS=$BITCODE_CFLAGS
6904
6905 BITCODE_CXXFLAGS=$BITCODE_CXXFLAGS
6906
6907
6908 # Check if the compiler still works with the final flag settings
6909 # (note, we're not checking that for CXX, which is optional)
6910 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler still works" >&5
6911 $as_echo_n "checking whether the C compiler still works... " >&6; }
6912 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6913 /* end confdefs.h.  */
6914
6915 int
6916 main ()
6917 {
6918 return 0;
6919   ;
6920   return 0;
6921 }
6922 _ACEOF
6923 if ac_fn_c_try_link "$LINENO"; then :
6924   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6925 $as_echo "yes" >&6; }
6926 else
6927   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6928 $as_echo "no" >&6; }
6929    as_fn_error $? "cannot proceed" "$LINENO" 5
6930 fi
6931 rm -f core conftest.err conftest.$ac_objext \
6932     conftest$ac_exeext conftest.$ac_ext
6933
6934 # Defend against gcc -ffast-math
6935 if test "$GCC" = yes; then
6936 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6937 /* end confdefs.h.  */
6938
6939 int
6940 main ()
6941 {
6942 #ifdef __FAST_MATH__
6943 choke me
6944 #endif
6945   ;
6946   return 0;
6947 }
6948 _ACEOF
6949 if ac_fn_c_try_compile "$LINENO"; then :
6950
6951 else
6952   as_fn_error $? "do not put -ffast-math in CFLAGS" "$LINENO" 5
6953 fi
6954 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6955 fi
6956
6957 # Defend against clang being used on x86-32 without SSE2 enabled.  As current
6958 # versions of clang do not understand -fexcess-precision=standard, the use of
6959 # x87 floating point operations leads to problems like isinf possibly returning
6960 # false for a value that is infinite when converted from the 80bit register to
6961 # the 8byte memory representation.
6962 #
6963 # Only perform the test if the compiler doesn't understand
6964 # -fexcess-precision=standard, that way a potentially fixed compiler will work
6965 # automatically.
6966 if test "$pgac_cv_prog_CC_cflags__fexcess_precision_standard" = no; then
6967 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6968 /* end confdefs.h.  */
6969
6970 int
6971 main ()
6972 {
6973
6974 #if defined(__clang__) && defined(__i386__) && !defined(__SSE2_MATH__)
6975 choke me
6976 #endif
6977
6978   ;
6979   return 0;
6980 }
6981 _ACEOF
6982 if ac_fn_c_try_compile "$LINENO"; then :
6983
6984 else
6985   as_fn_error $? "Compiling PostgreSQL with clang, on 32bit x86, requires SSE2 support. Use -msse2 or use gcc." "$LINENO" 5
6986 fi
6987 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6988 fi
6989
6990 ac_ext=c
6991 ac_cpp='$CPP $CPPFLAGS'
6992 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6993 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6994 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6995 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
6996 $as_echo_n "checking how to run the C preprocessor... " >&6; }
6997 # On Suns, sometimes $CPP names a directory.
6998 if test -n "$CPP" && test -d "$CPP"; then
6999   CPP=
7000 fi
7001 if test -z "$CPP"; then
7002   if ${ac_cv_prog_CPP+:} false; then :
7003   $as_echo_n "(cached) " >&6
7004 else
7005       # Double quotes because CPP needs to be expanded
7006     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
7007     do
7008       ac_preproc_ok=false
7009 for ac_c_preproc_warn_flag in '' yes
7010 do
7011   # Use a header file that comes with gcc, so configuring glibc
7012   # with a fresh cross-compiler works.
7013   # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
7014   # <limits.h> exists even on freestanding compilers.
7015   # On the NeXT, cc -E runs the code through the compiler's parser,
7016   # not just through cpp. "Syntax error" is here to catch this case.
7017   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7018 /* end confdefs.h.  */
7019 #ifdef __STDC__
7020 # include <limits.h>
7021 #else
7022 # include <assert.h>
7023 #endif
7024                      Syntax error
7025 _ACEOF
7026 if ac_fn_c_try_cpp "$LINENO"; then :
7027
7028 else
7029   # Broken: fails on valid input.
7030 continue
7031 fi
7032 rm -f conftest.err conftest.i conftest.$ac_ext
7033
7034   # OK, works on sane cases.  Now check whether nonexistent headers
7035   # can be detected and how.
7036   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7037 /* end confdefs.h.  */
7038 #include <ac_nonexistent.h>
7039 _ACEOF
7040 if ac_fn_c_try_cpp "$LINENO"; then :
7041   # Broken: success on invalid input.
7042 continue
7043 else
7044   # Passes both tests.
7045 ac_preproc_ok=:
7046 break
7047 fi
7048 rm -f conftest.err conftest.i conftest.$ac_ext
7049
7050 done
7051 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
7052 rm -f conftest.i conftest.err conftest.$ac_ext
7053 if $ac_preproc_ok; then :
7054   break
7055 fi
7056
7057     done
7058     ac_cv_prog_CPP=$CPP
7059
7060 fi
7061   CPP=$ac_cv_prog_CPP
7062 else
7063   ac_cv_prog_CPP=$CPP
7064 fi
7065 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
7066 $as_echo "$CPP" >&6; }
7067 ac_preproc_ok=false
7068 for ac_c_preproc_warn_flag in '' yes
7069 do
7070   # Use a header file that comes with gcc, so configuring glibc
7071   # with a fresh cross-compiler works.
7072   # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
7073   # <limits.h> exists even on freestanding compilers.
7074   # On the NeXT, cc -E runs the code through the compiler's parser,
7075   # not just through cpp. "Syntax error" is here to catch this case.
7076   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7077 /* end confdefs.h.  */
7078 #ifdef __STDC__
7079 # include <limits.h>
7080 #else
7081 # include <assert.h>
7082 #endif
7083                      Syntax error
7084 _ACEOF
7085 if ac_fn_c_try_cpp "$LINENO"; then :
7086
7087 else
7088   # Broken: fails on valid input.
7089 continue
7090 fi
7091 rm -f conftest.err conftest.i conftest.$ac_ext
7092
7093   # OK, works on sane cases.  Now check whether nonexistent headers
7094   # can be detected and how.
7095   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7096 /* end confdefs.h.  */
7097 #include <ac_nonexistent.h>
7098 _ACEOF
7099 if ac_fn_c_try_cpp "$LINENO"; then :
7100   # Broken: success on invalid input.
7101 continue
7102 else
7103   # Passes both tests.
7104 ac_preproc_ok=:
7105 break
7106 fi
7107 rm -f conftest.err conftest.i conftest.$ac_ext
7108
7109 done
7110 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
7111 rm -f conftest.i conftest.err conftest.$ac_ext
7112 if $ac_preproc_ok; then :
7113
7114 else
7115   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
7116 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
7117 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
7118 See \`config.log' for more details" "$LINENO" 5; }
7119 fi
7120
7121 ac_ext=c
7122 ac_cpp='$CPP $CPPFLAGS'
7123 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7124 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7125 ac_compiler_gnu=$ac_cv_c_compiler_gnu
7126
7127
7128
7129
7130 #
7131 # Set up TAS assembly code if needed; the template file has now had its
7132 # chance to request this.
7133 #
7134 ac_config_links="$ac_config_links src/backend/port/tas.s:src/backend/port/tas/${tas_file}"
7135
7136
7137 if test "$need_tas" = yes ; then
7138   TAS=tas.o
7139 else
7140   TAS=""
7141 fi
7142
7143
7144
7145 #
7146 # Automatic dependency tracking
7147 #
7148
7149
7150 # Check whether --enable-depend was given.
7151 if test "${enable_depend+set}" = set; then :
7152   enableval=$enable_depend;
7153   case $enableval in
7154     yes)
7155       autodepend=yes
7156       ;;
7157     no)
7158       :
7159       ;;
7160     *)
7161       as_fn_error $? "no argument expected for --enable-depend option" "$LINENO" 5
7162       ;;
7163   esac
7164
7165 else
7166   enable_depend=no
7167
7168 fi
7169
7170
7171
7172
7173
7174 #
7175 # Enable assert checks
7176 #
7177
7178
7179 # Check whether --enable-cassert was given.
7180 if test "${enable_cassert+set}" = set; then :
7181   enableval=$enable_cassert;
7182   case $enableval in
7183     yes)
7184
7185 $as_echo "#define USE_ASSERT_CHECKING 1" >>confdefs.h
7186
7187       ;;
7188     no)
7189       :
7190       ;;
7191     *)
7192       as_fn_error $? "no argument expected for --enable-cassert option" "$LINENO" 5
7193       ;;
7194   esac
7195
7196 else
7197   enable_cassert=no
7198
7199 fi
7200
7201
7202
7203
7204 #
7205 # Include directories
7206 #
7207 ac_save_IFS=$IFS
7208 IFS="${IFS}${PATH_SEPARATOR}"
7209 # SRCH_INC comes from the template file
7210 for dir in $with_includes $SRCH_INC; do
7211   if test -d "$dir"; then
7212     INCLUDES="$INCLUDES -I$dir"
7213   else
7214     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Include directory $dir does not exist." >&5
7215 $as_echo "$as_me: WARNING: *** Include directory $dir does not exist." >&2;}
7216   fi
7217 done
7218 IFS=$ac_save_IFS
7219
7220
7221
7222 #
7223 # Library directories
7224 #
7225 ac_save_IFS=$IFS
7226 IFS="${IFS}${PATH_SEPARATOR}"
7227 # LIBRARY_DIRS comes from command line, SRCH_LIB from template file.
7228 for dir in $LIBRARY_DIRS $SRCH_LIB; do
7229   if test -d "$dir"; then
7230     LIBDIRS="$LIBDIRS -L$dir"
7231   else
7232     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Library directory $dir does not exist." >&5
7233 $as_echo "$as_me: WARNING: *** Library directory $dir does not exist." >&2;}
7234   fi
7235 done
7236 IFS=$ac_save_IFS
7237
7238 #
7239 # Enable thread-safe client libraries
7240 #
7241 { $as_echo "$as_me:${as_lineno-$LINENO}: checking allow thread-safe client libraries" >&5
7242 $as_echo_n "checking allow thread-safe client libraries... " >&6; }
7243
7244
7245 # Check whether --enable-thread-safety was given.
7246 if test "${enable_thread_safety+set}" = set; then :
7247   enableval=$enable_thread_safety;
7248   case $enableval in
7249     yes)
7250       :
7251       ;;
7252     no)
7253       :
7254       ;;
7255     *)
7256       as_fn_error $? "no argument expected for --enable-thread-safety option" "$LINENO" 5
7257       ;;
7258   esac
7259
7260 else
7261   enable_thread_safety=yes
7262
7263 fi
7264
7265
7266 if test "$enable_thread_safety" = yes; then
7267
7268 $as_echo "#define ENABLE_THREAD_SAFETY 1" >>confdefs.h
7269
7270 fi
7271 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_thread_safety" >&5
7272 $as_echo "$enable_thread_safety" >&6; }
7273
7274
7275 #
7276 # ICU
7277 #
7278 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with ICU support" >&5
7279 $as_echo_n "checking whether to build with ICU support... " >&6; }
7280
7281
7282
7283 # Check whether --with-icu was given.
7284 if test "${with_icu+set}" = set; then :
7285   withval=$with_icu;
7286   case $withval in
7287     yes)
7288
7289 $as_echo "#define USE_ICU 1" >>confdefs.h
7290
7291       ;;
7292     no)
7293       :
7294       ;;
7295     *)
7296       as_fn_error $? "no argument expected for --with-icu option" "$LINENO" 5
7297       ;;
7298   esac
7299
7300 else
7301   with_icu=no
7302
7303 fi
7304
7305
7306 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_icu" >&5
7307 $as_echo "$with_icu" >&6; }
7308
7309
7310 if test "$with_icu" = yes; then
7311
7312
7313
7314
7315
7316
7317
7318 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
7319         if test -n "$ac_tool_prefix"; then
7320   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
7321 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
7322 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7323 $as_echo_n "checking for $ac_word... " >&6; }
7324 if ${ac_cv_path_PKG_CONFIG+:} false; then :
7325   $as_echo_n "(cached) " >&6
7326 else
7327   case $PKG_CONFIG in
7328   [\\/]* | ?:[\\/]*)
7329   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
7330   ;;
7331   *)
7332   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7333 for as_dir in $PATH
7334 do
7335   IFS=$as_save_IFS
7336   test -z "$as_dir" && as_dir=.
7337     for ac_exec_ext in '' $ac_executable_extensions; do
7338   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7339     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
7340     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7341     break 2
7342   fi
7343 done
7344   done
7345 IFS=$as_save_IFS
7346
7347   ;;
7348 esac
7349 fi
7350 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
7351 if test -n "$PKG_CONFIG"; then
7352   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
7353 $as_echo "$PKG_CONFIG" >&6; }
7354 else
7355   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7356 $as_echo "no" >&6; }
7357 fi
7358
7359
7360 fi
7361 if test -z "$ac_cv_path_PKG_CONFIG"; then
7362   ac_pt_PKG_CONFIG=$PKG_CONFIG
7363   # Extract the first word of "pkg-config", so it can be a program name with args.
7364 set dummy pkg-config; ac_word=$2
7365 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7366 $as_echo_n "checking for $ac_word... " >&6; }
7367 if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
7368   $as_echo_n "(cached) " >&6
7369 else
7370   case $ac_pt_PKG_CONFIG in
7371   [\\/]* | ?:[\\/]*)
7372   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
7373   ;;
7374   *)
7375   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7376 for as_dir in $PATH
7377 do
7378   IFS=$as_save_IFS
7379   test -z "$as_dir" && as_dir=.
7380     for ac_exec_ext in '' $ac_executable_extensions; do
7381   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7382     ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
7383     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7384     break 2
7385   fi
7386 done
7387   done
7388 IFS=$as_save_IFS
7389
7390   ;;
7391 esac
7392 fi
7393 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
7394 if test -n "$ac_pt_PKG_CONFIG"; then
7395   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
7396 $as_echo "$ac_pt_PKG_CONFIG" >&6; }
7397 else
7398   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7399 $as_echo "no" >&6; }
7400 fi
7401
7402   if test "x$ac_pt_PKG_CONFIG" = x; then
7403     PKG_CONFIG=""
7404   else
7405     case $cross_compiling:$ac_tool_warned in
7406 yes:)
7407 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7408 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7409 ac_tool_warned=yes ;;
7410 esac
7411     PKG_CONFIG=$ac_pt_PKG_CONFIG
7412   fi
7413 else
7414   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
7415 fi
7416
7417 fi
7418 if test -n "$PKG_CONFIG"; then
7419         _pkg_min_version=0.9.0
7420         { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
7421 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
7422         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
7423                 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7424 $as_echo "yes" >&6; }
7425         else
7426                 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7427 $as_echo "no" >&6; }
7428                 PKG_CONFIG=""
7429         fi
7430 fi
7431
7432 pkg_failed=no
7433 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icu-uc icu-i18n" >&5
7434 $as_echo_n "checking for icu-uc icu-i18n... " >&6; }
7435
7436 if test -n "$ICU_CFLAGS"; then
7437     pkg_cv_ICU_CFLAGS="$ICU_CFLAGS"
7438  elif test -n "$PKG_CONFIG"; then
7439     if test -n "$PKG_CONFIG" && \
7440     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-uc icu-i18n\""; } >&5
7441   ($PKG_CONFIG --exists --print-errors "icu-uc icu-i18n") 2>&5
7442   ac_status=$?
7443   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7444   test $ac_status = 0; }; then
7445   pkg_cv_ICU_CFLAGS=`$PKG_CONFIG --cflags "icu-uc icu-i18n" 2>/dev/null`
7446                       test "x$?" != "x0" && pkg_failed=yes
7447 else
7448   pkg_failed=yes
7449 fi
7450  else
7451     pkg_failed=untried
7452 fi
7453 if test -n "$ICU_LIBS"; then
7454     pkg_cv_ICU_LIBS="$ICU_LIBS"
7455  elif test -n "$PKG_CONFIG"; then
7456     if test -n "$PKG_CONFIG" && \
7457     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-uc icu-i18n\""; } >&5
7458   ($PKG_CONFIG --exists --print-errors "icu-uc icu-i18n") 2>&5
7459   ac_status=$?
7460   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7461   test $ac_status = 0; }; then
7462   pkg_cv_ICU_LIBS=`$PKG_CONFIG --libs "icu-uc icu-i18n" 2>/dev/null`
7463                       test "x$?" != "x0" && pkg_failed=yes
7464 else
7465   pkg_failed=yes
7466 fi
7467  else
7468     pkg_failed=untried
7469 fi
7470
7471
7472
7473 if test $pkg_failed = yes; then
7474         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7475 $as_echo "no" >&6; }
7476
7477 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
7478         _pkg_short_errors_supported=yes
7479 else
7480         _pkg_short_errors_supported=no
7481 fi
7482         if test $_pkg_short_errors_supported = yes; then
7483                 ICU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "icu-uc icu-i18n" 2>&1`
7484         else
7485                 ICU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "icu-uc icu-i18n" 2>&1`
7486         fi
7487         # Put the nasty error message in config.log where it belongs
7488         echo "$ICU_PKG_ERRORS" >&5
7489
7490         as_fn_error $? "Package requirements (icu-uc icu-i18n) were not met:
7491
7492 $ICU_PKG_ERRORS
7493
7494 Consider adjusting the PKG_CONFIG_PATH environment variable if you
7495 installed software in a non-standard prefix.
7496
7497 Alternatively, you may set the environment variables ICU_CFLAGS
7498 and ICU_LIBS to avoid the need to call pkg-config.
7499 See the pkg-config man page for more details." "$LINENO" 5
7500 elif test $pkg_failed = untried; then
7501         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7502 $as_echo "no" >&6; }
7503         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
7504 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
7505 as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
7506 is in your PATH or set the PKG_CONFIG environment variable to the full
7507 path to pkg-config.
7508
7509 Alternatively, you may set the environment variables ICU_CFLAGS
7510 and ICU_LIBS to avoid the need to call pkg-config.
7511 See the pkg-config man page for more details.
7512
7513 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
7514 See \`config.log' for more details" "$LINENO" 5; }
7515 else
7516         ICU_CFLAGS=$pkg_cv_ICU_CFLAGS
7517         ICU_LIBS=$pkg_cv_ICU_LIBS
7518         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7519 $as_echo "yes" >&6; }
7520
7521 fi
7522 fi
7523
7524 #
7525 # Optionally build Tcl modules (PL/Tcl)
7526 #
7527 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Tcl" >&5
7528 $as_echo_n "checking whether to build with Tcl... " >&6; }
7529
7530
7531
7532 # Check whether --with-tcl was given.
7533 if test "${with_tcl+set}" = set; then :
7534   withval=$with_tcl;
7535   case $withval in
7536     yes)
7537       :
7538       ;;
7539     no)
7540       :
7541       ;;
7542     *)
7543       as_fn_error $? "no argument expected for --with-tcl option" "$LINENO" 5
7544       ;;
7545   esac
7546
7547 else
7548   with_tcl=no
7549
7550 fi
7551
7552
7553 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_tcl" >&5
7554 $as_echo "$with_tcl" >&6; }
7555
7556
7557 # We see if the path to the Tcl/Tk configuration scripts is specified.
7558 # This will override the use of tclsh to find the paths to search.
7559
7560
7561
7562
7563 # Check whether --with-tclconfig was given.
7564 if test "${with_tclconfig+set}" = set; then :
7565   withval=$with_tclconfig;
7566   case $withval in
7567     yes)
7568       as_fn_error $? "argument required for --with-tclconfig option" "$LINENO" 5
7569       ;;
7570     no)
7571       as_fn_error $? "argument required for --with-tclconfig option" "$LINENO" 5
7572       ;;
7573     *)
7574
7575       ;;
7576   esac
7577
7578 fi
7579
7580
7581
7582 #
7583 # Optionally build Perl modules (PL/Perl)
7584 #
7585 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Perl modules" >&5
7586 $as_echo_n "checking whether to build Perl modules... " >&6; }
7587
7588
7589
7590 # Check whether --with-perl was given.
7591 if test "${with_perl+set}" = set; then :
7592   withval=$with_perl;
7593   case $withval in
7594     yes)
7595       :
7596       ;;
7597     no)
7598       :
7599       ;;
7600     *)
7601       as_fn_error $? "no argument expected for --with-perl option" "$LINENO" 5
7602       ;;
7603   esac
7604
7605 else
7606   with_perl=no
7607
7608 fi
7609
7610
7611 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_perl" >&5
7612 $as_echo "$with_perl" >&6; }
7613
7614
7615 #
7616 # Optionally build Python modules (PL/Python)
7617 #
7618 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Python modules" >&5
7619 $as_echo_n "checking whether to build Python modules... " >&6; }
7620
7621
7622
7623 # Check whether --with-python was given.
7624 if test "${with_python+set}" = set; then :
7625   withval=$with_python;
7626   case $withval in
7627     yes)
7628       :
7629       ;;
7630     no)
7631       :
7632       ;;
7633     *)
7634       as_fn_error $? "no argument expected for --with-python option" "$LINENO" 5
7635       ;;
7636   esac
7637
7638 else
7639   with_python=no
7640
7641 fi
7642
7643
7644 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_python" >&5
7645 $as_echo "$with_python" >&6; }
7646
7647
7648 #
7649 # GSSAPI
7650 #
7651 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with GSSAPI support" >&5
7652 $as_echo_n "checking whether to build with GSSAPI support... " >&6; }
7653
7654
7655
7656 # Check whether --with-gssapi was given.
7657 if test "${with_gssapi+set}" = set; then :
7658   withval=$with_gssapi;
7659   case $withval in
7660     yes)
7661
7662
7663 $as_echo "#define ENABLE_GSS 1" >>confdefs.h
7664
7665   krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab"
7666
7667       ;;
7668     no)
7669       :
7670       ;;
7671     *)
7672       as_fn_error $? "no argument expected for --with-gssapi option" "$LINENO" 5
7673       ;;
7674   esac
7675
7676 else
7677   with_gssapi=no
7678
7679 fi
7680
7681
7682 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gssapi" >&5
7683 $as_echo "$with_gssapi" >&6; }
7684
7685
7686
7687
7688
7689
7690 #
7691 # Kerberos configuration parameters
7692 #
7693
7694
7695
7696 # Check whether --with-krb-srvnam was given.
7697 if test "${with_krb_srvnam+set}" = set; then :
7698   withval=$with_krb_srvnam;
7699   case $withval in
7700     yes)
7701       as_fn_error $? "argument required for --with-krb-srvnam option" "$LINENO" 5
7702       ;;
7703     no)
7704       as_fn_error $? "argument required for --with-krb-srvnam option" "$LINENO" 5
7705       ;;
7706     *)
7707
7708       ;;
7709   esac
7710
7711 else
7712   with_krb_srvnam="postgres"
7713 fi
7714
7715
7716
7717
7718 cat >>confdefs.h <<_ACEOF
7719 #define PG_KRB_SRVNAM "$with_krb_srvnam"
7720 _ACEOF
7721
7722
7723
7724 #
7725 # PAM
7726 #
7727 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with PAM support" >&5
7728 $as_echo_n "checking whether to build with PAM support... " >&6; }
7729
7730
7731
7732 # Check whether --with-pam was given.
7733 if test "${with_pam+set}" = set; then :
7734   withval=$with_pam;
7735   case $withval in
7736     yes)
7737
7738 $as_echo "#define USE_PAM 1" >>confdefs.h
7739
7740       ;;
7741     no)
7742       :
7743       ;;
7744     *)
7745       as_fn_error $? "no argument expected for --with-pam option" "$LINENO" 5
7746       ;;
7747   esac
7748
7749 else
7750   with_pam=no
7751
7752 fi
7753
7754
7755 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pam" >&5
7756 $as_echo "$with_pam" >&6; }
7757
7758
7759 #
7760 # BSD AUTH
7761 #
7762 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with BSD Authentication support" >&5
7763 $as_echo_n "checking whether to build with BSD Authentication support... " >&6; }
7764
7765
7766
7767 # Check whether --with-bsd-auth was given.
7768 if test "${with_bsd_auth+set}" = set; then :
7769   withval=$with_bsd_auth;
7770   case $withval in
7771     yes)
7772
7773 $as_echo "#define USE_BSD_AUTH 1" >>confdefs.h
7774
7775       ;;
7776     no)
7777       :
7778       ;;
7779     *)
7780       as_fn_error $? "no argument expected for --with-bsd-auth option" "$LINENO" 5
7781       ;;
7782   esac
7783
7784 else
7785   with_bsd_auth=no
7786
7787 fi
7788
7789
7790 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_bsd_auth" >&5
7791 $as_echo "$with_bsd_auth" >&6; }
7792
7793
7794 #
7795 # LDAP
7796 #
7797 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with LDAP support" >&5
7798 $as_echo_n "checking whether to build with LDAP support... " >&6; }
7799
7800
7801
7802 # Check whether --with-ldap was given.
7803 if test "${with_ldap+set}" = set; then :
7804   withval=$with_ldap;
7805   case $withval in
7806     yes)
7807
7808 $as_echo "#define USE_LDAP 1" >>confdefs.h
7809
7810       ;;
7811     no)
7812       :
7813       ;;
7814     *)
7815       as_fn_error $? "no argument expected for --with-ldap option" "$LINENO" 5
7816       ;;
7817   esac
7818
7819 else
7820   with_ldap=no
7821
7822 fi
7823
7824
7825 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ldap" >&5
7826 $as_echo "$with_ldap" >&6; }
7827
7828
7829
7830 #
7831 # Bonjour
7832 #
7833 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Bonjour support" >&5
7834 $as_echo_n "checking whether to build with Bonjour support... " >&6; }
7835
7836
7837
7838 # Check whether --with-bonjour was given.
7839 if test "${with_bonjour+set}" = set; then :
7840   withval=$with_bonjour;
7841   case $withval in
7842     yes)
7843
7844 $as_echo "#define USE_BONJOUR 1" >>confdefs.h
7845
7846       ;;
7847     no)
7848       :
7849       ;;
7850     *)
7851       as_fn_error $? "no argument expected for --with-bonjour option" "$LINENO" 5
7852       ;;
7853   esac
7854
7855 else
7856   with_bonjour=no
7857
7858 fi
7859
7860
7861 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_bonjour" >&5
7862 $as_echo "$with_bonjour" >&6; }
7863
7864
7865 #
7866 # OpenSSL
7867 #
7868 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with OpenSSL support" >&5
7869 $as_echo_n "checking whether to build with OpenSSL support... " >&6; }
7870
7871
7872
7873 # Check whether --with-openssl was given.
7874 if test "${with_openssl+set}" = set; then :
7875   withval=$with_openssl;
7876   case $withval in
7877     yes)
7878
7879 $as_echo "#define USE_OPENSSL 1" >>confdefs.h
7880
7881       ;;
7882     no)
7883       :
7884       ;;
7885     *)
7886       as_fn_error $? "no argument expected for --with-openssl option" "$LINENO" 5
7887       ;;
7888   esac
7889
7890 else
7891   with_openssl=no
7892
7893 fi
7894
7895
7896 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_openssl" >&5
7897 $as_echo "$with_openssl" >&6; }
7898
7899
7900 #
7901 # SELinux
7902 #
7903 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with SELinux support" >&5
7904 $as_echo_n "checking whether to build with SELinux support... " >&6; }
7905
7906
7907
7908 # Check whether --with-selinux was given.
7909 if test "${with_selinux+set}" = set; then :
7910   withval=$with_selinux;
7911   case $withval in
7912     yes)
7913       :
7914       ;;
7915     no)
7916       :
7917       ;;
7918     *)
7919       as_fn_error $? "no argument expected for --with-selinux option" "$LINENO" 5
7920       ;;
7921   esac
7922
7923 else
7924   with_selinux=no
7925
7926 fi
7927
7928
7929
7930 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_selinux" >&5
7931 $as_echo "$with_selinux" >&6; }
7932
7933 #
7934 # Systemd
7935 #
7936 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with systemd support" >&5
7937 $as_echo_n "checking whether to build with systemd support... " >&6; }
7938
7939
7940
7941 # Check whether --with-systemd was given.
7942 if test "${with_systemd+set}" = set; then :
7943   withval=$with_systemd;
7944   case $withval in
7945     yes)
7946
7947 $as_echo "#define USE_SYSTEMD 1" >>confdefs.h
7948
7949       ;;
7950     no)
7951       :
7952       ;;
7953     *)
7954       as_fn_error $? "no argument expected for --with-systemd option" "$LINENO" 5
7955       ;;
7956   esac
7957
7958 else
7959   with_systemd=no
7960
7961 fi
7962
7963
7964
7965 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_systemd" >&5
7966 $as_echo "$with_systemd" >&6; }
7967
7968 #
7969 # Readline
7970 #
7971
7972
7973
7974 # Check whether --with-readline was given.
7975 if test "${with_readline+set}" = set; then :
7976   withval=$with_readline;
7977   case $withval in
7978     yes)
7979       :
7980       ;;
7981     no)
7982       :
7983       ;;
7984     *)
7985       as_fn_error $? "no argument expected for --with-readline option" "$LINENO" 5
7986       ;;
7987   esac
7988
7989 else
7990   with_readline=yes
7991
7992 fi
7993
7994
7995 # readline on MinGW has problems with backslashes in psql and other bugs.
7996 # This is particularly a problem with non-US code pages.
7997 # Therefore disable its use until we understand the cause. 2004-07-20
7998 if test "$PORTNAME" = "win32"; then
7999   if test "$with_readline" = yes; then
8000     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Readline does not work on MinGW --- disabling" >&5
8001 $as_echo "$as_me: WARNING: *** Readline does not work on MinGW --- disabling" >&2;}
8002     with_readline=no
8003   fi
8004 fi
8005
8006
8007 #
8008 # Prefer libedit
8009 #
8010
8011
8012
8013 # Check whether --with-libedit-preferred was given.
8014 if test "${with_libedit_preferred+set}" = set; then :
8015   withval=$with_libedit_preferred;
8016   case $withval in
8017     yes)
8018       :
8019       ;;
8020     no)
8021       :
8022       ;;
8023     *)
8024       as_fn_error $? "no argument expected for --with-libedit-preferred option" "$LINENO" 5
8025       ;;
8026   esac
8027
8028 else
8029   with_libedit_preferred=no
8030
8031 fi
8032
8033
8034
8035
8036 #
8037 # UUID library
8038 #
8039 # There are at least three UUID libraries in common use: the FreeBSD/NetBSD
8040 # library, the e2fsprogs libuuid (now part of util-linux-ng), and the OSSP
8041 # UUID library.  More than one of these might be present on a given platform,
8042 # so we make the user say which one she wants.
8043 #
8044
8045
8046
8047 # Check whether --with-uuid was given.
8048 if test "${with_uuid+set}" = set; then :
8049   withval=$with_uuid;
8050   case $withval in
8051     yes)
8052       as_fn_error $? "argument required for --with-uuid option" "$LINENO" 5
8053       ;;
8054     no)
8055       as_fn_error $? "argument required for --with-uuid option" "$LINENO" 5
8056       ;;
8057     *)
8058
8059       ;;
8060   esac
8061
8062 fi
8063
8064
8065 if test x"$with_uuid" = x"" ; then
8066   with_uuid=no
8067 fi
8068
8069
8070
8071 # Check whether --with-ossp-uuid was given.
8072 if test "${with_ossp_uuid+set}" = set; then :
8073   withval=$with_ossp_uuid;
8074   case $withval in
8075     yes)
8076       :
8077       ;;
8078     no)
8079       :
8080       ;;
8081     *)
8082       as_fn_error $? "no argument expected for --with-ossp-uuid option" "$LINENO" 5
8083       ;;
8084   esac
8085
8086 else
8087   with_ossp_uuid=no
8088
8089 fi
8090
8091
8092 if test "$with_ossp_uuid" = yes ; then
8093   with_uuid=ossp
8094 fi
8095
8096 if test "$with_uuid" = bsd ; then
8097
8098 $as_echo "#define HAVE_UUID_BSD 1" >>confdefs.h
8099
8100   UUID_EXTRA_OBJS="md5.o sha1.o"
8101 elif test "$with_uuid" = e2fs ; then
8102
8103 $as_echo "#define HAVE_UUID_E2FS 1" >>confdefs.h
8104
8105   UUID_EXTRA_OBJS="md5.o sha1.o"
8106 elif test "$with_uuid" = ossp ; then
8107
8108 $as_echo "#define HAVE_UUID_OSSP 1" >>confdefs.h
8109
8110   UUID_EXTRA_OBJS=""
8111 elif test "$with_uuid" = no ; then
8112   UUID_EXTRA_OBJS=""
8113 else
8114   as_fn_error $? "--with-uuid must specify one of bsd, e2fs, or ossp" "$LINENO" 5
8115 fi
8116
8117
8118
8119
8120 #
8121 # XML
8122 #
8123
8124
8125
8126 # Check whether --with-libxml was given.
8127 if test "${with_libxml+set}" = set; then :
8128   withval=$with_libxml;
8129   case $withval in
8130     yes)
8131
8132 $as_echo "#define USE_LIBXML 1" >>confdefs.h
8133
8134       ;;
8135     no)
8136       :
8137       ;;
8138     *)
8139       as_fn_error $? "no argument expected for --with-libxml option" "$LINENO" 5
8140       ;;
8141   esac
8142
8143 else
8144   with_libxml=no
8145
8146 fi
8147
8148
8149
8150 if test "$with_libxml" = yes ; then
8151   if test -z "$XML2_CONFIG"; then
8152   for ac_prog in xml2-config
8153 do
8154   # Extract the first word of "$ac_prog", so it can be a program name with args.
8155 set dummy $ac_prog; ac_word=$2
8156 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8157 $as_echo_n "checking for $ac_word... " >&6; }
8158 if ${ac_cv_path_XML2_CONFIG+:} false; then :
8159   $as_echo_n "(cached) " >&6
8160 else
8161   case $XML2_CONFIG in
8162   [\\/]* | ?:[\\/]*)
8163   ac_cv_path_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test with a path.
8164   ;;
8165   *)
8166   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8167 for as_dir in $PATH
8168 do
8169   IFS=$as_save_IFS
8170   test -z "$as_dir" && as_dir=.
8171     for ac_exec_ext in '' $ac_executable_extensions; do
8172   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8173     ac_cv_path_XML2_CONFIG="$as_dir/$ac_word$ac_exec_ext"
8174     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8175     break 2
8176   fi
8177 done
8178   done
8179 IFS=$as_save_IFS
8180
8181   ;;
8182 esac
8183 fi
8184 XML2_CONFIG=$ac_cv_path_XML2_CONFIG
8185 if test -n "$XML2_CONFIG"; then
8186   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5
8187 $as_echo "$XML2_CONFIG" >&6; }
8188 else
8189   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8190 $as_echo "no" >&6; }
8191 fi
8192
8193
8194   test -n "$XML2_CONFIG" && break
8195 done
8196
8197 else
8198   # Report the value of XML2_CONFIG in configure's output in all cases.
8199   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML2_CONFIG" >&5
8200 $as_echo_n "checking for XML2_CONFIG... " >&6; }
8201   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5
8202 $as_echo "$XML2_CONFIG" >&6; }
8203 fi
8204
8205     if test -n "$XML2_CONFIG"; then
8206     for pgac_option in `$XML2_CONFIG --cflags`; do
8207       case $pgac_option in
8208         -I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";;
8209       esac
8210     done
8211     for pgac_option in `$XML2_CONFIG --libs`; do
8212       case $pgac_option in
8213         -L*) LDFLAGS="$LDFLAGS $pgac_option";;
8214       esac
8215     done
8216   fi
8217 fi
8218
8219
8220
8221 #
8222 # XSLT
8223 #
8224
8225
8226
8227 # Check whether --with-libxslt was given.
8228 if test "${with_libxslt+set}" = set; then :
8229   withval=$with_libxslt;
8230   case $withval in
8231     yes)
8232
8233 $as_echo "#define USE_LIBXSLT 1" >>confdefs.h
8234
8235       ;;
8236     no)
8237       :
8238       ;;
8239     *)
8240       as_fn_error $? "no argument expected for --with-libxslt option" "$LINENO" 5
8241       ;;
8242   esac
8243
8244 else
8245   with_libxslt=no
8246
8247 fi
8248
8249
8250
8251
8252
8253
8254 #
8255 # tzdata
8256 #
8257
8258
8259
8260 # Check whether --with-system-tzdata was given.
8261 if test "${with_system_tzdata+set}" = set; then :
8262   withval=$with_system_tzdata;
8263   case $withval in
8264     yes)
8265       as_fn_error $? "argument required for --with-system-tzdata option" "$LINENO" 5
8266       ;;
8267     no)
8268       as_fn_error $? "argument required for --with-system-tzdata option" "$LINENO" 5
8269       ;;
8270     *)
8271
8272       ;;
8273   esac
8274
8275 fi
8276
8277
8278
8279
8280 #
8281 # Zlib
8282 #
8283
8284
8285
8286 # Check whether --with-zlib was given.
8287 if test "${with_zlib+set}" = set; then :
8288   withval=$with_zlib;
8289   case $withval in
8290     yes)
8291       :
8292       ;;
8293     no)
8294       :
8295       ;;
8296     *)
8297       as_fn_error $? "no argument expected for --with-zlib option" "$LINENO" 5
8298       ;;
8299   esac
8300
8301 else
8302   with_zlib=yes
8303
8304 fi
8305
8306
8307
8308
8309 #
8310 # Elf
8311 #
8312
8313 # Assume system is ELF if it predefines __ELF__ as 1,
8314 # otherwise believe host_os based default.
8315 case $host_os in
8316     freebsd1*|freebsd2*) elf=no;;
8317     freebsd3*|freebsd4*) elf=yes;;
8318 esac
8319
8320
8321 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
8322 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
8323 if ${ac_cv_path_GREP+:} false; then :
8324   $as_echo_n "(cached) " >&6
8325 else
8326   if test -z "$GREP"; then
8327   ac_path_GREP_found=false
8328   # Loop through the user's path and test for each of PROGNAME-LIST
8329   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8330 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
8331 do
8332   IFS=$as_save_IFS
8333   test -z "$as_dir" && as_dir=.
8334     for ac_prog in grep ggrep; do
8335     for ac_exec_ext in '' $ac_executable_extensions; do
8336       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
8337       as_fn_executable_p "$ac_path_GREP" || continue
8338 # Check for GNU ac_path_GREP and select it if it is found.
8339   # Check for GNU $ac_path_GREP
8340 case `"$ac_path_GREP" --version 2>&1` in
8341 *GNU*)
8342   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
8343 *)
8344   ac_count=0
8345   $as_echo_n 0123456789 >"conftest.in"
8346   while :
8347   do
8348     cat "conftest.in" "conftest.in" >"conftest.tmp"
8349     mv "conftest.tmp" "conftest.in"
8350     cp "conftest.in" "conftest.nl"
8351     $as_echo 'GREP' >> "conftest.nl"
8352     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
8353     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
8354     as_fn_arith $ac_count + 1 && ac_count=$as_val
8355     if test $ac_count -gt ${ac_path_GREP_max-0}; then
8356       # Best one so far, save it but keep looking for a better one
8357       ac_cv_path_GREP="$ac_path_GREP"
8358       ac_path_GREP_max=$ac_count
8359     fi
8360     # 10*(2^10) chars as input seems more than enough
8361     test $ac_count -gt 10 && break
8362   done
8363   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
8364 esac
8365
8366       $ac_path_GREP_found && break 3
8367     done
8368   done
8369   done
8370 IFS=$as_save_IFS
8371   if test -z "$ac_cv_path_GREP"; then
8372     as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
8373   fi
8374 else
8375   ac_cv_path_GREP=$GREP
8376 fi
8377
8378 fi
8379 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
8380 $as_echo "$ac_cv_path_GREP" >&6; }
8381  GREP="$ac_cv_path_GREP"
8382
8383
8384 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
8385 $as_echo_n "checking for egrep... " >&6; }
8386 if ${ac_cv_path_EGREP+:} false; then :
8387   $as_echo_n "(cached) " >&6
8388 else
8389   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
8390    then ac_cv_path_EGREP="$GREP -E"
8391    else
8392      if test -z "$EGREP"; then
8393   ac_path_EGREP_found=false
8394   # Loop through the user's path and test for each of PROGNAME-LIST
8395   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8396 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
8397 do
8398   IFS=$as_save_IFS
8399   test -z "$as_dir" && as_dir=.
8400     for ac_prog in egrep; do
8401     for ac_exec_ext in '' $ac_executable_extensions; do
8402       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
8403       as_fn_executable_p "$ac_path_EGREP" || continue
8404 # Check for GNU ac_path_EGREP and select it if it is found.
8405   # Check for GNU $ac_path_EGREP
8406 case `"$ac_path_EGREP" --version 2>&1` in
8407 *GNU*)
8408   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
8409 *)
8410   ac_count=0
8411   $as_echo_n 0123456789 >"conftest.in"
8412   while :
8413   do
8414     cat "conftest.in" "conftest.in" >"conftest.tmp"
8415     mv "conftest.tmp" "conftest.in"
8416     cp "conftest.in" "conftest.nl"
8417     $as_echo 'EGREP' >> "conftest.nl"
8418     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
8419     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
8420     as_fn_arith $ac_count + 1 && ac_count=$as_val
8421     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
8422       # Best one so far, save it but keep looking for a better one
8423       ac_cv_path_EGREP="$ac_path_EGREP"
8424       ac_path_EGREP_max=$ac_count
8425     fi
8426     # 10*(2^10) chars as input seems more than enough
8427     test $ac_count -gt 10 && break
8428   done
8429   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
8430 esac
8431
8432       $ac_path_EGREP_found && break 3
8433     done
8434   done
8435   done
8436 IFS=$as_save_IFS
8437   if test -z "$ac_cv_path_EGREP"; then
8438     as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
8439   fi
8440 else
8441   ac_cv_path_EGREP=$EGREP
8442 fi
8443
8444    fi
8445 fi
8446 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
8447 $as_echo "$ac_cv_path_EGREP" >&6; }
8448  EGREP="$ac_cv_path_EGREP"
8449
8450
8451 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8452 /* end confdefs.h.  */
8453 #if __ELF__
8454   yes
8455 #endif
8456
8457 _ACEOF
8458 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8459   $EGREP "yes" >/dev/null 2>&1; then :
8460   ELF_SYS=true
8461 else
8462   if test "X$elf" = "Xyes" ; then
8463   ELF_SYS=true
8464 else
8465   ELF_SYS=
8466 fi
8467 fi
8468 rm -f conftest*
8469
8470
8471
8472 #
8473 # Assignments
8474 #
8475
8476 CPPFLAGS="$CPPFLAGS $INCLUDES"
8477 LDFLAGS="$LDFLAGS $LIBDIRS"
8478
8479
8480
8481
8482
8483 # Check whether --with-gnu-ld was given.
8484 if test "${with_gnu_ld+set}" = set; then :
8485   withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
8486 else
8487   with_gnu_ld=no
8488 fi
8489
8490 ac_prog=ld
8491 if test "$GCC" = yes; then
8492   # Check if gcc -print-prog-name=ld gives a path.
8493   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5
8494 $as_echo_n "checking for ld used by GCC... " >&6; }
8495   case $host in
8496   *-*-mingw*)
8497     # gcc leaves a trailing carriage return which upsets mingw
8498     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
8499   *)
8500     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
8501   esac
8502   case "$ac_prog" in
8503     # Accept absolute paths.
8504     [\\/]* | [A-Za-z]:[\\/]*)
8505       re_direlt='/[^/][^/]*/\.\./'
8506       # Canonicalize the path of ld
8507       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
8508       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
8509         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
8510       done
8511       test -z "$LD" && LD="$ac_prog"
8512       ;;
8513   "")
8514     # If it fails, then pretend we aren't using GCC.
8515     ac_prog=ld
8516     ;;
8517   *)
8518     # If it is relative, then search for the first ld in PATH.
8519     with_gnu_ld=unknown
8520     ;;
8521   esac
8522 elif test "$with_gnu_ld" = yes; then
8523   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
8524 $as_echo_n "checking for GNU ld... " >&6; }
8525 else
8526   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
8527 $as_echo_n "checking for non-GNU ld... " >&6; }
8528 fi
8529 if ${ac_cv_path_LD+:} false; then :
8530   $as_echo_n "(cached) " >&6
8531 else
8532   if test -z "$LD"; then
8533   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
8534   for ac_dir in $PATH; do
8535     test -z "$ac_dir" && ac_dir=.
8536     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
8537       ac_cv_path_LD="$ac_dir/$ac_prog"
8538       # Check to see if the program is GNU ld.  I'd rather use --version,
8539       # but apparently some GNU ld's only accept -v.
8540       # Break only if it was the GNU/non-GNU ld that we prefer.
8541       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
8542         test "$with_gnu_ld" != no && break
8543       else
8544         test "$with_gnu_ld" != yes && break
8545       fi
8546     fi
8547   done
8548   IFS="$ac_save_ifs"
8549 else
8550   ac_cv_path_LD="$LD" # Let the user override the test with a path.
8551 fi
8552 fi
8553
8554 LD="$ac_cv_path_LD"
8555 if test -n "$LD"; then
8556   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
8557 $as_echo "$LD" >&6; }
8558 else
8559   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8560 $as_echo "no" >&6; }
8561 fi
8562 test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
8563 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
8564 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
8565 if ${ac_cv_prog_gnu_ld+:} false; then :
8566   $as_echo_n "(cached) " >&6
8567 else
8568   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
8569 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
8570   ac_cv_prog_gnu_ld=yes
8571 else
8572   ac_cv_prog_gnu_ld=no
8573 fi
8574 fi
8575 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gnu_ld" >&5
8576 $as_echo "$ac_cv_prog_gnu_ld" >&6; }
8577 with_gnu_ld=$ac_cv_prog_gnu_ld
8578
8579
8580
8581
8582 if test -n "$ac_tool_prefix"; then
8583   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
8584 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
8585 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8586 $as_echo_n "checking for $ac_word... " >&6; }
8587 if ${ac_cv_prog_RANLIB+:} false; then :
8588   $as_echo_n "(cached) " >&6
8589 else
8590   if test -n "$RANLIB"; then
8591   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
8592 else
8593 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8594 for as_dir in $PATH
8595 do
8596   IFS=$as_save_IFS
8597   test -z "$as_dir" && as_dir=.
8598     for ac_exec_ext in '' $ac_executable_extensions; do
8599   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8600     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
8601     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8602     break 2
8603   fi
8604 done
8605   done
8606 IFS=$as_save_IFS
8607
8608 fi
8609 fi
8610 RANLIB=$ac_cv_prog_RANLIB
8611 if test -n "$RANLIB"; then
8612   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
8613 $as_echo "$RANLIB" >&6; }
8614 else
8615   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8616 $as_echo "no" >&6; }
8617 fi
8618
8619
8620 fi
8621 if test -z "$ac_cv_prog_RANLIB"; then
8622   ac_ct_RANLIB=$RANLIB
8623   # Extract the first word of "ranlib", so it can be a program name with args.
8624 set dummy ranlib; ac_word=$2
8625 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8626 $as_echo_n "checking for $ac_word... " >&6; }
8627 if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
8628   $as_echo_n "(cached) " >&6
8629 else
8630   if test -n "$ac_ct_RANLIB"; then
8631   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
8632 else
8633 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8634 for as_dir in $PATH
8635 do
8636   IFS=$as_save_IFS
8637   test -z "$as_dir" && as_dir=.
8638     for ac_exec_ext in '' $ac_executable_extensions; do
8639   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8640     ac_cv_prog_ac_ct_RANLIB="ranlib"
8641     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8642     break 2
8643   fi
8644 done
8645   done
8646 IFS=$as_save_IFS
8647
8648 fi
8649 fi
8650 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
8651 if test -n "$ac_ct_RANLIB"; then
8652   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
8653 $as_echo "$ac_ct_RANLIB" >&6; }
8654 else
8655   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8656 $as_echo "no" >&6; }
8657 fi
8658
8659   if test "x$ac_ct_RANLIB" = x; then
8660     RANLIB=":"
8661   else
8662     case $cross_compiling:$ac_tool_warned in
8663 yes:)
8664 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8665 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8666 ac_tool_warned=yes ;;
8667 esac
8668     RANLIB=$ac_ct_RANLIB
8669   fi
8670 else
8671   RANLIB="$ac_cv_prog_RANLIB"
8672 fi
8673
8674
8675   if test -n "$ac_tool_prefix"; then
8676   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
8677 set dummy ${ac_tool_prefix}strip; ac_word=$2
8678 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8679 $as_echo_n "checking for $ac_word... " >&6; }
8680 if ${ac_cv_prog_STRIP+:} false; then :
8681   $as_echo_n "(cached) " >&6
8682 else
8683   if test -n "$STRIP"; then
8684   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
8685 else
8686 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8687 for as_dir in $PATH
8688 do
8689   IFS=$as_save_IFS
8690   test -z "$as_dir" && as_dir=.
8691     for ac_exec_ext in '' $ac_executable_extensions; do
8692   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8693     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
8694     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8695     break 2
8696   fi
8697 done
8698   done
8699 IFS=$as_save_IFS
8700
8701 fi
8702 fi
8703 STRIP=$ac_cv_prog_STRIP
8704 if test -n "$STRIP"; then
8705   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
8706 $as_echo "$STRIP" >&6; }
8707 else
8708   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8709 $as_echo "no" >&6; }
8710 fi
8711
8712
8713 fi
8714 if test -z "$ac_cv_prog_STRIP"; then
8715   ac_ct_STRIP=$STRIP
8716   # Extract the first word of "strip", so it can be a program name with args.
8717 set dummy strip; ac_word=$2
8718 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8719 $as_echo_n "checking for $ac_word... " >&6; }
8720 if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
8721   $as_echo_n "(cached) " >&6
8722 else
8723   if test -n "$ac_ct_STRIP"; then
8724   ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
8725 else
8726 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8727 for as_dir in $PATH
8728 do
8729   IFS=$as_save_IFS
8730   test -z "$as_dir" && as_dir=.
8731     for ac_exec_ext in '' $ac_executable_extensions; do
8732   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8733     ac_cv_prog_ac_ct_STRIP="strip"
8734     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8735     break 2
8736   fi
8737 done
8738   done
8739 IFS=$as_save_IFS
8740
8741 fi
8742 fi
8743 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
8744 if test -n "$ac_ct_STRIP"; then
8745   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
8746 $as_echo "$ac_ct_STRIP" >&6; }
8747 else
8748   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8749 $as_echo "no" >&6; }
8750 fi
8751
8752   if test "x$ac_ct_STRIP" = x; then
8753     STRIP=":"
8754   else
8755     case $cross_compiling:$ac_tool_warned in
8756 yes:)
8757 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8758 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8759 ac_tool_warned=yes ;;
8760 esac
8761     STRIP=$ac_ct_STRIP
8762   fi
8763 else
8764   STRIP="$ac_cv_prog_STRIP"
8765 fi
8766
8767
8768   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is possible to strip libraries" >&5
8769 $as_echo_n "checking whether it is possible to strip libraries... " >&6; }
8770   if test x"$STRIP" != x"" && "$STRIP" -V 2>&1 | grep "GNU strip" >/dev/null; then
8771     STRIP_STATIC_LIB="$STRIP -x"
8772     STRIP_SHARED_LIB="$STRIP --strip-unneeded"
8773     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
8774 $as_echo "yes" >&6; }
8775   else
8776     case $host_os in
8777       darwin*)
8778         STRIP="$STRIP -x"
8779         STRIP_STATIC_LIB=$STRIP
8780         STRIP_SHARED_LIB=$STRIP
8781         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
8782 $as_echo "yes" >&6; }
8783         ;;
8784       *)
8785         STRIP_STATIC_LIB=:
8786         STRIP_SHARED_LIB=:
8787         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8788 $as_echo "no" >&6; }
8789         ;;
8790     esac
8791   fi
8792
8793
8794
8795 if test -n "$ac_tool_prefix"; then
8796   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
8797 set dummy ${ac_tool_prefix}ar; ac_word=$2
8798 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8799 $as_echo_n "checking for $ac_word... " >&6; }
8800 if ${ac_cv_prog_AR+:} false; then :
8801   $as_echo_n "(cached) " >&6
8802 else
8803   if test -n "$AR"; then
8804   ac_cv_prog_AR="$AR" # Let the user override the test.
8805 else
8806 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8807 for as_dir in $PATH
8808 do
8809   IFS=$as_save_IFS
8810   test -z "$as_dir" && as_dir=.
8811     for ac_exec_ext in '' $ac_executable_extensions; do
8812   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8813     ac_cv_prog_AR="${ac_tool_prefix}ar"
8814     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8815     break 2
8816   fi
8817 done
8818   done
8819 IFS=$as_save_IFS
8820
8821 fi
8822 fi
8823 AR=$ac_cv_prog_AR
8824 if test -n "$AR"; then
8825   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
8826 $as_echo "$AR" >&6; }
8827 else
8828   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8829 $as_echo "no" >&6; }
8830 fi
8831
8832
8833 fi
8834 if test -z "$ac_cv_prog_AR"; then
8835   ac_ct_AR=$AR
8836   # Extract the first word of "ar", so it can be a program name with args.
8837 set dummy ar; ac_word=$2
8838 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8839 $as_echo_n "checking for $ac_word... " >&6; }
8840 if ${ac_cv_prog_ac_ct_AR+:} false; then :
8841   $as_echo_n "(cached) " >&6
8842 else
8843   if test -n "$ac_ct_AR"; then
8844   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
8845 else
8846 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8847 for as_dir in $PATH
8848 do
8849   IFS=$as_save_IFS
8850   test -z "$as_dir" && as_dir=.
8851     for ac_exec_ext in '' $ac_executable_extensions; do
8852   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8853     ac_cv_prog_ac_ct_AR="ar"
8854     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8855     break 2
8856   fi
8857 done
8858   done
8859 IFS=$as_save_IFS
8860
8861 fi
8862 fi
8863 ac_ct_AR=$ac_cv_prog_ac_ct_AR
8864 if test -n "$ac_ct_AR"; then
8865   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
8866 $as_echo "$ac_ct_AR" >&6; }
8867 else
8868   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8869 $as_echo "no" >&6; }
8870 fi
8871
8872   if test "x$ac_ct_AR" = x; then
8873     AR="ar"
8874   else
8875     case $cross_compiling:$ac_tool_warned in
8876 yes:)
8877 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8878 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8879 ac_tool_warned=yes ;;
8880 esac
8881     AR=$ac_ct_AR
8882   fi
8883 else
8884   AR="$ac_cv_prog_AR"
8885 fi
8886
8887 if test "$PORTNAME" = "win32"; then
8888   if test -n "$ac_tool_prefix"; then
8889   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
8890 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
8891 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8892 $as_echo_n "checking for $ac_word... " >&6; }
8893 if ${ac_cv_prog_DLLTOOL+:} false; then :
8894   $as_echo_n "(cached) " >&6
8895 else
8896   if test -n "$DLLTOOL"; then
8897   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
8898 else
8899 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8900 for as_dir in $PATH
8901 do
8902   IFS=$as_save_IFS
8903   test -z "$as_dir" && as_dir=.
8904     for ac_exec_ext in '' $ac_executable_extensions; do
8905   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8906     ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
8907     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8908     break 2
8909   fi
8910 done
8911   done
8912 IFS=$as_save_IFS
8913
8914 fi
8915 fi
8916 DLLTOOL=$ac_cv_prog_DLLTOOL
8917 if test -n "$DLLTOOL"; then
8918   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
8919 $as_echo "$DLLTOOL" >&6; }
8920 else
8921   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8922 $as_echo "no" >&6; }
8923 fi
8924
8925
8926 fi
8927 if test -z "$ac_cv_prog_DLLTOOL"; then
8928   ac_ct_DLLTOOL=$DLLTOOL
8929   # Extract the first word of "dlltool", so it can be a program name with args.
8930 set dummy dlltool; ac_word=$2
8931 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8932 $as_echo_n "checking for $ac_word... " >&6; }
8933 if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
8934   $as_echo_n "(cached) " >&6
8935 else
8936   if test -n "$ac_ct_DLLTOOL"; then
8937   ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
8938 else
8939 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8940 for as_dir in $PATH
8941 do
8942   IFS=$as_save_IFS
8943   test -z "$as_dir" && as_dir=.
8944     for ac_exec_ext in '' $ac_executable_extensions; do
8945   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8946     ac_cv_prog_ac_ct_DLLTOOL="dlltool"
8947     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8948     break 2
8949   fi
8950 done
8951   done
8952 IFS=$as_save_IFS
8953
8954 fi
8955 fi
8956 ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
8957 if test -n "$ac_ct_DLLTOOL"; then
8958   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
8959 $as_echo "$ac_ct_DLLTOOL" >&6; }
8960 else
8961   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8962 $as_echo "no" >&6; }
8963 fi
8964
8965   if test "x$ac_ct_DLLTOOL" = x; then
8966     DLLTOOL="dlltool"
8967   else
8968     case $cross_compiling:$ac_tool_warned in
8969 yes:)
8970 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8971 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8972 ac_tool_warned=yes ;;
8973 esac
8974     DLLTOOL=$ac_ct_DLLTOOL
8975   fi
8976 else
8977   DLLTOOL="$ac_cv_prog_DLLTOOL"
8978 fi
8979
8980   if test -n "$ac_tool_prefix"; then
8981   # Extract the first word of "${ac_tool_prefix}dllwrap", so it can be a program name with args.
8982 set dummy ${ac_tool_prefix}dllwrap; ac_word=$2
8983 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8984 $as_echo_n "checking for $ac_word... " >&6; }
8985 if ${ac_cv_prog_DLLWRAP+:} false; then :
8986   $as_echo_n "(cached) " >&6
8987 else
8988   if test -n "$DLLWRAP"; then
8989   ac_cv_prog_DLLWRAP="$DLLWRAP" # Let the user override the test.
8990 else
8991 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8992 for as_dir in $PATH
8993 do
8994   IFS=$as_save_IFS
8995   test -z "$as_dir" && as_dir=.
8996     for ac_exec_ext in '' $ac_executable_extensions; do
8997   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8998     ac_cv_prog_DLLWRAP="${ac_tool_prefix}dllwrap"
8999     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9000     break 2
9001   fi
9002 done
9003   done
9004 IFS=$as_save_IFS
9005
9006 fi
9007 fi
9008 DLLWRAP=$ac_cv_prog_DLLWRAP
9009 if test -n "$DLLWRAP"; then
9010   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLWRAP" >&5
9011 $as_echo "$DLLWRAP" >&6; }
9012 else
9013   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9014 $as_echo "no" >&6; }
9015 fi
9016
9017
9018 fi
9019 if test -z "$ac_cv_prog_DLLWRAP"; then
9020   ac_ct_DLLWRAP=$DLLWRAP
9021   # Extract the first word of "dllwrap", so it can be a program name with args.
9022 set dummy dllwrap; ac_word=$2
9023 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9024 $as_echo_n "checking for $ac_word... " >&6; }
9025 if ${ac_cv_prog_ac_ct_DLLWRAP+:} false; then :
9026   $as_echo_n "(cached) " >&6
9027 else
9028   if test -n "$ac_ct_DLLWRAP"; then
9029   ac_cv_prog_ac_ct_DLLWRAP="$ac_ct_DLLWRAP" # Let the user override the test.
9030 else
9031 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9032 for as_dir in $PATH
9033 do
9034   IFS=$as_save_IFS
9035   test -z "$as_dir" && as_dir=.
9036     for ac_exec_ext in '' $ac_executable_extensions; do
9037   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9038     ac_cv_prog_ac_ct_DLLWRAP="dllwrap"
9039     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9040     break 2
9041   fi
9042 done
9043   done
9044 IFS=$as_save_IFS
9045
9046 fi
9047 fi
9048 ac_ct_DLLWRAP=$ac_cv_prog_ac_ct_DLLWRAP
9049 if test -n "$ac_ct_DLLWRAP"; then
9050   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLWRAP" >&5
9051 $as_echo "$ac_ct_DLLWRAP" >&6; }
9052 else
9053   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9054 $as_echo "no" >&6; }
9055 fi
9056
9057   if test "x$ac_ct_DLLWRAP" = x; then
9058     DLLWRAP="dllwrap"
9059   else
9060     case $cross_compiling:$ac_tool_warned in
9061 yes:)
9062 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
9063 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
9064 ac_tool_warned=yes ;;
9065 esac
9066     DLLWRAP=$ac_ct_DLLWRAP
9067   fi
9068 else
9069   DLLWRAP="$ac_cv_prog_DLLWRAP"
9070 fi
9071
9072   if test -n "$ac_tool_prefix"; then
9073   # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
9074 set dummy ${ac_tool_prefix}windres; ac_word=$2
9075 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9076 $as_echo_n "checking for $ac_word... " >&6; }
9077 if ${ac_cv_prog_WINDRES+:} false; then :
9078   $as_echo_n "(cached) " >&6
9079 else
9080   if test -n "$WINDRES"; then
9081   ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
9082 else
9083 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9084 for as_dir in $PATH
9085 do
9086   IFS=$as_save_IFS
9087   test -z "$as_dir" && as_dir=.
9088     for ac_exec_ext in '' $ac_executable_extensions; do
9089   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9090     ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
9091     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9092     break 2
9093   fi
9094 done
9095   done
9096 IFS=$as_save_IFS
9097
9098 fi
9099 fi
9100 WINDRES=$ac_cv_prog_WINDRES
9101 if test -n "$WINDRES"; then
9102   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5
9103 $as_echo "$WINDRES" >&6; }
9104 else
9105   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9106 $as_echo "no" >&6; }
9107 fi
9108
9109
9110 fi
9111 if test -z "$ac_cv_prog_WINDRES"; then
9112   ac_ct_WINDRES=$WINDRES
9113   # Extract the first word of "windres", so it can be a program name with args.
9114 set dummy windres; ac_word=$2
9115 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9116 $as_echo_n "checking for $ac_word... " >&6; }
9117 if ${ac_cv_prog_ac_ct_WINDRES+:} false; then :
9118   $as_echo_n "(cached) " >&6
9119 else
9120   if test -n "$ac_ct_WINDRES"; then
9121   ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
9122 else
9123 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9124 for as_dir in $PATH
9125 do
9126   IFS=$as_save_IFS
9127   test -z "$as_dir" && as_dir=.
9128     for ac_exec_ext in '' $ac_executable_extensions; do
9129   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9130     ac_cv_prog_ac_ct_WINDRES="windres"
9131     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9132     break 2
9133   fi
9134 done
9135   done
9136 IFS=$as_save_IFS
9137
9138 fi
9139 fi
9140 ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
9141 if test -n "$ac_ct_WINDRES"; then
9142   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5
9143 $as_echo "$ac_ct_WINDRES" >&6; }
9144 else
9145   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9146 $as_echo "no" >&6; }
9147 fi
9148
9149   if test "x$ac_ct_WINDRES" = x; then
9150     WINDRES="windres"
9151   else
9152     case $cross_compiling:$ac_tool_warned in
9153 yes:)
9154 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
9155 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
9156 ac_tool_warned=yes ;;
9157 esac
9158     WINDRES=$ac_ct_WINDRES
9159   fi
9160 else
9161   WINDRES="$ac_cv_prog_WINDRES"
9162 fi
9163
9164 fi
9165
9166 # Find a good install program.  We prefer a C program (faster),
9167 # so one script is as good as another.  But avoid the broken or
9168 # incompatible versions:
9169 # SysV /etc/install, /usr/sbin/install
9170 # SunOS /usr/etc/install
9171 # IRIX /sbin/install
9172 # AIX /bin/install
9173 # AmigaOS /C/install, which installs bootblocks on floppy discs
9174 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
9175 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
9176 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
9177 # OS/2's system install, which has a completely different semantic
9178 # ./install, which can be erroneously created by make from ./install.sh.
9179 # Reject install programs that cannot install multiple files.
9180 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
9181 $as_echo_n "checking for a BSD-compatible install... " >&6; }
9182 if test -z "$INSTALL"; then
9183 if ${ac_cv_path_install+:} false; then :
9184   $as_echo_n "(cached) " >&6
9185 else
9186   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9187 for as_dir in $PATH
9188 do
9189   IFS=$as_save_IFS
9190   test -z "$as_dir" && as_dir=.
9191     # Account for people who put trailing slashes in PATH elements.
9192 case $as_dir/ in #((
9193   ./ | .// | /[cC]/* | \
9194   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
9195   ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
9196   /usr/ucb/* ) ;;
9197   *)
9198     # OSF1 and SCO ODT 3.0 have their own names for install.
9199     # Don't use installbsd from OSF since it installs stuff as root
9200     # by default.
9201     for ac_prog in ginstall scoinst install; do
9202       for ac_exec_ext in '' $ac_executable_extensions; do
9203         if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
9204           if test $ac_prog = install &&
9205             grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
9206             # AIX install.  It has an incompatible calling convention.
9207             :
9208           elif test $ac_prog = install &&
9209             grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
9210             # program-specific install script used by HP pwplus--don't use.
9211             :
9212           else
9213             rm -rf conftest.one conftest.two conftest.dir
9214             echo one > conftest.one
9215             echo two > conftest.two
9216             mkdir conftest.dir
9217             if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
9218               test -s conftest.one && test -s conftest.two &&
9219               test -s conftest.dir/conftest.one &&
9220               test -s conftest.dir/conftest.two
9221             then
9222               ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
9223               break 3
9224             fi
9225           fi
9226         fi
9227       done
9228     done
9229     ;;
9230 esac
9231
9232   done
9233 IFS=$as_save_IFS
9234
9235 rm -rf conftest.one conftest.two conftest.dir
9236
9237 fi
9238   if test "${ac_cv_path_install+set}" = set; then
9239     INSTALL=$ac_cv_path_install
9240   else
9241     # As a last resort, use the slow shell script.  Don't cache a
9242     # value for INSTALL within a source directory, because that will
9243     # break other packages using the cache if that directory is
9244     # removed, or if the value is a relative name.
9245     INSTALL=$ac_install_sh
9246   fi
9247 fi
9248 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
9249 $as_echo "$INSTALL" >&6; }
9250
9251 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
9252 # It thinks the first close brace ends the variable substitution.
9253 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
9254
9255 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
9256
9257 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
9258
9259 # When Autoconf chooses install-sh as install program it tries to generate
9260 # a relative path to it in each makefile where it substitutes it. This clashes
9261 # with our Makefile.global concept. This workaround helps.
9262 case $INSTALL in
9263   *install-sh*) install_bin='';;
9264   *) install_bin=$INSTALL;;
9265 esac
9266
9267
9268 if test -z "$TAR"; then
9269   for ac_prog in tar
9270 do
9271   # Extract the first word of "$ac_prog", so it can be a program name with args.
9272 set dummy $ac_prog; ac_word=$2
9273 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9274 $as_echo_n "checking for $ac_word... " >&6; }
9275 if ${ac_cv_path_TAR+:} false; then :
9276   $as_echo_n "(cached) " >&6
9277 else
9278   case $TAR in
9279   [\\/]* | ?:[\\/]*)
9280   ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
9281   ;;
9282   *)
9283   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9284 for as_dir in $PATH
9285 do
9286   IFS=$as_save_IFS
9287   test -z "$as_dir" && as_dir=.
9288     for ac_exec_ext in '' $ac_executable_extensions; do
9289   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9290     ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext"
9291     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9292     break 2
9293   fi
9294 done
9295   done
9296 IFS=$as_save_IFS
9297
9298   ;;
9299 esac
9300 fi
9301 TAR=$ac_cv_path_TAR
9302 if test -n "$TAR"; then
9303   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5
9304 $as_echo "$TAR" >&6; }
9305 else
9306   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9307 $as_echo "no" >&6; }
9308 fi
9309
9310
9311   test -n "$TAR" && break
9312 done
9313
9314 else
9315   # Report the value of TAR in configure's output in all cases.
9316   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TAR" >&5
9317 $as_echo_n "checking for TAR... " >&6; }
9318   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5
9319 $as_echo "$TAR" >&6; }
9320 fi
9321
9322 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
9323 $as_echo_n "checking whether ln -s works... " >&6; }
9324 LN_S=$as_ln_s
9325 if test "$LN_S" = "ln -s"; then
9326   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
9327 $as_echo "yes" >&6; }
9328 else
9329   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
9330 $as_echo "no, using $LN_S" >&6; }
9331 fi
9332
9333 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
9334 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
9335 if test -z "$MKDIR_P"; then
9336   if ${ac_cv_path_mkdir+:} false; then :
9337   $as_echo_n "(cached) " >&6
9338 else
9339   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9340 for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
9341 do
9342   IFS=$as_save_IFS
9343   test -z "$as_dir" && as_dir=.
9344     for ac_prog in mkdir gmkdir; do
9345          for ac_exec_ext in '' $ac_executable_extensions; do
9346            as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
9347            case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
9348              'mkdir (GNU coreutils) '* | \
9349              'mkdir (coreutils) '* | \
9350              'mkdir (fileutils) '4.1*)
9351                ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
9352                break 3;;
9353            esac
9354          done
9355        done
9356   done
9357 IFS=$as_save_IFS
9358
9359 fi
9360
9361   test -d ./--version && rmdir ./--version
9362   if test "${ac_cv_path_mkdir+set}" = set; then
9363     MKDIR_P="$ac_cv_path_mkdir -p"
9364   else
9365     # As a last resort, use the slow shell script.  Don't cache a
9366     # value for MKDIR_P within a source directory, because that will
9367     # break other packages using the cache if that directory is
9368     # removed, or if the value is a relative name.
9369     MKDIR_P="$ac_install_sh -d"
9370   fi
9371 fi
9372 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
9373 $as_echo "$MKDIR_P" >&6; }
9374
9375 # When Autoconf chooses install-sh as mkdir -p program it tries to generate
9376 # a relative path to it in each makefile where it substitutes it. This clashes
9377 # with our Makefile.global concept. This workaround helps.
9378 case $MKDIR_P in
9379   *install-sh*) MKDIR_P='\${SHELL} \${top_srcdir}/config/install-sh -c -d';;
9380 esac
9381
9382 if test -z "$BISON"; then
9383   for ac_prog in bison
9384 do
9385   # Extract the first word of "$ac_prog", so it can be a program name with args.
9386 set dummy $ac_prog; ac_word=$2
9387 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9388 $as_echo_n "checking for $ac_word... " >&6; }
9389 if ${ac_cv_path_BISON+:} false; then :
9390   $as_echo_n "(cached) " >&6
9391 else
9392   case $BISON in
9393   [\\/]* | ?:[\\/]*)
9394   ac_cv_path_BISON="$BISON" # Let the user override the test with a path.
9395   ;;
9396   *)
9397   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9398 for as_dir in $PATH
9399 do
9400   IFS=$as_save_IFS
9401   test -z "$as_dir" && as_dir=.
9402     for ac_exec_ext in '' $ac_executable_extensions; do
9403   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9404     ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext"
9405     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9406     break 2
9407   fi
9408 done
9409   done
9410 IFS=$as_save_IFS
9411
9412   ;;
9413 esac
9414 fi
9415 BISON=$ac_cv_path_BISON
9416 if test -n "$BISON"; then
9417   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5
9418 $as_echo "$BISON" >&6; }
9419 else
9420   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9421 $as_echo "no" >&6; }
9422 fi
9423
9424
9425   test -n "$BISON" && break
9426 done
9427
9428 else
9429   # Report the value of BISON in configure's output in all cases.
9430   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BISON" >&5
9431 $as_echo_n "checking for BISON... " >&6; }
9432   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5
9433 $as_echo "$BISON" >&6; }
9434 fi
9435
9436
9437 if test "$BISON"; then
9438   pgac_bison_version=`$BISON --version 2>/dev/null | sed q`
9439   { $as_echo "$as_me:${as_lineno-$LINENO}: using $pgac_bison_version" >&5
9440 $as_echo "$as_me: using $pgac_bison_version" >&6;}
9441   if echo "$pgac_bison_version" | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'
9442   then
9443     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9444 *** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
9445 *** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&5
9446 $as_echo "$as_me: WARNING:
9447 *** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
9448 *** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&2;}
9449     BISON=""
9450   fi
9451   # Bison >=3.0 issues warnings about %name-prefix="base_yy", instead
9452   # of the now preferred %name-prefix "base_yy", but the latter
9453   # doesn't work with Bison 2.3 or less.  So for now we silence the
9454   # deprecation warnings.
9455   if echo "$pgac_bison_version" | $AWK '{ if ($4 >= 3) exit 0; else exit 1;}'
9456   then
9457     BISONFLAGS="$BISONFLAGS -Wno-deprecated"
9458   fi
9459 fi
9460
9461 if test -z "$BISON"; then
9462   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9463 *** Without Bison you will not be able to build PostgreSQL from Git nor
9464 *** change any of the parser definition files.  You can obtain Bison from
9465 *** a GNU mirror site.  (If you are using the official distribution of
9466 *** PostgreSQL then you do not need to worry about this, because the Bison
9467 *** output is pre-generated.)" >&5
9468 $as_echo "$as_me: WARNING:
9469 *** Without Bison you will not be able to build PostgreSQL from Git nor
9470 *** change any of the parser definition files.  You can obtain Bison from
9471 *** a GNU mirror site.  (If you are using the official distribution of
9472 *** PostgreSQL then you do not need to worry about this, because the Bison
9473 *** output is pre-generated.)" >&2;}
9474 fi
9475
9476
9477 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flex" >&5
9478 $as_echo_n "checking for flex... " >&6; }
9479 if ${pgac_cv_path_flex+:} false; then :
9480   $as_echo_n "(cached) " >&6
9481 else
9482   # Let the user override the test
9483 if test -n "$FLEX"; then
9484   pgac_cv_path_flex=$FLEX
9485 else
9486   pgac_save_IFS=$IFS
9487   IFS=$PATH_SEPARATOR
9488   for pgac_dir in $PATH; do
9489     IFS=$pgac_save_IFS
9490     if test -z "$pgac_dir" || test x"$pgac_dir" = x"."; then
9491       pgac_dir=`pwd`
9492     fi
9493     for pgac_prog in flex lex; do
9494       pgac_candidate="$pgac_dir/$pgac_prog"
9495       if test -f "$pgac_candidate" \
9496         && $pgac_candidate --version </dev/null >/dev/null 2>&1
9497       then
9498         echo '%%'  > conftest.l
9499         if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
9500           pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
9501           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;}'
9502           then
9503             pgac_cv_path_flex=$pgac_candidate
9504             break 2
9505           else
9506             { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9507 *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
9508 *** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&5
9509 $as_echo "$as_me: WARNING:
9510 *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
9511 *** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&2;}
9512           fi
9513         fi
9514       fi
9515     done
9516   done
9517   rm -f conftest.l lex.yy.c
9518   : ${pgac_cv_path_flex=no}
9519 fi
9520
9521 fi
9522 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_path_flex" >&5
9523 $as_echo "$pgac_cv_path_flex" >&6; }
9524 if test x"$pgac_cv_path_flex" = x"no"; then
9525   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9526 *** Without Flex you will not be able to build PostgreSQL from Git nor
9527 *** change any of the scanner definition files.  You can obtain Flex from
9528 *** a GNU mirror site.  (If you are using the official distribution of
9529 *** PostgreSQL then you do not need to worry about this because the Flex
9530 *** output is pre-generated.)" >&5
9531 $as_echo "$as_me: WARNING:
9532 *** Without Flex you will not be able to build PostgreSQL from Git nor
9533 *** change any of the scanner definition files.  You can obtain Flex from
9534 *** a GNU mirror site.  (If you are using the official distribution of
9535 *** PostgreSQL then you do not need to worry about this because the Flex
9536 *** output is pre-generated.)" >&2;}
9537
9538   FLEX=
9539 else
9540   FLEX=$pgac_cv_path_flex
9541   pgac_flex_version=`$FLEX --version 2>/dev/null`
9542   { $as_echo "$as_me:${as_lineno-$LINENO}: using $pgac_flex_version" >&5
9543 $as_echo "$as_me: using $pgac_flex_version" >&6;}
9544 fi
9545
9546
9547
9548
9549
9550 if test -z "$PERL"; then
9551   for ac_prog in perl
9552 do
9553   # Extract the first word of "$ac_prog", so it can be a program name with args.
9554 set dummy $ac_prog; ac_word=$2
9555 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9556 $as_echo_n "checking for $ac_word... " >&6; }
9557 if ${ac_cv_path_PERL+:} false; then :
9558   $as_echo_n "(cached) " >&6
9559 else
9560   case $PERL in
9561   [\\/]* | ?:[\\/]*)
9562   ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
9563   ;;
9564   *)
9565   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9566 for as_dir in $PATH
9567 do
9568   IFS=$as_save_IFS
9569   test -z "$as_dir" && as_dir=.
9570     for ac_exec_ext in '' $ac_executable_extensions; do
9571   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9572     ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
9573     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9574     break 2
9575   fi
9576 done
9577   done
9578 IFS=$as_save_IFS
9579
9580   ;;
9581 esac
9582 fi
9583 PERL=$ac_cv_path_PERL
9584 if test -n "$PERL"; then
9585   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
9586 $as_echo "$PERL" >&6; }
9587 else
9588   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9589 $as_echo "no" >&6; }
9590 fi
9591
9592
9593   test -n "$PERL" && break
9594 done
9595
9596 else
9597   # Report the value of PERL in configure's output in all cases.
9598   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PERL" >&5
9599 $as_echo_n "checking for PERL... " >&6; }
9600   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
9601 $as_echo "$PERL" >&6; }
9602 fi
9603
9604
9605 if test "$PERL"; then
9606   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'`
9607   { $as_echo "$as_me:${as_lineno-$LINENO}: using perl $pgac_perl_version" >&5
9608 $as_echo "$as_me: using perl $pgac_perl_version" >&6;}
9609   if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \
9610     $AWK '{ if ($1 == 5 && $2 >= 8) exit 1; else exit 0;}'
9611   then
9612     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9613 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
9614 *** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&5
9615 $as_echo "$as_me: WARNING:
9616 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
9617 *** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&2;}
9618     PERL=""
9619   fi
9620 fi
9621
9622 if test -z "$PERL"; then
9623   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9624 *** Without Perl you will not be able to build PostgreSQL from Git.
9625 *** You can obtain Perl from any CPAN mirror site.
9626 *** (If you are using the official distribution of PostgreSQL then you do not
9627 *** need to worry about this, because the Perl output is pre-generated.)" >&5
9628 $as_echo "$as_me: WARNING:
9629 *** Without Perl you will not be able to build PostgreSQL from Git.
9630 *** You can obtain Perl from any CPAN mirror site.
9631 *** (If you are using the official distribution of PostgreSQL then you do not
9632 *** need to worry about this, because the Perl output is pre-generated.)" >&2;}
9633 fi
9634
9635 if test "$with_perl" = yes; then
9636   if test -z "$PERL"; then
9637     as_fn_error $? "Perl not found" "$LINENO" 5
9638   fi
9639
9640 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl archlibexp" >&5
9641 $as_echo_n "checking for Perl archlibexp... " >&6; }
9642 perl_archlibexp=`$PERL -MConfig -e 'print $Config{archlibexp}'`
9643 test "$PORTNAME" = "win32" && perl_archlibexp=`echo $perl_archlibexp | sed 's,\\\\,/,g'`
9644 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_archlibexp" >&5
9645 $as_echo "$perl_archlibexp" >&6; }
9646 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl privlibexp" >&5
9647 $as_echo_n "checking for Perl privlibexp... " >&6; }
9648 perl_privlibexp=`$PERL -MConfig -e 'print $Config{privlibexp}'`
9649 test "$PORTNAME" = "win32" && perl_privlibexp=`echo $perl_privlibexp | sed 's,\\\\,/,g'`
9650 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_privlibexp" >&5
9651 $as_echo "$perl_privlibexp" >&6; }
9652 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl useshrplib" >&5
9653 $as_echo_n "checking for Perl useshrplib... " >&6; }
9654 perl_useshrplib=`$PERL -MConfig -e 'print $Config{useshrplib}'`
9655 test "$PORTNAME" = "win32" && perl_useshrplib=`echo $perl_useshrplib | sed 's,\\\\,/,g'`
9656 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_useshrplib" >&5
9657 $as_echo "$perl_useshrplib" >&6; }
9658   if test "$perl_useshrplib" != yes && test "$perl_useshrplib" != true; then
9659     as_fn_error $? "cannot build PL/Perl because libperl is not a shared library
9660 You might have to rebuild your Perl installation.  Refer to the
9661 documentation for details.  Use --without-perl to disable building
9662 PL/Perl." "$LINENO" 5
9663   fi
9664   # On most platforms, archlibexp is also where the Perl include files live ...
9665   perl_includespec="-I$perl_archlibexp/CORE"
9666   # ... but on newer macOS versions, we must use -iwithsysroot to look
9667   # under $PG_SYSROOT
9668   if test \! -f "$perl_archlibexp/CORE/perl.h" ; then
9669     if test -f "$PG_SYSROOT$perl_archlibexp/CORE/perl.h" ; then
9670       perl_includespec="-iwithsysroot $perl_archlibexp/CORE"
9671     fi
9672   fi
9673
9674 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLAGS recommended by Perl" >&5
9675 $as_echo_n "checking for CFLAGS recommended by Perl... " >&6; }
9676 perl_ccflags=`$PERL -MConfig -e 'print $Config{ccflags}'`
9677 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_ccflags" >&5
9678 $as_echo "$perl_ccflags" >&6; }
9679 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLAGS to compile embedded Perl" >&5
9680 $as_echo_n "checking for CFLAGS to compile embedded Perl... " >&6; }
9681 perl_embed_ccflags=`$PERL -MConfig -e 'foreach $f (split(" ",$Config{ccflags})) {print $f, " " if ($f =~ /^-D[^_]/ || $f =~ /^-D_USE_32BIT_TIME_T/)}'`
9682 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_embed_ccflags" >&5
9683 $as_echo "$perl_embed_ccflags" >&6; }
9684
9685
9686 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flags to link embedded Perl" >&5
9687 $as_echo_n "checking for flags to link embedded Perl... " >&6; }
9688 if test "$PORTNAME" = "win32" ; then
9689         perl_lib=`basename $perl_archlibexp/CORE/perl[5-9]*.lib .lib`
9690         if test -e "$perl_archlibexp/CORE/$perl_lib.lib"; then
9691                 perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
9692         else
9693                 perl_lib=`basename $perl_archlibexp/CORE/libperl[5-9]*.a .a | sed 's/^lib//'`
9694                 if test -e "$perl_archlibexp/CORE/lib$perl_lib.a"; then
9695                         perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
9696                 fi
9697         fi
9698 else
9699         pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
9700         pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
9701         perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e "s/ -arch [-a-zA-Z0-9_]*//g"`
9702 fi
9703 if test -z "$perl_embed_ldflags" ; then
9704         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9705 $as_echo "no" >&6; }
9706         as_fn_error $? "could not determine flags for linking embedded Perl.
9707 This probably means that ExtUtils::Embed or ExtUtils::MakeMaker is not
9708 installed." "$LINENO" 5
9709 else
9710         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_embed_ldflags" >&5
9711 $as_echo "$perl_embed_ldflags" >&6; }
9712 fi
9713
9714 fi
9715
9716 if test "$with_python" = yes; then
9717   if test -z "$PYTHON"; then
9718   for ac_prog in python python3 python2
9719 do
9720   # Extract the first word of "$ac_prog", so it can be a program name with args.
9721 set dummy $ac_prog; ac_word=$2
9722 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9723 $as_echo_n "checking for $ac_word... " >&6; }
9724 if ${ac_cv_path_PYTHON+:} false; then :
9725   $as_echo_n "(cached) " >&6
9726 else
9727   case $PYTHON in
9728   [\\/]* | ?:[\\/]*)
9729   ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
9730   ;;
9731   *)
9732   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9733 for as_dir in $PATH
9734 do
9735   IFS=$as_save_IFS
9736   test -z "$as_dir" && as_dir=.
9737     for ac_exec_ext in '' $ac_executable_extensions; do
9738   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9739     ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
9740     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9741     break 2
9742   fi
9743 done
9744   done
9745 IFS=$as_save_IFS
9746
9747   ;;
9748 esac
9749 fi
9750 PYTHON=$ac_cv_path_PYTHON
9751 if test -n "$PYTHON"; then
9752   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
9753 $as_echo "$PYTHON" >&6; }
9754 else
9755   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9756 $as_echo "no" >&6; }
9757 fi
9758
9759
9760   test -n "$PYTHON" && break
9761 done
9762
9763 else
9764   # Report the value of PYTHON in configure's output in all cases.
9765   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PYTHON" >&5
9766 $as_echo_n "checking for PYTHON... " >&6; }
9767   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
9768 $as_echo "$PYTHON" >&6; }
9769 fi
9770
9771 if test x"$PYTHON" = x""; then
9772   as_fn_error $? "Python not found" "$LINENO" 5
9773 fi
9774
9775
9776 python_fullversion=`${PYTHON} -c "import sys; print(sys.version)" | sed q`
9777 { $as_echo "$as_me:${as_lineno-$LINENO}: using python $python_fullversion" >&5
9778 $as_echo "$as_me: using python $python_fullversion" >&6;}
9779 # python_fullversion is typically n.n.n plus some trailing junk
9780 python_majorversion=`echo "$python_fullversion" | sed 's/^\([0-9]*\).*/\1/'`
9781 python_minorversion=`echo "$python_fullversion" | sed 's/^[0-9]*\.\([0-9]*\).*/\1/'`
9782 python_version=`echo "$python_fullversion" | sed 's/^\([0-9]*\.[0-9]*\).*/\1/'`
9783 # Reject unsupported Python versions as soon as practical.
9784 if test "$python_majorversion" -lt 3 -a "$python_minorversion" -lt 4; then
9785   as_fn_error $? "Python version $python_version is too old (version 2.4 or later is required)" "$LINENO" 5
9786 fi
9787
9788 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python distutils module" >&5
9789 $as_echo_n "checking for Python distutils module... " >&6; }
9790 if "${PYTHON}" -c 'import distutils' 2>&5
9791 then
9792     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
9793 $as_echo "yes" >&6; }
9794 else
9795     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9796 $as_echo "no" >&6; }
9797     as_fn_error $? "distutils module not found" "$LINENO" 5
9798 fi
9799
9800 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python configuration directory" >&5
9801 $as_echo_n "checking Python configuration directory... " >&6; }
9802 python_configdir=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBPL'))))"`
9803 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $python_configdir" >&5
9804 $as_echo "$python_configdir" >&6; }
9805
9806 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python include directories" >&5
9807 $as_echo_n "checking Python include directories... " >&6; }
9808 python_includespec=`${PYTHON} -c "
9809 import distutils.sysconfig
9810 a = '-I' + distutils.sysconfig.get_python_inc(False)
9811 b = '-I' + distutils.sysconfig.get_python_inc(True)
9812 if a == b:
9813     print(a)
9814 else:
9815     print(a + ' ' + b)"`
9816 if test "$PORTNAME" = win32 ; then
9817     python_includespec=`echo $python_includespec | sed 's,[\],/,g'`
9818 fi
9819 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $python_includespec" >&5
9820 $as_echo "$python_includespec" >&6; }
9821
9822
9823
9824 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link an embedded Python application" >&5
9825 $as_echo_n "checking how to link an embedded Python application... " >&6; }
9826
9827 python_libdir=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBDIR'))))"`
9828 python_ldlibrary=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LDLIBRARY'))))"`
9829
9830 # If LDLIBRARY exists and has a shlib extension, use it verbatim.
9831 ldlibrary=`echo "${python_ldlibrary}" | sed -e 's/\.so$//' -e 's/\.dll$//' -e 's/\.dylib$//' -e 's/\.sl$//'`
9832 if test -e "${python_libdir}/${python_ldlibrary}" -a x"${python_ldlibrary}" != x"${ldlibrary}"
9833 then
9834         ldlibrary=`echo "${ldlibrary}" | sed "s/^lib//"`
9835         found_shlib=1
9836 else
9837         # Otherwise, guess the base name of the shlib.
9838         # LDVERSION was added in Python 3.2, before that use VERSION,
9839         # or failing that, $python_version from _PGAC_CHECK_PYTHON_DIRS.
9840         python_ldversion=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LDVERSION'))))"`
9841         if test x"${python_ldversion}" != x""; then
9842                 ldlibrary="python${python_ldversion}"
9843         else
9844                 python_version_var=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('VERSION'))))"`
9845                 if test x"${python_version_var}" != x""; then
9846                         ldlibrary="python${python_version_var}"
9847                 else
9848                         ldlibrary="python${python_version}"
9849                 fi
9850         fi
9851         # Search for a likely-looking file.
9852         found_shlib=0
9853         for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib
9854         do
9855                 # We don't know the platform DLSUFFIX here, so check 'em all.
9856                 for e in .so .dll .dylib .sl; do
9857                         if test -e "$d/lib${ldlibrary}$e"; then
9858                                 python_libdir="$d"
9859                                 found_shlib=1
9860                                 break 2
9861                         fi
9862                 done
9863         done
9864         # Some platforms (OpenBSD) require us to accept a bare versioned shlib
9865         # (".so.n.n") as well. However, check this only after failing to find
9866         # ".so" anywhere, because yet other platforms (Debian) put the .so
9867         # symlink in a different directory from the underlying versioned shlib.
9868         if test "$found_shlib" != 1; then
9869                 for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib
9870                 do
9871                         for f in "$d/lib${ldlibrary}.so."* ; do
9872                                 if test -e "$f"; then
9873                                         python_libdir="$d"
9874                                         found_shlib=1
9875                                         break 2
9876                                 fi
9877                         done
9878                 done
9879         fi
9880         # As usual, Windows has its own ideas.  Possible default library
9881         # locations include c:/Windows/System32 and (for Cygwin) /usr/bin,
9882         # and the "lib" prefix might not be there.
9883         if test "$found_shlib" != 1 -a \( "$PORTNAME" = win32 -o "$PORTNAME" = cygwin \); then
9884                 for d in "${python_libdir}" "${python_configdir}" c:/Windows/System32 /usr/bin
9885                 do
9886                         for f in "$d/lib${ldlibrary}.dll" "$d/${ldlibrary}.dll" ; do
9887                                 if test -e "$f"; then
9888                                         python_libdir="$d"
9889                                         found_shlib=1
9890                                         break 2
9891                                 fi
9892                         done
9893                 done
9894         fi
9895 fi
9896 if test "$found_shlib" != 1; then
9897         as_fn_error $? "could not find shared library for Python
9898 You might have to rebuild your Python installation.  Refer to the
9899 documentation for details.  Use --without-python to disable building
9900 PL/Python." "$LINENO" 5
9901 fi
9902 python_libspec="-L${python_libdir} -l${ldlibrary}"
9903
9904 python_additional_libs=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','BASEMODLIBS'))))"`
9905
9906 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${python_libspec} ${python_additional_libs}" >&5
9907 $as_echo "${python_libspec} ${python_additional_libs}" >&6; }
9908
9909
9910
9911 fi
9912
9913 if test "$cross_compiling" = yes && test -z "$with_system_tzdata"; then
9914   if test -z "$ZIC"; then
9915   for ac_prog in zic
9916 do
9917   # Extract the first word of "$ac_prog", so it can be a program name with args.
9918 set dummy $ac_prog; ac_word=$2
9919 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9920 $as_echo_n "checking for $ac_word... " >&6; }
9921 if ${ac_cv_path_ZIC+:} false; then :
9922   $as_echo_n "(cached) " >&6
9923 else
9924   case $ZIC in
9925   [\\/]* | ?:[\\/]*)
9926   ac_cv_path_ZIC="$ZIC" # Let the user override the test with a path.
9927   ;;
9928   *)
9929   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9930 for as_dir in $PATH
9931 do
9932   IFS=$as_save_IFS
9933   test -z "$as_dir" && as_dir=.
9934     for ac_exec_ext in '' $ac_executable_extensions; do
9935   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9936     ac_cv_path_ZIC="$as_dir/$ac_word$ac_exec_ext"
9937     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9938     break 2
9939   fi
9940 done
9941   done
9942 IFS=$as_save_IFS
9943
9944   ;;
9945 esac
9946 fi
9947 ZIC=$ac_cv_path_ZIC
9948 if test -n "$ZIC"; then
9949   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIC" >&5
9950 $as_echo "$ZIC" >&6; }
9951 else
9952   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9953 $as_echo "no" >&6; }
9954 fi
9955
9956
9957   test -n "$ZIC" && break
9958 done
9959
9960 else
9961   # Report the value of ZIC in configure's output in all cases.
9962   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZIC" >&5
9963 $as_echo_n "checking for ZIC... " >&6; }
9964   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIC" >&5
9965 $as_echo "$ZIC" >&6; }
9966 fi
9967
9968   if test -z "$ZIC"; then
9969     as_fn_error $? "
9970 When cross-compiling, either use the option --with-system-tzdata to use
9971 existing time-zone data, or set the environment variable ZIC to a zic
9972 program to use during the build." "$LINENO" 5
9973   fi
9974 fi
9975
9976 #
9977 # Pthreads
9978 #
9979 # For each platform, we need to know about any special compile and link
9980 # libraries, and whether the normal C function names are thread-safe.
9981 # See the comment at the top of src/port/thread.c for more information.
9982 # WIN32 doesn't need the pthread tests;  it always uses threads
9983 #
9984 # These tests are run before the library-tests, because linking with the
9985 # other libraries can pull in the pthread functions as a side-effect.  We
9986 # want to use the -pthread or similar flags directly, and not rely on
9987 # the side-effects of linking with some other library.
9988
9989 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
9990 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
9991 if ${ac_cv_path_SED+:} false; then :
9992   $as_echo_n "(cached) " >&6
9993 else
9994             ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
9995      for ac_i in 1 2 3 4 5 6 7; do
9996        ac_script="$ac_script$as_nl$ac_script"
9997      done
9998      echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
9999      { ac_script=; unset ac_script;}
10000      if test -z "$SED"; then
10001   ac_path_SED_found=false
10002   # Loop through the user's path and test for each of PROGNAME-LIST
10003   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10004 for as_dir in $PATH
10005 do
10006   IFS=$as_save_IFS
10007   test -z "$as_dir" && as_dir=.
10008     for ac_prog in sed gsed; do
10009     for ac_exec_ext in '' $ac_executable_extensions; do
10010       ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
10011       as_fn_executable_p "$ac_path_SED" || continue
10012 # Check for GNU ac_path_SED and select it if it is found.
10013   # Check for GNU $ac_path_SED
10014 case `"$ac_path_SED" --version 2>&1` in
10015 *GNU*)
10016   ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
10017 *)
10018   ac_count=0
10019   $as_echo_n 0123456789 >"conftest.in"
10020   while :
10021   do
10022     cat "conftest.in" "conftest.in" >"conftest.tmp"
10023     mv "conftest.tmp" "conftest.in"
10024     cp "conftest.in" "conftest.nl"
10025     $as_echo '' >> "conftest.nl"
10026     "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
10027     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
10028     as_fn_arith $ac_count + 1 && ac_count=$as_val
10029     if test $ac_count -gt ${ac_path_SED_max-0}; then
10030       # Best one so far, save it but keep looking for a better one
10031       ac_cv_path_SED="$ac_path_SED"
10032       ac_path_SED_max=$ac_count
10033     fi
10034     # 10*(2^10) chars as input seems more than enough
10035     test $ac_count -gt 10 && break
10036   done
10037   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
10038 esac
10039
10040       $ac_path_SED_found && break 3
10041     done
10042   done
10043   done
10044 IFS=$as_save_IFS
10045   if test -z "$ac_cv_path_SED"; then
10046     as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
10047   fi
10048 else
10049   ac_cv_path_SED=$SED
10050 fi
10051
10052 fi
10053 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
10054 $as_echo "$ac_cv_path_SED" >&6; }
10055  SED="$ac_cv_path_SED"
10056   rm -f conftest.sed
10057
10058 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
10059 $as_echo_n "checking for ANSI C header files... " >&6; }
10060 if ${ac_cv_header_stdc+:} false; then :
10061   $as_echo_n "(cached) " >&6
10062 else
10063   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10064 /* end confdefs.h.  */
10065 #include <stdlib.h>
10066 #include <stdarg.h>
10067 #include <string.h>
10068 #include <float.h>
10069
10070 int
10071 main ()
10072 {
10073
10074   ;
10075   return 0;
10076 }
10077 _ACEOF
10078 if ac_fn_c_try_compile "$LINENO"; then :
10079   ac_cv_header_stdc=yes
10080 else
10081   ac_cv_header_stdc=no
10082 fi
10083 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10084
10085 if test $ac_cv_header_stdc = yes; then
10086   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10087   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10088 /* end confdefs.h.  */
10089 #include <string.h>
10090
10091 _ACEOF
10092 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10093   $EGREP "memchr" >/dev/null 2>&1; then :
10094
10095 else
10096   ac_cv_header_stdc=no
10097 fi
10098 rm -f conftest*
10099
10100 fi
10101
10102 if test $ac_cv_header_stdc = yes; then
10103   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
10104   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10105 /* end confdefs.h.  */
10106 #include <stdlib.h>
10107
10108 _ACEOF
10109 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10110   $EGREP "free" >/dev/null 2>&1; then :
10111
10112 else
10113   ac_cv_header_stdc=no
10114 fi
10115 rm -f conftest*
10116
10117 fi
10118
10119 if test $ac_cv_header_stdc = yes; then
10120   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
10121   if test "$cross_compiling" = yes; then :
10122   :
10123 else
10124   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10125 /* end confdefs.h.  */
10126 #include <ctype.h>
10127 #include <stdlib.h>
10128 #if ((' ' & 0x0FF) == 0x020)
10129 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10130 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10131 #else
10132 # define ISLOWER(c) \
10133                    (('a' <= (c) && (c) <= 'i') \
10134                      || ('j' <= (c) && (c) <= 'r') \
10135                      || ('s' <= (c) && (c) <= 'z'))
10136 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
10137 #endif
10138
10139 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10140 int
10141 main ()
10142 {
10143   int i;
10144   for (i = 0; i < 256; i++)
10145     if (XOR (islower (i), ISLOWER (i))
10146         || toupper (i) != TOUPPER (i))
10147       return 2;
10148   return 0;
10149 }
10150 _ACEOF
10151 if ac_fn_c_try_run "$LINENO"; then :
10152
10153 else
10154   ac_cv_header_stdc=no
10155 fi
10156 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10157   conftest.$ac_objext conftest.beam conftest.$ac_ext
10158 fi
10159
10160 fi
10161 fi
10162 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
10163 $as_echo "$ac_cv_header_stdc" >&6; }
10164 if test $ac_cv_header_stdc = yes; then
10165
10166 $as_echo "#define STDC_HEADERS 1" >>confdefs.h
10167
10168 fi
10169
10170 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
10171 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
10172                   inttypes.h stdint.h unistd.h
10173 do :
10174   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
10175 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
10176 "
10177 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
10178   cat >>confdefs.h <<_ACEOF
10179 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
10180 _ACEOF
10181
10182 fi
10183
10184 done
10185
10186
10187 if test "$enable_thread_safety" = yes -a "$PORTNAME" != "win32"; then :
10188    # then
10189
10190
10191
10192
10193 ac_ext=c
10194 ac_cpp='$CPP $CPPFLAGS'
10195 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10196 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10197 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10198
10199 ax_pthread_ok=no
10200
10201 # We used to check for pthread.h first, but this fails if pthread.h
10202 # requires special compiler flags (e.g. on Tru64 or Sequent).
10203 # It gets checked for in the link test anyway.
10204
10205 # First of all, check if the user has set any of the PTHREAD_LIBS,
10206 # etcetera environment variables, and if threads linking works using
10207 # them:
10208 if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
10209         ax_pthread_save_CC="$CC"
10210         ax_pthread_save_CFLAGS="$CFLAGS"
10211         ax_pthread_save_LIBS="$LIBS"
10212         if test "x$PTHREAD_CC" != "x"; then :
10213   CC="$PTHREAD_CC"
10214 fi
10215         CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
10216         LIBS="$PTHREAD_LIBS $LIBS"
10217         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5
10218 $as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; }
10219         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10220 /* end confdefs.h.  */
10221
10222 /* Override any GCC internal prototype to avoid an error.
10223    Use char because int might match the return type of a GCC
10224    builtin and then its argument prototype would still apply.  */
10225 #ifdef __cplusplus
10226 extern "C"
10227 #endif
10228 char pthread_join ();
10229 int
10230 main ()
10231 {
10232 return pthread_join ();
10233   ;
10234   return 0;
10235 }
10236 _ACEOF
10237 if ac_fn_c_try_link "$LINENO"; then :
10238   ax_pthread_ok=yes
10239 fi
10240 rm -f core conftest.err conftest.$ac_objext \
10241     conftest$ac_exeext conftest.$ac_ext
10242         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
10243 $as_echo "$ax_pthread_ok" >&6; }
10244         if test "x$ax_pthread_ok" = "xno"; then
10245                 PTHREAD_LIBS=""
10246                 PTHREAD_CFLAGS=""
10247         fi
10248         CC="$ax_pthread_save_CC"
10249         CFLAGS="$ax_pthread_save_CFLAGS"
10250         LIBS="$ax_pthread_save_LIBS"
10251 fi
10252
10253 # We must check for the threads library under a number of different
10254 # names; the ordering is very important because some systems
10255 # (e.g. DEC) have both -lpthread and -lpthreads, where one of the
10256 # libraries is broken (non-POSIX).
10257
10258 # Create a list of thread flags to try.  Items starting with a "-" are
10259 # C compiler flags, and other items are library names, except for "none"
10260 # which indicates that we try without any flags at all, and "pthread-config"
10261 # which is a program returning the flags for the Pth emulation library.
10262
10263 ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
10264
10265 # The ordering *is* (sometimes) important.  Some notes on the
10266 # individual items follow:
10267
10268 # pthreads: AIX (must check this before -lpthread)
10269 # none: in case threads are in libc; should be tried before -Kthread and
10270 #       other compiler flags to prevent continual compiler warnings
10271 # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
10272 # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
10273 #           (Note: HP C rejects this with "bad form for `-t' option")
10274 # -pthreads: Solaris/gcc (Note: HP C also rejects)
10275 # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
10276 #      doesn't hurt to check since this sometimes defines pthreads and
10277 #      -D_REENTRANT too), HP C (must be checked before -lpthread, which
10278 #      is present but should not be used directly; and before -mthreads,
10279 #      because the compiler interprets this as "-mt" + "-hreads")
10280 # -mthreads: Mingw32/gcc, Lynx/gcc
10281 # pthread: Linux, etcetera
10282 # --thread-safe: KAI C++
10283 # pthread-config: use pthread-config program (for GNU Pth library)
10284
10285 case $host_os in
10286
10287         freebsd*)
10288
10289         # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
10290         # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
10291
10292         ax_pthread_flags="-kthread lthread $ax_pthread_flags"
10293         ;;
10294
10295         hpux*)
10296
10297         # From the cc(1) man page: "[-mt] Sets various -D flags to enable
10298         # multi-threading and also sets -lpthread."
10299
10300         ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
10301         ;;
10302
10303         openedition*)
10304
10305         # IBM z/OS requires a feature-test macro to be defined in order to
10306         # enable POSIX threads at all, so give the user a hint if this is
10307         # not set. (We don't define these ourselves, as they can affect
10308         # other portions of the system API in unpredictable ways.)
10309
10310         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10311 /* end confdefs.h.  */
10312
10313 #            if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
10314              AX_PTHREAD_ZOS_MISSING
10315 #            endif
10316
10317 _ACEOF
10318 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10319   $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then :
10320   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5
10321 $as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;}
10322 fi
10323 rm -f conftest*
10324
10325         ;;
10326
10327         solaris*)
10328
10329         # On Solaris (at least, for some versions), libc contains stubbed
10330         # (non-functional) versions of the pthreads routines, so link-based
10331         # tests will erroneously succeed. (N.B.: The stubs are missing
10332         # pthread_cleanup_push, or rather a function called by this macro,
10333         # so we could check for that, but who knows whether they'll stub
10334         # that too in a future libc.)  So we'll check first for the
10335         # standard Solaris way of linking pthreads (-mt -lpthread).
10336
10337         ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
10338         ;;
10339 esac
10340
10341 # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
10342
10343 if test "x$GCC" = "xyes"; then :
10344   ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"
10345 fi
10346
10347 # The presence of a feature test macro requesting re-entrant function
10348 # definitions is, on some systems, a strong hint that pthreads support is
10349 # correctly enabled
10350
10351 case $host_os in
10352         darwin* | hpux* | linux* | osf* | solaris*)
10353         ax_pthread_check_macro="_REENTRANT"
10354         ;;
10355
10356         aix*)
10357         ax_pthread_check_macro="_THREAD_SAFE"
10358         ;;
10359
10360         *)
10361         ax_pthread_check_macro="--"
10362         ;;
10363 esac
10364 if test "x$ax_pthread_check_macro" = "x--"; then :
10365   ax_pthread_check_cond=0
10366 else
10367   ax_pthread_check_cond="!defined($ax_pthread_check_macro)"
10368 fi
10369
10370 # Are we compiling with Clang?
10371
10372 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5
10373 $as_echo_n "checking whether $CC is Clang... " >&6; }
10374 if ${ax_cv_PTHREAD_CLANG+:} false; then :
10375   $as_echo_n "(cached) " >&6
10376 else
10377   ax_cv_PTHREAD_CLANG=no
10378      # Note that Autoconf sets GCC=yes for Clang as well as GCC
10379      if test "x$GCC" = "xyes"; then
10380         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10381 /* end confdefs.h.  */
10382 /* Note: Clang 2.7 lacks __clang_[a-z]+__ */
10383 #            if defined(__clang__) && defined(__llvm__)
10384              AX_PTHREAD_CC_IS_CLANG
10385 #            endif
10386
10387 _ACEOF
10388 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10389   $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1; then :
10390   ax_cv_PTHREAD_CLANG=yes
10391 fi
10392 rm -f conftest*
10393
10394      fi
10395
10396 fi
10397 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5
10398 $as_echo "$ax_cv_PTHREAD_CLANG" >&6; }
10399 ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
10400
10401 ax_pthread_clang_warning=no
10402
10403 # Clang needs special handling, because older versions handle the -pthread
10404 # option in a rather... idiosyncratic way
10405
10406 if test "x$ax_pthread_clang" = "xyes"; then
10407
10408         # Clang takes -pthread; it has never supported any other flag
10409
10410         # (Note 1: This will need to be revisited if a system that Clang
10411         # supports has POSIX threads in a separate library.  This tends not
10412         # to be the way of modern systems, but it's conceivable.)
10413
10414         # (Note 2: On some systems, notably Darwin, -pthread is not needed
10415         # to get POSIX threads support; the API is always present and
10416         # active.  We could reasonably leave PTHREAD_CFLAGS empty.  But
10417         # -pthread does define _REENTRANT, and while the Darwin headers
10418         # ignore this macro, third-party headers might not.)
10419
10420         PTHREAD_CFLAGS="-pthread"
10421         PTHREAD_LIBS=
10422
10423         ax_pthread_ok=yes
10424
10425         # However, older versions of Clang make a point of warning the user
10426         # that, in an invocation where only linking and no compilation is
10427         # taking place, the -pthread option has no effect ("argument unused
10428         # during compilation").  They expect -pthread to be passed in only
10429         # when source code is being compiled.
10430         #
10431         # Problem is, this is at odds with the way Automake and most other
10432         # C build frameworks function, which is that the same flags used in
10433         # compilation (CFLAGS) are also used in linking.  Many systems
10434         # supported by AX_PTHREAD require exactly this for POSIX threads
10435         # support, and in fact it is often not straightforward to specify a
10436         # flag that is used only in the compilation phase and not in
10437         # linking.  Such a scenario is extremely rare in practice.
10438         #
10439         # Even though use of the -pthread flag in linking would only print
10440         # a warning, this can be a nuisance for well-run software projects
10441         # that build with -Werror.  So if the active version of Clang has
10442         # this misfeature, we search for an option to squash it.
10443
10444         { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5
10445 $as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; }
10446 if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then :
10447   $as_echo_n "(cached) " >&6
10448 else
10449   ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
10450              # Create an alternate version of $ac_link that compiles and
10451              # links in two steps (.c -> .o, .o -> exe) instead of one
10452              # (.c -> exe), because the warning occurs only in the second
10453              # step
10454              ax_pthread_save_ac_link="$ac_link"
10455              ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
10456              ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
10457              ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
10458              ax_pthread_save_CFLAGS="$CFLAGS"
10459              for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
10460                 if test "x$ax_pthread_try" = "xunknown"; then :
10461   break
10462 fi
10463                 CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
10464                 ac_link="$ax_pthread_save_ac_link"
10465                 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10466 /* end confdefs.h.  */
10467 int main(void){return 0;}
10468 _ACEOF
10469 if ac_fn_c_try_link "$LINENO"; then :
10470   ac_link="$ax_pthread_2step_ac_link"
10471                      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10472 /* end confdefs.h.  */
10473 int main(void){return 0;}
10474 _ACEOF
10475 if ac_fn_c_try_link "$LINENO"; then :
10476   break
10477 fi
10478 rm -f core conftest.err conftest.$ac_objext \
10479     conftest$ac_exeext conftest.$ac_ext
10480
10481 fi
10482 rm -f core conftest.err conftest.$ac_objext \
10483     conftest$ac_exeext conftest.$ac_ext
10484              done
10485              ac_link="$ax_pthread_save_ac_link"
10486              CFLAGS="$ax_pthread_save_CFLAGS"
10487              if test "x$ax_pthread_try" = "x"; then :
10488   ax_pthread_try=no
10489 fi
10490              ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
10491
10492 fi
10493 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5
10494 $as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; }
10495
10496         case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
10497                 no | unknown) ;;
10498                 *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
10499         esac
10500
10501 fi # $ax_pthread_clang = yes
10502
10503 if test "x$ax_pthread_ok" = "xno"; then
10504 for ax_pthread_try_flag in $ax_pthread_flags; do
10505
10506         case $ax_pthread_try_flag in
10507                 none)
10508                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
10509 $as_echo_n "checking whether pthreads work without any flags... " >&6; }
10510                 ;;
10511
10512                 -mt,pthread)
10513                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5
10514 $as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; }
10515                 PTHREAD_CFLAGS="-mt"
10516                 PTHREAD_LIBS="-lpthread"
10517                 ;;
10518
10519                 -*)
10520                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5
10521 $as_echo_n "checking whether pthreads work with $ax_pthread_try_flag... " >&6; }
10522                 PTHREAD_CFLAGS="$ax_pthread_try_flag"
10523                 ;;
10524
10525                 pthread-config)
10526                 # Extract the first word of "pthread-config", so it can be a program name with args.
10527 set dummy pthread-config; ac_word=$2
10528 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10529 $as_echo_n "checking for $ac_word... " >&6; }
10530 if ${ac_cv_prog_ax_pthread_config+:} false; then :
10531   $as_echo_n "(cached) " >&6
10532 else
10533   if test -n "$ax_pthread_config"; then
10534   ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
10535 else
10536 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10537 for as_dir in $PATH
10538 do
10539   IFS=$as_save_IFS
10540   test -z "$as_dir" && as_dir=.
10541     for ac_exec_ext in '' $ac_executable_extensions; do
10542   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
10543     ac_cv_prog_ax_pthread_config="yes"
10544     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10545     break 2
10546   fi
10547 done
10548   done
10549 IFS=$as_save_IFS
10550
10551   test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
10552 fi
10553 fi
10554 ax_pthread_config=$ac_cv_prog_ax_pthread_config
10555 if test -n "$ax_pthread_config"; then
10556   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
10557 $as_echo "$ax_pthread_config" >&6; }
10558 else
10559   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10560 $as_echo "no" >&6; }
10561 fi
10562
10563
10564                 if test "x$ax_pthread_config" = "xno"; then :
10565   continue
10566 fi
10567                 PTHREAD_CFLAGS="`pthread-config --cflags`"
10568                 PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
10569                 ;;
10570
10571                 *)
10572                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5
10573 $as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; }
10574                 PTHREAD_LIBS="-l$ax_pthread_try_flag"
10575                 ;;
10576         esac
10577
10578         ax_pthread_save_CFLAGS="$CFLAGS"
10579         ax_pthread_save_LIBS="$LIBS"
10580         CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
10581         LIBS="$PTHREAD_LIBS $LIBS"
10582
10583         # Check for various functions.  We must include pthread.h,
10584         # since some functions may be macros.  (On the Sequent, we
10585         # need a special flag -Kthread to make this header compile.)
10586         # We check for pthread_join because it is in -lpthread on IRIX
10587         # while pthread_create is in libc.  We check for pthread_attr_init
10588         # due to DEC craziness with -lpthreads.  We check for
10589         # pthread_cleanup_push because it is one of the few pthread
10590         # functions on Solaris that doesn't have a non-functional libc stub.
10591         # We try pthread_create on general principles.
10592
10593         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10594 /* end confdefs.h.  */
10595 #include <pthread.h>
10596 #                       if $ax_pthread_check_cond
10597 #                        error "$ax_pthread_check_macro must be defined"
10598 #                       endif
10599                         static void routine(void *a) { a = 0; }
10600                         static void *start_routine(void *a) { return a; }
10601 int
10602 main ()
10603 {
10604 pthread_t th; pthread_attr_t attr;
10605                         pthread_create(&th, 0, start_routine, 0);
10606                         pthread_join(th, 0);
10607                         pthread_attr_init(&attr);
10608                         pthread_cleanup_push(routine, 0);
10609                         pthread_cleanup_pop(0) /* ; */
10610   ;
10611   return 0;
10612 }
10613 _ACEOF
10614 if ac_fn_c_try_link "$LINENO"; then :
10615   ax_pthread_ok=yes
10616 fi
10617 rm -f core conftest.err conftest.$ac_objext \
10618     conftest$ac_exeext conftest.$ac_ext
10619
10620         CFLAGS="$ax_pthread_save_CFLAGS"
10621         LIBS="$ax_pthread_save_LIBS"
10622
10623         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
10624 $as_echo "$ax_pthread_ok" >&6; }
10625         if test "x$ax_pthread_ok" = "xyes"; then :
10626   break
10627 fi
10628
10629         PTHREAD_LIBS=""
10630         PTHREAD_CFLAGS=""
10631 done
10632 fi
10633
10634 # Various other checks:
10635 if test "x$ax_pthread_ok" = "xyes"; then
10636         ax_pthread_save_CFLAGS="$CFLAGS"
10637         ax_pthread_save_LIBS="$LIBS"
10638         CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
10639         LIBS="$PTHREAD_LIBS $LIBS"
10640
10641         # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
10642         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
10643 $as_echo_n "checking for joinable pthread attribute... " >&6; }
10644 if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then :
10645   $as_echo_n "(cached) " >&6
10646 else
10647   ax_cv_PTHREAD_JOINABLE_ATTR=unknown
10648              for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
10649                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10650 /* end confdefs.h.  */
10651 #include <pthread.h>
10652 int
10653 main ()
10654 {
10655 int attr = $ax_pthread_attr; return attr /* ; */
10656   ;
10657   return 0;
10658 }
10659 _ACEOF
10660 if ac_fn_c_try_link "$LINENO"; then :
10661   ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break
10662 fi
10663 rm -f core conftest.err conftest.$ac_objext \
10664     conftest$ac_exeext conftest.$ac_ext
10665              done
10666
10667 fi
10668 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5
10669 $as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; }
10670         if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
10671                test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
10672                test "x$ax_pthread_joinable_attr_defined" != "xyes"; then :
10673
10674 cat >>confdefs.h <<_ACEOF
10675 #define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR
10676 _ACEOF
10677
10678                ax_pthread_joinable_attr_defined=yes
10679
10680 fi
10681
10682         { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5
10683 $as_echo_n "checking whether more special flags are required for pthreads... " >&6; }
10684 if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then :
10685   $as_echo_n "(cached) " >&6
10686 else
10687   ax_cv_PTHREAD_SPECIAL_FLAGS=no
10688              case $host_os in
10689              solaris*)
10690              ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
10691              ;;
10692              esac
10693
10694 fi
10695 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5
10696 $as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; }
10697         if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
10698                test "x$ax_pthread_special_flags_added" != "xyes"; then :
10699   PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
10700                ax_pthread_special_flags_added=yes
10701 fi
10702
10703         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5
10704 $as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; }
10705 if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then :
10706   $as_echo_n "(cached) " >&6
10707 else
10708   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10709 /* end confdefs.h.  */
10710 #include <pthread.h>
10711 int
10712 main ()
10713 {
10714 int i = PTHREAD_PRIO_INHERIT;
10715   ;
10716   return 0;
10717 }
10718 _ACEOF
10719 if ac_fn_c_try_link "$LINENO"; then :
10720   ax_cv_PTHREAD_PRIO_INHERIT=yes
10721 else
10722   ax_cv_PTHREAD_PRIO_INHERIT=no
10723 fi
10724 rm -f core conftest.err conftest.$ac_objext \
10725     conftest$ac_exeext conftest.$ac_ext
10726
10727 fi
10728 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5
10729 $as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; }
10730         if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
10731                test "x$ax_pthread_prio_inherit_defined" != "xyes"; then :
10732
10733 $as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h
10734
10735                ax_pthread_prio_inherit_defined=yes
10736
10737 fi
10738
10739         CFLAGS="$ax_pthread_save_CFLAGS"
10740         LIBS="$ax_pthread_save_LIBS"
10741
10742         # More AIX lossage: compile with *_r variant
10743         if test "x$GCC" != "xyes"; then
10744             case $host_os in
10745                 aix*)
10746                 case "x/$CC" in #(
10747   x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) :
10748     #handle absolute path differently from PATH based program lookup
10749                      case "x$CC" in #(
10750   x/*) :
10751     if as_fn_executable_p ${CC}_r; then :
10752   PTHREAD_CC="${CC}_r"
10753 fi ;; #(
10754   *) :
10755     for ac_prog in ${CC}_r
10756 do
10757   # Extract the first word of "$ac_prog", so it can be a program name with args.
10758 set dummy $ac_prog; ac_word=$2
10759 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10760 $as_echo_n "checking for $ac_word... " >&6; }
10761 if ${ac_cv_prog_PTHREAD_CC+:} false; then :
10762   $as_echo_n "(cached) " >&6
10763 else
10764   if test -n "$PTHREAD_CC"; then
10765   ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
10766 else
10767 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10768 for as_dir in $PATH
10769 do
10770   IFS=$as_save_IFS
10771   test -z "$as_dir" && as_dir=.
10772     for ac_exec_ext in '' $ac_executable_extensions; do
10773   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
10774     ac_cv_prog_PTHREAD_CC="$ac_prog"
10775     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10776     break 2
10777   fi
10778 done
10779   done
10780 IFS=$as_save_IFS
10781
10782 fi
10783 fi
10784 PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
10785 if test -n "$PTHREAD_CC"; then
10786   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
10787 $as_echo "$PTHREAD_CC" >&6; }
10788 else
10789   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10790 $as_echo "no" >&6; }
10791 fi
10792
10793
10794   test -n "$PTHREAD_CC" && break
10795 done
10796 test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
10797  ;;
10798 esac ;; #(
10799   *) :
10800      ;;
10801 esac
10802                 ;;
10803             esac
10804         fi
10805 fi
10806
10807 test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
10808
10809
10810
10811
10812
10813 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
10814 if test "x$ax_pthread_ok" = "xyes"; then
10815
10816 $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
10817
10818         :
10819 else
10820         ax_pthread_ok=no
10821
10822 fi
10823 ac_ext=c
10824 ac_cpp='$CPP $CPPFLAGS'
10825 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10826 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10827 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10828
10829         # set thread flags
10830
10831 # Some platforms use these, so just define them.  They can't hurt if they
10832 # are not supported.  For example, on Solaris -D_POSIX_PTHREAD_SEMANTICS
10833 # enables 5-arg getpwuid_r, among other things.
10834 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
10835
10836 # Check for *_r functions
10837 _CFLAGS="$CFLAGS"
10838 _LIBS="$LIBS"
10839 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
10840 LIBS="$LIBS $PTHREAD_LIBS"
10841
10842 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
10843 if test "x$ac_cv_header_pthread_h" = xyes; then :
10844
10845 else
10846   as_fn_error $? "
10847 pthread.h not found;  use --disable-thread-safety to disable thread safety" "$LINENO" 5
10848 fi
10849
10850
10851
10852 for ac_func in strerror_r getpwuid_r gethostbyname_r
10853 do :
10854   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
10855 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
10856 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
10857   cat >>confdefs.h <<_ACEOF
10858 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
10859 _ACEOF
10860
10861 fi
10862 done
10863
10864
10865 # Do test here with the proper thread flags
10866 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns int" >&5
10867 $as_echo_n "checking whether strerror_r returns int... " >&6; }
10868 if ${pgac_cv_func_strerror_r_int+:} false; then :
10869   $as_echo_n "(cached) " >&6
10870 else
10871   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10872 /* end confdefs.h.  */
10873 #include <string.h>
10874 int
10875 main ()
10876 {
10877 char buf[100];
10878   switch (strerror_r(1, buf, sizeof(buf)))
10879   { case 0: break; default: break; }
10880
10881   ;
10882   return 0;
10883 }
10884 _ACEOF
10885 if ac_fn_c_try_compile "$LINENO"; then :
10886   pgac_cv_func_strerror_r_int=yes
10887 else
10888   pgac_cv_func_strerror_r_int=no
10889 fi
10890 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10891 fi
10892 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_strerror_r_int" >&5
10893 $as_echo "$pgac_cv_func_strerror_r_int" >&6; }
10894 if test x"$pgac_cv_func_strerror_r_int" = xyes ; then
10895
10896 $as_echo "#define STRERROR_R_INT 1" >>confdefs.h
10897
10898 fi
10899
10900
10901 CFLAGS="$_CFLAGS"
10902 LIBS="$_LIBS"
10903
10904
10905 else
10906    # else
10907 # do not use values from template file
10908 PTHREAD_CFLAGS=
10909 PTHREAD_LIBS=
10910
10911 fi # fi
10912
10913
10914
10915
10916
10917 ##
10918 ## Libraries
10919 ##
10920 ## Most libraries are included only if they demonstrably provide a function
10921 ## we need, but libm is an exception: always include it, because there are
10922 ## too many compilers that play cute optimization games that will break
10923 ## probes for standard functions such as pow().
10924 ##
10925
10926 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5
10927 $as_echo_n "checking for main in -lm... " >&6; }
10928 if ${ac_cv_lib_m_main+:} false; then :
10929   $as_echo_n "(cached) " >&6
10930 else
10931   ac_check_lib_save_LIBS=$LIBS
10932 LIBS="-lm  $LIBS"
10933 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10934 /* end confdefs.h.  */
10935
10936
10937 int
10938 main ()
10939 {
10940 return main ();
10941   ;
10942   return 0;
10943 }
10944 _ACEOF
10945 if ac_fn_c_try_link "$LINENO"; then :
10946   ac_cv_lib_m_main=yes
10947 else
10948   ac_cv_lib_m_main=no
10949 fi
10950 rm -f core conftest.err conftest.$ac_objext \
10951     conftest$ac_exeext conftest.$ac_ext
10952 LIBS=$ac_check_lib_save_LIBS
10953 fi
10954 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5
10955 $as_echo "$ac_cv_lib_m_main" >&6; }
10956 if test "x$ac_cv_lib_m_main" = xyes; then :
10957   cat >>confdefs.h <<_ACEOF
10958 #define HAVE_LIBM 1
10959 _ACEOF
10960
10961   LIBS="-lm $LIBS"
10962
10963 fi
10964
10965 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setproctitle" >&5
10966 $as_echo_n "checking for library containing setproctitle... " >&6; }
10967 if ${ac_cv_search_setproctitle+:} false; then :
10968   $as_echo_n "(cached) " >&6
10969 else
10970   ac_func_search_save_LIBS=$LIBS
10971 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10972 /* end confdefs.h.  */
10973
10974 /* Override any GCC internal prototype to avoid an error.
10975    Use char because int might match the return type of a GCC
10976    builtin and then its argument prototype would still apply.  */
10977 #ifdef __cplusplus
10978 extern "C"
10979 #endif
10980 char setproctitle ();
10981 int
10982 main ()
10983 {
10984 return setproctitle ();
10985   ;
10986   return 0;
10987 }
10988 _ACEOF
10989 for ac_lib in '' util; do
10990   if test -z "$ac_lib"; then
10991     ac_res="none required"
10992   else
10993     ac_res=-l$ac_lib
10994     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
10995   fi
10996   if ac_fn_c_try_link "$LINENO"; then :
10997   ac_cv_search_setproctitle=$ac_res
10998 fi
10999 rm -f core conftest.err conftest.$ac_objext \
11000     conftest$ac_exeext
11001   if ${ac_cv_search_setproctitle+:} false; then :
11002   break
11003 fi
11004 done
11005 if ${ac_cv_search_setproctitle+:} false; then :
11006
11007 else
11008   ac_cv_search_setproctitle=no
11009 fi
11010 rm conftest.$ac_ext
11011 LIBS=$ac_func_search_save_LIBS
11012 fi
11013 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setproctitle" >&5
11014 $as_echo "$ac_cv_search_setproctitle" >&6; }
11015 ac_res=$ac_cv_search_setproctitle
11016 if test "$ac_res" != no; then :
11017   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11018
11019 fi
11020
11021 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
11022 $as_echo_n "checking for library containing dlopen... " >&6; }
11023 if ${ac_cv_search_dlopen+:} false; then :
11024   $as_echo_n "(cached) " >&6
11025 else
11026   ac_func_search_save_LIBS=$LIBS
11027 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11028 /* end confdefs.h.  */
11029
11030 /* Override any GCC internal prototype to avoid an error.
11031    Use char because int might match the return type of a GCC
11032    builtin and then its argument prototype would still apply.  */
11033 #ifdef __cplusplus
11034 extern "C"
11035 #endif
11036 char dlopen ();
11037 int
11038 main ()
11039 {
11040 return dlopen ();
11041   ;
11042   return 0;
11043 }
11044 _ACEOF
11045 for ac_lib in '' dl; do
11046   if test -z "$ac_lib"; then
11047     ac_res="none required"
11048   else
11049     ac_res=-l$ac_lib
11050     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11051   fi
11052   if ac_fn_c_try_link "$LINENO"; then :
11053   ac_cv_search_dlopen=$ac_res
11054 fi
11055 rm -f core conftest.err conftest.$ac_objext \
11056     conftest$ac_exeext
11057   if ${ac_cv_search_dlopen+:} false; then :
11058   break
11059 fi
11060 done
11061 if ${ac_cv_search_dlopen+:} false; then :
11062
11063 else
11064   ac_cv_search_dlopen=no
11065 fi
11066 rm conftest.$ac_ext
11067 LIBS=$ac_func_search_save_LIBS
11068 fi
11069 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
11070 $as_echo "$ac_cv_search_dlopen" >&6; }
11071 ac_res=$ac_cv_search_dlopen
11072 if test "$ac_res" != no; then :
11073   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11074
11075 fi
11076
11077 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
11078 $as_echo_n "checking for library containing socket... " >&6; }
11079 if ${ac_cv_search_socket+:} false; then :
11080   $as_echo_n "(cached) " >&6
11081 else
11082   ac_func_search_save_LIBS=$LIBS
11083 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11084 /* end confdefs.h.  */
11085
11086 /* Override any GCC internal prototype to avoid an error.
11087    Use char because int might match the return type of a GCC
11088    builtin and then its argument prototype would still apply.  */
11089 #ifdef __cplusplus
11090 extern "C"
11091 #endif
11092 char socket ();
11093 int
11094 main ()
11095 {
11096 return socket ();
11097   ;
11098   return 0;
11099 }
11100 _ACEOF
11101 for ac_lib in '' socket ws2_32; do
11102   if test -z "$ac_lib"; then
11103     ac_res="none required"
11104   else
11105     ac_res=-l$ac_lib
11106     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11107   fi
11108   if ac_fn_c_try_link "$LINENO"; then :
11109   ac_cv_search_socket=$ac_res
11110 fi
11111 rm -f core conftest.err conftest.$ac_objext \
11112     conftest$ac_exeext
11113   if ${ac_cv_search_socket+:} false; then :
11114   break
11115 fi
11116 done
11117 if ${ac_cv_search_socket+:} false; then :
11118
11119 else
11120   ac_cv_search_socket=no
11121 fi
11122 rm conftest.$ac_ext
11123 LIBS=$ac_func_search_save_LIBS
11124 fi
11125 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
11126 $as_echo "$ac_cv_search_socket" >&6; }
11127 ac_res=$ac_cv_search_socket
11128 if test "$ac_res" != no; then :
11129   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11130
11131 fi
11132
11133 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shl_load" >&5
11134 $as_echo_n "checking for library containing shl_load... " >&6; }
11135 if ${ac_cv_search_shl_load+:} false; then :
11136   $as_echo_n "(cached) " >&6
11137 else
11138   ac_func_search_save_LIBS=$LIBS
11139 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11140 /* end confdefs.h.  */
11141
11142 /* Override any GCC internal prototype to avoid an error.
11143    Use char because int might match the return type of a GCC
11144    builtin and then its argument prototype would still apply.  */
11145 #ifdef __cplusplus
11146 extern "C"
11147 #endif
11148 char shl_load ();
11149 int
11150 main ()
11151 {
11152 return shl_load ();
11153   ;
11154   return 0;
11155 }
11156 _ACEOF
11157 for ac_lib in '' dld; do
11158   if test -z "$ac_lib"; then
11159     ac_res="none required"
11160   else
11161     ac_res=-l$ac_lib
11162     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11163   fi
11164   if ac_fn_c_try_link "$LINENO"; then :
11165   ac_cv_search_shl_load=$ac_res
11166 fi
11167 rm -f core conftest.err conftest.$ac_objext \
11168     conftest$ac_exeext
11169   if ${ac_cv_search_shl_load+:} false; then :
11170   break
11171 fi
11172 done
11173 if ${ac_cv_search_shl_load+:} false; then :
11174
11175 else
11176   ac_cv_search_shl_load=no
11177 fi
11178 rm conftest.$ac_ext
11179 LIBS=$ac_func_search_save_LIBS
11180 fi
11181 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shl_load" >&5
11182 $as_echo "$ac_cv_search_shl_load" >&6; }
11183 ac_res=$ac_cv_search_shl_load
11184 if test "$ac_res" != no; then :
11185   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11186
11187 fi
11188
11189 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getopt_long" >&5
11190 $as_echo_n "checking for library containing getopt_long... " >&6; }
11191 if ${ac_cv_search_getopt_long+:} false; then :
11192   $as_echo_n "(cached) " >&6
11193 else
11194   ac_func_search_save_LIBS=$LIBS
11195 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11196 /* end confdefs.h.  */
11197
11198 /* Override any GCC internal prototype to avoid an error.
11199    Use char because int might match the return type of a GCC
11200    builtin and then its argument prototype would still apply.  */
11201 #ifdef __cplusplus
11202 extern "C"
11203 #endif
11204 char getopt_long ();
11205 int
11206 main ()
11207 {
11208 return getopt_long ();
11209   ;
11210   return 0;
11211 }
11212 _ACEOF
11213 for ac_lib in '' getopt gnugetopt; do
11214   if test -z "$ac_lib"; then
11215     ac_res="none required"
11216   else
11217     ac_res=-l$ac_lib
11218     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11219   fi
11220   if ac_fn_c_try_link "$LINENO"; then :
11221   ac_cv_search_getopt_long=$ac_res
11222 fi
11223 rm -f core conftest.err conftest.$ac_objext \
11224     conftest$ac_exeext
11225   if ${ac_cv_search_getopt_long+:} false; then :
11226   break
11227 fi
11228 done
11229 if ${ac_cv_search_getopt_long+:} false; then :
11230
11231 else
11232   ac_cv_search_getopt_long=no
11233 fi
11234 rm conftest.$ac_ext
11235 LIBS=$ac_func_search_save_LIBS
11236 fi
11237 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getopt_long" >&5
11238 $as_echo "$ac_cv_search_getopt_long" >&6; }
11239 ac_res=$ac_cv_search_getopt_long
11240 if test "$ac_res" != no; then :
11241   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11242
11243 fi
11244
11245 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
11246 $as_echo_n "checking for library containing crypt... " >&6; }
11247 if ${ac_cv_search_crypt+:} false; then :
11248   $as_echo_n "(cached) " >&6
11249 else
11250   ac_func_search_save_LIBS=$LIBS
11251 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11252 /* end confdefs.h.  */
11253
11254 /* Override any GCC internal prototype to avoid an error.
11255    Use char because int might match the return type of a GCC
11256    builtin and then its argument prototype would still apply.  */
11257 #ifdef __cplusplus
11258 extern "C"
11259 #endif
11260 char crypt ();
11261 int
11262 main ()
11263 {
11264 return crypt ();
11265   ;
11266   return 0;
11267 }
11268 _ACEOF
11269 for ac_lib in '' crypt; do
11270   if test -z "$ac_lib"; then
11271     ac_res="none required"
11272   else
11273     ac_res=-l$ac_lib
11274     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11275   fi
11276   if ac_fn_c_try_link "$LINENO"; then :
11277   ac_cv_search_crypt=$ac_res
11278 fi
11279 rm -f core conftest.err conftest.$ac_objext \
11280     conftest$ac_exeext
11281   if ${ac_cv_search_crypt+:} false; then :
11282   break
11283 fi
11284 done
11285 if ${ac_cv_search_crypt+:} false; then :
11286
11287 else
11288   ac_cv_search_crypt=no
11289 fi
11290 rm conftest.$ac_ext
11291 LIBS=$ac_func_search_save_LIBS
11292 fi
11293 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5
11294 $as_echo "$ac_cv_search_crypt" >&6; }
11295 ac_res=$ac_cv_search_crypt
11296 if test "$ac_res" != no; then :
11297   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11298
11299 fi
11300
11301 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5
11302 $as_echo_n "checking for library containing shm_open... " >&6; }
11303 if ${ac_cv_search_shm_open+:} false; then :
11304   $as_echo_n "(cached) " >&6
11305 else
11306   ac_func_search_save_LIBS=$LIBS
11307 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11308 /* end confdefs.h.  */
11309
11310 /* Override any GCC internal prototype to avoid an error.
11311    Use char because int might match the return type of a GCC
11312    builtin and then its argument prototype would still apply.  */
11313 #ifdef __cplusplus
11314 extern "C"
11315 #endif
11316 char shm_open ();
11317 int
11318 main ()
11319 {
11320 return shm_open ();
11321   ;
11322   return 0;
11323 }
11324 _ACEOF
11325 for ac_lib in '' rt; do
11326   if test -z "$ac_lib"; then
11327     ac_res="none required"
11328   else
11329     ac_res=-l$ac_lib
11330     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11331   fi
11332   if ac_fn_c_try_link "$LINENO"; then :
11333   ac_cv_search_shm_open=$ac_res
11334 fi
11335 rm -f core conftest.err conftest.$ac_objext \
11336     conftest$ac_exeext
11337   if ${ac_cv_search_shm_open+:} false; then :
11338   break
11339 fi
11340 done
11341 if ${ac_cv_search_shm_open+:} false; then :
11342
11343 else
11344   ac_cv_search_shm_open=no
11345 fi
11346 rm conftest.$ac_ext
11347 LIBS=$ac_func_search_save_LIBS
11348 fi
11349 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_open" >&5
11350 $as_echo "$ac_cv_search_shm_open" >&6; }
11351 ac_res=$ac_cv_search_shm_open
11352 if test "$ac_res" != no; then :
11353   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11354
11355 fi
11356
11357 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_unlink" >&5
11358 $as_echo_n "checking for library containing shm_unlink... " >&6; }
11359 if ${ac_cv_search_shm_unlink+:} false; then :
11360   $as_echo_n "(cached) " >&6
11361 else
11362   ac_func_search_save_LIBS=$LIBS
11363 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11364 /* end confdefs.h.  */
11365
11366 /* Override any GCC internal prototype to avoid an error.
11367    Use char because int might match the return type of a GCC
11368    builtin and then its argument prototype would still apply.  */
11369 #ifdef __cplusplus
11370 extern "C"
11371 #endif
11372 char shm_unlink ();
11373 int
11374 main ()
11375 {
11376 return shm_unlink ();
11377   ;
11378   return 0;
11379 }
11380 _ACEOF
11381 for ac_lib in '' rt; do
11382   if test -z "$ac_lib"; then
11383     ac_res="none required"
11384   else
11385     ac_res=-l$ac_lib
11386     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11387   fi
11388   if ac_fn_c_try_link "$LINENO"; then :
11389   ac_cv_search_shm_unlink=$ac_res
11390 fi
11391 rm -f core conftest.err conftest.$ac_objext \
11392     conftest$ac_exeext
11393   if ${ac_cv_search_shm_unlink+:} false; then :
11394   break
11395 fi
11396 done
11397 if ${ac_cv_search_shm_unlink+:} false; then :
11398
11399 else
11400   ac_cv_search_shm_unlink=no
11401 fi
11402 rm conftest.$ac_ext
11403 LIBS=$ac_func_search_save_LIBS
11404 fi
11405 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_unlink" >&5
11406 $as_echo "$ac_cv_search_shm_unlink" >&6; }
11407 ac_res=$ac_cv_search_shm_unlink
11408 if test "$ac_res" != no; then :
11409   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11410
11411 fi
11412
11413 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
11414 $as_echo_n "checking for library containing clock_gettime... " >&6; }
11415 if ${ac_cv_search_clock_gettime+:} false; then :
11416   $as_echo_n "(cached) " >&6
11417 else
11418   ac_func_search_save_LIBS=$LIBS
11419 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11420 /* end confdefs.h.  */
11421
11422 /* Override any GCC internal prototype to avoid an error.
11423    Use char because int might match the return type of a GCC
11424    builtin and then its argument prototype would still apply.  */
11425 #ifdef __cplusplus
11426 extern "C"
11427 #endif
11428 char clock_gettime ();
11429 int
11430 main ()
11431 {
11432 return clock_gettime ();
11433   ;
11434   return 0;
11435 }
11436 _ACEOF
11437 for ac_lib in '' rt posix4; do
11438   if test -z "$ac_lib"; then
11439     ac_res="none required"
11440   else
11441     ac_res=-l$ac_lib
11442     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11443   fi
11444   if ac_fn_c_try_link "$LINENO"; then :
11445   ac_cv_search_clock_gettime=$ac_res
11446 fi
11447 rm -f core conftest.err conftest.$ac_objext \
11448     conftest$ac_exeext
11449   if ${ac_cv_search_clock_gettime+:} false; then :
11450   break
11451 fi
11452 done
11453 if ${ac_cv_search_clock_gettime+:} false; then :
11454
11455 else
11456   ac_cv_search_clock_gettime=no
11457 fi
11458 rm conftest.$ac_ext
11459 LIBS=$ac_func_search_save_LIBS
11460 fi
11461 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
11462 $as_echo "$ac_cv_search_clock_gettime" >&6; }
11463 ac_res=$ac_cv_search_clock_gettime
11464 if test "$ac_res" != no; then :
11465   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11466
11467 fi
11468
11469 # Solaris:
11470 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fdatasync" >&5
11471 $as_echo_n "checking for library containing fdatasync... " >&6; }
11472 if ${ac_cv_search_fdatasync+:} false; then :
11473   $as_echo_n "(cached) " >&6
11474 else
11475   ac_func_search_save_LIBS=$LIBS
11476 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11477 /* end confdefs.h.  */
11478
11479 /* Override any GCC internal prototype to avoid an error.
11480    Use char because int might match the return type of a GCC
11481    builtin and then its argument prototype would still apply.  */
11482 #ifdef __cplusplus
11483 extern "C"
11484 #endif
11485 char fdatasync ();
11486 int
11487 main ()
11488 {
11489 return fdatasync ();
11490   ;
11491   return 0;
11492 }
11493 _ACEOF
11494 for ac_lib in '' rt posix4; do
11495   if test -z "$ac_lib"; then
11496     ac_res="none required"
11497   else
11498     ac_res=-l$ac_lib
11499     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11500   fi
11501   if ac_fn_c_try_link "$LINENO"; then :
11502   ac_cv_search_fdatasync=$ac_res
11503 fi
11504 rm -f core conftest.err conftest.$ac_objext \
11505     conftest$ac_exeext
11506   if ${ac_cv_search_fdatasync+:} false; then :
11507   break
11508 fi
11509 done
11510 if ${ac_cv_search_fdatasync+:} false; then :
11511
11512 else
11513   ac_cv_search_fdatasync=no
11514 fi
11515 rm conftest.$ac_ext
11516 LIBS=$ac_func_search_save_LIBS
11517 fi
11518 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fdatasync" >&5
11519 $as_echo "$ac_cv_search_fdatasync" >&6; }
11520 ac_res=$ac_cv_search_fdatasync
11521 if test "$ac_res" != no; then :
11522   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11523
11524 fi
11525
11526 # Required for thread_test.c on Solaris
11527 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_yield" >&5
11528 $as_echo_n "checking for library containing sched_yield... " >&6; }
11529 if ${ac_cv_search_sched_yield+:} false; then :
11530   $as_echo_n "(cached) " >&6
11531 else
11532   ac_func_search_save_LIBS=$LIBS
11533 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11534 /* end confdefs.h.  */
11535
11536 /* Override any GCC internal prototype to avoid an error.
11537    Use char because int might match the return type of a GCC
11538    builtin and then its argument prototype would still apply.  */
11539 #ifdef __cplusplus
11540 extern "C"
11541 #endif
11542 char sched_yield ();
11543 int
11544 main ()
11545 {
11546 return sched_yield ();
11547   ;
11548   return 0;
11549 }
11550 _ACEOF
11551 for ac_lib in '' rt; do
11552   if test -z "$ac_lib"; then
11553     ac_res="none required"
11554   else
11555     ac_res=-l$ac_lib
11556     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11557   fi
11558   if ac_fn_c_try_link "$LINENO"; then :
11559   ac_cv_search_sched_yield=$ac_res
11560 fi
11561 rm -f core conftest.err conftest.$ac_objext \
11562     conftest$ac_exeext
11563   if ${ac_cv_search_sched_yield+:} false; then :
11564   break
11565 fi
11566 done
11567 if ${ac_cv_search_sched_yield+:} false; then :
11568
11569 else
11570   ac_cv_search_sched_yield=no
11571 fi
11572 rm conftest.$ac_ext
11573 LIBS=$ac_func_search_save_LIBS
11574 fi
11575 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_yield" >&5
11576 $as_echo "$ac_cv_search_sched_yield" >&6; }
11577 ac_res=$ac_cv_search_sched_yield
11578 if test "$ac_res" != no; then :
11579   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11580
11581 fi
11582
11583 # Required for thread_test.c on Solaris 2.5:
11584 # Other ports use it too (HP-UX) so test unconditionally
11585 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname_r" >&5
11586 $as_echo_n "checking for library containing gethostbyname_r... " >&6; }
11587 if ${ac_cv_search_gethostbyname_r+:} false; then :
11588   $as_echo_n "(cached) " >&6
11589 else
11590   ac_func_search_save_LIBS=$LIBS
11591 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11592 /* end confdefs.h.  */
11593
11594 /* Override any GCC internal prototype to avoid an error.
11595    Use char because int might match the return type of a GCC
11596    builtin and then its argument prototype would still apply.  */
11597 #ifdef __cplusplus
11598 extern "C"
11599 #endif
11600 char gethostbyname_r ();
11601 int
11602 main ()
11603 {
11604 return gethostbyname_r ();
11605   ;
11606   return 0;
11607 }
11608 _ACEOF
11609 for ac_lib in '' nsl; do
11610   if test -z "$ac_lib"; then
11611     ac_res="none required"
11612   else
11613     ac_res=-l$ac_lib
11614     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11615   fi
11616   if ac_fn_c_try_link "$LINENO"; then :
11617   ac_cv_search_gethostbyname_r=$ac_res
11618 fi
11619 rm -f core conftest.err conftest.$ac_objext \
11620     conftest$ac_exeext
11621   if ${ac_cv_search_gethostbyname_r+:} false; then :
11622   break
11623 fi
11624 done
11625 if ${ac_cv_search_gethostbyname_r+:} false; then :
11626
11627 else
11628   ac_cv_search_gethostbyname_r=no
11629 fi
11630 rm conftest.$ac_ext
11631 LIBS=$ac_func_search_save_LIBS
11632 fi
11633 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname_r" >&5
11634 $as_echo "$ac_cv_search_gethostbyname_r" >&6; }
11635 ac_res=$ac_cv_search_gethostbyname_r
11636 if test "$ac_res" != no; then :
11637   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11638
11639 fi
11640
11641 # Cygwin:
11642 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shmget" >&5
11643 $as_echo_n "checking for library containing shmget... " >&6; }
11644 if ${ac_cv_search_shmget+:} false; then :
11645   $as_echo_n "(cached) " >&6
11646 else
11647   ac_func_search_save_LIBS=$LIBS
11648 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11649 /* end confdefs.h.  */
11650
11651 /* Override any GCC internal prototype to avoid an error.
11652    Use char because int might match the return type of a GCC
11653    builtin and then its argument prototype would still apply.  */
11654 #ifdef __cplusplus
11655 extern "C"
11656 #endif
11657 char shmget ();
11658 int
11659 main ()
11660 {
11661 return shmget ();
11662   ;
11663   return 0;
11664 }
11665 _ACEOF
11666 for ac_lib in '' cygipc; do
11667   if test -z "$ac_lib"; then
11668     ac_res="none required"
11669   else
11670     ac_res=-l$ac_lib
11671     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11672   fi
11673   if ac_fn_c_try_link "$LINENO"; then :
11674   ac_cv_search_shmget=$ac_res
11675 fi
11676 rm -f core conftest.err conftest.$ac_objext \
11677     conftest$ac_exeext
11678   if ${ac_cv_search_shmget+:} false; then :
11679   break
11680 fi
11681 done
11682 if ${ac_cv_search_shmget+:} false; then :
11683
11684 else
11685   ac_cv_search_shmget=no
11686 fi
11687 rm conftest.$ac_ext
11688 LIBS=$ac_func_search_save_LIBS
11689 fi
11690 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shmget" >&5
11691 $as_echo "$ac_cv_search_shmget" >&6; }
11692 ac_res=$ac_cv_search_shmget
11693 if test "$ac_res" != no; then :
11694   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11695
11696 fi
11697
11698
11699 if test "$with_readline" = yes; then
11700
11701
11702 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing readline" >&5
11703 $as_echo_n "checking for library containing readline... " >&6; }
11704 if ${pgac_cv_check_readline+:} false; then :
11705   $as_echo_n "(cached) " >&6
11706 else
11707   pgac_cv_check_readline=no
11708 pgac_save_LIBS=$LIBS
11709 if test x"$with_libedit_preferred" != x"yes"
11710 then    READLINE_ORDER="-lreadline -ledit"
11711 else    READLINE_ORDER="-ledit -lreadline"
11712 fi
11713 for pgac_rllib in $READLINE_ORDER ; do
11714   for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
11715     LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS"
11716     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11717 /* end confdefs.h.  */
11718
11719 /* Override any GCC internal prototype to avoid an error.
11720    Use char because int might match the return type of a GCC
11721    builtin and then its argument prototype would still apply.  */
11722 #ifdef __cplusplus
11723 extern "C"
11724 #endif
11725 char readline ();
11726 int
11727 main ()
11728 {
11729 return readline ();
11730   ;
11731   return 0;
11732 }
11733 _ACEOF
11734 if ac_fn_c_try_link "$LINENO"; then :
11735
11736       # Older NetBSD, OpenBSD, and Irix have a broken linker that does not
11737       # recognize dependent libraries; assume curses is needed if we didn't
11738       # find any dependency.
11739       case $host_os in
11740         netbsd* | openbsd* | irix*)
11741           if test x"$pgac_lib" = x"" ; then
11742             pgac_lib=" -lcurses"
11743           fi ;;
11744       esac
11745
11746       pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"
11747       break
11748
11749 fi
11750 rm -f core conftest.err conftest.$ac_objext \
11751     conftest$ac_exeext conftest.$ac_ext
11752   done
11753   if test "$pgac_cv_check_readline" != no ; then
11754     break
11755   fi
11756 done
11757 LIBS=$pgac_save_LIBS
11758
11759 fi
11760 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_readline" >&5
11761 $as_echo "$pgac_cv_check_readline" >&6; }
11762 if test "$pgac_cv_check_readline" != no ; then
11763   LIBS="$pgac_cv_check_readline $LIBS"
11764
11765 $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
11766
11767 fi
11768
11769
11770   if test x"$pgac_cv_check_readline" = x"no"; then
11771     as_fn_error $? "readline library not found
11772 If you have readline already installed, see config.log for details on the
11773 failure.  It is possible the compiler isn't looking in the proper directory.
11774 Use --without-readline to disable readline support." "$LINENO" 5
11775   fi
11776 fi
11777
11778 if test "$with_zlib" = yes; then
11779   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5
11780 $as_echo_n "checking for inflate in -lz... " >&6; }
11781 if ${ac_cv_lib_z_inflate+:} false; then :
11782   $as_echo_n "(cached) " >&6
11783 else
11784   ac_check_lib_save_LIBS=$LIBS
11785 LIBS="-lz  $LIBS"
11786 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11787 /* end confdefs.h.  */
11788
11789 /* Override any GCC internal prototype to avoid an error.
11790    Use char because int might match the return type of a GCC
11791    builtin and then its argument prototype would still apply.  */
11792 #ifdef __cplusplus
11793 extern "C"
11794 #endif
11795 char inflate ();
11796 int
11797 main ()
11798 {
11799 return inflate ();
11800   ;
11801   return 0;
11802 }
11803 _ACEOF
11804 if ac_fn_c_try_link "$LINENO"; then :
11805   ac_cv_lib_z_inflate=yes
11806 else
11807   ac_cv_lib_z_inflate=no
11808 fi
11809 rm -f core conftest.err conftest.$ac_objext \
11810     conftest$ac_exeext conftest.$ac_ext
11811 LIBS=$ac_check_lib_save_LIBS
11812 fi
11813 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5
11814 $as_echo "$ac_cv_lib_z_inflate" >&6; }
11815 if test "x$ac_cv_lib_z_inflate" = xyes; then :
11816   cat >>confdefs.h <<_ACEOF
11817 #define HAVE_LIBZ 1
11818 _ACEOF
11819
11820   LIBS="-lz $LIBS"
11821
11822 else
11823   as_fn_error $? "zlib library not found
11824 If you have zlib already installed, see config.log for details on the
11825 failure.  It is possible the compiler isn't looking in the proper directory.
11826 Use --without-zlib to disable zlib support." "$LINENO" 5
11827 fi
11828
11829 fi
11830
11831 if test "$enable_spinlocks" = yes; then
11832
11833 $as_echo "#define HAVE_SPINLOCKS 1" >>confdefs.h
11834
11835 else
11836   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
11837 *** Not using spinlocks will cause poor performance." >&5
11838 $as_echo "$as_me: WARNING:
11839 *** Not using spinlocks will cause poor performance." >&2;}
11840 fi
11841
11842 if test "$enable_atomics" = yes; then
11843
11844 $as_echo "#define HAVE_ATOMICS 1" >>confdefs.h
11845
11846 else
11847   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
11848 *** Not using atomic operations will cause poor performance." >&5
11849 $as_echo "$as_me: WARNING:
11850 *** Not using atomic operations will cause poor performance." >&2;}
11851 fi
11852
11853 if test "$with_gssapi" = yes ; then
11854   if test "$PORTNAME" != "win32"; then
11855     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gss_init_sec_context" >&5
11856 $as_echo_n "checking for library containing gss_init_sec_context... " >&6; }
11857 if ${ac_cv_search_gss_init_sec_context+:} false; then :
11858   $as_echo_n "(cached) " >&6
11859 else
11860   ac_func_search_save_LIBS=$LIBS
11861 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11862 /* end confdefs.h.  */
11863
11864 /* Override any GCC internal prototype to avoid an error.
11865    Use char because int might match the return type of a GCC
11866    builtin and then its argument prototype would still apply.  */
11867 #ifdef __cplusplus
11868 extern "C"
11869 #endif
11870 char gss_init_sec_context ();
11871 int
11872 main ()
11873 {
11874 return gss_init_sec_context ();
11875   ;
11876   return 0;
11877 }
11878 _ACEOF
11879 for ac_lib in '' gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'; do
11880   if test -z "$ac_lib"; then
11881     ac_res="none required"
11882   else
11883     ac_res=-l$ac_lib
11884     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11885   fi
11886   if ac_fn_c_try_link "$LINENO"; then :
11887   ac_cv_search_gss_init_sec_context=$ac_res
11888 fi
11889 rm -f core conftest.err conftest.$ac_objext \
11890     conftest$ac_exeext
11891   if ${ac_cv_search_gss_init_sec_context+:} false; then :
11892   break
11893 fi
11894 done
11895 if ${ac_cv_search_gss_init_sec_context+:} false; then :
11896
11897 else
11898   ac_cv_search_gss_init_sec_context=no
11899 fi
11900 rm conftest.$ac_ext
11901 LIBS=$ac_func_search_save_LIBS
11902 fi
11903 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gss_init_sec_context" >&5
11904 $as_echo "$ac_cv_search_gss_init_sec_context" >&6; }
11905 ac_res=$ac_cv_search_gss_init_sec_context
11906 if test "$ac_res" != no; then :
11907   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11908
11909 else
11910   as_fn_error $? "could not find function 'gss_init_sec_context' required for GSSAPI" "$LINENO" 5
11911 fi
11912
11913   else
11914     LIBS="$LIBS -lgssapi32"
11915   fi
11916 fi
11917
11918 if test "$with_openssl" = yes ; then
11919     if test "$PORTNAME" != "win32"; then
11920      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5
11921 $as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; }
11922 if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then :
11923   $as_echo_n "(cached) " >&6
11924 else
11925   ac_check_lib_save_LIBS=$LIBS
11926 LIBS="-lcrypto  $LIBS"
11927 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11928 /* end confdefs.h.  */
11929
11930 /* Override any GCC internal prototype to avoid an error.
11931    Use char because int might match the return type of a GCC
11932    builtin and then its argument prototype would still apply.  */
11933 #ifdef __cplusplus
11934 extern "C"
11935 #endif
11936 char CRYPTO_new_ex_data ();
11937 int
11938 main ()
11939 {
11940 return CRYPTO_new_ex_data ();
11941   ;
11942   return 0;
11943 }
11944 _ACEOF
11945 if ac_fn_c_try_link "$LINENO"; then :
11946   ac_cv_lib_crypto_CRYPTO_new_ex_data=yes
11947 else
11948   ac_cv_lib_crypto_CRYPTO_new_ex_data=no
11949 fi
11950 rm -f core conftest.err conftest.$ac_objext \
11951     conftest$ac_exeext conftest.$ac_ext
11952 LIBS=$ac_check_lib_save_LIBS
11953 fi
11954 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5
11955 $as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; }
11956 if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then :
11957   cat >>confdefs.h <<_ACEOF
11958 #define HAVE_LIBCRYPTO 1
11959 _ACEOF
11960
11961   LIBS="-lcrypto $LIBS"
11962
11963 else
11964   as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5
11965 fi
11966
11967      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl" >&5
11968 $as_echo_n "checking for SSL_new in -lssl... " >&6; }
11969 if ${ac_cv_lib_ssl_SSL_new+:} false; then :
11970   $as_echo_n "(cached) " >&6
11971 else
11972   ac_check_lib_save_LIBS=$LIBS
11973 LIBS="-lssl  $LIBS"
11974 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11975 /* end confdefs.h.  */
11976
11977 /* Override any GCC internal prototype to avoid an error.
11978    Use char because int might match the return type of a GCC
11979    builtin and then its argument prototype would still apply.  */
11980 #ifdef __cplusplus
11981 extern "C"
11982 #endif
11983 char SSL_new ();
11984 int
11985 main ()
11986 {
11987 return SSL_new ();
11988   ;
11989   return 0;
11990 }
11991 _ACEOF
11992 if ac_fn_c_try_link "$LINENO"; then :
11993   ac_cv_lib_ssl_SSL_new=yes
11994 else
11995   ac_cv_lib_ssl_SSL_new=no
11996 fi
11997 rm -f core conftest.err conftest.$ac_objext \
11998     conftest$ac_exeext conftest.$ac_ext
11999 LIBS=$ac_check_lib_save_LIBS
12000 fi
12001 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_new" >&5
12002 $as_echo "$ac_cv_lib_ssl_SSL_new" >&6; }
12003 if test "x$ac_cv_lib_ssl_SSL_new" = xyes; then :
12004   cat >>confdefs.h <<_ACEOF
12005 #define HAVE_LIBSSL 1
12006 _ACEOF
12007
12008   LIBS="-lssl $LIBS"
12009
12010 else
12011   as_fn_error $? "library 'ssl' is required for OpenSSL" "$LINENO" 5
12012 fi
12013
12014   else
12015      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing CRYPTO_new_ex_data" >&5
12016 $as_echo_n "checking for library containing CRYPTO_new_ex_data... " >&6; }
12017 if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
12018   $as_echo_n "(cached) " >&6
12019 else
12020   ac_func_search_save_LIBS=$LIBS
12021 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12022 /* end confdefs.h.  */
12023
12024 /* Override any GCC internal prototype to avoid an error.
12025    Use char because int might match the return type of a GCC
12026    builtin and then its argument prototype would still apply.  */
12027 #ifdef __cplusplus
12028 extern "C"
12029 #endif
12030 char CRYPTO_new_ex_data ();
12031 int
12032 main ()
12033 {
12034 return CRYPTO_new_ex_data ();
12035   ;
12036   return 0;
12037 }
12038 _ACEOF
12039 for ac_lib in '' eay32 crypto; do
12040   if test -z "$ac_lib"; then
12041     ac_res="none required"
12042   else
12043     ac_res=-l$ac_lib
12044     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
12045   fi
12046   if ac_fn_c_try_link "$LINENO"; then :
12047   ac_cv_search_CRYPTO_new_ex_data=$ac_res
12048 fi
12049 rm -f core conftest.err conftest.$ac_objext \
12050     conftest$ac_exeext
12051   if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
12052   break
12053 fi
12054 done
12055 if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
12056
12057 else
12058   ac_cv_search_CRYPTO_new_ex_data=no
12059 fi
12060 rm conftest.$ac_ext
12061 LIBS=$ac_func_search_save_LIBS
12062 fi
12063 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_CRYPTO_new_ex_data" >&5
12064 $as_echo "$ac_cv_search_CRYPTO_new_ex_data" >&6; }
12065 ac_res=$ac_cv_search_CRYPTO_new_ex_data
12066 if test "$ac_res" != no; then :
12067   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
12068
12069 else
12070   as_fn_error $? "library 'eay32' or 'crypto' is required for OpenSSL" "$LINENO" 5
12071 fi
12072
12073      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_new" >&5
12074 $as_echo_n "checking for library containing SSL_new... " >&6; }
12075 if ${ac_cv_search_SSL_new+:} false; then :
12076   $as_echo_n "(cached) " >&6
12077 else
12078   ac_func_search_save_LIBS=$LIBS
12079 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12080 /* end confdefs.h.  */
12081
12082 /* Override any GCC internal prototype to avoid an error.
12083    Use char because int might match the return type of a GCC
12084    builtin and then its argument prototype would still apply.  */
12085 #ifdef __cplusplus
12086 extern "C"
12087 #endif
12088 char SSL_new ();
12089 int
12090 main ()
12091 {
12092 return SSL_new ();
12093   ;
12094   return 0;
12095 }
12096 _ACEOF
12097 for ac_lib in '' ssleay32 ssl; do
12098   if test -z "$ac_lib"; then
12099     ac_res="none required"
12100   else
12101     ac_res=-l$ac_lib
12102     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
12103   fi
12104   if ac_fn_c_try_link "$LINENO"; then :
12105   ac_cv_search_SSL_new=$ac_res
12106 fi
12107 rm -f core conftest.err conftest.$ac_objext \
12108     conftest$ac_exeext
12109   if ${ac_cv_search_SSL_new+:} false; then :
12110   break
12111 fi
12112 done
12113 if ${ac_cv_search_SSL_new+:} false; then :
12114
12115 else
12116   ac_cv_search_SSL_new=no
12117 fi
12118 rm conftest.$ac_ext
12119 LIBS=$ac_func_search_save_LIBS
12120 fi
12121 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SSL_new" >&5
12122 $as_echo "$ac_cv_search_SSL_new" >&6; }
12123 ac_res=$ac_cv_search_SSL_new
12124 if test "$ac_res" != no; then :
12125   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
12126
12127 else
12128   as_fn_error $? "library 'ssleay32' or 'ssl' is required for OpenSSL" "$LINENO" 5
12129 fi
12130
12131   fi
12132   for ac_func in SSL_clear_options SSL_get_current_compression X509_get_signature_nid
12133 do :
12134   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
12135 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
12136 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
12137   cat >>confdefs.h <<_ACEOF
12138 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
12139 _ACEOF
12140
12141 fi
12142 done
12143
12144   # Functions introduced in OpenSSL 1.1.0. We used to check for
12145   # OPENSSL_VERSION_NUMBER, but that didn't work with 1.1.0, because LibreSSL
12146   # defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it
12147   # doesn't have these OpenSSL 1.1.0 functions. So check for individual
12148   # functions.
12149   for ac_func in OPENSSL_init_ssl BIO_get_data BIO_meth_new ASN1_STRING_get0_data RAND_OpenSSL
12150 do :
12151   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
12152 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
12153 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
12154   cat >>confdefs.h <<_ACEOF
12155 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
12156 _ACEOF
12157
12158 fi
12159 done
12160
12161   # OpenSSL versions before 1.1.0 required setting callback functions, for
12162   # thread-safety. In 1.1.0, it's no longer required, and CRYPTO_lock()
12163   # function was removed.
12164   for ac_func in CRYPTO_lock
12165 do :
12166   ac_fn_c_check_func "$LINENO" "CRYPTO_lock" "ac_cv_func_CRYPTO_lock"
12167 if test "x$ac_cv_func_CRYPTO_lock" = xyes; then :
12168   cat >>confdefs.h <<_ACEOF
12169 #define HAVE_CRYPTO_LOCK 1
12170 _ACEOF
12171
12172 fi
12173 done
12174
12175 fi
12176
12177 if test "$with_pam" = yes ; then
12178   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5
12179 $as_echo_n "checking for pam_start in -lpam... " >&6; }
12180 if ${ac_cv_lib_pam_pam_start+:} false; then :
12181   $as_echo_n "(cached) " >&6
12182 else
12183   ac_check_lib_save_LIBS=$LIBS
12184 LIBS="-lpam  $LIBS"
12185 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12186 /* end confdefs.h.  */
12187
12188 /* Override any GCC internal prototype to avoid an error.
12189    Use char because int might match the return type of a GCC
12190    builtin and then its argument prototype would still apply.  */
12191 #ifdef __cplusplus
12192 extern "C"
12193 #endif
12194 char pam_start ();
12195 int
12196 main ()
12197 {
12198 return pam_start ();
12199   ;
12200   return 0;
12201 }
12202 _ACEOF
12203 if ac_fn_c_try_link "$LINENO"; then :
12204   ac_cv_lib_pam_pam_start=yes
12205 else
12206   ac_cv_lib_pam_pam_start=no
12207 fi
12208 rm -f core conftest.err conftest.$ac_objext \
12209     conftest$ac_exeext conftest.$ac_ext
12210 LIBS=$ac_check_lib_save_LIBS
12211 fi
12212 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5
12213 $as_echo "$ac_cv_lib_pam_pam_start" >&6; }
12214 if test "x$ac_cv_lib_pam_pam_start" = xyes; then :
12215   cat >>confdefs.h <<_ACEOF
12216 #define HAVE_LIBPAM 1
12217 _ACEOF
12218
12219   LIBS="-lpam $LIBS"
12220
12221 else
12222   as_fn_error $? "library 'pam' is required for PAM" "$LINENO" 5
12223 fi
12224
12225 fi
12226
12227 if test "$with_libxml" = yes ; then
12228   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlSaveToBuffer in -lxml2" >&5
12229 $as_echo_n "checking for xmlSaveToBuffer in -lxml2... " >&6; }
12230 if ${ac_cv_lib_xml2_xmlSaveToBuffer+:} false; then :
12231   $as_echo_n "(cached) " >&6
12232 else
12233   ac_check_lib_save_LIBS=$LIBS
12234 LIBS="-lxml2  $LIBS"
12235 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12236 /* end confdefs.h.  */
12237
12238 /* Override any GCC internal prototype to avoid an error.
12239    Use char because int might match the return type of a GCC
12240    builtin and then its argument prototype would still apply.  */
12241 #ifdef __cplusplus
12242 extern "C"
12243 #endif
12244 char xmlSaveToBuffer ();
12245 int
12246 main ()
12247 {
12248 return xmlSaveToBuffer ();
12249   ;
12250   return 0;
12251 }
12252 _ACEOF
12253 if ac_fn_c_try_link "$LINENO"; then :
12254   ac_cv_lib_xml2_xmlSaveToBuffer=yes
12255 else
12256   ac_cv_lib_xml2_xmlSaveToBuffer=no
12257 fi
12258 rm -f core conftest.err conftest.$ac_objext \
12259     conftest$ac_exeext conftest.$ac_ext
12260 LIBS=$ac_check_lib_save_LIBS
12261 fi
12262 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlSaveToBuffer" >&5
12263 $as_echo "$ac_cv_lib_xml2_xmlSaveToBuffer" >&6; }
12264 if test "x$ac_cv_lib_xml2_xmlSaveToBuffer" = xyes; then :
12265   cat >>confdefs.h <<_ACEOF
12266 #define HAVE_LIBXML2 1
12267 _ACEOF
12268
12269   LIBS="-lxml2 $LIBS"
12270
12271 else
12272   as_fn_error $? "library 'xml2' (version >= 2.6.23) is required for XML support" "$LINENO" 5
12273 fi
12274
12275 fi
12276
12277 if test "$with_libxslt" = yes ; then
12278   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xsltCleanupGlobals in -lxslt" >&5
12279 $as_echo_n "checking for xsltCleanupGlobals in -lxslt... " >&6; }
12280 if ${ac_cv_lib_xslt_xsltCleanupGlobals+:} false; then :
12281   $as_echo_n "(cached) " >&6
12282 else
12283   ac_check_lib_save_LIBS=$LIBS
12284 LIBS="-lxslt  $LIBS"
12285 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12286 /* end confdefs.h.  */
12287
12288 /* Override any GCC internal prototype to avoid an error.
12289    Use char because int might match the return type of a GCC
12290    builtin and then its argument prototype would still apply.  */
12291 #ifdef __cplusplus
12292 extern "C"
12293 #endif
12294 char xsltCleanupGlobals ();
12295 int
12296 main ()
12297 {
12298 return xsltCleanupGlobals ();
12299   ;
12300   return 0;
12301 }
12302 _ACEOF
12303 if ac_fn_c_try_link "$LINENO"; then :
12304   ac_cv_lib_xslt_xsltCleanupGlobals=yes
12305 else
12306   ac_cv_lib_xslt_xsltCleanupGlobals=no
12307 fi
12308 rm -f core conftest.err conftest.$ac_objext \
12309     conftest$ac_exeext conftest.$ac_ext
12310 LIBS=$ac_check_lib_save_LIBS
12311 fi
12312 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xslt_xsltCleanupGlobals" >&5
12313 $as_echo "$ac_cv_lib_xslt_xsltCleanupGlobals" >&6; }
12314 if test "x$ac_cv_lib_xslt_xsltCleanupGlobals" = xyes; then :
12315   cat >>confdefs.h <<_ACEOF
12316 #define HAVE_LIBXSLT 1
12317 _ACEOF
12318
12319   LIBS="-lxslt $LIBS"
12320
12321 else
12322   as_fn_error $? "library 'xslt' is required for XSLT support" "$LINENO" 5
12323 fi
12324
12325 fi
12326
12327 # Note: We can test for libldap_r only after we know PTHREAD_LIBS
12328 if test "$with_ldap" = yes ; then
12329   _LIBS="$LIBS"
12330   if test "$PORTNAME" != "win32"; then
12331     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
12332 $as_echo_n "checking for ldap_bind in -lldap... " >&6; }
12333 if ${ac_cv_lib_ldap_ldap_bind+:} false; then :
12334   $as_echo_n "(cached) " >&6
12335 else
12336   ac_check_lib_save_LIBS=$LIBS
12337 LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
12338 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12339 /* end confdefs.h.  */
12340
12341 /* Override any GCC internal prototype to avoid an error.
12342    Use char because int might match the return type of a GCC
12343    builtin and then its argument prototype would still apply.  */
12344 #ifdef __cplusplus
12345 extern "C"
12346 #endif
12347 char ldap_bind ();
12348 int
12349 main ()
12350 {
12351 return ldap_bind ();
12352   ;
12353   return 0;
12354 }
12355 _ACEOF
12356 if ac_fn_c_try_link "$LINENO"; then :
12357   ac_cv_lib_ldap_ldap_bind=yes
12358 else
12359   ac_cv_lib_ldap_ldap_bind=no
12360 fi
12361 rm -f core conftest.err conftest.$ac_objext \
12362     conftest$ac_exeext conftest.$ac_ext
12363 LIBS=$ac_check_lib_save_LIBS
12364 fi
12365 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
12366 $as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
12367 if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
12368   cat >>confdefs.h <<_ACEOF
12369 #define HAVE_LIBLDAP 1
12370 _ACEOF
12371
12372   LIBS="-lldap $LIBS"
12373
12374 else
12375   as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
12376 fi
12377
12378     LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12379     if test "$enable_thread_safety" = yes; then
12380       # on some platforms ldap_r fails to link without PTHREAD_LIBS
12381       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_simple_bind in -lldap_r" >&5
12382 $as_echo_n "checking for ldap_simple_bind in -lldap_r... " >&6; }
12383 if ${ac_cv_lib_ldap_r_ldap_simple_bind+:} false; then :
12384   $as_echo_n "(cached) " >&6
12385 else
12386   ac_check_lib_save_LIBS=$LIBS
12387 LIBS="-lldap_r $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $LIBS"
12388 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12389 /* end confdefs.h.  */
12390
12391 /* Override any GCC internal prototype to avoid an error.
12392    Use char because int might match the return type of a GCC
12393    builtin and then its argument prototype would still apply.  */
12394 #ifdef __cplusplus
12395 extern "C"
12396 #endif
12397 char ldap_simple_bind ();
12398 int
12399 main ()
12400 {
12401 return ldap_simple_bind ();
12402   ;
12403   return 0;
12404 }
12405 _ACEOF
12406 if ac_fn_c_try_link "$LINENO"; then :
12407   ac_cv_lib_ldap_r_ldap_simple_bind=yes
12408 else
12409   ac_cv_lib_ldap_r_ldap_simple_bind=no
12410 fi
12411 rm -f core conftest.err conftest.$ac_objext \
12412     conftest$ac_exeext conftest.$ac_ext
12413 LIBS=$ac_check_lib_save_LIBS
12414 fi
12415 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_r_ldap_simple_bind" >&5
12416 $as_echo "$ac_cv_lib_ldap_r_ldap_simple_bind" >&6; }
12417 if test "x$ac_cv_lib_ldap_r_ldap_simple_bind" = xyes; then :
12418   cat >>confdefs.h <<_ACEOF
12419 #define HAVE_LIBLDAP_R 1
12420 _ACEOF
12421
12422   LIBS="-lldap_r $LIBS"
12423
12424 else
12425   as_fn_error $? "library 'ldap_r' is required for LDAP" "$LINENO" 5
12426 fi
12427
12428       LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS"
12429     else
12430       LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
12431     fi
12432     for ac_func in ldap_initialize
12433 do :
12434   ac_fn_c_check_func "$LINENO" "ldap_initialize" "ac_cv_func_ldap_initialize"
12435 if test "x$ac_cv_func_ldap_initialize" = xyes; then :
12436   cat >>confdefs.h <<_ACEOF
12437 #define HAVE_LDAP_INITIALIZE 1
12438 _ACEOF
12439
12440 fi
12441 done
12442
12443   else
12444     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lwldap32" >&5
12445 $as_echo_n "checking for ldap_bind in -lwldap32... " >&6; }
12446 if ${ac_cv_lib_wldap32_ldap_bind+:} false; then :
12447   $as_echo_n "(cached) " >&6
12448 else
12449   ac_check_lib_save_LIBS=$LIBS
12450 LIBS="-lwldap32  $LIBS"
12451 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12452 /* end confdefs.h.  */
12453
12454 /* Override any GCC internal prototype to avoid an error.
12455    Use char because int might match the return type of a GCC
12456    builtin and then its argument prototype would still apply.  */
12457 #ifdef __cplusplus
12458 extern "C"
12459 #endif
12460 char ldap_bind ();
12461 int
12462 main ()
12463 {
12464 return ldap_bind ();
12465   ;
12466   return 0;
12467 }
12468 _ACEOF
12469 if ac_fn_c_try_link "$LINENO"; then :
12470   ac_cv_lib_wldap32_ldap_bind=yes
12471 else
12472   ac_cv_lib_wldap32_ldap_bind=no
12473 fi
12474 rm -f core conftest.err conftest.$ac_objext \
12475     conftest$ac_exeext conftest.$ac_ext
12476 LIBS=$ac_check_lib_save_LIBS
12477 fi
12478 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wldap32_ldap_bind" >&5
12479 $as_echo "$ac_cv_lib_wldap32_ldap_bind" >&6; }
12480 if test "x$ac_cv_lib_wldap32_ldap_bind" = xyes; then :
12481   cat >>confdefs.h <<_ACEOF
12482 #define HAVE_LIBWLDAP32 1
12483 _ACEOF
12484
12485   LIBS="-lwldap32 $LIBS"
12486
12487 else
12488   as_fn_error $? "library 'wldap32' is required for LDAP" "$LINENO" 5
12489 fi
12490
12491     LDAP_LIBS_FE="-lwldap32"
12492     LDAP_LIBS_BE="-lwldap32"
12493   fi
12494   LIBS="$_LIBS"
12495 fi
12496
12497
12498
12499 # for contrib/sepgsql
12500 if test "$with_selinux" = yes; then
12501   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_compute_create_name in -lselinux" >&5
12502 $as_echo_n "checking for security_compute_create_name in -lselinux... " >&6; }
12503 if ${ac_cv_lib_selinux_security_compute_create_name+:} false; then :
12504   $as_echo_n "(cached) " >&6
12505 else
12506   ac_check_lib_save_LIBS=$LIBS
12507 LIBS="-lselinux  $LIBS"
12508 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12509 /* end confdefs.h.  */
12510
12511 /* Override any GCC internal prototype to avoid an error.
12512    Use char because int might match the return type of a GCC
12513    builtin and then its argument prototype would still apply.  */
12514 #ifdef __cplusplus
12515 extern "C"
12516 #endif
12517 char security_compute_create_name ();
12518 int
12519 main ()
12520 {
12521 return security_compute_create_name ();
12522   ;
12523   return 0;
12524 }
12525 _ACEOF
12526 if ac_fn_c_try_link "$LINENO"; then :
12527   ac_cv_lib_selinux_security_compute_create_name=yes
12528 else
12529   ac_cv_lib_selinux_security_compute_create_name=no
12530 fi
12531 rm -f core conftest.err conftest.$ac_objext \
12532     conftest$ac_exeext conftest.$ac_ext
12533 LIBS=$ac_check_lib_save_LIBS
12534 fi
12535 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_compute_create_name" >&5
12536 $as_echo "$ac_cv_lib_selinux_security_compute_create_name" >&6; }
12537 if test "x$ac_cv_lib_selinux_security_compute_create_name" = xyes; then :
12538   cat >>confdefs.h <<_ACEOF
12539 #define HAVE_LIBSELINUX 1
12540 _ACEOF
12541
12542   LIBS="-lselinux $LIBS"
12543
12544 else
12545   as_fn_error $? "library 'libselinux', version 2.1.10 or newer, is required for SELinux support" "$LINENO" 5
12546 fi
12547
12548 fi
12549
12550 # for contrib/uuid-ossp
12551 if test "$with_uuid" = bsd ; then
12552   # On BSD, the UUID functions are in libc
12553   ac_fn_c_check_func "$LINENO" "uuid_to_string" "ac_cv_func_uuid_to_string"
12554 if test "x$ac_cv_func_uuid_to_string" = xyes; then :
12555   UUID_LIBS=""
12556 else
12557   as_fn_error $? "BSD UUID functions are not present" "$LINENO" 5
12558 fi
12559
12560 elif test "$with_uuid" = e2fs ; then
12561   # On macOS, the UUID functions are in libc
12562   ac_fn_c_check_func "$LINENO" "uuid_generate" "ac_cv_func_uuid_generate"
12563 if test "x$ac_cv_func_uuid_generate" = xyes; then :
12564   UUID_LIBS=""
12565 else
12566   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5
12567 $as_echo_n "checking for uuid_generate in -luuid... " >&6; }
12568 if ${ac_cv_lib_uuid_uuid_generate+:} false; then :
12569   $as_echo_n "(cached) " >&6
12570 else
12571   ac_check_lib_save_LIBS=$LIBS
12572 LIBS="-luuid  $LIBS"
12573 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12574 /* end confdefs.h.  */
12575
12576 /* Override any GCC internal prototype to avoid an error.
12577    Use char because int might match the return type of a GCC
12578    builtin and then its argument prototype would still apply.  */
12579 #ifdef __cplusplus
12580 extern "C"
12581 #endif
12582 char uuid_generate ();
12583 int
12584 main ()
12585 {
12586 return uuid_generate ();
12587   ;
12588   return 0;
12589 }
12590 _ACEOF
12591 if ac_fn_c_try_link "$LINENO"; then :
12592   ac_cv_lib_uuid_uuid_generate=yes
12593 else
12594   ac_cv_lib_uuid_uuid_generate=no
12595 fi
12596 rm -f core conftest.err conftest.$ac_objext \
12597     conftest$ac_exeext conftest.$ac_ext
12598 LIBS=$ac_check_lib_save_LIBS
12599 fi
12600 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5
12601 $as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; }
12602 if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then :
12603   UUID_LIBS="-luuid"
12604 else
12605   as_fn_error $? "library 'uuid' is required for E2FS UUID" "$LINENO" 5
12606 fi
12607
12608 fi
12609
12610 elif test "$with_uuid" = ossp ; then
12611   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_export in -lossp-uuid" >&5
12612 $as_echo_n "checking for uuid_export in -lossp-uuid... " >&6; }
12613 if ${ac_cv_lib_ossp_uuid_uuid_export+:} false; then :
12614   $as_echo_n "(cached) " >&6
12615 else
12616   ac_check_lib_save_LIBS=$LIBS
12617 LIBS="-lossp-uuid  $LIBS"
12618 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12619 /* end confdefs.h.  */
12620
12621 /* Override any GCC internal prototype to avoid an error.
12622    Use char because int might match the return type of a GCC
12623    builtin and then its argument prototype would still apply.  */
12624 #ifdef __cplusplus
12625 extern "C"
12626 #endif
12627 char uuid_export ();
12628 int
12629 main ()
12630 {
12631 return uuid_export ();
12632   ;
12633   return 0;
12634 }
12635 _ACEOF
12636 if ac_fn_c_try_link "$LINENO"; then :
12637   ac_cv_lib_ossp_uuid_uuid_export=yes
12638 else
12639   ac_cv_lib_ossp_uuid_uuid_export=no
12640 fi
12641 rm -f core conftest.err conftest.$ac_objext \
12642     conftest$ac_exeext conftest.$ac_ext
12643 LIBS=$ac_check_lib_save_LIBS
12644 fi
12645 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossp_uuid_uuid_export" >&5
12646 $as_echo "$ac_cv_lib_ossp_uuid_uuid_export" >&6; }
12647 if test "x$ac_cv_lib_ossp_uuid_uuid_export" = xyes; then :
12648   UUID_LIBS="-lossp-uuid"
12649 else
12650   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_export in -luuid" >&5
12651 $as_echo_n "checking for uuid_export in -luuid... " >&6; }
12652 if ${ac_cv_lib_uuid_uuid_export+:} false; then :
12653   $as_echo_n "(cached) " >&6
12654 else
12655   ac_check_lib_save_LIBS=$LIBS
12656 LIBS="-luuid  $LIBS"
12657 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12658 /* end confdefs.h.  */
12659
12660 /* Override any GCC internal prototype to avoid an error.
12661    Use char because int might match the return type of a GCC
12662    builtin and then its argument prototype would still apply.  */
12663 #ifdef __cplusplus
12664 extern "C"
12665 #endif
12666 char uuid_export ();
12667 int
12668 main ()
12669 {
12670 return uuid_export ();
12671   ;
12672   return 0;
12673 }
12674 _ACEOF
12675 if ac_fn_c_try_link "$LINENO"; then :
12676   ac_cv_lib_uuid_uuid_export=yes
12677 else
12678   ac_cv_lib_uuid_uuid_export=no
12679 fi
12680 rm -f core conftest.err conftest.$ac_objext \
12681     conftest$ac_exeext conftest.$ac_ext
12682 LIBS=$ac_check_lib_save_LIBS
12683 fi
12684 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_export" >&5
12685 $as_echo "$ac_cv_lib_uuid_uuid_export" >&6; }
12686 if test "x$ac_cv_lib_uuid_uuid_export" = xyes; then :
12687   UUID_LIBS="-luuid"
12688 else
12689   as_fn_error $? "library 'ossp-uuid' or 'uuid' is required for OSSP UUID" "$LINENO" 5
12690 fi
12691
12692 fi
12693
12694 fi
12695
12696
12697
12698 ##
12699 ## Header files
12700 ##
12701
12702 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
12703 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
12704 if ${ac_cv_header_stdbool_h+:} false; then :
12705   $as_echo_n "(cached) " >&6
12706 else
12707   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12708 /* end confdefs.h.  */
12709
12710              #include <stdbool.h>
12711              #ifndef bool
12712               "error: bool is not defined"
12713              #endif
12714              #ifndef false
12715               "error: false is not defined"
12716              #endif
12717              #if false
12718               "error: false is not 0"
12719              #endif
12720              #ifndef true
12721               "error: true is not defined"
12722              #endif
12723              #if true != 1
12724               "error: true is not 1"
12725              #endif
12726              #ifndef __bool_true_false_are_defined
12727               "error: __bool_true_false_are_defined is not defined"
12728              #endif
12729
12730              struct s { _Bool s: 1; _Bool t; } s;
12731
12732              char a[true == 1 ? 1 : -1];
12733              char b[false == 0 ? 1 : -1];
12734              char c[__bool_true_false_are_defined == 1 ? 1 : -1];
12735              char d[(bool) 0.5 == true ? 1 : -1];
12736              /* See body of main program for 'e'.  */
12737              char f[(_Bool) 0.0 == false ? 1 : -1];
12738              char g[true];
12739              char h[sizeof (_Bool)];
12740              char i[sizeof s.t];
12741              enum { j = false, k = true, l = false * true, m = true * 256 };
12742              /* The following fails for
12743                 HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
12744              _Bool n[m];
12745              char o[sizeof n == m * sizeof n[0] ? 1 : -1];
12746              char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
12747              /* Catch a bug in an HP-UX C compiler.  See
12748                 http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
12749                 http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
12750               */
12751              _Bool q = true;
12752              _Bool *pq = &q;
12753
12754 int
12755 main ()
12756 {
12757
12758              bool e = &s;
12759              *pq |= q;
12760              *pq |= ! q;
12761              /* Refer to every declared value, to avoid compiler optimizations.  */
12762              return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
12763                      + !m + !n + !o + !p + !q + !pq);
12764
12765   ;
12766   return 0;
12767 }
12768 _ACEOF
12769 if ac_fn_c_try_compile "$LINENO"; then :
12770   ac_cv_header_stdbool_h=yes
12771 else
12772   ac_cv_header_stdbool_h=no
12773 fi
12774 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12775 fi
12776 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
12777 $as_echo "$ac_cv_header_stdbool_h" >&6; }
12778    ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
12779 if test "x$ac_cv_type__Bool" = xyes; then :
12780
12781 cat >>confdefs.h <<_ACEOF
12782 #define HAVE__BOOL 1
12783 _ACEOF
12784
12785
12786 fi
12787
12788
12789 if test $ac_cv_header_stdbool_h = yes; then
12790
12791 $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
12792
12793 fi
12794
12795
12796 for ac_header in atomic.h copyfile.h crypt.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/ipc.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h
12797 do :
12798   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
12799 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
12800 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
12801   cat >>confdefs.h <<_ACEOF
12802 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
12803 _ACEOF
12804
12805 fi
12806
12807 done
12808
12809
12810 # On BSD, test for net/if.h will fail unless sys/socket.h
12811 # is included first.
12812 for ac_header in net/if.h
12813 do :
12814   ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "$ac_includes_default
12815 #include <sys/socket.h>
12816
12817 "
12818 if test "x$ac_cv_header_net_if_h" = xyes; then :
12819   cat >>confdefs.h <<_ACEOF
12820 #define HAVE_NET_IF_H 1
12821 _ACEOF
12822
12823 fi
12824
12825 done
12826
12827
12828 # On OpenBSD, test for sys/ucred.h will fail unless sys/param.h
12829 # is included first.
12830 for ac_header in sys/ucred.h
12831 do :
12832   ac_fn_c_check_header_compile "$LINENO" "sys/ucred.h" "ac_cv_header_sys_ucred_h" "$ac_includes_default
12833 #include <sys/param.h>
12834
12835 "
12836 if test "x$ac_cv_header_sys_ucred_h" = xyes; then :
12837   cat >>confdefs.h <<_ACEOF
12838 #define HAVE_SYS_UCRED_H 1
12839 _ACEOF
12840
12841 fi
12842
12843 done
12844
12845
12846 # At least on IRIX, test for netinet/tcp.h will fail unless
12847 # netinet/in.h is included first.
12848 for ac_header in netinet/tcp.h
12849 do :
12850   ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default
12851 #include <netinet/in.h>
12852
12853 "
12854 if test "x$ac_cv_header_netinet_tcp_h" = xyes; then :
12855   cat >>confdefs.h <<_ACEOF
12856 #define HAVE_NETINET_TCP_H 1
12857 _ACEOF
12858
12859 fi
12860
12861 done
12862
12863
12864 if expr x"$pgac_cv_check_readline" : 'x-lreadline' >/dev/null ; then
12865   for ac_header in readline/readline.h
12866 do :
12867   ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
12868 if test "x$ac_cv_header_readline_readline_h" = xyes; then :
12869   cat >>confdefs.h <<_ACEOF
12870 #define HAVE_READLINE_READLINE_H 1
12871 _ACEOF
12872
12873 else
12874   for ac_header in readline.h
12875 do :
12876   ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
12877 if test "x$ac_cv_header_readline_h" = xyes; then :
12878   cat >>confdefs.h <<_ACEOF
12879 #define HAVE_READLINE_H 1
12880 _ACEOF
12881
12882 else
12883   as_fn_error $? "readline header not found
12884 If you have readline already installed, see config.log for details on the
12885 failure.  It is possible the compiler isn't looking in the proper directory.
12886 Use --without-readline to disable readline support." "$LINENO" 5
12887 fi
12888
12889 done
12890
12891 fi
12892
12893 done
12894
12895   for ac_header in readline/history.h
12896 do :
12897   ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
12898 if test "x$ac_cv_header_readline_history_h" = xyes; then :
12899   cat >>confdefs.h <<_ACEOF
12900 #define HAVE_READLINE_HISTORY_H 1
12901 _ACEOF
12902
12903 else
12904   for ac_header in history.h
12905 do :
12906   ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
12907 if test "x$ac_cv_header_history_h" = xyes; then :
12908   cat >>confdefs.h <<_ACEOF
12909 #define HAVE_HISTORY_H 1
12910 _ACEOF
12911
12912 else
12913   as_fn_error $? "history header not found
12914 If you have readline already installed, see config.log for details on the
12915 failure.  It is possible the compiler isn't looking in the proper directory.
12916 Use --without-readline to disable readline support." "$LINENO" 5
12917 fi
12918
12919 done
12920
12921 fi
12922
12923 done
12924
12925 fi
12926
12927 if expr x"$pgac_cv_check_readline" : 'x-ledit' >/dev/null ; then
12928 # Some installations of libedit usurp /usr/include/readline/, which seems
12929 # bad practice, since in combined installations readline will have its headers
12930 # there.  We might have to resort to AC_EGREP checks to make sure we found
12931 # the proper header...
12932   for ac_header in editline/readline.h
12933 do :
12934   ac_fn_c_check_header_mongrel "$LINENO" "editline/readline.h" "ac_cv_header_editline_readline_h" "$ac_includes_default"
12935 if test "x$ac_cv_header_editline_readline_h" = xyes; then :
12936   cat >>confdefs.h <<_ACEOF
12937 #define HAVE_EDITLINE_READLINE_H 1
12938 _ACEOF
12939
12940 else
12941   for ac_header in readline.h
12942 do :
12943   ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
12944 if test "x$ac_cv_header_readline_h" = xyes; then :
12945   cat >>confdefs.h <<_ACEOF
12946 #define HAVE_READLINE_H 1
12947 _ACEOF
12948
12949 else
12950   for ac_header in readline/readline.h
12951 do :
12952   ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
12953 if test "x$ac_cv_header_readline_readline_h" = xyes; then :
12954   cat >>confdefs.h <<_ACEOF
12955 #define HAVE_READLINE_READLINE_H 1
12956 _ACEOF
12957
12958 else
12959   as_fn_error $? "readline header not found
12960 If you have libedit already installed, see config.log for details on the
12961 failure.  It is possible the compiler isn't looking in the proper directory.
12962 Use --without-readline to disable libedit support." "$LINENO" 5
12963 fi
12964
12965 done
12966
12967 fi
12968
12969 done
12970
12971 fi
12972
12973 done
12974
12975 # Note: in a libedit installation, history.h is sometimes a dummy, and may
12976 # not be there at all.  Hence, don't complain if not found.  We must check
12977 # though, since in yet other versions it is an independent header.
12978   for ac_header in editline/history.h
12979 do :
12980   ac_fn_c_check_header_mongrel "$LINENO" "editline/history.h" "ac_cv_header_editline_history_h" "$ac_includes_default"
12981 if test "x$ac_cv_header_editline_history_h" = xyes; then :
12982   cat >>confdefs.h <<_ACEOF
12983 #define HAVE_EDITLINE_HISTORY_H 1
12984 _ACEOF
12985
12986 else
12987   for ac_header in history.h
12988 do :
12989   ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
12990 if test "x$ac_cv_header_history_h" = xyes; then :
12991   cat >>confdefs.h <<_ACEOF
12992 #define HAVE_HISTORY_H 1
12993 _ACEOF
12994
12995 else
12996   for ac_header in readline/history.h
12997 do :
12998   ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
12999 if test "x$ac_cv_header_readline_history_h" = xyes; then :
13000   cat >>confdefs.h <<_ACEOF
13001 #define HAVE_READLINE_HISTORY_H 1
13002 _ACEOF
13003
13004 fi
13005
13006 done
13007
13008 fi
13009
13010 done
13011
13012 fi
13013
13014 done
13015
13016 fi
13017
13018 if test "$with_zlib" = yes; then
13019   ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
13020 if test "x$ac_cv_header_zlib_h" = xyes; then :
13021
13022 else
13023   as_fn_error $? "zlib header not found
13024 If you have zlib already installed, see config.log for details on the
13025 failure.  It is possible the compiler isn't looking in the proper directory.
13026 Use --without-zlib to disable zlib support." "$LINENO" 5
13027 fi
13028
13029
13030 fi
13031
13032 if test "$with_gssapi" = yes ; then
13033   for ac_header in gssapi/gssapi.h
13034 do :
13035   ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default"
13036 if test "x$ac_cv_header_gssapi_gssapi_h" = xyes; then :
13037   cat >>confdefs.h <<_ACEOF
13038 #define HAVE_GSSAPI_GSSAPI_H 1
13039 _ACEOF
13040
13041 else
13042   for ac_header in gssapi.h
13043 do :
13044   ac_fn_c_check_header_mongrel "$LINENO" "gssapi.h" "ac_cv_header_gssapi_h" "$ac_includes_default"
13045 if test "x$ac_cv_header_gssapi_h" = xyes; then :
13046   cat >>confdefs.h <<_ACEOF
13047 #define HAVE_GSSAPI_H 1
13048 _ACEOF
13049
13050 else
13051   as_fn_error $? "gssapi.h header file is required for GSSAPI" "$LINENO" 5
13052 fi
13053
13054 done
13055
13056 fi
13057
13058 done
13059
13060 fi
13061
13062 if test "$with_openssl" = yes ; then
13063   ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default"
13064 if test "x$ac_cv_header_openssl_ssl_h" = xyes; then :
13065
13066 else
13067   as_fn_error $? "header file <openssl/ssl.h> is required for OpenSSL" "$LINENO" 5
13068 fi
13069
13070
13071   ac_fn_c_check_header_mongrel "$LINENO" "openssl/err.h" "ac_cv_header_openssl_err_h" "$ac_includes_default"
13072 if test "x$ac_cv_header_openssl_err_h" = xyes; then :
13073
13074 else
13075   as_fn_error $? "header file <openssl/err.h> is required for OpenSSL" "$LINENO" 5
13076 fi
13077
13078
13079 fi
13080
13081 if test "$with_pam" = yes ; then
13082   for ac_header in security/pam_appl.h
13083 do :
13084   ac_fn_c_check_header_mongrel "$LINENO" "security/pam_appl.h" "ac_cv_header_security_pam_appl_h" "$ac_includes_default"
13085 if test "x$ac_cv_header_security_pam_appl_h" = xyes; then :
13086   cat >>confdefs.h <<_ACEOF
13087 #define HAVE_SECURITY_PAM_APPL_H 1
13088 _ACEOF
13089
13090 else
13091   for ac_header in pam/pam_appl.h
13092 do :
13093   ac_fn_c_check_header_mongrel "$LINENO" "pam/pam_appl.h" "ac_cv_header_pam_pam_appl_h" "$ac_includes_default"
13094 if test "x$ac_cv_header_pam_pam_appl_h" = xyes; then :
13095   cat >>confdefs.h <<_ACEOF
13096 #define HAVE_PAM_PAM_APPL_H 1
13097 _ACEOF
13098
13099 else
13100   as_fn_error $? "header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM." "$LINENO" 5
13101 fi
13102
13103 done
13104
13105 fi
13106
13107 done
13108
13109 fi
13110
13111 if test "$with_bsd_auth" = yes ; then
13112   ac_fn_c_check_header_mongrel "$LINENO" "bsd_auth.h" "ac_cv_header_bsd_auth_h" "$ac_includes_default"
13113 if test "x$ac_cv_header_bsd_auth_h" = xyes; then :
13114
13115 else
13116   as_fn_error $? "header file <bsd_auth.h> is required for BSD Authentication support" "$LINENO" 5
13117 fi
13118
13119
13120 fi
13121
13122 if test "$with_systemd" = yes ; then
13123   ac_fn_c_check_header_mongrel "$LINENO" "systemd/sd-daemon.h" "ac_cv_header_systemd_sd_daemon_h" "$ac_includes_default"
13124 if test "x$ac_cv_header_systemd_sd_daemon_h" = xyes; then :
13125
13126 else
13127   as_fn_error $? "header file <systemd/sd-daemon.h> is required for systemd support" "$LINENO" 5
13128 fi
13129
13130
13131 fi
13132
13133 if test "$with_libxml" = yes ; then
13134   ac_fn_c_check_header_mongrel "$LINENO" "libxml/parser.h" "ac_cv_header_libxml_parser_h" "$ac_includes_default"
13135 if test "x$ac_cv_header_libxml_parser_h" = xyes; then :
13136
13137 else
13138   as_fn_error $? "header file <libxml/parser.h> is required for XML support" "$LINENO" 5
13139 fi
13140
13141
13142 fi
13143
13144 if test "$with_libxslt" = yes ; then
13145   ac_fn_c_check_header_mongrel "$LINENO" "libxslt/xslt.h" "ac_cv_header_libxslt_xslt_h" "$ac_includes_default"
13146 if test "x$ac_cv_header_libxslt_xslt_h" = xyes; then :
13147
13148 else
13149   as_fn_error $? "header file <libxslt/xslt.h> is required for XSLT support" "$LINENO" 5
13150 fi
13151
13152
13153 fi
13154
13155 if test "$with_ldap" = yes ; then
13156   if test "$PORTNAME" != "win32"; then
13157      for ac_header in ldap.h
13158 do :
13159   ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default"
13160 if test "x$ac_cv_header_ldap_h" = xyes; then :
13161   cat >>confdefs.h <<_ACEOF
13162 #define HAVE_LDAP_H 1
13163 _ACEOF
13164
13165 else
13166   as_fn_error $? "header file <ldap.h> is required for LDAP" "$LINENO" 5
13167 fi
13168
13169 done
13170
13171      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compatible LDAP implementation" >&5
13172 $as_echo_n "checking for compatible LDAP implementation... " >&6; }
13173 if ${pgac_cv_ldap_safe+:} false; then :
13174   $as_echo_n "(cached) " >&6
13175 else
13176   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13177 /* end confdefs.h.  */
13178 #include <ldap.h>
13179 #if !defined(LDAP_VENDOR_VERSION) || \
13180      (defined(LDAP_API_FEATURE_X_OPENLDAP) && \
13181       LDAP_VENDOR_VERSION >= 20424 && LDAP_VENDOR_VERSION <= 20431)
13182 choke me
13183 #endif
13184 int
13185 main ()
13186 {
13187
13188   ;
13189   return 0;
13190 }
13191 _ACEOF
13192 if ac_fn_c_try_compile "$LINENO"; then :
13193   pgac_cv_ldap_safe=yes
13194 else
13195   pgac_cv_ldap_safe=no
13196 fi
13197 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13198 fi
13199 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_ldap_safe" >&5
13200 $as_echo "$pgac_cv_ldap_safe" >&6; }
13201
13202 if test "$pgac_cv_ldap_safe" != yes; then
13203   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
13204 *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
13205 *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
13206 *** also uses LDAP will crash on exit." >&5
13207 $as_echo "$as_me: WARNING:
13208 *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
13209 *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
13210 *** also uses LDAP will crash on exit." >&2;}
13211 fi
13212   else
13213      for ac_header in winldap.h
13214 do :
13215   ac_fn_c_check_header_compile "$LINENO" "winldap.h" "ac_cv_header_winldap_h" "$ac_includes_default
13216 #include <windows.h>
13217
13218 "
13219 if test "x$ac_cv_header_winldap_h" = xyes; then :
13220   cat >>confdefs.h <<_ACEOF
13221 #define HAVE_WINLDAP_H 1
13222 _ACEOF
13223
13224 else
13225   as_fn_error $? "header file <winldap.h> is required for LDAP" "$LINENO" 5
13226 fi
13227
13228 done
13229
13230   fi
13231 fi
13232
13233 if test "$with_bonjour" = yes ; then
13234   ac_fn_c_check_header_mongrel "$LINENO" "dns_sd.h" "ac_cv_header_dns_sd_h" "$ac_includes_default"
13235 if test "x$ac_cv_header_dns_sd_h" = xyes; then :
13236
13237 else
13238   as_fn_error $? "header file <dns_sd.h> is required for Bonjour" "$LINENO" 5
13239 fi
13240
13241
13242 fi
13243
13244 # for contrib/uuid-ossp
13245 if test "$with_uuid" = bsd ; then
13246   for ac_header in uuid.h
13247 do :
13248   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
13249 if test "x$ac_cv_header_uuid_h" = xyes; then :
13250   cat >>confdefs.h <<_ACEOF
13251 #define HAVE_UUID_H 1
13252 _ACEOF
13253  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13254 /* end confdefs.h.  */
13255 #include <uuid.h>
13256
13257 _ACEOF
13258 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13259   $EGREP "uuid_to_string" >/dev/null 2>&1; then :
13260
13261 else
13262   as_fn_error $? "header file <uuid.h> does not match BSD UUID library" "$LINENO" 5
13263 fi
13264 rm -f conftest*
13265
13266 else
13267   as_fn_error $? "header file <uuid.h> is required for BSD UUID" "$LINENO" 5
13268 fi
13269
13270 done
13271
13272 elif test "$with_uuid" = e2fs ; then
13273   for ac_header in uuid/uuid.h
13274 do :
13275   ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
13276 if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
13277   cat >>confdefs.h <<_ACEOF
13278 #define HAVE_UUID_UUID_H 1
13279 _ACEOF
13280  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13281 /* end confdefs.h.  */
13282 #include <uuid/uuid.h>
13283
13284 _ACEOF
13285 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13286   $EGREP "uuid_generate" >/dev/null 2>&1; then :
13287
13288 else
13289   as_fn_error $? "header file <uuid/uuid.h> does not match E2FS UUID library" "$LINENO" 5
13290 fi
13291 rm -f conftest*
13292
13293 else
13294   for ac_header in uuid.h
13295 do :
13296   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
13297 if test "x$ac_cv_header_uuid_h" = xyes; then :
13298   cat >>confdefs.h <<_ACEOF
13299 #define HAVE_UUID_H 1
13300 _ACEOF
13301  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13302 /* end confdefs.h.  */
13303 #include <uuid.h>
13304
13305 _ACEOF
13306 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13307   $EGREP "uuid_generate" >/dev/null 2>&1; then :
13308
13309 else
13310   as_fn_error $? "header file <uuid.h> does not match E2FS UUID library" "$LINENO" 5
13311 fi
13312 rm -f conftest*
13313
13314 else
13315   as_fn_error $? "header file <uuid/uuid.h> or <uuid.h> is required for E2FS UUID" "$LINENO" 5
13316 fi
13317
13318 done
13319
13320 fi
13321
13322 done
13323
13324 elif test "$with_uuid" = ossp ; then
13325   for ac_header in ossp/uuid.h
13326 do :
13327   ac_fn_c_check_header_mongrel "$LINENO" "ossp/uuid.h" "ac_cv_header_ossp_uuid_h" "$ac_includes_default"
13328 if test "x$ac_cv_header_ossp_uuid_h" = xyes; then :
13329   cat >>confdefs.h <<_ACEOF
13330 #define HAVE_OSSP_UUID_H 1
13331 _ACEOF
13332  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13333 /* end confdefs.h.  */
13334 #include <ossp/uuid.h>
13335
13336 _ACEOF
13337 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13338   $EGREP "uuid_export" >/dev/null 2>&1; then :
13339
13340 else
13341   as_fn_error $? "header file <ossp/uuid.h> does not match OSSP UUID library" "$LINENO" 5
13342 fi
13343 rm -f conftest*
13344
13345 else
13346   for ac_header in uuid.h
13347 do :
13348   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
13349 if test "x$ac_cv_header_uuid_h" = xyes; then :
13350   cat >>confdefs.h <<_ACEOF
13351 #define HAVE_UUID_H 1
13352 _ACEOF
13353  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13354 /* end confdefs.h.  */
13355 #include <uuid.h>
13356
13357 _ACEOF
13358 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13359   $EGREP "uuid_export" >/dev/null 2>&1; then :
13360
13361 else
13362   as_fn_error $? "header file <uuid.h> does not match OSSP UUID library" "$LINENO" 5
13363 fi
13364 rm -f conftest*
13365
13366 else
13367   as_fn_error $? "header file <ossp/uuid.h> or <uuid.h> is required for OSSP UUID" "$LINENO" 5
13368 fi
13369
13370 done
13371
13372 fi
13373
13374 done
13375
13376 fi
13377
13378 if test "$PORTNAME" = "win32" ; then
13379    for ac_header in crtdefs.h
13380 do :
13381   ac_fn_c_check_header_mongrel "$LINENO" "crtdefs.h" "ac_cv_header_crtdefs_h" "$ac_includes_default"
13382 if test "x$ac_cv_header_crtdefs_h" = xyes; then :
13383   cat >>confdefs.h <<_ACEOF
13384 #define HAVE_CRTDEFS_H 1
13385 _ACEOF
13386
13387 fi
13388
13389 done
13390
13391 fi
13392
13393 ##
13394 ## Types, structures, compiler characteristics
13395 ##
13396
13397   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
13398 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
13399 if ${ac_cv_c_bigendian+:} false; then :
13400   $as_echo_n "(cached) " >&6
13401 else
13402   ac_cv_c_bigendian=unknown
13403     # See if we're dealing with a universal compiler.
13404     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13405 /* end confdefs.h.  */
13406 #ifndef __APPLE_CC__
13407                not a universal capable compiler
13408              #endif
13409              typedef int dummy;
13410
13411 _ACEOF
13412 if ac_fn_c_try_compile "$LINENO"; then :
13413
13414         # Check for potential -arch flags.  It is not universal unless
13415         # there are at least two -arch flags with different values.
13416         ac_arch=
13417         ac_prev=
13418         for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
13419          if test -n "$ac_prev"; then
13420            case $ac_word in
13421              i?86 | x86_64 | ppc | ppc64)
13422                if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
13423                  ac_arch=$ac_word
13424                else
13425                  ac_cv_c_bigendian=universal
13426                  break
13427                fi
13428                ;;
13429            esac
13430            ac_prev=
13431          elif test "x$ac_word" = "x-arch"; then
13432            ac_prev=arch
13433          fi
13434        done
13435 fi
13436 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13437     if test $ac_cv_c_bigendian = unknown; then
13438       # See if sys/param.h defines the BYTE_ORDER macro.
13439       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13440 /* end confdefs.h.  */
13441 #include <sys/types.h>
13442              #include <sys/param.h>
13443
13444 int
13445 main ()
13446 {
13447 #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
13448                      && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
13449                      && LITTLE_ENDIAN)
13450               bogus endian macros
13451              #endif
13452
13453   ;
13454   return 0;
13455 }
13456 _ACEOF
13457 if ac_fn_c_try_compile "$LINENO"; then :
13458   # It does; now see whether it defined to BIG_ENDIAN or not.
13459          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13460 /* end confdefs.h.  */
13461 #include <sys/types.h>
13462                 #include <sys/param.h>
13463
13464 int
13465 main ()
13466 {
13467 #if BYTE_ORDER != BIG_ENDIAN
13468                  not big endian
13469                 #endif
13470
13471   ;
13472   return 0;
13473 }
13474 _ACEOF
13475 if ac_fn_c_try_compile "$LINENO"; then :
13476   ac_cv_c_bigendian=yes
13477 else
13478   ac_cv_c_bigendian=no
13479 fi
13480 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13481 fi
13482 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13483     fi
13484     if test $ac_cv_c_bigendian = unknown; then
13485       # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
13486       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13487 /* end confdefs.h.  */
13488 #include <limits.h>
13489
13490 int
13491 main ()
13492 {
13493 #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
13494               bogus endian macros
13495              #endif
13496
13497   ;
13498   return 0;
13499 }
13500 _ACEOF
13501 if ac_fn_c_try_compile "$LINENO"; then :
13502   # It does; now see whether it defined to _BIG_ENDIAN or not.
13503          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13504 /* end confdefs.h.  */
13505 #include <limits.h>
13506
13507 int
13508 main ()
13509 {
13510 #ifndef _BIG_ENDIAN
13511                  not big endian
13512                 #endif
13513
13514   ;
13515   return 0;
13516 }
13517 _ACEOF
13518 if ac_fn_c_try_compile "$LINENO"; then :
13519   ac_cv_c_bigendian=yes
13520 else
13521   ac_cv_c_bigendian=no
13522 fi
13523 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13524 fi
13525 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13526     fi
13527     if test $ac_cv_c_bigendian = unknown; then
13528       # Compile a test program.
13529       if test "$cross_compiling" = yes; then :
13530   # Try to guess by grepping values from an object file.
13531          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13532 /* end confdefs.h.  */
13533 short int ascii_mm[] =
13534                   { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
13535                 short int ascii_ii[] =
13536                   { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
13537                 int use_ascii (int i) {
13538                   return ascii_mm[i] + ascii_ii[i];
13539                 }
13540                 short int ebcdic_ii[] =
13541                   { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
13542                 short int ebcdic_mm[] =
13543                   { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
13544                 int use_ebcdic (int i) {
13545                   return ebcdic_mm[i] + ebcdic_ii[i];
13546                 }
13547                 extern int foo;
13548
13549 int
13550 main ()
13551 {
13552 return use_ascii (foo) == use_ebcdic (foo);
13553   ;
13554   return 0;
13555 }
13556 _ACEOF
13557 if ac_fn_c_try_compile "$LINENO"; then :
13558   if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
13559               ac_cv_c_bigendian=yes
13560             fi
13561             if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
13562               if test "$ac_cv_c_bigendian" = unknown; then
13563                 ac_cv_c_bigendian=no
13564               else
13565                 # finding both strings is unlikely to happen, but who knows?
13566                 ac_cv_c_bigendian=unknown
13567               fi
13568             fi
13569 fi
13570 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13571 else
13572   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13573 /* end confdefs.h.  */
13574 $ac_includes_default
13575 int
13576 main ()
13577 {
13578
13579              /* Are we little or big endian?  From Harbison&Steele.  */
13580              union
13581              {
13582                long int l;
13583                char c[sizeof (long int)];
13584              } u;
13585              u.l = 1;
13586              return u.c[sizeof (long int) - 1] == 1;
13587
13588   ;
13589   return 0;
13590 }
13591 _ACEOF
13592 if ac_fn_c_try_run "$LINENO"; then :
13593   ac_cv_c_bigendian=no
13594 else
13595   ac_cv_c_bigendian=yes
13596 fi
13597 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13598   conftest.$ac_objext conftest.beam conftest.$ac_ext
13599 fi
13600
13601     fi
13602 fi
13603 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
13604 $as_echo "$ac_cv_c_bigendian" >&6; }
13605  case $ac_cv_c_bigendian in #(
13606    yes)
13607      $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
13608 ;; #(
13609    no)
13610       ;; #(
13611    universal)
13612
13613 $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
13614
13615      ;; #(
13616    *)
13617      as_fn_error $? "unknown endianness
13618  presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
13619  esac
13620
13621 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
13622 $as_echo_n "checking for inline... " >&6; }
13623 if ${ac_cv_c_inline+:} false; then :
13624   $as_echo_n "(cached) " >&6
13625 else
13626   ac_cv_c_inline=no
13627 for ac_kw in inline __inline__ __inline; do
13628   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13629 /* end confdefs.h.  */
13630 #ifndef __cplusplus
13631 typedef int foo_t;
13632 static $ac_kw foo_t static_foo () {return 0; }
13633 $ac_kw foo_t foo () {return 0; }
13634 #endif
13635
13636 _ACEOF
13637 if ac_fn_c_try_compile "$LINENO"; then :
13638   ac_cv_c_inline=$ac_kw
13639 fi
13640 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13641   test "$ac_cv_c_inline" != no && break
13642 done
13643
13644 fi
13645 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
13646 $as_echo "$ac_cv_c_inline" >&6; }
13647
13648 case $ac_cv_c_inline in
13649   inline | yes) ;;
13650   *)
13651     case $ac_cv_c_inline in
13652       no) ac_val=;;
13653       *) ac_val=$ac_cv_c_inline;;
13654     esac
13655     cat >>confdefs.h <<_ACEOF
13656 #ifndef __cplusplus
13657 #define inline $ac_val
13658 #endif
13659 _ACEOF
13660     ;;
13661 esac
13662
13663 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf format archetype" >&5
13664 $as_echo_n "checking for printf format archetype... " >&6; }
13665 if ${pgac_cv_printf_archetype+:} false; then :
13666   $as_echo_n "(cached) " >&6
13667 else
13668   pgac_cv_printf_archetype=gnu_printf
13669 ac_save_c_werror_flag=$ac_c_werror_flag
13670 ac_c_werror_flag=yes
13671 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13672 /* end confdefs.h.  */
13673 extern void pgac_write(int ignore, const char *fmt,...)
13674 __attribute__((format($pgac_cv_printf_archetype, 2, 3)));
13675 int
13676 main ()
13677 {
13678 pgac_write(0, "error %s: %m", "foo");
13679   ;
13680   return 0;
13681 }
13682 _ACEOF
13683 if ac_fn_c_try_compile "$LINENO"; then :
13684   ac_archetype_ok=yes
13685 else
13686   ac_archetype_ok=no
13687 fi
13688 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13689 ac_c_werror_flag=$ac_save_c_werror_flag
13690
13691 if [ "$ac_archetype_ok" = no ]; then
13692   pgac_cv_printf_archetype=__syslog__
13693   ac_save_c_werror_flag=$ac_c_werror_flag
13694 ac_c_werror_flag=yes
13695 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13696 /* end confdefs.h.  */
13697 extern void pgac_write(int ignore, const char *fmt,...)
13698 __attribute__((format($pgac_cv_printf_archetype, 2, 3)));
13699 int
13700 main ()
13701 {
13702 pgac_write(0, "error %s: %m", "foo");
13703   ;
13704   return 0;
13705 }
13706 _ACEOF
13707 if ac_fn_c_try_compile "$LINENO"; then :
13708   ac_archetype_ok=yes
13709 else
13710   ac_archetype_ok=no
13711 fi
13712 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13713 ac_c_werror_flag=$ac_save_c_werror_flag
13714
13715   if [ "$ac_archetype_ok" = no ]; then
13716     pgac_cv_printf_archetype=printf
13717   fi
13718 fi
13719 fi
13720 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_printf_archetype" >&5
13721 $as_echo "$pgac_cv_printf_archetype" >&6; }
13722
13723 cat >>confdefs.h <<_ACEOF
13724 #define PG_PRINTF_ATTRIBUTE $pgac_cv_printf_archetype
13725 _ACEOF
13726
13727
13728
13729   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array members" >&5
13730 $as_echo_n "checking for flexible array members... " >&6; }
13731 if ${ac_cv_c_flexmember+:} false; then :
13732   $as_echo_n "(cached) " >&6
13733 else
13734   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13735 /* end confdefs.h.  */
13736 #include <stdlib.h>
13737             #include <stdio.h>
13738             #include <stddef.h>
13739             struct s { int n; double d[]; };
13740 int
13741 main ()
13742 {
13743 int m = getchar ();
13744             struct s *p = malloc (offsetof (struct s, d)
13745                                   + m * sizeof (double));
13746             p->d[0] = 0.0;
13747             return p->d != (double *) NULL;
13748   ;
13749   return 0;
13750 }
13751 _ACEOF
13752 if ac_fn_c_try_compile "$LINENO"; then :
13753   ac_cv_c_flexmember=yes
13754 else
13755   ac_cv_c_flexmember=no
13756 fi
13757 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13758 fi
13759 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
13760 $as_echo "$ac_cv_c_flexmember" >&6; }
13761   if test $ac_cv_c_flexmember = yes; then
13762
13763 $as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
13764
13765   else
13766     $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
13767
13768   fi
13769
13770 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed types" >&5
13771 $as_echo_n "checking for signed types... " >&6; }
13772 if ${pgac_cv_c_signed+:} false; then :
13773   $as_echo_n "(cached) " >&6
13774 else
13775   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13776 /* end confdefs.h.  */
13777
13778 int
13779 main ()
13780 {
13781 signed char c; signed short s; signed int i;
13782   ;
13783   return 0;
13784 }
13785 _ACEOF
13786 if ac_fn_c_try_compile "$LINENO"; then :
13787   pgac_cv_c_signed=yes
13788 else
13789   pgac_cv_c_signed=no
13790 fi
13791 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13792 fi
13793 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_signed" >&5
13794 $as_echo "$pgac_cv_c_signed" >&6; }
13795 if test x"$pgac_cv_c_signed" = xno ; then
13796
13797 $as_echo "#define signed /**/" >>confdefs.h
13798
13799 fi
13800 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __func__" >&5
13801 $as_echo_n "checking for __func__... " >&6; }
13802 if ${pgac_cv_funcname_func_support+:} false; then :
13803   $as_echo_n "(cached) " >&6
13804 else
13805   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13806 /* end confdefs.h.  */
13807 #include <stdio.h>
13808 int
13809 main ()
13810 {
13811 printf("%s\n", __func__);
13812   ;
13813   return 0;
13814 }
13815 _ACEOF
13816 if ac_fn_c_try_compile "$LINENO"; then :
13817   pgac_cv_funcname_func_support=yes
13818 else
13819   pgac_cv_funcname_func_support=no
13820 fi
13821 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13822 fi
13823 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_func_support" >&5
13824 $as_echo "$pgac_cv_funcname_func_support" >&6; }
13825 if test x"$pgac_cv_funcname_func_support" = xyes ; then
13826
13827 $as_echo "#define HAVE_FUNCNAME__FUNC 1" >>confdefs.h
13828
13829 else
13830 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __FUNCTION__" >&5
13831 $as_echo_n "checking for __FUNCTION__... " >&6; }
13832 if ${pgac_cv_funcname_function_support+:} false; then :
13833   $as_echo_n "(cached) " >&6
13834 else
13835   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13836 /* end confdefs.h.  */
13837 #include <stdio.h>
13838 int
13839 main ()
13840 {
13841 printf("%s\n", __FUNCTION__);
13842   ;
13843   return 0;
13844 }
13845 _ACEOF
13846 if ac_fn_c_try_compile "$LINENO"; then :
13847   pgac_cv_funcname_function_support=yes
13848 else
13849   pgac_cv_funcname_function_support=no
13850 fi
13851 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13852 fi
13853 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_function_support" >&5
13854 $as_echo "$pgac_cv_funcname_function_support" >&6; }
13855 if test x"$pgac_cv_funcname_function_support" = xyes ; then
13856
13857 $as_echo "#define HAVE_FUNCNAME__FUNCTION 1" >>confdefs.h
13858
13859 fi
13860 fi
13861 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Static_assert" >&5
13862 $as_echo_n "checking for _Static_assert... " >&6; }
13863 if ${pgac_cv__static_assert+:} false; then :
13864   $as_echo_n "(cached) " >&6
13865 else
13866   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13867 /* end confdefs.h.  */
13868
13869 int
13870 main ()
13871 {
13872 ({ _Static_assert(1, "foo"); })
13873   ;
13874   return 0;
13875 }
13876 _ACEOF
13877 if ac_fn_c_try_link "$LINENO"; then :
13878   pgac_cv__static_assert=yes
13879 else
13880   pgac_cv__static_assert=no
13881 fi
13882 rm -f core conftest.err conftest.$ac_objext \
13883     conftest$ac_exeext conftest.$ac_ext
13884 fi
13885 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__static_assert" >&5
13886 $as_echo "$pgac_cv__static_assert" >&6; }
13887 if test x"$pgac_cv__static_assert" = xyes ; then
13888
13889 $as_echo "#define HAVE__STATIC_ASSERT 1" >>confdefs.h
13890
13891 fi
13892 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for typeof" >&5
13893 $as_echo_n "checking for typeof... " >&6; }
13894 if ${pgac_cv_c_typeof+:} false; then :
13895   $as_echo_n "(cached) " >&6
13896 else
13897   pgac_cv_c_typeof=no
13898 for pgac_kw in typeof __typeof__ decltype; do
13899   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13900 /* end confdefs.h.  */
13901
13902 int
13903 main ()
13904 {
13905 int x = 0;
13906 $pgac_kw(x) y;
13907 y = x;
13908 return y;
13909   ;
13910   return 0;
13911 }
13912 _ACEOF
13913 if ac_fn_c_try_compile "$LINENO"; then :
13914   pgac_cv_c_typeof=$pgac_kw
13915 fi
13916 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13917   test "$pgac_cv_c_typeof" != no && break
13918 done
13919 fi
13920 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_typeof" >&5
13921 $as_echo "$pgac_cv_c_typeof" >&6; }
13922 if test "$pgac_cv_c_typeof" != no; then
13923
13924 $as_echo "#define HAVE_TYPEOF 1" >>confdefs.h
13925
13926   if test "$pgac_cv_c_typeof" != typeof; then
13927
13928 cat >>confdefs.h <<_ACEOF
13929 #define typeof $pgac_cv_c_typeof
13930 _ACEOF
13931
13932   fi
13933 fi
13934 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_types_compatible_p" >&5
13935 $as_echo_n "checking for __builtin_types_compatible_p... " >&6; }
13936 if ${pgac_cv__types_compatible+:} false; then :
13937   $as_echo_n "(cached) " >&6
13938 else
13939   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13940 /* end confdefs.h.  */
13941
13942 int
13943 main ()
13944 {
13945  int x; static int y[__builtin_types_compatible_p(__typeof__(x), int)];
13946   ;
13947   return 0;
13948 }
13949 _ACEOF
13950 if ac_fn_c_try_compile "$LINENO"; then :
13951   pgac_cv__types_compatible=yes
13952 else
13953   pgac_cv__types_compatible=no
13954 fi
13955 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13956 fi
13957 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__types_compatible" >&5
13958 $as_echo "$pgac_cv__types_compatible" >&6; }
13959 if test x"$pgac_cv__types_compatible" = xyes ; then
13960
13961 $as_echo "#define HAVE__BUILTIN_TYPES_COMPATIBLE_P 1" >>confdefs.h
13962
13963 fi
13964 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_constant_p" >&5
13965 $as_echo_n "checking for __builtin_constant_p... " >&6; }
13966 if ${pgac_cv__builtin_constant_p+:} false; then :
13967   $as_echo_n "(cached) " >&6
13968 else
13969   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13970 /* end confdefs.h.  */
13971 static int x;
13972   static int y[__builtin_constant_p(x) ? x : 1];
13973   static int z[__builtin_constant_p("string literal") ? 1 : x];
13974
13975
13976 _ACEOF
13977 if ac_fn_c_try_compile "$LINENO"; then :
13978   pgac_cv__builtin_constant_p=yes
13979 else
13980   pgac_cv__builtin_constant_p=no
13981 fi
13982 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13983 fi
13984 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_constant_p" >&5
13985 $as_echo "$pgac_cv__builtin_constant_p" >&6; }
13986 if test x"$pgac_cv__builtin_constant_p" = xyes ; then
13987
13988 $as_echo "#define HAVE__BUILTIN_CONSTANT_P 1" >>confdefs.h
13989
13990 fi
13991 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_unreachable" >&5
13992 $as_echo_n "checking for __builtin_unreachable... " >&6; }
13993 if ${pgac_cv__builtin_unreachable+:} false; then :
13994   $as_echo_n "(cached) " >&6
13995 else
13996   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13997 /* end confdefs.h.  */
13998
13999 int
14000 main ()
14001 {
14002 __builtin_unreachable();
14003   ;
14004   return 0;
14005 }
14006 _ACEOF
14007 if ac_fn_c_try_link "$LINENO"; then :
14008   pgac_cv__builtin_unreachable=yes
14009 else
14010   pgac_cv__builtin_unreachable=no
14011 fi
14012 rm -f core conftest.err conftest.$ac_objext \
14013     conftest$ac_exeext conftest.$ac_ext
14014 fi
14015 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_unreachable" >&5
14016 $as_echo "$pgac_cv__builtin_unreachable" >&6; }
14017 if test x"$pgac_cv__builtin_unreachable" = xyes ; then
14018
14019 $as_echo "#define HAVE__BUILTIN_UNREACHABLE 1" >>confdefs.h
14020
14021 fi
14022 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for computed goto support" >&5
14023 $as_echo_n "checking for computed goto support... " >&6; }
14024 if ${pgac_cv_computed_goto+:} false; then :
14025   $as_echo_n "(cached) " >&6
14026 else
14027   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14028 /* end confdefs.h.  */
14029
14030 int
14031 main ()
14032 {
14033 void *labeladdrs[] = {&&my_label};
14034   goto *labeladdrs[0];
14035   my_label:
14036   return 1;
14037
14038   ;
14039   return 0;
14040 }
14041 _ACEOF
14042 if ac_fn_c_try_compile "$LINENO"; then :
14043   pgac_cv_computed_goto=yes
14044 else
14045   pgac_cv_computed_goto=no
14046 fi
14047 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14048 fi
14049 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_computed_goto" >&5
14050 $as_echo "$pgac_cv_computed_goto" >&6; }
14051 if test x"$pgac_cv_computed_goto" = xyes ; then
14052
14053 $as_echo "#define HAVE_COMPUTED_GOTO 1" >>confdefs.h
14054
14055 fi
14056 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
14057 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
14058 if ${ac_cv_struct_tm+:} false; then :
14059   $as_echo_n "(cached) " >&6
14060 else
14061   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14062 /* end confdefs.h.  */
14063 #include <sys/types.h>
14064 #include <time.h>
14065
14066 int
14067 main ()
14068 {
14069 struct tm tm;
14070                                      int *p = &tm.tm_sec;
14071                                      return !p;
14072   ;
14073   return 0;
14074 }
14075 _ACEOF
14076 if ac_fn_c_try_compile "$LINENO"; then :
14077   ac_cv_struct_tm=time.h
14078 else
14079   ac_cv_struct_tm=sys/time.h
14080 fi
14081 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14082 fi
14083 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
14084 $as_echo "$ac_cv_struct_tm" >&6; }
14085 if test $ac_cv_struct_tm = sys/time.h; then
14086
14087 $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
14088
14089 fi
14090
14091 ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h>
14092 #include <$ac_cv_struct_tm>
14093
14094 "
14095 if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
14096
14097 cat >>confdefs.h <<_ACEOF
14098 #define HAVE_STRUCT_TM_TM_ZONE 1
14099 _ACEOF
14100
14101
14102 fi
14103
14104 if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
14105
14106 $as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h
14107
14108 fi
14109 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
14110 $as_echo_n "checking for tzname... " >&6; }
14111 if ${ac_cv_var_tzname+:} false; then :
14112   $as_echo_n "(cached) " >&6
14113 else
14114   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14115 /* end confdefs.h.  */
14116 #include <stdlib.h>
14117 #include <time.h>
14118 #ifndef tzname /* For SGI.  */
14119 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
14120 #endif
14121
14122 int
14123 main ()
14124 {
14125 atoi(*tzname);
14126   ;
14127   return 0;
14128 }
14129 _ACEOF
14130 if ac_fn_c_try_link "$LINENO"; then :
14131   ac_cv_var_tzname=yes
14132 else
14133   ac_cv_var_tzname=no
14134 fi
14135 rm -f core conftest.err conftest.$ac_objext \
14136     conftest$ac_exeext conftest.$ac_ext
14137 fi
14138 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5
14139 $as_echo "$ac_cv_var_tzname" >&6; }
14140 if test $ac_cv_var_tzname = yes; then
14141
14142 $as_echo "#define HAVE_TZNAME 1" >>confdefs.h
14143
14144 fi
14145
14146 ac_fn_c_check_type "$LINENO" "union semun" "ac_cv_type_union_semun" "#include <sys/types.h>
14147 #ifdef HAVE_SYS_IPC_H
14148 #include <sys/ipc.h>
14149 #endif
14150 #ifdef HAVE_SYS_SEM_H
14151 #include <sys/sem.h>
14152 #endif
14153 "
14154 if test "x$ac_cv_type_union_semun" = xyes; then :
14155
14156 cat >>confdefs.h <<_ACEOF
14157 #define HAVE_UNION_SEMUN 1
14158 _ACEOF
14159
14160
14161 fi
14162
14163 ac_fn_c_check_type "$LINENO" "struct sockaddr_un" "ac_cv_type_struct_sockaddr_un" "#include <sys/types.h>
14164 #ifdef HAVE_SYS_UN_H
14165 #include <sys/un.h>
14166 #endif
14167
14168 "
14169 if test "x$ac_cv_type_struct_sockaddr_un" = xyes; then :
14170
14171 $as_echo "#define HAVE_UNIX_SOCKETS 1" >>confdefs.h
14172
14173 fi
14174
14175 ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include <sys/types.h>
14176 #include <sys/socket.h>
14177
14178 "
14179 if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
14180
14181 cat >>confdefs.h <<_ACEOF
14182 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
14183 _ACEOF
14184
14185
14186 fi
14187
14188 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
14189 #include <sys/socket.h>
14190
14191 "
14192 if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
14193
14194 cat >>confdefs.h <<_ACEOF
14195 #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
14196 _ACEOF
14197
14198
14199 fi
14200 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_family" "ac_cv_member_struct_sockaddr_storage___ss_family" "#include <sys/types.h>
14201 #include <sys/socket.h>
14202
14203 "
14204 if test "x$ac_cv_member_struct_sockaddr_storage___ss_family" = xyes; then :
14205
14206 cat >>confdefs.h <<_ACEOF
14207 #define HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY 1
14208 _ACEOF
14209
14210
14211 fi
14212 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_len" "ac_cv_member_struct_sockaddr_storage_ss_len" "#include <sys/types.h>
14213 #include <sys/socket.h>
14214
14215 "
14216 if test "x$ac_cv_member_struct_sockaddr_storage_ss_len" = xyes; then :
14217
14218 cat >>confdefs.h <<_ACEOF
14219 #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1
14220 _ACEOF
14221
14222
14223 fi
14224 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_len" "ac_cv_member_struct_sockaddr_storage___ss_len" "#include <sys/types.h>
14225 #include <sys/socket.h>
14226
14227 "
14228 if test "x$ac_cv_member_struct_sockaddr_storage___ss_len" = xyes; then :
14229
14230 cat >>confdefs.h <<_ACEOF
14231 #define HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN 1
14232 _ACEOF
14233
14234
14235 fi
14236 ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include <sys/types.h>
14237 #include <sys/socket.h>
14238
14239 "
14240 if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then :
14241
14242 cat >>confdefs.h <<_ACEOF
14243 #define HAVE_STRUCT_SOCKADDR_SA_LEN 1
14244 _ACEOF
14245
14246
14247 fi
14248
14249 ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "#include <sys/types.h>
14250 #include <sys/socket.h>
14251 #include <netdb.h>
14252
14253 "
14254 if test "x$ac_cv_type_struct_addrinfo" = xyes; then :
14255
14256 cat >>confdefs.h <<_ACEOF
14257 #define HAVE_STRUCT_ADDRINFO 1
14258 _ACEOF
14259
14260
14261 fi
14262
14263
14264   ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
14265 if test "x$ac_cv_type_intptr_t" = xyes; then :
14266
14267 $as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h
14268
14269 else
14270   for ac_type in 'int' 'long int' 'long long int'; do
14271        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14272 /* end confdefs.h.  */
14273 $ac_includes_default
14274 int
14275 main ()
14276 {
14277 static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
14278 test_array [0] = 0;
14279 return test_array [0];
14280
14281   ;
14282   return 0;
14283 }
14284 _ACEOF
14285 if ac_fn_c_try_compile "$LINENO"; then :
14286
14287 cat >>confdefs.h <<_ACEOF
14288 #define intptr_t $ac_type
14289 _ACEOF
14290
14291           ac_type=
14292 fi
14293 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14294        test -z "$ac_type" && break
14295      done
14296 fi
14297
14298
14299
14300   ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
14301 if test "x$ac_cv_type_uintptr_t" = xyes; then :
14302
14303 $as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
14304
14305 else
14306   for ac_type in 'unsigned int' 'unsigned long int' \
14307         'unsigned long long int'; do
14308        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14309 /* end confdefs.h.  */
14310 $ac_includes_default
14311 int
14312 main ()
14313 {
14314 static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
14315 test_array [0] = 0;
14316 return test_array [0];
14317
14318   ;
14319   return 0;
14320 }
14321 _ACEOF
14322 if ac_fn_c_try_compile "$LINENO"; then :
14323
14324 cat >>confdefs.h <<_ACEOF
14325 #define uintptr_t $ac_type
14326 _ACEOF
14327
14328           ac_type=
14329 fi
14330 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14331        test -z "$ac_type" && break
14332      done
14333 fi
14334
14335
14336
14337   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
14338 $as_echo_n "checking for unsigned long long int... " >&6; }
14339 if ${ac_cv_type_unsigned_long_long_int+:} false; then :
14340   $as_echo_n "(cached) " >&6
14341 else
14342   ac_cv_type_unsigned_long_long_int=yes
14343      if test "x${ac_cv_prog_cc_c99-no}" = xno; then
14344        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14345 /* end confdefs.h.  */
14346
14347   /* For now, do not test the preprocessor; as of 2007 there are too many
14348          implementations with broken preprocessors.  Perhaps this can
14349          be revisited in 2012.  In the meantime, code should not expect
14350          #if to work with literals wider than 32 bits.  */
14351       /* Test literals.  */
14352       long long int ll = 9223372036854775807ll;
14353       long long int nll = -9223372036854775807LL;
14354       unsigned long long int ull = 18446744073709551615ULL;
14355       /* Test constant expressions.   */
14356       typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
14357                      ? 1 : -1)];
14358       typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
14359                      ? 1 : -1)];
14360       int i = 63;
14361 int
14362 main ()
14363 {
14364 /* Test availability of runtime routines for shift and division.  */
14365       long long int llmax = 9223372036854775807ll;
14366       unsigned long long int ullmax = 18446744073709551615ull;
14367       return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
14368               | (llmax / ll) | (llmax % ll)
14369               | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
14370               | (ullmax / ull) | (ullmax % ull));
14371   ;
14372   return 0;
14373 }
14374
14375 _ACEOF
14376 if ac_fn_c_try_link "$LINENO"; then :
14377
14378 else
14379   ac_cv_type_unsigned_long_long_int=no
14380 fi
14381 rm -f core conftest.err conftest.$ac_objext \
14382     conftest$ac_exeext conftest.$ac_ext
14383      fi
14384 fi
14385 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
14386 $as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
14387   if test $ac_cv_type_unsigned_long_long_int = yes; then
14388
14389 $as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
14390
14391   fi
14392
14393
14394
14395   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
14396 $as_echo_n "checking for long long int... " >&6; }
14397 if ${ac_cv_type_long_long_int+:} false; then :
14398   $as_echo_n "(cached) " >&6
14399 else
14400   ac_cv_type_long_long_int=yes
14401       if test "x${ac_cv_prog_cc_c99-no}" = xno; then
14402         ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
14403         if test $ac_cv_type_long_long_int = yes; then
14404                                   if test "$cross_compiling" = yes; then :
14405   :
14406 else
14407   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14408 /* end confdefs.h.  */
14409 #include <limits.h>
14410                  #ifndef LLONG_MAX
14411                  # define HALF \
14412                           (1LL << (sizeof (long long int) * CHAR_BIT - 2))
14413                  # define LLONG_MAX (HALF - 1 + HALF)
14414                  #endif
14415 int
14416 main ()
14417 {
14418 long long int n = 1;
14419                  int i;
14420                  for (i = 0; ; i++)
14421                    {
14422                      long long int m = n << i;
14423                      if (m >> i != n)
14424                        return 1;
14425                      if (LLONG_MAX / 2 < m)
14426                        break;
14427                    }
14428                  return 0;
14429   ;
14430   return 0;
14431 }
14432 _ACEOF
14433 if ac_fn_c_try_run "$LINENO"; then :
14434
14435 else
14436   ac_cv_type_long_long_int=no
14437 fi
14438 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14439   conftest.$ac_objext conftest.beam conftest.$ac_ext
14440 fi
14441
14442         fi
14443       fi
14444 fi
14445 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
14446 $as_echo "$ac_cv_type_long_long_int" >&6; }
14447   if test $ac_cv_type_long_long_int = yes; then
14448
14449 $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
14450
14451   fi
14452
14453
14454 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale_t" >&5
14455 $as_echo_n "checking for locale_t... " >&6; }
14456 if ${pgac_cv_type_locale_t+:} false; then :
14457   $as_echo_n "(cached) " >&6
14458 else
14459   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14460 /* end confdefs.h.  */
14461 #include <locale.h>
14462 locale_t x;
14463 int
14464 main ()
14465 {
14466
14467   ;
14468   return 0;
14469 }
14470 _ACEOF
14471 if ac_fn_c_try_compile "$LINENO"; then :
14472   pgac_cv_type_locale_t=yes
14473 else
14474   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14475 /* end confdefs.h.  */
14476 #include <xlocale.h>
14477 locale_t x;
14478 int
14479 main ()
14480 {
14481
14482   ;
14483   return 0;
14484 }
14485 _ACEOF
14486 if ac_fn_c_try_compile "$LINENO"; then :
14487   pgac_cv_type_locale_t='yes (in xlocale.h)'
14488 else
14489   pgac_cv_type_locale_t=no
14490 fi
14491 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14492 fi
14493 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14494 fi
14495 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_locale_t" >&5
14496 $as_echo "$pgac_cv_type_locale_t" >&6; }
14497 if test "$pgac_cv_type_locale_t" != no; then
14498
14499 $as_echo "#define HAVE_LOCALE_T 1" >>confdefs.h
14500
14501 fi
14502 if test "$pgac_cv_type_locale_t" = 'yes (in xlocale.h)'; then
14503
14504 $as_echo "#define LOCALE_T_IN_XLOCALE 1" >>confdefs.h
14505
14506 fi
14507
14508 # MSVC doesn't cope well with defining restrict to __restrict, the
14509 # spelling it understands, because it conflicts with
14510 # __declspec(restrict). Therefore we define pg_restrict to the
14511 # appropriate definition, which presumably won't conflict.
14512 #
14513 # Allow platforms with buggy compilers to force restrict to not be
14514 # used by setting $FORCE_DISABLE_RESTRICT=yes in the relevant
14515 # template.
14516 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
14517 $as_echo_n "checking for C/C++ restrict keyword... " >&6; }
14518 if ${ac_cv_c_restrict+:} false; then :
14519   $as_echo_n "(cached) " >&6
14520 else
14521   ac_cv_c_restrict=no
14522    # The order here caters to the fact that C++ does not require restrict.
14523    for ac_kw in __restrict __restrict__ _Restrict restrict; do
14524      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14525 /* end confdefs.h.  */
14526 typedef int * int_ptr;
14527         int foo (int_ptr $ac_kw ip) {
14528         return ip[0];
14529        }
14530 int
14531 main ()
14532 {
14533 int s[1];
14534         int * $ac_kw t = s;
14535         t[0] = 0;
14536         return foo(t)
14537   ;
14538   return 0;
14539 }
14540 _ACEOF
14541 if ac_fn_c_try_compile "$LINENO"; then :
14542   ac_cv_c_restrict=$ac_kw
14543 fi
14544 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14545      test "$ac_cv_c_restrict" != no && break
14546    done
14547
14548 fi
14549 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
14550 $as_echo "$ac_cv_c_restrict" >&6; }
14551
14552  case $ac_cv_c_restrict in
14553    restrict) ;;
14554    no) $as_echo "#define restrict /**/" >>confdefs.h
14555  ;;
14556    *)  cat >>confdefs.h <<_ACEOF
14557 #define restrict $ac_cv_c_restrict
14558 _ACEOF
14559  ;;
14560  esac
14561
14562 if test "$ac_cv_c_restrict" = "no" -o "x$FORCE_DISABLE_RESTRICT" = "xyes"; then
14563   pg_restrict=""
14564 else
14565   pg_restrict="$ac_cv_c_restrict"
14566 fi
14567
14568 cat >>confdefs.h <<_ACEOF
14569 #define pg_restrict $pg_restrict
14570 _ACEOF
14571
14572
14573 ac_fn_c_check_type "$LINENO" "struct cmsgcred" "ac_cv_type_struct_cmsgcred" "#include <sys/socket.h>
14574 #include <sys/param.h>
14575 #ifdef HAVE_SYS_UCRED_H
14576 #include <sys/ucred.h>
14577 #endif
14578 "
14579 if test "x$ac_cv_type_struct_cmsgcred" = xyes; then :
14580
14581 cat >>confdefs.h <<_ACEOF
14582 #define HAVE_STRUCT_CMSGCRED 1
14583 _ACEOF
14584
14585
14586 fi
14587
14588
14589 ac_fn_c_check_type "$LINENO" "struct option" "ac_cv_type_struct_option" "#ifdef HAVE_GETOPT_H
14590 #include <getopt.h>
14591 #endif
14592 "
14593 if test "x$ac_cv_type_struct_option" = xyes; then :
14594
14595 cat >>confdefs.h <<_ACEOF
14596 #define HAVE_STRUCT_OPTION 1
14597 _ACEOF
14598
14599
14600 fi
14601
14602
14603 if test "$with_zlib" = yes; then
14604   # Check that <zlib.h> defines z_streamp (versions before about 1.0.4
14605   # did not).  While we could work around the lack of z_streamp, it
14606   # seems unwise to encourage people to use such old zlib versions...
14607   ac_fn_c_check_type "$LINENO" "z_streamp" "ac_cv_type_z_streamp" "#include <zlib.h>
14608 "
14609 if test "x$ac_cv_type_z_streamp" = xyes; then :
14610
14611 else
14612   as_fn_error $? "zlib version is too old
14613 Use --without-zlib to disable zlib support." "$LINENO" 5
14614 fi
14615
14616 fi
14617
14618 case $host_cpu in
14619   x86_64)
14620     # On x86_64, check if we can compile a popcntq instruction
14621     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether assembler supports x86_64 popcntq" >&5
14622 $as_echo_n "checking whether assembler supports x86_64 popcntq... " >&6; }
14623 if ${pgac_cv_have_x86_64_popcntq+:} false; then :
14624   $as_echo_n "(cached) " >&6
14625 else
14626   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14627 /* end confdefs.h.  */
14628
14629 int
14630 main ()
14631 {
14632 long long x = 1; long long r;
14633          __asm__ __volatile__ (" popcntq %1,%0\n" : "=q"(r) : "rm"(x));
14634   ;
14635   return 0;
14636 }
14637 _ACEOF
14638 if ac_fn_c_try_compile "$LINENO"; then :
14639   pgac_cv_have_x86_64_popcntq=yes
14640 else
14641   pgac_cv_have_x86_64_popcntq=no
14642 fi
14643 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14644 fi
14645 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_have_x86_64_popcntq" >&5
14646 $as_echo "$pgac_cv_have_x86_64_popcntq" >&6; }
14647     if test x"$pgac_cv_have_x86_64_popcntq" = xyes ; then
14648
14649 $as_echo "#define HAVE_X86_64_POPCNTQ 1" >>confdefs.h
14650
14651     fi
14652   ;;
14653   ppc*|powerpc*)
14654     # On PPC, check if assembler supports LWARX instruction's mutex hint bit
14655     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether assembler supports lwarx hint bit" >&5
14656 $as_echo_n "checking whether assembler supports lwarx hint bit... " >&6; }
14657 if ${pgac_cv_have_ppc_mutex_hint+:} false; then :
14658   $as_echo_n "(cached) " >&6
14659 else
14660   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14661 /* end confdefs.h.  */
14662
14663 int
14664 main ()
14665 {
14666 int a = 0; int *p = &a; int r;
14667          __asm__ __volatile__ (" lwarx %0,0,%1,1\n" : "=&r"(r) : "r"(p));
14668   ;
14669   return 0;
14670 }
14671 _ACEOF
14672 if ac_fn_c_try_compile "$LINENO"; then :
14673   pgac_cv_have_ppc_mutex_hint=yes
14674 else
14675   pgac_cv_have_ppc_mutex_hint=no
14676 fi
14677 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14678 fi
14679 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_have_ppc_mutex_hint" >&5
14680 $as_echo "$pgac_cv_have_ppc_mutex_hint" >&6; }
14681     if test x"$pgac_cv_have_ppc_mutex_hint" = xyes ; then
14682
14683 $as_echo "#define HAVE_PPC_LWARX_MUTEX_HINT 1" >>confdefs.h
14684
14685     fi
14686   ;;
14687 esac
14688
14689 # Check largefile support.  You might think this is a system service not a
14690 # compiler characteristic, but you'd be wrong.  We must check this before
14691 # probing existence of related functions such as fseeko, since the largefile
14692 # defines can affect what is generated for that.
14693 if test "$PORTNAME" != "win32"; then
14694    # Check whether --enable-largefile was given.
14695 if test "${enable_largefile+set}" = set; then :
14696   enableval=$enable_largefile;
14697 fi
14698
14699 if test "$enable_largefile" != no; then
14700
14701   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
14702 $as_echo_n "checking for special C compiler options needed for large files... " >&6; }
14703 if ${ac_cv_sys_largefile_CC+:} false; then :
14704   $as_echo_n "(cached) " >&6
14705 else
14706   ac_cv_sys_largefile_CC=no
14707      if test "$GCC" != yes; then
14708        ac_save_CC=$CC
14709        while :; do
14710          # IRIX 6.2 and later do not support large files by default,
14711          # so use the C compiler's -n32 option if that helps.
14712          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14713 /* end confdefs.h.  */
14714 #include <sys/types.h>
14715  /* Check that off_t can represent 2**63 - 1 correctly.
14716     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14717     since some C++ compilers masquerading as C compilers
14718     incorrectly reject 9223372036854775807.  */
14719 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14720   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14721                        && LARGE_OFF_T % 2147483647 == 1)
14722                       ? 1 : -1];
14723 int
14724 main ()
14725 {
14726
14727   ;
14728   return 0;
14729 }
14730 _ACEOF
14731          if ac_fn_c_try_compile "$LINENO"; then :
14732   break
14733 fi
14734 rm -f core conftest.err conftest.$ac_objext
14735          CC="$CC -n32"
14736          if ac_fn_c_try_compile "$LINENO"; then :
14737   ac_cv_sys_largefile_CC=' -n32'; break
14738 fi
14739 rm -f core conftest.err conftest.$ac_objext
14740          break
14741        done
14742        CC=$ac_save_CC
14743        rm -f conftest.$ac_ext
14744     fi
14745 fi
14746 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
14747 $as_echo "$ac_cv_sys_largefile_CC" >&6; }
14748   if test "$ac_cv_sys_largefile_CC" != no; then
14749     CC=$CC$ac_cv_sys_largefile_CC
14750   fi
14751
14752   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
14753 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
14754 if ${ac_cv_sys_file_offset_bits+:} false; then :
14755   $as_echo_n "(cached) " >&6
14756 else
14757   while :; do
14758   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14759 /* end confdefs.h.  */
14760 #include <sys/types.h>
14761  /* Check that off_t can represent 2**63 - 1 correctly.
14762     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14763     since some C++ compilers masquerading as C compilers
14764     incorrectly reject 9223372036854775807.  */
14765 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14766   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14767                        && LARGE_OFF_T % 2147483647 == 1)
14768                       ? 1 : -1];
14769 int
14770 main ()
14771 {
14772
14773   ;
14774   return 0;
14775 }
14776 _ACEOF
14777 if ac_fn_c_try_compile "$LINENO"; then :
14778   ac_cv_sys_file_offset_bits=no; break
14779 fi
14780 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14781   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14782 /* end confdefs.h.  */
14783 #define _FILE_OFFSET_BITS 64
14784 #include <sys/types.h>
14785  /* Check that off_t can represent 2**63 - 1 correctly.
14786     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14787     since some C++ compilers masquerading as C compilers
14788     incorrectly reject 9223372036854775807.  */
14789 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14790   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14791                        && LARGE_OFF_T % 2147483647 == 1)
14792                       ? 1 : -1];
14793 int
14794 main ()
14795 {
14796
14797   ;
14798   return 0;
14799 }
14800 _ACEOF
14801 if ac_fn_c_try_compile "$LINENO"; then :
14802   ac_cv_sys_file_offset_bits=64; break
14803 fi
14804 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14805   ac_cv_sys_file_offset_bits=unknown
14806   break
14807 done
14808 fi
14809 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
14810 $as_echo "$ac_cv_sys_file_offset_bits" >&6; }
14811 case $ac_cv_sys_file_offset_bits in #(
14812   no | unknown) ;;
14813   *)
14814 cat >>confdefs.h <<_ACEOF
14815 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14816 _ACEOF
14817 ;;
14818 esac
14819 rm -rf conftest*
14820   if test $ac_cv_sys_file_offset_bits = unknown; then
14821     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
14822 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
14823 if ${ac_cv_sys_large_files+:} false; then :
14824   $as_echo_n "(cached) " >&6
14825 else
14826   while :; do
14827   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14828 /* end confdefs.h.  */
14829 #include <sys/types.h>
14830  /* Check that off_t can represent 2**63 - 1 correctly.
14831     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14832     since some C++ compilers masquerading as C compilers
14833     incorrectly reject 9223372036854775807.  */
14834 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14835   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14836                        && LARGE_OFF_T % 2147483647 == 1)
14837                       ? 1 : -1];
14838 int
14839 main ()
14840 {
14841
14842   ;
14843   return 0;
14844 }
14845 _ACEOF
14846 if ac_fn_c_try_compile "$LINENO"; then :
14847   ac_cv_sys_large_files=no; break
14848 fi
14849 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14850   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14851 /* end confdefs.h.  */
14852 #define _LARGE_FILES 1
14853 #include <sys/types.h>
14854  /* Check that off_t can represent 2**63 - 1 correctly.
14855     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14856     since some C++ compilers masquerading as C compilers
14857     incorrectly reject 9223372036854775807.  */
14858 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14859   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14860                        && LARGE_OFF_T % 2147483647 == 1)
14861                       ? 1 : -1];
14862 int
14863 main ()
14864 {
14865
14866   ;
14867   return 0;
14868 }
14869 _ACEOF
14870 if ac_fn_c_try_compile "$LINENO"; then :
14871   ac_cv_sys_large_files=1; break
14872 fi
14873 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14874   ac_cv_sys_large_files=unknown
14875   break
14876 done
14877 fi
14878 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
14879 $as_echo "$ac_cv_sys_large_files" >&6; }
14880 case $ac_cv_sys_large_files in #(
14881   no | unknown) ;;
14882   *)
14883 cat >>confdefs.h <<_ACEOF
14884 #define _LARGE_FILES $ac_cv_sys_large_files
14885 _ACEOF
14886 ;;
14887 esac
14888 rm -rf conftest*
14889   fi
14890
14891
14892 fi
14893
14894
14895 fi
14896
14897 # The cast to long int works around a bug in the HP C Compiler
14898 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
14899 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
14900 # This bug is HP SR number 8606223364.
14901 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
14902 $as_echo_n "checking size of off_t... " >&6; }
14903 if ${ac_cv_sizeof_off_t+:} false; then :
14904   $as_echo_n "(cached) " >&6
14905 else
14906   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t"        "$ac_includes_default"; then :
14907
14908 else
14909   if test "$ac_cv_type_off_t" = yes; then
14910      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14911 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14912 as_fn_error 77 "cannot compute sizeof (off_t)
14913 See \`config.log' for more details" "$LINENO" 5; }
14914    else
14915      ac_cv_sizeof_off_t=0
14916    fi
14917 fi
14918
14919 fi
14920 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
14921 $as_echo "$ac_cv_sizeof_off_t" >&6; }
14922
14923
14924
14925 cat >>confdefs.h <<_ACEOF
14926 #define SIZEOF_OFF_T $ac_cv_sizeof_off_t
14927 _ACEOF
14928
14929
14930
14931 # If we don't have largefile support, can't handle segsize >= 2GB.
14932 if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then
14933    as_fn_error $? "Large file support is not enabled. Segment size cannot be larger than 1GB." "$LINENO" 5
14934 fi
14935
14936 # The cast to long int works around a bug in the HP C Compiler
14937 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
14938 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
14939 # This bug is HP SR number 8606223364.
14940 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of bool" >&5
14941 $as_echo_n "checking size of bool... " >&6; }
14942 if ${ac_cv_sizeof_bool+:} false; then :
14943   $as_echo_n "(cached) " >&6
14944 else
14945   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (bool))" "ac_cv_sizeof_bool"        "#ifdef HAVE_STDBOOL_H
14946 #include <stdbool.h>
14947 #endif
14948 "; then :
14949
14950 else
14951   if test "$ac_cv_type_bool" = yes; then
14952      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14953 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14954 as_fn_error 77 "cannot compute sizeof (bool)
14955 See \`config.log' for more details" "$LINENO" 5; }
14956    else
14957      ac_cv_sizeof_bool=0
14958    fi
14959 fi
14960
14961 fi
14962 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_bool" >&5
14963 $as_echo "$ac_cv_sizeof_bool" >&6; }
14964
14965
14966
14967 cat >>confdefs.h <<_ACEOF
14968 #define SIZEOF_BOOL $ac_cv_sizeof_bool
14969 _ACEOF
14970
14971
14972
14973
14974 ##
14975 ## Functions, global variables
14976 ##
14977
14978 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int timezone" >&5
14979 $as_echo_n "checking for int timezone... " >&6; }
14980 if ${pgac_cv_var_int_timezone+:} false; then :
14981   $as_echo_n "(cached) " >&6
14982 else
14983   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14984 /* end confdefs.h.  */
14985 #include <time.h>
14986 int res;
14987 int
14988 main ()
14989 {
14990 #ifndef __CYGWIN__
14991 res = timezone / 60;
14992 #else
14993 res = _timezone / 60;
14994 #endif
14995   ;
14996   return 0;
14997 }
14998 _ACEOF
14999 if ac_fn_c_try_link "$LINENO"; then :
15000   pgac_cv_var_int_timezone=yes
15001 else
15002   pgac_cv_var_int_timezone=no
15003 fi
15004 rm -f core conftest.err conftest.$ac_objext \
15005     conftest$ac_exeext conftest.$ac_ext
15006 fi
15007 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_timezone" >&5
15008 $as_echo "$pgac_cv_var_int_timezone" >&6; }
15009 if test x"$pgac_cv_var_int_timezone" = xyes ; then
15010
15011 $as_echo "#define HAVE_INT_TIMEZONE 1" >>confdefs.h
15012
15013 fi
15014 { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for accept()" >&5
15015 $as_echo_n "checking types of arguments for accept()... " >&6; }
15016  if ${ac_cv_func_accept_return+:} false; then :
15017   $as_echo_n "(cached) " >&6
15018 else
15019    if ${ac_cv_func_accept_arg1+:} false; then :
15020   $as_echo_n "(cached) " >&6
15021 else
15022     if ${ac_cv_func_accept_arg2+:} false; then :
15023   $as_echo_n "(cached) " >&6
15024 else
15025      if ${ac_cv_func_accept_arg3+:} false; then :
15026   $as_echo_n "(cached) " >&6
15027 else
15028       for ac_cv_func_accept_return in 'int' 'SOCKET WSAAPI' 'unsigned int PASCAL'; do
15029       for ac_cv_func_accept_arg1 in 'int' 'SOCKET' 'unsigned int'; do
15030        for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
15031         for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
15032          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15033 /* end confdefs.h.  */
15034 #include <sys/types.h>
15035 #include <sys/socket.h>
15036 extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);
15037 _ACEOF
15038 if ac_fn_c_try_compile "$LINENO"; then :
15039   ac_not_found=no; break 4
15040 else
15041   ac_not_found=yes
15042 fi
15043 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15044        done
15045       done
15046      done
15047     done
15048     if test "$ac_not_found" = yes; then
15049       as_fn_error $? "could not determine argument types" "$LINENO" 5
15050     fi
15051     if test "$ac_cv_func_accept_arg3" = "void"; then
15052       ac_cv_func_accept_arg3=int
15053     fi
15054
15055 fi
15056
15057 fi
15058
15059 fi
15060
15061 fi
15062  { $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
15063 $as_echo "$ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&6; }
15064
15065 cat >>confdefs.h <<_ACEOF
15066 #define ACCEPT_TYPE_RETURN $ac_cv_func_accept_return
15067 _ACEOF
15068
15069
15070 cat >>confdefs.h <<_ACEOF
15071 #define ACCEPT_TYPE_ARG1 $ac_cv_func_accept_arg1
15072 _ACEOF
15073
15074
15075 cat >>confdefs.h <<_ACEOF
15076 #define ACCEPT_TYPE_ARG2 $ac_cv_func_accept_arg2
15077 _ACEOF
15078
15079
15080 cat >>confdefs.h <<_ACEOF
15081 #define ACCEPT_TYPE_ARG3 $ac_cv_func_accept_arg3
15082 _ACEOF
15083
15084
15085 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday takes only one argument" >&5
15086 $as_echo_n "checking whether gettimeofday takes only one argument... " >&6; }
15087 if ${pgac_cv_func_gettimeofday_1arg+:} false; then :
15088   $as_echo_n "(cached) " >&6
15089 else
15090   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15091 /* end confdefs.h.  */
15092 #include <sys/time.h>
15093 int
15094 main ()
15095 {
15096 struct timeval *tp;
15097 struct timezone *tzp;
15098 gettimeofday(tp,tzp);
15099   ;
15100   return 0;
15101 }
15102 _ACEOF
15103 if ac_fn_c_try_compile "$LINENO"; then :
15104   pgac_cv_func_gettimeofday_1arg=no
15105 else
15106   pgac_cv_func_gettimeofday_1arg=yes
15107 fi
15108 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15109 fi
15110 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_gettimeofday_1arg" >&5
15111 $as_echo "$pgac_cv_func_gettimeofday_1arg" >&6; }
15112 if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
15113
15114 $as_echo "#define GETTIMEOFDAY_1ARG 1" >>confdefs.h
15115
15116 fi
15117
15118 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wcstombs_l declaration" >&5
15119 $as_echo_n "checking for wcstombs_l declaration... " >&6; }
15120 if ${pgac_cv_func_wcstombs_l+:} false; then :
15121   $as_echo_n "(cached) " >&6
15122 else
15123   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15124 /* end confdefs.h.  */
15125 #include <stdlib.h>
15126 #include <locale.h>
15127 int
15128 main ()
15129 {
15130 #ifndef wcstombs_l
15131 (void) wcstombs_l;
15132 #endif
15133   ;
15134   return 0;
15135 }
15136 _ACEOF
15137 if ac_fn_c_try_compile "$LINENO"; then :
15138   pgac_cv_func_wcstombs_l='yes'
15139 else
15140   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15141 /* end confdefs.h.  */
15142 #include <stdlib.h>
15143 #include <locale.h>
15144 #include <xlocale.h>
15145 int
15146 main ()
15147 {
15148 #ifndef wcstombs_l
15149 (void) wcstombs_l;
15150 #endif
15151   ;
15152   return 0;
15153 }
15154 _ACEOF
15155 if ac_fn_c_try_compile "$LINENO"; then :
15156   pgac_cv_func_wcstombs_l='yes (in xlocale.h)'
15157 else
15158   pgac_cv_func_wcstombs_l='no'
15159 fi
15160 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15161 fi
15162 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15163 fi
15164 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_wcstombs_l" >&5
15165 $as_echo "$pgac_cv_func_wcstombs_l" >&6; }
15166 if test "$pgac_cv_func_wcstombs_l" = 'yes (in xlocale.h)'; then
15167
15168 $as_echo "#define WCSTOMBS_L_IN_XLOCALE 1" >>confdefs.h
15169
15170 fi
15171
15172 # Some versions of libedit contain strlcpy(), setproctitle(), and other
15173 # symbols that that library has no business exposing to the world.  Pending
15174 # acquisition of a clue by those developers, ignore libedit (including its
15175 # possible alias of libreadline) while checking for everything else.
15176 LIBS_including_readline="$LIBS"
15177 LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
15178
15179 for ac_func in cbrt clock_gettime copyfile fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll posix_fallocate ppoll pstat pthread_is_threaded_np readlink setproctitle setproctitle_fast setsid shm_open strchrnul strsignal symlink sync_file_range uselocale utime utimes wcstombs_l
15180 do :
15181   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
15182 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
15183 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
15184   cat >>confdefs.h <<_ACEOF
15185 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
15186 _ACEOF
15187
15188 fi
15189 done
15190
15191
15192 # These typically are compiler builtins, for which AC_CHECK_FUNCS fails.
15193 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap16" >&5
15194 $as_echo_n "checking for __builtin_bswap16... " >&6; }
15195 if ${pgac_cv__builtin_bswap16+:} false; then :
15196   $as_echo_n "(cached) " >&6
15197 else
15198   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15199 /* end confdefs.h.  */
15200
15201 int
15202 call__builtin_bswap16(int x)
15203 {
15204     return __builtin_bswap16(x);
15205 }
15206 int
15207 main ()
15208 {
15209
15210   ;
15211   return 0;
15212 }
15213 _ACEOF
15214 if ac_fn_c_try_link "$LINENO"; then :
15215   pgac_cv__builtin_bswap16=yes
15216 else
15217   pgac_cv__builtin_bswap16=no
15218 fi
15219 rm -f core conftest.err conftest.$ac_objext \
15220     conftest$ac_exeext conftest.$ac_ext
15221 fi
15222 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_bswap16" >&5
15223 $as_echo "$pgac_cv__builtin_bswap16" >&6; }
15224 if test x"${pgac_cv__builtin_bswap16}" = xyes ; then
15225
15226 cat >>confdefs.h <<_ACEOF
15227 #define HAVE__BUILTIN_BSWAP16 1
15228 _ACEOF
15229
15230 fi
15231 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap32" >&5
15232 $as_echo_n "checking for __builtin_bswap32... " >&6; }
15233 if ${pgac_cv__builtin_bswap32+:} false; then :
15234   $as_echo_n "(cached) " >&6
15235 else
15236   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15237 /* end confdefs.h.  */
15238
15239 int
15240 call__builtin_bswap32(int x)
15241 {
15242     return __builtin_bswap32(x);
15243 }
15244 int
15245 main ()
15246 {
15247
15248   ;
15249   return 0;
15250 }
15251 _ACEOF
15252 if ac_fn_c_try_link "$LINENO"; then :
15253   pgac_cv__builtin_bswap32=yes
15254 else
15255   pgac_cv__builtin_bswap32=no
15256 fi
15257 rm -f core conftest.err conftest.$ac_objext \
15258     conftest$ac_exeext conftest.$ac_ext
15259 fi
15260 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_bswap32" >&5
15261 $as_echo "$pgac_cv__builtin_bswap32" >&6; }
15262 if test x"${pgac_cv__builtin_bswap32}" = xyes ; then
15263
15264 cat >>confdefs.h <<_ACEOF
15265 #define HAVE__BUILTIN_BSWAP32 1
15266 _ACEOF
15267
15268 fi
15269 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap64" >&5
15270 $as_echo_n "checking for __builtin_bswap64... " >&6; }
15271 if ${pgac_cv__builtin_bswap64+:} false; then :
15272   $as_echo_n "(cached) " >&6
15273 else
15274   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15275 /* end confdefs.h.  */
15276
15277 int
15278 call__builtin_bswap64(long int x)
15279 {
15280     return __builtin_bswap64(x);
15281 }
15282 int
15283 main ()
15284 {
15285
15286   ;
15287   return 0;
15288 }
15289 _ACEOF
15290 if ac_fn_c_try_link "$LINENO"; then :
15291   pgac_cv__builtin_bswap64=yes
15292 else
15293   pgac_cv__builtin_bswap64=no
15294 fi
15295 rm -f core conftest.err conftest.$ac_objext \
15296     conftest$ac_exeext conftest.$ac_ext
15297 fi
15298 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_bswap64" >&5
15299 $as_echo "$pgac_cv__builtin_bswap64" >&6; }
15300 if test x"${pgac_cv__builtin_bswap64}" = xyes ; then
15301
15302 cat >>confdefs.h <<_ACEOF
15303 #define HAVE__BUILTIN_BSWAP64 1
15304 _ACEOF
15305
15306 fi
15307 # We assume that we needn't test all widths of these explicitly:
15308 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_clz" >&5
15309 $as_echo_n "checking for __builtin_clz... " >&6; }
15310 if ${pgac_cv__builtin_clz+:} false; then :
15311   $as_echo_n "(cached) " >&6
15312 else
15313   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15314 /* end confdefs.h.  */
15315
15316 int
15317 call__builtin_clz(unsigned int x)
15318 {
15319     return __builtin_clz(x);
15320 }
15321 int
15322 main ()
15323 {
15324
15325   ;
15326   return 0;
15327 }
15328 _ACEOF
15329 if ac_fn_c_try_link "$LINENO"; then :
15330   pgac_cv__builtin_clz=yes
15331 else
15332   pgac_cv__builtin_clz=no
15333 fi
15334 rm -f core conftest.err conftest.$ac_objext \
15335     conftest$ac_exeext conftest.$ac_ext
15336 fi
15337 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_clz" >&5
15338 $as_echo "$pgac_cv__builtin_clz" >&6; }
15339 if test x"${pgac_cv__builtin_clz}" = xyes ; then
15340
15341 cat >>confdefs.h <<_ACEOF
15342 #define HAVE__BUILTIN_CLZ 1
15343 _ACEOF
15344
15345 fi
15346 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_ctz" >&5
15347 $as_echo_n "checking for __builtin_ctz... " >&6; }
15348 if ${pgac_cv__builtin_ctz+:} false; then :
15349   $as_echo_n "(cached) " >&6
15350 else
15351   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15352 /* end confdefs.h.  */
15353
15354 int
15355 call__builtin_ctz(unsigned int x)
15356 {
15357     return __builtin_ctz(x);
15358 }
15359 int
15360 main ()
15361 {
15362
15363   ;
15364   return 0;
15365 }
15366 _ACEOF
15367 if ac_fn_c_try_link "$LINENO"; then :
15368   pgac_cv__builtin_ctz=yes
15369 else
15370   pgac_cv__builtin_ctz=no
15371 fi
15372 rm -f core conftest.err conftest.$ac_objext \
15373     conftest$ac_exeext conftest.$ac_ext
15374 fi
15375 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_ctz" >&5
15376 $as_echo "$pgac_cv__builtin_ctz" >&6; }
15377 if test x"${pgac_cv__builtin_ctz}" = xyes ; then
15378
15379 cat >>confdefs.h <<_ACEOF
15380 #define HAVE__BUILTIN_CTZ 1
15381 _ACEOF
15382
15383 fi
15384 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_popcount" >&5
15385 $as_echo_n "checking for __builtin_popcount... " >&6; }
15386 if ${pgac_cv__builtin_popcount+:} false; then :
15387   $as_echo_n "(cached) " >&6
15388 else
15389   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15390 /* end confdefs.h.  */
15391
15392 int
15393 call__builtin_popcount(unsigned int x)
15394 {
15395     return __builtin_popcount(x);
15396 }
15397 int
15398 main ()
15399 {
15400
15401   ;
15402   return 0;
15403 }
15404 _ACEOF
15405 if ac_fn_c_try_link "$LINENO"; then :
15406   pgac_cv__builtin_popcount=yes
15407 else
15408   pgac_cv__builtin_popcount=no
15409 fi
15410 rm -f core conftest.err conftest.$ac_objext \
15411     conftest$ac_exeext conftest.$ac_ext
15412 fi
15413 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_popcount" >&5
15414 $as_echo "$pgac_cv__builtin_popcount" >&6; }
15415 if test x"${pgac_cv__builtin_popcount}" = xyes ; then
15416
15417 cat >>confdefs.h <<_ACEOF
15418 #define HAVE__BUILTIN_POPCOUNT 1
15419 _ACEOF
15420
15421 fi
15422
15423 ac_fn_c_check_func "$LINENO" "fseeko" "ac_cv_func_fseeko"
15424 if test "x$ac_cv_func_fseeko" = xyes; then :
15425   $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
15426
15427 else
15428   case " $LIBOBJS " in
15429   *" fseeko.$ac_objext "* ) ;;
15430   *) LIBOBJS="$LIBOBJS fseeko.$ac_objext"
15431  ;;
15432 esac
15433
15434 fi
15435
15436
15437 case $host_os in
15438         # NetBSD uses a custom fseeko/ftello built on fsetpos/fgetpos
15439         # Mingw uses macros to access Win32 API calls
15440         netbsd*|mingw*)
15441
15442 $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
15443
15444                 ac_cv_func_fseeko=yes;;
15445         *)
15446                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
15447 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
15448 if ${ac_cv_sys_largefile_source+:} false; then :
15449   $as_echo_n "(cached) " >&6
15450 else
15451   while :; do
15452   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15453 /* end confdefs.h.  */
15454 #include <sys/types.h> /* for off_t */
15455      #include <stdio.h>
15456 int
15457 main ()
15458 {
15459 int (*fp) (FILE *, off_t, int) = fseeko;
15460      return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
15461   ;
15462   return 0;
15463 }
15464 _ACEOF
15465 if ac_fn_c_try_link "$LINENO"; then :
15466   ac_cv_sys_largefile_source=no; break
15467 fi
15468 rm -f core conftest.err conftest.$ac_objext \
15469     conftest$ac_exeext conftest.$ac_ext
15470   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15471 /* end confdefs.h.  */
15472 #define _LARGEFILE_SOURCE 1
15473 #include <sys/types.h> /* for off_t */
15474      #include <stdio.h>
15475 int
15476 main ()
15477 {
15478 int (*fp) (FILE *, off_t, int) = fseeko;
15479      return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
15480   ;
15481   return 0;
15482 }
15483 _ACEOF
15484 if ac_fn_c_try_link "$LINENO"; then :
15485   ac_cv_sys_largefile_source=1; break
15486 fi
15487 rm -f core conftest.err conftest.$ac_objext \
15488     conftest$ac_exeext conftest.$ac_ext
15489   ac_cv_sys_largefile_source=unknown
15490   break
15491 done
15492 fi
15493 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
15494 $as_echo "$ac_cv_sys_largefile_source" >&6; }
15495 case $ac_cv_sys_largefile_source in #(
15496   no | unknown) ;;
15497   *)
15498 cat >>confdefs.h <<_ACEOF
15499 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
15500 _ACEOF
15501 ;;
15502 esac
15503 rm -rf conftest*
15504
15505 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
15506 # in glibc 2.1.3, but that breaks too many other things.
15507 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
15508 if test $ac_cv_sys_largefile_source != unknown; then
15509
15510 $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
15511
15512 fi
15513 ;;
15514 esac
15515
15516 # posix_fadvise() is a no-op on Solaris, so don't incur function overhead
15517 # by calling it, 2009-04-02
15518 # http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/posix_fadvise.c
15519 # The Clang compiler raises a warning for an undeclared identifier that matches
15520 # a compiler builtin function.  All extant Clang versions are affected, as of
15521 # Clang 3.6.0.  Test a builtin known to every version.  This problem affects the
15522 # C and Objective C languages, but Clang does report an error under C++ and
15523 # Objective C++.
15524 #
15525 # Passing -fno-builtin to the compiler would suppress this problem.  That
15526 # strategy would have the advantage of being insensitive to stray warnings, but
15527 # it would make tests less realistic.
15528 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how $CC reports undeclared, standard C functions" >&5
15529 $as_echo_n "checking how $CC reports undeclared, standard C functions... " >&6; }
15530 if ${ac_cv_c_decl_report+:} false; then :
15531   $as_echo_n "(cached) " >&6
15532 else
15533   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15534 /* end confdefs.h.  */
15535
15536 int
15537 main ()
15538 {
15539 (void) strchr;
15540   ;
15541   return 0;
15542 }
15543 _ACEOF
15544 if ac_fn_c_try_compile "$LINENO"; then :
15545   if test -s conftest.err; then :
15546       # For AC_CHECK_DECL to react to warnings, the compiler must be silent on
15547     # valid AC_CHECK_DECL input.  No library function is consistently available
15548     # on freestanding implementations, so test against a dummy declaration.
15549     # Include always-available headers on the off chance that they somehow
15550     # elicit warnings.
15551     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15552 /* end confdefs.h.  */
15553 #include <float.h>
15554 #include <limits.h>
15555 #include <stdarg.h>
15556 #include <stddef.h>
15557 extern void ac_decl (int, char *);
15558 int
15559 main ()
15560 {
15561 #ifdef __cplusplus
15562   (void) ac_decl ((int) 0, (char *) 0);
15563   (void) ac_decl;
15564 #else
15565   (void) ac_decl;
15566 #endif
15567
15568   ;
15569   return 0;
15570 }
15571 _ACEOF
15572 if ac_fn_c_try_compile "$LINENO"; then :
15573   if test -s conftest.err; then :
15574   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
15575 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
15576 as_fn_error $? "cannot detect from compiler exit status or warnings
15577 See \`config.log' for more details" "$LINENO" 5; }
15578 else
15579   ac_cv_c_decl_report=warning
15580 fi
15581 else
15582   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
15583 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
15584 as_fn_error $? "cannot compile a simple declaration test
15585 See \`config.log' for more details" "$LINENO" 5; }
15586 fi
15587 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15588 else
15589   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
15590 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
15591 as_fn_error $? "compiler does not report undeclared identifiers
15592 See \`config.log' for more details" "$LINENO" 5; }
15593 fi
15594 else
15595   ac_cv_c_decl_report=error
15596 fi
15597 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15598 fi
15599 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_decl_report" >&5
15600 $as_echo "$ac_cv_c_decl_report" >&6; }
15601
15602 case $ac_cv_c_decl_report in
15603   warning) ac_c_decl_warn_flag=yes ;;
15604   *) ac_c_decl_warn_flag= ;;
15605 esac
15606
15607 if test "$PORTNAME" != "solaris"; then :
15608
15609 for ac_func in posix_fadvise
15610 do :
15611   ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise"
15612 if test "x$ac_cv_func_posix_fadvise" = xyes; then :
15613   cat >>confdefs.h <<_ACEOF
15614 #define HAVE_POSIX_FADVISE 1
15615 _ACEOF
15616
15617 fi
15618 done
15619
15620 ac_fn_c_check_decl "$LINENO" "posix_fadvise" "ac_cv_have_decl_posix_fadvise" "#include <fcntl.h>
15621 "
15622 if test "x$ac_cv_have_decl_posix_fadvise" = xyes; then :
15623   ac_have_decl=1
15624 else
15625   ac_have_decl=0
15626 fi
15627
15628 cat >>confdefs.h <<_ACEOF
15629 #define HAVE_DECL_POSIX_FADVISE $ac_have_decl
15630 _ACEOF
15631
15632
15633 fi # fi
15634
15635 ac_fn_c_check_decl "$LINENO" "fdatasync" "ac_cv_have_decl_fdatasync" "#include <unistd.h>
15636 "
15637 if test "x$ac_cv_have_decl_fdatasync" = xyes; then :
15638   ac_have_decl=1
15639 else
15640   ac_have_decl=0
15641 fi
15642
15643 cat >>confdefs.h <<_ACEOF
15644 #define HAVE_DECL_FDATASYNC $ac_have_decl
15645 _ACEOF
15646
15647 ac_fn_c_check_decl "$LINENO" "strlcat" "ac_cv_have_decl_strlcat" "$ac_includes_default"
15648 if test "x$ac_cv_have_decl_strlcat" = xyes; then :
15649   ac_have_decl=1
15650 else
15651   ac_have_decl=0
15652 fi
15653
15654 cat >>confdefs.h <<_ACEOF
15655 #define HAVE_DECL_STRLCAT $ac_have_decl
15656 _ACEOF
15657 ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" "$ac_includes_default"
15658 if test "x$ac_cv_have_decl_strlcpy" = xyes; then :
15659   ac_have_decl=1
15660 else
15661   ac_have_decl=0
15662 fi
15663
15664 cat >>confdefs.h <<_ACEOF
15665 #define HAVE_DECL_STRLCPY $ac_have_decl
15666 _ACEOF
15667 ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default"
15668 if test "x$ac_cv_have_decl_strnlen" = xyes; then :
15669   ac_have_decl=1
15670 else
15671   ac_have_decl=0
15672 fi
15673
15674 cat >>confdefs.h <<_ACEOF
15675 #define HAVE_DECL_STRNLEN $ac_have_decl
15676 _ACEOF
15677
15678 # This is probably only present on macOS, but may as well check always
15679 ac_fn_c_check_decl "$LINENO" "F_FULLFSYNC" "ac_cv_have_decl_F_FULLFSYNC" "#include <fcntl.h>
15680 "
15681 if test "x$ac_cv_have_decl_F_FULLFSYNC" = xyes; then :
15682   ac_have_decl=1
15683 else
15684   ac_have_decl=0
15685 fi
15686
15687 cat >>confdefs.h <<_ACEOF
15688 #define HAVE_DECL_F_FULLFSYNC $ac_have_decl
15689 _ACEOF
15690
15691
15692 ac_fn_c_check_decl "$LINENO" "RTLD_GLOBAL" "ac_cv_have_decl_RTLD_GLOBAL" "#include <dlfcn.h>
15693 "
15694 if test "x$ac_cv_have_decl_RTLD_GLOBAL" = xyes; then :
15695   ac_have_decl=1
15696 else
15697   ac_have_decl=0
15698 fi
15699
15700 cat >>confdefs.h <<_ACEOF
15701 #define HAVE_DECL_RTLD_GLOBAL $ac_have_decl
15702 _ACEOF
15703 ac_fn_c_check_decl "$LINENO" "RTLD_NOW" "ac_cv_have_decl_RTLD_NOW" "#include <dlfcn.h>
15704 "
15705 if test "x$ac_cv_have_decl_RTLD_NOW" = xyes; then :
15706   ac_have_decl=1
15707 else
15708   ac_have_decl=0
15709 fi
15710
15711 cat >>confdefs.h <<_ACEOF
15712 #define HAVE_DECL_RTLD_NOW $ac_have_decl
15713 _ACEOF
15714
15715
15716 ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "$ac_includes_default
15717 #include <netinet/in.h>
15718 "
15719 if test "x$ac_cv_type_struct_sockaddr_in6" = xyes; then :
15720
15721 $as_echo "#define HAVE_IPV6 1" >>confdefs.h
15722
15723 fi
15724
15725
15726 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PS_STRINGS" >&5
15727 $as_echo_n "checking for PS_STRINGS... " >&6; }
15728 if ${pgac_cv_var_PS_STRINGS+:} false; then :
15729   $as_echo_n "(cached) " >&6
15730 else
15731   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15732 /* end confdefs.h.  */
15733 #include <machine/vmparam.h>
15734 #include <sys/exec.h>
15735
15736 int
15737 main ()
15738 {
15739 PS_STRINGS->ps_nargvstr = 1;
15740 PS_STRINGS->ps_argvstr = "foo";
15741   ;
15742   return 0;
15743 }
15744 _ACEOF
15745 if ac_fn_c_try_link "$LINENO"; then :
15746   pgac_cv_var_PS_STRINGS=yes
15747 else
15748   pgac_cv_var_PS_STRINGS=no
15749 fi
15750 rm -f core conftest.err conftest.$ac_objext \
15751     conftest$ac_exeext conftest.$ac_ext
15752 fi
15753 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_PS_STRINGS" >&5
15754 $as_echo "$pgac_cv_var_PS_STRINGS" >&6; }
15755 if test "$pgac_cv_var_PS_STRINGS" = yes ; then
15756
15757 $as_echo "#define HAVE_PS_STRINGS 1" >>confdefs.h
15758
15759 fi
15760
15761
15762 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf" >&5
15763 $as_echo_n "checking for isinf... " >&6; }
15764 if ${ac_cv_func_isinf+:} false; then :
15765   $as_echo_n "(cached) " >&6
15766 else
15767   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15768 /* end confdefs.h.  */
15769
15770 #include <math.h>
15771 double glob_double;
15772
15773 int
15774 main ()
15775 {
15776 return isinf(glob_double) ? 0 : 1;
15777   ;
15778   return 0;
15779 }
15780 _ACEOF
15781 if ac_fn_c_try_link "$LINENO"; then :
15782   ac_cv_func_isinf=yes
15783 else
15784   ac_cv_func_isinf=no
15785 fi
15786 rm -f core conftest.err conftest.$ac_objext \
15787     conftest$ac_exeext conftest.$ac_ext
15788 fi
15789 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_isinf" >&5
15790 $as_echo "$ac_cv_func_isinf" >&6; }
15791
15792 if test $ac_cv_func_isinf = yes ; then
15793
15794 $as_echo "#define HAVE_ISINF 1" >>confdefs.h
15795
15796 else
15797   case " $LIBOBJS " in
15798   *" isinf.$ac_objext "* ) ;;
15799   *) LIBOBJS="$LIBOBJS isinf.$ac_objext"
15800  ;;
15801 esac
15802
15803   # Look for a way to implement a substitute for isinf()
15804   for ac_func in fpclass fp_class fp_class_d class
15805 do :
15806   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
15807 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
15808 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
15809   cat >>confdefs.h <<_ACEOF
15810 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
15811 _ACEOF
15812  break
15813 fi
15814 done
15815
15816 fi
15817
15818 ac_fn_c_check_func "$LINENO" "crypt" "ac_cv_func_crypt"
15819 if test "x$ac_cv_func_crypt" = xyes; then :
15820   $as_echo "#define HAVE_CRYPT 1" >>confdefs.h
15821
15822 else
15823   case " $LIBOBJS " in
15824   *" crypt.$ac_objext "* ) ;;
15825   *) LIBOBJS="$LIBOBJS crypt.$ac_objext"
15826  ;;
15827 esac
15828
15829 fi
15830
15831 ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
15832 if test "x$ac_cv_func_dlopen" = xyes; then :
15833   $as_echo "#define HAVE_DLOPEN 1" >>confdefs.h
15834
15835 else
15836   case " $LIBOBJS " in
15837   *" dlopen.$ac_objext "* ) ;;
15838   *) LIBOBJS="$LIBOBJS dlopen.$ac_objext"
15839  ;;
15840 esac
15841
15842 fi
15843
15844 ac_fn_c_check_func "$LINENO" "fls" "ac_cv_func_fls"
15845 if test "x$ac_cv_func_fls" = xyes; then :
15846   $as_echo "#define HAVE_FLS 1" >>confdefs.h
15847
15848 else
15849   case " $LIBOBJS " in
15850   *" fls.$ac_objext "* ) ;;
15851   *) LIBOBJS="$LIBOBJS fls.$ac_objext"
15852  ;;
15853 esac
15854
15855 fi
15856
15857 ac_fn_c_check_func "$LINENO" "getopt" "ac_cv_func_getopt"
15858 if test "x$ac_cv_func_getopt" = xyes; then :
15859   $as_echo "#define HAVE_GETOPT 1" >>confdefs.h
15860
15861 else
15862   case " $LIBOBJS " in
15863   *" getopt.$ac_objext "* ) ;;
15864   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
15865  ;;
15866 esac
15867
15868 fi
15869
15870 ac_fn_c_check_func "$LINENO" "getrusage" "ac_cv_func_getrusage"
15871 if test "x$ac_cv_func_getrusage" = xyes; then :
15872   $as_echo "#define HAVE_GETRUSAGE 1" >>confdefs.h
15873
15874 else
15875   case " $LIBOBJS " in
15876   *" getrusage.$ac_objext "* ) ;;
15877   *) LIBOBJS="$LIBOBJS getrusage.$ac_objext"
15878  ;;
15879 esac
15880
15881 fi
15882
15883 ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton"
15884 if test "x$ac_cv_func_inet_aton" = xyes; then :
15885   $as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
15886
15887 else
15888   case " $LIBOBJS " in
15889   *" inet_aton.$ac_objext "* ) ;;
15890   *) LIBOBJS="$LIBOBJS inet_aton.$ac_objext"
15891  ;;
15892 esac
15893
15894 fi
15895
15896 ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
15897 if test "x$ac_cv_func_mkdtemp" = xyes; then :
15898   $as_echo "#define HAVE_MKDTEMP 1" >>confdefs.h
15899
15900 else
15901   case " $LIBOBJS " in
15902   *" mkdtemp.$ac_objext "* ) ;;
15903   *) LIBOBJS="$LIBOBJS mkdtemp.$ac_objext"
15904  ;;
15905 esac
15906
15907 fi
15908
15909 ac_fn_c_check_func "$LINENO" "pread" "ac_cv_func_pread"
15910 if test "x$ac_cv_func_pread" = xyes; then :
15911   $as_echo "#define HAVE_PREAD 1" >>confdefs.h
15912
15913 else
15914   case " $LIBOBJS " in
15915   *" pread.$ac_objext "* ) ;;
15916   *) LIBOBJS="$LIBOBJS pread.$ac_objext"
15917  ;;
15918 esac
15919
15920 fi
15921
15922 ac_fn_c_check_func "$LINENO" "pwrite" "ac_cv_func_pwrite"
15923 if test "x$ac_cv_func_pwrite" = xyes; then :
15924   $as_echo "#define HAVE_PWRITE 1" >>confdefs.h
15925
15926 else
15927   case " $LIBOBJS " in
15928   *" pwrite.$ac_objext "* ) ;;
15929   *) LIBOBJS="$LIBOBJS pwrite.$ac_objext"
15930  ;;
15931 esac
15932
15933 fi
15934
15935 ac_fn_c_check_func "$LINENO" "random" "ac_cv_func_random"
15936 if test "x$ac_cv_func_random" = xyes; then :
15937   $as_echo "#define HAVE_RANDOM 1" >>confdefs.h
15938
15939 else
15940   case " $LIBOBJS " in
15941   *" random.$ac_objext "* ) ;;
15942   *) LIBOBJS="$LIBOBJS random.$ac_objext"
15943  ;;
15944 esac
15945
15946 fi
15947
15948 ac_fn_c_check_func "$LINENO" "rint" "ac_cv_func_rint"
15949 if test "x$ac_cv_func_rint" = xyes; then :
15950   $as_echo "#define HAVE_RINT 1" >>confdefs.h
15951
15952 else
15953   case " $LIBOBJS " in
15954   *" rint.$ac_objext "* ) ;;
15955   *) LIBOBJS="$LIBOBJS rint.$ac_objext"
15956  ;;
15957 esac
15958
15959 fi
15960
15961 ac_fn_c_check_func "$LINENO" "srandom" "ac_cv_func_srandom"
15962 if test "x$ac_cv_func_srandom" = xyes; then :
15963   $as_echo "#define HAVE_SRANDOM 1" >>confdefs.h
15964
15965 else
15966   case " $LIBOBJS " in
15967   *" srandom.$ac_objext "* ) ;;
15968   *) LIBOBJS="$LIBOBJS srandom.$ac_objext"
15969  ;;
15970 esac
15971
15972 fi
15973
15974 ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat"
15975 if test "x$ac_cv_func_strlcat" = xyes; then :
15976   $as_echo "#define HAVE_STRLCAT 1" >>confdefs.h
15977
15978 else
15979   case " $LIBOBJS " in
15980   *" strlcat.$ac_objext "* ) ;;
15981   *) LIBOBJS="$LIBOBJS strlcat.$ac_objext"
15982  ;;
15983 esac
15984
15985 fi
15986
15987 ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy"
15988 if test "x$ac_cv_func_strlcpy" = xyes; then :
15989   $as_echo "#define HAVE_STRLCPY 1" >>confdefs.h
15990
15991 else
15992   case " $LIBOBJS " in
15993   *" strlcpy.$ac_objext "* ) ;;
15994   *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext"
15995  ;;
15996 esac
15997
15998 fi
15999
16000 ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen"
16001 if test "x$ac_cv_func_strnlen" = xyes; then :
16002   $as_echo "#define HAVE_STRNLEN 1" >>confdefs.h
16003
16004 else
16005   case " $LIBOBJS " in
16006   *" strnlen.$ac_objext "* ) ;;
16007   *) LIBOBJS="$LIBOBJS strnlen.$ac_objext"
16008  ;;
16009 esac
16010
16011 fi
16012
16013 ac_fn_c_check_func "$LINENO" "strtof" "ac_cv_func_strtof"
16014 if test "x$ac_cv_func_strtof" = xyes; then :
16015   $as_echo "#define HAVE_STRTOF 1" >>confdefs.h
16016
16017 else
16018   case " $LIBOBJS " in
16019   *" strtof.$ac_objext "* ) ;;
16020   *) LIBOBJS="$LIBOBJS strtof.$ac_objext"
16021  ;;
16022 esac
16023
16024 fi
16025
16026
16027
16028 case $host_os in
16029         # Cygwin and (apparently, based on test results) Mingw both
16030         # have a broken strtof(), so substitute the same replacement
16031         # code we use with VS2013. That's not a perfect fix, since
16032         # (unlike with VS2013) it doesn't avoid double-rounding, but
16033         # we have no better options. To get that, though, we have to
16034         # force the file to be compiled despite HAVE_STRTOF.
16035         mingw*|cygwin*)
16036                 case " $LIBOBJS " in
16037   *" strtof.$ac_objext "* ) ;;
16038   *) LIBOBJS="$LIBOBJS strtof.$ac_objext"
16039  ;;
16040 esac
16041
16042                 { $as_echo "$as_me:${as_lineno-$LINENO}: On $host_os we will use our strtof wrapper." >&5
16043 $as_echo "$as_me: On $host_os we will use our strtof wrapper." >&6;}
16044         ;;
16045 esac
16046
16047 case $host_os in
16048
16049         # Windows uses a specialised env handler
16050         # and doesn't need a replacement getpeereid because it doesn't use
16051         # Unix sockets.
16052         mingw*)
16053
16054 $as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
16055
16056
16057 $as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
16058
16059                 ac_cv_func_unsetenv=yes
16060                 ac_cv_func_getpeereid=yes;;
16061         *)
16062                 ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
16063 if test "x$ac_cv_func_unsetenv" = xyes; then :
16064   $as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
16065
16066 else
16067   case " $LIBOBJS " in
16068   *" unsetenv.$ac_objext "* ) ;;
16069   *) LIBOBJS="$LIBOBJS unsetenv.$ac_objext"
16070  ;;
16071 esac
16072
16073 fi
16074
16075 ac_fn_c_check_func "$LINENO" "getpeereid" "ac_cv_func_getpeereid"
16076 if test "x$ac_cv_func_getpeereid" = xyes; then :
16077   $as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
16078
16079 else
16080   case " $LIBOBJS " in
16081   *" getpeereid.$ac_objext "* ) ;;
16082   *) LIBOBJS="$LIBOBJS getpeereid.$ac_objext"
16083  ;;
16084 esac
16085
16086 fi
16087
16088
16089                 ;;
16090 esac
16091
16092 # System's version of getaddrinfo(), if any, may be used only if we found
16093 # a definition for struct addrinfo; see notes in src/include/getaddrinfo.h.
16094 # We use only our own getaddrinfo.c on Windows, but it's time to revisit that.
16095 if test x"$ac_cv_type_struct_addrinfo" = xyes && \
16096    test "$PORTNAME" != "win32"; then
16097   ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo"
16098 if test "x$ac_cv_func_getaddrinfo" = xyes; then :
16099   $as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
16100
16101 else
16102   case " $LIBOBJS " in
16103   *" getaddrinfo.$ac_objext "* ) ;;
16104   *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext"
16105  ;;
16106 esac
16107
16108 fi
16109
16110
16111 else
16112   case " $LIBOBJS " in
16113   *" getaddrinfo.$ac_objext "* ) ;;
16114   *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext"
16115  ;;
16116 esac
16117
16118 fi
16119
16120 # Similarly, use system's getopt_long() only if system provides struct option.
16121 if test x"$ac_cv_type_struct_option" = xyes ; then
16122   ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long"
16123 if test "x$ac_cv_func_getopt_long" = xyes; then :
16124   $as_echo "#define HAVE_GETOPT_LONG 1" >>confdefs.h
16125
16126 else
16127   case " $LIBOBJS " in
16128   *" getopt_long.$ac_objext "* ) ;;
16129   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
16130  ;;
16131 esac
16132
16133 fi
16134
16135
16136 else
16137   case " $LIBOBJS " in
16138   *" getopt_long.$ac_objext "* ) ;;
16139   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
16140  ;;
16141 esac
16142
16143 fi
16144
16145 # On OpenBSD and Solaris, getopt() doesn't do what we want for long options
16146 # (i.e., allow '-' as a flag character), so use our version on those platforms.
16147 if test "$PORTNAME" = "openbsd" -o "$PORTNAME" = "solaris"; then
16148   case " $LIBOBJS " in
16149   *" getopt.$ac_objext "* ) ;;
16150   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
16151  ;;
16152 esac
16153
16154 fi
16155
16156 # mingw has adopted a GNU-centric interpretation of optind/optreset,
16157 # so always use our version on Windows.
16158 if test "$PORTNAME" = "win32"; then
16159   case " $LIBOBJS " in
16160   *" getopt.$ac_objext "* ) ;;
16161   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
16162  ;;
16163 esac
16164
16165   case " $LIBOBJS " in
16166   *" getopt_long.$ac_objext "* ) ;;
16167   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
16168  ;;
16169 esac
16170
16171 fi
16172
16173 # Win32 (really MinGW) support
16174 if test "$PORTNAME" = "win32"; then
16175   for ac_func in _configthreadlocale
16176 do :
16177   ac_fn_c_check_func "$LINENO" "_configthreadlocale" "ac_cv_func__configthreadlocale"
16178 if test "x$ac_cv_func__configthreadlocale" = xyes; then :
16179   cat >>confdefs.h <<_ACEOF
16180 #define HAVE__CONFIGTHREADLOCALE 1
16181 _ACEOF
16182
16183 fi
16184 done
16185
16186   ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
16187 if test "x$ac_cv_func_gettimeofday" = xyes; then :
16188   $as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
16189
16190 else
16191   case " $LIBOBJS " in
16192   *" gettimeofday.$ac_objext "* ) ;;
16193   *) LIBOBJS="$LIBOBJS gettimeofday.$ac_objext"
16194  ;;
16195 esac
16196
16197 fi
16198
16199
16200   case " $LIBOBJS " in
16201   *" dirmod.$ac_objext "* ) ;;
16202   *) LIBOBJS="$LIBOBJS dirmod.$ac_objext"
16203  ;;
16204 esac
16205
16206   case " $LIBOBJS " in
16207   *" kill.$ac_objext "* ) ;;
16208   *) LIBOBJS="$LIBOBJS kill.$ac_objext"
16209  ;;
16210 esac
16211
16212   case " $LIBOBJS " in
16213   *" open.$ac_objext "* ) ;;
16214   *) LIBOBJS="$LIBOBJS open.$ac_objext"
16215  ;;
16216 esac
16217
16218   case " $LIBOBJS " in
16219   *" system.$ac_objext "* ) ;;
16220   *) LIBOBJS="$LIBOBJS system.$ac_objext"
16221  ;;
16222 esac
16223
16224   case " $LIBOBJS " in
16225   *" win32env.$ac_objext "* ) ;;
16226   *) LIBOBJS="$LIBOBJS win32env.$ac_objext"
16227  ;;
16228 esac
16229
16230   case " $LIBOBJS " in
16231   *" win32error.$ac_objext "* ) ;;
16232   *) LIBOBJS="$LIBOBJS win32error.$ac_objext"
16233  ;;
16234 esac
16235
16236   case " $LIBOBJS " in
16237   *" win32security.$ac_objext "* ) ;;
16238   *) LIBOBJS="$LIBOBJS win32security.$ac_objext"
16239  ;;
16240 esac
16241
16242   case " $LIBOBJS " in
16243   *" win32setlocale.$ac_objext "* ) ;;
16244   *) LIBOBJS="$LIBOBJS win32setlocale.$ac_objext"
16245  ;;
16246 esac
16247
16248
16249 $as_echo "#define HAVE_SYMLINK 1" >>confdefs.h
16250
16251   ac_fn_c_check_type "$LINENO" "MINIDUMP_TYPE" "ac_cv_type_MINIDUMP_TYPE" "
16252 #define WIN32_LEAN_AND_MEAN
16253 #include <windows.h>
16254 #include <string.h>
16255 #include <dbghelp.h>
16256 "
16257 if test "x$ac_cv_type_MINIDUMP_TYPE" = xyes; then :
16258
16259 cat >>confdefs.h <<_ACEOF
16260 #define HAVE_MINIDUMP_TYPE 1
16261 _ACEOF
16262
16263 pgac_minidump_type=yes
16264 else
16265   pgac_minidump_type=no
16266 fi
16267
16268 fi
16269 if test x"$pgac_minidump_type" = x"yes" ; then
16270   have_win32_dbghelp=yes
16271
16272 else
16273   have_win32_dbghelp=no
16274
16275 fi
16276
16277 # Cygwin needs only a bit of that
16278 if test "$PORTNAME" = "cygwin"; then
16279   case " $LIBOBJS " in
16280   *" dirmod.$ac_objext "* ) ;;
16281   *) LIBOBJS="$LIBOBJS dirmod.$ac_objext"
16282  ;;
16283 esac
16284
16285 fi
16286
16287 ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog"
16288 if test "x$ac_cv_func_syslog" = xyes; then :
16289   ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default"
16290 if test "x$ac_cv_header_syslog_h" = xyes; then :
16291
16292 $as_echo "#define HAVE_SYSLOG 1" >>confdefs.h
16293
16294 fi
16295
16296
16297 fi
16298
16299
16300 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opterr" >&5
16301 $as_echo_n "checking for opterr... " >&6; }
16302 if ${pgac_cv_var_int_opterr+:} false; then :
16303   $as_echo_n "(cached) " >&6
16304 else
16305   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16306 /* end confdefs.h.  */
16307 #include <unistd.h>
16308 int
16309 main ()
16310 {
16311 extern int opterr; opterr = 1;
16312   ;
16313   return 0;
16314 }
16315 _ACEOF
16316 if ac_fn_c_try_link "$LINENO"; then :
16317   pgac_cv_var_int_opterr=yes
16318 else
16319   pgac_cv_var_int_opterr=no
16320 fi
16321 rm -f core conftest.err conftest.$ac_objext \
16322     conftest$ac_exeext conftest.$ac_ext
16323 fi
16324 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_opterr" >&5
16325 $as_echo "$pgac_cv_var_int_opterr" >&6; }
16326 if test x"$pgac_cv_var_int_opterr" = x"yes"; then
16327
16328 $as_echo "#define HAVE_INT_OPTERR 1" >>confdefs.h
16329
16330 fi
16331
16332 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for optreset" >&5
16333 $as_echo_n "checking for optreset... " >&6; }
16334 if ${pgac_cv_var_int_optreset+:} false; then :
16335   $as_echo_n "(cached) " >&6
16336 else
16337   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16338 /* end confdefs.h.  */
16339 #include <unistd.h>
16340 int
16341 main ()
16342 {
16343 extern int optreset; optreset = 1;
16344   ;
16345   return 0;
16346 }
16347 _ACEOF
16348 if ac_fn_c_try_link "$LINENO"; then :
16349   pgac_cv_var_int_optreset=yes
16350 else
16351   pgac_cv_var_int_optreset=no
16352 fi
16353 rm -f core conftest.err conftest.$ac_objext \
16354     conftest$ac_exeext conftest.$ac_ext
16355 fi
16356 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_optreset" >&5
16357 $as_echo "$pgac_cv_var_int_optreset" >&6; }
16358 if test x"$pgac_cv_var_int_optreset" = x"yes"; then
16359
16360 $as_echo "#define HAVE_INT_OPTRESET 1" >>confdefs.h
16361
16362 fi
16363
16364 for ac_func in strtoll __strtoll strtoq
16365 do :
16366   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
16367 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
16368 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
16369   cat >>confdefs.h <<_ACEOF
16370 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
16371 _ACEOF
16372  break
16373 fi
16374 done
16375
16376 for ac_func in strtoull __strtoull strtouq
16377 do :
16378   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
16379 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
16380 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
16381   cat >>confdefs.h <<_ACEOF
16382 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
16383 _ACEOF
16384  break
16385 fi
16386 done
16387
16388 # strto[u]ll may exist but not be declared
16389 ac_fn_c_check_decl "$LINENO" "strtoll" "ac_cv_have_decl_strtoll" "$ac_includes_default"
16390 if test "x$ac_cv_have_decl_strtoll" = xyes; then :
16391   ac_have_decl=1
16392 else
16393   ac_have_decl=0
16394 fi
16395
16396 cat >>confdefs.h <<_ACEOF
16397 #define HAVE_DECL_STRTOLL $ac_have_decl
16398 _ACEOF
16399 ac_fn_c_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default"
16400 if test "x$ac_cv_have_decl_strtoull" = xyes; then :
16401   ac_have_decl=1
16402 else
16403   ac_have_decl=0
16404 fi
16405
16406 cat >>confdefs.h <<_ACEOF
16407 #define HAVE_DECL_STRTOULL $ac_have_decl
16408 _ACEOF
16409
16410
16411 if test "$with_icu" = yes; then
16412   ac_save_CPPFLAGS=$CPPFLAGS
16413   CPPFLAGS="$ICU_CFLAGS $CPPFLAGS"
16414
16415   # Verify we have ICU's header files
16416   ac_fn_c_check_header_mongrel "$LINENO" "unicode/ucol.h" "ac_cv_header_unicode_ucol_h" "$ac_includes_default"
16417 if test "x$ac_cv_header_unicode_ucol_h" = xyes; then :
16418
16419 else
16420   as_fn_error $? "header file <unicode/ucol.h> is required for ICU" "$LINENO" 5
16421 fi
16422
16423
16424
16425   CPPFLAGS=$ac_save_CPPFLAGS
16426 fi
16427
16428 if test "$with_llvm" = yes; then
16429
16430   # Check which functionality is present
16431   SAVE_CPPFLAGS="$CPPFLAGS"
16432   CPPFLAGS="$CPPFLAGS $LLVM_CPPFLAGS"
16433   ac_fn_c_check_decl "$LINENO" "LLVMOrcGetSymbolAddressIn" "ac_cv_have_decl_LLVMOrcGetSymbolAddressIn" "#include <llvm-c/OrcBindings.h>
16434 "
16435 if test "x$ac_cv_have_decl_LLVMOrcGetSymbolAddressIn" = xyes; then :
16436   ac_have_decl=1
16437 else
16438   ac_have_decl=0
16439 fi
16440
16441 cat >>confdefs.h <<_ACEOF
16442 #define HAVE_DECL_LLVMORCGETSYMBOLADDRESSIN $ac_have_decl
16443 _ACEOF
16444
16445   ac_fn_c_check_decl "$LINENO" "LLVMGetHostCPUName" "ac_cv_have_decl_LLVMGetHostCPUName" "#include <llvm-c/TargetMachine.h>
16446 "
16447 if test "x$ac_cv_have_decl_LLVMGetHostCPUName" = xyes; then :
16448   ac_have_decl=1
16449 else
16450   ac_have_decl=0
16451 fi
16452
16453 cat >>confdefs.h <<_ACEOF
16454 #define HAVE_DECL_LLVMGETHOSTCPUNAME $ac_have_decl
16455 _ACEOF
16456 ac_fn_c_check_decl "$LINENO" "LLVMGetHostCPUFeatures" "ac_cv_have_decl_LLVMGetHostCPUFeatures" "#include <llvm-c/TargetMachine.h>
16457 "
16458 if test "x$ac_cv_have_decl_LLVMGetHostCPUFeatures" = xyes; then :
16459   ac_have_decl=1
16460 else
16461   ac_have_decl=0
16462 fi
16463
16464 cat >>confdefs.h <<_ACEOF
16465 #define HAVE_DECL_LLVMGETHOSTCPUFEATURES $ac_have_decl
16466 _ACEOF
16467
16468   ac_fn_c_check_decl "$LINENO" "LLVMCreateGDBRegistrationListener" "ac_cv_have_decl_LLVMCreateGDBRegistrationListener" "#include <llvm-c/ExecutionEngine.h>
16469 "
16470 if test "x$ac_cv_have_decl_LLVMCreateGDBRegistrationListener" = xyes; then :
16471   ac_have_decl=1
16472 else
16473   ac_have_decl=0
16474 fi
16475
16476 cat >>confdefs.h <<_ACEOF
16477 #define HAVE_DECL_LLVMCREATEGDBREGISTRATIONLISTENER $ac_have_decl
16478 _ACEOF
16479 ac_fn_c_check_decl "$LINENO" "LLVMCreatePerfJITEventListener" "ac_cv_have_decl_LLVMCreatePerfJITEventListener" "#include <llvm-c/ExecutionEngine.h>
16480 "
16481 if test "x$ac_cv_have_decl_LLVMCreatePerfJITEventListener" = xyes; then :
16482   ac_have_decl=1
16483 else
16484   ac_have_decl=0
16485 fi
16486
16487 cat >>confdefs.h <<_ACEOF
16488 #define HAVE_DECL_LLVMCREATEPERFJITEVENTLISTENER $ac_have_decl
16489 _ACEOF
16490
16491   CPPFLAGS="$SAVE_CPPFLAGS"
16492
16493 fi
16494
16495 # Lastly, restore full LIBS list and check for readline/libedit symbols
16496 LIBS="$LIBS_including_readline"
16497
16498 if test "$with_readline" = yes; then
16499   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_append_character" >&5
16500 $as_echo_n "checking for rl_completion_append_character... " >&6; }
16501 if ${pgac_cv_var_rl_completion_append_character+:} false; then :
16502   $as_echo_n "(cached) " >&6
16503 else
16504   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16505 /* end confdefs.h.  */
16506 #include <stdio.h>
16507 #ifdef HAVE_READLINE_READLINE_H
16508 # include <readline/readline.h>
16509 #elif defined(HAVE_READLINE_H)
16510 # include <readline.h>
16511 #endif
16512
16513 int
16514 main ()
16515 {
16516 rl_completion_append_character = 'x';
16517   ;
16518   return 0;
16519 }
16520 _ACEOF
16521 if ac_fn_c_try_link "$LINENO"; then :
16522   pgac_cv_var_rl_completion_append_character=yes
16523 else
16524   pgac_cv_var_rl_completion_append_character=no
16525 fi
16526 rm -f core conftest.err conftest.$ac_objext \
16527     conftest$ac_exeext conftest.$ac_ext
16528 fi
16529 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_rl_completion_append_character" >&5
16530 $as_echo "$pgac_cv_var_rl_completion_append_character" >&6; }
16531 if test x"$pgac_cv_var_rl_completion_append_character" = x"yes"; then
16532
16533 $as_echo "#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1" >>confdefs.h
16534
16535 fi
16536   for ac_func in rl_completion_matches rl_filename_completion_function rl_reset_screen_size
16537 do :
16538   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
16539 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
16540 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
16541   cat >>confdefs.h <<_ACEOF
16542 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
16543 _ACEOF
16544
16545 fi
16546 done
16547
16548   for ac_func in append_history history_truncate_file
16549 do :
16550   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
16551 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
16552 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
16553   cat >>confdefs.h <<_ACEOF
16554 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
16555 _ACEOF
16556
16557 fi
16558 done
16559
16560 fi
16561
16562
16563 # This test makes sure that run tests work at all.  Sometimes a shared
16564 # library is found by the linker, but the runtime linker can't find it.
16565 # This check should come after all modifications of compiler or linker
16566 # variables, and before any other run tests.
16567 { $as_echo "$as_me:${as_lineno-$LINENO}: checking test program" >&5
16568 $as_echo_n "checking test program... " >&6; }
16569 if test "$cross_compiling" = yes; then :
16570   { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling" >&5
16571 $as_echo "cross-compiling" >&6; }
16572 else
16573   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16574 /* end confdefs.h.  */
16575 int main() { return 0; }
16576 _ACEOF
16577 if ac_fn_c_try_run "$LINENO"; then :
16578   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
16579 $as_echo "ok" >&6; }
16580 else
16581   { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
16582 $as_echo "failed" >&6; }
16583 as_fn_error $? "
16584 Could not execute a simple test program.  This may be a problem
16585 related to locating shared libraries.  Check the file 'config.log'
16586 for the exact reason." "$LINENO" 5
16587 fi
16588 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16589   conftest.$ac_objext conftest.beam conftest.$ac_ext
16590 fi
16591
16592
16593 # --------------------
16594 # Run tests below here
16595 # --------------------
16596
16597
16598 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long int is 64 bits" >&5
16599 $as_echo_n "checking whether long int is 64 bits... " >&6; }
16600 if ${pgac_cv_type_long_int_64+:} false; then :
16601   $as_echo_n "(cached) " >&6
16602 else
16603   if test "$cross_compiling" = yes; then :
16604   # If cross-compiling, check the size reported by the compiler and
16605 # trust that the arithmetic works.
16606 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16607 /* end confdefs.h.  */
16608
16609 int
16610 main ()
16611 {
16612 static int test_array [1 - 2 * !(sizeof(long int) == 8)];
16613 test_array [0] = 0;
16614 return test_array [0];
16615
16616   ;
16617   return 0;
16618 }
16619 _ACEOF
16620 if ac_fn_c_try_compile "$LINENO"; then :
16621   pgac_cv_type_long_int_64=yes
16622 else
16623   pgac_cv_type_long_int_64=no
16624 fi
16625 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16626 else
16627   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16628 /* end confdefs.h.  */
16629 typedef long int ac_int64;
16630
16631 /*
16632  * These are globals to discourage the compiler from folding all the
16633  * arithmetic tests down to compile-time constants.
16634  */
16635 ac_int64 a = 20000001;
16636 ac_int64 b = 40000005;
16637
16638 int does_int64_work()
16639 {
16640   ac_int64 c,d;
16641
16642   if (sizeof(ac_int64) != 8)
16643     return 0;                   /* definitely not the right size */
16644
16645   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
16646   c = a * b;
16647   d = (c + b) / b;
16648   if (d != a+1)
16649     return 0;
16650   return 1;
16651 }
16652
16653 int
16654 main() {
16655   return (! does_int64_work());
16656 }
16657 _ACEOF
16658 if ac_fn_c_try_run "$LINENO"; then :
16659   pgac_cv_type_long_int_64=yes
16660 else
16661   pgac_cv_type_long_int_64=no
16662 fi
16663 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16664   conftest.$ac_objext conftest.beam conftest.$ac_ext
16665 fi
16666
16667 fi
16668 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_long_int_64" >&5
16669 $as_echo "$pgac_cv_type_long_int_64" >&6; }
16670
16671 HAVE_LONG_INT_64=$pgac_cv_type_long_int_64
16672 if test x"$pgac_cv_type_long_int_64" = xyes ; then
16673
16674 $as_echo "#define HAVE_LONG_INT_64 1" >>confdefs.h
16675
16676 fi
16677
16678
16679 if test x"$HAVE_LONG_INT_64" = x"yes" ; then
16680   pg_int64_type="long int"
16681 else
16682   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long long int is 64 bits" >&5
16683 $as_echo_n "checking whether long long int is 64 bits... " >&6; }
16684 if ${pgac_cv_type_long_long_int_64+:} false; then :
16685   $as_echo_n "(cached) " >&6
16686 else
16687   if test "$cross_compiling" = yes; then :
16688   # If cross-compiling, check the size reported by the compiler and
16689 # trust that the arithmetic works.
16690 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16691 /* end confdefs.h.  */
16692
16693 int
16694 main ()
16695 {
16696 static int test_array [1 - 2 * !(sizeof(long long int) == 8)];
16697 test_array [0] = 0;
16698 return test_array [0];
16699
16700   ;
16701   return 0;
16702 }
16703 _ACEOF
16704 if ac_fn_c_try_compile "$LINENO"; then :
16705   pgac_cv_type_long_long_int_64=yes
16706 else
16707   pgac_cv_type_long_long_int_64=no
16708 fi
16709 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16710 else
16711   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16712 /* end confdefs.h.  */
16713 typedef long long int ac_int64;
16714
16715 /*
16716  * These are globals to discourage the compiler from folding all the
16717  * arithmetic tests down to compile-time constants.
16718  */
16719 ac_int64 a = 20000001;
16720 ac_int64 b = 40000005;
16721
16722 int does_int64_work()
16723 {
16724   ac_int64 c,d;
16725
16726   if (sizeof(ac_int64) != 8)
16727     return 0;                   /* definitely not the right size */
16728
16729   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
16730   c = a * b;
16731   d = (c + b) / b;
16732   if (d != a+1)
16733     return 0;
16734   return 1;
16735 }
16736
16737 int
16738 main() {
16739   return (! does_int64_work());
16740 }
16741 _ACEOF
16742 if ac_fn_c_try_run "$LINENO"; then :
16743   pgac_cv_type_long_long_int_64=yes
16744 else
16745   pgac_cv_type_long_long_int_64=no
16746 fi
16747 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16748   conftest.$ac_objext conftest.beam conftest.$ac_ext
16749 fi
16750
16751 fi
16752 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_long_long_int_64" >&5
16753 $as_echo "$pgac_cv_type_long_long_int_64" >&6; }
16754
16755 HAVE_LONG_LONG_INT_64=$pgac_cv_type_long_long_int_64
16756 if test x"$pgac_cv_type_long_long_int_64" = xyes ; then
16757
16758 $as_echo "#define HAVE_LONG_LONG_INT_64 1" >>confdefs.h
16759
16760 fi
16761
16762   if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then
16763     pg_int64_type="long long int"
16764   else
16765     as_fn_error $? "Cannot find a working 64-bit integer type." "$LINENO" 5
16766   fi
16767 fi
16768
16769
16770 cat >>confdefs.h <<_ACEOF
16771 #define PG_INT64_TYPE $pg_int64_type
16772 _ACEOF
16773
16774
16775 # Select the printf length modifier that goes with that, too.
16776 if test x"$pg_int64_type" = x"long long int" ; then
16777   INT64_MODIFIER='"ll"'
16778 else
16779   INT64_MODIFIER='"l"'
16780 fi
16781
16782
16783 cat >>confdefs.h <<_ACEOF
16784 #define INT64_MODIFIER $INT64_MODIFIER
16785 _ACEOF
16786
16787
16788 # has to be down here, rather than with the other builtins, because
16789 # the test uses PG_INT64_TYPE.
16790 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_mul_overflow" >&5
16791 $as_echo_n "checking for __builtin_mul_overflow... " >&6; }
16792 if ${pgac_cv__builtin_op_overflow+:} false; then :
16793   $as_echo_n "(cached) " >&6
16794 else
16795   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16796 /* end confdefs.h.  */
16797
16798 PG_INT64_TYPE a = 1;
16799 PG_INT64_TYPE b = 1;
16800 PG_INT64_TYPE result;
16801 int oflo;
16802
16803 int
16804 main ()
16805 {
16806 oflo = __builtin_mul_overflow(a, b, &result);
16807   ;
16808   return 0;
16809 }
16810 _ACEOF
16811 if ac_fn_c_try_link "$LINENO"; then :
16812   pgac_cv__builtin_op_overflow=yes
16813 else
16814   pgac_cv__builtin_op_overflow=no
16815 fi
16816 rm -f core conftest.err conftest.$ac_objext \
16817     conftest$ac_exeext conftest.$ac_ext
16818 fi
16819 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_op_overflow" >&5
16820 $as_echo "$pgac_cv__builtin_op_overflow" >&6; }
16821 if test x"$pgac_cv__builtin_op_overflow" = xyes ; then
16822
16823 $as_echo "#define HAVE__BUILTIN_OP_OVERFLOW 1" >>confdefs.h
16824
16825 fi
16826
16827 # Check size of void *, size_t (enables tweaks for > 32bit address space)
16828 # The cast to long int works around a bug in the HP C Compiler
16829 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
16830 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
16831 # This bug is HP SR number 8606223364.
16832 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
16833 $as_echo_n "checking size of void *... " >&6; }
16834 if ${ac_cv_sizeof_void_p+:} false; then :
16835   $as_echo_n "(cached) " >&6
16836 else
16837   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p"        "$ac_includes_default"; then :
16838
16839 else
16840   if test "$ac_cv_type_void_p" = yes; then
16841      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16842 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
16843 as_fn_error 77 "cannot compute sizeof (void *)
16844 See \`config.log' for more details" "$LINENO" 5; }
16845    else
16846      ac_cv_sizeof_void_p=0
16847    fi
16848 fi
16849
16850 fi
16851 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
16852 $as_echo "$ac_cv_sizeof_void_p" >&6; }
16853
16854
16855
16856 cat >>confdefs.h <<_ACEOF
16857 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
16858 _ACEOF
16859
16860
16861 # The cast to long int works around a bug in the HP C Compiler
16862 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
16863 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
16864 # This bug is HP SR number 8606223364.
16865 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
16866 $as_echo_n "checking size of size_t... " >&6; }
16867 if ${ac_cv_sizeof_size_t+:} false; then :
16868   $as_echo_n "(cached) " >&6
16869 else
16870   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t"        "$ac_includes_default"; then :
16871
16872 else
16873   if test "$ac_cv_type_size_t" = yes; then
16874      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16875 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
16876 as_fn_error 77 "cannot compute sizeof (size_t)
16877 See \`config.log' for more details" "$LINENO" 5; }
16878    else
16879      ac_cv_sizeof_size_t=0
16880    fi
16881 fi
16882
16883 fi
16884 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
16885 $as_echo "$ac_cv_sizeof_size_t" >&6; }
16886
16887
16888
16889 cat >>confdefs.h <<_ACEOF
16890 #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
16891 _ACEOF
16892
16893
16894 # The cast to long int works around a bug in the HP C Compiler
16895 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
16896 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
16897 # This bug is HP SR number 8606223364.
16898 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
16899 $as_echo_n "checking size of long... " >&6; }
16900 if ${ac_cv_sizeof_long+:} false; then :
16901   $as_echo_n "(cached) " >&6
16902 else
16903   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long"        "$ac_includes_default"; then :
16904
16905 else
16906   if test "$ac_cv_type_long" = yes; then
16907      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16908 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
16909 as_fn_error 77 "cannot compute sizeof (long)
16910 See \`config.log' for more details" "$LINENO" 5; }
16911    else
16912      ac_cv_sizeof_long=0
16913    fi
16914 fi
16915
16916 fi
16917 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
16918 $as_echo "$ac_cv_sizeof_long" >&6; }
16919
16920
16921
16922 cat >>confdefs.h <<_ACEOF
16923 #define SIZEOF_LONG $ac_cv_sizeof_long
16924 _ACEOF
16925
16926
16927
16928 # Decide whether float4 is passed by value: user-selectable, enabled by default
16929 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float4 passed by value" >&5
16930 $as_echo_n "checking whether to build with float4 passed by value... " >&6; }
16931
16932
16933 # Check whether --enable-float4-byval was given.
16934 if test "${enable_float4_byval+set}" = set; then :
16935   enableval=$enable_float4_byval;
16936   case $enableval in
16937     yes)
16938
16939 $as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
16940
16941                float4passbyval=true
16942       ;;
16943     no)
16944       float4passbyval=false
16945       ;;
16946     *)
16947       as_fn_error $? "no argument expected for --enable-float4-byval option" "$LINENO" 5
16948       ;;
16949   esac
16950
16951 else
16952   enable_float4_byval=yes
16953
16954 $as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
16955
16956                float4passbyval=true
16957 fi
16958
16959
16960 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float4_byval" >&5
16961 $as_echo "$enable_float4_byval" >&6; }
16962
16963 cat >>confdefs.h <<_ACEOF
16964 #define FLOAT4PASSBYVAL $float4passbyval
16965 _ACEOF
16966
16967
16968 # Decide whether float8 is passed by value.
16969 # Note: this setting also controls int8 and related types such as timestamp.
16970 # If sizeof(Datum) >= 8, this is user-selectable, enabled by default.
16971 # If not, trying to select it is an error.
16972 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float8 passed by value" >&5
16973 $as_echo_n "checking whether to build with float8 passed by value... " >&6; }
16974 if test $ac_cv_sizeof_void_p -ge 8 ; then
16975
16976
16977 # Check whether --enable-float8-byval was given.
16978 if test "${enable_float8_byval+set}" = set; then :
16979   enableval=$enable_float8_byval;
16980   case $enableval in
16981     yes)
16982       :
16983       ;;
16984     no)
16985       :
16986       ;;
16987     *)
16988       as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5
16989       ;;
16990   esac
16991
16992 else
16993   enable_float8_byval=yes
16994
16995 fi
16996
16997
16998 else
16999
17000
17001 # Check whether --enable-float8-byval was given.
17002 if test "${enable_float8_byval+set}" = set; then :
17003   enableval=$enable_float8_byval;
17004   case $enableval in
17005     yes)
17006       :
17007       ;;
17008     no)
17009       :
17010       ;;
17011     *)
17012       as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5
17013       ;;
17014   esac
17015
17016 else
17017   enable_float8_byval=no
17018
17019 fi
17020
17021
17022   if test "$enable_float8_byval" = yes ; then
17023     as_fn_error $? "--enable-float8-byval is not supported on 32-bit platforms." "$LINENO" 5
17024   fi
17025 fi
17026 if test "$enable_float8_byval" = yes ; then
17027
17028 $as_echo "#define USE_FLOAT8_BYVAL 1" >>confdefs.h
17029
17030   float8passbyval=true
17031 else
17032   float8passbyval=false
17033 fi
17034 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float8_byval" >&5
17035 $as_echo "$enable_float8_byval" >&6; }
17036
17037 cat >>confdefs.h <<_ACEOF
17038 #define FLOAT8PASSBYVAL $float8passbyval
17039 _ACEOF
17040
17041
17042 # Determine memory alignment requirements for the basic C data types.
17043
17044 # The cast to long int works around a bug in the HP C Compiler,
17045 # see AC_CHECK_SIZEOF for more information.
17046 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of short" >&5
17047 $as_echo_n "checking alignment of short... " >&6; }
17048 if ${ac_cv_alignof_short+:} false; then :
17049   $as_echo_n "(cached) " >&6
17050 else
17051   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_short"        "$ac_includes_default
17052 #ifndef offsetof
17053 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
17054 #endif
17055 typedef struct { char x; short y; } ac__type_alignof_;"; then :
17056
17057 else
17058   if test "$ac_cv_type_short" = yes; then
17059      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
17060 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
17061 as_fn_error 77 "cannot compute alignment of short
17062 See \`config.log' for more details" "$LINENO" 5; }
17063    else
17064      ac_cv_alignof_short=0
17065    fi
17066 fi
17067
17068 fi
17069 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_short" >&5
17070 $as_echo "$ac_cv_alignof_short" >&6; }
17071
17072
17073
17074 cat >>confdefs.h <<_ACEOF
17075 #define ALIGNOF_SHORT $ac_cv_alignof_short
17076 _ACEOF
17077
17078
17079 # The cast to long int works around a bug in the HP C Compiler,
17080 # see AC_CHECK_SIZEOF for more information.
17081 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of int" >&5
17082 $as_echo_n "checking alignment of int... " >&6; }
17083 if ${ac_cv_alignof_int+:} false; then :
17084   $as_echo_n "(cached) " >&6
17085 else
17086   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_int"        "$ac_includes_default
17087 #ifndef offsetof
17088 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
17089 #endif
17090 typedef struct { char x; int y; } ac__type_alignof_;"; then :
17091
17092 else
17093   if test "$ac_cv_type_int" = yes; then
17094      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
17095 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
17096 as_fn_error 77 "cannot compute alignment of int
17097 See \`config.log' for more details" "$LINENO" 5; }
17098    else
17099      ac_cv_alignof_int=0
17100    fi
17101 fi
17102
17103 fi
17104 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_int" >&5
17105 $as_echo "$ac_cv_alignof_int" >&6; }
17106
17107
17108
17109 cat >>confdefs.h <<_ACEOF
17110 #define ALIGNOF_INT $ac_cv_alignof_int
17111 _ACEOF
17112
17113
17114 # The cast to long int works around a bug in the HP C Compiler,
17115 # see AC_CHECK_SIZEOF for more information.
17116 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of long" >&5
17117 $as_echo_n "checking alignment of long... " >&6; }
17118 if ${ac_cv_alignof_long+:} false; then :
17119   $as_echo_n "(cached) " >&6
17120 else
17121   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long"        "$ac_includes_default
17122 #ifndef offsetof
17123 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
17124 #endif
17125 typedef struct { char x; long y; } ac__type_alignof_;"; then :
17126
17127 else
17128   if test "$ac_cv_type_long" = yes; then
17129      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
17130 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
17131 as_fn_error 77 "cannot compute alignment of long
17132 See \`config.log' for more details" "$LINENO" 5; }
17133    else
17134      ac_cv_alignof_long=0
17135    fi
17136 fi
17137
17138 fi
17139 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long" >&5
17140 $as_echo "$ac_cv_alignof_long" >&6; }
17141
17142
17143
17144 cat >>confdefs.h <<_ACEOF
17145 #define ALIGNOF_LONG $ac_cv_alignof_long
17146 _ACEOF
17147
17148
17149 if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then
17150   # The cast to long int works around a bug in the HP C Compiler,
17151 # see AC_CHECK_SIZEOF for more information.
17152 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of long long int" >&5
17153 $as_echo_n "checking alignment of long long int... " >&6; }
17154 if ${ac_cv_alignof_long_long_int+:} false; then :
17155   $as_echo_n "(cached) " >&6
17156 else
17157   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long_long_int"        "$ac_includes_default
17158 #ifndef offsetof
17159 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
17160 #endif
17161 typedef struct { char x; long long int y; } ac__type_alignof_;"; then :
17162
17163 else
17164   if test "$ac_cv_type_long_long_int" = yes; then
17165      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
17166 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
17167 as_fn_error 77 "cannot compute alignment of long long int
17168 See \`config.log' for more details" "$LINENO" 5; }
17169    else
17170      ac_cv_alignof_long_long_int=0
17171    fi
17172 fi
17173
17174 fi
17175 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long_long_int" >&5
17176 $as_echo "$ac_cv_alignof_long_long_int" >&6; }
17177
17178
17179
17180 cat >>confdefs.h <<_ACEOF
17181 #define ALIGNOF_LONG_LONG_INT $ac_cv_alignof_long_long_int
17182 _ACEOF
17183
17184
17185 fi
17186 # The cast to long int works around a bug in the HP C Compiler,
17187 # see AC_CHECK_SIZEOF for more information.
17188 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of double" >&5
17189 $as_echo_n "checking alignment of double... " >&6; }
17190 if ${ac_cv_alignof_double+:} false; then :
17191   $as_echo_n "(cached) " >&6
17192 else
17193   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_double"        "$ac_includes_default
17194 #ifndef offsetof
17195 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
17196 #endif
17197 typedef struct { char x; double y; } ac__type_alignof_;"; then :
17198
17199 else
17200   if test "$ac_cv_type_double" = yes; then
17201      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
17202 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
17203 as_fn_error 77 "cannot compute alignment of double
17204 See \`config.log' for more details" "$LINENO" 5; }
17205    else
17206      ac_cv_alignof_double=0
17207    fi
17208 fi
17209
17210 fi
17211 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_double" >&5
17212 $as_echo "$ac_cv_alignof_double" >&6; }
17213
17214
17215
17216 cat >>confdefs.h <<_ACEOF
17217 #define ALIGNOF_DOUBLE $ac_cv_alignof_double
17218 _ACEOF
17219
17220
17221
17222 # Compute maximum alignment of any basic type.
17223 # We assume long's alignment is at least as strong as char, short, or int;
17224 # but we must check long long (if it is being used for int64) and double.
17225 # Note that we intentionally do not consider any types wider than 64 bits,
17226 # as allowing MAXIMUM_ALIGNOF to exceed 8 would be too much of a penalty
17227 # for disk and memory space.
17228
17229 MAX_ALIGNOF=$ac_cv_alignof_long
17230 if test $MAX_ALIGNOF -lt $ac_cv_alignof_double ; then
17231   MAX_ALIGNOF=$ac_cv_alignof_double
17232 fi
17233 if test x"$HAVE_LONG_LONG_INT_64" = xyes && test $MAX_ALIGNOF -lt $ac_cv_alignof_long_long_int ; then
17234   MAX_ALIGNOF="$ac_cv_alignof_long_long_int"
17235 fi
17236
17237 cat >>confdefs.h <<_ACEOF
17238 #define MAXIMUM_ALIGNOF $MAX_ALIGNOF
17239 _ACEOF
17240
17241
17242
17243 # Some platforms predefine the types int8, int16, etc.  Only check
17244 # a (hopefully) representative subset.
17245 ac_fn_c_check_type "$LINENO" "int8" "ac_cv_type_int8" "#include <stdio.h>
17246 "
17247 if test "x$ac_cv_type_int8" = xyes; then :
17248
17249 cat >>confdefs.h <<_ACEOF
17250 #define HAVE_INT8 1
17251 _ACEOF
17252
17253
17254 fi
17255 ac_fn_c_check_type "$LINENO" "uint8" "ac_cv_type_uint8" "#include <stdio.h>
17256 "
17257 if test "x$ac_cv_type_uint8" = xyes; then :
17258
17259 cat >>confdefs.h <<_ACEOF
17260 #define HAVE_UINT8 1
17261 _ACEOF
17262
17263
17264 fi
17265 ac_fn_c_check_type "$LINENO" "int64" "ac_cv_type_int64" "#include <stdio.h>
17266 "
17267 if test "x$ac_cv_type_int64" = xyes; then :
17268
17269 cat >>confdefs.h <<_ACEOF
17270 #define HAVE_INT64 1
17271 _ACEOF
17272
17273
17274 fi
17275 ac_fn_c_check_type "$LINENO" "uint64" "ac_cv_type_uint64" "#include <stdio.h>
17276 "
17277 if test "x$ac_cv_type_uint64" = xyes; then :
17278
17279 cat >>confdefs.h <<_ACEOF
17280 #define HAVE_UINT64 1
17281 _ACEOF
17282
17283
17284 fi
17285
17286
17287 # Some compilers offer a 128-bit integer scalar type.
17288 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __int128" >&5
17289 $as_echo_n "checking for __int128... " >&6; }
17290 if ${pgac_cv__128bit_int+:} false; then :
17291   $as_echo_n "(cached) " >&6
17292 else
17293   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17294 /* end confdefs.h.  */
17295
17296 /*
17297  * We don't actually run this test, just link it to verify that any support
17298  * functions needed for __int128 are present.
17299  *
17300  * These are globals to discourage the compiler from folding all the
17301  * arithmetic tests down to compile-time constants.  We do not have
17302  * convenient support for 128bit literals at this point...
17303  */
17304 __int128 a = 48828125;
17305 __int128 b = 97656250;
17306
17307 int
17308 main ()
17309 {
17310
17311 __int128 c,d;
17312 a = (a << 12) + 1; /* 200000000001 */
17313 b = (b << 12) + 5; /* 400000000005 */
17314 /* try the most relevant arithmetic ops */
17315 c = a * b;
17316 d = (c + b) / b;
17317 /* must use the results, else compiler may optimize arithmetic away */
17318 if (d != a+1)
17319   return 1;
17320
17321   ;
17322   return 0;
17323 }
17324 _ACEOF
17325 if ac_fn_c_try_link "$LINENO"; then :
17326   pgac_cv__128bit_int=yes
17327 else
17328   pgac_cv__128bit_int=no
17329 fi
17330 rm -f core conftest.err conftest.$ac_objext \
17331     conftest$ac_exeext conftest.$ac_ext
17332 fi
17333 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__128bit_int" >&5
17334 $as_echo "$pgac_cv__128bit_int" >&6; }
17335 if test x"$pgac_cv__128bit_int" = xyes ; then
17336   # Use of non-default alignment with __int128 tickles bugs in some compilers.
17337   # If not cross-compiling, we can test for bugs and disable use of __int128
17338   # with buggy compilers.  If cross-compiling, hope for the best.
17339   # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83925
17340   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __int128 alignment bug" >&5
17341 $as_echo_n "checking for __int128 alignment bug... " >&6; }
17342 if ${pgac_cv__128bit_int_bug+:} false; then :
17343   $as_echo_n "(cached) " >&6
17344 else
17345   if test "$cross_compiling" = yes; then :
17346   pgac_cv__128bit_int_bug="assuming ok"
17347 else
17348   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17349 /* end confdefs.h.  */
17350
17351 /* This must match the corresponding code in c.h: */
17352 #if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__IBMC__)
17353 #define pg_attribute_aligned(a) __attribute__((aligned(a)))
17354 #endif
17355 typedef __int128 int128a
17356 #if defined(pg_attribute_aligned)
17357 pg_attribute_aligned(8)
17358 #endif
17359 ;
17360 int128a holder;
17361 void pass_by_val(void *buffer, int128a par) { holder = par; }
17362
17363 int
17364 main ()
17365 {
17366
17367 long int i64 = 97656225L << 12;
17368 int128a q;
17369 pass_by_val(main, (int128a) i64);
17370 q = (int128a) i64;
17371 if (q != holder)
17372   return 1;
17373
17374   ;
17375   return 0;
17376 }
17377 _ACEOF
17378 if ac_fn_c_try_run "$LINENO"; then :
17379   pgac_cv__128bit_int_bug=ok
17380 else
17381   pgac_cv__128bit_int_bug=broken
17382 fi
17383 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17384   conftest.$ac_objext conftest.beam conftest.$ac_ext
17385 fi
17386
17387 fi
17388 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__128bit_int_bug" >&5
17389 $as_echo "$pgac_cv__128bit_int_bug" >&6; }
17390   if test x"$pgac_cv__128bit_int_bug" != xbroken ; then
17391
17392 $as_echo "#define PG_INT128_TYPE __int128" >>confdefs.h
17393
17394     # The cast to long int works around a bug in the HP C Compiler,
17395 # see AC_CHECK_SIZEOF for more information.
17396 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of PG_INT128_TYPE" >&5
17397 $as_echo_n "checking alignment of PG_INT128_TYPE... " >&6; }
17398 if ${ac_cv_alignof_PG_INT128_TYPE+:} false; then :
17399   $as_echo_n "(cached) " >&6
17400 else
17401   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_PG_INT128_TYPE"        "$ac_includes_default
17402 #ifndef offsetof
17403 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
17404 #endif
17405 typedef struct { char x; PG_INT128_TYPE y; } ac__type_alignof_;"; then :
17406
17407 else
17408   if test "$ac_cv_type_PG_INT128_TYPE" = yes; then
17409      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
17410 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
17411 as_fn_error 77 "cannot compute alignment of PG_INT128_TYPE
17412 See \`config.log' for more details" "$LINENO" 5; }
17413    else
17414      ac_cv_alignof_PG_INT128_TYPE=0
17415    fi
17416 fi
17417
17418 fi
17419 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_PG_INT128_TYPE" >&5
17420 $as_echo "$ac_cv_alignof_PG_INT128_TYPE" >&6; }
17421
17422
17423
17424 cat >>confdefs.h <<_ACEOF
17425 #define ALIGNOF_PG_INT128_TYPE $ac_cv_alignof_PG_INT128_TYPE
17426 _ACEOF
17427
17428
17429   fi
17430 fi
17431
17432 # Check for various atomic operations now that we have checked how to declare
17433 # 64bit integers.
17434 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync char locking functions" >&5
17435 $as_echo_n "checking for builtin __sync char locking functions... " >&6; }
17436 if ${pgac_cv_gcc_sync_char_tas+:} false; then :
17437   $as_echo_n "(cached) " >&6
17438 else
17439   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17440 /* end confdefs.h.  */
17441
17442 int
17443 main ()
17444 {
17445 char lock = 0;
17446    __sync_lock_test_and_set(&lock, 1);
17447    __sync_lock_release(&lock);
17448   ;
17449   return 0;
17450 }
17451 _ACEOF
17452 if ac_fn_c_try_link "$LINENO"; then :
17453   pgac_cv_gcc_sync_char_tas="yes"
17454 else
17455   pgac_cv_gcc_sync_char_tas="no"
17456 fi
17457 rm -f core conftest.err conftest.$ac_objext \
17458     conftest$ac_exeext conftest.$ac_ext
17459 fi
17460 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_char_tas" >&5
17461 $as_echo "$pgac_cv_gcc_sync_char_tas" >&6; }
17462 if test x"$pgac_cv_gcc_sync_char_tas" = x"yes"; then
17463
17464 $as_echo "#define HAVE_GCC__SYNC_CHAR_TAS 1" >>confdefs.h
17465
17466 fi
17467 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int32 locking functions" >&5
17468 $as_echo_n "checking for builtin __sync int32 locking functions... " >&6; }
17469 if ${pgac_cv_gcc_sync_int32_tas+:} false; then :
17470   $as_echo_n "(cached) " >&6
17471 else
17472   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17473 /* end confdefs.h.  */
17474
17475 int
17476 main ()
17477 {
17478 int lock = 0;
17479    __sync_lock_test_and_set(&lock, 1);
17480    __sync_lock_release(&lock);
17481   ;
17482   return 0;
17483 }
17484 _ACEOF
17485 if ac_fn_c_try_link "$LINENO"; then :
17486   pgac_cv_gcc_sync_int32_tas="yes"
17487 else
17488   pgac_cv_gcc_sync_int32_tas="no"
17489 fi
17490 rm -f core conftest.err conftest.$ac_objext \
17491     conftest$ac_exeext conftest.$ac_ext
17492 fi
17493 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int32_tas" >&5
17494 $as_echo "$pgac_cv_gcc_sync_int32_tas" >&6; }
17495 if test x"$pgac_cv_gcc_sync_int32_tas" = x"yes"; then
17496
17497 $as_echo "#define HAVE_GCC__SYNC_INT32_TAS 1" >>confdefs.h
17498
17499 fi
17500 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int32 atomic operations" >&5
17501 $as_echo_n "checking for builtin __sync int32 atomic operations... " >&6; }
17502 if ${pgac_cv_gcc_sync_int32_cas+:} false; then :
17503   $as_echo_n "(cached) " >&6
17504 else
17505   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17506 /* end confdefs.h.  */
17507
17508 int
17509 main ()
17510 {
17511 int val = 0;
17512    __sync_val_compare_and_swap(&val, 0, 37);
17513   ;
17514   return 0;
17515 }
17516 _ACEOF
17517 if ac_fn_c_try_link "$LINENO"; then :
17518   pgac_cv_gcc_sync_int32_cas="yes"
17519 else
17520   pgac_cv_gcc_sync_int32_cas="no"
17521 fi
17522 rm -f core conftest.err conftest.$ac_objext \
17523     conftest$ac_exeext conftest.$ac_ext
17524 fi
17525 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int32_cas" >&5
17526 $as_echo "$pgac_cv_gcc_sync_int32_cas" >&6; }
17527 if test x"$pgac_cv_gcc_sync_int32_cas" = x"yes"; then
17528
17529 $as_echo "#define HAVE_GCC__SYNC_INT32_CAS 1" >>confdefs.h
17530
17531 fi
17532 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int64 atomic operations" >&5
17533 $as_echo_n "checking for builtin __sync int64 atomic operations... " >&6; }
17534 if ${pgac_cv_gcc_sync_int64_cas+:} false; then :
17535   $as_echo_n "(cached) " >&6
17536 else
17537   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17538 /* end confdefs.h.  */
17539
17540 int
17541 main ()
17542 {
17543 PG_INT64_TYPE lock = 0;
17544    __sync_val_compare_and_swap(&lock, 0, (PG_INT64_TYPE) 37);
17545   ;
17546   return 0;
17547 }
17548 _ACEOF
17549 if ac_fn_c_try_link "$LINENO"; then :
17550   pgac_cv_gcc_sync_int64_cas="yes"
17551 else
17552   pgac_cv_gcc_sync_int64_cas="no"
17553 fi
17554 rm -f core conftest.err conftest.$ac_objext \
17555     conftest$ac_exeext conftest.$ac_ext
17556 fi
17557 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int64_cas" >&5
17558 $as_echo "$pgac_cv_gcc_sync_int64_cas" >&6; }
17559 if test x"$pgac_cv_gcc_sync_int64_cas" = x"yes"; then
17560
17561 $as_echo "#define HAVE_GCC__SYNC_INT64_CAS 1" >>confdefs.h
17562
17563 fi
17564 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic int32 atomic operations" >&5
17565 $as_echo_n "checking for builtin __atomic int32 atomic operations... " >&6; }
17566 if ${pgac_cv_gcc_atomic_int32_cas+:} false; then :
17567   $as_echo_n "(cached) " >&6
17568 else
17569   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17570 /* end confdefs.h.  */
17571
17572 int
17573 main ()
17574 {
17575 int val = 0;
17576    int expect = 0;
17577    __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
17578   ;
17579   return 0;
17580 }
17581 _ACEOF
17582 if ac_fn_c_try_link "$LINENO"; then :
17583   pgac_cv_gcc_atomic_int32_cas="yes"
17584 else
17585   pgac_cv_gcc_atomic_int32_cas="no"
17586 fi
17587 rm -f core conftest.err conftest.$ac_objext \
17588     conftest$ac_exeext conftest.$ac_ext
17589 fi
17590 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_atomic_int32_cas" >&5
17591 $as_echo "$pgac_cv_gcc_atomic_int32_cas" >&6; }
17592 if test x"$pgac_cv_gcc_atomic_int32_cas" = x"yes"; then
17593
17594 $as_echo "#define HAVE_GCC__ATOMIC_INT32_CAS 1" >>confdefs.h
17595
17596 fi
17597 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic int64 atomic operations" >&5
17598 $as_echo_n "checking for builtin __atomic int64 atomic operations... " >&6; }
17599 if ${pgac_cv_gcc_atomic_int64_cas+:} false; then :
17600   $as_echo_n "(cached) " >&6
17601 else
17602   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17603 /* end confdefs.h.  */
17604
17605 int
17606 main ()
17607 {
17608 PG_INT64_TYPE val = 0;
17609    PG_INT64_TYPE expect = 0;
17610    __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
17611   ;
17612   return 0;
17613 }
17614 _ACEOF
17615 if ac_fn_c_try_link "$LINENO"; then :
17616   pgac_cv_gcc_atomic_int64_cas="yes"
17617 else
17618   pgac_cv_gcc_atomic_int64_cas="no"
17619 fi
17620 rm -f core conftest.err conftest.$ac_objext \
17621     conftest$ac_exeext conftest.$ac_ext
17622 fi
17623 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_atomic_int64_cas" >&5
17624 $as_echo "$pgac_cv_gcc_atomic_int64_cas" >&6; }
17625 if test x"$pgac_cv_gcc_atomic_int64_cas" = x"yes"; then
17626
17627 $as_echo "#define HAVE_GCC__ATOMIC_INT64_CAS 1" >>confdefs.h
17628
17629 fi
17630
17631
17632 # Check for x86 cpuid instruction
17633 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __get_cpuid" >&5
17634 $as_echo_n "checking for __get_cpuid... " >&6; }
17635 if ${pgac_cv__get_cpuid+:} false; then :
17636   $as_echo_n "(cached) " >&6
17637 else
17638   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17639 /* end confdefs.h.  */
17640 #include <cpuid.h>
17641 int
17642 main ()
17643 {
17644 unsigned int exx[4] = {0, 0, 0, 0};
17645   __get_cpuid(1, &exx[0], &exx[1], &exx[2], &exx[3]);
17646
17647   ;
17648   return 0;
17649 }
17650 _ACEOF
17651 if ac_fn_c_try_link "$LINENO"; then :
17652   pgac_cv__get_cpuid="yes"
17653 else
17654   pgac_cv__get_cpuid="no"
17655 fi
17656 rm -f core conftest.err conftest.$ac_objext \
17657     conftest$ac_exeext conftest.$ac_ext
17658 fi
17659 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__get_cpuid" >&5
17660 $as_echo "$pgac_cv__get_cpuid" >&6; }
17661 if test x"$pgac_cv__get_cpuid" = x"yes"; then
17662
17663 $as_echo "#define HAVE__GET_CPUID 1" >>confdefs.h
17664
17665 fi
17666
17667 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __cpuid" >&5
17668 $as_echo_n "checking for __cpuid... " >&6; }
17669 if ${pgac_cv__cpuid+:} false; then :
17670   $as_echo_n "(cached) " >&6
17671 else
17672   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17673 /* end confdefs.h.  */
17674 #include <intrin.h>
17675 int
17676 main ()
17677 {
17678 unsigned int exx[4] = {0, 0, 0, 0};
17679   __get_cpuid(exx[0], 1);
17680
17681   ;
17682   return 0;
17683 }
17684 _ACEOF
17685 if ac_fn_c_try_link "$LINENO"; then :
17686   pgac_cv__cpuid="yes"
17687 else
17688   pgac_cv__cpuid="no"
17689 fi
17690 rm -f core conftest.err conftest.$ac_objext \
17691     conftest$ac_exeext conftest.$ac_ext
17692 fi
17693 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__cpuid" >&5
17694 $as_echo "$pgac_cv__cpuid" >&6; }
17695 if test x"$pgac_cv__cpuid" = x"yes"; then
17696
17697 $as_echo "#define HAVE__CPUID 1" >>confdefs.h
17698
17699 fi
17700
17701 # Check for Intel SSE 4.2 intrinsics to do CRC calculations.
17702 #
17703 # First check if the _mm_crc32_u8 and _mm_crc32_u64 intrinsics can be used
17704 # with the default compiler flags. If not, check if adding the -msse4.2
17705 # flag helps. CFLAGS_SSE42 is set to -msse4.2 if that's required.
17706 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=" >&5
17707 $as_echo_n "checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=... " >&6; }
17708 if ${pgac_cv_sse42_crc32_intrinsics_+:} false; then :
17709   $as_echo_n "(cached) " >&6
17710 else
17711   pgac_save_CFLAGS=$CFLAGS
17712 CFLAGS="$pgac_save_CFLAGS "
17713 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17714 /* end confdefs.h.  */
17715 #include <nmmintrin.h>
17716 int
17717 main ()
17718 {
17719 unsigned int crc = 0;
17720    crc = _mm_crc32_u8(crc, 0);
17721    crc = _mm_crc32_u32(crc, 0);
17722    /* return computed value, to prevent the above being optimized away */
17723    return crc == 0;
17724   ;
17725   return 0;
17726 }
17727 _ACEOF
17728 if ac_fn_c_try_link "$LINENO"; then :
17729   pgac_cv_sse42_crc32_intrinsics_=yes
17730 else
17731   pgac_cv_sse42_crc32_intrinsics_=no
17732 fi
17733 rm -f core conftest.err conftest.$ac_objext \
17734     conftest$ac_exeext conftest.$ac_ext
17735 CFLAGS="$pgac_save_CFLAGS"
17736 fi
17737 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_sse42_crc32_intrinsics_" >&5
17738 $as_echo "$pgac_cv_sse42_crc32_intrinsics_" >&6; }
17739 if test x"$pgac_cv_sse42_crc32_intrinsics_" = x"yes"; then
17740   CFLAGS_SSE42=""
17741   pgac_sse42_crc32_intrinsics=yes
17742 fi
17743
17744 if test x"$pgac_sse42_crc32_intrinsics" != x"yes"; then
17745   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=-msse4.2" >&5
17746 $as_echo_n "checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=-msse4.2... " >&6; }
17747 if ${pgac_cv_sse42_crc32_intrinsics__msse4_2+:} false; then :
17748   $as_echo_n "(cached) " >&6
17749 else
17750   pgac_save_CFLAGS=$CFLAGS
17751 CFLAGS="$pgac_save_CFLAGS -msse4.2"
17752 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17753 /* end confdefs.h.  */
17754 #include <nmmintrin.h>
17755 int
17756 main ()
17757 {
17758 unsigned int crc = 0;
17759    crc = _mm_crc32_u8(crc, 0);
17760    crc = _mm_crc32_u32(crc, 0);
17761    /* return computed value, to prevent the above being optimized away */
17762    return crc == 0;
17763   ;
17764   return 0;
17765 }
17766 _ACEOF
17767 if ac_fn_c_try_link "$LINENO"; then :
17768   pgac_cv_sse42_crc32_intrinsics__msse4_2=yes
17769 else
17770   pgac_cv_sse42_crc32_intrinsics__msse4_2=no
17771 fi
17772 rm -f core conftest.err conftest.$ac_objext \
17773     conftest$ac_exeext conftest.$ac_ext
17774 CFLAGS="$pgac_save_CFLAGS"
17775 fi
17776 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_sse42_crc32_intrinsics__msse4_2" >&5
17777 $as_echo "$pgac_cv_sse42_crc32_intrinsics__msse4_2" >&6; }
17778 if test x"$pgac_cv_sse42_crc32_intrinsics__msse4_2" = x"yes"; then
17779   CFLAGS_SSE42="-msse4.2"
17780   pgac_sse42_crc32_intrinsics=yes
17781 fi
17782
17783 fi
17784
17785
17786 # Are we targeting a processor that supports SSE 4.2? gcc, clang and icc all
17787 # define __SSE4_2__ in that case.
17788 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17789 /* end confdefs.h.  */
17790
17791 int
17792 main ()
17793 {
17794
17795 #ifndef __SSE4_2__
17796 #error __SSE4_2__ not defined
17797 #endif
17798
17799   ;
17800   return 0;
17801 }
17802 _ACEOF
17803 if ac_fn_c_try_compile "$LINENO"; then :
17804   SSE4_2_TARGETED=1
17805 fi
17806 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17807
17808 # Check for ARMv8 CRC Extension intrinsics to do CRC calculations.
17809 #
17810 # First check if __crc32c* intrinsics can be used with the default compiler
17811 # flags. If not, check if adding -march=armv8-a+crc flag helps.
17812 # CFLAGS_ARMV8_CRC32C is set if the extra flag is required.
17813 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=" >&5
17814 $as_echo_n "checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=... " >&6; }
17815 if ${pgac_cv_armv8_crc32c_intrinsics_+:} false; then :
17816   $as_echo_n "(cached) " >&6
17817 else
17818   pgac_save_CFLAGS=$CFLAGS
17819 CFLAGS="$pgac_save_CFLAGS "
17820 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17821 /* end confdefs.h.  */
17822 #include <arm_acle.h>
17823 int
17824 main ()
17825 {
17826 unsigned int crc = 0;
17827    crc = __crc32cb(crc, 0);
17828    crc = __crc32ch(crc, 0);
17829    crc = __crc32cw(crc, 0);
17830    crc = __crc32cd(crc, 0);
17831    /* return computed value, to prevent the above being optimized away */
17832    return crc == 0;
17833   ;
17834   return 0;
17835 }
17836 _ACEOF
17837 if ac_fn_c_try_link "$LINENO"; then :
17838   pgac_cv_armv8_crc32c_intrinsics_=yes
17839 else
17840   pgac_cv_armv8_crc32c_intrinsics_=no
17841 fi
17842 rm -f core conftest.err conftest.$ac_objext \
17843     conftest$ac_exeext conftest.$ac_ext
17844 CFLAGS="$pgac_save_CFLAGS"
17845 fi
17846 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_armv8_crc32c_intrinsics_" >&5
17847 $as_echo "$pgac_cv_armv8_crc32c_intrinsics_" >&6; }
17848 if test x"$pgac_cv_armv8_crc32c_intrinsics_" = x"yes"; then
17849   CFLAGS_ARMV8_CRC32C=""
17850   pgac_armv8_crc32c_intrinsics=yes
17851 fi
17852
17853 if test x"$pgac_armv8_crc32c_intrinsics" != x"yes"; then
17854   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc" >&5
17855 $as_echo_n "checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=-march=armv8-a+crc... " >&6; }
17856 if ${pgac_cv_armv8_crc32c_intrinsics__march_armv8_apcrc+:} false; then :
17857   $as_echo_n "(cached) " >&6
17858 else
17859   pgac_save_CFLAGS=$CFLAGS
17860 CFLAGS="$pgac_save_CFLAGS -march=armv8-a+crc"
17861 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17862 /* end confdefs.h.  */
17863 #include <arm_acle.h>
17864 int
17865 main ()
17866 {
17867 unsigned int crc = 0;
17868    crc = __crc32cb(crc, 0);
17869    crc = __crc32ch(crc, 0);
17870    crc = __crc32cw(crc, 0);
17871    crc = __crc32cd(crc, 0);
17872    /* return computed value, to prevent the above being optimized away */
17873    return crc == 0;
17874   ;
17875   return 0;
17876 }
17877 _ACEOF
17878 if ac_fn_c_try_link "$LINENO"; then :
17879   pgac_cv_armv8_crc32c_intrinsics__march_armv8_apcrc=yes
17880 else
17881   pgac_cv_armv8_crc32c_intrinsics__march_armv8_apcrc=no
17882 fi
17883 rm -f core conftest.err conftest.$ac_objext \
17884     conftest$ac_exeext conftest.$ac_ext
17885 CFLAGS="$pgac_save_CFLAGS"
17886 fi
17887 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_armv8_crc32c_intrinsics__march_armv8_apcrc" >&5
17888 $as_echo "$pgac_cv_armv8_crc32c_intrinsics__march_armv8_apcrc" >&6; }
17889 if test x"$pgac_cv_armv8_crc32c_intrinsics__march_armv8_apcrc" = x"yes"; then
17890   CFLAGS_ARMV8_CRC32C="-march=armv8-a+crc"
17891   pgac_armv8_crc32c_intrinsics=yes
17892 fi
17893
17894 fi
17895
17896
17897 # Select CRC-32C implementation.
17898 #
17899 # If we are targeting a processor that has Intel SSE 4.2 instructions, we can
17900 # use the special CRC instructions for calculating CRC-32C. If we're not
17901 # targeting such a processor, but we can nevertheless produce code that uses
17902 # the SSE intrinsics, perhaps with some extra CFLAGS, compile both
17903 # implementations and select which one to use at runtime, depending on whether
17904 # SSE 4.2 is supported by the processor we're running on.
17905 #
17906 # Similarly, if we are targeting an ARM processor that has the CRC
17907 # instructions that are part of the ARMv8 CRC Extension, use them. And if
17908 # we're not targeting such a processor, but can nevertheless produce code that
17909 # uses the CRC instructions, compile both, and select at runtime.
17910 #
17911 # You can override this logic by setting the appropriate USE_*_CRC32 flag to 1
17912 # in the template or configure command line.
17913 if test x"$USE_SLICING_BY_8_CRC32C" = x"" && test x"$USE_SSE42_CRC32C" = x"" && test x"$USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" = x"" && test x"$USE_ARMV8_CRC32C" = x"" && test x"$USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK" = x""; then
17914   # Use Intel SSE 4.2 if available.
17915   if test x"$pgac_sse42_crc32_intrinsics" = x"yes" && test x"$SSE4_2_TARGETED" = x"1" ; then
17916     USE_SSE42_CRC32C=1
17917   else
17918     # Intel SSE 4.2, with runtime check? The CPUID instruction is needed for
17919     # the runtime check.
17920     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
17921       USE_SSE42_CRC32C_WITH_RUNTIME_CHECK=1
17922     else
17923       # Use ARM CRC Extension if available.
17924       if test x"$pgac_armv8_crc32c_intrinsics" = x"yes" && test x"$CFLAGS_ARMV8_CRC32C" = x""; then
17925         USE_ARMV8_CRC32C=1
17926       else
17927         # ARM CRC Extension, with runtime check?
17928         if test x"$pgac_armv8_crc32c_intrinsics" = x"yes"; then
17929           USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK=1
17930         else
17931           # fall back to slicing-by-8 algorithm, which doesn't require any
17932           # special CPU support.
17933           USE_SLICING_BY_8_CRC32C=1
17934         fi
17935       fi
17936     fi
17937   fi
17938 fi
17939
17940 # Set PG_CRC32C_OBJS appropriately depending on the selected implementation.
17941 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which CRC-32C implementation to use" >&5
17942 $as_echo_n "checking which CRC-32C implementation to use... " >&6; }
17943 if test x"$USE_SSE42_CRC32C" = x"1"; then
17944
17945 $as_echo "#define USE_SSE42_CRC32C 1" >>confdefs.h
17946
17947   PG_CRC32C_OBJS="pg_crc32c_sse42.o"
17948   { $as_echo "$as_me:${as_lineno-$LINENO}: result: SSE 4.2" >&5
17949 $as_echo "SSE 4.2" >&6; }
17950 else
17951   if test x"$USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" = x"1"; then
17952
17953 $as_echo "#define USE_SSE42_CRC32C_WITH_RUNTIME_CHECK 1" >>confdefs.h
17954
17955     PG_CRC32C_OBJS="pg_crc32c_sse42.o pg_crc32c_sb8.o pg_crc32c_sse42_choose.o"
17956     { $as_echo "$as_me:${as_lineno-$LINENO}: result: SSE 4.2 with runtime check" >&5
17957 $as_echo "SSE 4.2 with runtime check" >&6; }
17958   else
17959     if test x"$USE_ARMV8_CRC32C" = x"1"; then
17960
17961 $as_echo "#define USE_ARMV8_CRC32C 1" >>confdefs.h
17962
17963       PG_CRC32C_OBJS="pg_crc32c_armv8.o"
17964       { $as_echo "$as_me:${as_lineno-$LINENO}: result: ARMv8 CRC instructions" >&5
17965 $as_echo "ARMv8 CRC instructions" >&6; }
17966     else
17967       if test x"$USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK" = x"1"; then
17968
17969 $as_echo "#define USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK 1" >>confdefs.h
17970
17971         PG_CRC32C_OBJS="pg_crc32c_armv8.o pg_crc32c_sb8.o pg_crc32c_armv8_choose.o"
17972         { $as_echo "$as_me:${as_lineno-$LINENO}: result: ARMv8 CRC instructions with runtime check" >&5
17973 $as_echo "ARMv8 CRC instructions with runtime check" >&6; }
17974       else
17975
17976 $as_echo "#define USE_SLICING_BY_8_CRC32C 1" >>confdefs.h
17977
17978         PG_CRC32C_OBJS="pg_crc32c_sb8.o"
17979         { $as_echo "$as_me:${as_lineno-$LINENO}: result: slicing-by-8" >&5
17980 $as_echo "slicing-by-8" >&6; }
17981       fi
17982     fi
17983   fi
17984 fi
17985
17986
17987
17988 # Select semaphore implementation type.
17989 if test "$PORTNAME" != "win32"; then
17990   if test x"$PREFERRED_SEMAPHORES" = x"NAMED_POSIX" ; then
17991     # Need sem_open for this
17992     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_open" >&5
17993 $as_echo_n "checking for library containing sem_open... " >&6; }
17994 if ${ac_cv_search_sem_open+:} false; then :
17995   $as_echo_n "(cached) " >&6
17996 else
17997   ac_func_search_save_LIBS=$LIBS
17998 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17999 /* end confdefs.h.  */
18000
18001 /* Override any GCC internal prototype to avoid an error.
18002    Use char because int might match the return type of a GCC
18003    builtin and then its argument prototype would still apply.  */
18004 #ifdef __cplusplus
18005 extern "C"
18006 #endif
18007 char sem_open ();
18008 int
18009 main ()
18010 {
18011 return sem_open ();
18012   ;
18013   return 0;
18014 }
18015 _ACEOF
18016 for ac_lib in '' rt pthread; do
18017   if test -z "$ac_lib"; then
18018     ac_res="none required"
18019   else
18020     ac_res=-l$ac_lib
18021     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
18022   fi
18023   if ac_fn_c_try_link "$LINENO"; then :
18024   ac_cv_search_sem_open=$ac_res
18025 fi
18026 rm -f core conftest.err conftest.$ac_objext \
18027     conftest$ac_exeext
18028   if ${ac_cv_search_sem_open+:} false; then :
18029   break
18030 fi
18031 done
18032 if ${ac_cv_search_sem_open+:} false; then :
18033
18034 else
18035   ac_cv_search_sem_open=no
18036 fi
18037 rm conftest.$ac_ext
18038 LIBS=$ac_func_search_save_LIBS
18039 fi
18040 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_open" >&5
18041 $as_echo "$ac_cv_search_sem_open" >&6; }
18042 ac_res=$ac_cv_search_sem_open
18043 if test "$ac_res" != no; then :
18044   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
18045   USE_NAMED_POSIX_SEMAPHORES=1
18046 fi
18047
18048   fi
18049   if test x"$PREFERRED_SEMAPHORES" = x"UNNAMED_POSIX" ; then
18050     # Need sem_init for this
18051     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5
18052 $as_echo_n "checking for library containing sem_init... " >&6; }
18053 if ${ac_cv_search_sem_init+:} false; then :
18054   $as_echo_n "(cached) " >&6
18055 else
18056   ac_func_search_save_LIBS=$LIBS
18057 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18058 /* end confdefs.h.  */
18059
18060 /* Override any GCC internal prototype to avoid an error.
18061    Use char because int might match the return type of a GCC
18062    builtin and then its argument prototype would still apply.  */
18063 #ifdef __cplusplus
18064 extern "C"
18065 #endif
18066 char sem_init ();
18067 int
18068 main ()
18069 {
18070 return sem_init ();
18071   ;
18072   return 0;
18073 }
18074 _ACEOF
18075 for ac_lib in '' rt pthread; do
18076   if test -z "$ac_lib"; then
18077     ac_res="none required"
18078   else
18079     ac_res=-l$ac_lib
18080     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
18081   fi
18082   if ac_fn_c_try_link "$LINENO"; then :
18083   ac_cv_search_sem_init=$ac_res
18084 fi
18085 rm -f core conftest.err conftest.$ac_objext \
18086     conftest$ac_exeext
18087   if ${ac_cv_search_sem_init+:} false; then :
18088   break
18089 fi
18090 done
18091 if ${ac_cv_search_sem_init+:} false; then :
18092
18093 else
18094   ac_cv_search_sem_init=no
18095 fi
18096 rm conftest.$ac_ext
18097 LIBS=$ac_func_search_save_LIBS
18098 fi
18099 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_init" >&5
18100 $as_echo "$ac_cv_search_sem_init" >&6; }
18101 ac_res=$ac_cv_search_sem_init
18102 if test "$ac_res" != no; then :
18103   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
18104   USE_UNNAMED_POSIX_SEMAPHORES=1
18105 fi
18106
18107   fi
18108   { $as_echo "$as_me:${as_lineno-$LINENO}: checking which semaphore API to use" >&5
18109 $as_echo_n "checking which semaphore API to use... " >&6; }
18110   if test x"$USE_NAMED_POSIX_SEMAPHORES" = x"1" ; then
18111
18112 $as_echo "#define USE_NAMED_POSIX_SEMAPHORES 1" >>confdefs.h
18113
18114     SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
18115     sematype="named POSIX"
18116   else
18117     if test x"$USE_UNNAMED_POSIX_SEMAPHORES" = x"1" ; then
18118
18119 $as_echo "#define USE_UNNAMED_POSIX_SEMAPHORES 1" >>confdefs.h
18120
18121       SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
18122       sematype="unnamed POSIX"
18123     else
18124
18125 $as_echo "#define USE_SYSV_SEMAPHORES 1" >>confdefs.h
18126
18127       SEMA_IMPLEMENTATION="src/backend/port/sysv_sema.c"
18128       sematype="System V"
18129     fi
18130   fi
18131   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sematype" >&5
18132 $as_echo "$sematype" >&6; }
18133 else
18134
18135 $as_echo "#define USE_WIN32_SEMAPHORES 1" >>confdefs.h
18136
18137   SEMA_IMPLEMENTATION="src/backend/port/win32_sema.c"
18138 fi
18139
18140
18141 # Select shared-memory implementation type.
18142 if test "$PORTNAME" != "win32"; then
18143
18144 $as_echo "#define USE_SYSV_SHARED_MEMORY 1" >>confdefs.h
18145
18146   SHMEM_IMPLEMENTATION="src/backend/port/sysv_shmem.c"
18147 else
18148
18149 $as_echo "#define USE_WIN32_SHARED_MEMORY 1" >>confdefs.h
18150
18151   SHMEM_IMPLEMENTATION="src/backend/port/win32_shmem.c"
18152 fi
18153
18154 # Select random number source
18155 #
18156 # You can override this logic by setting the appropriate USE_*RANDOM flag to 1
18157 # in the template or configure command line.
18158
18159 # If not selected manually, try to select a source automatically.
18160 if test x"$USE_OPENSSL_RANDOM" = x"" && test x"$USE_WIN32_RANDOM" = x"" && test x"$USE_DEV_URANDOM" = x"" ; then
18161   if test x"$with_openssl" = x"yes" ; then
18162     USE_OPENSSL_RANDOM=1
18163   elif test "$PORTNAME" = "win32" ; then
18164     USE_WIN32_RANDOM=1
18165   else
18166     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/urandom" >&5
18167 $as_echo_n "checking for /dev/urandom... " >&6; }
18168 if ${ac_cv_file__dev_urandom+:} false; then :
18169   $as_echo_n "(cached) " >&6
18170 else
18171   test "$cross_compiling" = yes &&
18172   as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
18173 if test -r "/dev/urandom"; then
18174   ac_cv_file__dev_urandom=yes
18175 else
18176   ac_cv_file__dev_urandom=no
18177 fi
18178 fi
18179 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_urandom" >&5
18180 $as_echo "$ac_cv_file__dev_urandom" >&6; }
18181 if test "x$ac_cv_file__dev_urandom" = xyes; then :
18182
18183 fi
18184
18185
18186     if test x"$ac_cv_file__dev_urandom" = x"yes" ; then
18187       USE_DEV_URANDOM=1
18188     fi
18189   fi
18190 fi
18191
18192 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which random number source to use" >&5
18193 $as_echo_n "checking which random number source to use... " >&6; }
18194 if test x"$USE_OPENSSL_RANDOM" = x"1" ; then
18195
18196 $as_echo "#define USE_OPENSSL_RANDOM 1" >>confdefs.h
18197
18198   { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL" >&5
18199 $as_echo "OpenSSL" >&6; }
18200 elif test x"$USE_WIN32_RANDOM" = x"1" ; then
18201
18202 $as_echo "#define USE_WIN32_RANDOM 1" >>confdefs.h
18203
18204   { $as_echo "$as_me:${as_lineno-$LINENO}: result: Windows native" >&5
18205 $as_echo "Windows native" >&6; }
18206 elif test x"$USE_DEV_URANDOM" = x"1" ; then
18207
18208 $as_echo "#define USE_DEV_URANDOM 1" >>confdefs.h
18209
18210   { $as_echo "$as_me:${as_lineno-$LINENO}: result: /dev/urandom" >&5
18211 $as_echo "/dev/urandom" >&6; }
18212 else
18213   as_fn_error $? "
18214 no source of strong random numbers was found
18215 PostgreSQL can use OpenSSL or /dev/urandom as a source of random numbers." "$LINENO" 5
18216 fi
18217
18218 # If not set in template file, set bytes to use libc memset()
18219 if test x"$MEMSET_LOOP_LIMIT" = x"" ; then
18220   MEMSET_LOOP_LIMIT=1024
18221 fi
18222
18223 cat >>confdefs.h <<_ACEOF
18224 #define MEMSET_LOOP_LIMIT ${MEMSET_LOOP_LIMIT}
18225 _ACEOF
18226
18227
18228
18229 if test "$enable_nls" = yes ; then
18230
18231   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing bind_textdomain_codeset" >&5
18232 $as_echo_n "checking for library containing bind_textdomain_codeset... " >&6; }
18233 if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
18234   $as_echo_n "(cached) " >&6
18235 else
18236   ac_func_search_save_LIBS=$LIBS
18237 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18238 /* end confdefs.h.  */
18239
18240 /* Override any GCC internal prototype to avoid an error.
18241    Use char because int might match the return type of a GCC
18242    builtin and then its argument prototype would still apply.  */
18243 #ifdef __cplusplus
18244 extern "C"
18245 #endif
18246 char bind_textdomain_codeset ();
18247 int
18248 main ()
18249 {
18250 return bind_textdomain_codeset ();
18251   ;
18252   return 0;
18253 }
18254 _ACEOF
18255 for ac_lib in '' intl; do
18256   if test -z "$ac_lib"; then
18257     ac_res="none required"
18258   else
18259     ac_res=-l$ac_lib
18260     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
18261   fi
18262   if ac_fn_c_try_link "$LINENO"; then :
18263   ac_cv_search_bind_textdomain_codeset=$ac_res
18264 fi
18265 rm -f core conftest.err conftest.$ac_objext \
18266     conftest$ac_exeext
18267   if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
18268   break
18269 fi
18270 done
18271 if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
18272
18273 else
18274   ac_cv_search_bind_textdomain_codeset=no
18275 fi
18276 rm conftest.$ac_ext
18277 LIBS=$ac_func_search_save_LIBS
18278 fi
18279 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_bind_textdomain_codeset" >&5
18280 $as_echo "$ac_cv_search_bind_textdomain_codeset" >&6; }
18281 ac_res=$ac_cv_search_bind_textdomain_codeset
18282 if test "$ac_res" != no; then :
18283   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
18284
18285 else
18286   as_fn_error $? "a gettext implementation is required for NLS" "$LINENO" 5
18287 fi
18288
18289   ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
18290 if test "x$ac_cv_header_libintl_h" = xyes; then :
18291
18292 else
18293   as_fn_error $? "header file <libintl.h> is required for NLS" "$LINENO" 5
18294 fi
18295
18296
18297   if test -z "$MSGFMT"; then
18298   for ac_prog in msgfmt
18299 do
18300   # Extract the first word of "$ac_prog", so it can be a program name with args.
18301 set dummy $ac_prog; ac_word=$2
18302 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18303 $as_echo_n "checking for $ac_word... " >&6; }
18304 if ${ac_cv_path_MSGFMT+:} false; then :
18305   $as_echo_n "(cached) " >&6
18306 else
18307   case $MSGFMT in
18308   [\\/]* | ?:[\\/]*)
18309   ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
18310   ;;
18311   *)
18312   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18313 for as_dir in $PATH
18314 do
18315   IFS=$as_save_IFS
18316   test -z "$as_dir" && as_dir=.
18317     for ac_exec_ext in '' $ac_executable_extensions; do
18318   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18319     ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext"
18320     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18321     break 2
18322   fi
18323 done
18324   done
18325 IFS=$as_save_IFS
18326
18327   ;;
18328 esac
18329 fi
18330 MSGFMT=$ac_cv_path_MSGFMT
18331 if test -n "$MSGFMT"; then
18332   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
18333 $as_echo "$MSGFMT" >&6; }
18334 else
18335   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18336 $as_echo "no" >&6; }
18337 fi
18338
18339
18340   test -n "$MSGFMT" && break
18341 done
18342
18343 else
18344   # Report the value of MSGFMT in configure's output in all cases.
18345   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MSGFMT" >&5
18346 $as_echo_n "checking for MSGFMT... " >&6; }
18347   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
18348 $as_echo "$MSGFMT" >&6; }
18349 fi
18350
18351     if test -z "$MSGFMT"; then
18352     as_fn_error $? "msgfmt is required for NLS" "$LINENO" 5
18353   fi
18354   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msgfmt flags" >&5
18355 $as_echo_n "checking for msgfmt flags... " >&6; }
18356 if ${pgac_cv_msgfmt_flags+:} false; then :
18357   $as_echo_n "(cached) " >&6
18358 else
18359   if test x"$MSGFMT" != x"" && "$MSGFMT" --version 2>&1 | grep "GNU" >/dev/null; then
18360     pgac_cv_msgfmt_flags=-c
18361 fi
18362 fi
18363 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_msgfmt_flags" >&5
18364 $as_echo "$pgac_cv_msgfmt_flags" >&6; }
18365   MSGFMT_FLAGS=$pgac_cv_msgfmt_flags
18366
18367   if test -z "$MSGMERGE"; then
18368   for ac_prog in msgmerge
18369 do
18370   # Extract the first word of "$ac_prog", so it can be a program name with args.
18371 set dummy $ac_prog; ac_word=$2
18372 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18373 $as_echo_n "checking for $ac_word... " >&6; }
18374 if ${ac_cv_path_MSGMERGE+:} false; then :
18375   $as_echo_n "(cached) " >&6
18376 else
18377   case $MSGMERGE in
18378   [\\/]* | ?:[\\/]*)
18379   ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path.
18380   ;;
18381   *)
18382   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18383 for as_dir in $PATH
18384 do
18385   IFS=$as_save_IFS
18386   test -z "$as_dir" && as_dir=.
18387     for ac_exec_ext in '' $ac_executable_extensions; do
18388   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18389     ac_cv_path_MSGMERGE="$as_dir/$ac_word$ac_exec_ext"
18390     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18391     break 2
18392   fi
18393 done
18394   done
18395 IFS=$as_save_IFS
18396
18397   ;;
18398 esac
18399 fi
18400 MSGMERGE=$ac_cv_path_MSGMERGE
18401 if test -n "$MSGMERGE"; then
18402   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
18403 $as_echo "$MSGMERGE" >&6; }
18404 else
18405   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18406 $as_echo "no" >&6; }
18407 fi
18408
18409
18410   test -n "$MSGMERGE" && break
18411 done
18412
18413 else
18414   # Report the value of MSGMERGE in configure's output in all cases.
18415   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MSGMERGE" >&5
18416 $as_echo_n "checking for MSGMERGE... " >&6; }
18417   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
18418 $as_echo "$MSGMERGE" >&6; }
18419 fi
18420
18421   if test -z "$XGETTEXT"; then
18422   for ac_prog in xgettext
18423 do
18424   # Extract the first word of "$ac_prog", so it can be a program name with args.
18425 set dummy $ac_prog; ac_word=$2
18426 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18427 $as_echo_n "checking for $ac_word... " >&6; }
18428 if ${ac_cv_path_XGETTEXT+:} false; then :
18429   $as_echo_n "(cached) " >&6
18430 else
18431   case $XGETTEXT in
18432   [\\/]* | ?:[\\/]*)
18433   ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
18434   ;;
18435   *)
18436   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18437 for as_dir in $PATH
18438 do
18439   IFS=$as_save_IFS
18440   test -z "$as_dir" && as_dir=.
18441     for ac_exec_ext in '' $ac_executable_extensions; do
18442   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18443     ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext"
18444     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18445     break 2
18446   fi
18447 done
18448   done
18449 IFS=$as_save_IFS
18450
18451   ;;
18452 esac
18453 fi
18454 XGETTEXT=$ac_cv_path_XGETTEXT
18455 if test -n "$XGETTEXT"; then
18456   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
18457 $as_echo "$XGETTEXT" >&6; }
18458 else
18459   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18460 $as_echo "no" >&6; }
18461 fi
18462
18463
18464   test -n "$XGETTEXT" && break
18465 done
18466
18467 else
18468   # Report the value of XGETTEXT in configure's output in all cases.
18469   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XGETTEXT" >&5
18470 $as_echo_n "checking for XGETTEXT... " >&6; }
18471   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
18472 $as_echo "$XGETTEXT" >&6; }
18473 fi
18474
18475
18476 fi
18477
18478 # Check for Tcl configuration script tclConfig.sh
18479 if test "$with_tcl" = yes; then
18480     if test -z "$TCLSH"; then
18481   for ac_prog in tclsh tcl tclsh8.6 tclsh86 tclsh8.5 tclsh85 tclsh8.4 tclsh84
18482 do
18483   # Extract the first word of "$ac_prog", so it can be a program name with args.
18484 set dummy $ac_prog; ac_word=$2
18485 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18486 $as_echo_n "checking for $ac_word... " >&6; }
18487 if ${ac_cv_path_TCLSH+:} false; then :
18488   $as_echo_n "(cached) " >&6
18489 else
18490   case $TCLSH in
18491   [\\/]* | ?:[\\/]*)
18492   ac_cv_path_TCLSH="$TCLSH" # Let the user override the test with a path.
18493   ;;
18494   *)
18495   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18496 for as_dir in $PATH
18497 do
18498   IFS=$as_save_IFS
18499   test -z "$as_dir" && as_dir=.
18500     for ac_exec_ext in '' $ac_executable_extensions; do
18501   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18502     ac_cv_path_TCLSH="$as_dir/$ac_word$ac_exec_ext"
18503     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18504     break 2
18505   fi
18506 done
18507   done
18508 IFS=$as_save_IFS
18509
18510   ;;
18511 esac
18512 fi
18513 TCLSH=$ac_cv_path_TCLSH
18514 if test -n "$TCLSH"; then
18515   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLSH" >&5
18516 $as_echo "$TCLSH" >&6; }
18517 else
18518   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18519 $as_echo "no" >&6; }
18520 fi
18521
18522
18523   test -n "$TCLSH" && break
18524 done
18525
18526 else
18527   # Report the value of TCLSH in configure's output in all cases.
18528   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TCLSH" >&5
18529 $as_echo_n "checking for TCLSH... " >&6; }
18530   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLSH" >&5
18531 $as_echo "$TCLSH" >&6; }
18532 fi
18533
18534 if test x"$TCLSH" = x""; then
18535   as_fn_error $? "Tcl shell not found" "$LINENO" 5
18536 fi
18537
18538 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclConfig.sh" >&5
18539 $as_echo_n "checking for tclConfig.sh... " >&6; }
18540 # Let user override test
18541 if test -z "$TCL_CONFIG_SH"; then
18542     pgac_test_dirs="$with_tclconfig"
18543
18544     set X $pgac_test_dirs; shift
18545     if test $# -eq 0; then
18546         test -z "$TCLSH" && as_fn_error $? "unable to locate tclConfig.sh because no Tcl shell was found" "$LINENO" 5
18547         pgac_test_dirs=`echo 'puts $auto_path' | $TCLSH`
18548         # On newer macOS, $auto_path frequently doesn't include the place
18549         # where tclConfig.sh actually lives.  Append that to the end, so as not
18550         # to break cases where a non-default Tcl installation is being used.
18551         if test -d "$PG_SYSROOT/System/Library/Frameworks/Tcl.framework" ; then
18552             pgac_test_dirs="$pgac_test_dirs $PG_SYSROOT/System/Library/Frameworks/Tcl.framework"
18553         fi
18554         set X $pgac_test_dirs; shift
18555     fi
18556
18557     for pgac_dir do
18558         if test -r "$pgac_dir/tclConfig.sh"; then
18559             TCL_CONFIG_SH=$pgac_dir/tclConfig.sh
18560             break
18561         fi
18562     done
18563 fi
18564
18565 if test -z "$TCL_CONFIG_SH"; then
18566     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18567 $as_echo "no" >&6; }
18568     as_fn_error $? "file 'tclConfig.sh' is required for Tcl" "$LINENO" 5
18569 else
18570     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCL_CONFIG_SH" >&5
18571 $as_echo "$TCL_CONFIG_SH" >&6; }
18572 fi
18573
18574
18575
18576     . "$TCL_CONFIG_SH"
18577 eval TCL_INCLUDE_SPEC=\"$TCL_INCLUDE_SPEC\"
18578 eval TCL_LIBS=\"$TCL_LIBS\"
18579 eval TCL_LIB_SPEC=\"$TCL_LIB_SPEC\"
18580 eval TCL_SHARED_BUILD=\"$TCL_SHARED_BUILD\"
18581
18582         if test "$TCL_SHARED_BUILD" != 1; then
18583       as_fn_error $? "cannot build PL/Tcl because Tcl is not a shared library
18584 Use --without-tcl to disable building PL/Tcl." "$LINENO" 5
18585     fi
18586     # now that we have TCL_INCLUDE_SPEC, we can check for <tcl.h>
18587     ac_save_CPPFLAGS=$CPPFLAGS
18588     CPPFLAGS="$TCL_INCLUDE_SPEC $CPPFLAGS"
18589     ac_fn_c_check_header_mongrel "$LINENO" "tcl.h" "ac_cv_header_tcl_h" "$ac_includes_default"
18590 if test "x$ac_cv_header_tcl_h" = xyes; then :
18591
18592 else
18593   as_fn_error $? "header file <tcl.h> is required for Tcl" "$LINENO" 5
18594 fi
18595
18596
18597     CPPFLAGS=$ac_save_CPPFLAGS
18598 fi
18599
18600 # check for <perl.h>
18601 if test "$with_perl" = yes; then
18602   ac_save_CPPFLAGS=$CPPFLAGS
18603   CPPFLAGS="$CPPFLAGS $perl_includespec"
18604   ac_fn_c_check_header_compile "$LINENO" "perl.h" "ac_cv_header_perl_h" "#include <EXTERN.h>
18605 "
18606 if test "x$ac_cv_header_perl_h" = xyes; then :
18607
18608 else
18609   as_fn_error $? "header file <perl.h> is required for Perl" "$LINENO" 5
18610 fi
18611
18612
18613   # While we're at it, check that we can link to libperl.
18614   # On most platforms, if perl.h is there then libperl.so will be too, but at
18615   # this writing Debian packages them separately.  There is no known reason to
18616   # waste cycles on separate probes for the Tcl or Python libraries, though.
18617   pgac_save_LIBS=$LIBS
18618   LIBS="$perl_embed_ldflags"
18619   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libperl" >&5
18620 $as_echo_n "checking for libperl... " >&6; }
18621   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18622 /* end confdefs.h.  */
18623
18624 #include <EXTERN.h>
18625 #include <perl.h>
18626
18627 int
18628 main ()
18629 {
18630 perl_alloc();
18631   ;
18632   return 0;
18633 }
18634 _ACEOF
18635 if ac_fn_c_try_link "$LINENO"; then :
18636   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
18637 $as_echo "yes" >&6; }
18638 else
18639   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18640 $as_echo "no" >&6; }
18641      as_fn_error $? "libperl library is required for Perl" "$LINENO" 5
18642 fi
18643 rm -f core conftest.err conftest.$ac_objext \
18644     conftest$ac_exeext conftest.$ac_ext
18645   LIBS=$pgac_save_LIBS
18646   CPPFLAGS=$ac_save_CPPFLAGS
18647 fi
18648
18649 # check for <Python.h>
18650 if test "$with_python" = yes; then
18651   ac_save_CPPFLAGS=$CPPFLAGS
18652   CPPFLAGS="$python_includespec $CPPFLAGS"
18653   ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
18654 if test "x$ac_cv_header_Python_h" = xyes; then :
18655
18656 else
18657   as_fn_error $? "header file <Python.h> is required for Python" "$LINENO" 5
18658 fi
18659
18660
18661   CPPFLAGS=$ac_save_CPPFLAGS
18662 fi
18663
18664 #
18665 # Check for DocBook and tools
18666 #
18667 if test -z "$XMLLINT"; then
18668   for ac_prog in xmllint
18669 do
18670   # Extract the first word of "$ac_prog", so it can be a program name with args.
18671 set dummy $ac_prog; ac_word=$2
18672 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18673 $as_echo_n "checking for $ac_word... " >&6; }
18674 if ${ac_cv_path_XMLLINT+:} false; then :
18675   $as_echo_n "(cached) " >&6
18676 else
18677   case $XMLLINT in
18678   [\\/]* | ?:[\\/]*)
18679   ac_cv_path_XMLLINT="$XMLLINT" # Let the user override the test with a path.
18680   ;;
18681   *)
18682   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18683 for as_dir in $PATH
18684 do
18685   IFS=$as_save_IFS
18686   test -z "$as_dir" && as_dir=.
18687     for ac_exec_ext in '' $ac_executable_extensions; do
18688   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18689     ac_cv_path_XMLLINT="$as_dir/$ac_word$ac_exec_ext"
18690     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18691     break 2
18692   fi
18693 done
18694   done
18695 IFS=$as_save_IFS
18696
18697   ;;
18698 esac
18699 fi
18700 XMLLINT=$ac_cv_path_XMLLINT
18701 if test -n "$XMLLINT"; then
18702   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
18703 $as_echo "$XMLLINT" >&6; }
18704 else
18705   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18706 $as_echo "no" >&6; }
18707 fi
18708
18709
18710   test -n "$XMLLINT" && break
18711 done
18712
18713 else
18714   # Report the value of XMLLINT in configure's output in all cases.
18715   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XMLLINT" >&5
18716 $as_echo_n "checking for XMLLINT... " >&6; }
18717   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
18718 $as_echo "$XMLLINT" >&6; }
18719 fi
18720
18721
18722 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XML V4.2" >&5
18723 $as_echo_n "checking for DocBook XML V4.2... " >&6; }
18724 if ${pgac_cv_check_docbook+:} false; then :
18725   $as_echo_n "(cached) " >&6
18726 else
18727   cat >conftest.xml <<EOF
18728 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
18729 <book>
18730  <title>test</title>
18731  <chapter>
18732   <title>random</title>
18733    <sect1>
18734     <title>testsect</title>
18735     <para>text</para>
18736   </sect1>
18737  </chapter>
18738 </book>
18739 EOF
18740
18741 pgac_cv_check_docbook=no
18742
18743 if test -n "$XMLLINT"; then
18744   $XMLLINT --noout --valid conftest.xml 1>&5 2>&1
18745   if test $? -eq 0; then
18746     pgac_cv_check_docbook=yes
18747   fi
18748 fi
18749 rm -f conftest.xml
18750 fi
18751 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_docbook" >&5
18752 $as_echo "$pgac_cv_check_docbook" >&6; }
18753
18754 have_docbook=$pgac_cv_check_docbook
18755
18756
18757 if test -z "$DBTOEPUB"; then
18758   for ac_prog in dbtoepub
18759 do
18760   # Extract the first word of "$ac_prog", so it can be a program name with args.
18761 set dummy $ac_prog; ac_word=$2
18762 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18763 $as_echo_n "checking for $ac_word... " >&6; }
18764 if ${ac_cv_path_DBTOEPUB+:} false; then :
18765   $as_echo_n "(cached) " >&6
18766 else
18767   case $DBTOEPUB in
18768   [\\/]* | ?:[\\/]*)
18769   ac_cv_path_DBTOEPUB="$DBTOEPUB" # Let the user override the test with a path.
18770   ;;
18771   *)
18772   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18773 for as_dir in $PATH
18774 do
18775   IFS=$as_save_IFS
18776   test -z "$as_dir" && as_dir=.
18777     for ac_exec_ext in '' $ac_executable_extensions; do
18778   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18779     ac_cv_path_DBTOEPUB="$as_dir/$ac_word$ac_exec_ext"
18780     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18781     break 2
18782   fi
18783 done
18784   done
18785 IFS=$as_save_IFS
18786
18787   ;;
18788 esac
18789 fi
18790 DBTOEPUB=$ac_cv_path_DBTOEPUB
18791 if test -n "$DBTOEPUB"; then
18792   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18793 $as_echo "$DBTOEPUB" >&6; }
18794 else
18795   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18796 $as_echo "no" >&6; }
18797 fi
18798
18799
18800   test -n "$DBTOEPUB" && break
18801 done
18802
18803 else
18804   # Report the value of DBTOEPUB in configure's output in all cases.
18805   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBTOEPUB" >&5
18806 $as_echo_n "checking for DBTOEPUB... " >&6; }
18807   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18808 $as_echo "$DBTOEPUB" >&6; }
18809 fi
18810
18811 if test -z "$XSLTPROC"; then
18812   for ac_prog in xsltproc
18813 do
18814   # Extract the first word of "$ac_prog", so it can be a program name with args.
18815 set dummy $ac_prog; ac_word=$2
18816 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18817 $as_echo_n "checking for $ac_word... " >&6; }
18818 if ${ac_cv_path_XSLTPROC+:} false; then :
18819   $as_echo_n "(cached) " >&6
18820 else
18821   case $XSLTPROC in
18822   [\\/]* | ?:[\\/]*)
18823   ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
18824   ;;
18825   *)
18826   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18827 for as_dir in $PATH
18828 do
18829   IFS=$as_save_IFS
18830   test -z "$as_dir" && as_dir=.
18831     for ac_exec_ext in '' $ac_executable_extensions; do
18832   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18833     ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
18834     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18835     break 2
18836   fi
18837 done
18838   done
18839 IFS=$as_save_IFS
18840
18841   ;;
18842 esac
18843 fi
18844 XSLTPROC=$ac_cv_path_XSLTPROC
18845 if test -n "$XSLTPROC"; then
18846   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18847 $as_echo "$XSLTPROC" >&6; }
18848 else
18849   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18850 $as_echo "no" >&6; }
18851 fi
18852
18853
18854   test -n "$XSLTPROC" && break
18855 done
18856
18857 else
18858   # Report the value of XSLTPROC in configure's output in all cases.
18859   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSLTPROC" >&5
18860 $as_echo_n "checking for XSLTPROC... " >&6; }
18861   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18862 $as_echo "$XSLTPROC" >&6; }
18863 fi
18864
18865 if test -z "$FOP"; then
18866   for ac_prog in fop
18867 do
18868   # Extract the first word of "$ac_prog", so it can be a program name with args.
18869 set dummy $ac_prog; ac_word=$2
18870 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18871 $as_echo_n "checking for $ac_word... " >&6; }
18872 if ${ac_cv_path_FOP+:} false; then :
18873   $as_echo_n "(cached) " >&6
18874 else
18875   case $FOP in
18876   [\\/]* | ?:[\\/]*)
18877   ac_cv_path_FOP="$FOP" # Let the user override the test with a path.
18878   ;;
18879   *)
18880   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18881 for as_dir in $PATH
18882 do
18883   IFS=$as_save_IFS
18884   test -z "$as_dir" && as_dir=.
18885     for ac_exec_ext in '' $ac_executable_extensions; do
18886   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18887     ac_cv_path_FOP="$as_dir/$ac_word$ac_exec_ext"
18888     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18889     break 2
18890   fi
18891 done
18892   done
18893 IFS=$as_save_IFS
18894
18895   ;;
18896 esac
18897 fi
18898 FOP=$ac_cv_path_FOP
18899 if test -n "$FOP"; then
18900   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18901 $as_echo "$FOP" >&6; }
18902 else
18903   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18904 $as_echo "no" >&6; }
18905 fi
18906
18907
18908   test -n "$FOP" && break
18909 done
18910
18911 else
18912   # Report the value of FOP in configure's output in all cases.
18913   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FOP" >&5
18914 $as_echo_n "checking for FOP... " >&6; }
18915   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18916 $as_echo "$FOP" >&6; }
18917 fi
18918
18919
18920 #
18921 # Check for test tools
18922 #
18923 if test "$enable_tap_tests" = yes; then
18924   # Check for necessary modules, unless user has specified the "prove" to use;
18925   # in that case it's her responsibility to have a working configuration.
18926   # (prove might be part of a different Perl installation than perl, eg on
18927   # MSys, so the result of AX_PROG_PERL_MODULES could be irrelevant anyway.)
18928   if test -z "$PROVE"; then
18929     # Test::More and Time::HiRes are supposed to be part of core Perl,
18930     # but some distros omit them in a minimal installation.
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941 # Make sure we have perl
18942 if test -z "$PERL"; then
18943 # Extract the first word of "perl", so it can be a program name with args.
18944 set dummy perl; ac_word=$2
18945 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18946 $as_echo_n "checking for $ac_word... " >&6; }
18947 if ${ac_cv_prog_PERL+:} false; then :
18948   $as_echo_n "(cached) " >&6
18949 else
18950   if test -n "$PERL"; then
18951   ac_cv_prog_PERL="$PERL" # Let the user override the test.
18952 else
18953 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18954 for as_dir in $PATH
18955 do
18956   IFS=$as_save_IFS
18957   test -z "$as_dir" && as_dir=.
18958     for ac_exec_ext in '' $ac_executable_extensions; do
18959   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18960     ac_cv_prog_PERL="perl"
18961     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18962     break 2
18963   fi
18964 done
18965   done
18966 IFS=$as_save_IFS
18967
18968 fi
18969 fi
18970 PERL=$ac_cv_prog_PERL
18971 if test -n "$PERL"; then
18972   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
18973 $as_echo "$PERL" >&6; }
18974 else
18975   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18976 $as_echo "no" >&6; }
18977 fi
18978
18979
18980 fi
18981
18982 if test "x$PERL" != x; then
18983   ax_perl_modules_failed=0
18984   for ax_perl_module in 'IPC::Run' 'Test::More 0.87' 'Time::HiRes' ; do
18985     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ax_perl_module" >&5
18986 $as_echo_n "checking for perl module $ax_perl_module... " >&6; }
18987
18988     # Would be nice to log result here, but can't rely on autoconf internals
18989     $PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1
18990     if test $? -ne 0; then
18991       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18992 $as_echo "no" >&6; };
18993       ax_perl_modules_failed=1
18994    else
18995       { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
18996 $as_echo "ok" >&6; };
18997     fi
18998   done
18999
19000   # Run optional shell commands
19001   if test "$ax_perl_modules_failed" = 0; then
19002     :
19003
19004   else
19005     :
19006     as_fn_error $? "Additional Perl modules are required to run TAP tests" "$LINENO" 5
19007   fi
19008 else
19009   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5
19010 $as_echo "$as_me: WARNING: could not find perl" >&2;}
19011 fi
19012   fi
19013   # Now make sure we know where prove is
19014   if test -z "$PROVE"; then
19015   for ac_prog in prove
19016 do
19017   # Extract the first word of "$ac_prog", so it can be a program name with args.
19018 set dummy $ac_prog; ac_word=$2
19019 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
19020 $as_echo_n "checking for $ac_word... " >&6; }
19021 if ${ac_cv_path_PROVE+:} false; then :
19022   $as_echo_n "(cached) " >&6
19023 else
19024   case $PROVE in
19025   [\\/]* | ?:[\\/]*)
19026   ac_cv_path_PROVE="$PROVE" # Let the user override the test with a path.
19027   ;;
19028   *)
19029   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
19030 for as_dir in $PATH
19031 do
19032   IFS=$as_save_IFS
19033   test -z "$as_dir" && as_dir=.
19034     for ac_exec_ext in '' $ac_executable_extensions; do
19035   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
19036     ac_cv_path_PROVE="$as_dir/$ac_word$ac_exec_ext"
19037     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
19038     break 2
19039   fi
19040 done
19041   done
19042 IFS=$as_save_IFS
19043
19044   ;;
19045 esac
19046 fi
19047 PROVE=$ac_cv_path_PROVE
19048 if test -n "$PROVE"; then
19049   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROVE" >&5
19050 $as_echo "$PROVE" >&6; }
19051 else
19052   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19053 $as_echo "no" >&6; }
19054 fi
19055
19056
19057   test -n "$PROVE" && break
19058 done
19059
19060 else
19061   # Report the value of PROVE in configure's output in all cases.
19062   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PROVE" >&5
19063 $as_echo_n "checking for PROVE... " >&6; }
19064   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROVE" >&5
19065 $as_echo "$PROVE" >&6; }
19066 fi
19067
19068   if test -z "$PROVE"; then
19069     as_fn_error $? "prove not found" "$LINENO" 5
19070   fi
19071 fi
19072
19073 # Thread testing
19074
19075 # We have to run the thread test near the end so we have all our symbols
19076 # defined.  Cross compiling throws a warning.
19077 #
19078 if test "$enable_thread_safety" = yes; then
19079 if test "$PORTNAME" != "win32"
19080 then
19081 { $as_echo "$as_me:${as_lineno-$LINENO}: checking thread safety of required library functions" >&5
19082 $as_echo_n "checking thread safety of required library functions... " >&6; }
19083
19084 _CFLAGS="$CFLAGS"
19085 _LIBS="$LIBS"
19086 CFLAGS="$CFLAGS $PTHREAD_CFLAGS -DIN_CONFIGURE"
19087 LIBS="$LIBS $PTHREAD_LIBS"
19088 if test "$cross_compiling" = yes; then :
19089   { $as_echo "$as_me:${as_lineno-$LINENO}: result: maybe" >&5
19090 $as_echo "maybe" >&6; }
19091   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
19092 *** Skipping thread test program because of cross-compile build.
19093 *** Run the program in src/test/thread on the target machine.
19094 " >&5
19095 $as_echo "$as_me: WARNING:
19096 *** Skipping thread test program because of cross-compile build.
19097 *** Run the program in src/test/thread on the target machine.
19098 " >&2;}
19099 else
19100   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19101 /* end confdefs.h.  */
19102 #include "$srcdir/src/test/thread/thread_test.c"
19103 _ACEOF
19104 if ac_fn_c_try_run "$LINENO"; then :
19105   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
19106 $as_echo "yes" >&6; }
19107 else
19108   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19109 $as_echo "no" >&6; }
19110   as_fn_error $? "thread test program failed
19111 This platform is not thread-safe.  Check the file 'config.log' or compile
19112 and run src/test/thread/thread_test for the exact reason.
19113 Use --disable-thread-safety to disable thread safety." "$LINENO" 5
19114 fi
19115 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19116   conftest.$ac_objext conftest.beam conftest.$ac_ext
19117 fi
19118
19119 CFLAGS="$_CFLAGS"
19120 LIBS="$_LIBS"
19121 else
19122 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** skipping thread test on Win32" >&5
19123 $as_echo "$as_me: WARNING: *** skipping thread test on Win32" >&2;}
19124 fi
19125 fi
19126
19127 # If compiler will take -Wl,--as-needed (or various platform-specific
19128 # spellings thereof) then add that to LDFLAGS.  This is much easier than
19129 # trying to filter LIBS to the minimum for each executable.
19130 # On (at least) some Red-Hat-derived systems, this switch breaks linking to
19131 # libreadline; therefore we postpone testing it until we know what library
19132 # dependencies readline has.  The test code will try to link with $LIBS.
19133 if test "$with_readline" = yes; then
19134   link_test_func=readline
19135 else
19136   link_test_func=exit
19137 fi
19138
19139 if test "$PORTNAME" = "darwin"; then
19140   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,-dead_strip_dylibs" >&5
19141 $as_echo_n "checking whether $CC supports -Wl,-dead_strip_dylibs... " >&6; }
19142 if ${pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs+:} false; then :
19143   $as_echo_n "(cached) " >&6
19144 else
19145   pgac_save_LDFLAGS=$LDFLAGS
19146 LDFLAGS="$pgac_save_LDFLAGS -Wl,-dead_strip_dylibs"
19147 if test "$cross_compiling" = yes; then :
19148   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs="assuming no"
19149 else
19150   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19151 /* end confdefs.h.  */
19152 extern void $link_test_func (); void (*fptr) () = $link_test_func;
19153 int
19154 main ()
19155 {
19156
19157   ;
19158   return 0;
19159 }
19160 _ACEOF
19161 if ac_fn_c_try_run "$LINENO"; then :
19162   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=yes
19163 else
19164   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=no
19165 fi
19166 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19167   conftest.$ac_objext conftest.beam conftest.$ac_ext
19168 fi
19169
19170 LDFLAGS="$pgac_save_LDFLAGS"
19171 fi
19172 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&5
19173 $as_echo "$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&6; }
19174 if test x"$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" = x"yes"; then
19175   LDFLAGS="$LDFLAGS -Wl,-dead_strip_dylibs"
19176 fi
19177
19178 elif test "$PORTNAME" = "openbsd"; then
19179   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,-Bdynamic" >&5
19180 $as_echo_n "checking whether $CC supports -Wl,-Bdynamic... " >&6; }
19181 if ${pgac_cv_prog_cc_ldflags__Wl__Bdynamic+:} false; then :
19182   $as_echo_n "(cached) " >&6
19183 else
19184   pgac_save_LDFLAGS=$LDFLAGS
19185 LDFLAGS="$pgac_save_LDFLAGS -Wl,-Bdynamic"
19186 if test "$cross_compiling" = yes; then :
19187   pgac_cv_prog_cc_ldflags__Wl__Bdynamic="assuming no"
19188 else
19189   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19190 /* end confdefs.h.  */
19191 extern void $link_test_func (); void (*fptr) () = $link_test_func;
19192 int
19193 main ()
19194 {
19195
19196   ;
19197   return 0;
19198 }
19199 _ACEOF
19200 if ac_fn_c_try_run "$LINENO"; then :
19201   pgac_cv_prog_cc_ldflags__Wl__Bdynamic=yes
19202 else
19203   pgac_cv_prog_cc_ldflags__Wl__Bdynamic=no
19204 fi
19205 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19206   conftest.$ac_objext conftest.beam conftest.$ac_ext
19207 fi
19208
19209 LDFLAGS="$pgac_save_LDFLAGS"
19210 fi
19211 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&5
19212 $as_echo "$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&6; }
19213 if test x"$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" = x"yes"; then
19214   LDFLAGS="$LDFLAGS -Wl,-Bdynamic"
19215 fi
19216
19217 else
19218   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,--as-needed" >&5
19219 $as_echo_n "checking whether $CC supports -Wl,--as-needed... " >&6; }
19220 if ${pgac_cv_prog_cc_ldflags__Wl___as_needed+:} false; then :
19221   $as_echo_n "(cached) " >&6
19222 else
19223   pgac_save_LDFLAGS=$LDFLAGS
19224 LDFLAGS="$pgac_save_LDFLAGS -Wl,--as-needed"
19225 if test "$cross_compiling" = yes; then :
19226   pgac_cv_prog_cc_ldflags__Wl___as_needed="assuming no"
19227 else
19228   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19229 /* end confdefs.h.  */
19230 extern void $link_test_func (); void (*fptr) () = $link_test_func;
19231 int
19232 main ()
19233 {
19234
19235   ;
19236   return 0;
19237 }
19238 _ACEOF
19239 if ac_fn_c_try_run "$LINENO"; then :
19240   pgac_cv_prog_cc_ldflags__Wl___as_needed=yes
19241 else
19242   pgac_cv_prog_cc_ldflags__Wl___as_needed=no
19243 fi
19244 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
19245   conftest.$ac_objext conftest.beam conftest.$ac_ext
19246 fi
19247
19248 LDFLAGS="$pgac_save_LDFLAGS"
19249 fi
19250 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl___as_needed" >&5
19251 $as_echo "$pgac_cv_prog_cc_ldflags__Wl___as_needed" >&6; }
19252 if test x"$pgac_cv_prog_cc_ldflags__Wl___as_needed" = x"yes"; then
19253   LDFLAGS="$LDFLAGS -Wl,--as-needed"
19254 fi
19255
19256 fi
19257
19258 # Create compiler version string
19259 if test x"$GCC" = x"yes" ; then
19260   cc_string=`${CC} --version | sed q`
19261   case $cc_string in [A-Za-z]*) ;; *) cc_string="GCC $cc_string";; esac
19262 elif test x"$SUN_STUDIO_CC" = x"yes" ; then
19263   cc_string=`${CC} -V 2>&1 | sed q`
19264 else
19265   cc_string=$CC
19266 fi
19267
19268
19269 cat >>confdefs.h <<_ACEOF
19270 #define PG_VERSION_STR "PostgreSQL $PG_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"
19271 _ACEOF
19272
19273
19274 # Supply a numeric version string for use by 3rd party add-ons
19275 # awk -F is a regex on some platforms, and not on others, so make "." a tab
19276 PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |
19277 tr '.' '        ' |
19278 $AWK '{printf "%d%04d", $1, $2}'`"
19279
19280 cat >>confdefs.h <<_ACEOF
19281 #define PG_VERSION_NUM $PG_VERSION_NUM
19282 _ACEOF
19283
19284
19285
19286 # If we are inserting PG_SYSROOT into CPPFLAGS, do so symbolically not
19287 # literally, so that it's possible to override it at build time using
19288 # a command like "make ... PG_SYSROOT=path".  This has to be done after
19289 # we've finished all configure checks that depend on CPPFLAGS.
19290 if test x"$PG_SYSROOT" != x; then
19291   CPPFLAGS=`echo "$CPPFLAGS" | sed -e "s| $PG_SYSROOT | \\\$(PG_SYSROOT) |"`
19292 fi
19293
19294
19295
19296 # Begin output steps
19297
19298 { $as_echo "$as_me:${as_lineno-$LINENO}: using compiler=$cc_string" >&5
19299 $as_echo "$as_me: using compiler=$cc_string" >&6;}
19300 { $as_echo "$as_me:${as_lineno-$LINENO}: using CFLAGS=$CFLAGS" >&5
19301 $as_echo "$as_me: using CFLAGS=$CFLAGS" >&6;}
19302 { $as_echo "$as_me:${as_lineno-$LINENO}: using CPPFLAGS=$CPPFLAGS" >&5
19303 $as_echo "$as_me: using CPPFLAGS=$CPPFLAGS" >&6;}
19304 { $as_echo "$as_me:${as_lineno-$LINENO}: using LDFLAGS=$LDFLAGS" >&5
19305 $as_echo "$as_me: using LDFLAGS=$LDFLAGS" >&6;}
19306 # Currently only used when LLVM is used
19307 if test "$with_llvm" = yes ; then
19308    { $as_echo "$as_me:${as_lineno-$LINENO}: using CXX=$CXX" >&5
19309 $as_echo "$as_me: using CXX=$CXX" >&6;}
19310    { $as_echo "$as_me:${as_lineno-$LINENO}: using CXXFLAGS=$CXXFLAGS" >&5
19311 $as_echo "$as_me: using CXXFLAGS=$CXXFLAGS" >&6;}
19312    { $as_echo "$as_me:${as_lineno-$LINENO}: using CLANG=$CLANG" >&5
19313 $as_echo "$as_me: using CLANG=$CLANG" >&6;}
19314    { $as_echo "$as_me:${as_lineno-$LINENO}: using BITCODE_CFLAGS=$BITCODE_CFLAGS" >&5
19315 $as_echo "$as_me: using BITCODE_CFLAGS=$BITCODE_CFLAGS" >&6;}
19316    { $as_echo "$as_me:${as_lineno-$LINENO}: using BITCODE_CXXFLAGS=$BITCODE_CXXFLAGS" >&5
19317 $as_echo "$as_me: using BITCODE_CXXFLAGS=$BITCODE_CXXFLAGS" >&6;}
19318 fi
19319
19320 # prepare build tree if outside source tree
19321 # Note 1: test -ef might not exist, but it's more reliable than `pwd`.
19322 # Note 2: /bin/pwd might be better than shell's built-in at getting
19323 #         a symlink-free name.
19324 if ( test "$srcdir" -ef . ) >/dev/null 2>&1 || test "`cd $srcdir && /bin/pwd`" = "`/bin/pwd`"; then
19325   vpath_build=no
19326 else
19327   vpath_build=yes
19328   if test "$no_create" != yes; then
19329     $as_echo_n "preparing build tree... " >&6
19330     pgac_abs_top_srcdir=`cd "$srcdir" && pwd`
19331     $SHELL "$ac_aux_dir/prep_buildtree" "$pgac_abs_top_srcdir" "." \
19332       || as_fn_error $? "failed" "$LINENO" 5
19333     { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
19334 $as_echo "done" >&6; }
19335   fi
19336 fi
19337
19338
19339
19340 ac_config_files="$ac_config_files GNUmakefile src/Makefile.global"
19341
19342
19343 ac_config_links="$ac_config_links src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION} src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION} src/include/pg_config_os.h:src/include/port/${template}.h src/Makefile.port:src/makefiles/Makefile.${template}"
19344
19345
19346 if test "$PORTNAME" = "win32"; then
19347 ac_config_commands="$ac_config_commands check_win32_symlinks"
19348
19349 fi
19350
19351 ac_config_headers="$ac_config_headers src/include/pg_config.h"
19352
19353
19354 ac_config_headers="$ac_config_headers src/include/pg_config_ext.h"
19355
19356
19357 ac_config_headers="$ac_config_headers src/interfaces/ecpg/include/ecpg_config.h"
19358
19359
19360 cat >confcache <<\_ACEOF
19361 # This file is a shell script that caches the results of configure
19362 # tests run on this system so they can be shared between configure
19363 # scripts and configure runs, see configure's option --config-cache.
19364 # It is not useful on other systems.  If it contains results you don't
19365 # want to keep, you may remove or edit it.
19366 #
19367 # config.status only pays attention to the cache file if you give it
19368 # the --recheck option to rerun configure.
19369 #
19370 # `ac_cv_env_foo' variables (set or unset) will be overridden when
19371 # loading this file, other *unset* `ac_cv_foo' will be assigned the
19372 # following values.
19373
19374 _ACEOF
19375
19376 # The following way of writing the cache mishandles newlines in values,
19377 # but we know of no workaround that is simple, portable, and efficient.
19378 # So, we kill variables containing newlines.
19379 # Ultrix sh set writes to stderr and can't be redirected directly,
19380 # and sets the high bit in the cache file unless we assign to the vars.
19381 (
19382   for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
19383     eval ac_val=\$$ac_var
19384     case $ac_val in #(
19385     *${as_nl}*)
19386       case $ac_var in #(
19387       *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
19388 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
19389       esac
19390       case $ac_var in #(
19391       _ | IFS | as_nl) ;; #(
19392       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
19393       *) { eval $ac_var=; unset $ac_var;} ;;
19394       esac ;;
19395     esac
19396   done
19397
19398   (set) 2>&1 |
19399     case $as_nl`(ac_space=' '; set) 2>&1` in #(
19400     *${as_nl}ac_space=\ *)
19401       # `set' does not quote correctly, so add quotes: double-quote
19402       # substitution turns \\\\ into \\, and sed turns \\ into \.
19403       sed -n \
19404         "s/'/'\\\\''/g;
19405           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
19406       ;; #(
19407     *)
19408       # `set' quotes correctly as required by POSIX, so do not add quotes.
19409       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
19410       ;;
19411     esac |
19412     sort
19413 ) |
19414   sed '
19415      /^ac_cv_env_/b end
19416      t clear
19417      :clear
19418      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
19419      t end
19420      s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
19421      :end' >>confcache
19422 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
19423   if test -w "$cache_file"; then
19424     if test "x$cache_file" != "x/dev/null"; then
19425       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
19426 $as_echo "$as_me: updating cache $cache_file" >&6;}
19427       if test ! -f "$cache_file" || test -h "$cache_file"; then
19428         cat confcache >"$cache_file"
19429       else
19430         case $cache_file in #(
19431         */* | ?:*)
19432           mv -f confcache "$cache_file"$$ &&
19433           mv -f "$cache_file"$$ "$cache_file" ;; #(
19434         *)
19435           mv -f confcache "$cache_file" ;;
19436         esac
19437       fi
19438     fi
19439   else
19440     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
19441 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
19442   fi
19443 fi
19444 rm -f confcache
19445
19446 test "x$prefix" = xNONE && prefix=$ac_default_prefix
19447 # Let make expand exec_prefix.
19448 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
19449
19450 DEFS=-DHAVE_CONFIG_H
19451
19452 ac_libobjs=
19453 ac_ltlibobjs=
19454 U=
19455 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
19456   # 1. Remove the extension, and $U if already installed.
19457   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
19458   ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
19459   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
19460   #    will be set to the directory where LIBOBJS objects are built.
19461   as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
19462   as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
19463 done
19464 LIBOBJS=$ac_libobjs
19465
19466 LTLIBOBJS=$ac_ltlibobjs
19467
19468
19469
19470
19471 : "${CONFIG_STATUS=./config.status}"
19472 ac_write_fail=0
19473 ac_clean_files_save=$ac_clean_files
19474 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
19475 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
19476 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
19477 as_write_fail=0
19478 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
19479 #! $SHELL
19480 # Generated by $as_me.
19481 # Run this file to recreate the current configuration.
19482 # Compiler output produced by configure, useful for debugging
19483 # configure, is in config.log if it exists.
19484
19485 debug=false
19486 ac_cs_recheck=false
19487 ac_cs_silent=false
19488
19489 SHELL=\${CONFIG_SHELL-$SHELL}
19490 export SHELL
19491 _ASEOF
19492 cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
19493 ## -------------------- ##
19494 ## M4sh Initialization. ##
19495 ## -------------------- ##
19496
19497 # Be more Bourne compatible
19498 DUALCASE=1; export DUALCASE # for MKS sh
19499 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
19500   emulate sh
19501   NULLCMD=:
19502   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
19503   # is contrary to our usage.  Disable this feature.
19504   alias -g '${1+"$@"}'='"$@"'
19505   setopt NO_GLOB_SUBST
19506 else
19507   case `(set -o) 2>/dev/null` in #(
19508   *posix*) :
19509     set -o posix ;; #(
19510   *) :
19511      ;;
19512 esac
19513 fi
19514
19515
19516 as_nl='
19517 '
19518 export as_nl
19519 # Printing a long string crashes Solaris 7 /usr/bin/printf.
19520 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
19521 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
19522 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
19523 # Prefer a ksh shell builtin over an external printf program on Solaris,
19524 # but without wasting forks for bash or zsh.
19525 if test -z "$BASH_VERSION$ZSH_VERSION" \
19526     && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
19527   as_echo='print -r --'
19528   as_echo_n='print -rn --'
19529 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
19530   as_echo='printf %s\n'
19531   as_echo_n='printf %s'
19532 else
19533   if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
19534     as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
19535     as_echo_n='/usr/ucb/echo -n'
19536   else
19537     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
19538     as_echo_n_body='eval
19539       arg=$1;
19540       case $arg in #(
19541       *"$as_nl"*)
19542         expr "X$arg" : "X\\(.*\\)$as_nl";
19543         arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
19544       esac;
19545       expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
19546     '
19547     export as_echo_n_body
19548     as_echo_n='sh -c $as_echo_n_body as_echo'
19549   fi
19550   export as_echo_body
19551   as_echo='sh -c $as_echo_body as_echo'
19552 fi
19553
19554 # The user is always right.
19555 if test "${PATH_SEPARATOR+set}" != set; then
19556   PATH_SEPARATOR=:
19557   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
19558     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
19559       PATH_SEPARATOR=';'
19560   }
19561 fi
19562
19563
19564 # IFS
19565 # We need space, tab and new line, in precisely that order.  Quoting is
19566 # there to prevent editors from complaining about space-tab.
19567 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
19568 # splitting by setting IFS to empty value.)
19569 IFS=" ""        $as_nl"
19570
19571 # Find who we are.  Look in the path if we contain no directory separator.
19572 as_myself=
19573 case $0 in #((
19574   *[\\/]* ) as_myself=$0 ;;
19575   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
19576 for as_dir in $PATH
19577 do
19578   IFS=$as_save_IFS
19579   test -z "$as_dir" && as_dir=.
19580     test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
19581   done
19582 IFS=$as_save_IFS
19583
19584      ;;
19585 esac
19586 # We did not find ourselves, most probably we were run as `sh COMMAND'
19587 # in which case we are not to be found in the path.
19588 if test "x$as_myself" = x; then
19589   as_myself=$0
19590 fi
19591 if test ! -f "$as_myself"; then
19592   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
19593   exit 1
19594 fi
19595
19596 # Unset variables that we do not need and which cause bugs (e.g. in
19597 # pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
19598 # suppresses any "Segmentation fault" message there.  '((' could
19599 # trigger a bug in pdksh 5.2.14.
19600 for as_var in BASH_ENV ENV MAIL MAILPATH
19601 do eval test x\${$as_var+set} = xset \
19602   && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
19603 done
19604 PS1='$ '
19605 PS2='> '
19606 PS4='+ '
19607
19608 # NLS nuisances.
19609 LC_ALL=C
19610 export LC_ALL
19611 LANGUAGE=C
19612 export LANGUAGE
19613
19614 # CDPATH.
19615 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
19616
19617
19618 # as_fn_error STATUS ERROR [LINENO LOG_FD]
19619 # ----------------------------------------
19620 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
19621 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
19622 # script with STATUS, using 1 if that was 0.
19623 as_fn_error ()
19624 {
19625   as_status=$1; test $as_status -eq 0 && as_status=1
19626   if test "$4"; then
19627     as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
19628     $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
19629   fi
19630   $as_echo "$as_me: error: $2" >&2
19631   as_fn_exit $as_status
19632 } # as_fn_error
19633
19634
19635 # as_fn_set_status STATUS
19636 # -----------------------
19637 # Set $? to STATUS, without forking.
19638 as_fn_set_status ()
19639 {
19640   return $1
19641 } # as_fn_set_status
19642
19643 # as_fn_exit STATUS
19644 # -----------------
19645 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
19646 as_fn_exit ()
19647 {
19648   set +e
19649   as_fn_set_status $1
19650   exit $1
19651 } # as_fn_exit
19652
19653 # as_fn_unset VAR
19654 # ---------------
19655 # Portably unset VAR.
19656 as_fn_unset ()
19657 {
19658   { eval $1=; unset $1;}
19659 }
19660 as_unset=as_fn_unset
19661 # as_fn_append VAR VALUE
19662 # ----------------------
19663 # Append the text in VALUE to the end of the definition contained in VAR. Take
19664 # advantage of any shell optimizations that allow amortized linear growth over
19665 # repeated appends, instead of the typical quadratic growth present in naive
19666 # implementations.
19667 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
19668   eval 'as_fn_append ()
19669   {
19670     eval $1+=\$2
19671   }'
19672 else
19673   as_fn_append ()
19674   {
19675     eval $1=\$$1\$2
19676   }
19677 fi # as_fn_append
19678
19679 # as_fn_arith ARG...
19680 # ------------------
19681 # Perform arithmetic evaluation on the ARGs, and store the result in the
19682 # global $as_val. Take advantage of shells that can avoid forks. The arguments
19683 # must be portable across $(()) and expr.
19684 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
19685   eval 'as_fn_arith ()
19686   {
19687     as_val=$(( $* ))
19688   }'
19689 else
19690   as_fn_arith ()
19691   {
19692     as_val=`expr "$@" || test $? -eq 1`
19693   }
19694 fi # as_fn_arith
19695
19696
19697 if expr a : '\(a\)' >/dev/null 2>&1 &&
19698    test "X`expr 00001 : '.*\(...\)'`" = X001; then
19699   as_expr=expr
19700 else
19701   as_expr=false
19702 fi
19703
19704 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
19705   as_basename=basename
19706 else
19707   as_basename=false
19708 fi
19709
19710 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
19711   as_dirname=dirname
19712 else
19713   as_dirname=false
19714 fi
19715
19716 as_me=`$as_basename -- "$0" ||
19717 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
19718          X"$0" : 'X\(//\)$' \| \
19719          X"$0" : 'X\(/\)' \| . 2>/dev/null ||
19720 $as_echo X/"$0" |
19721     sed '/^.*\/\([^/][^/]*\)\/*$/{
19722             s//\1/
19723             q
19724           }
19725           /^X\/\(\/\/\)$/{
19726             s//\1/
19727             q
19728           }
19729           /^X\/\(\/\).*/{
19730             s//\1/
19731             q
19732           }
19733           s/.*/./; q'`
19734
19735 # Avoid depending upon Character Ranges.
19736 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
19737 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
19738 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
19739 as_cr_digits='0123456789'
19740 as_cr_alnum=$as_cr_Letters$as_cr_digits
19741
19742 ECHO_C= ECHO_N= ECHO_T=
19743 case `echo -n x` in #(((((
19744 -n*)
19745   case `echo 'xy\c'` in
19746   *c*) ECHO_T=' ';;     # ECHO_T is single tab character.
19747   xy)  ECHO_C='\c';;
19748   *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
19749        ECHO_T=' ';;
19750   esac;;
19751 *)
19752   ECHO_N='-n';;
19753 esac
19754
19755 rm -f conf$$ conf$$.exe conf$$.file
19756 if test -d conf$$.dir; then
19757   rm -f conf$$.dir/conf$$.file
19758 else
19759   rm -f conf$$.dir
19760   mkdir conf$$.dir 2>/dev/null
19761 fi
19762 if (echo >conf$$.file) 2>/dev/null; then
19763   if ln -s conf$$.file conf$$ 2>/dev/null; then
19764     as_ln_s='ln -s'
19765     # ... but there are two gotchas:
19766     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
19767     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
19768     # In both cases, we have to default to `cp -pR'.
19769     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
19770       as_ln_s='cp -pR'
19771   elif ln conf$$.file conf$$ 2>/dev/null; then
19772     as_ln_s=ln
19773   else
19774     as_ln_s='cp -pR'
19775   fi
19776 else
19777   as_ln_s='cp -pR'
19778 fi
19779 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
19780 rmdir conf$$.dir 2>/dev/null
19781
19782
19783 # as_fn_mkdir_p
19784 # -------------
19785 # Create "$as_dir" as a directory, including parents if necessary.
19786 as_fn_mkdir_p ()
19787 {
19788
19789   case $as_dir in #(
19790   -*) as_dir=./$as_dir;;
19791   esac
19792   test -d "$as_dir" || eval $as_mkdir_p || {
19793     as_dirs=
19794     while :; do
19795       case $as_dir in #(
19796       *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
19797       *) as_qdir=$as_dir;;
19798       esac
19799       as_dirs="'$as_qdir' $as_dirs"
19800       as_dir=`$as_dirname -- "$as_dir" ||
19801 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19802          X"$as_dir" : 'X\(//\)[^/]' \| \
19803          X"$as_dir" : 'X\(//\)$' \| \
19804          X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
19805 $as_echo X"$as_dir" |
19806     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
19807             s//\1/
19808             q
19809           }
19810           /^X\(\/\/\)[^/].*/{
19811             s//\1/
19812             q
19813           }
19814           /^X\(\/\/\)$/{
19815             s//\1/
19816             q
19817           }
19818           /^X\(\/\).*/{
19819             s//\1/
19820             q
19821           }
19822           s/.*/./; q'`
19823       test -d "$as_dir" && break
19824     done
19825     test -z "$as_dirs" || eval "mkdir $as_dirs"
19826   } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
19827
19828
19829 } # as_fn_mkdir_p
19830 if mkdir -p . 2>/dev/null; then
19831   as_mkdir_p='mkdir -p "$as_dir"'
19832 else
19833   test -d ./-p && rmdir ./-p
19834   as_mkdir_p=false
19835 fi
19836
19837
19838 # as_fn_executable_p FILE
19839 # -----------------------
19840 # Test if FILE is an executable regular file.
19841 as_fn_executable_p ()
19842 {
19843   test -f "$1" && test -x "$1"
19844 } # as_fn_executable_p
19845 as_test_x='test -x'
19846 as_executable_p=as_fn_executable_p
19847
19848 # Sed expression to map a string onto a valid CPP name.
19849 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
19850
19851 # Sed expression to map a string onto a valid variable name.
19852 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
19853
19854
19855 exec 6>&1
19856 ## ----------------------------------- ##
19857 ## Main body of $CONFIG_STATUS script. ##
19858 ## ----------------------------------- ##
19859 _ASEOF
19860 test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
19861
19862 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19863 # Save the log message, to keep $0 and so on meaningful, and to
19864 # report actual input values of CONFIG_FILES etc. instead of their
19865 # values after options handling.
19866 ac_log="
19867 This file was extended by PostgreSQL $as_me 12devel, which was
19868 generated by GNU Autoconf 2.69.  Invocation command line was
19869
19870   CONFIG_FILES    = $CONFIG_FILES
19871   CONFIG_HEADERS  = $CONFIG_HEADERS
19872   CONFIG_LINKS    = $CONFIG_LINKS
19873   CONFIG_COMMANDS = $CONFIG_COMMANDS
19874   $ $0 $@
19875
19876 on `(hostname || uname -n) 2>/dev/null | sed 1q`
19877 "
19878
19879 _ACEOF
19880
19881 case $ac_config_files in *"
19882 "*) set x $ac_config_files; shift; ac_config_files=$*;;
19883 esac
19884
19885 case $ac_config_headers in *"
19886 "*) set x $ac_config_headers; shift; ac_config_headers=$*;;
19887 esac
19888
19889
19890 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19891 # Files that config.status was made for.
19892 config_files="$ac_config_files"
19893 config_headers="$ac_config_headers"
19894 config_links="$ac_config_links"
19895 config_commands="$ac_config_commands"
19896
19897 _ACEOF
19898
19899 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19900 ac_cs_usage="\
19901 \`$as_me' instantiates files and other configuration actions
19902 from templates according to the current configuration.  Unless the files
19903 and actions are specified as TAGs, all are instantiated by default.
19904
19905 Usage: $0 [OPTION]... [TAG]...
19906
19907   -h, --help       print this help, then exit
19908   -V, --version    print version number and configuration settings, then exit
19909       --config     print configuration, then exit
19910   -q, --quiet, --silent
19911                    do not print progress messages
19912   -d, --debug      don't remove temporary files
19913       --recheck    update $as_me by reconfiguring in the same conditions
19914       --file=FILE[:TEMPLATE]
19915                    instantiate the configuration file FILE
19916       --header=FILE[:TEMPLATE]
19917                    instantiate the configuration header FILE
19918
19919 Configuration files:
19920 $config_files
19921
19922 Configuration headers:
19923 $config_headers
19924
19925 Configuration links:
19926 $config_links
19927
19928 Configuration commands:
19929 $config_commands
19930
19931 Report bugs to <pgsql-bugs@lists.postgresql.org>."
19932
19933 _ACEOF
19934 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19935 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
19936 ac_cs_version="\\
19937 PostgreSQL config.status 12devel
19938 configured by $0, generated by GNU Autoconf 2.69,
19939   with options \\"\$ac_cs_config\\"
19940
19941 Copyright (C) 2012 Free Software Foundation, Inc.
19942 This config.status script is free software; the Free Software Foundation
19943 gives unlimited permission to copy, distribute and modify it."
19944
19945 ac_pwd='$ac_pwd'
19946 srcdir='$srcdir'
19947 INSTALL='$INSTALL'
19948 MKDIR_P='$MKDIR_P'
19949 AWK='$AWK'
19950 test -n "\$AWK" || AWK=awk
19951 _ACEOF
19952
19953 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19954 # The default lists apply if the user does not specify any file.
19955 ac_need_defaults=:
19956 while test $# != 0
19957 do
19958   case $1 in
19959   --*=?*)
19960     ac_option=`expr "X$1" : 'X\([^=]*\)='`
19961     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
19962     ac_shift=:
19963     ;;
19964   --*=)
19965     ac_option=`expr "X$1" : 'X\([^=]*\)='`
19966     ac_optarg=
19967     ac_shift=:
19968     ;;
19969   *)
19970     ac_option=$1
19971     ac_optarg=$2
19972     ac_shift=shift
19973     ;;
19974   esac
19975
19976   case $ac_option in
19977   # Handling of the options.
19978   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
19979     ac_cs_recheck=: ;;
19980   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
19981     $as_echo "$ac_cs_version"; exit ;;
19982   --config | --confi | --conf | --con | --co | --c )
19983     $as_echo "$ac_cs_config"; exit ;;
19984   --debug | --debu | --deb | --de | --d | -d )
19985     debug=: ;;
19986   --file | --fil | --fi | --f )
19987     $ac_shift
19988     case $ac_optarg in
19989     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
19990     '') as_fn_error $? "missing file argument" ;;
19991     esac
19992     as_fn_append CONFIG_FILES " '$ac_optarg'"
19993     ac_need_defaults=false;;
19994   --header | --heade | --head | --hea )
19995     $ac_shift
19996     case $ac_optarg in
19997     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
19998     esac
19999     as_fn_append CONFIG_HEADERS " '$ac_optarg'"
20000     ac_need_defaults=false;;
20001   --he | --h)
20002     # Conflict between --help and --header
20003     as_fn_error $? "ambiguous option: \`$1'
20004 Try \`$0 --help' for more information.";;
20005   --help | --hel | -h )
20006     $as_echo "$ac_cs_usage"; exit ;;
20007   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
20008   | -silent | --silent | --silen | --sile | --sil | --si | --s)
20009     ac_cs_silent=: ;;
20010
20011   # This is an error.
20012   -*) as_fn_error $? "unrecognized option: \`$1'
20013 Try \`$0 --help' for more information." ;;
20014
20015   *) as_fn_append ac_config_targets " $1"
20016      ac_need_defaults=false ;;
20017
20018   esac
20019   shift
20020 done
20021
20022 ac_configure_extra_args=
20023
20024 if $ac_cs_silent; then
20025   exec 6>/dev/null
20026   ac_configure_extra_args="$ac_configure_extra_args --silent"
20027 fi
20028
20029 _ACEOF
20030 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
20031 if \$ac_cs_recheck; then
20032   set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
20033   shift
20034   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
20035   CONFIG_SHELL='$SHELL'
20036   export CONFIG_SHELL
20037   exec "\$@"
20038 fi
20039
20040 _ACEOF
20041 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
20042 exec 5>>config.log
20043 {
20044   echo
20045   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
20046 ## Running $as_me. ##
20047 _ASBOX
20048   $as_echo "$ac_log"
20049 } >&5
20050
20051 _ACEOF
20052 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
20053 _ACEOF
20054
20055 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
20056
20057 # Handling of arguments.
20058 for ac_config_target in $ac_config_targets
20059 do
20060   case $ac_config_target in
20061     "src/backend/port/tas.s") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/tas.s:src/backend/port/tas/${tas_file}" ;;
20062     "GNUmakefile") CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;;
20063     "src/Makefile.global") CONFIG_FILES="$CONFIG_FILES src/Makefile.global" ;;
20064     "src/backend/port/pg_sema.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}" ;;
20065     "src/backend/port/pg_shmem.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}" ;;
20066     "src/include/pg_config_os.h") CONFIG_LINKS="$CONFIG_LINKS src/include/pg_config_os.h:src/include/port/${template}.h" ;;
20067     "src/Makefile.port") CONFIG_LINKS="$CONFIG_LINKS src/Makefile.port:src/makefiles/Makefile.${template}" ;;
20068     "check_win32_symlinks") CONFIG_COMMANDS="$CONFIG_COMMANDS check_win32_symlinks" ;;
20069     "src/include/pg_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config.h" ;;
20070     "src/include/pg_config_ext.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config_ext.h" ;;
20071     "src/interfaces/ecpg/include/ecpg_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/interfaces/ecpg/include/ecpg_config.h" ;;
20072
20073   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
20074   esac
20075 done
20076
20077
20078 # If the user did not use the arguments to specify the items to instantiate,
20079 # then the envvar interface is used.  Set only those that are not.
20080 # We use the long form for the default assignment because of an extremely
20081 # bizarre bug on SunOS 4.1.3.
20082 if $ac_need_defaults; then
20083   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
20084   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
20085   test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
20086   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
20087 fi
20088
20089 # Have a temporary directory for convenience.  Make it in the build tree
20090 # simply because there is no reason against having it here, and in addition,
20091 # creating and moving files from /tmp can sometimes cause problems.
20092 # Hook for its removal unless debugging.
20093 # Note that there is a small window in which the directory will not be cleaned:
20094 # after its creation but before its name has been assigned to `$tmp'.
20095 $debug ||
20096 {
20097   tmp= ac_tmp=
20098   trap 'exit_status=$?
20099   : "${ac_tmp:=$tmp}"
20100   { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
20101 ' 0
20102   trap 'as_fn_exit 1' 1 2 13 15
20103 }
20104 # Create a (secure) tmp directory for tmp files.
20105
20106 {
20107   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
20108   test -d "$tmp"
20109 }  ||
20110 {
20111   tmp=./conf$$-$RANDOM
20112   (umask 077 && mkdir "$tmp")
20113 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
20114 ac_tmp=$tmp
20115
20116 # Set up the scripts for CONFIG_FILES section.
20117 # No need to generate them if there are no CONFIG_FILES.
20118 # This happens for instance with `./config.status config.h'.
20119 if test -n "$CONFIG_FILES"; then
20120
20121
20122 ac_cr=`echo X | tr X '\015'`
20123 # On cygwin, bash can eat \r inside `` if the user requested igncr.
20124 # But we know of no other shell where ac_cr would be empty at this
20125 # point, so we can use a bashism as a fallback.
20126 if test "x$ac_cr" = x; then
20127   eval ac_cr=\$\'\\r\'
20128 fi
20129 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
20130 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
20131   ac_cs_awk_cr='\\r'
20132 else
20133   ac_cs_awk_cr=$ac_cr
20134 fi
20135
20136 echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
20137 _ACEOF
20138
20139
20140 {
20141   echo "cat >conf$$subs.awk <<_ACEOF" &&
20142   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
20143   echo "_ACEOF"
20144 } >conf$$subs.sh ||
20145   as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
20146 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
20147 ac_delim='%!_!# '
20148 for ac_last_try in false false false false false :; do
20149   . ./conf$$subs.sh ||
20150     as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
20151
20152   ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
20153   if test $ac_delim_n = $ac_delim_num; then
20154     break
20155   elif $ac_last_try; then
20156     as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
20157   else
20158     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
20159   fi
20160 done
20161 rm -f conf$$subs.sh
20162
20163 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
20164 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
20165 _ACEOF
20166 sed -n '
20167 h
20168 s/^/S["/; s/!.*/"]=/
20169 p
20170 g
20171 s/^[^!]*!//
20172 :repl
20173 t repl
20174 s/'"$ac_delim"'$//
20175 t delim
20176 :nl
20177 h
20178 s/\(.\{148\}\)..*/\1/
20179 t more1
20180 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
20181 p
20182 n
20183 b repl
20184 :more1
20185 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
20186 p
20187 g
20188 s/.\{148\}//
20189 t nl
20190 :delim
20191 h
20192 s/\(.\{148\}\)..*/\1/
20193 t more2
20194 s/["\\]/\\&/g; s/^/"/; s/$/"/
20195 p
20196 b
20197 :more2
20198 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
20199 p
20200 g
20201 s/.\{148\}//
20202 t delim
20203 ' <conf$$subs.awk | sed '
20204 /^[^""]/{
20205   N
20206   s/\n//
20207 }
20208 ' >>$CONFIG_STATUS || ac_write_fail=1
20209 rm -f conf$$subs.awk
20210 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
20211 _ACAWK
20212 cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
20213   for (key in S) S_is_set[key] = 1
20214   FS = "\a"
20215
20216 }
20217 {
20218   line = $ 0
20219   nfields = split(line, field, "@")
20220   substed = 0
20221   len = length(field[1])
20222   for (i = 2; i < nfields; i++) {
20223     key = field[i]
20224     keylen = length(key)
20225     if (S_is_set[key]) {
20226       value = S[key]
20227       line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
20228       len += length(value) + length(field[++i])
20229       substed = 1
20230     } else
20231       len += 1 + keylen
20232   }
20233
20234   print line
20235 }
20236
20237 _ACAWK
20238 _ACEOF
20239 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
20240 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
20241   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
20242 else
20243   cat
20244 fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
20245   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
20246 _ACEOF
20247
20248 # VPATH may cause trouble with some makes, so we remove sole $(srcdir),
20249 # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
20250 # trailing colons and then remove the whole line if VPATH becomes empty
20251 # (actually we leave an empty line to preserve line numbers).
20252 if test "x$srcdir" = x.; then
20253   ac_vpsub='/^[  ]*VPATH[        ]*=[    ]*/{
20254 h
20255 s///
20256 s/^/:/
20257 s/[      ]*$/:/
20258 s/:\$(srcdir):/:/g
20259 s/:\${srcdir}:/:/g
20260 s/:@srcdir@:/:/g
20261 s/^:*//
20262 s/:*$//
20263 x
20264 s/\(=[   ]*\).*/\1/
20265 G
20266 s/\n//
20267 s/^[^=]*=[       ]*$//
20268 }'
20269 fi
20270
20271 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
20272 fi # test -n "$CONFIG_FILES"
20273
20274 # Set up the scripts for CONFIG_HEADERS section.
20275 # No need to generate them if there are no CONFIG_HEADERS.
20276 # This happens for instance with `./config.status Makefile'.
20277 if test -n "$CONFIG_HEADERS"; then
20278 cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
20279 BEGIN {
20280 _ACEOF
20281
20282 # Transform confdefs.h into an awk script `defines.awk', embedded as
20283 # here-document in config.status, that substitutes the proper values into
20284 # config.h.in to produce config.h.
20285
20286 # Create a delimiter string that does not exist in confdefs.h, to ease
20287 # handling of long lines.
20288 ac_delim='%!_!# '
20289 for ac_last_try in false false :; do
20290   ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
20291   if test -z "$ac_tt"; then
20292     break
20293   elif $ac_last_try; then
20294     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
20295   else
20296     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
20297   fi
20298 done
20299
20300 # For the awk script, D is an array of macro values keyed by name,
20301 # likewise P contains macro parameters if any.  Preserve backslash
20302 # newline sequences.
20303
20304 ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
20305 sed -n '
20306 s/.\{148\}/&'"$ac_delim"'/g
20307 t rset
20308 :rset
20309 s/^[     ]*#[    ]*define[       ][      ]*/ /
20310 t def
20311 d
20312 :def
20313 s/\\$//
20314 t bsnl
20315 s/["\\]/\\&/g
20316 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
20317 D["\1"]=" \3"/p
20318 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2"/p
20319 d
20320 :bsnl
20321 s/["\\]/\\&/g
20322 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
20323 D["\1"]=" \3\\\\\\n"\\/p
20324 t cont
20325 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
20326 t cont
20327 d
20328 :cont
20329 n
20330 s/.\{148\}/&'"$ac_delim"'/g
20331 t clear
20332 :clear
20333 s/\\$//
20334 t bsnlc
20335 s/["\\]/\\&/g; s/^/"/; s/$/"/p
20336 d
20337 :bsnlc
20338 s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
20339 b cont
20340 ' <confdefs.h | sed '
20341 s/'"$ac_delim"'/"\\\
20342 "/g' >>$CONFIG_STATUS || ac_write_fail=1
20343
20344 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
20345   for (key in D) D_is_set[key] = 1
20346   FS = "\a"
20347 }
20348 /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
20349   line = \$ 0
20350   split(line, arg, " ")
20351   if (arg[1] == "#") {
20352     defundef = arg[2]
20353     mac1 = arg[3]
20354   } else {
20355     defundef = substr(arg[1], 2)
20356     mac1 = arg[2]
20357   }
20358   split(mac1, mac2, "(") #)
20359   macro = mac2[1]
20360   prefix = substr(line, 1, index(line, defundef) - 1)
20361   if (D_is_set[macro]) {
20362     # Preserve the white space surrounding the "#".
20363     print prefix "define", macro P[macro] D[macro]
20364     next
20365   } else {
20366     # Replace #undef with comments.  This is necessary, for example,
20367     # in the case of _POSIX_SOURCE, which is predefined and required
20368     # on some systems where configure will not decide to define it.
20369     if (defundef == "undef") {
20370       print "/*", prefix defundef, macro, "*/"
20371       next
20372     }
20373   }
20374 }
20375 { print }
20376 _ACAWK
20377 _ACEOF
20378 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
20379   as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
20380 fi # test -n "$CONFIG_HEADERS"
20381
20382
20383 eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS  :L $CONFIG_LINKS  :C $CONFIG_COMMANDS"
20384 shift
20385 for ac_tag
20386 do
20387   case $ac_tag in
20388   :[FHLC]) ac_mode=$ac_tag; continue;;
20389   esac
20390   case $ac_mode$ac_tag in
20391   :[FHL]*:*);;
20392   :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
20393   :[FH]-) ac_tag=-:-;;
20394   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
20395   esac
20396   ac_save_IFS=$IFS
20397   IFS=:
20398   set x $ac_tag
20399   IFS=$ac_save_IFS
20400   shift
20401   ac_file=$1
20402   shift
20403
20404   case $ac_mode in
20405   :L) ac_source=$1;;
20406   :[FH])
20407     ac_file_inputs=
20408     for ac_f
20409     do
20410       case $ac_f in
20411       -) ac_f="$ac_tmp/stdin";;
20412       *) # Look for the file first in the build tree, then in the source tree
20413          # (if the path is not absolute).  The absolute path cannot be DOS-style,
20414          # because $ac_f cannot contain `:'.
20415          test -f "$ac_f" ||
20416            case $ac_f in
20417            [\\/$]*) false;;
20418            *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
20419            esac ||
20420            as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
20421       esac
20422       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
20423       as_fn_append ac_file_inputs " '$ac_f'"
20424     done
20425
20426     # Let's still pretend it is `configure' which instantiates (i.e., don't
20427     # use $as_me), people would be surprised to read:
20428     #    /* config.h.  Generated by config.status.  */
20429     configure_input='Generated from '`
20430           $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
20431         `' by configure.'
20432     if test x"$ac_file" != x-; then
20433       configure_input="$ac_file.  $configure_input"
20434       { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
20435 $as_echo "$as_me: creating $ac_file" >&6;}
20436     fi
20437     # Neutralize special characters interpreted by sed in replacement strings.
20438     case $configure_input in #(
20439     *\&* | *\|* | *\\* )
20440        ac_sed_conf_input=`$as_echo "$configure_input" |
20441        sed 's/[\\\\&|]/\\\\&/g'`;; #(
20442     *) ac_sed_conf_input=$configure_input;;
20443     esac
20444
20445     case $ac_tag in
20446     *:-:* | *:-) cat >"$ac_tmp/stdin" \
20447       || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
20448     esac
20449     ;;
20450   esac
20451
20452   ac_dir=`$as_dirname -- "$ac_file" ||
20453 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20454          X"$ac_file" : 'X\(//\)[^/]' \| \
20455          X"$ac_file" : 'X\(//\)$' \| \
20456          X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
20457 $as_echo X"$ac_file" |
20458     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
20459             s//\1/
20460             q
20461           }
20462           /^X\(\/\/\)[^/].*/{
20463             s//\1/
20464             q
20465           }
20466           /^X\(\/\/\)$/{
20467             s//\1/
20468             q
20469           }
20470           /^X\(\/\).*/{
20471             s//\1/
20472             q
20473           }
20474           s/.*/./; q'`
20475   as_dir="$ac_dir"; as_fn_mkdir_p
20476   ac_builddir=.
20477
20478 case "$ac_dir" in
20479 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
20480 *)
20481   ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
20482   # A ".." for each directory in $ac_dir_suffix.
20483   ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
20484   case $ac_top_builddir_sub in
20485   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
20486   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
20487   esac ;;
20488 esac
20489 ac_abs_top_builddir=$ac_pwd
20490 ac_abs_builddir=$ac_pwd$ac_dir_suffix
20491 # for backward compatibility:
20492 ac_top_builddir=$ac_top_build_prefix
20493
20494 case $srcdir in
20495   .)  # We are building in place.
20496     ac_srcdir=.
20497     ac_top_srcdir=$ac_top_builddir_sub
20498     ac_abs_top_srcdir=$ac_pwd ;;
20499   [\\/]* | ?:[\\/]* )  # Absolute name.
20500     ac_srcdir=$srcdir$ac_dir_suffix;
20501     ac_top_srcdir=$srcdir
20502     ac_abs_top_srcdir=$srcdir ;;
20503   *) # Relative name.
20504     ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
20505     ac_top_srcdir=$ac_top_build_prefix$srcdir
20506     ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
20507 esac
20508 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
20509
20510
20511   case $ac_mode in
20512   :F)
20513   #
20514   # CONFIG_FILE
20515   #
20516
20517   case $INSTALL in
20518   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
20519   *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
20520   esac
20521   ac_MKDIR_P=$MKDIR_P
20522   case $MKDIR_P in
20523   [\\/$]* | ?:[\\/]* ) ;;
20524   */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
20525   esac
20526 _ACEOF
20527
20528 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
20529 # If the template does not know about datarootdir, expand it.
20530 # FIXME: This hack should be removed a few years after 2.60.
20531 ac_datarootdir_hack=; ac_datarootdir_seen=
20532 ac_sed_dataroot='
20533 /datarootdir/ {
20534   p
20535   q
20536 }
20537 /@datadir@/p
20538 /@docdir@/p
20539 /@infodir@/p
20540 /@localedir@/p
20541 /@mandir@/p'
20542 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
20543 *datarootdir*) ac_datarootdir_seen=yes;;
20544 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
20545   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
20546 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
20547 _ACEOF
20548 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
20549   ac_datarootdir_hack='
20550   s&@datadir@&$datadir&g
20551   s&@docdir@&$docdir&g
20552   s&@infodir@&$infodir&g
20553   s&@localedir@&$localedir&g
20554   s&@mandir@&$mandir&g
20555   s&\\\${datarootdir}&$datarootdir&g' ;;
20556 esac
20557 _ACEOF
20558
20559 # Neutralize VPATH when `$srcdir' = `.'.
20560 # Shell code in configure.ac might set extrasub.
20561 # FIXME: do we really want to maintain this feature?
20562 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
20563 ac_sed_extra="$ac_vpsub
20564 $extrasub
20565 _ACEOF
20566 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
20567 :t
20568 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
20569 s|@configure_input@|$ac_sed_conf_input|;t t
20570 s&@top_builddir@&$ac_top_builddir_sub&;t t
20571 s&@top_build_prefix@&$ac_top_build_prefix&;t t
20572 s&@srcdir@&$ac_srcdir&;t t
20573 s&@abs_srcdir@&$ac_abs_srcdir&;t t
20574 s&@top_srcdir@&$ac_top_srcdir&;t t
20575 s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
20576 s&@builddir@&$ac_builddir&;t t
20577 s&@abs_builddir@&$ac_abs_builddir&;t t
20578 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
20579 s&@INSTALL@&$ac_INSTALL&;t t
20580 s&@MKDIR_P@&$ac_MKDIR_P&;t t
20581 $ac_datarootdir_hack
20582 "
20583 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
20584   >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
20585
20586 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
20587   { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
20588   { ac_out=`sed -n '/^[  ]*datarootdir[  ]*:*=/p' \
20589       "$ac_tmp/out"`; test -z "$ac_out"; } &&
20590   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
20591 which seems to be undefined.  Please make sure it is defined" >&5
20592 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
20593 which seems to be undefined.  Please make sure it is defined" >&2;}
20594
20595   rm -f "$ac_tmp/stdin"
20596   case $ac_file in
20597   -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
20598   *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
20599   esac \
20600   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
20601  ;;
20602   :H)
20603   #
20604   # CONFIG_HEADER
20605   #
20606   if test x"$ac_file" != x-; then
20607     {
20608       $as_echo "/* $configure_input  */" \
20609       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
20610     } >"$ac_tmp/config.h" \
20611       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
20612     if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
20613       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
20614 $as_echo "$as_me: $ac_file is unchanged" >&6;}
20615     else
20616       rm -f "$ac_file"
20617       mv "$ac_tmp/config.h" "$ac_file" \
20618         || as_fn_error $? "could not create $ac_file" "$LINENO" 5
20619     fi
20620   else
20621     $as_echo "/* $configure_input  */" \
20622       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
20623       || as_fn_error $? "could not create -" "$LINENO" 5
20624   fi
20625  ;;
20626   :L)
20627   #
20628   # CONFIG_LINK
20629   #
20630
20631   if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
20632     :
20633   else
20634     # Prefer the file from the source tree if names are identical.
20635     if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
20636       ac_source=$srcdir/$ac_source
20637     fi
20638
20639     { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
20640 $as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
20641
20642     if test ! -r "$ac_source"; then
20643       as_fn_error $? "$ac_source: file not found" "$LINENO" 5
20644     fi
20645     rm -f "$ac_file"
20646
20647     # Try a relative symlink, then a hard link, then a copy.
20648     case $ac_source in
20649     [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
20650         *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
20651     esac
20652     ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
20653       ln "$ac_source" "$ac_file" 2>/dev/null ||
20654       cp -p "$ac_source" "$ac_file" ||
20655       as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
20656   fi
20657  ;;
20658   :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
20659 $as_echo "$as_me: executing $ac_file commands" >&6;}
20660  ;;
20661   esac
20662
20663
20664   case $ac_file$ac_mode in
20665     "check_win32_symlinks":C)
20666 # Links sometimes fail undetected on Mingw -
20667 # so here we detect it and warn the user
20668 for FILE in $CONFIG_LINKS
20669  do
20670         # test -e works for symlinks in the MinGW console
20671         test -e `expr "$FILE" : '\([^:]*\)'` || { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** link for $FILE -- please fix by hand" >&5
20672 $as_echo "$as_me: WARNING: *** link for $FILE -- please fix by hand" >&2;}
20673  done
20674  ;;
20675     "src/include/pg_config.h":H)
20676 # Update timestamp for pg_config.h (see Makefile.global)
20677 echo >src/include/stamp-h
20678  ;;
20679     "src/include/pg_config_ext.h":H)
20680 # Update timestamp for pg_config_ext.h (see Makefile.global)
20681 echo >src/include/stamp-ext-h
20682  ;;
20683     "src/interfaces/ecpg/include/ecpg_config.h":H) echo >src/interfaces/ecpg/include/stamp-h ;;
20684
20685   esac
20686 done # for ac_tag
20687
20688
20689 as_fn_exit 0
20690 _ACEOF
20691 ac_clean_files=$ac_clean_files_save
20692
20693 test $ac_write_fail = 0 ||
20694   as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
20695
20696
20697 # configure is writing to config.log, and then calls config.status.
20698 # config.status does its own redirection, appending to config.log.
20699 # Unfortunately, on DOS this fails, as config.log is still kept open
20700 # by configure, so config.status won't be able to write to it; its
20701 # output is simply discarded.  So we exec the FD to /dev/null,
20702 # effectively closing config.log, so it can be properly (re)opened and
20703 # appended to by config.status.  When coming back to configure, we
20704 # need to make the FD available again.
20705 if test "$no_create" != yes; then
20706   ac_cs_success=:
20707   ac_config_status_args=
20708   test "$silent" = yes &&
20709     ac_config_status_args="$ac_config_status_args --quiet"
20710   exec 5>/dev/null
20711   $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
20712   exec 5>>config.log
20713   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
20714   # would make configure fail if this is the last instruction.
20715   $ac_cs_success || as_fn_exit 1
20716 fi
20717 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
20718   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
20719 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
20720 fi
20721