]> granicus.if.org Git - postgresql/blob - configure
Fix typo in BITCODE_CXXFLAGS assignment.
[postgresql] / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by GNU Autoconf 2.69 for PostgreSQL 11devel.
4 #
5 # Report bugs to <pgsql-bugs@postgresql.org>.
6 #
7 #
8 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
9 #
10 #
11 # This configure script is free software; the Free Software Foundation
12 # gives unlimited permission to copy, distribute and modify it.
13 #
14 # Copyright (c) 1996-2018, PostgreSQL Global Development Group
15 ## -------------------- ##
16 ## M4sh Initialization. ##
17 ## -------------------- ##
18
19 # Be more Bourne compatible
20 DUALCASE=1; export DUALCASE # for MKS sh
21 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
22   emulate sh
23   NULLCMD=:
24   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
25   # is contrary to our usage.  Disable this feature.
26   alias -g '${1+"$@"}'='"$@"'
27   setopt NO_GLOB_SUBST
28 else
29   case `(set -o) 2>/dev/null` in #(
30   *posix*) :
31     set -o posix ;; #(
32   *) :
33      ;;
34 esac
35 fi
36
37
38 as_nl='
39 '
40 export as_nl
41 # Printing a long string crashes Solaris 7 /usr/bin/printf.
42 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
43 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
44 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
45 # Prefer a ksh shell builtin over an external printf program on Solaris,
46 # but without wasting forks for bash or zsh.
47 if test -z "$BASH_VERSION$ZSH_VERSION" \
48     && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
49   as_echo='print -r --'
50   as_echo_n='print -rn --'
51 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
52   as_echo='printf %s\n'
53   as_echo_n='printf %s'
54 else
55   if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
56     as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
57     as_echo_n='/usr/ucb/echo -n'
58   else
59     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
60     as_echo_n_body='eval
61       arg=$1;
62       case $arg in #(
63       *"$as_nl"*)
64         expr "X$arg" : "X\\(.*\\)$as_nl";
65         arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
66       esac;
67       expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
68     '
69     export as_echo_n_body
70     as_echo_n='sh -c $as_echo_n_body as_echo'
71   fi
72   export as_echo_body
73   as_echo='sh -c $as_echo_body as_echo'
74 fi
75
76 # The user is always right.
77 if test "${PATH_SEPARATOR+set}" != set; then
78   PATH_SEPARATOR=:
79   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
80     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
81       PATH_SEPARATOR=';'
82   }
83 fi
84
85
86 # IFS
87 # We need space, tab and new line, in precisely that order.  Quoting is
88 # there to prevent editors from complaining about space-tab.
89 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
90 # splitting by setting IFS to empty value.)
91 IFS=" ""        $as_nl"
92
93 # Find who we are.  Look in the path if we contain no directory separator.
94 as_myself=
95 case $0 in #((
96   *[\\/]* ) as_myself=$0 ;;
97   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
98 for as_dir in $PATH
99 do
100   IFS=$as_save_IFS
101   test -z "$as_dir" && as_dir=.
102     test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
103   done
104 IFS=$as_save_IFS
105
106      ;;
107 esac
108 # We did not find ourselves, most probably we were run as `sh COMMAND'
109 # in which case we are not to be found in the path.
110 if test "x$as_myself" = x; then
111   as_myself=$0
112 fi
113 if test ! -f "$as_myself"; then
114   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
115   exit 1
116 fi
117
118 # Unset variables that we do not need and which cause bugs (e.g. in
119 # pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
120 # suppresses any "Segmentation fault" message there.  '((' could
121 # trigger a bug in pdksh 5.2.14.
122 for as_var in BASH_ENV ENV MAIL MAILPATH
123 do eval test x\${$as_var+set} = xset \
124   && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
125 done
126 PS1='$ '
127 PS2='> '
128 PS4='+ '
129
130 # NLS nuisances.
131 LC_ALL=C
132 export LC_ALL
133 LANGUAGE=C
134 export LANGUAGE
135
136 # CDPATH.
137 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
138
139 # Use a proper internal environment variable to ensure we don't fall
140   # into an infinite loop, continuously re-executing ourselves.
141   if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
142     _as_can_reexec=no; export _as_can_reexec;
143     # We cannot yet assume a decent shell, so we have to provide a
144 # neutralization value for shells without unset; and this also
145 # works around shells that cannot unset nonexistent variables.
146 # Preserve -v and -x to the replacement shell.
147 BASH_ENV=/dev/null
148 ENV=/dev/null
149 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
150 case $- in # ((((
151   *v*x* | *x*v* ) as_opts=-vx ;;
152   *v* ) as_opts=-v ;;
153   *x* ) as_opts=-x ;;
154   * ) as_opts= ;;
155 esac
156 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
157 # Admittedly, this is quite paranoid, since all the known shells bail
158 # out after a failed `exec'.
159 $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
160 as_fn_exit 255
161   fi
162   # We don't want this to propagate to other subprocesses.
163           { _as_can_reexec=; unset _as_can_reexec;}
164 if test "x$CONFIG_SHELL" = x; then
165   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
166   emulate sh
167   NULLCMD=:
168   # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
169   # is contrary to our usage.  Disable this feature.
170   alias -g '\${1+\"\$@\"}'='\"\$@\"'
171   setopt NO_GLOB_SUBST
172 else
173   case \`(set -o) 2>/dev/null\` in #(
174   *posix*) :
175     set -o posix ;; #(
176   *) :
177      ;;
178 esac
179 fi
180 "
181   as_required="as_fn_return () { (exit \$1); }
182 as_fn_success () { as_fn_return 0; }
183 as_fn_failure () { as_fn_return 1; }
184 as_fn_ret_success () { return 0; }
185 as_fn_ret_failure () { return 1; }
186
187 exitcode=0
188 as_fn_success || { exitcode=1; echo as_fn_success failed.; }
189 as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
190 as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
191 as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
192 if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
193
194 else
195   exitcode=1; echo positional parameters were not saved.
196 fi
197 test x\$exitcode = x0 || exit 1
198 test -x / || exit 1"
199   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
200   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
201   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
202   test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
203 test \$(( 1 + 1 )) = 2 || exit 1"
204   if (eval "$as_required") 2>/dev/null; then :
205   as_have_required=yes
206 else
207   as_have_required=no
208 fi
209   if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
210
211 else
212   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
213 as_found=false
214 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
215 do
216   IFS=$as_save_IFS
217   test -z "$as_dir" && as_dir=.
218   as_found=:
219   case $as_dir in #(
220          /*)
221            for as_base in sh bash ksh sh5; do
222              # Try only shells that exist, to save several forks.
223              as_shell=$as_dir/$as_base
224              if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
225                     { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
226   CONFIG_SHELL=$as_shell as_have_required=yes
227                    if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
228   break 2
229 fi
230 fi
231            done;;
232        esac
233   as_found=false
234 done
235 $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
236               { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
237   CONFIG_SHELL=$SHELL as_have_required=yes
238 fi; }
239 IFS=$as_save_IFS
240
241
242       if test "x$CONFIG_SHELL" != x; then :
243   export CONFIG_SHELL
244              # We cannot yet assume a decent shell, so we have to provide a
245 # neutralization value for shells without unset; and this also
246 # works around shells that cannot unset nonexistent variables.
247 # Preserve -v and -x to the replacement shell.
248 BASH_ENV=/dev/null
249 ENV=/dev/null
250 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
251 case $- in # ((((
252   *v*x* | *x*v* ) as_opts=-vx ;;
253   *v* ) as_opts=-v ;;
254   *x* ) as_opts=-x ;;
255   * ) as_opts= ;;
256 esac
257 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
258 # Admittedly, this is quite paranoid, since all the known shells bail
259 # out after a failed `exec'.
260 $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
261 exit 255
262 fi
263
264     if test x$as_have_required = xno; then :
265   $as_echo "$0: This script requires a shell more modern than all"
266   $as_echo "$0: the shells that I found on your system."
267   if test x${ZSH_VERSION+set} = xset ; then
268     $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
269     $as_echo "$0: be upgraded to zsh 4.3.4 or later."
270   else
271     $as_echo "$0: Please tell bug-autoconf@gnu.org and
272 $0: pgsql-bugs@postgresql.org about your system, including
273 $0: any error possibly output before this message. Then
274 $0: install a modern shell, or manually run the script
275 $0: under such a shell if you do have one."
276   fi
277   exit 1
278 fi
279 fi
280 fi
281 SHELL=${CONFIG_SHELL-/bin/sh}
282 export SHELL
283 # Unset more variables known to interfere with behavior of common tools.
284 CLICOLOR_FORCE= GREP_OPTIONS=
285 unset CLICOLOR_FORCE GREP_OPTIONS
286
287 ## --------------------- ##
288 ## M4sh Shell Functions. ##
289 ## --------------------- ##
290 # as_fn_unset VAR
291 # ---------------
292 # Portably unset VAR.
293 as_fn_unset ()
294 {
295   { eval $1=; unset $1;}
296 }
297 as_unset=as_fn_unset
298
299 # as_fn_set_status STATUS
300 # -----------------------
301 # Set $? to STATUS, without forking.
302 as_fn_set_status ()
303 {
304   return $1
305 } # as_fn_set_status
306
307 # as_fn_exit STATUS
308 # -----------------
309 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
310 as_fn_exit ()
311 {
312   set +e
313   as_fn_set_status $1
314   exit $1
315 } # as_fn_exit
316
317 # as_fn_mkdir_p
318 # -------------
319 # Create "$as_dir" as a directory, including parents if necessary.
320 as_fn_mkdir_p ()
321 {
322
323   case $as_dir in #(
324   -*) as_dir=./$as_dir;;
325   esac
326   test -d "$as_dir" || eval $as_mkdir_p || {
327     as_dirs=
328     while :; do
329       case $as_dir in #(
330       *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
331       *) as_qdir=$as_dir;;
332       esac
333       as_dirs="'$as_qdir' $as_dirs"
334       as_dir=`$as_dirname -- "$as_dir" ||
335 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
336          X"$as_dir" : 'X\(//\)[^/]' \| \
337          X"$as_dir" : 'X\(//\)$' \| \
338          X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
339 $as_echo X"$as_dir" |
340     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
341             s//\1/
342             q
343           }
344           /^X\(\/\/\)[^/].*/{
345             s//\1/
346             q
347           }
348           /^X\(\/\/\)$/{
349             s//\1/
350             q
351           }
352           /^X\(\/\).*/{
353             s//\1/
354             q
355           }
356           s/.*/./; q'`
357       test -d "$as_dir" && break
358     done
359     test -z "$as_dirs" || eval "mkdir $as_dirs"
360   } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
361
362
363 } # as_fn_mkdir_p
364
365 # as_fn_executable_p FILE
366 # -----------------------
367 # Test if FILE is an executable regular file.
368 as_fn_executable_p ()
369 {
370   test -f "$1" && test -x "$1"
371 } # as_fn_executable_p
372 # as_fn_append VAR VALUE
373 # ----------------------
374 # Append the text in VALUE to the end of the definition contained in VAR. Take
375 # advantage of any shell optimizations that allow amortized linear growth over
376 # repeated appends, instead of the typical quadratic growth present in naive
377 # implementations.
378 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
379   eval 'as_fn_append ()
380   {
381     eval $1+=\$2
382   }'
383 else
384   as_fn_append ()
385   {
386     eval $1=\$$1\$2
387   }
388 fi # as_fn_append
389
390 # as_fn_arith ARG...
391 # ------------------
392 # Perform arithmetic evaluation on the ARGs, and store the result in the
393 # global $as_val. Take advantage of shells that can avoid forks. The arguments
394 # must be portable across $(()) and expr.
395 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
396   eval 'as_fn_arith ()
397   {
398     as_val=$(( $* ))
399   }'
400 else
401   as_fn_arith ()
402   {
403     as_val=`expr "$@" || test $? -eq 1`
404   }
405 fi # as_fn_arith
406
407
408 # as_fn_error STATUS ERROR [LINENO LOG_FD]
409 # ----------------------------------------
410 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
411 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
412 # script with STATUS, using 1 if that was 0.
413 as_fn_error ()
414 {
415   as_status=$1; test $as_status -eq 0 && as_status=1
416   if test "$4"; then
417     as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
418     $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
419   fi
420   $as_echo "$as_me: error: $2" >&2
421   as_fn_exit $as_status
422 } # as_fn_error
423
424 if expr a : '\(a\)' >/dev/null 2>&1 &&
425    test "X`expr 00001 : '.*\(...\)'`" = X001; then
426   as_expr=expr
427 else
428   as_expr=false
429 fi
430
431 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
432   as_basename=basename
433 else
434   as_basename=false
435 fi
436
437 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
438   as_dirname=dirname
439 else
440   as_dirname=false
441 fi
442
443 as_me=`$as_basename -- "$0" ||
444 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
445          X"$0" : 'X\(//\)$' \| \
446          X"$0" : 'X\(/\)' \| . 2>/dev/null ||
447 $as_echo X/"$0" |
448     sed '/^.*\/\([^/][^/]*\)\/*$/{
449             s//\1/
450             q
451           }
452           /^X\/\(\/\/\)$/{
453             s//\1/
454             q
455           }
456           /^X\/\(\/\).*/{
457             s//\1/
458             q
459           }
460           s/.*/./; q'`
461
462 # Avoid depending upon Character Ranges.
463 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
464 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
465 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
466 as_cr_digits='0123456789'
467 as_cr_alnum=$as_cr_Letters$as_cr_digits
468
469
470   as_lineno_1=$LINENO as_lineno_1a=$LINENO
471   as_lineno_2=$LINENO as_lineno_2a=$LINENO
472   eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
473   test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
474   # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
475   sed -n '
476     p
477     /[$]LINENO/=
478   ' <$as_myself |
479     sed '
480       s/[$]LINENO.*/&-/
481       t lineno
482       b
483       :lineno
484       N
485       :loop
486       s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
487       t loop
488       s/-\n.*//
489     ' >$as_me.lineno &&
490   chmod +x "$as_me.lineno" ||
491     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
492
493   # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
494   # already done that, so ensure we don't try to do so again and fall
495   # in an infinite loop.  This has already happened in practice.
496   _as_can_reexec=no; export _as_can_reexec
497   # Don't try to exec as it changes $[0], causing all sort of problems
498   # (the dirname of $[0] is not the place where we might find the
499   # original and so on.  Autoconf is especially sensitive to this).
500   . "./$as_me.lineno"
501   # Exit status is that of the last command.
502   exit
503 }
504
505 ECHO_C= ECHO_N= ECHO_T=
506 case `echo -n x` in #(((((
507 -n*)
508   case `echo 'xy\c'` in
509   *c*) ECHO_T=' ';;     # ECHO_T is single tab character.
510   xy)  ECHO_C='\c';;
511   *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
512        ECHO_T=' ';;
513   esac;;
514 *)
515   ECHO_N='-n';;
516 esac
517
518 rm -f conf$$ conf$$.exe conf$$.file
519 if test -d conf$$.dir; then
520   rm -f conf$$.dir/conf$$.file
521 else
522   rm -f conf$$.dir
523   mkdir conf$$.dir 2>/dev/null
524 fi
525 if (echo >conf$$.file) 2>/dev/null; then
526   if ln -s conf$$.file conf$$ 2>/dev/null; then
527     as_ln_s='ln -s'
528     # ... but there are two gotchas:
529     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
530     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
531     # In both cases, we have to default to `cp -pR'.
532     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
533       as_ln_s='cp -pR'
534   elif ln conf$$.file conf$$ 2>/dev/null; then
535     as_ln_s=ln
536   else
537     as_ln_s='cp -pR'
538   fi
539 else
540   as_ln_s='cp -pR'
541 fi
542 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
543 rmdir conf$$.dir 2>/dev/null
544
545 if mkdir -p . 2>/dev/null; then
546   as_mkdir_p='mkdir -p "$as_dir"'
547 else
548   test -d ./-p && rmdir ./-p
549   as_mkdir_p=false
550 fi
551
552 as_test_x='test -x'
553 as_executable_p=as_fn_executable_p
554
555 # Sed expression to map a string onto a valid CPP name.
556 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
557
558 # Sed expression to map a string onto a valid variable name.
559 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
560
561
562 test -n "$DJDIR" || exec 7<&0 </dev/null
563 exec 6>&1
564
565 # Name of the host.
566 # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
567 # so uname gets run too.
568 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
569
570 #
571 # Initializations.
572 #
573 ac_default_prefix=/usr/local
574 ac_clean_files=
575 ac_config_libobj_dir=.
576 LIBOBJS=
577 cross_compiling=no
578 subdirs=
579 MFLAGS=
580 MAKEFLAGS=
581
582 # Identity of this package.
583 PACKAGE_NAME='PostgreSQL'
584 PACKAGE_TARNAME='postgresql'
585 PACKAGE_VERSION='11devel'
586 PACKAGE_STRING='PostgreSQL 11devel'
587 PACKAGE_BUGREPORT='pgsql-bugs@postgresql.org'
588 PACKAGE_URL=''
589
590 ac_unique_file="src/backend/access/common/heaptuple.c"
591 ac_default_prefix=/usr/local/pgsql
592 # Factoring default headers for most tests.
593 ac_includes_default="\
594 #include <stdio.h>
595 #ifdef HAVE_SYS_TYPES_H
596 # include <sys/types.h>
597 #endif
598 #ifdef HAVE_SYS_STAT_H
599 # include <sys/stat.h>
600 #endif
601 #ifdef STDC_HEADERS
602 # include <stdlib.h>
603 # include <stddef.h>
604 #else
605 # ifdef HAVE_STDLIB_H
606 #  include <stdlib.h>
607 # endif
608 #endif
609 #ifdef HAVE_STRING_H
610 # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
611 #  include <memory.h>
612 # endif
613 # include <string.h>
614 #endif
615 #ifdef HAVE_STRINGS_H
616 # include <strings.h>
617 #endif
618 #ifdef HAVE_INTTYPES_H
619 # include <inttypes.h>
620 #endif
621 #ifdef HAVE_STDINT_H
622 # include <stdint.h>
623 #endif
624 #ifdef HAVE_UNISTD_H
625 # include <unistd.h>
626 #endif"
627
628 ac_subst_vars='LTLIBOBJS
629 vpath_build
630 PG_VERSION_NUM
631 PROVE
632 FOP
633 XSLTPROC
634 DBTOEPUB
635 have_docbook
636 XMLLINT
637 TCL_SHLIB_LD_LIBS
638 TCL_SHARED_BUILD
639 TCL_LIB_SPEC
640 TCL_LIBS
641 TCL_INCLUDE_SPEC
642 TCL_CONFIG_SH
643 TCLSH
644 XGETTEXT
645 MSGMERGE
646 MSGFMT_FLAGS
647 MSGFMT
648 PG_CRC32C_OBJS
649 CFLAGS_SSE42
650 have_win32_dbghelp
651 HAVE_IPV6
652 LIBOBJS
653 UUID_LIBS
654 LDAP_LIBS_BE
655 LDAP_LIBS_FE
656 PTHREAD_CFLAGS
657 PTHREAD_LIBS
658 PTHREAD_CC
659 ax_pthread_config
660 ZIC
661 python_additional_libs
662 python_libspec
663 python_libdir
664 python_includespec
665 python_version
666 python_majorversion
667 PYTHON
668 perl_embed_ldflags
669 perl_embed_ccflags
670 perl_useshrplib
671 perl_privlibexp
672 perl_archlibexp
673 PERL
674 FLEXFLAGS
675 FLEX
676 BISONFLAGS
677 BISON
678 MKDIR_P
679 LN_S
680 TAR
681 install_bin
682 INSTALL_DATA
683 INSTALL_SCRIPT
684 INSTALL_PROGRAM
685 WINDRES
686 DLLWRAP
687 DLLTOOL
688 AR
689 STRIP_SHARED_LIB
690 STRIP_STATIC_LIB
691 STRIP
692 RANLIB
693 with_gnu_ld
694 LD
695 LDFLAGS_SL
696 LDFLAGS_EX
697 ELF_SYS
698 EGREP
699 GREP
700 with_zlib
701 with_system_tzdata
702 with_libxslt
703 with_libxml
704 XML2_CONFIG
705 UUID_EXTRA_OBJS
706 with_uuid
707 with_systemd
708 with_selinux
709 with_openssl
710 with_ldap
711 with_krb_srvnam
712 krb_srvtab
713 with_gssapi
714 with_python
715 with_perl
716 with_tcl
717 ICU_LIBS
718 ICU_CFLAGS
719 PKG_CONFIG_LIBDIR
720 PKG_CONFIG_PATH
721 PKG_CONFIG
722 with_icu
723 enable_thread_safety
724 INCLUDES
725 autodepend
726 TAS
727 GCC
728 CPP
729 BITCODE_CXXFLAGS
730 BITCODE_CFLAGS
731 CFLAGS_VECTOR
732 LLVM_BINPATH
733 LLVM_CXXFLAGS
734 LLVM_CFLAGS
735 LLVM_CPPFLAGS
736 LLVM_LIBS
737 CLANG
738 LLVM_CONFIG
739 AWK
740 with_llvm
741 SUN_STUDIO_CC
742 ac_ct_CXX
743 CXXFLAGS
744 CXX
745 OBJEXT
746 EXEEXT
747 ac_ct_CC
748 CPPFLAGS
749 LDFLAGS
750 CFLAGS
751 CC
752 enable_tap_tests
753 enable_dtrace
754 DTRACEFLAGS
755 DTRACE
756 enable_coverage
757 GENHTML
758 LCOV
759 GCOV
760 enable_debug
761 enable_strong_random
762 enable_rpath
763 default_port
764 WANTED_LANGUAGES
765 enable_nls
766 PORTNAME
767 host_os
768 host_vendor
769 host_cpu
770 host
771 build_os
772 build_vendor
773 build_cpu
774 build
775 PG_MAJORVERSION
776 configure_args
777 target_alias
778 host_alias
779 build_alias
780 LIBS
781 ECHO_T
782 ECHO_N
783 ECHO_C
784 DEFS
785 mandir
786 localedir
787 libdir
788 psdir
789 pdfdir
790 dvidir
791 htmldir
792 infodir
793 docdir
794 oldincludedir
795 includedir
796 localstatedir
797 sharedstatedir
798 sysconfdir
799 datadir
800 datarootdir
801 libexecdir
802 sbindir
803 bindir
804 program_transform_name
805 prefix
806 exec_prefix
807 PACKAGE_URL
808 PACKAGE_BUGREPORT
809 PACKAGE_STRING
810 PACKAGE_VERSION
811 PACKAGE_TARNAME
812 PACKAGE_NAME
813 PATH_SEPARATOR
814 SHELL'
815 ac_subst_files=''
816 ac_user_opts='
817 enable_option_checking
818 with_extra_version
819 with_template
820 with_includes
821 with_libraries
822 with_libs
823 enable_integer_datetimes
824 enable_nls
825 with_pgport
826 enable_rpath
827 enable_spinlocks
828 enable_atomics
829 enable_strong_random
830 enable_debug
831 enable_profiling
832 enable_coverage
833 enable_dtrace
834 enable_tap_tests
835 with_blocksize
836 with_segsize
837 with_wal_blocksize
838 with_CC
839 with_llvm
840 enable_depend
841 enable_cassert
842 enable_thread_safety
843 with_icu
844 with_tcl
845 with_tclconfig
846 with_perl
847 with_python
848 with_gssapi
849 with_krb_srvnam
850 with_pam
851 with_bsd_auth
852 with_ldap
853 with_bonjour
854 with_openssl
855 with_selinux
856 with_systemd
857 with_readline
858 with_libedit_preferred
859 with_uuid
860 with_ossp_uuid
861 with_libxml
862 with_libxslt
863 with_system_tzdata
864 with_zlib
865 with_gnu_ld
866 enable_largefile
867 enable_float4_byval
868 enable_float8_byval
869 '
870       ac_precious_vars='build_alias
871 host_alias
872 target_alias
873 CC
874 CFLAGS
875 LDFLAGS
876 LIBS
877 CPPFLAGS
878 CXX
879 CXXFLAGS
880 CCC
881 LLVM_CONFIG
882 CLANG
883 CPP
884 PKG_CONFIG
885 PKG_CONFIG_PATH
886 PKG_CONFIG_LIBDIR
887 ICU_CFLAGS
888 ICU_LIBS
889 LDFLAGS_EX
890 LDFLAGS_SL'
891
892
893 # Initialize some variables set by options.
894 ac_init_help=
895 ac_init_version=false
896 ac_unrecognized_opts=
897 ac_unrecognized_sep=
898 # The variables have the same names as the options, with
899 # dashes changed to underlines.
900 cache_file=/dev/null
901 exec_prefix=NONE
902 no_create=
903 no_recursion=
904 prefix=NONE
905 program_prefix=NONE
906 program_suffix=NONE
907 program_transform_name=s,x,x,
908 silent=
909 site=
910 srcdir=
911 verbose=
912 x_includes=NONE
913 x_libraries=NONE
914
915 # Installation directory options.
916 # These are left unexpanded so users can "make install exec_prefix=/foo"
917 # and all the variables that are supposed to be based on exec_prefix
918 # by default will actually change.
919 # Use braces instead of parens because sh, perl, etc. also accept them.
920 # (The list follows the same order as the GNU Coding Standards.)
921 bindir='${exec_prefix}/bin'
922 sbindir='${exec_prefix}/sbin'
923 libexecdir='${exec_prefix}/libexec'
924 datarootdir='${prefix}/share'
925 datadir='${datarootdir}'
926 sysconfdir='${prefix}/etc'
927 sharedstatedir='${prefix}/com'
928 localstatedir='${prefix}/var'
929 includedir='${prefix}/include'
930 oldincludedir='/usr/include'
931 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
932 infodir='${datarootdir}/info'
933 htmldir='${docdir}'
934 dvidir='${docdir}'
935 pdfdir='${docdir}'
936 psdir='${docdir}'
937 libdir='${exec_prefix}/lib'
938 localedir='${datarootdir}/locale'
939 mandir='${datarootdir}/man'
940
941 ac_prev=
942 ac_dashdash=
943 for ac_option
944 do
945   # If the previous option needs an argument, assign it.
946   if test -n "$ac_prev"; then
947     eval $ac_prev=\$ac_option
948     ac_prev=
949     continue
950   fi
951
952   case $ac_option in
953   *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
954   *=)   ac_optarg= ;;
955   *)    ac_optarg=yes ;;
956   esac
957
958   # Accept the important Cygnus configure options, so we can diagnose typos.
959
960   case $ac_dashdash$ac_option in
961   --)
962     ac_dashdash=yes ;;
963
964   -bindir | --bindir | --bindi | --bind | --bin | --bi)
965     ac_prev=bindir ;;
966   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
967     bindir=$ac_optarg ;;
968
969   -build | --build | --buil | --bui | --bu)
970     ac_prev=build_alias ;;
971   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
972     build_alias=$ac_optarg ;;
973
974   -cache-file | --cache-file | --cache-fil | --cache-fi \
975   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
976     ac_prev=cache_file ;;
977   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
978   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
979     cache_file=$ac_optarg ;;
980
981   --config-cache | -C)
982     cache_file=config.cache ;;
983
984   -datadir | --datadir | --datadi | --datad)
985     ac_prev=datadir ;;
986   -datadir=* | --datadir=* | --datadi=* | --datad=*)
987     datadir=$ac_optarg ;;
988
989   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
990   | --dataroo | --dataro | --datar)
991     ac_prev=datarootdir ;;
992   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
993   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
994     datarootdir=$ac_optarg ;;
995
996   -disable-* | --disable-*)
997     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
998     # Reject names that are not valid shell variable names.
999     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1000       as_fn_error $? "invalid feature name: $ac_useropt"
1001     ac_useropt_orig=$ac_useropt
1002     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1003     case $ac_user_opts in
1004       *"
1005 "enable_$ac_useropt"
1006 "*) ;;
1007       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
1008          ac_unrecognized_sep=', ';;
1009     esac
1010     eval enable_$ac_useropt=no ;;
1011
1012   -docdir | --docdir | --docdi | --doc | --do)
1013     ac_prev=docdir ;;
1014   -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
1015     docdir=$ac_optarg ;;
1016
1017   -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
1018     ac_prev=dvidir ;;
1019   -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
1020     dvidir=$ac_optarg ;;
1021
1022   -enable-* | --enable-*)
1023     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
1024     # Reject names that are not valid shell variable names.
1025     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1026       as_fn_error $? "invalid feature name: $ac_useropt"
1027     ac_useropt_orig=$ac_useropt
1028     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1029     case $ac_user_opts in
1030       *"
1031 "enable_$ac_useropt"
1032 "*) ;;
1033       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
1034          ac_unrecognized_sep=', ';;
1035     esac
1036     eval enable_$ac_useropt=\$ac_optarg ;;
1037
1038   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
1039   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
1040   | --exec | --exe | --ex)
1041     ac_prev=exec_prefix ;;
1042   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
1043   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
1044   | --exec=* | --exe=* | --ex=*)
1045     exec_prefix=$ac_optarg ;;
1046
1047   -gas | --gas | --ga | --g)
1048     # Obsolete; use --with-gas.
1049     with_gas=yes ;;
1050
1051   -help | --help | --hel | --he | -h)
1052     ac_init_help=long ;;
1053   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
1054     ac_init_help=recursive ;;
1055   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
1056     ac_init_help=short ;;
1057
1058   -host | --host | --hos | --ho)
1059     ac_prev=host_alias ;;
1060   -host=* | --host=* | --hos=* | --ho=*)
1061     host_alias=$ac_optarg ;;
1062
1063   -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
1064     ac_prev=htmldir ;;
1065   -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
1066   | --ht=*)
1067     htmldir=$ac_optarg ;;
1068
1069   -includedir | --includedir | --includedi | --included | --include \
1070   | --includ | --inclu | --incl | --inc)
1071     ac_prev=includedir ;;
1072   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
1073   | --includ=* | --inclu=* | --incl=* | --inc=*)
1074     includedir=$ac_optarg ;;
1075
1076   -infodir | --infodir | --infodi | --infod | --info | --inf)
1077     ac_prev=infodir ;;
1078   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
1079     infodir=$ac_optarg ;;
1080
1081   -libdir | --libdir | --libdi | --libd)
1082     ac_prev=libdir ;;
1083   -libdir=* | --libdir=* | --libdi=* | --libd=*)
1084     libdir=$ac_optarg ;;
1085
1086   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
1087   | --libexe | --libex | --libe)
1088     ac_prev=libexecdir ;;
1089   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
1090   | --libexe=* | --libex=* | --libe=*)
1091     libexecdir=$ac_optarg ;;
1092
1093   -localedir | --localedir | --localedi | --localed | --locale)
1094     ac_prev=localedir ;;
1095   -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
1096     localedir=$ac_optarg ;;
1097
1098   -localstatedir | --localstatedir | --localstatedi | --localstated \
1099   | --localstate | --localstat | --localsta | --localst | --locals)
1100     ac_prev=localstatedir ;;
1101   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
1102   | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
1103     localstatedir=$ac_optarg ;;
1104
1105   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
1106     ac_prev=mandir ;;
1107   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
1108     mandir=$ac_optarg ;;
1109
1110   -nfp | --nfp | --nf)
1111     # Obsolete; use --without-fp.
1112     with_fp=no ;;
1113
1114   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1115   | --no-cr | --no-c | -n)
1116     no_create=yes ;;
1117
1118   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1119   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1120     no_recursion=yes ;;
1121
1122   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
1123   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
1124   | --oldin | --oldi | --old | --ol | --o)
1125     ac_prev=oldincludedir ;;
1126   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1127   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1128   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1129     oldincludedir=$ac_optarg ;;
1130
1131   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1132     ac_prev=prefix ;;
1133   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1134     prefix=$ac_optarg ;;
1135
1136   -program-prefix | --program-prefix | --program-prefi | --program-pref \
1137   | --program-pre | --program-pr | --program-p)
1138     ac_prev=program_prefix ;;
1139   -program-prefix=* | --program-prefix=* | --program-prefi=* \
1140   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1141     program_prefix=$ac_optarg ;;
1142
1143   -program-suffix | --program-suffix | --program-suffi | --program-suff \
1144   | --program-suf | --program-su | --program-s)
1145     ac_prev=program_suffix ;;
1146   -program-suffix=* | --program-suffix=* | --program-suffi=* \
1147   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1148     program_suffix=$ac_optarg ;;
1149
1150   -program-transform-name | --program-transform-name \
1151   | --program-transform-nam | --program-transform-na \
1152   | --program-transform-n | --program-transform- \
1153   | --program-transform | --program-transfor \
1154   | --program-transfo | --program-transf \
1155   | --program-trans | --program-tran \
1156   | --progr-tra | --program-tr | --program-t)
1157     ac_prev=program_transform_name ;;
1158   -program-transform-name=* | --program-transform-name=* \
1159   | --program-transform-nam=* | --program-transform-na=* \
1160   | --program-transform-n=* | --program-transform-=* \
1161   | --program-transform=* | --program-transfor=* \
1162   | --program-transfo=* | --program-transf=* \
1163   | --program-trans=* | --program-tran=* \
1164   | --progr-tra=* | --program-tr=* | --program-t=*)
1165     program_transform_name=$ac_optarg ;;
1166
1167   -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
1168     ac_prev=pdfdir ;;
1169   -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
1170     pdfdir=$ac_optarg ;;
1171
1172   -psdir | --psdir | --psdi | --psd | --ps)
1173     ac_prev=psdir ;;
1174   -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
1175     psdir=$ac_optarg ;;
1176
1177   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1178   | -silent | --silent | --silen | --sile | --sil)
1179     silent=yes ;;
1180
1181   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1182     ac_prev=sbindir ;;
1183   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1184   | --sbi=* | --sb=*)
1185     sbindir=$ac_optarg ;;
1186
1187   -sharedstatedir | --sharedstatedir | --sharedstatedi \
1188   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1189   | --sharedst | --shareds | --shared | --share | --shar \
1190   | --sha | --sh)
1191     ac_prev=sharedstatedir ;;
1192   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1193   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1194   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1195   | --sha=* | --sh=*)
1196     sharedstatedir=$ac_optarg ;;
1197
1198   -site | --site | --sit)
1199     ac_prev=site ;;
1200   -site=* | --site=* | --sit=*)
1201     site=$ac_optarg ;;
1202
1203   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1204     ac_prev=srcdir ;;
1205   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1206     srcdir=$ac_optarg ;;
1207
1208   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1209   | --syscon | --sysco | --sysc | --sys | --sy)
1210     ac_prev=sysconfdir ;;
1211   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1212   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1213     sysconfdir=$ac_optarg ;;
1214
1215   -target | --target | --targe | --targ | --tar | --ta | --t)
1216     ac_prev=target_alias ;;
1217   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1218     target_alias=$ac_optarg ;;
1219
1220   -v | -verbose | --verbose | --verbos | --verbo | --verb)
1221     verbose=yes ;;
1222
1223   -version | --version | --versio | --versi | --vers | -V)
1224     ac_init_version=: ;;
1225
1226   -with-* | --with-*)
1227     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1228     # Reject names that are not valid shell variable names.
1229     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1230       as_fn_error $? "invalid package name: $ac_useropt"
1231     ac_useropt_orig=$ac_useropt
1232     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1233     case $ac_user_opts in
1234       *"
1235 "with_$ac_useropt"
1236 "*) ;;
1237       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1238          ac_unrecognized_sep=', ';;
1239     esac
1240     eval with_$ac_useropt=\$ac_optarg ;;
1241
1242   -without-* | --without-*)
1243     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1244     # Reject names that are not valid shell variable names.
1245     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1246       as_fn_error $? "invalid package name: $ac_useropt"
1247     ac_useropt_orig=$ac_useropt
1248     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1249     case $ac_user_opts in
1250       *"
1251 "with_$ac_useropt"
1252 "*) ;;
1253       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1254          ac_unrecognized_sep=', ';;
1255     esac
1256     eval with_$ac_useropt=no ;;
1257
1258   --x)
1259     # Obsolete; use --with-x.
1260     with_x=yes ;;
1261
1262   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1263   | --x-incl | --x-inc | --x-in | --x-i)
1264     ac_prev=x_includes ;;
1265   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1266   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1267     x_includes=$ac_optarg ;;
1268
1269   -x-libraries | --x-libraries | --x-librarie | --x-librari \
1270   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1271     ac_prev=x_libraries ;;
1272   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1273   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1274     x_libraries=$ac_optarg ;;
1275
1276   -*) as_fn_error $? "unrecognized option: \`$ac_option'
1277 Try \`$0 --help' for more information"
1278     ;;
1279
1280   *=*)
1281     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1282     # Reject names that are not valid shell variable names.
1283     case $ac_envvar in #(
1284       '' | [0-9]* | *[!_$as_cr_alnum]* )
1285       as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
1286     esac
1287     eval $ac_envvar=\$ac_optarg
1288     export $ac_envvar ;;
1289
1290   *)
1291     # FIXME: should be removed in autoconf 3.0.
1292     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
1293     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1294       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1295     : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
1296     ;;
1297
1298   esac
1299 done
1300
1301 if test -n "$ac_prev"; then
1302   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1303   as_fn_error $? "missing argument to $ac_option"
1304 fi
1305
1306 if test -n "$ac_unrecognized_opts"; then
1307   case $enable_option_checking in
1308     no) ;;
1309     fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
1310     *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1311   esac
1312 fi
1313
1314 # Check all directory arguments for consistency.
1315 for ac_var in   exec_prefix prefix bindir sbindir libexecdir datarootdir \
1316                 datadir sysconfdir sharedstatedir localstatedir includedir \
1317                 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1318                 libdir localedir mandir
1319 do
1320   eval ac_val=\$$ac_var
1321   # Remove trailing slashes.
1322   case $ac_val in
1323     */ )
1324       ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1325       eval $ac_var=\$ac_val;;
1326   esac
1327   # Be sure to have absolute directory names.
1328   case $ac_val in
1329     [\\/$]* | ?:[\\/]* )  continue;;
1330     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1331   esac
1332   as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
1333 done
1334
1335 # There might be people who depend on the old broken behavior: `$host'
1336 # used to hold the argument of --host etc.
1337 # FIXME: To remove some day.
1338 build=$build_alias
1339 host=$host_alias
1340 target=$target_alias
1341
1342 # FIXME: To remove some day.
1343 if test "x$host_alias" != x; then
1344   if test "x$build_alias" = x; then
1345     cross_compiling=maybe
1346   elif test "x$build_alias" != "x$host_alias"; then
1347     cross_compiling=yes
1348   fi
1349 fi
1350
1351 ac_tool_prefix=
1352 test -n "$host_alias" && ac_tool_prefix=$host_alias-
1353
1354 test "$silent" = yes && exec 6>/dev/null
1355
1356
1357 ac_pwd=`pwd` && test -n "$ac_pwd" &&
1358 ac_ls_di=`ls -di .` &&
1359 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1360   as_fn_error $? "working directory cannot be determined"
1361 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1362   as_fn_error $? "pwd does not report name of working directory"
1363
1364
1365 # Find the source files, if location was not specified.
1366 if test -z "$srcdir"; then
1367   ac_srcdir_defaulted=yes
1368   # Try the directory containing this script, then the parent directory.
1369   ac_confdir=`$as_dirname -- "$as_myself" ||
1370 $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1371          X"$as_myself" : 'X\(//\)[^/]' \| \
1372          X"$as_myself" : 'X\(//\)$' \| \
1373          X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1374 $as_echo X"$as_myself" |
1375     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1376             s//\1/
1377             q
1378           }
1379           /^X\(\/\/\)[^/].*/{
1380             s//\1/
1381             q
1382           }
1383           /^X\(\/\/\)$/{
1384             s//\1/
1385             q
1386           }
1387           /^X\(\/\).*/{
1388             s//\1/
1389             q
1390           }
1391           s/.*/./; q'`
1392   srcdir=$ac_confdir
1393   if test ! -r "$srcdir/$ac_unique_file"; then
1394     srcdir=..
1395   fi
1396 else
1397   ac_srcdir_defaulted=no
1398 fi
1399 if test ! -r "$srcdir/$ac_unique_file"; then
1400   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1401   as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
1402 fi
1403 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1404 ac_abs_confdir=`(
1405         cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
1406         pwd)`
1407 # When building in place, set srcdir=.
1408 if test "$ac_abs_confdir" = "$ac_pwd"; then
1409   srcdir=.
1410 fi
1411 # Remove unnecessary trailing slashes from srcdir.
1412 # Double slashes in file names in object file debugging info
1413 # mess up M-x gdb in Emacs.
1414 case $srcdir in
1415 */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1416 esac
1417 for ac_var in $ac_precious_vars; do
1418   eval ac_env_${ac_var}_set=\${${ac_var}+set}
1419   eval ac_env_${ac_var}_value=\$${ac_var}
1420   eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1421   eval ac_cv_env_${ac_var}_value=\$${ac_var}
1422 done
1423
1424 #
1425 # Report the --help message.
1426 #
1427 if test "$ac_init_help" = "long"; then
1428   # Omit some internal or obsolete options to make the list less imposing.
1429   # This message is too long to be a string in the A/UX 3.1 sh.
1430   cat <<_ACEOF
1431 \`configure' configures PostgreSQL 11devel to adapt to many kinds of systems.
1432
1433 Usage: $0 [OPTION]... [VAR=VALUE]...
1434
1435 To assign environment variables (e.g., CC, CFLAGS...), specify them as
1436 VAR=VALUE.  See below for descriptions of some of the useful variables.
1437
1438 Defaults for the options are specified in brackets.
1439
1440 Configuration:
1441   -h, --help              display this help and exit
1442       --help=short        display options specific to this package
1443       --help=recursive    display the short help of all the included packages
1444   -V, --version           display version information and exit
1445   -q, --quiet, --silent   do not print \`checking ...' messages
1446       --cache-file=FILE   cache test results in FILE [disabled]
1447   -C, --config-cache      alias for \`--cache-file=config.cache'
1448   -n, --no-create         do not create output files
1449       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
1450
1451 Installation directories:
1452   --prefix=PREFIX         install architecture-independent files in PREFIX
1453                           [$ac_default_prefix]
1454   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
1455                           [PREFIX]
1456
1457 By default, \`make install' will install all the files in
1458 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
1459 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1460 for instance \`--prefix=\$HOME'.
1461
1462 For better control, use the options below.
1463
1464 Fine tuning of the installation directories:
1465   --bindir=DIR            user executables [EPREFIX/bin]
1466   --sbindir=DIR           system admin executables [EPREFIX/sbin]
1467   --libexecdir=DIR        program executables [EPREFIX/libexec]
1468   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1469   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1470   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1471   --libdir=DIR            object code libraries [EPREFIX/lib]
1472   --includedir=DIR        C header files [PREFIX/include]
1473   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
1474   --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
1475   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
1476   --infodir=DIR           info documentation [DATAROOTDIR/info]
1477   --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
1478   --mandir=DIR            man documentation [DATAROOTDIR/man]
1479   --docdir=DIR            documentation root [DATAROOTDIR/doc/postgresql]
1480   --htmldir=DIR           html documentation [DOCDIR]
1481   --dvidir=DIR            dvi documentation [DOCDIR]
1482   --pdfdir=DIR            pdf documentation [DOCDIR]
1483   --psdir=DIR             ps documentation [DOCDIR]
1484 _ACEOF
1485
1486   cat <<\_ACEOF
1487
1488 System types:
1489   --build=BUILD     configure for building on BUILD [guessed]
1490   --host=HOST       cross-compile to build programs to run on HOST [BUILD]
1491 _ACEOF
1492 fi
1493
1494 if test -n "$ac_init_help"; then
1495   case $ac_init_help in
1496      short | recursive ) echo "Configuration of PostgreSQL 11devel:";;
1497    esac
1498   cat <<\_ACEOF
1499
1500 Optional Features:
1501   --disable-option-checking  ignore unrecognized --enable/--with options
1502   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1503   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
1504   --disable-integer-datetimes
1505                           obsolete option, no longer supported
1506   --enable-nls[=LANGUAGES]
1507                           enable Native Language Support
1508   --disable-rpath         do not embed shared library search path in
1509                           executables
1510   --disable-spinlocks     do not use spinlocks
1511   --disable-atomics       do not use atomic operations
1512   --disable-strong-random do not use a strong random number source
1513   --enable-debug          build with debugging symbols (-g)
1514   --enable-profiling      build with profiling enabled
1515   --enable-coverage       build with coverage testing instrumentation
1516   --enable-dtrace         build with DTrace support
1517   --enable-tap-tests      enable TAP tests (requires Perl and IPC::Run)
1518   --enable-depend         turn on automatic dependency tracking
1519   --enable-cassert        enable assertion checks (for debugging)
1520   --disable-thread-safety disable thread-safety in client libraries
1521   --disable-largefile     omit support for large files
1522   --disable-float4-byval  disable float4 passed by value
1523   --disable-float8-byval  disable float8 passed by value
1524
1525 Optional Packages:
1526   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1527   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
1528   --with-extra-version=STRING
1529                           append STRING to version
1530   --with-template=NAME    override operating system template
1531   --with-includes=DIRS    look for additional header files in DIRS
1532   --with-libraries=DIRS   look for additional libraries in DIRS
1533   --with-libs=DIRS        alternative spelling of --with-libraries
1534   --with-pgport=PORTNUM   set default port number [5432]
1535   --with-blocksize=BLOCKSIZE
1536                           set table block size in kB [8]
1537   --with-segsize=SEGSIZE  set table segment size in GB [1]
1538   --with-wal-blocksize=BLOCKSIZE
1539                           set WAL block size in kB [8]
1540   --with-CC=CMD           set compiler (deprecated)
1541   --with-llvm             build with LLVM based JIT support
1542   --with-icu              build with ICU support
1543   --with-tcl              build Tcl modules (PL/Tcl)
1544   --with-tclconfig=DIR    tclConfig.sh is in DIR
1545   --with-perl             build Perl modules (PL/Perl)
1546   --with-python           build Python modules (PL/Python)
1547   --with-gssapi           build with GSSAPI support
1548   --with-krb-srvnam=NAME  default service principal name in Kerberos (GSSAPI)
1549                           [postgres]
1550   --with-pam              build with PAM support
1551   --with-bsd-auth         build with BSD Authentication support
1552   --with-ldap             build with LDAP support
1553   --with-bonjour          build with Bonjour support
1554   --with-openssl          build with OpenSSL support
1555   --with-selinux          build with SELinux support
1556   --with-systemd          build with systemd support
1557   --without-readline      do not use GNU Readline nor BSD Libedit for editing
1558   --with-libedit-preferred
1559                           prefer BSD Libedit over GNU Readline
1560   --with-uuid=LIB         build contrib/uuid-ossp using LIB (bsd,e2fs,ossp)
1561   --with-ossp-uuid        obsolete spelling of --with-uuid=ossp
1562   --with-libxml           build with XML support
1563   --with-libxslt          use XSLT support when building contrib/xml2
1564   --with-system-tzdata=DIR
1565                           use system time zone data in DIR
1566   --without-zlib          do not use Zlib
1567   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
1568
1569 Some influential environment variables:
1570   CC          C compiler command
1571   CFLAGS      C compiler flags
1572   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
1573               nonstandard directory <lib dir>
1574   LIBS        libraries to pass to the linker, e.g. -l<library>
1575   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1576               you have headers in a nonstandard directory <include dir>
1577   CXX         C++ compiler command
1578   CXXFLAGS    C++ compiler flags
1579   LLVM_CONFIG path to llvm-config command
1580   CLANG       path to clang compiler to generate bitcode
1581   CPP         C preprocessor
1582   PKG_CONFIG  path to pkg-config utility
1583   PKG_CONFIG_PATH
1584               directories to add to pkg-config's search path
1585   PKG_CONFIG_LIBDIR
1586               path overriding pkg-config's built-in search path
1587   ICU_CFLAGS  C compiler flags for ICU, overriding pkg-config
1588   ICU_LIBS    linker flags for ICU, overriding pkg-config
1589   LDFLAGS_EX  extra linker flags for linking executables only
1590   LDFLAGS_SL  extra linker flags for linking shared libraries only
1591
1592 Use these variables to override the choices made by `configure' or to help
1593 it to find libraries and programs with nonstandard names/locations.
1594
1595 Report bugs to <pgsql-bugs@postgresql.org>.
1596 _ACEOF
1597 ac_status=$?
1598 fi
1599
1600 if test "$ac_init_help" = "recursive"; then
1601   # If there are subdirs, report their specific --help.
1602   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1603     test -d "$ac_dir" ||
1604       { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1605       continue
1606     ac_builddir=.
1607
1608 case "$ac_dir" in
1609 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1610 *)
1611   ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
1612   # A ".." for each directory in $ac_dir_suffix.
1613   ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1614   case $ac_top_builddir_sub in
1615   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1616   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1617   esac ;;
1618 esac
1619 ac_abs_top_builddir=$ac_pwd
1620 ac_abs_builddir=$ac_pwd$ac_dir_suffix
1621 # for backward compatibility:
1622 ac_top_builddir=$ac_top_build_prefix
1623
1624 case $srcdir in
1625   .)  # We are building in place.
1626     ac_srcdir=.
1627     ac_top_srcdir=$ac_top_builddir_sub
1628     ac_abs_top_srcdir=$ac_pwd ;;
1629   [\\/]* | ?:[\\/]* )  # Absolute name.
1630     ac_srcdir=$srcdir$ac_dir_suffix;
1631     ac_top_srcdir=$srcdir
1632     ac_abs_top_srcdir=$srcdir ;;
1633   *) # Relative name.
1634     ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1635     ac_top_srcdir=$ac_top_build_prefix$srcdir
1636     ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1637 esac
1638 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1639
1640     cd "$ac_dir" || { ac_status=$?; continue; }
1641     # Check for guested configure.
1642     if test -f "$ac_srcdir/configure.gnu"; then
1643       echo &&
1644       $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1645     elif test -f "$ac_srcdir/configure"; then
1646       echo &&
1647       $SHELL "$ac_srcdir/configure" --help=recursive
1648     else
1649       $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1650     fi || ac_status=$?
1651     cd "$ac_pwd" || { ac_status=$?; break; }
1652   done
1653 fi
1654
1655 test -n "$ac_init_help" && exit $ac_status
1656 if $ac_init_version; then
1657   cat <<\_ACEOF
1658 PostgreSQL configure 11devel
1659 generated by GNU Autoconf 2.69
1660
1661 Copyright (C) 2012 Free Software Foundation, Inc.
1662 This configure script is free software; the Free Software Foundation
1663 gives unlimited permission to copy, distribute and modify it.
1664
1665 Copyright (c) 1996-2018, PostgreSQL Global Development Group
1666 _ACEOF
1667   exit
1668 fi
1669
1670 ## ------------------------ ##
1671 ## Autoconf initialization. ##
1672 ## ------------------------ ##
1673
1674 # ac_fn_c_try_compile LINENO
1675 # --------------------------
1676 # Try to compile conftest.$ac_ext, and return whether this succeeded.
1677 ac_fn_c_try_compile ()
1678 {
1679   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1680   rm -f conftest.$ac_objext
1681   if { { ac_try="$ac_compile"
1682 case "(($ac_try" in
1683   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1684   *) ac_try_echo=$ac_try;;
1685 esac
1686 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1687 $as_echo "$ac_try_echo"; } >&5
1688   (eval "$ac_compile") 2>conftest.err
1689   ac_status=$?
1690   if test -s conftest.err; then
1691     grep -v '^ *+' conftest.err >conftest.er1
1692     cat conftest.er1 >&5
1693     mv -f conftest.er1 conftest.err
1694   fi
1695   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1696   test $ac_status = 0; } && {
1697          test -z "$ac_c_werror_flag" ||
1698          test ! -s conftest.err
1699        } && test -s conftest.$ac_objext; then :
1700   ac_retval=0
1701 else
1702   $as_echo "$as_me: failed program was:" >&5
1703 sed 's/^/| /' conftest.$ac_ext >&5
1704
1705         ac_retval=1
1706 fi
1707   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1708   as_fn_set_status $ac_retval
1709
1710 } # ac_fn_c_try_compile
1711
1712 # ac_fn_cxx_try_compile LINENO
1713 # ----------------------------
1714 # Try to compile conftest.$ac_ext, and return whether this succeeded.
1715 ac_fn_cxx_try_compile ()
1716 {
1717   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1718   rm -f conftest.$ac_objext
1719   if { { ac_try="$ac_compile"
1720 case "(($ac_try" in
1721   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1722   *) ac_try_echo=$ac_try;;
1723 esac
1724 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1725 $as_echo "$ac_try_echo"; } >&5
1726   (eval "$ac_compile") 2>conftest.err
1727   ac_status=$?
1728   if test -s conftest.err; then
1729     grep -v '^ *+' conftest.err >conftest.er1
1730     cat conftest.er1 >&5
1731     mv -f conftest.er1 conftest.err
1732   fi
1733   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1734   test $ac_status = 0; } && {
1735          test -z "$ac_cxx_werror_flag" ||
1736          test ! -s conftest.err
1737        } && test -s conftest.$ac_objext; then :
1738   ac_retval=0
1739 else
1740   $as_echo "$as_me: failed program was:" >&5
1741 sed 's/^/| /' conftest.$ac_ext >&5
1742
1743         ac_retval=1
1744 fi
1745   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1746   as_fn_set_status $ac_retval
1747
1748 } # ac_fn_cxx_try_compile
1749
1750 # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
1751 # ---------------------------------------------
1752 # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
1753 # accordingly.
1754 ac_fn_c_check_decl ()
1755 {
1756   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1757   as_decl_name=`echo $2|sed 's/ *(.*//'`
1758   as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
1759   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
1760 $as_echo_n "checking whether $as_decl_name is declared... " >&6; }
1761 if eval \${$3+:} false; then :
1762   $as_echo_n "(cached) " >&6
1763 else
1764   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1765 /* end confdefs.h.  */
1766 $4
1767 int
1768 main ()
1769 {
1770 #ifndef $as_decl_name
1771 #ifdef __cplusplus
1772   (void) $as_decl_use;
1773 #else
1774   (void) $as_decl_name;
1775 #endif
1776 #endif
1777
1778   ;
1779   return 0;
1780 }
1781 _ACEOF
1782 if ac_fn_c_try_compile "$LINENO"; then :
1783   eval "$3=yes"
1784 else
1785   eval "$3=no"
1786 fi
1787 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1788 fi
1789 eval ac_res=\$$3
1790                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1791 $as_echo "$ac_res" >&6; }
1792   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1793
1794 } # ac_fn_c_check_decl
1795
1796 # ac_fn_c_try_link LINENO
1797 # -----------------------
1798 # Try to link conftest.$ac_ext, and return whether this succeeded.
1799 ac_fn_c_try_link ()
1800 {
1801   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1802   rm -f conftest.$ac_objext conftest$ac_exeext
1803   if { { ac_try="$ac_link"
1804 case "(($ac_try" in
1805   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1806   *) ac_try_echo=$ac_try;;
1807 esac
1808 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1809 $as_echo "$ac_try_echo"; } >&5
1810   (eval "$ac_link") 2>conftest.err
1811   ac_status=$?
1812   if test -s conftest.err; then
1813     grep -v '^ *+' conftest.err >conftest.er1
1814     cat conftest.er1 >&5
1815     mv -f conftest.er1 conftest.err
1816   fi
1817   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1818   test $ac_status = 0; } && {
1819          test -z "$ac_c_werror_flag" ||
1820          test ! -s conftest.err
1821        } && test -s conftest$ac_exeext && {
1822          test "$cross_compiling" = yes ||
1823          test -x conftest$ac_exeext
1824        }; then :
1825   ac_retval=0
1826 else
1827   $as_echo "$as_me: failed program was:" >&5
1828 sed 's/^/| /' conftest.$ac_ext >&5
1829
1830         ac_retval=1
1831 fi
1832   # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1833   # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1834   # interfere with the next link command; also delete a directory that is
1835   # left behind by Apple's compiler.  We do this before executing the actions.
1836   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1837   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1838   as_fn_set_status $ac_retval
1839
1840 } # ac_fn_c_try_link
1841
1842 # ac_fn_c_try_cpp LINENO
1843 # ----------------------
1844 # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
1845 ac_fn_c_try_cpp ()
1846 {
1847   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1848   if { { ac_try="$ac_cpp conftest.$ac_ext"
1849 case "(($ac_try" in
1850   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1851   *) ac_try_echo=$ac_try;;
1852 esac
1853 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1854 $as_echo "$ac_try_echo"; } >&5
1855   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
1856   ac_status=$?
1857   if test -s conftest.err; then
1858     grep -v '^ *+' conftest.err >conftest.er1
1859     cat conftest.er1 >&5
1860     mv -f conftest.er1 conftest.err
1861   fi
1862   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1863   test $ac_status = 0; } > conftest.i && {
1864          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
1865          test ! -s conftest.err
1866        }; then :
1867   ac_retval=0
1868 else
1869   $as_echo "$as_me: failed program was:" >&5
1870 sed 's/^/| /' conftest.$ac_ext >&5
1871
1872     ac_retval=1
1873 fi
1874   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1875   as_fn_set_status $ac_retval
1876
1877 } # ac_fn_c_try_cpp
1878
1879 # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
1880 # -------------------------------------------------------
1881 # Tests whether HEADER exists, giving a warning if it cannot be compiled using
1882 # the include files in INCLUDES and setting the cache variable VAR
1883 # accordingly.
1884 ac_fn_c_check_header_mongrel ()
1885 {
1886   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1887   if eval \${$3+:} false; then :
1888   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1889 $as_echo_n "checking for $2... " >&6; }
1890 if eval \${$3+:} false; then :
1891   $as_echo_n "(cached) " >&6
1892 fi
1893 eval ac_res=\$$3
1894                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1895 $as_echo "$ac_res" >&6; }
1896 else
1897   # Is the header compilable?
1898 { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
1899 $as_echo_n "checking $2 usability... " >&6; }
1900 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1901 /* end confdefs.h.  */
1902 $4
1903 #include <$2>
1904 _ACEOF
1905 if ac_fn_c_try_compile "$LINENO"; then :
1906   ac_header_compiler=yes
1907 else
1908   ac_header_compiler=no
1909 fi
1910 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1911 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
1912 $as_echo "$ac_header_compiler" >&6; }
1913
1914 # Is the header present?
1915 { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
1916 $as_echo_n "checking $2 presence... " >&6; }
1917 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1918 /* end confdefs.h.  */
1919 #include <$2>
1920 _ACEOF
1921 if ac_fn_c_try_cpp "$LINENO"; then :
1922   ac_header_preproc=yes
1923 else
1924   ac_header_preproc=no
1925 fi
1926 rm -f conftest.err conftest.i conftest.$ac_ext
1927 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
1928 $as_echo "$ac_header_preproc" >&6; }
1929
1930 # So?  What about this header?
1931 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
1932   yes:no: )
1933     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
1934 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
1935     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1936 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1937     ;;
1938   no:yes:* )
1939     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
1940 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
1941     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
1942 $as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
1943     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
1944 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
1945     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
1946 $as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
1947     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1948 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1949 ( $as_echo "## ---------------------------------------- ##
1950 ## Report this to pgsql-bugs@postgresql.org ##
1951 ## ---------------------------------------- ##"
1952      ) | sed "s/^/$as_me: WARNING:     /" >&2
1953     ;;
1954 esac
1955   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1956 $as_echo_n "checking for $2... " >&6; }
1957 if eval \${$3+:} false; then :
1958   $as_echo_n "(cached) " >&6
1959 else
1960   eval "$3=\$ac_header_compiler"
1961 fi
1962 eval ac_res=\$$3
1963                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1964 $as_echo "$ac_res" >&6; }
1965 fi
1966   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1967
1968 } # ac_fn_c_check_header_mongrel
1969
1970 # ac_fn_c_try_run LINENO
1971 # ----------------------
1972 # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
1973 # that executables *can* be run.
1974 ac_fn_c_try_run ()
1975 {
1976   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1977   if { { ac_try="$ac_link"
1978 case "(($ac_try" in
1979   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1980   *) ac_try_echo=$ac_try;;
1981 esac
1982 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1983 $as_echo "$ac_try_echo"; } >&5
1984   (eval "$ac_link") 2>&5
1985   ac_status=$?
1986   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1987   test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
1988   { { case "(($ac_try" in
1989   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1990   *) ac_try_echo=$ac_try;;
1991 esac
1992 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1993 $as_echo "$ac_try_echo"; } >&5
1994   (eval "$ac_try") 2>&5
1995   ac_status=$?
1996   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1997   test $ac_status = 0; }; }; then :
1998   ac_retval=0
1999 else
2000   $as_echo "$as_me: program exited with status $ac_status" >&5
2001        $as_echo "$as_me: failed program was:" >&5
2002 sed 's/^/| /' conftest.$ac_ext >&5
2003
2004        ac_retval=$ac_status
2005 fi
2006   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
2007   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2008   as_fn_set_status $ac_retval
2009
2010 } # ac_fn_c_try_run
2011
2012 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
2013 # -------------------------------------------------------
2014 # Tests whether HEADER exists and can be compiled using the include files in
2015 # INCLUDES, setting the cache variable VAR accordingly.
2016 ac_fn_c_check_header_compile ()
2017 {
2018   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2019   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2020 $as_echo_n "checking for $2... " >&6; }
2021 if eval \${$3+:} false; then :
2022   $as_echo_n "(cached) " >&6
2023 else
2024   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2025 /* end confdefs.h.  */
2026 $4
2027 #include <$2>
2028 _ACEOF
2029 if ac_fn_c_try_compile "$LINENO"; then :
2030   eval "$3=yes"
2031 else
2032   eval "$3=no"
2033 fi
2034 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2035 fi
2036 eval ac_res=\$$3
2037                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2038 $as_echo "$ac_res" >&6; }
2039   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2040
2041 } # ac_fn_c_check_header_compile
2042
2043 # ac_fn_c_check_func LINENO FUNC VAR
2044 # ----------------------------------
2045 # Tests whether FUNC exists, setting the cache variable VAR accordingly
2046 ac_fn_c_check_func ()
2047 {
2048   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2049   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2050 $as_echo_n "checking for $2... " >&6; }
2051 if eval \${$3+:} false; then :
2052   $as_echo_n "(cached) " >&6
2053 else
2054   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2055 /* end confdefs.h.  */
2056 /* Define $2 to an innocuous variant, in case <limits.h> declares $2.
2057    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
2058 #define $2 innocuous_$2
2059
2060 /* System header to define __stub macros and hopefully few prototypes,
2061     which can conflict with char $2 (); below.
2062     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
2063     <limits.h> exists even on freestanding compilers.  */
2064
2065 #ifdef __STDC__
2066 # include <limits.h>
2067 #else
2068 # include <assert.h>
2069 #endif
2070
2071 #undef $2
2072
2073 /* Override any GCC internal prototype to avoid an error.
2074    Use char because int might match the return type of a GCC
2075    builtin and then its argument prototype would still apply.  */
2076 #ifdef __cplusplus
2077 extern "C"
2078 #endif
2079 char $2 ();
2080 /* The GNU C library defines this for functions which it implements
2081     to always fail with ENOSYS.  Some functions are actually named
2082     something starting with __ and the normal name is an alias.  */
2083 #if defined __stub_$2 || defined __stub___$2
2084 choke me
2085 #endif
2086
2087 int
2088 main ()
2089 {
2090 return $2 ();
2091   ;
2092   return 0;
2093 }
2094 _ACEOF
2095 if ac_fn_c_try_link "$LINENO"; then :
2096   eval "$3=yes"
2097 else
2098   eval "$3=no"
2099 fi
2100 rm -f core conftest.err conftest.$ac_objext \
2101     conftest$ac_exeext conftest.$ac_ext
2102 fi
2103 eval ac_res=\$$3
2104                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2105 $as_echo "$ac_res" >&6; }
2106   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2107
2108 } # ac_fn_c_check_func
2109
2110 # ac_fn_c_check_type LINENO TYPE VAR INCLUDES
2111 # -------------------------------------------
2112 # Tests whether TYPE exists after having included INCLUDES, setting cache
2113 # variable VAR accordingly.
2114 ac_fn_c_check_type ()
2115 {
2116   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2117   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2118 $as_echo_n "checking for $2... " >&6; }
2119 if eval \${$3+:} false; then :
2120   $as_echo_n "(cached) " >&6
2121 else
2122   eval "$3=no"
2123   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2124 /* end confdefs.h.  */
2125 $4
2126 int
2127 main ()
2128 {
2129 if (sizeof ($2))
2130          return 0;
2131   ;
2132   return 0;
2133 }
2134 _ACEOF
2135 if ac_fn_c_try_compile "$LINENO"; then :
2136   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2137 /* end confdefs.h.  */
2138 $4
2139 int
2140 main ()
2141 {
2142 if (sizeof (($2)))
2143             return 0;
2144   ;
2145   return 0;
2146 }
2147 _ACEOF
2148 if ac_fn_c_try_compile "$LINENO"; then :
2149
2150 else
2151   eval "$3=yes"
2152 fi
2153 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2154 fi
2155 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2156 fi
2157 eval ac_res=\$$3
2158                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2159 $as_echo "$ac_res" >&6; }
2160   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2161
2162 } # ac_fn_c_check_type
2163
2164 # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
2165 # ----------------------------------------------------
2166 # Tries to find if the field MEMBER exists in type AGGR, after including
2167 # INCLUDES, setting cache variable VAR accordingly.
2168 ac_fn_c_check_member ()
2169 {
2170   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2171   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
2172 $as_echo_n "checking for $2.$3... " >&6; }
2173 if eval \${$4+:} false; then :
2174   $as_echo_n "(cached) " >&6
2175 else
2176   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2177 /* end confdefs.h.  */
2178 $5
2179 int
2180 main ()
2181 {
2182 static $2 ac_aggr;
2183 if (ac_aggr.$3)
2184 return 0;
2185   ;
2186   return 0;
2187 }
2188 _ACEOF
2189 if ac_fn_c_try_compile "$LINENO"; then :
2190   eval "$4=yes"
2191 else
2192   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2193 /* end confdefs.h.  */
2194 $5
2195 int
2196 main ()
2197 {
2198 static $2 ac_aggr;
2199 if (sizeof ac_aggr.$3)
2200 return 0;
2201   ;
2202   return 0;
2203 }
2204 _ACEOF
2205 if ac_fn_c_try_compile "$LINENO"; then :
2206   eval "$4=yes"
2207 else
2208   eval "$4=no"
2209 fi
2210 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2211 fi
2212 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2213 fi
2214 eval ac_res=\$$4
2215                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2216 $as_echo "$ac_res" >&6; }
2217   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2218
2219 } # ac_fn_c_check_member
2220
2221 # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
2222 # --------------------------------------------
2223 # Tries to find the compile-time value of EXPR in a program that includes
2224 # INCLUDES, setting VAR accordingly. Returns whether the value could be
2225 # computed
2226 ac_fn_c_compute_int ()
2227 {
2228   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2229   if test "$cross_compiling" = yes; then
2230     # Depending upon the size, compute the lo and hi bounds.
2231 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2232 /* end confdefs.h.  */
2233 $4
2234 int
2235 main ()
2236 {
2237 static int test_array [1 - 2 * !(($2) >= 0)];
2238 test_array [0] = 0;
2239 return test_array [0];
2240
2241   ;
2242   return 0;
2243 }
2244 _ACEOF
2245 if ac_fn_c_try_compile "$LINENO"; then :
2246   ac_lo=0 ac_mid=0
2247   while :; do
2248     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2249 /* end confdefs.h.  */
2250 $4
2251 int
2252 main ()
2253 {
2254 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
2255 test_array [0] = 0;
2256 return test_array [0];
2257
2258   ;
2259   return 0;
2260 }
2261 _ACEOF
2262 if ac_fn_c_try_compile "$LINENO"; then :
2263   ac_hi=$ac_mid; break
2264 else
2265   as_fn_arith $ac_mid + 1 && ac_lo=$as_val
2266                         if test $ac_lo -le $ac_mid; then
2267                           ac_lo= ac_hi=
2268                           break
2269                         fi
2270                         as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
2271 fi
2272 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2273   done
2274 else
2275   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2276 /* end confdefs.h.  */
2277 $4
2278 int
2279 main ()
2280 {
2281 static int test_array [1 - 2 * !(($2) < 0)];
2282 test_array [0] = 0;
2283 return test_array [0];
2284
2285   ;
2286   return 0;
2287 }
2288 _ACEOF
2289 if ac_fn_c_try_compile "$LINENO"; then :
2290   ac_hi=-1 ac_mid=-1
2291   while :; do
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_lo=$ac_mid; break
2308 else
2309   as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
2310                         if test $ac_mid -le $ac_hi; then
2311                           ac_lo= ac_hi=
2312                           break
2313                         fi
2314                         as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
2315 fi
2316 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2317   done
2318 else
2319   ac_lo= ac_hi=
2320 fi
2321 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2322 fi
2323 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2324 # Binary search between lo and hi bounds.
2325 while test "x$ac_lo" != "x$ac_hi"; do
2326   as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
2327   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2328 /* end confdefs.h.  */
2329 $4
2330 int
2331 main ()
2332 {
2333 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
2334 test_array [0] = 0;
2335 return test_array [0];
2336
2337   ;
2338   return 0;
2339 }
2340 _ACEOF
2341 if ac_fn_c_try_compile "$LINENO"; then :
2342   ac_hi=$ac_mid
2343 else
2344   as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
2345 fi
2346 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2347 done
2348 case $ac_lo in #((
2349 ?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
2350 '') ac_retval=1 ;;
2351 esac
2352   else
2353     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2354 /* end confdefs.h.  */
2355 $4
2356 static long int longval () { return $2; }
2357 static unsigned long int ulongval () { return $2; }
2358 #include <stdio.h>
2359 #include <stdlib.h>
2360 int
2361 main ()
2362 {
2363
2364   FILE *f = fopen ("conftest.val", "w");
2365   if (! f)
2366     return 1;
2367   if (($2) < 0)
2368     {
2369       long int i = longval ();
2370       if (i != ($2))
2371         return 1;
2372       fprintf (f, "%ld", i);
2373     }
2374   else
2375     {
2376       unsigned long int i = ulongval ();
2377       if (i != ($2))
2378         return 1;
2379       fprintf (f, "%lu", i);
2380     }
2381   /* Do not output a trailing newline, as this causes \r\n confusion
2382      on some platforms.  */
2383   return ferror (f) || fclose (f) != 0;
2384
2385   ;
2386   return 0;
2387 }
2388 _ACEOF
2389 if ac_fn_c_try_run "$LINENO"; then :
2390   echo >>conftest.val; read $3 <conftest.val; ac_retval=0
2391 else
2392   ac_retval=1
2393 fi
2394 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
2395   conftest.$ac_objext conftest.beam conftest.$ac_ext
2396 rm -f conftest.val
2397
2398   fi
2399   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2400   as_fn_set_status $ac_retval
2401
2402 } # ac_fn_c_compute_int
2403 cat >config.log <<_ACEOF
2404 This file contains any messages produced by compilers while
2405 running configure, to aid debugging if configure makes a mistake.
2406
2407 It was created by PostgreSQL $as_me 11devel, which was
2408 generated by GNU Autoconf 2.69.  Invocation command line was
2409
2410   $ $0 $@
2411
2412 _ACEOF
2413 exec 5>>config.log
2414 {
2415 cat <<_ASUNAME
2416 ## --------- ##
2417 ## Platform. ##
2418 ## --------- ##
2419
2420 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
2421 uname -m = `(uname -m) 2>/dev/null || echo unknown`
2422 uname -r = `(uname -r) 2>/dev/null || echo unknown`
2423 uname -s = `(uname -s) 2>/dev/null || echo unknown`
2424 uname -v = `(uname -v) 2>/dev/null || echo unknown`
2425
2426 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
2427 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
2428
2429 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
2430 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
2431 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
2432 /usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
2433 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
2434 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
2435 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
2436
2437 _ASUNAME
2438
2439 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2440 for as_dir in $PATH
2441 do
2442   IFS=$as_save_IFS
2443   test -z "$as_dir" && as_dir=.
2444     $as_echo "PATH: $as_dir"
2445   done
2446 IFS=$as_save_IFS
2447
2448 } >&5
2449
2450 cat >&5 <<_ACEOF
2451
2452
2453 ## ----------- ##
2454 ## Core tests. ##
2455 ## ----------- ##
2456
2457 _ACEOF
2458
2459
2460 # Keep a trace of the command line.
2461 # Strip out --no-create and --no-recursion so they do not pile up.
2462 # Strip out --silent because we don't want to record it for future runs.
2463 # Also quote any args containing shell meta-characters.
2464 # Make two passes to allow for proper duplicate-argument suppression.
2465 ac_configure_args=
2466 ac_configure_args0=
2467 ac_configure_args1=
2468 ac_must_keep_next=false
2469 for ac_pass in 1 2
2470 do
2471   for ac_arg
2472   do
2473     case $ac_arg in
2474     -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
2475     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
2476     | -silent | --silent | --silen | --sile | --sil)
2477       continue ;;
2478     *\'*)
2479       ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
2480     esac
2481     case $ac_pass in
2482     1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2483     2)
2484       as_fn_append ac_configure_args1 " '$ac_arg'"
2485       if test $ac_must_keep_next = true; then
2486         ac_must_keep_next=false # Got value, back to normal.
2487       else
2488         case $ac_arg in
2489           *=* | --config-cache | -C | -disable-* | --disable-* \
2490           | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
2491           | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
2492           | -with-* | --with-* | -without-* | --without-* | --x)
2493             case "$ac_configure_args0 " in
2494               "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
2495             esac
2496             ;;
2497           -* ) ac_must_keep_next=true ;;
2498         esac
2499       fi
2500       as_fn_append ac_configure_args " '$ac_arg'"
2501       ;;
2502     esac
2503   done
2504 done
2505 { ac_configure_args0=; unset ac_configure_args0;}
2506 { ac_configure_args1=; unset ac_configure_args1;}
2507
2508 # When interrupted or exit'd, cleanup temporary files, and complete
2509 # config.log.  We remove comments because anyway the quotes in there
2510 # would cause problems or look ugly.
2511 # WARNING: Use '\'' to represent an apostrophe within the trap.
2512 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
2513 trap 'exit_status=$?
2514   # Save into config.log some information that might help in debugging.
2515   {
2516     echo
2517
2518     $as_echo "## ---------------- ##
2519 ## Cache variables. ##
2520 ## ---------------- ##"
2521     echo
2522     # The following way of writing the cache mishandles newlines in values,
2523 (
2524   for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
2525     eval ac_val=\$$ac_var
2526     case $ac_val in #(
2527     *${as_nl}*)
2528       case $ac_var in #(
2529       *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
2530 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2531       esac
2532       case $ac_var in #(
2533       _ | IFS | as_nl) ;; #(
2534       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
2535       *) { eval $ac_var=; unset $ac_var;} ;;
2536       esac ;;
2537     esac
2538   done
2539   (set) 2>&1 |
2540     case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
2541     *${as_nl}ac_space=\ *)
2542       sed -n \
2543         "s/'\''/'\''\\\\'\'''\''/g;
2544           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
2545       ;; #(
2546     *)
2547       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
2548       ;;
2549     esac |
2550     sort
2551 )
2552     echo
2553
2554     $as_echo "## ----------------- ##
2555 ## Output variables. ##
2556 ## ----------------- ##"
2557     echo
2558     for ac_var in $ac_subst_vars
2559     do
2560       eval ac_val=\$$ac_var
2561       case $ac_val in
2562       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2563       esac
2564       $as_echo "$ac_var='\''$ac_val'\''"
2565     done | sort
2566     echo
2567
2568     if test -n "$ac_subst_files"; then
2569       $as_echo "## ------------------- ##
2570 ## File substitutions. ##
2571 ## ------------------- ##"
2572       echo
2573       for ac_var in $ac_subst_files
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     fi
2583
2584     if test -s confdefs.h; then
2585       $as_echo "## ----------- ##
2586 ## confdefs.h. ##
2587 ## ----------- ##"
2588       echo
2589       cat confdefs.h
2590       echo
2591     fi
2592     test "$ac_signal" != 0 &&
2593       $as_echo "$as_me: caught signal $ac_signal"
2594     $as_echo "$as_me: exit $exit_status"
2595   } >&5
2596   rm -f core *.core core.conftest.* &&
2597     rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
2598     exit $exit_status
2599 ' 0
2600 for ac_signal in 1 2 13 15; do
2601   trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
2602 done
2603 ac_signal=0
2604
2605 # confdefs.h avoids OS command line length limits that DEFS can exceed.
2606 rm -f -r conftest* confdefs.h
2607
2608 $as_echo "/* confdefs.h */" > confdefs.h
2609
2610 # Predefined preprocessor variables.
2611
2612 cat >>confdefs.h <<_ACEOF
2613 #define PACKAGE_NAME "$PACKAGE_NAME"
2614 _ACEOF
2615
2616 cat >>confdefs.h <<_ACEOF
2617 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
2618 _ACEOF
2619
2620 cat >>confdefs.h <<_ACEOF
2621 #define PACKAGE_VERSION "$PACKAGE_VERSION"
2622 _ACEOF
2623
2624 cat >>confdefs.h <<_ACEOF
2625 #define PACKAGE_STRING "$PACKAGE_STRING"
2626 _ACEOF
2627
2628 cat >>confdefs.h <<_ACEOF
2629 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
2630 _ACEOF
2631
2632 cat >>confdefs.h <<_ACEOF
2633 #define PACKAGE_URL "$PACKAGE_URL"
2634 _ACEOF
2635
2636
2637 # Let the site file select an alternate cache file if it wants to.
2638 # Prefer an explicitly selected file to automatically selected ones.
2639 ac_site_file1=NONE
2640 ac_site_file2=NONE
2641 if test -n "$CONFIG_SITE"; then
2642   # We do not want a PATH search for config.site.
2643   case $CONFIG_SITE in #((
2644     -*)  ac_site_file1=./$CONFIG_SITE;;
2645     */*) ac_site_file1=$CONFIG_SITE;;
2646     *)   ac_site_file1=./$CONFIG_SITE;;
2647   esac
2648 elif test "x$prefix" != xNONE; then
2649   ac_site_file1=$prefix/share/config.site
2650   ac_site_file2=$prefix/etc/config.site
2651 else
2652   ac_site_file1=$ac_default_prefix/share/config.site
2653   ac_site_file2=$ac_default_prefix/etc/config.site
2654 fi
2655 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
2656 do
2657   test "x$ac_site_file" = xNONE && continue
2658   if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
2659     { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2660 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
2661     sed 's/^/| /' "$ac_site_file" >&5
2662     . "$ac_site_file" \
2663       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2664 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2665 as_fn_error $? "failed to load site script $ac_site_file
2666 See \`config.log' for more details" "$LINENO" 5; }
2667   fi
2668 done
2669
2670 if test -r "$cache_file"; then
2671   # Some versions of bash will fail to source /dev/null (special files
2672   # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
2673   if test /dev/null != "$cache_file" && test -f "$cache_file"; then
2674     { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
2675 $as_echo "$as_me: loading cache $cache_file" >&6;}
2676     case $cache_file in
2677       [\\/]* | ?:[\\/]* ) . "$cache_file";;
2678       *)                      . "./$cache_file";;
2679     esac
2680   fi
2681 else
2682   { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
2683 $as_echo "$as_me: creating cache $cache_file" >&6;}
2684   >$cache_file
2685 fi
2686
2687 # Check that the precious variables saved in the cache have kept the same
2688 # value.
2689 ac_cache_corrupted=false
2690 for ac_var in $ac_precious_vars; do
2691   eval ac_old_set=\$ac_cv_env_${ac_var}_set
2692   eval ac_new_set=\$ac_env_${ac_var}_set
2693   eval ac_old_val=\$ac_cv_env_${ac_var}_value
2694   eval ac_new_val=\$ac_env_${ac_var}_value
2695   case $ac_old_set,$ac_new_set in
2696     set,)
2697       { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
2698 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
2699       ac_cache_corrupted=: ;;
2700     ,set)
2701       { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
2702 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
2703       ac_cache_corrupted=: ;;
2704     ,);;
2705     *)
2706       if test "x$ac_old_val" != "x$ac_new_val"; then
2707         # differences in whitespace do not lead to failure.
2708         ac_old_val_w=`echo x $ac_old_val`
2709         ac_new_val_w=`echo x $ac_new_val`
2710         if test "$ac_old_val_w" != "$ac_new_val_w"; then
2711           { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
2712 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
2713           ac_cache_corrupted=:
2714         else
2715           { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
2716 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
2717           eval $ac_var=\$ac_old_val
2718         fi
2719         { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
2720 $as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
2721         { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
2722 $as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
2723       fi;;
2724   esac
2725   # Pass precious variables to config.status.
2726   if test "$ac_new_set" = set; then
2727     case $ac_new_val in
2728     *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
2729     *) ac_arg=$ac_var=$ac_new_val ;;
2730     esac
2731     case " $ac_configure_args " in
2732       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
2733       *) as_fn_append ac_configure_args " '$ac_arg'" ;;
2734     esac
2735   fi
2736 done
2737 if $ac_cache_corrupted; then
2738   { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2739 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2740   { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
2741 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
2742   as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
2743 fi
2744 ## -------------------- ##
2745 ## Main body of script. ##
2746 ## -------------------- ##
2747
2748 ac_ext=c
2749 ac_cpp='$CPP $CPPFLAGS'
2750 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2751 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2752 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2753
2754
2755
2756
2757
2758
2759 ac_aux_dir=
2760 for ac_dir in config "$srcdir"/config; do
2761   if test -f "$ac_dir/install-sh"; then
2762     ac_aux_dir=$ac_dir
2763     ac_install_sh="$ac_aux_dir/install-sh -c"
2764     break
2765   elif test -f "$ac_dir/install.sh"; then
2766     ac_aux_dir=$ac_dir
2767     ac_install_sh="$ac_aux_dir/install.sh -c"
2768     break
2769   elif test -f "$ac_dir/shtool"; then
2770     ac_aux_dir=$ac_dir
2771     ac_install_sh="$ac_aux_dir/shtool install -c"
2772     break
2773   fi
2774 done
2775 if test -z "$ac_aux_dir"; then
2776   as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5
2777 fi
2778
2779 # These three variables are undocumented and unsupported,
2780 # and are intended to be withdrawn in a future Autoconf release.
2781 # They can cause serious problems if a builder's source tree is in a directory
2782 # whose full name contains unusual characters.
2783 ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
2784 ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
2785 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
2786
2787
2788
2789 configure_args=$ac_configure_args
2790
2791
2792 PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`
2793
2794
2795 cat >>confdefs.h <<_ACEOF
2796 #define PG_MAJORVERSION "$PG_MAJORVERSION"
2797 _ACEOF
2798
2799
2800
2801
2802
2803 # Check whether --with-extra-version was given.
2804 if test "${with_extra_version+set}" = set; then :
2805   withval=$with_extra_version;
2806   case $withval in
2807     yes)
2808       as_fn_error $? "argument required for --with-extra-version option" "$LINENO" 5
2809       ;;
2810     no)
2811       as_fn_error $? "argument required for --with-extra-version option" "$LINENO" 5
2812       ;;
2813     *)
2814       PG_VERSION="$PACKAGE_VERSION$withval"
2815       ;;
2816   esac
2817
2818 else
2819   PG_VERSION="$PACKAGE_VERSION"
2820 fi
2821
2822
2823
2824 cat >>confdefs.h <<_ACEOF
2825 #define PG_VERSION "$PG_VERSION"
2826 _ACEOF
2827
2828
2829 # Make sure we can run config.sub.
2830 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
2831   as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
2832
2833 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
2834 $as_echo_n "checking build system type... " >&6; }
2835 if ${ac_cv_build+:} false; then :
2836   $as_echo_n "(cached) " >&6
2837 else
2838   ac_build_alias=$build_alias
2839 test "x$ac_build_alias" = x &&
2840   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
2841 test "x$ac_build_alias" = x &&
2842   as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
2843 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
2844   as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
2845
2846 fi
2847 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
2848 $as_echo "$ac_cv_build" >&6; }
2849 case $ac_cv_build in
2850 *-*-*) ;;
2851 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
2852 esac
2853 build=$ac_cv_build
2854 ac_save_IFS=$IFS; IFS='-'
2855 set x $ac_cv_build
2856 shift
2857 build_cpu=$1
2858 build_vendor=$2
2859 shift; shift
2860 # Remember, the first character of IFS is used to create $*,
2861 # except with old shells:
2862 build_os=$*
2863 IFS=$ac_save_IFS
2864 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
2865
2866
2867 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
2868 $as_echo_n "checking host system type... " >&6; }
2869 if ${ac_cv_host+:} false; then :
2870   $as_echo_n "(cached) " >&6
2871 else
2872   if test "x$host_alias" = x; then
2873   ac_cv_host=$ac_cv_build
2874 else
2875   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
2876     as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
2877 fi
2878
2879 fi
2880 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
2881 $as_echo "$ac_cv_host" >&6; }
2882 case $ac_cv_host in
2883 *-*-*) ;;
2884 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
2885 esac
2886 host=$ac_cv_host
2887 ac_save_IFS=$IFS; IFS='-'
2888 set x $ac_cv_host
2889 shift
2890 host_cpu=$1
2891 host_vendor=$2
2892 shift; shift
2893 # Remember, the first character of IFS is used to create $*,
2894 # except with old shells:
2895 host_os=$*
2896 IFS=$ac_save_IFS
2897 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
2898
2899
2900
2901 template=
2902 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which template to use" >&5
2903 $as_echo_n "checking which template to use... " >&6; }
2904
2905
2906
2907
2908 # Check whether --with-template was given.
2909 if test "${with_template+set}" = set; then :
2910   withval=$with_template;
2911   case $withval in
2912     yes)
2913       as_fn_error $? "argument required for --with-template option" "$LINENO" 5
2914       ;;
2915     no)
2916       as_fn_error $? "argument required for --with-template option" "$LINENO" 5
2917       ;;
2918     *)
2919
2920   case $withval in
2921     list)   echo; ls "$srcdir/src/template"; exit;;
2922     *)      if test -f "$srcdir/src/template/$with_template" ; then
2923               template=$withval
2924             else
2925               as_fn_error $? "'$withval' is not a valid template name. Use 'list' for a list." "$LINENO" 5
2926             fi;;
2927   esac
2928
2929       ;;
2930   esac
2931
2932 else
2933
2934 # --with-template not given
2935
2936 case $host_os in
2937      aix*) template=aix ;;
2938   cygwin*) template=cygwin ;;
2939   darwin*) template=darwin ;;
2940 dragonfly*) template=netbsd ;;
2941  freebsd*) template=freebsd ;;
2942     hpux*) template=hpux ;;
2943  linux*|gnu*|k*bsd*-gnu)
2944            template=linux ;;
2945    mingw*) template=win32 ;;
2946   netbsd*) template=netbsd ;;
2947  openbsd*) template=openbsd ;;
2948  solaris*) template=solaris ;;
2949 esac
2950
2951   if test x"$template" = x"" ; then
2952     as_fn_error $? "
2953 *******************************************************************
2954 PostgreSQL has apparently not been ported to your platform yet.
2955 To try a manual configuration, look into the src/template directory
2956 for a similar platform and use the '--with-template=' option.
2957
2958 Please also contact <pgsql-bugs@postgresql.org> to see about
2959 rectifying this.  Include the above 'checking host system type...'
2960 line.
2961 *******************************************************************
2962 " "$LINENO" 5
2963   fi
2964
2965
2966 fi
2967
2968
2969
2970 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $template" >&5
2971 $as_echo "$template" >&6; }
2972
2973 PORTNAME=$template
2974
2975
2976 # Initialize default assumption that we do not need separate assembly code
2977 # for TAS (test-and-set).  This can be overridden by the template file
2978 # when it's executed.
2979 need_tas=no
2980 tas_file=dummy.s
2981
2982
2983
2984 ##
2985 ## Command line options
2986 ##
2987
2988 #
2989 # Add non-standard directories to the include path
2990 #
2991
2992
2993
2994 # Check whether --with-includes was given.
2995 if test "${with_includes+set}" = set; then :
2996   withval=$with_includes;
2997   case $withval in
2998     yes)
2999       as_fn_error $? "argument required for --with-includes option" "$LINENO" 5
3000       ;;
3001     no)
3002       as_fn_error $? "argument required for --with-includes option" "$LINENO" 5
3003       ;;
3004     *)
3005
3006       ;;
3007   esac
3008
3009 fi
3010
3011
3012
3013
3014 #
3015 # Add non-standard directories to the library search path
3016 #
3017
3018
3019
3020 # Check whether --with-libraries was given.
3021 if test "${with_libraries+set}" = set; then :
3022   withval=$with_libraries;
3023   case $withval in
3024     yes)
3025       as_fn_error $? "argument required for --with-libraries option" "$LINENO" 5
3026       ;;
3027     no)
3028       as_fn_error $? "argument required for --with-libraries option" "$LINENO" 5
3029       ;;
3030     *)
3031       LIBRARY_DIRS=$withval
3032       ;;
3033   esac
3034
3035 fi
3036
3037
3038
3039
3040
3041
3042 # Check whether --with-libs was given.
3043 if test "${with_libs+set}" = set; then :
3044   withval=$with_libs;
3045   case $withval in
3046     yes)
3047       as_fn_error $? "argument required for --with-libs option" "$LINENO" 5
3048       ;;
3049     no)
3050       as_fn_error $? "argument required for --with-libs option" "$LINENO" 5
3051       ;;
3052     *)
3053       LIBRARY_DIRS=$withval
3054       ;;
3055   esac
3056
3057 fi
3058
3059
3060
3061
3062 #
3063 # 64-bit integer date/time storage is now the only option, but to avoid
3064 # unnecessary breakage of build scripts, continue to accept an explicit
3065 # "--enable-integer-datetimes" switch.
3066 #
3067
3068
3069 # Check whether --enable-integer-datetimes was given.
3070 if test "${enable_integer_datetimes+set}" = set; then :
3071   enableval=$enable_integer_datetimes;
3072   case $enableval in
3073     yes)
3074       :
3075       ;;
3076     no)
3077       as_fn_error $? "--disable-integer-datetimes is no longer supported" "$LINENO" 5
3078       ;;
3079     *)
3080       as_fn_error $? "no argument expected for --enable-integer-datetimes option" "$LINENO" 5
3081       ;;
3082   esac
3083
3084 else
3085   enable_integer_datetimes=yes
3086
3087 fi
3088
3089
3090
3091
3092 #
3093 # NLS
3094 #
3095 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is wanted" >&5
3096 $as_echo_n "checking whether NLS is wanted... " >&6; }
3097
3098
3099 # Check whether --enable-nls was given.
3100 if test "${enable_nls+set}" = set; then :
3101   enableval=$enable_nls;
3102   case $enableval in
3103     yes)
3104       :
3105       ;;
3106     no)
3107       :
3108       ;;
3109     *)
3110       enable_nls=yes
3111 WANTED_LANGUAGES=$enableval
3112       ;;
3113   esac
3114
3115 else
3116   enable_nls=no
3117 fi
3118
3119
3120
3121 if test "$enable_nls" = yes; then
3122
3123 $as_echo "#define ENABLE_NLS 1" >>confdefs.h
3124
3125 fi
3126
3127 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_nls" >&5
3128 $as_echo "$enable_nls" >&6; }
3129
3130
3131
3132 #
3133 # Default port number (--with-pgport), default 5432
3134 #
3135 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for default port number" >&5
3136 $as_echo_n "checking for default port number... " >&6; }
3137
3138
3139
3140 # Check whether --with-pgport was given.
3141 if test "${with_pgport+set}" = set; then :
3142   withval=$with_pgport;
3143   case $withval in
3144     yes)
3145       as_fn_error $? "argument required for --with-pgport option" "$LINENO" 5
3146       ;;
3147     no)
3148       as_fn_error $? "argument required for --with-pgport option" "$LINENO" 5
3149       ;;
3150     *)
3151       default_port=$withval
3152       ;;
3153   esac
3154
3155 else
3156   default_port=5432
3157 fi
3158
3159
3160 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $default_port" >&5
3161 $as_echo "$default_port" >&6; }
3162 # Need both of these because some places want an integer and some a string
3163
3164 cat >>confdefs.h <<_ACEOF
3165 #define DEF_PGPORT ${default_port}
3166 _ACEOF
3167
3168
3169 cat >>confdefs.h <<_ACEOF
3170 #define DEF_PGPORT_STR "${default_port}"
3171 _ACEOF
3172
3173
3174
3175 # It's worth validating port; you can get very confusing errors otherwise
3176 if test x"$default_port" = x""; then
3177   as_fn_error $? "invalid --with-pgport specification: empty string" "$LINENO" 5
3178 elif test ! x`echo "$default_port" | sed -e 's/[0-9]*//'` = x""; then
3179   as_fn_error $? "invalid --with-pgport specification: must be a number" "$LINENO" 5
3180 elif test ! x`echo "$default_port" | sed -e 's/^0.//'` = x"$default_port"; then
3181   as_fn_error $? "invalid --with-pgport specification: must not have leading 0" "$LINENO" 5
3182 elif test "$default_port" -lt "1" -o "$default_port" -gt "65535"; then
3183   as_fn_error $? "invalid --with-pgport specification: must be between 1 and 65535" "$LINENO" 5
3184 fi
3185
3186 #
3187 # '-rpath'-like feature can be disabled
3188 #
3189
3190
3191 # Check whether --enable-rpath was given.
3192 if test "${enable_rpath+set}" = set; then :
3193   enableval=$enable_rpath;
3194   case $enableval in
3195     yes)
3196       :
3197       ;;
3198     no)
3199       :
3200       ;;
3201     *)
3202       as_fn_error $? "no argument expected for --enable-rpath option" "$LINENO" 5
3203       ;;
3204   esac
3205
3206 else
3207   enable_rpath=yes
3208
3209 fi
3210
3211
3212
3213
3214 #
3215 # Spinlocks
3216 #
3217
3218
3219 # Check whether --enable-spinlocks was given.
3220 if test "${enable_spinlocks+set}" = set; then :
3221   enableval=$enable_spinlocks;
3222   case $enableval in
3223     yes)
3224       :
3225       ;;
3226     no)
3227       :
3228       ;;
3229     *)
3230       as_fn_error $? "no argument expected for --enable-spinlocks option" "$LINENO" 5
3231       ;;
3232   esac
3233
3234 else
3235   enable_spinlocks=yes
3236
3237 fi
3238
3239
3240
3241 #
3242 # Atomic operations
3243 #
3244
3245
3246 # Check whether --enable-atomics was given.
3247 if test "${enable_atomics+set}" = set; then :
3248   enableval=$enable_atomics;
3249   case $enableval in
3250     yes)
3251       :
3252       ;;
3253     no)
3254       :
3255       ;;
3256     *)
3257       as_fn_error $? "no argument expected for --enable-atomics option" "$LINENO" 5
3258       ;;
3259   esac
3260
3261 else
3262   enable_atomics=yes
3263
3264 fi
3265
3266
3267
3268 #
3269 # Random number generation
3270 #
3271
3272
3273 # Check whether --enable-strong-random was given.
3274 if test "${enable_strong_random+set}" = set; then :
3275   enableval=$enable_strong_random;
3276   case $enableval in
3277     yes)
3278       :
3279       ;;
3280     no)
3281       :
3282       ;;
3283     *)
3284       as_fn_error $? "no argument expected for --enable-strong-random option" "$LINENO" 5
3285       ;;
3286   esac
3287
3288 else
3289   enable_strong_random=yes
3290
3291 fi
3292
3293
3294
3295
3296 #
3297 # --enable-debug adds -g to compiler flags
3298 #
3299
3300
3301 # Check whether --enable-debug was given.
3302 if test "${enable_debug+set}" = set; then :
3303   enableval=$enable_debug;
3304   case $enableval in
3305     yes)
3306       :
3307       ;;
3308     no)
3309       :
3310       ;;
3311     *)
3312       as_fn_error $? "no argument expected for --enable-debug option" "$LINENO" 5
3313       ;;
3314   esac
3315
3316 else
3317   enable_debug=no
3318
3319 fi
3320
3321
3322
3323
3324 #
3325 # --enable-profiling enables gcc profiling
3326 #
3327
3328
3329 # Check whether --enable-profiling was given.
3330 if test "${enable_profiling+set}" = set; then :
3331   enableval=$enable_profiling;
3332   case $enableval in
3333     yes)
3334       :
3335       ;;
3336     no)
3337       :
3338       ;;
3339     *)
3340       as_fn_error $? "no argument expected for --enable-profiling option" "$LINENO" 5
3341       ;;
3342   esac
3343
3344 else
3345   enable_profiling=no
3346
3347 fi
3348
3349
3350
3351 #
3352 # --enable-coverage enables generation of code coverage metrics with gcov
3353 #
3354
3355
3356 # Check whether --enable-coverage was given.
3357 if test "${enable_coverage+set}" = set; then :
3358   enableval=$enable_coverage;
3359   case $enableval in
3360     yes)
3361       if test -z "$GCOV"; then
3362   for ac_prog in gcov
3363 do
3364   # Extract the first word of "$ac_prog", so it can be a program name with args.
3365 set dummy $ac_prog; ac_word=$2
3366 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3367 $as_echo_n "checking for $ac_word... " >&6; }
3368 if ${ac_cv_path_GCOV+:} false; then :
3369   $as_echo_n "(cached) " >&6
3370 else
3371   case $GCOV in
3372   [\\/]* | ?:[\\/]*)
3373   ac_cv_path_GCOV="$GCOV" # Let the user override the test with a path.
3374   ;;
3375   *)
3376   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3377 for as_dir in $PATH
3378 do
3379   IFS=$as_save_IFS
3380   test -z "$as_dir" && as_dir=.
3381     for ac_exec_ext in '' $ac_executable_extensions; do
3382   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3383     ac_cv_path_GCOV="$as_dir/$ac_word$ac_exec_ext"
3384     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3385     break 2
3386   fi
3387 done
3388   done
3389 IFS=$as_save_IFS
3390
3391   ;;
3392 esac
3393 fi
3394 GCOV=$ac_cv_path_GCOV
3395 if test -n "$GCOV"; then
3396   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5
3397 $as_echo "$GCOV" >&6; }
3398 else
3399   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3400 $as_echo "no" >&6; }
3401 fi
3402
3403
3404   test -n "$GCOV" && break
3405 done
3406
3407 else
3408   # Report the value of GCOV in configure's output in all cases.
3409   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCOV" >&5
3410 $as_echo_n "checking for GCOV... " >&6; }
3411   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5
3412 $as_echo "$GCOV" >&6; }
3413 fi
3414
3415 if test -z "$GCOV"; then
3416   as_fn_error $? "gcov not found" "$LINENO" 5
3417 fi
3418 if test -z "$LCOV"; then
3419   for ac_prog in lcov
3420 do
3421   # Extract the first word of "$ac_prog", so it can be a program name with args.
3422 set dummy $ac_prog; ac_word=$2
3423 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3424 $as_echo_n "checking for $ac_word... " >&6; }
3425 if ${ac_cv_path_LCOV+:} false; then :
3426   $as_echo_n "(cached) " >&6
3427 else
3428   case $LCOV in
3429   [\\/]* | ?:[\\/]*)
3430   ac_cv_path_LCOV="$LCOV" # Let the user override the test with a path.
3431   ;;
3432   *)
3433   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3434 for as_dir in $PATH
3435 do
3436   IFS=$as_save_IFS
3437   test -z "$as_dir" && as_dir=.
3438     for ac_exec_ext in '' $ac_executable_extensions; do
3439   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3440     ac_cv_path_LCOV="$as_dir/$ac_word$ac_exec_ext"
3441     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3442     break 2
3443   fi
3444 done
3445   done
3446 IFS=$as_save_IFS
3447
3448   ;;
3449 esac
3450 fi
3451 LCOV=$ac_cv_path_LCOV
3452 if test -n "$LCOV"; then
3453   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5
3454 $as_echo "$LCOV" >&6; }
3455 else
3456   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3457 $as_echo "no" >&6; }
3458 fi
3459
3460
3461   test -n "$LCOV" && break
3462 done
3463
3464 else
3465   # Report the value of LCOV in configure's output in all cases.
3466   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LCOV" >&5
3467 $as_echo_n "checking for LCOV... " >&6; }
3468   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5
3469 $as_echo "$LCOV" >&6; }
3470 fi
3471
3472 if test -z "$LCOV"; then
3473   as_fn_error $? "lcov not found" "$LINENO" 5
3474 fi
3475 if test -z "$GENHTML"; then
3476   for ac_prog in genhtml
3477 do
3478   # Extract the first word of "$ac_prog", so it can be a program name with args.
3479 set dummy $ac_prog; ac_word=$2
3480 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3481 $as_echo_n "checking for $ac_word... " >&6; }
3482 if ${ac_cv_path_GENHTML+:} false; then :
3483   $as_echo_n "(cached) " >&6
3484 else
3485   case $GENHTML in
3486   [\\/]* | ?:[\\/]*)
3487   ac_cv_path_GENHTML="$GENHTML" # Let the user override the test with a path.
3488   ;;
3489   *)
3490   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3491 for as_dir in $PATH
3492 do
3493   IFS=$as_save_IFS
3494   test -z "$as_dir" && as_dir=.
3495     for ac_exec_ext in '' $ac_executable_extensions; do
3496   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3497     ac_cv_path_GENHTML="$as_dir/$ac_word$ac_exec_ext"
3498     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3499     break 2
3500   fi
3501 done
3502   done
3503 IFS=$as_save_IFS
3504
3505   ;;
3506 esac
3507 fi
3508 GENHTML=$ac_cv_path_GENHTML
3509 if test -n "$GENHTML"; then
3510   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5
3511 $as_echo "$GENHTML" >&6; }
3512 else
3513   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3514 $as_echo "no" >&6; }
3515 fi
3516
3517
3518   test -n "$GENHTML" && break
3519 done
3520
3521 else
3522   # Report the value of GENHTML in configure's output in all cases.
3523   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GENHTML" >&5
3524 $as_echo_n "checking for GENHTML... " >&6; }
3525   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5
3526 $as_echo "$GENHTML" >&6; }
3527 fi
3528
3529 if test -z "$GENHTML"; then
3530   as_fn_error $? "genhtml not found" "$LINENO" 5
3531 fi
3532       ;;
3533     no)
3534       :
3535       ;;
3536     *)
3537       as_fn_error $? "no argument expected for --enable-coverage option" "$LINENO" 5
3538       ;;
3539   esac
3540
3541 else
3542   enable_coverage=no
3543
3544 fi
3545
3546
3547
3548
3549 #
3550 # DTrace
3551 #
3552
3553
3554 # Check whether --enable-dtrace was given.
3555 if test "${enable_dtrace+set}" = set; then :
3556   enableval=$enable_dtrace;
3557   case $enableval in
3558     yes)
3559       if test -z "$DTRACE"; then
3560   for ac_prog in dtrace
3561 do
3562   # Extract the first word of "$ac_prog", so it can be a program name with args.
3563 set dummy $ac_prog; ac_word=$2
3564 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3565 $as_echo_n "checking for $ac_word... " >&6; }
3566 if ${ac_cv_path_DTRACE+:} false; then :
3567   $as_echo_n "(cached) " >&6
3568 else
3569   case $DTRACE in
3570   [\\/]* | ?:[\\/]*)
3571   ac_cv_path_DTRACE="$DTRACE" # Let the user override the test with a path.
3572   ;;
3573   *)
3574   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3575 for as_dir in $PATH
3576 do
3577   IFS=$as_save_IFS
3578   test -z "$as_dir" && as_dir=.
3579     for ac_exec_ext in '' $ac_executable_extensions; do
3580   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3581     ac_cv_path_DTRACE="$as_dir/$ac_word$ac_exec_ext"
3582     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3583     break 2
3584   fi
3585 done
3586   done
3587 IFS=$as_save_IFS
3588
3589   ;;
3590 esac
3591 fi
3592 DTRACE=$ac_cv_path_DTRACE
3593 if test -n "$DTRACE"; then
3594   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5
3595 $as_echo "$DTRACE" >&6; }
3596 else
3597   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3598 $as_echo "no" >&6; }
3599 fi
3600
3601
3602   test -n "$DTRACE" && break
3603 done
3604
3605 else
3606   # Report the value of DTRACE in configure's output in all cases.
3607   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DTRACE" >&5
3608 $as_echo_n "checking for DTRACE... " >&6; }
3609   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5
3610 $as_echo "$DTRACE" >&6; }
3611 fi
3612
3613 if test -z "$DTRACE"; then
3614   as_fn_error $? "dtrace not found" "$LINENO" 5
3615 fi
3616
3617       ;;
3618     no)
3619       :
3620       ;;
3621     *)
3622       as_fn_error $? "no argument expected for --enable-dtrace option" "$LINENO" 5
3623       ;;
3624   esac
3625
3626 else
3627   enable_dtrace=no
3628
3629 fi
3630
3631
3632
3633
3634 #
3635 # TAP tests
3636 #
3637
3638
3639 # Check whether --enable-tap-tests was given.
3640 if test "${enable_tap_tests+set}" = set; then :
3641   enableval=$enable_tap_tests;
3642   case $enableval in
3643     yes)
3644       :
3645       ;;
3646     no)
3647       :
3648       ;;
3649     *)
3650       as_fn_error $? "no argument expected for --enable-tap-tests option" "$LINENO" 5
3651       ;;
3652   esac
3653
3654 else
3655   enable_tap_tests=no
3656
3657 fi
3658
3659
3660
3661
3662 #
3663 # Block size
3664 #
3665 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for block size" >&5
3666 $as_echo_n "checking for block size... " >&6; }
3667
3668
3669
3670 # Check whether --with-blocksize was given.
3671 if test "${with_blocksize+set}" = set; then :
3672   withval=$with_blocksize;
3673   case $withval in
3674     yes)
3675       as_fn_error $? "argument required for --with-blocksize option" "$LINENO" 5
3676       ;;
3677     no)
3678       as_fn_error $? "argument required for --with-blocksize option" "$LINENO" 5
3679       ;;
3680     *)
3681       blocksize=$withval
3682       ;;
3683   esac
3684
3685 else
3686   blocksize=8
3687 fi
3688
3689
3690 case ${blocksize} in
3691   1) BLCKSZ=1024;;
3692   2) BLCKSZ=2048;;
3693   4) BLCKSZ=4096;;
3694   8) BLCKSZ=8192;;
3695  16) BLCKSZ=16384;;
3696  32) BLCKSZ=32768;;
3697   *) as_fn_error $? "Invalid block size. Allowed values are 1,2,4,8,16,32." "$LINENO" 5
3698 esac
3699 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${blocksize}kB" >&5
3700 $as_echo "${blocksize}kB" >&6; }
3701
3702
3703 cat >>confdefs.h <<_ACEOF
3704 #define BLCKSZ ${BLCKSZ}
3705 _ACEOF
3706
3707
3708 #
3709 # Relation segment size
3710 #
3711 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for segment size" >&5
3712 $as_echo_n "checking for segment size... " >&6; }
3713
3714
3715
3716 # Check whether --with-segsize was given.
3717 if test "${with_segsize+set}" = set; then :
3718   withval=$with_segsize;
3719   case $withval in
3720     yes)
3721       as_fn_error $? "argument required for --with-segsize option" "$LINENO" 5
3722       ;;
3723     no)
3724       as_fn_error $? "argument required for --with-segsize option" "$LINENO" 5
3725       ;;
3726     *)
3727       segsize=$withval
3728       ;;
3729   esac
3730
3731 else
3732   segsize=1
3733 fi
3734
3735
3736 # this expression is set up to avoid unnecessary integer overflow
3737 # blocksize is already guaranteed to be a factor of 1024
3738 RELSEG_SIZE=`expr '(' 1024 / ${blocksize} ')' '*' ${segsize} '*' 1024`
3739 test $? -eq 0 || exit 1
3740 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${segsize}GB" >&5
3741 $as_echo "${segsize}GB" >&6; }
3742
3743
3744 cat >>confdefs.h <<_ACEOF
3745 #define RELSEG_SIZE ${RELSEG_SIZE}
3746 _ACEOF
3747
3748
3749 #
3750 # WAL block size
3751 #
3752 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAL block size" >&5
3753 $as_echo_n "checking for WAL block size... " >&6; }
3754
3755
3756
3757 # Check whether --with-wal-blocksize was given.
3758 if test "${with_wal_blocksize+set}" = set; then :
3759   withval=$with_wal_blocksize;
3760   case $withval in
3761     yes)
3762       as_fn_error $? "argument required for --with-wal-blocksize option" "$LINENO" 5
3763       ;;
3764     no)
3765       as_fn_error $? "argument required for --with-wal-blocksize option" "$LINENO" 5
3766       ;;
3767     *)
3768       wal_blocksize=$withval
3769       ;;
3770   esac
3771
3772 else
3773   wal_blocksize=8
3774 fi
3775
3776
3777 case ${wal_blocksize} in
3778   1) XLOG_BLCKSZ=1024;;
3779   2) XLOG_BLCKSZ=2048;;
3780   4) XLOG_BLCKSZ=4096;;
3781   8) XLOG_BLCKSZ=8192;;
3782  16) XLOG_BLCKSZ=16384;;
3783  32) XLOG_BLCKSZ=32768;;
3784  64) XLOG_BLCKSZ=65536;;
3785   *) as_fn_error $? "Invalid WAL block size. Allowed values are 1,2,4,8,16,32,64." "$LINENO" 5
3786 esac
3787 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${wal_blocksize}kB" >&5
3788 $as_echo "${wal_blocksize}kB" >&6; }
3789
3790
3791 cat >>confdefs.h <<_ACEOF
3792 #define XLOG_BLCKSZ ${XLOG_BLCKSZ}
3793 _ACEOF
3794
3795
3796 #
3797 # C compiler
3798 #
3799
3800 # For historical reasons you can also use --with-CC to specify the C compiler
3801 # to use, although the standard way to do this is to set the CC environment
3802 # variable.
3803
3804
3805
3806 # Check whether --with-CC was given.
3807 if test "${with_CC+set}" = set; then :
3808   withval=$with_CC;
3809   case $withval in
3810     yes)
3811       as_fn_error $? "argument required for --with-CC option" "$LINENO" 5
3812       ;;
3813     no)
3814       as_fn_error $? "argument required for --with-CC option" "$LINENO" 5
3815       ;;
3816     *)
3817       CC=$with_CC
3818       ;;
3819   esac
3820
3821 fi
3822
3823
3824
3825 case $template in
3826   aix) pgac_cc_list="gcc xlc"; pgac_cxx_list="g++ xlC";;
3827     *) pgac_cc_list="gcc cc"; pgac_cxx_list="g++ c++";;
3828 esac
3829
3830 ac_ext=c
3831 ac_cpp='$CPP $CPPFLAGS'
3832 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3833 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3834 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3835 if test -n "$ac_tool_prefix"; then
3836   for ac_prog in $pgac_cc_list
3837   do
3838     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3839 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3840 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3841 $as_echo_n "checking for $ac_word... " >&6; }
3842 if ${ac_cv_prog_CC+:} false; then :
3843   $as_echo_n "(cached) " >&6
3844 else
3845   if test -n "$CC"; then
3846   ac_cv_prog_CC="$CC" # Let the user override the test.
3847 else
3848 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3849 for as_dir in $PATH
3850 do
3851   IFS=$as_save_IFS
3852   test -z "$as_dir" && as_dir=.
3853     for ac_exec_ext in '' $ac_executable_extensions; do
3854   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3855     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3856     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3857     break 2
3858   fi
3859 done
3860   done
3861 IFS=$as_save_IFS
3862
3863 fi
3864 fi
3865 CC=$ac_cv_prog_CC
3866 if test -n "$CC"; then
3867   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3868 $as_echo "$CC" >&6; }
3869 else
3870   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3871 $as_echo "no" >&6; }
3872 fi
3873
3874
3875     test -n "$CC" && break
3876   done
3877 fi
3878 if test -z "$CC"; then
3879   ac_ct_CC=$CC
3880   for ac_prog in $pgac_cc_list
3881 do
3882   # Extract the first word of "$ac_prog", so it can be a program name with args.
3883 set dummy $ac_prog; ac_word=$2
3884 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3885 $as_echo_n "checking for $ac_word... " >&6; }
3886 if ${ac_cv_prog_ac_ct_CC+:} false; then :
3887   $as_echo_n "(cached) " >&6
3888 else
3889   if test -n "$ac_ct_CC"; then
3890   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3891 else
3892 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3893 for as_dir in $PATH
3894 do
3895   IFS=$as_save_IFS
3896   test -z "$as_dir" && as_dir=.
3897     for ac_exec_ext in '' $ac_executable_extensions; do
3898   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3899     ac_cv_prog_ac_ct_CC="$ac_prog"
3900     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3901     break 2
3902   fi
3903 done
3904   done
3905 IFS=$as_save_IFS
3906
3907 fi
3908 fi
3909 ac_ct_CC=$ac_cv_prog_ac_ct_CC
3910 if test -n "$ac_ct_CC"; then
3911   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3912 $as_echo "$ac_ct_CC" >&6; }
3913 else
3914   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3915 $as_echo "no" >&6; }
3916 fi
3917
3918
3919   test -n "$ac_ct_CC" && break
3920 done
3921
3922   if test "x$ac_ct_CC" = x; then
3923     CC=""
3924   else
3925     case $cross_compiling:$ac_tool_warned in
3926 yes:)
3927 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3928 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3929 ac_tool_warned=yes ;;
3930 esac
3931     CC=$ac_ct_CC
3932   fi
3933 fi
3934
3935
3936 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3937 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3938 as_fn_error $? "no acceptable C compiler found in \$PATH
3939 See \`config.log' for more details" "$LINENO" 5; }
3940
3941 # Provide some information about the compiler.
3942 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
3943 set X $ac_compile
3944 ac_compiler=$2
3945 for ac_option in --version -v -V -qversion; do
3946   { { ac_try="$ac_compiler $ac_option >&5"
3947 case "(($ac_try" in
3948   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3949   *) ac_try_echo=$ac_try;;
3950 esac
3951 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3952 $as_echo "$ac_try_echo"; } >&5
3953   (eval "$ac_compiler $ac_option >&5") 2>conftest.err
3954   ac_status=$?
3955   if test -s conftest.err; then
3956     sed '10a\
3957 ... rest of stderr output deleted ...
3958          10q' conftest.err >conftest.er1
3959     cat conftest.er1 >&5
3960   fi
3961   rm -f conftest.er1 conftest.err
3962   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3963   test $ac_status = 0; }
3964 done
3965
3966 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3967 /* end confdefs.h.  */
3968
3969 int
3970 main ()
3971 {
3972
3973   ;
3974   return 0;
3975 }
3976 _ACEOF
3977 ac_clean_files_save=$ac_clean_files
3978 ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
3979 # Try to create an executable without -o first, disregard a.out.
3980 # It will help us diagnose broken compilers, and finding out an intuition
3981 # of exeext.
3982 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
3983 $as_echo_n "checking whether the C compiler works... " >&6; }
3984 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
3985
3986 # The possible output files:
3987 ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
3988
3989 ac_rmfiles=
3990 for ac_file in $ac_files
3991 do
3992   case $ac_file in
3993     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3994     * ) ac_rmfiles="$ac_rmfiles $ac_file";;
3995   esac
3996 done
3997 rm -f $ac_rmfiles
3998
3999 if { { ac_try="$ac_link_default"
4000 case "(($ac_try" in
4001   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4002   *) ac_try_echo=$ac_try;;
4003 esac
4004 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4005 $as_echo "$ac_try_echo"; } >&5
4006   (eval "$ac_link_default") 2>&5
4007   ac_status=$?
4008   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4009   test $ac_status = 0; }; then :
4010   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
4011 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
4012 # in a Makefile.  We should not override ac_cv_exeext if it was cached,
4013 # so that the user can short-circuit this test for compilers unknown to
4014 # Autoconf.
4015 for ac_file in $ac_files ''
4016 do
4017   test -f "$ac_file" || continue
4018   case $ac_file in
4019     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
4020         ;;
4021     [ab].out )
4022         # We found the default executable, but exeext='' is most
4023         # certainly right.
4024         break;;
4025     *.* )
4026         if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
4027         then :; else
4028            ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4029         fi
4030         # We set ac_cv_exeext here because the later test for it is not
4031         # safe: cross compilers may not add the suffix if given an `-o'
4032         # argument, so we may need to know it at that point already.
4033         # Even if this section looks crufty: it has the advantage of
4034         # actually working.
4035         break;;
4036     * )
4037         break;;
4038   esac
4039 done
4040 test "$ac_cv_exeext" = no && ac_cv_exeext=
4041
4042 else
4043   ac_file=''
4044 fi
4045 if test -z "$ac_file"; then :
4046   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4047 $as_echo "no" >&6; }
4048 $as_echo "$as_me: failed program was:" >&5
4049 sed 's/^/| /' conftest.$ac_ext >&5
4050
4051 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4052 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4053 as_fn_error 77 "C compiler cannot create executables
4054 See \`config.log' for more details" "$LINENO" 5; }
4055 else
4056   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4057 $as_echo "yes" >&6; }
4058 fi
4059 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
4060 $as_echo_n "checking for C compiler default output file name... " >&6; }
4061 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
4062 $as_echo "$ac_file" >&6; }
4063 ac_exeext=$ac_cv_exeext
4064
4065 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
4066 ac_clean_files=$ac_clean_files_save
4067 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
4068 $as_echo_n "checking for suffix of executables... " >&6; }
4069 if { { ac_try="$ac_link"
4070 case "(($ac_try" in
4071   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4072   *) ac_try_echo=$ac_try;;
4073 esac
4074 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4075 $as_echo "$ac_try_echo"; } >&5
4076   (eval "$ac_link") 2>&5
4077   ac_status=$?
4078   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4079   test $ac_status = 0; }; then :
4080   # If both `conftest.exe' and `conftest' are `present' (well, observable)
4081 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
4082 # work properly (i.e., refer to `conftest.exe'), while it won't with
4083 # `rm'.
4084 for ac_file in conftest.exe conftest conftest.*; do
4085   test -f "$ac_file" || continue
4086   case $ac_file in
4087     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4088     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4089           break;;
4090     * ) break;;
4091   esac
4092 done
4093 else
4094   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4095 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4096 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
4097 See \`config.log' for more details" "$LINENO" 5; }
4098 fi
4099 rm -f conftest conftest$ac_cv_exeext
4100 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
4101 $as_echo "$ac_cv_exeext" >&6; }
4102
4103 rm -f conftest.$ac_ext
4104 EXEEXT=$ac_cv_exeext
4105 ac_exeext=$EXEEXT
4106 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4107 /* end confdefs.h.  */
4108 #include <stdio.h>
4109 int
4110 main ()
4111 {
4112 FILE *f = fopen ("conftest.out", "w");
4113  return ferror (f) || fclose (f) != 0;
4114
4115   ;
4116   return 0;
4117 }
4118 _ACEOF
4119 ac_clean_files="$ac_clean_files conftest.out"
4120 # Check that the compiler produces executables we can run.  If not, either
4121 # the compiler is broken, or we cross compile.
4122 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
4123 $as_echo_n "checking whether we are cross compiling... " >&6; }
4124 if test "$cross_compiling" != yes; then
4125   { { ac_try="$ac_link"
4126 case "(($ac_try" in
4127   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4128   *) ac_try_echo=$ac_try;;
4129 esac
4130 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4131 $as_echo "$ac_try_echo"; } >&5
4132   (eval "$ac_link") 2>&5
4133   ac_status=$?
4134   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4135   test $ac_status = 0; }
4136   if { ac_try='./conftest$ac_cv_exeext'
4137   { { case "(($ac_try" in
4138   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4139   *) ac_try_echo=$ac_try;;
4140 esac
4141 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4142 $as_echo "$ac_try_echo"; } >&5
4143   (eval "$ac_try") 2>&5
4144   ac_status=$?
4145   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4146   test $ac_status = 0; }; }; then
4147     cross_compiling=no
4148   else
4149     if test "$cross_compiling" = maybe; then
4150         cross_compiling=yes
4151     else
4152         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4153 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4154 as_fn_error $? "cannot run C compiled programs.
4155 If you meant to cross compile, use \`--host'.
4156 See \`config.log' for more details" "$LINENO" 5; }
4157     fi
4158   fi
4159 fi
4160 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
4161 $as_echo "$cross_compiling" >&6; }
4162
4163 rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
4164 ac_clean_files=$ac_clean_files_save
4165 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
4166 $as_echo_n "checking for suffix of object files... " >&6; }
4167 if ${ac_cv_objext+:} false; then :
4168   $as_echo_n "(cached) " >&6
4169 else
4170   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4171 /* end confdefs.h.  */
4172
4173 int
4174 main ()
4175 {
4176
4177   ;
4178   return 0;
4179 }
4180 _ACEOF
4181 rm -f conftest.o conftest.obj
4182 if { { ac_try="$ac_compile"
4183 case "(($ac_try" in
4184   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4185   *) ac_try_echo=$ac_try;;
4186 esac
4187 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4188 $as_echo "$ac_try_echo"; } >&5
4189   (eval "$ac_compile") 2>&5
4190   ac_status=$?
4191   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4192   test $ac_status = 0; }; then :
4193   for ac_file in conftest.o conftest.obj conftest.*; do
4194   test -f "$ac_file" || continue;
4195   case $ac_file in
4196     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
4197     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
4198        break;;
4199   esac
4200 done
4201 else
4202   $as_echo "$as_me: failed program was:" >&5
4203 sed 's/^/| /' conftest.$ac_ext >&5
4204
4205 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4206 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4207 as_fn_error $? "cannot compute suffix of object files: cannot compile
4208 See \`config.log' for more details" "$LINENO" 5; }
4209 fi
4210 rm -f conftest.$ac_cv_objext conftest.$ac_ext
4211 fi
4212 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
4213 $as_echo "$ac_cv_objext" >&6; }
4214 OBJEXT=$ac_cv_objext
4215 ac_objext=$OBJEXT
4216 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
4217 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
4218 if ${ac_cv_c_compiler_gnu+:} false; then :
4219   $as_echo_n "(cached) " >&6
4220 else
4221   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4222 /* end confdefs.h.  */
4223
4224 int
4225 main ()
4226 {
4227 #ifndef __GNUC__
4228        choke me
4229 #endif
4230
4231   ;
4232   return 0;
4233 }
4234 _ACEOF
4235 if ac_fn_c_try_compile "$LINENO"; then :
4236   ac_compiler_gnu=yes
4237 else
4238   ac_compiler_gnu=no
4239 fi
4240 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4241 ac_cv_c_compiler_gnu=$ac_compiler_gnu
4242
4243 fi
4244 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4245 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
4246 if test $ac_compiler_gnu = yes; then
4247   GCC=yes
4248 else
4249   GCC=
4250 fi
4251 ac_test_CFLAGS=${CFLAGS+set}
4252 ac_save_CFLAGS=$CFLAGS
4253 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4254 $as_echo_n "checking whether $CC accepts -g... " >&6; }
4255 if ${ac_cv_prog_cc_g+:} false; then :
4256   $as_echo_n "(cached) " >&6
4257 else
4258   ac_save_c_werror_flag=$ac_c_werror_flag
4259    ac_c_werror_flag=yes
4260    ac_cv_prog_cc_g=no
4261    CFLAGS="-g"
4262    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4263 /* end confdefs.h.  */
4264
4265 int
4266 main ()
4267 {
4268
4269   ;
4270   return 0;
4271 }
4272 _ACEOF
4273 if ac_fn_c_try_compile "$LINENO"; then :
4274   ac_cv_prog_cc_g=yes
4275 else
4276   CFLAGS=""
4277       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4278 /* end confdefs.h.  */
4279
4280 int
4281 main ()
4282 {
4283
4284   ;
4285   return 0;
4286 }
4287 _ACEOF
4288 if ac_fn_c_try_compile "$LINENO"; then :
4289
4290 else
4291   ac_c_werror_flag=$ac_save_c_werror_flag
4292          CFLAGS="-g"
4293          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4294 /* end confdefs.h.  */
4295
4296 int
4297 main ()
4298 {
4299
4300   ;
4301   return 0;
4302 }
4303 _ACEOF
4304 if ac_fn_c_try_compile "$LINENO"; then :
4305   ac_cv_prog_cc_g=yes
4306 fi
4307 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4308 fi
4309 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4310 fi
4311 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4312    ac_c_werror_flag=$ac_save_c_werror_flag
4313 fi
4314 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4315 $as_echo "$ac_cv_prog_cc_g" >&6; }
4316 if test "$ac_test_CFLAGS" = set; then
4317   CFLAGS=$ac_save_CFLAGS
4318 elif test $ac_cv_prog_cc_g = yes; then
4319   if test "$GCC" = yes; then
4320     CFLAGS="-g -O2"
4321   else
4322     CFLAGS="-g"
4323   fi
4324 else
4325   if test "$GCC" = yes; then
4326     CFLAGS="-O2"
4327   else
4328     CFLAGS=
4329   fi
4330 fi
4331 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
4332 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
4333 if ${ac_cv_prog_cc_c89+:} false; then :
4334   $as_echo_n "(cached) " >&6
4335 else
4336   ac_cv_prog_cc_c89=no
4337 ac_save_CC=$CC
4338 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4339 /* end confdefs.h.  */
4340 #include <stdarg.h>
4341 #include <stdio.h>
4342 struct stat;
4343 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4344 struct buf { int x; };
4345 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4346 static char *e (p, i)
4347      char **p;
4348      int i;
4349 {
4350   return p[i];
4351 }
4352 static char *f (char * (*g) (char **, int), char **p, ...)
4353 {
4354   char *s;
4355   va_list v;
4356   va_start (v,p);
4357   s = g (p, va_arg (v,int));
4358   va_end (v);
4359   return s;
4360 }
4361
4362 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
4363    function prototypes and stuff, but not '\xHH' hex character constants.
4364    These don't provoke an error unfortunately, instead are silently treated
4365    as 'x'.  The following induces an error, until -std is added to get
4366    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
4367    array size at least.  It's necessary to write '\x00'==0 to get something
4368    that's true only with -std.  */
4369 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
4370
4371 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
4372    inside strings and character constants.  */
4373 #define FOO(x) 'x'
4374 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
4375
4376 int test (int i, double x);
4377 struct s1 {int (*f) (int a);};
4378 struct s2 {int (*f) (double a);};
4379 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4380 int argc;
4381 char **argv;
4382 int
4383 main ()
4384 {
4385 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4386   ;
4387   return 0;
4388 }
4389 _ACEOF
4390 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
4391         -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4392 do
4393   CC="$ac_save_CC $ac_arg"
4394   if ac_fn_c_try_compile "$LINENO"; then :
4395   ac_cv_prog_cc_c89=$ac_arg
4396 fi
4397 rm -f core conftest.err conftest.$ac_objext
4398   test "x$ac_cv_prog_cc_c89" != "xno" && break
4399 done
4400 rm -f conftest.$ac_ext
4401 CC=$ac_save_CC
4402
4403 fi
4404 # AC_CACHE_VAL
4405 case "x$ac_cv_prog_cc_c89" in
4406   x)
4407     { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4408 $as_echo "none needed" >&6; } ;;
4409   xno)
4410     { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4411 $as_echo "unsupported" >&6; } ;;
4412   *)
4413     CC="$CC $ac_cv_prog_cc_c89"
4414     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
4415 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
4416 esac
4417 if test "x$ac_cv_prog_cc_c89" != xno; then :
4418
4419 fi
4420
4421 ac_ext=c
4422 ac_cpp='$CPP $CPPFLAGS'
4423 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4424 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4425 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4426
4427 ac_ext=cpp
4428 ac_cpp='$CXXCPP $CPPFLAGS'
4429 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4430 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4431 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
4432 if test -z "$CXX"; then
4433   if test -n "$CCC"; then
4434     CXX=$CCC
4435   else
4436     if test -n "$ac_tool_prefix"; then
4437   for ac_prog in $pgac_cxx_list
4438   do
4439     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4440 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4441 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4442 $as_echo_n "checking for $ac_word... " >&6; }
4443 if ${ac_cv_prog_CXX+:} false; then :
4444   $as_echo_n "(cached) " >&6
4445 else
4446   if test -n "$CXX"; then
4447   ac_cv_prog_CXX="$CXX" # Let the user override the test.
4448 else
4449 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4450 for as_dir in $PATH
4451 do
4452   IFS=$as_save_IFS
4453   test -z "$as_dir" && as_dir=.
4454     for ac_exec_ext in '' $ac_executable_extensions; do
4455   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4456     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
4457     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4458     break 2
4459   fi
4460 done
4461   done
4462 IFS=$as_save_IFS
4463
4464 fi
4465 fi
4466 CXX=$ac_cv_prog_CXX
4467 if test -n "$CXX"; then
4468   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
4469 $as_echo "$CXX" >&6; }
4470 else
4471   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4472 $as_echo "no" >&6; }
4473 fi
4474
4475
4476     test -n "$CXX" && break
4477   done
4478 fi
4479 if test -z "$CXX"; then
4480   ac_ct_CXX=$CXX
4481   for ac_prog in $pgac_cxx_list
4482 do
4483   # Extract the first word of "$ac_prog", so it can be a program name with args.
4484 set dummy $ac_prog; ac_word=$2
4485 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4486 $as_echo_n "checking for $ac_word... " >&6; }
4487 if ${ac_cv_prog_ac_ct_CXX+:} false; then :
4488   $as_echo_n "(cached) " >&6
4489 else
4490   if test -n "$ac_ct_CXX"; then
4491   ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
4492 else
4493 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4494 for as_dir in $PATH
4495 do
4496   IFS=$as_save_IFS
4497   test -z "$as_dir" && as_dir=.
4498     for ac_exec_ext in '' $ac_executable_extensions; do
4499   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4500     ac_cv_prog_ac_ct_CXX="$ac_prog"
4501     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4502     break 2
4503   fi
4504 done
4505   done
4506 IFS=$as_save_IFS
4507
4508 fi
4509 fi
4510 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
4511 if test -n "$ac_ct_CXX"; then
4512   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
4513 $as_echo "$ac_ct_CXX" >&6; }
4514 else
4515   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4516 $as_echo "no" >&6; }
4517 fi
4518
4519
4520   test -n "$ac_ct_CXX" && break
4521 done
4522
4523   if test "x$ac_ct_CXX" = x; then
4524     CXX="g++"
4525   else
4526     case $cross_compiling:$ac_tool_warned in
4527 yes:)
4528 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4529 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4530 ac_tool_warned=yes ;;
4531 esac
4532     CXX=$ac_ct_CXX
4533   fi
4534 fi
4535
4536   fi
4537 fi
4538 # Provide some information about the compiler.
4539 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
4540 set X $ac_compile
4541 ac_compiler=$2
4542 for ac_option in --version -v -V -qversion; do
4543   { { ac_try="$ac_compiler $ac_option >&5"
4544 case "(($ac_try" in
4545   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4546   *) ac_try_echo=$ac_try;;
4547 esac
4548 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4549 $as_echo "$ac_try_echo"; } >&5
4550   (eval "$ac_compiler $ac_option >&5") 2>conftest.err
4551   ac_status=$?
4552   if test -s conftest.err; then
4553     sed '10a\
4554 ... rest of stderr output deleted ...
4555          10q' conftest.err >conftest.er1
4556     cat conftest.er1 >&5
4557   fi
4558   rm -f conftest.er1 conftest.err
4559   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4560   test $ac_status = 0; }
4561 done
4562
4563 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
4564 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
4565 if ${ac_cv_cxx_compiler_gnu+:} false; then :
4566   $as_echo_n "(cached) " >&6
4567 else
4568   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4569 /* end confdefs.h.  */
4570
4571 int
4572 main ()
4573 {
4574 #ifndef __GNUC__
4575        choke me
4576 #endif
4577
4578   ;
4579   return 0;
4580 }
4581 _ACEOF
4582 if ac_fn_cxx_try_compile "$LINENO"; then :
4583   ac_compiler_gnu=yes
4584 else
4585   ac_compiler_gnu=no
4586 fi
4587 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4588 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
4589
4590 fi
4591 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
4592 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
4593 if test $ac_compiler_gnu = yes; then
4594   GXX=yes
4595 else
4596   GXX=
4597 fi
4598 ac_test_CXXFLAGS=${CXXFLAGS+set}
4599 ac_save_CXXFLAGS=$CXXFLAGS
4600 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
4601 $as_echo_n "checking whether $CXX accepts -g... " >&6; }
4602 if ${ac_cv_prog_cxx_g+:} false; then :
4603   $as_echo_n "(cached) " >&6
4604 else
4605   ac_save_cxx_werror_flag=$ac_cxx_werror_flag
4606    ac_cxx_werror_flag=yes
4607    ac_cv_prog_cxx_g=no
4608    CXXFLAGS="-g"
4609    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4610 /* end confdefs.h.  */
4611
4612 int
4613 main ()
4614 {
4615
4616   ;
4617   return 0;
4618 }
4619 _ACEOF
4620 if ac_fn_cxx_try_compile "$LINENO"; then :
4621   ac_cv_prog_cxx_g=yes
4622 else
4623   CXXFLAGS=""
4624       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4625 /* end confdefs.h.  */
4626
4627 int
4628 main ()
4629 {
4630
4631   ;
4632   return 0;
4633 }
4634 _ACEOF
4635 if ac_fn_cxx_try_compile "$LINENO"; then :
4636
4637 else
4638   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
4639          CXXFLAGS="-g"
4640          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4641 /* end confdefs.h.  */
4642
4643 int
4644 main ()
4645 {
4646
4647   ;
4648   return 0;
4649 }
4650 _ACEOF
4651 if ac_fn_cxx_try_compile "$LINENO"; then :
4652   ac_cv_prog_cxx_g=yes
4653 fi
4654 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4655 fi
4656 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4657 fi
4658 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4659    ac_cxx_werror_flag=$ac_save_cxx_werror_flag
4660 fi
4661 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
4662 $as_echo "$ac_cv_prog_cxx_g" >&6; }
4663 if test "$ac_test_CXXFLAGS" = set; then
4664   CXXFLAGS=$ac_save_CXXFLAGS
4665 elif test $ac_cv_prog_cxx_g = yes; then
4666   if test "$GXX" = yes; then
4667     CXXFLAGS="-g -O2"
4668   else
4669     CXXFLAGS="-g"
4670   fi
4671 else
4672   if test "$GXX" = yes; then
4673     CXXFLAGS="-O2"
4674   else
4675     CXXFLAGS=
4676   fi
4677 fi
4678 ac_ext=c
4679 ac_cpp='$CPP $CPPFLAGS'
4680 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4681 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4682 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4683
4684
4685 # Check if it's Intel's compiler, which (usually) pretends to be gcc,
4686 # but has idiosyncrasies of its own.  We assume icc will define
4687 # __INTEL_COMPILER regardless of CFLAGS.
4688
4689 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4690 /* end confdefs.h.  */
4691
4692 int
4693 main ()
4694 {
4695 #ifndef __INTEL_COMPILER
4696 choke me
4697 #endif
4698   ;
4699   return 0;
4700 }
4701 _ACEOF
4702 if ac_fn_c_try_compile "$LINENO"; then :
4703   ICC=yes
4704 else
4705   ICC=no
4706 fi
4707 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4708
4709 # Check if it's Sun Studio compiler. We assume that
4710 # __SUNPRO_C will be defined for Sun Studio compilers
4711 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4712 /* end confdefs.h.  */
4713
4714 int
4715 main ()
4716 {
4717 #ifndef __SUNPRO_C
4718 choke me
4719 #endif
4720   ;
4721   return 0;
4722 }
4723 _ACEOF
4724 if ac_fn_c_try_compile "$LINENO"; then :
4725   SUN_STUDIO_CC=yes
4726 else
4727   SUN_STUDIO_CC=no
4728 fi
4729 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4730
4731
4732
4733
4734 #
4735 # LLVM
4736 #
4737 # Checked early because subsequent tests depend on it.
4738
4739
4740
4741 # Check whether --with-llvm was given.
4742 if test "${with_llvm+set}" = set; then :
4743   withval=$with_llvm;
4744   case $withval in
4745     yes)
4746
4747 $as_echo "#define USE_LLVM 1" >>confdefs.h
4748
4749       ;;
4750     no)
4751       :
4752       ;;
4753     *)
4754       as_fn_error $? "no argument expected for --with-llvm option" "$LINENO" 5
4755       ;;
4756   esac
4757
4758 else
4759   with_llvm=no
4760
4761 fi
4762
4763
4764
4765 if test "$with_llvm" = yes ; then
4766    for ac_prog in gawk mawk nawk awk
4767 do
4768   # Extract the first word of "$ac_prog", so it can be a program name with args.
4769 set dummy $ac_prog; ac_word=$2
4770 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4771 $as_echo_n "checking for $ac_word... " >&6; }
4772 if ${ac_cv_prog_AWK+:} false; then :
4773   $as_echo_n "(cached) " >&6
4774 else
4775   if test -n "$AWK"; then
4776   ac_cv_prog_AWK="$AWK" # Let the user override the test.
4777 else
4778 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4779 for as_dir in $PATH
4780 do
4781   IFS=$as_save_IFS
4782   test -z "$as_dir" && as_dir=.
4783     for ac_exec_ext in '' $ac_executable_extensions; do
4784   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4785     ac_cv_prog_AWK="$ac_prog"
4786     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4787     break 2
4788   fi
4789 done
4790   done
4791 IFS=$as_save_IFS
4792
4793 fi
4794 fi
4795 AWK=$ac_cv_prog_AWK
4796 if test -n "$AWK"; then
4797   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
4798 $as_echo "$AWK" >&6; }
4799 else
4800   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4801 $as_echo "no" >&6; }
4802 fi
4803
4804
4805   test -n "$AWK" && break
4806 done
4807
4808
4809
4810
4811
4812   if test -z "$LLVM_CONFIG"; then
4813   for ac_prog in llvm-config llvm-config-6.0 llvm-config-5.0 llvm-config-4.0 llvm-config-3.9
4814 do
4815   # Extract the first word of "$ac_prog", so it can be a program name with args.
4816 set dummy $ac_prog; ac_word=$2
4817 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4818 $as_echo_n "checking for $ac_word... " >&6; }
4819 if ${ac_cv_path_LLVM_CONFIG+:} false; then :
4820   $as_echo_n "(cached) " >&6
4821 else
4822   case $LLVM_CONFIG in
4823   [\\/]* | ?:[\\/]*)
4824   ac_cv_path_LLVM_CONFIG="$LLVM_CONFIG" # Let the user override the test with a path.
4825   ;;
4826   *)
4827   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4828 for as_dir in $PATH
4829 do
4830   IFS=$as_save_IFS
4831   test -z "$as_dir" && as_dir=.
4832     for ac_exec_ext in '' $ac_executable_extensions; do
4833   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4834     ac_cv_path_LLVM_CONFIG="$as_dir/$ac_word$ac_exec_ext"
4835     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4836     break 2
4837   fi
4838 done
4839   done
4840 IFS=$as_save_IFS
4841
4842   ;;
4843 esac
4844 fi
4845 LLVM_CONFIG=$ac_cv_path_LLVM_CONFIG
4846 if test -n "$LLVM_CONFIG"; then
4847   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_CONFIG" >&5
4848 $as_echo "$LLVM_CONFIG" >&6; }
4849 else
4850   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4851 $as_echo "no" >&6; }
4852 fi
4853
4854
4855   test -n "$LLVM_CONFIG" && break
4856 done
4857
4858 else
4859   # Report the value of LLVM_CONFIG in configure's output in all cases.
4860   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LLVM_CONFIG" >&5
4861 $as_echo_n "checking for LLVM_CONFIG... " >&6; }
4862   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_CONFIG" >&5
4863 $as_echo "$LLVM_CONFIG" >&6; }
4864 fi
4865
4866
4867   # no point continuing if llvm wasn't found
4868   if test -z "$LLVM_CONFIG"; then
4869     as_fn_error $? "llvm-config not found, but required when compiling --with-llvm, specify with LLVM_CONFIG=" "$LINENO" 5
4870   fi
4871   # check if detected $LLVM_CONFIG is executable
4872   pgac_llvm_version="$($LLVM_CONFIG --version 2> /dev/null || echo no)"
4873   if test "x$pgac_llvm_version" = "xno"; then
4874     as_fn_error $? "$LLVM_CONFIG does not work" "$LINENO" 5
4875   fi
4876   # and whether the version is supported
4877   if echo $pgac_llvm_version | $AWK -F '.' '{ if ($1 >= 4 || ($1 == 3 && $2 >= 9)) exit 1; else exit 0;}';then
4878     as_fn_error $? "$LLVM_CONFIG version is $pgac_llvm_version but at least 3.9 is required" "$LINENO" 5
4879   fi
4880
4881   # need clang to create some bitcode files
4882
4883   if test -z "$CLANG"; then
4884   for ac_prog in clang clang-6.0 clang-5.0 clang-4.0 clang-3.9
4885 do
4886   # Extract the first word of "$ac_prog", so it can be a program name with args.
4887 set dummy $ac_prog; ac_word=$2
4888 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4889 $as_echo_n "checking for $ac_word... " >&6; }
4890 if ${ac_cv_path_CLANG+:} false; then :
4891   $as_echo_n "(cached) " >&6
4892 else
4893   case $CLANG in
4894   [\\/]* | ?:[\\/]*)
4895   ac_cv_path_CLANG="$CLANG" # Let the user override the test with a path.
4896   ;;
4897   *)
4898   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4899 for as_dir in $PATH
4900 do
4901   IFS=$as_save_IFS
4902   test -z "$as_dir" && as_dir=.
4903     for ac_exec_ext in '' $ac_executable_extensions; do
4904   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4905     ac_cv_path_CLANG="$as_dir/$ac_word$ac_exec_ext"
4906     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4907     break 2
4908   fi
4909 done
4910   done
4911 IFS=$as_save_IFS
4912
4913   ;;
4914 esac
4915 fi
4916 CLANG=$ac_cv_path_CLANG
4917 if test -n "$CLANG"; then
4918   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLANG" >&5
4919 $as_echo "$CLANG" >&6; }
4920 else
4921   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4922 $as_echo "no" >&6; }
4923 fi
4924
4925
4926   test -n "$CLANG" && break
4927 done
4928
4929 else
4930   # Report the value of CLANG in configure's output in all cases.
4931   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CLANG" >&5
4932 $as_echo_n "checking for CLANG... " >&6; }
4933   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLANG" >&5
4934 $as_echo "$CLANG" >&6; }
4935 fi
4936
4937   if test -z "$CLANG"; then
4938     as_fn_error $? "clang not found, but required when compiling --with-llvm, specify with CLANG=" "$LINENO" 5
4939   fi
4940   # make sure clang is executable
4941   if test "x$($CLANG --version 2> /dev/null || echo no)" = "xno"; then
4942     as_fn_error $? "$CLANG does not work" "$LINENO" 5
4943   fi
4944   # Could check clang version, but it doesn't seem that
4945   # important. Systems with a new enough LLVM version are usually
4946   # going to have a decent clang version too. It's also not entirely
4947   # clear what the minimum version is.
4948
4949   # Collect compiler flags necessary to build the LLVM dependent
4950   # shared library.
4951   for pgac_option in `$LLVM_CONFIG --cppflags`; do
4952     case $pgac_option in
4953       -I*|-D*) LLVM_CPPFLAGS="$pgac_option $LLVM_CPPFLAGS";;
4954     esac
4955   done
4956
4957   for pgac_option in `$LLVM_CONFIG --ldflags`; do
4958     case $pgac_option in
4959       -L*) LDFLAGS="$LDFLAGS $pgac_option";;
4960     esac
4961   done
4962
4963   # ABI influencing options, standard influencing options
4964   for pgac_option in `$LLVM_CONFIG --cxxflags`; do
4965     case $pgac_option in
4966       -fno-rtti*) LLVM_CXXFLAGS="$LLVM_CXXFLAGS $pgac_option";;
4967       -std=*) LLVM_CXXFLAGS="$LLVM_CXXFLAGS $pgac_option";;
4968     esac
4969   done
4970
4971   # Look for components we're interested in, collect necessary
4972   # libs. As some components are optional, we can't just list all of
4973   # them as it'd raise an error.
4974   pgac_components='';
4975   for pgac_component in `$LLVM_CONFIG --components`; do
4976     case $pgac_component in
4977       engine) pgac_components="$pgac_components $pgac_component";;
4978       debuginfodwarf) pgac_components="$pgac_components $pgac_component";;
4979       orcjit) pgac_components="$pgac_components $pgac_component";;
4980       passes) pgac_components="$pgac_components $pgac_component";;
4981       perfjitevents) pgac_components="$pgac_components $pgac_component";;
4982     esac
4983   done;
4984
4985   # And then get the libraries that need to be linked in for the
4986   # selected components.  They're large libraries, we only want to
4987   # link them into the LLVM using shared library.
4988   for pgac_option in `$LLVM_CONFIG --libs --system-libs $pgac_components`; do
4989     case $pgac_option in
4990       -l*) LLVM_LIBS="$LLVM_LIBS $pgac_option";;
4991     esac
4992   done
4993
4994   LLVM_BINPATH=`$LLVM_CONFIG --bindir`
4995
4996   # Check which functionality is present
4997   SAVE_CPPFLAGS="$CPPFLAGS"
4998   CPPFLAGS="$CPPFLAGS $LLVM_CPPFLAGS"
4999   ac_fn_c_check_decl "$LINENO" "LLVMOrcGetSymbolAddressIn" "ac_cv_have_decl_LLVMOrcGetSymbolAddressIn" "#include <llvm-c/OrcBindings.h>
5000 "
5001 if test "x$ac_cv_have_decl_LLVMOrcGetSymbolAddressIn" = xyes; then :
5002   ac_have_decl=1
5003 else
5004   ac_have_decl=0
5005 fi
5006
5007 cat >>confdefs.h <<_ACEOF
5008 #define HAVE_DECL_LLVMORCGETSYMBOLADDRESSIN $ac_have_decl
5009 _ACEOF
5010 ac_fn_c_check_decl "$LINENO" "LLVMOrcRegisterGDB" "ac_cv_have_decl_LLVMOrcRegisterGDB" "#include <llvm-c/OrcBindings.h>
5011 "
5012 if test "x$ac_cv_have_decl_LLVMOrcRegisterGDB" = xyes; then :
5013   ac_have_decl=1
5014 else
5015   ac_have_decl=0
5016 fi
5017
5018 cat >>confdefs.h <<_ACEOF
5019 #define HAVE_DECL_LLVMORCREGISTERGDB $ac_have_decl
5020 _ACEOF
5021 ac_fn_c_check_decl "$LINENO" "LLVMOrcRegisterPerf" "ac_cv_have_decl_LLVMOrcRegisterPerf" "#include <llvm-c/OrcBindings.h>
5022 "
5023 if test "x$ac_cv_have_decl_LLVMOrcRegisterPerf" = xyes; then :
5024   ac_have_decl=1
5025 else
5026   ac_have_decl=0
5027 fi
5028
5029 cat >>confdefs.h <<_ACEOF
5030 #define HAVE_DECL_LLVMORCREGISTERPERF $ac_have_decl
5031 _ACEOF
5032
5033   ac_fn_c_check_decl "$LINENO" "LLVMGetHostCPUName" "ac_cv_have_decl_LLVMGetHostCPUName" "#include <llvm-c/TargetMachine.h>
5034 "
5035 if test "x$ac_cv_have_decl_LLVMGetHostCPUName" = xyes; then :
5036   ac_have_decl=1
5037 else
5038   ac_have_decl=0
5039 fi
5040
5041 cat >>confdefs.h <<_ACEOF
5042 #define HAVE_DECL_LLVMGETHOSTCPUNAME $ac_have_decl
5043 _ACEOF
5044
5045   CPPFLAGS="$SAVE_CPPFLAGS"
5046
5047   # LLVM_CONFIG, CLANG are already output via AC_ARG_VAR
5048
5049
5050
5051
5052
5053
5054
5055 fi
5056
5057
5058 unset CFLAGS
5059 unset CXXFLAGS
5060
5061 #
5062 # Read the template
5063 #
5064 . "$srcdir/src/template/$template" || exit
5065
5066 # C[XX]FLAGS are selected so:
5067 # If the user specifies something in the environment, that is used.
5068 # else:  If the template file set something, that is used.
5069 # else:  If coverage was enabled, don't set anything.
5070 # else:  If the compiler is GCC, then we use -O2.
5071 # else:  If the compiler is something else, then we use -O, unless debugging.
5072
5073 if test "$ac_env_CFLAGS_set" = set; then
5074   CFLAGS=$ac_env_CFLAGS_value
5075 elif test "${CFLAGS+set}" = set; then
5076   : # (keep what template set)
5077 elif test "$enable_coverage" = yes; then
5078   : # no optimization by default
5079 elif test "$GCC" = yes; then
5080   CFLAGS="-O2"
5081 else
5082   # if the user selected debug mode, don't use -O
5083   if test "$enable_debug" != yes; then
5084     CFLAGS="-O"
5085   fi
5086 fi
5087
5088 if test "$ac_env_CXXFLAGS_set" = set; then
5089   CXXFLAGS=$ac_env_CXXFLAGS_value
5090 elif test "${CXXFLAGS+set}" = set; then
5091   : # (keep what template set)
5092 elif test "$enable_coverage" = yes; then
5093   : # no optimization by default
5094 elif test "$GCC" = yes; then
5095   CXXFLAGS="-O2"
5096 else
5097   # if the user selected debug mode, don't use -O
5098   if test "$enable_debug" != yes; then
5099     CXXFLAGS="-O"
5100   fi
5101 fi
5102
5103 # When generating bitcode (for inlining) we always want to use -O2
5104 # even when --enable-debug is specified. The bitcode it's not going to
5105 # be used for line-by-line debugging, and JIT inlining doesn't work
5106 # without at least -O1 (otherwise clang will emit 'noinline'
5107 # attributes everywhere), which is bad for testing.  Still allow the
5108 # environment to override if done explicitly.
5109 if test "$ac_env_BITCODE_CFLAGS_set" = set; then
5110   BITCODE_CFLAGS=$ac_env_BITCODE_CFLAGS_value
5111 else
5112   BITCODE_CFLAGS="-O2 $BITCODE_CFLAGS"
5113 fi
5114 if test "$ac_env_BITCODE_CXXFLAGS_set" = set; then
5115   BITCODE_CXXFLAGS=$ac_env_BITCODE_CXXFLAGS_value
5116 else
5117   BITCODE_CXXFLAGS="-O2 $BITCODE_CXXFLAGS"
5118 fi
5119
5120 # C[XX]FLAGS we determined above will be added back at the end
5121 user_CFLAGS=$CFLAGS
5122 CFLAGS=""
5123 user_CXXFLAGS=$CXXFLAGS
5124 CXXFLAGS=""
5125 user_BITCODE_CFLAGS=$BITCODE_CFLAGS
5126 BITCODE_CFLAGS=""
5127 user_BITCODE_CXXFLAGS=$BITCODE_CXXFLAGS
5128 BITCODE_CXXFLAGS=""
5129
5130 # set CFLAGS_VECTOR from the environment, if available
5131 if test "$ac_env_CFLAGS_VECTOR_set" = set; then
5132   CFLAGS_VECTOR=$ac_env_CFLAGS_VECTOR_value
5133 fi
5134
5135 # Some versions of GCC support some additional useful warning flags.
5136 # Check whether they are supported, and add them to CFLAGS if so.
5137 # ICC pretends to be GCC but it's lying; it doesn't support these flags,
5138 # but has its own.  Also check other compiler-specific flags here.
5139
5140 if test "$GCC" = yes -a "$ICC" = no; then
5141   CFLAGS="-Wall -Wmissing-prototypes -Wpointer-arith"
5142   CXXFLAGS="-Wall -Wpointer-arith"
5143   # These work in some but not all gcc versions
5144
5145 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wdeclaration-after-statement, for CFLAGS" >&5
5146 $as_echo_n "checking whether ${CC} supports -Wdeclaration-after-statement, for CFLAGS... " >&6; }
5147 if ${pgac_cv_prog_CC_cflags__Wdeclaration_after_statement+:} false; then :
5148   $as_echo_n "(cached) " >&6
5149 else
5150   pgac_save_CFLAGS=$CFLAGS
5151 pgac_save_CC=$CC
5152 CC=${CC}
5153 CFLAGS="${CFLAGS} -Wdeclaration-after-statement"
5154 ac_save_c_werror_flag=$ac_c_werror_flag
5155 ac_c_werror_flag=yes
5156 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5157 /* end confdefs.h.  */
5158
5159 int
5160 main ()
5161 {
5162
5163   ;
5164   return 0;
5165 }
5166 _ACEOF
5167 if ac_fn_c_try_compile "$LINENO"; then :
5168   pgac_cv_prog_CC_cflags__Wdeclaration_after_statement=yes
5169 else
5170   pgac_cv_prog_CC_cflags__Wdeclaration_after_statement=no
5171 fi
5172 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5173 ac_c_werror_flag=$ac_save_c_werror_flag
5174 CFLAGS="$pgac_save_CFLAGS"
5175 CC="$pgac_save_CC"
5176 fi
5177 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" >&5
5178 $as_echo "$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" >&6; }
5179 if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then
5180   CFLAGS="${CFLAGS} -Wdeclaration-after-statement"
5181 fi
5182
5183
5184   # -Wdeclaration-after-statement isn't applicable for C++
5185
5186 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wendif-labels, for CFLAGS" >&5
5187 $as_echo_n "checking whether ${CC} supports -Wendif-labels, for CFLAGS... " >&6; }
5188 if ${pgac_cv_prog_CC_cflags__Wendif_labels+:} false; then :
5189   $as_echo_n "(cached) " >&6
5190 else
5191   pgac_save_CFLAGS=$CFLAGS
5192 pgac_save_CC=$CC
5193 CC=${CC}
5194 CFLAGS="${CFLAGS} -Wendif-labels"
5195 ac_save_c_werror_flag=$ac_c_werror_flag
5196 ac_c_werror_flag=yes
5197 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5198 /* end confdefs.h.  */
5199
5200 int
5201 main ()
5202 {
5203
5204   ;
5205   return 0;
5206 }
5207 _ACEOF
5208 if ac_fn_c_try_compile "$LINENO"; then :
5209   pgac_cv_prog_CC_cflags__Wendif_labels=yes
5210 else
5211   pgac_cv_prog_CC_cflags__Wendif_labels=no
5212 fi
5213 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5214 ac_c_werror_flag=$ac_save_c_werror_flag
5215 CFLAGS="$pgac_save_CFLAGS"
5216 CC="$pgac_save_CC"
5217 fi
5218 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wendif_labels" >&5
5219 $as_echo "$pgac_cv_prog_CC_cflags__Wendif_labels" >&6; }
5220 if test x"$pgac_cv_prog_CC_cflags__Wendif_labels" = x"yes"; then
5221   CFLAGS="${CFLAGS} -Wendif-labels"
5222 fi
5223
5224
5225   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -Wendif-labels, for CXXFLAGS" >&5
5226 $as_echo_n "checking whether ${CXX} supports -Wendif-labels, for CXXFLAGS... " >&6; }
5227 if ${pgac_cv_prog_CXX_cxxflags__Wendif_labels+:} false; then :
5228   $as_echo_n "(cached) " >&6
5229 else
5230   pgac_save_CXXFLAGS=$CXXFLAGS
5231 pgac_save_CXX=$CXX
5232 CXX=${CXX}
5233 CXXFLAGS="${CXXFLAGS} -Wendif-labels"
5234 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5235 ac_cxx_werror_flag=yes
5236 ac_ext=cpp
5237 ac_cpp='$CXXCPP $CPPFLAGS'
5238 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5239 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5240 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5241
5242 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5243 /* end confdefs.h.  */
5244
5245 int
5246 main ()
5247 {
5248
5249   ;
5250   return 0;
5251 }
5252 _ACEOF
5253 if ac_fn_cxx_try_compile "$LINENO"; then :
5254   pgac_cv_prog_CXX_cxxflags__Wendif_labels=yes
5255 else
5256   pgac_cv_prog_CXX_cxxflags__Wendif_labels=no
5257 fi
5258 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5259 ac_ext=c
5260 ac_cpp='$CPP $CPPFLAGS'
5261 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5262 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5263 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5264
5265 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5266 CXXFLAGS="$pgac_save_CXXFLAGS"
5267 CXX="$pgac_save_CXX"
5268 fi
5269 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__Wendif_labels" >&5
5270 $as_echo "$pgac_cv_prog_CXX_cxxflags__Wendif_labels" >&6; }
5271 if test x"$pgac_cv_prog_CXX_cxxflags__Wendif_labels" = x"yes"; then
5272   CXXFLAGS="${CXXFLAGS} -Wendif-labels"
5273 fi
5274
5275
5276
5277 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wmissing-format-attribute, for CFLAGS" >&5
5278 $as_echo_n "checking whether ${CC} supports -Wmissing-format-attribute, for CFLAGS... " >&6; }
5279 if ${pgac_cv_prog_CC_cflags__Wmissing_format_attribute+:} false; then :
5280   $as_echo_n "(cached) " >&6
5281 else
5282   pgac_save_CFLAGS=$CFLAGS
5283 pgac_save_CC=$CC
5284 CC=${CC}
5285 CFLAGS="${CFLAGS} -Wmissing-format-attribute"
5286 ac_save_c_werror_flag=$ac_c_werror_flag
5287 ac_c_werror_flag=yes
5288 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5289 /* end confdefs.h.  */
5290
5291 int
5292 main ()
5293 {
5294
5295   ;
5296   return 0;
5297 }
5298 _ACEOF
5299 if ac_fn_c_try_compile "$LINENO"; then :
5300   pgac_cv_prog_CC_cflags__Wmissing_format_attribute=yes
5301 else
5302   pgac_cv_prog_CC_cflags__Wmissing_format_attribute=no
5303 fi
5304 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5305 ac_c_werror_flag=$ac_save_c_werror_flag
5306 CFLAGS="$pgac_save_CFLAGS"
5307 CC="$pgac_save_CC"
5308 fi
5309 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wmissing_format_attribute" >&5
5310 $as_echo "$pgac_cv_prog_CC_cflags__Wmissing_format_attribute" >&6; }
5311 if test x"$pgac_cv_prog_CC_cflags__Wmissing_format_attribute" = x"yes"; then
5312   CFLAGS="${CFLAGS} -Wmissing-format-attribute"
5313 fi
5314
5315
5316   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -Wmissing-format-attribute, for CXXFLAGS" >&5
5317 $as_echo_n "checking whether ${CXX} supports -Wmissing-format-attribute, for CXXFLAGS... " >&6; }
5318 if ${pgac_cv_prog_CXX_cxxflags__Wmissing_format_attribute+:} false; then :
5319   $as_echo_n "(cached) " >&6
5320 else
5321   pgac_save_CXXFLAGS=$CXXFLAGS
5322 pgac_save_CXX=$CXX
5323 CXX=${CXX}
5324 CXXFLAGS="${CXXFLAGS} -Wmissing-format-attribute"
5325 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5326 ac_cxx_werror_flag=yes
5327 ac_ext=cpp
5328 ac_cpp='$CXXCPP $CPPFLAGS'
5329 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5330 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5331 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5332
5333 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5334 /* end confdefs.h.  */
5335
5336 int
5337 main ()
5338 {
5339
5340   ;
5341   return 0;
5342 }
5343 _ACEOF
5344 if ac_fn_cxx_try_compile "$LINENO"; then :
5345   pgac_cv_prog_CXX_cxxflags__Wmissing_format_attribute=yes
5346 else
5347   pgac_cv_prog_CXX_cxxflags__Wmissing_format_attribute=no
5348 fi
5349 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5350 ac_ext=c
5351 ac_cpp='$CPP $CPPFLAGS'
5352 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5353 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5354 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5355
5356 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5357 CXXFLAGS="$pgac_save_CXXFLAGS"
5358 CXX="$pgac_save_CXX"
5359 fi
5360 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__Wmissing_format_attribute" >&5
5361 $as_echo "$pgac_cv_prog_CXX_cxxflags__Wmissing_format_attribute" >&6; }
5362 if test x"$pgac_cv_prog_CXX_cxxflags__Wmissing_format_attribute" = x"yes"; then
5363   CXXFLAGS="${CXXFLAGS} -Wmissing-format-attribute"
5364 fi
5365
5366
5367   # This was included in -Wall/-Wformat in older GCC versions
5368
5369 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wformat-security, for CFLAGS" >&5
5370 $as_echo_n "checking whether ${CC} supports -Wformat-security, for CFLAGS... " >&6; }
5371 if ${pgac_cv_prog_CC_cflags__Wformat_security+:} false; then :
5372   $as_echo_n "(cached) " >&6
5373 else
5374   pgac_save_CFLAGS=$CFLAGS
5375 pgac_save_CC=$CC
5376 CC=${CC}
5377 CFLAGS="${CFLAGS} -Wformat-security"
5378 ac_save_c_werror_flag=$ac_c_werror_flag
5379 ac_c_werror_flag=yes
5380 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5381 /* end confdefs.h.  */
5382
5383 int
5384 main ()
5385 {
5386
5387   ;
5388   return 0;
5389 }
5390 _ACEOF
5391 if ac_fn_c_try_compile "$LINENO"; then :
5392   pgac_cv_prog_CC_cflags__Wformat_security=yes
5393 else
5394   pgac_cv_prog_CC_cflags__Wformat_security=no
5395 fi
5396 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5397 ac_c_werror_flag=$ac_save_c_werror_flag
5398 CFLAGS="$pgac_save_CFLAGS"
5399 CC="$pgac_save_CC"
5400 fi
5401 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wformat_security" >&5
5402 $as_echo "$pgac_cv_prog_CC_cflags__Wformat_security" >&6; }
5403 if test x"$pgac_cv_prog_CC_cflags__Wformat_security" = x"yes"; then
5404   CFLAGS="${CFLAGS} -Wformat-security"
5405 fi
5406
5407
5408   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -Wformat-security, for CXXFLAGS" >&5
5409 $as_echo_n "checking whether ${CXX} supports -Wformat-security, for CXXFLAGS... " >&6; }
5410 if ${pgac_cv_prog_CXX_cxxflags__Wformat_security+:} false; then :
5411   $as_echo_n "(cached) " >&6
5412 else
5413   pgac_save_CXXFLAGS=$CXXFLAGS
5414 pgac_save_CXX=$CXX
5415 CXX=${CXX}
5416 CXXFLAGS="${CXXFLAGS} -Wformat-security"
5417 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5418 ac_cxx_werror_flag=yes
5419 ac_ext=cpp
5420 ac_cpp='$CXXCPP $CPPFLAGS'
5421 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5422 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5423 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5424
5425 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5426 /* end confdefs.h.  */
5427
5428 int
5429 main ()
5430 {
5431
5432   ;
5433   return 0;
5434 }
5435 _ACEOF
5436 if ac_fn_cxx_try_compile "$LINENO"; then :
5437   pgac_cv_prog_CXX_cxxflags__Wformat_security=yes
5438 else
5439   pgac_cv_prog_CXX_cxxflags__Wformat_security=no
5440 fi
5441 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5442 ac_ext=c
5443 ac_cpp='$CPP $CPPFLAGS'
5444 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5445 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5446 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5447
5448 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5449 CXXFLAGS="$pgac_save_CXXFLAGS"
5450 CXX="$pgac_save_CXX"
5451 fi
5452 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__Wformat_security" >&5
5453 $as_echo "$pgac_cv_prog_CXX_cxxflags__Wformat_security" >&6; }
5454 if test x"$pgac_cv_prog_CXX_cxxflags__Wformat_security" = x"yes"; then
5455   CXXFLAGS="${CXXFLAGS} -Wformat-security"
5456 fi
5457
5458
5459   # Disable strict-aliasing rules; needed for gcc 3.3+
5460
5461 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -fno-strict-aliasing, for CFLAGS" >&5
5462 $as_echo_n "checking whether ${CC} supports -fno-strict-aliasing, for CFLAGS... " >&6; }
5463 if ${pgac_cv_prog_CC_cflags__fno_strict_aliasing+:} false; then :
5464   $as_echo_n "(cached) " >&6
5465 else
5466   pgac_save_CFLAGS=$CFLAGS
5467 pgac_save_CC=$CC
5468 CC=${CC}
5469 CFLAGS="${CFLAGS} -fno-strict-aliasing"
5470 ac_save_c_werror_flag=$ac_c_werror_flag
5471 ac_c_werror_flag=yes
5472 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5473 /* end confdefs.h.  */
5474
5475 int
5476 main ()
5477 {
5478
5479   ;
5480   return 0;
5481 }
5482 _ACEOF
5483 if ac_fn_c_try_compile "$LINENO"; then :
5484   pgac_cv_prog_CC_cflags__fno_strict_aliasing=yes
5485 else
5486   pgac_cv_prog_CC_cflags__fno_strict_aliasing=no
5487 fi
5488 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5489 ac_c_werror_flag=$ac_save_c_werror_flag
5490 CFLAGS="$pgac_save_CFLAGS"
5491 CC="$pgac_save_CC"
5492 fi
5493 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__fno_strict_aliasing" >&5
5494 $as_echo "$pgac_cv_prog_CC_cflags__fno_strict_aliasing" >&6; }
5495 if test x"$pgac_cv_prog_CC_cflags__fno_strict_aliasing" = x"yes"; then
5496   CFLAGS="${CFLAGS} -fno-strict-aliasing"
5497 fi
5498
5499
5500   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -fno-strict-aliasing, for CXXFLAGS" >&5
5501 $as_echo_n "checking whether ${CXX} supports -fno-strict-aliasing, for CXXFLAGS... " >&6; }
5502 if ${pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing+:} false; then :
5503   $as_echo_n "(cached) " >&6
5504 else
5505   pgac_save_CXXFLAGS=$CXXFLAGS
5506 pgac_save_CXX=$CXX
5507 CXX=${CXX}
5508 CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
5509 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5510 ac_cxx_werror_flag=yes
5511 ac_ext=cpp
5512 ac_cpp='$CXXCPP $CPPFLAGS'
5513 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5514 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5515 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5516
5517 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5518 /* end confdefs.h.  */
5519
5520 int
5521 main ()
5522 {
5523
5524   ;
5525   return 0;
5526 }
5527 _ACEOF
5528 if ac_fn_cxx_try_compile "$LINENO"; then :
5529   pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing=yes
5530 else
5531   pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing=no
5532 fi
5533 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5534 ac_ext=c
5535 ac_cpp='$CPP $CPPFLAGS'
5536 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5537 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5538 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5539
5540 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5541 CXXFLAGS="$pgac_save_CXXFLAGS"
5542 CXX="$pgac_save_CXX"
5543 fi
5544 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing" >&5
5545 $as_echo "$pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing" >&6; }
5546 if test x"$pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing" = x"yes"; then
5547   CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
5548 fi
5549
5550
5551   # Disable optimizations that assume no overflow; needed for gcc 4.3+
5552
5553 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -fwrapv, for CFLAGS" >&5
5554 $as_echo_n "checking whether ${CC} supports -fwrapv, for CFLAGS... " >&6; }
5555 if ${pgac_cv_prog_CC_cflags__fwrapv+:} false; then :
5556   $as_echo_n "(cached) " >&6
5557 else
5558   pgac_save_CFLAGS=$CFLAGS
5559 pgac_save_CC=$CC
5560 CC=${CC}
5561 CFLAGS="${CFLAGS} -fwrapv"
5562 ac_save_c_werror_flag=$ac_c_werror_flag
5563 ac_c_werror_flag=yes
5564 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5565 /* end confdefs.h.  */
5566
5567 int
5568 main ()
5569 {
5570
5571   ;
5572   return 0;
5573 }
5574 _ACEOF
5575 if ac_fn_c_try_compile "$LINENO"; then :
5576   pgac_cv_prog_CC_cflags__fwrapv=yes
5577 else
5578   pgac_cv_prog_CC_cflags__fwrapv=no
5579 fi
5580 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5581 ac_c_werror_flag=$ac_save_c_werror_flag
5582 CFLAGS="$pgac_save_CFLAGS"
5583 CC="$pgac_save_CC"
5584 fi
5585 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__fwrapv" >&5
5586 $as_echo "$pgac_cv_prog_CC_cflags__fwrapv" >&6; }
5587 if test x"$pgac_cv_prog_CC_cflags__fwrapv" = x"yes"; then
5588   CFLAGS="${CFLAGS} -fwrapv"
5589 fi
5590
5591
5592   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -fwrapv, for CXXFLAGS" >&5
5593 $as_echo_n "checking whether ${CXX} supports -fwrapv, for CXXFLAGS... " >&6; }
5594 if ${pgac_cv_prog_CXX_cxxflags__fwrapv+:} false; then :
5595   $as_echo_n "(cached) " >&6
5596 else
5597   pgac_save_CXXFLAGS=$CXXFLAGS
5598 pgac_save_CXX=$CXX
5599 CXX=${CXX}
5600 CXXFLAGS="${CXXFLAGS} -fwrapv"
5601 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5602 ac_cxx_werror_flag=yes
5603 ac_ext=cpp
5604 ac_cpp='$CXXCPP $CPPFLAGS'
5605 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5606 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5607 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5608
5609 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5610 /* end confdefs.h.  */
5611
5612 int
5613 main ()
5614 {
5615
5616   ;
5617   return 0;
5618 }
5619 _ACEOF
5620 if ac_fn_cxx_try_compile "$LINENO"; then :
5621   pgac_cv_prog_CXX_cxxflags__fwrapv=yes
5622 else
5623   pgac_cv_prog_CXX_cxxflags__fwrapv=no
5624 fi
5625 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5626 ac_ext=c
5627 ac_cpp='$CPP $CPPFLAGS'
5628 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5629 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5630 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5631
5632 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5633 CXXFLAGS="$pgac_save_CXXFLAGS"
5634 CXX="$pgac_save_CXX"
5635 fi
5636 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__fwrapv" >&5
5637 $as_echo "$pgac_cv_prog_CXX_cxxflags__fwrapv" >&6; }
5638 if test x"$pgac_cv_prog_CXX_cxxflags__fwrapv" = x"yes"; then
5639   CXXFLAGS="${CXXFLAGS} -fwrapv"
5640 fi
5641
5642
5643   # Disable FP optimizations that cause various errors on gcc 4.5+ or maybe 4.6+
5644
5645 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -fexcess-precision=standard, for CFLAGS" >&5
5646 $as_echo_n "checking whether ${CC} supports -fexcess-precision=standard, for CFLAGS... " >&6; }
5647 if ${pgac_cv_prog_CC_cflags__fexcess_precision_standard+:} false; then :
5648   $as_echo_n "(cached) " >&6
5649 else
5650   pgac_save_CFLAGS=$CFLAGS
5651 pgac_save_CC=$CC
5652 CC=${CC}
5653 CFLAGS="${CFLAGS} -fexcess-precision=standard"
5654 ac_save_c_werror_flag=$ac_c_werror_flag
5655 ac_c_werror_flag=yes
5656 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5657 /* end confdefs.h.  */
5658
5659 int
5660 main ()
5661 {
5662
5663   ;
5664   return 0;
5665 }
5666 _ACEOF
5667 if ac_fn_c_try_compile "$LINENO"; then :
5668   pgac_cv_prog_CC_cflags__fexcess_precision_standard=yes
5669 else
5670   pgac_cv_prog_CC_cflags__fexcess_precision_standard=no
5671 fi
5672 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5673 ac_c_werror_flag=$ac_save_c_werror_flag
5674 CFLAGS="$pgac_save_CFLAGS"
5675 CC="$pgac_save_CC"
5676 fi
5677 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__fexcess_precision_standard" >&5
5678 $as_echo "$pgac_cv_prog_CC_cflags__fexcess_precision_standard" >&6; }
5679 if test x"$pgac_cv_prog_CC_cflags__fexcess_precision_standard" = x"yes"; then
5680   CFLAGS="${CFLAGS} -fexcess-precision=standard"
5681 fi
5682
5683
5684   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -fexcess-precision=standard, for CXXFLAGS" >&5
5685 $as_echo_n "checking whether ${CXX} supports -fexcess-precision=standard, for CXXFLAGS... " >&6; }
5686 if ${pgac_cv_prog_CXX_cxxflags__fexcess_precision_standard+:} false; then :
5687   $as_echo_n "(cached) " >&6
5688 else
5689   pgac_save_CXXFLAGS=$CXXFLAGS
5690 pgac_save_CXX=$CXX
5691 CXX=${CXX}
5692 CXXFLAGS="${CXXFLAGS} -fexcess-precision=standard"
5693 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5694 ac_cxx_werror_flag=yes
5695 ac_ext=cpp
5696 ac_cpp='$CXXCPP $CPPFLAGS'
5697 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5698 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5699 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5700
5701 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5702 /* end confdefs.h.  */
5703
5704 int
5705 main ()
5706 {
5707
5708   ;
5709   return 0;
5710 }
5711 _ACEOF
5712 if ac_fn_cxx_try_compile "$LINENO"; then :
5713   pgac_cv_prog_CXX_cxxflags__fexcess_precision_standard=yes
5714 else
5715   pgac_cv_prog_CXX_cxxflags__fexcess_precision_standard=no
5716 fi
5717 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5718 ac_ext=c
5719 ac_cpp='$CPP $CPPFLAGS'
5720 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5721 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5722 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5723
5724 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5725 CXXFLAGS="$pgac_save_CXXFLAGS"
5726 CXX="$pgac_save_CXX"
5727 fi
5728 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__fexcess_precision_standard" >&5
5729 $as_echo "$pgac_cv_prog_CXX_cxxflags__fexcess_precision_standard" >&6; }
5730 if test x"$pgac_cv_prog_CXX_cxxflags__fexcess_precision_standard" = x"yes"; then
5731   CXXFLAGS="${CXXFLAGS} -fexcess-precision=standard"
5732 fi
5733
5734
5735   # Optimization flags for specific files that benefit from vectorization
5736   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -funroll-loops, for CFLAGS_VECTOR" >&5
5737 $as_echo_n "checking whether ${CC} supports -funroll-loops, for CFLAGS_VECTOR... " >&6; }
5738 if ${pgac_cv_prog_CC_cflags__funroll_loops+:} false; then :
5739   $as_echo_n "(cached) " >&6
5740 else
5741   pgac_save_CFLAGS=$CFLAGS
5742 pgac_save_CC=$CC
5743 CC=${CC}
5744 CFLAGS="${CFLAGS_VECTOR} -funroll-loops"
5745 ac_save_c_werror_flag=$ac_c_werror_flag
5746 ac_c_werror_flag=yes
5747 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5748 /* end confdefs.h.  */
5749
5750 int
5751 main ()
5752 {
5753
5754   ;
5755   return 0;
5756 }
5757 _ACEOF
5758 if ac_fn_c_try_compile "$LINENO"; then :
5759   pgac_cv_prog_CC_cflags__funroll_loops=yes
5760 else
5761   pgac_cv_prog_CC_cflags__funroll_loops=no
5762 fi
5763 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5764 ac_c_werror_flag=$ac_save_c_werror_flag
5765 CFLAGS="$pgac_save_CFLAGS"
5766 CC="$pgac_save_CC"
5767 fi
5768 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__funroll_loops" >&5
5769 $as_echo "$pgac_cv_prog_CC_cflags__funroll_loops" >&6; }
5770 if test x"$pgac_cv_prog_CC_cflags__funroll_loops" = x"yes"; then
5771   CFLAGS_VECTOR="${CFLAGS_VECTOR} -funroll-loops"
5772 fi
5773
5774
5775   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -ftree-vectorize, for CFLAGS_VECTOR" >&5
5776 $as_echo_n "checking whether ${CC} supports -ftree-vectorize, for CFLAGS_VECTOR... " >&6; }
5777 if ${pgac_cv_prog_CC_cflags__ftree_vectorize+:} false; then :
5778   $as_echo_n "(cached) " >&6
5779 else
5780   pgac_save_CFLAGS=$CFLAGS
5781 pgac_save_CC=$CC
5782 CC=${CC}
5783 CFLAGS="${CFLAGS_VECTOR} -ftree-vectorize"
5784 ac_save_c_werror_flag=$ac_c_werror_flag
5785 ac_c_werror_flag=yes
5786 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5787 /* end confdefs.h.  */
5788
5789 int
5790 main ()
5791 {
5792
5793   ;
5794   return 0;
5795 }
5796 _ACEOF
5797 if ac_fn_c_try_compile "$LINENO"; then :
5798   pgac_cv_prog_CC_cflags__ftree_vectorize=yes
5799 else
5800   pgac_cv_prog_CC_cflags__ftree_vectorize=no
5801 fi
5802 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5803 ac_c_werror_flag=$ac_save_c_werror_flag
5804 CFLAGS="$pgac_save_CFLAGS"
5805 CC="$pgac_save_CC"
5806 fi
5807 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__ftree_vectorize" >&5
5808 $as_echo "$pgac_cv_prog_CC_cflags__ftree_vectorize" >&6; }
5809 if test x"$pgac_cv_prog_CC_cflags__ftree_vectorize" = x"yes"; then
5810   CFLAGS_VECTOR="${CFLAGS_VECTOR} -ftree-vectorize"
5811 fi
5812
5813
5814   # We want to suppress clang's unhelpful unused-command-line-argument warnings
5815   # but gcc won't complain about unrecognized -Wno-foo switches, so we have to
5816   # test for the positive form and if that works, add the negative form
5817   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS" >&5
5818 $as_echo_n "checking whether ${CC} supports -Wunused-command-line-argument, for NOT_THE_CFLAGS... " >&6; }
5819 if ${pgac_cv_prog_CC_cflags__Wunused_command_line_argument+:} false; then :
5820   $as_echo_n "(cached) " >&6
5821 else
5822   pgac_save_CFLAGS=$CFLAGS
5823 pgac_save_CC=$CC
5824 CC=${CC}
5825 CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
5826 ac_save_c_werror_flag=$ac_c_werror_flag
5827 ac_c_werror_flag=yes
5828 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5829 /* end confdefs.h.  */
5830
5831 int
5832 main ()
5833 {
5834
5835   ;
5836   return 0;
5837 }
5838 _ACEOF
5839 if ac_fn_c_try_compile "$LINENO"; then :
5840   pgac_cv_prog_CC_cflags__Wunused_command_line_argument=yes
5841 else
5842   pgac_cv_prog_CC_cflags__Wunused_command_line_argument=no
5843 fi
5844 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5845 ac_c_werror_flag=$ac_save_c_werror_flag
5846 CFLAGS="$pgac_save_CFLAGS"
5847 CC="$pgac_save_CC"
5848 fi
5849 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wunused_command_line_argument" >&5
5850 $as_echo "$pgac_cv_prog_CC_cflags__Wunused_command_line_argument" >&6; }
5851 if test x"$pgac_cv_prog_CC_cflags__Wunused_command_line_argument" = x"yes"; then
5852   NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
5853 fi
5854
5855
5856   if test -n "$NOT_THE_CFLAGS"; then
5857     CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
5858   fi
5859 elif test "$ICC" = yes; then
5860   # Intel's compiler has a bug/misoptimization in checking for
5861   # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
5862
5863 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -mp1, for CFLAGS" >&5
5864 $as_echo_n "checking whether ${CC} supports -mp1, for CFLAGS... " >&6; }
5865 if ${pgac_cv_prog_CC_cflags__mp1+:} false; then :
5866   $as_echo_n "(cached) " >&6
5867 else
5868   pgac_save_CFLAGS=$CFLAGS
5869 pgac_save_CC=$CC
5870 CC=${CC}
5871 CFLAGS="${CFLAGS} -mp1"
5872 ac_save_c_werror_flag=$ac_c_werror_flag
5873 ac_c_werror_flag=yes
5874 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5875 /* end confdefs.h.  */
5876
5877 int
5878 main ()
5879 {
5880
5881   ;
5882   return 0;
5883 }
5884 _ACEOF
5885 if ac_fn_c_try_compile "$LINENO"; then :
5886   pgac_cv_prog_CC_cflags__mp1=yes
5887 else
5888   pgac_cv_prog_CC_cflags__mp1=no
5889 fi
5890 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5891 ac_c_werror_flag=$ac_save_c_werror_flag
5892 CFLAGS="$pgac_save_CFLAGS"
5893 CC="$pgac_save_CC"
5894 fi
5895 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__mp1" >&5
5896 $as_echo "$pgac_cv_prog_CC_cflags__mp1" >&6; }
5897 if test x"$pgac_cv_prog_CC_cflags__mp1" = x"yes"; then
5898   CFLAGS="${CFLAGS} -mp1"
5899 fi
5900
5901
5902   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -mp1, for CXXFLAGS" >&5
5903 $as_echo_n "checking whether ${CXX} supports -mp1, for CXXFLAGS... " >&6; }
5904 if ${pgac_cv_prog_CXX_cxxflags__mp1+:} false; then :
5905   $as_echo_n "(cached) " >&6
5906 else
5907   pgac_save_CXXFLAGS=$CXXFLAGS
5908 pgac_save_CXX=$CXX
5909 CXX=${CXX}
5910 CXXFLAGS="${CXXFLAGS} -mp1"
5911 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
5912 ac_cxx_werror_flag=yes
5913 ac_ext=cpp
5914 ac_cpp='$CXXCPP $CPPFLAGS'
5915 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5916 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5917 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
5918
5919 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5920 /* end confdefs.h.  */
5921
5922 int
5923 main ()
5924 {
5925
5926   ;
5927   return 0;
5928 }
5929 _ACEOF
5930 if ac_fn_cxx_try_compile "$LINENO"; then :
5931   pgac_cv_prog_CXX_cxxflags__mp1=yes
5932 else
5933   pgac_cv_prog_CXX_cxxflags__mp1=no
5934 fi
5935 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5936 ac_ext=c
5937 ac_cpp='$CPP $CPPFLAGS'
5938 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5939 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5940 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5941
5942 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
5943 CXXFLAGS="$pgac_save_CXXFLAGS"
5944 CXX="$pgac_save_CXX"
5945 fi
5946 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__mp1" >&5
5947 $as_echo "$pgac_cv_prog_CXX_cxxflags__mp1" >&6; }
5948 if test x"$pgac_cv_prog_CXX_cxxflags__mp1" = x"yes"; then
5949   CXXFLAGS="${CXXFLAGS} -mp1"
5950 fi
5951
5952
5953   # Make sure strict aliasing is off (though this is said to be the default)
5954
5955 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -fno-strict-aliasing, for CFLAGS" >&5
5956 $as_echo_n "checking whether ${CC} supports -fno-strict-aliasing, for CFLAGS... " >&6; }
5957 if ${pgac_cv_prog_CC_cflags__fno_strict_aliasing+:} false; then :
5958   $as_echo_n "(cached) " >&6
5959 else
5960   pgac_save_CFLAGS=$CFLAGS
5961 pgac_save_CC=$CC
5962 CC=${CC}
5963 CFLAGS="${CFLAGS} -fno-strict-aliasing"
5964 ac_save_c_werror_flag=$ac_c_werror_flag
5965 ac_c_werror_flag=yes
5966 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5967 /* end confdefs.h.  */
5968
5969 int
5970 main ()
5971 {
5972
5973   ;
5974   return 0;
5975 }
5976 _ACEOF
5977 if ac_fn_c_try_compile "$LINENO"; then :
5978   pgac_cv_prog_CC_cflags__fno_strict_aliasing=yes
5979 else
5980   pgac_cv_prog_CC_cflags__fno_strict_aliasing=no
5981 fi
5982 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5983 ac_c_werror_flag=$ac_save_c_werror_flag
5984 CFLAGS="$pgac_save_CFLAGS"
5985 CC="$pgac_save_CC"
5986 fi
5987 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__fno_strict_aliasing" >&5
5988 $as_echo "$pgac_cv_prog_CC_cflags__fno_strict_aliasing" >&6; }
5989 if test x"$pgac_cv_prog_CC_cflags__fno_strict_aliasing" = x"yes"; then
5990   CFLAGS="${CFLAGS} -fno-strict-aliasing"
5991 fi
5992
5993
5994   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -fno-strict-aliasing, for CXXFLAGS" >&5
5995 $as_echo_n "checking whether ${CXX} supports -fno-strict-aliasing, for CXXFLAGS... " >&6; }
5996 if ${pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing+:} false; then :
5997   $as_echo_n "(cached) " >&6
5998 else
5999   pgac_save_CXXFLAGS=$CXXFLAGS
6000 pgac_save_CXX=$CXX
6001 CXX=${CXX}
6002 CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
6003 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
6004 ac_cxx_werror_flag=yes
6005 ac_ext=cpp
6006 ac_cpp='$CXXCPP $CPPFLAGS'
6007 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6008 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6009 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6010
6011 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6012 /* end confdefs.h.  */
6013
6014 int
6015 main ()
6016 {
6017
6018   ;
6019   return 0;
6020 }
6021 _ACEOF
6022 if ac_fn_cxx_try_compile "$LINENO"; then :
6023   pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing=yes
6024 else
6025   pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing=no
6026 fi
6027 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6028 ac_ext=c
6029 ac_cpp='$CPP $CPPFLAGS'
6030 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6031 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6032 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6033
6034 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
6035 CXXFLAGS="$pgac_save_CXXFLAGS"
6036 CXX="$pgac_save_CXX"
6037 fi
6038 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing" >&5
6039 $as_echo "$pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing" >&6; }
6040 if test x"$pgac_cv_prog_CXX_cxxflags__fno_strict_aliasing" = x"yes"; then
6041   CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
6042 fi
6043
6044
6045 elif test "$PORTNAME" = "aix"; then
6046   # AIX's xlc has to have strict aliasing turned off too
6047
6048 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -qnoansialias, for CFLAGS" >&5
6049 $as_echo_n "checking whether ${CC} supports -qnoansialias, for CFLAGS... " >&6; }
6050 if ${pgac_cv_prog_CC_cflags__qnoansialias+:} false; then :
6051   $as_echo_n "(cached) " >&6
6052 else
6053   pgac_save_CFLAGS=$CFLAGS
6054 pgac_save_CC=$CC
6055 CC=${CC}
6056 CFLAGS="${CFLAGS} -qnoansialias"
6057 ac_save_c_werror_flag=$ac_c_werror_flag
6058 ac_c_werror_flag=yes
6059 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6060 /* end confdefs.h.  */
6061
6062 int
6063 main ()
6064 {
6065
6066   ;
6067   return 0;
6068 }
6069 _ACEOF
6070 if ac_fn_c_try_compile "$LINENO"; then :
6071   pgac_cv_prog_CC_cflags__qnoansialias=yes
6072 else
6073   pgac_cv_prog_CC_cflags__qnoansialias=no
6074 fi
6075 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6076 ac_c_werror_flag=$ac_save_c_werror_flag
6077 CFLAGS="$pgac_save_CFLAGS"
6078 CC="$pgac_save_CC"
6079 fi
6080 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__qnoansialias" >&5
6081 $as_echo "$pgac_cv_prog_CC_cflags__qnoansialias" >&6; }
6082 if test x"$pgac_cv_prog_CC_cflags__qnoansialias" = x"yes"; then
6083   CFLAGS="${CFLAGS} -qnoansialias"
6084 fi
6085
6086
6087   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -qnoansialias, for CXXFLAGS" >&5
6088 $as_echo_n "checking whether ${CXX} supports -qnoansialias, for CXXFLAGS... " >&6; }
6089 if ${pgac_cv_prog_CXX_cxxflags__qnoansialias+:} false; then :
6090   $as_echo_n "(cached) " >&6
6091 else
6092   pgac_save_CXXFLAGS=$CXXFLAGS
6093 pgac_save_CXX=$CXX
6094 CXX=${CXX}
6095 CXXFLAGS="${CXXFLAGS} -qnoansialias"
6096 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
6097 ac_cxx_werror_flag=yes
6098 ac_ext=cpp
6099 ac_cpp='$CXXCPP $CPPFLAGS'
6100 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6101 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6102 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6103
6104 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6105 /* end confdefs.h.  */
6106
6107 int
6108 main ()
6109 {
6110
6111   ;
6112   return 0;
6113 }
6114 _ACEOF
6115 if ac_fn_cxx_try_compile "$LINENO"; then :
6116   pgac_cv_prog_CXX_cxxflags__qnoansialias=yes
6117 else
6118   pgac_cv_prog_CXX_cxxflags__qnoansialias=no
6119 fi
6120 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6121 ac_ext=c
6122 ac_cpp='$CPP $CPPFLAGS'
6123 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6124 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6125 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6126
6127 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
6128 CXXFLAGS="$pgac_save_CXXFLAGS"
6129 CXX="$pgac_save_CXX"
6130 fi
6131 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__qnoansialias" >&5
6132 $as_echo "$pgac_cv_prog_CXX_cxxflags__qnoansialias" >&6; }
6133 if test x"$pgac_cv_prog_CXX_cxxflags__qnoansialias" = x"yes"; then
6134   CXXFLAGS="${CXXFLAGS} -qnoansialias"
6135 fi
6136
6137
6138
6139 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -qlonglong, for CFLAGS" >&5
6140 $as_echo_n "checking whether ${CC} supports -qlonglong, for CFLAGS... " >&6; }
6141 if ${pgac_cv_prog_CC_cflags__qlonglong+:} false; then :
6142   $as_echo_n "(cached) " >&6
6143 else
6144   pgac_save_CFLAGS=$CFLAGS
6145 pgac_save_CC=$CC
6146 CC=${CC}
6147 CFLAGS="${CFLAGS} -qlonglong"
6148 ac_save_c_werror_flag=$ac_c_werror_flag
6149 ac_c_werror_flag=yes
6150 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6151 /* end confdefs.h.  */
6152
6153 int
6154 main ()
6155 {
6156
6157   ;
6158   return 0;
6159 }
6160 _ACEOF
6161 if ac_fn_c_try_compile "$LINENO"; then :
6162   pgac_cv_prog_CC_cflags__qlonglong=yes
6163 else
6164   pgac_cv_prog_CC_cflags__qlonglong=no
6165 fi
6166 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6167 ac_c_werror_flag=$ac_save_c_werror_flag
6168 CFLAGS="$pgac_save_CFLAGS"
6169 CC="$pgac_save_CC"
6170 fi
6171 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__qlonglong" >&5
6172 $as_echo "$pgac_cv_prog_CC_cflags__qlonglong" >&6; }
6173 if test x"$pgac_cv_prog_CC_cflags__qlonglong" = x"yes"; then
6174   CFLAGS="${CFLAGS} -qlonglong"
6175 fi
6176
6177
6178   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports -qlonglong, for CXXFLAGS" >&5
6179 $as_echo_n "checking whether ${CXX} supports -qlonglong, for CXXFLAGS... " >&6; }
6180 if ${pgac_cv_prog_CXX_cxxflags__qlonglong+:} false; then :
6181   $as_echo_n "(cached) " >&6
6182 else
6183   pgac_save_CXXFLAGS=$CXXFLAGS
6184 pgac_save_CXX=$CXX
6185 CXX=${CXX}
6186 CXXFLAGS="${CXXFLAGS} -qlonglong"
6187 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
6188 ac_cxx_werror_flag=yes
6189 ac_ext=cpp
6190 ac_cpp='$CXXCPP $CPPFLAGS'
6191 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6192 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6193 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6194
6195 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6196 /* end confdefs.h.  */
6197
6198 int
6199 main ()
6200 {
6201
6202   ;
6203   return 0;
6204 }
6205 _ACEOF
6206 if ac_fn_cxx_try_compile "$LINENO"; then :
6207   pgac_cv_prog_CXX_cxxflags__qlonglong=yes
6208 else
6209   pgac_cv_prog_CXX_cxxflags__qlonglong=no
6210 fi
6211 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6212 ac_ext=c
6213 ac_cpp='$CPP $CPPFLAGS'
6214 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6215 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6216 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6217
6218 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
6219 CXXFLAGS="$pgac_save_CXXFLAGS"
6220 CXX="$pgac_save_CXX"
6221 fi
6222 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags__qlonglong" >&5
6223 $as_echo "$pgac_cv_prog_CXX_cxxflags__qlonglong" >&6; }
6224 if test x"$pgac_cv_prog_CXX_cxxflags__qlonglong" = x"yes"; then
6225   CXXFLAGS="${CXXFLAGS} -qlonglong"
6226 fi
6227
6228
6229 elif test "$PORTNAME" = "hpux"; then
6230   # On some versions of HP-UX, libm functions do not set errno by default.
6231   # Fix that by using +Olibmerrno if the compiler recognizes it.
6232
6233 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports +Olibmerrno, for CFLAGS" >&5
6234 $as_echo_n "checking whether ${CC} supports +Olibmerrno, for CFLAGS... " >&6; }
6235 if ${pgac_cv_prog_CC_cflags_pOlibmerrno+:} false; then :
6236   $as_echo_n "(cached) " >&6
6237 else
6238   pgac_save_CFLAGS=$CFLAGS
6239 pgac_save_CC=$CC
6240 CC=${CC}
6241 CFLAGS="${CFLAGS} +Olibmerrno"
6242 ac_save_c_werror_flag=$ac_c_werror_flag
6243 ac_c_werror_flag=yes
6244 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6245 /* end confdefs.h.  */
6246
6247 int
6248 main ()
6249 {
6250
6251   ;
6252   return 0;
6253 }
6254 _ACEOF
6255 if ac_fn_c_try_compile "$LINENO"; then :
6256   pgac_cv_prog_CC_cflags_pOlibmerrno=yes
6257 else
6258   pgac_cv_prog_CC_cflags_pOlibmerrno=no
6259 fi
6260 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6261 ac_c_werror_flag=$ac_save_c_werror_flag
6262 CFLAGS="$pgac_save_CFLAGS"
6263 CC="$pgac_save_CC"
6264 fi
6265 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags_pOlibmerrno" >&5
6266 $as_echo "$pgac_cv_prog_CC_cflags_pOlibmerrno" >&6; }
6267 if test x"$pgac_cv_prog_CC_cflags_pOlibmerrno" = x"yes"; then
6268   CFLAGS="${CFLAGS} +Olibmerrno"
6269 fi
6270
6271
6272   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CXX} supports +Olibmerrno, for CXXFLAGS" >&5
6273 $as_echo_n "checking whether ${CXX} supports +Olibmerrno, for CXXFLAGS... " >&6; }
6274 if ${pgac_cv_prog_CXX_cxxflags_pOlibmerrno+:} false; then :
6275   $as_echo_n "(cached) " >&6
6276 else
6277   pgac_save_CXXFLAGS=$CXXFLAGS
6278 pgac_save_CXX=$CXX
6279 CXX=${CXX}
6280 CXXFLAGS="${CXXFLAGS} +Olibmerrno"
6281 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
6282 ac_cxx_werror_flag=yes
6283 ac_ext=cpp
6284 ac_cpp='$CXXCPP $CPPFLAGS'
6285 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6286 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6287 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6288
6289 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6290 /* end confdefs.h.  */
6291
6292 int
6293 main ()
6294 {
6295
6296   ;
6297   return 0;
6298 }
6299 _ACEOF
6300 if ac_fn_cxx_try_compile "$LINENO"; then :
6301   pgac_cv_prog_CXX_cxxflags_pOlibmerrno=yes
6302 else
6303   pgac_cv_prog_CXX_cxxflags_pOlibmerrno=no
6304 fi
6305 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6306 ac_ext=c
6307 ac_cpp='$CPP $CPPFLAGS'
6308 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6309 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6310 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6311
6312 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
6313 CXXFLAGS="$pgac_save_CXXFLAGS"
6314 CXX="$pgac_save_CXX"
6315 fi
6316 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CXX_cxxflags_pOlibmerrno" >&5
6317 $as_echo "$pgac_cv_prog_CXX_cxxflags_pOlibmerrno" >&6; }
6318 if test x"$pgac_cv_prog_CXX_cxxflags_pOlibmerrno" = x"yes"; then
6319   CXXFLAGS="${CXXFLAGS} +Olibmerrno"
6320 fi
6321
6322
6323 fi
6324
6325 CFLAGS_VECTOR=$CFLAGS_VECTOR
6326
6327
6328 # Determine flags used to emit bitcode for JIT inlining. Need to test
6329 # for behaviour changing compiler flags, to keep compatibility with
6330 # compiler used for normal postgres code.
6331 if test "$with_llvm" = yes ; then
6332   CLANGXX="$CLANG -xc++"
6333
6334   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -fno-strict-aliasing, for BITCODE_CFLAGS" >&5
6335 $as_echo_n "checking whether ${CLANG} supports -fno-strict-aliasing, for BITCODE_CFLAGS... " >&6; }
6336 if ${pgac_cv_prog_CLANG_cflags__fno_strict_aliasing+:} false; then :
6337   $as_echo_n "(cached) " >&6
6338 else
6339   pgac_save_CFLAGS=$CFLAGS
6340 pgac_save_CC=$CC
6341 CC=${CLANG}
6342 CFLAGS="${BITCODE_CFLAGS} -fno-strict-aliasing"
6343 ac_save_c_werror_flag=$ac_c_werror_flag
6344 ac_c_werror_flag=yes
6345 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6346 /* end confdefs.h.  */
6347
6348 int
6349 main ()
6350 {
6351
6352   ;
6353   return 0;
6354 }
6355 _ACEOF
6356 if ac_fn_c_try_compile "$LINENO"; then :
6357   pgac_cv_prog_CLANG_cflags__fno_strict_aliasing=yes
6358 else
6359   pgac_cv_prog_CLANG_cflags__fno_strict_aliasing=no
6360 fi
6361 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6362 ac_c_werror_flag=$ac_save_c_werror_flag
6363 CFLAGS="$pgac_save_CFLAGS"
6364 CC="$pgac_save_CC"
6365 fi
6366 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__fno_strict_aliasing" >&5
6367 $as_echo "$pgac_cv_prog_CLANG_cflags__fno_strict_aliasing" >&6; }
6368 if test x"$pgac_cv_prog_CLANG_cflags__fno_strict_aliasing" = x"yes"; then
6369   BITCODE_CFLAGS="${BITCODE_CFLAGS} -fno-strict-aliasing"
6370 fi
6371
6372   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANGXX} supports -fno-strict-aliasing, for BITCODE_CXXFLAGS" >&5
6373 $as_echo_n "checking whether ${CLANGXX} supports -fno-strict-aliasing, for BITCODE_CXXFLAGS... " >&6; }
6374 if ${pgac_cv_prog_CLANGXX_cxxflags__fno_strict_aliasing+:} false; then :
6375   $as_echo_n "(cached) " >&6
6376 else
6377   pgac_save_CXXFLAGS=$CXXFLAGS
6378 pgac_save_CXX=$CXX
6379 CXX=${CLANGXX}
6380 CXXFLAGS="${BITCODE_CXXFLAGS} -fno-strict-aliasing"
6381 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
6382 ac_cxx_werror_flag=yes
6383 ac_ext=cpp
6384 ac_cpp='$CXXCPP $CPPFLAGS'
6385 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6386 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6387 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6388
6389 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6390 /* end confdefs.h.  */
6391
6392 int
6393 main ()
6394 {
6395
6396   ;
6397   return 0;
6398 }
6399 _ACEOF
6400 if ac_fn_cxx_try_compile "$LINENO"; then :
6401   pgac_cv_prog_CLANGXX_cxxflags__fno_strict_aliasing=yes
6402 else
6403   pgac_cv_prog_CLANGXX_cxxflags__fno_strict_aliasing=no
6404 fi
6405 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6406 ac_ext=c
6407 ac_cpp='$CPP $CPPFLAGS'
6408 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6409 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6410 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6411
6412 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
6413 CXXFLAGS="$pgac_save_CXXFLAGS"
6414 CXX="$pgac_save_CXX"
6415 fi
6416 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANGXX_cxxflags__fno_strict_aliasing" >&5
6417 $as_echo "$pgac_cv_prog_CLANGXX_cxxflags__fno_strict_aliasing" >&6; }
6418 if test x"$pgac_cv_prog_CLANGXX_cxxflags__fno_strict_aliasing" = x"yes"; then
6419   BITCODE_CXXFLAGS="${BITCODE_CXXFLAGS} -fno-strict-aliasing"
6420 fi
6421
6422   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -fwrapv, for BITCODE_CFLAGS" >&5
6423 $as_echo_n "checking whether ${CLANG} supports -fwrapv, for BITCODE_CFLAGS... " >&6; }
6424 if ${pgac_cv_prog_CLANG_cflags__fwrapv+:} false; then :
6425   $as_echo_n "(cached) " >&6
6426 else
6427   pgac_save_CFLAGS=$CFLAGS
6428 pgac_save_CC=$CC
6429 CC=${CLANG}
6430 CFLAGS="${BITCODE_CFLAGS} -fwrapv"
6431 ac_save_c_werror_flag=$ac_c_werror_flag
6432 ac_c_werror_flag=yes
6433 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6434 /* end confdefs.h.  */
6435
6436 int
6437 main ()
6438 {
6439
6440   ;
6441   return 0;
6442 }
6443 _ACEOF
6444 if ac_fn_c_try_compile "$LINENO"; then :
6445   pgac_cv_prog_CLANG_cflags__fwrapv=yes
6446 else
6447   pgac_cv_prog_CLANG_cflags__fwrapv=no
6448 fi
6449 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6450 ac_c_werror_flag=$ac_save_c_werror_flag
6451 CFLAGS="$pgac_save_CFLAGS"
6452 CC="$pgac_save_CC"
6453 fi
6454 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__fwrapv" >&5
6455 $as_echo "$pgac_cv_prog_CLANG_cflags__fwrapv" >&6; }
6456 if test x"$pgac_cv_prog_CLANG_cflags__fwrapv" = x"yes"; then
6457   BITCODE_CFLAGS="${BITCODE_CFLAGS} -fwrapv"
6458 fi
6459
6460   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANGXX} supports -fwrapv, for BITCODE_CXXFLAGS" >&5
6461 $as_echo_n "checking whether ${CLANGXX} supports -fwrapv, for BITCODE_CXXFLAGS... " >&6; }
6462 if ${pgac_cv_prog_CLANGXX_cxxflags__fwrapv+:} false; then :
6463   $as_echo_n "(cached) " >&6
6464 else
6465   pgac_save_CXXFLAGS=$CXXFLAGS
6466 pgac_save_CXX=$CXX
6467 CXX=${CLANGXX}
6468 CXXFLAGS="${BITCODE_CXXFLAGS} -fwrapv"
6469 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
6470 ac_cxx_werror_flag=yes
6471 ac_ext=cpp
6472 ac_cpp='$CXXCPP $CPPFLAGS'
6473 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6474 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6475 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6476
6477 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6478 /* end confdefs.h.  */
6479
6480 int
6481 main ()
6482 {
6483
6484   ;
6485   return 0;
6486 }
6487 _ACEOF
6488 if ac_fn_cxx_try_compile "$LINENO"; then :
6489   pgac_cv_prog_CLANGXX_cxxflags__fwrapv=yes
6490 else
6491   pgac_cv_prog_CLANGXX_cxxflags__fwrapv=no
6492 fi
6493 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6494 ac_ext=c
6495 ac_cpp='$CPP $CPPFLAGS'
6496 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6497 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6498 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6499
6500 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
6501 CXXFLAGS="$pgac_save_CXXFLAGS"
6502 CXX="$pgac_save_CXX"
6503 fi
6504 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANGXX_cxxflags__fwrapv" >&5
6505 $as_echo "$pgac_cv_prog_CLANGXX_cxxflags__fwrapv" >&6; }
6506 if test x"$pgac_cv_prog_CLANGXX_cxxflags__fwrapv" = x"yes"; then
6507   BITCODE_CXXFLAGS="${BITCODE_CXXFLAGS} -fwrapv"
6508 fi
6509
6510   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANG} supports -fexcess-precision=standard, for BITCODE_CFLAGS" >&5
6511 $as_echo_n "checking whether ${CLANG} supports -fexcess-precision=standard, for BITCODE_CFLAGS... " >&6; }
6512 if ${pgac_cv_prog_CLANG_cflags__fexcess_precision_standard+:} false; then :
6513   $as_echo_n "(cached) " >&6
6514 else
6515   pgac_save_CFLAGS=$CFLAGS
6516 pgac_save_CC=$CC
6517 CC=${CLANG}
6518 CFLAGS="${BITCODE_CFLAGS} -fexcess-precision=standard"
6519 ac_save_c_werror_flag=$ac_c_werror_flag
6520 ac_c_werror_flag=yes
6521 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6522 /* end confdefs.h.  */
6523
6524 int
6525 main ()
6526 {
6527
6528   ;
6529   return 0;
6530 }
6531 _ACEOF
6532 if ac_fn_c_try_compile "$LINENO"; then :
6533   pgac_cv_prog_CLANG_cflags__fexcess_precision_standard=yes
6534 else
6535   pgac_cv_prog_CLANG_cflags__fexcess_precision_standard=no
6536 fi
6537 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6538 ac_c_werror_flag=$ac_save_c_werror_flag
6539 CFLAGS="$pgac_save_CFLAGS"
6540 CC="$pgac_save_CC"
6541 fi
6542 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANG_cflags__fexcess_precision_standard" >&5
6543 $as_echo "$pgac_cv_prog_CLANG_cflags__fexcess_precision_standard" >&6; }
6544 if test x"$pgac_cv_prog_CLANG_cflags__fexcess_precision_standard" = x"yes"; then
6545   BITCODE_CFLAGS="${BITCODE_CFLAGS} -fexcess-precision=standard"
6546 fi
6547
6548   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CLANGXX} supports -fexcess-precision=standard, for BITCODE_CXXFLAGS" >&5
6549 $as_echo_n "checking whether ${CLANGXX} supports -fexcess-precision=standard, for BITCODE_CXXFLAGS... " >&6; }
6550 if ${pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard+:} false; then :
6551   $as_echo_n "(cached) " >&6
6552 else
6553   pgac_save_CXXFLAGS=$CXXFLAGS
6554 pgac_save_CXX=$CXX
6555 CXX=${CLANGXX}
6556 CXXFLAGS="${BITCODE_CXXFLAGS} -fexcess-precision=standard"
6557 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
6558 ac_cxx_werror_flag=yes
6559 ac_ext=cpp
6560 ac_cpp='$CXXCPP $CPPFLAGS'
6561 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6562 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6563 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
6564
6565 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6566 /* end confdefs.h.  */
6567
6568 int
6569 main ()
6570 {
6571
6572   ;
6573   return 0;
6574 }
6575 _ACEOF
6576 if ac_fn_cxx_try_compile "$LINENO"; then :
6577   pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard=yes
6578 else
6579   pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard=no
6580 fi
6581 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6582 ac_ext=c
6583 ac_cpp='$CPP $CPPFLAGS'
6584 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6585 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6586 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6587
6588 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
6589 CXXFLAGS="$pgac_save_CXXFLAGS"
6590 CXX="$pgac_save_CXX"
6591 fi
6592 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard" >&5
6593 $as_echo "$pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard" >&6; }
6594 if test x"$pgac_cv_prog_CLANGXX_cxxflags__fexcess_precision_standard" = x"yes"; then
6595   BITCODE_CXXFLAGS="${BITCODE_CXXFLAGS} -fexcess-precision=standard"
6596 fi
6597
6598 fi
6599
6600 # supply -g if --enable-debug
6601 if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
6602   CFLAGS="$CFLAGS -g"
6603 fi
6604
6605 if test "$enable_debug" = yes && test "$ac_cv_prog_cxx_g" = yes; then
6606   CXXFLAGS="$CXXFLAGS -g"
6607 fi
6608
6609 # enable code coverage if --enable-coverage
6610 if test "$enable_coverage" = yes; then
6611   if test "$GCC" = yes; then
6612     CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
6613     CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
6614   else
6615     as_fn_error $? "--enable-coverage is supported only when using GCC" "$LINENO" 5
6616   fi
6617 fi
6618
6619 # enable profiling if --enable-profiling
6620 if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then
6621   if test "$GCC" = yes; then
6622
6623 $as_echo "#define PROFILE_PID_DIR 1" >>confdefs.h
6624
6625     CFLAGS="$CFLAGS -pg $PLATFORM_PROFILE_FLAGS"
6626     CXXFLAGS="$CXXFLAGS -pg $PLATFORM_PROFILE_FLAGS"
6627   else
6628     as_fn_error $? "--enable-profiling is supported only when using GCC" "$LINENO" 5
6629   fi
6630 fi
6631
6632 # We already have this in Makefile.win32, but configure needs it too
6633 if test "$PORTNAME" = "win32"; then
6634   CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32 -DEXEC_BACKEND"
6635 fi
6636
6637 # Now that we're done automatically adding stuff to C[XX]FLAGS, put back the
6638 # user-specified flags (if any) at the end.  This lets users override
6639 # the automatic additions.
6640 CFLAGS="$CFLAGS $user_CFLAGS"
6641 CXXFLAGS="$CXXFLAGS $user_CXXFLAGS"
6642 BITCODE_CFLAGS="$BITCODE_CFLAGS $user_BITCODE_CFLAGS"
6643 BITCODE_CXXFLAGS="$BITCODE_CXXFLAGS $user_BITCODE_CXXFLAGS"
6644
6645 BITCODE_CFLAGS=$BITCODE_CFLAGS
6646
6647 BITCODE_CXXFLAGS=$BITCODE_CXXFLAGS
6648
6649
6650 # Check if the compiler still works with the final flag settings
6651 # (note, we're not checking that for CXX, which is optional)
6652 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler still works" >&5
6653 $as_echo_n "checking whether the C compiler still works... " >&6; }
6654 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6655 /* end confdefs.h.  */
6656
6657 int
6658 main ()
6659 {
6660 return 0;
6661   ;
6662   return 0;
6663 }
6664 _ACEOF
6665 if ac_fn_c_try_link "$LINENO"; then :
6666   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6667 $as_echo "yes" >&6; }
6668 else
6669   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6670 $as_echo "no" >&6; }
6671    as_fn_error $? "cannot proceed" "$LINENO" 5
6672 fi
6673 rm -f core conftest.err conftest.$ac_objext \
6674     conftest$ac_exeext conftest.$ac_ext
6675
6676 # Defend against gcc -ffast-math
6677 if test "$GCC" = yes; then
6678 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6679 /* end confdefs.h.  */
6680
6681 int
6682 main ()
6683 {
6684 #ifdef __FAST_MATH__
6685 choke me
6686 #endif
6687   ;
6688   return 0;
6689 }
6690 _ACEOF
6691 if ac_fn_c_try_compile "$LINENO"; then :
6692
6693 else
6694   as_fn_error $? "do not put -ffast-math in CFLAGS" "$LINENO" 5
6695 fi
6696 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6697 fi
6698
6699 ac_ext=c
6700 ac_cpp='$CPP $CPPFLAGS'
6701 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6702 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6703 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6704 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
6705 $as_echo_n "checking how to run the C preprocessor... " >&6; }
6706 # On Suns, sometimes $CPP names a directory.
6707 if test -n "$CPP" && test -d "$CPP"; then
6708   CPP=
6709 fi
6710 if test -z "$CPP"; then
6711   if ${ac_cv_prog_CPP+:} false; then :
6712   $as_echo_n "(cached) " >&6
6713 else
6714       # Double quotes because CPP needs to be expanded
6715     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
6716     do
6717       ac_preproc_ok=false
6718 for ac_c_preproc_warn_flag in '' yes
6719 do
6720   # Use a header file that comes with gcc, so configuring glibc
6721   # with a fresh cross-compiler works.
6722   # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
6723   # <limits.h> exists even on freestanding compilers.
6724   # On the NeXT, cc -E runs the code through the compiler's parser,
6725   # not just through cpp. "Syntax error" is here to catch this case.
6726   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6727 /* end confdefs.h.  */
6728 #ifdef __STDC__
6729 # include <limits.h>
6730 #else
6731 # include <assert.h>
6732 #endif
6733                      Syntax error
6734 _ACEOF
6735 if ac_fn_c_try_cpp "$LINENO"; then :
6736
6737 else
6738   # Broken: fails on valid input.
6739 continue
6740 fi
6741 rm -f conftest.err conftest.i conftest.$ac_ext
6742
6743   # OK, works on sane cases.  Now check whether nonexistent headers
6744   # can be detected and how.
6745   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6746 /* end confdefs.h.  */
6747 #include <ac_nonexistent.h>
6748 _ACEOF
6749 if ac_fn_c_try_cpp "$LINENO"; then :
6750   # Broken: success on invalid input.
6751 continue
6752 else
6753   # Passes both tests.
6754 ac_preproc_ok=:
6755 break
6756 fi
6757 rm -f conftest.err conftest.i conftest.$ac_ext
6758
6759 done
6760 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6761 rm -f conftest.i conftest.err conftest.$ac_ext
6762 if $ac_preproc_ok; then :
6763   break
6764 fi
6765
6766     done
6767     ac_cv_prog_CPP=$CPP
6768
6769 fi
6770   CPP=$ac_cv_prog_CPP
6771 else
6772   ac_cv_prog_CPP=$CPP
6773 fi
6774 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
6775 $as_echo "$CPP" >&6; }
6776 ac_preproc_ok=false
6777 for ac_c_preproc_warn_flag in '' yes
6778 do
6779   # Use a header file that comes with gcc, so configuring glibc
6780   # with a fresh cross-compiler works.
6781   # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
6782   # <limits.h> exists even on freestanding compilers.
6783   # On the NeXT, cc -E runs the code through the compiler's parser,
6784   # not just through cpp. "Syntax error" is here to catch this case.
6785   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6786 /* end confdefs.h.  */
6787 #ifdef __STDC__
6788 # include <limits.h>
6789 #else
6790 # include <assert.h>
6791 #endif
6792                      Syntax error
6793 _ACEOF
6794 if ac_fn_c_try_cpp "$LINENO"; then :
6795
6796 else
6797   # Broken: fails on valid input.
6798 continue
6799 fi
6800 rm -f conftest.err conftest.i conftest.$ac_ext
6801
6802   # OK, works on sane cases.  Now check whether nonexistent headers
6803   # can be detected and how.
6804   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6805 /* end confdefs.h.  */
6806 #include <ac_nonexistent.h>
6807 _ACEOF
6808 if ac_fn_c_try_cpp "$LINENO"; then :
6809   # Broken: success on invalid input.
6810 continue
6811 else
6812   # Passes both tests.
6813 ac_preproc_ok=:
6814 break
6815 fi
6816 rm -f conftest.err conftest.i conftest.$ac_ext
6817
6818 done
6819 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6820 rm -f conftest.i conftest.err conftest.$ac_ext
6821 if $ac_preproc_ok; then :
6822
6823 else
6824   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
6825 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
6826 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
6827 See \`config.log' for more details" "$LINENO" 5; }
6828 fi
6829
6830 ac_ext=c
6831 ac_cpp='$CPP $CPPFLAGS'
6832 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6833 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6834 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6835
6836
6837
6838
6839 #
6840 # Set up TAS assembly code if needed; the template file has now had its
6841 # chance to request this.
6842 #
6843 ac_config_links="$ac_config_links src/backend/port/tas.s:src/backend/port/tas/${tas_file}"
6844
6845
6846 if test "$need_tas" = yes ; then
6847   TAS=tas.o
6848 else
6849   TAS=""
6850 fi
6851
6852
6853
6854 #
6855 # Automatic dependency tracking
6856 #
6857
6858
6859 # Check whether --enable-depend was given.
6860 if test "${enable_depend+set}" = set; then :
6861   enableval=$enable_depend;
6862   case $enableval in
6863     yes)
6864       autodepend=yes
6865       ;;
6866     no)
6867       :
6868       ;;
6869     *)
6870       as_fn_error $? "no argument expected for --enable-depend option" "$LINENO" 5
6871       ;;
6872   esac
6873
6874 else
6875   enable_depend=no
6876
6877 fi
6878
6879
6880
6881
6882
6883 #
6884 # Enable assert checks
6885 #
6886
6887
6888 # Check whether --enable-cassert was given.
6889 if test "${enable_cassert+set}" = set; then :
6890   enableval=$enable_cassert;
6891   case $enableval in
6892     yes)
6893
6894 $as_echo "#define USE_ASSERT_CHECKING 1" >>confdefs.h
6895
6896       ;;
6897     no)
6898       :
6899       ;;
6900     *)
6901       as_fn_error $? "no argument expected for --enable-cassert option" "$LINENO" 5
6902       ;;
6903   esac
6904
6905 else
6906   enable_cassert=no
6907
6908 fi
6909
6910
6911
6912
6913 #
6914 # Include directories
6915 #
6916 ac_save_IFS=$IFS
6917 IFS="${IFS}${PATH_SEPARATOR}"
6918 # SRCH_INC comes from the template file
6919 for dir in $with_includes $SRCH_INC; do
6920   if test -d "$dir"; then
6921     INCLUDES="$INCLUDES -I$dir"
6922   else
6923     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Include directory $dir does not exist." >&5
6924 $as_echo "$as_me: WARNING: *** Include directory $dir does not exist." >&2;}
6925   fi
6926 done
6927 IFS=$ac_save_IFS
6928
6929
6930
6931 #
6932 # Library directories
6933 #
6934 ac_save_IFS=$IFS
6935 IFS="${IFS}${PATH_SEPARATOR}"
6936 # LIBRARY_DIRS comes from command line, SRCH_LIB from template file.
6937 for dir in $LIBRARY_DIRS $SRCH_LIB; do
6938   if test -d "$dir"; then
6939     LIBDIRS="$LIBDIRS -L$dir"
6940   else
6941     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Library directory $dir does not exist." >&5
6942 $as_echo "$as_me: WARNING: *** Library directory $dir does not exist." >&2;}
6943   fi
6944 done
6945 IFS=$ac_save_IFS
6946
6947 #
6948 # Enable thread-safe client libraries
6949 #
6950 { $as_echo "$as_me:${as_lineno-$LINENO}: checking allow thread-safe client libraries" >&5
6951 $as_echo_n "checking allow thread-safe client libraries... " >&6; }
6952
6953
6954 # Check whether --enable-thread-safety was given.
6955 if test "${enable_thread_safety+set}" = set; then :
6956   enableval=$enable_thread_safety;
6957   case $enableval in
6958     yes)
6959       :
6960       ;;
6961     no)
6962       :
6963       ;;
6964     *)
6965       as_fn_error $? "no argument expected for --enable-thread-safety option" "$LINENO" 5
6966       ;;
6967   esac
6968
6969 else
6970   enable_thread_safety=yes
6971
6972 fi
6973
6974
6975 if test "$enable_thread_safety" = yes; then
6976
6977 $as_echo "#define ENABLE_THREAD_SAFETY 1" >>confdefs.h
6978
6979 fi
6980 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_thread_safety" >&5
6981 $as_echo "$enable_thread_safety" >&6; }
6982
6983
6984 #
6985 # ICU
6986 #
6987 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with ICU support" >&5
6988 $as_echo_n "checking whether to build with ICU support... " >&6; }
6989
6990
6991
6992 # Check whether --with-icu was given.
6993 if test "${with_icu+set}" = set; then :
6994   withval=$with_icu;
6995   case $withval in
6996     yes)
6997
6998 $as_echo "#define USE_ICU 1" >>confdefs.h
6999
7000       ;;
7001     no)
7002       :
7003       ;;
7004     *)
7005       as_fn_error $? "no argument expected for --with-icu option" "$LINENO" 5
7006       ;;
7007   esac
7008
7009 else
7010   with_icu=no
7011
7012 fi
7013
7014
7015 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_icu" >&5
7016 $as_echo "$with_icu" >&6; }
7017
7018
7019 if test "$with_icu" = yes; then
7020
7021
7022
7023
7024
7025
7026
7027 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
7028         if test -n "$ac_tool_prefix"; then
7029   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
7030 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
7031 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7032 $as_echo_n "checking for $ac_word... " >&6; }
7033 if ${ac_cv_path_PKG_CONFIG+:} false; then :
7034   $as_echo_n "(cached) " >&6
7035 else
7036   case $PKG_CONFIG in
7037   [\\/]* | ?:[\\/]*)
7038   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
7039   ;;
7040   *)
7041   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7042 for as_dir in $PATH
7043 do
7044   IFS=$as_save_IFS
7045   test -z "$as_dir" && as_dir=.
7046     for ac_exec_ext in '' $ac_executable_extensions; do
7047   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7048     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
7049     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7050     break 2
7051   fi
7052 done
7053   done
7054 IFS=$as_save_IFS
7055
7056   ;;
7057 esac
7058 fi
7059 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
7060 if test -n "$PKG_CONFIG"; then
7061   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
7062 $as_echo "$PKG_CONFIG" >&6; }
7063 else
7064   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7065 $as_echo "no" >&6; }
7066 fi
7067
7068
7069 fi
7070 if test -z "$ac_cv_path_PKG_CONFIG"; then
7071   ac_pt_PKG_CONFIG=$PKG_CONFIG
7072   # Extract the first word of "pkg-config", so it can be a program name with args.
7073 set dummy pkg-config; ac_word=$2
7074 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7075 $as_echo_n "checking for $ac_word... " >&6; }
7076 if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
7077   $as_echo_n "(cached) " >&6
7078 else
7079   case $ac_pt_PKG_CONFIG in
7080   [\\/]* | ?:[\\/]*)
7081   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
7082   ;;
7083   *)
7084   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7085 for as_dir in $PATH
7086 do
7087   IFS=$as_save_IFS
7088   test -z "$as_dir" && as_dir=.
7089     for ac_exec_ext in '' $ac_executable_extensions; do
7090   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7091     ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
7092     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7093     break 2
7094   fi
7095 done
7096   done
7097 IFS=$as_save_IFS
7098
7099   ;;
7100 esac
7101 fi
7102 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
7103 if test -n "$ac_pt_PKG_CONFIG"; then
7104   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
7105 $as_echo "$ac_pt_PKG_CONFIG" >&6; }
7106 else
7107   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7108 $as_echo "no" >&6; }
7109 fi
7110
7111   if test "x$ac_pt_PKG_CONFIG" = x; then
7112     PKG_CONFIG=""
7113   else
7114     case $cross_compiling:$ac_tool_warned in
7115 yes:)
7116 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7117 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7118 ac_tool_warned=yes ;;
7119 esac
7120     PKG_CONFIG=$ac_pt_PKG_CONFIG
7121   fi
7122 else
7123   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
7124 fi
7125
7126 fi
7127 if test -n "$PKG_CONFIG"; then
7128         _pkg_min_version=0.9.0
7129         { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
7130 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
7131         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
7132                 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7133 $as_echo "yes" >&6; }
7134         else
7135                 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7136 $as_echo "no" >&6; }
7137                 PKG_CONFIG=""
7138         fi
7139 fi
7140
7141 pkg_failed=no
7142 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icu-uc icu-i18n" >&5
7143 $as_echo_n "checking for icu-uc icu-i18n... " >&6; }
7144
7145 if test -n "$ICU_CFLAGS"; then
7146     pkg_cv_ICU_CFLAGS="$ICU_CFLAGS"
7147  elif test -n "$PKG_CONFIG"; then
7148     if test -n "$PKG_CONFIG" && \
7149     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-uc icu-i18n\""; } >&5
7150   ($PKG_CONFIG --exists --print-errors "icu-uc icu-i18n") 2>&5
7151   ac_status=$?
7152   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7153   test $ac_status = 0; }; then
7154   pkg_cv_ICU_CFLAGS=`$PKG_CONFIG --cflags "icu-uc icu-i18n" 2>/dev/null`
7155                       test "x$?" != "x0" && pkg_failed=yes
7156 else
7157   pkg_failed=yes
7158 fi
7159  else
7160     pkg_failed=untried
7161 fi
7162 if test -n "$ICU_LIBS"; then
7163     pkg_cv_ICU_LIBS="$ICU_LIBS"
7164  elif test -n "$PKG_CONFIG"; then
7165     if test -n "$PKG_CONFIG" && \
7166     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-uc icu-i18n\""; } >&5
7167   ($PKG_CONFIG --exists --print-errors "icu-uc icu-i18n") 2>&5
7168   ac_status=$?
7169   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7170   test $ac_status = 0; }; then
7171   pkg_cv_ICU_LIBS=`$PKG_CONFIG --libs "icu-uc icu-i18n" 2>/dev/null`
7172                       test "x$?" != "x0" && pkg_failed=yes
7173 else
7174   pkg_failed=yes
7175 fi
7176  else
7177     pkg_failed=untried
7178 fi
7179
7180
7181
7182 if test $pkg_failed = yes; then
7183         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7184 $as_echo "no" >&6; }
7185
7186 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
7187         _pkg_short_errors_supported=yes
7188 else
7189         _pkg_short_errors_supported=no
7190 fi
7191         if test $_pkg_short_errors_supported = yes; then
7192                 ICU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "icu-uc icu-i18n" 2>&1`
7193         else
7194                 ICU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "icu-uc icu-i18n" 2>&1`
7195         fi
7196         # Put the nasty error message in config.log where it belongs
7197         echo "$ICU_PKG_ERRORS" >&5
7198
7199         as_fn_error $? "Package requirements (icu-uc icu-i18n) were not met:
7200
7201 $ICU_PKG_ERRORS
7202
7203 Consider adjusting the PKG_CONFIG_PATH environment variable if you
7204 installed software in a non-standard prefix.
7205
7206 Alternatively, you may set the environment variables ICU_CFLAGS
7207 and ICU_LIBS to avoid the need to call pkg-config.
7208 See the pkg-config man page for more details." "$LINENO" 5
7209 elif test $pkg_failed = untried; then
7210         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7211 $as_echo "no" >&6; }
7212         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
7213 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
7214 as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
7215 is in your PATH or set the PKG_CONFIG environment variable to the full
7216 path to pkg-config.
7217
7218 Alternatively, you may set the environment variables ICU_CFLAGS
7219 and ICU_LIBS to avoid the need to call pkg-config.
7220 See the pkg-config man page for more details.
7221
7222 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
7223 See \`config.log' for more details" "$LINENO" 5; }
7224 else
7225         ICU_CFLAGS=$pkg_cv_ICU_CFLAGS
7226         ICU_LIBS=$pkg_cv_ICU_LIBS
7227         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7228 $as_echo "yes" >&6; }
7229
7230 fi
7231 fi
7232
7233 #
7234 # Optionally build Tcl modules (PL/Tcl)
7235 #
7236 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Tcl" >&5
7237 $as_echo_n "checking whether to build with Tcl... " >&6; }
7238
7239
7240
7241 # Check whether --with-tcl was given.
7242 if test "${with_tcl+set}" = set; then :
7243   withval=$with_tcl;
7244   case $withval in
7245     yes)
7246       :
7247       ;;
7248     no)
7249       :
7250       ;;
7251     *)
7252       as_fn_error $? "no argument expected for --with-tcl option" "$LINENO" 5
7253       ;;
7254   esac
7255
7256 else
7257   with_tcl=no
7258
7259 fi
7260
7261
7262 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_tcl" >&5
7263 $as_echo "$with_tcl" >&6; }
7264
7265
7266 # We see if the path to the Tcl/Tk configuration scripts is specified.
7267 # This will override the use of tclsh to find the paths to search.
7268
7269
7270
7271
7272 # Check whether --with-tclconfig was given.
7273 if test "${with_tclconfig+set}" = set; then :
7274   withval=$with_tclconfig;
7275   case $withval in
7276     yes)
7277       as_fn_error $? "argument required for --with-tclconfig option" "$LINENO" 5
7278       ;;
7279     no)
7280       as_fn_error $? "argument required for --with-tclconfig option" "$LINENO" 5
7281       ;;
7282     *)
7283
7284       ;;
7285   esac
7286
7287 fi
7288
7289
7290
7291 #
7292 # Optionally build Perl modules (PL/Perl)
7293 #
7294 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Perl modules" >&5
7295 $as_echo_n "checking whether to build Perl modules... " >&6; }
7296
7297
7298
7299 # Check whether --with-perl was given.
7300 if test "${with_perl+set}" = set; then :
7301   withval=$with_perl;
7302   case $withval in
7303     yes)
7304       :
7305       ;;
7306     no)
7307       :
7308       ;;
7309     *)
7310       as_fn_error $? "no argument expected for --with-perl option" "$LINENO" 5
7311       ;;
7312   esac
7313
7314 else
7315   with_perl=no
7316
7317 fi
7318
7319
7320 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_perl" >&5
7321 $as_echo "$with_perl" >&6; }
7322
7323
7324 #
7325 # Optionally build Python modules (PL/Python)
7326 #
7327 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Python modules" >&5
7328 $as_echo_n "checking whether to build Python modules... " >&6; }
7329
7330
7331
7332 # Check whether --with-python was given.
7333 if test "${with_python+set}" = set; then :
7334   withval=$with_python;
7335   case $withval in
7336     yes)
7337       :
7338       ;;
7339     no)
7340       :
7341       ;;
7342     *)
7343       as_fn_error $? "no argument expected for --with-python option" "$LINENO" 5
7344       ;;
7345   esac
7346
7347 else
7348   with_python=no
7349
7350 fi
7351
7352
7353 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_python" >&5
7354 $as_echo "$with_python" >&6; }
7355
7356
7357 #
7358 # GSSAPI
7359 #
7360 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with GSSAPI support" >&5
7361 $as_echo_n "checking whether to build with GSSAPI support... " >&6; }
7362
7363
7364
7365 # Check whether --with-gssapi was given.
7366 if test "${with_gssapi+set}" = set; then :
7367   withval=$with_gssapi;
7368   case $withval in
7369     yes)
7370
7371
7372 $as_echo "#define ENABLE_GSS 1" >>confdefs.h
7373
7374   krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab"
7375
7376       ;;
7377     no)
7378       :
7379       ;;
7380     *)
7381       as_fn_error $? "no argument expected for --with-gssapi option" "$LINENO" 5
7382       ;;
7383   esac
7384
7385 else
7386   with_gssapi=no
7387
7388 fi
7389
7390
7391 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gssapi" >&5
7392 $as_echo "$with_gssapi" >&6; }
7393
7394
7395
7396
7397
7398
7399 #
7400 # Kerberos configuration parameters
7401 #
7402
7403
7404
7405 # Check whether --with-krb-srvnam was given.
7406 if test "${with_krb_srvnam+set}" = set; then :
7407   withval=$with_krb_srvnam;
7408   case $withval in
7409     yes)
7410       as_fn_error $? "argument required for --with-krb-srvnam option" "$LINENO" 5
7411       ;;
7412     no)
7413       as_fn_error $? "argument required for --with-krb-srvnam option" "$LINENO" 5
7414       ;;
7415     *)
7416
7417       ;;
7418   esac
7419
7420 else
7421   with_krb_srvnam="postgres"
7422 fi
7423
7424
7425
7426
7427 cat >>confdefs.h <<_ACEOF
7428 #define PG_KRB_SRVNAM "$with_krb_srvnam"
7429 _ACEOF
7430
7431
7432
7433 #
7434 # PAM
7435 #
7436 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with PAM support" >&5
7437 $as_echo_n "checking whether to build with PAM support... " >&6; }
7438
7439
7440
7441 # Check whether --with-pam was given.
7442 if test "${with_pam+set}" = set; then :
7443   withval=$with_pam;
7444   case $withval in
7445     yes)
7446
7447 $as_echo "#define USE_PAM 1" >>confdefs.h
7448
7449       ;;
7450     no)
7451       :
7452       ;;
7453     *)
7454       as_fn_error $? "no argument expected for --with-pam option" "$LINENO" 5
7455       ;;
7456   esac
7457
7458 else
7459   with_pam=no
7460
7461 fi
7462
7463
7464 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pam" >&5
7465 $as_echo "$with_pam" >&6; }
7466
7467
7468 #
7469 # BSD AUTH
7470 #
7471 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with BSD Authentication support" >&5
7472 $as_echo_n "checking whether to build with BSD Authentication support... " >&6; }
7473
7474
7475
7476 # Check whether --with-bsd-auth was given.
7477 if test "${with_bsd_auth+set}" = set; then :
7478   withval=$with_bsd_auth;
7479   case $withval in
7480     yes)
7481
7482 $as_echo "#define USE_BSD_AUTH 1" >>confdefs.h
7483
7484       ;;
7485     no)
7486       :
7487       ;;
7488     *)
7489       as_fn_error $? "no argument expected for --with-bsd-auth option" "$LINENO" 5
7490       ;;
7491   esac
7492
7493 else
7494   with_bsd_auth=no
7495
7496 fi
7497
7498
7499 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_bsd_auth" >&5
7500 $as_echo "$with_bsd_auth" >&6; }
7501
7502
7503 #
7504 # LDAP
7505 #
7506 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with LDAP support" >&5
7507 $as_echo_n "checking whether to build with LDAP support... " >&6; }
7508
7509
7510
7511 # Check whether --with-ldap was given.
7512 if test "${with_ldap+set}" = set; then :
7513   withval=$with_ldap;
7514   case $withval in
7515     yes)
7516
7517 $as_echo "#define USE_LDAP 1" >>confdefs.h
7518
7519       ;;
7520     no)
7521       :
7522       ;;
7523     *)
7524       as_fn_error $? "no argument expected for --with-ldap option" "$LINENO" 5
7525       ;;
7526   esac
7527
7528 else
7529   with_ldap=no
7530
7531 fi
7532
7533
7534 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ldap" >&5
7535 $as_echo "$with_ldap" >&6; }
7536
7537
7538
7539 #
7540 # Bonjour
7541 #
7542 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Bonjour support" >&5
7543 $as_echo_n "checking whether to build with Bonjour support... " >&6; }
7544
7545
7546
7547 # Check whether --with-bonjour was given.
7548 if test "${with_bonjour+set}" = set; then :
7549   withval=$with_bonjour;
7550   case $withval in
7551     yes)
7552
7553 $as_echo "#define USE_BONJOUR 1" >>confdefs.h
7554
7555       ;;
7556     no)
7557       :
7558       ;;
7559     *)
7560       as_fn_error $? "no argument expected for --with-bonjour option" "$LINENO" 5
7561       ;;
7562   esac
7563
7564 else
7565   with_bonjour=no
7566
7567 fi
7568
7569
7570 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_bonjour" >&5
7571 $as_echo "$with_bonjour" >&6; }
7572
7573
7574 #
7575 # OpenSSL
7576 #
7577 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with OpenSSL support" >&5
7578 $as_echo_n "checking whether to build with OpenSSL support... " >&6; }
7579
7580
7581
7582 # Check whether --with-openssl was given.
7583 if test "${with_openssl+set}" = set; then :
7584   withval=$with_openssl;
7585   case $withval in
7586     yes)
7587
7588 $as_echo "#define USE_OPENSSL 1" >>confdefs.h
7589
7590       ;;
7591     no)
7592       :
7593       ;;
7594     *)
7595       as_fn_error $? "no argument expected for --with-openssl option" "$LINENO" 5
7596       ;;
7597   esac
7598
7599 else
7600   with_openssl=no
7601
7602 fi
7603
7604
7605 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_openssl" >&5
7606 $as_echo "$with_openssl" >&6; }
7607
7608
7609 #
7610 # SELinux
7611 #
7612 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with SELinux support" >&5
7613 $as_echo_n "checking whether to build with SELinux support... " >&6; }
7614
7615
7616
7617 # Check whether --with-selinux was given.
7618 if test "${with_selinux+set}" = set; then :
7619   withval=$with_selinux;
7620   case $withval in
7621     yes)
7622       :
7623       ;;
7624     no)
7625       :
7626       ;;
7627     *)
7628       as_fn_error $? "no argument expected for --with-selinux option" "$LINENO" 5
7629       ;;
7630   esac
7631
7632 else
7633   with_selinux=no
7634
7635 fi
7636
7637
7638
7639 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_selinux" >&5
7640 $as_echo "$with_selinux" >&6; }
7641
7642 #
7643 # Systemd
7644 #
7645 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with systemd support" >&5
7646 $as_echo_n "checking whether to build with systemd support... " >&6; }
7647
7648
7649
7650 # Check whether --with-systemd was given.
7651 if test "${with_systemd+set}" = set; then :
7652   withval=$with_systemd;
7653   case $withval in
7654     yes)
7655
7656 $as_echo "#define USE_SYSTEMD 1" >>confdefs.h
7657
7658       ;;
7659     no)
7660       :
7661       ;;
7662     *)
7663       as_fn_error $? "no argument expected for --with-systemd option" "$LINENO" 5
7664       ;;
7665   esac
7666
7667 else
7668   with_systemd=no
7669
7670 fi
7671
7672
7673
7674 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_systemd" >&5
7675 $as_echo "$with_systemd" >&6; }
7676
7677 #
7678 # Readline
7679 #
7680
7681
7682
7683 # Check whether --with-readline was given.
7684 if test "${with_readline+set}" = set; then :
7685   withval=$with_readline;
7686   case $withval in
7687     yes)
7688       :
7689       ;;
7690     no)
7691       :
7692       ;;
7693     *)
7694       as_fn_error $? "no argument expected for --with-readline option" "$LINENO" 5
7695       ;;
7696   esac
7697
7698 else
7699   with_readline=yes
7700
7701 fi
7702
7703
7704 # readline on MinGW has problems with backslashes in psql and other bugs.
7705 # This is particularly a problem with non-US code pages.
7706 # Therefore disable its use until we understand the cause. 2004-07-20
7707 if test "$PORTNAME" = "win32"; then
7708   if test "$with_readline" = yes; then
7709     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Readline does not work on MinGW --- disabling" >&5
7710 $as_echo "$as_me: WARNING: *** Readline does not work on MinGW --- disabling" >&2;}
7711     with_readline=no
7712   fi
7713 fi
7714
7715
7716 #
7717 # Prefer libedit
7718 #
7719
7720
7721
7722 # Check whether --with-libedit-preferred was given.
7723 if test "${with_libedit_preferred+set}" = set; then :
7724   withval=$with_libedit_preferred;
7725   case $withval in
7726     yes)
7727       :
7728       ;;
7729     no)
7730       :
7731       ;;
7732     *)
7733       as_fn_error $? "no argument expected for --with-libedit-preferred option" "$LINENO" 5
7734       ;;
7735   esac
7736
7737 else
7738   with_libedit_preferred=no
7739
7740 fi
7741
7742
7743
7744
7745 #
7746 # UUID library
7747 #
7748 # There are at least three UUID libraries in common use: the FreeBSD/NetBSD
7749 # library, the e2fsprogs libuuid (now part of util-linux-ng), and the OSSP
7750 # UUID library.  More than one of these might be present on a given platform,
7751 # so we make the user say which one she wants.
7752 #
7753
7754
7755
7756 # Check whether --with-uuid was given.
7757 if test "${with_uuid+set}" = set; then :
7758   withval=$with_uuid;
7759   case $withval in
7760     yes)
7761       as_fn_error $? "argument required for --with-uuid option" "$LINENO" 5
7762       ;;
7763     no)
7764       as_fn_error $? "argument required for --with-uuid option" "$LINENO" 5
7765       ;;
7766     *)
7767
7768       ;;
7769   esac
7770
7771 fi
7772
7773
7774 if test x"$with_uuid" = x"" ; then
7775   with_uuid=no
7776 fi
7777
7778
7779
7780 # Check whether --with-ossp-uuid was given.
7781 if test "${with_ossp_uuid+set}" = set; then :
7782   withval=$with_ossp_uuid;
7783   case $withval in
7784     yes)
7785       :
7786       ;;
7787     no)
7788       :
7789       ;;
7790     *)
7791       as_fn_error $? "no argument expected for --with-ossp-uuid option" "$LINENO" 5
7792       ;;
7793   esac
7794
7795 else
7796   with_ossp_uuid=no
7797
7798 fi
7799
7800
7801 if test "$with_ossp_uuid" = yes ; then
7802   with_uuid=ossp
7803 fi
7804
7805 if test "$with_uuid" = bsd ; then
7806
7807 $as_echo "#define HAVE_UUID_BSD 1" >>confdefs.h
7808
7809   UUID_EXTRA_OBJS="md5.o sha1.o"
7810 elif test "$with_uuid" = e2fs ; then
7811
7812 $as_echo "#define HAVE_UUID_E2FS 1" >>confdefs.h
7813
7814   UUID_EXTRA_OBJS="md5.o sha1.o"
7815 elif test "$with_uuid" = ossp ; then
7816
7817 $as_echo "#define HAVE_UUID_OSSP 1" >>confdefs.h
7818
7819   UUID_EXTRA_OBJS=""
7820 elif test "$with_uuid" = no ; then
7821   UUID_EXTRA_OBJS=""
7822 else
7823   as_fn_error $? "--with-uuid must specify one of bsd, e2fs, or ossp" "$LINENO" 5
7824 fi
7825
7826
7827
7828
7829 #
7830 # XML
7831 #
7832
7833
7834
7835 # Check whether --with-libxml was given.
7836 if test "${with_libxml+set}" = set; then :
7837   withval=$with_libxml;
7838   case $withval in
7839     yes)
7840
7841 $as_echo "#define USE_LIBXML 1" >>confdefs.h
7842
7843       ;;
7844     no)
7845       :
7846       ;;
7847     *)
7848       as_fn_error $? "no argument expected for --with-libxml option" "$LINENO" 5
7849       ;;
7850   esac
7851
7852 else
7853   with_libxml=no
7854
7855 fi
7856
7857
7858
7859 if test "$with_libxml" = yes ; then
7860   if test -z "$XML2_CONFIG"; then
7861   for ac_prog in xml2-config
7862 do
7863   # Extract the first word of "$ac_prog", so it can be a program name with args.
7864 set dummy $ac_prog; ac_word=$2
7865 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7866 $as_echo_n "checking for $ac_word... " >&6; }
7867 if ${ac_cv_path_XML2_CONFIG+:} false; then :
7868   $as_echo_n "(cached) " >&6
7869 else
7870   case $XML2_CONFIG in
7871   [\\/]* | ?:[\\/]*)
7872   ac_cv_path_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test with a path.
7873   ;;
7874   *)
7875   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7876 for as_dir in $PATH
7877 do
7878   IFS=$as_save_IFS
7879   test -z "$as_dir" && as_dir=.
7880     for ac_exec_ext in '' $ac_executable_extensions; do
7881   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7882     ac_cv_path_XML2_CONFIG="$as_dir/$ac_word$ac_exec_ext"
7883     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7884     break 2
7885   fi
7886 done
7887   done
7888 IFS=$as_save_IFS
7889
7890   ;;
7891 esac
7892 fi
7893 XML2_CONFIG=$ac_cv_path_XML2_CONFIG
7894 if test -n "$XML2_CONFIG"; then
7895   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5
7896 $as_echo "$XML2_CONFIG" >&6; }
7897 else
7898   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7899 $as_echo "no" >&6; }
7900 fi
7901
7902
7903   test -n "$XML2_CONFIG" && break
7904 done
7905
7906 else
7907   # Report the value of XML2_CONFIG in configure's output in all cases.
7908   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML2_CONFIG" >&5
7909 $as_echo_n "checking for XML2_CONFIG... " >&6; }
7910   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5
7911 $as_echo "$XML2_CONFIG" >&6; }
7912 fi
7913
7914   if test -n "$XML2_CONFIG"; then
7915     for pgac_option in `$XML2_CONFIG --cflags`; do
7916       case $pgac_option in
7917         -I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";;
7918       esac
7919     done
7920     for pgac_option in `$XML2_CONFIG --libs`; do
7921       case $pgac_option in
7922         -L*) LDFLAGS="$LDFLAGS $pgac_option";;
7923       esac
7924     done
7925   fi
7926 fi
7927
7928
7929
7930 #
7931 # XSLT
7932 #
7933
7934
7935
7936 # Check whether --with-libxslt was given.
7937 if test "${with_libxslt+set}" = set; then :
7938   withval=$with_libxslt;
7939   case $withval in
7940     yes)
7941
7942 $as_echo "#define USE_LIBXSLT 1" >>confdefs.h
7943
7944       ;;
7945     no)
7946       :
7947       ;;
7948     *)
7949       as_fn_error $? "no argument expected for --with-libxslt option" "$LINENO" 5
7950       ;;
7951   esac
7952
7953 else
7954   with_libxslt=no
7955
7956 fi
7957
7958
7959
7960
7961
7962
7963 #
7964 # tzdata
7965 #
7966
7967
7968
7969 # Check whether --with-system-tzdata was given.
7970 if test "${with_system_tzdata+set}" = set; then :
7971   withval=$with_system_tzdata;
7972   case $withval in
7973     yes)
7974       as_fn_error $? "argument required for --with-system-tzdata option" "$LINENO" 5
7975       ;;
7976     no)
7977       as_fn_error $? "argument required for --with-system-tzdata option" "$LINENO" 5
7978       ;;
7979     *)
7980
7981       ;;
7982   esac
7983
7984 fi
7985
7986
7987
7988
7989 #
7990 # Zlib
7991 #
7992
7993
7994
7995 # Check whether --with-zlib was given.
7996 if test "${with_zlib+set}" = set; then :
7997   withval=$with_zlib;
7998   case $withval in
7999     yes)
8000       :
8001       ;;
8002     no)
8003       :
8004       ;;
8005     *)
8006       as_fn_error $? "no argument expected for --with-zlib option" "$LINENO" 5
8007       ;;
8008   esac
8009
8010 else
8011   with_zlib=yes
8012
8013 fi
8014
8015
8016
8017
8018 #
8019 # Elf
8020 #
8021
8022 # Assume system is ELF if it predefines __ELF__ as 1,
8023 # otherwise believe host_os based default.
8024 case $host_os in
8025     freebsd1*|freebsd2*) elf=no;;
8026     freebsd3*|freebsd4*) elf=yes;;
8027 esac
8028
8029
8030 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
8031 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
8032 if ${ac_cv_path_GREP+:} false; then :
8033   $as_echo_n "(cached) " >&6
8034 else
8035   if test -z "$GREP"; then
8036   ac_path_GREP_found=false
8037   # Loop through the user's path and test for each of PROGNAME-LIST
8038   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8039 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
8040 do
8041   IFS=$as_save_IFS
8042   test -z "$as_dir" && as_dir=.
8043     for ac_prog in grep ggrep; do
8044     for ac_exec_ext in '' $ac_executable_extensions; do
8045       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
8046       as_fn_executable_p "$ac_path_GREP" || continue
8047 # Check for GNU ac_path_GREP and select it if it is found.
8048   # Check for GNU $ac_path_GREP
8049 case `"$ac_path_GREP" --version 2>&1` in
8050 *GNU*)
8051   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
8052 *)
8053   ac_count=0
8054   $as_echo_n 0123456789 >"conftest.in"
8055   while :
8056   do
8057     cat "conftest.in" "conftest.in" >"conftest.tmp"
8058     mv "conftest.tmp" "conftest.in"
8059     cp "conftest.in" "conftest.nl"
8060     $as_echo 'GREP' >> "conftest.nl"
8061     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
8062     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
8063     as_fn_arith $ac_count + 1 && ac_count=$as_val
8064     if test $ac_count -gt ${ac_path_GREP_max-0}; then
8065       # Best one so far, save it but keep looking for a better one
8066       ac_cv_path_GREP="$ac_path_GREP"
8067       ac_path_GREP_max=$ac_count
8068     fi
8069     # 10*(2^10) chars as input seems more than enough
8070     test $ac_count -gt 10 && break
8071   done
8072   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
8073 esac
8074
8075       $ac_path_GREP_found && break 3
8076     done
8077   done
8078   done
8079 IFS=$as_save_IFS
8080   if test -z "$ac_cv_path_GREP"; then
8081     as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
8082   fi
8083 else
8084   ac_cv_path_GREP=$GREP
8085 fi
8086
8087 fi
8088 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
8089 $as_echo "$ac_cv_path_GREP" >&6; }
8090  GREP="$ac_cv_path_GREP"
8091
8092
8093 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
8094 $as_echo_n "checking for egrep... " >&6; }
8095 if ${ac_cv_path_EGREP+:} false; then :
8096   $as_echo_n "(cached) " >&6
8097 else
8098   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
8099    then ac_cv_path_EGREP="$GREP -E"
8100    else
8101      if test -z "$EGREP"; then
8102   ac_path_EGREP_found=false
8103   # Loop through the user's path and test for each of PROGNAME-LIST
8104   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8105 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
8106 do
8107   IFS=$as_save_IFS
8108   test -z "$as_dir" && as_dir=.
8109     for ac_prog in egrep; do
8110     for ac_exec_ext in '' $ac_executable_extensions; do
8111       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
8112       as_fn_executable_p "$ac_path_EGREP" || continue
8113 # Check for GNU ac_path_EGREP and select it if it is found.
8114   # Check for GNU $ac_path_EGREP
8115 case `"$ac_path_EGREP" --version 2>&1` in
8116 *GNU*)
8117   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
8118 *)
8119   ac_count=0
8120   $as_echo_n 0123456789 >"conftest.in"
8121   while :
8122   do
8123     cat "conftest.in" "conftest.in" >"conftest.tmp"
8124     mv "conftest.tmp" "conftest.in"
8125     cp "conftest.in" "conftest.nl"
8126     $as_echo 'EGREP' >> "conftest.nl"
8127     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
8128     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
8129     as_fn_arith $ac_count + 1 && ac_count=$as_val
8130     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
8131       # Best one so far, save it but keep looking for a better one
8132       ac_cv_path_EGREP="$ac_path_EGREP"
8133       ac_path_EGREP_max=$ac_count
8134     fi
8135     # 10*(2^10) chars as input seems more than enough
8136     test $ac_count -gt 10 && break
8137   done
8138   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
8139 esac
8140
8141       $ac_path_EGREP_found && break 3
8142     done
8143   done
8144   done
8145 IFS=$as_save_IFS
8146   if test -z "$ac_cv_path_EGREP"; then
8147     as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
8148   fi
8149 else
8150   ac_cv_path_EGREP=$EGREP
8151 fi
8152
8153    fi
8154 fi
8155 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
8156 $as_echo "$ac_cv_path_EGREP" >&6; }
8157  EGREP="$ac_cv_path_EGREP"
8158
8159
8160 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8161 /* end confdefs.h.  */
8162 #if __ELF__
8163   yes
8164 #endif
8165
8166 _ACEOF
8167 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8168   $EGREP "yes" >/dev/null 2>&1; then :
8169   ELF_SYS=true
8170 else
8171   if test "X$elf" = "Xyes" ; then
8172   ELF_SYS=true
8173 else
8174   ELF_SYS=
8175 fi
8176 fi
8177 rm -f conftest*
8178
8179
8180
8181 #
8182 # Assignments
8183 #
8184
8185 CPPFLAGS="$CPPFLAGS $INCLUDES"
8186 LDFLAGS="$LDFLAGS $LIBDIRS"
8187
8188
8189
8190
8191
8192 # Check whether --with-gnu-ld was given.
8193 if test "${with_gnu_ld+set}" = set; then :
8194   withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
8195 else
8196   with_gnu_ld=no
8197 fi
8198
8199 ac_prog=ld
8200 if test "$GCC" = yes; then
8201   # Check if gcc -print-prog-name=ld gives a path.
8202   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5
8203 $as_echo_n "checking for ld used by GCC... " >&6; }
8204   case $host in
8205   *-*-mingw*)
8206     # gcc leaves a trailing carriage return which upsets mingw
8207     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
8208   *)
8209     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
8210   esac
8211   case "$ac_prog" in
8212     # Accept absolute paths.
8213     [\\/]* | [A-Za-z]:[\\/]*)
8214       re_direlt='/[^/][^/]*/\.\./'
8215       # Canonicalize the path of ld
8216       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
8217       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
8218         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
8219       done
8220       test -z "$LD" && LD="$ac_prog"
8221       ;;
8222   "")
8223     # If it fails, then pretend we aren't using GCC.
8224     ac_prog=ld
8225     ;;
8226   *)
8227     # If it is relative, then search for the first ld in PATH.
8228     with_gnu_ld=unknown
8229     ;;
8230   esac
8231 elif test "$with_gnu_ld" = yes; then
8232   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
8233 $as_echo_n "checking for GNU ld... " >&6; }
8234 else
8235   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
8236 $as_echo_n "checking for non-GNU ld... " >&6; }
8237 fi
8238 if ${ac_cv_path_LD+:} false; then :
8239   $as_echo_n "(cached) " >&6
8240 else
8241   if test -z "$LD"; then
8242   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
8243   for ac_dir in $PATH; do
8244     test -z "$ac_dir" && ac_dir=.
8245     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
8246       ac_cv_path_LD="$ac_dir/$ac_prog"
8247       # Check to see if the program is GNU ld.  I'd rather use --version,
8248       # but apparently some GNU ld's only accept -v.
8249       # Break only if it was the GNU/non-GNU ld that we prefer.
8250       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
8251         test "$with_gnu_ld" != no && break
8252       else
8253         test "$with_gnu_ld" != yes && break
8254       fi
8255     fi
8256   done
8257   IFS="$ac_save_ifs"
8258 else
8259   ac_cv_path_LD="$LD" # Let the user override the test with a path.
8260 fi
8261 fi
8262
8263 LD="$ac_cv_path_LD"
8264 if test -n "$LD"; then
8265   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
8266 $as_echo "$LD" >&6; }
8267 else
8268   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8269 $as_echo "no" >&6; }
8270 fi
8271 test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
8272 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
8273 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
8274 if ${ac_cv_prog_gnu_ld+:} false; then :
8275   $as_echo_n "(cached) " >&6
8276 else
8277   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
8278 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
8279   ac_cv_prog_gnu_ld=yes
8280 else
8281   ac_cv_prog_gnu_ld=no
8282 fi
8283 fi
8284 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gnu_ld" >&5
8285 $as_echo "$ac_cv_prog_gnu_ld" >&6; }
8286 with_gnu_ld=$ac_cv_prog_gnu_ld
8287
8288
8289
8290
8291 if test -n "$ac_tool_prefix"; then
8292   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
8293 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
8294 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8295 $as_echo_n "checking for $ac_word... " >&6; }
8296 if ${ac_cv_prog_RANLIB+:} false; then :
8297   $as_echo_n "(cached) " >&6
8298 else
8299   if test -n "$RANLIB"; then
8300   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
8301 else
8302 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8303 for as_dir in $PATH
8304 do
8305   IFS=$as_save_IFS
8306   test -z "$as_dir" && as_dir=.
8307     for ac_exec_ext in '' $ac_executable_extensions; do
8308   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8309     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
8310     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8311     break 2
8312   fi
8313 done
8314   done
8315 IFS=$as_save_IFS
8316
8317 fi
8318 fi
8319 RANLIB=$ac_cv_prog_RANLIB
8320 if test -n "$RANLIB"; then
8321   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
8322 $as_echo "$RANLIB" >&6; }
8323 else
8324   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8325 $as_echo "no" >&6; }
8326 fi
8327
8328
8329 fi
8330 if test -z "$ac_cv_prog_RANLIB"; then
8331   ac_ct_RANLIB=$RANLIB
8332   # Extract the first word of "ranlib", so it can be a program name with args.
8333 set dummy ranlib; ac_word=$2
8334 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8335 $as_echo_n "checking for $ac_word... " >&6; }
8336 if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
8337   $as_echo_n "(cached) " >&6
8338 else
8339   if test -n "$ac_ct_RANLIB"; then
8340   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
8341 else
8342 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8343 for as_dir in $PATH
8344 do
8345   IFS=$as_save_IFS
8346   test -z "$as_dir" && as_dir=.
8347     for ac_exec_ext in '' $ac_executable_extensions; do
8348   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8349     ac_cv_prog_ac_ct_RANLIB="ranlib"
8350     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8351     break 2
8352   fi
8353 done
8354   done
8355 IFS=$as_save_IFS
8356
8357 fi
8358 fi
8359 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
8360 if test -n "$ac_ct_RANLIB"; then
8361   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
8362 $as_echo "$ac_ct_RANLIB" >&6; }
8363 else
8364   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8365 $as_echo "no" >&6; }
8366 fi
8367
8368   if test "x$ac_ct_RANLIB" = x; then
8369     RANLIB=":"
8370   else
8371     case $cross_compiling:$ac_tool_warned in
8372 yes:)
8373 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8374 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8375 ac_tool_warned=yes ;;
8376 esac
8377     RANLIB=$ac_ct_RANLIB
8378   fi
8379 else
8380   RANLIB="$ac_cv_prog_RANLIB"
8381 fi
8382
8383
8384   if test -n "$ac_tool_prefix"; then
8385   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
8386 set dummy ${ac_tool_prefix}strip; ac_word=$2
8387 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8388 $as_echo_n "checking for $ac_word... " >&6; }
8389 if ${ac_cv_prog_STRIP+:} false; then :
8390   $as_echo_n "(cached) " >&6
8391 else
8392   if test -n "$STRIP"; then
8393   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
8394 else
8395 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8396 for as_dir in $PATH
8397 do
8398   IFS=$as_save_IFS
8399   test -z "$as_dir" && as_dir=.
8400     for ac_exec_ext in '' $ac_executable_extensions; do
8401   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8402     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
8403     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8404     break 2
8405   fi
8406 done
8407   done
8408 IFS=$as_save_IFS
8409
8410 fi
8411 fi
8412 STRIP=$ac_cv_prog_STRIP
8413 if test -n "$STRIP"; then
8414   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
8415 $as_echo "$STRIP" >&6; }
8416 else
8417   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8418 $as_echo "no" >&6; }
8419 fi
8420
8421
8422 fi
8423 if test -z "$ac_cv_prog_STRIP"; then
8424   ac_ct_STRIP=$STRIP
8425   # Extract the first word of "strip", so it can be a program name with args.
8426 set dummy strip; ac_word=$2
8427 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8428 $as_echo_n "checking for $ac_word... " >&6; }
8429 if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
8430   $as_echo_n "(cached) " >&6
8431 else
8432   if test -n "$ac_ct_STRIP"; then
8433   ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
8434 else
8435 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8436 for as_dir in $PATH
8437 do
8438   IFS=$as_save_IFS
8439   test -z "$as_dir" && as_dir=.
8440     for ac_exec_ext in '' $ac_executable_extensions; do
8441   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8442     ac_cv_prog_ac_ct_STRIP="strip"
8443     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8444     break 2
8445   fi
8446 done
8447   done
8448 IFS=$as_save_IFS
8449
8450 fi
8451 fi
8452 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
8453 if test -n "$ac_ct_STRIP"; then
8454   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
8455 $as_echo "$ac_ct_STRIP" >&6; }
8456 else
8457   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8458 $as_echo "no" >&6; }
8459 fi
8460
8461   if test "x$ac_ct_STRIP" = x; then
8462     STRIP=":"
8463   else
8464     case $cross_compiling:$ac_tool_warned in
8465 yes:)
8466 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8467 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8468 ac_tool_warned=yes ;;
8469 esac
8470     STRIP=$ac_ct_STRIP
8471   fi
8472 else
8473   STRIP="$ac_cv_prog_STRIP"
8474 fi
8475
8476
8477   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is possible to strip libraries" >&5
8478 $as_echo_n "checking whether it is possible to strip libraries... " >&6; }
8479   if test x"$STRIP" != x"" && "$STRIP" -V 2>&1 | grep "GNU strip" >/dev/null; then
8480     STRIP_STATIC_LIB="$STRIP -x"
8481     STRIP_SHARED_LIB="$STRIP --strip-unneeded"
8482     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
8483 $as_echo "yes" >&6; }
8484   else
8485     case $host_os in
8486       darwin*)
8487         STRIP="$STRIP -x"
8488         STRIP_STATIC_LIB=$STRIP
8489         STRIP_SHARED_LIB=$STRIP
8490         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
8491 $as_echo "yes" >&6; }
8492         ;;
8493       *)
8494         STRIP_STATIC_LIB=:
8495         STRIP_SHARED_LIB=:
8496         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8497 $as_echo "no" >&6; }
8498         ;;
8499     esac
8500   fi
8501
8502
8503
8504 if test -n "$ac_tool_prefix"; then
8505   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
8506 set dummy ${ac_tool_prefix}ar; ac_word=$2
8507 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8508 $as_echo_n "checking for $ac_word... " >&6; }
8509 if ${ac_cv_prog_AR+:} false; then :
8510   $as_echo_n "(cached) " >&6
8511 else
8512   if test -n "$AR"; then
8513   ac_cv_prog_AR="$AR" # Let the user override the test.
8514 else
8515 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8516 for as_dir in $PATH
8517 do
8518   IFS=$as_save_IFS
8519   test -z "$as_dir" && as_dir=.
8520     for ac_exec_ext in '' $ac_executable_extensions; do
8521   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8522     ac_cv_prog_AR="${ac_tool_prefix}ar"
8523     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8524     break 2
8525   fi
8526 done
8527   done
8528 IFS=$as_save_IFS
8529
8530 fi
8531 fi
8532 AR=$ac_cv_prog_AR
8533 if test -n "$AR"; then
8534   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
8535 $as_echo "$AR" >&6; }
8536 else
8537   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8538 $as_echo "no" >&6; }
8539 fi
8540
8541
8542 fi
8543 if test -z "$ac_cv_prog_AR"; then
8544   ac_ct_AR=$AR
8545   # Extract the first word of "ar", so it can be a program name with args.
8546 set dummy ar; ac_word=$2
8547 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8548 $as_echo_n "checking for $ac_word... " >&6; }
8549 if ${ac_cv_prog_ac_ct_AR+:} false; then :
8550   $as_echo_n "(cached) " >&6
8551 else
8552   if test -n "$ac_ct_AR"; then
8553   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
8554 else
8555 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8556 for as_dir in $PATH
8557 do
8558   IFS=$as_save_IFS
8559   test -z "$as_dir" && as_dir=.
8560     for ac_exec_ext in '' $ac_executable_extensions; do
8561   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8562     ac_cv_prog_ac_ct_AR="ar"
8563     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8564     break 2
8565   fi
8566 done
8567   done
8568 IFS=$as_save_IFS
8569
8570 fi
8571 fi
8572 ac_ct_AR=$ac_cv_prog_ac_ct_AR
8573 if test -n "$ac_ct_AR"; then
8574   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
8575 $as_echo "$ac_ct_AR" >&6; }
8576 else
8577   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8578 $as_echo "no" >&6; }
8579 fi
8580
8581   if test "x$ac_ct_AR" = x; then
8582     AR="ar"
8583   else
8584     case $cross_compiling:$ac_tool_warned in
8585 yes:)
8586 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8587 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8588 ac_tool_warned=yes ;;
8589 esac
8590     AR=$ac_ct_AR
8591   fi
8592 else
8593   AR="$ac_cv_prog_AR"
8594 fi
8595
8596 if test "$PORTNAME" = "win32"; then
8597   if test -n "$ac_tool_prefix"; then
8598   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
8599 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
8600 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8601 $as_echo_n "checking for $ac_word... " >&6; }
8602 if ${ac_cv_prog_DLLTOOL+:} false; then :
8603   $as_echo_n "(cached) " >&6
8604 else
8605   if test -n "$DLLTOOL"; then
8606   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
8607 else
8608 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8609 for as_dir in $PATH
8610 do
8611   IFS=$as_save_IFS
8612   test -z "$as_dir" && as_dir=.
8613     for ac_exec_ext in '' $ac_executable_extensions; do
8614   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8615     ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
8616     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8617     break 2
8618   fi
8619 done
8620   done
8621 IFS=$as_save_IFS
8622
8623 fi
8624 fi
8625 DLLTOOL=$ac_cv_prog_DLLTOOL
8626 if test -n "$DLLTOOL"; then
8627   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
8628 $as_echo "$DLLTOOL" >&6; }
8629 else
8630   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8631 $as_echo "no" >&6; }
8632 fi
8633
8634
8635 fi
8636 if test -z "$ac_cv_prog_DLLTOOL"; then
8637   ac_ct_DLLTOOL=$DLLTOOL
8638   # Extract the first word of "dlltool", so it can be a program name with args.
8639 set dummy dlltool; ac_word=$2
8640 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8641 $as_echo_n "checking for $ac_word... " >&6; }
8642 if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
8643   $as_echo_n "(cached) " >&6
8644 else
8645   if test -n "$ac_ct_DLLTOOL"; then
8646   ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
8647 else
8648 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8649 for as_dir in $PATH
8650 do
8651   IFS=$as_save_IFS
8652   test -z "$as_dir" && as_dir=.
8653     for ac_exec_ext in '' $ac_executable_extensions; do
8654   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8655     ac_cv_prog_ac_ct_DLLTOOL="dlltool"
8656     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8657     break 2
8658   fi
8659 done
8660   done
8661 IFS=$as_save_IFS
8662
8663 fi
8664 fi
8665 ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
8666 if test -n "$ac_ct_DLLTOOL"; then
8667   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
8668 $as_echo "$ac_ct_DLLTOOL" >&6; }
8669 else
8670   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8671 $as_echo "no" >&6; }
8672 fi
8673
8674   if test "x$ac_ct_DLLTOOL" = x; then
8675     DLLTOOL="dlltool"
8676   else
8677     case $cross_compiling:$ac_tool_warned in
8678 yes:)
8679 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8680 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8681 ac_tool_warned=yes ;;
8682 esac
8683     DLLTOOL=$ac_ct_DLLTOOL
8684   fi
8685 else
8686   DLLTOOL="$ac_cv_prog_DLLTOOL"
8687 fi
8688
8689   if test -n "$ac_tool_prefix"; then
8690   # Extract the first word of "${ac_tool_prefix}dllwrap", so it can be a program name with args.
8691 set dummy ${ac_tool_prefix}dllwrap; ac_word=$2
8692 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8693 $as_echo_n "checking for $ac_word... " >&6; }
8694 if ${ac_cv_prog_DLLWRAP+:} false; then :
8695   $as_echo_n "(cached) " >&6
8696 else
8697   if test -n "$DLLWRAP"; then
8698   ac_cv_prog_DLLWRAP="$DLLWRAP" # Let the user override the test.
8699 else
8700 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8701 for as_dir in $PATH
8702 do
8703   IFS=$as_save_IFS
8704   test -z "$as_dir" && as_dir=.
8705     for ac_exec_ext in '' $ac_executable_extensions; do
8706   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8707     ac_cv_prog_DLLWRAP="${ac_tool_prefix}dllwrap"
8708     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8709     break 2
8710   fi
8711 done
8712   done
8713 IFS=$as_save_IFS
8714
8715 fi
8716 fi
8717 DLLWRAP=$ac_cv_prog_DLLWRAP
8718 if test -n "$DLLWRAP"; then
8719   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLWRAP" >&5
8720 $as_echo "$DLLWRAP" >&6; }
8721 else
8722   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8723 $as_echo "no" >&6; }
8724 fi
8725
8726
8727 fi
8728 if test -z "$ac_cv_prog_DLLWRAP"; then
8729   ac_ct_DLLWRAP=$DLLWRAP
8730   # Extract the first word of "dllwrap", so it can be a program name with args.
8731 set dummy dllwrap; ac_word=$2
8732 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8733 $as_echo_n "checking for $ac_word... " >&6; }
8734 if ${ac_cv_prog_ac_ct_DLLWRAP+:} false; then :
8735   $as_echo_n "(cached) " >&6
8736 else
8737   if test -n "$ac_ct_DLLWRAP"; then
8738   ac_cv_prog_ac_ct_DLLWRAP="$ac_ct_DLLWRAP" # Let the user override the test.
8739 else
8740 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8741 for as_dir in $PATH
8742 do
8743   IFS=$as_save_IFS
8744   test -z "$as_dir" && as_dir=.
8745     for ac_exec_ext in '' $ac_executable_extensions; do
8746   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8747     ac_cv_prog_ac_ct_DLLWRAP="dllwrap"
8748     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8749     break 2
8750   fi
8751 done
8752   done
8753 IFS=$as_save_IFS
8754
8755 fi
8756 fi
8757 ac_ct_DLLWRAP=$ac_cv_prog_ac_ct_DLLWRAP
8758 if test -n "$ac_ct_DLLWRAP"; then
8759   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLWRAP" >&5
8760 $as_echo "$ac_ct_DLLWRAP" >&6; }
8761 else
8762   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8763 $as_echo "no" >&6; }
8764 fi
8765
8766   if test "x$ac_ct_DLLWRAP" = x; then
8767     DLLWRAP="dllwrap"
8768   else
8769     case $cross_compiling:$ac_tool_warned in
8770 yes:)
8771 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8772 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8773 ac_tool_warned=yes ;;
8774 esac
8775     DLLWRAP=$ac_ct_DLLWRAP
8776   fi
8777 else
8778   DLLWRAP="$ac_cv_prog_DLLWRAP"
8779 fi
8780
8781   if test -n "$ac_tool_prefix"; then
8782   # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
8783 set dummy ${ac_tool_prefix}windres; ac_word=$2
8784 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8785 $as_echo_n "checking for $ac_word... " >&6; }
8786 if ${ac_cv_prog_WINDRES+:} false; then :
8787   $as_echo_n "(cached) " >&6
8788 else
8789   if test -n "$WINDRES"; then
8790   ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
8791 else
8792 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8793 for as_dir in $PATH
8794 do
8795   IFS=$as_save_IFS
8796   test -z "$as_dir" && as_dir=.
8797     for ac_exec_ext in '' $ac_executable_extensions; do
8798   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8799     ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
8800     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8801     break 2
8802   fi
8803 done
8804   done
8805 IFS=$as_save_IFS
8806
8807 fi
8808 fi
8809 WINDRES=$ac_cv_prog_WINDRES
8810 if test -n "$WINDRES"; then
8811   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5
8812 $as_echo "$WINDRES" >&6; }
8813 else
8814   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8815 $as_echo "no" >&6; }
8816 fi
8817
8818
8819 fi
8820 if test -z "$ac_cv_prog_WINDRES"; then
8821   ac_ct_WINDRES=$WINDRES
8822   # Extract the first word of "windres", so it can be a program name with args.
8823 set dummy windres; ac_word=$2
8824 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8825 $as_echo_n "checking for $ac_word... " >&6; }
8826 if ${ac_cv_prog_ac_ct_WINDRES+:} false; then :
8827   $as_echo_n "(cached) " >&6
8828 else
8829   if test -n "$ac_ct_WINDRES"; then
8830   ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
8831 else
8832 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8833 for as_dir in $PATH
8834 do
8835   IFS=$as_save_IFS
8836   test -z "$as_dir" && as_dir=.
8837     for ac_exec_ext in '' $ac_executable_extensions; do
8838   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8839     ac_cv_prog_ac_ct_WINDRES="windres"
8840     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8841     break 2
8842   fi
8843 done
8844   done
8845 IFS=$as_save_IFS
8846
8847 fi
8848 fi
8849 ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
8850 if test -n "$ac_ct_WINDRES"; then
8851   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5
8852 $as_echo "$ac_ct_WINDRES" >&6; }
8853 else
8854   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8855 $as_echo "no" >&6; }
8856 fi
8857
8858   if test "x$ac_ct_WINDRES" = x; then
8859     WINDRES="windres"
8860   else
8861     case $cross_compiling:$ac_tool_warned in
8862 yes:)
8863 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8864 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8865 ac_tool_warned=yes ;;
8866 esac
8867     WINDRES=$ac_ct_WINDRES
8868   fi
8869 else
8870   WINDRES="$ac_cv_prog_WINDRES"
8871 fi
8872
8873 fi
8874
8875 # Find a good install program.  We prefer a C program (faster),
8876 # so one script is as good as another.  But avoid the broken or
8877 # incompatible versions:
8878 # SysV /etc/install, /usr/sbin/install
8879 # SunOS /usr/etc/install
8880 # IRIX /sbin/install
8881 # AIX /bin/install
8882 # AmigaOS /C/install, which installs bootblocks on floppy discs
8883 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
8884 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
8885 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
8886 # OS/2's system install, which has a completely different semantic
8887 # ./install, which can be erroneously created by make from ./install.sh.
8888 # Reject install programs that cannot install multiple files.
8889 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
8890 $as_echo_n "checking for a BSD-compatible install... " >&6; }
8891 if test -z "$INSTALL"; then
8892 if ${ac_cv_path_install+:} false; then :
8893   $as_echo_n "(cached) " >&6
8894 else
8895   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8896 for as_dir in $PATH
8897 do
8898   IFS=$as_save_IFS
8899   test -z "$as_dir" && as_dir=.
8900     # Account for people who put trailing slashes in PATH elements.
8901 case $as_dir/ in #((
8902   ./ | .// | /[cC]/* | \
8903   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
8904   ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
8905   /usr/ucb/* ) ;;
8906   *)
8907     # OSF1 and SCO ODT 3.0 have their own names for install.
8908     # Don't use installbsd from OSF since it installs stuff as root
8909     # by default.
8910     for ac_prog in ginstall scoinst install; do
8911       for ac_exec_ext in '' $ac_executable_extensions; do
8912         if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
8913           if test $ac_prog = install &&
8914             grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
8915             # AIX install.  It has an incompatible calling convention.
8916             :
8917           elif test $ac_prog = install &&
8918             grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
8919             # program-specific install script used by HP pwplus--don't use.
8920             :
8921           else
8922             rm -rf conftest.one conftest.two conftest.dir
8923             echo one > conftest.one
8924             echo two > conftest.two
8925             mkdir conftest.dir
8926             if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
8927               test -s conftest.one && test -s conftest.two &&
8928               test -s conftest.dir/conftest.one &&
8929               test -s conftest.dir/conftest.two
8930             then
8931               ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
8932               break 3
8933             fi
8934           fi
8935         fi
8936       done
8937     done
8938     ;;
8939 esac
8940
8941   done
8942 IFS=$as_save_IFS
8943
8944 rm -rf conftest.one conftest.two conftest.dir
8945
8946 fi
8947   if test "${ac_cv_path_install+set}" = set; then
8948     INSTALL=$ac_cv_path_install
8949   else
8950     # As a last resort, use the slow shell script.  Don't cache a
8951     # value for INSTALL within a source directory, because that will
8952     # break other packages using the cache if that directory is
8953     # removed, or if the value is a relative name.
8954     INSTALL=$ac_install_sh
8955   fi
8956 fi
8957 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
8958 $as_echo "$INSTALL" >&6; }
8959
8960 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
8961 # It thinks the first close brace ends the variable substitution.
8962 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
8963
8964 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
8965
8966 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
8967
8968 # When Autoconf chooses install-sh as install program it tries to generate
8969 # a relative path to it in each makefile where it substitutes it. This clashes
8970 # with our Makefile.global concept. This workaround helps.
8971 case $INSTALL in
8972   *install-sh*) install_bin='';;
8973   *) install_bin=$INSTALL;;
8974 esac
8975
8976
8977 if test -z "$TAR"; then
8978   for ac_prog in tar
8979 do
8980   # Extract the first word of "$ac_prog", so it can be a program name with args.
8981 set dummy $ac_prog; ac_word=$2
8982 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8983 $as_echo_n "checking for $ac_word... " >&6; }
8984 if ${ac_cv_path_TAR+:} false; then :
8985   $as_echo_n "(cached) " >&6
8986 else
8987   case $TAR in
8988   [\\/]* | ?:[\\/]*)
8989   ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
8990   ;;
8991   *)
8992   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8993 for as_dir in $PATH
8994 do
8995   IFS=$as_save_IFS
8996   test -z "$as_dir" && as_dir=.
8997     for ac_exec_ext in '' $ac_executable_extensions; do
8998   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8999     ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext"
9000     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9001     break 2
9002   fi
9003 done
9004   done
9005 IFS=$as_save_IFS
9006
9007   ;;
9008 esac
9009 fi
9010 TAR=$ac_cv_path_TAR
9011 if test -n "$TAR"; then
9012   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5
9013 $as_echo "$TAR" >&6; }
9014 else
9015   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9016 $as_echo "no" >&6; }
9017 fi
9018
9019
9020   test -n "$TAR" && break
9021 done
9022
9023 else
9024   # Report the value of TAR in configure's output in all cases.
9025   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TAR" >&5
9026 $as_echo_n "checking for TAR... " >&6; }
9027   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5
9028 $as_echo "$TAR" >&6; }
9029 fi
9030
9031 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
9032 $as_echo_n "checking whether ln -s works... " >&6; }
9033 LN_S=$as_ln_s
9034 if test "$LN_S" = "ln -s"; then
9035   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
9036 $as_echo "yes" >&6; }
9037 else
9038   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
9039 $as_echo "no, using $LN_S" >&6; }
9040 fi
9041
9042 for ac_prog in gawk mawk nawk awk
9043 do
9044   # Extract the first word of "$ac_prog", so it can be a program name with args.
9045 set dummy $ac_prog; ac_word=$2
9046 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9047 $as_echo_n "checking for $ac_word... " >&6; }
9048 if ${ac_cv_prog_AWK+:} false; then :
9049   $as_echo_n "(cached) " >&6
9050 else
9051   if test -n "$AWK"; then
9052   ac_cv_prog_AWK="$AWK" # Let the user override the test.
9053 else
9054 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9055 for as_dir in $PATH
9056 do
9057   IFS=$as_save_IFS
9058   test -z "$as_dir" && as_dir=.
9059     for ac_exec_ext in '' $ac_executable_extensions; do
9060   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9061     ac_cv_prog_AWK="$ac_prog"
9062     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9063     break 2
9064   fi
9065 done
9066   done
9067 IFS=$as_save_IFS
9068
9069 fi
9070 fi
9071 AWK=$ac_cv_prog_AWK
9072 if test -n "$AWK"; then
9073   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
9074 $as_echo "$AWK" >&6; }
9075 else
9076   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9077 $as_echo "no" >&6; }
9078 fi
9079
9080
9081   test -n "$AWK" && break
9082 done
9083
9084 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
9085 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
9086 if test -z "$MKDIR_P"; then
9087   if ${ac_cv_path_mkdir+:} false; then :
9088   $as_echo_n "(cached) " >&6
9089 else
9090   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9091 for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
9092 do
9093   IFS=$as_save_IFS
9094   test -z "$as_dir" && as_dir=.
9095     for ac_prog in mkdir gmkdir; do
9096          for ac_exec_ext in '' $ac_executable_extensions; do
9097            as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
9098            case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
9099              'mkdir (GNU coreutils) '* | \
9100              'mkdir (coreutils) '* | \
9101              'mkdir (fileutils) '4.1*)
9102                ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
9103                break 3;;
9104            esac
9105          done
9106        done
9107   done
9108 IFS=$as_save_IFS
9109
9110 fi
9111
9112   test -d ./--version && rmdir ./--version
9113   if test "${ac_cv_path_mkdir+set}" = set; then
9114     MKDIR_P="$ac_cv_path_mkdir -p"
9115   else
9116     # As a last resort, use the slow shell script.  Don't cache a
9117     # value for MKDIR_P within a source directory, because that will
9118     # break other packages using the cache if that directory is
9119     # removed, or if the value is a relative name.
9120     MKDIR_P="$ac_install_sh -d"
9121   fi
9122 fi
9123 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
9124 $as_echo "$MKDIR_P" >&6; }
9125
9126 # When Autoconf chooses install-sh as mkdir -p program it tries to generate
9127 # a relative path to it in each makefile where it substitutes it. This clashes
9128 # with our Makefile.global concept. This workaround helps.
9129 case $MKDIR_P in
9130   *install-sh*) MKDIR_P='\${SHELL} \${top_srcdir}/config/install-sh -c -d';;
9131 esac
9132
9133 if test -z "$BISON"; then
9134   for ac_prog in bison
9135 do
9136   # Extract the first word of "$ac_prog", so it can be a program name with args.
9137 set dummy $ac_prog; ac_word=$2
9138 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9139 $as_echo_n "checking for $ac_word... " >&6; }
9140 if ${ac_cv_path_BISON+:} false; then :
9141   $as_echo_n "(cached) " >&6
9142 else
9143   case $BISON in
9144   [\\/]* | ?:[\\/]*)
9145   ac_cv_path_BISON="$BISON" # Let the user override the test with a path.
9146   ;;
9147   *)
9148   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9149 for as_dir in $PATH
9150 do
9151   IFS=$as_save_IFS
9152   test -z "$as_dir" && as_dir=.
9153     for ac_exec_ext in '' $ac_executable_extensions; do
9154   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9155     ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext"
9156     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9157     break 2
9158   fi
9159 done
9160   done
9161 IFS=$as_save_IFS
9162
9163   ;;
9164 esac
9165 fi
9166 BISON=$ac_cv_path_BISON
9167 if test -n "$BISON"; then
9168   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5
9169 $as_echo "$BISON" >&6; }
9170 else
9171   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9172 $as_echo "no" >&6; }
9173 fi
9174
9175
9176   test -n "$BISON" && break
9177 done
9178
9179 else
9180   # Report the value of BISON in configure's output in all cases.
9181   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BISON" >&5
9182 $as_echo_n "checking for BISON... " >&6; }
9183   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5
9184 $as_echo "$BISON" >&6; }
9185 fi
9186
9187
9188 if test "$BISON"; then
9189   pgac_bison_version=`$BISON --version 2>/dev/null | sed q`
9190   { $as_echo "$as_me:${as_lineno-$LINENO}: using $pgac_bison_version" >&5
9191 $as_echo "$as_me: using $pgac_bison_version" >&6;}
9192   if echo "$pgac_bison_version" | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'
9193   then
9194     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9195 *** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
9196 *** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&5
9197 $as_echo "$as_me: WARNING:
9198 *** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
9199 *** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&2;}
9200     BISON=""
9201   fi
9202   # Bison >=3.0 issues warnings about %name-prefix="base_yy", instead
9203   # of the now preferred %name-prefix "base_yy", but the latter
9204   # doesn't work with Bison 2.3 or less.  So for now we silence the
9205   # deprecation warnings.
9206   if echo "$pgac_bison_version" | $AWK '{ if ($4 >= 3) exit 0; else exit 1;}'
9207   then
9208     BISONFLAGS="$BISONFLAGS -Wno-deprecated"
9209   fi
9210 fi
9211
9212 if test -z "$BISON"; then
9213   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9214 *** Without Bison you will not be able to build PostgreSQL from Git nor
9215 *** change any of the parser definition files.  You can obtain Bison from
9216 *** a GNU mirror site.  (If you are using the official distribution of
9217 *** PostgreSQL then you do not need to worry about this, because the Bison
9218 *** output is pre-generated.)" >&5
9219 $as_echo "$as_me: WARNING:
9220 *** Without Bison you will not be able to build PostgreSQL from Git nor
9221 *** change any of the parser definition files.  You can obtain Bison from
9222 *** a GNU mirror site.  (If you are using the official distribution of
9223 *** PostgreSQL then you do not need to worry about this, because the Bison
9224 *** output is pre-generated.)" >&2;}
9225 fi
9226 # We don't need AC_SUBST(BISON) because PGAC_PATH_PROGS did it
9227
9228
9229 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flex" >&5
9230 $as_echo_n "checking for flex... " >&6; }
9231 if ${pgac_cv_path_flex+:} false; then :
9232   $as_echo_n "(cached) " >&6
9233 else
9234   # Let the user override the test
9235 if test -n "$FLEX"; then
9236   pgac_cv_path_flex=$FLEX
9237 else
9238   pgac_save_IFS=$IFS
9239   IFS=$PATH_SEPARATOR
9240   for pgac_dir in $PATH; do
9241     IFS=$pgac_save_IFS
9242     if test -z "$pgac_dir" || test x"$pgac_dir" = x"."; then
9243       pgac_dir=`pwd`
9244     fi
9245     for pgac_prog in flex lex; do
9246       pgac_candidate="$pgac_dir/$pgac_prog"
9247       if test -f "$pgac_candidate" \
9248         && $pgac_candidate --version </dev/null >/dev/null 2>&1
9249       then
9250         echo '%%'  > conftest.l
9251         if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
9252           pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
9253           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;}'
9254           then
9255             pgac_cv_path_flex=$pgac_candidate
9256             break 2
9257           else
9258             { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9259 *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
9260 *** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&5
9261 $as_echo "$as_me: WARNING:
9262 *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
9263 *** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&2;}
9264           fi
9265         fi
9266       fi
9267     done
9268   done
9269   rm -f conftest.l lex.yy.c
9270   : ${pgac_cv_path_flex=no}
9271 fi
9272
9273 fi
9274 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_path_flex" >&5
9275 $as_echo "$pgac_cv_path_flex" >&6; }
9276 if test x"$pgac_cv_path_flex" = x"no"; then
9277   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9278 *** Without Flex you will not be able to build PostgreSQL from Git nor
9279 *** change any of the scanner definition files.  You can obtain Flex from
9280 *** a GNU mirror site.  (If you are using the official distribution of
9281 *** PostgreSQL then you do not need to worry about this because the Flex
9282 *** output is pre-generated.)" >&5
9283 $as_echo "$as_me: WARNING:
9284 *** Without Flex you will not be able to build PostgreSQL from Git nor
9285 *** change any of the scanner definition files.  You can obtain Flex from
9286 *** a GNU mirror site.  (If you are using the official distribution of
9287 *** PostgreSQL then you do not need to worry about this because the Flex
9288 *** output is pre-generated.)" >&2;}
9289
9290   FLEX=
9291 else
9292   FLEX=$pgac_cv_path_flex
9293   pgac_flex_version=`$FLEX --version 2>/dev/null`
9294   { $as_echo "$as_me:${as_lineno-$LINENO}: using $pgac_flex_version" >&5
9295 $as_echo "$as_me: using $pgac_flex_version" >&6;}
9296 fi
9297
9298
9299
9300
9301
9302 if test -z "$PERL"; then
9303   for ac_prog in perl
9304 do
9305   # Extract the first word of "$ac_prog", so it can be a program name with args.
9306 set dummy $ac_prog; ac_word=$2
9307 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9308 $as_echo_n "checking for $ac_word... " >&6; }
9309 if ${ac_cv_path_PERL+:} false; then :
9310   $as_echo_n "(cached) " >&6
9311 else
9312   case $PERL in
9313   [\\/]* | ?:[\\/]*)
9314   ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
9315   ;;
9316   *)
9317   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9318 for as_dir in $PATH
9319 do
9320   IFS=$as_save_IFS
9321   test -z "$as_dir" && as_dir=.
9322     for ac_exec_ext in '' $ac_executable_extensions; do
9323   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9324     ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
9325     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9326     break 2
9327   fi
9328 done
9329   done
9330 IFS=$as_save_IFS
9331
9332   ;;
9333 esac
9334 fi
9335 PERL=$ac_cv_path_PERL
9336 if test -n "$PERL"; then
9337   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
9338 $as_echo "$PERL" >&6; }
9339 else
9340   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9341 $as_echo "no" >&6; }
9342 fi
9343
9344
9345   test -n "$PERL" && break
9346 done
9347
9348 else
9349   # Report the value of PERL in configure's output in all cases.
9350   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PERL" >&5
9351 $as_echo_n "checking for PERL... " >&6; }
9352   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
9353 $as_echo "$PERL" >&6; }
9354 fi
9355
9356
9357 if test "$PERL"; then
9358   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'`
9359   { $as_echo "$as_me:${as_lineno-$LINENO}: using perl $pgac_perl_version" >&5
9360 $as_echo "$as_me: using perl $pgac_perl_version" >&6;}
9361   if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \
9362     $AWK '{ if ($1 == 5 && $2 >= 8) exit 1; else exit 0;}'
9363   then
9364     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9365 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
9366 *** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&5
9367 $as_echo "$as_me: WARNING:
9368 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
9369 *** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&2;}
9370     PERL=""
9371   fi
9372 fi
9373
9374 if test -z "$PERL"; then
9375   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9376 *** Without Perl you will not be able to build PostgreSQL from Git.
9377 *** You can obtain Perl from any CPAN mirror site.
9378 *** (If you are using the official distribution of PostgreSQL then you do not
9379 *** need to worry about this, because the Perl output is pre-generated.)" >&5
9380 $as_echo "$as_me: WARNING:
9381 *** Without Perl you will not be able to build PostgreSQL from Git.
9382 *** You can obtain Perl from any CPAN mirror site.
9383 *** (If you are using the official distribution of PostgreSQL then you do not
9384 *** need to worry about this, because the Perl output is pre-generated.)" >&2;}
9385 fi
9386
9387 if test "$with_perl" = yes; then
9388   if test -z "$PERL"; then
9389     as_fn_error $? "Perl not found" "$LINENO" 5
9390   fi
9391
9392 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl archlibexp" >&5
9393 $as_echo_n "checking for Perl archlibexp... " >&6; }
9394 perl_archlibexp=`$PERL -MConfig -e 'print $Config{archlibexp}'`
9395 test "$PORTNAME" = "win32" && perl_archlibexp=`echo $perl_archlibexp | sed 's,\\\\,/,g'`
9396 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_archlibexp" >&5
9397 $as_echo "$perl_archlibexp" >&6; }
9398 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl privlibexp" >&5
9399 $as_echo_n "checking for Perl privlibexp... " >&6; }
9400 perl_privlibexp=`$PERL -MConfig -e 'print $Config{privlibexp}'`
9401 test "$PORTNAME" = "win32" && perl_privlibexp=`echo $perl_privlibexp | sed 's,\\\\,/,g'`
9402 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_privlibexp" >&5
9403 $as_echo "$perl_privlibexp" >&6; }
9404 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl useshrplib" >&5
9405 $as_echo_n "checking for Perl useshrplib... " >&6; }
9406 perl_useshrplib=`$PERL -MConfig -e 'print $Config{useshrplib}'`
9407 test "$PORTNAME" = "win32" && perl_useshrplib=`echo $perl_useshrplib | sed 's,\\\\,/,g'`
9408 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_useshrplib" >&5
9409 $as_echo "$perl_useshrplib" >&6; }
9410   if test "$perl_useshrplib" != yes && test "$perl_useshrplib" != true; then
9411     as_fn_error $? "cannot build PL/Perl because libperl is not a shared library
9412 You might have to rebuild your Perl installation.  Refer to the
9413 documentation for details.  Use --without-perl to disable building
9414 PL/Perl." "$LINENO" 5
9415   fi
9416
9417 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLAGS recommended by Perl" >&5
9418 $as_echo_n "checking for CFLAGS recommended by Perl... " >&6; }
9419 perl_ccflags=`$PERL -MConfig -e 'print $Config{ccflags}'`
9420 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_ccflags" >&5
9421 $as_echo "$perl_ccflags" >&6; }
9422 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLAGS to compile embedded Perl" >&5
9423 $as_echo_n "checking for CFLAGS to compile embedded Perl... " >&6; }
9424 perl_embed_ccflags=`$PERL -MConfig -e 'foreach $f (split(" ",$Config{ccflags})) {print $f, " " if ($f =~ /^-D[^_]/ || $f =~ /^-D_USE_32BIT_TIME_T/)}'`
9425 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_embed_ccflags" >&5
9426 $as_echo "$perl_embed_ccflags" >&6; }
9427
9428
9429 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flags to link embedded Perl" >&5
9430 $as_echo_n "checking for flags to link embedded Perl... " >&6; }
9431 if test "$PORTNAME" = "win32" ; then
9432         perl_lib=`basename $perl_archlibexp/CORE/perl[5-9]*.lib .lib`
9433         if test -e "$perl_archlibexp/CORE/$perl_lib.lib"; then
9434                 perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
9435         else
9436                 perl_lib=`basename $perl_archlibexp/CORE/libperl[5-9]*.a .a | sed 's/^lib//'`
9437                 if test -e "$perl_archlibexp/CORE/lib$perl_lib.a"; then
9438                         perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
9439                 fi
9440         fi
9441 else
9442         pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
9443         pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
9444         perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e "s/ -arch [-a-zA-Z0-9_]*//g"`
9445 fi
9446 if test -z "$perl_embed_ldflags" ; then
9447         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9448 $as_echo "no" >&6; }
9449         as_fn_error $? "could not determine flags for linking embedded Perl.
9450 This probably means that ExtUtils::Embed or ExtUtils::MakeMaker is not
9451 installed." "$LINENO" 5
9452 else
9453         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_embed_ldflags" >&5
9454 $as_echo "$perl_embed_ldflags" >&6; }
9455 fi
9456
9457 fi
9458
9459 if test "$with_python" = yes; then
9460   if test -z "$PYTHON"; then
9461   for ac_prog in python
9462 do
9463   # Extract the first word of "$ac_prog", so it can be a program name with args.
9464 set dummy $ac_prog; ac_word=$2
9465 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9466 $as_echo_n "checking for $ac_word... " >&6; }
9467 if ${ac_cv_path_PYTHON+:} false; then :
9468   $as_echo_n "(cached) " >&6
9469 else
9470   case $PYTHON in
9471   [\\/]* | ?:[\\/]*)
9472   ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
9473   ;;
9474   *)
9475   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9476 for as_dir in $PATH
9477 do
9478   IFS=$as_save_IFS
9479   test -z "$as_dir" && as_dir=.
9480     for ac_exec_ext in '' $ac_executable_extensions; do
9481   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9482     ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
9483     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9484     break 2
9485   fi
9486 done
9487   done
9488 IFS=$as_save_IFS
9489
9490   ;;
9491 esac
9492 fi
9493 PYTHON=$ac_cv_path_PYTHON
9494 if test -n "$PYTHON"; then
9495   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
9496 $as_echo "$PYTHON" >&6; }
9497 else
9498   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9499 $as_echo "no" >&6; }
9500 fi
9501
9502
9503   test -n "$PYTHON" && break
9504 done
9505
9506 else
9507   # Report the value of PYTHON in configure's output in all cases.
9508   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PYTHON" >&5
9509 $as_echo_n "checking for PYTHON... " >&6; }
9510   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
9511 $as_echo "$PYTHON" >&6; }
9512 fi
9513
9514 if test x"$PYTHON" = x""; then
9515   as_fn_error $? "Python not found" "$LINENO" 5
9516 fi
9517
9518
9519 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python distutils module" >&5
9520 $as_echo_n "checking for Python distutils module... " >&6; }
9521 if "${PYTHON}" -c 'import distutils' 2>&5
9522 then
9523     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
9524 $as_echo "yes" >&6; }
9525 else
9526     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9527 $as_echo "no" >&6; }
9528     as_fn_error $? "distutils module not found" "$LINENO" 5
9529 fi
9530 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python configuration directory" >&5
9531 $as_echo_n "checking Python configuration directory... " >&6; }
9532 python_majorversion=`${PYTHON} -c "import sys; print(sys.version[0])"`
9533 python_minorversion=`${PYTHON} -c "import sys; print(sys.version[2])"`
9534 python_version=`${PYTHON} -c "import sys; print(sys.version[:3])"`
9535 python_configdir=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBPL'))))"`
9536 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $python_configdir" >&5
9537 $as_echo "$python_configdir" >&6; }
9538
9539 # Reject unsupported Python versions as soon as practical.
9540 if test "$python_majorversion" -lt 3 -a "$python_minorversion" -lt 4; then
9541   as_fn_error $? "Python version $python_version is too old (version 2.4 or later is required)" "$LINENO" 5
9542 fi
9543
9544 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python include directories" >&5
9545 $as_echo_n "checking Python include directories... " >&6; }
9546 python_includespec=`${PYTHON} -c "
9547 import distutils.sysconfig
9548 a = '-I' + distutils.sysconfig.get_python_inc(False)
9549 b = '-I' + distutils.sysconfig.get_python_inc(True)
9550 if a == b:
9551     print(a)
9552 else:
9553     print(a + ' ' + b)"`
9554 if test "$PORTNAME" = win32 ; then
9555     python_includespec=`echo $python_includespec | sed 's,[\],/,g'`
9556 fi
9557 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $python_includespec" >&5
9558 $as_echo "$python_includespec" >&6; }
9559
9560
9561
9562 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link an embedded Python application" >&5
9563 $as_echo_n "checking how to link an embedded Python application... " >&6; }
9564
9565 python_libdir=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBDIR'))))"`
9566 python_ldlibrary=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LDLIBRARY'))))"`
9567
9568 # If LDLIBRARY exists and has a shlib extension, use it verbatim.
9569 ldlibrary=`echo "${python_ldlibrary}" | sed -e 's/\.so$//' -e 's/\.dll$//' -e 's/\.dylib$//' -e 's/\.sl$//'`
9570 if test -e "${python_libdir}/${python_ldlibrary}" -a x"${python_ldlibrary}" != x"${ldlibrary}"
9571 then
9572         ldlibrary=`echo "${ldlibrary}" | sed "s/^lib//"`
9573         found_shlib=1
9574 else
9575         # Otherwise, guess the base name of the shlib.
9576         # LDVERSION was added in Python 3.2, before that use VERSION,
9577         # or failing that, $python_version from _PGAC_CHECK_PYTHON_DIRS.
9578         python_ldversion=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LDVERSION'))))"`
9579         if test x"${python_ldversion}" != x""; then
9580                 ldlibrary="python${python_ldversion}"
9581         else
9582                 python_version_var=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('VERSION'))))"`
9583                 if test x"${python_version_var}" != x""; then
9584                         ldlibrary="python${python_version_var}"
9585                 else
9586                         ldlibrary="python${python_version}"
9587                 fi
9588         fi
9589         # Search for a likely-looking file.
9590         found_shlib=0
9591         for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib
9592         do
9593                 # We don't know the platform DLSUFFIX here, so check 'em all.
9594                 for e in .so .dll .dylib .sl; do
9595                         if test -e "$d/lib${ldlibrary}$e"; then
9596                                 python_libdir="$d"
9597                                 found_shlib=1
9598                                 break 2
9599                         fi
9600                 done
9601         done
9602         # Some platforms (OpenBSD) require us to accept a bare versioned shlib
9603         # (".so.n.n") as well. However, check this only after failing to find
9604         # ".so" anywhere, because yet other platforms (Debian) put the .so
9605         # symlink in a different directory from the underlying versioned shlib.
9606         if test "$found_shlib" != 1; then
9607                 for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib
9608                 do
9609                         for f in "$d/lib${ldlibrary}.so."* ; do
9610                                 if test -e "$f"; then
9611                                         python_libdir="$d"
9612                                         found_shlib=1
9613                                         break 2
9614                                 fi
9615                         done
9616                 done
9617         fi
9618         # As usual, Windows has its own ideas.  Possible default library
9619         # locations include c:/Windows/System32 and (for Cygwin) /usr/bin,
9620         # and the "lib" prefix might not be there.
9621         if test "$found_shlib" != 1 -a \( "$PORTNAME" = win32 -o "$PORTNAME" = cygwin \); then
9622                 for d in "${python_libdir}" "${python_configdir}" c:/Windows/System32 /usr/bin
9623                 do
9624                         for f in "$d/lib${ldlibrary}.dll" "$d/${ldlibrary}.dll" ; do
9625                                 if test -e "$f"; then
9626                                         python_libdir="$d"
9627                                         found_shlib=1
9628                                         break 2
9629                                 fi
9630                         done
9631                 done
9632         fi
9633 fi
9634 if test "$found_shlib" != 1; then
9635         as_fn_error $? "could not find shared library for Python
9636 You might have to rebuild your Python installation.  Refer to the
9637 documentation for details.  Use --without-python to disable building
9638 PL/Python." "$LINENO" 5
9639 fi
9640 python_libspec="-L${python_libdir} -l${ldlibrary}"
9641
9642 python_additional_libs=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','BASEMODLIBS'))))"`
9643
9644 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${python_libspec} ${python_additional_libs}" >&5
9645 $as_echo "${python_libspec} ${python_additional_libs}" >&6; }
9646
9647
9648
9649 fi
9650
9651 if test "$cross_compiling" = yes && test -z "$with_system_tzdata"; then
9652   if test -z "$ZIC"; then
9653   for ac_prog in zic
9654 do
9655   # Extract the first word of "$ac_prog", so it can be a program name with args.
9656 set dummy $ac_prog; ac_word=$2
9657 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9658 $as_echo_n "checking for $ac_word... " >&6; }
9659 if ${ac_cv_path_ZIC+:} false; then :
9660   $as_echo_n "(cached) " >&6
9661 else
9662   case $ZIC in
9663   [\\/]* | ?:[\\/]*)
9664   ac_cv_path_ZIC="$ZIC" # Let the user override the test with a path.
9665   ;;
9666   *)
9667   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9668 for as_dir in $PATH
9669 do
9670   IFS=$as_save_IFS
9671   test -z "$as_dir" && as_dir=.
9672     for ac_exec_ext in '' $ac_executable_extensions; do
9673   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9674     ac_cv_path_ZIC="$as_dir/$ac_word$ac_exec_ext"
9675     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9676     break 2
9677   fi
9678 done
9679   done
9680 IFS=$as_save_IFS
9681
9682   ;;
9683 esac
9684 fi
9685 ZIC=$ac_cv_path_ZIC
9686 if test -n "$ZIC"; then
9687   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIC" >&5
9688 $as_echo "$ZIC" >&6; }
9689 else
9690   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9691 $as_echo "no" >&6; }
9692 fi
9693
9694
9695   test -n "$ZIC" && break
9696 done
9697
9698 else
9699   # Report the value of ZIC in configure's output in all cases.
9700   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZIC" >&5
9701 $as_echo_n "checking for ZIC... " >&6; }
9702   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIC" >&5
9703 $as_echo "$ZIC" >&6; }
9704 fi
9705
9706   if test -z "$ZIC"; then
9707     as_fn_error $? "
9708 When cross-compiling, either use the option --with-system-tzdata to use
9709 existing time-zone data, or set the environment variable ZIC to a zic
9710 program to use during the build." "$LINENO" 5
9711   fi
9712 fi
9713
9714 #
9715 # Pthreads
9716 #
9717 # For each platform, we need to know about any special compile and link
9718 # libraries, and whether the normal C function names are thread-safe.
9719 # See the comment at the top of src/port/thread.c for more information.
9720 # WIN32 doesn't need the pthread tests;  it always uses threads
9721 #
9722 # These tests are run before the library-tests, because linking with the
9723 # other libraries can pull in the pthread functions as a side-effect.  We
9724 # want to use the -pthread or similar flags directly, and not rely on
9725 # the side-effects of linking with some other library.
9726 #
9727 # note: We have to use AS_IF here rather than plain if. The AC_CHECK_HEADER
9728 # invocation below is the first one in the script, and autoconf generates
9729 # additional code for that, which must not be inside the if-block. AS_IF
9730 # knows how to do that.
9731 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
9732 $as_echo_n "checking for ANSI C header files... " >&6; }
9733 if ${ac_cv_header_stdc+:} false; then :
9734   $as_echo_n "(cached) " >&6
9735 else
9736   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9737 /* end confdefs.h.  */
9738 #include <stdlib.h>
9739 #include <stdarg.h>
9740 #include <string.h>
9741 #include <float.h>
9742
9743 int
9744 main ()
9745 {
9746
9747   ;
9748   return 0;
9749 }
9750 _ACEOF
9751 if ac_fn_c_try_compile "$LINENO"; then :
9752   ac_cv_header_stdc=yes
9753 else
9754   ac_cv_header_stdc=no
9755 fi
9756 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9757
9758 if test $ac_cv_header_stdc = yes; then
9759   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9760   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9761 /* end confdefs.h.  */
9762 #include <string.h>
9763
9764 _ACEOF
9765 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9766   $EGREP "memchr" >/dev/null 2>&1; then :
9767
9768 else
9769   ac_cv_header_stdc=no
9770 fi
9771 rm -f conftest*
9772
9773 fi
9774
9775 if test $ac_cv_header_stdc = yes; then
9776   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9777   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9778 /* end confdefs.h.  */
9779 #include <stdlib.h>
9780
9781 _ACEOF
9782 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9783   $EGREP "free" >/dev/null 2>&1; then :
9784
9785 else
9786   ac_cv_header_stdc=no
9787 fi
9788 rm -f conftest*
9789
9790 fi
9791
9792 if test $ac_cv_header_stdc = yes; then
9793   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9794   if test "$cross_compiling" = yes; then :
9795   :
9796 else
9797   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9798 /* end confdefs.h.  */
9799 #include <ctype.h>
9800 #include <stdlib.h>
9801 #if ((' ' & 0x0FF) == 0x020)
9802 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9803 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9804 #else
9805 # define ISLOWER(c) \
9806                    (('a' <= (c) && (c) <= 'i') \
9807                      || ('j' <= (c) && (c) <= 'r') \
9808                      || ('s' <= (c) && (c) <= 'z'))
9809 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
9810 #endif
9811
9812 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9813 int
9814 main ()
9815 {
9816   int i;
9817   for (i = 0; i < 256; i++)
9818     if (XOR (islower (i), ISLOWER (i))
9819         || toupper (i) != TOUPPER (i))
9820       return 2;
9821   return 0;
9822 }
9823 _ACEOF
9824 if ac_fn_c_try_run "$LINENO"; then :
9825
9826 else
9827   ac_cv_header_stdc=no
9828 fi
9829 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9830   conftest.$ac_objext conftest.beam conftest.$ac_ext
9831 fi
9832
9833 fi
9834 fi
9835 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
9836 $as_echo "$ac_cv_header_stdc" >&6; }
9837 if test $ac_cv_header_stdc = yes; then
9838
9839 $as_echo "#define STDC_HEADERS 1" >>confdefs.h
9840
9841 fi
9842
9843 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
9844 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
9845                   inttypes.h stdint.h unistd.h
9846 do :
9847   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
9848 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
9849 "
9850 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
9851   cat >>confdefs.h <<_ACEOF
9852 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
9853 _ACEOF
9854
9855 fi
9856
9857 done
9858
9859
9860 if test "$enable_thread_safety" = yes -a "$PORTNAME" != "win32"; then :
9861    # then
9862
9863
9864
9865 ac_ext=c
9866 ac_cpp='$CPP $CPPFLAGS'
9867 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
9868 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
9869 ac_compiler_gnu=$ac_cv_c_compiler_gnu
9870
9871 ax_pthread_ok=no
9872
9873 # We used to check for pthread.h first, but this fails if pthread.h
9874 # requires special compiler flags (e.g. on Tru64 or Sequent).
9875 # It gets checked for in the link test anyway.
9876
9877 # First of all, check if the user has set any of the PTHREAD_LIBS,
9878 # etcetera environment variables, and if threads linking works using
9879 # them:
9880 if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
9881         save_CFLAGS="$CFLAGS"
9882         CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
9883         save_LIBS="$LIBS"
9884         LIBS="$PTHREAD_LIBS $LIBS"
9885         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5
9886 $as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; }
9887         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9888 /* end confdefs.h.  */
9889
9890 /* Override any GCC internal prototype to avoid an error.
9891    Use char because int might match the return type of a GCC
9892    builtin and then its argument prototype would still apply.  */
9893 #ifdef __cplusplus
9894 extern "C"
9895 #endif
9896 char pthread_join ();
9897 int
9898 main ()
9899 {
9900 return pthread_join ();
9901   ;
9902   return 0;
9903 }
9904 _ACEOF
9905 if ac_fn_c_try_link "$LINENO"; then :
9906   ax_pthread_ok=yes
9907 fi
9908 rm -f core conftest.err conftest.$ac_objext \
9909     conftest$ac_exeext conftest.$ac_ext
9910         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
9911 $as_echo "$ax_pthread_ok" >&6; }
9912         if test x"$ax_pthread_ok" = xno; then
9913                 PTHREAD_LIBS=""
9914                 PTHREAD_CFLAGS=""
9915         fi
9916         LIBS="$save_LIBS"
9917         CFLAGS="$save_CFLAGS"
9918 fi
9919
9920 # We must check for the threads library under a number of different
9921 # names; the ordering is very important because some systems
9922 # (e.g. DEC) have both -lpthread and -lpthreads, where one of the
9923 # libraries is broken (non-POSIX).
9924
9925 # Create a list of thread flags to try.  Items starting with a "-" are
9926 # C compiler flags, and other items are library names, except for "none"
9927 # which indicates that we try without any flags at all, and "pthread-config"
9928 # which is a program returning the flags for the Pth emulation library.
9929
9930 ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mt -mthreads pthread --thread-safe pthread-config"
9931
9932 # The ordering *is* (sometimes) important.  Some notes on the
9933 # individual items follow:
9934
9935 # pthreads: AIX (must check this before -lpthread)
9936 # none: in case threads are in libc; should be tried before -Kthread and
9937 #       other compiler flags to prevent continual compiler warnings
9938 # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
9939 # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
9940 # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
9941 # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
9942 # -pthreads: Solaris/gcc
9943 # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
9944 #      doesn't hurt to check since this sometimes defines pthreads and
9945 #      -D_REENTRANT too), HP C (must be checked before -lpthread, which
9946 #      is present but should not be used directly)
9947 # -mthreads: Mingw32/gcc, Lynx/gcc
9948 # pthread: Linux, etcetera
9949 # --thread-safe: KAI C++
9950 # pthread-config: use pthread-config program (for GNU Pth library)
9951
9952 case $host_os in
9953
9954         hpux*)
9955
9956         # From the cc(1) man page: "[-mt] Sets various -D flags to enable
9957         # multi-threading and also sets -lpthread."
9958
9959         ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
9960         ;;
9961
9962         openedition*)
9963
9964         # IBM z/OS requires a feature-test macro to be defined in order to
9965         # enable POSIX threads at all, so give the user a hint if this is
9966         # not set. (We don't define these ourselves, as they can affect
9967         # other portions of the system API in unpredictable ways.)
9968
9969         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9970 /* end confdefs.h.  */
9971
9972 #            if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
9973              AX_PTHREAD_ZOS_MISSING
9974 #            endif
9975
9976 _ACEOF
9977 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9978   $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then :
9979   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5
9980 $as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;}
9981 fi
9982 rm -f conftest*
9983
9984         ;;
9985
9986         solaris*)
9987
9988         # Newer versions of Solaris require the "-mt -lpthread" pair, and we
9989         # check that first.  On some older versions, libc contains stubbed
9990         # (non-functional) versions of the pthreads routines, so link-based
9991         # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
9992         # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
9993         # a function called by this macro, so we could check for that, but
9994         # who knows whether they'll stub that too in a future libc.)  So
9995         # we'll look for -pthreads and -lpthread shortly thereafter.
9996
9997         ax_pthread_flags="-mt,pthread -pthreads -pthread pthread $ax_pthread_flags"
9998         ;;
9999 esac
10000
10001 # Older versions of Clang only give a warning instead of an error for an
10002 # unrecognized option, unless we specify -Werror. (We throw in some extra
10003 # Clang warning flags for good measure.)
10004
10005 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler needs certain flags to reject unknown flags" >&5
10006 $as_echo_n "checking if compiler needs certain flags to reject unknown flags... " >&6; }
10007 if ${ax_cv_PTHREAD_REJECT_UNKNOWN+:} false; then :
10008   $as_echo_n "(cached) " >&6
10009 else
10010   ax_cv_PTHREAD_REJECT_UNKNOWN=unknown
10011      save_CFLAGS="$CFLAGS"
10012      ax_pthread_extra_flags="-Wunknown-warning-option -Wunused-command-line-argument"
10013      CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wfoobaz -foobaz"
10014      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10015 /* end confdefs.h.  */
10016 int foo(void);
10017 int
10018 main ()
10019 {
10020 foo()
10021   ;
10022   return 0;
10023 }
10024 _ACEOF
10025 if ac_fn_c_try_compile "$LINENO"; then :
10026   ax_cv_PTHREAD_REJECT_UNKNOWN="-Werror $ax_pthread_extra_flags"
10027 else
10028   ax_cv_PTHREAD_REJECT_UNKNOWN=no
10029 fi
10030 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10031      CFLAGS="$save_CFLAGS"
10032
10033 fi
10034 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_REJECT_UNKNOWN" >&5
10035 $as_echo "$ax_cv_PTHREAD_REJECT_UNKNOWN" >&6; }
10036 ax_pthread_extra_flags=
10037 if test "x$ax_cv_PTHREAD_REJECT_UNKNOWN" != "xno"; then :
10038   ax_pthread_extra_flags="$ax_cv_PTHREAD_REJECT_UNKNOWN"
10039 fi
10040
10041 if test x"$ax_pthread_ok" = xno; then
10042 for flag in $ax_pthread_flags; do
10043
10044         case $flag in
10045                 none)
10046                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
10047 $as_echo_n "checking whether pthreads work without any flags... " >&6; }
10048                 ;;
10049
10050                 -mt,pthread)
10051                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5
10052 $as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; }
10053                 PTHREAD_CFLAGS="-mt"
10054                 PTHREAD_LIBS="-lpthread"
10055                 ;;
10056
10057                 -*)
10058                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5
10059 $as_echo_n "checking whether pthreads work with $flag... " >&6; }
10060                 PTHREAD_CFLAGS="$flag"
10061                 ;;
10062
10063                 pthread-config)
10064                 # Extract the first word of "pthread-config", so it can be a program name with args.
10065 set dummy pthread-config; ac_word=$2
10066 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10067 $as_echo_n "checking for $ac_word... " >&6; }
10068 if ${ac_cv_prog_ax_pthread_config+:} false; then :
10069   $as_echo_n "(cached) " >&6
10070 else
10071   if test -n "$ax_pthread_config"; then
10072   ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
10073 else
10074 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10075 for as_dir in $PATH
10076 do
10077   IFS=$as_save_IFS
10078   test -z "$as_dir" && as_dir=.
10079     for ac_exec_ext in '' $ac_executable_extensions; do
10080   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
10081     ac_cv_prog_ax_pthread_config="yes"
10082     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10083     break 2
10084   fi
10085 done
10086   done
10087 IFS=$as_save_IFS
10088
10089   test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
10090 fi
10091 fi
10092 ax_pthread_config=$ac_cv_prog_ax_pthread_config
10093 if test -n "$ax_pthread_config"; then
10094   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
10095 $as_echo "$ax_pthread_config" >&6; }
10096 else
10097   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10098 $as_echo "no" >&6; }
10099 fi
10100
10101
10102                 if test x"$ax_pthread_config" = xno; then continue; fi
10103                 PTHREAD_CFLAGS="`pthread-config --cflags`"
10104                 PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
10105                 ;;
10106
10107                 *)
10108                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5
10109 $as_echo_n "checking for the pthreads library -l$flag... " >&6; }
10110                 PTHREAD_LIBS="-l$flag"
10111                 ;;
10112         esac
10113
10114         save_LIBS="$LIBS"
10115         save_CFLAGS="$CFLAGS"
10116         LIBS="$PTHREAD_LIBS $LIBS"
10117         CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
10118
10119         # Check for various functions.  We must include pthread.h,
10120         # since some functions may be macros.  (On the Sequent, we
10121         # need a special flag -Kthread to make this header compile.)
10122         # We check for pthread_join because it is in -lpthread on IRIX
10123         # while pthread_create is in libc.  We check for pthread_attr_init
10124         # due to DEC craziness with -lpthreads.  We check for
10125         # pthread_cleanup_push because it is one of the few pthread
10126         # functions on Solaris that doesn't have a non-functional libc stub.
10127         # We try pthread_create on general principles.
10128         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10129 /* end confdefs.h.  */
10130 #include <pthread.h>
10131                         static void routine(void *a) { a = 0; }
10132                         static void *start_routine(void *a) { return a; }
10133 int
10134 main ()
10135 {
10136 pthread_t th; pthread_attr_t attr;
10137                         pthread_create(&th, 0, start_routine, 0);
10138                         pthread_join(th, 0);
10139                         pthread_attr_init(&attr);
10140                         pthread_cleanup_push(routine, 0);
10141                         pthread_cleanup_pop(0) /* ; */
10142   ;
10143   return 0;
10144 }
10145 _ACEOF
10146 if ac_fn_c_try_link "$LINENO"; then :
10147   ax_pthread_ok=yes
10148 fi
10149 rm -f core conftest.err conftest.$ac_objext \
10150     conftest$ac_exeext conftest.$ac_ext
10151
10152         LIBS="$save_LIBS"
10153         CFLAGS="$save_CFLAGS"
10154
10155         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
10156 $as_echo "$ax_pthread_ok" >&6; }
10157         if test "x$ax_pthread_ok" = xyes; then
10158                 break;
10159         fi
10160
10161         PTHREAD_LIBS=""
10162         PTHREAD_CFLAGS=""
10163 done
10164 fi
10165
10166 # Various other checks:
10167 if test "x$ax_pthread_ok" = xyes; then
10168         save_LIBS="$LIBS"
10169         LIBS="$PTHREAD_LIBS $LIBS"
10170         save_CFLAGS="$CFLAGS"
10171         CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
10172
10173         # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
10174         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
10175 $as_echo_n "checking for joinable pthread attribute... " >&6; }
10176 if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then :
10177   $as_echo_n "(cached) " >&6
10178 else
10179   ax_cv_PTHREAD_JOINABLE_ATTR=unknown
10180              for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
10181                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10182 /* end confdefs.h.  */
10183 #include <pthread.h>
10184 int
10185 main ()
10186 {
10187 int attr = $attr; return attr /* ; */
10188   ;
10189   return 0;
10190 }
10191 _ACEOF
10192 if ac_fn_c_try_link "$LINENO"; then :
10193   ax_cv_PTHREAD_JOINABLE_ATTR=$attr; break
10194 fi
10195 rm -f core conftest.err conftest.$ac_objext \
10196     conftest$ac_exeext conftest.$ac_ext
10197              done
10198
10199 fi
10200 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5
10201 $as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; }
10202         if test "$ax_cv_PTHREAD_JOINABLE_ATTR" != unknown && \
10203                test "$ax_cv_PTHREAD_JOINABLE_ATTR" != PTHREAD_CREATE_JOINABLE; then :
10204
10205 cat >>confdefs.h <<_ACEOF
10206 #define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR
10207 _ACEOF
10208
10209 fi
10210
10211         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5
10212 $as_echo_n "checking if more special flags are required for pthreads... " >&6; }
10213 if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then :
10214   $as_echo_n "(cached) " >&6
10215 else
10216   ax_cv_PTHREAD_SPECIAL_FLAGS=no
10217              ax_pthread_special_flags_added=no
10218              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10219 /* end confdefs.h.  */
10220
10221 #                 if !defined(_REENTRANT) && !defined(_THREAD_SAFE)
10222                   AX_PTHREAD_NEED_SPECIAL_FLAG
10223 #                 endif
10224
10225 _ACEOF
10226 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10227   $EGREP "AX_PTHREAD_NEED_SPECIAL_FLAG" >/dev/null 2>&1; then :
10228   case $host_os in
10229                   aix* | freebsd*)
10230                   ax_cv_PTHREAD_SPECIAL_FLAGS="-D_THREAD_SAFE"
10231                   ;;
10232                   darwin* | hpux* | osf* | solaris*)
10233                   ax_cv_PTHREAD_SPECIAL_FLAGS="-D_REENTRANT"
10234                   ;;
10235                   esac
10236
10237 fi
10238 rm -f conftest*
10239
10240
10241 fi
10242 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5
10243 $as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; }
10244         if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
10245                test "x$ax_pthread_special_flags_added" != "xyes"; then :
10246   PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
10247                ax_pthread_special_flags_added=yes
10248 fi
10249
10250         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5
10251 $as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; }
10252 if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then :
10253   $as_echo_n "(cached) " >&6
10254 else
10255   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10256 /* end confdefs.h.  */
10257 #include <pthread.h>
10258 int
10259 main ()
10260 {
10261 int i = PTHREAD_PRIO_INHERIT;
10262   ;
10263   return 0;
10264 }
10265 _ACEOF
10266 if ac_fn_c_try_link "$LINENO"; then :
10267   ax_cv_PTHREAD_PRIO_INHERIT=yes
10268 else
10269   ax_cv_PTHREAD_PRIO_INHERIT=no
10270 fi
10271 rm -f core conftest.err conftest.$ac_objext \
10272     conftest$ac_exeext conftest.$ac_ext
10273
10274 fi
10275 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5
10276 $as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; }
10277         if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then :
10278
10279 $as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h
10280
10281 fi
10282
10283         LIBS="$save_LIBS"
10284         CFLAGS="$save_CFLAGS"
10285
10286         # More AIX lossage: compile with *_r variant
10287         if test "x$GCC" != xyes; then
10288             case $host_os in
10289                 aix*)
10290                 case "x/$CC" in #(
10291   x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) :
10292     #handle absolute path differently from PATH based program lookup
10293                    case "x$CC" in #(
10294   x/*) :
10295     if as_fn_executable_p ${CC}_r; then :
10296   PTHREAD_CC="${CC}_r"
10297 fi ;; #(
10298   *) :
10299     for ac_prog in ${CC}_r
10300 do
10301   # Extract the first word of "$ac_prog", so it can be a program name with args.
10302 set dummy $ac_prog; ac_word=$2
10303 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
10304 $as_echo_n "checking for $ac_word... " >&6; }
10305 if ${ac_cv_prog_PTHREAD_CC+:} false; then :
10306   $as_echo_n "(cached) " >&6
10307 else
10308   if test -n "$PTHREAD_CC"; then
10309   ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
10310 else
10311 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10312 for as_dir in $PATH
10313 do
10314   IFS=$as_save_IFS
10315   test -z "$as_dir" && as_dir=.
10316     for ac_exec_ext in '' $ac_executable_extensions; do
10317   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
10318     ac_cv_prog_PTHREAD_CC="$ac_prog"
10319     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
10320     break 2
10321   fi
10322 done
10323   done
10324 IFS=$as_save_IFS
10325
10326 fi
10327 fi
10328 PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
10329 if test -n "$PTHREAD_CC"; then
10330   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
10331 $as_echo "$PTHREAD_CC" >&6; }
10332 else
10333   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10334 $as_echo "no" >&6; }
10335 fi
10336
10337
10338   test -n "$PTHREAD_CC" && break
10339 done
10340 test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
10341  ;;
10342 esac ;; #(
10343   *) :
10344      ;;
10345 esac
10346                 ;;
10347             esac
10348         fi
10349 fi
10350
10351 test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
10352
10353
10354
10355
10356
10357 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
10358 if test x"$ax_pthread_ok" = xyes; then
10359
10360 $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
10361
10362         :
10363 else
10364         ax_pthread_ok=no
10365
10366 fi
10367 ac_ext=c
10368 ac_cpp='$CPP $CPPFLAGS'
10369 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10370 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10371 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10372
10373         # set thread flags
10374
10375 # Some platforms use these, so just define them.  They can't hurt if they
10376 # are not supported.  For example, on Solaris -D_POSIX_PTHREAD_SEMANTICS
10377 # enables 5-arg getpwuid_r, among other things.
10378 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
10379
10380 # Check for *_r functions
10381 _CFLAGS="$CFLAGS"
10382 _LIBS="$LIBS"
10383 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
10384 LIBS="$LIBS $PTHREAD_LIBS"
10385
10386 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
10387 if test "x$ac_cv_header_pthread_h" = xyes; then :
10388
10389 else
10390   as_fn_error $? "
10391 pthread.h not found;  use --disable-thread-safety to disable thread safety" "$LINENO" 5
10392 fi
10393
10394
10395
10396 for ac_func in strerror_r getpwuid_r gethostbyname_r
10397 do :
10398   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
10399 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
10400 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
10401   cat >>confdefs.h <<_ACEOF
10402 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
10403 _ACEOF
10404
10405 fi
10406 done
10407
10408
10409 # Do test here with the proper thread flags
10410 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns int" >&5
10411 $as_echo_n "checking whether strerror_r returns int... " >&6; }
10412 if ${pgac_cv_func_strerror_r_int+:} false; then :
10413   $as_echo_n "(cached) " >&6
10414 else
10415   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10416 /* end confdefs.h.  */
10417 #include <string.h>
10418 int
10419 main ()
10420 {
10421 #ifndef _AIX
10422 int strerror_r(int, char *, size_t);
10423 #else
10424 /* Older AIX has 'int' for the third argument so we don't test the args. */
10425 int strerror_r();
10426 #endif
10427   ;
10428   return 0;
10429 }
10430 _ACEOF
10431 if ac_fn_c_try_compile "$LINENO"; then :
10432   pgac_cv_func_strerror_r_int=yes
10433 else
10434   pgac_cv_func_strerror_r_int=no
10435 fi
10436 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10437 fi
10438 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_strerror_r_int" >&5
10439 $as_echo "$pgac_cv_func_strerror_r_int" >&6; }
10440 if test x"$pgac_cv_func_strerror_r_int" = xyes ; then
10441
10442 $as_echo "#define STRERROR_R_INT 1" >>confdefs.h
10443
10444 fi
10445
10446
10447 CFLAGS="$_CFLAGS"
10448 LIBS="$_LIBS"
10449
10450
10451 else
10452    # else
10453 # do not use values from template file
10454 PTHREAD_CFLAGS=
10455 PTHREAD_LIBS=
10456
10457 fi # fi
10458
10459
10460
10461
10462
10463 ##
10464 ## Libraries
10465 ##
10466 ## Most libraries are included only if they demonstrably provide a function
10467 ## we need, but libm is an exception: always include it, because there are
10468 ## too many compilers that play cute optimization games that will break
10469 ## probes for standard functions such as pow().
10470 ##
10471
10472 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5
10473 $as_echo_n "checking for main in -lm... " >&6; }
10474 if ${ac_cv_lib_m_main+:} false; then :
10475   $as_echo_n "(cached) " >&6
10476 else
10477   ac_check_lib_save_LIBS=$LIBS
10478 LIBS="-lm  $LIBS"
10479 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10480 /* end confdefs.h.  */
10481
10482
10483 int
10484 main ()
10485 {
10486 return main ();
10487   ;
10488   return 0;
10489 }
10490 _ACEOF
10491 if ac_fn_c_try_link "$LINENO"; then :
10492   ac_cv_lib_m_main=yes
10493 else
10494   ac_cv_lib_m_main=no
10495 fi
10496 rm -f core conftest.err conftest.$ac_objext \
10497     conftest$ac_exeext conftest.$ac_ext
10498 LIBS=$ac_check_lib_save_LIBS
10499 fi
10500 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5
10501 $as_echo "$ac_cv_lib_m_main" >&6; }
10502 if test "x$ac_cv_lib_m_main" = xyes; then :
10503   cat >>confdefs.h <<_ACEOF
10504 #define HAVE_LIBM 1
10505 _ACEOF
10506
10507   LIBS="-lm $LIBS"
10508
10509 fi
10510
10511 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setproctitle" >&5
10512 $as_echo_n "checking for library containing setproctitle... " >&6; }
10513 if ${ac_cv_search_setproctitle+:} false; then :
10514   $as_echo_n "(cached) " >&6
10515 else
10516   ac_func_search_save_LIBS=$LIBS
10517 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10518 /* end confdefs.h.  */
10519
10520 /* Override any GCC internal prototype to avoid an error.
10521    Use char because int might match the return type of a GCC
10522    builtin and then its argument prototype would still apply.  */
10523 #ifdef __cplusplus
10524 extern "C"
10525 #endif
10526 char setproctitle ();
10527 int
10528 main ()
10529 {
10530 return setproctitle ();
10531   ;
10532   return 0;
10533 }
10534 _ACEOF
10535 for ac_lib in '' util; do
10536   if test -z "$ac_lib"; then
10537     ac_res="none required"
10538   else
10539     ac_res=-l$ac_lib
10540     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
10541   fi
10542   if ac_fn_c_try_link "$LINENO"; then :
10543   ac_cv_search_setproctitle=$ac_res
10544 fi
10545 rm -f core conftest.err conftest.$ac_objext \
10546     conftest$ac_exeext
10547   if ${ac_cv_search_setproctitle+:} false; then :
10548   break
10549 fi
10550 done
10551 if ${ac_cv_search_setproctitle+:} false; then :
10552
10553 else
10554   ac_cv_search_setproctitle=no
10555 fi
10556 rm conftest.$ac_ext
10557 LIBS=$ac_func_search_save_LIBS
10558 fi
10559 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setproctitle" >&5
10560 $as_echo "$ac_cv_search_setproctitle" >&6; }
10561 ac_res=$ac_cv_search_setproctitle
10562 if test "$ac_res" != no; then :
10563   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
10564
10565 fi
10566
10567 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
10568 $as_echo_n "checking for library containing dlopen... " >&6; }
10569 if ${ac_cv_search_dlopen+:} false; then :
10570   $as_echo_n "(cached) " >&6
10571 else
10572   ac_func_search_save_LIBS=$LIBS
10573 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10574 /* end confdefs.h.  */
10575
10576 /* Override any GCC internal prototype to avoid an error.
10577    Use char because int might match the return type of a GCC
10578    builtin and then its argument prototype would still apply.  */
10579 #ifdef __cplusplus
10580 extern "C"
10581 #endif
10582 char dlopen ();
10583 int
10584 main ()
10585 {
10586 return dlopen ();
10587   ;
10588   return 0;
10589 }
10590 _ACEOF
10591 for ac_lib in '' dl; do
10592   if test -z "$ac_lib"; then
10593     ac_res="none required"
10594   else
10595     ac_res=-l$ac_lib
10596     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
10597   fi
10598   if ac_fn_c_try_link "$LINENO"; then :
10599   ac_cv_search_dlopen=$ac_res
10600 fi
10601 rm -f core conftest.err conftest.$ac_objext \
10602     conftest$ac_exeext
10603   if ${ac_cv_search_dlopen+:} false; then :
10604   break
10605 fi
10606 done
10607 if ${ac_cv_search_dlopen+:} false; then :
10608
10609 else
10610   ac_cv_search_dlopen=no
10611 fi
10612 rm conftest.$ac_ext
10613 LIBS=$ac_func_search_save_LIBS
10614 fi
10615 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
10616 $as_echo "$ac_cv_search_dlopen" >&6; }
10617 ac_res=$ac_cv_search_dlopen
10618 if test "$ac_res" != no; then :
10619   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
10620
10621 fi
10622
10623 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
10624 $as_echo_n "checking for library containing socket... " >&6; }
10625 if ${ac_cv_search_socket+:} false; then :
10626   $as_echo_n "(cached) " >&6
10627 else
10628   ac_func_search_save_LIBS=$LIBS
10629 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10630 /* end confdefs.h.  */
10631
10632 /* Override any GCC internal prototype to avoid an error.
10633    Use char because int might match the return type of a GCC
10634    builtin and then its argument prototype would still apply.  */
10635 #ifdef __cplusplus
10636 extern "C"
10637 #endif
10638 char socket ();
10639 int
10640 main ()
10641 {
10642 return socket ();
10643   ;
10644   return 0;
10645 }
10646 _ACEOF
10647 for ac_lib in '' socket ws2_32; do
10648   if test -z "$ac_lib"; then
10649     ac_res="none required"
10650   else
10651     ac_res=-l$ac_lib
10652     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
10653   fi
10654   if ac_fn_c_try_link "$LINENO"; then :
10655   ac_cv_search_socket=$ac_res
10656 fi
10657 rm -f core conftest.err conftest.$ac_objext \
10658     conftest$ac_exeext
10659   if ${ac_cv_search_socket+:} false; then :
10660   break
10661 fi
10662 done
10663 if ${ac_cv_search_socket+:} false; then :
10664
10665 else
10666   ac_cv_search_socket=no
10667 fi
10668 rm conftest.$ac_ext
10669 LIBS=$ac_func_search_save_LIBS
10670 fi
10671 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
10672 $as_echo "$ac_cv_search_socket" >&6; }
10673 ac_res=$ac_cv_search_socket
10674 if test "$ac_res" != no; then :
10675   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
10676
10677 fi
10678
10679 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shl_load" >&5
10680 $as_echo_n "checking for library containing shl_load... " >&6; }
10681 if ${ac_cv_search_shl_load+:} false; then :
10682   $as_echo_n "(cached) " >&6
10683 else
10684   ac_func_search_save_LIBS=$LIBS
10685 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10686 /* end confdefs.h.  */
10687
10688 /* Override any GCC internal prototype to avoid an error.
10689    Use char because int might match the return type of a GCC
10690    builtin and then its argument prototype would still apply.  */
10691 #ifdef __cplusplus
10692 extern "C"
10693 #endif
10694 char shl_load ();
10695 int
10696 main ()
10697 {
10698 return shl_load ();
10699   ;
10700   return 0;
10701 }
10702 _ACEOF
10703 for ac_lib in '' dld; do
10704   if test -z "$ac_lib"; then
10705     ac_res="none required"
10706   else
10707     ac_res=-l$ac_lib
10708     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
10709   fi
10710   if ac_fn_c_try_link "$LINENO"; then :
10711   ac_cv_search_shl_load=$ac_res
10712 fi
10713 rm -f core conftest.err conftest.$ac_objext \
10714     conftest$ac_exeext
10715   if ${ac_cv_search_shl_load+:} false; then :
10716   break
10717 fi
10718 done
10719 if ${ac_cv_search_shl_load+:} false; then :
10720
10721 else
10722   ac_cv_search_shl_load=no
10723 fi
10724 rm conftest.$ac_ext
10725 LIBS=$ac_func_search_save_LIBS
10726 fi
10727 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shl_load" >&5
10728 $as_echo "$ac_cv_search_shl_load" >&6; }
10729 ac_res=$ac_cv_search_shl_load
10730 if test "$ac_res" != no; then :
10731   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
10732
10733 fi
10734
10735 # We only use libld in port/dynloader/aix.c
10736 case $host_os in
10737      aix*)
10738         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldopen" >&5
10739 $as_echo_n "checking for library containing ldopen... " >&6; }
10740 if ${ac_cv_search_ldopen+:} false; then :
10741   $as_echo_n "(cached) " >&6
10742 else
10743   ac_func_search_save_LIBS=$LIBS
10744 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10745 /* end confdefs.h.  */
10746
10747 /* Override any GCC internal prototype to avoid an error.
10748    Use char because int might match the return type of a GCC
10749    builtin and then its argument prototype would still apply.  */
10750 #ifdef __cplusplus
10751 extern "C"
10752 #endif
10753 char ldopen ();
10754 int
10755 main ()
10756 {
10757 return ldopen ();
10758   ;
10759   return 0;
10760 }
10761 _ACEOF
10762 for ac_lib in '' ld; do
10763   if test -z "$ac_lib"; then
10764     ac_res="none required"
10765   else
10766     ac_res=-l$ac_lib
10767     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
10768   fi
10769   if ac_fn_c_try_link "$LINENO"; then :
10770   ac_cv_search_ldopen=$ac_res
10771 fi
10772 rm -f core conftest.err conftest.$ac_objext \
10773     conftest$ac_exeext
10774   if ${ac_cv_search_ldopen+:} false; then :
10775   break
10776 fi
10777 done
10778 if ${ac_cv_search_ldopen+:} false; then :
10779
10780 else
10781   ac_cv_search_ldopen=no
10782 fi
10783 rm conftest.$ac_ext
10784 LIBS=$ac_func_search_save_LIBS
10785 fi
10786 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldopen" >&5
10787 $as_echo "$ac_cv_search_ldopen" >&6; }
10788 ac_res=$ac_cv_search_ldopen
10789 if test "$ac_res" != no; then :
10790   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
10791
10792 fi
10793
10794         ;;
10795 esac
10796 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getopt_long" >&5
10797 $as_echo_n "checking for library containing getopt_long... " >&6; }
10798 if ${ac_cv_search_getopt_long+:} false; then :
10799   $as_echo_n "(cached) " >&6
10800 else
10801   ac_func_search_save_LIBS=$LIBS
10802 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10803 /* end confdefs.h.  */
10804
10805 /* Override any GCC internal prototype to avoid an error.
10806    Use char because int might match the return type of a GCC
10807    builtin and then its argument prototype would still apply.  */
10808 #ifdef __cplusplus
10809 extern "C"
10810 #endif
10811 char getopt_long ();
10812 int
10813 main ()
10814 {
10815 return getopt_long ();
10816   ;
10817   return 0;
10818 }
10819 _ACEOF
10820 for ac_lib in '' getopt gnugetopt; do
10821   if test -z "$ac_lib"; then
10822     ac_res="none required"
10823   else
10824     ac_res=-l$ac_lib
10825     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
10826   fi
10827   if ac_fn_c_try_link "$LINENO"; then :
10828   ac_cv_search_getopt_long=$ac_res
10829 fi
10830 rm -f core conftest.err conftest.$ac_objext \
10831     conftest$ac_exeext
10832   if ${ac_cv_search_getopt_long+:} false; then :
10833   break
10834 fi
10835 done
10836 if ${ac_cv_search_getopt_long+:} false; then :
10837
10838 else
10839   ac_cv_search_getopt_long=no
10840 fi
10841 rm conftest.$ac_ext
10842 LIBS=$ac_func_search_save_LIBS
10843 fi
10844 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getopt_long" >&5
10845 $as_echo "$ac_cv_search_getopt_long" >&6; }
10846 ac_res=$ac_cv_search_getopt_long
10847 if test "$ac_res" != no; then :
10848   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
10849
10850 fi
10851
10852 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
10853 $as_echo_n "checking for library containing crypt... " >&6; }
10854 if ${ac_cv_search_crypt+:} false; then :
10855   $as_echo_n "(cached) " >&6
10856 else
10857   ac_func_search_save_LIBS=$LIBS
10858 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10859 /* end confdefs.h.  */
10860
10861 /* Override any GCC internal prototype to avoid an error.
10862    Use char because int might match the return type of a GCC
10863    builtin and then its argument prototype would still apply.  */
10864 #ifdef __cplusplus
10865 extern "C"
10866 #endif
10867 char crypt ();
10868 int
10869 main ()
10870 {
10871 return crypt ();
10872   ;
10873   return 0;
10874 }
10875 _ACEOF
10876 for ac_lib in '' crypt; do
10877   if test -z "$ac_lib"; then
10878     ac_res="none required"
10879   else
10880     ac_res=-l$ac_lib
10881     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
10882   fi
10883   if ac_fn_c_try_link "$LINENO"; then :
10884   ac_cv_search_crypt=$ac_res
10885 fi
10886 rm -f core conftest.err conftest.$ac_objext \
10887     conftest$ac_exeext
10888   if ${ac_cv_search_crypt+:} false; then :
10889   break
10890 fi
10891 done
10892 if ${ac_cv_search_crypt+:} false; then :
10893
10894 else
10895   ac_cv_search_crypt=no
10896 fi
10897 rm conftest.$ac_ext
10898 LIBS=$ac_func_search_save_LIBS
10899 fi
10900 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5
10901 $as_echo "$ac_cv_search_crypt" >&6; }
10902 ac_res=$ac_cv_search_crypt
10903 if test "$ac_res" != no; then :
10904   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
10905
10906 fi
10907
10908 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5
10909 $as_echo_n "checking for library containing shm_open... " >&6; }
10910 if ${ac_cv_search_shm_open+:} false; then :
10911   $as_echo_n "(cached) " >&6
10912 else
10913   ac_func_search_save_LIBS=$LIBS
10914 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10915 /* end confdefs.h.  */
10916
10917 /* Override any GCC internal prototype to avoid an error.
10918    Use char because int might match the return type of a GCC
10919    builtin and then its argument prototype would still apply.  */
10920 #ifdef __cplusplus
10921 extern "C"
10922 #endif
10923 char shm_open ();
10924 int
10925 main ()
10926 {
10927 return shm_open ();
10928   ;
10929   return 0;
10930 }
10931 _ACEOF
10932 for ac_lib in '' rt; do
10933   if test -z "$ac_lib"; then
10934     ac_res="none required"
10935   else
10936     ac_res=-l$ac_lib
10937     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
10938   fi
10939   if ac_fn_c_try_link "$LINENO"; then :
10940   ac_cv_search_shm_open=$ac_res
10941 fi
10942 rm -f core conftest.err conftest.$ac_objext \
10943     conftest$ac_exeext
10944   if ${ac_cv_search_shm_open+:} false; then :
10945   break
10946 fi
10947 done
10948 if ${ac_cv_search_shm_open+:} false; then :
10949
10950 else
10951   ac_cv_search_shm_open=no
10952 fi
10953 rm conftest.$ac_ext
10954 LIBS=$ac_func_search_save_LIBS
10955 fi
10956 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_open" >&5
10957 $as_echo "$ac_cv_search_shm_open" >&6; }
10958 ac_res=$ac_cv_search_shm_open
10959 if test "$ac_res" != no; then :
10960   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
10961
10962 fi
10963
10964 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_unlink" >&5
10965 $as_echo_n "checking for library containing shm_unlink... " >&6; }
10966 if ${ac_cv_search_shm_unlink+:} false; then :
10967   $as_echo_n "(cached) " >&6
10968 else
10969   ac_func_search_save_LIBS=$LIBS
10970 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10971 /* end confdefs.h.  */
10972
10973 /* Override any GCC internal prototype to avoid an error.
10974    Use char because int might match the return type of a GCC
10975    builtin and then its argument prototype would still apply.  */
10976 #ifdef __cplusplus
10977 extern "C"
10978 #endif
10979 char shm_unlink ();
10980 int
10981 main ()
10982 {
10983 return shm_unlink ();
10984   ;
10985   return 0;
10986 }
10987 _ACEOF
10988 for ac_lib in '' rt; do
10989   if test -z "$ac_lib"; then
10990     ac_res="none required"
10991   else
10992     ac_res=-l$ac_lib
10993     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
10994   fi
10995   if ac_fn_c_try_link "$LINENO"; then :
10996   ac_cv_search_shm_unlink=$ac_res
10997 fi
10998 rm -f core conftest.err conftest.$ac_objext \
10999     conftest$ac_exeext
11000   if ${ac_cv_search_shm_unlink+:} false; then :
11001   break
11002 fi
11003 done
11004 if ${ac_cv_search_shm_unlink+:} false; then :
11005
11006 else
11007   ac_cv_search_shm_unlink=no
11008 fi
11009 rm conftest.$ac_ext
11010 LIBS=$ac_func_search_save_LIBS
11011 fi
11012 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_unlink" >&5
11013 $as_echo "$ac_cv_search_shm_unlink" >&6; }
11014 ac_res=$ac_cv_search_shm_unlink
11015 if test "$ac_res" != no; then :
11016   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11017
11018 fi
11019
11020 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
11021 $as_echo_n "checking for library containing clock_gettime... " >&6; }
11022 if ${ac_cv_search_clock_gettime+:} false; then :
11023   $as_echo_n "(cached) " >&6
11024 else
11025   ac_func_search_save_LIBS=$LIBS
11026 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11027 /* end confdefs.h.  */
11028
11029 /* Override any GCC internal prototype to avoid an error.
11030    Use char because int might match the return type of a GCC
11031    builtin and then its argument prototype would still apply.  */
11032 #ifdef __cplusplus
11033 extern "C"
11034 #endif
11035 char clock_gettime ();
11036 int
11037 main ()
11038 {
11039 return clock_gettime ();
11040   ;
11041   return 0;
11042 }
11043 _ACEOF
11044 for ac_lib in '' rt posix4; do
11045   if test -z "$ac_lib"; then
11046     ac_res="none required"
11047   else
11048     ac_res=-l$ac_lib
11049     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11050   fi
11051   if ac_fn_c_try_link "$LINENO"; then :
11052   ac_cv_search_clock_gettime=$ac_res
11053 fi
11054 rm -f core conftest.err conftest.$ac_objext \
11055     conftest$ac_exeext
11056   if ${ac_cv_search_clock_gettime+:} false; then :
11057   break
11058 fi
11059 done
11060 if ${ac_cv_search_clock_gettime+:} false; then :
11061
11062 else
11063   ac_cv_search_clock_gettime=no
11064 fi
11065 rm conftest.$ac_ext
11066 LIBS=$ac_func_search_save_LIBS
11067 fi
11068 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
11069 $as_echo "$ac_cv_search_clock_gettime" >&6; }
11070 ac_res=$ac_cv_search_clock_gettime
11071 if test "$ac_res" != no; then :
11072   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11073
11074 fi
11075
11076 # Solaris:
11077 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fdatasync" >&5
11078 $as_echo_n "checking for library containing fdatasync... " >&6; }
11079 if ${ac_cv_search_fdatasync+:} 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 fdatasync ();
11093 int
11094 main ()
11095 {
11096 return fdatasync ();
11097   ;
11098   return 0;
11099 }
11100 _ACEOF
11101 for ac_lib in '' rt posix4; 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_fdatasync=$ac_res
11110 fi
11111 rm -f core conftest.err conftest.$ac_objext \
11112     conftest$ac_exeext
11113   if ${ac_cv_search_fdatasync+:} false; then :
11114   break
11115 fi
11116 done
11117 if ${ac_cv_search_fdatasync+:} false; then :
11118
11119 else
11120   ac_cv_search_fdatasync=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_fdatasync" >&5
11126 $as_echo "$ac_cv_search_fdatasync" >&6; }
11127 ac_res=$ac_cv_search_fdatasync
11128 if test "$ac_res" != no; then :
11129   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11130
11131 fi
11132
11133 # Required for thread_test.c on Solaris
11134 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_yield" >&5
11135 $as_echo_n "checking for library containing sched_yield... " >&6; }
11136 if ${ac_cv_search_sched_yield+:} false; then :
11137   $as_echo_n "(cached) " >&6
11138 else
11139   ac_func_search_save_LIBS=$LIBS
11140 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11141 /* end confdefs.h.  */
11142
11143 /* Override any GCC internal prototype to avoid an error.
11144    Use char because int might match the return type of a GCC
11145    builtin and then its argument prototype would still apply.  */
11146 #ifdef __cplusplus
11147 extern "C"
11148 #endif
11149 char sched_yield ();
11150 int
11151 main ()
11152 {
11153 return sched_yield ();
11154   ;
11155   return 0;
11156 }
11157 _ACEOF
11158 for ac_lib in '' rt; do
11159   if test -z "$ac_lib"; then
11160     ac_res="none required"
11161   else
11162     ac_res=-l$ac_lib
11163     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11164   fi
11165   if ac_fn_c_try_link "$LINENO"; then :
11166   ac_cv_search_sched_yield=$ac_res
11167 fi
11168 rm -f core conftest.err conftest.$ac_objext \
11169     conftest$ac_exeext
11170   if ${ac_cv_search_sched_yield+:} false; then :
11171   break
11172 fi
11173 done
11174 if ${ac_cv_search_sched_yield+:} false; then :
11175
11176 else
11177   ac_cv_search_sched_yield=no
11178 fi
11179 rm conftest.$ac_ext
11180 LIBS=$ac_func_search_save_LIBS
11181 fi
11182 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_yield" >&5
11183 $as_echo "$ac_cv_search_sched_yield" >&6; }
11184 ac_res=$ac_cv_search_sched_yield
11185 if test "$ac_res" != no; then :
11186   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11187
11188 fi
11189
11190 # Required for thread_test.c on Solaris 2.5:
11191 # Other ports use it too (HP-UX) so test unconditionally
11192 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname_r" >&5
11193 $as_echo_n "checking for library containing gethostbyname_r... " >&6; }
11194 if ${ac_cv_search_gethostbyname_r+:} false; then :
11195   $as_echo_n "(cached) " >&6
11196 else
11197   ac_func_search_save_LIBS=$LIBS
11198 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11199 /* end confdefs.h.  */
11200
11201 /* Override any GCC internal prototype to avoid an error.
11202    Use char because int might match the return type of a GCC
11203    builtin and then its argument prototype would still apply.  */
11204 #ifdef __cplusplus
11205 extern "C"
11206 #endif
11207 char gethostbyname_r ();
11208 int
11209 main ()
11210 {
11211 return gethostbyname_r ();
11212   ;
11213   return 0;
11214 }
11215 _ACEOF
11216 for ac_lib in '' nsl; do
11217   if test -z "$ac_lib"; then
11218     ac_res="none required"
11219   else
11220     ac_res=-l$ac_lib
11221     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11222   fi
11223   if ac_fn_c_try_link "$LINENO"; then :
11224   ac_cv_search_gethostbyname_r=$ac_res
11225 fi
11226 rm -f core conftest.err conftest.$ac_objext \
11227     conftest$ac_exeext
11228   if ${ac_cv_search_gethostbyname_r+:} false; then :
11229   break
11230 fi
11231 done
11232 if ${ac_cv_search_gethostbyname_r+:} false; then :
11233
11234 else
11235   ac_cv_search_gethostbyname_r=no
11236 fi
11237 rm conftest.$ac_ext
11238 LIBS=$ac_func_search_save_LIBS
11239 fi
11240 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname_r" >&5
11241 $as_echo "$ac_cv_search_gethostbyname_r" >&6; }
11242 ac_res=$ac_cv_search_gethostbyname_r
11243 if test "$ac_res" != no; then :
11244   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11245
11246 fi
11247
11248 # Cygwin:
11249 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shmget" >&5
11250 $as_echo_n "checking for library containing shmget... " >&6; }
11251 if ${ac_cv_search_shmget+:} false; then :
11252   $as_echo_n "(cached) " >&6
11253 else
11254   ac_func_search_save_LIBS=$LIBS
11255 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11256 /* end confdefs.h.  */
11257
11258 /* Override any GCC internal prototype to avoid an error.
11259    Use char because int might match the return type of a GCC
11260    builtin and then its argument prototype would still apply.  */
11261 #ifdef __cplusplus
11262 extern "C"
11263 #endif
11264 char shmget ();
11265 int
11266 main ()
11267 {
11268 return shmget ();
11269   ;
11270   return 0;
11271 }
11272 _ACEOF
11273 for ac_lib in '' cygipc; do
11274   if test -z "$ac_lib"; then
11275     ac_res="none required"
11276   else
11277     ac_res=-l$ac_lib
11278     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11279   fi
11280   if ac_fn_c_try_link "$LINENO"; then :
11281   ac_cv_search_shmget=$ac_res
11282 fi
11283 rm -f core conftest.err conftest.$ac_objext \
11284     conftest$ac_exeext
11285   if ${ac_cv_search_shmget+:} false; then :
11286   break
11287 fi
11288 done
11289 if ${ac_cv_search_shmget+:} false; then :
11290
11291 else
11292   ac_cv_search_shmget=no
11293 fi
11294 rm conftest.$ac_ext
11295 LIBS=$ac_func_search_save_LIBS
11296 fi
11297 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shmget" >&5
11298 $as_echo "$ac_cv_search_shmget" >&6; }
11299 ac_res=$ac_cv_search_shmget
11300 if test "$ac_res" != no; then :
11301   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11302
11303 fi
11304
11305
11306 if test "$with_readline" = yes; then
11307
11308
11309 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing readline" >&5
11310 $as_echo_n "checking for library containing readline... " >&6; }
11311 if ${pgac_cv_check_readline+:} false; then :
11312   $as_echo_n "(cached) " >&6
11313 else
11314   pgac_cv_check_readline=no
11315 pgac_save_LIBS=$LIBS
11316 if test x"$with_libedit_preferred" != x"yes"
11317 then    READLINE_ORDER="-lreadline -ledit"
11318 else    READLINE_ORDER="-ledit -lreadline"
11319 fi
11320 for pgac_rllib in $READLINE_ORDER ; do
11321   for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
11322     LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS"
11323     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11324 /* end confdefs.h.  */
11325
11326 /* Override any GCC internal prototype to avoid an error.
11327    Use char because int might match the return type of a GCC
11328    builtin and then its argument prototype would still apply.  */
11329 #ifdef __cplusplus
11330 extern "C"
11331 #endif
11332 char readline ();
11333 int
11334 main ()
11335 {
11336 return readline ();
11337   ;
11338   return 0;
11339 }
11340 _ACEOF
11341 if ac_fn_c_try_link "$LINENO"; then :
11342
11343       # Older NetBSD, OpenBSD, and Irix have a broken linker that does not
11344       # recognize dependent libraries; assume curses is needed if we didn't
11345       # find any dependency.
11346       case $host_os in
11347         netbsd* | openbsd* | irix*)
11348           if test x"$pgac_lib" = x"" ; then
11349             pgac_lib=" -lcurses"
11350           fi ;;
11351       esac
11352
11353       pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"
11354       break
11355
11356 fi
11357 rm -f core conftest.err conftest.$ac_objext \
11358     conftest$ac_exeext conftest.$ac_ext
11359   done
11360   if test "$pgac_cv_check_readline" != no ; then
11361     break
11362   fi
11363 done
11364 LIBS=$pgac_save_LIBS
11365
11366 fi
11367 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_readline" >&5
11368 $as_echo "$pgac_cv_check_readline" >&6; }
11369 if test "$pgac_cv_check_readline" != no ; then
11370   LIBS="$pgac_cv_check_readline $LIBS"
11371
11372 $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
11373
11374 fi
11375
11376
11377   if test x"$pgac_cv_check_readline" = x"no"; then
11378     as_fn_error $? "readline library not found
11379 If you have readline already installed, see config.log for details on the
11380 failure.  It is possible the compiler isn't looking in the proper directory.
11381 Use --without-readline to disable readline support." "$LINENO" 5
11382   fi
11383 fi
11384
11385 if test "$with_zlib" = yes; then
11386   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5
11387 $as_echo_n "checking for inflate in -lz... " >&6; }
11388 if ${ac_cv_lib_z_inflate+:} false; then :
11389   $as_echo_n "(cached) " >&6
11390 else
11391   ac_check_lib_save_LIBS=$LIBS
11392 LIBS="-lz  $LIBS"
11393 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11394 /* end confdefs.h.  */
11395
11396 /* Override any GCC internal prototype to avoid an error.
11397    Use char because int might match the return type of a GCC
11398    builtin and then its argument prototype would still apply.  */
11399 #ifdef __cplusplus
11400 extern "C"
11401 #endif
11402 char inflate ();
11403 int
11404 main ()
11405 {
11406 return inflate ();
11407   ;
11408   return 0;
11409 }
11410 _ACEOF
11411 if ac_fn_c_try_link "$LINENO"; then :
11412   ac_cv_lib_z_inflate=yes
11413 else
11414   ac_cv_lib_z_inflate=no
11415 fi
11416 rm -f core conftest.err conftest.$ac_objext \
11417     conftest$ac_exeext conftest.$ac_ext
11418 LIBS=$ac_check_lib_save_LIBS
11419 fi
11420 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5
11421 $as_echo "$ac_cv_lib_z_inflate" >&6; }
11422 if test "x$ac_cv_lib_z_inflate" = xyes; then :
11423   cat >>confdefs.h <<_ACEOF
11424 #define HAVE_LIBZ 1
11425 _ACEOF
11426
11427   LIBS="-lz $LIBS"
11428
11429 else
11430   as_fn_error $? "zlib library not found
11431 If you have zlib already installed, see config.log for details on the
11432 failure.  It is possible the compiler isn't looking in the proper directory.
11433 Use --without-zlib to disable zlib support." "$LINENO" 5
11434 fi
11435
11436 fi
11437
11438 if test "$enable_spinlocks" = yes; then
11439
11440 $as_echo "#define HAVE_SPINLOCKS 1" >>confdefs.h
11441
11442 else
11443   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
11444 *** Not using spinlocks will cause poor performance." >&5
11445 $as_echo "$as_me: WARNING:
11446 *** Not using spinlocks will cause poor performance." >&2;}
11447 fi
11448
11449 if test "$enable_atomics" = yes; then
11450
11451 $as_echo "#define HAVE_ATOMICS 1" >>confdefs.h
11452
11453 else
11454   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
11455 *** Not using atomic operations will cause poor performance." >&5
11456 $as_echo "$as_me: WARNING:
11457 *** Not using atomic operations will cause poor performance." >&2;}
11458 fi
11459
11460 if test "$with_gssapi" = yes ; then
11461   if test "$PORTNAME" != "win32"; then
11462     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gss_init_sec_context" >&5
11463 $as_echo_n "checking for library containing gss_init_sec_context... " >&6; }
11464 if ${ac_cv_search_gss_init_sec_context+:} false; then :
11465   $as_echo_n "(cached) " >&6
11466 else
11467   ac_func_search_save_LIBS=$LIBS
11468 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11469 /* end confdefs.h.  */
11470
11471 /* Override any GCC internal prototype to avoid an error.
11472    Use char because int might match the return type of a GCC
11473    builtin and then its argument prototype would still apply.  */
11474 #ifdef __cplusplus
11475 extern "C"
11476 #endif
11477 char gss_init_sec_context ();
11478 int
11479 main ()
11480 {
11481 return gss_init_sec_context ();
11482   ;
11483   return 0;
11484 }
11485 _ACEOF
11486 for ac_lib in '' gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'; do
11487   if test -z "$ac_lib"; then
11488     ac_res="none required"
11489   else
11490     ac_res=-l$ac_lib
11491     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11492   fi
11493   if ac_fn_c_try_link "$LINENO"; then :
11494   ac_cv_search_gss_init_sec_context=$ac_res
11495 fi
11496 rm -f core conftest.err conftest.$ac_objext \
11497     conftest$ac_exeext
11498   if ${ac_cv_search_gss_init_sec_context+:} false; then :
11499   break
11500 fi
11501 done
11502 if ${ac_cv_search_gss_init_sec_context+:} false; then :
11503
11504 else
11505   ac_cv_search_gss_init_sec_context=no
11506 fi
11507 rm conftest.$ac_ext
11508 LIBS=$ac_func_search_save_LIBS
11509 fi
11510 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gss_init_sec_context" >&5
11511 $as_echo "$ac_cv_search_gss_init_sec_context" >&6; }
11512 ac_res=$ac_cv_search_gss_init_sec_context
11513 if test "$ac_res" != no; then :
11514   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11515
11516 else
11517   as_fn_error $? "could not find function 'gss_init_sec_context' required for GSSAPI" "$LINENO" 5
11518 fi
11519
11520   else
11521     LIBS="$LIBS -lgssapi32"
11522   fi
11523 fi
11524
11525 if test "$with_openssl" = yes ; then
11526     if test "$PORTNAME" != "win32"; then
11527      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5
11528 $as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; }
11529 if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then :
11530   $as_echo_n "(cached) " >&6
11531 else
11532   ac_check_lib_save_LIBS=$LIBS
11533 LIBS="-lcrypto  $LIBS"
11534 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11535 /* end confdefs.h.  */
11536
11537 /* Override any GCC internal prototype to avoid an error.
11538    Use char because int might match the return type of a GCC
11539    builtin and then its argument prototype would still apply.  */
11540 #ifdef __cplusplus
11541 extern "C"
11542 #endif
11543 char CRYPTO_new_ex_data ();
11544 int
11545 main ()
11546 {
11547 return CRYPTO_new_ex_data ();
11548   ;
11549   return 0;
11550 }
11551 _ACEOF
11552 if ac_fn_c_try_link "$LINENO"; then :
11553   ac_cv_lib_crypto_CRYPTO_new_ex_data=yes
11554 else
11555   ac_cv_lib_crypto_CRYPTO_new_ex_data=no
11556 fi
11557 rm -f core conftest.err conftest.$ac_objext \
11558     conftest$ac_exeext conftest.$ac_ext
11559 LIBS=$ac_check_lib_save_LIBS
11560 fi
11561 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5
11562 $as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; }
11563 if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then :
11564   cat >>confdefs.h <<_ACEOF
11565 #define HAVE_LIBCRYPTO 1
11566 _ACEOF
11567
11568   LIBS="-lcrypto $LIBS"
11569
11570 else
11571   as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5
11572 fi
11573
11574      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl" >&5
11575 $as_echo_n "checking for SSL_new in -lssl... " >&6; }
11576 if ${ac_cv_lib_ssl_SSL_new+:} false; then :
11577   $as_echo_n "(cached) " >&6
11578 else
11579   ac_check_lib_save_LIBS=$LIBS
11580 LIBS="-lssl  $LIBS"
11581 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11582 /* end confdefs.h.  */
11583
11584 /* Override any GCC internal prototype to avoid an error.
11585    Use char because int might match the return type of a GCC
11586    builtin and then its argument prototype would still apply.  */
11587 #ifdef __cplusplus
11588 extern "C"
11589 #endif
11590 char SSL_new ();
11591 int
11592 main ()
11593 {
11594 return SSL_new ();
11595   ;
11596   return 0;
11597 }
11598 _ACEOF
11599 if ac_fn_c_try_link "$LINENO"; then :
11600   ac_cv_lib_ssl_SSL_new=yes
11601 else
11602   ac_cv_lib_ssl_SSL_new=no
11603 fi
11604 rm -f core conftest.err conftest.$ac_objext \
11605     conftest$ac_exeext conftest.$ac_ext
11606 LIBS=$ac_check_lib_save_LIBS
11607 fi
11608 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_new" >&5
11609 $as_echo "$ac_cv_lib_ssl_SSL_new" >&6; }
11610 if test "x$ac_cv_lib_ssl_SSL_new" = xyes; then :
11611   cat >>confdefs.h <<_ACEOF
11612 #define HAVE_LIBSSL 1
11613 _ACEOF
11614
11615   LIBS="-lssl $LIBS"
11616
11617 else
11618   as_fn_error $? "library 'ssl' is required for OpenSSL" "$LINENO" 5
11619 fi
11620
11621   else
11622      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing CRYPTO_new_ex_data" >&5
11623 $as_echo_n "checking for library containing CRYPTO_new_ex_data... " >&6; }
11624 if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
11625   $as_echo_n "(cached) " >&6
11626 else
11627   ac_func_search_save_LIBS=$LIBS
11628 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11629 /* end confdefs.h.  */
11630
11631 /* Override any GCC internal prototype to avoid an error.
11632    Use char because int might match the return type of a GCC
11633    builtin and then its argument prototype would still apply.  */
11634 #ifdef __cplusplus
11635 extern "C"
11636 #endif
11637 char CRYPTO_new_ex_data ();
11638 int
11639 main ()
11640 {
11641 return CRYPTO_new_ex_data ();
11642   ;
11643   return 0;
11644 }
11645 _ACEOF
11646 for ac_lib in '' eay32 crypto; do
11647   if test -z "$ac_lib"; then
11648     ac_res="none required"
11649   else
11650     ac_res=-l$ac_lib
11651     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11652   fi
11653   if ac_fn_c_try_link "$LINENO"; then :
11654   ac_cv_search_CRYPTO_new_ex_data=$ac_res
11655 fi
11656 rm -f core conftest.err conftest.$ac_objext \
11657     conftest$ac_exeext
11658   if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
11659   break
11660 fi
11661 done
11662 if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
11663
11664 else
11665   ac_cv_search_CRYPTO_new_ex_data=no
11666 fi
11667 rm conftest.$ac_ext
11668 LIBS=$ac_func_search_save_LIBS
11669 fi
11670 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_CRYPTO_new_ex_data" >&5
11671 $as_echo "$ac_cv_search_CRYPTO_new_ex_data" >&6; }
11672 ac_res=$ac_cv_search_CRYPTO_new_ex_data
11673 if test "$ac_res" != no; then :
11674   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11675
11676 else
11677   as_fn_error $? "library 'eay32' or 'crypto' is required for OpenSSL" "$LINENO" 5
11678 fi
11679
11680      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_new" >&5
11681 $as_echo_n "checking for library containing SSL_new... " >&6; }
11682 if ${ac_cv_search_SSL_new+:} false; then :
11683   $as_echo_n "(cached) " >&6
11684 else
11685   ac_func_search_save_LIBS=$LIBS
11686 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11687 /* end confdefs.h.  */
11688
11689 /* Override any GCC internal prototype to avoid an error.
11690    Use char because int might match the return type of a GCC
11691    builtin and then its argument prototype would still apply.  */
11692 #ifdef __cplusplus
11693 extern "C"
11694 #endif
11695 char SSL_new ();
11696 int
11697 main ()
11698 {
11699 return SSL_new ();
11700   ;
11701   return 0;
11702 }
11703 _ACEOF
11704 for ac_lib in '' ssleay32 ssl; do
11705   if test -z "$ac_lib"; then
11706     ac_res="none required"
11707   else
11708     ac_res=-l$ac_lib
11709     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
11710   fi
11711   if ac_fn_c_try_link "$LINENO"; then :
11712   ac_cv_search_SSL_new=$ac_res
11713 fi
11714 rm -f core conftest.err conftest.$ac_objext \
11715     conftest$ac_exeext
11716   if ${ac_cv_search_SSL_new+:} false; then :
11717   break
11718 fi
11719 done
11720 if ${ac_cv_search_SSL_new+:} false; then :
11721
11722 else
11723   ac_cv_search_SSL_new=no
11724 fi
11725 rm conftest.$ac_ext
11726 LIBS=$ac_func_search_save_LIBS
11727 fi
11728 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SSL_new" >&5
11729 $as_echo "$ac_cv_search_SSL_new" >&6; }
11730 ac_res=$ac_cv_search_SSL_new
11731 if test "$ac_res" != no; then :
11732   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11733
11734 else
11735   as_fn_error $? "library 'ssleay32' or 'ssl' is required for OpenSSL" "$LINENO" 5
11736 fi
11737
11738   fi
11739   for ac_func in SSL_clear_options SSL_get_current_compression X509_get_signature_nid
11740 do :
11741   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
11742 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
11743 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
11744   cat >>confdefs.h <<_ACEOF
11745 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
11746 _ACEOF
11747
11748 fi
11749 done
11750
11751   # Functions introduced in OpenSSL 1.1.0. We used to check for
11752   # OPENSSL_VERSION_NUMBER, but that didn't work with 1.1.0, because LibreSSL
11753   # defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it
11754   # doesn't have these OpenSSL 1.1.0 functions. So check for individual
11755   # functions.
11756   for ac_func in OPENSSL_init_ssl BIO_get_data BIO_meth_new ASN1_STRING_get0_data RAND_OpenSSL
11757 do :
11758   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
11759 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
11760 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
11761   cat >>confdefs.h <<_ACEOF
11762 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
11763 _ACEOF
11764
11765 fi
11766 done
11767
11768   # OpenSSL versions before 1.1.0 required setting callback functions, for
11769   # thread-safety. In 1.1.0, it's no longer required, and CRYPTO_lock()
11770   # function was removed.
11771   for ac_func in CRYPTO_lock
11772 do :
11773   ac_fn_c_check_func "$LINENO" "CRYPTO_lock" "ac_cv_func_CRYPTO_lock"
11774 if test "x$ac_cv_func_CRYPTO_lock" = xyes; then :
11775   cat >>confdefs.h <<_ACEOF
11776 #define HAVE_CRYPTO_LOCK 1
11777 _ACEOF
11778
11779 fi
11780 done
11781
11782 fi
11783
11784 if test "$with_pam" = yes ; then
11785   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5
11786 $as_echo_n "checking for pam_start in -lpam... " >&6; }
11787 if ${ac_cv_lib_pam_pam_start+:} false; then :
11788   $as_echo_n "(cached) " >&6
11789 else
11790   ac_check_lib_save_LIBS=$LIBS
11791 LIBS="-lpam  $LIBS"
11792 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11793 /* end confdefs.h.  */
11794
11795 /* Override any GCC internal prototype to avoid an error.
11796    Use char because int might match the return type of a GCC
11797    builtin and then its argument prototype would still apply.  */
11798 #ifdef __cplusplus
11799 extern "C"
11800 #endif
11801 char pam_start ();
11802 int
11803 main ()
11804 {
11805 return pam_start ();
11806   ;
11807   return 0;
11808 }
11809 _ACEOF
11810 if ac_fn_c_try_link "$LINENO"; then :
11811   ac_cv_lib_pam_pam_start=yes
11812 else
11813   ac_cv_lib_pam_pam_start=no
11814 fi
11815 rm -f core conftest.err conftest.$ac_objext \
11816     conftest$ac_exeext conftest.$ac_ext
11817 LIBS=$ac_check_lib_save_LIBS
11818 fi
11819 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5
11820 $as_echo "$ac_cv_lib_pam_pam_start" >&6; }
11821 if test "x$ac_cv_lib_pam_pam_start" = xyes; then :
11822   cat >>confdefs.h <<_ACEOF
11823 #define HAVE_LIBPAM 1
11824 _ACEOF
11825
11826   LIBS="-lpam $LIBS"
11827
11828 else
11829   as_fn_error $? "library 'pam' is required for PAM" "$LINENO" 5
11830 fi
11831
11832 fi
11833
11834 if test "$with_libxml" = yes ; then
11835   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlSaveToBuffer in -lxml2" >&5
11836 $as_echo_n "checking for xmlSaveToBuffer in -lxml2... " >&6; }
11837 if ${ac_cv_lib_xml2_xmlSaveToBuffer+:} false; then :
11838   $as_echo_n "(cached) " >&6
11839 else
11840   ac_check_lib_save_LIBS=$LIBS
11841 LIBS="-lxml2  $LIBS"
11842 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11843 /* end confdefs.h.  */
11844
11845 /* Override any GCC internal prototype to avoid an error.
11846    Use char because int might match the return type of a GCC
11847    builtin and then its argument prototype would still apply.  */
11848 #ifdef __cplusplus
11849 extern "C"
11850 #endif
11851 char xmlSaveToBuffer ();
11852 int
11853 main ()
11854 {
11855 return xmlSaveToBuffer ();
11856   ;
11857   return 0;
11858 }
11859 _ACEOF
11860 if ac_fn_c_try_link "$LINENO"; then :
11861   ac_cv_lib_xml2_xmlSaveToBuffer=yes
11862 else
11863   ac_cv_lib_xml2_xmlSaveToBuffer=no
11864 fi
11865 rm -f core conftest.err conftest.$ac_objext \
11866     conftest$ac_exeext conftest.$ac_ext
11867 LIBS=$ac_check_lib_save_LIBS
11868 fi
11869 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlSaveToBuffer" >&5
11870 $as_echo "$ac_cv_lib_xml2_xmlSaveToBuffer" >&6; }
11871 if test "x$ac_cv_lib_xml2_xmlSaveToBuffer" = xyes; then :
11872   cat >>confdefs.h <<_ACEOF
11873 #define HAVE_LIBXML2 1
11874 _ACEOF
11875
11876   LIBS="-lxml2 $LIBS"
11877
11878 else
11879   as_fn_error $? "library 'xml2' (version >= 2.6.23) is required for XML support" "$LINENO" 5
11880 fi
11881
11882 fi
11883
11884 if test "$with_libxslt" = yes ; then
11885   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xsltCleanupGlobals in -lxslt" >&5
11886 $as_echo_n "checking for xsltCleanupGlobals in -lxslt... " >&6; }
11887 if ${ac_cv_lib_xslt_xsltCleanupGlobals+:} false; then :
11888   $as_echo_n "(cached) " >&6
11889 else
11890   ac_check_lib_save_LIBS=$LIBS
11891 LIBS="-lxslt  $LIBS"
11892 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11893 /* end confdefs.h.  */
11894
11895 /* Override any GCC internal prototype to avoid an error.
11896    Use char because int might match the return type of a GCC
11897    builtin and then its argument prototype would still apply.  */
11898 #ifdef __cplusplus
11899 extern "C"
11900 #endif
11901 char xsltCleanupGlobals ();
11902 int
11903 main ()
11904 {
11905 return xsltCleanupGlobals ();
11906   ;
11907   return 0;
11908 }
11909 _ACEOF
11910 if ac_fn_c_try_link "$LINENO"; then :
11911   ac_cv_lib_xslt_xsltCleanupGlobals=yes
11912 else
11913   ac_cv_lib_xslt_xsltCleanupGlobals=no
11914 fi
11915 rm -f core conftest.err conftest.$ac_objext \
11916     conftest$ac_exeext conftest.$ac_ext
11917 LIBS=$ac_check_lib_save_LIBS
11918 fi
11919 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xslt_xsltCleanupGlobals" >&5
11920 $as_echo "$ac_cv_lib_xslt_xsltCleanupGlobals" >&6; }
11921 if test "x$ac_cv_lib_xslt_xsltCleanupGlobals" = xyes; then :
11922   cat >>confdefs.h <<_ACEOF
11923 #define HAVE_LIBXSLT 1
11924 _ACEOF
11925
11926   LIBS="-lxslt $LIBS"
11927
11928 else
11929   as_fn_error $? "library 'xslt' is required for XSLT support" "$LINENO" 5
11930 fi
11931
11932 fi
11933
11934 # Note: We can test for libldap_r only after we know PTHREAD_LIBS
11935 if test "$with_ldap" = yes ; then
11936   _LIBS="$LIBS"
11937   if test "$PORTNAME" != "win32"; then
11938     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
11939 $as_echo_n "checking for ldap_bind in -lldap... " >&6; }
11940 if ${ac_cv_lib_ldap_ldap_bind+:} false; then :
11941   $as_echo_n "(cached) " >&6
11942 else
11943   ac_check_lib_save_LIBS=$LIBS
11944 LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
11945 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11946 /* end confdefs.h.  */
11947
11948 /* Override any GCC internal prototype to avoid an error.
11949    Use char because int might match the return type of a GCC
11950    builtin and then its argument prototype would still apply.  */
11951 #ifdef __cplusplus
11952 extern "C"
11953 #endif
11954 char ldap_bind ();
11955 int
11956 main ()
11957 {
11958 return ldap_bind ();
11959   ;
11960   return 0;
11961 }
11962 _ACEOF
11963 if ac_fn_c_try_link "$LINENO"; then :
11964   ac_cv_lib_ldap_ldap_bind=yes
11965 else
11966   ac_cv_lib_ldap_ldap_bind=no
11967 fi
11968 rm -f core conftest.err conftest.$ac_objext \
11969     conftest$ac_exeext conftest.$ac_ext
11970 LIBS=$ac_check_lib_save_LIBS
11971 fi
11972 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
11973 $as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
11974 if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
11975   cat >>confdefs.h <<_ACEOF
11976 #define HAVE_LIBLDAP 1
11977 _ACEOF
11978
11979   LIBS="-lldap $LIBS"
11980
11981 else
11982   as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
11983 fi
11984
11985     LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
11986     if test "$enable_thread_safety" = yes; then
11987       # on some platforms ldap_r fails to link without PTHREAD_LIBS
11988       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_simple_bind in -lldap_r" >&5
11989 $as_echo_n "checking for ldap_simple_bind in -lldap_r... " >&6; }
11990 if ${ac_cv_lib_ldap_r_ldap_simple_bind+:} false; then :
11991   $as_echo_n "(cached) " >&6
11992 else
11993   ac_check_lib_save_LIBS=$LIBS
11994 LIBS="-lldap_r $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $LIBS"
11995 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11996 /* end confdefs.h.  */
11997
11998 /* Override any GCC internal prototype to avoid an error.
11999    Use char because int might match the return type of a GCC
12000    builtin and then its argument prototype would still apply.  */
12001 #ifdef __cplusplus
12002 extern "C"
12003 #endif
12004 char ldap_simple_bind ();
12005 int
12006 main ()
12007 {
12008 return ldap_simple_bind ();
12009   ;
12010   return 0;
12011 }
12012 _ACEOF
12013 if ac_fn_c_try_link "$LINENO"; then :
12014   ac_cv_lib_ldap_r_ldap_simple_bind=yes
12015 else
12016   ac_cv_lib_ldap_r_ldap_simple_bind=no
12017 fi
12018 rm -f core conftest.err conftest.$ac_objext \
12019     conftest$ac_exeext conftest.$ac_ext
12020 LIBS=$ac_check_lib_save_LIBS
12021 fi
12022 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_r_ldap_simple_bind" >&5
12023 $as_echo "$ac_cv_lib_ldap_r_ldap_simple_bind" >&6; }
12024 if test "x$ac_cv_lib_ldap_r_ldap_simple_bind" = xyes; then :
12025   cat >>confdefs.h <<_ACEOF
12026 #define HAVE_LIBLDAP_R 1
12027 _ACEOF
12028
12029   LIBS="-lldap_r $LIBS"
12030
12031 else
12032   as_fn_error $? "library 'ldap_r' is required for LDAP" "$LINENO" 5
12033 fi
12034
12035       LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS"
12036     else
12037       LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
12038     fi
12039     for ac_func in ldap_initialize
12040 do :
12041   ac_fn_c_check_func "$LINENO" "ldap_initialize" "ac_cv_func_ldap_initialize"
12042 if test "x$ac_cv_func_ldap_initialize" = xyes; then :
12043   cat >>confdefs.h <<_ACEOF
12044 #define HAVE_LDAP_INITIALIZE 1
12045 _ACEOF
12046
12047 fi
12048 done
12049
12050   else
12051     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lwldap32" >&5
12052 $as_echo_n "checking for ldap_bind in -lwldap32... " >&6; }
12053 if ${ac_cv_lib_wldap32_ldap_bind+:} false; then :
12054   $as_echo_n "(cached) " >&6
12055 else
12056   ac_check_lib_save_LIBS=$LIBS
12057 LIBS="-lwldap32  $LIBS"
12058 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12059 /* end confdefs.h.  */
12060
12061 /* Override any GCC internal prototype to avoid an error.
12062    Use char because int might match the return type of a GCC
12063    builtin and then its argument prototype would still apply.  */
12064 #ifdef __cplusplus
12065 extern "C"
12066 #endif
12067 char ldap_bind ();
12068 int
12069 main ()
12070 {
12071 return ldap_bind ();
12072   ;
12073   return 0;
12074 }
12075 _ACEOF
12076 if ac_fn_c_try_link "$LINENO"; then :
12077   ac_cv_lib_wldap32_ldap_bind=yes
12078 else
12079   ac_cv_lib_wldap32_ldap_bind=no
12080 fi
12081 rm -f core conftest.err conftest.$ac_objext \
12082     conftest$ac_exeext conftest.$ac_ext
12083 LIBS=$ac_check_lib_save_LIBS
12084 fi
12085 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wldap32_ldap_bind" >&5
12086 $as_echo "$ac_cv_lib_wldap32_ldap_bind" >&6; }
12087 if test "x$ac_cv_lib_wldap32_ldap_bind" = xyes; then :
12088   cat >>confdefs.h <<_ACEOF
12089 #define HAVE_LIBWLDAP32 1
12090 _ACEOF
12091
12092   LIBS="-lwldap32 $LIBS"
12093
12094 else
12095   as_fn_error $? "library 'wldap32' is required for LDAP" "$LINENO" 5
12096 fi
12097
12098     LDAP_LIBS_FE="-lwldap32"
12099     LDAP_LIBS_BE="-lwldap32"
12100   fi
12101   LIBS="$_LIBS"
12102 fi
12103
12104
12105
12106 # for contrib/sepgsql
12107 if test "$with_selinux" = yes; then
12108   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_compute_create_name in -lselinux" >&5
12109 $as_echo_n "checking for security_compute_create_name in -lselinux... " >&6; }
12110 if ${ac_cv_lib_selinux_security_compute_create_name+:} false; then :
12111   $as_echo_n "(cached) " >&6
12112 else
12113   ac_check_lib_save_LIBS=$LIBS
12114 LIBS="-lselinux  $LIBS"
12115 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12116 /* end confdefs.h.  */
12117
12118 /* Override any GCC internal prototype to avoid an error.
12119    Use char because int might match the return type of a GCC
12120    builtin and then its argument prototype would still apply.  */
12121 #ifdef __cplusplus
12122 extern "C"
12123 #endif
12124 char security_compute_create_name ();
12125 int
12126 main ()
12127 {
12128 return security_compute_create_name ();
12129   ;
12130   return 0;
12131 }
12132 _ACEOF
12133 if ac_fn_c_try_link "$LINENO"; then :
12134   ac_cv_lib_selinux_security_compute_create_name=yes
12135 else
12136   ac_cv_lib_selinux_security_compute_create_name=no
12137 fi
12138 rm -f core conftest.err conftest.$ac_objext \
12139     conftest$ac_exeext conftest.$ac_ext
12140 LIBS=$ac_check_lib_save_LIBS
12141 fi
12142 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_compute_create_name" >&5
12143 $as_echo "$ac_cv_lib_selinux_security_compute_create_name" >&6; }
12144 if test "x$ac_cv_lib_selinux_security_compute_create_name" = xyes; then :
12145   cat >>confdefs.h <<_ACEOF
12146 #define HAVE_LIBSELINUX 1
12147 _ACEOF
12148
12149   LIBS="-lselinux $LIBS"
12150
12151 else
12152   as_fn_error $? "library 'libselinux', version 2.1.10 or newer, is required for SELinux support" "$LINENO" 5
12153 fi
12154
12155 fi
12156
12157 # for contrib/uuid-ossp
12158 if test "$with_uuid" = bsd ; then
12159   # On BSD, the UUID functions are in libc
12160   ac_fn_c_check_func "$LINENO" "uuid_to_string" "ac_cv_func_uuid_to_string"
12161 if test "x$ac_cv_func_uuid_to_string" = xyes; then :
12162   UUID_LIBS=""
12163 else
12164   as_fn_error $? "BSD UUID functions are not present" "$LINENO" 5
12165 fi
12166
12167 elif test "$with_uuid" = e2fs ; then
12168   # On macOS, the UUID functions are in libc
12169   ac_fn_c_check_func "$LINENO" "uuid_generate" "ac_cv_func_uuid_generate"
12170 if test "x$ac_cv_func_uuid_generate" = xyes; then :
12171   UUID_LIBS=""
12172 else
12173   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5
12174 $as_echo_n "checking for uuid_generate in -luuid... " >&6; }
12175 if ${ac_cv_lib_uuid_uuid_generate+:} false; then :
12176   $as_echo_n "(cached) " >&6
12177 else
12178   ac_check_lib_save_LIBS=$LIBS
12179 LIBS="-luuid  $LIBS"
12180 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12181 /* end confdefs.h.  */
12182
12183 /* Override any GCC internal prototype to avoid an error.
12184    Use char because int might match the return type of a GCC
12185    builtin and then its argument prototype would still apply.  */
12186 #ifdef __cplusplus
12187 extern "C"
12188 #endif
12189 char uuid_generate ();
12190 int
12191 main ()
12192 {
12193 return uuid_generate ();
12194   ;
12195   return 0;
12196 }
12197 _ACEOF
12198 if ac_fn_c_try_link "$LINENO"; then :
12199   ac_cv_lib_uuid_uuid_generate=yes
12200 else
12201   ac_cv_lib_uuid_uuid_generate=no
12202 fi
12203 rm -f core conftest.err conftest.$ac_objext \
12204     conftest$ac_exeext conftest.$ac_ext
12205 LIBS=$ac_check_lib_save_LIBS
12206 fi
12207 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5
12208 $as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; }
12209 if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then :
12210   UUID_LIBS="-luuid"
12211 else
12212   as_fn_error $? "library 'uuid' is required for E2FS UUID" "$LINENO" 5
12213 fi
12214
12215 fi
12216
12217 elif test "$with_uuid" = ossp ; then
12218   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_export in -lossp-uuid" >&5
12219 $as_echo_n "checking for uuid_export in -lossp-uuid... " >&6; }
12220 if ${ac_cv_lib_ossp_uuid_uuid_export+:} false; then :
12221   $as_echo_n "(cached) " >&6
12222 else
12223   ac_check_lib_save_LIBS=$LIBS
12224 LIBS="-lossp-uuid  $LIBS"
12225 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12226 /* end confdefs.h.  */
12227
12228 /* Override any GCC internal prototype to avoid an error.
12229    Use char because int might match the return type of a GCC
12230    builtin and then its argument prototype would still apply.  */
12231 #ifdef __cplusplus
12232 extern "C"
12233 #endif
12234 char uuid_export ();
12235 int
12236 main ()
12237 {
12238 return uuid_export ();
12239   ;
12240   return 0;
12241 }
12242 _ACEOF
12243 if ac_fn_c_try_link "$LINENO"; then :
12244   ac_cv_lib_ossp_uuid_uuid_export=yes
12245 else
12246   ac_cv_lib_ossp_uuid_uuid_export=no
12247 fi
12248 rm -f core conftest.err conftest.$ac_objext \
12249     conftest$ac_exeext conftest.$ac_ext
12250 LIBS=$ac_check_lib_save_LIBS
12251 fi
12252 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossp_uuid_uuid_export" >&5
12253 $as_echo "$ac_cv_lib_ossp_uuid_uuid_export" >&6; }
12254 if test "x$ac_cv_lib_ossp_uuid_uuid_export" = xyes; then :
12255   UUID_LIBS="-lossp-uuid"
12256 else
12257   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_export in -luuid" >&5
12258 $as_echo_n "checking for uuid_export in -luuid... " >&6; }
12259 if ${ac_cv_lib_uuid_uuid_export+:} false; then :
12260   $as_echo_n "(cached) " >&6
12261 else
12262   ac_check_lib_save_LIBS=$LIBS
12263 LIBS="-luuid  $LIBS"
12264 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12265 /* end confdefs.h.  */
12266
12267 /* Override any GCC internal prototype to avoid an error.
12268    Use char because int might match the return type of a GCC
12269    builtin and then its argument prototype would still apply.  */
12270 #ifdef __cplusplus
12271 extern "C"
12272 #endif
12273 char uuid_export ();
12274 int
12275 main ()
12276 {
12277 return uuid_export ();
12278   ;
12279   return 0;
12280 }
12281 _ACEOF
12282 if ac_fn_c_try_link "$LINENO"; then :
12283   ac_cv_lib_uuid_uuid_export=yes
12284 else
12285   ac_cv_lib_uuid_uuid_export=no
12286 fi
12287 rm -f core conftest.err conftest.$ac_objext \
12288     conftest$ac_exeext conftest.$ac_ext
12289 LIBS=$ac_check_lib_save_LIBS
12290 fi
12291 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_export" >&5
12292 $as_echo "$ac_cv_lib_uuid_uuid_export" >&6; }
12293 if test "x$ac_cv_lib_uuid_uuid_export" = xyes; then :
12294   UUID_LIBS="-luuid"
12295 else
12296   as_fn_error $? "library 'ossp-uuid' or 'uuid' is required for OSSP UUID" "$LINENO" 5
12297 fi
12298
12299 fi
12300
12301 fi
12302
12303
12304
12305 ##
12306 ## Header files
12307 ##
12308
12309 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
12310 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
12311 if ${ac_cv_header_stdbool_h+:} false; then :
12312   $as_echo_n "(cached) " >&6
12313 else
12314   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12315 /* end confdefs.h.  */
12316
12317              #include <stdbool.h>
12318              #ifndef bool
12319               "error: bool is not defined"
12320              #endif
12321              #ifndef false
12322               "error: false is not defined"
12323              #endif
12324              #if false
12325               "error: false is not 0"
12326              #endif
12327              #ifndef true
12328               "error: true is not defined"
12329              #endif
12330              #if true != 1
12331               "error: true is not 1"
12332              #endif
12333              #ifndef __bool_true_false_are_defined
12334               "error: __bool_true_false_are_defined is not defined"
12335              #endif
12336
12337              struct s { _Bool s: 1; _Bool t; } s;
12338
12339              char a[true == 1 ? 1 : -1];
12340              char b[false == 0 ? 1 : -1];
12341              char c[__bool_true_false_are_defined == 1 ? 1 : -1];
12342              char d[(bool) 0.5 == true ? 1 : -1];
12343              /* See body of main program for 'e'.  */
12344              char f[(_Bool) 0.0 == false ? 1 : -1];
12345              char g[true];
12346              char h[sizeof (_Bool)];
12347              char i[sizeof s.t];
12348              enum { j = false, k = true, l = false * true, m = true * 256 };
12349              /* The following fails for
12350                 HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
12351              _Bool n[m];
12352              char o[sizeof n == m * sizeof n[0] ? 1 : -1];
12353              char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
12354              /* Catch a bug in an HP-UX C compiler.  See
12355                 http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
12356                 http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
12357               */
12358              _Bool q = true;
12359              _Bool *pq = &q;
12360
12361 int
12362 main ()
12363 {
12364
12365              bool e = &s;
12366              *pq |= q;
12367              *pq |= ! q;
12368              /* Refer to every declared value, to avoid compiler optimizations.  */
12369              return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
12370                      + !m + !n + !o + !p + !q + !pq);
12371
12372   ;
12373   return 0;
12374 }
12375 _ACEOF
12376 if ac_fn_c_try_compile "$LINENO"; then :
12377   ac_cv_header_stdbool_h=yes
12378 else
12379   ac_cv_header_stdbool_h=no
12380 fi
12381 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12382 fi
12383 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
12384 $as_echo "$ac_cv_header_stdbool_h" >&6; }
12385    ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
12386 if test "x$ac_cv_type__Bool" = xyes; then :
12387
12388 cat >>confdefs.h <<_ACEOF
12389 #define HAVE__BOOL 1
12390 _ACEOF
12391
12392
12393 fi
12394
12395
12396 if test $ac_cv_header_stdbool_h = yes; then
12397
12398 $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
12399
12400 fi
12401
12402
12403 for ac_header in atomic.h crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/ipc.h sys/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
12404 do :
12405   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
12406 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
12407 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
12408   cat >>confdefs.h <<_ACEOF
12409 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
12410 _ACEOF
12411
12412 fi
12413
12414 done
12415
12416
12417 # On BSD, test for net/if.h will fail unless sys/socket.h
12418 # is included first.
12419 for ac_header in net/if.h
12420 do :
12421   ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "$ac_includes_default
12422 #include <sys/socket.h>
12423
12424 "
12425 if test "x$ac_cv_header_net_if_h" = xyes; then :
12426   cat >>confdefs.h <<_ACEOF
12427 #define HAVE_NET_IF_H 1
12428 _ACEOF
12429
12430 fi
12431
12432 done
12433
12434
12435 # On OpenBSD, test for sys/ucred.h will fail unless sys/param.h
12436 # is included first.
12437 for ac_header in sys/ucred.h
12438 do :
12439   ac_fn_c_check_header_compile "$LINENO" "sys/ucred.h" "ac_cv_header_sys_ucred_h" "$ac_includes_default
12440 #include <sys/param.h>
12441
12442 "
12443 if test "x$ac_cv_header_sys_ucred_h" = xyes; then :
12444   cat >>confdefs.h <<_ACEOF
12445 #define HAVE_SYS_UCRED_H 1
12446 _ACEOF
12447
12448 fi
12449
12450 done
12451
12452
12453 # At least on IRIX, test for netinet/tcp.h will fail unless
12454 # netinet/in.h is included first.
12455 for ac_header in netinet/tcp.h
12456 do :
12457   ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default
12458 #include <netinet/in.h>
12459
12460 "
12461 if test "x$ac_cv_header_netinet_tcp_h" = xyes; then :
12462   cat >>confdefs.h <<_ACEOF
12463 #define HAVE_NETINET_TCP_H 1
12464 _ACEOF
12465
12466 fi
12467
12468 done
12469
12470
12471 if expr x"$pgac_cv_check_readline" : 'x-lreadline' >/dev/null ; then
12472   for ac_header in readline/readline.h
12473 do :
12474   ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
12475 if test "x$ac_cv_header_readline_readline_h" = xyes; then :
12476   cat >>confdefs.h <<_ACEOF
12477 #define HAVE_READLINE_READLINE_H 1
12478 _ACEOF
12479
12480 else
12481   for ac_header in readline.h
12482 do :
12483   ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
12484 if test "x$ac_cv_header_readline_h" = xyes; then :
12485   cat >>confdefs.h <<_ACEOF
12486 #define HAVE_READLINE_H 1
12487 _ACEOF
12488
12489 else
12490   as_fn_error $? "readline header not found
12491 If you have readline already installed, see config.log for details on the
12492 failure.  It is possible the compiler isn't looking in the proper directory.
12493 Use --without-readline to disable readline support." "$LINENO" 5
12494 fi
12495
12496 done
12497
12498 fi
12499
12500 done
12501
12502   for ac_header in readline/history.h
12503 do :
12504   ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
12505 if test "x$ac_cv_header_readline_history_h" = xyes; then :
12506   cat >>confdefs.h <<_ACEOF
12507 #define HAVE_READLINE_HISTORY_H 1
12508 _ACEOF
12509
12510 else
12511   for ac_header in history.h
12512 do :
12513   ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
12514 if test "x$ac_cv_header_history_h" = xyes; then :
12515   cat >>confdefs.h <<_ACEOF
12516 #define HAVE_HISTORY_H 1
12517 _ACEOF
12518
12519 else
12520   as_fn_error $? "history header not found
12521 If you have readline already installed, see config.log for details on the
12522 failure.  It is possible the compiler isn't looking in the proper directory.
12523 Use --without-readline to disable readline support." "$LINENO" 5
12524 fi
12525
12526 done
12527
12528 fi
12529
12530 done
12531
12532 fi
12533
12534 if expr x"$pgac_cv_check_readline" : 'x-ledit' >/dev/null ; then
12535 # Some installations of libedit usurp /usr/include/readline/, which seems
12536 # bad practice, since in combined installations readline will have its headers
12537 # there.  We might have to resort to AC_EGREP checks to make sure we found
12538 # the proper header...
12539   for ac_header in editline/readline.h
12540 do :
12541   ac_fn_c_check_header_mongrel "$LINENO" "editline/readline.h" "ac_cv_header_editline_readline_h" "$ac_includes_default"
12542 if test "x$ac_cv_header_editline_readline_h" = xyes; then :
12543   cat >>confdefs.h <<_ACEOF
12544 #define HAVE_EDITLINE_READLINE_H 1
12545 _ACEOF
12546
12547 else
12548   for ac_header in readline.h
12549 do :
12550   ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
12551 if test "x$ac_cv_header_readline_h" = xyes; then :
12552   cat >>confdefs.h <<_ACEOF
12553 #define HAVE_READLINE_H 1
12554 _ACEOF
12555
12556 else
12557   for ac_header in readline/readline.h
12558 do :
12559   ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
12560 if test "x$ac_cv_header_readline_readline_h" = xyes; then :
12561   cat >>confdefs.h <<_ACEOF
12562 #define HAVE_READLINE_READLINE_H 1
12563 _ACEOF
12564
12565 else
12566   as_fn_error $? "readline header not found
12567 If you have libedit already installed, see config.log for details on the
12568 failure.  It is possible the compiler isn't looking in the proper directory.
12569 Use --without-readline to disable libedit support." "$LINENO" 5
12570 fi
12571
12572 done
12573
12574 fi
12575
12576 done
12577
12578 fi
12579
12580 done
12581
12582 # Note: in a libedit installation, history.h is sometimes a dummy, and may
12583 # not be there at all.  Hence, don't complain if not found.  We must check
12584 # though, since in yet other versions it is an independent header.
12585   for ac_header in editline/history.h
12586 do :
12587   ac_fn_c_check_header_mongrel "$LINENO" "editline/history.h" "ac_cv_header_editline_history_h" "$ac_includes_default"
12588 if test "x$ac_cv_header_editline_history_h" = xyes; then :
12589   cat >>confdefs.h <<_ACEOF
12590 #define HAVE_EDITLINE_HISTORY_H 1
12591 _ACEOF
12592
12593 else
12594   for ac_header in history.h
12595 do :
12596   ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
12597 if test "x$ac_cv_header_history_h" = xyes; then :
12598   cat >>confdefs.h <<_ACEOF
12599 #define HAVE_HISTORY_H 1
12600 _ACEOF
12601
12602 else
12603   for ac_header in readline/history.h
12604 do :
12605   ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
12606 if test "x$ac_cv_header_readline_history_h" = xyes; then :
12607   cat >>confdefs.h <<_ACEOF
12608 #define HAVE_READLINE_HISTORY_H 1
12609 _ACEOF
12610
12611 fi
12612
12613 done
12614
12615 fi
12616
12617 done
12618
12619 fi
12620
12621 done
12622
12623 fi
12624
12625 if test "$with_zlib" = yes; then
12626   ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
12627 if test "x$ac_cv_header_zlib_h" = xyes; then :
12628
12629 else
12630   as_fn_error $? "zlib header not found
12631 If you have zlib already installed, see config.log for details on the
12632 failure.  It is possible the compiler isn't looking in the proper directory.
12633 Use --without-zlib to disable zlib support." "$LINENO" 5
12634 fi
12635
12636
12637 fi
12638
12639 if test "$with_gssapi" = yes ; then
12640   for ac_header in gssapi/gssapi.h
12641 do :
12642   ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default"
12643 if test "x$ac_cv_header_gssapi_gssapi_h" = xyes; then :
12644   cat >>confdefs.h <<_ACEOF
12645 #define HAVE_GSSAPI_GSSAPI_H 1
12646 _ACEOF
12647
12648 else
12649   for ac_header in gssapi.h
12650 do :
12651   ac_fn_c_check_header_mongrel "$LINENO" "gssapi.h" "ac_cv_header_gssapi_h" "$ac_includes_default"
12652 if test "x$ac_cv_header_gssapi_h" = xyes; then :
12653   cat >>confdefs.h <<_ACEOF
12654 #define HAVE_GSSAPI_H 1
12655 _ACEOF
12656
12657 else
12658   as_fn_error $? "gssapi.h header file is required for GSSAPI" "$LINENO" 5
12659 fi
12660
12661 done
12662
12663 fi
12664
12665 done
12666
12667 fi
12668
12669 if test "$with_openssl" = yes ; then
12670   ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default"
12671 if test "x$ac_cv_header_openssl_ssl_h" = xyes; then :
12672
12673 else
12674   as_fn_error $? "header file <openssl/ssl.h> is required for OpenSSL" "$LINENO" 5
12675 fi
12676
12677
12678   ac_fn_c_check_header_mongrel "$LINENO" "openssl/err.h" "ac_cv_header_openssl_err_h" "$ac_includes_default"
12679 if test "x$ac_cv_header_openssl_err_h" = xyes; then :
12680
12681 else
12682   as_fn_error $? "header file <openssl/err.h> is required for OpenSSL" "$LINENO" 5
12683 fi
12684
12685
12686 fi
12687
12688 if test "$with_pam" = yes ; then
12689   for ac_header in security/pam_appl.h
12690 do :
12691   ac_fn_c_check_header_mongrel "$LINENO" "security/pam_appl.h" "ac_cv_header_security_pam_appl_h" "$ac_includes_default"
12692 if test "x$ac_cv_header_security_pam_appl_h" = xyes; then :
12693   cat >>confdefs.h <<_ACEOF
12694 #define HAVE_SECURITY_PAM_APPL_H 1
12695 _ACEOF
12696
12697 else
12698   for ac_header in pam/pam_appl.h
12699 do :
12700   ac_fn_c_check_header_mongrel "$LINENO" "pam/pam_appl.h" "ac_cv_header_pam_pam_appl_h" "$ac_includes_default"
12701 if test "x$ac_cv_header_pam_pam_appl_h" = xyes; then :
12702   cat >>confdefs.h <<_ACEOF
12703 #define HAVE_PAM_PAM_APPL_H 1
12704 _ACEOF
12705
12706 else
12707   as_fn_error $? "header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM." "$LINENO" 5
12708 fi
12709
12710 done
12711
12712 fi
12713
12714 done
12715
12716 fi
12717
12718 if test "$with_bsd_auth" = yes ; then
12719   ac_fn_c_check_header_mongrel "$LINENO" "bsd_auth.h" "ac_cv_header_bsd_auth_h" "$ac_includes_default"
12720 if test "x$ac_cv_header_bsd_auth_h" = xyes; then :
12721
12722 else
12723   as_fn_error $? "header file <bsd_auth.h> is required for BSD Authentication support" "$LINENO" 5
12724 fi
12725
12726
12727 fi
12728
12729 if test "$with_systemd" = yes ; then
12730   ac_fn_c_check_header_mongrel "$LINENO" "systemd/sd-daemon.h" "ac_cv_header_systemd_sd_daemon_h" "$ac_includes_default"
12731 if test "x$ac_cv_header_systemd_sd_daemon_h" = xyes; then :
12732
12733 else
12734   as_fn_error $? "header file <systemd/sd-daemon.h> is required for systemd support" "$LINENO" 5
12735 fi
12736
12737
12738 fi
12739
12740 if test "$with_libxml" = yes ; then
12741   ac_fn_c_check_header_mongrel "$LINENO" "libxml/parser.h" "ac_cv_header_libxml_parser_h" "$ac_includes_default"
12742 if test "x$ac_cv_header_libxml_parser_h" = xyes; then :
12743
12744 else
12745   as_fn_error $? "header file <libxml/parser.h> is required for XML support" "$LINENO" 5
12746 fi
12747
12748
12749 fi
12750
12751 if test "$with_libxslt" = yes ; then
12752   ac_fn_c_check_header_mongrel "$LINENO" "libxslt/xslt.h" "ac_cv_header_libxslt_xslt_h" "$ac_includes_default"
12753 if test "x$ac_cv_header_libxslt_xslt_h" = xyes; then :
12754
12755 else
12756   as_fn_error $? "header file <libxslt/xslt.h> is required for XSLT support" "$LINENO" 5
12757 fi
12758
12759
12760 fi
12761
12762 if test "$with_ldap" = yes ; then
12763   if test "$PORTNAME" != "win32"; then
12764      for ac_header in ldap.h
12765 do :
12766   ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default"
12767 if test "x$ac_cv_header_ldap_h" = xyes; then :
12768   cat >>confdefs.h <<_ACEOF
12769 #define HAVE_LDAP_H 1
12770 _ACEOF
12771
12772 else
12773   as_fn_error $? "header file <ldap.h> is required for LDAP" "$LINENO" 5
12774 fi
12775
12776 done
12777
12778      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compatible LDAP implementation" >&5
12779 $as_echo_n "checking for compatible LDAP implementation... " >&6; }
12780 if ${pgac_cv_ldap_safe+:} false; then :
12781   $as_echo_n "(cached) " >&6
12782 else
12783   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12784 /* end confdefs.h.  */
12785 #include <ldap.h>
12786 #if !defined(LDAP_VENDOR_VERSION) || \
12787      (defined(LDAP_API_FEATURE_X_OPENLDAP) && \
12788       LDAP_VENDOR_VERSION >= 20424 && LDAP_VENDOR_VERSION <= 20431)
12789 choke me
12790 #endif
12791 int
12792 main ()
12793 {
12794
12795   ;
12796   return 0;
12797 }
12798 _ACEOF
12799 if ac_fn_c_try_compile "$LINENO"; then :
12800   pgac_cv_ldap_safe=yes
12801 else
12802   pgac_cv_ldap_safe=no
12803 fi
12804 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12805 fi
12806 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_ldap_safe" >&5
12807 $as_echo "$pgac_cv_ldap_safe" >&6; }
12808
12809 if test "$pgac_cv_ldap_safe" != yes; then
12810   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
12811 *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
12812 *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
12813 *** also uses LDAP will crash on exit." >&5
12814 $as_echo "$as_me: WARNING:
12815 *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
12816 *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
12817 *** also uses LDAP will crash on exit." >&2;}
12818 fi
12819   else
12820      for ac_header in winldap.h
12821 do :
12822   ac_fn_c_check_header_compile "$LINENO" "winldap.h" "ac_cv_header_winldap_h" "$ac_includes_default
12823 #include <windows.h>
12824
12825 "
12826 if test "x$ac_cv_header_winldap_h" = xyes; then :
12827   cat >>confdefs.h <<_ACEOF
12828 #define HAVE_WINLDAP_H 1
12829 _ACEOF
12830
12831 else
12832   as_fn_error $? "header file <winldap.h> is required for LDAP" "$LINENO" 5
12833 fi
12834
12835 done
12836
12837   fi
12838 fi
12839
12840 if test "$with_bonjour" = yes ; then
12841   ac_fn_c_check_header_mongrel "$LINENO" "dns_sd.h" "ac_cv_header_dns_sd_h" "$ac_includes_default"
12842 if test "x$ac_cv_header_dns_sd_h" = xyes; then :
12843
12844 else
12845   as_fn_error $? "header file <dns_sd.h> is required for Bonjour" "$LINENO" 5
12846 fi
12847
12848
12849 fi
12850
12851 # for contrib/uuid-ossp
12852 if test "$with_uuid" = bsd ; then
12853   for ac_header in uuid.h
12854 do :
12855   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
12856 if test "x$ac_cv_header_uuid_h" = xyes; then :
12857   cat >>confdefs.h <<_ACEOF
12858 #define HAVE_UUID_H 1
12859 _ACEOF
12860  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12861 /* end confdefs.h.  */
12862 #include <uuid.h>
12863
12864 _ACEOF
12865 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12866   $EGREP "uuid_to_string" >/dev/null 2>&1; then :
12867
12868 else
12869   as_fn_error $? "header file <uuid.h> does not match BSD UUID library" "$LINENO" 5
12870 fi
12871 rm -f conftest*
12872
12873 else
12874   as_fn_error $? "header file <uuid.h> is required for BSD UUID" "$LINENO" 5
12875 fi
12876
12877 done
12878
12879 elif test "$with_uuid" = e2fs ; then
12880   for ac_header in uuid/uuid.h
12881 do :
12882   ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
12883 if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
12884   cat >>confdefs.h <<_ACEOF
12885 #define HAVE_UUID_UUID_H 1
12886 _ACEOF
12887  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12888 /* end confdefs.h.  */
12889 #include <uuid/uuid.h>
12890
12891 _ACEOF
12892 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12893   $EGREP "uuid_generate" >/dev/null 2>&1; then :
12894
12895 else
12896   as_fn_error $? "header file <uuid/uuid.h> does not match E2FS UUID library" "$LINENO" 5
12897 fi
12898 rm -f conftest*
12899
12900 else
12901   for ac_header in uuid.h
12902 do :
12903   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
12904 if test "x$ac_cv_header_uuid_h" = xyes; then :
12905   cat >>confdefs.h <<_ACEOF
12906 #define HAVE_UUID_H 1
12907 _ACEOF
12908  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12909 /* end confdefs.h.  */
12910 #include <uuid.h>
12911
12912 _ACEOF
12913 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12914   $EGREP "uuid_generate" >/dev/null 2>&1; then :
12915
12916 else
12917   as_fn_error $? "header file <uuid.h> does not match E2FS UUID library" "$LINENO" 5
12918 fi
12919 rm -f conftest*
12920
12921 else
12922   as_fn_error $? "header file <uuid/uuid.h> or <uuid.h> is required for E2FS UUID" "$LINENO" 5
12923 fi
12924
12925 done
12926
12927 fi
12928
12929 done
12930
12931 elif test "$with_uuid" = ossp ; then
12932   for ac_header in ossp/uuid.h
12933 do :
12934   ac_fn_c_check_header_mongrel "$LINENO" "ossp/uuid.h" "ac_cv_header_ossp_uuid_h" "$ac_includes_default"
12935 if test "x$ac_cv_header_ossp_uuid_h" = xyes; then :
12936   cat >>confdefs.h <<_ACEOF
12937 #define HAVE_OSSP_UUID_H 1
12938 _ACEOF
12939  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12940 /* end confdefs.h.  */
12941 #include <ossp/uuid.h>
12942
12943 _ACEOF
12944 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12945   $EGREP "uuid_export" >/dev/null 2>&1; then :
12946
12947 else
12948   as_fn_error $? "header file <ossp/uuid.h> does not match OSSP UUID library" "$LINENO" 5
12949 fi
12950 rm -f conftest*
12951
12952 else
12953   for ac_header in uuid.h
12954 do :
12955   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
12956 if test "x$ac_cv_header_uuid_h" = xyes; then :
12957   cat >>confdefs.h <<_ACEOF
12958 #define HAVE_UUID_H 1
12959 _ACEOF
12960  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12961 /* end confdefs.h.  */
12962 #include <uuid.h>
12963
12964 _ACEOF
12965 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12966   $EGREP "uuid_export" >/dev/null 2>&1; then :
12967
12968 else
12969   as_fn_error $? "header file <uuid.h> does not match OSSP UUID library" "$LINENO" 5
12970 fi
12971 rm -f conftest*
12972
12973 else
12974   as_fn_error $? "header file <ossp/uuid.h> or <uuid.h> is required for OSSP UUID" "$LINENO" 5
12975 fi
12976
12977 done
12978
12979 fi
12980
12981 done
12982
12983 fi
12984
12985 if test "$PORTNAME" = "win32" ; then
12986    for ac_header in crtdefs.h
12987 do :
12988   ac_fn_c_check_header_mongrel "$LINENO" "crtdefs.h" "ac_cv_header_crtdefs_h" "$ac_includes_default"
12989 if test "x$ac_cv_header_crtdefs_h" = xyes; then :
12990   cat >>confdefs.h <<_ACEOF
12991 #define HAVE_CRTDEFS_H 1
12992 _ACEOF
12993
12994 fi
12995
12996 done
12997
12998 fi
12999
13000 ##
13001 ## Types, structures, compiler characteristics
13002 ##
13003
13004   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
13005 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
13006 if ${ac_cv_c_bigendian+:} false; then :
13007   $as_echo_n "(cached) " >&6
13008 else
13009   ac_cv_c_bigendian=unknown
13010     # See if we're dealing with a universal compiler.
13011     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13012 /* end confdefs.h.  */
13013 #ifndef __APPLE_CC__
13014                not a universal capable compiler
13015              #endif
13016              typedef int dummy;
13017
13018 _ACEOF
13019 if ac_fn_c_try_compile "$LINENO"; then :
13020
13021         # Check for potential -arch flags.  It is not universal unless
13022         # there are at least two -arch flags with different values.
13023         ac_arch=
13024         ac_prev=
13025         for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
13026          if test -n "$ac_prev"; then
13027            case $ac_word in
13028              i?86 | x86_64 | ppc | ppc64)
13029                if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
13030                  ac_arch=$ac_word
13031                else
13032                  ac_cv_c_bigendian=universal
13033                  break
13034                fi
13035                ;;
13036            esac
13037            ac_prev=
13038          elif test "x$ac_word" = "x-arch"; then
13039            ac_prev=arch
13040          fi
13041        done
13042 fi
13043 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13044     if test $ac_cv_c_bigendian = unknown; then
13045       # See if sys/param.h defines the BYTE_ORDER macro.
13046       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13047 /* end confdefs.h.  */
13048 #include <sys/types.h>
13049              #include <sys/param.h>
13050
13051 int
13052 main ()
13053 {
13054 #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
13055                      && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
13056                      && LITTLE_ENDIAN)
13057               bogus endian macros
13058              #endif
13059
13060   ;
13061   return 0;
13062 }
13063 _ACEOF
13064 if ac_fn_c_try_compile "$LINENO"; then :
13065   # It does; now see whether it defined to BIG_ENDIAN or not.
13066          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13067 /* end confdefs.h.  */
13068 #include <sys/types.h>
13069                 #include <sys/param.h>
13070
13071 int
13072 main ()
13073 {
13074 #if BYTE_ORDER != BIG_ENDIAN
13075                  not big endian
13076                 #endif
13077
13078   ;
13079   return 0;
13080 }
13081 _ACEOF
13082 if ac_fn_c_try_compile "$LINENO"; then :
13083   ac_cv_c_bigendian=yes
13084 else
13085   ac_cv_c_bigendian=no
13086 fi
13087 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13088 fi
13089 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13090     fi
13091     if test $ac_cv_c_bigendian = unknown; then
13092       # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
13093       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13094 /* end confdefs.h.  */
13095 #include <limits.h>
13096
13097 int
13098 main ()
13099 {
13100 #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
13101               bogus endian macros
13102              #endif
13103
13104   ;
13105   return 0;
13106 }
13107 _ACEOF
13108 if ac_fn_c_try_compile "$LINENO"; then :
13109   # It does; now see whether it defined to _BIG_ENDIAN or not.
13110          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13111 /* end confdefs.h.  */
13112 #include <limits.h>
13113
13114 int
13115 main ()
13116 {
13117 #ifndef _BIG_ENDIAN
13118                  not big endian
13119                 #endif
13120
13121   ;
13122   return 0;
13123 }
13124 _ACEOF
13125 if ac_fn_c_try_compile "$LINENO"; then :
13126   ac_cv_c_bigendian=yes
13127 else
13128   ac_cv_c_bigendian=no
13129 fi
13130 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13131 fi
13132 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13133     fi
13134     if test $ac_cv_c_bigendian = unknown; then
13135       # Compile a test program.
13136       if test "$cross_compiling" = yes; then :
13137   # Try to guess by grepping values from an object file.
13138          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13139 /* end confdefs.h.  */
13140 short int ascii_mm[] =
13141                   { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
13142                 short int ascii_ii[] =
13143                   { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
13144                 int use_ascii (int i) {
13145                   return ascii_mm[i] + ascii_ii[i];
13146                 }
13147                 short int ebcdic_ii[] =
13148                   { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
13149                 short int ebcdic_mm[] =
13150                   { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
13151                 int use_ebcdic (int i) {
13152                   return ebcdic_mm[i] + ebcdic_ii[i];
13153                 }
13154                 extern int foo;
13155
13156 int
13157 main ()
13158 {
13159 return use_ascii (foo) == use_ebcdic (foo);
13160   ;
13161   return 0;
13162 }
13163 _ACEOF
13164 if ac_fn_c_try_compile "$LINENO"; then :
13165   if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
13166               ac_cv_c_bigendian=yes
13167             fi
13168             if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
13169               if test "$ac_cv_c_bigendian" = unknown; then
13170                 ac_cv_c_bigendian=no
13171               else
13172                 # finding both strings is unlikely to happen, but who knows?
13173                 ac_cv_c_bigendian=unknown
13174               fi
13175             fi
13176 fi
13177 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13178 else
13179   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13180 /* end confdefs.h.  */
13181 $ac_includes_default
13182 int
13183 main ()
13184 {
13185
13186              /* Are we little or big endian?  From Harbison&Steele.  */
13187              union
13188              {
13189                long int l;
13190                char c[sizeof (long int)];
13191              } u;
13192              u.l = 1;
13193              return u.c[sizeof (long int) - 1] == 1;
13194
13195   ;
13196   return 0;
13197 }
13198 _ACEOF
13199 if ac_fn_c_try_run "$LINENO"; then :
13200   ac_cv_c_bigendian=no
13201 else
13202   ac_cv_c_bigendian=yes
13203 fi
13204 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13205   conftest.$ac_objext conftest.beam conftest.$ac_ext
13206 fi
13207
13208     fi
13209 fi
13210 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
13211 $as_echo "$ac_cv_c_bigendian" >&6; }
13212  case $ac_cv_c_bigendian in #(
13213    yes)
13214      $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
13215 ;; #(
13216    no)
13217       ;; #(
13218    universal)
13219
13220 $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
13221
13222      ;; #(
13223    *)
13224      as_fn_error $? "unknown endianness
13225  presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
13226  esac
13227
13228 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
13229 $as_echo_n "checking for inline... " >&6; }
13230 if ${ac_cv_c_inline+:} false; then :
13231   $as_echo_n "(cached) " >&6
13232 else
13233   ac_cv_c_inline=no
13234 for ac_kw in inline __inline__ __inline; do
13235   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13236 /* end confdefs.h.  */
13237 #ifndef __cplusplus
13238 typedef int foo_t;
13239 static $ac_kw foo_t static_foo () {return 0; }
13240 $ac_kw foo_t foo () {return 0; }
13241 #endif
13242
13243 _ACEOF
13244 if ac_fn_c_try_compile "$LINENO"; then :
13245   ac_cv_c_inline=$ac_kw
13246 fi
13247 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13248   test "$ac_cv_c_inline" != no && break
13249 done
13250
13251 fi
13252 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
13253 $as_echo "$ac_cv_c_inline" >&6; }
13254
13255 case $ac_cv_c_inline in
13256   inline | yes) ;;
13257   *)
13258     case $ac_cv_c_inline in
13259       no) ac_val=;;
13260       *) ac_val=$ac_cv_c_inline;;
13261     esac
13262     cat >>confdefs.h <<_ACEOF
13263 #ifndef __cplusplus
13264 #define inline $ac_val
13265 #endif
13266 _ACEOF
13267     ;;
13268 esac
13269
13270 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf format archetype" >&5
13271 $as_echo_n "checking for printf format archetype... " >&6; }
13272 if ${pgac_cv_printf_archetype+:} false; then :
13273   $as_echo_n "(cached) " >&6
13274 else
13275   ac_save_c_werror_flag=$ac_c_werror_flag
13276 ac_c_werror_flag=yes
13277 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13278 /* end confdefs.h.  */
13279 extern int
13280 pgac_write(int ignore, const char *fmt,...)
13281 __attribute__((format(gnu_printf, 2, 3)));
13282 int
13283 main ()
13284 {
13285
13286   ;
13287   return 0;
13288 }
13289 _ACEOF
13290 if ac_fn_c_try_compile "$LINENO"; then :
13291   pgac_cv_printf_archetype=gnu_printf
13292 else
13293   pgac_cv_printf_archetype=printf
13294 fi
13295 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13296 ac_c_werror_flag=$ac_save_c_werror_flag
13297 fi
13298 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_printf_archetype" >&5
13299 $as_echo "$pgac_cv_printf_archetype" >&6; }
13300
13301 cat >>confdefs.h <<_ACEOF
13302 #define PG_PRINTF_ATTRIBUTE $pgac_cv_printf_archetype
13303 _ACEOF
13304
13305
13306
13307   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array members" >&5
13308 $as_echo_n "checking for flexible array members... " >&6; }
13309 if ${ac_cv_c_flexmember+:} false; then :
13310   $as_echo_n "(cached) " >&6
13311 else
13312   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13313 /* end confdefs.h.  */
13314 #include <stdlib.h>
13315             #include <stdio.h>
13316             #include <stddef.h>
13317             struct s { int n; double d[]; };
13318 int
13319 main ()
13320 {
13321 int m = getchar ();
13322             struct s *p = malloc (offsetof (struct s, d)
13323                                   + m * sizeof (double));
13324             p->d[0] = 0.0;
13325             return p->d != (double *) NULL;
13326   ;
13327   return 0;
13328 }
13329 _ACEOF
13330 if ac_fn_c_try_compile "$LINENO"; then :
13331   ac_cv_c_flexmember=yes
13332 else
13333   ac_cv_c_flexmember=no
13334 fi
13335 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13336 fi
13337 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
13338 $as_echo "$ac_cv_c_flexmember" >&6; }
13339   if test $ac_cv_c_flexmember = yes; then
13340
13341 $as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
13342
13343   else
13344     $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
13345
13346   fi
13347
13348 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed types" >&5
13349 $as_echo_n "checking for signed types... " >&6; }
13350 if ${pgac_cv_c_signed+:} false; then :
13351   $as_echo_n "(cached) " >&6
13352 else
13353   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13354 /* end confdefs.h.  */
13355
13356 int
13357 main ()
13358 {
13359 signed char c; signed short s; signed int i;
13360   ;
13361   return 0;
13362 }
13363 _ACEOF
13364 if ac_fn_c_try_compile "$LINENO"; then :
13365   pgac_cv_c_signed=yes
13366 else
13367   pgac_cv_c_signed=no
13368 fi
13369 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13370 fi
13371 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_signed" >&5
13372 $as_echo "$pgac_cv_c_signed" >&6; }
13373 if test x"$pgac_cv_c_signed" = xno ; then
13374
13375 $as_echo "#define signed /**/" >>confdefs.h
13376
13377 fi
13378 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __func__" >&5
13379 $as_echo_n "checking for __func__... " >&6; }
13380 if ${pgac_cv_funcname_func_support+:} false; then :
13381   $as_echo_n "(cached) " >&6
13382 else
13383   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13384 /* end confdefs.h.  */
13385 #include <stdio.h>
13386 int
13387 main ()
13388 {
13389 printf("%s\n", __func__);
13390   ;
13391   return 0;
13392 }
13393 _ACEOF
13394 if ac_fn_c_try_compile "$LINENO"; then :
13395   pgac_cv_funcname_func_support=yes
13396 else
13397   pgac_cv_funcname_func_support=no
13398 fi
13399 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13400 fi
13401 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_func_support" >&5
13402 $as_echo "$pgac_cv_funcname_func_support" >&6; }
13403 if test x"$pgac_cv_funcname_func_support" = xyes ; then
13404
13405 $as_echo "#define HAVE_FUNCNAME__FUNC 1" >>confdefs.h
13406
13407 else
13408 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __FUNCTION__" >&5
13409 $as_echo_n "checking for __FUNCTION__... " >&6; }
13410 if ${pgac_cv_funcname_function_support+:} false; then :
13411   $as_echo_n "(cached) " >&6
13412 else
13413   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13414 /* end confdefs.h.  */
13415 #include <stdio.h>
13416 int
13417 main ()
13418 {
13419 printf("%s\n", __FUNCTION__);
13420   ;
13421   return 0;
13422 }
13423 _ACEOF
13424 if ac_fn_c_try_compile "$LINENO"; then :
13425   pgac_cv_funcname_function_support=yes
13426 else
13427   pgac_cv_funcname_function_support=no
13428 fi
13429 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13430 fi
13431 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_function_support" >&5
13432 $as_echo "$pgac_cv_funcname_function_support" >&6; }
13433 if test x"$pgac_cv_funcname_function_support" = xyes ; then
13434
13435 $as_echo "#define HAVE_FUNCNAME__FUNCTION 1" >>confdefs.h
13436
13437 fi
13438 fi
13439 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Static_assert" >&5
13440 $as_echo_n "checking for _Static_assert... " >&6; }
13441 if ${pgac_cv__static_assert+:} false; then :
13442   $as_echo_n "(cached) " >&6
13443 else
13444   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13445 /* end confdefs.h.  */
13446
13447 int
13448 main ()
13449 {
13450 ({ _Static_assert(1, "foo"); })
13451   ;
13452   return 0;
13453 }
13454 _ACEOF
13455 if ac_fn_c_try_link "$LINENO"; then :
13456   pgac_cv__static_assert=yes
13457 else
13458   pgac_cv__static_assert=no
13459 fi
13460 rm -f core conftest.err conftest.$ac_objext \
13461     conftest$ac_exeext conftest.$ac_ext
13462 fi
13463 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__static_assert" >&5
13464 $as_echo "$pgac_cv__static_assert" >&6; }
13465 if test x"$pgac_cv__static_assert" = xyes ; then
13466
13467 $as_echo "#define HAVE__STATIC_ASSERT 1" >>confdefs.h
13468
13469 fi
13470 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for typeof" >&5
13471 $as_echo_n "checking for typeof... " >&6; }
13472 if ${pgac_cv_c_typeof+:} false; then :
13473   $as_echo_n "(cached) " >&6
13474 else
13475   pgac_cv_c_typeof=no
13476 for pgac_kw in typeof __typeof__ decltype; do
13477   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13478 /* end confdefs.h.  */
13479
13480 int
13481 main ()
13482 {
13483 int x = 0;
13484 $pgac_kw(x) y;
13485 y = x;
13486 return y;
13487   ;
13488   return 0;
13489 }
13490 _ACEOF
13491 if ac_fn_c_try_compile "$LINENO"; then :
13492   pgac_cv_c_typeof=$pgac_kw
13493 fi
13494 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13495   test "$pgac_cv_c_typeof" != no && break
13496 done
13497 fi
13498 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_typeof" >&5
13499 $as_echo "$pgac_cv_c_typeof" >&6; }
13500 if test "$pgac_cv_c_typeof" != no; then
13501
13502 $as_echo "#define HAVE_TYPEOF 1" >>confdefs.h
13503
13504   if test "$pgac_cv_c_typeof" != typeof; then
13505
13506 cat >>confdefs.h <<_ACEOF
13507 #define typeof $pgac_cv_c_typeof
13508 _ACEOF
13509
13510   fi
13511 fi
13512 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_types_compatible_p" >&5
13513 $as_echo_n "checking for __builtin_types_compatible_p... " >&6; }
13514 if ${pgac_cv__types_compatible+:} false; then :
13515   $as_echo_n "(cached) " >&6
13516 else
13517   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13518 /* end confdefs.h.  */
13519
13520 int
13521 main ()
13522 {
13523  int x; static int y[__builtin_types_compatible_p(__typeof__(x), int)];
13524   ;
13525   return 0;
13526 }
13527 _ACEOF
13528 if ac_fn_c_try_compile "$LINENO"; then :
13529   pgac_cv__types_compatible=yes
13530 else
13531   pgac_cv__types_compatible=no
13532 fi
13533 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13534 fi
13535 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__types_compatible" >&5
13536 $as_echo "$pgac_cv__types_compatible" >&6; }
13537 if test x"$pgac_cv__types_compatible" = xyes ; then
13538
13539 $as_echo "#define HAVE__BUILTIN_TYPES_COMPATIBLE_P 1" >>confdefs.h
13540
13541 fi
13542 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap16" >&5
13543 $as_echo_n "checking for __builtin_bswap16... " >&6; }
13544 if ${pgac_cv__builtin_bswap16+:} false; then :
13545   $as_echo_n "(cached) " >&6
13546 else
13547   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13548 /* end confdefs.h.  */
13549 static unsigned long int x = __builtin_bswap16(0xaabb);
13550
13551 _ACEOF
13552 if ac_fn_c_try_compile "$LINENO"; then :
13553   pgac_cv__builtin_bswap16=yes
13554 else
13555   pgac_cv__builtin_bswap16=no
13556 fi
13557 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13558 fi
13559 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_bswap16" >&5
13560 $as_echo "$pgac_cv__builtin_bswap16" >&6; }
13561 if test x"$pgac_cv__builtin_bswap16" = xyes ; then
13562
13563 $as_echo "#define HAVE__BUILTIN_BSWAP16 1" >>confdefs.h
13564
13565 fi
13566 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap32" >&5
13567 $as_echo_n "checking for __builtin_bswap32... " >&6; }
13568 if ${pgac_cv__builtin_bswap32+:} false; then :
13569   $as_echo_n "(cached) " >&6
13570 else
13571   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13572 /* end confdefs.h.  */
13573 static unsigned long int x = __builtin_bswap32(0xaabbccdd);
13574
13575 _ACEOF
13576 if ac_fn_c_try_compile "$LINENO"; then :
13577   pgac_cv__builtin_bswap32=yes
13578 else
13579   pgac_cv__builtin_bswap32=no
13580 fi
13581 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13582 fi
13583 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_bswap32" >&5
13584 $as_echo "$pgac_cv__builtin_bswap32" >&6; }
13585 if test x"$pgac_cv__builtin_bswap32" = xyes ; then
13586
13587 $as_echo "#define HAVE__BUILTIN_BSWAP32 1" >>confdefs.h
13588
13589 fi
13590 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap64" >&5
13591 $as_echo_n "checking for __builtin_bswap64... " >&6; }
13592 if ${pgac_cv__builtin_bswap64+:} false; then :
13593   $as_echo_n "(cached) " >&6
13594 else
13595   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13596 /* end confdefs.h.  */
13597 static unsigned long int x = __builtin_bswap64(0xaabbccddeeff0011);
13598
13599 _ACEOF
13600 if ac_fn_c_try_compile "$LINENO"; then :
13601   pgac_cv__builtin_bswap64=yes
13602 else
13603   pgac_cv__builtin_bswap64=no
13604 fi
13605 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13606 fi
13607 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_bswap64" >&5
13608 $as_echo "$pgac_cv__builtin_bswap64" >&6; }
13609 if test x"$pgac_cv__builtin_bswap64" = xyes ; then
13610
13611 $as_echo "#define HAVE__BUILTIN_BSWAP64 1" >>confdefs.h
13612
13613 fi
13614 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_constant_p" >&5
13615 $as_echo_n "checking for __builtin_constant_p... " >&6; }
13616 if ${pgac_cv__builtin_constant_p+:} false; then :
13617   $as_echo_n "(cached) " >&6
13618 else
13619   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13620 /* end confdefs.h.  */
13621 static int x;
13622   static int y[__builtin_constant_p(x) ? x : 1];
13623   static int z[__builtin_constant_p("string literal") ? 1 : x];
13624
13625
13626 _ACEOF
13627 if ac_fn_c_try_compile "$LINENO"; then :
13628   pgac_cv__builtin_constant_p=yes
13629 else
13630   pgac_cv__builtin_constant_p=no
13631 fi
13632 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13633 fi
13634 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_constant_p" >&5
13635 $as_echo "$pgac_cv__builtin_constant_p" >&6; }
13636 if test x"$pgac_cv__builtin_constant_p" = xyes ; then
13637
13638 $as_echo "#define HAVE__BUILTIN_CONSTANT_P 1" >>confdefs.h
13639
13640 fi
13641 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_unreachable" >&5
13642 $as_echo_n "checking for __builtin_unreachable... " >&6; }
13643 if ${pgac_cv__builtin_unreachable+:} false; then :
13644   $as_echo_n "(cached) " >&6
13645 else
13646   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13647 /* end confdefs.h.  */
13648
13649 int
13650 main ()
13651 {
13652 __builtin_unreachable();
13653   ;
13654   return 0;
13655 }
13656 _ACEOF
13657 if ac_fn_c_try_link "$LINENO"; then :
13658   pgac_cv__builtin_unreachable=yes
13659 else
13660   pgac_cv__builtin_unreachable=no
13661 fi
13662 rm -f core conftest.err conftest.$ac_objext \
13663     conftest$ac_exeext conftest.$ac_ext
13664 fi
13665 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_unreachable" >&5
13666 $as_echo "$pgac_cv__builtin_unreachable" >&6; }
13667 if test x"$pgac_cv__builtin_unreachable" = xyes ; then
13668
13669 $as_echo "#define HAVE__BUILTIN_UNREACHABLE 1" >>confdefs.h
13670
13671 fi
13672 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for computed goto support" >&5
13673 $as_echo_n "checking for computed goto support... " >&6; }
13674 if ${pgac_cv_computed_goto+:} false; then :
13675   $as_echo_n "(cached) " >&6
13676 else
13677   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13678 /* end confdefs.h.  */
13679
13680 int
13681 main ()
13682 {
13683 void *labeladdrs[] = {&&my_label};
13684   goto *labeladdrs[0];
13685   my_label:
13686   return 1;
13687
13688   ;
13689   return 0;
13690 }
13691 _ACEOF
13692 if ac_fn_c_try_compile "$LINENO"; then :
13693   pgac_cv_computed_goto=yes
13694 else
13695   pgac_cv_computed_goto=no
13696 fi
13697 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13698 fi
13699 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_computed_goto" >&5
13700 $as_echo "$pgac_cv_computed_goto" >&6; }
13701 if test x"$pgac_cv_computed_goto" = xyes ; then
13702
13703 $as_echo "#define HAVE_COMPUTED_GOTO 1" >>confdefs.h
13704
13705 fi
13706 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __VA_ARGS__" >&5
13707 $as_echo_n "checking for __VA_ARGS__... " >&6; }
13708 if ${pgac_cv__va_args+:} false; then :
13709   $as_echo_n "(cached) " >&6
13710 else
13711   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13712 /* end confdefs.h.  */
13713 #include <stdio.h>
13714 int
13715 main ()
13716 {
13717 #define debug(...) fprintf(stderr, __VA_ARGS__)
13718 debug("%s", "blarg");
13719
13720   ;
13721   return 0;
13722 }
13723 _ACEOF
13724 if ac_fn_c_try_compile "$LINENO"; then :
13725   pgac_cv__va_args=yes
13726 else
13727   pgac_cv__va_args=no
13728 fi
13729 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13730 fi
13731 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__va_args" >&5
13732 $as_echo "$pgac_cv__va_args" >&6; }
13733 if test x"$pgac_cv__va_args" = xyes ; then
13734
13735 $as_echo "#define HAVE__VA_ARGS 1" >>confdefs.h
13736
13737 fi
13738 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
13739 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
13740 if ${ac_cv_struct_tm+:} false; then :
13741   $as_echo_n "(cached) " >&6
13742 else
13743   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13744 /* end confdefs.h.  */
13745 #include <sys/types.h>
13746 #include <time.h>
13747
13748 int
13749 main ()
13750 {
13751 struct tm tm;
13752                                      int *p = &tm.tm_sec;
13753                                      return !p;
13754   ;
13755   return 0;
13756 }
13757 _ACEOF
13758 if ac_fn_c_try_compile "$LINENO"; then :
13759   ac_cv_struct_tm=time.h
13760 else
13761   ac_cv_struct_tm=sys/time.h
13762 fi
13763 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13764 fi
13765 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
13766 $as_echo "$ac_cv_struct_tm" >&6; }
13767 if test $ac_cv_struct_tm = sys/time.h; then
13768
13769 $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
13770
13771 fi
13772
13773 ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h>
13774 #include <$ac_cv_struct_tm>
13775
13776 "
13777 if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
13778
13779 cat >>confdefs.h <<_ACEOF
13780 #define HAVE_STRUCT_TM_TM_ZONE 1
13781 _ACEOF
13782
13783
13784 fi
13785
13786 if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
13787
13788 $as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h
13789
13790 fi
13791 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
13792 $as_echo_n "checking for tzname... " >&6; }
13793 if ${ac_cv_var_tzname+:} false; then :
13794   $as_echo_n "(cached) " >&6
13795 else
13796   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13797 /* end confdefs.h.  */
13798 #include <stdlib.h>
13799 #include <time.h>
13800 #ifndef tzname /* For SGI.  */
13801 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
13802 #endif
13803
13804 int
13805 main ()
13806 {
13807 atoi(*tzname);
13808   ;
13809   return 0;
13810 }
13811 _ACEOF
13812 if ac_fn_c_try_link "$LINENO"; then :
13813   ac_cv_var_tzname=yes
13814 else
13815   ac_cv_var_tzname=no
13816 fi
13817 rm -f core conftest.err conftest.$ac_objext \
13818     conftest$ac_exeext conftest.$ac_ext
13819 fi
13820 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5
13821 $as_echo "$ac_cv_var_tzname" >&6; }
13822 if test $ac_cv_var_tzname = yes; then
13823
13824 $as_echo "#define HAVE_TZNAME 1" >>confdefs.h
13825
13826 fi
13827
13828 ac_fn_c_check_type "$LINENO" "union semun" "ac_cv_type_union_semun" "#include <sys/types.h>
13829 #ifdef HAVE_SYS_IPC_H
13830 #include <sys/ipc.h>
13831 #endif
13832 #ifdef HAVE_SYS_SEM_H
13833 #include <sys/sem.h>
13834 #endif
13835 "
13836 if test "x$ac_cv_type_union_semun" = xyes; then :
13837
13838 cat >>confdefs.h <<_ACEOF
13839 #define HAVE_UNION_SEMUN 1
13840 _ACEOF
13841
13842
13843 fi
13844
13845 ac_fn_c_check_type "$LINENO" "struct sockaddr_un" "ac_cv_type_struct_sockaddr_un" "#include <sys/types.h>
13846 #ifdef HAVE_SYS_UN_H
13847 #include <sys/un.h>
13848 #endif
13849
13850 "
13851 if test "x$ac_cv_type_struct_sockaddr_un" = xyes; then :
13852
13853 $as_echo "#define HAVE_UNIX_SOCKETS 1" >>confdefs.h
13854
13855 fi
13856
13857 ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include <sys/types.h>
13858 #include <sys/socket.h>
13859
13860 "
13861 if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
13862
13863 cat >>confdefs.h <<_ACEOF
13864 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
13865 _ACEOF
13866
13867
13868 fi
13869
13870 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
13871 #include <sys/socket.h>
13872
13873 "
13874 if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
13875
13876 cat >>confdefs.h <<_ACEOF
13877 #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
13878 _ACEOF
13879
13880
13881 fi
13882 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_family" "ac_cv_member_struct_sockaddr_storage___ss_family" "#include <sys/types.h>
13883 #include <sys/socket.h>
13884
13885 "
13886 if test "x$ac_cv_member_struct_sockaddr_storage___ss_family" = xyes; then :
13887
13888 cat >>confdefs.h <<_ACEOF
13889 #define HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY 1
13890 _ACEOF
13891
13892
13893 fi
13894 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_len" "ac_cv_member_struct_sockaddr_storage_ss_len" "#include <sys/types.h>
13895 #include <sys/socket.h>
13896
13897 "
13898 if test "x$ac_cv_member_struct_sockaddr_storage_ss_len" = xyes; then :
13899
13900 cat >>confdefs.h <<_ACEOF
13901 #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1
13902 _ACEOF
13903
13904
13905 fi
13906 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_len" "ac_cv_member_struct_sockaddr_storage___ss_len" "#include <sys/types.h>
13907 #include <sys/socket.h>
13908
13909 "
13910 if test "x$ac_cv_member_struct_sockaddr_storage___ss_len" = xyes; then :
13911
13912 cat >>confdefs.h <<_ACEOF
13913 #define HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN 1
13914 _ACEOF
13915
13916
13917 fi
13918 ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include <sys/types.h>
13919 #include <sys/socket.h>
13920
13921 "
13922 if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then :
13923
13924 cat >>confdefs.h <<_ACEOF
13925 #define HAVE_STRUCT_SOCKADDR_SA_LEN 1
13926 _ACEOF
13927
13928
13929 fi
13930
13931 ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "#include <sys/types.h>
13932 #include <sys/socket.h>
13933 #include <netdb.h>
13934
13935 "
13936 if test "x$ac_cv_type_struct_addrinfo" = xyes; then :
13937
13938 cat >>confdefs.h <<_ACEOF
13939 #define HAVE_STRUCT_ADDRINFO 1
13940 _ACEOF
13941
13942
13943 fi
13944
13945
13946   ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
13947 if test "x$ac_cv_type_intptr_t" = xyes; then :
13948
13949 $as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h
13950
13951 else
13952   for ac_type in 'int' 'long int' 'long long int'; do
13953        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13954 /* end confdefs.h.  */
13955 $ac_includes_default
13956 int
13957 main ()
13958 {
13959 static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
13960 test_array [0] = 0;
13961 return test_array [0];
13962
13963   ;
13964   return 0;
13965 }
13966 _ACEOF
13967 if ac_fn_c_try_compile "$LINENO"; then :
13968
13969 cat >>confdefs.h <<_ACEOF
13970 #define intptr_t $ac_type
13971 _ACEOF
13972
13973           ac_type=
13974 fi
13975 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13976        test -z "$ac_type" && break
13977      done
13978 fi
13979
13980
13981
13982   ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
13983 if test "x$ac_cv_type_uintptr_t" = xyes; then :
13984
13985 $as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
13986
13987 else
13988   for ac_type in 'unsigned int' 'unsigned long int' \
13989         'unsigned long long int'; do
13990        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13991 /* end confdefs.h.  */
13992 $ac_includes_default
13993 int
13994 main ()
13995 {
13996 static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
13997 test_array [0] = 0;
13998 return test_array [0];
13999
14000   ;
14001   return 0;
14002 }
14003 _ACEOF
14004 if ac_fn_c_try_compile "$LINENO"; then :
14005
14006 cat >>confdefs.h <<_ACEOF
14007 #define uintptr_t $ac_type
14008 _ACEOF
14009
14010           ac_type=
14011 fi
14012 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14013        test -z "$ac_type" && break
14014      done
14015 fi
14016
14017
14018
14019   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
14020 $as_echo_n "checking for unsigned long long int... " >&6; }
14021 if ${ac_cv_type_unsigned_long_long_int+:} false; then :
14022   $as_echo_n "(cached) " >&6
14023 else
14024   ac_cv_type_unsigned_long_long_int=yes
14025      if test "x${ac_cv_prog_cc_c99-no}" = xno; then
14026        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14027 /* end confdefs.h.  */
14028
14029   /* For now, do not test the preprocessor; as of 2007 there are too many
14030          implementations with broken preprocessors.  Perhaps this can
14031          be revisited in 2012.  In the meantime, code should not expect
14032          #if to work with literals wider than 32 bits.  */
14033       /* Test literals.  */
14034       long long int ll = 9223372036854775807ll;
14035       long long int nll = -9223372036854775807LL;
14036       unsigned long long int ull = 18446744073709551615ULL;
14037       /* Test constant expressions.   */
14038       typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
14039                      ? 1 : -1)];
14040       typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
14041                      ? 1 : -1)];
14042       int i = 63;
14043 int
14044 main ()
14045 {
14046 /* Test availability of runtime routines for shift and division.  */
14047       long long int llmax = 9223372036854775807ll;
14048       unsigned long long int ullmax = 18446744073709551615ull;
14049       return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
14050               | (llmax / ll) | (llmax % ll)
14051               | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
14052               | (ullmax / ull) | (ullmax % ull));
14053   ;
14054   return 0;
14055 }
14056
14057 _ACEOF
14058 if ac_fn_c_try_link "$LINENO"; then :
14059
14060 else
14061   ac_cv_type_unsigned_long_long_int=no
14062 fi
14063 rm -f core conftest.err conftest.$ac_objext \
14064     conftest$ac_exeext conftest.$ac_ext
14065      fi
14066 fi
14067 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
14068 $as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
14069   if test $ac_cv_type_unsigned_long_long_int = yes; then
14070
14071 $as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
14072
14073   fi
14074
14075
14076
14077   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
14078 $as_echo_n "checking for long long int... " >&6; }
14079 if ${ac_cv_type_long_long_int+:} false; then :
14080   $as_echo_n "(cached) " >&6
14081 else
14082   ac_cv_type_long_long_int=yes
14083       if test "x${ac_cv_prog_cc_c99-no}" = xno; then
14084         ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
14085         if test $ac_cv_type_long_long_int = yes; then
14086                                   if test "$cross_compiling" = yes; then :
14087   :
14088 else
14089   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14090 /* end confdefs.h.  */
14091 #include <limits.h>
14092                  #ifndef LLONG_MAX
14093                  # define HALF \
14094                           (1LL << (sizeof (long long int) * CHAR_BIT - 2))
14095                  # define LLONG_MAX (HALF - 1 + HALF)
14096                  #endif
14097 int
14098 main ()
14099 {
14100 long long int n = 1;
14101                  int i;
14102                  for (i = 0; ; i++)
14103                    {
14104                      long long int m = n << i;
14105                      if (m >> i != n)
14106                        return 1;
14107                      if (LLONG_MAX / 2 < m)
14108                        break;
14109                    }
14110                  return 0;
14111   ;
14112   return 0;
14113 }
14114 _ACEOF
14115 if ac_fn_c_try_run "$LINENO"; then :
14116
14117 else
14118   ac_cv_type_long_long_int=no
14119 fi
14120 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
14121   conftest.$ac_objext conftest.beam conftest.$ac_ext
14122 fi
14123
14124         fi
14125       fi
14126 fi
14127 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
14128 $as_echo "$ac_cv_type_long_long_int" >&6; }
14129   if test $ac_cv_type_long_long_int = yes; then
14130
14131 $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
14132
14133   fi
14134
14135
14136 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale_t" >&5
14137 $as_echo_n "checking for locale_t... " >&6; }
14138 if ${pgac_cv_type_locale_t+:} false; then :
14139   $as_echo_n "(cached) " >&6
14140 else
14141   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14142 /* end confdefs.h.  */
14143 #include <locale.h>
14144 locale_t x;
14145 int
14146 main ()
14147 {
14148
14149   ;
14150   return 0;
14151 }
14152 _ACEOF
14153 if ac_fn_c_try_compile "$LINENO"; then :
14154   pgac_cv_type_locale_t=yes
14155 else
14156   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14157 /* end confdefs.h.  */
14158 #include <xlocale.h>
14159 locale_t x;
14160 int
14161 main ()
14162 {
14163
14164   ;
14165   return 0;
14166 }
14167 _ACEOF
14168 if ac_fn_c_try_compile "$LINENO"; then :
14169   pgac_cv_type_locale_t='yes (in xlocale.h)'
14170 else
14171   pgac_cv_type_locale_t=no
14172 fi
14173 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14174 fi
14175 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14176 fi
14177 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_locale_t" >&5
14178 $as_echo "$pgac_cv_type_locale_t" >&6; }
14179 if test "$pgac_cv_type_locale_t" != no; then
14180
14181 $as_echo "#define HAVE_LOCALE_T 1" >>confdefs.h
14182
14183 fi
14184 if test "$pgac_cv_type_locale_t" = 'yes (in xlocale.h)'; then
14185
14186 $as_echo "#define LOCALE_T_IN_XLOCALE 1" >>confdefs.h
14187
14188 fi
14189
14190 # MSVC doesn't cope well with defining restrict to __restrict, the
14191 # spelling it understands, because it conflicts with
14192 # __declspec(restrict). Therefore we define pg_restrict to the
14193 # appropriate definition, which presumably won't conflict.
14194 #
14195 # Allow platforms with buggy compilers to force restrict to not be
14196 # used by setting $FORCE_DISABLE_RESTRICT=yes in the relevant
14197 # template.
14198 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
14199 $as_echo_n "checking for C/C++ restrict keyword... " >&6; }
14200 if ${ac_cv_c_restrict+:} false; then :
14201   $as_echo_n "(cached) " >&6
14202 else
14203   ac_cv_c_restrict=no
14204    # The order here caters to the fact that C++ does not require restrict.
14205    for ac_kw in __restrict __restrict__ _Restrict restrict; do
14206      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14207 /* end confdefs.h.  */
14208 typedef int * int_ptr;
14209         int foo (int_ptr $ac_kw ip) {
14210         return ip[0];
14211        }
14212 int
14213 main ()
14214 {
14215 int s[1];
14216         int * $ac_kw t = s;
14217         t[0] = 0;
14218         return foo(t)
14219   ;
14220   return 0;
14221 }
14222 _ACEOF
14223 if ac_fn_c_try_compile "$LINENO"; then :
14224   ac_cv_c_restrict=$ac_kw
14225 fi
14226 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14227      test "$ac_cv_c_restrict" != no && break
14228    done
14229
14230 fi
14231 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
14232 $as_echo "$ac_cv_c_restrict" >&6; }
14233
14234  case $ac_cv_c_restrict in
14235    restrict) ;;
14236    no) $as_echo "#define restrict /**/" >>confdefs.h
14237  ;;
14238    *)  cat >>confdefs.h <<_ACEOF
14239 #define restrict $ac_cv_c_restrict
14240 _ACEOF
14241  ;;
14242  esac
14243
14244 if test "$ac_cv_c_restrict" = "no" -o "x$FORCE_DISABLE_RESTRICT" = "xyes"; then
14245   pg_restrict=""
14246 else
14247   pg_restrict="$ac_cv_c_restrict"
14248 fi
14249
14250 cat >>confdefs.h <<_ACEOF
14251 #define pg_restrict $pg_restrict
14252 _ACEOF
14253
14254
14255 ac_fn_c_check_type "$LINENO" "struct cmsgcred" "ac_cv_type_struct_cmsgcred" "#include <sys/socket.h>
14256 #include <sys/param.h>
14257 #ifdef HAVE_SYS_UCRED_H
14258 #include <sys/ucred.h>
14259 #endif
14260 "
14261 if test "x$ac_cv_type_struct_cmsgcred" = xyes; then :
14262
14263 cat >>confdefs.h <<_ACEOF
14264 #define HAVE_STRUCT_CMSGCRED 1
14265 _ACEOF
14266
14267
14268 fi
14269
14270
14271 ac_fn_c_check_type "$LINENO" "struct option" "ac_cv_type_struct_option" "#ifdef HAVE_GETOPT_H
14272 #include <getopt.h>
14273 #endif
14274 "
14275 if test "x$ac_cv_type_struct_option" = xyes; then :
14276
14277 cat >>confdefs.h <<_ACEOF
14278 #define HAVE_STRUCT_OPTION 1
14279 _ACEOF
14280
14281
14282 fi
14283
14284
14285 if test "$with_zlib" = yes; then
14286   # Check that <zlib.h> defines z_streamp (versions before about 1.0.4
14287   # did not).  While we could work around the lack of z_streamp, it
14288   # seems unwise to encourage people to use such old zlib versions...
14289   ac_fn_c_check_type "$LINENO" "z_streamp" "ac_cv_type_z_streamp" "#include <zlib.h>
14290 "
14291 if test "x$ac_cv_type_z_streamp" = xyes; then :
14292
14293 else
14294   as_fn_error $? "zlib version is too old
14295 Use --without-zlib to disable zlib support." "$LINENO" 5
14296 fi
14297
14298 fi
14299
14300 # On PPC, check if assembler supports LWARX instruction's mutex hint bit
14301 case $host_cpu in
14302   ppc*|powerpc*)
14303     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether assembler supports lwarx hint bit" >&5
14304 $as_echo_n "checking whether assembler supports lwarx hint bit... " >&6; }
14305     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14306 /* end confdefs.h.  */
14307
14308 int
14309 main ()
14310 {
14311 int a = 0; int *p = &a; int r;
14312          __asm__ __volatile__ (" lwarx %0,0,%1,1\n" : "=&r"(r) : "r"(p));
14313   ;
14314   return 0;
14315 }
14316 _ACEOF
14317 if ac_fn_c_try_compile "$LINENO"; then :
14318   pgac_cv_have_ppc_mutex_hint=yes
14319 else
14320   pgac_cv_have_ppc_mutex_hint=no
14321 fi
14322 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14323     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_have_ppc_mutex_hint" >&5
14324 $as_echo "$pgac_cv_have_ppc_mutex_hint" >&6; }
14325     if test x"$pgac_cv_have_ppc_mutex_hint" = xyes ; then
14326
14327 $as_echo "#define HAVE_PPC_LWARX_MUTEX_HINT 1" >>confdefs.h
14328
14329     fi
14330   ;;
14331 esac
14332
14333 # Check largefile support.  You might think this is a system service not a
14334 # compiler characteristic, but you'd be wrong.  We must check this before
14335 # probing existence of related functions such as fseeko, since the largefile
14336 # defines can affect what is generated for that.
14337 if test "$PORTNAME" != "win32"; then
14338    # Check whether --enable-largefile was given.
14339 if test "${enable_largefile+set}" = set; then :
14340   enableval=$enable_largefile;
14341 fi
14342
14343 if test "$enable_largefile" != no; then
14344
14345   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
14346 $as_echo_n "checking for special C compiler options needed for large files... " >&6; }
14347 if ${ac_cv_sys_largefile_CC+:} false; then :
14348   $as_echo_n "(cached) " >&6
14349 else
14350   ac_cv_sys_largefile_CC=no
14351      if test "$GCC" != yes; then
14352        ac_save_CC=$CC
14353        while :; do
14354          # IRIX 6.2 and later do not support large files by default,
14355          # so use the C compiler's -n32 option if that helps.
14356          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14357 /* end confdefs.h.  */
14358 #include <sys/types.h>
14359  /* Check that off_t can represent 2**63 - 1 correctly.
14360     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14361     since some C++ compilers masquerading as C compilers
14362     incorrectly reject 9223372036854775807.  */
14363 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14364   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14365                        && LARGE_OFF_T % 2147483647 == 1)
14366                       ? 1 : -1];
14367 int
14368 main ()
14369 {
14370
14371   ;
14372   return 0;
14373 }
14374 _ACEOF
14375          if ac_fn_c_try_compile "$LINENO"; then :
14376   break
14377 fi
14378 rm -f core conftest.err conftest.$ac_objext
14379          CC="$CC -n32"
14380          if ac_fn_c_try_compile "$LINENO"; then :
14381   ac_cv_sys_largefile_CC=' -n32'; break
14382 fi
14383 rm -f core conftest.err conftest.$ac_objext
14384          break
14385        done
14386        CC=$ac_save_CC
14387        rm -f conftest.$ac_ext
14388     fi
14389 fi
14390 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
14391 $as_echo "$ac_cv_sys_largefile_CC" >&6; }
14392   if test "$ac_cv_sys_largefile_CC" != no; then
14393     CC=$CC$ac_cv_sys_largefile_CC
14394   fi
14395
14396   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
14397 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
14398 if ${ac_cv_sys_file_offset_bits+:} false; then :
14399   $as_echo_n "(cached) " >&6
14400 else
14401   while :; do
14402   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14403 /* end confdefs.h.  */
14404 #include <sys/types.h>
14405  /* Check that off_t can represent 2**63 - 1 correctly.
14406     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14407     since some C++ compilers masquerading as C compilers
14408     incorrectly reject 9223372036854775807.  */
14409 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14410   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14411                        && LARGE_OFF_T % 2147483647 == 1)
14412                       ? 1 : -1];
14413 int
14414 main ()
14415 {
14416
14417   ;
14418   return 0;
14419 }
14420 _ACEOF
14421 if ac_fn_c_try_compile "$LINENO"; then :
14422   ac_cv_sys_file_offset_bits=no; break
14423 fi
14424 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14425   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14426 /* end confdefs.h.  */
14427 #define _FILE_OFFSET_BITS 64
14428 #include <sys/types.h>
14429  /* Check that off_t can represent 2**63 - 1 correctly.
14430     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14431     since some C++ compilers masquerading as C compilers
14432     incorrectly reject 9223372036854775807.  */
14433 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14434   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14435                        && LARGE_OFF_T % 2147483647 == 1)
14436                       ? 1 : -1];
14437 int
14438 main ()
14439 {
14440
14441   ;
14442   return 0;
14443 }
14444 _ACEOF
14445 if ac_fn_c_try_compile "$LINENO"; then :
14446   ac_cv_sys_file_offset_bits=64; break
14447 fi
14448 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14449   ac_cv_sys_file_offset_bits=unknown
14450   break
14451 done
14452 fi
14453 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
14454 $as_echo "$ac_cv_sys_file_offset_bits" >&6; }
14455 case $ac_cv_sys_file_offset_bits in #(
14456   no | unknown) ;;
14457   *)
14458 cat >>confdefs.h <<_ACEOF
14459 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14460 _ACEOF
14461 ;;
14462 esac
14463 rm -rf conftest*
14464   if test $ac_cv_sys_file_offset_bits = unknown; then
14465     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
14466 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
14467 if ${ac_cv_sys_large_files+:} false; then :
14468   $as_echo_n "(cached) " >&6
14469 else
14470   while :; do
14471   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14472 /* end confdefs.h.  */
14473 #include <sys/types.h>
14474  /* Check that off_t can represent 2**63 - 1 correctly.
14475     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14476     since some C++ compilers masquerading as C compilers
14477     incorrectly reject 9223372036854775807.  */
14478 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14479   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14480                        && LARGE_OFF_T % 2147483647 == 1)
14481                       ? 1 : -1];
14482 int
14483 main ()
14484 {
14485
14486   ;
14487   return 0;
14488 }
14489 _ACEOF
14490 if ac_fn_c_try_compile "$LINENO"; then :
14491   ac_cv_sys_large_files=no; break
14492 fi
14493 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14494   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14495 /* end confdefs.h.  */
14496 #define _LARGE_FILES 1
14497 #include <sys/types.h>
14498  /* Check that off_t can represent 2**63 - 1 correctly.
14499     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14500     since some C++ compilers masquerading as C compilers
14501     incorrectly reject 9223372036854775807.  */
14502 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14503   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14504                        && LARGE_OFF_T % 2147483647 == 1)
14505                       ? 1 : -1];
14506 int
14507 main ()
14508 {
14509
14510   ;
14511   return 0;
14512 }
14513 _ACEOF
14514 if ac_fn_c_try_compile "$LINENO"; then :
14515   ac_cv_sys_large_files=1; break
14516 fi
14517 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14518   ac_cv_sys_large_files=unknown
14519   break
14520 done
14521 fi
14522 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
14523 $as_echo "$ac_cv_sys_large_files" >&6; }
14524 case $ac_cv_sys_large_files in #(
14525   no | unknown) ;;
14526   *)
14527 cat >>confdefs.h <<_ACEOF
14528 #define _LARGE_FILES $ac_cv_sys_large_files
14529 _ACEOF
14530 ;;
14531 esac
14532 rm -rf conftest*
14533   fi
14534
14535
14536 fi
14537
14538
14539 fi
14540
14541 # Check for largefile support (must be after AC_SYS_LARGEFILE)
14542 # The cast to long int works around a bug in the HP C Compiler
14543 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
14544 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
14545 # This bug is HP SR number 8606223364.
14546 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
14547 $as_echo_n "checking size of off_t... " >&6; }
14548 if ${ac_cv_sizeof_off_t+:} false; then :
14549   $as_echo_n "(cached) " >&6
14550 else
14551   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t"        "$ac_includes_default"; then :
14552
14553 else
14554   if test "$ac_cv_type_off_t" = yes; then
14555      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14556 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14557 as_fn_error 77 "cannot compute sizeof (off_t)
14558 See \`config.log' for more details" "$LINENO" 5; }
14559    else
14560      ac_cv_sizeof_off_t=0
14561    fi
14562 fi
14563
14564 fi
14565 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
14566 $as_echo "$ac_cv_sizeof_off_t" >&6; }
14567
14568
14569
14570 cat >>confdefs.h <<_ACEOF
14571 #define SIZEOF_OFF_T $ac_cv_sizeof_off_t
14572 _ACEOF
14573
14574
14575
14576 # If we don't have largefile support, can't handle segsize >= 2GB.
14577 if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then
14578    as_fn_error $? "Large file support is not enabled. Segment size cannot be larger than 1GB." "$LINENO" 5
14579 fi
14580
14581 # The cast to long int works around a bug in the HP C Compiler
14582 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
14583 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
14584 # This bug is HP SR number 8606223364.
14585 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of bool" >&5
14586 $as_echo_n "checking size of bool... " >&6; }
14587 if ${ac_cv_sizeof_bool+:} false; then :
14588   $as_echo_n "(cached) " >&6
14589 else
14590   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (bool))" "ac_cv_sizeof_bool"        "#ifdef HAVE_STDBOOL_H
14591 #include <stdbool.h>
14592 #endif
14593 "; then :
14594
14595 else
14596   if test "$ac_cv_type_bool" = yes; then
14597      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14598 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14599 as_fn_error 77 "cannot compute sizeof (bool)
14600 See \`config.log' for more details" "$LINENO" 5; }
14601    else
14602      ac_cv_sizeof_bool=0
14603    fi
14604 fi
14605
14606 fi
14607 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_bool" >&5
14608 $as_echo "$ac_cv_sizeof_bool" >&6; }
14609
14610
14611
14612 cat >>confdefs.h <<_ACEOF
14613 #define SIZEOF_BOOL $ac_cv_sizeof_bool
14614 _ACEOF
14615
14616
14617
14618
14619 ##
14620 ## Functions, global variables
14621 ##
14622
14623 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int timezone" >&5
14624 $as_echo_n "checking for int timezone... " >&6; }
14625 if ${pgac_cv_var_int_timezone+:} false; then :
14626   $as_echo_n "(cached) " >&6
14627 else
14628   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14629 /* end confdefs.h.  */
14630 #include <time.h>
14631 int res;
14632 int
14633 main ()
14634 {
14635 #ifndef __CYGWIN__
14636 res = timezone / 60;
14637 #else
14638 res = _timezone / 60;
14639 #endif
14640   ;
14641   return 0;
14642 }
14643 _ACEOF
14644 if ac_fn_c_try_link "$LINENO"; then :
14645   pgac_cv_var_int_timezone=yes
14646 else
14647   pgac_cv_var_int_timezone=no
14648 fi
14649 rm -f core conftest.err conftest.$ac_objext \
14650     conftest$ac_exeext conftest.$ac_ext
14651 fi
14652 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_timezone" >&5
14653 $as_echo "$pgac_cv_var_int_timezone" >&6; }
14654 if test x"$pgac_cv_var_int_timezone" = xyes ; then
14655
14656 $as_echo "#define HAVE_INT_TIMEZONE 1" >>confdefs.h
14657
14658 fi
14659 { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for accept()" >&5
14660 $as_echo_n "checking types of arguments for accept()... " >&6; }
14661  if ${ac_cv_func_accept_return+:} false; then :
14662   $as_echo_n "(cached) " >&6
14663 else
14664    if ${ac_cv_func_accept_arg1+:} false; then :
14665   $as_echo_n "(cached) " >&6
14666 else
14667     if ${ac_cv_func_accept_arg2+:} false; then :
14668   $as_echo_n "(cached) " >&6
14669 else
14670      if ${ac_cv_func_accept_arg3+:} false; then :
14671   $as_echo_n "(cached) " >&6
14672 else
14673       for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET WSAAPI'; do
14674       for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do
14675        for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
14676         for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
14677          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14678 /* end confdefs.h.  */
14679 #include <sys/types.h>
14680 #include <sys/socket.h>
14681 extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);
14682 _ACEOF
14683 if ac_fn_c_try_compile "$LINENO"; then :
14684   ac_not_found=no; break 4
14685 else
14686   ac_not_found=yes
14687 fi
14688 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14689        done
14690       done
14691      done
14692     done
14693     if test "$ac_not_found" = yes; then
14694       as_fn_error $? "could not determine argument types" "$LINENO" 5
14695     fi
14696     if test "$ac_cv_func_accept_arg3" = "void"; then
14697       ac_cv_func_accept_arg3=int
14698     fi
14699
14700 fi
14701
14702 fi
14703
14704 fi
14705
14706 fi
14707  { $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
14708 $as_echo "$ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&6; }
14709
14710 cat >>confdefs.h <<_ACEOF
14711 #define ACCEPT_TYPE_RETURN $ac_cv_func_accept_return
14712 _ACEOF
14713
14714
14715 cat >>confdefs.h <<_ACEOF
14716 #define ACCEPT_TYPE_ARG1 $ac_cv_func_accept_arg1
14717 _ACEOF
14718
14719
14720 cat >>confdefs.h <<_ACEOF
14721 #define ACCEPT_TYPE_ARG2 $ac_cv_func_accept_arg2
14722 _ACEOF
14723
14724
14725 cat >>confdefs.h <<_ACEOF
14726 #define ACCEPT_TYPE_ARG3 $ac_cv_func_accept_arg3
14727 _ACEOF
14728
14729
14730 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday takes only one argument" >&5
14731 $as_echo_n "checking whether gettimeofday takes only one argument... " >&6; }
14732 if ${pgac_cv_func_gettimeofday_1arg+:} false; then :
14733   $as_echo_n "(cached) " >&6
14734 else
14735   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14736 /* end confdefs.h.  */
14737 #include <sys/time.h>
14738 int
14739 main ()
14740 {
14741 struct timeval *tp;
14742 struct timezone *tzp;
14743 gettimeofday(tp,tzp);
14744   ;
14745   return 0;
14746 }
14747 _ACEOF
14748 if ac_fn_c_try_compile "$LINENO"; then :
14749   pgac_cv_func_gettimeofday_1arg=no
14750 else
14751   pgac_cv_func_gettimeofday_1arg=yes
14752 fi
14753 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14754 fi
14755 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_gettimeofday_1arg" >&5
14756 $as_echo "$pgac_cv_func_gettimeofday_1arg" >&6; }
14757 if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
14758
14759 $as_echo "#define GETTIMEOFDAY_1ARG 1" >>confdefs.h
14760
14761 fi
14762
14763 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wcstombs_l declaration" >&5
14764 $as_echo_n "checking for wcstombs_l declaration... " >&6; }
14765 if ${pgac_cv_func_wcstombs_l+:} false; then :
14766   $as_echo_n "(cached) " >&6
14767 else
14768   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14769 /* end confdefs.h.  */
14770 #include <stdlib.h>
14771 #include <locale.h>
14772 int
14773 main ()
14774 {
14775 #ifndef wcstombs_l
14776 (void) wcstombs_l;
14777 #endif
14778   ;
14779   return 0;
14780 }
14781 _ACEOF
14782 if ac_fn_c_try_compile "$LINENO"; then :
14783   pgac_cv_func_wcstombs_l='yes'
14784 else
14785   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14786 /* end confdefs.h.  */
14787 #include <stdlib.h>
14788 #include <locale.h>
14789 #include <xlocale.h>
14790 int
14791 main ()
14792 {
14793 #ifndef wcstombs_l
14794 (void) wcstombs_l;
14795 #endif
14796   ;
14797   return 0;
14798 }
14799 _ACEOF
14800 if ac_fn_c_try_compile "$LINENO"; then :
14801   pgac_cv_func_wcstombs_l='yes (in xlocale.h)'
14802 else
14803   pgac_cv_func_wcstombs_l='no'
14804 fi
14805 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14806 fi
14807 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14808 fi
14809 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_wcstombs_l" >&5
14810 $as_echo "$pgac_cv_func_wcstombs_l" >&6; }
14811 if test "$pgac_cv_func_wcstombs_l" = 'yes (in xlocale.h)'; then
14812
14813 $as_echo "#define WCSTOMBS_L_IN_XLOCALE 1" >>confdefs.h
14814
14815 fi
14816
14817 # Some versions of libedit contain strlcpy(), setproctitle(), and other
14818 # symbols that that library has no business exposing to the world.  Pending
14819 # acquisition of a clue by those developers, ignore libedit (including its
14820 # possible alias of libreadline) while checking for everything else.
14821 LIBS_including_readline="$LIBS"
14822 LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
14823
14824 for ac_func in cbrt clock_gettime dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll posix_fallocate pstat pthread_is_threaded_np readlink setproctitle setsid shm_open symlink sync_file_range utime utimes wcstombs_l
14825 do :
14826   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
14827 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
14828 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
14829   cat >>confdefs.h <<_ACEOF
14830 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
14831 _ACEOF
14832
14833 fi
14834 done
14835
14836
14837 ac_fn_c_check_func "$LINENO" "fseeko" "ac_cv_func_fseeko"
14838 if test "x$ac_cv_func_fseeko" = xyes; then :
14839   $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
14840
14841 else
14842   case " $LIBOBJS " in
14843   *" fseeko.$ac_objext "* ) ;;
14844   *) LIBOBJS="$LIBOBJS fseeko.$ac_objext"
14845  ;;
14846 esac
14847
14848 fi
14849
14850
14851 case $host_os in
14852         # NetBSD uses a custom fseeko/ftello built on fsetpos/fgetpos
14853         # Mingw uses macros to access Win32 API calls
14854         netbsd*|mingw*)
14855
14856 $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
14857
14858                 ac_cv_func_fseeko=yes;;
14859         *)
14860                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14861 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
14862 if ${ac_cv_sys_largefile_source+:} false; then :
14863   $as_echo_n "(cached) " >&6
14864 else
14865   while :; do
14866   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14867 /* end confdefs.h.  */
14868 #include <sys/types.h> /* for off_t */
14869      #include <stdio.h>
14870 int
14871 main ()
14872 {
14873 int (*fp) (FILE *, off_t, int) = fseeko;
14874      return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
14875   ;
14876   return 0;
14877 }
14878 _ACEOF
14879 if ac_fn_c_try_link "$LINENO"; then :
14880   ac_cv_sys_largefile_source=no; break
14881 fi
14882 rm -f core conftest.err conftest.$ac_objext \
14883     conftest$ac_exeext conftest.$ac_ext
14884   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14885 /* end confdefs.h.  */
14886 #define _LARGEFILE_SOURCE 1
14887 #include <sys/types.h> /* for off_t */
14888      #include <stdio.h>
14889 int
14890 main ()
14891 {
14892 int (*fp) (FILE *, off_t, int) = fseeko;
14893      return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
14894   ;
14895   return 0;
14896 }
14897 _ACEOF
14898 if ac_fn_c_try_link "$LINENO"; then :
14899   ac_cv_sys_largefile_source=1; break
14900 fi
14901 rm -f core conftest.err conftest.$ac_objext \
14902     conftest$ac_exeext conftest.$ac_ext
14903   ac_cv_sys_largefile_source=unknown
14904   break
14905 done
14906 fi
14907 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
14908 $as_echo "$ac_cv_sys_largefile_source" >&6; }
14909 case $ac_cv_sys_largefile_source in #(
14910   no | unknown) ;;
14911   *)
14912 cat >>confdefs.h <<_ACEOF
14913 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14914 _ACEOF
14915 ;;
14916 esac
14917 rm -rf conftest*
14918
14919 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14920 # in glibc 2.1.3, but that breaks too many other things.
14921 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14922 if test $ac_cv_sys_largefile_source != unknown; then
14923
14924 $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
14925
14926 fi
14927 ;;
14928 esac
14929
14930 # posix_fadvise() is a no-op on Solaris, so don't incur function overhead
14931 # by calling it, 2009-04-02
14932 # http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/posix_fadvise.c
14933 if test "$PORTNAME" != "solaris"; then
14934 for ac_func in posix_fadvise
14935 do :
14936   ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise"
14937 if test "x$ac_cv_func_posix_fadvise" = xyes; then :
14938   cat >>confdefs.h <<_ACEOF
14939 #define HAVE_POSIX_FADVISE 1
14940 _ACEOF
14941
14942 fi
14943 done
14944
14945 ac_fn_c_check_decl "$LINENO" "posix_fadvise" "ac_cv_have_decl_posix_fadvise" "#include <fcntl.h>
14946 "
14947 if test "x$ac_cv_have_decl_posix_fadvise" = xyes; then :
14948   ac_have_decl=1
14949 else
14950   ac_have_decl=0
14951 fi
14952
14953 cat >>confdefs.h <<_ACEOF
14954 #define HAVE_DECL_POSIX_FADVISE $ac_have_decl
14955 _ACEOF
14956
14957 fi
14958
14959 ac_fn_c_check_decl "$LINENO" "fdatasync" "ac_cv_have_decl_fdatasync" "#include <unistd.h>
14960 "
14961 if test "x$ac_cv_have_decl_fdatasync" = xyes; then :
14962   ac_have_decl=1
14963 else
14964   ac_have_decl=0
14965 fi
14966
14967 cat >>confdefs.h <<_ACEOF
14968 #define HAVE_DECL_FDATASYNC $ac_have_decl
14969 _ACEOF
14970
14971 ac_fn_c_check_decl "$LINENO" "strlcat" "ac_cv_have_decl_strlcat" "$ac_includes_default"
14972 if test "x$ac_cv_have_decl_strlcat" = xyes; then :
14973   ac_have_decl=1
14974 else
14975   ac_have_decl=0
14976 fi
14977
14978 cat >>confdefs.h <<_ACEOF
14979 #define HAVE_DECL_STRLCAT $ac_have_decl
14980 _ACEOF
14981 ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" "$ac_includes_default"
14982 if test "x$ac_cv_have_decl_strlcpy" = xyes; then :
14983   ac_have_decl=1
14984 else
14985   ac_have_decl=0
14986 fi
14987
14988 cat >>confdefs.h <<_ACEOF
14989 #define HAVE_DECL_STRLCPY $ac_have_decl
14990 _ACEOF
14991 ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default"
14992 if test "x$ac_cv_have_decl_strnlen" = xyes; then :
14993   ac_have_decl=1
14994 else
14995   ac_have_decl=0
14996 fi
14997
14998 cat >>confdefs.h <<_ACEOF
14999 #define HAVE_DECL_STRNLEN $ac_have_decl
15000 _ACEOF
15001
15002 # This is probably only present on macOS, but may as well check always
15003 ac_fn_c_check_decl "$LINENO" "F_FULLFSYNC" "ac_cv_have_decl_F_FULLFSYNC" "#include <fcntl.h>
15004 "
15005 if test "x$ac_cv_have_decl_F_FULLFSYNC" = xyes; then :
15006   ac_have_decl=1
15007 else
15008   ac_have_decl=0
15009 fi
15010
15011 cat >>confdefs.h <<_ACEOF
15012 #define HAVE_DECL_F_FULLFSYNC $ac_have_decl
15013 _ACEOF
15014
15015
15016 HAVE_IPV6=no
15017 ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "$ac_includes_default
15018 #include <netinet/in.h>
15019 "
15020 if test "x$ac_cv_type_struct_sockaddr_in6" = xyes; then :
15021
15022 $as_echo "#define HAVE_IPV6 1" >>confdefs.h
15023
15024          HAVE_IPV6=yes
15025 fi
15026
15027
15028
15029 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PS_STRINGS" >&5
15030 $as_echo_n "checking for PS_STRINGS... " >&6; }
15031 if ${pgac_cv_var_PS_STRINGS+:} false; then :
15032   $as_echo_n "(cached) " >&6
15033 else
15034   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15035 /* end confdefs.h.  */
15036 #include <machine/vmparam.h>
15037 #include <sys/exec.h>
15038
15039 int
15040 main ()
15041 {
15042 PS_STRINGS->ps_nargvstr = 1;
15043 PS_STRINGS->ps_argvstr = "foo";
15044   ;
15045   return 0;
15046 }
15047 _ACEOF
15048 if ac_fn_c_try_link "$LINENO"; then :
15049   pgac_cv_var_PS_STRINGS=yes
15050 else
15051   pgac_cv_var_PS_STRINGS=no
15052 fi
15053 rm -f core conftest.err conftest.$ac_objext \
15054     conftest$ac_exeext conftest.$ac_ext
15055 fi
15056 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_PS_STRINGS" >&5
15057 $as_echo "$pgac_cv_var_PS_STRINGS" >&6; }
15058 if test "$pgac_cv_var_PS_STRINGS" = yes ; then
15059
15060 $as_echo "#define HAVE_PS_STRINGS 1" >>confdefs.h
15061
15062 fi
15063
15064
15065 # We use our snprintf.c emulation if either snprintf() or vsnprintf()
15066 # is missing.  Yes, there are machines that have only one.  We may
15067 # also decide to use snprintf.c if snprintf() is present but does not
15068 # have all the features we need --- see below.
15069
15070 if test "$PORTNAME" = "win32"; then
15071   # Win32 gets snprintf.c built unconditionally.
15072   #
15073   # To properly translate all NLS languages strings, we must support the
15074   # *printf() %$ format, which allows *printf() arguments to be selected
15075   # by position in the translated string.
15076   #
15077   # libintl versions < 0.13 use the native *printf() functions, and Win32
15078   # *printf() doesn't understand %$, so we must use our /port versions,
15079   # which do understand %$. libintl versions >= 0.13 include their own
15080   # *printf versions on Win32.  The libintl 0.13 release note text is:
15081   #
15082   #   C format strings with positions, as they arise when a translator
15083   #   needs to reorder a sentence, are now supported on all platforms.
15084   #   On those few platforms (NetBSD and Woe32) for which the native
15085   #   printf()/fprintf()/... functions don't support such format
15086   #   strings, replacements are provided through <libintl.h>.
15087   #
15088   # We could use libintl >= 0.13's *printf() if we were sure that we had
15089   # a litint >= 0.13 at runtime, but seeing that there is no clean way
15090   # to guarantee that, it is best to just use our own, so we are sure to
15091   # get %$ support. In include/port.h we disable the *printf() macros
15092   # that might have been defined by libintl.
15093   #
15094   # We do this unconditionally whether NLS is used or not so we are sure
15095   # that all Win32 libraries and binaries behave the same.
15096   pgac_need_repl_snprintf=yes
15097 else
15098   pgac_need_repl_snprintf=no
15099   for ac_func in snprintf
15100 do :
15101   ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
15102 if test "x$ac_cv_func_snprintf" = xyes; then :
15103   cat >>confdefs.h <<_ACEOF
15104 #define HAVE_SNPRINTF 1
15105 _ACEOF
15106
15107 else
15108   pgac_need_repl_snprintf=yes
15109 fi
15110 done
15111
15112   for ac_func in vsnprintf
15113 do :
15114   ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf"
15115 if test "x$ac_cv_func_vsnprintf" = xyes; then :
15116   cat >>confdefs.h <<_ACEOF
15117 #define HAVE_VSNPRINTF 1
15118 _ACEOF
15119
15120 else
15121   pgac_need_repl_snprintf=yes
15122 fi
15123 done
15124
15125 fi
15126
15127
15128 # Check whether <stdio.h> declares snprintf() and vsnprintf(); if not,
15129 # include/c.h will provide declarations.  Note this is a separate test
15130 # from whether the functions exist in the C library --- there are
15131 # systems that have the functions but don't bother to declare them :-(
15132
15133 ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default"
15134 if test "x$ac_cv_have_decl_snprintf" = xyes; then :
15135   ac_have_decl=1
15136 else
15137   ac_have_decl=0
15138 fi
15139
15140 cat >>confdefs.h <<_ACEOF
15141 #define HAVE_DECL_SNPRINTF $ac_have_decl
15142 _ACEOF
15143 ac_fn_c_check_decl "$LINENO" "vsnprintf" "ac_cv_have_decl_vsnprintf" "$ac_includes_default"
15144 if test "x$ac_cv_have_decl_vsnprintf" = xyes; then :
15145   ac_have_decl=1
15146 else
15147   ac_have_decl=0
15148 fi
15149
15150 cat >>confdefs.h <<_ACEOF
15151 #define HAVE_DECL_VSNPRINTF $ac_have_decl
15152 _ACEOF
15153
15154
15155
15156 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf" >&5
15157 $as_echo_n "checking for isinf... " >&6; }
15158 if ${ac_cv_func_isinf+:} false; then :
15159   $as_echo_n "(cached) " >&6
15160 else
15161   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15162 /* end confdefs.h.  */
15163
15164 #include <math.h>
15165 double glob_double;
15166
15167 int
15168 main ()
15169 {
15170 return isinf(glob_double) ? 0 : 1;
15171   ;
15172   return 0;
15173 }
15174 _ACEOF
15175 if ac_fn_c_try_link "$LINENO"; then :
15176   ac_cv_func_isinf=yes
15177 else
15178   ac_cv_func_isinf=no
15179 fi
15180 rm -f core conftest.err conftest.$ac_objext \
15181     conftest$ac_exeext conftest.$ac_ext
15182 fi
15183 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_isinf" >&5
15184 $as_echo "$ac_cv_func_isinf" >&6; }
15185
15186 if test $ac_cv_func_isinf = yes ; then
15187
15188 $as_echo "#define HAVE_ISINF 1" >>confdefs.h
15189
15190 else
15191   case " $LIBOBJS " in
15192   *" isinf.$ac_objext "* ) ;;
15193   *) LIBOBJS="$LIBOBJS isinf.$ac_objext"
15194  ;;
15195 esac
15196
15197   # Look for a way to implement a substitute for isinf()
15198   for ac_func in fpclass fp_class fp_class_d class
15199 do :
15200   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
15201 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
15202 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
15203   cat >>confdefs.h <<_ACEOF
15204 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
15205 _ACEOF
15206  break
15207 fi
15208 done
15209
15210 fi
15211
15212 ac_fn_c_check_func "$LINENO" "crypt" "ac_cv_func_crypt"
15213 if test "x$ac_cv_func_crypt" = xyes; then :
15214   $as_echo "#define HAVE_CRYPT 1" >>confdefs.h
15215
15216 else
15217   case " $LIBOBJS " in
15218   *" crypt.$ac_objext "* ) ;;
15219   *) LIBOBJS="$LIBOBJS crypt.$ac_objext"
15220  ;;
15221 esac
15222
15223 fi
15224
15225 ac_fn_c_check_func "$LINENO" "fls" "ac_cv_func_fls"
15226 if test "x$ac_cv_func_fls" = xyes; then :
15227   $as_echo "#define HAVE_FLS 1" >>confdefs.h
15228
15229 else
15230   case " $LIBOBJS " in
15231   *" fls.$ac_objext "* ) ;;
15232   *) LIBOBJS="$LIBOBJS fls.$ac_objext"
15233  ;;
15234 esac
15235
15236 fi
15237
15238 ac_fn_c_check_func "$LINENO" "getopt" "ac_cv_func_getopt"
15239 if test "x$ac_cv_func_getopt" = xyes; then :
15240   $as_echo "#define HAVE_GETOPT 1" >>confdefs.h
15241
15242 else
15243   case " $LIBOBJS " in
15244   *" getopt.$ac_objext "* ) ;;
15245   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
15246  ;;
15247 esac
15248
15249 fi
15250
15251 ac_fn_c_check_func "$LINENO" "getrusage" "ac_cv_func_getrusage"
15252 if test "x$ac_cv_func_getrusage" = xyes; then :
15253   $as_echo "#define HAVE_GETRUSAGE 1" >>confdefs.h
15254
15255 else
15256   case " $LIBOBJS " in
15257   *" getrusage.$ac_objext "* ) ;;
15258   *) LIBOBJS="$LIBOBJS getrusage.$ac_objext"
15259  ;;
15260 esac
15261
15262 fi
15263
15264 ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton"
15265 if test "x$ac_cv_func_inet_aton" = xyes; then :
15266   $as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
15267
15268 else
15269   case " $LIBOBJS " in
15270   *" inet_aton.$ac_objext "* ) ;;
15271   *) LIBOBJS="$LIBOBJS inet_aton.$ac_objext"
15272  ;;
15273 esac
15274
15275 fi
15276
15277 ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
15278 if test "x$ac_cv_func_mkdtemp" = xyes; then :
15279   $as_echo "#define HAVE_MKDTEMP 1" >>confdefs.h
15280
15281 else
15282   case " $LIBOBJS " in
15283   *" mkdtemp.$ac_objext "* ) ;;
15284   *) LIBOBJS="$LIBOBJS mkdtemp.$ac_objext"
15285  ;;
15286 esac
15287
15288 fi
15289
15290 ac_fn_c_check_func "$LINENO" "random" "ac_cv_func_random"
15291 if test "x$ac_cv_func_random" = xyes; then :
15292   $as_echo "#define HAVE_RANDOM 1" >>confdefs.h
15293
15294 else
15295   case " $LIBOBJS " in
15296   *" random.$ac_objext "* ) ;;
15297   *) LIBOBJS="$LIBOBJS random.$ac_objext"
15298  ;;
15299 esac
15300
15301 fi
15302
15303 ac_fn_c_check_func "$LINENO" "rint" "ac_cv_func_rint"
15304 if test "x$ac_cv_func_rint" = xyes; then :
15305   $as_echo "#define HAVE_RINT 1" >>confdefs.h
15306
15307 else
15308   case " $LIBOBJS " in
15309   *" rint.$ac_objext "* ) ;;
15310   *) LIBOBJS="$LIBOBJS rint.$ac_objext"
15311  ;;
15312 esac
15313
15314 fi
15315
15316 ac_fn_c_check_func "$LINENO" "srandom" "ac_cv_func_srandom"
15317 if test "x$ac_cv_func_srandom" = xyes; then :
15318   $as_echo "#define HAVE_SRANDOM 1" >>confdefs.h
15319
15320 else
15321   case " $LIBOBJS " in
15322   *" srandom.$ac_objext "* ) ;;
15323   *) LIBOBJS="$LIBOBJS srandom.$ac_objext"
15324  ;;
15325 esac
15326
15327 fi
15328
15329 ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror"
15330 if test "x$ac_cv_func_strerror" = xyes; then :
15331   $as_echo "#define HAVE_STRERROR 1" >>confdefs.h
15332
15333 else
15334   case " $LIBOBJS " in
15335   *" strerror.$ac_objext "* ) ;;
15336   *) LIBOBJS="$LIBOBJS strerror.$ac_objext"
15337  ;;
15338 esac
15339
15340 fi
15341
15342 ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat"
15343 if test "x$ac_cv_func_strlcat" = xyes; then :
15344   $as_echo "#define HAVE_STRLCAT 1" >>confdefs.h
15345
15346 else
15347   case " $LIBOBJS " in
15348   *" strlcat.$ac_objext "* ) ;;
15349   *) LIBOBJS="$LIBOBJS strlcat.$ac_objext"
15350  ;;
15351 esac
15352
15353 fi
15354
15355 ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy"
15356 if test "x$ac_cv_func_strlcpy" = xyes; then :
15357   $as_echo "#define HAVE_STRLCPY 1" >>confdefs.h
15358
15359 else
15360   case " $LIBOBJS " in
15361   *" strlcpy.$ac_objext "* ) ;;
15362   *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext"
15363  ;;
15364 esac
15365
15366 fi
15367
15368 ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen"
15369 if test "x$ac_cv_func_strnlen" = xyes; then :
15370   $as_echo "#define HAVE_STRNLEN 1" >>confdefs.h
15371
15372 else
15373   case " $LIBOBJS " in
15374   *" strnlen.$ac_objext "* ) ;;
15375   *) LIBOBJS="$LIBOBJS strnlen.$ac_objext"
15376  ;;
15377 esac
15378
15379 fi
15380
15381
15382
15383 case $host_os in
15384
15385         # Windows uses a specialised env handler
15386         # and doesn't need a replacement getpeereid because it doesn't use
15387         # Unix sockets.
15388         mingw*)
15389
15390 $as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
15391
15392
15393 $as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
15394
15395                 ac_cv_func_unsetenv=yes
15396                 ac_cv_func_getpeereid=yes;;
15397         *)
15398                 ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
15399 if test "x$ac_cv_func_unsetenv" = xyes; then :
15400   $as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
15401
15402 else
15403   case " $LIBOBJS " in
15404   *" unsetenv.$ac_objext "* ) ;;
15405   *) LIBOBJS="$LIBOBJS unsetenv.$ac_objext"
15406  ;;
15407 esac
15408
15409 fi
15410
15411 ac_fn_c_check_func "$LINENO" "getpeereid" "ac_cv_func_getpeereid"
15412 if test "x$ac_cv_func_getpeereid" = xyes; then :
15413   $as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
15414
15415 else
15416   case " $LIBOBJS " in
15417   *" getpeereid.$ac_objext "* ) ;;
15418   *) LIBOBJS="$LIBOBJS getpeereid.$ac_objext"
15419  ;;
15420 esac
15421
15422 fi
15423
15424
15425                 ;;
15426 esac
15427
15428 # System's version of getaddrinfo(), if any, may be used only if we found
15429 # a definition for struct addrinfo; see notes in src/include/getaddrinfo.h.
15430 # We use only our own getaddrinfo.c on Windows, but it's time to revisit that.
15431 if test x"$ac_cv_type_struct_addrinfo" = xyes && \
15432    test "$PORTNAME" != "win32"; then
15433   ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo"
15434 if test "x$ac_cv_func_getaddrinfo" = xyes; then :
15435   $as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
15436
15437 else
15438   case " $LIBOBJS " in
15439   *" getaddrinfo.$ac_objext "* ) ;;
15440   *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext"
15441  ;;
15442 esac
15443
15444 fi
15445
15446
15447 else
15448   case " $LIBOBJS " in
15449   *" getaddrinfo.$ac_objext "* ) ;;
15450   *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext"
15451  ;;
15452 esac
15453
15454 fi
15455
15456 # Similarly, use system's getopt_long() only if system provides struct option.
15457 if test x"$ac_cv_type_struct_option" = xyes ; then
15458   ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long"
15459 if test "x$ac_cv_func_getopt_long" = xyes; then :
15460   $as_echo "#define HAVE_GETOPT_LONG 1" >>confdefs.h
15461
15462 else
15463   case " $LIBOBJS " in
15464   *" getopt_long.$ac_objext "* ) ;;
15465   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
15466  ;;
15467 esac
15468
15469 fi
15470
15471
15472 else
15473   case " $LIBOBJS " in
15474   *" getopt_long.$ac_objext "* ) ;;
15475   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
15476  ;;
15477 esac
15478
15479 fi
15480
15481 # Solaris' getopt() doesn't do what we want for long options, so always use
15482 # our version on that platform.
15483 if test "$PORTNAME" = "solaris"; then
15484   case " $LIBOBJS " in
15485   *" getopt.$ac_objext "* ) ;;
15486   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
15487  ;;
15488 esac
15489
15490 fi
15491
15492 # mingw has adopted a GNU-centric interpretation of optind/optreset,
15493 # so always use our version on Windows.
15494 if test "$PORTNAME" = "win32"; then
15495   case " $LIBOBJS " in
15496   *" getopt.$ac_objext "* ) ;;
15497   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
15498  ;;
15499 esac
15500
15501   case " $LIBOBJS " in
15502   *" getopt_long.$ac_objext "* ) ;;
15503   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
15504  ;;
15505 esac
15506
15507 fi
15508
15509 # Win32 (really MinGW) support
15510 if test "$PORTNAME" = "win32"; then
15511   ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
15512 if test "x$ac_cv_func_gettimeofday" = xyes; then :
15513   $as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
15514
15515 else
15516   case " $LIBOBJS " in
15517   *" gettimeofday.$ac_objext "* ) ;;
15518   *) LIBOBJS="$LIBOBJS gettimeofday.$ac_objext"
15519  ;;
15520 esac
15521
15522 fi
15523
15524
15525   case " $LIBOBJS " in
15526   *" dirmod.$ac_objext "* ) ;;
15527   *) LIBOBJS="$LIBOBJS dirmod.$ac_objext"
15528  ;;
15529 esac
15530
15531   case " $LIBOBJS " in
15532   *" kill.$ac_objext "* ) ;;
15533   *) LIBOBJS="$LIBOBJS kill.$ac_objext"
15534  ;;
15535 esac
15536
15537   case " $LIBOBJS " in
15538   *" open.$ac_objext "* ) ;;
15539   *) LIBOBJS="$LIBOBJS open.$ac_objext"
15540  ;;
15541 esac
15542
15543   case " $LIBOBJS " in
15544   *" system.$ac_objext "* ) ;;
15545   *) LIBOBJS="$LIBOBJS system.$ac_objext"
15546  ;;
15547 esac
15548
15549   case " $LIBOBJS " in
15550   *" win32env.$ac_objext "* ) ;;
15551   *) LIBOBJS="$LIBOBJS win32env.$ac_objext"
15552  ;;
15553 esac
15554
15555   case " $LIBOBJS " in
15556   *" win32error.$ac_objext "* ) ;;
15557   *) LIBOBJS="$LIBOBJS win32error.$ac_objext"
15558  ;;
15559 esac
15560
15561   case " $LIBOBJS " in
15562   *" win32security.$ac_objext "* ) ;;
15563   *) LIBOBJS="$LIBOBJS win32security.$ac_objext"
15564  ;;
15565 esac
15566
15567   case " $LIBOBJS " in
15568   *" win32setlocale.$ac_objext "* ) ;;
15569   *) LIBOBJS="$LIBOBJS win32setlocale.$ac_objext"
15570  ;;
15571 esac
15572
15573
15574 $as_echo "#define HAVE_SYMLINK 1" >>confdefs.h
15575
15576   ac_fn_c_check_type "$LINENO" "MINIDUMP_TYPE" "ac_cv_type_MINIDUMP_TYPE" "
15577 #define WIN32_LEAN_AND_MEAN
15578 #include <windows.h>
15579 #include <string.h>
15580 #include <dbghelp.h>
15581 "
15582 if test "x$ac_cv_type_MINIDUMP_TYPE" = xyes; then :
15583
15584 cat >>confdefs.h <<_ACEOF
15585 #define HAVE_MINIDUMP_TYPE 1
15586 _ACEOF
15587
15588 pgac_minidump_type=yes
15589 else
15590   pgac_minidump_type=no
15591 fi
15592
15593 fi
15594 if test x"$pgac_minidump_type" = x"yes" ; then
15595   have_win32_dbghelp=yes
15596
15597 else
15598   have_win32_dbghelp=no
15599
15600 fi
15601
15602 # Cygwin needs only a bit of that
15603 if test "$PORTNAME" = "cygwin"; then
15604   case " $LIBOBJS " in
15605   *" dirmod.$ac_objext "* ) ;;
15606   *) LIBOBJS="$LIBOBJS dirmod.$ac_objext"
15607  ;;
15608 esac
15609
15610 fi
15611
15612 ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include <signal.h>
15613 /* NetBSD declares sys_siglist in unistd.h.  */
15614 #ifdef HAVE_UNISTD_H
15615 # include <unistd.h>
15616 #endif
15617
15618 "
15619 if test "x$ac_cv_have_decl_sys_siglist" = xyes; then :
15620   ac_have_decl=1
15621 else
15622   ac_have_decl=0
15623 fi
15624
15625 cat >>confdefs.h <<_ACEOF
15626 #define HAVE_DECL_SYS_SIGLIST $ac_have_decl
15627 _ACEOF
15628
15629
15630 ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog"
15631 if test "x$ac_cv_func_syslog" = xyes; then :
15632   ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default"
15633 if test "x$ac_cv_header_syslog_h" = xyes; then :
15634
15635 $as_echo "#define HAVE_SYSLOG 1" >>confdefs.h
15636
15637 fi
15638
15639
15640 fi
15641
15642
15643 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opterr" >&5
15644 $as_echo_n "checking for opterr... " >&6; }
15645 if ${pgac_cv_var_int_opterr+:} false; then :
15646   $as_echo_n "(cached) " >&6
15647 else
15648   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15649 /* end confdefs.h.  */
15650 #include <unistd.h>
15651 int
15652 main ()
15653 {
15654 extern int opterr; opterr = 1;
15655   ;
15656   return 0;
15657 }
15658 _ACEOF
15659 if ac_fn_c_try_link "$LINENO"; then :
15660   pgac_cv_var_int_opterr=yes
15661 else
15662   pgac_cv_var_int_opterr=no
15663 fi
15664 rm -f core conftest.err conftest.$ac_objext \
15665     conftest$ac_exeext conftest.$ac_ext
15666 fi
15667 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_opterr" >&5
15668 $as_echo "$pgac_cv_var_int_opterr" >&6; }
15669 if test x"$pgac_cv_var_int_opterr" = x"yes"; then
15670
15671 $as_echo "#define HAVE_INT_OPTERR 1" >>confdefs.h
15672
15673 fi
15674
15675 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for optreset" >&5
15676 $as_echo_n "checking for optreset... " >&6; }
15677 if ${pgac_cv_var_int_optreset+:} false; then :
15678   $as_echo_n "(cached) " >&6
15679 else
15680   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15681 /* end confdefs.h.  */
15682 #include <unistd.h>
15683 int
15684 main ()
15685 {
15686 extern int optreset; optreset = 1;
15687   ;
15688   return 0;
15689 }
15690 _ACEOF
15691 if ac_fn_c_try_link "$LINENO"; then :
15692   pgac_cv_var_int_optreset=yes
15693 else
15694   pgac_cv_var_int_optreset=no
15695 fi
15696 rm -f core conftest.err conftest.$ac_objext \
15697     conftest$ac_exeext conftest.$ac_ext
15698 fi
15699 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_optreset" >&5
15700 $as_echo "$pgac_cv_var_int_optreset" >&6; }
15701 if test x"$pgac_cv_var_int_optreset" = x"yes"; then
15702
15703 $as_echo "#define HAVE_INT_OPTRESET 1" >>confdefs.h
15704
15705 fi
15706
15707 for ac_func in strtoll strtoq
15708 do :
15709   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
15710 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
15711 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
15712   cat >>confdefs.h <<_ACEOF
15713 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
15714 _ACEOF
15715  break
15716 fi
15717 done
15718
15719 for ac_func in strtoull strtouq
15720 do :
15721   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
15722 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
15723 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
15724   cat >>confdefs.h <<_ACEOF
15725 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
15726 _ACEOF
15727  break
15728 fi
15729 done
15730
15731
15732 if test "$with_icu" = yes; then
15733   ac_save_CPPFLAGS=$CPPFLAGS
15734   CPPFLAGS="$ICU_CFLAGS $CPPFLAGS"
15735
15736   # Verify we have ICU's header files
15737   ac_fn_c_check_header_mongrel "$LINENO" "unicode/ucol.h" "ac_cv_header_unicode_ucol_h" "$ac_includes_default"
15738 if test "x$ac_cv_header_unicode_ucol_h" = xyes; then :
15739
15740 else
15741   as_fn_error $? "header file <unicode/ucol.h> is required for ICU" "$LINENO" 5
15742 fi
15743
15744
15745
15746   CPPFLAGS=$ac_save_CPPFLAGS
15747 fi
15748
15749 # Lastly, restore full LIBS list and check for readline/libedit symbols
15750 LIBS="$LIBS_including_readline"
15751
15752 if test "$with_readline" = yes; then
15753   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_append_character" >&5
15754 $as_echo_n "checking for rl_completion_append_character... " >&6; }
15755 if ${pgac_cv_var_rl_completion_append_character+:} false; then :
15756   $as_echo_n "(cached) " >&6
15757 else
15758   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15759 /* end confdefs.h.  */
15760 #include <stdio.h>
15761 #ifdef HAVE_READLINE_READLINE_H
15762 # include <readline/readline.h>
15763 #elif defined(HAVE_READLINE_H)
15764 # include <readline.h>
15765 #endif
15766
15767 int
15768 main ()
15769 {
15770 rl_completion_append_character = 'x';
15771   ;
15772   return 0;
15773 }
15774 _ACEOF
15775 if ac_fn_c_try_link "$LINENO"; then :
15776   pgac_cv_var_rl_completion_append_character=yes
15777 else
15778   pgac_cv_var_rl_completion_append_character=no
15779 fi
15780 rm -f core conftest.err conftest.$ac_objext \
15781     conftest$ac_exeext conftest.$ac_ext
15782 fi
15783 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_rl_completion_append_character" >&5
15784 $as_echo "$pgac_cv_var_rl_completion_append_character" >&6; }
15785 if test x"$pgac_cv_var_rl_completion_append_character" = x"yes"; then
15786
15787 $as_echo "#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1" >>confdefs.h
15788
15789 fi
15790   for ac_func in rl_completion_matches rl_filename_completion_function rl_reset_screen_size
15791 do :
15792   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
15793 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
15794 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
15795   cat >>confdefs.h <<_ACEOF
15796 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
15797 _ACEOF
15798
15799 fi
15800 done
15801
15802   for ac_func in append_history history_truncate_file
15803 do :
15804   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
15805 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
15806 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
15807   cat >>confdefs.h <<_ACEOF
15808 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
15809 _ACEOF
15810
15811 fi
15812 done
15813
15814 fi
15815
15816
15817 # This test makes sure that run tests work at all.  Sometimes a shared
15818 # library is found by the linker, but the runtime linker can't find it.
15819 # This check should come after all modifications of compiler or linker
15820 # variables, and before any other run tests.
15821 { $as_echo "$as_me:${as_lineno-$LINENO}: checking test program" >&5
15822 $as_echo_n "checking test program... " >&6; }
15823 if test "$cross_compiling" = yes; then :
15824   { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling" >&5
15825 $as_echo "cross-compiling" >&6; }
15826 else
15827   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15828 /* end confdefs.h.  */
15829 int main() { return 0; }
15830 _ACEOF
15831 if ac_fn_c_try_run "$LINENO"; then :
15832   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
15833 $as_echo "ok" >&6; }
15834 else
15835   { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
15836 $as_echo "failed" >&6; }
15837 as_fn_error $? "
15838 Could not execute a simple test program.  This may be a problem
15839 related to locating shared libraries.  Check the file 'config.log'
15840 for the exact reason." "$LINENO" 5
15841 fi
15842 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15843   conftest.$ac_objext conftest.beam conftest.$ac_ext
15844 fi
15845
15846
15847 # --------------------
15848 # Run tests below here
15849 # --------------------
15850
15851 # Force use of our snprintf if system's doesn't do arg control
15852 # See comment above at snprintf test for details.
15853 if test "$enable_nls" = yes -a "$pgac_need_repl_snprintf" = no; then
15854   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf supports argument control" >&5
15855 $as_echo_n "checking whether snprintf supports argument control... " >&6; }
15856 if ${pgac_cv_snprintf_arg_control+:} false; then :
15857   $as_echo_n "(cached) " >&6
15858 else
15859   if test "$cross_compiling" = yes; then :
15860   pgac_cv_snprintf_arg_control=cross
15861 else
15862   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15863 /* end confdefs.h.  */
15864 #include <stdio.h>
15865 #include <string.h>
15866
15867 int main()
15868 {
15869   char buf[100];
15870
15871   /* can it swap arguments? */
15872   snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
15873   if (strcmp(buf, "4 3") != 0)
15874     return 1;
15875   return 0;
15876 }
15877 _ACEOF
15878 if ac_fn_c_try_run "$LINENO"; then :
15879   pgac_cv_snprintf_arg_control=yes
15880 else
15881   pgac_cv_snprintf_arg_control=no
15882 fi
15883 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15884   conftest.$ac_objext conftest.beam conftest.$ac_ext
15885 fi
15886
15887
15888 fi
15889 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_arg_control" >&5
15890 $as_echo "$pgac_cv_snprintf_arg_control" >&6; }
15891
15892   if test $pgac_cv_snprintf_arg_control != yes ; then
15893     pgac_need_repl_snprintf=yes
15894   fi
15895 fi
15896
15897
15898
15899
15900 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long int is 64 bits" >&5
15901 $as_echo_n "checking whether long int is 64 bits... " >&6; }
15902 if ${pgac_cv_type_long_int_64+:} false; then :
15903   $as_echo_n "(cached) " >&6
15904 else
15905   if test "$cross_compiling" = yes; then :
15906   # If cross-compiling, check the size reported by the compiler and
15907 # trust that the arithmetic works.
15908 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15909 /* end confdefs.h.  */
15910
15911 int
15912 main ()
15913 {
15914 static int test_array [1 - 2 * !(sizeof(long int) == 8)];
15915 test_array [0] = 0;
15916 return test_array [0];
15917
15918   ;
15919   return 0;
15920 }
15921 _ACEOF
15922 if ac_fn_c_try_compile "$LINENO"; then :
15923   pgac_cv_type_long_int_64=yes
15924 else
15925   pgac_cv_type_long_int_64=no
15926 fi
15927 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15928 else
15929   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15930 /* end confdefs.h.  */
15931 typedef long int ac_int64;
15932
15933 /*
15934  * These are globals to discourage the compiler from folding all the
15935  * arithmetic tests down to compile-time constants.
15936  */
15937 ac_int64 a = 20000001;
15938 ac_int64 b = 40000005;
15939
15940 int does_int64_work()
15941 {
15942   ac_int64 c,d;
15943
15944   if (sizeof(ac_int64) != 8)
15945     return 0;                   /* definitely not the right size */
15946
15947   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
15948   c = a * b;
15949   d = (c + b) / b;
15950   if (d != a+1)
15951     return 0;
15952   return 1;
15953 }
15954
15955 int
15956 main() {
15957   return (! does_int64_work());
15958 }
15959 _ACEOF
15960 if ac_fn_c_try_run "$LINENO"; then :
15961   pgac_cv_type_long_int_64=yes
15962 else
15963   pgac_cv_type_long_int_64=no
15964 fi
15965 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15966   conftest.$ac_objext conftest.beam conftest.$ac_ext
15967 fi
15968
15969 fi
15970 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_long_int_64" >&5
15971 $as_echo "$pgac_cv_type_long_int_64" >&6; }
15972
15973 HAVE_LONG_INT_64=$pgac_cv_type_long_int_64
15974 if test x"$pgac_cv_type_long_int_64" = xyes ; then
15975
15976 $as_echo "#define HAVE_LONG_INT_64 1" >>confdefs.h
15977
15978 fi
15979
15980
15981 if test x"$HAVE_LONG_INT_64" = x"yes" ; then
15982   pg_int64_type="long int"
15983 else
15984   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long long int is 64 bits" >&5
15985 $as_echo_n "checking whether long long int is 64 bits... " >&6; }
15986 if ${pgac_cv_type_long_long_int_64+:} false; then :
15987   $as_echo_n "(cached) " >&6
15988 else
15989   if test "$cross_compiling" = yes; then :
15990   # If cross-compiling, check the size reported by the compiler and
15991 # trust that the arithmetic works.
15992 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15993 /* end confdefs.h.  */
15994
15995 int
15996 main ()
15997 {
15998 static int test_array [1 - 2 * !(sizeof(long long int) == 8)];
15999 test_array [0] = 0;
16000 return test_array [0];
16001
16002   ;
16003   return 0;
16004 }
16005 _ACEOF
16006 if ac_fn_c_try_compile "$LINENO"; then :
16007   pgac_cv_type_long_long_int_64=yes
16008 else
16009   pgac_cv_type_long_long_int_64=no
16010 fi
16011 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16012 else
16013   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16014 /* end confdefs.h.  */
16015 typedef long long int ac_int64;
16016
16017 /*
16018  * These are globals to discourage the compiler from folding all the
16019  * arithmetic tests down to compile-time constants.
16020  */
16021 ac_int64 a = 20000001;
16022 ac_int64 b = 40000005;
16023
16024 int does_int64_work()
16025 {
16026   ac_int64 c,d;
16027
16028   if (sizeof(ac_int64) != 8)
16029     return 0;                   /* definitely not the right size */
16030
16031   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
16032   c = a * b;
16033   d = (c + b) / b;
16034   if (d != a+1)
16035     return 0;
16036   return 1;
16037 }
16038
16039 int
16040 main() {
16041   return (! does_int64_work());
16042 }
16043 _ACEOF
16044 if ac_fn_c_try_run "$LINENO"; then :
16045   pgac_cv_type_long_long_int_64=yes
16046 else
16047   pgac_cv_type_long_long_int_64=no
16048 fi
16049 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16050   conftest.$ac_objext conftest.beam conftest.$ac_ext
16051 fi
16052
16053 fi
16054 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_long_long_int_64" >&5
16055 $as_echo "$pgac_cv_type_long_long_int_64" >&6; }
16056
16057 HAVE_LONG_LONG_INT_64=$pgac_cv_type_long_long_int_64
16058 if test x"$pgac_cv_type_long_long_int_64" = xyes ; then
16059
16060 $as_echo "#define HAVE_LONG_LONG_INT_64 1" >>confdefs.h
16061
16062 fi
16063
16064   if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then
16065     pg_int64_type="long long int"
16066   else
16067     as_fn_error $? "Cannot find a working 64-bit integer type." "$LINENO" 5
16068   fi
16069 fi
16070
16071
16072 cat >>confdefs.h <<_ACEOF
16073 #define PG_INT64_TYPE $pg_int64_type
16074 _ACEOF
16075
16076
16077 # If we found "long int" is 64 bits, assume snprintf handles it.  If
16078 # we found we need to use "long long int", better check.  We cope with
16079 # snprintfs that use %lld, %qd, or %I64d as the format.  If none of these
16080 # work, fall back to our own snprintf emulation (which we know uses %lld).
16081
16082 if test "$HAVE_LONG_LONG_INT_64" = yes ; then
16083   if test $pgac_need_repl_snprintf = no; then
16084     { $as_echo "$as_me:${as_lineno-$LINENO}: checking snprintf length modifier for long long int" >&5
16085 $as_echo_n "checking snprintf length modifier for long long int... " >&6; }
16086 if ${pgac_cv_snprintf_long_long_int_modifier+:} false; then :
16087   $as_echo_n "(cached) " >&6
16088 else
16089   for pgac_modifier in 'll' 'q' 'I64'; do
16090 if test "$cross_compiling" = yes; then :
16091   pgac_cv_snprintf_long_long_int_modifier=cross; break
16092 else
16093   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16094 /* end confdefs.h.  */
16095 #include <stdio.h>
16096 #include <string.h>
16097 typedef long long int ac_int64;
16098 #define INT64_FORMAT "%${pgac_modifier}d"
16099
16100 ac_int64 a = 20000001;
16101 ac_int64 b = 40000005;
16102
16103 int does_int64_snprintf_work()
16104 {
16105   ac_int64 c;
16106   char buf[100];
16107
16108   if (sizeof(ac_int64) != 8)
16109     return 0;                   /* doesn't look like the right size */
16110
16111   c = a * b;
16112   snprintf(buf, 100, INT64_FORMAT, c);
16113   if (strcmp(buf, "800000140000005") != 0)
16114     return 0;                   /* either multiply or snprintf is busted */
16115   return 1;
16116 }
16117
16118 int
16119 main() {
16120   return (! does_int64_snprintf_work());
16121 }
16122 _ACEOF
16123 if ac_fn_c_try_run "$LINENO"; then :
16124   pgac_cv_snprintf_long_long_int_modifier=$pgac_modifier; break
16125 fi
16126 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16127   conftest.$ac_objext conftest.beam conftest.$ac_ext
16128 fi
16129
16130 done
16131 fi
16132
16133 LONG_LONG_INT_MODIFIER=''
16134
16135 case $pgac_cv_snprintf_long_long_int_modifier in
16136   cross) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot test (not on host machine)" >&5
16137 $as_echo "cannot test (not on host machine)" >&6; };;
16138   ?*)    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_long_long_int_modifier" >&5
16139 $as_echo "$pgac_cv_snprintf_long_long_int_modifier" >&6; }
16140          LONG_LONG_INT_MODIFIER=$pgac_cv_snprintf_long_long_int_modifier;;
16141   *)     { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
16142 $as_echo "none" >&6; };;
16143 esac
16144     if test "$LONG_LONG_INT_MODIFIER" = ""; then
16145       # Force usage of our own snprintf, since system snprintf is broken
16146       pgac_need_repl_snprintf=yes
16147       LONG_LONG_INT_MODIFIER='ll'
16148     fi
16149   else
16150     # Here if we previously decided we needed to use our own snprintf
16151     LONG_LONG_INT_MODIFIER='ll'
16152   fi
16153 else
16154   # Here if we are not using 'long long int' at all
16155   LONG_LONG_INT_MODIFIER='l'
16156 fi
16157
16158 INT64_MODIFIER="\"$LONG_LONG_INT_MODIFIER\""
16159
16160
16161 cat >>confdefs.h <<_ACEOF
16162 #define INT64_MODIFIER $INT64_MODIFIER
16163 _ACEOF
16164
16165
16166 # Also force use of our snprintf if the system's doesn't support the %z flag.
16167 if test "$pgac_need_repl_snprintf" = no; then
16168   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf supports the %z modifier" >&5
16169 $as_echo_n "checking whether snprintf supports the %z modifier... " >&6; }
16170 if ${pgac_cv_snprintf_size_t_support+:} false; then :
16171   $as_echo_n "(cached) " >&6
16172 else
16173   if test "$cross_compiling" = yes; then :
16174   pgac_cv_snprintf_size_t_support=cross
16175 else
16176   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16177 /* end confdefs.h.  */
16178 #include <stdio.h>
16179 #include <string.h>
16180
16181 int main()
16182 {
16183   char bufz[100];
16184   char buf64[100];
16185
16186   /*
16187    * Print the largest unsigned number fitting in a size_t using both %zu
16188    * and the previously-determined format for 64-bit integers.  Note that
16189    * we don't run this code unless we know snprintf handles 64-bit ints.
16190    */
16191   bufz[0] = '\0';  /* in case snprintf fails to emit anything */
16192   snprintf(bufz, sizeof(bufz), "%zu", ~((size_t) 0));
16193   snprintf(buf64, sizeof(buf64), "%" INT64_MODIFIER "u",
16194     (unsigned PG_INT64_TYPE) ~((size_t) 0));
16195   if (strcmp(bufz, buf64) != 0)
16196     return 1;
16197   return 0;
16198 }
16199 _ACEOF
16200 if ac_fn_c_try_run "$LINENO"; then :
16201   pgac_cv_snprintf_size_t_support=yes
16202 else
16203   pgac_cv_snprintf_size_t_support=no
16204 fi
16205 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16206   conftest.$ac_objext conftest.beam conftest.$ac_ext
16207 fi
16208
16209
16210 fi
16211 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_size_t_support" >&5
16212 $as_echo "$pgac_cv_snprintf_size_t_support" >&6; }
16213
16214   if test "$pgac_cv_snprintf_size_t_support" != yes; then
16215     pgac_need_repl_snprintf=yes
16216   fi
16217 fi
16218
16219 # Now we have checked all the reasons to replace snprintf
16220 if test $pgac_need_repl_snprintf = yes; then
16221
16222 $as_echo "#define USE_REPL_SNPRINTF 1" >>confdefs.h
16223
16224   case " $LIBOBJS " in
16225   *" snprintf.$ac_objext "* ) ;;
16226   *) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
16227  ;;
16228 esac
16229
16230 fi
16231
16232 # has to be down here, rather than with the other builtins, because
16233 # the test uses PG_INT64_TYPE.
16234 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_mul_overflow" >&5
16235 $as_echo_n "checking for __builtin_mul_overflow... " >&6; }
16236 if ${pgac_cv__builtin_op_overflow+:} false; then :
16237   $as_echo_n "(cached) " >&6
16238 else
16239   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16240 /* end confdefs.h.  */
16241
16242 PG_INT64_TYPE a = 1;
16243 PG_INT64_TYPE b = 1;
16244 PG_INT64_TYPE result;
16245 int oflo;
16246
16247 int
16248 main ()
16249 {
16250 oflo = __builtin_mul_overflow(a, b, &result);
16251   ;
16252   return 0;
16253 }
16254 _ACEOF
16255 if ac_fn_c_try_link "$LINENO"; then :
16256   pgac_cv__builtin_op_overflow=yes
16257 else
16258   pgac_cv__builtin_op_overflow=no
16259 fi
16260 rm -f core conftest.err conftest.$ac_objext \
16261     conftest$ac_exeext conftest.$ac_ext
16262 fi
16263 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_op_overflow" >&5
16264 $as_echo "$pgac_cv__builtin_op_overflow" >&6; }
16265 if test x"$pgac_cv__builtin_op_overflow" = xyes ; then
16266
16267 $as_echo "#define HAVE__BUILTIN_OP_OVERFLOW 1" >>confdefs.h
16268
16269 fi
16270
16271 # Check size of void *, size_t (enables tweaks for > 32bit address space)
16272 # The cast to long int works around a bug in the HP C Compiler
16273 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
16274 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
16275 # This bug is HP SR number 8606223364.
16276 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
16277 $as_echo_n "checking size of void *... " >&6; }
16278 if ${ac_cv_sizeof_void_p+:} false; then :
16279   $as_echo_n "(cached) " >&6
16280 else
16281   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p"        "$ac_includes_default"; then :
16282
16283 else
16284   if test "$ac_cv_type_void_p" = yes; then
16285      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16286 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
16287 as_fn_error 77 "cannot compute sizeof (void *)
16288 See \`config.log' for more details" "$LINENO" 5; }
16289    else
16290      ac_cv_sizeof_void_p=0
16291    fi
16292 fi
16293
16294 fi
16295 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
16296 $as_echo "$ac_cv_sizeof_void_p" >&6; }
16297
16298
16299
16300 cat >>confdefs.h <<_ACEOF
16301 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
16302 _ACEOF
16303
16304
16305 # The cast to long int works around a bug in the HP C Compiler
16306 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
16307 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
16308 # This bug is HP SR number 8606223364.
16309 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
16310 $as_echo_n "checking size of size_t... " >&6; }
16311 if ${ac_cv_sizeof_size_t+:} false; then :
16312   $as_echo_n "(cached) " >&6
16313 else
16314   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t"        "$ac_includes_default"; then :
16315
16316 else
16317   if test "$ac_cv_type_size_t" = yes; then
16318      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16319 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
16320 as_fn_error 77 "cannot compute sizeof (size_t)
16321 See \`config.log' for more details" "$LINENO" 5; }
16322    else
16323      ac_cv_sizeof_size_t=0
16324    fi
16325 fi
16326
16327 fi
16328 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
16329 $as_echo "$ac_cv_sizeof_size_t" >&6; }
16330
16331
16332
16333 cat >>confdefs.h <<_ACEOF
16334 #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
16335 _ACEOF
16336
16337
16338 # The cast to long int works around a bug in the HP C Compiler
16339 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
16340 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
16341 # This bug is HP SR number 8606223364.
16342 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
16343 $as_echo_n "checking size of long... " >&6; }
16344 if ${ac_cv_sizeof_long+:} false; then :
16345   $as_echo_n "(cached) " >&6
16346 else
16347   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long"        "$ac_includes_default"; then :
16348
16349 else
16350   if test "$ac_cv_type_long" = yes; then
16351      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16352 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
16353 as_fn_error 77 "cannot compute sizeof (long)
16354 See \`config.log' for more details" "$LINENO" 5; }
16355    else
16356      ac_cv_sizeof_long=0
16357    fi
16358 fi
16359
16360 fi
16361 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
16362 $as_echo "$ac_cv_sizeof_long" >&6; }
16363
16364
16365
16366 cat >>confdefs.h <<_ACEOF
16367 #define SIZEOF_LONG $ac_cv_sizeof_long
16368 _ACEOF
16369
16370
16371
16372 # Decide whether float4 is passed by value: user-selectable, enabled by default
16373 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float4 passed by value" >&5
16374 $as_echo_n "checking whether to build with float4 passed by value... " >&6; }
16375
16376
16377 # Check whether --enable-float4-byval was given.
16378 if test "${enable_float4_byval+set}" = set; then :
16379   enableval=$enable_float4_byval;
16380   case $enableval in
16381     yes)
16382
16383 $as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
16384
16385                float4passbyval=true
16386       ;;
16387     no)
16388       float4passbyval=false
16389       ;;
16390     *)
16391       as_fn_error $? "no argument expected for --enable-float4-byval option" "$LINENO" 5
16392       ;;
16393   esac
16394
16395 else
16396   enable_float4_byval=yes
16397
16398 $as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
16399
16400                float4passbyval=true
16401 fi
16402
16403
16404 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float4_byval" >&5
16405 $as_echo "$enable_float4_byval" >&6; }
16406
16407 cat >>confdefs.h <<_ACEOF
16408 #define FLOAT4PASSBYVAL $float4passbyval
16409 _ACEOF
16410
16411
16412 # Decide whether float8 is passed by value.
16413 # Note: this setting also controls int8 and related types such as timestamp.
16414 # If sizeof(Datum) >= 8, this is user-selectable, enabled by default.
16415 # If not, trying to select it is an error.
16416 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float8 passed by value" >&5
16417 $as_echo_n "checking whether to build with float8 passed by value... " >&6; }
16418 if test $ac_cv_sizeof_void_p -ge 8 ; then
16419
16420
16421 # Check whether --enable-float8-byval was given.
16422 if test "${enable_float8_byval+set}" = set; then :
16423   enableval=$enable_float8_byval;
16424   case $enableval in
16425     yes)
16426       :
16427       ;;
16428     no)
16429       :
16430       ;;
16431     *)
16432       as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5
16433       ;;
16434   esac
16435
16436 else
16437   enable_float8_byval=yes
16438
16439 fi
16440
16441
16442 else
16443
16444
16445 # Check whether --enable-float8-byval was given.
16446 if test "${enable_float8_byval+set}" = set; then :
16447   enableval=$enable_float8_byval;
16448   case $enableval in
16449     yes)
16450       :
16451       ;;
16452     no)
16453       :
16454       ;;
16455     *)
16456       as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5
16457       ;;
16458   esac
16459
16460 else
16461   enable_float8_byval=no
16462
16463 fi
16464
16465
16466   if test "$enable_float8_byval" = yes ; then
16467     as_fn_error $? "--enable-float8-byval is not supported on 32-bit platforms." "$LINENO" 5
16468   fi
16469 fi
16470 if test "$enable_float8_byval" = yes ; then
16471
16472 $as_echo "#define USE_FLOAT8_BYVAL 1" >>confdefs.h
16473
16474   float8passbyval=true
16475 else
16476   float8passbyval=false
16477 fi
16478 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float8_byval" >&5
16479 $as_echo "$enable_float8_byval" >&6; }
16480
16481 cat >>confdefs.h <<_ACEOF
16482 #define FLOAT8PASSBYVAL $float8passbyval
16483 _ACEOF
16484
16485
16486 # Determine memory alignment requirements for the basic C data types.
16487
16488 # The cast to long int works around a bug in the HP C Compiler,
16489 # see AC_CHECK_SIZEOF for more information.
16490 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of short" >&5
16491 $as_echo_n "checking alignment of short... " >&6; }
16492 if ${ac_cv_alignof_short+:} false; then :
16493   $as_echo_n "(cached) " >&6
16494 else
16495   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_short"        "$ac_includes_default
16496 #ifndef offsetof
16497 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
16498 #endif
16499 typedef struct { char x; short y; } ac__type_alignof_;"; then :
16500
16501 else
16502   if test "$ac_cv_type_short" = yes; then
16503      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16504 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
16505 as_fn_error 77 "cannot compute alignment of short
16506 See \`config.log' for more details" "$LINENO" 5; }
16507    else
16508      ac_cv_alignof_short=0
16509    fi
16510 fi
16511
16512 fi
16513 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_short" >&5
16514 $as_echo "$ac_cv_alignof_short" >&6; }
16515
16516
16517
16518 cat >>confdefs.h <<_ACEOF
16519 #define ALIGNOF_SHORT $ac_cv_alignof_short
16520 _ACEOF
16521
16522
16523 # The cast to long int works around a bug in the HP C Compiler,
16524 # see AC_CHECK_SIZEOF for more information.
16525 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of int" >&5
16526 $as_echo_n "checking alignment of int... " >&6; }
16527 if ${ac_cv_alignof_int+:} false; then :
16528   $as_echo_n "(cached) " >&6
16529 else
16530   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_int"        "$ac_includes_default
16531 #ifndef offsetof
16532 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
16533 #endif
16534 typedef struct { char x; int y; } ac__type_alignof_;"; then :
16535
16536 else
16537   if test "$ac_cv_type_int" = yes; then
16538      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16539 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
16540 as_fn_error 77 "cannot compute alignment of int
16541 See \`config.log' for more details" "$LINENO" 5; }
16542    else
16543      ac_cv_alignof_int=0
16544    fi
16545 fi
16546
16547 fi
16548 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_int" >&5
16549 $as_echo "$ac_cv_alignof_int" >&6; }
16550
16551
16552
16553 cat >>confdefs.h <<_ACEOF
16554 #define ALIGNOF_INT $ac_cv_alignof_int
16555 _ACEOF
16556
16557
16558 # The cast to long int works around a bug in the HP C Compiler,
16559 # see AC_CHECK_SIZEOF for more information.
16560 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of long" >&5
16561 $as_echo_n "checking alignment of long... " >&6; }
16562 if ${ac_cv_alignof_long+:} false; then :
16563   $as_echo_n "(cached) " >&6
16564 else
16565   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long"        "$ac_includes_default
16566 #ifndef offsetof
16567 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
16568 #endif
16569 typedef struct { char x; long y; } ac__type_alignof_;"; then :
16570
16571 else
16572   if test "$ac_cv_type_long" = yes; then
16573      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16574 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
16575 as_fn_error 77 "cannot compute alignment of long
16576 See \`config.log' for more details" "$LINENO" 5; }
16577    else
16578      ac_cv_alignof_long=0
16579    fi
16580 fi
16581
16582 fi
16583 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long" >&5
16584 $as_echo "$ac_cv_alignof_long" >&6; }
16585
16586
16587
16588 cat >>confdefs.h <<_ACEOF
16589 #define ALIGNOF_LONG $ac_cv_alignof_long
16590 _ACEOF
16591
16592
16593 if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then
16594   # The cast to long int works around a bug in the HP C Compiler,
16595 # see AC_CHECK_SIZEOF for more information.
16596 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of long long int" >&5
16597 $as_echo_n "checking alignment of long long int... " >&6; }
16598 if ${ac_cv_alignof_long_long_int+:} false; then :
16599   $as_echo_n "(cached) " >&6
16600 else
16601   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long_long_int"        "$ac_includes_default
16602 #ifndef offsetof
16603 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
16604 #endif
16605 typedef struct { char x; long long int y; } ac__type_alignof_;"; then :
16606
16607 else
16608   if test "$ac_cv_type_long_long_int" = yes; then
16609      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16610 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
16611 as_fn_error 77 "cannot compute alignment of long long int
16612 See \`config.log' for more details" "$LINENO" 5; }
16613    else
16614      ac_cv_alignof_long_long_int=0
16615    fi
16616 fi
16617
16618 fi
16619 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long_long_int" >&5
16620 $as_echo "$ac_cv_alignof_long_long_int" >&6; }
16621
16622
16623
16624 cat >>confdefs.h <<_ACEOF
16625 #define ALIGNOF_LONG_LONG_INT $ac_cv_alignof_long_long_int
16626 _ACEOF
16627
16628
16629 fi
16630 # The cast to long int works around a bug in the HP C Compiler,
16631 # see AC_CHECK_SIZEOF for more information.
16632 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of double" >&5
16633 $as_echo_n "checking alignment of double... " >&6; }
16634 if ${ac_cv_alignof_double+:} false; then :
16635   $as_echo_n "(cached) " >&6
16636 else
16637   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_double"        "$ac_includes_default
16638 #ifndef offsetof
16639 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
16640 #endif
16641 typedef struct { char x; double y; } ac__type_alignof_;"; then :
16642
16643 else
16644   if test "$ac_cv_type_double" = yes; then
16645      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16646 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
16647 as_fn_error 77 "cannot compute alignment of double
16648 See \`config.log' for more details" "$LINENO" 5; }
16649    else
16650      ac_cv_alignof_double=0
16651    fi
16652 fi
16653
16654 fi
16655 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_double" >&5
16656 $as_echo "$ac_cv_alignof_double" >&6; }
16657
16658
16659
16660 cat >>confdefs.h <<_ACEOF
16661 #define ALIGNOF_DOUBLE $ac_cv_alignof_double
16662 _ACEOF
16663
16664
16665
16666 # Compute maximum alignment of any basic type.
16667 # We assume long's alignment is at least as strong as char, short, or int;
16668 # but we must check long long (if it is being used for int64) and double.
16669 # Note that we intentionally do not consider any types wider than 64 bits,
16670 # as allowing MAXIMUM_ALIGNOF to exceed 8 would be too much of a penalty
16671 # for disk and memory space.
16672
16673 MAX_ALIGNOF=$ac_cv_alignof_long
16674 if test $MAX_ALIGNOF -lt $ac_cv_alignof_double ; then
16675   MAX_ALIGNOF=$ac_cv_alignof_double
16676 fi
16677 if test x"$HAVE_LONG_LONG_INT_64" = xyes && test $MAX_ALIGNOF -lt $ac_cv_alignof_long_long_int ; then
16678   MAX_ALIGNOF="$ac_cv_alignof_long_long_int"
16679 fi
16680
16681 cat >>confdefs.h <<_ACEOF
16682 #define MAXIMUM_ALIGNOF $MAX_ALIGNOF
16683 _ACEOF
16684
16685
16686
16687 # Some platforms predefine the types int8, int16, etc.  Only check
16688 # a (hopefully) representative subset.
16689 ac_fn_c_check_type "$LINENO" "int8" "ac_cv_type_int8" "#include <stdio.h>
16690 "
16691 if test "x$ac_cv_type_int8" = xyes; then :
16692
16693 cat >>confdefs.h <<_ACEOF
16694 #define HAVE_INT8 1
16695 _ACEOF
16696
16697
16698 fi
16699 ac_fn_c_check_type "$LINENO" "uint8" "ac_cv_type_uint8" "#include <stdio.h>
16700 "
16701 if test "x$ac_cv_type_uint8" = xyes; then :
16702
16703 cat >>confdefs.h <<_ACEOF
16704 #define HAVE_UINT8 1
16705 _ACEOF
16706
16707
16708 fi
16709 ac_fn_c_check_type "$LINENO" "int64" "ac_cv_type_int64" "#include <stdio.h>
16710 "
16711 if test "x$ac_cv_type_int64" = xyes; then :
16712
16713 cat >>confdefs.h <<_ACEOF
16714 #define HAVE_INT64 1
16715 _ACEOF
16716
16717
16718 fi
16719 ac_fn_c_check_type "$LINENO" "uint64" "ac_cv_type_uint64" "#include <stdio.h>
16720 "
16721 if test "x$ac_cv_type_uint64" = xyes; then :
16722
16723 cat >>confdefs.h <<_ACEOF
16724 #define HAVE_UINT64 1
16725 _ACEOF
16726
16727
16728 fi
16729
16730
16731 # Some compilers offer a 128-bit integer scalar type.
16732 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __int128" >&5
16733 $as_echo_n "checking for __int128... " >&6; }
16734 if ${pgac_cv__128bit_int+:} false; then :
16735   $as_echo_n "(cached) " >&6
16736 else
16737   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16738 /* end confdefs.h.  */
16739
16740 /*
16741  * We don't actually run this test, just link it to verify that any support
16742  * functions needed for __int128 are present.
16743  *
16744  * These are globals to discourage the compiler from folding all the
16745  * arithmetic tests down to compile-time constants.  We do not have
16746  * convenient support for 128bit literals at this point...
16747  */
16748 __int128 a = 48828125;
16749 __int128 b = 97656250;
16750
16751 int
16752 main ()
16753 {
16754
16755 __int128 c,d;
16756 a = (a << 12) + 1; /* 200000000001 */
16757 b = (b << 12) + 5; /* 400000000005 */
16758 /* try the most relevant arithmetic ops */
16759 c = a * b;
16760 d = (c + b) / b;
16761 /* must use the results, else compiler may optimize arithmetic away */
16762 if (d != a+1)
16763   return 1;
16764
16765   ;
16766   return 0;
16767 }
16768 _ACEOF
16769 if ac_fn_c_try_link "$LINENO"; then :
16770   pgac_cv__128bit_int=yes
16771 else
16772   pgac_cv__128bit_int=no
16773 fi
16774 rm -f core conftest.err conftest.$ac_objext \
16775     conftest$ac_exeext conftest.$ac_ext
16776 fi
16777 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__128bit_int" >&5
16778 $as_echo "$pgac_cv__128bit_int" >&6; }
16779 if test x"$pgac_cv__128bit_int" = xyes ; then
16780   # Use of non-default alignment with __int128 tickles bugs in some compilers.
16781   # If not cross-compiling, we can test for bugs and disable use of __int128
16782   # with buggy compilers.  If cross-compiling, hope for the best.
16783   # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83925
16784   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __int128 alignment bug" >&5
16785 $as_echo_n "checking for __int128 alignment bug... " >&6; }
16786 if ${pgac_cv__128bit_int_bug+:} false; then :
16787   $as_echo_n "(cached) " >&6
16788 else
16789   if test "$cross_compiling" = yes; then :
16790   pgac_cv__128bit_int_bug="assuming ok"
16791 else
16792   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16793 /* end confdefs.h.  */
16794
16795 /* This must match the corresponding code in c.h: */
16796 #if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__IBMC__)
16797 #define pg_attribute_aligned(a) __attribute__((aligned(a)))
16798 #endif
16799 typedef __int128 int128a
16800 #if defined(pg_attribute_aligned)
16801 pg_attribute_aligned(8)
16802 #endif
16803 ;
16804 int128a holder;
16805 void pass_by_val(void *buffer, int128a par) { holder = par; }
16806
16807 int
16808 main ()
16809 {
16810
16811 long int i64 = 97656225L << 12;
16812 int128a q;
16813 pass_by_val(main, (int128a) i64);
16814 q = (int128a) i64;
16815 if (q != holder)
16816   return 1;
16817
16818   ;
16819   return 0;
16820 }
16821 _ACEOF
16822 if ac_fn_c_try_run "$LINENO"; then :
16823   pgac_cv__128bit_int_bug=ok
16824 else
16825   pgac_cv__128bit_int_bug=broken
16826 fi
16827 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16828   conftest.$ac_objext conftest.beam conftest.$ac_ext
16829 fi
16830
16831 fi
16832 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__128bit_int_bug" >&5
16833 $as_echo "$pgac_cv__128bit_int_bug" >&6; }
16834   if test x"$pgac_cv__128bit_int_bug" != xbroken ; then
16835
16836 $as_echo "#define PG_INT128_TYPE __int128" >>confdefs.h
16837
16838     # The cast to long int works around a bug in the HP C Compiler,
16839 # see AC_CHECK_SIZEOF for more information.
16840 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of PG_INT128_TYPE" >&5
16841 $as_echo_n "checking alignment of PG_INT128_TYPE... " >&6; }
16842 if ${ac_cv_alignof_PG_INT128_TYPE+:} false; then :
16843   $as_echo_n "(cached) " >&6
16844 else
16845   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_PG_INT128_TYPE"        "$ac_includes_default
16846 #ifndef offsetof
16847 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
16848 #endif
16849 typedef struct { char x; PG_INT128_TYPE y; } ac__type_alignof_;"; then :
16850
16851 else
16852   if test "$ac_cv_type_PG_INT128_TYPE" = yes; then
16853      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16854 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
16855 as_fn_error 77 "cannot compute alignment of PG_INT128_TYPE
16856 See \`config.log' for more details" "$LINENO" 5; }
16857    else
16858      ac_cv_alignof_PG_INT128_TYPE=0
16859    fi
16860 fi
16861
16862 fi
16863 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_PG_INT128_TYPE" >&5
16864 $as_echo "$ac_cv_alignof_PG_INT128_TYPE" >&6; }
16865
16866
16867
16868 cat >>confdefs.h <<_ACEOF
16869 #define ALIGNOF_PG_INT128_TYPE $ac_cv_alignof_PG_INT128_TYPE
16870 _ACEOF
16871
16872
16873   fi
16874 fi
16875
16876 # Check for various atomic operations now that we have checked how to declare
16877 # 64bit integers.
16878 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync char locking functions" >&5
16879 $as_echo_n "checking for builtin __sync char locking functions... " >&6; }
16880 if ${pgac_cv_gcc_sync_char_tas+:} false; then :
16881   $as_echo_n "(cached) " >&6
16882 else
16883   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16884 /* end confdefs.h.  */
16885
16886 int
16887 main ()
16888 {
16889 char lock = 0;
16890    __sync_lock_test_and_set(&lock, 1);
16891    __sync_lock_release(&lock);
16892   ;
16893   return 0;
16894 }
16895 _ACEOF
16896 if ac_fn_c_try_link "$LINENO"; then :
16897   pgac_cv_gcc_sync_char_tas="yes"
16898 else
16899   pgac_cv_gcc_sync_char_tas="no"
16900 fi
16901 rm -f core conftest.err conftest.$ac_objext \
16902     conftest$ac_exeext conftest.$ac_ext
16903 fi
16904 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_char_tas" >&5
16905 $as_echo "$pgac_cv_gcc_sync_char_tas" >&6; }
16906 if test x"$pgac_cv_gcc_sync_char_tas" = x"yes"; then
16907
16908 $as_echo "#define HAVE_GCC__SYNC_CHAR_TAS 1" >>confdefs.h
16909
16910 fi
16911 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int32 locking functions" >&5
16912 $as_echo_n "checking for builtin __sync int32 locking functions... " >&6; }
16913 if ${pgac_cv_gcc_sync_int32_tas+:} false; then :
16914   $as_echo_n "(cached) " >&6
16915 else
16916   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16917 /* end confdefs.h.  */
16918
16919 int
16920 main ()
16921 {
16922 int lock = 0;
16923    __sync_lock_test_and_set(&lock, 1);
16924    __sync_lock_release(&lock);
16925   ;
16926   return 0;
16927 }
16928 _ACEOF
16929 if ac_fn_c_try_link "$LINENO"; then :
16930   pgac_cv_gcc_sync_int32_tas="yes"
16931 else
16932   pgac_cv_gcc_sync_int32_tas="no"
16933 fi
16934 rm -f core conftest.err conftest.$ac_objext \
16935     conftest$ac_exeext conftest.$ac_ext
16936 fi
16937 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int32_tas" >&5
16938 $as_echo "$pgac_cv_gcc_sync_int32_tas" >&6; }
16939 if test x"$pgac_cv_gcc_sync_int32_tas" = x"yes"; then
16940
16941 $as_echo "#define HAVE_GCC__SYNC_INT32_TAS 1" >>confdefs.h
16942
16943 fi
16944 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int32 atomic operations" >&5
16945 $as_echo_n "checking for builtin __sync int32 atomic operations... " >&6; }
16946 if ${pgac_cv_gcc_sync_int32_cas+:} false; then :
16947   $as_echo_n "(cached) " >&6
16948 else
16949   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16950 /* end confdefs.h.  */
16951
16952 int
16953 main ()
16954 {
16955 int val = 0;
16956    __sync_val_compare_and_swap(&val, 0, 37);
16957   ;
16958   return 0;
16959 }
16960 _ACEOF
16961 if ac_fn_c_try_link "$LINENO"; then :
16962   pgac_cv_gcc_sync_int32_cas="yes"
16963 else
16964   pgac_cv_gcc_sync_int32_cas="no"
16965 fi
16966 rm -f core conftest.err conftest.$ac_objext \
16967     conftest$ac_exeext conftest.$ac_ext
16968 fi
16969 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int32_cas" >&5
16970 $as_echo "$pgac_cv_gcc_sync_int32_cas" >&6; }
16971 if test x"$pgac_cv_gcc_sync_int32_cas" = x"yes"; then
16972
16973 $as_echo "#define HAVE_GCC__SYNC_INT32_CAS 1" >>confdefs.h
16974
16975 fi
16976 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int64 atomic operations" >&5
16977 $as_echo_n "checking for builtin __sync int64 atomic operations... " >&6; }
16978 if ${pgac_cv_gcc_sync_int64_cas+:} false; then :
16979   $as_echo_n "(cached) " >&6
16980 else
16981   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16982 /* end confdefs.h.  */
16983
16984 int
16985 main ()
16986 {
16987 PG_INT64_TYPE lock = 0;
16988    __sync_val_compare_and_swap(&lock, 0, (PG_INT64_TYPE) 37);
16989   ;
16990   return 0;
16991 }
16992 _ACEOF
16993 if ac_fn_c_try_link "$LINENO"; then :
16994   pgac_cv_gcc_sync_int64_cas="yes"
16995 else
16996   pgac_cv_gcc_sync_int64_cas="no"
16997 fi
16998 rm -f core conftest.err conftest.$ac_objext \
16999     conftest$ac_exeext conftest.$ac_ext
17000 fi
17001 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int64_cas" >&5
17002 $as_echo "$pgac_cv_gcc_sync_int64_cas" >&6; }
17003 if test x"$pgac_cv_gcc_sync_int64_cas" = x"yes"; then
17004
17005 $as_echo "#define HAVE_GCC__SYNC_INT64_CAS 1" >>confdefs.h
17006
17007 fi
17008 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic int32 atomic operations" >&5
17009 $as_echo_n "checking for builtin __atomic int32 atomic operations... " >&6; }
17010 if ${pgac_cv_gcc_atomic_int32_cas+:} false; then :
17011   $as_echo_n "(cached) " >&6
17012 else
17013   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17014 /* end confdefs.h.  */
17015
17016 int
17017 main ()
17018 {
17019 int val = 0;
17020    int expect = 0;
17021    __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
17022   ;
17023   return 0;
17024 }
17025 _ACEOF
17026 if ac_fn_c_try_link "$LINENO"; then :
17027   pgac_cv_gcc_atomic_int32_cas="yes"
17028 else
17029   pgac_cv_gcc_atomic_int32_cas="no"
17030 fi
17031 rm -f core conftest.err conftest.$ac_objext \
17032     conftest$ac_exeext conftest.$ac_ext
17033 fi
17034 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_atomic_int32_cas" >&5
17035 $as_echo "$pgac_cv_gcc_atomic_int32_cas" >&6; }
17036 if test x"$pgac_cv_gcc_atomic_int32_cas" = x"yes"; then
17037
17038 $as_echo "#define HAVE_GCC__ATOMIC_INT32_CAS 1" >>confdefs.h
17039
17040 fi
17041 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic int64 atomic operations" >&5
17042 $as_echo_n "checking for builtin __atomic int64 atomic operations... " >&6; }
17043 if ${pgac_cv_gcc_atomic_int64_cas+:} false; then :
17044   $as_echo_n "(cached) " >&6
17045 else
17046   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17047 /* end confdefs.h.  */
17048
17049 int
17050 main ()
17051 {
17052 PG_INT64_TYPE val = 0;
17053    PG_INT64_TYPE expect = 0;
17054    __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
17055   ;
17056   return 0;
17057 }
17058 _ACEOF
17059 if ac_fn_c_try_link "$LINENO"; then :
17060   pgac_cv_gcc_atomic_int64_cas="yes"
17061 else
17062   pgac_cv_gcc_atomic_int64_cas="no"
17063 fi
17064 rm -f core conftest.err conftest.$ac_objext \
17065     conftest$ac_exeext conftest.$ac_ext
17066 fi
17067 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_atomic_int64_cas" >&5
17068 $as_echo "$pgac_cv_gcc_atomic_int64_cas" >&6; }
17069 if test x"$pgac_cv_gcc_atomic_int64_cas" = x"yes"; then
17070
17071 $as_echo "#define HAVE_GCC__ATOMIC_INT64_CAS 1" >>confdefs.h
17072
17073 fi
17074
17075
17076 # Check for x86 cpuid instruction
17077 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __get_cpuid" >&5
17078 $as_echo_n "checking for __get_cpuid... " >&6; }
17079 if ${pgac_cv__get_cpuid+:} false; then :
17080   $as_echo_n "(cached) " >&6
17081 else
17082   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17083 /* end confdefs.h.  */
17084 #include <cpuid.h>
17085 int
17086 main ()
17087 {
17088 unsigned int exx[4] = {0, 0, 0, 0};
17089   __get_cpuid(1, &exx[0], &exx[1], &exx[2], &exx[3]);
17090
17091   ;
17092   return 0;
17093 }
17094 _ACEOF
17095 if ac_fn_c_try_link "$LINENO"; then :
17096   pgac_cv__get_cpuid="yes"
17097 else
17098   pgac_cv__get_cpuid="no"
17099 fi
17100 rm -f core conftest.err conftest.$ac_objext \
17101     conftest$ac_exeext conftest.$ac_ext
17102 fi
17103 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__get_cpuid" >&5
17104 $as_echo "$pgac_cv__get_cpuid" >&6; }
17105 if test x"$pgac_cv__get_cpuid" = x"yes"; then
17106
17107 $as_echo "#define HAVE__GET_CPUID 1" >>confdefs.h
17108
17109 fi
17110
17111 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __cpuid" >&5
17112 $as_echo_n "checking for __cpuid... " >&6; }
17113 if ${pgac_cv__cpuid+:} false; then :
17114   $as_echo_n "(cached) " >&6
17115 else
17116   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17117 /* end confdefs.h.  */
17118 #include <intrin.h>
17119 int
17120 main ()
17121 {
17122 unsigned int exx[4] = {0, 0, 0, 0};
17123   __get_cpuid(exx[0], 1);
17124
17125   ;
17126   return 0;
17127 }
17128 _ACEOF
17129 if ac_fn_c_try_link "$LINENO"; then :
17130   pgac_cv__cpuid="yes"
17131 else
17132   pgac_cv__cpuid="no"
17133 fi
17134 rm -f core conftest.err conftest.$ac_objext \
17135     conftest$ac_exeext conftest.$ac_ext
17136 fi
17137 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__cpuid" >&5
17138 $as_echo "$pgac_cv__cpuid" >&6; }
17139 if test x"$pgac_cv__cpuid" = x"yes"; then
17140
17141 $as_echo "#define HAVE__CPUID 1" >>confdefs.h
17142
17143 fi
17144
17145 # Check for Intel SSE 4.2 intrinsics to do CRC calculations.
17146 #
17147 # First check if the _mm_crc32_u8 and _mm_crc32_u64 intrinsics can be used
17148 # with the default compiler flags. If not, check if adding the -msse4.2
17149 # flag helps. CFLAGS_SSE42 is set to -msse4.2 if that's required.
17150 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=" >&5
17151 $as_echo_n "checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=... " >&6; }
17152 if ${pgac_cv_sse42_crc32_intrinsics_+:} false; then :
17153   $as_echo_n "(cached) " >&6
17154 else
17155   pgac_save_CFLAGS=$CFLAGS
17156 CFLAGS="$pgac_save_CFLAGS "
17157 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17158 /* end confdefs.h.  */
17159 #include <nmmintrin.h>
17160 int
17161 main ()
17162 {
17163 unsigned int crc = 0;
17164    crc = _mm_crc32_u8(crc, 0);
17165    crc = _mm_crc32_u32(crc, 0);
17166    /* return computed value, to prevent the above being optimized away */
17167    return crc == 0;
17168   ;
17169   return 0;
17170 }
17171 _ACEOF
17172 if ac_fn_c_try_link "$LINENO"; then :
17173   pgac_cv_sse42_crc32_intrinsics_=yes
17174 else
17175   pgac_cv_sse42_crc32_intrinsics_=no
17176 fi
17177 rm -f core conftest.err conftest.$ac_objext \
17178     conftest$ac_exeext conftest.$ac_ext
17179 CFLAGS="$pgac_save_CFLAGS"
17180 fi
17181 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_sse42_crc32_intrinsics_" >&5
17182 $as_echo "$pgac_cv_sse42_crc32_intrinsics_" >&6; }
17183 if test x"$pgac_cv_sse42_crc32_intrinsics_" = x"yes"; then
17184   CFLAGS_SSE42=""
17185   pgac_sse42_crc32_intrinsics=yes
17186 fi
17187
17188 if test x"$pgac_sse42_crc32_intrinsics" != x"yes"; then
17189   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=-msse4.2" >&5
17190 $as_echo_n "checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=-msse4.2... " >&6; }
17191 if ${pgac_cv_sse42_crc32_intrinsics__msse4_2+:} false; then :
17192   $as_echo_n "(cached) " >&6
17193 else
17194   pgac_save_CFLAGS=$CFLAGS
17195 CFLAGS="$pgac_save_CFLAGS -msse4.2"
17196 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17197 /* end confdefs.h.  */
17198 #include <nmmintrin.h>
17199 int
17200 main ()
17201 {
17202 unsigned int crc = 0;
17203    crc = _mm_crc32_u8(crc, 0);
17204    crc = _mm_crc32_u32(crc, 0);
17205    /* return computed value, to prevent the above being optimized away */
17206    return crc == 0;
17207   ;
17208   return 0;
17209 }
17210 _ACEOF
17211 if ac_fn_c_try_link "$LINENO"; then :
17212   pgac_cv_sse42_crc32_intrinsics__msse4_2=yes
17213 else
17214   pgac_cv_sse42_crc32_intrinsics__msse4_2=no
17215 fi
17216 rm -f core conftest.err conftest.$ac_objext \
17217     conftest$ac_exeext conftest.$ac_ext
17218 CFLAGS="$pgac_save_CFLAGS"
17219 fi
17220 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_sse42_crc32_intrinsics__msse4_2" >&5
17221 $as_echo "$pgac_cv_sse42_crc32_intrinsics__msse4_2" >&6; }
17222 if test x"$pgac_cv_sse42_crc32_intrinsics__msse4_2" = x"yes"; then
17223   CFLAGS_SSE42="-msse4.2"
17224   pgac_sse42_crc32_intrinsics=yes
17225 fi
17226
17227 fi
17228
17229
17230 # Are we targeting a processor that supports SSE 4.2? gcc, clang and icc all
17231 # define __SSE4_2__ in that case.
17232 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17233 /* end confdefs.h.  */
17234
17235 int
17236 main ()
17237 {
17238
17239 #ifndef __SSE4_2__
17240 #error __SSE4_2__ not defined
17241 #endif
17242
17243   ;
17244   return 0;
17245 }
17246 _ACEOF
17247 if ac_fn_c_try_compile "$LINENO"; then :
17248   SSE4_2_TARGETED=1
17249 fi
17250 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17251
17252 # Select CRC-32C implementation.
17253 #
17254 # If we are targeting a processor that has SSE 4.2 instructions, we can use the
17255 # special CRC instructions for calculating CRC-32C. If we're not targeting such
17256 # a processor, but we can nevertheless produce code that uses the SSE
17257 # intrinsics, perhaps with some extra CFLAGS, compile both implementations and
17258 # select which one to use at runtime, depending on whether SSE 4.2 is supported
17259 # by the processor we're running on.
17260 #
17261 # You can override this logic by setting the appropriate USE_*_CRC32 flag to 1
17262 # in the template or configure command line.
17263 if test x"$USE_SSE42_CRC32C" = x"" && test x"$USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" = x"" && test x"$USE_SLICING_BY_8_CRC32C" = x""; then
17264   if test x"$pgac_sse42_crc32_intrinsics" = x"yes" && test x"$SSE4_2_TARGETED" = x"1" ; then
17265     USE_SSE42_CRC32C=1
17266   else
17267     # the CPUID instruction is needed for the runtime check.
17268     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
17269       USE_SSE42_CRC32C_WITH_RUNTIME_CHECK=1
17270     else
17271       # fall back to slicing-by-8 algorithm which doesn't require any special
17272       # CPU support.
17273       USE_SLICING_BY_8_CRC32C=1
17274     fi
17275   fi
17276 fi
17277
17278 # Set PG_CRC32C_OBJS appropriately depending on the selected implementation.
17279 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which CRC-32C implementation to use" >&5
17280 $as_echo_n "checking which CRC-32C implementation to use... " >&6; }
17281 if test x"$USE_SSE42_CRC32C" = x"1"; then
17282
17283 $as_echo "#define USE_SSE42_CRC32C 1" >>confdefs.h
17284
17285   PG_CRC32C_OBJS="pg_crc32c_sse42.o"
17286   { $as_echo "$as_me:${as_lineno-$LINENO}: result: SSE 4.2" >&5
17287 $as_echo "SSE 4.2" >&6; }
17288 else
17289   if test x"$USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" = x"1"; then
17290
17291 $as_echo "#define USE_SSE42_CRC32C_WITH_RUNTIME_CHECK 1" >>confdefs.h
17292
17293     PG_CRC32C_OBJS="pg_crc32c_sse42.o pg_crc32c_sb8.o pg_crc32c_choose.o"
17294     { $as_echo "$as_me:${as_lineno-$LINENO}: result: SSE 4.2 with runtime check" >&5
17295 $as_echo "SSE 4.2 with runtime check" >&6; }
17296   else
17297
17298 $as_echo "#define USE_SLICING_BY_8_CRC32C 1" >>confdefs.h
17299
17300     PG_CRC32C_OBJS="pg_crc32c_sb8.o"
17301     { $as_echo "$as_me:${as_lineno-$LINENO}: result: slicing-by-8" >&5
17302 $as_echo "slicing-by-8" >&6; }
17303   fi
17304 fi
17305
17306
17307
17308 # Select semaphore implementation type.
17309 if test "$PORTNAME" != "win32"; then
17310   if test x"$PREFERRED_SEMAPHORES" = x"NAMED_POSIX" ; then
17311     # Need sem_open for this
17312     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_open" >&5
17313 $as_echo_n "checking for library containing sem_open... " >&6; }
17314 if ${ac_cv_search_sem_open+:} false; then :
17315   $as_echo_n "(cached) " >&6
17316 else
17317   ac_func_search_save_LIBS=$LIBS
17318 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17319 /* end confdefs.h.  */
17320
17321 /* Override any GCC internal prototype to avoid an error.
17322    Use char because int might match the return type of a GCC
17323    builtin and then its argument prototype would still apply.  */
17324 #ifdef __cplusplus
17325 extern "C"
17326 #endif
17327 char sem_open ();
17328 int
17329 main ()
17330 {
17331 return sem_open ();
17332   ;
17333   return 0;
17334 }
17335 _ACEOF
17336 for ac_lib in '' rt pthread; do
17337   if test -z "$ac_lib"; then
17338     ac_res="none required"
17339   else
17340     ac_res=-l$ac_lib
17341     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
17342   fi
17343   if ac_fn_c_try_link "$LINENO"; then :
17344   ac_cv_search_sem_open=$ac_res
17345 fi
17346 rm -f core conftest.err conftest.$ac_objext \
17347     conftest$ac_exeext
17348   if ${ac_cv_search_sem_open+:} false; then :
17349   break
17350 fi
17351 done
17352 if ${ac_cv_search_sem_open+:} false; then :
17353
17354 else
17355   ac_cv_search_sem_open=no
17356 fi
17357 rm conftest.$ac_ext
17358 LIBS=$ac_func_search_save_LIBS
17359 fi
17360 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_open" >&5
17361 $as_echo "$ac_cv_search_sem_open" >&6; }
17362 ac_res=$ac_cv_search_sem_open
17363 if test "$ac_res" != no; then :
17364   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
17365   USE_NAMED_POSIX_SEMAPHORES=1
17366 fi
17367
17368   fi
17369   if test x"$PREFERRED_SEMAPHORES" = x"UNNAMED_POSIX" ; then
17370     # Need sem_init for this
17371     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5
17372 $as_echo_n "checking for library containing sem_init... " >&6; }
17373 if ${ac_cv_search_sem_init+:} false; then :
17374   $as_echo_n "(cached) " >&6
17375 else
17376   ac_func_search_save_LIBS=$LIBS
17377 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17378 /* end confdefs.h.  */
17379
17380 /* Override any GCC internal prototype to avoid an error.
17381    Use char because int might match the return type of a GCC
17382    builtin and then its argument prototype would still apply.  */
17383 #ifdef __cplusplus
17384 extern "C"
17385 #endif
17386 char sem_init ();
17387 int
17388 main ()
17389 {
17390 return sem_init ();
17391   ;
17392   return 0;
17393 }
17394 _ACEOF
17395 for ac_lib in '' rt pthread; do
17396   if test -z "$ac_lib"; then
17397     ac_res="none required"
17398   else
17399     ac_res=-l$ac_lib
17400     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
17401   fi
17402   if ac_fn_c_try_link "$LINENO"; then :
17403   ac_cv_search_sem_init=$ac_res
17404 fi
17405 rm -f core conftest.err conftest.$ac_objext \
17406     conftest$ac_exeext
17407   if ${ac_cv_search_sem_init+:} false; then :
17408   break
17409 fi
17410 done
17411 if ${ac_cv_search_sem_init+:} false; then :
17412
17413 else
17414   ac_cv_search_sem_init=no
17415 fi
17416 rm conftest.$ac_ext
17417 LIBS=$ac_func_search_save_LIBS
17418 fi
17419 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_init" >&5
17420 $as_echo "$ac_cv_search_sem_init" >&6; }
17421 ac_res=$ac_cv_search_sem_init
17422 if test "$ac_res" != no; then :
17423   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
17424   USE_UNNAMED_POSIX_SEMAPHORES=1
17425 fi
17426
17427   fi
17428   { $as_echo "$as_me:${as_lineno-$LINENO}: checking which semaphore API to use" >&5
17429 $as_echo_n "checking which semaphore API to use... " >&6; }
17430   if test x"$USE_NAMED_POSIX_SEMAPHORES" = x"1" ; then
17431
17432 $as_echo "#define USE_NAMED_POSIX_SEMAPHORES 1" >>confdefs.h
17433
17434     SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
17435     sematype="named POSIX"
17436   else
17437     if test x"$USE_UNNAMED_POSIX_SEMAPHORES" = x"1" ; then
17438
17439 $as_echo "#define USE_UNNAMED_POSIX_SEMAPHORES 1" >>confdefs.h
17440
17441       SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
17442       sematype="unnamed POSIX"
17443     else
17444
17445 $as_echo "#define USE_SYSV_SEMAPHORES 1" >>confdefs.h
17446
17447       SEMA_IMPLEMENTATION="src/backend/port/sysv_sema.c"
17448       sematype="System V"
17449     fi
17450   fi
17451   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sematype" >&5
17452 $as_echo "$sematype" >&6; }
17453 else
17454
17455 $as_echo "#define USE_WIN32_SEMAPHORES 1" >>confdefs.h
17456
17457   SEMA_IMPLEMENTATION="src/backend/port/win32_sema.c"
17458 fi
17459
17460
17461 # Select shared-memory implementation type.
17462 if test "$PORTNAME" != "win32"; then
17463
17464 $as_echo "#define USE_SYSV_SHARED_MEMORY 1" >>confdefs.h
17465
17466   SHMEM_IMPLEMENTATION="src/backend/port/sysv_shmem.c"
17467 else
17468
17469 $as_echo "#define USE_WIN32_SHARED_MEMORY 1" >>confdefs.h
17470
17471   SHMEM_IMPLEMENTATION="src/backend/port/win32_shmem.c"
17472 fi
17473
17474 # Select random number source
17475 #
17476 # You can override this logic by setting the appropriate USE_*RANDOM flag to 1
17477 # in the template or configure command line.
17478
17479 # If not selected manually, try to select a source automatically.
17480 if test "$enable_strong_random" = "yes" && test x"$USE_OPENSSL_RANDOM" = x"" && test x"$USE_WIN32_RANDOM" = x"" && test x"$USE_DEV_URANDOM" = x"" ; then
17481   if test x"$with_openssl" = x"yes" ; then
17482     USE_OPENSSL_RANDOM=1
17483   elif test "$PORTNAME" = "win32" ; then
17484     USE_WIN32_RANDOM=1
17485   else
17486     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/urandom" >&5
17487 $as_echo_n "checking for /dev/urandom... " >&6; }
17488 if ${ac_cv_file__dev_urandom+:} false; then :
17489   $as_echo_n "(cached) " >&6
17490 else
17491   test "$cross_compiling" = yes &&
17492   as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
17493 if test -r "/dev/urandom"; then
17494   ac_cv_file__dev_urandom=yes
17495 else
17496   ac_cv_file__dev_urandom=no
17497 fi
17498 fi
17499 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_urandom" >&5
17500 $as_echo "$ac_cv_file__dev_urandom" >&6; }
17501 if test "x$ac_cv_file__dev_urandom" = xyes; then :
17502
17503 fi
17504
17505
17506     if test x"$ac_cv_file__dev_urandom" = x"yes" ; then
17507       USE_DEV_URANDOM=1
17508     fi
17509   fi
17510 fi
17511
17512 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which random number source to use" >&5
17513 $as_echo_n "checking which random number source to use... " >&6; }
17514 if test "$enable_strong_random" = yes ; then
17515   if test x"$USE_OPENSSL_RANDOM" = x"1" ; then
17516
17517 $as_echo "#define USE_OPENSSL_RANDOM 1" >>confdefs.h
17518
17519     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL" >&5
17520 $as_echo "OpenSSL" >&6; }
17521   elif test x"$USE_WIN32_RANDOM" = x"1" ; then
17522
17523 $as_echo "#define USE_WIN32_RANDOM 1" >>confdefs.h
17524
17525     { $as_echo "$as_me:${as_lineno-$LINENO}: result: Windows native" >&5
17526 $as_echo "Windows native" >&6; }
17527   elif test x"$USE_DEV_URANDOM" = x"1" ; then
17528
17529 $as_echo "#define USE_DEV_URANDOM 1" >>confdefs.h
17530
17531     { $as_echo "$as_me:${as_lineno-$LINENO}: result: /dev/urandom" >&5
17532 $as_echo "/dev/urandom" >&6; }
17533   else
17534     as_fn_error $? "
17535 no source of strong random numbers was found
17536 PostgreSQL can use OpenSSL or /dev/urandom as a source of random numbers,
17537 for authentication protocols. You can use --disable-strong-random to use a
17538 built-in pseudo random number generator, but that may be insecure." "$LINENO" 5
17539   fi
17540
17541 $as_echo "#define HAVE_STRONG_RANDOM 1" >>confdefs.h
17542
17543 else
17544     { $as_echo "$as_me:${as_lineno-$LINENO}: result: weak builtin PRNG" >&5
17545 $as_echo "weak builtin PRNG" >&6; }
17546     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
17547 *** Not using a strong random number source may be insecure." >&5
17548 $as_echo "$as_me: WARNING:
17549 *** Not using a strong random number source may be insecure." >&2;}
17550 fi
17551
17552 # If not set in template file, set bytes to use libc memset()
17553 if test x"$MEMSET_LOOP_LIMIT" = x"" ; then
17554   MEMSET_LOOP_LIMIT=1024
17555 fi
17556
17557 cat >>confdefs.h <<_ACEOF
17558 #define MEMSET_LOOP_LIMIT ${MEMSET_LOOP_LIMIT}
17559 _ACEOF
17560
17561
17562
17563 if test "$enable_nls" = yes ; then
17564
17565   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing bind_textdomain_codeset" >&5
17566 $as_echo_n "checking for library containing bind_textdomain_codeset... " >&6; }
17567 if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
17568   $as_echo_n "(cached) " >&6
17569 else
17570   ac_func_search_save_LIBS=$LIBS
17571 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17572 /* end confdefs.h.  */
17573
17574 /* Override any GCC internal prototype to avoid an error.
17575    Use char because int might match the return type of a GCC
17576    builtin and then its argument prototype would still apply.  */
17577 #ifdef __cplusplus
17578 extern "C"
17579 #endif
17580 char bind_textdomain_codeset ();
17581 int
17582 main ()
17583 {
17584 return bind_textdomain_codeset ();
17585   ;
17586   return 0;
17587 }
17588 _ACEOF
17589 for ac_lib in '' intl; do
17590   if test -z "$ac_lib"; then
17591     ac_res="none required"
17592   else
17593     ac_res=-l$ac_lib
17594     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
17595   fi
17596   if ac_fn_c_try_link "$LINENO"; then :
17597   ac_cv_search_bind_textdomain_codeset=$ac_res
17598 fi
17599 rm -f core conftest.err conftest.$ac_objext \
17600     conftest$ac_exeext
17601   if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
17602   break
17603 fi
17604 done
17605 if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
17606
17607 else
17608   ac_cv_search_bind_textdomain_codeset=no
17609 fi
17610 rm conftest.$ac_ext
17611 LIBS=$ac_func_search_save_LIBS
17612 fi
17613 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_bind_textdomain_codeset" >&5
17614 $as_echo "$ac_cv_search_bind_textdomain_codeset" >&6; }
17615 ac_res=$ac_cv_search_bind_textdomain_codeset
17616 if test "$ac_res" != no; then :
17617   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
17618
17619 else
17620   as_fn_error $? "a gettext implementation is required for NLS" "$LINENO" 5
17621 fi
17622
17623   ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
17624 if test "x$ac_cv_header_libintl_h" = xyes; then :
17625
17626 else
17627   as_fn_error $? "header file <libintl.h> is required for NLS" "$LINENO" 5
17628 fi
17629
17630
17631   if test -z "$MSGFMT"; then
17632   for ac_prog in msgfmt
17633 do
17634   # Extract the first word of "$ac_prog", so it can be a program name with args.
17635 set dummy $ac_prog; ac_word=$2
17636 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
17637 $as_echo_n "checking for $ac_word... " >&6; }
17638 if ${ac_cv_path_MSGFMT+:} false; then :
17639   $as_echo_n "(cached) " >&6
17640 else
17641   case $MSGFMT in
17642   [\\/]* | ?:[\\/]*)
17643   ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
17644   ;;
17645   *)
17646   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
17647 for as_dir in $PATH
17648 do
17649   IFS=$as_save_IFS
17650   test -z "$as_dir" && as_dir=.
17651     for ac_exec_ext in '' $ac_executable_extensions; do
17652   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
17653     ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext"
17654     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
17655     break 2
17656   fi
17657 done
17658   done
17659 IFS=$as_save_IFS
17660
17661   ;;
17662 esac
17663 fi
17664 MSGFMT=$ac_cv_path_MSGFMT
17665 if test -n "$MSGFMT"; then
17666   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
17667 $as_echo "$MSGFMT" >&6; }
17668 else
17669   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17670 $as_echo "no" >&6; }
17671 fi
17672
17673
17674   test -n "$MSGFMT" && break
17675 done
17676
17677 else
17678   # Report the value of MSGFMT in configure's output in all cases.
17679   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MSGFMT" >&5
17680 $as_echo_n "checking for MSGFMT... " >&6; }
17681   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
17682 $as_echo "$MSGFMT" >&6; }
17683 fi
17684
17685   if test -z "$MSGFMT"; then
17686     as_fn_error $? "msgfmt is required for NLS" "$LINENO" 5
17687   fi
17688   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msgfmt flags" >&5
17689 $as_echo_n "checking for msgfmt flags... " >&6; }
17690 if ${pgac_cv_msgfmt_flags+:} false; then :
17691   $as_echo_n "(cached) " >&6
17692 else
17693   if test x"$MSGFMT" != x"" && "$MSGFMT" --version 2>&1 | grep "GNU" >/dev/null; then
17694     pgac_cv_msgfmt_flags=-c
17695 fi
17696 fi
17697 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_msgfmt_flags" >&5
17698 $as_echo "$pgac_cv_msgfmt_flags" >&6; }
17699   MSGFMT_FLAGS=$pgac_cv_msgfmt_flags
17700
17701   if test -z "$MSGMERGE"; then
17702   for ac_prog in msgmerge
17703 do
17704   # Extract the first word of "$ac_prog", so it can be a program name with args.
17705 set dummy $ac_prog; ac_word=$2
17706 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
17707 $as_echo_n "checking for $ac_word... " >&6; }
17708 if ${ac_cv_path_MSGMERGE+:} false; then :
17709   $as_echo_n "(cached) " >&6
17710 else
17711   case $MSGMERGE in
17712   [\\/]* | ?:[\\/]*)
17713   ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path.
17714   ;;
17715   *)
17716   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
17717 for as_dir in $PATH
17718 do
17719   IFS=$as_save_IFS
17720   test -z "$as_dir" && as_dir=.
17721     for ac_exec_ext in '' $ac_executable_extensions; do
17722   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
17723     ac_cv_path_MSGMERGE="$as_dir/$ac_word$ac_exec_ext"
17724     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
17725     break 2
17726   fi
17727 done
17728   done
17729 IFS=$as_save_IFS
17730
17731   ;;
17732 esac
17733 fi
17734 MSGMERGE=$ac_cv_path_MSGMERGE
17735 if test -n "$MSGMERGE"; then
17736   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
17737 $as_echo "$MSGMERGE" >&6; }
17738 else
17739   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17740 $as_echo "no" >&6; }
17741 fi
17742
17743
17744   test -n "$MSGMERGE" && break
17745 done
17746
17747 else
17748   # Report the value of MSGMERGE in configure's output in all cases.
17749   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MSGMERGE" >&5
17750 $as_echo_n "checking for MSGMERGE... " >&6; }
17751   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
17752 $as_echo "$MSGMERGE" >&6; }
17753 fi
17754
17755   if test -z "$XGETTEXT"; then
17756   for ac_prog in xgettext
17757 do
17758   # Extract the first word of "$ac_prog", so it can be a program name with args.
17759 set dummy $ac_prog; ac_word=$2
17760 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
17761 $as_echo_n "checking for $ac_word... " >&6; }
17762 if ${ac_cv_path_XGETTEXT+:} false; then :
17763   $as_echo_n "(cached) " >&6
17764 else
17765   case $XGETTEXT in
17766   [\\/]* | ?:[\\/]*)
17767   ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
17768   ;;
17769   *)
17770   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
17771 for as_dir in $PATH
17772 do
17773   IFS=$as_save_IFS
17774   test -z "$as_dir" && as_dir=.
17775     for ac_exec_ext in '' $ac_executable_extensions; do
17776   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
17777     ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext"
17778     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
17779     break 2
17780   fi
17781 done
17782   done
17783 IFS=$as_save_IFS
17784
17785   ;;
17786 esac
17787 fi
17788 XGETTEXT=$ac_cv_path_XGETTEXT
17789 if test -n "$XGETTEXT"; then
17790   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
17791 $as_echo "$XGETTEXT" >&6; }
17792 else
17793   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17794 $as_echo "no" >&6; }
17795 fi
17796
17797
17798   test -n "$XGETTEXT" && break
17799 done
17800
17801 else
17802   # Report the value of XGETTEXT in configure's output in all cases.
17803   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XGETTEXT" >&5
17804 $as_echo_n "checking for XGETTEXT... " >&6; }
17805   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
17806 $as_echo "$XGETTEXT" >&6; }
17807 fi
17808
17809
17810 fi
17811
17812 # Check for Tcl configuration script tclConfig.sh
17813 if test "$with_tcl" = yes; then
17814     if test -z "$TCLSH"; then
17815   for ac_prog in tclsh tcl tclsh8.6 tclsh86 tclsh8.5 tclsh85 tclsh8.4 tclsh84
17816 do
17817   # Extract the first word of "$ac_prog", so it can be a program name with args.
17818 set dummy $ac_prog; ac_word=$2
17819 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
17820 $as_echo_n "checking for $ac_word... " >&6; }
17821 if ${ac_cv_path_TCLSH+:} false; then :
17822   $as_echo_n "(cached) " >&6
17823 else
17824   case $TCLSH in
17825   [\\/]* | ?:[\\/]*)
17826   ac_cv_path_TCLSH="$TCLSH" # Let the user override the test with a path.
17827   ;;
17828   *)
17829   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
17830 for as_dir in $PATH
17831 do
17832   IFS=$as_save_IFS
17833   test -z "$as_dir" && as_dir=.
17834     for ac_exec_ext in '' $ac_executable_extensions; do
17835   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
17836     ac_cv_path_TCLSH="$as_dir/$ac_word$ac_exec_ext"
17837     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
17838     break 2
17839   fi
17840 done
17841   done
17842 IFS=$as_save_IFS
17843
17844   ;;
17845 esac
17846 fi
17847 TCLSH=$ac_cv_path_TCLSH
17848 if test -n "$TCLSH"; then
17849   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLSH" >&5
17850 $as_echo "$TCLSH" >&6; }
17851 else
17852   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17853 $as_echo "no" >&6; }
17854 fi
17855
17856
17857   test -n "$TCLSH" && break
17858 done
17859
17860 else
17861   # Report the value of TCLSH in configure's output in all cases.
17862   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TCLSH" >&5
17863 $as_echo_n "checking for TCLSH... " >&6; }
17864   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLSH" >&5
17865 $as_echo "$TCLSH" >&6; }
17866 fi
17867
17868 if test x"$TCLSH" = x""; then
17869   as_fn_error $? "Tcl shell not found" "$LINENO" 5
17870 fi
17871
17872 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclConfig.sh" >&5
17873 $as_echo_n "checking for tclConfig.sh... " >&6; }
17874 # Let user override test
17875 if test -z "$TCL_CONFIG_SH"; then
17876     pgac_test_dirs="$with_tclconfig"
17877
17878     set X $pgac_test_dirs; shift
17879     if test $# -eq 0; then
17880         test -z "$TCLSH" && as_fn_error $? "unable to locate tclConfig.sh because no Tcl shell was found" "$LINENO" 5
17881         set X `echo 'puts $auto_path' | $TCLSH`; shift
17882     fi
17883
17884     for pgac_dir do
17885         if test -r "$pgac_dir/tclConfig.sh"; then
17886             TCL_CONFIG_SH=$pgac_dir/tclConfig.sh
17887             break
17888         fi
17889     done
17890 fi
17891
17892 if test -z "$TCL_CONFIG_SH"; then
17893     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17894 $as_echo "no" >&6; }
17895     as_fn_error $? "file 'tclConfig.sh' is required for Tcl" "$LINENO" 5
17896 else
17897     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCL_CONFIG_SH" >&5
17898 $as_echo "$TCL_CONFIG_SH" >&6; }
17899 fi
17900
17901
17902
17903     . "$TCL_CONFIG_SH"
17904 eval TCL_INCLUDE_SPEC=\"$TCL_INCLUDE_SPEC\"
17905 eval TCL_LIBS=\"$TCL_LIBS\"
17906 eval TCL_LIB_SPEC=\"$TCL_LIB_SPEC\"
17907 eval TCL_SHARED_BUILD=\"$TCL_SHARED_BUILD\"
17908
17909         if test "$TCL_SHARED_BUILD" != 1; then
17910       as_fn_error $? "cannot build PL/Tcl because Tcl is not a shared library
17911 Use --without-tcl to disable building PL/Tcl." "$LINENO" 5
17912     fi
17913     # now that we have TCL_INCLUDE_SPEC, we can check for <tcl.h>
17914     ac_save_CPPFLAGS=$CPPFLAGS
17915     CPPFLAGS="$TCL_INCLUDE_SPEC $CPPFLAGS"
17916     ac_fn_c_check_header_mongrel "$LINENO" "tcl.h" "ac_cv_header_tcl_h" "$ac_includes_default"
17917 if test "x$ac_cv_header_tcl_h" = xyes; then :
17918
17919 else
17920   as_fn_error $? "header file <tcl.h> is required for Tcl" "$LINENO" 5
17921 fi
17922
17923
17924     CPPFLAGS=$ac_save_CPPFLAGS
17925 fi
17926
17927 # check for <perl.h>
17928 if test "$with_perl" = yes; then
17929   ac_save_CPPFLAGS=$CPPFLAGS
17930   CPPFLAGS="$CPPFLAGS -I$perl_archlibexp/CORE"
17931   ac_fn_c_check_header_compile "$LINENO" "perl.h" "ac_cv_header_perl_h" "#include <EXTERN.h>
17932 "
17933 if test "x$ac_cv_header_perl_h" = xyes; then :
17934
17935 else
17936   as_fn_error $? "header file <perl.h> is required for Perl" "$LINENO" 5
17937 fi
17938
17939
17940   # While we're at it, check that we can link to libperl.
17941   # On most platforms, if perl.h is there then libperl.so will be too, but at
17942   # this writing Debian packages them separately.  There is no known reason to
17943   # waste cycles on separate probes for the Tcl or Python libraries, though.
17944   pgac_save_LIBS=$LIBS
17945   LIBS="$perl_embed_ldflags"
17946   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libperl" >&5
17947 $as_echo_n "checking for libperl... " >&6; }
17948   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17949 /* end confdefs.h.  */
17950
17951 #include <EXTERN.h>
17952 #include <perl.h>
17953
17954 int
17955 main ()
17956 {
17957 perl_alloc();
17958   ;
17959   return 0;
17960 }
17961 _ACEOF
17962 if ac_fn_c_try_link "$LINENO"; then :
17963   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
17964 $as_echo "yes" >&6; }
17965 else
17966   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17967 $as_echo "no" >&6; }
17968      as_fn_error $? "libperl library is required for Perl" "$LINENO" 5
17969 fi
17970 rm -f core conftest.err conftest.$ac_objext \
17971     conftest$ac_exeext conftest.$ac_ext
17972   LIBS=$pgac_save_LIBS
17973   CPPFLAGS=$ac_save_CPPFLAGS
17974 fi
17975
17976 # check for <Python.h>
17977 if test "$with_python" = yes; then
17978   ac_save_CPPFLAGS=$CPPFLAGS
17979   CPPFLAGS="$python_includespec $CPPFLAGS"
17980   ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
17981 if test "x$ac_cv_header_Python_h" = xyes; then :
17982
17983 else
17984   as_fn_error $? "header file <Python.h> is required for Python" "$LINENO" 5
17985 fi
17986
17987
17988   CPPFLAGS=$ac_save_CPPFLAGS
17989 fi
17990
17991 #
17992 # Check for DocBook and tools
17993 #
17994 if test -z "$XMLLINT"; then
17995   for ac_prog in xmllint
17996 do
17997   # Extract the first word of "$ac_prog", so it can be a program name with args.
17998 set dummy $ac_prog; ac_word=$2
17999 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18000 $as_echo_n "checking for $ac_word... " >&6; }
18001 if ${ac_cv_path_XMLLINT+:} false; then :
18002   $as_echo_n "(cached) " >&6
18003 else
18004   case $XMLLINT in
18005   [\\/]* | ?:[\\/]*)
18006   ac_cv_path_XMLLINT="$XMLLINT" # Let the user override the test with a path.
18007   ;;
18008   *)
18009   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18010 for as_dir in $PATH
18011 do
18012   IFS=$as_save_IFS
18013   test -z "$as_dir" && as_dir=.
18014     for ac_exec_ext in '' $ac_executable_extensions; do
18015   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18016     ac_cv_path_XMLLINT="$as_dir/$ac_word$ac_exec_ext"
18017     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18018     break 2
18019   fi
18020 done
18021   done
18022 IFS=$as_save_IFS
18023
18024   ;;
18025 esac
18026 fi
18027 XMLLINT=$ac_cv_path_XMLLINT
18028 if test -n "$XMLLINT"; then
18029   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
18030 $as_echo "$XMLLINT" >&6; }
18031 else
18032   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18033 $as_echo "no" >&6; }
18034 fi
18035
18036
18037   test -n "$XMLLINT" && break
18038 done
18039
18040 else
18041   # Report the value of XMLLINT in configure's output in all cases.
18042   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XMLLINT" >&5
18043 $as_echo_n "checking for XMLLINT... " >&6; }
18044   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
18045 $as_echo "$XMLLINT" >&6; }
18046 fi
18047
18048
18049 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XML V4.2" >&5
18050 $as_echo_n "checking for DocBook XML V4.2... " >&6; }
18051 if ${pgac_cv_check_docbook+:} false; then :
18052   $as_echo_n "(cached) " >&6
18053 else
18054   cat >conftest.xml <<EOF
18055 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
18056 <book>
18057  <title>test</title>
18058  <chapter>
18059   <title>random</title>
18060    <sect1>
18061     <title>testsect</title>
18062     <para>text</para>
18063   </sect1>
18064  </chapter>
18065 </book>
18066 EOF
18067
18068 pgac_cv_check_docbook=no
18069
18070 if test -n "$XMLLINT"; then
18071   $XMLLINT --noout --valid conftest.xml 1>&5 2>&1
18072   if test $? -eq 0; then
18073     pgac_cv_check_docbook=yes
18074   fi
18075 fi
18076 rm -f conftest.xml
18077 fi
18078 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_docbook" >&5
18079 $as_echo "$pgac_cv_check_docbook" >&6; }
18080
18081 have_docbook=$pgac_cv_check_docbook
18082
18083
18084 if test -z "$DBTOEPUB"; then
18085   for ac_prog in dbtoepub
18086 do
18087   # Extract the first word of "$ac_prog", so it can be a program name with args.
18088 set dummy $ac_prog; ac_word=$2
18089 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18090 $as_echo_n "checking for $ac_word... " >&6; }
18091 if ${ac_cv_path_DBTOEPUB+:} false; then :
18092   $as_echo_n "(cached) " >&6
18093 else
18094   case $DBTOEPUB in
18095   [\\/]* | ?:[\\/]*)
18096   ac_cv_path_DBTOEPUB="$DBTOEPUB" # Let the user override the test with a path.
18097   ;;
18098   *)
18099   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18100 for as_dir in $PATH
18101 do
18102   IFS=$as_save_IFS
18103   test -z "$as_dir" && as_dir=.
18104     for ac_exec_ext in '' $ac_executable_extensions; do
18105   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18106     ac_cv_path_DBTOEPUB="$as_dir/$ac_word$ac_exec_ext"
18107     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18108     break 2
18109   fi
18110 done
18111   done
18112 IFS=$as_save_IFS
18113
18114   ;;
18115 esac
18116 fi
18117 DBTOEPUB=$ac_cv_path_DBTOEPUB
18118 if test -n "$DBTOEPUB"; then
18119   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18120 $as_echo "$DBTOEPUB" >&6; }
18121 else
18122   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18123 $as_echo "no" >&6; }
18124 fi
18125
18126
18127   test -n "$DBTOEPUB" && break
18128 done
18129
18130 else
18131   # Report the value of DBTOEPUB in configure's output in all cases.
18132   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBTOEPUB" >&5
18133 $as_echo_n "checking for DBTOEPUB... " >&6; }
18134   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18135 $as_echo "$DBTOEPUB" >&6; }
18136 fi
18137
18138 if test -z "$XSLTPROC"; then
18139   for ac_prog in xsltproc
18140 do
18141   # Extract the first word of "$ac_prog", so it can be a program name with args.
18142 set dummy $ac_prog; ac_word=$2
18143 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18144 $as_echo_n "checking for $ac_word... " >&6; }
18145 if ${ac_cv_path_XSLTPROC+:} false; then :
18146   $as_echo_n "(cached) " >&6
18147 else
18148   case $XSLTPROC in
18149   [\\/]* | ?:[\\/]*)
18150   ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
18151   ;;
18152   *)
18153   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18154 for as_dir in $PATH
18155 do
18156   IFS=$as_save_IFS
18157   test -z "$as_dir" && as_dir=.
18158     for ac_exec_ext in '' $ac_executable_extensions; do
18159   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18160     ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
18161     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18162     break 2
18163   fi
18164 done
18165   done
18166 IFS=$as_save_IFS
18167
18168   ;;
18169 esac
18170 fi
18171 XSLTPROC=$ac_cv_path_XSLTPROC
18172 if test -n "$XSLTPROC"; then
18173   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18174 $as_echo "$XSLTPROC" >&6; }
18175 else
18176   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18177 $as_echo "no" >&6; }
18178 fi
18179
18180
18181   test -n "$XSLTPROC" && break
18182 done
18183
18184 else
18185   # Report the value of XSLTPROC in configure's output in all cases.
18186   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSLTPROC" >&5
18187 $as_echo_n "checking for XSLTPROC... " >&6; }
18188   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18189 $as_echo "$XSLTPROC" >&6; }
18190 fi
18191
18192 if test -z "$FOP"; then
18193   for ac_prog in fop
18194 do
18195   # Extract the first word of "$ac_prog", so it can be a program name with args.
18196 set dummy $ac_prog; ac_word=$2
18197 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18198 $as_echo_n "checking for $ac_word... " >&6; }
18199 if ${ac_cv_path_FOP+:} false; then :
18200   $as_echo_n "(cached) " >&6
18201 else
18202   case $FOP in
18203   [\\/]* | ?:[\\/]*)
18204   ac_cv_path_FOP="$FOP" # Let the user override the test with a path.
18205   ;;
18206   *)
18207   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18208 for as_dir in $PATH
18209 do
18210   IFS=$as_save_IFS
18211   test -z "$as_dir" && as_dir=.
18212     for ac_exec_ext in '' $ac_executable_extensions; do
18213   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18214     ac_cv_path_FOP="$as_dir/$ac_word$ac_exec_ext"
18215     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18216     break 2
18217   fi
18218 done
18219   done
18220 IFS=$as_save_IFS
18221
18222   ;;
18223 esac
18224 fi
18225 FOP=$ac_cv_path_FOP
18226 if test -n "$FOP"; then
18227   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18228 $as_echo "$FOP" >&6; }
18229 else
18230   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18231 $as_echo "no" >&6; }
18232 fi
18233
18234
18235   test -n "$FOP" && break
18236 done
18237
18238 else
18239   # Report the value of FOP in configure's output in all cases.
18240   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FOP" >&5
18241 $as_echo_n "checking for FOP... " >&6; }
18242   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18243 $as_echo "$FOP" >&6; }
18244 fi
18245
18246
18247 #
18248 # Check for test tools
18249 #
18250 if test "$enable_tap_tests" = yes; then
18251   # Check for necessary modules, unless user has specified the "prove" to use;
18252   # in that case it's her responsibility to have a working configuration.
18253   # (prove might be part of a different Perl installation than perl, eg on
18254   # MSys, so the result of AX_PROG_PERL_MODULES could be irrelevant anyway.)
18255   if test -z "$PROVE"; then
18256     # Test::More and Time::HiRes are supposed to be part of core Perl,
18257     # but some distros omit them in a minimal installation.
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268 # Make sure we have perl
18269 if test -z "$PERL"; then
18270 # Extract the first word of "perl", so it can be a program name with args.
18271 set dummy perl; ac_word=$2
18272 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18273 $as_echo_n "checking for $ac_word... " >&6; }
18274 if ${ac_cv_prog_PERL+:} false; then :
18275   $as_echo_n "(cached) " >&6
18276 else
18277   if test -n "$PERL"; then
18278   ac_cv_prog_PERL="$PERL" # Let the user override the test.
18279 else
18280 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18281 for as_dir in $PATH
18282 do
18283   IFS=$as_save_IFS
18284   test -z "$as_dir" && as_dir=.
18285     for ac_exec_ext in '' $ac_executable_extensions; do
18286   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18287     ac_cv_prog_PERL="perl"
18288     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18289     break 2
18290   fi
18291 done
18292   done
18293 IFS=$as_save_IFS
18294
18295 fi
18296 fi
18297 PERL=$ac_cv_prog_PERL
18298 if test -n "$PERL"; then
18299   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
18300 $as_echo "$PERL" >&6; }
18301 else
18302   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18303 $as_echo "no" >&6; }
18304 fi
18305
18306
18307 fi
18308
18309 if test "x$PERL" != x; then
18310   ax_perl_modules_failed=0
18311   for ax_perl_module in 'IPC::Run' 'Test::More 0.87' 'Time::HiRes' ; do
18312     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ax_perl_module" >&5
18313 $as_echo_n "checking for perl module $ax_perl_module... " >&6; }
18314
18315     # Would be nice to log result here, but can't rely on autoconf internals
18316     $PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1
18317     if test $? -ne 0; then
18318       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18319 $as_echo "no" >&6; };
18320       ax_perl_modules_failed=1
18321    else
18322       { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
18323 $as_echo "ok" >&6; };
18324     fi
18325   done
18326
18327   # Run optional shell commands
18328   if test "$ax_perl_modules_failed" = 0; then
18329     :
18330
18331   else
18332     :
18333     as_fn_error $? "Additional Perl modules are required to run TAP tests" "$LINENO" 5
18334   fi
18335 else
18336   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5
18337 $as_echo "$as_me: WARNING: could not find perl" >&2;}
18338 fi
18339   fi
18340   # Now make sure we know where prove is
18341   if test -z "$PROVE"; then
18342   for ac_prog in prove
18343 do
18344   # Extract the first word of "$ac_prog", so it can be a program name with args.
18345 set dummy $ac_prog; ac_word=$2
18346 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
18347 $as_echo_n "checking for $ac_word... " >&6; }
18348 if ${ac_cv_path_PROVE+:} false; then :
18349   $as_echo_n "(cached) " >&6
18350 else
18351   case $PROVE in
18352   [\\/]* | ?:[\\/]*)
18353   ac_cv_path_PROVE="$PROVE" # Let the user override the test with a path.
18354   ;;
18355   *)
18356   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18357 for as_dir in $PATH
18358 do
18359   IFS=$as_save_IFS
18360   test -z "$as_dir" && as_dir=.
18361     for ac_exec_ext in '' $ac_executable_extensions; do
18362   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18363     ac_cv_path_PROVE="$as_dir/$ac_word$ac_exec_ext"
18364     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
18365     break 2
18366   fi
18367 done
18368   done
18369 IFS=$as_save_IFS
18370
18371   ;;
18372 esac
18373 fi
18374 PROVE=$ac_cv_path_PROVE
18375 if test -n "$PROVE"; then
18376   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROVE" >&5
18377 $as_echo "$PROVE" >&6; }
18378 else
18379   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18380 $as_echo "no" >&6; }
18381 fi
18382
18383
18384   test -n "$PROVE" && break
18385 done
18386
18387 else
18388   # Report the value of PROVE in configure's output in all cases.
18389   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PROVE" >&5
18390 $as_echo_n "checking for PROVE... " >&6; }
18391   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROVE" >&5
18392 $as_echo "$PROVE" >&6; }
18393 fi
18394
18395   if test -z "$PROVE"; then
18396     as_fn_error $? "prove not found" "$LINENO" 5
18397   fi
18398 fi
18399
18400 # Thread testing
18401
18402 # We have to run the thread test near the end so we have all our symbols
18403 # defined.  Cross compiling throws a warning.
18404 #
18405 if test "$enable_thread_safety" = yes; then
18406 if test "$PORTNAME" != "win32"
18407 then
18408 { $as_echo "$as_me:${as_lineno-$LINENO}: checking thread safety of required library functions" >&5
18409 $as_echo_n "checking thread safety of required library functions... " >&6; }
18410
18411 _CFLAGS="$CFLAGS"
18412 _LIBS="$LIBS"
18413 CFLAGS="$CFLAGS $PTHREAD_CFLAGS -DIN_CONFIGURE"
18414 LIBS="$LIBS $PTHREAD_LIBS"
18415 if test "$cross_compiling" = yes; then :
18416   { $as_echo "$as_me:${as_lineno-$LINENO}: result: maybe" >&5
18417 $as_echo "maybe" >&6; }
18418   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
18419 *** Skipping thread test program because of cross-compile build.
18420 *** Run the program in src/test/thread on the target machine.
18421 " >&5
18422 $as_echo "$as_me: WARNING:
18423 *** Skipping thread test program because of cross-compile build.
18424 *** Run the program in src/test/thread on the target machine.
18425 " >&2;}
18426 else
18427   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18428 /* end confdefs.h.  */
18429 #include "$srcdir/src/test/thread/thread_test.c"
18430 _ACEOF
18431 if ac_fn_c_try_run "$LINENO"; then :
18432   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
18433 $as_echo "yes" >&6; }
18434 else
18435   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18436 $as_echo "no" >&6; }
18437   as_fn_error $? "thread test program failed
18438 This platform is not thread-safe.  Check the file 'config.log' or compile
18439 and run src/test/thread/thread_test for the exact reason.
18440 Use --disable-thread-safety to disable thread safety." "$LINENO" 5
18441 fi
18442 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18443   conftest.$ac_objext conftest.beam conftest.$ac_ext
18444 fi
18445
18446 CFLAGS="$_CFLAGS"
18447 LIBS="$_LIBS"
18448 else
18449 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** skipping thread test on Win32" >&5
18450 $as_echo "$as_me: WARNING: *** skipping thread test on Win32" >&2;}
18451 fi
18452 fi
18453
18454 # If compiler will take -Wl,--as-needed (or various platform-specific
18455 # spellings thereof) then add that to LDFLAGS.  This is much easier than
18456 # trying to filter LIBS to the minimum for each executable.
18457 # On (at least) some Red-Hat-derived systems, this switch breaks linking to
18458 # libreadline; therefore we postpone testing it until we know what library
18459 # dependencies readline has.  The test code will try to link with $LIBS.
18460 if test "$with_readline" = yes; then
18461   link_test_func=readline
18462 else
18463   link_test_func=exit
18464 fi
18465
18466 if test "$PORTNAME" = "darwin"; then
18467   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,-dead_strip_dylibs" >&5
18468 $as_echo_n "checking whether $CC supports -Wl,-dead_strip_dylibs... " >&6; }
18469 if ${pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs+:} false; then :
18470   $as_echo_n "(cached) " >&6
18471 else
18472   pgac_save_LDFLAGS=$LDFLAGS
18473 LDFLAGS="$pgac_save_LDFLAGS -Wl,-dead_strip_dylibs"
18474 if test "$cross_compiling" = yes; then :
18475   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs="assuming no"
18476 else
18477   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18478 /* end confdefs.h.  */
18479 extern void $link_test_func (); void (*fptr) () = $link_test_func;
18480 int
18481 main ()
18482 {
18483
18484   ;
18485   return 0;
18486 }
18487 _ACEOF
18488 if ac_fn_c_try_run "$LINENO"; then :
18489   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=yes
18490 else
18491   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=no
18492 fi
18493 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18494   conftest.$ac_objext conftest.beam conftest.$ac_ext
18495 fi
18496
18497 LDFLAGS="$pgac_save_LDFLAGS"
18498 fi
18499 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&5
18500 $as_echo "$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&6; }
18501 if test x"$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" = x"yes"; then
18502   LDFLAGS="$LDFLAGS -Wl,-dead_strip_dylibs"
18503 fi
18504
18505 elif test "$PORTNAME" = "openbsd"; then
18506   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,-Bdynamic" >&5
18507 $as_echo_n "checking whether $CC supports -Wl,-Bdynamic... " >&6; }
18508 if ${pgac_cv_prog_cc_ldflags__Wl__Bdynamic+:} false; then :
18509   $as_echo_n "(cached) " >&6
18510 else
18511   pgac_save_LDFLAGS=$LDFLAGS
18512 LDFLAGS="$pgac_save_LDFLAGS -Wl,-Bdynamic"
18513 if test "$cross_compiling" = yes; then :
18514   pgac_cv_prog_cc_ldflags__Wl__Bdynamic="assuming no"
18515 else
18516   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18517 /* end confdefs.h.  */
18518 extern void $link_test_func (); void (*fptr) () = $link_test_func;
18519 int
18520 main ()
18521 {
18522
18523   ;
18524   return 0;
18525 }
18526 _ACEOF
18527 if ac_fn_c_try_run "$LINENO"; then :
18528   pgac_cv_prog_cc_ldflags__Wl__Bdynamic=yes
18529 else
18530   pgac_cv_prog_cc_ldflags__Wl__Bdynamic=no
18531 fi
18532 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18533   conftest.$ac_objext conftest.beam conftest.$ac_ext
18534 fi
18535
18536 LDFLAGS="$pgac_save_LDFLAGS"
18537 fi
18538 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&5
18539 $as_echo "$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&6; }
18540 if test x"$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" = x"yes"; then
18541   LDFLAGS="$LDFLAGS -Wl,-Bdynamic"
18542 fi
18543
18544 else
18545   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,--as-needed" >&5
18546 $as_echo_n "checking whether $CC supports -Wl,--as-needed... " >&6; }
18547 if ${pgac_cv_prog_cc_ldflags__Wl___as_needed+:} false; then :
18548   $as_echo_n "(cached) " >&6
18549 else
18550   pgac_save_LDFLAGS=$LDFLAGS
18551 LDFLAGS="$pgac_save_LDFLAGS -Wl,--as-needed"
18552 if test "$cross_compiling" = yes; then :
18553   pgac_cv_prog_cc_ldflags__Wl___as_needed="assuming no"
18554 else
18555   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18556 /* end confdefs.h.  */
18557 extern void $link_test_func (); void (*fptr) () = $link_test_func;
18558 int
18559 main ()
18560 {
18561
18562   ;
18563   return 0;
18564 }
18565 _ACEOF
18566 if ac_fn_c_try_run "$LINENO"; then :
18567   pgac_cv_prog_cc_ldflags__Wl___as_needed=yes
18568 else
18569   pgac_cv_prog_cc_ldflags__Wl___as_needed=no
18570 fi
18571 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
18572   conftest.$ac_objext conftest.beam conftest.$ac_ext
18573 fi
18574
18575 LDFLAGS="$pgac_save_LDFLAGS"
18576 fi
18577 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl___as_needed" >&5
18578 $as_echo "$pgac_cv_prog_cc_ldflags__Wl___as_needed" >&6; }
18579 if test x"$pgac_cv_prog_cc_ldflags__Wl___as_needed" = x"yes"; then
18580   LDFLAGS="$LDFLAGS -Wl,--as-needed"
18581 fi
18582
18583 fi
18584
18585 # Create compiler version string
18586 if test x"$GCC" = x"yes" ; then
18587   cc_string=`${CC} --version | sed q`
18588   case $cc_string in [A-Za-z]*) ;; *) cc_string="GCC $cc_string";; esac
18589 elif test x"$SUN_STUDIO_CC" = x"yes" ; then
18590   cc_string=`${CC} -V 2>&1 | sed q`
18591 else
18592   cc_string=$CC
18593 fi
18594
18595
18596 cat >>confdefs.h <<_ACEOF
18597 #define PG_VERSION_STR "PostgreSQL $PG_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"
18598 _ACEOF
18599
18600
18601 # Supply a numeric version string for use by 3rd party add-ons
18602 # awk -F is a regex on some platforms, and not on others, so make "." a tab
18603 PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |
18604 tr '.' '        ' |
18605 $AWK '{printf "%d%04d", $1, $2}'`"
18606
18607 cat >>confdefs.h <<_ACEOF
18608 #define PG_VERSION_NUM $PG_VERSION_NUM
18609 _ACEOF
18610
18611
18612
18613
18614 # Begin output steps
18615
18616 { $as_echo "$as_me:${as_lineno-$LINENO}: using compiler=$cc_string" >&5
18617 $as_echo "$as_me: using compiler=$cc_string" >&6;}
18618 { $as_echo "$as_me:${as_lineno-$LINENO}: using CFLAGS=$CFLAGS" >&5
18619 $as_echo "$as_me: using CFLAGS=$CFLAGS" >&6;}
18620 { $as_echo "$as_me:${as_lineno-$LINENO}: using CPPFLAGS=$CPPFLAGS" >&5
18621 $as_echo "$as_me: using CPPFLAGS=$CPPFLAGS" >&6;}
18622 { $as_echo "$as_me:${as_lineno-$LINENO}: using LDFLAGS=$LDFLAGS" >&5
18623 $as_echo "$as_me: using LDFLAGS=$LDFLAGS" >&6;}
18624 # Currently only used when LLVM is used
18625 if test "$with_llvm" = yes ; then
18626    { $as_echo "$as_me:${as_lineno-$LINENO}: using CXX=$CXX" >&5
18627 $as_echo "$as_me: using CXX=$CXX" >&6;}
18628    { $as_echo "$as_me:${as_lineno-$LINENO}: using CXXFLAGS=$CXXFLAGS" >&5
18629 $as_echo "$as_me: using CXXFLAGS=$CXXFLAGS" >&6;}
18630    { $as_echo "$as_me:${as_lineno-$LINENO}: using CLANG=$CLANG" >&5
18631 $as_echo "$as_me: using CLANG=$CLANG" >&6;}
18632    { $as_echo "$as_me:${as_lineno-$LINENO}: using BITCODE_CFLAGS=$BITCODE_CFLAGS" >&5
18633 $as_echo "$as_me: using BITCODE_CFLAGS=$BITCODE_CFLAGS" >&6;}
18634    { $as_echo "$as_me:${as_lineno-$LINENO}: using BITCODE_CXXFLAGS=$BITCODE_CXXFLAGS" >&5
18635 $as_echo "$as_me: using BITCODE_CXXFLAGS=$BITCODE_CXXFLAGS" >&6;}
18636 fi
18637
18638 # prepare build tree if outside source tree
18639 # Note 1: test -ef might not exist, but it's more reliable than `pwd`.
18640 # Note 2: /bin/pwd might be better than shell's built-in at getting
18641 #         a symlink-free name.
18642 if ( test "$srcdir" -ef . ) >/dev/null 2>&1 || test "`cd $srcdir && /bin/pwd`" = "`/bin/pwd`"; then
18643   vpath_build=no
18644 else
18645   vpath_build=yes
18646   if test "$no_create" != yes; then
18647     $as_echo_n "preparing build tree... " >&6
18648     pgac_abs_top_srcdir=`cd "$srcdir" && pwd`
18649     $SHELL "$ac_aux_dir/prep_buildtree" "$pgac_abs_top_srcdir" "." \
18650       || as_fn_error $? "failed" "$LINENO" 5
18651     { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
18652 $as_echo "done" >&6; }
18653   fi
18654 fi
18655
18656
18657
18658 ac_config_files="$ac_config_files GNUmakefile src/Makefile.global"
18659
18660
18661 ac_config_links="$ac_config_links src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION} src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION} src/include/dynloader.h:src/backend/port/dynloader/${template}.h src/include/pg_config_os.h:src/include/port/${template}.h src/Makefile.port:src/makefiles/Makefile.${template}"
18662
18663
18664 if test "$PORTNAME" = "win32"; then
18665 ac_config_commands="$ac_config_commands check_win32_symlinks"
18666
18667 fi
18668
18669 ac_config_headers="$ac_config_headers src/include/pg_config.h"
18670
18671
18672 ac_config_headers="$ac_config_headers src/include/pg_config_ext.h"
18673
18674
18675 ac_config_headers="$ac_config_headers src/interfaces/ecpg/include/ecpg_config.h"
18676
18677
18678 cat >confcache <<\_ACEOF
18679 # This file is a shell script that caches the results of configure
18680 # tests run on this system so they can be shared between configure
18681 # scripts and configure runs, see configure's option --config-cache.
18682 # It is not useful on other systems.  If it contains results you don't
18683 # want to keep, you may remove or edit it.
18684 #
18685 # config.status only pays attention to the cache file if you give it
18686 # the --recheck option to rerun configure.
18687 #
18688 # `ac_cv_env_foo' variables (set or unset) will be overridden when
18689 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18690 # following values.
18691
18692 _ACEOF
18693
18694 # The following way of writing the cache mishandles newlines in values,
18695 # but we know of no workaround that is simple, portable, and efficient.
18696 # So, we kill variables containing newlines.
18697 # Ultrix sh set writes to stderr and can't be redirected directly,
18698 # and sets the high bit in the cache file unless we assign to the vars.
18699 (
18700   for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
18701     eval ac_val=\$$ac_var
18702     case $ac_val in #(
18703     *${as_nl}*)
18704       case $ac_var in #(
18705       *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
18706 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
18707       esac
18708       case $ac_var in #(
18709       _ | IFS | as_nl) ;; #(
18710       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
18711       *) { eval $ac_var=; unset $ac_var;} ;;
18712       esac ;;
18713     esac
18714   done
18715
18716   (set) 2>&1 |
18717     case $as_nl`(ac_space=' '; set) 2>&1` in #(
18718     *${as_nl}ac_space=\ *)
18719       # `set' does not quote correctly, so add quotes: double-quote
18720       # substitution turns \\\\ into \\, and sed turns \\ into \.
18721       sed -n \
18722         "s/'/'\\\\''/g;
18723           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18724       ;; #(
18725     *)
18726       # `set' quotes correctly as required by POSIX, so do not add quotes.
18727       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
18728       ;;
18729     esac |
18730     sort
18731 ) |
18732   sed '
18733      /^ac_cv_env_/b end
18734      t clear
18735      :clear
18736      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18737      t end
18738      s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18739      :end' >>confcache
18740 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
18741   if test -w "$cache_file"; then
18742     if test "x$cache_file" != "x/dev/null"; then
18743       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
18744 $as_echo "$as_me: updating cache $cache_file" >&6;}
18745       if test ! -f "$cache_file" || test -h "$cache_file"; then
18746         cat confcache >"$cache_file"
18747       else
18748         case $cache_file in #(
18749         */* | ?:*)
18750           mv -f confcache "$cache_file"$$ &&
18751           mv -f "$cache_file"$$ "$cache_file" ;; #(
18752         *)
18753           mv -f confcache "$cache_file" ;;
18754         esac
18755       fi
18756     fi
18757   else
18758     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
18759 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
18760   fi
18761 fi
18762 rm -f confcache
18763
18764 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18765 # Let make expand exec_prefix.
18766 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18767
18768 DEFS=-DHAVE_CONFIG_H
18769
18770 ac_libobjs=
18771 ac_ltlibobjs=
18772 U=
18773 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
18774   # 1. Remove the extension, and $U if already installed.
18775   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
18776   ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
18777   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
18778   #    will be set to the directory where LIBOBJS objects are built.
18779   as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
18780   as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
18781 done
18782 LIBOBJS=$ac_libobjs
18783
18784 LTLIBOBJS=$ac_ltlibobjs
18785
18786
18787
18788
18789 : "${CONFIG_STATUS=./config.status}"
18790 ac_write_fail=0
18791 ac_clean_files_save=$ac_clean_files
18792 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18793 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
18794 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
18795 as_write_fail=0
18796 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
18797 #! $SHELL
18798 # Generated by $as_me.
18799 # Run this file to recreate the current configuration.
18800 # Compiler output produced by configure, useful for debugging
18801 # configure, is in config.log if it exists.
18802
18803 debug=false
18804 ac_cs_recheck=false
18805 ac_cs_silent=false
18806
18807 SHELL=\${CONFIG_SHELL-$SHELL}
18808 export SHELL
18809 _ASEOF
18810 cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
18811 ## -------------------- ##
18812 ## M4sh Initialization. ##
18813 ## -------------------- ##
18814
18815 # Be more Bourne compatible
18816 DUALCASE=1; export DUALCASE # for MKS sh
18817 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
18818   emulate sh
18819   NULLCMD=:
18820   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
18821   # is contrary to our usage.  Disable this feature.
18822   alias -g '${1+"$@"}'='"$@"'
18823   setopt NO_GLOB_SUBST
18824 else
18825   case `(set -o) 2>/dev/null` in #(
18826   *posix*) :
18827     set -o posix ;; #(
18828   *) :
18829      ;;
18830 esac
18831 fi
18832
18833
18834 as_nl='
18835 '
18836 export as_nl
18837 # Printing a long string crashes Solaris 7 /usr/bin/printf.
18838 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
18839 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
18840 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
18841 # Prefer a ksh shell builtin over an external printf program on Solaris,
18842 # but without wasting forks for bash or zsh.
18843 if test -z "$BASH_VERSION$ZSH_VERSION" \
18844     && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
18845   as_echo='print -r --'
18846   as_echo_n='print -rn --'
18847 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
18848   as_echo='printf %s\n'
18849   as_echo_n='printf %s'
18850 else
18851   if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
18852     as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
18853     as_echo_n='/usr/ucb/echo -n'
18854   else
18855     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
18856     as_echo_n_body='eval
18857       arg=$1;
18858       case $arg in #(
18859       *"$as_nl"*)
18860         expr "X$arg" : "X\\(.*\\)$as_nl";
18861         arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
18862       esac;
18863       expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
18864     '
18865     export as_echo_n_body
18866     as_echo_n='sh -c $as_echo_n_body as_echo'
18867   fi
18868   export as_echo_body
18869   as_echo='sh -c $as_echo_body as_echo'
18870 fi
18871
18872 # The user is always right.
18873 if test "${PATH_SEPARATOR+set}" != set; then
18874   PATH_SEPARATOR=:
18875   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
18876     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
18877       PATH_SEPARATOR=';'
18878   }
18879 fi
18880
18881
18882 # IFS
18883 # We need space, tab and new line, in precisely that order.  Quoting is
18884 # there to prevent editors from complaining about space-tab.
18885 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
18886 # splitting by setting IFS to empty value.)
18887 IFS=" ""        $as_nl"
18888
18889 # Find who we are.  Look in the path if we contain no directory separator.
18890 as_myself=
18891 case $0 in #((
18892   *[\\/]* ) as_myself=$0 ;;
18893   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18894 for as_dir in $PATH
18895 do
18896   IFS=$as_save_IFS
18897   test -z "$as_dir" && as_dir=.
18898     test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
18899   done
18900 IFS=$as_save_IFS
18901
18902      ;;
18903 esac
18904 # We did not find ourselves, most probably we were run as `sh COMMAND'
18905 # in which case we are not to be found in the path.
18906 if test "x$as_myself" = x; then
18907   as_myself=$0
18908 fi
18909 if test ! -f "$as_myself"; then
18910   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
18911   exit 1
18912 fi
18913
18914 # Unset variables that we do not need and which cause bugs (e.g. in
18915 # pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
18916 # suppresses any "Segmentation fault" message there.  '((' could
18917 # trigger a bug in pdksh 5.2.14.
18918 for as_var in BASH_ENV ENV MAIL MAILPATH
18919 do eval test x\${$as_var+set} = xset \
18920   && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
18921 done
18922 PS1='$ '
18923 PS2='> '
18924 PS4='+ '
18925
18926 # NLS nuisances.
18927 LC_ALL=C
18928 export LC_ALL
18929 LANGUAGE=C
18930 export LANGUAGE
18931
18932 # CDPATH.
18933 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
18934
18935
18936 # as_fn_error STATUS ERROR [LINENO LOG_FD]
18937 # ----------------------------------------
18938 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
18939 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
18940 # script with STATUS, using 1 if that was 0.
18941 as_fn_error ()
18942 {
18943   as_status=$1; test $as_status -eq 0 && as_status=1
18944   if test "$4"; then
18945     as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
18946     $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
18947   fi
18948   $as_echo "$as_me: error: $2" >&2
18949   as_fn_exit $as_status
18950 } # as_fn_error
18951
18952
18953 # as_fn_set_status STATUS
18954 # -----------------------
18955 # Set $? to STATUS, without forking.
18956 as_fn_set_status ()
18957 {
18958   return $1
18959 } # as_fn_set_status
18960
18961 # as_fn_exit STATUS
18962 # -----------------
18963 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
18964 as_fn_exit ()
18965 {
18966   set +e
18967   as_fn_set_status $1
18968   exit $1
18969 } # as_fn_exit
18970
18971 # as_fn_unset VAR
18972 # ---------------
18973 # Portably unset VAR.
18974 as_fn_unset ()
18975 {
18976   { eval $1=; unset $1;}
18977 }
18978 as_unset=as_fn_unset
18979 # as_fn_append VAR VALUE
18980 # ----------------------
18981 # Append the text in VALUE to the end of the definition contained in VAR. Take
18982 # advantage of any shell optimizations that allow amortized linear growth over
18983 # repeated appends, instead of the typical quadratic growth present in naive
18984 # implementations.
18985 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
18986   eval 'as_fn_append ()
18987   {
18988     eval $1+=\$2
18989   }'
18990 else
18991   as_fn_append ()
18992   {
18993     eval $1=\$$1\$2
18994   }
18995 fi # as_fn_append
18996
18997 # as_fn_arith ARG...
18998 # ------------------
18999 # Perform arithmetic evaluation on the ARGs, and store the result in the
19000 # global $as_val. Take advantage of shells that can avoid forks. The arguments
19001 # must be portable across $(()) and expr.
19002 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
19003   eval 'as_fn_arith ()
19004   {
19005     as_val=$(( $* ))
19006   }'
19007 else
19008   as_fn_arith ()
19009   {
19010     as_val=`expr "$@" || test $? -eq 1`
19011   }
19012 fi # as_fn_arith
19013
19014
19015 if expr a : '\(a\)' >/dev/null 2>&1 &&
19016    test "X`expr 00001 : '.*\(...\)'`" = X001; then
19017   as_expr=expr
19018 else
19019   as_expr=false
19020 fi
19021
19022 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
19023   as_basename=basename
19024 else
19025   as_basename=false
19026 fi
19027
19028 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
19029   as_dirname=dirname
19030 else
19031   as_dirname=false
19032 fi
19033
19034 as_me=`$as_basename -- "$0" ||
19035 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
19036          X"$0" : 'X\(//\)$' \| \
19037          X"$0" : 'X\(/\)' \| . 2>/dev/null ||
19038 $as_echo X/"$0" |
19039     sed '/^.*\/\([^/][^/]*\)\/*$/{
19040             s//\1/
19041             q
19042           }
19043           /^X\/\(\/\/\)$/{
19044             s//\1/
19045             q
19046           }
19047           /^X\/\(\/\).*/{
19048             s//\1/
19049             q
19050           }
19051           s/.*/./; q'`
19052
19053 # Avoid depending upon Character Ranges.
19054 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
19055 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
19056 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
19057 as_cr_digits='0123456789'
19058 as_cr_alnum=$as_cr_Letters$as_cr_digits
19059
19060 ECHO_C= ECHO_N= ECHO_T=
19061 case `echo -n x` in #(((((
19062 -n*)
19063   case `echo 'xy\c'` in
19064   *c*) ECHO_T=' ';;     # ECHO_T is single tab character.
19065   xy)  ECHO_C='\c';;
19066   *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
19067        ECHO_T=' ';;
19068   esac;;
19069 *)
19070   ECHO_N='-n';;
19071 esac
19072
19073 rm -f conf$$ conf$$.exe conf$$.file
19074 if test -d conf$$.dir; then
19075   rm -f conf$$.dir/conf$$.file
19076 else
19077   rm -f conf$$.dir
19078   mkdir conf$$.dir 2>/dev/null
19079 fi
19080 if (echo >conf$$.file) 2>/dev/null; then
19081   if ln -s conf$$.file conf$$ 2>/dev/null; then
19082     as_ln_s='ln -s'
19083     # ... but there are two gotchas:
19084     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
19085     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
19086     # In both cases, we have to default to `cp -pR'.
19087     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
19088       as_ln_s='cp -pR'
19089   elif ln conf$$.file conf$$ 2>/dev/null; then
19090     as_ln_s=ln
19091   else
19092     as_ln_s='cp -pR'
19093   fi
19094 else
19095   as_ln_s='cp -pR'
19096 fi
19097 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
19098 rmdir conf$$.dir 2>/dev/null
19099
19100
19101 # as_fn_mkdir_p
19102 # -------------
19103 # Create "$as_dir" as a directory, including parents if necessary.
19104 as_fn_mkdir_p ()
19105 {
19106
19107   case $as_dir in #(
19108   -*) as_dir=./$as_dir;;
19109   esac
19110   test -d "$as_dir" || eval $as_mkdir_p || {
19111     as_dirs=
19112     while :; do
19113       case $as_dir in #(
19114       *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
19115       *) as_qdir=$as_dir;;
19116       esac
19117       as_dirs="'$as_qdir' $as_dirs"
19118       as_dir=`$as_dirname -- "$as_dir" ||
19119 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19120          X"$as_dir" : 'X\(//\)[^/]' \| \
19121          X"$as_dir" : 'X\(//\)$' \| \
19122          X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
19123 $as_echo X"$as_dir" |
19124     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
19125             s//\1/
19126             q
19127           }
19128           /^X\(\/\/\)[^/].*/{
19129             s//\1/
19130             q
19131           }
19132           /^X\(\/\/\)$/{
19133             s//\1/
19134             q
19135           }
19136           /^X\(\/\).*/{
19137             s//\1/
19138             q
19139           }
19140           s/.*/./; q'`
19141       test -d "$as_dir" && break
19142     done
19143     test -z "$as_dirs" || eval "mkdir $as_dirs"
19144   } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
19145
19146
19147 } # as_fn_mkdir_p
19148 if mkdir -p . 2>/dev/null; then
19149   as_mkdir_p='mkdir -p "$as_dir"'
19150 else
19151   test -d ./-p && rmdir ./-p
19152   as_mkdir_p=false
19153 fi
19154
19155
19156 # as_fn_executable_p FILE
19157 # -----------------------
19158 # Test if FILE is an executable regular file.
19159 as_fn_executable_p ()
19160 {
19161   test -f "$1" && test -x "$1"
19162 } # as_fn_executable_p
19163 as_test_x='test -x'
19164 as_executable_p=as_fn_executable_p
19165
19166 # Sed expression to map a string onto a valid CPP name.
19167 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
19168
19169 # Sed expression to map a string onto a valid variable name.
19170 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
19171
19172
19173 exec 6>&1
19174 ## ----------------------------------- ##
19175 ## Main body of $CONFIG_STATUS script. ##
19176 ## ----------------------------------- ##
19177 _ASEOF
19178 test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
19179
19180 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19181 # Save the log message, to keep $0 and so on meaningful, and to
19182 # report actual input values of CONFIG_FILES etc. instead of their
19183 # values after options handling.
19184 ac_log="
19185 This file was extended by PostgreSQL $as_me 11devel, which was
19186 generated by GNU Autoconf 2.69.  Invocation command line was
19187
19188   CONFIG_FILES    = $CONFIG_FILES
19189   CONFIG_HEADERS  = $CONFIG_HEADERS
19190   CONFIG_LINKS    = $CONFIG_LINKS
19191   CONFIG_COMMANDS = $CONFIG_COMMANDS
19192   $ $0 $@
19193
19194 on `(hostname || uname -n) 2>/dev/null | sed 1q`
19195 "
19196
19197 _ACEOF
19198
19199 case $ac_config_files in *"
19200 "*) set x $ac_config_files; shift; ac_config_files=$*;;
19201 esac
19202
19203 case $ac_config_headers in *"
19204 "*) set x $ac_config_headers; shift; ac_config_headers=$*;;
19205 esac
19206
19207
19208 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19209 # Files that config.status was made for.
19210 config_files="$ac_config_files"
19211 config_headers="$ac_config_headers"
19212 config_links="$ac_config_links"
19213 config_commands="$ac_config_commands"
19214
19215 _ACEOF
19216
19217 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19218 ac_cs_usage="\
19219 \`$as_me' instantiates files and other configuration actions
19220 from templates according to the current configuration.  Unless the files
19221 and actions are specified as TAGs, all are instantiated by default.
19222
19223 Usage: $0 [OPTION]... [TAG]...
19224
19225   -h, --help       print this help, then exit
19226   -V, --version    print version number and configuration settings, then exit
19227       --config     print configuration, then exit
19228   -q, --quiet, --silent
19229                    do not print progress messages
19230   -d, --debug      don't remove temporary files
19231       --recheck    update $as_me by reconfiguring in the same conditions
19232       --file=FILE[:TEMPLATE]
19233                    instantiate the configuration file FILE
19234       --header=FILE[:TEMPLATE]
19235                    instantiate the configuration header FILE
19236
19237 Configuration files:
19238 $config_files
19239
19240 Configuration headers:
19241 $config_headers
19242
19243 Configuration links:
19244 $config_links
19245
19246 Configuration commands:
19247 $config_commands
19248
19249 Report bugs to <pgsql-bugs@postgresql.org>."
19250
19251 _ACEOF
19252 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19253 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
19254 ac_cs_version="\\
19255 PostgreSQL config.status 11devel
19256 configured by $0, generated by GNU Autoconf 2.69,
19257   with options \\"\$ac_cs_config\\"
19258
19259 Copyright (C) 2012 Free Software Foundation, Inc.
19260 This config.status script is free software; the Free Software Foundation
19261 gives unlimited permission to copy, distribute and modify it."
19262
19263 ac_pwd='$ac_pwd'
19264 srcdir='$srcdir'
19265 INSTALL='$INSTALL'
19266 MKDIR_P='$MKDIR_P'
19267 AWK='$AWK'
19268 test -n "\$AWK" || AWK=awk
19269 _ACEOF
19270
19271 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19272 # The default lists apply if the user does not specify any file.
19273 ac_need_defaults=:
19274 while test $# != 0
19275 do
19276   case $1 in
19277   --*=?*)
19278     ac_option=`expr "X$1" : 'X\([^=]*\)='`
19279     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
19280     ac_shift=:
19281     ;;
19282   --*=)
19283     ac_option=`expr "X$1" : 'X\([^=]*\)='`
19284     ac_optarg=
19285     ac_shift=:
19286     ;;
19287   *)
19288     ac_option=$1
19289     ac_optarg=$2
19290     ac_shift=shift
19291     ;;
19292   esac
19293
19294   case $ac_option in
19295   # Handling of the options.
19296   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
19297     ac_cs_recheck=: ;;
19298   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
19299     $as_echo "$ac_cs_version"; exit ;;
19300   --config | --confi | --conf | --con | --co | --c )
19301     $as_echo "$ac_cs_config"; exit ;;
19302   --debug | --debu | --deb | --de | --d | -d )
19303     debug=: ;;
19304   --file | --fil | --fi | --f )
19305     $ac_shift
19306     case $ac_optarg in
19307     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
19308     '') as_fn_error $? "missing file argument" ;;
19309     esac
19310     as_fn_append CONFIG_FILES " '$ac_optarg'"
19311     ac_need_defaults=false;;
19312   --header | --heade | --head | --hea )
19313     $ac_shift
19314     case $ac_optarg in
19315     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
19316     esac
19317     as_fn_append CONFIG_HEADERS " '$ac_optarg'"
19318     ac_need_defaults=false;;
19319   --he | --h)
19320     # Conflict between --help and --header
19321     as_fn_error $? "ambiguous option: \`$1'
19322 Try \`$0 --help' for more information.";;
19323   --help | --hel | -h )
19324     $as_echo "$ac_cs_usage"; exit ;;
19325   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
19326   | -silent | --silent | --silen | --sile | --sil | --si | --s)
19327     ac_cs_silent=: ;;
19328
19329   # This is an error.
19330   -*) as_fn_error $? "unrecognized option: \`$1'
19331 Try \`$0 --help' for more information." ;;
19332
19333   *) as_fn_append ac_config_targets " $1"
19334      ac_need_defaults=false ;;
19335
19336   esac
19337   shift
19338 done
19339
19340 ac_configure_extra_args=
19341
19342 if $ac_cs_silent; then
19343   exec 6>/dev/null
19344   ac_configure_extra_args="$ac_configure_extra_args --silent"
19345 fi
19346
19347 _ACEOF
19348 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19349 if \$ac_cs_recheck; then
19350   set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
19351   shift
19352   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
19353   CONFIG_SHELL='$SHELL'
19354   export CONFIG_SHELL
19355   exec "\$@"
19356 fi
19357
19358 _ACEOF
19359 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19360 exec 5>>config.log
19361 {
19362   echo
19363   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
19364 ## Running $as_me. ##
19365 _ASBOX
19366   $as_echo "$ac_log"
19367 } >&5
19368
19369 _ACEOF
19370 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19371 _ACEOF
19372
19373 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19374
19375 # Handling of arguments.
19376 for ac_config_target in $ac_config_targets
19377 do
19378   case $ac_config_target in
19379     "src/backend/port/tas.s") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/tas.s:src/backend/port/tas/${tas_file}" ;;
19380     "GNUmakefile") CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;;
19381     "src/Makefile.global") CONFIG_FILES="$CONFIG_FILES src/Makefile.global" ;;
19382     "src/backend/port/dynloader.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c" ;;
19383     "src/backend/port/pg_sema.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}" ;;
19384     "src/backend/port/pg_shmem.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}" ;;
19385     "src/include/dynloader.h") CONFIG_LINKS="$CONFIG_LINKS src/include/dynloader.h:src/backend/port/dynloader/${template}.h" ;;
19386     "src/include/pg_config_os.h") CONFIG_LINKS="$CONFIG_LINKS src/include/pg_config_os.h:src/include/port/${template}.h" ;;
19387     "src/Makefile.port") CONFIG_LINKS="$CONFIG_LINKS src/Makefile.port:src/makefiles/Makefile.${template}" ;;
19388     "check_win32_symlinks") CONFIG_COMMANDS="$CONFIG_COMMANDS check_win32_symlinks" ;;
19389     "src/include/pg_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config.h" ;;
19390     "src/include/pg_config_ext.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config_ext.h" ;;
19391     "src/interfaces/ecpg/include/ecpg_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/interfaces/ecpg/include/ecpg_config.h" ;;
19392
19393   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
19394   esac
19395 done
19396
19397
19398 # If the user did not use the arguments to specify the items to instantiate,
19399 # then the envvar interface is used.  Set only those that are not.
19400 # We use the long form for the default assignment because of an extremely
19401 # bizarre bug on SunOS 4.1.3.
19402 if $ac_need_defaults; then
19403   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
19404   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
19405   test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
19406   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
19407 fi
19408
19409 # Have a temporary directory for convenience.  Make it in the build tree
19410 # simply because there is no reason against having it here, and in addition,
19411 # creating and moving files from /tmp can sometimes cause problems.
19412 # Hook for its removal unless debugging.
19413 # Note that there is a small window in which the directory will not be cleaned:
19414 # after its creation but before its name has been assigned to `$tmp'.
19415 $debug ||
19416 {
19417   tmp= ac_tmp=
19418   trap 'exit_status=$?
19419   : "${ac_tmp:=$tmp}"
19420   { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
19421 ' 0
19422   trap 'as_fn_exit 1' 1 2 13 15
19423 }
19424 # Create a (secure) tmp directory for tmp files.
19425
19426 {
19427   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
19428   test -d "$tmp"
19429 }  ||
19430 {
19431   tmp=./conf$$-$RANDOM
19432   (umask 077 && mkdir "$tmp")
19433 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
19434 ac_tmp=$tmp
19435
19436 # Set up the scripts for CONFIG_FILES section.
19437 # No need to generate them if there are no CONFIG_FILES.
19438 # This happens for instance with `./config.status config.h'.
19439 if test -n "$CONFIG_FILES"; then
19440
19441
19442 ac_cr=`echo X | tr X '\015'`
19443 # On cygwin, bash can eat \r inside `` if the user requested igncr.
19444 # But we know of no other shell where ac_cr would be empty at this
19445 # point, so we can use a bashism as a fallback.
19446 if test "x$ac_cr" = x; then
19447   eval ac_cr=\$\'\\r\'
19448 fi
19449 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
19450 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
19451   ac_cs_awk_cr='\\r'
19452 else
19453   ac_cs_awk_cr=$ac_cr
19454 fi
19455
19456 echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
19457 _ACEOF
19458
19459
19460 {
19461   echo "cat >conf$$subs.awk <<_ACEOF" &&
19462   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
19463   echo "_ACEOF"
19464 } >conf$$subs.sh ||
19465   as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
19466 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
19467 ac_delim='%!_!# '
19468 for ac_last_try in false false false false false :; do
19469   . ./conf$$subs.sh ||
19470     as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
19471
19472   ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
19473   if test $ac_delim_n = $ac_delim_num; then
19474     break
19475   elif $ac_last_try; then
19476     as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
19477   else
19478     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
19479   fi
19480 done
19481 rm -f conf$$subs.sh
19482
19483 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19484 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
19485 _ACEOF
19486 sed -n '
19487 h
19488 s/^/S["/; s/!.*/"]=/
19489 p
19490 g
19491 s/^[^!]*!//
19492 :repl
19493 t repl
19494 s/'"$ac_delim"'$//
19495 t delim
19496 :nl
19497 h
19498 s/\(.\{148\}\)..*/\1/
19499 t more1
19500 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
19501 p
19502 n
19503 b repl
19504 :more1
19505 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
19506 p
19507 g
19508 s/.\{148\}//
19509 t nl
19510 :delim
19511 h
19512 s/\(.\{148\}\)..*/\1/
19513 t more2
19514 s/["\\]/\\&/g; s/^/"/; s/$/"/
19515 p
19516 b
19517 :more2
19518 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
19519 p
19520 g
19521 s/.\{148\}//
19522 t delim
19523 ' <conf$$subs.awk | sed '
19524 /^[^""]/{
19525   N
19526   s/\n//
19527 }
19528 ' >>$CONFIG_STATUS || ac_write_fail=1
19529 rm -f conf$$subs.awk
19530 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19531 _ACAWK
19532 cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
19533   for (key in S) S_is_set[key] = 1
19534   FS = "\a"
19535
19536 }
19537 {
19538   line = $ 0
19539   nfields = split(line, field, "@")
19540   substed = 0
19541   len = length(field[1])
19542   for (i = 2; i < nfields; i++) {
19543     key = field[i]
19544     keylen = length(key)
19545     if (S_is_set[key]) {
19546       value = S[key]
19547       line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
19548       len += length(value) + length(field[++i])
19549       substed = 1
19550     } else
19551       len += 1 + keylen
19552   }
19553
19554   print line
19555 }
19556
19557 _ACAWK
19558 _ACEOF
19559 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19560 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
19561   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
19562 else
19563   cat
19564 fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
19565   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
19566 _ACEOF
19567
19568 # VPATH may cause trouble with some makes, so we remove sole $(srcdir),
19569 # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
19570 # trailing colons and then remove the whole line if VPATH becomes empty
19571 # (actually we leave an empty line to preserve line numbers).
19572 if test "x$srcdir" = x.; then
19573   ac_vpsub='/^[  ]*VPATH[        ]*=[    ]*/{
19574 h
19575 s///
19576 s/^/:/
19577 s/[      ]*$/:/
19578 s/:\$(srcdir):/:/g
19579 s/:\${srcdir}:/:/g
19580 s/:@srcdir@:/:/g
19581 s/^:*//
19582 s/:*$//
19583 x
19584 s/\(=[   ]*\).*/\1/
19585 G
19586 s/\n//
19587 s/^[^=]*=[       ]*$//
19588 }'
19589 fi
19590
19591 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19592 fi # test -n "$CONFIG_FILES"
19593
19594 # Set up the scripts for CONFIG_HEADERS section.
19595 # No need to generate them if there are no CONFIG_HEADERS.
19596 # This happens for instance with `./config.status Makefile'.
19597 if test -n "$CONFIG_HEADERS"; then
19598 cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
19599 BEGIN {
19600 _ACEOF
19601
19602 # Transform confdefs.h into an awk script `defines.awk', embedded as
19603 # here-document in config.status, that substitutes the proper values into
19604 # config.h.in to produce config.h.
19605
19606 # Create a delimiter string that does not exist in confdefs.h, to ease
19607 # handling of long lines.
19608 ac_delim='%!_!# '
19609 for ac_last_try in false false :; do
19610   ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
19611   if test -z "$ac_tt"; then
19612     break
19613   elif $ac_last_try; then
19614     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
19615   else
19616     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
19617   fi
19618 done
19619
19620 # For the awk script, D is an array of macro values keyed by name,
19621 # likewise P contains macro parameters if any.  Preserve backslash
19622 # newline sequences.
19623
19624 ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
19625 sed -n '
19626 s/.\{148\}/&'"$ac_delim"'/g
19627 t rset
19628 :rset
19629 s/^[     ]*#[    ]*define[       ][      ]*/ /
19630 t def
19631 d
19632 :def
19633 s/\\$//
19634 t bsnl
19635 s/["\\]/\\&/g
19636 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
19637 D["\1"]=" \3"/p
19638 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2"/p
19639 d
19640 :bsnl
19641 s/["\\]/\\&/g
19642 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
19643 D["\1"]=" \3\\\\\\n"\\/p
19644 t cont
19645 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
19646 t cont
19647 d
19648 :cont
19649 n
19650 s/.\{148\}/&'"$ac_delim"'/g
19651 t clear
19652 :clear
19653 s/\\$//
19654 t bsnlc
19655 s/["\\]/\\&/g; s/^/"/; s/$/"/p
19656 d
19657 :bsnlc
19658 s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
19659 b cont
19660 ' <confdefs.h | sed '
19661 s/'"$ac_delim"'/"\\\
19662 "/g' >>$CONFIG_STATUS || ac_write_fail=1
19663
19664 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19665   for (key in D) D_is_set[key] = 1
19666   FS = "\a"
19667 }
19668 /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
19669   line = \$ 0
19670   split(line, arg, " ")
19671   if (arg[1] == "#") {
19672     defundef = arg[2]
19673     mac1 = arg[3]
19674   } else {
19675     defundef = substr(arg[1], 2)
19676     mac1 = arg[2]
19677   }
19678   split(mac1, mac2, "(") #)
19679   macro = mac2[1]
19680   prefix = substr(line, 1, index(line, defundef) - 1)
19681   if (D_is_set[macro]) {
19682     # Preserve the white space surrounding the "#".
19683     print prefix "define", macro P[macro] D[macro]
19684     next
19685   } else {
19686     # Replace #undef with comments.  This is necessary, for example,
19687     # in the case of _POSIX_SOURCE, which is predefined and required
19688     # on some systems where configure will not decide to define it.
19689     if (defundef == "undef") {
19690       print "/*", prefix defundef, macro, "*/"
19691       next
19692     }
19693   }
19694 }
19695 { print }
19696 _ACAWK
19697 _ACEOF
19698 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19699   as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
19700 fi # test -n "$CONFIG_HEADERS"
19701
19702
19703 eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS  :L $CONFIG_LINKS  :C $CONFIG_COMMANDS"
19704 shift
19705 for ac_tag
19706 do
19707   case $ac_tag in
19708   :[FHLC]) ac_mode=$ac_tag; continue;;
19709   esac
19710   case $ac_mode$ac_tag in
19711   :[FHL]*:*);;
19712   :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
19713   :[FH]-) ac_tag=-:-;;
19714   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
19715   esac
19716   ac_save_IFS=$IFS
19717   IFS=:
19718   set x $ac_tag
19719   IFS=$ac_save_IFS
19720   shift
19721   ac_file=$1
19722   shift
19723
19724   case $ac_mode in
19725   :L) ac_source=$1;;
19726   :[FH])
19727     ac_file_inputs=
19728     for ac_f
19729     do
19730       case $ac_f in
19731       -) ac_f="$ac_tmp/stdin";;
19732       *) # Look for the file first in the build tree, then in the source tree
19733          # (if the path is not absolute).  The absolute path cannot be DOS-style,
19734          # because $ac_f cannot contain `:'.
19735          test -f "$ac_f" ||
19736            case $ac_f in
19737            [\\/$]*) false;;
19738            *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
19739            esac ||
19740            as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
19741       esac
19742       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
19743       as_fn_append ac_file_inputs " '$ac_f'"
19744     done
19745
19746     # Let's still pretend it is `configure' which instantiates (i.e., don't
19747     # use $as_me), people would be surprised to read:
19748     #    /* config.h.  Generated by config.status.  */
19749     configure_input='Generated from '`
19750           $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
19751         `' by configure.'
19752     if test x"$ac_file" != x-; then
19753       configure_input="$ac_file.  $configure_input"
19754       { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
19755 $as_echo "$as_me: creating $ac_file" >&6;}
19756     fi
19757     # Neutralize special characters interpreted by sed in replacement strings.
19758     case $configure_input in #(
19759     *\&* | *\|* | *\\* )
19760        ac_sed_conf_input=`$as_echo "$configure_input" |
19761        sed 's/[\\\\&|]/\\\\&/g'`;; #(
19762     *) ac_sed_conf_input=$configure_input;;
19763     esac
19764
19765     case $ac_tag in
19766     *:-:* | *:-) cat >"$ac_tmp/stdin" \
19767       || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
19768     esac
19769     ;;
19770   esac
19771
19772   ac_dir=`$as_dirname -- "$ac_file" ||
19773 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19774          X"$ac_file" : 'X\(//\)[^/]' \| \
19775          X"$ac_file" : 'X\(//\)$' \| \
19776          X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
19777 $as_echo X"$ac_file" |
19778     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
19779             s//\1/
19780             q
19781           }
19782           /^X\(\/\/\)[^/].*/{
19783             s//\1/
19784             q
19785           }
19786           /^X\(\/\/\)$/{
19787             s//\1/
19788             q
19789           }
19790           /^X\(\/\).*/{
19791             s//\1/
19792             q
19793           }
19794           s/.*/./; q'`
19795   as_dir="$ac_dir"; as_fn_mkdir_p
19796   ac_builddir=.
19797
19798 case "$ac_dir" in
19799 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
19800 *)
19801   ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
19802   # A ".." for each directory in $ac_dir_suffix.
19803   ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
19804   case $ac_top_builddir_sub in
19805   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
19806   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
19807   esac ;;
19808 esac
19809 ac_abs_top_builddir=$ac_pwd
19810 ac_abs_builddir=$ac_pwd$ac_dir_suffix
19811 # for backward compatibility:
19812 ac_top_builddir=$ac_top_build_prefix
19813
19814 case $srcdir in
19815   .)  # We are building in place.
19816     ac_srcdir=.
19817     ac_top_srcdir=$ac_top_builddir_sub
19818     ac_abs_top_srcdir=$ac_pwd ;;
19819   [\\/]* | ?:[\\/]* )  # Absolute name.
19820     ac_srcdir=$srcdir$ac_dir_suffix;
19821     ac_top_srcdir=$srcdir
19822     ac_abs_top_srcdir=$srcdir ;;
19823   *) # Relative name.
19824     ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
19825     ac_top_srcdir=$ac_top_build_prefix$srcdir
19826     ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
19827 esac
19828 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
19829
19830
19831   case $ac_mode in
19832   :F)
19833   #
19834   # CONFIG_FILE
19835   #
19836
19837   case $INSTALL in
19838   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19839   *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
19840   esac
19841   ac_MKDIR_P=$MKDIR_P
19842   case $MKDIR_P in
19843   [\\/$]* | ?:[\\/]* ) ;;
19844   */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
19845   esac
19846 _ACEOF
19847
19848 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19849 # If the template does not know about datarootdir, expand it.
19850 # FIXME: This hack should be removed a few years after 2.60.
19851 ac_datarootdir_hack=; ac_datarootdir_seen=
19852 ac_sed_dataroot='
19853 /datarootdir/ {
19854   p
19855   q
19856 }
19857 /@datadir@/p
19858 /@docdir@/p
19859 /@infodir@/p
19860 /@localedir@/p
19861 /@mandir@/p'
19862 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
19863 *datarootdir*) ac_datarootdir_seen=yes;;
19864 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
19865   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
19866 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
19867 _ACEOF
19868 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19869   ac_datarootdir_hack='
19870   s&@datadir@&$datadir&g
19871   s&@docdir@&$docdir&g
19872   s&@infodir@&$infodir&g
19873   s&@localedir@&$localedir&g
19874   s&@mandir@&$mandir&g
19875   s&\\\${datarootdir}&$datarootdir&g' ;;
19876 esac
19877 _ACEOF
19878
19879 # Neutralize VPATH when `$srcdir' = `.'.
19880 # Shell code in configure.ac might set extrasub.
19881 # FIXME: do we really want to maintain this feature?
19882 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
19883 ac_sed_extra="$ac_vpsub
19884 $extrasub
19885 _ACEOF
19886 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
19887 :t
19888 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19889 s|@configure_input@|$ac_sed_conf_input|;t t
19890 s&@top_builddir@&$ac_top_builddir_sub&;t t
19891 s&@top_build_prefix@&$ac_top_build_prefix&;t t
19892 s&@srcdir@&$ac_srcdir&;t t
19893 s&@abs_srcdir@&$ac_abs_srcdir&;t t
19894 s&@top_srcdir@&$ac_top_srcdir&;t t
19895 s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
19896 s&@builddir@&$ac_builddir&;t t
19897 s&@abs_builddir@&$ac_abs_builddir&;t t
19898 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
19899 s&@INSTALL@&$ac_INSTALL&;t t
19900 s&@MKDIR_P@&$ac_MKDIR_P&;t t
19901 $ac_datarootdir_hack
19902 "
19903 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
19904   >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
19905
19906 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
19907   { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
19908   { ac_out=`sed -n '/^[  ]*datarootdir[  ]*:*=/p' \
19909       "$ac_tmp/out"`; test -z "$ac_out"; } &&
19910   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
19911 which seems to be undefined.  Please make sure it is defined" >&5
19912 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
19913 which seems to be undefined.  Please make sure it is defined" >&2;}
19914
19915   rm -f "$ac_tmp/stdin"
19916   case $ac_file in
19917   -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
19918   *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
19919   esac \
19920   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
19921  ;;
19922   :H)
19923   #
19924   # CONFIG_HEADER
19925   #
19926   if test x"$ac_file" != x-; then
19927     {
19928       $as_echo "/* $configure_input  */" \
19929       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
19930     } >"$ac_tmp/config.h" \
19931       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
19932     if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
19933       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
19934 $as_echo "$as_me: $ac_file is unchanged" >&6;}
19935     else
19936       rm -f "$ac_file"
19937       mv "$ac_tmp/config.h" "$ac_file" \
19938         || as_fn_error $? "could not create $ac_file" "$LINENO" 5
19939     fi
19940   else
19941     $as_echo "/* $configure_input  */" \
19942       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
19943       || as_fn_error $? "could not create -" "$LINENO" 5
19944   fi
19945  ;;
19946   :L)
19947   #
19948   # CONFIG_LINK
19949   #
19950
19951   if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
19952     :
19953   else
19954     # Prefer the file from the source tree if names are identical.
19955     if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
19956       ac_source=$srcdir/$ac_source
19957     fi
19958
19959     { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
19960 $as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
19961
19962     if test ! -r "$ac_source"; then
19963       as_fn_error $? "$ac_source: file not found" "$LINENO" 5
19964     fi
19965     rm -f "$ac_file"
19966
19967     # Try a relative symlink, then a hard link, then a copy.
19968     case $ac_source in
19969     [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
19970         *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
19971     esac
19972     ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
19973       ln "$ac_source" "$ac_file" 2>/dev/null ||
19974       cp -p "$ac_source" "$ac_file" ||
19975       as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
19976   fi
19977  ;;
19978   :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
19979 $as_echo "$as_me: executing $ac_file commands" >&6;}
19980  ;;
19981   esac
19982
19983
19984   case $ac_file$ac_mode in
19985     "check_win32_symlinks":C)
19986 # Links sometimes fail undetected on Mingw -
19987 # so here we detect it and warn the user
19988 for FILE in $CONFIG_LINKS
19989  do
19990         # test -e works for symlinks in the MinGW console
19991         test -e `expr "$FILE" : '\([^:]*\)'` || { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** link for $FILE -- please fix by hand" >&5
19992 $as_echo "$as_me: WARNING: *** link for $FILE -- please fix by hand" >&2;}
19993  done
19994  ;;
19995     "src/include/pg_config.h":H)
19996 # Update timestamp for pg_config.h (see Makefile.global)
19997 echo >src/include/stamp-h
19998  ;;
19999     "src/include/pg_config_ext.h":H)
20000 # Update timestamp for pg_config_ext.h (see Makefile.global)
20001 echo >src/include/stamp-ext-h
20002  ;;
20003     "src/interfaces/ecpg/include/ecpg_config.h":H) echo >src/interfaces/ecpg/include/stamp-h ;;
20004
20005   esac
20006 done # for ac_tag
20007
20008
20009 as_fn_exit 0
20010 _ACEOF
20011 ac_clean_files=$ac_clean_files_save
20012
20013 test $ac_write_fail = 0 ||
20014   as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
20015
20016
20017 # configure is writing to config.log, and then calls config.status.
20018 # config.status does its own redirection, appending to config.log.
20019 # Unfortunately, on DOS this fails, as config.log is still kept open
20020 # by configure, so config.status won't be able to write to it; its
20021 # output is simply discarded.  So we exec the FD to /dev/null,
20022 # effectively closing config.log, so it can be properly (re)opened and
20023 # appended to by config.status.  When coming back to configure, we
20024 # need to make the FD available again.
20025 if test "$no_create" != yes; then
20026   ac_cs_success=:
20027   ac_config_status_args=
20028   test "$silent" = yes &&
20029     ac_config_status_args="$ac_config_status_args --quiet"
20030   exec 5>/dev/null
20031   $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
20032   exec 5>>config.log
20033   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
20034   # would make configure fail if this is the last instruction.
20035   $ac_cs_success || as_fn_exit 1
20036 fi
20037 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
20038   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
20039 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
20040 fi
20041