]> granicus.if.org Git - postgresql/blob - configure
Make numeric form of PG version number readily available in Makefiles.
[postgresql] / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by GNU Autoconf 2.69 for PostgreSQL 9.6devel.
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-2015, 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='9.6devel'
586 PACKAGE_STRING='PostgreSQL 9.6devel'
587 PACKAGE_BUGREPORT='pgsql-bugs@postgresql.org'
588 PACKAGE_URL=''
589
590 ac_unique_file="src/backend/access/common/heaptuple.c"
591 ac_default_prefix=/usr/local/pgsql
592 # Factoring default headers for most tests.
593 ac_includes_default="\
594 #include <stdio.h>
595 #ifdef HAVE_SYS_TYPES_H
596 # include <sys/types.h>
597 #endif
598 #ifdef HAVE_SYS_STAT_H
599 # include <sys/stat.h>
600 #endif
601 #ifdef STDC_HEADERS
602 # include <stdlib.h>
603 # include <stddef.h>
604 #else
605 # ifdef HAVE_STDLIB_H
606 #  include <stdlib.h>
607 # endif
608 #endif
609 #ifdef HAVE_STRING_H
610 # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
611 #  include <memory.h>
612 # endif
613 # include <string.h>
614 #endif
615 #ifdef HAVE_STRINGS_H
616 # include <strings.h>
617 #endif
618 #ifdef HAVE_INTTYPES_H
619 # include <inttypes.h>
620 #endif
621 #ifdef HAVE_STDINT_H
622 # include <stdint.h>
623 #endif
624 #ifdef HAVE_UNISTD_H
625 # include <unistd.h>
626 #endif"
627
628 ac_subst_vars='LTLIBOBJS
629 vpath_build
630 PG_VERSION_NUM
631 PROVE
632 OSX
633 XSLTPROC
634 XMLLINT
635 DBTOEPUB
636 COLLATEINDEX
637 DOCBOOKSTYLE
638 have_docbook
639 JADE
640 NSGMLS
641 TCL_SHLIB_LD_LIBS
642 TCL_SHARED_BUILD
643 TCL_LIB_SPEC
644 TCL_LIBS
645 TCL_INCLUDE_SPEC
646 TCL_CONFIG_SH
647 TCLSH
648 XGETTEXT
649 MSGMERGE
650 MSGFMT_FLAGS
651 MSGFMT
652 HAVE_POSIX_SIGNALS
653 PG_CRC32C_OBJS
654 CFLAGS_SSE42
655 LDAP_LIBS_BE
656 LDAP_LIBS_FE
657 PTHREAD_CFLAGS
658 PTHREAD_LIBS
659 acx_pthread_config
660 have_win32_dbghelp
661 HAVE_IPV6
662 LIBOBJS
663 UUID_LIBS
664 ZIC
665 python_additional_libs
666 python_libspec
667 python_libdir
668 python_includespec
669 python_version
670 python_majorversion
671 PYTHON
672 perl_embed_ldflags
673 perl_useshrplib
674 perl_privlibexp
675 perl_archlibexp
676 PERL
677 FLEXFLAGS
678 FLEX
679 BISONFLAGS
680 BISON
681 MKDIR_P
682 AWK
683 LN_S
684 TAR
685 install_bin
686 INSTALL_DATA
687 INSTALL_SCRIPT
688 INSTALL_PROGRAM
689 WINDRES
690 DLLWRAP
691 DLLTOOL
692 AR
693 STRIP_SHARED_LIB
694 STRIP_STATIC_LIB
695 STRIP
696 RANLIB
697 ld_R_works
698 with_gnu_ld
699 LD
700 LDFLAGS_SL
701 LDFLAGS_EX
702 ELF_SYS
703 EGREP
704 GREP
705 with_zlib
706 with_system_tzdata
707 with_libxslt
708 with_libxml
709 XML2_CONFIG
710 UUID_EXTRA_OBJS
711 with_uuid
712 with_selinux
713 with_openssl
714 krb_srvtab
715 with_python
716 with_perl
717 with_tcl
718 enable_thread_safety
719 INCLUDES
720 autodepend
721 TAS
722 GCC
723 CPP
724 CFLAGS_VECTOR
725 SUN_STUDIO_CC
726 OBJEXT
727 EXEEXT
728 ac_ct_CC
729 CPPFLAGS
730 LDFLAGS
731 CFLAGS
732 CC
733 enable_tap_tests
734 enable_dtrace
735 DTRACEFLAGS
736 DTRACE
737 enable_coverage
738 GENHTML
739 LCOV
740 GCOV
741 enable_debug
742 enable_rpath
743 default_port
744 WANTED_LANGUAGES
745 enable_nls
746 PORTNAME
747 host_os
748 host_vendor
749 host_cpu
750 host
751 build_os
752 build_vendor
753 build_cpu
754 build
755 PG_MAJORVERSION
756 configure_args
757 target_alias
758 host_alias
759 build_alias
760 LIBS
761 ECHO_T
762 ECHO_N
763 ECHO_C
764 DEFS
765 mandir
766 localedir
767 libdir
768 psdir
769 pdfdir
770 dvidir
771 htmldir
772 infodir
773 docdir
774 oldincludedir
775 includedir
776 localstatedir
777 sharedstatedir
778 sysconfdir
779 datadir
780 datarootdir
781 libexecdir
782 sbindir
783 bindir
784 program_transform_name
785 prefix
786 exec_prefix
787 PACKAGE_URL
788 PACKAGE_BUGREPORT
789 PACKAGE_STRING
790 PACKAGE_VERSION
791 PACKAGE_TARNAME
792 PACKAGE_NAME
793 PATH_SEPARATOR
794 SHELL'
795 ac_subst_files=''
796 ac_user_opts='
797 enable_option_checking
798 with_extra_version
799 with_template
800 with_includes
801 with_libraries
802 with_libs
803 enable_integer_datetimes
804 enable_nls
805 with_pgport
806 enable_rpath
807 enable_spinlocks
808 enable_atomics
809 enable_debug
810 enable_profiling
811 enable_coverage
812 enable_dtrace
813 enable_tap_tests
814 with_blocksize
815 with_segsize
816 with_wal_blocksize
817 with_wal_segsize
818 with_CC
819 enable_depend
820 enable_cassert
821 enable_thread_safety
822 with_tcl
823 with_tclconfig
824 with_perl
825 with_python
826 with_gssapi
827 with_krb_srvnam
828 with_pam
829 with_ldap
830 with_bonjour
831 with_openssl
832 with_selinux
833 with_readline
834 with_libedit_preferred
835 with_uuid
836 with_ossp_uuid
837 with_libxml
838 with_libxslt
839 with_system_tzdata
840 with_zlib
841 with_gnu_ld
842 enable_largefile
843 enable_float4_byval
844 enable_float8_byval
845 '
846       ac_precious_vars='build_alias
847 host_alias
848 target_alias
849 CC
850 CFLAGS
851 LDFLAGS
852 LIBS
853 CPPFLAGS
854 CPP
855 LDFLAGS_EX
856 LDFLAGS_SL
857 DOCBOOKSTYLE'
858
859
860 # Initialize some variables set by options.
861 ac_init_help=
862 ac_init_version=false
863 ac_unrecognized_opts=
864 ac_unrecognized_sep=
865 # The variables have the same names as the options, with
866 # dashes changed to underlines.
867 cache_file=/dev/null
868 exec_prefix=NONE
869 no_create=
870 no_recursion=
871 prefix=NONE
872 program_prefix=NONE
873 program_suffix=NONE
874 program_transform_name=s,x,x,
875 silent=
876 site=
877 srcdir=
878 verbose=
879 x_includes=NONE
880 x_libraries=NONE
881
882 # Installation directory options.
883 # These are left unexpanded so users can "make install exec_prefix=/foo"
884 # and all the variables that are supposed to be based on exec_prefix
885 # by default will actually change.
886 # Use braces instead of parens because sh, perl, etc. also accept them.
887 # (The list follows the same order as the GNU Coding Standards.)
888 bindir='${exec_prefix}/bin'
889 sbindir='${exec_prefix}/sbin'
890 libexecdir='${exec_prefix}/libexec'
891 datarootdir='${prefix}/share'
892 datadir='${datarootdir}'
893 sysconfdir='${prefix}/etc'
894 sharedstatedir='${prefix}/com'
895 localstatedir='${prefix}/var'
896 includedir='${prefix}/include'
897 oldincludedir='/usr/include'
898 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
899 infodir='${datarootdir}/info'
900 htmldir='${docdir}'
901 dvidir='${docdir}'
902 pdfdir='${docdir}'
903 psdir='${docdir}'
904 libdir='${exec_prefix}/lib'
905 localedir='${datarootdir}/locale'
906 mandir='${datarootdir}/man'
907
908 ac_prev=
909 ac_dashdash=
910 for ac_option
911 do
912   # If the previous option needs an argument, assign it.
913   if test -n "$ac_prev"; then
914     eval $ac_prev=\$ac_option
915     ac_prev=
916     continue
917   fi
918
919   case $ac_option in
920   *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
921   *=)   ac_optarg= ;;
922   *)    ac_optarg=yes ;;
923   esac
924
925   # Accept the important Cygnus configure options, so we can diagnose typos.
926
927   case $ac_dashdash$ac_option in
928   --)
929     ac_dashdash=yes ;;
930
931   -bindir | --bindir | --bindi | --bind | --bin | --bi)
932     ac_prev=bindir ;;
933   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
934     bindir=$ac_optarg ;;
935
936   -build | --build | --buil | --bui | --bu)
937     ac_prev=build_alias ;;
938   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
939     build_alias=$ac_optarg ;;
940
941   -cache-file | --cache-file | --cache-fil | --cache-fi \
942   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
943     ac_prev=cache_file ;;
944   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
945   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
946     cache_file=$ac_optarg ;;
947
948   --config-cache | -C)
949     cache_file=config.cache ;;
950
951   -datadir | --datadir | --datadi | --datad)
952     ac_prev=datadir ;;
953   -datadir=* | --datadir=* | --datadi=* | --datad=*)
954     datadir=$ac_optarg ;;
955
956   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
957   | --dataroo | --dataro | --datar)
958     ac_prev=datarootdir ;;
959   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
960   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
961     datarootdir=$ac_optarg ;;
962
963   -disable-* | --disable-*)
964     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
965     # Reject names that are not valid shell variable names.
966     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
967       as_fn_error $? "invalid feature name: $ac_useropt"
968     ac_useropt_orig=$ac_useropt
969     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
970     case $ac_user_opts in
971       *"
972 "enable_$ac_useropt"
973 "*) ;;
974       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
975          ac_unrecognized_sep=', ';;
976     esac
977     eval enable_$ac_useropt=no ;;
978
979   -docdir | --docdir | --docdi | --doc | --do)
980     ac_prev=docdir ;;
981   -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
982     docdir=$ac_optarg ;;
983
984   -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
985     ac_prev=dvidir ;;
986   -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
987     dvidir=$ac_optarg ;;
988
989   -enable-* | --enable-*)
990     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
991     # Reject names that are not valid shell variable names.
992     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
993       as_fn_error $? "invalid feature name: $ac_useropt"
994     ac_useropt_orig=$ac_useropt
995     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
996     case $ac_user_opts in
997       *"
998 "enable_$ac_useropt"
999 "*) ;;
1000       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
1001          ac_unrecognized_sep=', ';;
1002     esac
1003     eval enable_$ac_useropt=\$ac_optarg ;;
1004
1005   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
1006   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
1007   | --exec | --exe | --ex)
1008     ac_prev=exec_prefix ;;
1009   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
1010   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
1011   | --exec=* | --exe=* | --ex=*)
1012     exec_prefix=$ac_optarg ;;
1013
1014   -gas | --gas | --ga | --g)
1015     # Obsolete; use --with-gas.
1016     with_gas=yes ;;
1017
1018   -help | --help | --hel | --he | -h)
1019     ac_init_help=long ;;
1020   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
1021     ac_init_help=recursive ;;
1022   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
1023     ac_init_help=short ;;
1024
1025   -host | --host | --hos | --ho)
1026     ac_prev=host_alias ;;
1027   -host=* | --host=* | --hos=* | --ho=*)
1028     host_alias=$ac_optarg ;;
1029
1030   -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
1031     ac_prev=htmldir ;;
1032   -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
1033   | --ht=*)
1034     htmldir=$ac_optarg ;;
1035
1036   -includedir | --includedir | --includedi | --included | --include \
1037   | --includ | --inclu | --incl | --inc)
1038     ac_prev=includedir ;;
1039   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
1040   | --includ=* | --inclu=* | --incl=* | --inc=*)
1041     includedir=$ac_optarg ;;
1042
1043   -infodir | --infodir | --infodi | --infod | --info | --inf)
1044     ac_prev=infodir ;;
1045   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
1046     infodir=$ac_optarg ;;
1047
1048   -libdir | --libdir | --libdi | --libd)
1049     ac_prev=libdir ;;
1050   -libdir=* | --libdir=* | --libdi=* | --libd=*)
1051     libdir=$ac_optarg ;;
1052
1053   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
1054   | --libexe | --libex | --libe)
1055     ac_prev=libexecdir ;;
1056   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
1057   | --libexe=* | --libex=* | --libe=*)
1058     libexecdir=$ac_optarg ;;
1059
1060   -localedir | --localedir | --localedi | --localed | --locale)
1061     ac_prev=localedir ;;
1062   -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
1063     localedir=$ac_optarg ;;
1064
1065   -localstatedir | --localstatedir | --localstatedi | --localstated \
1066   | --localstate | --localstat | --localsta | --localst | --locals)
1067     ac_prev=localstatedir ;;
1068   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
1069   | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
1070     localstatedir=$ac_optarg ;;
1071
1072   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
1073     ac_prev=mandir ;;
1074   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
1075     mandir=$ac_optarg ;;
1076
1077   -nfp | --nfp | --nf)
1078     # Obsolete; use --without-fp.
1079     with_fp=no ;;
1080
1081   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1082   | --no-cr | --no-c | -n)
1083     no_create=yes ;;
1084
1085   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1086   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1087     no_recursion=yes ;;
1088
1089   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
1090   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
1091   | --oldin | --oldi | --old | --ol | --o)
1092     ac_prev=oldincludedir ;;
1093   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1094   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1095   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1096     oldincludedir=$ac_optarg ;;
1097
1098   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1099     ac_prev=prefix ;;
1100   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1101     prefix=$ac_optarg ;;
1102
1103   -program-prefix | --program-prefix | --program-prefi | --program-pref \
1104   | --program-pre | --program-pr | --program-p)
1105     ac_prev=program_prefix ;;
1106   -program-prefix=* | --program-prefix=* | --program-prefi=* \
1107   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1108     program_prefix=$ac_optarg ;;
1109
1110   -program-suffix | --program-suffix | --program-suffi | --program-suff \
1111   | --program-suf | --program-su | --program-s)
1112     ac_prev=program_suffix ;;
1113   -program-suffix=* | --program-suffix=* | --program-suffi=* \
1114   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1115     program_suffix=$ac_optarg ;;
1116
1117   -program-transform-name | --program-transform-name \
1118   | --program-transform-nam | --program-transform-na \
1119   | --program-transform-n | --program-transform- \
1120   | --program-transform | --program-transfor \
1121   | --program-transfo | --program-transf \
1122   | --program-trans | --program-tran \
1123   | --progr-tra | --program-tr | --program-t)
1124     ac_prev=program_transform_name ;;
1125   -program-transform-name=* | --program-transform-name=* \
1126   | --program-transform-nam=* | --program-transform-na=* \
1127   | --program-transform-n=* | --program-transform-=* \
1128   | --program-transform=* | --program-transfor=* \
1129   | --program-transfo=* | --program-transf=* \
1130   | --program-trans=* | --program-tran=* \
1131   | --progr-tra=* | --program-tr=* | --program-t=*)
1132     program_transform_name=$ac_optarg ;;
1133
1134   -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
1135     ac_prev=pdfdir ;;
1136   -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
1137     pdfdir=$ac_optarg ;;
1138
1139   -psdir | --psdir | --psdi | --psd | --ps)
1140     ac_prev=psdir ;;
1141   -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
1142     psdir=$ac_optarg ;;
1143
1144   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1145   | -silent | --silent | --silen | --sile | --sil)
1146     silent=yes ;;
1147
1148   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1149     ac_prev=sbindir ;;
1150   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1151   | --sbi=* | --sb=*)
1152     sbindir=$ac_optarg ;;
1153
1154   -sharedstatedir | --sharedstatedir | --sharedstatedi \
1155   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1156   | --sharedst | --shareds | --shared | --share | --shar \
1157   | --sha | --sh)
1158     ac_prev=sharedstatedir ;;
1159   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1160   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1161   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1162   | --sha=* | --sh=*)
1163     sharedstatedir=$ac_optarg ;;
1164
1165   -site | --site | --sit)
1166     ac_prev=site ;;
1167   -site=* | --site=* | --sit=*)
1168     site=$ac_optarg ;;
1169
1170   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1171     ac_prev=srcdir ;;
1172   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1173     srcdir=$ac_optarg ;;
1174
1175   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1176   | --syscon | --sysco | --sysc | --sys | --sy)
1177     ac_prev=sysconfdir ;;
1178   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1179   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1180     sysconfdir=$ac_optarg ;;
1181
1182   -target | --target | --targe | --targ | --tar | --ta | --t)
1183     ac_prev=target_alias ;;
1184   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1185     target_alias=$ac_optarg ;;
1186
1187   -v | -verbose | --verbose | --verbos | --verbo | --verb)
1188     verbose=yes ;;
1189
1190   -version | --version | --versio | --versi | --vers | -V)
1191     ac_init_version=: ;;
1192
1193   -with-* | --with-*)
1194     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1195     # Reject names that are not valid shell variable names.
1196     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1197       as_fn_error $? "invalid package name: $ac_useropt"
1198     ac_useropt_orig=$ac_useropt
1199     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1200     case $ac_user_opts in
1201       *"
1202 "with_$ac_useropt"
1203 "*) ;;
1204       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1205          ac_unrecognized_sep=', ';;
1206     esac
1207     eval with_$ac_useropt=\$ac_optarg ;;
1208
1209   -without-* | --without-*)
1210     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1211     # Reject names that are not valid shell variable names.
1212     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1213       as_fn_error $? "invalid package name: $ac_useropt"
1214     ac_useropt_orig=$ac_useropt
1215     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1216     case $ac_user_opts in
1217       *"
1218 "with_$ac_useropt"
1219 "*) ;;
1220       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1221          ac_unrecognized_sep=', ';;
1222     esac
1223     eval with_$ac_useropt=no ;;
1224
1225   --x)
1226     # Obsolete; use --with-x.
1227     with_x=yes ;;
1228
1229   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1230   | --x-incl | --x-inc | --x-in | --x-i)
1231     ac_prev=x_includes ;;
1232   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1233   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1234     x_includes=$ac_optarg ;;
1235
1236   -x-libraries | --x-libraries | --x-librarie | --x-librari \
1237   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1238     ac_prev=x_libraries ;;
1239   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1240   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1241     x_libraries=$ac_optarg ;;
1242
1243   -*) as_fn_error $? "unrecognized option: \`$ac_option'
1244 Try \`$0 --help' for more information"
1245     ;;
1246
1247   *=*)
1248     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1249     # Reject names that are not valid shell variable names.
1250     case $ac_envvar in #(
1251       '' | [0-9]* | *[!_$as_cr_alnum]* )
1252       as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
1253     esac
1254     eval $ac_envvar=\$ac_optarg
1255     export $ac_envvar ;;
1256
1257   *)
1258     # FIXME: should be removed in autoconf 3.0.
1259     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
1260     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1261       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1262     : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
1263     ;;
1264
1265   esac
1266 done
1267
1268 if test -n "$ac_prev"; then
1269   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1270   as_fn_error $? "missing argument to $ac_option"
1271 fi
1272
1273 if test -n "$ac_unrecognized_opts"; then
1274   case $enable_option_checking in
1275     no) ;;
1276     fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
1277     *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1278   esac
1279 fi
1280
1281 # Check all directory arguments for consistency.
1282 for ac_var in   exec_prefix prefix bindir sbindir libexecdir datarootdir \
1283                 datadir sysconfdir sharedstatedir localstatedir includedir \
1284                 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1285                 libdir localedir mandir
1286 do
1287   eval ac_val=\$$ac_var
1288   # Remove trailing slashes.
1289   case $ac_val in
1290     */ )
1291       ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1292       eval $ac_var=\$ac_val;;
1293   esac
1294   # Be sure to have absolute directory names.
1295   case $ac_val in
1296     [\\/$]* | ?:[\\/]* )  continue;;
1297     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1298   esac
1299   as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
1300 done
1301
1302 # There might be people who depend on the old broken behavior: `$host'
1303 # used to hold the argument of --host etc.
1304 # FIXME: To remove some day.
1305 build=$build_alias
1306 host=$host_alias
1307 target=$target_alias
1308
1309 # FIXME: To remove some day.
1310 if test "x$host_alias" != x; then
1311   if test "x$build_alias" = x; then
1312     cross_compiling=maybe
1313   elif test "x$build_alias" != "x$host_alias"; then
1314     cross_compiling=yes
1315   fi
1316 fi
1317
1318 ac_tool_prefix=
1319 test -n "$host_alias" && ac_tool_prefix=$host_alias-
1320
1321 test "$silent" = yes && exec 6>/dev/null
1322
1323
1324 ac_pwd=`pwd` && test -n "$ac_pwd" &&
1325 ac_ls_di=`ls -di .` &&
1326 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1327   as_fn_error $? "working directory cannot be determined"
1328 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1329   as_fn_error $? "pwd does not report name of working directory"
1330
1331
1332 # Find the source files, if location was not specified.
1333 if test -z "$srcdir"; then
1334   ac_srcdir_defaulted=yes
1335   # Try the directory containing this script, then the parent directory.
1336   ac_confdir=`$as_dirname -- "$as_myself" ||
1337 $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1338          X"$as_myself" : 'X\(//\)[^/]' \| \
1339          X"$as_myself" : 'X\(//\)$' \| \
1340          X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1341 $as_echo X"$as_myself" |
1342     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1343             s//\1/
1344             q
1345           }
1346           /^X\(\/\/\)[^/].*/{
1347             s//\1/
1348             q
1349           }
1350           /^X\(\/\/\)$/{
1351             s//\1/
1352             q
1353           }
1354           /^X\(\/\).*/{
1355             s//\1/
1356             q
1357           }
1358           s/.*/./; q'`
1359   srcdir=$ac_confdir
1360   if test ! -r "$srcdir/$ac_unique_file"; then
1361     srcdir=..
1362   fi
1363 else
1364   ac_srcdir_defaulted=no
1365 fi
1366 if test ! -r "$srcdir/$ac_unique_file"; then
1367   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1368   as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
1369 fi
1370 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1371 ac_abs_confdir=`(
1372         cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
1373         pwd)`
1374 # When building in place, set srcdir=.
1375 if test "$ac_abs_confdir" = "$ac_pwd"; then
1376   srcdir=.
1377 fi
1378 # Remove unnecessary trailing slashes from srcdir.
1379 # Double slashes in file names in object file debugging info
1380 # mess up M-x gdb in Emacs.
1381 case $srcdir in
1382 */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1383 esac
1384 for ac_var in $ac_precious_vars; do
1385   eval ac_env_${ac_var}_set=\${${ac_var}+set}
1386   eval ac_env_${ac_var}_value=\$${ac_var}
1387   eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1388   eval ac_cv_env_${ac_var}_value=\$${ac_var}
1389 done
1390
1391 #
1392 # Report the --help message.
1393 #
1394 if test "$ac_init_help" = "long"; then
1395   # Omit some internal or obsolete options to make the list less imposing.
1396   # This message is too long to be a string in the A/UX 3.1 sh.
1397   cat <<_ACEOF
1398 \`configure' configures PostgreSQL 9.6devel to adapt to many kinds of systems.
1399
1400 Usage: $0 [OPTION]... [VAR=VALUE]...
1401
1402 To assign environment variables (e.g., CC, CFLAGS...), specify them as
1403 VAR=VALUE.  See below for descriptions of some of the useful variables.
1404
1405 Defaults for the options are specified in brackets.
1406
1407 Configuration:
1408   -h, --help              display this help and exit
1409       --help=short        display options specific to this package
1410       --help=recursive    display the short help of all the included packages
1411   -V, --version           display version information and exit
1412   -q, --quiet, --silent   do not print \`checking ...' messages
1413       --cache-file=FILE   cache test results in FILE [disabled]
1414   -C, --config-cache      alias for \`--cache-file=config.cache'
1415   -n, --no-create         do not create output files
1416       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
1417
1418 Installation directories:
1419   --prefix=PREFIX         install architecture-independent files in PREFIX
1420                           [$ac_default_prefix]
1421   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
1422                           [PREFIX]
1423
1424 By default, \`make install' will install all the files in
1425 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
1426 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1427 for instance \`--prefix=\$HOME'.
1428
1429 For better control, use the options below.
1430
1431 Fine tuning of the installation directories:
1432   --bindir=DIR            user executables [EPREFIX/bin]
1433   --sbindir=DIR           system admin executables [EPREFIX/sbin]
1434   --libexecdir=DIR        program executables [EPREFIX/libexec]
1435   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1436   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1437   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1438   --libdir=DIR            object code libraries [EPREFIX/lib]
1439   --includedir=DIR        C header files [PREFIX/include]
1440   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
1441   --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
1442   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
1443   --infodir=DIR           info documentation [DATAROOTDIR/info]
1444   --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
1445   --mandir=DIR            man documentation [DATAROOTDIR/man]
1446   --docdir=DIR            documentation root [DATAROOTDIR/doc/postgresql]
1447   --htmldir=DIR           html documentation [DOCDIR]
1448   --dvidir=DIR            dvi documentation [DOCDIR]
1449   --pdfdir=DIR            pdf documentation [DOCDIR]
1450   --psdir=DIR             ps documentation [DOCDIR]
1451 _ACEOF
1452
1453   cat <<\_ACEOF
1454
1455 System types:
1456   --build=BUILD     configure for building on BUILD [guessed]
1457   --host=HOST       cross-compile to build programs to run on HOST [BUILD]
1458 _ACEOF
1459 fi
1460
1461 if test -n "$ac_init_help"; then
1462   case $ac_init_help in
1463      short | recursive ) echo "Configuration of PostgreSQL 9.6devel:";;
1464    esac
1465   cat <<\_ACEOF
1466
1467 Optional Features:
1468   --disable-option-checking  ignore unrecognized --enable/--with options
1469   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1470   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
1471   --disable-integer-datetimes
1472                           disable 64-bit integer date/time support
1473   --enable-nls[=LANGUAGES]
1474                           enable Native Language Support
1475   --disable-rpath         do not embed shared library search path in
1476                           executables
1477   --disable-spinlocks     do not use spinlocks
1478   --disable-atomics       do not use atomic operations
1479   --enable-debug          build with debugging symbols (-g)
1480   --enable-profiling      build with profiling enabled
1481   --enable-coverage       build with coverage testing instrumentation
1482   --enable-dtrace         build with DTrace support
1483   --enable-tap-tests      enable TAP tests (requires Perl and IPC::Run)
1484   --enable-depend         turn on automatic dependency tracking
1485   --enable-cassert        enable assertion checks (for debugging)
1486   --disable-thread-safety disable thread-safety in client libraries
1487   --disable-largefile     omit support for large files
1488   --disable-float4-byval  disable float4 passed by value
1489   --disable-float8-byval  disable float8 passed by value
1490
1491 Optional Packages:
1492   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1493   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
1494   --with-extra-version=STRING
1495                           append STRING to version
1496   --with-template=NAME    override operating system template
1497   --with-includes=DIRS    look for additional header files in DIRS
1498   --with-libraries=DIRS   look for additional libraries in DIRS
1499   --with-libs=DIRS        alternative spelling of --with-libraries
1500   --with-pgport=PORTNUM   set default port number [5432]
1501   --with-blocksize=BLOCKSIZE
1502                           set table block size in kB [8]
1503   --with-segsize=SEGSIZE  set table segment size in GB [1]
1504   --with-wal-blocksize=BLOCKSIZE
1505                           set WAL block size in kB [8]
1506   --with-wal-segsize=SEGSIZE
1507                           set WAL segment size in MB [16]
1508   --with-CC=CMD           set compiler (deprecated)
1509   --with-tcl              build Tcl modules (PL/Tcl)
1510   --with-tclconfig=DIR    tclConfig.sh is in DIR
1511   --with-perl             build Perl modules (PL/Perl)
1512   --with-python           build Python modules (PL/Python)
1513   --with-gssapi           build with GSSAPI support
1514   --with-krb-srvnam=NAME  default service principal name in Kerberos (GSSAPI)
1515                           [postgres]
1516   --with-pam              build with PAM support
1517   --with-ldap             build with LDAP support
1518   --with-bonjour          build with Bonjour support
1519   --with-openssl          build with OpenSSL support
1520   --with-selinux          build with SELinux support
1521   --without-readline      do not use GNU Readline nor BSD Libedit for editing
1522   --with-libedit-preferred
1523                           prefer BSD Libedit over GNU Readline
1524   --with-uuid=LIB         build contrib/uuid-ossp using LIB (bsd,e2fs,ossp)
1525   --with-ossp-uuid        obsolete spelling of --with-uuid=ossp
1526   --with-libxml           build with XML support
1527   --with-libxslt          use XSLT support when building contrib/xml2
1528   --with-system-tzdata=DIR
1529                           use system time zone data in DIR
1530   --without-zlib          do not use Zlib
1531   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
1532
1533 Some influential environment variables:
1534   CC          C compiler command
1535   CFLAGS      C compiler flags
1536   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
1537               nonstandard directory <lib dir>
1538   LIBS        libraries to pass to the linker, e.g. -l<library>
1539   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1540               you have headers in a nonstandard directory <include dir>
1541   CPP         C preprocessor
1542   LDFLAGS_EX  extra linker flags for linking executables only
1543   LDFLAGS_SL  extra linker flags for linking shared libraries only
1544   DOCBOOKSTYLE
1545               location of DocBook stylesheets
1546
1547 Use these variables to override the choices made by `configure' or to help
1548 it to find libraries and programs with nonstandard names/locations.
1549
1550 Report bugs to <pgsql-bugs@postgresql.org>.
1551 _ACEOF
1552 ac_status=$?
1553 fi
1554
1555 if test "$ac_init_help" = "recursive"; then
1556   # If there are subdirs, report their specific --help.
1557   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1558     test -d "$ac_dir" ||
1559       { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1560       continue
1561     ac_builddir=.
1562
1563 case "$ac_dir" in
1564 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1565 *)
1566   ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
1567   # A ".." for each directory in $ac_dir_suffix.
1568   ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1569   case $ac_top_builddir_sub in
1570   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1571   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1572   esac ;;
1573 esac
1574 ac_abs_top_builddir=$ac_pwd
1575 ac_abs_builddir=$ac_pwd$ac_dir_suffix
1576 # for backward compatibility:
1577 ac_top_builddir=$ac_top_build_prefix
1578
1579 case $srcdir in
1580   .)  # We are building in place.
1581     ac_srcdir=.
1582     ac_top_srcdir=$ac_top_builddir_sub
1583     ac_abs_top_srcdir=$ac_pwd ;;
1584   [\\/]* | ?:[\\/]* )  # Absolute name.
1585     ac_srcdir=$srcdir$ac_dir_suffix;
1586     ac_top_srcdir=$srcdir
1587     ac_abs_top_srcdir=$srcdir ;;
1588   *) # Relative name.
1589     ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1590     ac_top_srcdir=$ac_top_build_prefix$srcdir
1591     ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1592 esac
1593 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1594
1595     cd "$ac_dir" || { ac_status=$?; continue; }
1596     # Check for guested configure.
1597     if test -f "$ac_srcdir/configure.gnu"; then
1598       echo &&
1599       $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1600     elif test -f "$ac_srcdir/configure"; then
1601       echo &&
1602       $SHELL "$ac_srcdir/configure" --help=recursive
1603     else
1604       $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1605     fi || ac_status=$?
1606     cd "$ac_pwd" || { ac_status=$?; break; }
1607   done
1608 fi
1609
1610 test -n "$ac_init_help" && exit $ac_status
1611 if $ac_init_version; then
1612   cat <<\_ACEOF
1613 PostgreSQL configure 9.6devel
1614 generated by GNU Autoconf 2.69
1615
1616 Copyright (C) 2012 Free Software Foundation, Inc.
1617 This configure script is free software; the Free Software Foundation
1618 gives unlimited permission to copy, distribute and modify it.
1619
1620 Copyright (c) 1996-2015, PostgreSQL Global Development Group
1621 _ACEOF
1622   exit
1623 fi
1624
1625 ## ------------------------ ##
1626 ## Autoconf initialization. ##
1627 ## ------------------------ ##
1628
1629 # ac_fn_c_try_compile LINENO
1630 # --------------------------
1631 # Try to compile conftest.$ac_ext, and return whether this succeeded.
1632 ac_fn_c_try_compile ()
1633 {
1634   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1635   rm -f conftest.$ac_objext
1636   if { { ac_try="$ac_compile"
1637 case "(($ac_try" in
1638   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1639   *) ac_try_echo=$ac_try;;
1640 esac
1641 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1642 $as_echo "$ac_try_echo"; } >&5
1643   (eval "$ac_compile") 2>conftest.err
1644   ac_status=$?
1645   if test -s conftest.err; then
1646     grep -v '^ *+' conftest.err >conftest.er1
1647     cat conftest.er1 >&5
1648     mv -f conftest.er1 conftest.err
1649   fi
1650   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1651   test $ac_status = 0; } && {
1652          test -z "$ac_c_werror_flag" ||
1653          test ! -s conftest.err
1654        } && test -s conftest.$ac_objext; then :
1655   ac_retval=0
1656 else
1657   $as_echo "$as_me: failed program was:" >&5
1658 sed 's/^/| /' conftest.$ac_ext >&5
1659
1660         ac_retval=1
1661 fi
1662   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1663   as_fn_set_status $ac_retval
1664
1665 } # ac_fn_c_try_compile
1666
1667 # ac_fn_c_try_link LINENO
1668 # -----------------------
1669 # Try to link conftest.$ac_ext, and return whether this succeeded.
1670 ac_fn_c_try_link ()
1671 {
1672   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1673   rm -f conftest.$ac_objext conftest$ac_exeext
1674   if { { ac_try="$ac_link"
1675 case "(($ac_try" in
1676   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1677   *) ac_try_echo=$ac_try;;
1678 esac
1679 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1680 $as_echo "$ac_try_echo"; } >&5
1681   (eval "$ac_link") 2>conftest.err
1682   ac_status=$?
1683   if test -s conftest.err; then
1684     grep -v '^ *+' conftest.err >conftest.er1
1685     cat conftest.er1 >&5
1686     mv -f conftest.er1 conftest.err
1687   fi
1688   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1689   test $ac_status = 0; } && {
1690          test -z "$ac_c_werror_flag" ||
1691          test ! -s conftest.err
1692        } && test -s conftest$ac_exeext && {
1693          test "$cross_compiling" = yes ||
1694          test -x conftest$ac_exeext
1695        }; then :
1696   ac_retval=0
1697 else
1698   $as_echo "$as_me: failed program was:" >&5
1699 sed 's/^/| /' conftest.$ac_ext >&5
1700
1701         ac_retval=1
1702 fi
1703   # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1704   # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1705   # interfere with the next link command; also delete a directory that is
1706   # left behind by Apple's compiler.  We do this before executing the actions.
1707   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1708   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1709   as_fn_set_status $ac_retval
1710
1711 } # ac_fn_c_try_link
1712
1713 # ac_fn_c_try_cpp LINENO
1714 # ----------------------
1715 # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
1716 ac_fn_c_try_cpp ()
1717 {
1718   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1719   if { { ac_try="$ac_cpp conftest.$ac_ext"
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_cpp conftest.$ac_ext") 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; } > conftest.i && {
1735          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
1736          test ! -s conftest.err
1737        }; 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_c_try_cpp
1749
1750 # ac_fn_c_check_func LINENO FUNC VAR
1751 # ----------------------------------
1752 # Tests whether FUNC exists, setting the cache variable VAR accordingly
1753 ac_fn_c_check_func ()
1754 {
1755   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1756   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1757 $as_echo_n "checking for $2... " >&6; }
1758 if eval \${$3+:} false; then :
1759   $as_echo_n "(cached) " >&6
1760 else
1761   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1762 /* end confdefs.h.  */
1763 /* Define $2 to an innocuous variant, in case <limits.h> declares $2.
1764    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
1765 #define $2 innocuous_$2
1766
1767 /* System header to define __stub macros and hopefully few prototypes,
1768     which can conflict with char $2 (); below.
1769     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
1770     <limits.h> exists even on freestanding compilers.  */
1771
1772 #ifdef __STDC__
1773 # include <limits.h>
1774 #else
1775 # include <assert.h>
1776 #endif
1777
1778 #undef $2
1779
1780 /* Override any GCC internal prototype to avoid an error.
1781    Use char because int might match the return type of a GCC
1782    builtin and then its argument prototype would still apply.  */
1783 #ifdef __cplusplus
1784 extern "C"
1785 #endif
1786 char $2 ();
1787 /* The GNU C library defines this for functions which it implements
1788     to always fail with ENOSYS.  Some functions are actually named
1789     something starting with __ and the normal name is an alias.  */
1790 #if defined __stub_$2 || defined __stub___$2
1791 choke me
1792 #endif
1793
1794 int
1795 main ()
1796 {
1797 return $2 ();
1798   ;
1799   return 0;
1800 }
1801 _ACEOF
1802 if ac_fn_c_try_link "$LINENO"; then :
1803   eval "$3=yes"
1804 else
1805   eval "$3=no"
1806 fi
1807 rm -f core conftest.err conftest.$ac_objext \
1808     conftest$ac_exeext conftest.$ac_ext
1809 fi
1810 eval ac_res=\$$3
1811                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1812 $as_echo "$ac_res" >&6; }
1813   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1814
1815 } # ac_fn_c_check_func
1816
1817 # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
1818 # -------------------------------------------------------
1819 # Tests whether HEADER exists, giving a warning if it cannot be compiled using
1820 # the include files in INCLUDES and setting the cache variable VAR
1821 # accordingly.
1822 ac_fn_c_check_header_mongrel ()
1823 {
1824   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1825   if eval \${$3+:} false; then :
1826   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1827 $as_echo_n "checking for $2... " >&6; }
1828 if eval \${$3+:} false; then :
1829   $as_echo_n "(cached) " >&6
1830 fi
1831 eval ac_res=\$$3
1832                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1833 $as_echo "$ac_res" >&6; }
1834 else
1835   # Is the header compilable?
1836 { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
1837 $as_echo_n "checking $2 usability... " >&6; }
1838 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1839 /* end confdefs.h.  */
1840 $4
1841 #include <$2>
1842 _ACEOF
1843 if ac_fn_c_try_compile "$LINENO"; then :
1844   ac_header_compiler=yes
1845 else
1846   ac_header_compiler=no
1847 fi
1848 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1849 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
1850 $as_echo "$ac_header_compiler" >&6; }
1851
1852 # Is the header present?
1853 { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
1854 $as_echo_n "checking $2 presence... " >&6; }
1855 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1856 /* end confdefs.h.  */
1857 #include <$2>
1858 _ACEOF
1859 if ac_fn_c_try_cpp "$LINENO"; then :
1860   ac_header_preproc=yes
1861 else
1862   ac_header_preproc=no
1863 fi
1864 rm -f conftest.err conftest.i conftest.$ac_ext
1865 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
1866 $as_echo "$ac_header_preproc" >&6; }
1867
1868 # So?  What about this header?
1869 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
1870   yes:no: )
1871     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
1872 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
1873     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1874 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1875     ;;
1876   no:yes:* )
1877     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
1878 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
1879     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
1880 $as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
1881     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
1882 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
1883     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
1884 $as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
1885     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1886 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1887 ( $as_echo "## ---------------------------------------- ##
1888 ## Report this to pgsql-bugs@postgresql.org ##
1889 ## ---------------------------------------- ##"
1890      ) | sed "s/^/$as_me: WARNING:     /" >&2
1891     ;;
1892 esac
1893   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1894 $as_echo_n "checking for $2... " >&6; }
1895 if eval \${$3+:} false; then :
1896   $as_echo_n "(cached) " >&6
1897 else
1898   eval "$3=\$ac_header_compiler"
1899 fi
1900 eval ac_res=\$$3
1901                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1902 $as_echo "$ac_res" >&6; }
1903 fi
1904   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1905
1906 } # ac_fn_c_check_header_mongrel
1907
1908 # ac_fn_c_try_run LINENO
1909 # ----------------------
1910 # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
1911 # that executables *can* be run.
1912 ac_fn_c_try_run ()
1913 {
1914   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1915   if { { ac_try="$ac_link"
1916 case "(($ac_try" in
1917   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1918   *) ac_try_echo=$ac_try;;
1919 esac
1920 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1921 $as_echo "$ac_try_echo"; } >&5
1922   (eval "$ac_link") 2>&5
1923   ac_status=$?
1924   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1925   test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
1926   { { case "(($ac_try" in
1927   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1928   *) ac_try_echo=$ac_try;;
1929 esac
1930 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1931 $as_echo "$ac_try_echo"; } >&5
1932   (eval "$ac_try") 2>&5
1933   ac_status=$?
1934   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1935   test $ac_status = 0; }; }; then :
1936   ac_retval=0
1937 else
1938   $as_echo "$as_me: program exited with status $ac_status" >&5
1939        $as_echo "$as_me: failed program was:" >&5
1940 sed 's/^/| /' conftest.$ac_ext >&5
1941
1942        ac_retval=$ac_status
1943 fi
1944   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1945   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1946   as_fn_set_status $ac_retval
1947
1948 } # ac_fn_c_try_run
1949
1950 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
1951 # -------------------------------------------------------
1952 # Tests whether HEADER exists and can be compiled using the include files in
1953 # INCLUDES, setting the cache variable VAR accordingly.
1954 ac_fn_c_check_header_compile ()
1955 {
1956   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1957   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1958 $as_echo_n "checking for $2... " >&6; }
1959 if eval \${$3+:} false; then :
1960   $as_echo_n "(cached) " >&6
1961 else
1962   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1963 /* end confdefs.h.  */
1964 $4
1965 #include <$2>
1966 _ACEOF
1967 if ac_fn_c_try_compile "$LINENO"; then :
1968   eval "$3=yes"
1969 else
1970   eval "$3=no"
1971 fi
1972 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1973 fi
1974 eval ac_res=\$$3
1975                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1976 $as_echo "$ac_res" >&6; }
1977   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1978
1979 } # ac_fn_c_check_header_compile
1980
1981 # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
1982 # ----------------------------------------------------
1983 # Tries to find if the field MEMBER exists in type AGGR, after including
1984 # INCLUDES, setting cache variable VAR accordingly.
1985 ac_fn_c_check_member ()
1986 {
1987   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1988   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
1989 $as_echo_n "checking for $2.$3... " >&6; }
1990 if eval \${$4+:} false; then :
1991   $as_echo_n "(cached) " >&6
1992 else
1993   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1994 /* end confdefs.h.  */
1995 $5
1996 int
1997 main ()
1998 {
1999 static $2 ac_aggr;
2000 if (ac_aggr.$3)
2001 return 0;
2002   ;
2003   return 0;
2004 }
2005 _ACEOF
2006 if ac_fn_c_try_compile "$LINENO"; then :
2007   eval "$4=yes"
2008 else
2009   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2010 /* end confdefs.h.  */
2011 $5
2012 int
2013 main ()
2014 {
2015 static $2 ac_aggr;
2016 if (sizeof ac_aggr.$3)
2017 return 0;
2018   ;
2019   return 0;
2020 }
2021 _ACEOF
2022 if ac_fn_c_try_compile "$LINENO"; then :
2023   eval "$4=yes"
2024 else
2025   eval "$4=no"
2026 fi
2027 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2028 fi
2029 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2030 fi
2031 eval ac_res=\$$4
2032                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2033 $as_echo "$ac_res" >&6; }
2034   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2035
2036 } # ac_fn_c_check_member
2037
2038 # ac_fn_c_check_type LINENO TYPE VAR INCLUDES
2039 # -------------------------------------------
2040 # Tests whether TYPE exists after having included INCLUDES, setting cache
2041 # variable VAR accordingly.
2042 ac_fn_c_check_type ()
2043 {
2044   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2045   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2046 $as_echo_n "checking for $2... " >&6; }
2047 if eval \${$3+:} false; then :
2048   $as_echo_n "(cached) " >&6
2049 else
2050   eval "$3=no"
2051   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2052 /* end confdefs.h.  */
2053 $4
2054 int
2055 main ()
2056 {
2057 if (sizeof ($2))
2058          return 0;
2059   ;
2060   return 0;
2061 }
2062 _ACEOF
2063 if ac_fn_c_try_compile "$LINENO"; then :
2064   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2065 /* end confdefs.h.  */
2066 $4
2067 int
2068 main ()
2069 {
2070 if (sizeof (($2)))
2071             return 0;
2072   ;
2073   return 0;
2074 }
2075 _ACEOF
2076 if ac_fn_c_try_compile "$LINENO"; then :
2077
2078 else
2079   eval "$3=yes"
2080 fi
2081 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2082 fi
2083 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2084 fi
2085 eval ac_res=\$$3
2086                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2087 $as_echo "$ac_res" >&6; }
2088   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2089
2090 } # ac_fn_c_check_type
2091
2092 # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
2093 # --------------------------------------------
2094 # Tries to find the compile-time value of EXPR in a program that includes
2095 # INCLUDES, setting VAR accordingly. Returns whether the value could be
2096 # computed
2097 ac_fn_c_compute_int ()
2098 {
2099   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2100   if test "$cross_compiling" = yes; then
2101     # Depending upon the size, compute the lo and hi bounds.
2102 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2103 /* end confdefs.h.  */
2104 $4
2105 int
2106 main ()
2107 {
2108 static int test_array [1 - 2 * !(($2) >= 0)];
2109 test_array [0] = 0;
2110 return test_array [0];
2111
2112   ;
2113   return 0;
2114 }
2115 _ACEOF
2116 if ac_fn_c_try_compile "$LINENO"; then :
2117   ac_lo=0 ac_mid=0
2118   while :; do
2119     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2120 /* end confdefs.h.  */
2121 $4
2122 int
2123 main ()
2124 {
2125 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
2126 test_array [0] = 0;
2127 return test_array [0];
2128
2129   ;
2130   return 0;
2131 }
2132 _ACEOF
2133 if ac_fn_c_try_compile "$LINENO"; then :
2134   ac_hi=$ac_mid; break
2135 else
2136   as_fn_arith $ac_mid + 1 && ac_lo=$as_val
2137                         if test $ac_lo -le $ac_mid; then
2138                           ac_lo= ac_hi=
2139                           break
2140                         fi
2141                         as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
2142 fi
2143 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2144   done
2145 else
2146   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2147 /* end confdefs.h.  */
2148 $4
2149 int
2150 main ()
2151 {
2152 static int test_array [1 - 2 * !(($2) < 0)];
2153 test_array [0] = 0;
2154 return test_array [0];
2155
2156   ;
2157   return 0;
2158 }
2159 _ACEOF
2160 if ac_fn_c_try_compile "$LINENO"; then :
2161   ac_hi=-1 ac_mid=-1
2162   while :; do
2163     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2164 /* end confdefs.h.  */
2165 $4
2166 int
2167 main ()
2168 {
2169 static int test_array [1 - 2 * !(($2) >= $ac_mid)];
2170 test_array [0] = 0;
2171 return test_array [0];
2172
2173   ;
2174   return 0;
2175 }
2176 _ACEOF
2177 if ac_fn_c_try_compile "$LINENO"; then :
2178   ac_lo=$ac_mid; break
2179 else
2180   as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
2181                         if test $ac_mid -le $ac_hi; then
2182                           ac_lo= ac_hi=
2183                           break
2184                         fi
2185                         as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
2186 fi
2187 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2188   done
2189 else
2190   ac_lo= ac_hi=
2191 fi
2192 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2193 fi
2194 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2195 # Binary search between lo and hi bounds.
2196 while test "x$ac_lo" != "x$ac_hi"; do
2197   as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
2198   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2199 /* end confdefs.h.  */
2200 $4
2201 int
2202 main ()
2203 {
2204 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
2205 test_array [0] = 0;
2206 return test_array [0];
2207
2208   ;
2209   return 0;
2210 }
2211 _ACEOF
2212 if ac_fn_c_try_compile "$LINENO"; then :
2213   ac_hi=$ac_mid
2214 else
2215   as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
2216 fi
2217 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2218 done
2219 case $ac_lo in #((
2220 ?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
2221 '') ac_retval=1 ;;
2222 esac
2223   else
2224     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2225 /* end confdefs.h.  */
2226 $4
2227 static long int longval () { return $2; }
2228 static unsigned long int ulongval () { return $2; }
2229 #include <stdio.h>
2230 #include <stdlib.h>
2231 int
2232 main ()
2233 {
2234
2235   FILE *f = fopen ("conftest.val", "w");
2236   if (! f)
2237     return 1;
2238   if (($2) < 0)
2239     {
2240       long int i = longval ();
2241       if (i != ($2))
2242         return 1;
2243       fprintf (f, "%ld", i);
2244     }
2245   else
2246     {
2247       unsigned long int i = ulongval ();
2248       if (i != ($2))
2249         return 1;
2250       fprintf (f, "%lu", i);
2251     }
2252   /* Do not output a trailing newline, as this causes \r\n confusion
2253      on some platforms.  */
2254   return ferror (f) || fclose (f) != 0;
2255
2256   ;
2257   return 0;
2258 }
2259 _ACEOF
2260 if ac_fn_c_try_run "$LINENO"; then :
2261   echo >>conftest.val; read $3 <conftest.val; ac_retval=0
2262 else
2263   ac_retval=1
2264 fi
2265 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
2266   conftest.$ac_objext conftest.beam conftest.$ac_ext
2267 rm -f conftest.val
2268
2269   fi
2270   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2271   as_fn_set_status $ac_retval
2272
2273 } # ac_fn_c_compute_int
2274
2275 # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
2276 # ---------------------------------------------
2277 # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
2278 # accordingly.
2279 ac_fn_c_check_decl ()
2280 {
2281   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2282   as_decl_name=`echo $2|sed 's/ *(.*//'`
2283   as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
2284   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
2285 $as_echo_n "checking whether $as_decl_name is declared... " >&6; }
2286 if eval \${$3+:} false; then :
2287   $as_echo_n "(cached) " >&6
2288 else
2289   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2290 /* end confdefs.h.  */
2291 $4
2292 int
2293 main ()
2294 {
2295 #ifndef $as_decl_name
2296 #ifdef __cplusplus
2297   (void) $as_decl_use;
2298 #else
2299   (void) $as_decl_name;
2300 #endif
2301 #endif
2302
2303   ;
2304   return 0;
2305 }
2306 _ACEOF
2307 if ac_fn_c_try_compile "$LINENO"; then :
2308   eval "$3=yes"
2309 else
2310   eval "$3=no"
2311 fi
2312 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2313 fi
2314 eval ac_res=\$$3
2315                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2316 $as_echo "$ac_res" >&6; }
2317   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2318
2319 } # ac_fn_c_check_decl
2320 cat >config.log <<_ACEOF
2321 This file contains any messages produced by compilers while
2322 running configure, to aid debugging if configure makes a mistake.
2323
2324 It was created by PostgreSQL $as_me 9.6devel, which was
2325 generated by GNU Autoconf 2.69.  Invocation command line was
2326
2327   $ $0 $@
2328
2329 _ACEOF
2330 exec 5>>config.log
2331 {
2332 cat <<_ASUNAME
2333 ## --------- ##
2334 ## Platform. ##
2335 ## --------- ##
2336
2337 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
2338 uname -m = `(uname -m) 2>/dev/null || echo unknown`
2339 uname -r = `(uname -r) 2>/dev/null || echo unknown`
2340 uname -s = `(uname -s) 2>/dev/null || echo unknown`
2341 uname -v = `(uname -v) 2>/dev/null || echo unknown`
2342
2343 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
2344 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
2345
2346 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
2347 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
2348 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
2349 /usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
2350 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
2351 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
2352 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
2353
2354 _ASUNAME
2355
2356 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2357 for as_dir in $PATH
2358 do
2359   IFS=$as_save_IFS
2360   test -z "$as_dir" && as_dir=.
2361     $as_echo "PATH: $as_dir"
2362   done
2363 IFS=$as_save_IFS
2364
2365 } >&5
2366
2367 cat >&5 <<_ACEOF
2368
2369
2370 ## ----------- ##
2371 ## Core tests. ##
2372 ## ----------- ##
2373
2374 _ACEOF
2375
2376
2377 # Keep a trace of the command line.
2378 # Strip out --no-create and --no-recursion so they do not pile up.
2379 # Strip out --silent because we don't want to record it for future runs.
2380 # Also quote any args containing shell meta-characters.
2381 # Make two passes to allow for proper duplicate-argument suppression.
2382 ac_configure_args=
2383 ac_configure_args0=
2384 ac_configure_args1=
2385 ac_must_keep_next=false
2386 for ac_pass in 1 2
2387 do
2388   for ac_arg
2389   do
2390     case $ac_arg in
2391     -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
2392     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
2393     | -silent | --silent | --silen | --sile | --sil)
2394       continue ;;
2395     *\'*)
2396       ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
2397     esac
2398     case $ac_pass in
2399     1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2400     2)
2401       as_fn_append ac_configure_args1 " '$ac_arg'"
2402       if test $ac_must_keep_next = true; then
2403         ac_must_keep_next=false # Got value, back to normal.
2404       else
2405         case $ac_arg in
2406           *=* | --config-cache | -C | -disable-* | --disable-* \
2407           | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
2408           | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
2409           | -with-* | --with-* | -without-* | --without-* | --x)
2410             case "$ac_configure_args0 " in
2411               "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
2412             esac
2413             ;;
2414           -* ) ac_must_keep_next=true ;;
2415         esac
2416       fi
2417       as_fn_append ac_configure_args " '$ac_arg'"
2418       ;;
2419     esac
2420   done
2421 done
2422 { ac_configure_args0=; unset ac_configure_args0;}
2423 { ac_configure_args1=; unset ac_configure_args1;}
2424
2425 # When interrupted or exit'd, cleanup temporary files, and complete
2426 # config.log.  We remove comments because anyway the quotes in there
2427 # would cause problems or look ugly.
2428 # WARNING: Use '\'' to represent an apostrophe within the trap.
2429 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
2430 trap 'exit_status=$?
2431   # Save into config.log some information that might help in debugging.
2432   {
2433     echo
2434
2435     $as_echo "## ---------------- ##
2436 ## Cache variables. ##
2437 ## ---------------- ##"
2438     echo
2439     # The following way of writing the cache mishandles newlines in values,
2440 (
2441   for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
2442     eval ac_val=\$$ac_var
2443     case $ac_val in #(
2444     *${as_nl}*)
2445       case $ac_var in #(
2446       *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
2447 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2448       esac
2449       case $ac_var in #(
2450       _ | IFS | as_nl) ;; #(
2451       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
2452       *) { eval $ac_var=; unset $ac_var;} ;;
2453       esac ;;
2454     esac
2455   done
2456   (set) 2>&1 |
2457     case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
2458     *${as_nl}ac_space=\ *)
2459       sed -n \
2460         "s/'\''/'\''\\\\'\'''\''/g;
2461           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
2462       ;; #(
2463     *)
2464       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
2465       ;;
2466     esac |
2467     sort
2468 )
2469     echo
2470
2471     $as_echo "## ----------------- ##
2472 ## Output variables. ##
2473 ## ----------------- ##"
2474     echo
2475     for ac_var in $ac_subst_vars
2476     do
2477       eval ac_val=\$$ac_var
2478       case $ac_val in
2479       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2480       esac
2481       $as_echo "$ac_var='\''$ac_val'\''"
2482     done | sort
2483     echo
2484
2485     if test -n "$ac_subst_files"; then
2486       $as_echo "## ------------------- ##
2487 ## File substitutions. ##
2488 ## ------------------- ##"
2489       echo
2490       for ac_var in $ac_subst_files
2491       do
2492         eval ac_val=\$$ac_var
2493         case $ac_val in
2494         *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2495         esac
2496         $as_echo "$ac_var='\''$ac_val'\''"
2497       done | sort
2498       echo
2499     fi
2500
2501     if test -s confdefs.h; then
2502       $as_echo "## ----------- ##
2503 ## confdefs.h. ##
2504 ## ----------- ##"
2505       echo
2506       cat confdefs.h
2507       echo
2508     fi
2509     test "$ac_signal" != 0 &&
2510       $as_echo "$as_me: caught signal $ac_signal"
2511     $as_echo "$as_me: exit $exit_status"
2512   } >&5
2513   rm -f core *.core core.conftest.* &&
2514     rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
2515     exit $exit_status
2516 ' 0
2517 for ac_signal in 1 2 13 15; do
2518   trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
2519 done
2520 ac_signal=0
2521
2522 # confdefs.h avoids OS command line length limits that DEFS can exceed.
2523 rm -f -r conftest* confdefs.h
2524
2525 $as_echo "/* confdefs.h */" > confdefs.h
2526
2527 # Predefined preprocessor variables.
2528
2529 cat >>confdefs.h <<_ACEOF
2530 #define PACKAGE_NAME "$PACKAGE_NAME"
2531 _ACEOF
2532
2533 cat >>confdefs.h <<_ACEOF
2534 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
2535 _ACEOF
2536
2537 cat >>confdefs.h <<_ACEOF
2538 #define PACKAGE_VERSION "$PACKAGE_VERSION"
2539 _ACEOF
2540
2541 cat >>confdefs.h <<_ACEOF
2542 #define PACKAGE_STRING "$PACKAGE_STRING"
2543 _ACEOF
2544
2545 cat >>confdefs.h <<_ACEOF
2546 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
2547 _ACEOF
2548
2549 cat >>confdefs.h <<_ACEOF
2550 #define PACKAGE_URL "$PACKAGE_URL"
2551 _ACEOF
2552
2553
2554 # Let the site file select an alternate cache file if it wants to.
2555 # Prefer an explicitly selected file to automatically selected ones.
2556 ac_site_file1=NONE
2557 ac_site_file2=NONE
2558 if test -n "$CONFIG_SITE"; then
2559   # We do not want a PATH search for config.site.
2560   case $CONFIG_SITE in #((
2561     -*)  ac_site_file1=./$CONFIG_SITE;;
2562     */*) ac_site_file1=$CONFIG_SITE;;
2563     *)   ac_site_file1=./$CONFIG_SITE;;
2564   esac
2565 elif test "x$prefix" != xNONE; then
2566   ac_site_file1=$prefix/share/config.site
2567   ac_site_file2=$prefix/etc/config.site
2568 else
2569   ac_site_file1=$ac_default_prefix/share/config.site
2570   ac_site_file2=$ac_default_prefix/etc/config.site
2571 fi
2572 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
2573 do
2574   test "x$ac_site_file" = xNONE && continue
2575   if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
2576     { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2577 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
2578     sed 's/^/| /' "$ac_site_file" >&5
2579     . "$ac_site_file" \
2580       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2581 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2582 as_fn_error $? "failed to load site script $ac_site_file
2583 See \`config.log' for more details" "$LINENO" 5; }
2584   fi
2585 done
2586
2587 if test -r "$cache_file"; then
2588   # Some versions of bash will fail to source /dev/null (special files
2589   # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
2590   if test /dev/null != "$cache_file" && test -f "$cache_file"; then
2591     { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
2592 $as_echo "$as_me: loading cache $cache_file" >&6;}
2593     case $cache_file in
2594       [\\/]* | ?:[\\/]* ) . "$cache_file";;
2595       *)                      . "./$cache_file";;
2596     esac
2597   fi
2598 else
2599   { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
2600 $as_echo "$as_me: creating cache $cache_file" >&6;}
2601   >$cache_file
2602 fi
2603
2604 # Check that the precious variables saved in the cache have kept the same
2605 # value.
2606 ac_cache_corrupted=false
2607 for ac_var in $ac_precious_vars; do
2608   eval ac_old_set=\$ac_cv_env_${ac_var}_set
2609   eval ac_new_set=\$ac_env_${ac_var}_set
2610   eval ac_old_val=\$ac_cv_env_${ac_var}_value
2611   eval ac_new_val=\$ac_env_${ac_var}_value
2612   case $ac_old_set,$ac_new_set in
2613     set,)
2614       { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
2615 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
2616       ac_cache_corrupted=: ;;
2617     ,set)
2618       { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
2619 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
2620       ac_cache_corrupted=: ;;
2621     ,);;
2622     *)
2623       if test "x$ac_old_val" != "x$ac_new_val"; then
2624         # differences in whitespace do not lead to failure.
2625         ac_old_val_w=`echo x $ac_old_val`
2626         ac_new_val_w=`echo x $ac_new_val`
2627         if test "$ac_old_val_w" != "$ac_new_val_w"; then
2628           { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
2629 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
2630           ac_cache_corrupted=:
2631         else
2632           { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
2633 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
2634           eval $ac_var=\$ac_old_val
2635         fi
2636         { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
2637 $as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
2638         { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
2639 $as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
2640       fi;;
2641   esac
2642   # Pass precious variables to config.status.
2643   if test "$ac_new_set" = set; then
2644     case $ac_new_val in
2645     *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
2646     *) ac_arg=$ac_var=$ac_new_val ;;
2647     esac
2648     case " $ac_configure_args " in
2649       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
2650       *) as_fn_append ac_configure_args " '$ac_arg'" ;;
2651     esac
2652   fi
2653 done
2654 if $ac_cache_corrupted; then
2655   { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2656 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2657   { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
2658 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
2659   as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
2660 fi
2661 ## -------------------- ##
2662 ## Main body of script. ##
2663 ## -------------------- ##
2664
2665 ac_ext=c
2666 ac_cpp='$CPP $CPPFLAGS'
2667 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2668 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2669 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2670
2671
2672
2673
2674
2675
2676 ac_aux_dir=
2677 for ac_dir in config "$srcdir"/config; do
2678   if test -f "$ac_dir/install-sh"; then
2679     ac_aux_dir=$ac_dir
2680     ac_install_sh="$ac_aux_dir/install-sh -c"
2681     break
2682   elif test -f "$ac_dir/install.sh"; then
2683     ac_aux_dir=$ac_dir
2684     ac_install_sh="$ac_aux_dir/install.sh -c"
2685     break
2686   elif test -f "$ac_dir/shtool"; then
2687     ac_aux_dir=$ac_dir
2688     ac_install_sh="$ac_aux_dir/shtool install -c"
2689     break
2690   fi
2691 done
2692 if test -z "$ac_aux_dir"; then
2693   as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5
2694 fi
2695
2696 # These three variables are undocumented and unsupported,
2697 # and are intended to be withdrawn in a future Autoconf release.
2698 # They can cause serious problems if a builder's source tree is in a directory
2699 # whose full name contains unusual characters.
2700 ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
2701 ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
2702 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
2703
2704
2705
2706 configure_args=$ac_configure_args
2707
2708
2709 PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\.[0-9][0-9]*\)'`
2710
2711
2712 cat >>confdefs.h <<_ACEOF
2713 #define PG_MAJORVERSION "$PG_MAJORVERSION"
2714 _ACEOF
2715
2716
2717
2718
2719
2720 # Check whether --with-extra-version was given.
2721 if test "${with_extra_version+set}" = set; then :
2722   withval=$with_extra_version;
2723   case $withval in
2724     yes)
2725       as_fn_error $? "argument required for --with-extra-version option" "$LINENO" 5
2726       ;;
2727     no)
2728       as_fn_error $? "argument required for --with-extra-version option" "$LINENO" 5
2729       ;;
2730     *)
2731       PG_VERSION="$PACKAGE_VERSION$withval"
2732       ;;
2733   esac
2734
2735 else
2736   PG_VERSION="$PACKAGE_VERSION"
2737 fi
2738
2739
2740
2741 cat >>confdefs.h <<_ACEOF
2742 #define PG_VERSION "$PG_VERSION"
2743 _ACEOF
2744
2745
2746 # Make sure we can run config.sub.
2747 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
2748   as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
2749
2750 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
2751 $as_echo_n "checking build system type... " >&6; }
2752 if ${ac_cv_build+:} false; then :
2753   $as_echo_n "(cached) " >&6
2754 else
2755   ac_build_alias=$build_alias
2756 test "x$ac_build_alias" = x &&
2757   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
2758 test "x$ac_build_alias" = x &&
2759   as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
2760 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
2761   as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
2762
2763 fi
2764 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
2765 $as_echo "$ac_cv_build" >&6; }
2766 case $ac_cv_build in
2767 *-*-*) ;;
2768 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
2769 esac
2770 build=$ac_cv_build
2771 ac_save_IFS=$IFS; IFS='-'
2772 set x $ac_cv_build
2773 shift
2774 build_cpu=$1
2775 build_vendor=$2
2776 shift; shift
2777 # Remember, the first character of IFS is used to create $*,
2778 # except with old shells:
2779 build_os=$*
2780 IFS=$ac_save_IFS
2781 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
2782
2783
2784 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
2785 $as_echo_n "checking host system type... " >&6; }
2786 if ${ac_cv_host+:} false; then :
2787   $as_echo_n "(cached) " >&6
2788 else
2789   if test "x$host_alias" = x; then
2790   ac_cv_host=$ac_cv_build
2791 else
2792   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
2793     as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
2794 fi
2795
2796 fi
2797 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
2798 $as_echo "$ac_cv_host" >&6; }
2799 case $ac_cv_host in
2800 *-*-*) ;;
2801 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
2802 esac
2803 host=$ac_cv_host
2804 ac_save_IFS=$IFS; IFS='-'
2805 set x $ac_cv_host
2806 shift
2807 host_cpu=$1
2808 host_vendor=$2
2809 shift; shift
2810 # Remember, the first character of IFS is used to create $*,
2811 # except with old shells:
2812 host_os=$*
2813 IFS=$ac_save_IFS
2814 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
2815
2816
2817
2818 template=
2819 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which template to use" >&5
2820 $as_echo_n "checking which template to use... " >&6; }
2821
2822
2823
2824
2825 # Check whether --with-template was given.
2826 if test "${with_template+set}" = set; then :
2827   withval=$with_template;
2828   case $withval in
2829     yes)
2830       as_fn_error $? "argument required for --with-template option" "$LINENO" 5
2831       ;;
2832     no)
2833       as_fn_error $? "argument required for --with-template option" "$LINENO" 5
2834       ;;
2835     *)
2836
2837   case $withval in
2838     list)   echo; ls "$srcdir/src/template"; exit;;
2839     *)      if test -f "$srcdir/src/template/$with_template" ; then
2840               template=$withval
2841             else
2842               as_fn_error $? "'$withval' is not a valid template name. Use 'list' for a list." "$LINENO" 5
2843             fi;;
2844   esac
2845
2846       ;;
2847   esac
2848
2849 else
2850
2851 # --with-template not given
2852
2853 case $host_os in
2854      aix*) template=aix ;;
2855   cygwin*) template=cygwin ;;
2856   darwin*) template=darwin ;;
2857 dragonfly*) template=netbsd ;;
2858  freebsd*) template=freebsd ;;
2859     hpux*) template=hpux ;;
2860  linux*|gnu*|k*bsd*-gnu)
2861            template=linux ;;
2862    mingw*) template=win32 ;;
2863   netbsd*) template=netbsd ;;
2864  openbsd*) template=openbsd ;;
2865      sco*) template=sco ;;
2866  solaris*) template=solaris ;;
2867    sysv5*) template=unixware ;;
2868 esac
2869
2870   if test x"$template" = x"" ; then
2871     as_fn_error $? "
2872 *******************************************************************
2873 PostgreSQL has apparently not been ported to your platform yet.
2874 To try a manual configuration, look into the src/template directory
2875 for a similar platform and use the '--with-template=' option.
2876
2877 Please also contact <pgsql-bugs@postgresql.org> to see about
2878 rectifying this.  Include the above 'checking host system type...'
2879 line.
2880 *******************************************************************
2881 " "$LINENO" 5
2882   fi
2883
2884
2885 fi
2886
2887
2888
2889 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $template" >&5
2890 $as_echo "$template" >&6; }
2891
2892 PORTNAME=$template
2893
2894
2895 # Initialize default assumption that we do not need separate assembly code
2896 # for TAS (test-and-set).  This can be overridden by the template file
2897 # when it's executed.
2898 need_tas=no
2899 tas_file=dummy.s
2900
2901
2902
2903 ##
2904 ## Command line options
2905 ##
2906
2907 #
2908 # Add non-standard directories to the include path
2909 #
2910
2911
2912
2913 # Check whether --with-includes was given.
2914 if test "${with_includes+set}" = set; then :
2915   withval=$with_includes;
2916   case $withval in
2917     yes)
2918       as_fn_error $? "argument required for --with-includes option" "$LINENO" 5
2919       ;;
2920     no)
2921       as_fn_error $? "argument required for --with-includes option" "$LINENO" 5
2922       ;;
2923     *)
2924
2925       ;;
2926   esac
2927
2928 fi
2929
2930
2931
2932
2933 #
2934 # Add non-standard directories to the library search path
2935 #
2936
2937
2938
2939 # Check whether --with-libraries was given.
2940 if test "${with_libraries+set}" = set; then :
2941   withval=$with_libraries;
2942   case $withval in
2943     yes)
2944       as_fn_error $? "argument required for --with-libraries option" "$LINENO" 5
2945       ;;
2946     no)
2947       as_fn_error $? "argument required for --with-libraries option" "$LINENO" 5
2948       ;;
2949     *)
2950       LIBRARY_DIRS=$withval
2951       ;;
2952   esac
2953
2954 fi
2955
2956
2957
2958
2959
2960
2961 # Check whether --with-libs was given.
2962 if test "${with_libs+set}" = set; then :
2963   withval=$with_libs;
2964   case $withval in
2965     yes)
2966       as_fn_error $? "argument required for --with-libs option" "$LINENO" 5
2967       ;;
2968     no)
2969       as_fn_error $? "argument required for --with-libs option" "$LINENO" 5
2970       ;;
2971     *)
2972       LIBRARY_DIRS=$withval
2973       ;;
2974   esac
2975
2976 fi
2977
2978
2979
2980
2981 #
2982 # 64-bit integer date/time storage: enabled by default.
2983 #
2984 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with 64-bit integer date/time support" >&5
2985 $as_echo_n "checking whether to build with 64-bit integer date/time support... " >&6; }
2986
2987
2988 # Check whether --enable-integer-datetimes was given.
2989 if test "${enable_integer_datetimes+set}" = set; then :
2990   enableval=$enable_integer_datetimes;
2991   case $enableval in
2992     yes)
2993
2994 $as_echo "#define USE_INTEGER_DATETIMES 1" >>confdefs.h
2995
2996       ;;
2997     no)
2998       :
2999       ;;
3000     *)
3001       as_fn_error $? "no argument expected for --enable-integer-datetimes option" "$LINENO" 5
3002       ;;
3003   esac
3004
3005 else
3006   enable_integer_datetimes=yes
3007
3008 $as_echo "#define USE_INTEGER_DATETIMES 1" >>confdefs.h
3009
3010 fi
3011
3012
3013 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_integer_datetimes" >&5
3014 $as_echo "$enable_integer_datetimes" >&6; }
3015
3016
3017 #
3018 # NLS
3019 #
3020 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is wanted" >&5
3021 $as_echo_n "checking whether NLS is wanted... " >&6; }
3022
3023
3024 # Check whether --enable-nls was given.
3025 if test "${enable_nls+set}" = set; then :
3026   enableval=$enable_nls;
3027   case $enableval in
3028     yes)
3029       :
3030       ;;
3031     no)
3032       :
3033       ;;
3034     *)
3035       enable_nls=yes
3036 WANTED_LANGUAGES=$enableval
3037       ;;
3038   esac
3039
3040 else
3041   enable_nls=no
3042 fi
3043
3044
3045
3046 if test "$enable_nls" = yes; then
3047
3048 $as_echo "#define ENABLE_NLS 1" >>confdefs.h
3049
3050 fi
3051
3052 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_nls" >&5
3053 $as_echo "$enable_nls" >&6; }
3054
3055
3056
3057 #
3058 # Default port number (--with-pgport), default 5432
3059 #
3060 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for default port number" >&5
3061 $as_echo_n "checking for default port number... " >&6; }
3062
3063
3064
3065 # Check whether --with-pgport was given.
3066 if test "${with_pgport+set}" = set; then :
3067   withval=$with_pgport;
3068   case $withval in
3069     yes)
3070       as_fn_error $? "argument required for --with-pgport option" "$LINENO" 5
3071       ;;
3072     no)
3073       as_fn_error $? "argument required for --with-pgport option" "$LINENO" 5
3074       ;;
3075     *)
3076       default_port=$withval
3077       ;;
3078   esac
3079
3080 else
3081   default_port=5432
3082 fi
3083
3084
3085 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $default_port" >&5
3086 $as_echo "$default_port" >&6; }
3087 # Need both of these because some places want an integer and some a string
3088
3089 cat >>confdefs.h <<_ACEOF
3090 #define DEF_PGPORT ${default_port}
3091 _ACEOF
3092
3093
3094 cat >>confdefs.h <<_ACEOF
3095 #define DEF_PGPORT_STR "${default_port}"
3096 _ACEOF
3097
3098
3099
3100 #
3101 # '-rpath'-like feature can be disabled
3102 #
3103
3104
3105 # Check whether --enable-rpath was given.
3106 if test "${enable_rpath+set}" = set; then :
3107   enableval=$enable_rpath;
3108   case $enableval in
3109     yes)
3110       :
3111       ;;
3112     no)
3113       :
3114       ;;
3115     *)
3116       as_fn_error $? "no argument expected for --enable-rpath option" "$LINENO" 5
3117       ;;
3118   esac
3119
3120 else
3121   enable_rpath=yes
3122
3123 fi
3124
3125
3126
3127
3128 #
3129 # Spinlocks
3130 #
3131
3132
3133 # Check whether --enable-spinlocks was given.
3134 if test "${enable_spinlocks+set}" = set; then :
3135   enableval=$enable_spinlocks;
3136   case $enableval in
3137     yes)
3138       :
3139       ;;
3140     no)
3141       :
3142       ;;
3143     *)
3144       as_fn_error $? "no argument expected for --enable-spinlocks option" "$LINENO" 5
3145       ;;
3146   esac
3147
3148 else
3149   enable_spinlocks=yes
3150
3151 fi
3152
3153
3154
3155 #
3156 # Atomic operations
3157 #
3158
3159
3160 # Check whether --enable-atomics was given.
3161 if test "${enable_atomics+set}" = set; then :
3162   enableval=$enable_atomics;
3163   case $enableval in
3164     yes)
3165       :
3166       ;;
3167     no)
3168       :
3169       ;;
3170     *)
3171       as_fn_error $? "no argument expected for --enable-atomics option" "$LINENO" 5
3172       ;;
3173   esac
3174
3175 else
3176   enable_atomics=yes
3177
3178 fi
3179
3180
3181
3182 #
3183 # --enable-debug adds -g to compiler flags
3184 #
3185
3186
3187 # Check whether --enable-debug was given.
3188 if test "${enable_debug+set}" = set; then :
3189   enableval=$enable_debug;
3190   case $enableval in
3191     yes)
3192       :
3193       ;;
3194     no)
3195       :
3196       ;;
3197     *)
3198       as_fn_error $? "no argument expected for --enable-debug option" "$LINENO" 5
3199       ;;
3200   esac
3201
3202 else
3203   enable_debug=no
3204
3205 fi
3206
3207
3208
3209
3210 #
3211 # --enable-profiling enables gcc profiling
3212 #
3213
3214
3215 # Check whether --enable-profiling was given.
3216 if test "${enable_profiling+set}" = set; then :
3217   enableval=$enable_profiling;
3218   case $enableval in
3219     yes)
3220       :
3221       ;;
3222     no)
3223       :
3224       ;;
3225     *)
3226       as_fn_error $? "no argument expected for --enable-profiling option" "$LINENO" 5
3227       ;;
3228   esac
3229
3230 else
3231   enable_profiling=no
3232
3233 fi
3234
3235
3236
3237 #
3238 # --enable-coverage enables generation of code coverage metrics with gcov
3239 #
3240
3241
3242 # Check whether --enable-coverage was given.
3243 if test "${enable_coverage+set}" = set; then :
3244   enableval=$enable_coverage;
3245   case $enableval in
3246     yes)
3247       for ac_prog in gcov
3248 do
3249   # Extract the first word of "$ac_prog", so it can be a program name with args.
3250 set dummy $ac_prog; ac_word=$2
3251 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3252 $as_echo_n "checking for $ac_word... " >&6; }
3253 if ${ac_cv_prog_GCOV+:} false; then :
3254   $as_echo_n "(cached) " >&6
3255 else
3256   if test -n "$GCOV"; then
3257   ac_cv_prog_GCOV="$GCOV" # Let the user override the test.
3258 else
3259 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3260 for as_dir in $PATH
3261 do
3262   IFS=$as_save_IFS
3263   test -z "$as_dir" && as_dir=.
3264     for ac_exec_ext in '' $ac_executable_extensions; do
3265   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3266     ac_cv_prog_GCOV="$ac_prog"
3267     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3268     break 2
3269   fi
3270 done
3271   done
3272 IFS=$as_save_IFS
3273
3274 fi
3275 fi
3276 GCOV=$ac_cv_prog_GCOV
3277 if test -n "$GCOV"; then
3278   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5
3279 $as_echo "$GCOV" >&6; }
3280 else
3281   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3282 $as_echo "no" >&6; }
3283 fi
3284
3285
3286   test -n "$GCOV" && break
3287 done
3288
3289 if test -z "$GCOV"; then
3290   as_fn_error $? "gcov not found" "$LINENO" 5
3291 fi
3292 for ac_prog in lcov
3293 do
3294   # Extract the first word of "$ac_prog", so it can be a program name with args.
3295 set dummy $ac_prog; ac_word=$2
3296 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3297 $as_echo_n "checking for $ac_word... " >&6; }
3298 if ${ac_cv_prog_LCOV+:} false; then :
3299   $as_echo_n "(cached) " >&6
3300 else
3301   if test -n "$LCOV"; then
3302   ac_cv_prog_LCOV="$LCOV" # Let the user override the test.
3303 else
3304 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3305 for as_dir in $PATH
3306 do
3307   IFS=$as_save_IFS
3308   test -z "$as_dir" && as_dir=.
3309     for ac_exec_ext in '' $ac_executable_extensions; do
3310   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3311     ac_cv_prog_LCOV="$ac_prog"
3312     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3313     break 2
3314   fi
3315 done
3316   done
3317 IFS=$as_save_IFS
3318
3319 fi
3320 fi
3321 LCOV=$ac_cv_prog_LCOV
3322 if test -n "$LCOV"; then
3323   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5
3324 $as_echo "$LCOV" >&6; }
3325 else
3326   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3327 $as_echo "no" >&6; }
3328 fi
3329
3330
3331   test -n "$LCOV" && break
3332 done
3333
3334 if test -z "$LCOV"; then
3335   as_fn_error $? "lcov not found" "$LINENO" 5
3336 fi
3337 for ac_prog in genhtml
3338 do
3339   # Extract the first word of "$ac_prog", so it can be a program name with args.
3340 set dummy $ac_prog; ac_word=$2
3341 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3342 $as_echo_n "checking for $ac_word... " >&6; }
3343 if ${ac_cv_prog_GENHTML+:} false; then :
3344   $as_echo_n "(cached) " >&6
3345 else
3346   if test -n "$GENHTML"; then
3347   ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test.
3348 else
3349 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3350 for as_dir in $PATH
3351 do
3352   IFS=$as_save_IFS
3353   test -z "$as_dir" && as_dir=.
3354     for ac_exec_ext in '' $ac_executable_extensions; do
3355   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3356     ac_cv_prog_GENHTML="$ac_prog"
3357     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3358     break 2
3359   fi
3360 done
3361   done
3362 IFS=$as_save_IFS
3363
3364 fi
3365 fi
3366 GENHTML=$ac_cv_prog_GENHTML
3367 if test -n "$GENHTML"; then
3368   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5
3369 $as_echo "$GENHTML" >&6; }
3370 else
3371   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3372 $as_echo "no" >&6; }
3373 fi
3374
3375
3376   test -n "$GENHTML" && break
3377 done
3378
3379 if test -z "$GENHTML"; then
3380   as_fn_error $? "genhtml not found" "$LINENO" 5
3381 fi
3382       ;;
3383     no)
3384       :
3385       ;;
3386     *)
3387       as_fn_error $? "no argument expected for --enable-coverage option" "$LINENO" 5
3388       ;;
3389   esac
3390
3391 else
3392   enable_coverage=no
3393
3394 fi
3395
3396
3397
3398
3399 #
3400 # DTrace
3401 #
3402
3403
3404 # Check whether --enable-dtrace was given.
3405 if test "${enable_dtrace+set}" = set; then :
3406   enableval=$enable_dtrace;
3407   case $enableval in
3408     yes)
3409       for ac_prog in dtrace
3410 do
3411   # Extract the first word of "$ac_prog", so it can be a program name with args.
3412 set dummy $ac_prog; ac_word=$2
3413 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3414 $as_echo_n "checking for $ac_word... " >&6; }
3415 if ${ac_cv_prog_DTRACE+:} false; then :
3416   $as_echo_n "(cached) " >&6
3417 else
3418   if test -n "$DTRACE"; then
3419   ac_cv_prog_DTRACE="$DTRACE" # Let the user override the test.
3420 else
3421 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3422 for as_dir in $PATH
3423 do
3424   IFS=$as_save_IFS
3425   test -z "$as_dir" && as_dir=.
3426     for ac_exec_ext in '' $ac_executable_extensions; do
3427   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3428     ac_cv_prog_DTRACE="$ac_prog"
3429     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3430     break 2
3431   fi
3432 done
3433   done
3434 IFS=$as_save_IFS
3435
3436 fi
3437 fi
3438 DTRACE=$ac_cv_prog_DTRACE
3439 if test -n "$DTRACE"; then
3440   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5
3441 $as_echo "$DTRACE" >&6; }
3442 else
3443   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3444 $as_echo "no" >&6; }
3445 fi
3446
3447
3448   test -n "$DTRACE" && break
3449 done
3450
3451 if test -z "$DTRACE"; then
3452   as_fn_error $? "dtrace not found" "$LINENO" 5
3453 fi
3454
3455       ;;
3456     no)
3457       :
3458       ;;
3459     *)
3460       as_fn_error $? "no argument expected for --enable-dtrace option" "$LINENO" 5
3461       ;;
3462   esac
3463
3464 else
3465   enable_dtrace=no
3466
3467 fi
3468
3469
3470
3471
3472 #
3473 # TAP tests
3474 #
3475
3476
3477 # Check whether --enable-tap-tests was given.
3478 if test "${enable_tap_tests+set}" = set; then :
3479   enableval=$enable_tap_tests;
3480   case $enableval in
3481     yes)
3482       :
3483       ;;
3484     no)
3485       :
3486       ;;
3487     *)
3488       as_fn_error $? "no argument expected for --enable-tap-tests option" "$LINENO" 5
3489       ;;
3490   esac
3491
3492 else
3493   enable_tap_tests=no
3494
3495 fi
3496
3497
3498
3499
3500 #
3501 # Block size
3502 #
3503 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for block size" >&5
3504 $as_echo_n "checking for block size... " >&6; }
3505
3506
3507
3508 # Check whether --with-blocksize was given.
3509 if test "${with_blocksize+set}" = set; then :
3510   withval=$with_blocksize;
3511   case $withval in
3512     yes)
3513       as_fn_error $? "argument required for --with-blocksize option" "$LINENO" 5
3514       ;;
3515     no)
3516       as_fn_error $? "argument required for --with-blocksize option" "$LINENO" 5
3517       ;;
3518     *)
3519       blocksize=$withval
3520       ;;
3521   esac
3522
3523 else
3524   blocksize=8
3525 fi
3526
3527
3528 case ${blocksize} in
3529   1) BLCKSZ=1024;;
3530   2) BLCKSZ=2048;;
3531   4) BLCKSZ=4096;;
3532   8) BLCKSZ=8192;;
3533  16) BLCKSZ=16384;;
3534  32) BLCKSZ=32768;;
3535   *) as_fn_error $? "Invalid block size. Allowed values are 1,2,4,8,16,32." "$LINENO" 5
3536 esac
3537 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${blocksize}kB" >&5
3538 $as_echo "${blocksize}kB" >&6; }
3539
3540
3541 cat >>confdefs.h <<_ACEOF
3542 #define BLCKSZ ${BLCKSZ}
3543 _ACEOF
3544
3545
3546 #
3547 # Relation segment size
3548 #
3549 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for segment size" >&5
3550 $as_echo_n "checking for segment size... " >&6; }
3551
3552
3553
3554 # Check whether --with-segsize was given.
3555 if test "${with_segsize+set}" = set; then :
3556   withval=$with_segsize;
3557   case $withval in
3558     yes)
3559       as_fn_error $? "argument required for --with-segsize option" "$LINENO" 5
3560       ;;
3561     no)
3562       as_fn_error $? "argument required for --with-segsize option" "$LINENO" 5
3563       ;;
3564     *)
3565       segsize=$withval
3566       ;;
3567   esac
3568
3569 else
3570   segsize=1
3571 fi
3572
3573
3574 # this expression is set up to avoid unnecessary integer overflow
3575 # blocksize is already guaranteed to be a factor of 1024
3576 RELSEG_SIZE=`expr '(' 1024 / ${blocksize} ')' '*' ${segsize} '*' 1024`
3577 test $? -eq 0 || exit 1
3578 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${segsize}GB" >&5
3579 $as_echo "${segsize}GB" >&6; }
3580
3581
3582 cat >>confdefs.h <<_ACEOF
3583 #define RELSEG_SIZE ${RELSEG_SIZE}
3584 _ACEOF
3585
3586
3587 #
3588 # WAL block size
3589 #
3590 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAL block size" >&5
3591 $as_echo_n "checking for WAL block size... " >&6; }
3592
3593
3594
3595 # Check whether --with-wal-blocksize was given.
3596 if test "${with_wal_blocksize+set}" = set; then :
3597   withval=$with_wal_blocksize;
3598   case $withval in
3599     yes)
3600       as_fn_error $? "argument required for --with-wal-blocksize option" "$LINENO" 5
3601       ;;
3602     no)
3603       as_fn_error $? "argument required for --with-wal-blocksize option" "$LINENO" 5
3604       ;;
3605     *)
3606       wal_blocksize=$withval
3607       ;;
3608   esac
3609
3610 else
3611   wal_blocksize=8
3612 fi
3613
3614
3615 case ${wal_blocksize} in
3616   1) XLOG_BLCKSZ=1024;;
3617   2) XLOG_BLCKSZ=2048;;
3618   4) XLOG_BLCKSZ=4096;;
3619   8) XLOG_BLCKSZ=8192;;
3620  16) XLOG_BLCKSZ=16384;;
3621  32) XLOG_BLCKSZ=32768;;
3622  64) XLOG_BLCKSZ=65536;;
3623   *) as_fn_error $? "Invalid WAL block size. Allowed values are 1,2,4,8,16,32,64." "$LINENO" 5
3624 esac
3625 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${wal_blocksize}kB" >&5
3626 $as_echo "${wal_blocksize}kB" >&6; }
3627
3628
3629 cat >>confdefs.h <<_ACEOF
3630 #define XLOG_BLCKSZ ${XLOG_BLCKSZ}
3631 _ACEOF
3632
3633
3634 #
3635 # WAL segment size
3636 #
3637 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAL segment size" >&5
3638 $as_echo_n "checking for WAL segment size... " >&6; }
3639
3640
3641
3642 # Check whether --with-wal-segsize was given.
3643 if test "${with_wal_segsize+set}" = set; then :
3644   withval=$with_wal_segsize;
3645   case $withval in
3646     yes)
3647       as_fn_error $? "argument required for --with-wal-segsize option" "$LINENO" 5
3648       ;;
3649     no)
3650       as_fn_error $? "argument required for --with-wal-segsize option" "$LINENO" 5
3651       ;;
3652     *)
3653       wal_segsize=$withval
3654       ;;
3655   esac
3656
3657 else
3658   wal_segsize=16
3659 fi
3660
3661
3662 case ${wal_segsize} in
3663   1) ;;
3664   2) ;;
3665   4) ;;
3666   8) ;;
3667  16) ;;
3668  32) ;;
3669  64) ;;
3670   *) as_fn_error $? "Invalid WAL segment size. Allowed values are 1,2,4,8,16,32,64." "$LINENO" 5
3671 esac
3672 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${wal_segsize}MB" >&5
3673 $as_echo "${wal_segsize}MB" >&6; }
3674
3675
3676 cat >>confdefs.h <<_ACEOF
3677 #define XLOG_SEG_SIZE (${wal_segsize} * 1024 * 1024)
3678 _ACEOF
3679
3680
3681 #
3682 # C compiler
3683 #
3684
3685 # For historical reasons you can also use --with-CC to specify the C compiler
3686 # to use, although the standard way to do this is to set the CC environment
3687 # variable.
3688
3689
3690
3691 # Check whether --with-CC was given.
3692 if test "${with_CC+set}" = set; then :
3693   withval=$with_CC;
3694   case $withval in
3695     yes)
3696       as_fn_error $? "argument required for --with-CC option" "$LINENO" 5
3697       ;;
3698     no)
3699       as_fn_error $? "argument required for --with-CC option" "$LINENO" 5
3700       ;;
3701     *)
3702       CC=$with_CC
3703       ;;
3704   esac
3705
3706 fi
3707
3708
3709
3710 case $template in
3711   aix) pgac_cc_list="gcc xlc";;
3712     *) pgac_cc_list="gcc cc";;
3713 esac
3714
3715 ac_ext=c
3716 ac_cpp='$CPP $CPPFLAGS'
3717 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3718 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3719 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3720 if test -n "$ac_tool_prefix"; then
3721   for ac_prog in $pgac_cc_list
3722   do
3723     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3724 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3725 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3726 $as_echo_n "checking for $ac_word... " >&6; }
3727 if ${ac_cv_prog_CC+:} false; then :
3728   $as_echo_n "(cached) " >&6
3729 else
3730   if test -n "$CC"; then
3731   ac_cv_prog_CC="$CC" # Let the user override the test.
3732 else
3733 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3734 for as_dir in $PATH
3735 do
3736   IFS=$as_save_IFS
3737   test -z "$as_dir" && as_dir=.
3738     for ac_exec_ext in '' $ac_executable_extensions; do
3739   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3740     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3741     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3742     break 2
3743   fi
3744 done
3745   done
3746 IFS=$as_save_IFS
3747
3748 fi
3749 fi
3750 CC=$ac_cv_prog_CC
3751 if test -n "$CC"; then
3752   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3753 $as_echo "$CC" >&6; }
3754 else
3755   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3756 $as_echo "no" >&6; }
3757 fi
3758
3759
3760     test -n "$CC" && break
3761   done
3762 fi
3763 if test -z "$CC"; then
3764   ac_ct_CC=$CC
3765   for ac_prog in $pgac_cc_list
3766 do
3767   # Extract the first word of "$ac_prog", so it can be a program name with args.
3768 set dummy $ac_prog; ac_word=$2
3769 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3770 $as_echo_n "checking for $ac_word... " >&6; }
3771 if ${ac_cv_prog_ac_ct_CC+:} false; then :
3772   $as_echo_n "(cached) " >&6
3773 else
3774   if test -n "$ac_ct_CC"; then
3775   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3776 else
3777 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3778 for as_dir in $PATH
3779 do
3780   IFS=$as_save_IFS
3781   test -z "$as_dir" && as_dir=.
3782     for ac_exec_ext in '' $ac_executable_extensions; do
3783   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3784     ac_cv_prog_ac_ct_CC="$ac_prog"
3785     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3786     break 2
3787   fi
3788 done
3789   done
3790 IFS=$as_save_IFS
3791
3792 fi
3793 fi
3794 ac_ct_CC=$ac_cv_prog_ac_ct_CC
3795 if test -n "$ac_ct_CC"; then
3796   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3797 $as_echo "$ac_ct_CC" >&6; }
3798 else
3799   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3800 $as_echo "no" >&6; }
3801 fi
3802
3803
3804   test -n "$ac_ct_CC" && break
3805 done
3806
3807   if test "x$ac_ct_CC" = x; then
3808     CC=""
3809   else
3810     case $cross_compiling:$ac_tool_warned in
3811 yes:)
3812 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3813 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3814 ac_tool_warned=yes ;;
3815 esac
3816     CC=$ac_ct_CC
3817   fi
3818 fi
3819
3820
3821 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3822 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3823 as_fn_error $? "no acceptable C compiler found in \$PATH
3824 See \`config.log' for more details" "$LINENO" 5; }
3825
3826 # Provide some information about the compiler.
3827 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
3828 set X $ac_compile
3829 ac_compiler=$2
3830 for ac_option in --version -v -V -qversion; do
3831   { { ac_try="$ac_compiler $ac_option >&5"
3832 case "(($ac_try" in
3833   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3834   *) ac_try_echo=$ac_try;;
3835 esac
3836 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3837 $as_echo "$ac_try_echo"; } >&5
3838   (eval "$ac_compiler $ac_option >&5") 2>conftest.err
3839   ac_status=$?
3840   if test -s conftest.err; then
3841     sed '10a\
3842 ... rest of stderr output deleted ...
3843          10q' conftest.err >conftest.er1
3844     cat conftest.er1 >&5
3845   fi
3846   rm -f conftest.er1 conftest.err
3847   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3848   test $ac_status = 0; }
3849 done
3850
3851 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3852 /* end confdefs.h.  */
3853
3854 int
3855 main ()
3856 {
3857
3858   ;
3859   return 0;
3860 }
3861 _ACEOF
3862 ac_clean_files_save=$ac_clean_files
3863 ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
3864 # Try to create an executable without -o first, disregard a.out.
3865 # It will help us diagnose broken compilers, and finding out an intuition
3866 # of exeext.
3867 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
3868 $as_echo_n "checking whether the C compiler works... " >&6; }
3869 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
3870
3871 # The possible output files:
3872 ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
3873
3874 ac_rmfiles=
3875 for ac_file in $ac_files
3876 do
3877   case $ac_file in
3878     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3879     * ) ac_rmfiles="$ac_rmfiles $ac_file";;
3880   esac
3881 done
3882 rm -f $ac_rmfiles
3883
3884 if { { ac_try="$ac_link_default"
3885 case "(($ac_try" in
3886   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3887   *) ac_try_echo=$ac_try;;
3888 esac
3889 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3890 $as_echo "$ac_try_echo"; } >&5
3891   (eval "$ac_link_default") 2>&5
3892   ac_status=$?
3893   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3894   test $ac_status = 0; }; then :
3895   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
3896 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
3897 # in a Makefile.  We should not override ac_cv_exeext if it was cached,
3898 # so that the user can short-circuit this test for compilers unknown to
3899 # Autoconf.
3900 for ac_file in $ac_files ''
3901 do
3902   test -f "$ac_file" || continue
3903   case $ac_file in
3904     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
3905         ;;
3906     [ab].out )
3907         # We found the default executable, but exeext='' is most
3908         # certainly right.
3909         break;;
3910     *.* )
3911         if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
3912         then :; else
3913            ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3914         fi
3915         # We set ac_cv_exeext here because the later test for it is not
3916         # safe: cross compilers may not add the suffix if given an `-o'
3917         # argument, so we may need to know it at that point already.
3918         # Even if this section looks crufty: it has the advantage of
3919         # actually working.
3920         break;;
3921     * )
3922         break;;
3923   esac
3924 done
3925 test "$ac_cv_exeext" = no && ac_cv_exeext=
3926
3927 else
3928   ac_file=''
3929 fi
3930 if test -z "$ac_file"; then :
3931   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3932 $as_echo "no" >&6; }
3933 $as_echo "$as_me: failed program was:" >&5
3934 sed 's/^/| /' conftest.$ac_ext >&5
3935
3936 { { $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 77 "C compiler cannot create executables
3939 See \`config.log' for more details" "$LINENO" 5; }
3940 else
3941   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3942 $as_echo "yes" >&6; }
3943 fi
3944 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
3945 $as_echo_n "checking for C compiler default output file name... " >&6; }
3946 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
3947 $as_echo "$ac_file" >&6; }
3948 ac_exeext=$ac_cv_exeext
3949
3950 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
3951 ac_clean_files=$ac_clean_files_save
3952 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
3953 $as_echo_n "checking for suffix of executables... " >&6; }
3954 if { { ac_try="$ac_link"
3955 case "(($ac_try" in
3956   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3957   *) ac_try_echo=$ac_try;;
3958 esac
3959 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3960 $as_echo "$ac_try_echo"; } >&5
3961   (eval "$ac_link") 2>&5
3962   ac_status=$?
3963   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3964   test $ac_status = 0; }; then :
3965   # If both `conftest.exe' and `conftest' are `present' (well, observable)
3966 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
3967 # work properly (i.e., refer to `conftest.exe'), while it won't with
3968 # `rm'.
3969 for ac_file in conftest.exe conftest conftest.*; do
3970   test -f "$ac_file" || continue
3971   case $ac_file in
3972     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3973     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3974           break;;
3975     * ) break;;
3976   esac
3977 done
3978 else
3979   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3980 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3981 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
3982 See \`config.log' for more details" "$LINENO" 5; }
3983 fi
3984 rm -f conftest conftest$ac_cv_exeext
3985 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
3986 $as_echo "$ac_cv_exeext" >&6; }
3987
3988 rm -f conftest.$ac_ext
3989 EXEEXT=$ac_cv_exeext
3990 ac_exeext=$EXEEXT
3991 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3992 /* end confdefs.h.  */
3993 #include <stdio.h>
3994 int
3995 main ()
3996 {
3997 FILE *f = fopen ("conftest.out", "w");
3998  return ferror (f) || fclose (f) != 0;
3999
4000   ;
4001   return 0;
4002 }
4003 _ACEOF
4004 ac_clean_files="$ac_clean_files conftest.out"
4005 # Check that the compiler produces executables we can run.  If not, either
4006 # the compiler is broken, or we cross compile.
4007 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
4008 $as_echo_n "checking whether we are cross compiling... " >&6; }
4009 if test "$cross_compiling" != yes; then
4010   { { ac_try="$ac_link"
4011 case "(($ac_try" in
4012   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4013   *) ac_try_echo=$ac_try;;
4014 esac
4015 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4016 $as_echo "$ac_try_echo"; } >&5
4017   (eval "$ac_link") 2>&5
4018   ac_status=$?
4019   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4020   test $ac_status = 0; }
4021   if { ac_try='./conftest$ac_cv_exeext'
4022   { { case "(($ac_try" in
4023   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4024   *) ac_try_echo=$ac_try;;
4025 esac
4026 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4027 $as_echo "$ac_try_echo"; } >&5
4028   (eval "$ac_try") 2>&5
4029   ac_status=$?
4030   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4031   test $ac_status = 0; }; }; then
4032     cross_compiling=no
4033   else
4034     if test "$cross_compiling" = maybe; then
4035         cross_compiling=yes
4036     else
4037         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4038 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4039 as_fn_error $? "cannot run C compiled programs.
4040 If you meant to cross compile, use \`--host'.
4041 See \`config.log' for more details" "$LINENO" 5; }
4042     fi
4043   fi
4044 fi
4045 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
4046 $as_echo "$cross_compiling" >&6; }
4047
4048 rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
4049 ac_clean_files=$ac_clean_files_save
4050 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
4051 $as_echo_n "checking for suffix of object files... " >&6; }
4052 if ${ac_cv_objext+:} false; then :
4053   $as_echo_n "(cached) " >&6
4054 else
4055   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4056 /* end confdefs.h.  */
4057
4058 int
4059 main ()
4060 {
4061
4062   ;
4063   return 0;
4064 }
4065 _ACEOF
4066 rm -f conftest.o conftest.obj
4067 if { { ac_try="$ac_compile"
4068 case "(($ac_try" in
4069   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4070   *) ac_try_echo=$ac_try;;
4071 esac
4072 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4073 $as_echo "$ac_try_echo"; } >&5
4074   (eval "$ac_compile") 2>&5
4075   ac_status=$?
4076   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4077   test $ac_status = 0; }; then :
4078   for ac_file in conftest.o conftest.obj conftest.*; do
4079   test -f "$ac_file" || continue;
4080   case $ac_file in
4081     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
4082     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
4083        break;;
4084   esac
4085 done
4086 else
4087   $as_echo "$as_me: failed program was:" >&5
4088 sed 's/^/| /' conftest.$ac_ext >&5
4089
4090 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4091 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4092 as_fn_error $? "cannot compute suffix of object files: cannot compile
4093 See \`config.log' for more details" "$LINENO" 5; }
4094 fi
4095 rm -f conftest.$ac_cv_objext conftest.$ac_ext
4096 fi
4097 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
4098 $as_echo "$ac_cv_objext" >&6; }
4099 OBJEXT=$ac_cv_objext
4100 ac_objext=$OBJEXT
4101 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
4102 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
4103 if ${ac_cv_c_compiler_gnu+:} false; then :
4104   $as_echo_n "(cached) " >&6
4105 else
4106   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4107 /* end confdefs.h.  */
4108
4109 int
4110 main ()
4111 {
4112 #ifndef __GNUC__
4113        choke me
4114 #endif
4115
4116   ;
4117   return 0;
4118 }
4119 _ACEOF
4120 if ac_fn_c_try_compile "$LINENO"; then :
4121   ac_compiler_gnu=yes
4122 else
4123   ac_compiler_gnu=no
4124 fi
4125 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4126 ac_cv_c_compiler_gnu=$ac_compiler_gnu
4127
4128 fi
4129 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4130 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
4131 if test $ac_compiler_gnu = yes; then
4132   GCC=yes
4133 else
4134   GCC=
4135 fi
4136 ac_test_CFLAGS=${CFLAGS+set}
4137 ac_save_CFLAGS=$CFLAGS
4138 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4139 $as_echo_n "checking whether $CC accepts -g... " >&6; }
4140 if ${ac_cv_prog_cc_g+:} false; then :
4141   $as_echo_n "(cached) " >&6
4142 else
4143   ac_save_c_werror_flag=$ac_c_werror_flag
4144    ac_c_werror_flag=yes
4145    ac_cv_prog_cc_g=no
4146    CFLAGS="-g"
4147    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4148 /* end confdefs.h.  */
4149
4150 int
4151 main ()
4152 {
4153
4154   ;
4155   return 0;
4156 }
4157 _ACEOF
4158 if ac_fn_c_try_compile "$LINENO"; then :
4159   ac_cv_prog_cc_g=yes
4160 else
4161   CFLAGS=""
4162       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4163 /* end confdefs.h.  */
4164
4165 int
4166 main ()
4167 {
4168
4169   ;
4170   return 0;
4171 }
4172 _ACEOF
4173 if ac_fn_c_try_compile "$LINENO"; then :
4174
4175 else
4176   ac_c_werror_flag=$ac_save_c_werror_flag
4177          CFLAGS="-g"
4178          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4179 /* end confdefs.h.  */
4180
4181 int
4182 main ()
4183 {
4184
4185   ;
4186   return 0;
4187 }
4188 _ACEOF
4189 if ac_fn_c_try_compile "$LINENO"; then :
4190   ac_cv_prog_cc_g=yes
4191 fi
4192 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4193 fi
4194 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4195 fi
4196 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4197    ac_c_werror_flag=$ac_save_c_werror_flag
4198 fi
4199 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4200 $as_echo "$ac_cv_prog_cc_g" >&6; }
4201 if test "$ac_test_CFLAGS" = set; then
4202   CFLAGS=$ac_save_CFLAGS
4203 elif test $ac_cv_prog_cc_g = yes; then
4204   if test "$GCC" = yes; then
4205     CFLAGS="-g -O2"
4206   else
4207     CFLAGS="-g"
4208   fi
4209 else
4210   if test "$GCC" = yes; then
4211     CFLAGS="-O2"
4212   else
4213     CFLAGS=
4214   fi
4215 fi
4216 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
4217 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
4218 if ${ac_cv_prog_cc_c89+:} false; then :
4219   $as_echo_n "(cached) " >&6
4220 else
4221   ac_cv_prog_cc_c89=no
4222 ac_save_CC=$CC
4223 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4224 /* end confdefs.h.  */
4225 #include <stdarg.h>
4226 #include <stdio.h>
4227 struct stat;
4228 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4229 struct buf { int x; };
4230 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4231 static char *e (p, i)
4232      char **p;
4233      int i;
4234 {
4235   return p[i];
4236 }
4237 static char *f (char * (*g) (char **, int), char **p, ...)
4238 {
4239   char *s;
4240   va_list v;
4241   va_start (v,p);
4242   s = g (p, va_arg (v,int));
4243   va_end (v);
4244   return s;
4245 }
4246
4247 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
4248    function prototypes and stuff, but not '\xHH' hex character constants.
4249    These don't provoke an error unfortunately, instead are silently treated
4250    as 'x'.  The following induces an error, until -std is added to get
4251    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
4252    array size at least.  It's necessary to write '\x00'==0 to get something
4253    that's true only with -std.  */
4254 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
4255
4256 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
4257    inside strings and character constants.  */
4258 #define FOO(x) 'x'
4259 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
4260
4261 int test (int i, double x);
4262 struct s1 {int (*f) (int a);};
4263 struct s2 {int (*f) (double a);};
4264 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4265 int argc;
4266 char **argv;
4267 int
4268 main ()
4269 {
4270 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4271   ;
4272   return 0;
4273 }
4274 _ACEOF
4275 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
4276         -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4277 do
4278   CC="$ac_save_CC $ac_arg"
4279   if ac_fn_c_try_compile "$LINENO"; then :
4280   ac_cv_prog_cc_c89=$ac_arg
4281 fi
4282 rm -f core conftest.err conftest.$ac_objext
4283   test "x$ac_cv_prog_cc_c89" != "xno" && break
4284 done
4285 rm -f conftest.$ac_ext
4286 CC=$ac_save_CC
4287
4288 fi
4289 # AC_CACHE_VAL
4290 case "x$ac_cv_prog_cc_c89" in
4291   x)
4292     { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4293 $as_echo "none needed" >&6; } ;;
4294   xno)
4295     { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4296 $as_echo "unsupported" >&6; } ;;
4297   *)
4298     CC="$CC $ac_cv_prog_cc_c89"
4299     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
4300 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
4301 esac
4302 if test "x$ac_cv_prog_cc_c89" != xno; then :
4303
4304 fi
4305
4306 ac_ext=c
4307 ac_cpp='$CPP $CPPFLAGS'
4308 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4309 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4310 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4311
4312
4313 # Check if it's Intel's compiler, which (usually) pretends to be gcc,
4314 # but has idiosyncrasies of its own.  We assume icc will define
4315 # __INTEL_COMPILER regardless of CFLAGS.
4316
4317 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4318 /* end confdefs.h.  */
4319
4320 int
4321 main ()
4322 {
4323 #ifndef __INTEL_COMPILER
4324 choke me
4325 #endif
4326   ;
4327   return 0;
4328 }
4329 _ACEOF
4330 if ac_fn_c_try_compile "$LINENO"; then :
4331   ICC=yes
4332 else
4333   ICC=no
4334 fi
4335 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4336
4337 # Check if it's Sun Studio compiler. We assume that
4338 # __SUNPRO_C will be defined for Sun Studio compilers
4339 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4340 /* end confdefs.h.  */
4341
4342 int
4343 main ()
4344 {
4345 #ifndef __SUNPRO_C
4346 choke me
4347 #endif
4348   ;
4349   return 0;
4350 }
4351 _ACEOF
4352 if ac_fn_c_try_compile "$LINENO"; then :
4353   SUN_STUDIO_CC=yes
4354 else
4355   SUN_STUDIO_CC=no
4356 fi
4357 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4358
4359
4360
4361 unset CFLAGS
4362
4363 #
4364 # Read the template
4365 #
4366 . "$srcdir/src/template/$template" || exit
4367
4368 # CFLAGS are selected so:
4369 # If the user specifies something in the environment, that is used.
4370 # else:  If the template file set something, that is used.
4371 # else:  If coverage was enabled, don't set anything.
4372 # else:  If the compiler is GCC, then we use -O2.
4373 # else:  If the compiler is something else, then we use -O, unless debugging.
4374
4375 if test "$ac_env_CFLAGS_set" = set; then
4376   CFLAGS=$ac_env_CFLAGS_value
4377 elif test "${CFLAGS+set}" = set; then
4378   : # (keep what template set)
4379 elif test "$enable_coverage" = yes; then
4380   : # no optimization by default
4381 elif test "$GCC" = yes; then
4382   CFLAGS="-O2"
4383 else
4384   # if the user selected debug mode, don't use -O
4385   if test "$enable_debug" != yes; then
4386     CFLAGS="-O"
4387   fi
4388 fi
4389
4390 # CFLAGS we determined above will be added back at the end
4391 user_CFLAGS=$CFLAGS
4392 CFLAGS=""
4393
4394 # set CFLAGS_VECTOR from the environment, if available
4395 if test "$ac_env_CFLAGS_VECTOR_set" = set; then
4396   CFLAGS_VECTOR=$ac_env_CFLAGS_VECTOR_value
4397 fi
4398
4399 # Some versions of GCC support some additional useful warning flags.
4400 # Check whether they are supported, and add them to CFLAGS if so.
4401 # ICC pretends to be GCC but it's lying; it doesn't support these flags,
4402 # but has its own.  Also check other compiler-specific flags here.
4403
4404 if test "$GCC" = yes -a "$ICC" = no; then
4405   CFLAGS="-Wall -Wmissing-prototypes -Wpointer-arith"
4406   # These work in some but not all gcc versions
4407   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wdeclaration-after-statement" >&5
4408 $as_echo_n "checking whether $CC supports -Wdeclaration-after-statement... " >&6; }
4409 if ${pgac_cv_prog_cc_cflags__Wdeclaration_after_statement+:} false; then :
4410   $as_echo_n "(cached) " >&6
4411 else
4412   pgac_save_CFLAGS=$CFLAGS
4413 CFLAGS="$pgac_save_CFLAGS -Wdeclaration-after-statement"
4414 ac_save_c_werror_flag=$ac_c_werror_flag
4415 ac_c_werror_flag=yes
4416 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4417 /* end confdefs.h.  */
4418
4419 int
4420 main ()
4421 {
4422
4423   ;
4424   return 0;
4425 }
4426 _ACEOF
4427 if ac_fn_c_try_compile "$LINENO"; then :
4428   pgac_cv_prog_cc_cflags__Wdeclaration_after_statement=yes
4429 else
4430   pgac_cv_prog_cc_cflags__Wdeclaration_after_statement=no
4431 fi
4432 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4433 ac_c_werror_flag=$ac_save_c_werror_flag
4434 CFLAGS="$pgac_save_CFLAGS"
4435 fi
4436 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" >&5
4437 $as_echo "$pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" >&6; }
4438 if test x"$pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" = x"yes"; then
4439   CFLAGS="$CFLAGS -Wdeclaration-after-statement"
4440 fi
4441
4442   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wendif-labels" >&5
4443 $as_echo_n "checking whether $CC supports -Wendif-labels... " >&6; }
4444 if ${pgac_cv_prog_cc_cflags__Wendif_labels+:} false; then :
4445   $as_echo_n "(cached) " >&6
4446 else
4447   pgac_save_CFLAGS=$CFLAGS
4448 CFLAGS="$pgac_save_CFLAGS -Wendif-labels"
4449 ac_save_c_werror_flag=$ac_c_werror_flag
4450 ac_c_werror_flag=yes
4451 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4452 /* end confdefs.h.  */
4453
4454 int
4455 main ()
4456 {
4457
4458   ;
4459   return 0;
4460 }
4461 _ACEOF
4462 if ac_fn_c_try_compile "$LINENO"; then :
4463   pgac_cv_prog_cc_cflags__Wendif_labels=yes
4464 else
4465   pgac_cv_prog_cc_cflags__Wendif_labels=no
4466 fi
4467 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4468 ac_c_werror_flag=$ac_save_c_werror_flag
4469 CFLAGS="$pgac_save_CFLAGS"
4470 fi
4471 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wendif_labels" >&5
4472 $as_echo "$pgac_cv_prog_cc_cflags__Wendif_labels" >&6; }
4473 if test x"$pgac_cv_prog_cc_cflags__Wendif_labels" = x"yes"; then
4474   CFLAGS="$CFLAGS -Wendif-labels"
4475 fi
4476
4477   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wmissing-format-attribute" >&5
4478 $as_echo_n "checking whether $CC supports -Wmissing-format-attribute... " >&6; }
4479 if ${pgac_cv_prog_cc_cflags__Wmissing_format_attribute+:} false; then :
4480   $as_echo_n "(cached) " >&6
4481 else
4482   pgac_save_CFLAGS=$CFLAGS
4483 CFLAGS="$pgac_save_CFLAGS -Wmissing-format-attribute"
4484 ac_save_c_werror_flag=$ac_c_werror_flag
4485 ac_c_werror_flag=yes
4486 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4487 /* end confdefs.h.  */
4488
4489 int
4490 main ()
4491 {
4492
4493   ;
4494   return 0;
4495 }
4496 _ACEOF
4497 if ac_fn_c_try_compile "$LINENO"; then :
4498   pgac_cv_prog_cc_cflags__Wmissing_format_attribute=yes
4499 else
4500   pgac_cv_prog_cc_cflags__Wmissing_format_attribute=no
4501 fi
4502 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4503 ac_c_werror_flag=$ac_save_c_werror_flag
4504 CFLAGS="$pgac_save_CFLAGS"
4505 fi
4506 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wmissing_format_attribute" >&5
4507 $as_echo "$pgac_cv_prog_cc_cflags__Wmissing_format_attribute" >&6; }
4508 if test x"$pgac_cv_prog_cc_cflags__Wmissing_format_attribute" = x"yes"; then
4509   CFLAGS="$CFLAGS -Wmissing-format-attribute"
4510 fi
4511
4512   # This was included in -Wall/-Wformat in older GCC versions
4513   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wformat-security" >&5
4514 $as_echo_n "checking whether $CC supports -Wformat-security... " >&6; }
4515 if ${pgac_cv_prog_cc_cflags__Wformat_security+:} false; then :
4516   $as_echo_n "(cached) " >&6
4517 else
4518   pgac_save_CFLAGS=$CFLAGS
4519 CFLAGS="$pgac_save_CFLAGS -Wformat-security"
4520 ac_save_c_werror_flag=$ac_c_werror_flag
4521 ac_c_werror_flag=yes
4522 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4523 /* end confdefs.h.  */
4524
4525 int
4526 main ()
4527 {
4528
4529   ;
4530   return 0;
4531 }
4532 _ACEOF
4533 if ac_fn_c_try_compile "$LINENO"; then :
4534   pgac_cv_prog_cc_cflags__Wformat_security=yes
4535 else
4536   pgac_cv_prog_cc_cflags__Wformat_security=no
4537 fi
4538 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4539 ac_c_werror_flag=$ac_save_c_werror_flag
4540 CFLAGS="$pgac_save_CFLAGS"
4541 fi
4542 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wformat_security" >&5
4543 $as_echo "$pgac_cv_prog_cc_cflags__Wformat_security" >&6; }
4544 if test x"$pgac_cv_prog_cc_cflags__Wformat_security" = x"yes"; then
4545   CFLAGS="$CFLAGS -Wformat-security"
4546 fi
4547
4548   # Disable strict-aliasing rules; needed for gcc 3.3+
4549   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-strict-aliasing" >&5
4550 $as_echo_n "checking whether $CC supports -fno-strict-aliasing... " >&6; }
4551 if ${pgac_cv_prog_cc_cflags__fno_strict_aliasing+:} false; then :
4552   $as_echo_n "(cached) " >&6
4553 else
4554   pgac_save_CFLAGS=$CFLAGS
4555 CFLAGS="$pgac_save_CFLAGS -fno-strict-aliasing"
4556 ac_save_c_werror_flag=$ac_c_werror_flag
4557 ac_c_werror_flag=yes
4558 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4559 /* end confdefs.h.  */
4560
4561 int
4562 main ()
4563 {
4564
4565   ;
4566   return 0;
4567 }
4568 _ACEOF
4569 if ac_fn_c_try_compile "$LINENO"; then :
4570   pgac_cv_prog_cc_cflags__fno_strict_aliasing=yes
4571 else
4572   pgac_cv_prog_cc_cflags__fno_strict_aliasing=no
4573 fi
4574 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4575 ac_c_werror_flag=$ac_save_c_werror_flag
4576 CFLAGS="$pgac_save_CFLAGS"
4577 fi
4578 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&5
4579 $as_echo "$pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&6; }
4580 if test x"$pgac_cv_prog_cc_cflags__fno_strict_aliasing" = x"yes"; then
4581   CFLAGS="$CFLAGS -fno-strict-aliasing"
4582 fi
4583
4584   # Disable optimizations that assume no overflow; needed for gcc 4.3+
4585   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fwrapv" >&5
4586 $as_echo_n "checking whether $CC supports -fwrapv... " >&6; }
4587 if ${pgac_cv_prog_cc_cflags__fwrapv+:} false; then :
4588   $as_echo_n "(cached) " >&6
4589 else
4590   pgac_save_CFLAGS=$CFLAGS
4591 CFLAGS="$pgac_save_CFLAGS -fwrapv"
4592 ac_save_c_werror_flag=$ac_c_werror_flag
4593 ac_c_werror_flag=yes
4594 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4595 /* end confdefs.h.  */
4596
4597 int
4598 main ()
4599 {
4600
4601   ;
4602   return 0;
4603 }
4604 _ACEOF
4605 if ac_fn_c_try_compile "$LINENO"; then :
4606   pgac_cv_prog_cc_cflags__fwrapv=yes
4607 else
4608   pgac_cv_prog_cc_cflags__fwrapv=no
4609 fi
4610 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4611 ac_c_werror_flag=$ac_save_c_werror_flag
4612 CFLAGS="$pgac_save_CFLAGS"
4613 fi
4614 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fwrapv" >&5
4615 $as_echo "$pgac_cv_prog_cc_cflags__fwrapv" >&6; }
4616 if test x"$pgac_cv_prog_cc_cflags__fwrapv" = x"yes"; then
4617   CFLAGS="$CFLAGS -fwrapv"
4618 fi
4619
4620   # Disable FP optimizations that cause various errors on gcc 4.5+ or maybe 4.6+
4621   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fexcess-precision=standard" >&5
4622 $as_echo_n "checking whether $CC supports -fexcess-precision=standard... " >&6; }
4623 if ${pgac_cv_prog_cc_cflags__fexcess_precision_standard+:} false; then :
4624   $as_echo_n "(cached) " >&6
4625 else
4626   pgac_save_CFLAGS=$CFLAGS
4627 CFLAGS="$pgac_save_CFLAGS -fexcess-precision=standard"
4628 ac_save_c_werror_flag=$ac_c_werror_flag
4629 ac_c_werror_flag=yes
4630 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4631 /* end confdefs.h.  */
4632
4633 int
4634 main ()
4635 {
4636
4637   ;
4638   return 0;
4639 }
4640 _ACEOF
4641 if ac_fn_c_try_compile "$LINENO"; then :
4642   pgac_cv_prog_cc_cflags__fexcess_precision_standard=yes
4643 else
4644   pgac_cv_prog_cc_cflags__fexcess_precision_standard=no
4645 fi
4646 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4647 ac_c_werror_flag=$ac_save_c_werror_flag
4648 CFLAGS="$pgac_save_CFLAGS"
4649 fi
4650 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fexcess_precision_standard" >&5
4651 $as_echo "$pgac_cv_prog_cc_cflags__fexcess_precision_standard" >&6; }
4652 if test x"$pgac_cv_prog_cc_cflags__fexcess_precision_standard" = x"yes"; then
4653   CFLAGS="$CFLAGS -fexcess-precision=standard"
4654 fi
4655
4656   # Optimization flags for specific files that benefit from vectorization
4657   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -funroll-loops" >&5
4658 $as_echo_n "checking whether $CC supports -funroll-loops... " >&6; }
4659 if ${pgac_cv_prog_cc_cflags__funroll_loops+:} false; then :
4660   $as_echo_n "(cached) " >&6
4661 else
4662   pgac_save_CFLAGS=$CFLAGS
4663 CFLAGS="$pgac_save_CFLAGS -funroll-loops"
4664 ac_save_c_werror_flag=$ac_c_werror_flag
4665 ac_c_werror_flag=yes
4666 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4667 /* end confdefs.h.  */
4668
4669 int
4670 main ()
4671 {
4672
4673   ;
4674   return 0;
4675 }
4676 _ACEOF
4677 if ac_fn_c_try_compile "$LINENO"; then :
4678   pgac_cv_prog_cc_cflags__funroll_loops=yes
4679 else
4680   pgac_cv_prog_cc_cflags__funroll_loops=no
4681 fi
4682 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4683 ac_c_werror_flag=$ac_save_c_werror_flag
4684 CFLAGS="$pgac_save_CFLAGS"
4685 fi
4686 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__funroll_loops" >&5
4687 $as_echo "$pgac_cv_prog_cc_cflags__funroll_loops" >&6; }
4688 if test x"$pgac_cv_prog_cc_cflags__funroll_loops" = x"yes"; then
4689   CFLAGS_VECTOR="${CFLAGS_VECTOR} -funroll-loops"
4690 fi
4691
4692   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -ftree-vectorize" >&5
4693 $as_echo_n "checking whether $CC supports -ftree-vectorize... " >&6; }
4694 if ${pgac_cv_prog_cc_cflags__ftree_vectorize+:} false; then :
4695   $as_echo_n "(cached) " >&6
4696 else
4697   pgac_save_CFLAGS=$CFLAGS
4698 CFLAGS="$pgac_save_CFLAGS -ftree-vectorize"
4699 ac_save_c_werror_flag=$ac_c_werror_flag
4700 ac_c_werror_flag=yes
4701 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4702 /* end confdefs.h.  */
4703
4704 int
4705 main ()
4706 {
4707
4708   ;
4709   return 0;
4710 }
4711 _ACEOF
4712 if ac_fn_c_try_compile "$LINENO"; then :
4713   pgac_cv_prog_cc_cflags__ftree_vectorize=yes
4714 else
4715   pgac_cv_prog_cc_cflags__ftree_vectorize=no
4716 fi
4717 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4718 ac_c_werror_flag=$ac_save_c_werror_flag
4719 CFLAGS="$pgac_save_CFLAGS"
4720 fi
4721 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__ftree_vectorize" >&5
4722 $as_echo "$pgac_cv_prog_cc_cflags__ftree_vectorize" >&6; }
4723 if test x"$pgac_cv_prog_cc_cflags__ftree_vectorize" = x"yes"; then
4724   CFLAGS_VECTOR="${CFLAGS_VECTOR} -ftree-vectorize"
4725 fi
4726
4727   # We want to suppress clang's unhelpful unused-command-line-argument warnings
4728   # but gcc won't complain about unrecognized -Wno-foo switches, so we have to
4729   # test for the positive form and if that works, add the negative form
4730   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wunused-command-line-argument" >&5
4731 $as_echo_n "checking whether $CC supports -Wunused-command-line-argument... " >&6; }
4732 if ${pgac_cv_prog_cc_cflags__Wunused_command_line_argument+:} false; then :
4733   $as_echo_n "(cached) " >&6
4734 else
4735   pgac_save_CFLAGS=$CFLAGS
4736 CFLAGS="$pgac_save_CFLAGS -Wunused-command-line-argument"
4737 ac_save_c_werror_flag=$ac_c_werror_flag
4738 ac_c_werror_flag=yes
4739 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4740 /* end confdefs.h.  */
4741
4742 int
4743 main ()
4744 {
4745
4746   ;
4747   return 0;
4748 }
4749 _ACEOF
4750 if ac_fn_c_try_compile "$LINENO"; then :
4751   pgac_cv_prog_cc_cflags__Wunused_command_line_argument=yes
4752 else
4753   pgac_cv_prog_cc_cflags__Wunused_command_line_argument=no
4754 fi
4755 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4756 ac_c_werror_flag=$ac_save_c_werror_flag
4757 CFLAGS="$pgac_save_CFLAGS"
4758 fi
4759 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wunused_command_line_argument" >&5
4760 $as_echo "$pgac_cv_prog_cc_cflags__Wunused_command_line_argument" >&6; }
4761 if test x"$pgac_cv_prog_cc_cflags__Wunused_command_line_argument" = x"yes"; then
4762   NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
4763 fi
4764
4765   if test -n "$NOT_THE_CFLAGS"; then
4766     CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
4767   fi
4768 elif test "$ICC" = yes; then
4769   # Intel's compiler has a bug/misoptimization in checking for
4770   # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
4771   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mp1" >&5
4772 $as_echo_n "checking whether $CC supports -mp1... " >&6; }
4773 if ${pgac_cv_prog_cc_cflags__mp1+:} false; then :
4774   $as_echo_n "(cached) " >&6
4775 else
4776   pgac_save_CFLAGS=$CFLAGS
4777 CFLAGS="$pgac_save_CFLAGS -mp1"
4778 ac_save_c_werror_flag=$ac_c_werror_flag
4779 ac_c_werror_flag=yes
4780 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4781 /* end confdefs.h.  */
4782
4783 int
4784 main ()
4785 {
4786
4787   ;
4788   return 0;
4789 }
4790 _ACEOF
4791 if ac_fn_c_try_compile "$LINENO"; then :
4792   pgac_cv_prog_cc_cflags__mp1=yes
4793 else
4794   pgac_cv_prog_cc_cflags__mp1=no
4795 fi
4796 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4797 ac_c_werror_flag=$ac_save_c_werror_flag
4798 CFLAGS="$pgac_save_CFLAGS"
4799 fi
4800 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__mp1" >&5
4801 $as_echo "$pgac_cv_prog_cc_cflags__mp1" >&6; }
4802 if test x"$pgac_cv_prog_cc_cflags__mp1" = x"yes"; then
4803   CFLAGS="$CFLAGS -mp1"
4804 fi
4805
4806   # Make sure strict aliasing is off (though this is said to be the default)
4807   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-strict-aliasing" >&5
4808 $as_echo_n "checking whether $CC supports -fno-strict-aliasing... " >&6; }
4809 if ${pgac_cv_prog_cc_cflags__fno_strict_aliasing+:} false; then :
4810   $as_echo_n "(cached) " >&6
4811 else
4812   pgac_save_CFLAGS=$CFLAGS
4813 CFLAGS="$pgac_save_CFLAGS -fno-strict-aliasing"
4814 ac_save_c_werror_flag=$ac_c_werror_flag
4815 ac_c_werror_flag=yes
4816 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4817 /* end confdefs.h.  */
4818
4819 int
4820 main ()
4821 {
4822
4823   ;
4824   return 0;
4825 }
4826 _ACEOF
4827 if ac_fn_c_try_compile "$LINENO"; then :
4828   pgac_cv_prog_cc_cflags__fno_strict_aliasing=yes
4829 else
4830   pgac_cv_prog_cc_cflags__fno_strict_aliasing=no
4831 fi
4832 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4833 ac_c_werror_flag=$ac_save_c_werror_flag
4834 CFLAGS="$pgac_save_CFLAGS"
4835 fi
4836 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&5
4837 $as_echo "$pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&6; }
4838 if test x"$pgac_cv_prog_cc_cflags__fno_strict_aliasing" = x"yes"; then
4839   CFLAGS="$CFLAGS -fno-strict-aliasing"
4840 fi
4841
4842 elif test "$PORTNAME" = "aix"; then
4843   # AIX's xlc has to have strict aliasing turned off too
4844   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -qnoansialias" >&5
4845 $as_echo_n "checking whether $CC supports -qnoansialias... " >&6; }
4846 if ${pgac_cv_prog_cc_cflags__qnoansialias+:} false; then :
4847   $as_echo_n "(cached) " >&6
4848 else
4849   pgac_save_CFLAGS=$CFLAGS
4850 CFLAGS="$pgac_save_CFLAGS -qnoansialias"
4851 ac_save_c_werror_flag=$ac_c_werror_flag
4852 ac_c_werror_flag=yes
4853 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4854 /* end confdefs.h.  */
4855
4856 int
4857 main ()
4858 {
4859
4860   ;
4861   return 0;
4862 }
4863 _ACEOF
4864 if ac_fn_c_try_compile "$LINENO"; then :
4865   pgac_cv_prog_cc_cflags__qnoansialias=yes
4866 else
4867   pgac_cv_prog_cc_cflags__qnoansialias=no
4868 fi
4869 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4870 ac_c_werror_flag=$ac_save_c_werror_flag
4871 CFLAGS="$pgac_save_CFLAGS"
4872 fi
4873 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__qnoansialias" >&5
4874 $as_echo "$pgac_cv_prog_cc_cflags__qnoansialias" >&6; }
4875 if test x"$pgac_cv_prog_cc_cflags__qnoansialias" = x"yes"; then
4876   CFLAGS="$CFLAGS -qnoansialias"
4877 fi
4878
4879 elif test "$PORTNAME" = "hpux"; then
4880   # On some versions of HP-UX, libm functions do not set errno by default.
4881   # Fix that by using +Olibmerrno if the compiler recognizes it.
4882   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports +Olibmerrno" >&5
4883 $as_echo_n "checking whether $CC supports +Olibmerrno... " >&6; }
4884 if ${pgac_cv_prog_cc_cflags_pOlibmerrno+:} false; then :
4885   $as_echo_n "(cached) " >&6
4886 else
4887   pgac_save_CFLAGS=$CFLAGS
4888 CFLAGS="$pgac_save_CFLAGS +Olibmerrno"
4889 ac_save_c_werror_flag=$ac_c_werror_flag
4890 ac_c_werror_flag=yes
4891 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4892 /* end confdefs.h.  */
4893
4894 int
4895 main ()
4896 {
4897
4898   ;
4899   return 0;
4900 }
4901 _ACEOF
4902 if ac_fn_c_try_compile "$LINENO"; then :
4903   pgac_cv_prog_cc_cflags_pOlibmerrno=yes
4904 else
4905   pgac_cv_prog_cc_cflags_pOlibmerrno=no
4906 fi
4907 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4908 ac_c_werror_flag=$ac_save_c_werror_flag
4909 CFLAGS="$pgac_save_CFLAGS"
4910 fi
4911 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags_pOlibmerrno" >&5
4912 $as_echo "$pgac_cv_prog_cc_cflags_pOlibmerrno" >&6; }
4913 if test x"$pgac_cv_prog_cc_cflags_pOlibmerrno" = x"yes"; then
4914   CFLAGS="$CFLAGS +Olibmerrno"
4915 fi
4916
4917 fi
4918
4919 CFLAGS_VECTOR=$CFLAGS_VECTOR
4920
4921
4922 # supply -g if --enable-debug
4923 if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
4924   CFLAGS="$CFLAGS -g"
4925 fi
4926
4927 # enable code coverage if --enable-coverage
4928 if test "$enable_coverage" = yes; then
4929   if test "$GCC" = yes; then
4930     CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
4931   else
4932     as_fn_error $? "--enable-coverage is supported only when using GCC" "$LINENO" 5
4933   fi
4934 fi
4935
4936 # enable profiling if --enable-profiling
4937 if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then
4938   if test "$GCC" = yes; then
4939
4940 $as_echo "#define PROFILE_PID_DIR 1" >>confdefs.h
4941
4942     CFLAGS="$CFLAGS -pg $PLATFORM_PROFILE_FLAGS"
4943   else
4944     as_fn_error $? "--enable-profiling is supported only when using GCC" "$LINENO" 5
4945   fi
4946 fi
4947
4948 # We already have this in Makefile.win32, but configure needs it too
4949 if test "$PORTNAME" = "win32"; then
4950   CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32 -DEXEC_BACKEND"
4951 fi
4952
4953 # Now that we're done automatically adding stuff to CFLAGS, put back the
4954 # user-specified flags (if any) at the end.  This lets users override
4955 # the automatic additions.
4956 CFLAGS="$CFLAGS $user_CFLAGS"
4957
4958 # Check if the compiler still works with the final flag settings
4959 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler still works" >&5
4960 $as_echo_n "checking whether the C compiler still works... " >&6; }
4961 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4962 /* end confdefs.h.  */
4963
4964 int
4965 main ()
4966 {
4967 return 0;
4968   ;
4969   return 0;
4970 }
4971 _ACEOF
4972 if ac_fn_c_try_link "$LINENO"; then :
4973   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4974 $as_echo "yes" >&6; }
4975 else
4976   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4977 $as_echo "no" >&6; }
4978    as_fn_error $? "cannot proceed" "$LINENO" 5
4979 fi
4980 rm -f core conftest.err conftest.$ac_objext \
4981     conftest$ac_exeext conftest.$ac_ext
4982
4983 # Defend against gcc -ffast-math
4984 if test "$GCC" = yes; then
4985 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4986 /* end confdefs.h.  */
4987
4988 int
4989 main ()
4990 {
4991 #ifdef __FAST_MATH__
4992 choke me
4993 #endif
4994   ;
4995   return 0;
4996 }
4997 _ACEOF
4998 if ac_fn_c_try_compile "$LINENO"; then :
4999
5000 else
5001   as_fn_error $? "do not put -ffast-math in CFLAGS" "$LINENO" 5
5002 fi
5003 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5004 fi
5005
5006 ac_ext=c
5007 ac_cpp='$CPP $CPPFLAGS'
5008 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5009 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5010 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5011 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
5012 $as_echo_n "checking how to run the C preprocessor... " >&6; }
5013 # On Suns, sometimes $CPP names a directory.
5014 if test -n "$CPP" && test -d "$CPP"; then
5015   CPP=
5016 fi
5017 if test -z "$CPP"; then
5018   if ${ac_cv_prog_CPP+:} false; then :
5019   $as_echo_n "(cached) " >&6
5020 else
5021       # Double quotes because CPP needs to be expanded
5022     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
5023     do
5024       ac_preproc_ok=false
5025 for ac_c_preproc_warn_flag in '' yes
5026 do
5027   # Use a header file that comes with gcc, so configuring glibc
5028   # with a fresh cross-compiler works.
5029   # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5030   # <limits.h> exists even on freestanding compilers.
5031   # On the NeXT, cc -E runs the code through the compiler's parser,
5032   # not just through cpp. "Syntax error" is here to catch this case.
5033   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5034 /* end confdefs.h.  */
5035 #ifdef __STDC__
5036 # include <limits.h>
5037 #else
5038 # include <assert.h>
5039 #endif
5040                      Syntax error
5041 _ACEOF
5042 if ac_fn_c_try_cpp "$LINENO"; then :
5043
5044 else
5045   # Broken: fails on valid input.
5046 continue
5047 fi
5048 rm -f conftest.err conftest.i conftest.$ac_ext
5049
5050   # OK, works on sane cases.  Now check whether nonexistent headers
5051   # can be detected and how.
5052   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5053 /* end confdefs.h.  */
5054 #include <ac_nonexistent.h>
5055 _ACEOF
5056 if ac_fn_c_try_cpp "$LINENO"; then :
5057   # Broken: success on invalid input.
5058 continue
5059 else
5060   # Passes both tests.
5061 ac_preproc_ok=:
5062 break
5063 fi
5064 rm -f conftest.err conftest.i conftest.$ac_ext
5065
5066 done
5067 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
5068 rm -f conftest.i conftest.err conftest.$ac_ext
5069 if $ac_preproc_ok; then :
5070   break
5071 fi
5072
5073     done
5074     ac_cv_prog_CPP=$CPP
5075
5076 fi
5077   CPP=$ac_cv_prog_CPP
5078 else
5079   ac_cv_prog_CPP=$CPP
5080 fi
5081 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
5082 $as_echo "$CPP" >&6; }
5083 ac_preproc_ok=false
5084 for ac_c_preproc_warn_flag in '' yes
5085 do
5086   # Use a header file that comes with gcc, so configuring glibc
5087   # with a fresh cross-compiler works.
5088   # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5089   # <limits.h> exists even on freestanding compilers.
5090   # On the NeXT, cc -E runs the code through the compiler's parser,
5091   # not just through cpp. "Syntax error" is here to catch this case.
5092   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5093 /* end confdefs.h.  */
5094 #ifdef __STDC__
5095 # include <limits.h>
5096 #else
5097 # include <assert.h>
5098 #endif
5099                      Syntax error
5100 _ACEOF
5101 if ac_fn_c_try_cpp "$LINENO"; then :
5102
5103 else
5104   # Broken: fails on valid input.
5105 continue
5106 fi
5107 rm -f conftest.err conftest.i conftest.$ac_ext
5108
5109   # OK, works on sane cases.  Now check whether nonexistent headers
5110   # can be detected and how.
5111   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5112 /* end confdefs.h.  */
5113 #include <ac_nonexistent.h>
5114 _ACEOF
5115 if ac_fn_c_try_cpp "$LINENO"; then :
5116   # Broken: success on invalid input.
5117 continue
5118 else
5119   # Passes both tests.
5120 ac_preproc_ok=:
5121 break
5122 fi
5123 rm -f conftest.err conftest.i conftest.$ac_ext
5124
5125 done
5126 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
5127 rm -f conftest.i conftest.err conftest.$ac_ext
5128 if $ac_preproc_ok; then :
5129
5130 else
5131   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5132 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5133 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
5134 See \`config.log' for more details" "$LINENO" 5; }
5135 fi
5136
5137 ac_ext=c
5138 ac_cpp='$CPP $CPPFLAGS'
5139 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5140 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5141 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5142
5143
5144
5145
5146 #
5147 # Set up TAS assembly code if needed; the template file has now had its
5148 # chance to request this.
5149 #
5150 ac_config_links="$ac_config_links src/backend/port/tas.s:src/backend/port/tas/${tas_file}"
5151
5152
5153 if test "$need_tas" = yes ; then
5154   TAS=tas.o
5155 else
5156   TAS=""
5157 fi
5158
5159
5160
5161 #
5162 # Automatic dependency tracking
5163 #
5164
5165
5166 # Check whether --enable-depend was given.
5167 if test "${enable_depend+set}" = set; then :
5168   enableval=$enable_depend;
5169   case $enableval in
5170     yes)
5171       autodepend=yes
5172       ;;
5173     no)
5174       :
5175       ;;
5176     *)
5177       as_fn_error $? "no argument expected for --enable-depend option" "$LINENO" 5
5178       ;;
5179   esac
5180
5181 else
5182   enable_depend=no
5183
5184 fi
5185
5186
5187
5188
5189
5190 #
5191 # Enable assert checks
5192 #
5193
5194
5195 # Check whether --enable-cassert was given.
5196 if test "${enable_cassert+set}" = set; then :
5197   enableval=$enable_cassert;
5198   case $enableval in
5199     yes)
5200
5201 $as_echo "#define USE_ASSERT_CHECKING 1" >>confdefs.h
5202
5203       ;;
5204     no)
5205       :
5206       ;;
5207     *)
5208       as_fn_error $? "no argument expected for --enable-cassert option" "$LINENO" 5
5209       ;;
5210   esac
5211
5212 else
5213   enable_cassert=no
5214
5215 fi
5216
5217
5218
5219
5220 #
5221 # Include directories
5222 #
5223 ac_save_IFS=$IFS
5224 IFS="${IFS}${PATH_SEPARATOR}"
5225 # SRCH_INC comes from the template file
5226 for dir in $with_includes $SRCH_INC; do
5227   if test -d "$dir"; then
5228     INCLUDES="$INCLUDES -I$dir"
5229   else
5230     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Include directory $dir does not exist." >&5
5231 $as_echo "$as_me: WARNING: *** Include directory $dir does not exist." >&2;}
5232   fi
5233 done
5234 IFS=$ac_save_IFS
5235
5236
5237
5238 #
5239 # Library directories
5240 #
5241 ac_save_IFS=$IFS
5242 IFS="${IFS}${PATH_SEPARATOR}"
5243 # LIBRARY_DIRS comes from command line, SRCH_LIB from template file.
5244 for dir in $LIBRARY_DIRS $SRCH_LIB; do
5245   if test -d "$dir"; then
5246     LIBDIRS="$LIBDIRS -L$dir"
5247   else
5248     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Library directory $dir does not exist." >&5
5249 $as_echo "$as_me: WARNING: *** Library directory $dir does not exist." >&2;}
5250   fi
5251 done
5252 IFS=$ac_save_IFS
5253
5254 #
5255 # Enable thread-safe client libraries
5256 #
5257 { $as_echo "$as_me:${as_lineno-$LINENO}: checking allow thread-safe client libraries" >&5
5258 $as_echo_n "checking allow thread-safe client libraries... " >&6; }
5259
5260
5261 # Check whether --enable-thread-safety was given.
5262 if test "${enable_thread_safety+set}" = set; then :
5263   enableval=$enable_thread_safety;
5264   case $enableval in
5265     yes)
5266       :
5267       ;;
5268     no)
5269       :
5270       ;;
5271     *)
5272       as_fn_error $? "no argument expected for --enable-thread-safety option" "$LINENO" 5
5273       ;;
5274   esac
5275
5276 else
5277   enable_thread_safety=yes
5278
5279 fi
5280
5281
5282 if test "$enable_thread_safety" = yes; then
5283
5284 $as_echo "#define ENABLE_THREAD_SAFETY 1" >>confdefs.h
5285
5286 fi
5287 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_thread_safety" >&5
5288 $as_echo "$enable_thread_safety" >&6; }
5289
5290
5291 #
5292 # Optionally build Tcl modules (PL/Tcl)
5293 #
5294 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Tcl" >&5
5295 $as_echo_n "checking whether to build with Tcl... " >&6; }
5296
5297
5298
5299 # Check whether --with-tcl was given.
5300 if test "${with_tcl+set}" = set; then :
5301   withval=$with_tcl;
5302   case $withval in
5303     yes)
5304       :
5305       ;;
5306     no)
5307       :
5308       ;;
5309     *)
5310       as_fn_error $? "no argument expected for --with-tcl option" "$LINENO" 5
5311       ;;
5312   esac
5313
5314 else
5315   with_tcl=no
5316
5317 fi
5318
5319
5320 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_tcl" >&5
5321 $as_echo "$with_tcl" >&6; }
5322
5323
5324 # We see if the path to the Tcl/Tk configuration scripts is specified.
5325 # This will override the use of tclsh to find the paths to search.
5326
5327
5328
5329
5330 # Check whether --with-tclconfig was given.
5331 if test "${with_tclconfig+set}" = set; then :
5332   withval=$with_tclconfig;
5333   case $withval in
5334     yes)
5335       as_fn_error $? "argument required for --with-tclconfig option" "$LINENO" 5
5336       ;;
5337     no)
5338       as_fn_error $? "argument required for --with-tclconfig option" "$LINENO" 5
5339       ;;
5340     *)
5341
5342       ;;
5343   esac
5344
5345 fi
5346
5347
5348
5349 #
5350 # Optionally build Perl modules (PL/Perl)
5351 #
5352 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Perl modules" >&5
5353 $as_echo_n "checking whether to build Perl modules... " >&6; }
5354
5355
5356
5357 # Check whether --with-perl was given.
5358 if test "${with_perl+set}" = set; then :
5359   withval=$with_perl;
5360   case $withval in
5361     yes)
5362       :
5363       ;;
5364     no)
5365       :
5366       ;;
5367     *)
5368       as_fn_error $? "no argument expected for --with-perl option" "$LINENO" 5
5369       ;;
5370   esac
5371
5372 else
5373   with_perl=no
5374
5375 fi
5376
5377
5378 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_perl" >&5
5379 $as_echo "$with_perl" >&6; }
5380
5381
5382 #
5383 # Optionally build Python modules (PL/Python)
5384 #
5385 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Python modules" >&5
5386 $as_echo_n "checking whether to build Python modules... " >&6; }
5387
5388
5389
5390 # Check whether --with-python was given.
5391 if test "${with_python+set}" = set; then :
5392   withval=$with_python;
5393   case $withval in
5394     yes)
5395       :
5396       ;;
5397     no)
5398       :
5399       ;;
5400     *)
5401       as_fn_error $? "no argument expected for --with-python option" "$LINENO" 5
5402       ;;
5403   esac
5404
5405 else
5406   with_python=no
5407
5408 fi
5409
5410
5411 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_python" >&5
5412 $as_echo "$with_python" >&6; }
5413
5414
5415 #
5416 # GSSAPI
5417 #
5418 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with GSSAPI support" >&5
5419 $as_echo_n "checking whether to build with GSSAPI support... " >&6; }
5420
5421
5422
5423 # Check whether --with-gssapi was given.
5424 if test "${with_gssapi+set}" = set; then :
5425   withval=$with_gssapi;
5426   case $withval in
5427     yes)
5428
5429
5430 $as_echo "#define ENABLE_GSS 1" >>confdefs.h
5431
5432   krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab"
5433
5434       ;;
5435     no)
5436       :
5437       ;;
5438     *)
5439       as_fn_error $? "no argument expected for --with-gssapi option" "$LINENO" 5
5440       ;;
5441   esac
5442
5443 else
5444   with_gssapi=no
5445
5446 fi
5447
5448
5449 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gssapi" >&5
5450 $as_echo "$with_gssapi" >&6; }
5451
5452
5453
5454
5455
5456 #
5457 # Kerberos configuration parameters
5458 #
5459
5460
5461
5462 # Check whether --with-krb-srvnam was given.
5463 if test "${with_krb_srvnam+set}" = set; then :
5464   withval=$with_krb_srvnam;
5465   case $withval in
5466     yes)
5467       as_fn_error $? "argument required for --with-krb-srvnam option" "$LINENO" 5
5468       ;;
5469     no)
5470       as_fn_error $? "argument required for --with-krb-srvnam option" "$LINENO" 5
5471       ;;
5472     *)
5473
5474       ;;
5475   esac
5476
5477 else
5478   with_krb_srvnam="postgres"
5479 fi
5480
5481
5482
5483 cat >>confdefs.h <<_ACEOF
5484 #define PG_KRB_SRVNAM "$with_krb_srvnam"
5485 _ACEOF
5486
5487
5488
5489 #
5490 # PAM
5491 #
5492 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with PAM support" >&5
5493 $as_echo_n "checking whether to build with PAM support... " >&6; }
5494
5495
5496
5497 # Check whether --with-pam was given.
5498 if test "${with_pam+set}" = set; then :
5499   withval=$with_pam;
5500   case $withval in
5501     yes)
5502
5503 $as_echo "#define USE_PAM 1" >>confdefs.h
5504
5505       ;;
5506     no)
5507       :
5508       ;;
5509     *)
5510       as_fn_error $? "no argument expected for --with-pam option" "$LINENO" 5
5511       ;;
5512   esac
5513
5514 else
5515   with_pam=no
5516
5517 fi
5518
5519
5520 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pam" >&5
5521 $as_echo "$with_pam" >&6; }
5522
5523
5524 #
5525 # LDAP
5526 #
5527 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with LDAP support" >&5
5528 $as_echo_n "checking whether to build with LDAP support... " >&6; }
5529
5530
5531
5532 # Check whether --with-ldap was given.
5533 if test "${with_ldap+set}" = set; then :
5534   withval=$with_ldap;
5535   case $withval in
5536     yes)
5537
5538 $as_echo "#define USE_LDAP 1" >>confdefs.h
5539
5540       ;;
5541     no)
5542       :
5543       ;;
5544     *)
5545       as_fn_error $? "no argument expected for --with-ldap option" "$LINENO" 5
5546       ;;
5547   esac
5548
5549 else
5550   with_ldap=no
5551
5552 fi
5553
5554
5555 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ldap" >&5
5556 $as_echo "$with_ldap" >&6; }
5557
5558
5559 #
5560 # Bonjour
5561 #
5562 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Bonjour support" >&5
5563 $as_echo_n "checking whether to build with Bonjour support... " >&6; }
5564
5565
5566
5567 # Check whether --with-bonjour was given.
5568 if test "${with_bonjour+set}" = set; then :
5569   withval=$with_bonjour;
5570   case $withval in
5571     yes)
5572
5573 $as_echo "#define USE_BONJOUR 1" >>confdefs.h
5574
5575       ;;
5576     no)
5577       :
5578       ;;
5579     *)
5580       as_fn_error $? "no argument expected for --with-bonjour option" "$LINENO" 5
5581       ;;
5582   esac
5583
5584 else
5585   with_bonjour=no
5586
5587 fi
5588
5589
5590 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_bonjour" >&5
5591 $as_echo "$with_bonjour" >&6; }
5592
5593
5594 #
5595 # OpenSSL
5596 #
5597 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with OpenSSL support" >&5
5598 $as_echo_n "checking whether to build with OpenSSL support... " >&6; }
5599
5600
5601
5602 # Check whether --with-openssl was given.
5603 if test "${with_openssl+set}" = set; then :
5604   withval=$with_openssl;
5605   case $withval in
5606     yes)
5607
5608 $as_echo "#define USE_OPENSSL 1" >>confdefs.h
5609
5610       ;;
5611     no)
5612       :
5613       ;;
5614     *)
5615       as_fn_error $? "no argument expected for --with-openssl option" "$LINENO" 5
5616       ;;
5617   esac
5618
5619 else
5620   with_openssl=no
5621
5622 fi
5623
5624
5625 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_openssl" >&5
5626 $as_echo "$with_openssl" >&6; }
5627
5628
5629 #
5630 # SELinux
5631 #
5632 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with SELinux support" >&5
5633 $as_echo_n "checking whether to build with SELinux support... " >&6; }
5634
5635
5636
5637 # Check whether --with-selinux was given.
5638 if test "${with_selinux+set}" = set; then :
5639   withval=$with_selinux;
5640   case $withval in
5641     yes)
5642       :
5643       ;;
5644     no)
5645       :
5646       ;;
5647     *)
5648       as_fn_error $? "no argument expected for --with-selinux option" "$LINENO" 5
5649       ;;
5650   esac
5651
5652 else
5653   with_selinux=no
5654
5655 fi
5656
5657
5658
5659 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_selinux" >&5
5660 $as_echo "$with_selinux" >&6; }
5661
5662 #
5663 # Readline
5664 #
5665
5666
5667
5668 # Check whether --with-readline was given.
5669 if test "${with_readline+set}" = set; then :
5670   withval=$with_readline;
5671   case $withval in
5672     yes)
5673       :
5674       ;;
5675     no)
5676       :
5677       ;;
5678     *)
5679       as_fn_error $? "no argument expected for --with-readline option" "$LINENO" 5
5680       ;;
5681   esac
5682
5683 else
5684   with_readline=yes
5685
5686 fi
5687
5688
5689 # readline on MinGW has problems with backslashes in psql and other bugs.
5690 # This is particularly a problem with non-US code pages.
5691 # Therefore disable its use until we understand the cause. 2004-07-20
5692 if test "$PORTNAME" = "win32"; then
5693   if test "$with_readline" = yes; then
5694     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Readline does not work on MinGW --- disabling" >&5
5695 $as_echo "$as_me: WARNING: *** Readline does not work on MinGW --- disabling" >&2;}
5696     with_readline=no
5697   fi
5698 fi
5699
5700
5701 #
5702 # Prefer libedit
5703 #
5704
5705
5706
5707 # Check whether --with-libedit-preferred was given.
5708 if test "${with_libedit_preferred+set}" = set; then :
5709   withval=$with_libedit_preferred;
5710   case $withval in
5711     yes)
5712       :
5713       ;;
5714     no)
5715       :
5716       ;;
5717     *)
5718       as_fn_error $? "no argument expected for --with-libedit-preferred option" "$LINENO" 5
5719       ;;
5720   esac
5721
5722 else
5723   with_libedit_preferred=no
5724
5725 fi
5726
5727
5728
5729
5730 #
5731 # UUID library
5732 #
5733 # There are at least three UUID libraries in common use: the FreeBSD/NetBSD
5734 # library, the e2fsprogs libuuid (now part of util-linux-ng), and the OSSP
5735 # UUID library.  More than one of these might be present on a given platform,
5736 # so we make the user say which one she wants.
5737 #
5738
5739
5740
5741 # Check whether --with-uuid was given.
5742 if test "${with_uuid+set}" = set; then :
5743   withval=$with_uuid;
5744   case $withval in
5745     yes)
5746       as_fn_error $? "argument required for --with-uuid option" "$LINENO" 5
5747       ;;
5748     no)
5749       as_fn_error $? "argument required for --with-uuid option" "$LINENO" 5
5750       ;;
5751     *)
5752
5753       ;;
5754   esac
5755
5756 fi
5757
5758
5759 if test x"$with_uuid" = x"" ; then
5760   with_uuid=no
5761 fi
5762
5763
5764
5765 # Check whether --with-ossp-uuid was given.
5766 if test "${with_ossp_uuid+set}" = set; then :
5767   withval=$with_ossp_uuid;
5768   case $withval in
5769     yes)
5770       :
5771       ;;
5772     no)
5773       :
5774       ;;
5775     *)
5776       as_fn_error $? "no argument expected for --with-ossp-uuid option" "$LINENO" 5
5777       ;;
5778   esac
5779
5780 else
5781   with_ossp_uuid=no
5782
5783 fi
5784
5785
5786 if test "$with_ossp_uuid" = yes ; then
5787   with_uuid=ossp
5788 fi
5789
5790 if test "$with_uuid" = bsd ; then
5791
5792 $as_echo "#define HAVE_UUID_BSD 1" >>confdefs.h
5793
5794   UUID_EXTRA_OBJS="md5.o sha1.o"
5795 elif test "$with_uuid" = e2fs ; then
5796
5797 $as_echo "#define HAVE_UUID_E2FS 1" >>confdefs.h
5798
5799   UUID_EXTRA_OBJS="md5.o sha1.o"
5800 elif test "$with_uuid" = ossp ; then
5801
5802 $as_echo "#define HAVE_UUID_OSSP 1" >>confdefs.h
5803
5804   UUID_EXTRA_OBJS=""
5805 elif test "$with_uuid" = no ; then
5806   UUID_EXTRA_OBJS=""
5807 else
5808   as_fn_error $? "--with-uuid must specify one of bsd, e2fs, or ossp" "$LINENO" 5
5809 fi
5810
5811
5812
5813
5814 #
5815 # XML
5816 #
5817
5818
5819
5820 # Check whether --with-libxml was given.
5821 if test "${with_libxml+set}" = set; then :
5822   withval=$with_libxml;
5823   case $withval in
5824     yes)
5825
5826 $as_echo "#define USE_LIBXML 1" >>confdefs.h
5827
5828       ;;
5829     no)
5830       :
5831       ;;
5832     *)
5833       as_fn_error $? "no argument expected for --with-libxml option" "$LINENO" 5
5834       ;;
5835   esac
5836
5837 else
5838   with_libxml=no
5839
5840 fi
5841
5842
5843
5844 if test "$with_libxml" = yes ; then
5845   for ac_prog in xml2-config
5846 do
5847   # Extract the first word of "$ac_prog", so it can be a program name with args.
5848 set dummy $ac_prog; ac_word=$2
5849 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5850 $as_echo_n "checking for $ac_word... " >&6; }
5851 if ${ac_cv_prog_XML2_CONFIG+:} false; then :
5852   $as_echo_n "(cached) " >&6
5853 else
5854   if test -n "$XML2_CONFIG"; then
5855   ac_cv_prog_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test.
5856 else
5857 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5858 for as_dir in $PATH
5859 do
5860   IFS=$as_save_IFS
5861   test -z "$as_dir" && as_dir=.
5862     for ac_exec_ext in '' $ac_executable_extensions; do
5863   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5864     ac_cv_prog_XML2_CONFIG="$ac_prog"
5865     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5866     break 2
5867   fi
5868 done
5869   done
5870 IFS=$as_save_IFS
5871
5872 fi
5873 fi
5874 XML2_CONFIG=$ac_cv_prog_XML2_CONFIG
5875 if test -n "$XML2_CONFIG"; then
5876   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5
5877 $as_echo "$XML2_CONFIG" >&6; }
5878 else
5879   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5880 $as_echo "no" >&6; }
5881 fi
5882
5883
5884   test -n "$XML2_CONFIG" && break
5885 done
5886
5887   if test -n "$XML2_CONFIG"; then
5888     for pgac_option in `$XML2_CONFIG --cflags`; do
5889       case $pgac_option in
5890         -I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";;
5891       esac
5892     done
5893     for pgac_option in `$XML2_CONFIG --libs`; do
5894       case $pgac_option in
5895         -L*) LDFLAGS="$LDFLAGS $pgac_option";;
5896       esac
5897     done
5898   fi
5899 fi
5900
5901
5902
5903 #
5904 # XSLT
5905 #
5906
5907
5908
5909 # Check whether --with-libxslt was given.
5910 if test "${with_libxslt+set}" = set; then :
5911   withval=$with_libxslt;
5912   case $withval in
5913     yes)
5914
5915 $as_echo "#define USE_LIBXSLT 1" >>confdefs.h
5916
5917       ;;
5918     no)
5919       :
5920       ;;
5921     *)
5922       as_fn_error $? "no argument expected for --with-libxslt option" "$LINENO" 5
5923       ;;
5924   esac
5925
5926 else
5927   with_libxslt=no
5928
5929 fi
5930
5931
5932
5933
5934
5935
5936 #
5937 # tzdata
5938 #
5939
5940
5941
5942 # Check whether --with-system-tzdata was given.
5943 if test "${with_system_tzdata+set}" = set; then :
5944   withval=$with_system_tzdata;
5945   case $withval in
5946     yes)
5947       as_fn_error $? "argument required for --with-system-tzdata option" "$LINENO" 5
5948       ;;
5949     no)
5950       as_fn_error $? "argument required for --with-system-tzdata option" "$LINENO" 5
5951       ;;
5952     *)
5953
5954       ;;
5955   esac
5956
5957 fi
5958
5959
5960
5961
5962 #
5963 # Zlib
5964 #
5965
5966
5967
5968 # Check whether --with-zlib was given.
5969 if test "${with_zlib+set}" = set; then :
5970   withval=$with_zlib;
5971   case $withval in
5972     yes)
5973       :
5974       ;;
5975     no)
5976       :
5977       ;;
5978     *)
5979       as_fn_error $? "no argument expected for --with-zlib option" "$LINENO" 5
5980       ;;
5981   esac
5982
5983 else
5984   with_zlib=yes
5985
5986 fi
5987
5988
5989
5990
5991 #
5992 # Elf
5993 #
5994
5995 # Assume system is ELF if it predefines __ELF__ as 1,
5996 # otherwise believe host_os based default.
5997 case $host_os in
5998     freebsd1*|freebsd2*) elf=no;;
5999     freebsd3*|freebsd4*) elf=yes;;
6000 esac
6001
6002
6003 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
6004 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
6005 if ${ac_cv_path_GREP+:} false; then :
6006   $as_echo_n "(cached) " >&6
6007 else
6008   if test -z "$GREP"; then
6009   ac_path_GREP_found=false
6010   # Loop through the user's path and test for each of PROGNAME-LIST
6011   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6012 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
6013 do
6014   IFS=$as_save_IFS
6015   test -z "$as_dir" && as_dir=.
6016     for ac_prog in grep ggrep; do
6017     for ac_exec_ext in '' $ac_executable_extensions; do
6018       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
6019       as_fn_executable_p "$ac_path_GREP" || continue
6020 # Check for GNU ac_path_GREP and select it if it is found.
6021   # Check for GNU $ac_path_GREP
6022 case `"$ac_path_GREP" --version 2>&1` in
6023 *GNU*)
6024   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
6025 *)
6026   ac_count=0
6027   $as_echo_n 0123456789 >"conftest.in"
6028   while :
6029   do
6030     cat "conftest.in" "conftest.in" >"conftest.tmp"
6031     mv "conftest.tmp" "conftest.in"
6032     cp "conftest.in" "conftest.nl"
6033     $as_echo 'GREP' >> "conftest.nl"
6034     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
6035     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
6036     as_fn_arith $ac_count + 1 && ac_count=$as_val
6037     if test $ac_count -gt ${ac_path_GREP_max-0}; then
6038       # Best one so far, save it but keep looking for a better one
6039       ac_cv_path_GREP="$ac_path_GREP"
6040       ac_path_GREP_max=$ac_count
6041     fi
6042     # 10*(2^10) chars as input seems more than enough
6043     test $ac_count -gt 10 && break
6044   done
6045   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
6046 esac
6047
6048       $ac_path_GREP_found && break 3
6049     done
6050   done
6051   done
6052 IFS=$as_save_IFS
6053   if test -z "$ac_cv_path_GREP"; then
6054     as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
6055   fi
6056 else
6057   ac_cv_path_GREP=$GREP
6058 fi
6059
6060 fi
6061 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
6062 $as_echo "$ac_cv_path_GREP" >&6; }
6063  GREP="$ac_cv_path_GREP"
6064
6065
6066 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
6067 $as_echo_n "checking for egrep... " >&6; }
6068 if ${ac_cv_path_EGREP+:} false; then :
6069   $as_echo_n "(cached) " >&6
6070 else
6071   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
6072    then ac_cv_path_EGREP="$GREP -E"
6073    else
6074      if test -z "$EGREP"; then
6075   ac_path_EGREP_found=false
6076   # Loop through the user's path and test for each of PROGNAME-LIST
6077   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6078 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
6079 do
6080   IFS=$as_save_IFS
6081   test -z "$as_dir" && as_dir=.
6082     for ac_prog in egrep; do
6083     for ac_exec_ext in '' $ac_executable_extensions; do
6084       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
6085       as_fn_executable_p "$ac_path_EGREP" || continue
6086 # Check for GNU ac_path_EGREP and select it if it is found.
6087   # Check for GNU $ac_path_EGREP
6088 case `"$ac_path_EGREP" --version 2>&1` in
6089 *GNU*)
6090   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
6091 *)
6092   ac_count=0
6093   $as_echo_n 0123456789 >"conftest.in"
6094   while :
6095   do
6096     cat "conftest.in" "conftest.in" >"conftest.tmp"
6097     mv "conftest.tmp" "conftest.in"
6098     cp "conftest.in" "conftest.nl"
6099     $as_echo 'EGREP' >> "conftest.nl"
6100     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
6101     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
6102     as_fn_arith $ac_count + 1 && ac_count=$as_val
6103     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
6104       # Best one so far, save it but keep looking for a better one
6105       ac_cv_path_EGREP="$ac_path_EGREP"
6106       ac_path_EGREP_max=$ac_count
6107     fi
6108     # 10*(2^10) chars as input seems more than enough
6109     test $ac_count -gt 10 && break
6110   done
6111   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
6112 esac
6113
6114       $ac_path_EGREP_found && break 3
6115     done
6116   done
6117   done
6118 IFS=$as_save_IFS
6119   if test -z "$ac_cv_path_EGREP"; then
6120     as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
6121   fi
6122 else
6123   ac_cv_path_EGREP=$EGREP
6124 fi
6125
6126    fi
6127 fi
6128 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
6129 $as_echo "$ac_cv_path_EGREP" >&6; }
6130  EGREP="$ac_cv_path_EGREP"
6131
6132
6133 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6134 /* end confdefs.h.  */
6135 #if __ELF__
6136   yes
6137 #endif
6138
6139 _ACEOF
6140 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6141   $EGREP "yes" >/dev/null 2>&1; then :
6142   ELF_SYS=true
6143 else
6144   if test "X$elf" = "Xyes" ; then
6145   ELF_SYS=true
6146 else
6147   ELF_SYS=
6148 fi
6149 fi
6150 rm -f conftest*
6151
6152
6153
6154 #
6155 # Assignments
6156 #
6157
6158 CPPFLAGS="$CPPFLAGS $INCLUDES"
6159 LDFLAGS="$LDFLAGS $LIBDIRS"
6160
6161
6162
6163
6164
6165 # Check whether --with-gnu-ld was given.
6166 if test "${with_gnu_ld+set}" = set; then :
6167   withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
6168 else
6169   with_gnu_ld=no
6170 fi
6171
6172 ac_prog=ld
6173 if test "$GCC" = yes; then
6174   # Check if gcc -print-prog-name=ld gives a path.
6175   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5
6176 $as_echo_n "checking for ld used by GCC... " >&6; }
6177   case $host in
6178   *-*-mingw*)
6179     # gcc leaves a trailing carriage return which upsets mingw
6180     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
6181   *)
6182     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
6183   esac
6184   case "$ac_prog" in
6185     # Accept absolute paths.
6186     [\\/]* | [A-Za-z]:[\\/]*)
6187       re_direlt='/[^/][^/]*/\.\./'
6188       # Canonicalize the path of ld
6189       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
6190       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
6191         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
6192       done
6193       test -z "$LD" && LD="$ac_prog"
6194       ;;
6195   "")
6196     # If it fails, then pretend we aren't using GCC.
6197     ac_prog=ld
6198     ;;
6199   *)
6200     # If it is relative, then search for the first ld in PATH.
6201     with_gnu_ld=unknown
6202     ;;
6203   esac
6204 elif test "$with_gnu_ld" = yes; then
6205   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
6206 $as_echo_n "checking for GNU ld... " >&6; }
6207 else
6208   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
6209 $as_echo_n "checking for non-GNU ld... " >&6; }
6210 fi
6211 if ${ac_cv_path_LD+:} false; then :
6212   $as_echo_n "(cached) " >&6
6213 else
6214   if test -z "$LD"; then
6215   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
6216   for ac_dir in $PATH; do
6217     test -z "$ac_dir" && ac_dir=.
6218     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
6219       ac_cv_path_LD="$ac_dir/$ac_prog"
6220       # Check to see if the program is GNU ld.  I'd rather use --version,
6221       # but apparently some GNU ld's only accept -v.
6222       # Break only if it was the GNU/non-GNU ld that we prefer.
6223       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
6224         test "$with_gnu_ld" != no && break
6225       else
6226         test "$with_gnu_ld" != yes && break
6227       fi
6228     fi
6229   done
6230   IFS="$ac_save_ifs"
6231 else
6232   ac_cv_path_LD="$LD" # Let the user override the test with a path.
6233 fi
6234 fi
6235
6236 LD="$ac_cv_path_LD"
6237 if test -n "$LD"; then
6238   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
6239 $as_echo "$LD" >&6; }
6240 else
6241   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6242 $as_echo "no" >&6; }
6243 fi
6244 test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
6245 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
6246 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
6247 if ${ac_cv_prog_gnu_ld+:} false; then :
6248   $as_echo_n "(cached) " >&6
6249 else
6250   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
6251 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
6252   ac_cv_prog_gnu_ld=yes
6253 else
6254   ac_cv_prog_gnu_ld=no
6255 fi
6256 fi
6257 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gnu_ld" >&5
6258 $as_echo "$ac_cv_prog_gnu_ld" >&6; }
6259 with_gnu_ld=$ac_cv_prog_gnu_ld
6260
6261
6262
6263
6264 case $host_os in sysv5*)
6265   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ld -R works" >&5
6266 $as_echo_n "checking whether ld -R works... " >&6; }
6267 if ${pgac_cv_prog_ld_R+:} false; then :
6268   $as_echo_n "(cached) " >&6
6269 else
6270
6271     pgac_save_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -Wl,-R/usr/lib"
6272     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6273 /* end confdefs.h.  */
6274
6275 int
6276 main ()
6277 {
6278
6279   ;
6280   return 0;
6281 }
6282 _ACEOF
6283 if ac_fn_c_try_link "$LINENO"; then :
6284   pgac_cv_prog_ld_R=yes
6285 else
6286   pgac_cv_prog_ld_R=no
6287 fi
6288 rm -f core conftest.err conftest.$ac_objext \
6289     conftest$ac_exeext conftest.$ac_ext
6290     LDFLAGS=$pgac_save_LDFLAGS
6291
6292 fi
6293 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_ld_R" >&5
6294 $as_echo "$pgac_cv_prog_ld_R" >&6; }
6295   ld_R_works=$pgac_cv_prog_ld_R
6296
6297 esac
6298 if test -n "$ac_tool_prefix"; then
6299   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
6300 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
6301 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6302 $as_echo_n "checking for $ac_word... " >&6; }
6303 if ${ac_cv_prog_RANLIB+:} false; then :
6304   $as_echo_n "(cached) " >&6
6305 else
6306   if test -n "$RANLIB"; then
6307   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
6308 else
6309 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6310 for as_dir in $PATH
6311 do
6312   IFS=$as_save_IFS
6313   test -z "$as_dir" && as_dir=.
6314     for ac_exec_ext in '' $ac_executable_extensions; do
6315   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6316     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
6317     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6318     break 2
6319   fi
6320 done
6321   done
6322 IFS=$as_save_IFS
6323
6324 fi
6325 fi
6326 RANLIB=$ac_cv_prog_RANLIB
6327 if test -n "$RANLIB"; then
6328   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
6329 $as_echo "$RANLIB" >&6; }
6330 else
6331   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6332 $as_echo "no" >&6; }
6333 fi
6334
6335
6336 fi
6337 if test -z "$ac_cv_prog_RANLIB"; then
6338   ac_ct_RANLIB=$RANLIB
6339   # Extract the first word of "ranlib", so it can be a program name with args.
6340 set dummy ranlib; ac_word=$2
6341 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6342 $as_echo_n "checking for $ac_word... " >&6; }
6343 if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
6344   $as_echo_n "(cached) " >&6
6345 else
6346   if test -n "$ac_ct_RANLIB"; then
6347   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
6348 else
6349 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6350 for as_dir in $PATH
6351 do
6352   IFS=$as_save_IFS
6353   test -z "$as_dir" && as_dir=.
6354     for ac_exec_ext in '' $ac_executable_extensions; do
6355   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6356     ac_cv_prog_ac_ct_RANLIB="ranlib"
6357     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6358     break 2
6359   fi
6360 done
6361   done
6362 IFS=$as_save_IFS
6363
6364 fi
6365 fi
6366 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
6367 if test -n "$ac_ct_RANLIB"; then
6368   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
6369 $as_echo "$ac_ct_RANLIB" >&6; }
6370 else
6371   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6372 $as_echo "no" >&6; }
6373 fi
6374
6375   if test "x$ac_ct_RANLIB" = x; then
6376     RANLIB=":"
6377   else
6378     case $cross_compiling:$ac_tool_warned in
6379 yes:)
6380 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6381 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6382 ac_tool_warned=yes ;;
6383 esac
6384     RANLIB=$ac_ct_RANLIB
6385   fi
6386 else
6387   RANLIB="$ac_cv_prog_RANLIB"
6388 fi
6389
6390
6391   if test -n "$ac_tool_prefix"; then
6392   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
6393 set dummy ${ac_tool_prefix}strip; ac_word=$2
6394 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6395 $as_echo_n "checking for $ac_word... " >&6; }
6396 if ${ac_cv_prog_STRIP+:} false; then :
6397   $as_echo_n "(cached) " >&6
6398 else
6399   if test -n "$STRIP"; then
6400   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
6401 else
6402 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6403 for as_dir in $PATH
6404 do
6405   IFS=$as_save_IFS
6406   test -z "$as_dir" && as_dir=.
6407     for ac_exec_ext in '' $ac_executable_extensions; do
6408   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6409     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
6410     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6411     break 2
6412   fi
6413 done
6414   done
6415 IFS=$as_save_IFS
6416
6417 fi
6418 fi
6419 STRIP=$ac_cv_prog_STRIP
6420 if test -n "$STRIP"; then
6421   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
6422 $as_echo "$STRIP" >&6; }
6423 else
6424   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6425 $as_echo "no" >&6; }
6426 fi
6427
6428
6429 fi
6430 if test -z "$ac_cv_prog_STRIP"; then
6431   ac_ct_STRIP=$STRIP
6432   # Extract the first word of "strip", so it can be a program name with args.
6433 set dummy strip; ac_word=$2
6434 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6435 $as_echo_n "checking for $ac_word... " >&6; }
6436 if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
6437   $as_echo_n "(cached) " >&6
6438 else
6439   if test -n "$ac_ct_STRIP"; then
6440   ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
6441 else
6442 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6443 for as_dir in $PATH
6444 do
6445   IFS=$as_save_IFS
6446   test -z "$as_dir" && as_dir=.
6447     for ac_exec_ext in '' $ac_executable_extensions; do
6448   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6449     ac_cv_prog_ac_ct_STRIP="strip"
6450     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6451     break 2
6452   fi
6453 done
6454   done
6455 IFS=$as_save_IFS
6456
6457 fi
6458 fi
6459 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
6460 if test -n "$ac_ct_STRIP"; then
6461   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
6462 $as_echo "$ac_ct_STRIP" >&6; }
6463 else
6464   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6465 $as_echo "no" >&6; }
6466 fi
6467
6468   if test "x$ac_ct_STRIP" = x; then
6469     STRIP=":"
6470   else
6471     case $cross_compiling:$ac_tool_warned in
6472 yes:)
6473 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6474 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6475 ac_tool_warned=yes ;;
6476 esac
6477     STRIP=$ac_ct_STRIP
6478   fi
6479 else
6480   STRIP="$ac_cv_prog_STRIP"
6481 fi
6482
6483
6484   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is possible to strip libraries" >&5
6485 $as_echo_n "checking whether it is possible to strip libraries... " >&6; }
6486   if test x"$STRIP" != x"" && "$STRIP" -V 2>&1 | grep "GNU strip" >/dev/null; then
6487     STRIP_STATIC_LIB="$STRIP -x"
6488     STRIP_SHARED_LIB="$STRIP --strip-unneeded"
6489     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6490 $as_echo "yes" >&6; }
6491   else
6492     case $host_os in
6493       darwin*)
6494         STRIP="$STRIP -x"
6495         STRIP_STATIC_LIB=$STRIP
6496         STRIP_SHARED_LIB=$STRIP
6497         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6498 $as_echo "yes" >&6; }
6499         ;;
6500       *)
6501         STRIP_STATIC_LIB=:
6502         STRIP_SHARED_LIB=:
6503         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6504 $as_echo "no" >&6; }
6505         ;;
6506     esac
6507   fi
6508
6509
6510
6511 if test -n "$ac_tool_prefix"; then
6512   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
6513 set dummy ${ac_tool_prefix}ar; ac_word=$2
6514 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6515 $as_echo_n "checking for $ac_word... " >&6; }
6516 if ${ac_cv_prog_AR+:} false; then :
6517   $as_echo_n "(cached) " >&6
6518 else
6519   if test -n "$AR"; then
6520   ac_cv_prog_AR="$AR" # Let the user override the test.
6521 else
6522 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6523 for as_dir in $PATH
6524 do
6525   IFS=$as_save_IFS
6526   test -z "$as_dir" && as_dir=.
6527     for ac_exec_ext in '' $ac_executable_extensions; do
6528   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6529     ac_cv_prog_AR="${ac_tool_prefix}ar"
6530     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6531     break 2
6532   fi
6533 done
6534   done
6535 IFS=$as_save_IFS
6536
6537 fi
6538 fi
6539 AR=$ac_cv_prog_AR
6540 if test -n "$AR"; then
6541   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
6542 $as_echo "$AR" >&6; }
6543 else
6544   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6545 $as_echo "no" >&6; }
6546 fi
6547
6548
6549 fi
6550 if test -z "$ac_cv_prog_AR"; then
6551   ac_ct_AR=$AR
6552   # Extract the first word of "ar", so it can be a program name with args.
6553 set dummy ar; ac_word=$2
6554 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6555 $as_echo_n "checking for $ac_word... " >&6; }
6556 if ${ac_cv_prog_ac_ct_AR+:} false; then :
6557   $as_echo_n "(cached) " >&6
6558 else
6559   if test -n "$ac_ct_AR"; then
6560   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
6561 else
6562 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6563 for as_dir in $PATH
6564 do
6565   IFS=$as_save_IFS
6566   test -z "$as_dir" && as_dir=.
6567     for ac_exec_ext in '' $ac_executable_extensions; do
6568   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6569     ac_cv_prog_ac_ct_AR="ar"
6570     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6571     break 2
6572   fi
6573 done
6574   done
6575 IFS=$as_save_IFS
6576
6577 fi
6578 fi
6579 ac_ct_AR=$ac_cv_prog_ac_ct_AR
6580 if test -n "$ac_ct_AR"; then
6581   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
6582 $as_echo "$ac_ct_AR" >&6; }
6583 else
6584   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6585 $as_echo "no" >&6; }
6586 fi
6587
6588   if test "x$ac_ct_AR" = x; then
6589     AR="ar"
6590   else
6591     case $cross_compiling:$ac_tool_warned in
6592 yes:)
6593 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6594 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6595 ac_tool_warned=yes ;;
6596 esac
6597     AR=$ac_ct_AR
6598   fi
6599 else
6600   AR="$ac_cv_prog_AR"
6601 fi
6602
6603 if test "$PORTNAME" = "win32"; then
6604   if test -n "$ac_tool_prefix"; then
6605   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
6606 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
6607 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6608 $as_echo_n "checking for $ac_word... " >&6; }
6609 if ${ac_cv_prog_DLLTOOL+:} false; then :
6610   $as_echo_n "(cached) " >&6
6611 else
6612   if test -n "$DLLTOOL"; then
6613   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
6614 else
6615 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6616 for as_dir in $PATH
6617 do
6618   IFS=$as_save_IFS
6619   test -z "$as_dir" && as_dir=.
6620     for ac_exec_ext in '' $ac_executable_extensions; do
6621   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6622     ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
6623     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6624     break 2
6625   fi
6626 done
6627   done
6628 IFS=$as_save_IFS
6629
6630 fi
6631 fi
6632 DLLTOOL=$ac_cv_prog_DLLTOOL
6633 if test -n "$DLLTOOL"; then
6634   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
6635 $as_echo "$DLLTOOL" >&6; }
6636 else
6637   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6638 $as_echo "no" >&6; }
6639 fi
6640
6641
6642 fi
6643 if test -z "$ac_cv_prog_DLLTOOL"; then
6644   ac_ct_DLLTOOL=$DLLTOOL
6645   # Extract the first word of "dlltool", so it can be a program name with args.
6646 set dummy dlltool; ac_word=$2
6647 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6648 $as_echo_n "checking for $ac_word... " >&6; }
6649 if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
6650   $as_echo_n "(cached) " >&6
6651 else
6652   if test -n "$ac_ct_DLLTOOL"; then
6653   ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
6654 else
6655 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6656 for as_dir in $PATH
6657 do
6658   IFS=$as_save_IFS
6659   test -z "$as_dir" && as_dir=.
6660     for ac_exec_ext in '' $ac_executable_extensions; do
6661   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6662     ac_cv_prog_ac_ct_DLLTOOL="dlltool"
6663     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6664     break 2
6665   fi
6666 done
6667   done
6668 IFS=$as_save_IFS
6669
6670 fi
6671 fi
6672 ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
6673 if test -n "$ac_ct_DLLTOOL"; then
6674   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
6675 $as_echo "$ac_ct_DLLTOOL" >&6; }
6676 else
6677   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6678 $as_echo "no" >&6; }
6679 fi
6680
6681   if test "x$ac_ct_DLLTOOL" = x; then
6682     DLLTOOL="dlltool"
6683   else
6684     case $cross_compiling:$ac_tool_warned in
6685 yes:)
6686 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6687 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6688 ac_tool_warned=yes ;;
6689 esac
6690     DLLTOOL=$ac_ct_DLLTOOL
6691   fi
6692 else
6693   DLLTOOL="$ac_cv_prog_DLLTOOL"
6694 fi
6695
6696   if test -n "$ac_tool_prefix"; then
6697   # Extract the first word of "${ac_tool_prefix}dllwrap", so it can be a program name with args.
6698 set dummy ${ac_tool_prefix}dllwrap; ac_word=$2
6699 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6700 $as_echo_n "checking for $ac_word... " >&6; }
6701 if ${ac_cv_prog_DLLWRAP+:} false; then :
6702   $as_echo_n "(cached) " >&6
6703 else
6704   if test -n "$DLLWRAP"; then
6705   ac_cv_prog_DLLWRAP="$DLLWRAP" # Let the user override the test.
6706 else
6707 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6708 for as_dir in $PATH
6709 do
6710   IFS=$as_save_IFS
6711   test -z "$as_dir" && as_dir=.
6712     for ac_exec_ext in '' $ac_executable_extensions; do
6713   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6714     ac_cv_prog_DLLWRAP="${ac_tool_prefix}dllwrap"
6715     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6716     break 2
6717   fi
6718 done
6719   done
6720 IFS=$as_save_IFS
6721
6722 fi
6723 fi
6724 DLLWRAP=$ac_cv_prog_DLLWRAP
6725 if test -n "$DLLWRAP"; then
6726   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLWRAP" >&5
6727 $as_echo "$DLLWRAP" >&6; }
6728 else
6729   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6730 $as_echo "no" >&6; }
6731 fi
6732
6733
6734 fi
6735 if test -z "$ac_cv_prog_DLLWRAP"; then
6736   ac_ct_DLLWRAP=$DLLWRAP
6737   # Extract the first word of "dllwrap", so it can be a program name with args.
6738 set dummy dllwrap; ac_word=$2
6739 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6740 $as_echo_n "checking for $ac_word... " >&6; }
6741 if ${ac_cv_prog_ac_ct_DLLWRAP+:} false; then :
6742   $as_echo_n "(cached) " >&6
6743 else
6744   if test -n "$ac_ct_DLLWRAP"; then
6745   ac_cv_prog_ac_ct_DLLWRAP="$ac_ct_DLLWRAP" # Let the user override the test.
6746 else
6747 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6748 for as_dir in $PATH
6749 do
6750   IFS=$as_save_IFS
6751   test -z "$as_dir" && as_dir=.
6752     for ac_exec_ext in '' $ac_executable_extensions; do
6753   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6754     ac_cv_prog_ac_ct_DLLWRAP="dllwrap"
6755     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6756     break 2
6757   fi
6758 done
6759   done
6760 IFS=$as_save_IFS
6761
6762 fi
6763 fi
6764 ac_ct_DLLWRAP=$ac_cv_prog_ac_ct_DLLWRAP
6765 if test -n "$ac_ct_DLLWRAP"; then
6766   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLWRAP" >&5
6767 $as_echo "$ac_ct_DLLWRAP" >&6; }
6768 else
6769   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6770 $as_echo "no" >&6; }
6771 fi
6772
6773   if test "x$ac_ct_DLLWRAP" = x; then
6774     DLLWRAP="dllwrap"
6775   else
6776     case $cross_compiling:$ac_tool_warned in
6777 yes:)
6778 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6779 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6780 ac_tool_warned=yes ;;
6781 esac
6782     DLLWRAP=$ac_ct_DLLWRAP
6783   fi
6784 else
6785   DLLWRAP="$ac_cv_prog_DLLWRAP"
6786 fi
6787
6788   if test -n "$ac_tool_prefix"; then
6789   # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
6790 set dummy ${ac_tool_prefix}windres; ac_word=$2
6791 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6792 $as_echo_n "checking for $ac_word... " >&6; }
6793 if ${ac_cv_prog_WINDRES+:} false; then :
6794   $as_echo_n "(cached) " >&6
6795 else
6796   if test -n "$WINDRES"; then
6797   ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
6798 else
6799 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6800 for as_dir in $PATH
6801 do
6802   IFS=$as_save_IFS
6803   test -z "$as_dir" && as_dir=.
6804     for ac_exec_ext in '' $ac_executable_extensions; do
6805   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6806     ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
6807     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6808     break 2
6809   fi
6810 done
6811   done
6812 IFS=$as_save_IFS
6813
6814 fi
6815 fi
6816 WINDRES=$ac_cv_prog_WINDRES
6817 if test -n "$WINDRES"; then
6818   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5
6819 $as_echo "$WINDRES" >&6; }
6820 else
6821   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6822 $as_echo "no" >&6; }
6823 fi
6824
6825
6826 fi
6827 if test -z "$ac_cv_prog_WINDRES"; then
6828   ac_ct_WINDRES=$WINDRES
6829   # Extract the first word of "windres", so it can be a program name with args.
6830 set dummy windres; ac_word=$2
6831 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6832 $as_echo_n "checking for $ac_word... " >&6; }
6833 if ${ac_cv_prog_ac_ct_WINDRES+:} false; then :
6834   $as_echo_n "(cached) " >&6
6835 else
6836   if test -n "$ac_ct_WINDRES"; then
6837   ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
6838 else
6839 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6840 for as_dir in $PATH
6841 do
6842   IFS=$as_save_IFS
6843   test -z "$as_dir" && as_dir=.
6844     for ac_exec_ext in '' $ac_executable_extensions; do
6845   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6846     ac_cv_prog_ac_ct_WINDRES="windres"
6847     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6848     break 2
6849   fi
6850 done
6851   done
6852 IFS=$as_save_IFS
6853
6854 fi
6855 fi
6856 ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
6857 if test -n "$ac_ct_WINDRES"; then
6858   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5
6859 $as_echo "$ac_ct_WINDRES" >&6; }
6860 else
6861   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6862 $as_echo "no" >&6; }
6863 fi
6864
6865   if test "x$ac_ct_WINDRES" = x; then
6866     WINDRES="windres"
6867   else
6868     case $cross_compiling:$ac_tool_warned in
6869 yes:)
6870 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6871 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6872 ac_tool_warned=yes ;;
6873 esac
6874     WINDRES=$ac_ct_WINDRES
6875   fi
6876 else
6877   WINDRES="$ac_cv_prog_WINDRES"
6878 fi
6879
6880 fi
6881
6882 # Find a good install program.  We prefer a C program (faster),
6883 # so one script is as good as another.  But avoid the broken or
6884 # incompatible versions:
6885 # SysV /etc/install, /usr/sbin/install
6886 # SunOS /usr/etc/install
6887 # IRIX /sbin/install
6888 # AIX /bin/install
6889 # AmigaOS /C/install, which installs bootblocks on floppy discs
6890 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
6891 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
6892 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
6893 # OS/2's system install, which has a completely different semantic
6894 # ./install, which can be erroneously created by make from ./install.sh.
6895 # Reject install programs that cannot install multiple files.
6896 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
6897 $as_echo_n "checking for a BSD-compatible install... " >&6; }
6898 if test -z "$INSTALL"; then
6899 if ${ac_cv_path_install+:} false; then :
6900   $as_echo_n "(cached) " >&6
6901 else
6902   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6903 for as_dir in $PATH
6904 do
6905   IFS=$as_save_IFS
6906   test -z "$as_dir" && as_dir=.
6907     # Account for people who put trailing slashes in PATH elements.
6908 case $as_dir/ in #((
6909   ./ | .// | /[cC]/* | \
6910   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
6911   ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
6912   /usr/ucb/* ) ;;
6913   *)
6914     # OSF1 and SCO ODT 3.0 have their own names for install.
6915     # Don't use installbsd from OSF since it installs stuff as root
6916     # by default.
6917     for ac_prog in ginstall scoinst install; do
6918       for ac_exec_ext in '' $ac_executable_extensions; do
6919         if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
6920           if test $ac_prog = install &&
6921             grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
6922             # AIX install.  It has an incompatible calling convention.
6923             :
6924           elif test $ac_prog = install &&
6925             grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
6926             # program-specific install script used by HP pwplus--don't use.
6927             :
6928           else
6929             rm -rf conftest.one conftest.two conftest.dir
6930             echo one > conftest.one
6931             echo two > conftest.two
6932             mkdir conftest.dir
6933             if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
6934               test -s conftest.one && test -s conftest.two &&
6935               test -s conftest.dir/conftest.one &&
6936               test -s conftest.dir/conftest.two
6937             then
6938               ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
6939               break 3
6940             fi
6941           fi
6942         fi
6943       done
6944     done
6945     ;;
6946 esac
6947
6948   done
6949 IFS=$as_save_IFS
6950
6951 rm -rf conftest.one conftest.two conftest.dir
6952
6953 fi
6954   if test "${ac_cv_path_install+set}" = set; then
6955     INSTALL=$ac_cv_path_install
6956   else
6957     # As a last resort, use the slow shell script.  Don't cache a
6958     # value for INSTALL within a source directory, because that will
6959     # break other packages using the cache if that directory is
6960     # removed, or if the value is a relative name.
6961     INSTALL=$ac_install_sh
6962   fi
6963 fi
6964 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
6965 $as_echo "$INSTALL" >&6; }
6966
6967 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
6968 # It thinks the first close brace ends the variable substitution.
6969 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
6970
6971 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
6972
6973 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
6974
6975 # When Autoconf chooses install-sh as install program it tries to generate
6976 # a relative path to it in each makefile where it subsitutes it. This clashes
6977 # with our Makefile.global concept. This workaround helps.
6978 case $INSTALL in
6979   *install-sh*) install_bin='';;
6980   *) install_bin=$INSTALL;;
6981 esac
6982
6983
6984 # Extract the first word of "tar", so it can be a program name with args.
6985 set dummy tar; ac_word=$2
6986 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6987 $as_echo_n "checking for $ac_word... " >&6; }
6988 if ${ac_cv_path_TAR+:} false; then :
6989   $as_echo_n "(cached) " >&6
6990 else
6991   case $TAR in
6992   [\\/]* | ?:[\\/]*)
6993   ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
6994   ;;
6995   *)
6996   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6997 for as_dir in $PATH
6998 do
6999   IFS=$as_save_IFS
7000   test -z "$as_dir" && as_dir=.
7001     for ac_exec_ext in '' $ac_executable_extensions; do
7002   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7003     ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext"
7004     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7005     break 2
7006   fi
7007 done
7008   done
7009 IFS=$as_save_IFS
7010
7011   ;;
7012 esac
7013 fi
7014 TAR=$ac_cv_path_TAR
7015 if test -n "$TAR"; then
7016   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5
7017 $as_echo "$TAR" >&6; }
7018 else
7019   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7020 $as_echo "no" >&6; }
7021 fi
7022
7023
7024 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
7025 $as_echo_n "checking whether ln -s works... " >&6; }
7026 LN_S=$as_ln_s
7027 if test "$LN_S" = "ln -s"; then
7028   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7029 $as_echo "yes" >&6; }
7030 else
7031   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
7032 $as_echo "no, using $LN_S" >&6; }
7033 fi
7034
7035 for ac_prog in gawk mawk nawk awk
7036 do
7037   # Extract the first word of "$ac_prog", so it can be a program name with args.
7038 set dummy $ac_prog; ac_word=$2
7039 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7040 $as_echo_n "checking for $ac_word... " >&6; }
7041 if ${ac_cv_prog_AWK+:} false; then :
7042   $as_echo_n "(cached) " >&6
7043 else
7044   if test -n "$AWK"; then
7045   ac_cv_prog_AWK="$AWK" # Let the user override the test.
7046 else
7047 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7048 for as_dir in $PATH
7049 do
7050   IFS=$as_save_IFS
7051   test -z "$as_dir" && as_dir=.
7052     for ac_exec_ext in '' $ac_executable_extensions; do
7053   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7054     ac_cv_prog_AWK="$ac_prog"
7055     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7056     break 2
7057   fi
7058 done
7059   done
7060 IFS=$as_save_IFS
7061
7062 fi
7063 fi
7064 AWK=$ac_cv_prog_AWK
7065 if test -n "$AWK"; then
7066   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
7067 $as_echo "$AWK" >&6; }
7068 else
7069   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7070 $as_echo "no" >&6; }
7071 fi
7072
7073
7074   test -n "$AWK" && break
7075 done
7076
7077 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
7078 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
7079 if test -z "$MKDIR_P"; then
7080   if ${ac_cv_path_mkdir+:} false; then :
7081   $as_echo_n "(cached) " >&6
7082 else
7083   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7084 for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
7085 do
7086   IFS=$as_save_IFS
7087   test -z "$as_dir" && as_dir=.
7088     for ac_prog in mkdir gmkdir; do
7089          for ac_exec_ext in '' $ac_executable_extensions; do
7090            as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
7091            case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
7092              'mkdir (GNU coreutils) '* | \
7093              'mkdir (coreutils) '* | \
7094              'mkdir (fileutils) '4.1*)
7095                ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
7096                break 3;;
7097            esac
7098          done
7099        done
7100   done
7101 IFS=$as_save_IFS
7102
7103 fi
7104
7105   test -d ./--version && rmdir ./--version
7106   if test "${ac_cv_path_mkdir+set}" = set; then
7107     MKDIR_P="$ac_cv_path_mkdir -p"
7108   else
7109     # As a last resort, use the slow shell script.  Don't cache a
7110     # value for MKDIR_P within a source directory, because that will
7111     # break other packages using the cache if that directory is
7112     # removed, or if the value is a relative name.
7113     MKDIR_P="$ac_install_sh -d"
7114   fi
7115 fi
7116 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
7117 $as_echo "$MKDIR_P" >&6; }
7118
7119 # When Autoconf chooses install-sh as mkdir -p program it tries to generate
7120 # a relative path to it in each makefile where it subsitutes it. This clashes
7121 # with our Makefile.global concept. This workaround helps.
7122 case $MKDIR_P in
7123   *install-sh*) MKDIR_P='\${SHELL} \${top_srcdir}/config/install-sh -c -d';;
7124 esac
7125
7126 # Let the user override the search
7127 if test -z "$BISON"; then
7128   for ac_prog in bison
7129 do
7130   # Extract the first word of "$ac_prog", so it can be a program name with args.
7131 set dummy $ac_prog; ac_word=$2
7132 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7133 $as_echo_n "checking for $ac_word... " >&6; }
7134 if ${ac_cv_path_BISON+:} false; then :
7135   $as_echo_n "(cached) " >&6
7136 else
7137   case $BISON in
7138   [\\/]* | ?:[\\/]*)
7139   ac_cv_path_BISON="$BISON" # Let the user override the test with a path.
7140   ;;
7141   *)
7142   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7143 for as_dir in $PATH
7144 do
7145   IFS=$as_save_IFS
7146   test -z "$as_dir" && as_dir=.
7147     for ac_exec_ext in '' $ac_executable_extensions; do
7148   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7149     ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext"
7150     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7151     break 2
7152   fi
7153 done
7154   done
7155 IFS=$as_save_IFS
7156
7157   ;;
7158 esac
7159 fi
7160 BISON=$ac_cv_path_BISON
7161 if test -n "$BISON"; then
7162   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5
7163 $as_echo "$BISON" >&6; }
7164 else
7165   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7166 $as_echo "no" >&6; }
7167 fi
7168
7169
7170   test -n "$BISON" && break
7171 done
7172
7173 fi
7174
7175 if test "$BISON"; then
7176   pgac_bison_version=`$BISON --version 2>/dev/null | sed q`
7177   { $as_echo "$as_me:${as_lineno-$LINENO}: using $pgac_bison_version" >&5
7178 $as_echo "$as_me: using $pgac_bison_version" >&6;}
7179   if echo "$pgac_bison_version" | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'
7180   then
7181     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7182 *** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
7183 *** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&5
7184 $as_echo "$as_me: WARNING:
7185 *** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
7186 *** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&2;}
7187     BISON=""
7188   fi
7189   # Bison >=3.0 issues warnings about %name-prefix="base_yy", instead
7190   # of the now preferred %name-prefix "base_yy", but the latter
7191   # doesn't work with Bison 2.3 or less.  So for now we silence the
7192   # deprecation warnings.
7193   if echo "$pgac_bison_version" | $AWK '{ if ($4 >= 3) exit 0; else exit 1;}'
7194   then
7195     BISONFLAGS="$BISONFLAGS -Wno-deprecated"
7196   fi
7197 fi
7198
7199 if test -z "$BISON"; then
7200   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7201 *** Without Bison you will not be able to build PostgreSQL from Git nor
7202 *** change any of the parser definition files.  You can obtain Bison from
7203 *** a GNU mirror site.  (If you are using the official distribution of
7204 *** PostgreSQL then you do not need to worry about this, because the Bison
7205 *** output is pre-generated.)" >&5
7206 $as_echo "$as_me: WARNING:
7207 *** Without Bison you will not be able to build PostgreSQL from Git nor
7208 *** change any of the parser definition files.  You can obtain Bison from
7209 *** a GNU mirror site.  (If you are using the official distribution of
7210 *** PostgreSQL then you do not need to worry about this, because the Bison
7211 *** output is pre-generated.)" >&2;}
7212 fi
7213 # We don't need AC_SUBST(BISON) because AC_PATH_PROG did it
7214
7215
7216 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flex" >&5
7217 $as_echo_n "checking for flex... " >&6; }
7218 if ${pgac_cv_path_flex+:} false; then :
7219   $as_echo_n "(cached) " >&6
7220 else
7221   # Let the user override the test
7222 if test -n "$FLEX"; then
7223   pgac_cv_path_flex=$FLEX
7224 else
7225   pgac_save_IFS=$IFS
7226   IFS=$PATH_SEPARATOR
7227   for pgac_dir in $PATH; do
7228     IFS=$pgac_save_IFS
7229     if test -z "$pgac_dir" || test x"$pgac_dir" = x"."; then
7230       pgac_dir=`pwd`
7231     fi
7232     for pgac_prog in flex lex; do
7233       pgac_candidate="$pgac_dir/$pgac_prog"
7234       if test -f "$pgac_candidate" \
7235         && $pgac_candidate --version </dev/null >/dev/null 2>&1
7236       then
7237         echo '%%'  > conftest.l
7238         if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
7239           pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
7240           if echo "$pgac_flex_version" | sed 's/[.a-z]/ /g' | $AWK '{ if ($1 = 2 && $2 = 5 && $3 >= 31) exit 0; else exit 1;}'
7241           then
7242             pgac_cv_path_flex=$pgac_candidate
7243             break 2
7244           else
7245             { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7246 *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
7247 *** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&5
7248 $as_echo "$as_me: WARNING:
7249 *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
7250 *** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&2;}
7251           fi
7252         fi
7253       fi
7254     done
7255   done
7256   rm -f conftest.l lex.yy.c
7257   : ${pgac_cv_path_flex=no}
7258 fi
7259
7260 fi
7261 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_path_flex" >&5
7262 $as_echo "$pgac_cv_path_flex" >&6; }
7263 if test x"$pgac_cv_path_flex" = x"no"; then
7264   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7265 *** Without Flex you will not be able to build PostgreSQL from Git nor
7266 *** change any of the scanner definition files.  You can obtain Flex from
7267 *** a GNU mirror site.  (If you are using the official distribution of
7268 *** PostgreSQL then you do not need to worry about this because the Flex
7269 *** output is pre-generated.)" >&5
7270 $as_echo "$as_me: WARNING:
7271 *** Without Flex you will not be able to build PostgreSQL from Git nor
7272 *** change any of the scanner definition files.  You can obtain Flex from
7273 *** a GNU mirror site.  (If you are using the official distribution of
7274 *** PostgreSQL then you do not need to worry about this because the Flex
7275 *** output is pre-generated.)" >&2;}
7276
7277   FLEX=
7278 else
7279   FLEX=$pgac_cv_path_flex
7280   pgac_flex_version=`$FLEX --version 2>/dev/null`
7281   { $as_echo "$as_me:${as_lineno-$LINENO}: using $pgac_flex_version" >&5
7282 $as_echo "$as_me: using $pgac_flex_version" >&6;}
7283 fi
7284
7285
7286
7287
7288
7289 # Let the user override the search
7290 if test -z "$PERL"; then
7291   # Extract the first word of "perl", so it can be a program name with args.
7292 set dummy perl; ac_word=$2
7293 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7294 $as_echo_n "checking for $ac_word... " >&6; }
7295 if ${ac_cv_path_PERL+:} false; then :
7296   $as_echo_n "(cached) " >&6
7297 else
7298   case $PERL in
7299   [\\/]* | ?:[\\/]*)
7300   ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
7301   ;;
7302   *)
7303   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7304 for as_dir in $PATH
7305 do
7306   IFS=$as_save_IFS
7307   test -z "$as_dir" && as_dir=.
7308     for ac_exec_ext in '' $ac_executable_extensions; do
7309   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7310     ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
7311     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7312     break 2
7313   fi
7314 done
7315   done
7316 IFS=$as_save_IFS
7317
7318   ;;
7319 esac
7320 fi
7321 PERL=$ac_cv_path_PERL
7322 if test -n "$PERL"; then
7323   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
7324 $as_echo "$PERL" >&6; }
7325 else
7326   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7327 $as_echo "no" >&6; }
7328 fi
7329
7330
7331 fi
7332
7333 if test "$PERL"; then
7334   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'`
7335   { $as_echo "$as_me:${as_lineno-$LINENO}: using perl $pgac_perl_version" >&5
7336 $as_echo "$as_me: using perl $pgac_perl_version" >&6;}
7337   if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \
7338     $AWK '{ if ($1 = 5 && $2 >= 8) exit 1; else exit 0;}'
7339   then
7340     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7341 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
7342 *** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&5
7343 $as_echo "$as_me: WARNING:
7344 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
7345 *** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&2;}
7346     PERL=""
7347   fi
7348 fi
7349
7350 if test -z "$PERL"; then
7351   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7352 *** Without Perl you will not be able to build PostgreSQL from Git.
7353 *** You can obtain Perl from any CPAN mirror site.
7354 *** (If you are using the official distribution of PostgreSQL then you do not
7355 *** need to worry about this, because the Perl output is pre-generated.)" >&5
7356 $as_echo "$as_me: WARNING:
7357 *** Without Perl you will not be able to build PostgreSQL from Git.
7358 *** You can obtain Perl from any CPAN mirror site.
7359 *** (If you are using the official distribution of PostgreSQL then you do not
7360 *** need to worry about this, because the Perl output is pre-generated.)" >&2;}
7361 fi
7362
7363 if test "$with_perl" = yes; then
7364   if test -z "$PERL"; then
7365     as_fn_error $? "Perl not found" "$LINENO" 5
7366   fi
7367
7368 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl archlibexp" >&5
7369 $as_echo_n "checking for Perl archlibexp... " >&6; }
7370 perl_archlibexp=`$PERL -MConfig -e 'print $Config{archlibexp}'`
7371 test "$PORTNAME" = "win32" && perl_archlibexp=`echo $perl_archlibexp | sed 's,\\\\,/,g'`
7372 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_archlibexp" >&5
7373 $as_echo "$perl_archlibexp" >&6; }
7374 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl privlibexp" >&5
7375 $as_echo_n "checking for Perl privlibexp... " >&6; }
7376 perl_privlibexp=`$PERL -MConfig -e 'print $Config{privlibexp}'`
7377 test "$PORTNAME" = "win32" && perl_privlibexp=`echo $perl_privlibexp | sed 's,\\\\,/,g'`
7378 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_privlibexp" >&5
7379 $as_echo "$perl_privlibexp" >&6; }
7380 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl useshrplib" >&5
7381 $as_echo_n "checking for Perl useshrplib... " >&6; }
7382 perl_useshrplib=`$PERL -MConfig -e 'print $Config{useshrplib}'`
7383 test "$PORTNAME" = "win32" && perl_useshrplib=`echo $perl_useshrplib | sed 's,\\\\,/,g'`
7384 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_useshrplib" >&5
7385 $as_echo "$perl_useshrplib" >&6; }
7386   if test "$perl_useshrplib" != yes && test "$perl_useshrplib" != true; then
7387     as_fn_error $? "cannot build PL/Perl because libperl is not a shared library
7388 You might have to rebuild your Perl installation.  Refer to the
7389 documentation for details.  Use --without-perl to disable building
7390 PL/Perl." "$LINENO" 5
7391   fi
7392
7393 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flags to link embedded Perl" >&5
7394 $as_echo_n "checking for flags to link embedded Perl... " >&6; }
7395 if test "$PORTNAME" = "win32" ; then
7396 perl_lib=`basename $perl_archlibexp/CORE/perl[5-9]*.lib .lib`
7397 test -e "$perl_archlibexp/CORE/$perl_lib.lib" && perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
7398 else
7399 pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
7400 pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
7401 perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e "s/ -arch [-a-zA-Z0-9_]*//g"`
7402 fi
7403 if test -z "$perl_embed_ldflags" ; then
7404         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7405 $as_echo "no" >&6; }
7406         as_fn_error $? "could not determine flags for linking embedded Perl.
7407 This probably means that ExtUtils::Embed or ExtUtils::MakeMaker is not
7408 installed." "$LINENO" 5
7409 else
7410         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_embed_ldflags" >&5
7411 $as_echo "$perl_embed_ldflags" >&6; }
7412 fi
7413
7414 fi
7415
7416 if test "$with_python" = yes; then
7417   # Extract the first word of "python", so it can be a program name with args.
7418 set dummy python; ac_word=$2
7419 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7420 $as_echo_n "checking for $ac_word... " >&6; }
7421 if ${ac_cv_path_PYTHON+:} false; then :
7422   $as_echo_n "(cached) " >&6
7423 else
7424   case $PYTHON in
7425   [\\/]* | ?:[\\/]*)
7426   ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
7427   ;;
7428   *)
7429   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7430 for as_dir in $PATH
7431 do
7432   IFS=$as_save_IFS
7433   test -z "$as_dir" && as_dir=.
7434     for ac_exec_ext in '' $ac_executable_extensions; do
7435   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7436     ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
7437     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7438     break 2
7439   fi
7440 done
7441   done
7442 IFS=$as_save_IFS
7443
7444   ;;
7445 esac
7446 fi
7447 PYTHON=$ac_cv_path_PYTHON
7448 if test -n "$PYTHON"; then
7449   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
7450 $as_echo "$PYTHON" >&6; }
7451 else
7452   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7453 $as_echo "no" >&6; }
7454 fi
7455
7456
7457 if test x"$PYTHON" = x""; then
7458   as_fn_error $? "Python not found" "$LINENO" 5
7459 fi
7460
7461
7462 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python distutils module" >&5
7463 $as_echo_n "checking for Python distutils module... " >&6; }
7464 if "${PYTHON}" -c 'import distutils' 2>&5
7465 then
7466     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7467 $as_echo "yes" >&6; }
7468 else
7469     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7470 $as_echo "no" >&6; }
7471     as_fn_error $? "distutils module not found" "$LINENO" 5
7472 fi
7473 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python configuration directory" >&5
7474 $as_echo_n "checking Python configuration directory... " >&6; }
7475 python_majorversion=`${PYTHON} -c "import sys; print(sys.version[0])"`
7476 python_version=`${PYTHON} -c "import sys; print(sys.version[:3])"`
7477 python_configdir=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBPL'))))"`
7478 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $python_configdir" >&5
7479 $as_echo "$python_configdir" >&6; }
7480
7481 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python include directories" >&5
7482 $as_echo_n "checking Python include directories... " >&6; }
7483 python_includespec=`${PYTHON} -c "
7484 import distutils.sysconfig
7485 a = '-I' + distutils.sysconfig.get_python_inc(False)
7486 b = '-I' + distutils.sysconfig.get_python_inc(True)
7487 if a == b:
7488     print(a)
7489 else:
7490     print(a + ' ' + b)"`
7491 if test "$PORTNAME" = win32 ; then
7492     python_includespec=`echo $python_includespec | sed 's,[\],/,g'`
7493 fi
7494 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $python_includespec" >&5
7495 $as_echo "$python_includespec" >&6; }
7496
7497
7498
7499 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link an embedded Python application" >&5
7500 $as_echo_n "checking how to link an embedded Python application... " >&6; }
7501
7502 python_libdir=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBDIR'))))"`
7503 python_ldlibrary=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LDLIBRARY'))))"`
7504 python_so=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('SO'))))"`
7505 ldlibrary=`echo "${python_ldlibrary}" | sed "s/${python_so}$//"`
7506 python_enable_shared=`${PYTHON} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_vars().get('Py_ENABLE_SHARED',0))"`
7507
7508 if test x"${python_libdir}" != x"" -a x"${python_ldlibrary}" != x"" -a x"${python_ldlibrary}" != x"${ldlibrary}"
7509 then
7510         # New way: use the official shared library
7511         ldlibrary=`echo "${ldlibrary}" | sed "s/^lib//"`
7512         python_libspec="-L${python_libdir} -l${ldlibrary}"
7513 else
7514         # Old way: use libpython from python_configdir
7515         python_libdir="${python_configdir}"
7516         # LDVERSION was introduced in Python 3.2.
7517         python_ldversion=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LDVERSION'))))"`
7518         if test x"${python_ldversion}" = x""; then
7519                 python_ldversion=$python_version
7520         fi
7521         python_libspec="-L${python_libdir} -lpython${python_ldversion}"
7522 fi
7523
7524 python_additional_libs=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','BASEMODLIBS'))))"`
7525
7526 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${python_libspec} ${python_additional_libs}" >&5
7527 $as_echo "${python_libspec} ${python_additional_libs}" >&6; }
7528
7529
7530
7531
7532   # We need libpython as a shared library.  With Python >=2.5, we
7533   # check the Py_ENABLE_SHARED setting.  On Debian, the setting is not
7534   # correct before the jessie release (http://bugs.debian.org/695979).
7535   # We also want to support older Python versions.  So as a fallback
7536   # we see if there is a file that is named like a shared library.
7537
7538   if test "$python_enable_shared" != 1; then
7539     if test "$PORTNAME" = darwin; then
7540       # OS X does supply a .dylib even though Py_ENABLE_SHARED does
7541       # not get set.  The file detection logic below doesn't succeed
7542       # on older OS X versions, so make it explicit.
7543       python_enable_shared=1
7544     elif test "$PORTNAME" = win32; then
7545       # Windows also needs an explicit override.
7546       python_enable_shared=1
7547     else
7548       # We don't know the platform shared library extension here yet,
7549       # so we try some candidates.
7550       for dlsuffix in .so .sl; do
7551         if ls "$python_libdir"/libpython*${dlsuffix}* >/dev/null 2>&1; then
7552           python_enable_shared=1
7553           break
7554         fi
7555       done
7556     fi
7557   fi
7558
7559   if test "$python_enable_shared" != 1; then
7560     as_fn_error $? "cannot build PL/Python because libpython is not a shared library
7561 You might have to rebuild your Python installation.  Refer to the
7562 documentation for details.  Use --without-python to disable building
7563 PL/Python." "$LINENO" 5
7564   fi
7565 fi
7566
7567 if test "$cross_compiling" = yes && test -z "$with_system_tzdata"; then
7568   # Extract the first word of "zic", so it can be a program name with args.
7569 set dummy zic; ac_word=$2
7570 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7571 $as_echo_n "checking for $ac_word... " >&6; }
7572 if ${ac_cv_path_ZIC+:} false; then :
7573   $as_echo_n "(cached) " >&6
7574 else
7575   case $ZIC in
7576   [\\/]* | ?:[\\/]*)
7577   ac_cv_path_ZIC="$ZIC" # Let the user override the test with a path.
7578   ;;
7579   *)
7580   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7581 for as_dir in $PATH
7582 do
7583   IFS=$as_save_IFS
7584   test -z "$as_dir" && as_dir=.
7585     for ac_exec_ext in '' $ac_executable_extensions; do
7586   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7587     ac_cv_path_ZIC="$as_dir/$ac_word$ac_exec_ext"
7588     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7589     break 2
7590   fi
7591 done
7592   done
7593 IFS=$as_save_IFS
7594
7595   ;;
7596 esac
7597 fi
7598 ZIC=$ac_cv_path_ZIC
7599 if test -n "$ZIC"; then
7600   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIC" >&5
7601 $as_echo "$ZIC" >&6; }
7602 else
7603   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7604 $as_echo "no" >&6; }
7605 fi
7606
7607
7608   if test -z "$ZIC"; then
7609     as_fn_error $? "
7610 When cross-compiling, either use the option --with-system-tzdata to use
7611 existing time-zone data, or set the environment variable ZIC to a zic
7612 program to use during the build." "$LINENO" 5
7613   fi
7614 fi
7615
7616
7617 ##
7618 ## Libraries
7619 ##
7620 ## Most libraries are included only if they demonstrably provide a function
7621 ## we need, but libm is an exception: always include it, because there are
7622 ## too many compilers that play cute optimization games that will break
7623 ## probes for standard functions such as pow().
7624 ##
7625
7626 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5
7627 $as_echo_n "checking for main in -lm... " >&6; }
7628 if ${ac_cv_lib_m_main+:} false; then :
7629   $as_echo_n "(cached) " >&6
7630 else
7631   ac_check_lib_save_LIBS=$LIBS
7632 LIBS="-lm  $LIBS"
7633 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7634 /* end confdefs.h.  */
7635
7636
7637 int
7638 main ()
7639 {
7640 return main ();
7641   ;
7642   return 0;
7643 }
7644 _ACEOF
7645 if ac_fn_c_try_link "$LINENO"; then :
7646   ac_cv_lib_m_main=yes
7647 else
7648   ac_cv_lib_m_main=no
7649 fi
7650 rm -f core conftest.err conftest.$ac_objext \
7651     conftest$ac_exeext conftest.$ac_ext
7652 LIBS=$ac_check_lib_save_LIBS
7653 fi
7654 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5
7655 $as_echo "$ac_cv_lib_m_main" >&6; }
7656 if test "x$ac_cv_lib_m_main" = xyes; then :
7657   cat >>confdefs.h <<_ACEOF
7658 #define HAVE_LIBM 1
7659 _ACEOF
7660
7661   LIBS="-lm $LIBS"
7662
7663 fi
7664
7665 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setproctitle" >&5
7666 $as_echo_n "checking for library containing setproctitle... " >&6; }
7667 if ${ac_cv_search_setproctitle+:} false; then :
7668   $as_echo_n "(cached) " >&6
7669 else
7670   ac_func_search_save_LIBS=$LIBS
7671 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7672 /* end confdefs.h.  */
7673
7674 /* Override any GCC internal prototype to avoid an error.
7675    Use char because int might match the return type of a GCC
7676    builtin and then its argument prototype would still apply.  */
7677 #ifdef __cplusplus
7678 extern "C"
7679 #endif
7680 char setproctitle ();
7681 int
7682 main ()
7683 {
7684 return setproctitle ();
7685   ;
7686   return 0;
7687 }
7688 _ACEOF
7689 for ac_lib in '' util; do
7690   if test -z "$ac_lib"; then
7691     ac_res="none required"
7692   else
7693     ac_res=-l$ac_lib
7694     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
7695   fi
7696   if ac_fn_c_try_link "$LINENO"; then :
7697   ac_cv_search_setproctitle=$ac_res
7698 fi
7699 rm -f core conftest.err conftest.$ac_objext \
7700     conftest$ac_exeext
7701   if ${ac_cv_search_setproctitle+:} false; then :
7702   break
7703 fi
7704 done
7705 if ${ac_cv_search_setproctitle+:} false; then :
7706
7707 else
7708   ac_cv_search_setproctitle=no
7709 fi
7710 rm conftest.$ac_ext
7711 LIBS=$ac_func_search_save_LIBS
7712 fi
7713 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setproctitle" >&5
7714 $as_echo "$ac_cv_search_setproctitle" >&6; }
7715 ac_res=$ac_cv_search_setproctitle
7716 if test "$ac_res" != no; then :
7717   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
7718
7719 fi
7720
7721 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
7722 $as_echo_n "checking for library containing dlopen... " >&6; }
7723 if ${ac_cv_search_dlopen+:} false; then :
7724   $as_echo_n "(cached) " >&6
7725 else
7726   ac_func_search_save_LIBS=$LIBS
7727 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7728 /* end confdefs.h.  */
7729
7730 /* Override any GCC internal prototype to avoid an error.
7731    Use char because int might match the return type of a GCC
7732    builtin and then its argument prototype would still apply.  */
7733 #ifdef __cplusplus
7734 extern "C"
7735 #endif
7736 char dlopen ();
7737 int
7738 main ()
7739 {
7740 return dlopen ();
7741   ;
7742   return 0;
7743 }
7744 _ACEOF
7745 for ac_lib in '' dl; do
7746   if test -z "$ac_lib"; then
7747     ac_res="none required"
7748   else
7749     ac_res=-l$ac_lib
7750     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
7751   fi
7752   if ac_fn_c_try_link "$LINENO"; then :
7753   ac_cv_search_dlopen=$ac_res
7754 fi
7755 rm -f core conftest.err conftest.$ac_objext \
7756     conftest$ac_exeext
7757   if ${ac_cv_search_dlopen+:} false; then :
7758   break
7759 fi
7760 done
7761 if ${ac_cv_search_dlopen+:} false; then :
7762
7763 else
7764   ac_cv_search_dlopen=no
7765 fi
7766 rm conftest.$ac_ext
7767 LIBS=$ac_func_search_save_LIBS
7768 fi
7769 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
7770 $as_echo "$ac_cv_search_dlopen" >&6; }
7771 ac_res=$ac_cv_search_dlopen
7772 if test "$ac_res" != no; then :
7773   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
7774
7775 fi
7776
7777 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
7778 $as_echo_n "checking for library containing socket... " >&6; }
7779 if ${ac_cv_search_socket+:} false; then :
7780   $as_echo_n "(cached) " >&6
7781 else
7782   ac_func_search_save_LIBS=$LIBS
7783 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7784 /* end confdefs.h.  */
7785
7786 /* Override any GCC internal prototype to avoid an error.
7787    Use char because int might match the return type of a GCC
7788    builtin and then its argument prototype would still apply.  */
7789 #ifdef __cplusplus
7790 extern "C"
7791 #endif
7792 char socket ();
7793 int
7794 main ()
7795 {
7796 return socket ();
7797   ;
7798   return 0;
7799 }
7800 _ACEOF
7801 for ac_lib in '' socket ws2_32; do
7802   if test -z "$ac_lib"; then
7803     ac_res="none required"
7804   else
7805     ac_res=-l$ac_lib
7806     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
7807   fi
7808   if ac_fn_c_try_link "$LINENO"; then :
7809   ac_cv_search_socket=$ac_res
7810 fi
7811 rm -f core conftest.err conftest.$ac_objext \
7812     conftest$ac_exeext
7813   if ${ac_cv_search_socket+:} false; then :
7814   break
7815 fi
7816 done
7817 if ${ac_cv_search_socket+:} false; then :
7818
7819 else
7820   ac_cv_search_socket=no
7821 fi
7822 rm conftest.$ac_ext
7823 LIBS=$ac_func_search_save_LIBS
7824 fi
7825 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
7826 $as_echo "$ac_cv_search_socket" >&6; }
7827 ac_res=$ac_cv_search_socket
7828 if test "$ac_res" != no; then :
7829   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
7830
7831 fi
7832
7833 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shl_load" >&5
7834 $as_echo_n "checking for library containing shl_load... " >&6; }
7835 if ${ac_cv_search_shl_load+:} false; then :
7836   $as_echo_n "(cached) " >&6
7837 else
7838   ac_func_search_save_LIBS=$LIBS
7839 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7840 /* end confdefs.h.  */
7841
7842 /* Override any GCC internal prototype to avoid an error.
7843    Use char because int might match the return type of a GCC
7844    builtin and then its argument prototype would still apply.  */
7845 #ifdef __cplusplus
7846 extern "C"
7847 #endif
7848 char shl_load ();
7849 int
7850 main ()
7851 {
7852 return shl_load ();
7853   ;
7854   return 0;
7855 }
7856 _ACEOF
7857 for ac_lib in '' dld; do
7858   if test -z "$ac_lib"; then
7859     ac_res="none required"
7860   else
7861     ac_res=-l$ac_lib
7862     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
7863   fi
7864   if ac_fn_c_try_link "$LINENO"; then :
7865   ac_cv_search_shl_load=$ac_res
7866 fi
7867 rm -f core conftest.err conftest.$ac_objext \
7868     conftest$ac_exeext
7869   if ${ac_cv_search_shl_load+:} false; then :
7870   break
7871 fi
7872 done
7873 if ${ac_cv_search_shl_load+:} false; then :
7874
7875 else
7876   ac_cv_search_shl_load=no
7877 fi
7878 rm conftest.$ac_ext
7879 LIBS=$ac_func_search_save_LIBS
7880 fi
7881 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shl_load" >&5
7882 $as_echo "$ac_cv_search_shl_load" >&6; }
7883 ac_res=$ac_cv_search_shl_load
7884 if test "$ac_res" != no; then :
7885   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
7886
7887 fi
7888
7889 # We only use libld in port/dynloader/aix.c
7890 case $host_os in
7891      aix*)
7892         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldopen" >&5
7893 $as_echo_n "checking for library containing ldopen... " >&6; }
7894 if ${ac_cv_search_ldopen+:} false; then :
7895   $as_echo_n "(cached) " >&6
7896 else
7897   ac_func_search_save_LIBS=$LIBS
7898 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7899 /* end confdefs.h.  */
7900
7901 /* Override any GCC internal prototype to avoid an error.
7902    Use char because int might match the return type of a GCC
7903    builtin and then its argument prototype would still apply.  */
7904 #ifdef __cplusplus
7905 extern "C"
7906 #endif
7907 char ldopen ();
7908 int
7909 main ()
7910 {
7911 return ldopen ();
7912   ;
7913   return 0;
7914 }
7915 _ACEOF
7916 for ac_lib in '' ld; do
7917   if test -z "$ac_lib"; then
7918     ac_res="none required"
7919   else
7920     ac_res=-l$ac_lib
7921     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
7922   fi
7923   if ac_fn_c_try_link "$LINENO"; then :
7924   ac_cv_search_ldopen=$ac_res
7925 fi
7926 rm -f core conftest.err conftest.$ac_objext \
7927     conftest$ac_exeext
7928   if ${ac_cv_search_ldopen+:} false; then :
7929   break
7930 fi
7931 done
7932 if ${ac_cv_search_ldopen+:} false; then :
7933
7934 else
7935   ac_cv_search_ldopen=no
7936 fi
7937 rm conftest.$ac_ext
7938 LIBS=$ac_func_search_save_LIBS
7939 fi
7940 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldopen" >&5
7941 $as_echo "$ac_cv_search_ldopen" >&6; }
7942 ac_res=$ac_cv_search_ldopen
7943 if test "$ac_res" != no; then :
7944   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
7945
7946 fi
7947
7948         ;;
7949 esac
7950 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getopt_long" >&5
7951 $as_echo_n "checking for library containing getopt_long... " >&6; }
7952 if ${ac_cv_search_getopt_long+:} false; then :
7953   $as_echo_n "(cached) " >&6
7954 else
7955   ac_func_search_save_LIBS=$LIBS
7956 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7957 /* end confdefs.h.  */
7958
7959 /* Override any GCC internal prototype to avoid an error.
7960    Use char because int might match the return type of a GCC
7961    builtin and then its argument prototype would still apply.  */
7962 #ifdef __cplusplus
7963 extern "C"
7964 #endif
7965 char getopt_long ();
7966 int
7967 main ()
7968 {
7969 return getopt_long ();
7970   ;
7971   return 0;
7972 }
7973 _ACEOF
7974 for ac_lib in '' getopt gnugetopt; do
7975   if test -z "$ac_lib"; then
7976     ac_res="none required"
7977   else
7978     ac_res=-l$ac_lib
7979     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
7980   fi
7981   if ac_fn_c_try_link "$LINENO"; then :
7982   ac_cv_search_getopt_long=$ac_res
7983 fi
7984 rm -f core conftest.err conftest.$ac_objext \
7985     conftest$ac_exeext
7986   if ${ac_cv_search_getopt_long+:} false; then :
7987   break
7988 fi
7989 done
7990 if ${ac_cv_search_getopt_long+:} false; then :
7991
7992 else
7993   ac_cv_search_getopt_long=no
7994 fi
7995 rm conftest.$ac_ext
7996 LIBS=$ac_func_search_save_LIBS
7997 fi
7998 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getopt_long" >&5
7999 $as_echo "$ac_cv_search_getopt_long" >&6; }
8000 ac_res=$ac_cv_search_getopt_long
8001 if test "$ac_res" != no; then :
8002   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8003
8004 fi
8005
8006 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
8007 $as_echo_n "checking for library containing crypt... " >&6; }
8008 if ${ac_cv_search_crypt+:} false; then :
8009   $as_echo_n "(cached) " >&6
8010 else
8011   ac_func_search_save_LIBS=$LIBS
8012 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8013 /* end confdefs.h.  */
8014
8015 /* Override any GCC internal prototype to avoid an error.
8016    Use char because int might match the return type of a GCC
8017    builtin and then its argument prototype would still apply.  */
8018 #ifdef __cplusplus
8019 extern "C"
8020 #endif
8021 char crypt ();
8022 int
8023 main ()
8024 {
8025 return crypt ();
8026   ;
8027   return 0;
8028 }
8029 _ACEOF
8030 for ac_lib in '' crypt; do
8031   if test -z "$ac_lib"; then
8032     ac_res="none required"
8033   else
8034     ac_res=-l$ac_lib
8035     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8036   fi
8037   if ac_fn_c_try_link "$LINENO"; then :
8038   ac_cv_search_crypt=$ac_res
8039 fi
8040 rm -f core conftest.err conftest.$ac_objext \
8041     conftest$ac_exeext
8042   if ${ac_cv_search_crypt+:} false; then :
8043   break
8044 fi
8045 done
8046 if ${ac_cv_search_crypt+:} false; then :
8047
8048 else
8049   ac_cv_search_crypt=no
8050 fi
8051 rm conftest.$ac_ext
8052 LIBS=$ac_func_search_save_LIBS
8053 fi
8054 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5
8055 $as_echo "$ac_cv_search_crypt" >&6; }
8056 ac_res=$ac_cv_search_crypt
8057 if test "$ac_res" != no; then :
8058   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8059
8060 fi
8061
8062 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5
8063 $as_echo_n "checking for library containing shm_open... " >&6; }
8064 if ${ac_cv_search_shm_open+:} false; then :
8065   $as_echo_n "(cached) " >&6
8066 else
8067   ac_func_search_save_LIBS=$LIBS
8068 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8069 /* end confdefs.h.  */
8070
8071 /* Override any GCC internal prototype to avoid an error.
8072    Use char because int might match the return type of a GCC
8073    builtin and then its argument prototype would still apply.  */
8074 #ifdef __cplusplus
8075 extern "C"
8076 #endif
8077 char shm_open ();
8078 int
8079 main ()
8080 {
8081 return shm_open ();
8082   ;
8083   return 0;
8084 }
8085 _ACEOF
8086 for ac_lib in '' rt; do
8087   if test -z "$ac_lib"; then
8088     ac_res="none required"
8089   else
8090     ac_res=-l$ac_lib
8091     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8092   fi
8093   if ac_fn_c_try_link "$LINENO"; then :
8094   ac_cv_search_shm_open=$ac_res
8095 fi
8096 rm -f core conftest.err conftest.$ac_objext \
8097     conftest$ac_exeext
8098   if ${ac_cv_search_shm_open+:} false; then :
8099   break
8100 fi
8101 done
8102 if ${ac_cv_search_shm_open+:} false; then :
8103
8104 else
8105   ac_cv_search_shm_open=no
8106 fi
8107 rm conftest.$ac_ext
8108 LIBS=$ac_func_search_save_LIBS
8109 fi
8110 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_open" >&5
8111 $as_echo "$ac_cv_search_shm_open" >&6; }
8112 ac_res=$ac_cv_search_shm_open
8113 if test "$ac_res" != no; then :
8114   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8115
8116 fi
8117
8118 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_unlink" >&5
8119 $as_echo_n "checking for library containing shm_unlink... " >&6; }
8120 if ${ac_cv_search_shm_unlink+:} false; then :
8121   $as_echo_n "(cached) " >&6
8122 else
8123   ac_func_search_save_LIBS=$LIBS
8124 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8125 /* end confdefs.h.  */
8126
8127 /* Override any GCC internal prototype to avoid an error.
8128    Use char because int might match the return type of a GCC
8129    builtin and then its argument prototype would still apply.  */
8130 #ifdef __cplusplus
8131 extern "C"
8132 #endif
8133 char shm_unlink ();
8134 int
8135 main ()
8136 {
8137 return shm_unlink ();
8138   ;
8139   return 0;
8140 }
8141 _ACEOF
8142 for ac_lib in '' rt; do
8143   if test -z "$ac_lib"; then
8144     ac_res="none required"
8145   else
8146     ac_res=-l$ac_lib
8147     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8148   fi
8149   if ac_fn_c_try_link "$LINENO"; then :
8150   ac_cv_search_shm_unlink=$ac_res
8151 fi
8152 rm -f core conftest.err conftest.$ac_objext \
8153     conftest$ac_exeext
8154   if ${ac_cv_search_shm_unlink+:} false; then :
8155   break
8156 fi
8157 done
8158 if ${ac_cv_search_shm_unlink+:} false; then :
8159
8160 else
8161   ac_cv_search_shm_unlink=no
8162 fi
8163 rm conftest.$ac_ext
8164 LIBS=$ac_func_search_save_LIBS
8165 fi
8166 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_unlink" >&5
8167 $as_echo "$ac_cv_search_shm_unlink" >&6; }
8168 ac_res=$ac_cv_search_shm_unlink
8169 if test "$ac_res" != no; then :
8170   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8171
8172 fi
8173
8174 # Solaris:
8175 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fdatasync" >&5
8176 $as_echo_n "checking for library containing fdatasync... " >&6; }
8177 if ${ac_cv_search_fdatasync+:} false; then :
8178   $as_echo_n "(cached) " >&6
8179 else
8180   ac_func_search_save_LIBS=$LIBS
8181 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8182 /* end confdefs.h.  */
8183
8184 /* Override any GCC internal prototype to avoid an error.
8185    Use char because int might match the return type of a GCC
8186    builtin and then its argument prototype would still apply.  */
8187 #ifdef __cplusplus
8188 extern "C"
8189 #endif
8190 char fdatasync ();
8191 int
8192 main ()
8193 {
8194 return fdatasync ();
8195   ;
8196   return 0;
8197 }
8198 _ACEOF
8199 for ac_lib in '' rt posix4; do
8200   if test -z "$ac_lib"; then
8201     ac_res="none required"
8202   else
8203     ac_res=-l$ac_lib
8204     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8205   fi
8206   if ac_fn_c_try_link "$LINENO"; then :
8207   ac_cv_search_fdatasync=$ac_res
8208 fi
8209 rm -f core conftest.err conftest.$ac_objext \
8210     conftest$ac_exeext
8211   if ${ac_cv_search_fdatasync+:} false; then :
8212   break
8213 fi
8214 done
8215 if ${ac_cv_search_fdatasync+:} false; then :
8216
8217 else
8218   ac_cv_search_fdatasync=no
8219 fi
8220 rm conftest.$ac_ext
8221 LIBS=$ac_func_search_save_LIBS
8222 fi
8223 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fdatasync" >&5
8224 $as_echo "$ac_cv_search_fdatasync" >&6; }
8225 ac_res=$ac_cv_search_fdatasync
8226 if test "$ac_res" != no; then :
8227   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8228
8229 fi
8230
8231 # Required for thread_test.c on Solaris
8232 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_yield" >&5
8233 $as_echo_n "checking for library containing sched_yield... " >&6; }
8234 if ${ac_cv_search_sched_yield+:} false; then :
8235   $as_echo_n "(cached) " >&6
8236 else
8237   ac_func_search_save_LIBS=$LIBS
8238 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8239 /* end confdefs.h.  */
8240
8241 /* Override any GCC internal prototype to avoid an error.
8242    Use char because int might match the return type of a GCC
8243    builtin and then its argument prototype would still apply.  */
8244 #ifdef __cplusplus
8245 extern "C"
8246 #endif
8247 char sched_yield ();
8248 int
8249 main ()
8250 {
8251 return sched_yield ();
8252   ;
8253   return 0;
8254 }
8255 _ACEOF
8256 for ac_lib in '' rt; do
8257   if test -z "$ac_lib"; then
8258     ac_res="none required"
8259   else
8260     ac_res=-l$ac_lib
8261     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8262   fi
8263   if ac_fn_c_try_link "$LINENO"; then :
8264   ac_cv_search_sched_yield=$ac_res
8265 fi
8266 rm -f core conftest.err conftest.$ac_objext \
8267     conftest$ac_exeext
8268   if ${ac_cv_search_sched_yield+:} false; then :
8269   break
8270 fi
8271 done
8272 if ${ac_cv_search_sched_yield+:} false; then :
8273
8274 else
8275   ac_cv_search_sched_yield=no
8276 fi
8277 rm conftest.$ac_ext
8278 LIBS=$ac_func_search_save_LIBS
8279 fi
8280 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_yield" >&5
8281 $as_echo "$ac_cv_search_sched_yield" >&6; }
8282 ac_res=$ac_cv_search_sched_yield
8283 if test "$ac_res" != no; then :
8284   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8285
8286 fi
8287
8288 # Required for thread_test.c on Solaris 2.5:
8289 # Other ports use it too (HP-UX) so test unconditionally
8290 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname_r" >&5
8291 $as_echo_n "checking for library containing gethostbyname_r... " >&6; }
8292 if ${ac_cv_search_gethostbyname_r+:} false; then :
8293   $as_echo_n "(cached) " >&6
8294 else
8295   ac_func_search_save_LIBS=$LIBS
8296 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8297 /* end confdefs.h.  */
8298
8299 /* Override any GCC internal prototype to avoid an error.
8300    Use char because int might match the return type of a GCC
8301    builtin and then its argument prototype would still apply.  */
8302 #ifdef __cplusplus
8303 extern "C"
8304 #endif
8305 char gethostbyname_r ();
8306 int
8307 main ()
8308 {
8309 return gethostbyname_r ();
8310   ;
8311   return 0;
8312 }
8313 _ACEOF
8314 for ac_lib in '' nsl; do
8315   if test -z "$ac_lib"; then
8316     ac_res="none required"
8317   else
8318     ac_res=-l$ac_lib
8319     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8320   fi
8321   if ac_fn_c_try_link "$LINENO"; then :
8322   ac_cv_search_gethostbyname_r=$ac_res
8323 fi
8324 rm -f core conftest.err conftest.$ac_objext \
8325     conftest$ac_exeext
8326   if ${ac_cv_search_gethostbyname_r+:} false; then :
8327   break
8328 fi
8329 done
8330 if ${ac_cv_search_gethostbyname_r+:} false; then :
8331
8332 else
8333   ac_cv_search_gethostbyname_r=no
8334 fi
8335 rm conftest.$ac_ext
8336 LIBS=$ac_func_search_save_LIBS
8337 fi
8338 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname_r" >&5
8339 $as_echo "$ac_cv_search_gethostbyname_r" >&6; }
8340 ac_res=$ac_cv_search_gethostbyname_r
8341 if test "$ac_res" != no; then :
8342   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8343
8344 fi
8345
8346 # Cygwin:
8347 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shmget" >&5
8348 $as_echo_n "checking for library containing shmget... " >&6; }
8349 if ${ac_cv_search_shmget+:} false; then :
8350   $as_echo_n "(cached) " >&6
8351 else
8352   ac_func_search_save_LIBS=$LIBS
8353 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8354 /* end confdefs.h.  */
8355
8356 /* Override any GCC internal prototype to avoid an error.
8357    Use char because int might match the return type of a GCC
8358    builtin and then its argument prototype would still apply.  */
8359 #ifdef __cplusplus
8360 extern "C"
8361 #endif
8362 char shmget ();
8363 int
8364 main ()
8365 {
8366 return shmget ();
8367   ;
8368   return 0;
8369 }
8370 _ACEOF
8371 for ac_lib in '' cygipc; do
8372   if test -z "$ac_lib"; then
8373     ac_res="none required"
8374   else
8375     ac_res=-l$ac_lib
8376     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8377   fi
8378   if ac_fn_c_try_link "$LINENO"; then :
8379   ac_cv_search_shmget=$ac_res
8380 fi
8381 rm -f core conftest.err conftest.$ac_objext \
8382     conftest$ac_exeext
8383   if ${ac_cv_search_shmget+:} false; then :
8384   break
8385 fi
8386 done
8387 if ${ac_cv_search_shmget+:} false; then :
8388
8389 else
8390   ac_cv_search_shmget=no
8391 fi
8392 rm conftest.$ac_ext
8393 LIBS=$ac_func_search_save_LIBS
8394 fi
8395 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shmget" >&5
8396 $as_echo "$ac_cv_search_shmget" >&6; }
8397 ac_res=$ac_cv_search_shmget
8398 if test "$ac_res" != no; then :
8399   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8400
8401 fi
8402
8403
8404 if test "$with_readline" = yes; then
8405
8406
8407 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing readline" >&5
8408 $as_echo_n "checking for library containing readline... " >&6; }
8409 if ${pgac_cv_check_readline+:} false; then :
8410   $as_echo_n "(cached) " >&6
8411 else
8412   pgac_cv_check_readline=no
8413 pgac_save_LIBS=$LIBS
8414 if test x"$with_libedit_preferred" != x"yes"
8415 then    READLINE_ORDER="-lreadline -ledit"
8416 else    READLINE_ORDER="-ledit -lreadline"
8417 fi
8418 for pgac_rllib in $READLINE_ORDER ; do
8419   for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
8420     LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS"
8421     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8422 /* end confdefs.h.  */
8423
8424 /* Override any GCC internal prototype to avoid an error.
8425    Use char because int might match the return type of a GCC
8426    builtin and then its argument prototype would still apply.  */
8427 #ifdef __cplusplus
8428 extern "C"
8429 #endif
8430 char readline ();
8431 int
8432 main ()
8433 {
8434 return readline ();
8435   ;
8436   return 0;
8437 }
8438 _ACEOF
8439 if ac_fn_c_try_link "$LINENO"; then :
8440
8441       # Older NetBSD, OpenBSD, and Irix have a broken linker that does not
8442       # recognize dependent libraries; assume curses is needed if we didn't
8443       # find any dependency.
8444       case $host_os in
8445         netbsd* | openbsd* | irix*)
8446           if test x"$pgac_lib" = x"" ; then
8447             pgac_lib=" -lcurses"
8448           fi ;;
8449       esac
8450
8451       pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"
8452       break
8453
8454 fi
8455 rm -f core conftest.err conftest.$ac_objext \
8456     conftest$ac_exeext conftest.$ac_ext
8457   done
8458   if test "$pgac_cv_check_readline" != no ; then
8459     break
8460   fi
8461 done
8462 LIBS=$pgac_save_LIBS
8463
8464 fi
8465 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_readline" >&5
8466 $as_echo "$pgac_cv_check_readline" >&6; }
8467 if test "$pgac_cv_check_readline" != no ; then
8468   LIBS="$pgac_cv_check_readline $LIBS"
8469
8470 $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
8471
8472 fi
8473
8474
8475   if test x"$pgac_cv_check_readline" = x"no"; then
8476     as_fn_error $? "readline library not found
8477 If you have readline already installed, see config.log for details on the
8478 failure.  It is possible the compiler isn't looking in the proper directory.
8479 Use --without-readline to disable readline support." "$LINENO" 5
8480   fi
8481 fi
8482
8483 if test "$with_zlib" = yes; then
8484   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5
8485 $as_echo_n "checking for inflate in -lz... " >&6; }
8486 if ${ac_cv_lib_z_inflate+:} false; then :
8487   $as_echo_n "(cached) " >&6
8488 else
8489   ac_check_lib_save_LIBS=$LIBS
8490 LIBS="-lz  $LIBS"
8491 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8492 /* end confdefs.h.  */
8493
8494 /* Override any GCC internal prototype to avoid an error.
8495    Use char because int might match the return type of a GCC
8496    builtin and then its argument prototype would still apply.  */
8497 #ifdef __cplusplus
8498 extern "C"
8499 #endif
8500 char inflate ();
8501 int
8502 main ()
8503 {
8504 return inflate ();
8505   ;
8506   return 0;
8507 }
8508 _ACEOF
8509 if ac_fn_c_try_link "$LINENO"; then :
8510   ac_cv_lib_z_inflate=yes
8511 else
8512   ac_cv_lib_z_inflate=no
8513 fi
8514 rm -f core conftest.err conftest.$ac_objext \
8515     conftest$ac_exeext conftest.$ac_ext
8516 LIBS=$ac_check_lib_save_LIBS
8517 fi
8518 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5
8519 $as_echo "$ac_cv_lib_z_inflate" >&6; }
8520 if test "x$ac_cv_lib_z_inflate" = xyes; then :
8521   cat >>confdefs.h <<_ACEOF
8522 #define HAVE_LIBZ 1
8523 _ACEOF
8524
8525   LIBS="-lz $LIBS"
8526
8527 else
8528   as_fn_error $? "zlib library not found
8529 If you have zlib already installed, see config.log for details on the
8530 failure.  It is possible the compiler isn't looking in the proper directory.
8531 Use --without-zlib to disable zlib support." "$LINENO" 5
8532 fi
8533
8534 fi
8535
8536 if test "$enable_spinlocks" = yes; then
8537
8538 $as_echo "#define HAVE_SPINLOCKS 1" >>confdefs.h
8539
8540 else
8541   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
8542 *** Not using spinlocks will cause poor performance." >&5
8543 $as_echo "$as_me: WARNING:
8544 *** Not using spinlocks will cause poor performance." >&2;}
8545 fi
8546
8547 if test "$enable_atomics" = yes; then
8548
8549 $as_echo "#define HAVE_ATOMICS 1" >>confdefs.h
8550
8551 else
8552   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
8553 *** Not using atomic operations will cause poor performance." >&5
8554 $as_echo "$as_me: WARNING:
8555 *** Not using atomic operations will cause poor performance." >&2;}
8556 fi
8557
8558 if test "$with_gssapi" = yes ; then
8559   if test "$PORTNAME" != "win32"; then
8560     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gss_init_sec_context" >&5
8561 $as_echo_n "checking for library containing gss_init_sec_context... " >&6; }
8562 if ${ac_cv_search_gss_init_sec_context+:} false; then :
8563   $as_echo_n "(cached) " >&6
8564 else
8565   ac_func_search_save_LIBS=$LIBS
8566 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8567 /* end confdefs.h.  */
8568
8569 /* Override any GCC internal prototype to avoid an error.
8570    Use char because int might match the return type of a GCC
8571    builtin and then its argument prototype would still apply.  */
8572 #ifdef __cplusplus
8573 extern "C"
8574 #endif
8575 char gss_init_sec_context ();
8576 int
8577 main ()
8578 {
8579 return gss_init_sec_context ();
8580   ;
8581   return 0;
8582 }
8583 _ACEOF
8584 for ac_lib in '' gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'; do
8585   if test -z "$ac_lib"; then
8586     ac_res="none required"
8587   else
8588     ac_res=-l$ac_lib
8589     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8590   fi
8591   if ac_fn_c_try_link "$LINENO"; then :
8592   ac_cv_search_gss_init_sec_context=$ac_res
8593 fi
8594 rm -f core conftest.err conftest.$ac_objext \
8595     conftest$ac_exeext
8596   if ${ac_cv_search_gss_init_sec_context+:} false; then :
8597   break
8598 fi
8599 done
8600 if ${ac_cv_search_gss_init_sec_context+:} false; then :
8601
8602 else
8603   ac_cv_search_gss_init_sec_context=no
8604 fi
8605 rm conftest.$ac_ext
8606 LIBS=$ac_func_search_save_LIBS
8607 fi
8608 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gss_init_sec_context" >&5
8609 $as_echo "$ac_cv_search_gss_init_sec_context" >&6; }
8610 ac_res=$ac_cv_search_gss_init_sec_context
8611 if test "$ac_res" != no; then :
8612   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8613
8614 else
8615   as_fn_error $? "could not find function 'gss_init_sec_context' required for GSSAPI" "$LINENO" 5
8616 fi
8617
8618   else
8619     LIBS="$LIBS -lgssapi32"
8620   fi
8621 fi
8622
8623 if test "$with_openssl" = yes ; then
8624     if test "$PORTNAME" != "win32"; then
8625      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5
8626 $as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; }
8627 if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then :
8628   $as_echo_n "(cached) " >&6
8629 else
8630   ac_check_lib_save_LIBS=$LIBS
8631 LIBS="-lcrypto  $LIBS"
8632 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8633 /* end confdefs.h.  */
8634
8635 /* Override any GCC internal prototype to avoid an error.
8636    Use char because int might match the return type of a GCC
8637    builtin and then its argument prototype would still apply.  */
8638 #ifdef __cplusplus
8639 extern "C"
8640 #endif
8641 char CRYPTO_new_ex_data ();
8642 int
8643 main ()
8644 {
8645 return CRYPTO_new_ex_data ();
8646   ;
8647   return 0;
8648 }
8649 _ACEOF
8650 if ac_fn_c_try_link "$LINENO"; then :
8651   ac_cv_lib_crypto_CRYPTO_new_ex_data=yes
8652 else
8653   ac_cv_lib_crypto_CRYPTO_new_ex_data=no
8654 fi
8655 rm -f core conftest.err conftest.$ac_objext \
8656     conftest$ac_exeext conftest.$ac_ext
8657 LIBS=$ac_check_lib_save_LIBS
8658 fi
8659 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5
8660 $as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; }
8661 if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then :
8662   cat >>confdefs.h <<_ACEOF
8663 #define HAVE_LIBCRYPTO 1
8664 _ACEOF
8665
8666   LIBS="-lcrypto $LIBS"
8667
8668 else
8669   as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5
8670 fi
8671
8672      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5
8673 $as_echo_n "checking for SSL_library_init in -lssl... " >&6; }
8674 if ${ac_cv_lib_ssl_SSL_library_init+:} false; then :
8675   $as_echo_n "(cached) " >&6
8676 else
8677   ac_check_lib_save_LIBS=$LIBS
8678 LIBS="-lssl  $LIBS"
8679 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8680 /* end confdefs.h.  */
8681
8682 /* Override any GCC internal prototype to avoid an error.
8683    Use char because int might match the return type of a GCC
8684    builtin and then its argument prototype would still apply.  */
8685 #ifdef __cplusplus
8686 extern "C"
8687 #endif
8688 char SSL_library_init ();
8689 int
8690 main ()
8691 {
8692 return SSL_library_init ();
8693   ;
8694   return 0;
8695 }
8696 _ACEOF
8697 if ac_fn_c_try_link "$LINENO"; then :
8698   ac_cv_lib_ssl_SSL_library_init=yes
8699 else
8700   ac_cv_lib_ssl_SSL_library_init=no
8701 fi
8702 rm -f core conftest.err conftest.$ac_objext \
8703     conftest$ac_exeext conftest.$ac_ext
8704 LIBS=$ac_check_lib_save_LIBS
8705 fi
8706 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_library_init" >&5
8707 $as_echo "$ac_cv_lib_ssl_SSL_library_init" >&6; }
8708 if test "x$ac_cv_lib_ssl_SSL_library_init" = xyes; then :
8709   cat >>confdefs.h <<_ACEOF
8710 #define HAVE_LIBSSL 1
8711 _ACEOF
8712
8713   LIBS="-lssl $LIBS"
8714
8715 else
8716   as_fn_error $? "library 'ssl' is required for OpenSSL" "$LINENO" 5
8717 fi
8718
8719   else
8720      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing CRYPTO_new_ex_data" >&5
8721 $as_echo_n "checking for library containing CRYPTO_new_ex_data... " >&6; }
8722 if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
8723   $as_echo_n "(cached) " >&6
8724 else
8725   ac_func_search_save_LIBS=$LIBS
8726 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8727 /* end confdefs.h.  */
8728
8729 /* Override any GCC internal prototype to avoid an error.
8730    Use char because int might match the return type of a GCC
8731    builtin and then its argument prototype would still apply.  */
8732 #ifdef __cplusplus
8733 extern "C"
8734 #endif
8735 char CRYPTO_new_ex_data ();
8736 int
8737 main ()
8738 {
8739 return CRYPTO_new_ex_data ();
8740   ;
8741   return 0;
8742 }
8743 _ACEOF
8744 for ac_lib in '' eay32 crypto; do
8745   if test -z "$ac_lib"; then
8746     ac_res="none required"
8747   else
8748     ac_res=-l$ac_lib
8749     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8750   fi
8751   if ac_fn_c_try_link "$LINENO"; then :
8752   ac_cv_search_CRYPTO_new_ex_data=$ac_res
8753 fi
8754 rm -f core conftest.err conftest.$ac_objext \
8755     conftest$ac_exeext
8756   if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
8757   break
8758 fi
8759 done
8760 if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
8761
8762 else
8763   ac_cv_search_CRYPTO_new_ex_data=no
8764 fi
8765 rm conftest.$ac_ext
8766 LIBS=$ac_func_search_save_LIBS
8767 fi
8768 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_CRYPTO_new_ex_data" >&5
8769 $as_echo "$ac_cv_search_CRYPTO_new_ex_data" >&6; }
8770 ac_res=$ac_cv_search_CRYPTO_new_ex_data
8771 if test "$ac_res" != no; then :
8772   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8773
8774 else
8775   as_fn_error $? "library 'eay32' or 'crypto' is required for OpenSSL" "$LINENO" 5
8776 fi
8777
8778      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_library_init" >&5
8779 $as_echo_n "checking for library containing SSL_library_init... " >&6; }
8780 if ${ac_cv_search_SSL_library_init+:} false; then :
8781   $as_echo_n "(cached) " >&6
8782 else
8783   ac_func_search_save_LIBS=$LIBS
8784 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8785 /* end confdefs.h.  */
8786
8787 /* Override any GCC internal prototype to avoid an error.
8788    Use char because int might match the return type of a GCC
8789    builtin and then its argument prototype would still apply.  */
8790 #ifdef __cplusplus
8791 extern "C"
8792 #endif
8793 char SSL_library_init ();
8794 int
8795 main ()
8796 {
8797 return SSL_library_init ();
8798   ;
8799   return 0;
8800 }
8801 _ACEOF
8802 for ac_lib in '' ssleay32 ssl; do
8803   if test -z "$ac_lib"; then
8804     ac_res="none required"
8805   else
8806     ac_res=-l$ac_lib
8807     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8808   fi
8809   if ac_fn_c_try_link "$LINENO"; then :
8810   ac_cv_search_SSL_library_init=$ac_res
8811 fi
8812 rm -f core conftest.err conftest.$ac_objext \
8813     conftest$ac_exeext
8814   if ${ac_cv_search_SSL_library_init+:} false; then :
8815   break
8816 fi
8817 done
8818 if ${ac_cv_search_SSL_library_init+:} false; then :
8819
8820 else
8821   ac_cv_search_SSL_library_init=no
8822 fi
8823 rm conftest.$ac_ext
8824 LIBS=$ac_func_search_save_LIBS
8825 fi
8826 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SSL_library_init" >&5
8827 $as_echo "$ac_cv_search_SSL_library_init" >&6; }
8828 ac_res=$ac_cv_search_SSL_library_init
8829 if test "$ac_res" != no; then :
8830   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8831
8832 else
8833   as_fn_error $? "library 'ssleay32' or 'ssl' is required for OpenSSL" "$LINENO" 5
8834 fi
8835
8836   fi
8837   for ac_func in SSL_get_current_compression
8838 do :
8839   ac_fn_c_check_func "$LINENO" "SSL_get_current_compression" "ac_cv_func_SSL_get_current_compression"
8840 if test "x$ac_cv_func_SSL_get_current_compression" = xyes; then :
8841   cat >>confdefs.h <<_ACEOF
8842 #define HAVE_SSL_GET_CURRENT_COMPRESSION 1
8843 _ACEOF
8844
8845 fi
8846 done
8847
8848 fi
8849
8850 if test "$with_pam" = yes ; then
8851   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5
8852 $as_echo_n "checking for pam_start in -lpam... " >&6; }
8853 if ${ac_cv_lib_pam_pam_start+:} false; then :
8854   $as_echo_n "(cached) " >&6
8855 else
8856   ac_check_lib_save_LIBS=$LIBS
8857 LIBS="-lpam  $LIBS"
8858 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8859 /* end confdefs.h.  */
8860
8861 /* Override any GCC internal prototype to avoid an error.
8862    Use char because int might match the return type of a GCC
8863    builtin and then its argument prototype would still apply.  */
8864 #ifdef __cplusplus
8865 extern "C"
8866 #endif
8867 char pam_start ();
8868 int
8869 main ()
8870 {
8871 return pam_start ();
8872   ;
8873   return 0;
8874 }
8875 _ACEOF
8876 if ac_fn_c_try_link "$LINENO"; then :
8877   ac_cv_lib_pam_pam_start=yes
8878 else
8879   ac_cv_lib_pam_pam_start=no
8880 fi
8881 rm -f core conftest.err conftest.$ac_objext \
8882     conftest$ac_exeext conftest.$ac_ext
8883 LIBS=$ac_check_lib_save_LIBS
8884 fi
8885 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5
8886 $as_echo "$ac_cv_lib_pam_pam_start" >&6; }
8887 if test "x$ac_cv_lib_pam_pam_start" = xyes; then :
8888   cat >>confdefs.h <<_ACEOF
8889 #define HAVE_LIBPAM 1
8890 _ACEOF
8891
8892   LIBS="-lpam $LIBS"
8893
8894 else
8895   as_fn_error $? "library 'pam' is required for PAM" "$LINENO" 5
8896 fi
8897
8898 fi
8899
8900 if test "$with_libxml" = yes ; then
8901   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlSaveToBuffer in -lxml2" >&5
8902 $as_echo_n "checking for xmlSaveToBuffer in -lxml2... " >&6; }
8903 if ${ac_cv_lib_xml2_xmlSaveToBuffer+:} false; then :
8904   $as_echo_n "(cached) " >&6
8905 else
8906   ac_check_lib_save_LIBS=$LIBS
8907 LIBS="-lxml2  $LIBS"
8908 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8909 /* end confdefs.h.  */
8910
8911 /* Override any GCC internal prototype to avoid an error.
8912    Use char because int might match the return type of a GCC
8913    builtin and then its argument prototype would still apply.  */
8914 #ifdef __cplusplus
8915 extern "C"
8916 #endif
8917 char xmlSaveToBuffer ();
8918 int
8919 main ()
8920 {
8921 return xmlSaveToBuffer ();
8922   ;
8923   return 0;
8924 }
8925 _ACEOF
8926 if ac_fn_c_try_link "$LINENO"; then :
8927   ac_cv_lib_xml2_xmlSaveToBuffer=yes
8928 else
8929   ac_cv_lib_xml2_xmlSaveToBuffer=no
8930 fi
8931 rm -f core conftest.err conftest.$ac_objext \
8932     conftest$ac_exeext conftest.$ac_ext
8933 LIBS=$ac_check_lib_save_LIBS
8934 fi
8935 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlSaveToBuffer" >&5
8936 $as_echo "$ac_cv_lib_xml2_xmlSaveToBuffer" >&6; }
8937 if test "x$ac_cv_lib_xml2_xmlSaveToBuffer" = xyes; then :
8938   cat >>confdefs.h <<_ACEOF
8939 #define HAVE_LIBXML2 1
8940 _ACEOF
8941
8942   LIBS="-lxml2 $LIBS"
8943
8944 else
8945   as_fn_error $? "library 'xml2' (version >= 2.6.23) is required for XML support" "$LINENO" 5
8946 fi
8947
8948 fi
8949
8950 if test "$with_libxslt" = yes ; then
8951   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xsltCleanupGlobals in -lxslt" >&5
8952 $as_echo_n "checking for xsltCleanupGlobals in -lxslt... " >&6; }
8953 if ${ac_cv_lib_xslt_xsltCleanupGlobals+:} false; then :
8954   $as_echo_n "(cached) " >&6
8955 else
8956   ac_check_lib_save_LIBS=$LIBS
8957 LIBS="-lxslt  $LIBS"
8958 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8959 /* end confdefs.h.  */
8960
8961 /* Override any GCC internal prototype to avoid an error.
8962    Use char because int might match the return type of a GCC
8963    builtin and then its argument prototype would still apply.  */
8964 #ifdef __cplusplus
8965 extern "C"
8966 #endif
8967 char xsltCleanupGlobals ();
8968 int
8969 main ()
8970 {
8971 return xsltCleanupGlobals ();
8972   ;
8973   return 0;
8974 }
8975 _ACEOF
8976 if ac_fn_c_try_link "$LINENO"; then :
8977   ac_cv_lib_xslt_xsltCleanupGlobals=yes
8978 else
8979   ac_cv_lib_xslt_xsltCleanupGlobals=no
8980 fi
8981 rm -f core conftest.err conftest.$ac_objext \
8982     conftest$ac_exeext conftest.$ac_ext
8983 LIBS=$ac_check_lib_save_LIBS
8984 fi
8985 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xslt_xsltCleanupGlobals" >&5
8986 $as_echo "$ac_cv_lib_xslt_xsltCleanupGlobals" >&6; }
8987 if test "x$ac_cv_lib_xslt_xsltCleanupGlobals" = xyes; then :
8988   cat >>confdefs.h <<_ACEOF
8989 #define HAVE_LIBXSLT 1
8990 _ACEOF
8991
8992   LIBS="-lxslt $LIBS"
8993
8994 else
8995   as_fn_error $? "library 'xslt' is required for XSLT support" "$LINENO" 5
8996 fi
8997
8998 fi
8999
9000 # for contrib/sepgsql
9001 if test "$with_selinux" = yes; then
9002   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_compute_create_name in -lselinux" >&5
9003 $as_echo_n "checking for security_compute_create_name in -lselinux... " >&6; }
9004 if ${ac_cv_lib_selinux_security_compute_create_name+:} false; then :
9005   $as_echo_n "(cached) " >&6
9006 else
9007   ac_check_lib_save_LIBS=$LIBS
9008 LIBS="-lselinux  $LIBS"
9009 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9010 /* end confdefs.h.  */
9011
9012 /* Override any GCC internal prototype to avoid an error.
9013    Use char because int might match the return type of a GCC
9014    builtin and then its argument prototype would still apply.  */
9015 #ifdef __cplusplus
9016 extern "C"
9017 #endif
9018 char security_compute_create_name ();
9019 int
9020 main ()
9021 {
9022 return security_compute_create_name ();
9023   ;
9024   return 0;
9025 }
9026 _ACEOF
9027 if ac_fn_c_try_link "$LINENO"; then :
9028   ac_cv_lib_selinux_security_compute_create_name=yes
9029 else
9030   ac_cv_lib_selinux_security_compute_create_name=no
9031 fi
9032 rm -f core conftest.err conftest.$ac_objext \
9033     conftest$ac_exeext conftest.$ac_ext
9034 LIBS=$ac_check_lib_save_LIBS
9035 fi
9036 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_compute_create_name" >&5
9037 $as_echo "$ac_cv_lib_selinux_security_compute_create_name" >&6; }
9038 if test "x$ac_cv_lib_selinux_security_compute_create_name" = xyes; then :
9039   cat >>confdefs.h <<_ACEOF
9040 #define HAVE_LIBSELINUX 1
9041 _ACEOF
9042
9043   LIBS="-lselinux $LIBS"
9044
9045 else
9046   as_fn_error $? "library 'libselinux', version 2.1.10 or newer, is required for SELinux support" "$LINENO" 5
9047 fi
9048
9049 fi
9050
9051 # for contrib/uuid-ossp
9052 if test "$with_uuid" = bsd ; then
9053   # On BSD, the UUID functions are in libc
9054   ac_fn_c_check_func "$LINENO" "uuid_to_string" "ac_cv_func_uuid_to_string"
9055 if test "x$ac_cv_func_uuid_to_string" = xyes; then :
9056   UUID_LIBS=""
9057 else
9058   as_fn_error $? "BSD UUID functions are not present" "$LINENO" 5
9059 fi
9060
9061 elif test "$with_uuid" = e2fs ; then
9062   # On OS X, the UUID functions are in libc
9063   ac_fn_c_check_func "$LINENO" "uuid_generate" "ac_cv_func_uuid_generate"
9064 if test "x$ac_cv_func_uuid_generate" = xyes; then :
9065   UUID_LIBS=""
9066 else
9067   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5
9068 $as_echo_n "checking for uuid_generate in -luuid... " >&6; }
9069 if ${ac_cv_lib_uuid_uuid_generate+:} false; then :
9070   $as_echo_n "(cached) " >&6
9071 else
9072   ac_check_lib_save_LIBS=$LIBS
9073 LIBS="-luuid  $LIBS"
9074 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9075 /* end confdefs.h.  */
9076
9077 /* Override any GCC internal prototype to avoid an error.
9078    Use char because int might match the return type of a GCC
9079    builtin and then its argument prototype would still apply.  */
9080 #ifdef __cplusplus
9081 extern "C"
9082 #endif
9083 char uuid_generate ();
9084 int
9085 main ()
9086 {
9087 return uuid_generate ();
9088   ;
9089   return 0;
9090 }
9091 _ACEOF
9092 if ac_fn_c_try_link "$LINENO"; then :
9093   ac_cv_lib_uuid_uuid_generate=yes
9094 else
9095   ac_cv_lib_uuid_uuid_generate=no
9096 fi
9097 rm -f core conftest.err conftest.$ac_objext \
9098     conftest$ac_exeext conftest.$ac_ext
9099 LIBS=$ac_check_lib_save_LIBS
9100 fi
9101 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5
9102 $as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; }
9103 if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then :
9104   UUID_LIBS="-luuid"
9105 else
9106   as_fn_error $? "library 'uuid' is required for E2FS UUID" "$LINENO" 5
9107 fi
9108
9109 fi
9110
9111 elif test "$with_uuid" = ossp ; then
9112   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_export in -lossp-uuid" >&5
9113 $as_echo_n "checking for uuid_export in -lossp-uuid... " >&6; }
9114 if ${ac_cv_lib_ossp_uuid_uuid_export+:} false; then :
9115   $as_echo_n "(cached) " >&6
9116 else
9117   ac_check_lib_save_LIBS=$LIBS
9118 LIBS="-lossp-uuid  $LIBS"
9119 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9120 /* end confdefs.h.  */
9121
9122 /* Override any GCC internal prototype to avoid an error.
9123    Use char because int might match the return type of a GCC
9124    builtin and then its argument prototype would still apply.  */
9125 #ifdef __cplusplus
9126 extern "C"
9127 #endif
9128 char uuid_export ();
9129 int
9130 main ()
9131 {
9132 return uuid_export ();
9133   ;
9134   return 0;
9135 }
9136 _ACEOF
9137 if ac_fn_c_try_link "$LINENO"; then :
9138   ac_cv_lib_ossp_uuid_uuid_export=yes
9139 else
9140   ac_cv_lib_ossp_uuid_uuid_export=no
9141 fi
9142 rm -f core conftest.err conftest.$ac_objext \
9143     conftest$ac_exeext conftest.$ac_ext
9144 LIBS=$ac_check_lib_save_LIBS
9145 fi
9146 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossp_uuid_uuid_export" >&5
9147 $as_echo "$ac_cv_lib_ossp_uuid_uuid_export" >&6; }
9148 if test "x$ac_cv_lib_ossp_uuid_uuid_export" = xyes; then :
9149   UUID_LIBS="-lossp-uuid"
9150 else
9151   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_export in -luuid" >&5
9152 $as_echo_n "checking for uuid_export in -luuid... " >&6; }
9153 if ${ac_cv_lib_uuid_uuid_export+:} false; then :
9154   $as_echo_n "(cached) " >&6
9155 else
9156   ac_check_lib_save_LIBS=$LIBS
9157 LIBS="-luuid  $LIBS"
9158 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9159 /* end confdefs.h.  */
9160
9161 /* Override any GCC internal prototype to avoid an error.
9162    Use char because int might match the return type of a GCC
9163    builtin and then its argument prototype would still apply.  */
9164 #ifdef __cplusplus
9165 extern "C"
9166 #endif
9167 char uuid_export ();
9168 int
9169 main ()
9170 {
9171 return uuid_export ();
9172   ;
9173   return 0;
9174 }
9175 _ACEOF
9176 if ac_fn_c_try_link "$LINENO"; then :
9177   ac_cv_lib_uuid_uuid_export=yes
9178 else
9179   ac_cv_lib_uuid_uuid_export=no
9180 fi
9181 rm -f core conftest.err conftest.$ac_objext \
9182     conftest$ac_exeext conftest.$ac_ext
9183 LIBS=$ac_check_lib_save_LIBS
9184 fi
9185 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_export" >&5
9186 $as_echo "$ac_cv_lib_uuid_uuid_export" >&6; }
9187 if test "x$ac_cv_lib_uuid_uuid_export" = xyes; then :
9188   UUID_LIBS="-luuid"
9189 else
9190   as_fn_error $? "library 'ossp-uuid' or 'uuid' is required for OSSP UUID" "$LINENO" 5
9191 fi
9192
9193 fi
9194
9195 fi
9196
9197
9198
9199 ##
9200 ## Header files
9201 ##
9202
9203 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
9204 $as_echo_n "checking for ANSI C header files... " >&6; }
9205 if ${ac_cv_header_stdc+:} false; then :
9206   $as_echo_n "(cached) " >&6
9207 else
9208   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9209 /* end confdefs.h.  */
9210 #include <stdlib.h>
9211 #include <stdarg.h>
9212 #include <string.h>
9213 #include <float.h>
9214
9215 int
9216 main ()
9217 {
9218
9219   ;
9220   return 0;
9221 }
9222 _ACEOF
9223 if ac_fn_c_try_compile "$LINENO"; then :
9224   ac_cv_header_stdc=yes
9225 else
9226   ac_cv_header_stdc=no
9227 fi
9228 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9229
9230 if test $ac_cv_header_stdc = yes; then
9231   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9232   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9233 /* end confdefs.h.  */
9234 #include <string.h>
9235
9236 _ACEOF
9237 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9238   $EGREP "memchr" >/dev/null 2>&1; then :
9239
9240 else
9241   ac_cv_header_stdc=no
9242 fi
9243 rm -f conftest*
9244
9245 fi
9246
9247 if test $ac_cv_header_stdc = yes; then
9248   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9249   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9250 /* end confdefs.h.  */
9251 #include <stdlib.h>
9252
9253 _ACEOF
9254 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9255   $EGREP "free" >/dev/null 2>&1; then :
9256
9257 else
9258   ac_cv_header_stdc=no
9259 fi
9260 rm -f conftest*
9261
9262 fi
9263
9264 if test $ac_cv_header_stdc = yes; then
9265   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9266   if test "$cross_compiling" = yes; then :
9267   :
9268 else
9269   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9270 /* end confdefs.h.  */
9271 #include <ctype.h>
9272 #include <stdlib.h>
9273 #if ((' ' & 0x0FF) == 0x020)
9274 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9275 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9276 #else
9277 # define ISLOWER(c) \
9278                    (('a' <= (c) && (c) <= 'i') \
9279                      || ('j' <= (c) && (c) <= 'r') \
9280                      || ('s' <= (c) && (c) <= 'z'))
9281 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
9282 #endif
9283
9284 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9285 int
9286 main ()
9287 {
9288   int i;
9289   for (i = 0; i < 256; i++)
9290     if (XOR (islower (i), ISLOWER (i))
9291         || toupper (i) != TOUPPER (i))
9292       return 2;
9293   return 0;
9294 }
9295 _ACEOF
9296 if ac_fn_c_try_run "$LINENO"; then :
9297
9298 else
9299   ac_cv_header_stdc=no
9300 fi
9301 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9302   conftest.$ac_objext conftest.beam conftest.$ac_ext
9303 fi
9304
9305 fi
9306 fi
9307 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
9308 $as_echo "$ac_cv_header_stdc" >&6; }
9309 if test $ac_cv_header_stdc = yes; then
9310
9311 $as_echo "#define STDC_HEADERS 1" >>confdefs.h
9312
9313 fi
9314
9315 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
9316 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
9317                   inttypes.h stdint.h unistd.h
9318 do :
9319   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
9320 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
9321 "
9322 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
9323   cat >>confdefs.h <<_ACEOF
9324 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
9325 _ACEOF
9326
9327 fi
9328
9329 done
9330
9331
9332 for ac_header in atomic.h crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h pwd.h sys/ioctl.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/socket.h sys/sockio.h sys/tas.h sys/time.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h
9333 do :
9334   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
9335 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
9336 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
9337   cat >>confdefs.h <<_ACEOF
9338 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
9339 _ACEOF
9340
9341 fi
9342
9343 done
9344
9345
9346 # On BSD, test for net/if.h will fail unless sys/socket.h
9347 # is included first.
9348 for ac_header in net/if.h
9349 do :
9350   ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "$ac_includes_default
9351 #ifdef HAVE_SYS_SOCKET_H
9352 #include <sys/socket.h>
9353 #endif
9354
9355 "
9356 if test "x$ac_cv_header_net_if_h" = xyes; then :
9357   cat >>confdefs.h <<_ACEOF
9358 #define HAVE_NET_IF_H 1
9359 _ACEOF
9360
9361 fi
9362
9363 done
9364
9365
9366 # On OpenBSD, test for sys/ucred.h will fail unless sys/param.h
9367 # is included first.
9368 for ac_header in sys/ucred.h
9369 do :
9370   ac_fn_c_check_header_compile "$LINENO" "sys/ucred.h" "ac_cv_header_sys_ucred_h" "$ac_includes_default
9371 #include <sys/param.h>
9372
9373 "
9374 if test "x$ac_cv_header_sys_ucred_h" = xyes; then :
9375   cat >>confdefs.h <<_ACEOF
9376 #define HAVE_SYS_UCRED_H 1
9377 _ACEOF
9378
9379 fi
9380
9381 done
9382
9383
9384 # At least on IRIX, test for netinet/tcp.h will fail unless
9385 # netinet/in.h is included first.
9386 for ac_header in netinet/in.h
9387 do :
9388   ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
9389 if test "x$ac_cv_header_netinet_in_h" = xyes; then :
9390   cat >>confdefs.h <<_ACEOF
9391 #define HAVE_NETINET_IN_H 1
9392 _ACEOF
9393
9394 fi
9395
9396 done
9397
9398 for ac_header in netinet/tcp.h
9399 do :
9400   ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default
9401 #ifdef HAVE_NETINET_IN_H
9402 #include <netinet/in.h>
9403 #endif
9404
9405 "
9406 if test "x$ac_cv_header_netinet_tcp_h" = xyes; then :
9407   cat >>confdefs.h <<_ACEOF
9408 #define HAVE_NETINET_TCP_H 1
9409 _ACEOF
9410
9411 fi
9412
9413 done
9414
9415
9416 if expr x"$pgac_cv_check_readline" : 'x-lreadline' >/dev/null ; then
9417   for ac_header in readline/readline.h
9418 do :
9419   ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
9420 if test "x$ac_cv_header_readline_readline_h" = xyes; then :
9421   cat >>confdefs.h <<_ACEOF
9422 #define HAVE_READLINE_READLINE_H 1
9423 _ACEOF
9424
9425 else
9426   for ac_header in readline.h
9427 do :
9428   ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
9429 if test "x$ac_cv_header_readline_h" = xyes; then :
9430   cat >>confdefs.h <<_ACEOF
9431 #define HAVE_READLINE_H 1
9432 _ACEOF
9433
9434 else
9435   as_fn_error $? "readline header not found
9436 If you have readline already installed, see config.log for details on the
9437 failure.  It is possible the compiler isn't looking in the proper directory.
9438 Use --without-readline to disable readline support." "$LINENO" 5
9439 fi
9440
9441 done
9442
9443 fi
9444
9445 done
9446
9447   for ac_header in readline/history.h
9448 do :
9449   ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
9450 if test "x$ac_cv_header_readline_history_h" = xyes; then :
9451   cat >>confdefs.h <<_ACEOF
9452 #define HAVE_READLINE_HISTORY_H 1
9453 _ACEOF
9454
9455 else
9456   for ac_header in history.h
9457 do :
9458   ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
9459 if test "x$ac_cv_header_history_h" = xyes; then :
9460   cat >>confdefs.h <<_ACEOF
9461 #define HAVE_HISTORY_H 1
9462 _ACEOF
9463
9464 else
9465   as_fn_error $? "history header not found
9466 If you have readline already installed, see config.log for details on the
9467 failure.  It is possible the compiler isn't looking in the proper directory.
9468 Use --without-readline to disable readline support." "$LINENO" 5
9469 fi
9470
9471 done
9472
9473 fi
9474
9475 done
9476
9477 fi
9478
9479 if expr x"$pgac_cv_check_readline" : 'x-ledit' >/dev/null ; then
9480 # Some installations of libedit usurp /usr/include/readline/, which seems
9481 # bad practice, since in combined installations readline will have its headers
9482 # there.  We might have to resort to AC_EGREP checks to make sure we found
9483 # the proper header...
9484   for ac_header in editline/readline.h
9485 do :
9486   ac_fn_c_check_header_mongrel "$LINENO" "editline/readline.h" "ac_cv_header_editline_readline_h" "$ac_includes_default"
9487 if test "x$ac_cv_header_editline_readline_h" = xyes; then :
9488   cat >>confdefs.h <<_ACEOF
9489 #define HAVE_EDITLINE_READLINE_H 1
9490 _ACEOF
9491
9492 else
9493   for ac_header in readline.h
9494 do :
9495   ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
9496 if test "x$ac_cv_header_readline_h" = xyes; then :
9497   cat >>confdefs.h <<_ACEOF
9498 #define HAVE_READLINE_H 1
9499 _ACEOF
9500
9501 else
9502   for ac_header in readline/readline.h
9503 do :
9504   ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
9505 if test "x$ac_cv_header_readline_readline_h" = xyes; then :
9506   cat >>confdefs.h <<_ACEOF
9507 #define HAVE_READLINE_READLINE_H 1
9508 _ACEOF
9509
9510 else
9511   as_fn_error $? "readline header not found
9512 If you have libedit already installed, see config.log for details on the
9513 failure.  It is possible the compiler isn't looking in the proper directory.
9514 Use --without-readline to disable libedit support." "$LINENO" 5
9515 fi
9516
9517 done
9518
9519 fi
9520
9521 done
9522
9523 fi
9524
9525 done
9526
9527 # Note: in a libedit installation, history.h is sometimes a dummy, and may
9528 # not be there at all.  Hence, don't complain if not found.  We must check
9529 # though, since in yet other versions it is an independent header.
9530   for ac_header in editline/history.h
9531 do :
9532   ac_fn_c_check_header_mongrel "$LINENO" "editline/history.h" "ac_cv_header_editline_history_h" "$ac_includes_default"
9533 if test "x$ac_cv_header_editline_history_h" = xyes; then :
9534   cat >>confdefs.h <<_ACEOF
9535 #define HAVE_EDITLINE_HISTORY_H 1
9536 _ACEOF
9537
9538 else
9539   for ac_header in history.h
9540 do :
9541   ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
9542 if test "x$ac_cv_header_history_h" = xyes; then :
9543   cat >>confdefs.h <<_ACEOF
9544 #define HAVE_HISTORY_H 1
9545 _ACEOF
9546
9547 else
9548   for ac_header in readline/history.h
9549 do :
9550   ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
9551 if test "x$ac_cv_header_readline_history_h" = xyes; then :
9552   cat >>confdefs.h <<_ACEOF
9553 #define HAVE_READLINE_HISTORY_H 1
9554 _ACEOF
9555
9556 fi
9557
9558 done
9559
9560 fi
9561
9562 done
9563
9564 fi
9565
9566 done
9567
9568 fi
9569
9570 if test "$with_zlib" = yes; then
9571   ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
9572 if test "x$ac_cv_header_zlib_h" = xyes; then :
9573
9574 else
9575   as_fn_error $? "zlib header not found
9576 If you have zlib already installed, see config.log for details on the
9577 failure.  It is possible the compiler isn't looking in the proper directory.
9578 Use --without-zlib to disable zlib support." "$LINENO" 5
9579 fi
9580
9581
9582 fi
9583
9584 if test "$with_gssapi" = yes ; then
9585   for ac_header in gssapi/gssapi.h
9586 do :
9587   ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default"
9588 if test "x$ac_cv_header_gssapi_gssapi_h" = xyes; then :
9589   cat >>confdefs.h <<_ACEOF
9590 #define HAVE_GSSAPI_GSSAPI_H 1
9591 _ACEOF
9592
9593 else
9594   for ac_header in gssapi.h
9595 do :
9596   ac_fn_c_check_header_mongrel "$LINENO" "gssapi.h" "ac_cv_header_gssapi_h" "$ac_includes_default"
9597 if test "x$ac_cv_header_gssapi_h" = xyes; then :
9598   cat >>confdefs.h <<_ACEOF
9599 #define HAVE_GSSAPI_H 1
9600 _ACEOF
9601
9602 else
9603   as_fn_error $? "gssapi.h header file is required for GSSAPI" "$LINENO" 5
9604 fi
9605
9606 done
9607
9608 fi
9609
9610 done
9611
9612 fi
9613
9614 if test "$with_openssl" = yes ; then
9615   ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default"
9616 if test "x$ac_cv_header_openssl_ssl_h" = xyes; then :
9617
9618 else
9619   as_fn_error $? "header file <openssl/ssl.h> is required for OpenSSL" "$LINENO" 5
9620 fi
9621
9622
9623   ac_fn_c_check_header_mongrel "$LINENO" "openssl/err.h" "ac_cv_header_openssl_err_h" "$ac_includes_default"
9624 if test "x$ac_cv_header_openssl_err_h" = xyes; then :
9625
9626 else
9627   as_fn_error $? "header file <openssl/err.h> is required for OpenSSL" "$LINENO" 5
9628 fi
9629
9630
9631 fi
9632
9633 if test "$with_pam" = yes ; then
9634   for ac_header in security/pam_appl.h
9635 do :
9636   ac_fn_c_check_header_mongrel "$LINENO" "security/pam_appl.h" "ac_cv_header_security_pam_appl_h" "$ac_includes_default"
9637 if test "x$ac_cv_header_security_pam_appl_h" = xyes; then :
9638   cat >>confdefs.h <<_ACEOF
9639 #define HAVE_SECURITY_PAM_APPL_H 1
9640 _ACEOF
9641
9642 else
9643   for ac_header in pam/pam_appl.h
9644 do :
9645   ac_fn_c_check_header_mongrel "$LINENO" "pam/pam_appl.h" "ac_cv_header_pam_pam_appl_h" "$ac_includes_default"
9646 if test "x$ac_cv_header_pam_pam_appl_h" = xyes; then :
9647   cat >>confdefs.h <<_ACEOF
9648 #define HAVE_PAM_PAM_APPL_H 1
9649 _ACEOF
9650
9651 else
9652   as_fn_error $? "header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM." "$LINENO" 5
9653 fi
9654
9655 done
9656
9657 fi
9658
9659 done
9660
9661 fi
9662
9663 if test "$with_libxml" = yes ; then
9664   ac_fn_c_check_header_mongrel "$LINENO" "libxml/parser.h" "ac_cv_header_libxml_parser_h" "$ac_includes_default"
9665 if test "x$ac_cv_header_libxml_parser_h" = xyes; then :
9666
9667 else
9668   as_fn_error $? "header file <libxml/parser.h> is required for XML support" "$LINENO" 5
9669 fi
9670
9671
9672 fi
9673
9674 if test "$with_libxslt" = yes ; then
9675   ac_fn_c_check_header_mongrel "$LINENO" "libxslt/xslt.h" "ac_cv_header_libxslt_xslt_h" "$ac_includes_default"
9676 if test "x$ac_cv_header_libxslt_xslt_h" = xyes; then :
9677
9678 else
9679   as_fn_error $? "header file <libxslt/xslt.h> is required for XSLT support" "$LINENO" 5
9680 fi
9681
9682
9683 fi
9684
9685 if test "$with_ldap" = yes ; then
9686   if test "$PORTNAME" != "win32"; then
9687      for ac_header in ldap.h
9688 do :
9689   ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default"
9690 if test "x$ac_cv_header_ldap_h" = xyes; then :
9691   cat >>confdefs.h <<_ACEOF
9692 #define HAVE_LDAP_H 1
9693 _ACEOF
9694
9695 else
9696   as_fn_error $? "header file <ldap.h> is required for LDAP" "$LINENO" 5
9697 fi
9698
9699 done
9700
9701      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compatible LDAP implementation" >&5
9702 $as_echo_n "checking for compatible LDAP implementation... " >&6; }
9703 if ${pgac_cv_ldap_safe+:} false; then :
9704   $as_echo_n "(cached) " >&6
9705 else
9706   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9707 /* end confdefs.h.  */
9708 #include <ldap.h>
9709 #if !defined(LDAP_VENDOR_VERSION) || \
9710      (defined(LDAP_API_FEATURE_X_OPENLDAP) && \
9711       LDAP_VENDOR_VERSION >= 20424 && LDAP_VENDOR_VERSION <= 20431)
9712 choke me
9713 #endif
9714 int
9715 main ()
9716 {
9717
9718   ;
9719   return 0;
9720 }
9721 _ACEOF
9722 if ac_fn_c_try_compile "$LINENO"; then :
9723   pgac_cv_ldap_safe=yes
9724 else
9725   pgac_cv_ldap_safe=no
9726 fi
9727 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9728 fi
9729 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_ldap_safe" >&5
9730 $as_echo "$pgac_cv_ldap_safe" >&6; }
9731
9732 if test "$pgac_cv_ldap_safe" != yes; then
9733   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9734 *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
9735 *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
9736 *** also uses LDAP will crash on exit." >&5
9737 $as_echo "$as_me: WARNING:
9738 *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
9739 *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
9740 *** also uses LDAP will crash on exit." >&2;}
9741 fi
9742   else
9743      for ac_header in winldap.h
9744 do :
9745   ac_fn_c_check_header_compile "$LINENO" "winldap.h" "ac_cv_header_winldap_h" "$ac_includes_default
9746 #include <windows.h>
9747
9748 "
9749 if test "x$ac_cv_header_winldap_h" = xyes; then :
9750   cat >>confdefs.h <<_ACEOF
9751 #define HAVE_WINLDAP_H 1
9752 _ACEOF
9753
9754 else
9755   as_fn_error $? "header file <winldap.h> is required for LDAP" "$LINENO" 5
9756 fi
9757
9758 done
9759
9760   fi
9761 fi
9762
9763 if test "$with_bonjour" = yes ; then
9764   ac_fn_c_check_header_mongrel "$LINENO" "dns_sd.h" "ac_cv_header_dns_sd_h" "$ac_includes_default"
9765 if test "x$ac_cv_header_dns_sd_h" = xyes; then :
9766
9767 else
9768   as_fn_error $? "header file <dns_sd.h> is required for Bonjour" "$LINENO" 5
9769 fi
9770
9771
9772 fi
9773
9774 # for contrib/uuid-ossp
9775 if test "$with_uuid" = bsd ; then
9776   for ac_header in uuid.h
9777 do :
9778   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
9779 if test "x$ac_cv_header_uuid_h" = xyes; then :
9780   cat >>confdefs.h <<_ACEOF
9781 #define HAVE_UUID_H 1
9782 _ACEOF
9783  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9784 /* end confdefs.h.  */
9785 #include <uuid.h>
9786
9787 _ACEOF
9788 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9789   $EGREP "uuid_to_string" >/dev/null 2>&1; then :
9790
9791 else
9792   as_fn_error $? "header file <uuid.h> does not match BSD UUID library" "$LINENO" 5
9793 fi
9794 rm -f conftest*
9795
9796 else
9797   as_fn_error $? "header file <uuid.h> is required for BSD UUID" "$LINENO" 5
9798 fi
9799
9800 done
9801
9802 elif test "$with_uuid" = e2fs ; then
9803   for ac_header in uuid/uuid.h
9804 do :
9805   ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
9806 if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
9807   cat >>confdefs.h <<_ACEOF
9808 #define HAVE_UUID_UUID_H 1
9809 _ACEOF
9810  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9811 /* end confdefs.h.  */
9812 #include <uuid/uuid.h>
9813
9814 _ACEOF
9815 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9816   $EGREP "uuid_generate" >/dev/null 2>&1; then :
9817
9818 else
9819   as_fn_error $? "header file <uuid/uuid.h> does not match E2FS UUID library" "$LINENO" 5
9820 fi
9821 rm -f conftest*
9822
9823 else
9824   for ac_header in uuid.h
9825 do :
9826   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
9827 if test "x$ac_cv_header_uuid_h" = xyes; then :
9828   cat >>confdefs.h <<_ACEOF
9829 #define HAVE_UUID_H 1
9830 _ACEOF
9831  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9832 /* end confdefs.h.  */
9833 #include <uuid.h>
9834
9835 _ACEOF
9836 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9837   $EGREP "uuid_generate" >/dev/null 2>&1; then :
9838
9839 else
9840   as_fn_error $? "header file <uuid.h> does not match E2FS UUID library" "$LINENO" 5
9841 fi
9842 rm -f conftest*
9843
9844 else
9845   as_fn_error $? "header file <uuid/uuid.h> or <uuid.h> is required for E2FS UUID" "$LINENO" 5
9846 fi
9847
9848 done
9849
9850 fi
9851
9852 done
9853
9854 elif test "$with_uuid" = ossp ; then
9855   for ac_header in ossp/uuid.h
9856 do :
9857   ac_fn_c_check_header_mongrel "$LINENO" "ossp/uuid.h" "ac_cv_header_ossp_uuid_h" "$ac_includes_default"
9858 if test "x$ac_cv_header_ossp_uuid_h" = xyes; then :
9859   cat >>confdefs.h <<_ACEOF
9860 #define HAVE_OSSP_UUID_H 1
9861 _ACEOF
9862  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9863 /* end confdefs.h.  */
9864 #include <ossp/uuid.h>
9865
9866 _ACEOF
9867 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9868   $EGREP "uuid_export" >/dev/null 2>&1; then :
9869
9870 else
9871   as_fn_error $? "header file <ossp/uuid.h> does not match OSSP UUID library" "$LINENO" 5
9872 fi
9873 rm -f conftest*
9874
9875 else
9876   for ac_header in uuid.h
9877 do :
9878   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
9879 if test "x$ac_cv_header_uuid_h" = xyes; then :
9880   cat >>confdefs.h <<_ACEOF
9881 #define HAVE_UUID_H 1
9882 _ACEOF
9883  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9884 /* end confdefs.h.  */
9885 #include <uuid.h>
9886
9887 _ACEOF
9888 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9889   $EGREP "uuid_export" >/dev/null 2>&1; then :
9890
9891 else
9892   as_fn_error $? "header file <uuid.h> does not match OSSP UUID library" "$LINENO" 5
9893 fi
9894 rm -f conftest*
9895
9896 else
9897   as_fn_error $? "header file <ossp/uuid.h> or <uuid.h> is required for OSSP UUID" "$LINENO" 5
9898 fi
9899
9900 done
9901
9902 fi
9903
9904 done
9905
9906 fi
9907
9908 if test "$PORTNAME" = "win32" ; then
9909    for ac_header in crtdefs.h
9910 do :
9911   ac_fn_c_check_header_mongrel "$LINENO" "crtdefs.h" "ac_cv_header_crtdefs_h" "$ac_includes_default"
9912 if test "x$ac_cv_header_crtdefs_h" = xyes; then :
9913   cat >>confdefs.h <<_ACEOF
9914 #define HAVE_CRTDEFS_H 1
9915 _ACEOF
9916
9917 fi
9918
9919 done
9920
9921 fi
9922
9923 ##
9924 ## Types, structures, compiler characteristics
9925 ##
9926
9927   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
9928 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
9929 if ${ac_cv_c_bigendian+:} false; then :
9930   $as_echo_n "(cached) " >&6
9931 else
9932   ac_cv_c_bigendian=unknown
9933     # See if we're dealing with a universal compiler.
9934     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9935 /* end confdefs.h.  */
9936 #ifndef __APPLE_CC__
9937                not a universal capable compiler
9938              #endif
9939              typedef int dummy;
9940
9941 _ACEOF
9942 if ac_fn_c_try_compile "$LINENO"; then :
9943
9944         # Check for potential -arch flags.  It is not universal unless
9945         # there are at least two -arch flags with different values.
9946         ac_arch=
9947         ac_prev=
9948         for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
9949          if test -n "$ac_prev"; then
9950            case $ac_word in
9951              i?86 | x86_64 | ppc | ppc64)
9952                if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
9953                  ac_arch=$ac_word
9954                else
9955                  ac_cv_c_bigendian=universal
9956                  break
9957                fi
9958                ;;
9959            esac
9960            ac_prev=
9961          elif test "x$ac_word" = "x-arch"; then
9962            ac_prev=arch
9963          fi
9964        done
9965 fi
9966 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9967     if test $ac_cv_c_bigendian = unknown; then
9968       # See if sys/param.h defines the BYTE_ORDER macro.
9969       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9970 /* end confdefs.h.  */
9971 #include <sys/types.h>
9972              #include <sys/param.h>
9973
9974 int
9975 main ()
9976 {
9977 #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
9978                      && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
9979                      && LITTLE_ENDIAN)
9980               bogus endian macros
9981              #endif
9982
9983   ;
9984   return 0;
9985 }
9986 _ACEOF
9987 if ac_fn_c_try_compile "$LINENO"; then :
9988   # It does; now see whether it defined to BIG_ENDIAN or not.
9989          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9990 /* end confdefs.h.  */
9991 #include <sys/types.h>
9992                 #include <sys/param.h>
9993
9994 int
9995 main ()
9996 {
9997 #if BYTE_ORDER != BIG_ENDIAN
9998                  not big endian
9999                 #endif
10000
10001   ;
10002   return 0;
10003 }
10004 _ACEOF
10005 if ac_fn_c_try_compile "$LINENO"; then :
10006   ac_cv_c_bigendian=yes
10007 else
10008   ac_cv_c_bigendian=no
10009 fi
10010 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10011 fi
10012 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10013     fi
10014     if test $ac_cv_c_bigendian = unknown; then
10015       # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
10016       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10017 /* end confdefs.h.  */
10018 #include <limits.h>
10019
10020 int
10021 main ()
10022 {
10023 #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
10024               bogus endian macros
10025              #endif
10026
10027   ;
10028   return 0;
10029 }
10030 _ACEOF
10031 if ac_fn_c_try_compile "$LINENO"; then :
10032   # It does; now see whether it defined to _BIG_ENDIAN or not.
10033          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10034 /* end confdefs.h.  */
10035 #include <limits.h>
10036
10037 int
10038 main ()
10039 {
10040 #ifndef _BIG_ENDIAN
10041                  not big endian
10042                 #endif
10043
10044   ;
10045   return 0;
10046 }
10047 _ACEOF
10048 if ac_fn_c_try_compile "$LINENO"; then :
10049   ac_cv_c_bigendian=yes
10050 else
10051   ac_cv_c_bigendian=no
10052 fi
10053 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10054 fi
10055 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10056     fi
10057     if test $ac_cv_c_bigendian = unknown; then
10058       # Compile a test program.
10059       if test "$cross_compiling" = yes; then :
10060   # Try to guess by grepping values from an object file.
10061          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10062 /* end confdefs.h.  */
10063 short int ascii_mm[] =
10064                   { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
10065                 short int ascii_ii[] =
10066                   { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
10067                 int use_ascii (int i) {
10068                   return ascii_mm[i] + ascii_ii[i];
10069                 }
10070                 short int ebcdic_ii[] =
10071                   { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
10072                 short int ebcdic_mm[] =
10073                   { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
10074                 int use_ebcdic (int i) {
10075                   return ebcdic_mm[i] + ebcdic_ii[i];
10076                 }
10077                 extern int foo;
10078
10079 int
10080 main ()
10081 {
10082 return use_ascii (foo) == use_ebcdic (foo);
10083   ;
10084   return 0;
10085 }
10086 _ACEOF
10087 if ac_fn_c_try_compile "$LINENO"; then :
10088   if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
10089               ac_cv_c_bigendian=yes
10090             fi
10091             if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
10092               if test "$ac_cv_c_bigendian" = unknown; then
10093                 ac_cv_c_bigendian=no
10094               else
10095                 # finding both strings is unlikely to happen, but who knows?
10096                 ac_cv_c_bigendian=unknown
10097               fi
10098             fi
10099 fi
10100 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10101 else
10102   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10103 /* end confdefs.h.  */
10104 $ac_includes_default
10105 int
10106 main ()
10107 {
10108
10109              /* Are we little or big endian?  From Harbison&Steele.  */
10110              union
10111              {
10112                long int l;
10113                char c[sizeof (long int)];
10114              } u;
10115              u.l = 1;
10116              return u.c[sizeof (long int) - 1] == 1;
10117
10118   ;
10119   return 0;
10120 }
10121 _ACEOF
10122 if ac_fn_c_try_run "$LINENO"; then :
10123   ac_cv_c_bigendian=no
10124 else
10125   ac_cv_c_bigendian=yes
10126 fi
10127 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10128   conftest.$ac_objext conftest.beam conftest.$ac_ext
10129 fi
10130
10131     fi
10132 fi
10133 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
10134 $as_echo "$ac_cv_c_bigendian" >&6; }
10135  case $ac_cv_c_bigendian in #(
10136    yes)
10137      $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
10138 ;; #(
10139    no)
10140       ;; #(
10141    universal)
10142
10143 $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
10144
10145      ;; #(
10146    *)
10147      as_fn_error $? "unknown endianness
10148  presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
10149  esac
10150
10151 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
10152 $as_echo_n "checking for inline... " >&6; }
10153 if ${ac_cv_c_inline+:} false; then :
10154   $as_echo_n "(cached) " >&6
10155 else
10156   ac_cv_c_inline=no
10157 for ac_kw in inline __inline__ __inline; do
10158   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10159 /* end confdefs.h.  */
10160 #ifndef __cplusplus
10161 typedef int foo_t;
10162 static $ac_kw foo_t static_foo () {return 0; }
10163 $ac_kw foo_t foo () {return 0; }
10164 #endif
10165
10166 _ACEOF
10167 if ac_fn_c_try_compile "$LINENO"; then :
10168   ac_cv_c_inline=$ac_kw
10169 fi
10170 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10171   test "$ac_cv_c_inline" != no && break
10172 done
10173
10174 fi
10175 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
10176 $as_echo "$ac_cv_c_inline" >&6; }
10177
10178 case $ac_cv_c_inline in
10179   inline | yes) ;;
10180   *)
10181     case $ac_cv_c_inline in
10182       no) ac_val=;;
10183       *) ac_val=$ac_cv_c_inline;;
10184     esac
10185     cat >>confdefs.h <<_ACEOF
10186 #ifndef __cplusplus
10187 #define inline $ac_val
10188 #endif
10189 _ACEOF
10190     ;;
10191 esac
10192
10193 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for quiet inline (no complaint if unreferenced)" >&5
10194 $as_echo_n "checking for quiet inline (no complaint if unreferenced)... " >&6; }
10195 if ${pgac_cv_c_inline_quietly+:} false; then :
10196   $as_echo_n "(cached) " >&6
10197 else
10198   pgac_cv_c_inline_quietly=no
10199   if test "$ac_cv_c_inline" != no; then
10200     pgac_c_inline_save_werror=$ac_c_werror_flag
10201     ac_c_werror_flag=yes
10202     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10203 /* end confdefs.h.  */
10204 #include "$srcdir/config/test_quiet_include.h"
10205 int
10206 main ()
10207 {
10208
10209   ;
10210   return 0;
10211 }
10212 _ACEOF
10213 if ac_fn_c_try_link "$LINENO"; then :
10214   pgac_cv_c_inline_quietly=yes
10215 fi
10216 rm -f core conftest.err conftest.$ac_objext \
10217     conftest$ac_exeext conftest.$ac_ext
10218     ac_c_werror_flag=$pgac_c_inline_save_werror
10219   fi
10220 fi
10221 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_inline_quietly" >&5
10222 $as_echo "$pgac_cv_c_inline_quietly" >&6; }
10223 if test "$pgac_cv_c_inline_quietly" != no; then
10224
10225 cat >>confdefs.h <<_ACEOF
10226 #define PG_USE_INLINE 1
10227 _ACEOF
10228
10229 fi
10230
10231 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf format archetype" >&5
10232 $as_echo_n "checking for printf format archetype... " >&6; }
10233 if ${pgac_cv_printf_archetype+:} false; then :
10234   $as_echo_n "(cached) " >&6
10235 else
10236   ac_save_c_werror_flag=$ac_c_werror_flag
10237 ac_c_werror_flag=yes
10238 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10239 /* end confdefs.h.  */
10240 extern int
10241 pgac_write(int ignore, const char *fmt,...)
10242 __attribute__((format(gnu_printf, 2, 3)));
10243 int
10244 main ()
10245 {
10246
10247   ;
10248   return 0;
10249 }
10250 _ACEOF
10251 if ac_fn_c_try_compile "$LINENO"; then :
10252   pgac_cv_printf_archetype=gnu_printf
10253 else
10254   pgac_cv_printf_archetype=printf
10255 fi
10256 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10257 ac_c_werror_flag=$ac_save_c_werror_flag
10258 fi
10259 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_printf_archetype" >&5
10260 $as_echo "$pgac_cv_printf_archetype" >&6; }
10261
10262 cat >>confdefs.h <<_ACEOF
10263 #define PG_PRINTF_ATTRIBUTE $pgac_cv_printf_archetype
10264 _ACEOF
10265
10266
10267
10268   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array members" >&5
10269 $as_echo_n "checking for flexible array members... " >&6; }
10270 if ${ac_cv_c_flexmember+:} false; then :
10271   $as_echo_n "(cached) " >&6
10272 else
10273   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10274 /* end confdefs.h.  */
10275 #include <stdlib.h>
10276             #include <stdio.h>
10277             #include <stddef.h>
10278             struct s { int n; double d[]; };
10279 int
10280 main ()
10281 {
10282 int m = getchar ();
10283             struct s *p = malloc (offsetof (struct s, d)
10284                                   + m * sizeof (double));
10285             p->d[0] = 0.0;
10286             return p->d != (double *) NULL;
10287   ;
10288   return 0;
10289 }
10290 _ACEOF
10291 if ac_fn_c_try_compile "$LINENO"; then :
10292   ac_cv_c_flexmember=yes
10293 else
10294   ac_cv_c_flexmember=no
10295 fi
10296 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10297 fi
10298 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
10299 $as_echo "$ac_cv_c_flexmember" >&6; }
10300   if test $ac_cv_c_flexmember = yes; then
10301
10302 $as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
10303
10304   else
10305     $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
10306
10307   fi
10308
10309 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed types" >&5
10310 $as_echo_n "checking for signed types... " >&6; }
10311 if ${pgac_cv_c_signed+:} false; then :
10312   $as_echo_n "(cached) " >&6
10313 else
10314   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10315 /* end confdefs.h.  */
10316
10317 int
10318 main ()
10319 {
10320 signed char c; signed short s; signed int i;
10321   ;
10322   return 0;
10323 }
10324 _ACEOF
10325 if ac_fn_c_try_compile "$LINENO"; then :
10326   pgac_cv_c_signed=yes
10327 else
10328   pgac_cv_c_signed=no
10329 fi
10330 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10331 fi
10332 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_signed" >&5
10333 $as_echo "$pgac_cv_c_signed" >&6; }
10334 if test x"$pgac_cv_c_signed" = xno ; then
10335
10336 $as_echo "#define signed /**/" >>confdefs.h
10337
10338 fi
10339 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __func__" >&5
10340 $as_echo_n "checking for __func__... " >&6; }
10341 if ${pgac_cv_funcname_func_support+:} false; then :
10342   $as_echo_n "(cached) " >&6
10343 else
10344   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10345 /* end confdefs.h.  */
10346 #include <stdio.h>
10347 int
10348 main ()
10349 {
10350 printf("%s\n", __func__);
10351   ;
10352   return 0;
10353 }
10354 _ACEOF
10355 if ac_fn_c_try_compile "$LINENO"; then :
10356   pgac_cv_funcname_func_support=yes
10357 else
10358   pgac_cv_funcname_func_support=no
10359 fi
10360 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10361 fi
10362 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_func_support" >&5
10363 $as_echo "$pgac_cv_funcname_func_support" >&6; }
10364 if test x"$pgac_cv_funcname_func_support" = xyes ; then
10365
10366 $as_echo "#define HAVE_FUNCNAME__FUNC 1" >>confdefs.h
10367
10368 else
10369 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __FUNCTION__" >&5
10370 $as_echo_n "checking for __FUNCTION__... " >&6; }
10371 if ${pgac_cv_funcname_function_support+:} false; then :
10372   $as_echo_n "(cached) " >&6
10373 else
10374   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10375 /* end confdefs.h.  */
10376 #include <stdio.h>
10377 int
10378 main ()
10379 {
10380 printf("%s\n", __FUNCTION__);
10381   ;
10382   return 0;
10383 }
10384 _ACEOF
10385 if ac_fn_c_try_compile "$LINENO"; then :
10386   pgac_cv_funcname_function_support=yes
10387 else
10388   pgac_cv_funcname_function_support=no
10389 fi
10390 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10391 fi
10392 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_function_support" >&5
10393 $as_echo "$pgac_cv_funcname_function_support" >&6; }
10394 if test x"$pgac_cv_funcname_function_support" = xyes ; then
10395
10396 $as_echo "#define HAVE_FUNCNAME__FUNCTION 1" >>confdefs.h
10397
10398 fi
10399 fi
10400 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Static_assert" >&5
10401 $as_echo_n "checking for _Static_assert... " >&6; }
10402 if ${pgac_cv__static_assert+:} false; then :
10403   $as_echo_n "(cached) " >&6
10404 else
10405   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10406 /* end confdefs.h.  */
10407
10408 int
10409 main ()
10410 {
10411 ({ _Static_assert(1, "foo"); })
10412   ;
10413   return 0;
10414 }
10415 _ACEOF
10416 if ac_fn_c_try_link "$LINENO"; then :
10417   pgac_cv__static_assert=yes
10418 else
10419   pgac_cv__static_assert=no
10420 fi
10421 rm -f core conftest.err conftest.$ac_objext \
10422     conftest$ac_exeext conftest.$ac_ext
10423 fi
10424 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__static_assert" >&5
10425 $as_echo "$pgac_cv__static_assert" >&6; }
10426 if test x"$pgac_cv__static_assert" = xyes ; then
10427
10428 $as_echo "#define HAVE__STATIC_ASSERT 1" >>confdefs.h
10429
10430 fi
10431 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_types_compatible_p" >&5
10432 $as_echo_n "checking for __builtin_types_compatible_p... " >&6; }
10433 if ${pgac_cv__types_compatible+:} false; then :
10434   $as_echo_n "(cached) " >&6
10435 else
10436   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10437 /* end confdefs.h.  */
10438
10439 int
10440 main ()
10441 {
10442  int x; static int y[__builtin_types_compatible_p(__typeof__(x), int)];
10443   ;
10444   return 0;
10445 }
10446 _ACEOF
10447 if ac_fn_c_try_compile "$LINENO"; then :
10448   pgac_cv__types_compatible=yes
10449 else
10450   pgac_cv__types_compatible=no
10451 fi
10452 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10453 fi
10454 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__types_compatible" >&5
10455 $as_echo "$pgac_cv__types_compatible" >&6; }
10456 if test x"$pgac_cv__types_compatible" = xyes ; then
10457
10458 $as_echo "#define HAVE__BUILTIN_TYPES_COMPATIBLE_P 1" >>confdefs.h
10459
10460 fi
10461 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap32" >&5
10462 $as_echo_n "checking for __builtin_bswap32... " >&6; }
10463 if ${pgac_cv__builtin_bswap32+:} false; then :
10464   $as_echo_n "(cached) " >&6
10465 else
10466   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10467 /* end confdefs.h.  */
10468 static unsigned long int x = __builtin_bswap32(0xaabbccdd);
10469
10470 _ACEOF
10471 if ac_fn_c_try_compile "$LINENO"; then :
10472   pgac_cv__builtin_bswap32=yes
10473 else
10474   pgac_cv__builtin_bswap32=no
10475 fi
10476 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10477 fi
10478 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_bswap32" >&5
10479 $as_echo "$pgac_cv__builtin_bswap32" >&6; }
10480 if test x"$pgac_cv__builtin_bswap32" = xyes ; then
10481
10482 $as_echo "#define HAVE__BUILTIN_BSWAP32 1" >>confdefs.h
10483
10484 fi
10485 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_constant_p" >&5
10486 $as_echo_n "checking for __builtin_constant_p... " >&6; }
10487 if ${pgac_cv__builtin_constant_p+:} false; then :
10488   $as_echo_n "(cached) " >&6
10489 else
10490   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10491 /* end confdefs.h.  */
10492 static int x; static int y[__builtin_constant_p(x) ? x : 1];
10493
10494 _ACEOF
10495 if ac_fn_c_try_compile "$LINENO"; then :
10496   pgac_cv__builtin_constant_p=yes
10497 else
10498   pgac_cv__builtin_constant_p=no
10499 fi
10500 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10501 fi
10502 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_constant_p" >&5
10503 $as_echo "$pgac_cv__builtin_constant_p" >&6; }
10504 if test x"$pgac_cv__builtin_constant_p" = xyes ; then
10505
10506 $as_echo "#define HAVE__BUILTIN_CONSTANT_P 1" >>confdefs.h
10507
10508 fi
10509 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_unreachable" >&5
10510 $as_echo_n "checking for __builtin_unreachable... " >&6; }
10511 if ${pgac_cv__builtin_unreachable+:} false; then :
10512   $as_echo_n "(cached) " >&6
10513 else
10514   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10515 /* end confdefs.h.  */
10516
10517 int
10518 main ()
10519 {
10520 __builtin_unreachable();
10521   ;
10522   return 0;
10523 }
10524 _ACEOF
10525 if ac_fn_c_try_link "$LINENO"; then :
10526   pgac_cv__builtin_unreachable=yes
10527 else
10528   pgac_cv__builtin_unreachable=no
10529 fi
10530 rm -f core conftest.err conftest.$ac_objext \
10531     conftest$ac_exeext conftest.$ac_ext
10532 fi
10533 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_unreachable" >&5
10534 $as_echo "$pgac_cv__builtin_unreachable" >&6; }
10535 if test x"$pgac_cv__builtin_unreachable" = xyes ; then
10536
10537 $as_echo "#define HAVE__BUILTIN_UNREACHABLE 1" >>confdefs.h
10538
10539 fi
10540 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __VA_ARGS__" >&5
10541 $as_echo_n "checking for __VA_ARGS__... " >&6; }
10542 if ${pgac_cv__va_args+:} false; then :
10543   $as_echo_n "(cached) " >&6
10544 else
10545   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10546 /* end confdefs.h.  */
10547 #include <stdio.h>
10548 int
10549 main ()
10550 {
10551 #define debug(...) fprintf(stderr, __VA_ARGS__)
10552 debug("%s", "blarg");
10553
10554   ;
10555   return 0;
10556 }
10557 _ACEOF
10558 if ac_fn_c_try_compile "$LINENO"; then :
10559   pgac_cv__va_args=yes
10560 else
10561   pgac_cv__va_args=no
10562 fi
10563 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10564 fi
10565 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__va_args" >&5
10566 $as_echo "$pgac_cv__va_args" >&6; }
10567 if test x"$pgac_cv__va_args" = xyes ; then
10568
10569 $as_echo "#define HAVE__VA_ARGS 1" >>confdefs.h
10570
10571 fi
10572 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
10573 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
10574 if ${ac_cv_struct_tm+:} false; then :
10575   $as_echo_n "(cached) " >&6
10576 else
10577   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10578 /* end confdefs.h.  */
10579 #include <sys/types.h>
10580 #include <time.h>
10581
10582 int
10583 main ()
10584 {
10585 struct tm tm;
10586                                      int *p = &tm.tm_sec;
10587                                      return !p;
10588   ;
10589   return 0;
10590 }
10591 _ACEOF
10592 if ac_fn_c_try_compile "$LINENO"; then :
10593   ac_cv_struct_tm=time.h
10594 else
10595   ac_cv_struct_tm=sys/time.h
10596 fi
10597 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10598 fi
10599 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
10600 $as_echo "$ac_cv_struct_tm" >&6; }
10601 if test $ac_cv_struct_tm = sys/time.h; then
10602
10603 $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
10604
10605 fi
10606
10607 ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h>
10608 #include <$ac_cv_struct_tm>
10609
10610 "
10611 if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
10612
10613 cat >>confdefs.h <<_ACEOF
10614 #define HAVE_STRUCT_TM_TM_ZONE 1
10615 _ACEOF
10616
10617
10618 fi
10619
10620 if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
10621
10622 $as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h
10623
10624 fi
10625 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
10626 $as_echo_n "checking for tzname... " >&6; }
10627 if ${ac_cv_var_tzname+:} false; then :
10628   $as_echo_n "(cached) " >&6
10629 else
10630   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10631 /* end confdefs.h.  */
10632 #include <time.h>
10633 #ifndef tzname /* For SGI.  */
10634 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
10635 #endif
10636
10637 int
10638 main ()
10639 {
10640 atoi(*tzname);
10641   ;
10642   return 0;
10643 }
10644 _ACEOF
10645 if ac_fn_c_try_link "$LINENO"; then :
10646   ac_cv_var_tzname=yes
10647 else
10648   ac_cv_var_tzname=no
10649 fi
10650 rm -f core conftest.err conftest.$ac_objext \
10651     conftest$ac_exeext conftest.$ac_ext
10652 fi
10653 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5
10654 $as_echo "$ac_cv_var_tzname" >&6; }
10655 if test $ac_cv_var_tzname = yes; then
10656
10657 $as_echo "#define HAVE_TZNAME 1" >>confdefs.h
10658
10659 fi
10660
10661 ac_fn_c_check_type "$LINENO" "union semun" "ac_cv_type_union_semun" "#include <sys/types.h>
10662 #include <sys/ipc.h>
10663 #include <sys/sem.h>
10664 "
10665 if test "x$ac_cv_type_union_semun" = xyes; then :
10666
10667 cat >>confdefs.h <<_ACEOF
10668 #define HAVE_UNION_SEMUN 1
10669 _ACEOF
10670
10671
10672 fi
10673
10674 ac_fn_c_check_type "$LINENO" "struct sockaddr_un" "ac_cv_type_struct_sockaddr_un" "#include <sys/types.h>
10675 #ifdef HAVE_SYS_UN_H
10676 #include <sys/un.h>
10677 #endif
10678
10679 "
10680 if test "x$ac_cv_type_struct_sockaddr_un" = xyes; then :
10681
10682 $as_echo "#define HAVE_UNIX_SOCKETS 1" >>confdefs.h
10683
10684 fi
10685
10686 ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include <sys/types.h>
10687 #ifdef HAVE_SYS_SOCKET_H
10688 #include <sys/socket.h>
10689 #endif
10690
10691 "
10692 if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
10693
10694 cat >>confdefs.h <<_ACEOF
10695 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
10696 _ACEOF
10697
10698
10699 fi
10700
10701 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
10702 #ifdef HAVE_SYS_SOCKET_H
10703 #include <sys/socket.h>
10704 #endif
10705
10706 "
10707 if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
10708
10709 cat >>confdefs.h <<_ACEOF
10710 #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
10711 _ACEOF
10712
10713
10714 fi
10715 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_family" "ac_cv_member_struct_sockaddr_storage___ss_family" "#include <sys/types.h>
10716 #ifdef HAVE_SYS_SOCKET_H
10717 #include <sys/socket.h>
10718 #endif
10719
10720 "
10721 if test "x$ac_cv_member_struct_sockaddr_storage___ss_family" = xyes; then :
10722
10723 cat >>confdefs.h <<_ACEOF
10724 #define HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY 1
10725 _ACEOF
10726
10727
10728 fi
10729 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_len" "ac_cv_member_struct_sockaddr_storage_ss_len" "#include <sys/types.h>
10730 #ifdef HAVE_SYS_SOCKET_H
10731 #include <sys/socket.h>
10732 #endif
10733
10734 "
10735 if test "x$ac_cv_member_struct_sockaddr_storage_ss_len" = xyes; then :
10736
10737 cat >>confdefs.h <<_ACEOF
10738 #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1
10739 _ACEOF
10740
10741
10742 fi
10743 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_len" "ac_cv_member_struct_sockaddr_storage___ss_len" "#include <sys/types.h>
10744 #ifdef HAVE_SYS_SOCKET_H
10745 #include <sys/socket.h>
10746 #endif
10747
10748 "
10749 if test "x$ac_cv_member_struct_sockaddr_storage___ss_len" = xyes; then :
10750
10751 cat >>confdefs.h <<_ACEOF
10752 #define HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN 1
10753 _ACEOF
10754
10755
10756 fi
10757 ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include <sys/types.h>
10758 #ifdef HAVE_SYS_SOCKET_H
10759 #include <sys/socket.h>
10760 #endif
10761
10762 "
10763 if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then :
10764
10765 cat >>confdefs.h <<_ACEOF
10766 #define HAVE_STRUCT_SOCKADDR_SA_LEN 1
10767 _ACEOF
10768
10769
10770 fi
10771
10772 ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "#include <sys/types.h>
10773 #include <sys/socket.h>
10774 #include <netdb.h>
10775
10776 "
10777 if test "x$ac_cv_type_struct_addrinfo" = xyes; then :
10778
10779 cat >>confdefs.h <<_ACEOF
10780 #define HAVE_STRUCT_ADDRINFO 1
10781 _ACEOF
10782
10783
10784 fi
10785
10786
10787   ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
10788 if test "x$ac_cv_type_intptr_t" = xyes; then :
10789
10790 $as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h
10791
10792 else
10793   for ac_type in 'int' 'long int' 'long long int'; do
10794        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10795 /* end confdefs.h.  */
10796 $ac_includes_default
10797 int
10798 main ()
10799 {
10800 static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
10801 test_array [0] = 0;
10802 return test_array [0];
10803
10804   ;
10805   return 0;
10806 }
10807 _ACEOF
10808 if ac_fn_c_try_compile "$LINENO"; then :
10809
10810 cat >>confdefs.h <<_ACEOF
10811 #define intptr_t $ac_type
10812 _ACEOF
10813
10814           ac_type=
10815 fi
10816 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10817        test -z "$ac_type" && break
10818      done
10819 fi
10820
10821
10822
10823   ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
10824 if test "x$ac_cv_type_uintptr_t" = xyes; then :
10825
10826 $as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
10827
10828 else
10829   for ac_type in 'unsigned int' 'unsigned long int' \
10830         'unsigned long long int'; do
10831        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10832 /* end confdefs.h.  */
10833 $ac_includes_default
10834 int
10835 main ()
10836 {
10837 static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
10838 test_array [0] = 0;
10839 return test_array [0];
10840
10841   ;
10842   return 0;
10843 }
10844 _ACEOF
10845 if ac_fn_c_try_compile "$LINENO"; then :
10846
10847 cat >>confdefs.h <<_ACEOF
10848 #define uintptr_t $ac_type
10849 _ACEOF
10850
10851           ac_type=
10852 fi
10853 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10854        test -z "$ac_type" && break
10855      done
10856 fi
10857
10858
10859
10860   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
10861 $as_echo_n "checking for unsigned long long int... " >&6; }
10862 if ${ac_cv_type_unsigned_long_long_int+:} false; then :
10863   $as_echo_n "(cached) " >&6
10864 else
10865   ac_cv_type_unsigned_long_long_int=yes
10866      if test "x${ac_cv_prog_cc_c99-no}" = xno; then
10867        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10868 /* end confdefs.h.  */
10869
10870   /* For now, do not test the preprocessor; as of 2007 there are too many
10871          implementations with broken preprocessors.  Perhaps this can
10872          be revisited in 2012.  In the meantime, code should not expect
10873          #if to work with literals wider than 32 bits.  */
10874       /* Test literals.  */
10875       long long int ll = 9223372036854775807ll;
10876       long long int nll = -9223372036854775807LL;
10877       unsigned long long int ull = 18446744073709551615ULL;
10878       /* Test constant expressions.   */
10879       typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
10880                      ? 1 : -1)];
10881       typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
10882                      ? 1 : -1)];
10883       int i = 63;
10884 int
10885 main ()
10886 {
10887 /* Test availability of runtime routines for shift and division.  */
10888       long long int llmax = 9223372036854775807ll;
10889       unsigned long long int ullmax = 18446744073709551615ull;
10890       return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
10891               | (llmax / ll) | (llmax % ll)
10892               | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
10893               | (ullmax / ull) | (ullmax % ull));
10894   ;
10895   return 0;
10896 }
10897
10898 _ACEOF
10899 if ac_fn_c_try_link "$LINENO"; then :
10900
10901 else
10902   ac_cv_type_unsigned_long_long_int=no
10903 fi
10904 rm -f core conftest.err conftest.$ac_objext \
10905     conftest$ac_exeext conftest.$ac_ext
10906      fi
10907 fi
10908 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
10909 $as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
10910   if test $ac_cv_type_unsigned_long_long_int = yes; then
10911
10912 $as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
10913
10914   fi
10915
10916
10917
10918   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
10919 $as_echo_n "checking for long long int... " >&6; }
10920 if ${ac_cv_type_long_long_int+:} false; then :
10921   $as_echo_n "(cached) " >&6
10922 else
10923   ac_cv_type_long_long_int=yes
10924       if test "x${ac_cv_prog_cc_c99-no}" = xno; then
10925         ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
10926         if test $ac_cv_type_long_long_int = yes; then
10927                                   if test "$cross_compiling" = yes; then :
10928   :
10929 else
10930   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10931 /* end confdefs.h.  */
10932 #include <limits.h>
10933                  #ifndef LLONG_MAX
10934                  # define HALF \
10935                           (1LL << (sizeof (long long int) * CHAR_BIT - 2))
10936                  # define LLONG_MAX (HALF - 1 + HALF)
10937                  #endif
10938 int
10939 main ()
10940 {
10941 long long int n = 1;
10942                  int i;
10943                  for (i = 0; ; i++)
10944                    {
10945                      long long int m = n << i;
10946                      if (m >> i != n)
10947                        return 1;
10948                      if (LLONG_MAX / 2 < m)
10949                        break;
10950                    }
10951                  return 0;
10952   ;
10953   return 0;
10954 }
10955 _ACEOF
10956 if ac_fn_c_try_run "$LINENO"; then :
10957
10958 else
10959   ac_cv_type_long_long_int=no
10960 fi
10961 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
10962   conftest.$ac_objext conftest.beam conftest.$ac_ext
10963 fi
10964
10965         fi
10966       fi
10967 fi
10968 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
10969 $as_echo "$ac_cv_type_long_long_int" >&6; }
10970   if test $ac_cv_type_long_long_int = yes; then
10971
10972 $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
10973
10974   fi
10975
10976
10977 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale_t" >&5
10978 $as_echo_n "checking for locale_t... " >&6; }
10979 if ${pgac_cv_type_locale_t+:} false; then :
10980   $as_echo_n "(cached) " >&6
10981 else
10982   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10983 /* end confdefs.h.  */
10984 #include <locale.h>
10985 locale_t x;
10986 int
10987 main ()
10988 {
10989
10990   ;
10991   return 0;
10992 }
10993 _ACEOF
10994 if ac_fn_c_try_compile "$LINENO"; then :
10995   pgac_cv_type_locale_t=yes
10996 else
10997   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10998 /* end confdefs.h.  */
10999 #include <xlocale.h>
11000 locale_t x;
11001 int
11002 main ()
11003 {
11004
11005   ;
11006   return 0;
11007 }
11008 _ACEOF
11009 if ac_fn_c_try_compile "$LINENO"; then :
11010   pgac_cv_type_locale_t='yes (in xlocale.h)'
11011 else
11012   pgac_cv_type_locale_t=no
11013 fi
11014 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11015 fi
11016 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11017 fi
11018 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_locale_t" >&5
11019 $as_echo "$pgac_cv_type_locale_t" >&6; }
11020 if test "$pgac_cv_type_locale_t" != no; then
11021
11022 $as_echo "#define HAVE_LOCALE_T 1" >>confdefs.h
11023
11024 fi
11025 if test "$pgac_cv_type_locale_t" = 'yes (in xlocale.h)'; then
11026
11027 $as_echo "#define LOCALE_T_IN_XLOCALE 1" >>confdefs.h
11028
11029 fi
11030
11031 ac_fn_c_check_type "$LINENO" "struct cmsgcred" "ac_cv_type_struct_cmsgcred" "#include <sys/socket.h>
11032 #include <sys/param.h>
11033 #ifdef HAVE_SYS_UCRED_H
11034 #include <sys/ucred.h>
11035 #endif
11036 "
11037 if test "x$ac_cv_type_struct_cmsgcred" = xyes; then :
11038
11039 cat >>confdefs.h <<_ACEOF
11040 #define HAVE_STRUCT_CMSGCRED 1
11041 _ACEOF
11042
11043
11044 fi
11045
11046
11047 ac_fn_c_check_type "$LINENO" "struct option" "ac_cv_type_struct_option" "#ifdef HAVE_GETOPT_H
11048 #include <getopt.h>
11049 #endif
11050 "
11051 if test "x$ac_cv_type_struct_option" = xyes; then :
11052
11053 cat >>confdefs.h <<_ACEOF
11054 #define HAVE_STRUCT_OPTION 1
11055 _ACEOF
11056
11057
11058 fi
11059
11060
11061 if test "$with_zlib" = yes; then
11062   # Check that <zlib.h> defines z_streamp (versions before about 1.0.4
11063   # did not).  While we could work around the lack of z_streamp, it
11064   # seems unwise to encourage people to use such old zlib versions...
11065   ac_fn_c_check_type "$LINENO" "z_streamp" "ac_cv_type_z_streamp" "#include <zlib.h>
11066 "
11067 if test "x$ac_cv_type_z_streamp" = xyes; then :
11068
11069 else
11070   as_fn_error $? "zlib version is too old
11071 Use --without-zlib to disable zlib support." "$LINENO" 5
11072 fi
11073
11074 fi
11075
11076 # On PPC, check if assembler supports LWARX instruction's mutex hint bit
11077 case $host_cpu in
11078   ppc*|powerpc*)
11079     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether assembler supports lwarx hint bit" >&5
11080 $as_echo_n "checking whether assembler supports lwarx hint bit... " >&6; }
11081     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11082 /* end confdefs.h.  */
11083
11084 int
11085 main ()
11086 {
11087 int a = 0; int *p = &a; int r;
11088          __asm__ __volatile__ (" lwarx %0,0,%1,1\n" : "=&r"(r) : "r"(p));
11089   ;
11090   return 0;
11091 }
11092 _ACEOF
11093 if ac_fn_c_try_compile "$LINENO"; then :
11094   pgac_cv_have_ppc_mutex_hint=yes
11095 else
11096   pgac_cv_have_ppc_mutex_hint=no
11097 fi
11098 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11099     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_have_ppc_mutex_hint" >&5
11100 $as_echo "$pgac_cv_have_ppc_mutex_hint" >&6; }
11101     if test x"$pgac_cv_have_ppc_mutex_hint" = xyes ; then
11102
11103 $as_echo "#define HAVE_PPC_LWARX_MUTEX_HINT 1" >>confdefs.h
11104
11105     fi
11106   ;;
11107 esac
11108
11109 # Check largefile support.  You might think this is a system service not a
11110 # compiler characteristic, but you'd be wrong.  We must check this before
11111 # probing existence of related functions such as fseeko, since the largefile
11112 # defines can affect what is generated for that.
11113 if test "$PORTNAME" != "win32"; then
11114    # Check whether --enable-largefile was given.
11115 if test "${enable_largefile+set}" = set; then :
11116   enableval=$enable_largefile;
11117 fi
11118
11119 if test "$enable_largefile" != no; then
11120
11121   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
11122 $as_echo_n "checking for special C compiler options needed for large files... " >&6; }
11123 if ${ac_cv_sys_largefile_CC+:} false; then :
11124   $as_echo_n "(cached) " >&6
11125 else
11126   ac_cv_sys_largefile_CC=no
11127      if test "$GCC" != yes; then
11128        ac_save_CC=$CC
11129        while :; do
11130          # IRIX 6.2 and later do not support large files by default,
11131          # so use the C compiler's -n32 option if that helps.
11132          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11133 /* end confdefs.h.  */
11134 #include <sys/types.h>
11135  /* Check that off_t can represent 2**63 - 1 correctly.
11136     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11137     since some C++ compilers masquerading as C compilers
11138     incorrectly reject 9223372036854775807.  */
11139 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11140   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11141                        && LARGE_OFF_T % 2147483647 == 1)
11142                       ? 1 : -1];
11143 int
11144 main ()
11145 {
11146
11147   ;
11148   return 0;
11149 }
11150 _ACEOF
11151          if ac_fn_c_try_compile "$LINENO"; then :
11152   break
11153 fi
11154 rm -f core conftest.err conftest.$ac_objext
11155          CC="$CC -n32"
11156          if ac_fn_c_try_compile "$LINENO"; then :
11157   ac_cv_sys_largefile_CC=' -n32'; break
11158 fi
11159 rm -f core conftest.err conftest.$ac_objext
11160          break
11161        done
11162        CC=$ac_save_CC
11163        rm -f conftest.$ac_ext
11164     fi
11165 fi
11166 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
11167 $as_echo "$ac_cv_sys_largefile_CC" >&6; }
11168   if test "$ac_cv_sys_largefile_CC" != no; then
11169     CC=$CC$ac_cv_sys_largefile_CC
11170   fi
11171
11172   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
11173 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
11174 if ${ac_cv_sys_file_offset_bits+:} false; then :
11175   $as_echo_n "(cached) " >&6
11176 else
11177   while :; do
11178   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11179 /* end confdefs.h.  */
11180 #include <sys/types.h>
11181  /* Check that off_t can represent 2**63 - 1 correctly.
11182     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11183     since some C++ compilers masquerading as C compilers
11184     incorrectly reject 9223372036854775807.  */
11185 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11186   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11187                        && LARGE_OFF_T % 2147483647 == 1)
11188                       ? 1 : -1];
11189 int
11190 main ()
11191 {
11192
11193   ;
11194   return 0;
11195 }
11196 _ACEOF
11197 if ac_fn_c_try_compile "$LINENO"; then :
11198   ac_cv_sys_file_offset_bits=no; break
11199 fi
11200 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11201   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11202 /* end confdefs.h.  */
11203 #define _FILE_OFFSET_BITS 64
11204 #include <sys/types.h>
11205  /* Check that off_t can represent 2**63 - 1 correctly.
11206     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11207     since some C++ compilers masquerading as C compilers
11208     incorrectly reject 9223372036854775807.  */
11209 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11210   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11211                        && LARGE_OFF_T % 2147483647 == 1)
11212                       ? 1 : -1];
11213 int
11214 main ()
11215 {
11216
11217   ;
11218   return 0;
11219 }
11220 _ACEOF
11221 if ac_fn_c_try_compile "$LINENO"; then :
11222   ac_cv_sys_file_offset_bits=64; break
11223 fi
11224 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11225   ac_cv_sys_file_offset_bits=unknown
11226   break
11227 done
11228 fi
11229 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
11230 $as_echo "$ac_cv_sys_file_offset_bits" >&6; }
11231 case $ac_cv_sys_file_offset_bits in #(
11232   no | unknown) ;;
11233   *)
11234 cat >>confdefs.h <<_ACEOF
11235 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
11236 _ACEOF
11237 ;;
11238 esac
11239 rm -rf conftest*
11240   if test $ac_cv_sys_file_offset_bits = unknown; then
11241     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
11242 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
11243 if ${ac_cv_sys_large_files+:} false; then :
11244   $as_echo_n "(cached) " >&6
11245 else
11246   while :; do
11247   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11248 /* end confdefs.h.  */
11249 #include <sys/types.h>
11250  /* Check that off_t can represent 2**63 - 1 correctly.
11251     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11252     since some C++ compilers masquerading as C compilers
11253     incorrectly reject 9223372036854775807.  */
11254 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11255   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11256                        && LARGE_OFF_T % 2147483647 == 1)
11257                       ? 1 : -1];
11258 int
11259 main ()
11260 {
11261
11262   ;
11263   return 0;
11264 }
11265 _ACEOF
11266 if ac_fn_c_try_compile "$LINENO"; then :
11267   ac_cv_sys_large_files=no; break
11268 fi
11269 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11270   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11271 /* end confdefs.h.  */
11272 #define _LARGE_FILES 1
11273 #include <sys/types.h>
11274  /* Check that off_t can represent 2**63 - 1 correctly.
11275     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11276     since some C++ compilers masquerading as C compilers
11277     incorrectly reject 9223372036854775807.  */
11278 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11279   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11280                        && LARGE_OFF_T % 2147483647 == 1)
11281                       ? 1 : -1];
11282 int
11283 main ()
11284 {
11285
11286   ;
11287   return 0;
11288 }
11289 _ACEOF
11290 if ac_fn_c_try_compile "$LINENO"; then :
11291   ac_cv_sys_large_files=1; break
11292 fi
11293 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11294   ac_cv_sys_large_files=unknown
11295   break
11296 done
11297 fi
11298 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
11299 $as_echo "$ac_cv_sys_large_files" >&6; }
11300 case $ac_cv_sys_large_files in #(
11301   no | unknown) ;;
11302   *)
11303 cat >>confdefs.h <<_ACEOF
11304 #define _LARGE_FILES $ac_cv_sys_large_files
11305 _ACEOF
11306 ;;
11307 esac
11308 rm -rf conftest*
11309   fi
11310
11311
11312 fi
11313
11314
11315 fi
11316
11317 # Check for largefile support (must be after AC_SYS_LARGEFILE)
11318 # The cast to long int works around a bug in the HP C Compiler
11319 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
11320 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
11321 # This bug is HP SR number 8606223364.
11322 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
11323 $as_echo_n "checking size of off_t... " >&6; }
11324 if ${ac_cv_sizeof_off_t+:} false; then :
11325   $as_echo_n "(cached) " >&6
11326 else
11327   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t"        "$ac_includes_default"; then :
11328
11329 else
11330   if test "$ac_cv_type_off_t" = yes; then
11331      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
11332 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
11333 as_fn_error 77 "cannot compute sizeof (off_t)
11334 See \`config.log' for more details" "$LINENO" 5; }
11335    else
11336      ac_cv_sizeof_off_t=0
11337    fi
11338 fi
11339
11340 fi
11341 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
11342 $as_echo "$ac_cv_sizeof_off_t" >&6; }
11343
11344
11345
11346 cat >>confdefs.h <<_ACEOF
11347 #define SIZEOF_OFF_T $ac_cv_sizeof_off_t
11348 _ACEOF
11349
11350
11351
11352 # If we don't have largefile support, can't handle segsize >= 2GB.
11353 if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then
11354    as_fn_error $? "Large file support is not enabled. Segment size cannot be larger than 1GB." "$LINENO" 5
11355 fi
11356
11357
11358 ##
11359 ## Functions, global variables
11360 ##
11361
11362 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int timezone" >&5
11363 $as_echo_n "checking for int timezone... " >&6; }
11364 if ${pgac_cv_var_int_timezone+:} false; then :
11365   $as_echo_n "(cached) " >&6
11366 else
11367   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11368 /* end confdefs.h.  */
11369 #include <time.h>
11370 int res;
11371 int
11372 main ()
11373 {
11374 #ifndef __CYGWIN__
11375 res = timezone / 60;
11376 #else
11377 res = _timezone / 60;
11378 #endif
11379   ;
11380   return 0;
11381 }
11382 _ACEOF
11383 if ac_fn_c_try_link "$LINENO"; then :
11384   pgac_cv_var_int_timezone=yes
11385 else
11386   pgac_cv_var_int_timezone=no
11387 fi
11388 rm -f core conftest.err conftest.$ac_objext \
11389     conftest$ac_exeext conftest.$ac_ext
11390 fi
11391 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_timezone" >&5
11392 $as_echo "$pgac_cv_var_int_timezone" >&6; }
11393 if test x"$pgac_cv_var_int_timezone" = xyes ; then
11394
11395 $as_echo "#define HAVE_INT_TIMEZONE 1" >>confdefs.h
11396
11397 fi
11398 { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for accept()" >&5
11399 $as_echo_n "checking types of arguments for accept()... " >&6; }
11400  if ${ac_cv_func_accept_return+:} false; then :
11401   $as_echo_n "(cached) " >&6
11402 else
11403    if ${ac_cv_func_accept_arg1+:} false; then :
11404   $as_echo_n "(cached) " >&6
11405 else
11406     if ${ac_cv_func_accept_arg2+:} false; then :
11407   $as_echo_n "(cached) " >&6
11408 else
11409      if ${ac_cv_func_accept_arg3+:} false; then :
11410   $as_echo_n "(cached) " >&6
11411 else
11412       for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET WSAAPI'; do
11413       for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do
11414        for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
11415         for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
11416          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11417 /* end confdefs.h.  */
11418 #ifdef HAVE_SYS_TYPES_H
11419 #include <sys/types.h>
11420 #endif
11421 #ifdef HAVE_SYS_SOCKET_H
11422 #include <sys/socket.h>
11423 #endif
11424 extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);
11425 _ACEOF
11426 if ac_fn_c_try_compile "$LINENO"; then :
11427   ac_not_found=no; break 4
11428 else
11429   ac_not_found=yes
11430 fi
11431 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11432        done
11433       done
11434      done
11435     done
11436     if test "$ac_not_found" = yes; then
11437       as_fn_error $? "could not determine argument types" "$LINENO" 5
11438     fi
11439     if test "$ac_cv_func_accept_arg3" = "void"; then
11440       ac_cv_func_accept_arg3=int
11441     fi
11442
11443 fi
11444
11445 fi
11446
11447 fi
11448
11449 fi
11450  { $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
11451 $as_echo "$ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&6; }
11452
11453 cat >>confdefs.h <<_ACEOF
11454 #define ACCEPT_TYPE_RETURN $ac_cv_func_accept_return
11455 _ACEOF
11456
11457
11458 cat >>confdefs.h <<_ACEOF
11459 #define ACCEPT_TYPE_ARG1 $ac_cv_func_accept_arg1
11460 _ACEOF
11461
11462
11463 cat >>confdefs.h <<_ACEOF
11464 #define ACCEPT_TYPE_ARG2 $ac_cv_func_accept_arg2
11465 _ACEOF
11466
11467
11468 cat >>confdefs.h <<_ACEOF
11469 #define ACCEPT_TYPE_ARG3 $ac_cv_func_accept_arg3
11470 _ACEOF
11471
11472
11473 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday takes only one argument" >&5
11474 $as_echo_n "checking whether gettimeofday takes only one argument... " >&6; }
11475 if ${pgac_cv_func_gettimeofday_1arg+:} false; then :
11476   $as_echo_n "(cached) " >&6
11477 else
11478   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11479 /* end confdefs.h.  */
11480 #include <sys/time.h>
11481 int
11482 main ()
11483 {
11484 struct timeval *tp;
11485 struct timezone *tzp;
11486 gettimeofday(tp,tzp);
11487   ;
11488   return 0;
11489 }
11490 _ACEOF
11491 if ac_fn_c_try_compile "$LINENO"; then :
11492   pgac_cv_func_gettimeofday_1arg=no
11493 else
11494   pgac_cv_func_gettimeofday_1arg=yes
11495 fi
11496 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11497 fi
11498 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_gettimeofday_1arg" >&5
11499 $as_echo "$pgac_cv_func_gettimeofday_1arg" >&6; }
11500 if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
11501
11502 $as_echo "#define GETTIMEOFDAY_1ARG 1" >>confdefs.h
11503
11504 fi
11505
11506
11507 # Some versions of libedit contain strlcpy(), setproctitle(), and other
11508 # symbols that that library has no business exposing to the world.  Pending
11509 # acquisition of a clue by those developers, ignore libedit (including its
11510 # possible alias of libreadline) while checking for everything else.
11511 LIBS_including_readline="$LIBS"
11512 LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
11513
11514 for ac_func in cbrt dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat pthread_is_threaded_np readlink setproctitle setsid shm_open sigprocmask symlink sync_file_range towlower utime utimes wcstombs wcstombs_l
11515 do :
11516   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
11517 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
11518 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
11519   cat >>confdefs.h <<_ACEOF
11520 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
11521 _ACEOF
11522
11523 fi
11524 done
11525
11526
11527 ac_fn_c_check_func "$LINENO" "fseeko" "ac_cv_func_fseeko"
11528 if test "x$ac_cv_func_fseeko" = xyes; then :
11529   $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
11530
11531 else
11532   case " $LIBOBJS " in
11533   *" fseeko.$ac_objext "* ) ;;
11534   *) LIBOBJS="$LIBOBJS fseeko.$ac_objext"
11535  ;;
11536 esac
11537
11538 fi
11539
11540
11541 case $host_os in
11542         # NetBSD uses a custom fseeko/ftello built on fsetpos/fgetpos
11543         # Mingw uses macros to access Win32 API calls
11544         netbsd*|mingw*)
11545
11546 $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
11547
11548                 ac_cv_func_fseeko=yes;;
11549         *)
11550                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
11551 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
11552 if ${ac_cv_sys_largefile_source+:} false; then :
11553   $as_echo_n "(cached) " >&6
11554 else
11555   while :; do
11556   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11557 /* end confdefs.h.  */
11558 #include <sys/types.h> /* for off_t */
11559      #include <stdio.h>
11560 int
11561 main ()
11562 {
11563 int (*fp) (FILE *, off_t, int) = fseeko;
11564      return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
11565   ;
11566   return 0;
11567 }
11568 _ACEOF
11569 if ac_fn_c_try_link "$LINENO"; then :
11570   ac_cv_sys_largefile_source=no; break
11571 fi
11572 rm -f core conftest.err conftest.$ac_objext \
11573     conftest$ac_exeext conftest.$ac_ext
11574   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11575 /* end confdefs.h.  */
11576 #define _LARGEFILE_SOURCE 1
11577 #include <sys/types.h> /* for off_t */
11578      #include <stdio.h>
11579 int
11580 main ()
11581 {
11582 int (*fp) (FILE *, off_t, int) = fseeko;
11583      return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
11584   ;
11585   return 0;
11586 }
11587 _ACEOF
11588 if ac_fn_c_try_link "$LINENO"; then :
11589   ac_cv_sys_largefile_source=1; break
11590 fi
11591 rm -f core conftest.err conftest.$ac_objext \
11592     conftest$ac_exeext conftest.$ac_ext
11593   ac_cv_sys_largefile_source=unknown
11594   break
11595 done
11596 fi
11597 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
11598 $as_echo "$ac_cv_sys_largefile_source" >&6; }
11599 case $ac_cv_sys_largefile_source in #(
11600   no | unknown) ;;
11601   *)
11602 cat >>confdefs.h <<_ACEOF
11603 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
11604 _ACEOF
11605 ;;
11606 esac
11607 rm -rf conftest*
11608
11609 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
11610 # in glibc 2.1.3, but that breaks too many other things.
11611 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
11612 if test $ac_cv_sys_largefile_source != unknown; then
11613
11614 $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
11615
11616 fi
11617 ;;
11618 esac
11619
11620 # posix_fadvise() is a no-op on Solaris, so don't incur function overhead
11621 # by calling it, 2009-04-02
11622 # http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/posix_fadvise.c
11623 if test "$PORTNAME" != "solaris"; then
11624 for ac_func in posix_fadvise
11625 do :
11626   ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise"
11627 if test "x$ac_cv_func_posix_fadvise" = xyes; then :
11628   cat >>confdefs.h <<_ACEOF
11629 #define HAVE_POSIX_FADVISE 1
11630 _ACEOF
11631
11632 fi
11633 done
11634
11635 ac_fn_c_check_decl "$LINENO" "posix_fadvise" "ac_cv_have_decl_posix_fadvise" "#include <fcntl.h>
11636 "
11637 if test "x$ac_cv_have_decl_posix_fadvise" = xyes; then :
11638   ac_have_decl=1
11639 else
11640   ac_have_decl=0
11641 fi
11642
11643 cat >>confdefs.h <<_ACEOF
11644 #define HAVE_DECL_POSIX_FADVISE $ac_have_decl
11645 _ACEOF
11646
11647 fi
11648
11649 ac_fn_c_check_decl "$LINENO" "fdatasync" "ac_cv_have_decl_fdatasync" "#include <unistd.h>
11650 "
11651 if test "x$ac_cv_have_decl_fdatasync" = xyes; then :
11652   ac_have_decl=1
11653 else
11654   ac_have_decl=0
11655 fi
11656
11657 cat >>confdefs.h <<_ACEOF
11658 #define HAVE_DECL_FDATASYNC $ac_have_decl
11659 _ACEOF
11660
11661 ac_fn_c_check_decl "$LINENO" "strlcat" "ac_cv_have_decl_strlcat" "$ac_includes_default"
11662 if test "x$ac_cv_have_decl_strlcat" = xyes; then :
11663   ac_have_decl=1
11664 else
11665   ac_have_decl=0
11666 fi
11667
11668 cat >>confdefs.h <<_ACEOF
11669 #define HAVE_DECL_STRLCAT $ac_have_decl
11670 _ACEOF
11671 ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" "$ac_includes_default"
11672 if test "x$ac_cv_have_decl_strlcpy" = xyes; then :
11673   ac_have_decl=1
11674 else
11675   ac_have_decl=0
11676 fi
11677
11678 cat >>confdefs.h <<_ACEOF
11679 #define HAVE_DECL_STRLCPY $ac_have_decl
11680 _ACEOF
11681
11682 # This is probably only present on Darwin, but may as well check always
11683 ac_fn_c_check_decl "$LINENO" "F_FULLFSYNC" "ac_cv_have_decl_F_FULLFSYNC" "#include <fcntl.h>
11684 "
11685 if test "x$ac_cv_have_decl_F_FULLFSYNC" = xyes; then :
11686   ac_have_decl=1
11687 else
11688   ac_have_decl=0
11689 fi
11690
11691 cat >>confdefs.h <<_ACEOF
11692 #define HAVE_DECL_F_FULLFSYNC $ac_have_decl
11693 _ACEOF
11694
11695
11696 HAVE_IPV6=no
11697 ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "$ac_includes_default
11698 #include <netinet/in.h>
11699 "
11700 if test "x$ac_cv_type_struct_sockaddr_in6" = xyes; then :
11701
11702 $as_echo "#define HAVE_IPV6 1" >>confdefs.h
11703
11704          HAVE_IPV6=yes
11705 fi
11706
11707
11708
11709 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PS_STRINGS" >&5
11710 $as_echo_n "checking for PS_STRINGS... " >&6; }
11711 if ${pgac_cv_var_PS_STRINGS+:} false; then :
11712   $as_echo_n "(cached) " >&6
11713 else
11714   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11715 /* end confdefs.h.  */
11716 #include <machine/vmparam.h>
11717 #include <sys/exec.h>
11718
11719 int
11720 main ()
11721 {
11722 PS_STRINGS->ps_nargvstr = 1;
11723 PS_STRINGS->ps_argvstr = "foo";
11724   ;
11725   return 0;
11726 }
11727 _ACEOF
11728 if ac_fn_c_try_link "$LINENO"; then :
11729   pgac_cv_var_PS_STRINGS=yes
11730 else
11731   pgac_cv_var_PS_STRINGS=no
11732 fi
11733 rm -f core conftest.err conftest.$ac_objext \
11734     conftest$ac_exeext conftest.$ac_ext
11735 fi
11736 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_PS_STRINGS" >&5
11737 $as_echo "$pgac_cv_var_PS_STRINGS" >&6; }
11738 if test "$pgac_cv_var_PS_STRINGS" = yes ; then
11739
11740 $as_echo "#define HAVE_PS_STRINGS 1" >>confdefs.h
11741
11742 fi
11743
11744
11745 # We use our snprintf.c emulation if either snprintf() or vsnprintf()
11746 # is missing.  Yes, there are machines that have only one.  We may
11747 # also decide to use snprintf.c if snprintf() is present but does not
11748 # have all the features we need --- see below.
11749
11750 if test "$PORTNAME" = "win32"; then
11751   # Win32 gets snprintf.c built unconditionally.
11752   #
11753   # To properly translate all NLS languages strings, we must support the
11754   # *printf() %$ format, which allows *printf() arguments to be selected
11755   # by position in the translated string.
11756   #
11757   # libintl versions < 0.13 use the native *printf() functions, and Win32
11758   # *printf() doesn't understand %$, so we must use our /port versions,
11759   # which do understand %$. libintl versions >= 0.13 include their own
11760   # *printf versions on Win32.  The libintl 0.13 release note text is:
11761   #
11762   #   C format strings with positions, as they arise when a translator
11763   #   needs to reorder a sentence, are now supported on all platforms.
11764   #   On those few platforms (NetBSD and Woe32) for which the native
11765   #   printf()/fprintf()/... functions don't support such format
11766   #   strings, replacements are provided through <libintl.h>.
11767   #
11768   # We could use libintl >= 0.13's *printf() if we were sure that we had
11769   # a litint >= 0.13 at runtime, but seeing that there is no clean way
11770   # to guarantee that, it is best to just use our own, so we are sure to
11771   # get %$ support. In include/port.h we disable the *printf() macros
11772   # that might have been defined by libintl.
11773   #
11774   # We do this unconditionally whether NLS is used or not so we are sure
11775   # that all Win32 libraries and binaries behave the same.
11776   pgac_need_repl_snprintf=yes
11777 else
11778   pgac_need_repl_snprintf=no
11779   for ac_func in snprintf
11780 do :
11781   ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
11782 if test "x$ac_cv_func_snprintf" = xyes; then :
11783   cat >>confdefs.h <<_ACEOF
11784 #define HAVE_SNPRINTF 1
11785 _ACEOF
11786
11787 else
11788   pgac_need_repl_snprintf=yes
11789 fi
11790 done
11791
11792   for ac_func in vsnprintf
11793 do :
11794   ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf"
11795 if test "x$ac_cv_func_vsnprintf" = xyes; then :
11796   cat >>confdefs.h <<_ACEOF
11797 #define HAVE_VSNPRINTF 1
11798 _ACEOF
11799
11800 else
11801   pgac_need_repl_snprintf=yes
11802 fi
11803 done
11804
11805 fi
11806
11807
11808 # Check whether <stdio.h> declares snprintf() and vsnprintf(); if not,
11809 # include/c.h will provide declarations.  Note this is a separate test
11810 # from whether the functions exist in the C library --- there are
11811 # systems that have the functions but don't bother to declare them :-(
11812
11813 ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default"
11814 if test "x$ac_cv_have_decl_snprintf" = xyes; then :
11815   ac_have_decl=1
11816 else
11817   ac_have_decl=0
11818 fi
11819
11820 cat >>confdefs.h <<_ACEOF
11821 #define HAVE_DECL_SNPRINTF $ac_have_decl
11822 _ACEOF
11823 ac_fn_c_check_decl "$LINENO" "vsnprintf" "ac_cv_have_decl_vsnprintf" "$ac_includes_default"
11824 if test "x$ac_cv_have_decl_vsnprintf" = xyes; then :
11825   ac_have_decl=1
11826 else
11827   ac_have_decl=0
11828 fi
11829
11830 cat >>confdefs.h <<_ACEOF
11831 #define HAVE_DECL_VSNPRINTF $ac_have_decl
11832 _ACEOF
11833
11834
11835
11836 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf" >&5
11837 $as_echo_n "checking for isinf... " >&6; }
11838 if ${ac_cv_func_isinf+:} false; then :
11839   $as_echo_n "(cached) " >&6
11840 else
11841   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11842 /* end confdefs.h.  */
11843
11844 #include <math.h>
11845 double glob_double;
11846
11847 int
11848 main ()
11849 {
11850 return isinf(glob_double) ? 0 : 1;
11851   ;
11852   return 0;
11853 }
11854 _ACEOF
11855 if ac_fn_c_try_link "$LINENO"; then :
11856   ac_cv_func_isinf=yes
11857 else
11858   ac_cv_func_isinf=no
11859 fi
11860 rm -f core conftest.err conftest.$ac_objext \
11861     conftest$ac_exeext conftest.$ac_ext
11862 fi
11863 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_isinf" >&5
11864 $as_echo "$ac_cv_func_isinf" >&6; }
11865
11866 if test $ac_cv_func_isinf = yes ; then
11867
11868 $as_echo "#define HAVE_ISINF 1" >>confdefs.h
11869
11870 else
11871   case " $LIBOBJS " in
11872   *" isinf.$ac_objext "* ) ;;
11873   *) LIBOBJS="$LIBOBJS isinf.$ac_objext"
11874  ;;
11875 esac
11876
11877   # Look for a way to implement a substitute for isinf()
11878   for ac_func in fpclass fp_class fp_class_d class
11879 do :
11880   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
11881 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
11882 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
11883   cat >>confdefs.h <<_ACEOF
11884 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
11885 _ACEOF
11886  break
11887 fi
11888 done
11889
11890 fi
11891
11892 ac_fn_c_check_func "$LINENO" "crypt" "ac_cv_func_crypt"
11893 if test "x$ac_cv_func_crypt" = xyes; then :
11894   $as_echo "#define HAVE_CRYPT 1" >>confdefs.h
11895
11896 else
11897   case " $LIBOBJS " in
11898   *" crypt.$ac_objext "* ) ;;
11899   *) LIBOBJS="$LIBOBJS crypt.$ac_objext"
11900  ;;
11901 esac
11902
11903 fi
11904
11905 ac_fn_c_check_func "$LINENO" "fls" "ac_cv_func_fls"
11906 if test "x$ac_cv_func_fls" = xyes; then :
11907   $as_echo "#define HAVE_FLS 1" >>confdefs.h
11908
11909 else
11910   case " $LIBOBJS " in
11911   *" fls.$ac_objext "* ) ;;
11912   *) LIBOBJS="$LIBOBJS fls.$ac_objext"
11913  ;;
11914 esac
11915
11916 fi
11917
11918 ac_fn_c_check_func "$LINENO" "getopt" "ac_cv_func_getopt"
11919 if test "x$ac_cv_func_getopt" = xyes; then :
11920   $as_echo "#define HAVE_GETOPT 1" >>confdefs.h
11921
11922 else
11923   case " $LIBOBJS " in
11924   *" getopt.$ac_objext "* ) ;;
11925   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
11926  ;;
11927 esac
11928
11929 fi
11930
11931 ac_fn_c_check_func "$LINENO" "getrusage" "ac_cv_func_getrusage"
11932 if test "x$ac_cv_func_getrusage" = xyes; then :
11933   $as_echo "#define HAVE_GETRUSAGE 1" >>confdefs.h
11934
11935 else
11936   case " $LIBOBJS " in
11937   *" getrusage.$ac_objext "* ) ;;
11938   *) LIBOBJS="$LIBOBJS getrusage.$ac_objext"
11939  ;;
11940 esac
11941
11942 fi
11943
11944 ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton"
11945 if test "x$ac_cv_func_inet_aton" = xyes; then :
11946   $as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
11947
11948 else
11949   case " $LIBOBJS " in
11950   *" inet_aton.$ac_objext "* ) ;;
11951   *) LIBOBJS="$LIBOBJS inet_aton.$ac_objext"
11952  ;;
11953 esac
11954
11955 fi
11956
11957 ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
11958 if test "x$ac_cv_func_mkdtemp" = xyes; then :
11959   $as_echo "#define HAVE_MKDTEMP 1" >>confdefs.h
11960
11961 else
11962   case " $LIBOBJS " in
11963   *" mkdtemp.$ac_objext "* ) ;;
11964   *) LIBOBJS="$LIBOBJS mkdtemp.$ac_objext"
11965  ;;
11966 esac
11967
11968 fi
11969
11970 ac_fn_c_check_func "$LINENO" "random" "ac_cv_func_random"
11971 if test "x$ac_cv_func_random" = xyes; then :
11972   $as_echo "#define HAVE_RANDOM 1" >>confdefs.h
11973
11974 else
11975   case " $LIBOBJS " in
11976   *" random.$ac_objext "* ) ;;
11977   *) LIBOBJS="$LIBOBJS random.$ac_objext"
11978  ;;
11979 esac
11980
11981 fi
11982
11983 ac_fn_c_check_func "$LINENO" "rint" "ac_cv_func_rint"
11984 if test "x$ac_cv_func_rint" = xyes; then :
11985   $as_echo "#define HAVE_RINT 1" >>confdefs.h
11986
11987 else
11988   case " $LIBOBJS " in
11989   *" rint.$ac_objext "* ) ;;
11990   *) LIBOBJS="$LIBOBJS rint.$ac_objext"
11991  ;;
11992 esac
11993
11994 fi
11995
11996 ac_fn_c_check_func "$LINENO" "srandom" "ac_cv_func_srandom"
11997 if test "x$ac_cv_func_srandom" = xyes; then :
11998   $as_echo "#define HAVE_SRANDOM 1" >>confdefs.h
11999
12000 else
12001   case " $LIBOBJS " in
12002   *" srandom.$ac_objext "* ) ;;
12003   *) LIBOBJS="$LIBOBJS srandom.$ac_objext"
12004  ;;
12005 esac
12006
12007 fi
12008
12009 ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror"
12010 if test "x$ac_cv_func_strerror" = xyes; then :
12011   $as_echo "#define HAVE_STRERROR 1" >>confdefs.h
12012
12013 else
12014   case " $LIBOBJS " in
12015   *" strerror.$ac_objext "* ) ;;
12016   *) LIBOBJS="$LIBOBJS strerror.$ac_objext"
12017  ;;
12018 esac
12019
12020 fi
12021
12022 ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat"
12023 if test "x$ac_cv_func_strlcat" = xyes; then :
12024   $as_echo "#define HAVE_STRLCAT 1" >>confdefs.h
12025
12026 else
12027   case " $LIBOBJS " in
12028   *" strlcat.$ac_objext "* ) ;;
12029   *) LIBOBJS="$LIBOBJS strlcat.$ac_objext"
12030  ;;
12031 esac
12032
12033 fi
12034
12035 ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy"
12036 if test "x$ac_cv_func_strlcpy" = xyes; then :
12037   $as_echo "#define HAVE_STRLCPY 1" >>confdefs.h
12038
12039 else
12040   case " $LIBOBJS " in
12041   *" strlcpy.$ac_objext "* ) ;;
12042   *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext"
12043  ;;
12044 esac
12045
12046 fi
12047
12048
12049
12050 case $host_os in
12051
12052         # Windows uses a specialised env handler
12053         # and doesn't need a replacement getpeereid because it doesn't use
12054         # Unix sockets.
12055         mingw*)
12056
12057 $as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
12058
12059
12060 $as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
12061
12062                 ac_cv_func_unsetenv=yes
12063                 ac_cv_func_getpeereid=yes;;
12064         *)
12065                 ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
12066 if test "x$ac_cv_func_unsetenv" = xyes; then :
12067   $as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
12068
12069 else
12070   case " $LIBOBJS " in
12071   *" unsetenv.$ac_objext "* ) ;;
12072   *) LIBOBJS="$LIBOBJS unsetenv.$ac_objext"
12073  ;;
12074 esac
12075
12076 fi
12077
12078 ac_fn_c_check_func "$LINENO" "getpeereid" "ac_cv_func_getpeereid"
12079 if test "x$ac_cv_func_getpeereid" = xyes; then :
12080   $as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
12081
12082 else
12083   case " $LIBOBJS " in
12084   *" getpeereid.$ac_objext "* ) ;;
12085   *) LIBOBJS="$LIBOBJS getpeereid.$ac_objext"
12086  ;;
12087 esac
12088
12089 fi
12090
12091
12092                 ;;
12093 esac
12094
12095 # System's version of getaddrinfo(), if any, may be used only if we found
12096 # a definition for struct addrinfo; see notes in src/include/getaddrinfo.h.
12097 # We use only our own getaddrinfo.c on Windows, but it's time to revisit that.
12098 if test x"$ac_cv_type_struct_addrinfo" = xyes && \
12099    test "$PORTNAME" != "win32"; then
12100   ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo"
12101 if test "x$ac_cv_func_getaddrinfo" = xyes; then :
12102   $as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
12103
12104 else
12105   case " $LIBOBJS " in
12106   *" getaddrinfo.$ac_objext "* ) ;;
12107   *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext"
12108  ;;
12109 esac
12110
12111 fi
12112
12113
12114 else
12115   case " $LIBOBJS " in
12116   *" getaddrinfo.$ac_objext "* ) ;;
12117   *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext"
12118  ;;
12119 esac
12120
12121 fi
12122
12123 # Similarly, use system's getopt_long() only if system provides struct option.
12124 if test x"$ac_cv_type_struct_option" = xyes ; then
12125   ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long"
12126 if test "x$ac_cv_func_getopt_long" = xyes; then :
12127   $as_echo "#define HAVE_GETOPT_LONG 1" >>confdefs.h
12128
12129 else
12130   case " $LIBOBJS " in
12131   *" getopt_long.$ac_objext "* ) ;;
12132   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
12133  ;;
12134 esac
12135
12136 fi
12137
12138
12139 else
12140   case " $LIBOBJS " in
12141   *" getopt_long.$ac_objext "* ) ;;
12142   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
12143  ;;
12144 esac
12145
12146 fi
12147
12148 # Solaris' getopt() doesn't do what we want for long options, so always use
12149 # our version on that platform.
12150 if test "$PORTNAME" = "solaris"; then
12151   case " $LIBOBJS " in
12152   *" getopt.$ac_objext "* ) ;;
12153   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
12154  ;;
12155 esac
12156
12157 fi
12158
12159 # mingw has adopted a GNU-centric interpretation of optind/optreset,
12160 # so always use our version on Windows.
12161 if test "$PORTNAME" = "win32"; then
12162   case " $LIBOBJS " in
12163   *" getopt.$ac_objext "* ) ;;
12164   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
12165  ;;
12166 esac
12167
12168   case " $LIBOBJS " in
12169   *" getopt_long.$ac_objext "* ) ;;
12170   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
12171  ;;
12172 esac
12173
12174 fi
12175
12176 # Win32 (really MinGW) support
12177 if test "$PORTNAME" = "win32"; then
12178   ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
12179 if test "x$ac_cv_func_gettimeofday" = xyes; then :
12180   $as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
12181
12182 else
12183   case " $LIBOBJS " in
12184   *" gettimeofday.$ac_objext "* ) ;;
12185   *) LIBOBJS="$LIBOBJS gettimeofday.$ac_objext"
12186  ;;
12187 esac
12188
12189 fi
12190
12191
12192   case " $LIBOBJS " in
12193   *" dirmod.$ac_objext "* ) ;;
12194   *) LIBOBJS="$LIBOBJS dirmod.$ac_objext"
12195  ;;
12196 esac
12197
12198   case " $LIBOBJS " in
12199   *" kill.$ac_objext "* ) ;;
12200   *) LIBOBJS="$LIBOBJS kill.$ac_objext"
12201  ;;
12202 esac
12203
12204   case " $LIBOBJS " in
12205   *" open.$ac_objext "* ) ;;
12206   *) LIBOBJS="$LIBOBJS open.$ac_objext"
12207  ;;
12208 esac
12209
12210   case " $LIBOBJS " in
12211   *" system.$ac_objext "* ) ;;
12212   *) LIBOBJS="$LIBOBJS system.$ac_objext"
12213  ;;
12214 esac
12215
12216   case " $LIBOBJS " in
12217   *" win32env.$ac_objext "* ) ;;
12218   *) LIBOBJS="$LIBOBJS win32env.$ac_objext"
12219  ;;
12220 esac
12221
12222   case " $LIBOBJS " in
12223   *" win32error.$ac_objext "* ) ;;
12224   *) LIBOBJS="$LIBOBJS win32error.$ac_objext"
12225  ;;
12226 esac
12227
12228   case " $LIBOBJS " in
12229   *" win32setlocale.$ac_objext "* ) ;;
12230   *) LIBOBJS="$LIBOBJS win32setlocale.$ac_objext"
12231  ;;
12232 esac
12233
12234
12235 $as_echo "#define HAVE_SYMLINK 1" >>confdefs.h
12236
12237   ac_fn_c_check_type "$LINENO" "MINIDUMP_TYPE" "ac_cv_type_MINIDUMP_TYPE" "
12238 #define WIN32_LEAN_AND_MEAN
12239 #include <windows.h>
12240 #include <string.h>
12241 #include <dbghelp.h>
12242 "
12243 if test "x$ac_cv_type_MINIDUMP_TYPE" = xyes; then :
12244
12245 cat >>confdefs.h <<_ACEOF
12246 #define HAVE_MINIDUMP_TYPE 1
12247 _ACEOF
12248
12249 pgac_minidump_type=yes
12250 else
12251   pgac_minidump_type=no
12252 fi
12253
12254 fi
12255 if test x"$pgac_minidump_type" = x"yes" ; then
12256   have_win32_dbghelp=yes
12257
12258 else
12259   have_win32_dbghelp=no
12260
12261 fi
12262
12263 # Cygwin needs only a bit of that
12264 if test "$PORTNAME" = "cygwin"; then
12265   case " $LIBOBJS " in
12266   *" dirmod.$ac_objext "* ) ;;
12267   *) LIBOBJS="$LIBOBJS dirmod.$ac_objext"
12268  ;;
12269 esac
12270
12271 fi
12272
12273 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5
12274 $as_echo_n "checking for sigsetjmp... " >&6; }
12275 if ${pgac_cv_func_sigsetjmp+:} false; then :
12276   $as_echo_n "(cached) " >&6
12277 else
12278   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12279 /* end confdefs.h.  */
12280 #include <setjmp.h>
12281 int
12282 main ()
12283 {
12284 sigjmp_buf x; sigsetjmp(x, 1);
12285   ;
12286   return 0;
12287 }
12288 _ACEOF
12289 if ac_fn_c_try_link "$LINENO"; then :
12290   pgac_cv_func_sigsetjmp=yes
12291 else
12292   pgac_cv_func_sigsetjmp=no
12293 fi
12294 rm -f core conftest.err conftest.$ac_objext \
12295     conftest$ac_exeext conftest.$ac_ext
12296 fi
12297 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_sigsetjmp" >&5
12298 $as_echo "$pgac_cv_func_sigsetjmp" >&6; }
12299 if test x"$pgac_cv_func_sigsetjmp" = x"yes"; then
12300
12301 $as_echo "#define HAVE_SIGSETJMP 1" >>confdefs.h
12302
12303 fi
12304
12305 ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include <signal.h>
12306 /* NetBSD declares sys_siglist in unistd.h.  */
12307 #ifdef HAVE_UNISTD_H
12308 # include <unistd.h>
12309 #endif
12310
12311 "
12312 if test "x$ac_cv_have_decl_sys_siglist" = xyes; then :
12313   ac_have_decl=1
12314 else
12315   ac_have_decl=0
12316 fi
12317
12318 cat >>confdefs.h <<_ACEOF
12319 #define HAVE_DECL_SYS_SIGLIST $ac_have_decl
12320 _ACEOF
12321
12322
12323 ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog"
12324 if test "x$ac_cv_func_syslog" = xyes; then :
12325   ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default"
12326 if test "x$ac_cv_header_syslog_h" = xyes; then :
12327
12328 $as_echo "#define HAVE_SYSLOG 1" >>confdefs.h
12329
12330 fi
12331
12332
12333 fi
12334
12335
12336 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opterr" >&5
12337 $as_echo_n "checking for opterr... " >&6; }
12338 if ${pgac_cv_var_int_opterr+:} false; then :
12339   $as_echo_n "(cached) " >&6
12340 else
12341   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12342 /* end confdefs.h.  */
12343 #include <unistd.h>
12344 int
12345 main ()
12346 {
12347 extern int opterr; opterr = 1;
12348   ;
12349   return 0;
12350 }
12351 _ACEOF
12352 if ac_fn_c_try_link "$LINENO"; then :
12353   pgac_cv_var_int_opterr=yes
12354 else
12355   pgac_cv_var_int_opterr=no
12356 fi
12357 rm -f core conftest.err conftest.$ac_objext \
12358     conftest$ac_exeext conftest.$ac_ext
12359 fi
12360 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_opterr" >&5
12361 $as_echo "$pgac_cv_var_int_opterr" >&6; }
12362 if test x"$pgac_cv_var_int_opterr" = x"yes"; then
12363
12364 $as_echo "#define HAVE_INT_OPTERR 1" >>confdefs.h
12365
12366 fi
12367
12368 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for optreset" >&5
12369 $as_echo_n "checking for optreset... " >&6; }
12370 if ${pgac_cv_var_int_optreset+:} false; then :
12371   $as_echo_n "(cached) " >&6
12372 else
12373   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12374 /* end confdefs.h.  */
12375 #include <unistd.h>
12376 int
12377 main ()
12378 {
12379 extern int optreset; optreset = 1;
12380   ;
12381   return 0;
12382 }
12383 _ACEOF
12384 if ac_fn_c_try_link "$LINENO"; then :
12385   pgac_cv_var_int_optreset=yes
12386 else
12387   pgac_cv_var_int_optreset=no
12388 fi
12389 rm -f core conftest.err conftest.$ac_objext \
12390     conftest$ac_exeext conftest.$ac_ext
12391 fi
12392 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_optreset" >&5
12393 $as_echo "$pgac_cv_var_int_optreset" >&6; }
12394 if test x"$pgac_cv_var_int_optreset" = x"yes"; then
12395
12396 $as_echo "#define HAVE_INT_OPTRESET 1" >>confdefs.h
12397
12398 fi
12399
12400 for ac_func in strtoll strtoq
12401 do :
12402   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
12403 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
12404 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
12405   cat >>confdefs.h <<_ACEOF
12406 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
12407 _ACEOF
12408  break
12409 fi
12410 done
12411
12412 for ac_func in strtoull strtouq
12413 do :
12414   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
12415 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
12416 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
12417   cat >>confdefs.h <<_ACEOF
12418 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
12419 _ACEOF
12420  break
12421 fi
12422 done
12423
12424
12425 # Lastly, restore full LIBS list and check for readline/libedit symbols
12426 LIBS="$LIBS_including_readline"
12427
12428 if test "$with_readline" = yes; then
12429   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_append_character" >&5
12430 $as_echo_n "checking for rl_completion_append_character... " >&6; }
12431 if ${pgac_cv_var_rl_completion_append_character+:} false; then :
12432   $as_echo_n "(cached) " >&6
12433 else
12434   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12435 /* end confdefs.h.  */
12436 #include <stdio.h>
12437 #ifdef HAVE_READLINE_READLINE_H
12438 # include <readline/readline.h>
12439 #elif defined(HAVE_READLINE_H)
12440 # include <readline.h>
12441 #endif
12442
12443 int
12444 main ()
12445 {
12446 rl_completion_append_character = 'x';
12447   ;
12448   return 0;
12449 }
12450 _ACEOF
12451 if ac_fn_c_try_link "$LINENO"; then :
12452   pgac_cv_var_rl_completion_append_character=yes
12453 else
12454   pgac_cv_var_rl_completion_append_character=no
12455 fi
12456 rm -f core conftest.err conftest.$ac_objext \
12457     conftest$ac_exeext conftest.$ac_ext
12458 fi
12459 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_rl_completion_append_character" >&5
12460 $as_echo "$pgac_cv_var_rl_completion_append_character" >&6; }
12461 if test x"$pgac_cv_var_rl_completion_append_character" = x"yes"; then
12462
12463 $as_echo "#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1" >>confdefs.h
12464
12465 fi
12466   for ac_func in rl_completion_matches rl_filename_completion_function
12467 do :
12468   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
12469 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
12470 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
12471   cat >>confdefs.h <<_ACEOF
12472 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
12473 _ACEOF
12474
12475 fi
12476 done
12477
12478   for ac_func in append_history history_truncate_file
12479 do :
12480   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
12481 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
12482 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
12483   cat >>confdefs.h <<_ACEOF
12484 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
12485 _ACEOF
12486
12487 fi
12488 done
12489
12490 fi
12491
12492
12493 #
12494 # Pthreads
12495 #
12496 # For each platform, we need to know about any special compile and link
12497 # libraries, and whether the normal C function names are thread-safe.
12498 # See the comment at the top of src/port/thread.c for more information.
12499 # WIN32 doesn't need the pthread tests;  it always uses threads
12500 if test "$enable_thread_safety" = yes -a "$PORTNAME" != "win32"; then
12501
12502
12503 ac_ext=c
12504 ac_cpp='$CPP $CPPFLAGS'
12505 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
12506 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
12507 ac_compiler_gnu=$ac_cv_c_compiler_gnu
12508
12509 acx_pthread_ok=no
12510
12511 # We used to check for pthread.h first, but this fails if pthread.h
12512 # requires special compiler flags (e.g. on True64 or Sequent).
12513 # It gets checked for in the link test anyway.
12514
12515 # First of all, check if the user has set any of the PTHREAD_LIBS,
12516 # etcetera environment variables, and if threads linking works using
12517 # them:
12518 if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
12519         save_CFLAGS="$CFLAGS"
12520         CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
12521         save_LIBS="$LIBS"
12522         LIBS="$PTHREAD_LIBS $LIBS"
12523         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5
12524 $as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; }
12525         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12526 /* end confdefs.h.  */
12527
12528 /* Override any GCC internal prototype to avoid an error.
12529    Use char because int might match the return type of a GCC
12530    builtin and then its argument prototype would still apply.  */
12531 #ifdef __cplusplus
12532 extern "C"
12533 #endif
12534 char pthread_join ();
12535 int
12536 main ()
12537 {
12538 return pthread_join ();
12539   ;
12540   return 0;
12541 }
12542 _ACEOF
12543 if ac_fn_c_try_link "$LINENO"; then :
12544   acx_pthread_ok=yes
12545 fi
12546 rm -f core conftest.err conftest.$ac_objext \
12547     conftest$ac_exeext conftest.$ac_ext
12548         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5
12549 $as_echo "$acx_pthread_ok" >&6; }
12550         if test x"$acx_pthread_ok" = xno; then
12551                 PTHREAD_LIBS=""
12552                 PTHREAD_CFLAGS=""
12553         fi
12554         LIBS="$save_LIBS"
12555         CFLAGS="$save_CFLAGS"
12556 fi
12557
12558 # We must check for the threads library under a number of different
12559 # names; the ordering is very important because some systems
12560 # (e.g. DEC) have both -lpthread and -lpthreads, where one of the
12561 # libraries is broken (non-POSIX).
12562
12563 # Create a list of thread flags to try.  Items starting with a "-" are
12564 # C compiler flags, and other items are library names, except for "none"
12565 # which indicates that we try without any flags at all, and "pthread-config"
12566 # which is a program returning the flags for the Pth emulation library.
12567
12568 acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config pthreadGC2"
12569
12570 # The ordering *is* (sometimes) important.  Some notes on the
12571 # individual items follow:
12572
12573 # pthreads: AIX (must check this before -lpthread)
12574 # none: in case threads are in libc; should be tried before -Kthread and
12575 #       other compiler flags to prevent continual compiler warnings
12576 # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
12577 # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
12578 # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
12579 # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
12580 # -pthreads: Solaris/gcc
12581 # -mthreads: Mingw32/gcc, Lynx/gcc
12582 # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
12583 #      doesn't hurt to check since this sometimes defines pthreads too;
12584 #      also defines -D_REENTRANT)
12585 # pthread: Linux, etcetera
12586 # --thread-safe: KAI C++
12587 # pthread-config: use pthread-config program (for GNU Pth library)
12588
12589 case "${host_cpu}-${host_os}" in
12590         *solaris*)
12591
12592         # On Solaris (at least, for some versions), libc contains stubbed
12593         # (non-functional) versions of the pthreads routines, so link-based
12594         # tests will erroneously succeed.  (We need to link with -pthread or
12595         # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
12596         # a function called by this macro, so we could check for that, but
12597         # who knows whether they'll stub that too in a future libc.)  So,
12598         # we'll just look for -pthreads and -lpthread first:
12599
12600         acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
12601         ;;
12602 esac
12603
12604 if test x"$acx_pthread_ok" = xno; then
12605 for flag in $acx_pthread_flags; do
12606
12607         tryPTHREAD_CFLAGS=""
12608         tryPTHREAD_LIBS=""
12609         case $flag in
12610                 none)
12611                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
12612 $as_echo_n "checking whether pthreads work without any flags... " >&6; }
12613                 ;;
12614
12615                 -*)
12616                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5
12617 $as_echo_n "checking whether pthreads work with $flag... " >&6; }
12618                 tryPTHREAD_CFLAGS="$flag"
12619                 ;;
12620
12621                 pthread-config)
12622                 # skip this if we already have flags defined, for PostgreSQL
12623                 if test x"$PTHREAD_CFLAGS" != x -o x"$PTHREAD_LIBS" != x; then continue; fi
12624                 # Extract the first word of "pthread-config", so it can be a program name with args.
12625 set dummy pthread-config; ac_word=$2
12626 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12627 $as_echo_n "checking for $ac_word... " >&6; }
12628 if ${ac_cv_prog_acx_pthread_config+:} false; then :
12629   $as_echo_n "(cached) " >&6
12630 else
12631   if test -n "$acx_pthread_config"; then
12632   ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test.
12633 else
12634 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12635 for as_dir in $PATH
12636 do
12637   IFS=$as_save_IFS
12638   test -z "$as_dir" && as_dir=.
12639     for ac_exec_ext in '' $ac_executable_extensions; do
12640   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
12641     ac_cv_prog_acx_pthread_config="yes"
12642     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12643     break 2
12644   fi
12645 done
12646   done
12647 IFS=$as_save_IFS
12648
12649   test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no"
12650 fi
12651 fi
12652 acx_pthread_config=$ac_cv_prog_acx_pthread_config
12653 if test -n "$acx_pthread_config"; then
12654   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_config" >&5
12655 $as_echo "$acx_pthread_config" >&6; }
12656 else
12657   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12658 $as_echo "no" >&6; }
12659 fi
12660
12661
12662                 if test x"$acx_pthread_config" = xno; then continue; fi
12663                 tryPTHREAD_CFLAGS="`pthread-config --cflags`"
12664                 tryPTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
12665                 ;;
12666
12667                 *)
12668                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5
12669 $as_echo_n "checking for the pthreads library -l$flag... " >&6; }
12670                 tryPTHREAD_LIBS="-l$flag"
12671                 ;;
12672         esac
12673
12674         save_LIBS="$LIBS"
12675         save_CFLAGS="$CFLAGS"
12676         LIBS="$tryPTHREAD_LIBS $PTHREAD_LIBS $LIBS"
12677         CFLAGS="$CFLAGS $PTHREAD_CFLAGS $tryPTHREAD_CFLAGS"
12678
12679         # Check for various functions.  We must include pthread.h,
12680         # since some functions may be macros.  (On the Sequent, we
12681         # need a special flag -Kthread to make this header compile.)
12682         # We check for pthread_join because it is in -lpthread on IRIX
12683         # while pthread_create is in libc.  We check for pthread_attr_init
12684         # due to DEC craziness with -lpthreads.  We check for
12685         # pthread_cleanup_push because it is one of the few pthread
12686         # functions on Solaris that doesn't have a non-functional libc stub.
12687         # We try pthread_create on general principles.
12688         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12689 /* end confdefs.h.  */
12690 #include <pthread.h>
12691 int
12692 main ()
12693 {
12694 pthread_t th; pthread_join(th, 0);
12695                      pthread_attr_init(0); pthread_cleanup_push(0, 0);
12696                      pthread_create(0,0,0,0); pthread_cleanup_pop(0);
12697   ;
12698   return 0;
12699 }
12700 _ACEOF
12701 if ac_fn_c_try_link "$LINENO"; then :
12702   acx_pthread_ok=yes
12703 else
12704   acx_pthread_ok=no
12705 fi
12706 rm -f core conftest.err conftest.$ac_objext \
12707     conftest$ac_exeext conftest.$ac_ext
12708
12709         if test "x$acx_pthread_ok" = xyes; then
12710             # Don't use options that are ignored by the compiler.
12711             # We find them by checking stderror.
12712             cat >conftest.$ac_ext <<_ACEOF
12713 int
12714 main (int argc, char **argv)
12715 {
12716   (void) argc;
12717   (void) argv;
12718   return 0;
12719 }
12720 _ACEOF
12721             rm -f conftest.$ac_objext conftest$ac_exeext
12722             # Check both linking and compiling, because they might tolerate different options.
12723             if test "`(eval $ac_link 2>&1 1>&5)`" = "" && test "`(eval $ac_compile 2>&1 1>&5)`" = ""; then
12724                 # The original macro breaks out of the loop at this point,
12725                 # but we continue trying flags because Linux needs -lpthread
12726                 # too to build libpq successfully.  The test above only
12727                 # tests for building binaries, not shared libraries.
12728                 PTHREAD_LIBS=" $tryPTHREAD_LIBS $PTHREAD_LIBS"
12729                 PTHREAD_CFLAGS="$PTHREAD_CFLAGS $tryPTHREAD_CFLAGS"
12730             else   acx_pthread_ok=no
12731             fi
12732         fi
12733
12734         LIBS="$save_LIBS"
12735         CFLAGS="$save_CFLAGS"
12736
12737         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5
12738 $as_echo "$acx_pthread_ok" >&6; }
12739 done
12740 fi
12741
12742 # The original macro has a bunch of other tests here, which we have removed
12743 # because (a) Postgres doesn't need them, and (b) $acx_pthread_ok is not
12744 # meaningful at this point.
12745
12746
12747
12748
12749 ac_ext=c
12750 ac_cpp='$CPP $CPPFLAGS'
12751 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
12752 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
12753 ac_compiler_gnu=$ac_cv_c_compiler_gnu
12754
12755         # set thread flags
12756
12757 # Some platforms use these, so just define them.  They can't hurt if they
12758 # are not supported.  For example, on Solaris -D_POSIX_PTHREAD_SEMANTICS
12759 # enables 5-arg getpwuid_r, among other things.
12760 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
12761
12762 # Check for *_r functions
12763 _CFLAGS="$CFLAGS"
12764 _LIBS="$LIBS"
12765 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
12766 LIBS="$LIBS $PTHREAD_LIBS"
12767
12768 if test "$PORTNAME" != "win32"; then
12769 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
12770 if test "x$ac_cv_header_pthread_h" = xyes; then :
12771
12772 else
12773   as_fn_error $? "
12774 pthread.h not found;  use --disable-thread-safety to disable thread safety" "$LINENO" 5
12775 fi
12776
12777
12778 fi
12779
12780 for ac_func in strerror_r getpwuid_r gethostbyname_r
12781 do :
12782   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
12783 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
12784 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
12785   cat >>confdefs.h <<_ACEOF
12786 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
12787 _ACEOF
12788
12789 fi
12790 done
12791
12792
12793 # Do test here with the proper thread flags
12794 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns int" >&5
12795 $as_echo_n "checking whether strerror_r returns int... " >&6; }
12796 if ${pgac_cv_func_strerror_r_int+:} false; then :
12797   $as_echo_n "(cached) " >&6
12798 else
12799   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12800 /* end confdefs.h.  */
12801 #include <string.h>
12802 int
12803 main ()
12804 {
12805 #ifndef _AIX
12806 int strerror_r(int, char *, size_t);
12807 #else
12808 /* Older AIX has 'int' for the third argument so we don't test the args. */
12809 int strerror_r();
12810 #endif
12811   ;
12812   return 0;
12813 }
12814 _ACEOF
12815 if ac_fn_c_try_compile "$LINENO"; then :
12816   pgac_cv_func_strerror_r_int=yes
12817 else
12818   pgac_cv_func_strerror_r_int=no
12819 fi
12820 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12821 fi
12822 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_strerror_r_int" >&5
12823 $as_echo "$pgac_cv_func_strerror_r_int" >&6; }
12824 if test x"$pgac_cv_func_strerror_r_int" = xyes ; then
12825
12826 $as_echo "#define STRERROR_R_INT 1" >>confdefs.h
12827
12828 fi
12829
12830
12831 CFLAGS="$_CFLAGS"
12832 LIBS="$_LIBS"
12833
12834 else
12835 # do not use values from template file
12836 PTHREAD_CFLAGS=
12837 PTHREAD_LIBS=
12838 fi
12839
12840
12841
12842
12843
12844 # We can test for libldap_r only after we know PTHREAD_LIBS
12845 if test "$with_ldap" = yes ; then
12846   _LIBS="$LIBS"
12847   if test "$PORTNAME" != "win32"; then
12848     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
12849 $as_echo_n "checking for ldap_bind in -lldap... " >&6; }
12850 if ${ac_cv_lib_ldap_ldap_bind+:} false; then :
12851   $as_echo_n "(cached) " >&6
12852 else
12853   ac_check_lib_save_LIBS=$LIBS
12854 LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
12855 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12856 /* end confdefs.h.  */
12857
12858 /* Override any GCC internal prototype to avoid an error.
12859    Use char because int might match the return type of a GCC
12860    builtin and then its argument prototype would still apply.  */
12861 #ifdef __cplusplus
12862 extern "C"
12863 #endif
12864 char ldap_bind ();
12865 int
12866 main ()
12867 {
12868 return ldap_bind ();
12869   ;
12870   return 0;
12871 }
12872 _ACEOF
12873 if ac_fn_c_try_link "$LINENO"; then :
12874   ac_cv_lib_ldap_ldap_bind=yes
12875 else
12876   ac_cv_lib_ldap_ldap_bind=no
12877 fi
12878 rm -f core conftest.err conftest.$ac_objext \
12879     conftest$ac_exeext conftest.$ac_ext
12880 LIBS=$ac_check_lib_save_LIBS
12881 fi
12882 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
12883 $as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
12884 if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
12885   cat >>confdefs.h <<_ACEOF
12886 #define HAVE_LIBLDAP 1
12887 _ACEOF
12888
12889   LIBS="-lldap $LIBS"
12890
12891 else
12892   as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
12893 fi
12894
12895     LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12896     if test "$enable_thread_safety" = yes; then
12897       # on some platforms ldap_r fails to link without PTHREAD_LIBS
12898       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_simple_bind in -lldap_r" >&5
12899 $as_echo_n "checking for ldap_simple_bind in -lldap_r... " >&6; }
12900 if ${ac_cv_lib_ldap_r_ldap_simple_bind+:} false; then :
12901   $as_echo_n "(cached) " >&6
12902 else
12903   ac_check_lib_save_LIBS=$LIBS
12904 LIBS="-lldap_r $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $LIBS"
12905 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12906 /* end confdefs.h.  */
12907
12908 /* Override any GCC internal prototype to avoid an error.
12909    Use char because int might match the return type of a GCC
12910    builtin and then its argument prototype would still apply.  */
12911 #ifdef __cplusplus
12912 extern "C"
12913 #endif
12914 char ldap_simple_bind ();
12915 int
12916 main ()
12917 {
12918 return ldap_simple_bind ();
12919   ;
12920   return 0;
12921 }
12922 _ACEOF
12923 if ac_fn_c_try_link "$LINENO"; then :
12924   ac_cv_lib_ldap_r_ldap_simple_bind=yes
12925 else
12926   ac_cv_lib_ldap_r_ldap_simple_bind=no
12927 fi
12928 rm -f core conftest.err conftest.$ac_objext \
12929     conftest$ac_exeext conftest.$ac_ext
12930 LIBS=$ac_check_lib_save_LIBS
12931 fi
12932 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_r_ldap_simple_bind" >&5
12933 $as_echo "$ac_cv_lib_ldap_r_ldap_simple_bind" >&6; }
12934 if test "x$ac_cv_lib_ldap_r_ldap_simple_bind" = xyes; then :
12935   cat >>confdefs.h <<_ACEOF
12936 #define HAVE_LIBLDAP_R 1
12937 _ACEOF
12938
12939   LIBS="-lldap_r $LIBS"
12940
12941 else
12942   as_fn_error $? "library 'ldap_r' is required for LDAP" "$LINENO" 5
12943 fi
12944
12945       LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS"
12946     else
12947       LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
12948     fi
12949   else
12950     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lwldap32" >&5
12951 $as_echo_n "checking for ldap_bind in -lwldap32... " >&6; }
12952 if ${ac_cv_lib_wldap32_ldap_bind+:} false; then :
12953   $as_echo_n "(cached) " >&6
12954 else
12955   ac_check_lib_save_LIBS=$LIBS
12956 LIBS="-lwldap32  $LIBS"
12957 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12958 /* end confdefs.h.  */
12959
12960 /* Override any GCC internal prototype to avoid an error.
12961    Use char because int might match the return type of a GCC
12962    builtin and then its argument prototype would still apply.  */
12963 #ifdef __cplusplus
12964 extern "C"
12965 #endif
12966 char ldap_bind ();
12967 int
12968 main ()
12969 {
12970 return ldap_bind ();
12971   ;
12972   return 0;
12973 }
12974 _ACEOF
12975 if ac_fn_c_try_link "$LINENO"; then :
12976   ac_cv_lib_wldap32_ldap_bind=yes
12977 else
12978   ac_cv_lib_wldap32_ldap_bind=no
12979 fi
12980 rm -f core conftest.err conftest.$ac_objext \
12981     conftest$ac_exeext conftest.$ac_ext
12982 LIBS=$ac_check_lib_save_LIBS
12983 fi
12984 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wldap32_ldap_bind" >&5
12985 $as_echo "$ac_cv_lib_wldap32_ldap_bind" >&6; }
12986 if test "x$ac_cv_lib_wldap32_ldap_bind" = xyes; then :
12987   cat >>confdefs.h <<_ACEOF
12988 #define HAVE_LIBWLDAP32 1
12989 _ACEOF
12990
12991   LIBS="-lwldap32 $LIBS"
12992
12993 else
12994   as_fn_error $? "library 'wldap32' is required for LDAP" "$LINENO" 5
12995 fi
12996
12997     LDAP_LIBS_FE="-lwldap32"
12998     LDAP_LIBS_BE="-lwldap32"
12999   fi
13000   LIBS="$_LIBS"
13001 fi
13002
13003
13004
13005
13006 # This test makes sure that run tests work at all.  Sometimes a shared
13007 # library is found by the linker, but the runtime linker can't find it.
13008 # This check should come after all modifications of compiler or linker
13009 # variables, and before any other run tests.
13010 { $as_echo "$as_me:${as_lineno-$LINENO}: checking test program" >&5
13011 $as_echo_n "checking test program... " >&6; }
13012 if test "$cross_compiling" = yes; then :
13013   { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling" >&5
13014 $as_echo "cross-compiling" >&6; }
13015 else
13016   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13017 /* end confdefs.h.  */
13018 int main() { return 0; }
13019 _ACEOF
13020 if ac_fn_c_try_run "$LINENO"; then :
13021   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
13022 $as_echo "ok" >&6; }
13023 else
13024   { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
13025 $as_echo "failed" >&6; }
13026 as_fn_error $? "
13027 Could not execute a simple test program.  This may be a problem
13028 related to locating shared libraries.  Check the file 'config.log'
13029 for the exact reason." "$LINENO" 5
13030 fi
13031 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13032   conftest.$ac_objext conftest.beam conftest.$ac_ext
13033 fi
13034
13035
13036 # --------------------
13037 # Run tests below here
13038 # --------------------
13039
13040 # Force use of our snprintf if system's doesn't do arg control
13041 # See comment above at snprintf test for details.
13042 if test "$enable_nls" = yes -a "$pgac_need_repl_snprintf" = no; then
13043   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf supports argument control" >&5
13044 $as_echo_n "checking whether snprintf supports argument control... " >&6; }
13045 if ${pgac_cv_snprintf_arg_control+:} false; then :
13046   $as_echo_n "(cached) " >&6
13047 else
13048   if test "$cross_compiling" = yes; then :
13049   pgac_cv_snprintf_arg_control=cross
13050 else
13051   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13052 /* end confdefs.h.  */
13053 #include <stdio.h>
13054 #include <string.h>
13055
13056 int main()
13057 {
13058   char buf[100];
13059
13060   /* can it swap arguments? */
13061   snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
13062   if (strcmp(buf, "4 3") != 0)
13063     return 1;
13064   return 0;
13065 }
13066 _ACEOF
13067 if ac_fn_c_try_run "$LINENO"; then :
13068   pgac_cv_snprintf_arg_control=yes
13069 else
13070   pgac_cv_snprintf_arg_control=no
13071 fi
13072 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13073   conftest.$ac_objext conftest.beam conftest.$ac_ext
13074 fi
13075
13076
13077 fi
13078 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_arg_control" >&5
13079 $as_echo "$pgac_cv_snprintf_arg_control" >&6; }
13080
13081   if test $pgac_cv_snprintf_arg_control != yes ; then
13082     pgac_need_repl_snprintf=yes
13083   fi
13084 fi
13085
13086
13087
13088
13089 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long int is 64 bits" >&5
13090 $as_echo_n "checking whether long int is 64 bits... " >&6; }
13091 if ${pgac_cv_type_long_int_64+:} false; then :
13092   $as_echo_n "(cached) " >&6
13093 else
13094   if test "$cross_compiling" = yes; then :
13095   # If cross-compiling, check the size reported by the compiler and
13096 # trust that the arithmetic works.
13097 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13098 /* end confdefs.h.  */
13099
13100 int
13101 main ()
13102 {
13103 static int test_array [1 - 2 * !(sizeof(long int) == 8)];
13104 test_array [0] = 0;
13105 return test_array [0];
13106
13107   ;
13108   return 0;
13109 }
13110 _ACEOF
13111 if ac_fn_c_try_compile "$LINENO"; then :
13112   pgac_cv_type_long_int_64=yes
13113 else
13114   pgac_cv_type_long_int_64=no
13115 fi
13116 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13117 else
13118   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13119 /* end confdefs.h.  */
13120 typedef long int ac_int64;
13121
13122 /*
13123  * These are globals to discourage the compiler from folding all the
13124  * arithmetic tests down to compile-time constants.
13125  */
13126 ac_int64 a = 20000001;
13127 ac_int64 b = 40000005;
13128
13129 int does_int64_work()
13130 {
13131   ac_int64 c,d;
13132
13133   if (sizeof(ac_int64) != 8)
13134     return 0;                   /* definitely not the right size */
13135
13136   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
13137   c = a * b;
13138   d = (c + b) / b;
13139   if (d != a+1)
13140     return 0;
13141   return 1;
13142 }
13143 main() {
13144   exit(! does_int64_work());
13145 }
13146 _ACEOF
13147 if ac_fn_c_try_run "$LINENO"; then :
13148   pgac_cv_type_long_int_64=yes
13149 else
13150   pgac_cv_type_long_int_64=no
13151 fi
13152 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13153   conftest.$ac_objext conftest.beam conftest.$ac_ext
13154 fi
13155
13156 fi
13157 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_long_int_64" >&5
13158 $as_echo "$pgac_cv_type_long_int_64" >&6; }
13159
13160 HAVE_LONG_INT_64=$pgac_cv_type_long_int_64
13161 if test x"$pgac_cv_type_long_int_64" = xyes ; then
13162
13163 $as_echo "#define HAVE_LONG_INT_64 1" >>confdefs.h
13164
13165 fi
13166
13167
13168 if test x"$HAVE_LONG_INT_64" = x"yes" ; then
13169   pg_int64_type="long int"
13170 else
13171   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long long int is 64 bits" >&5
13172 $as_echo_n "checking whether long long int is 64 bits... " >&6; }
13173 if ${pgac_cv_type_long_long_int_64+:} false; then :
13174   $as_echo_n "(cached) " >&6
13175 else
13176   if test "$cross_compiling" = yes; then :
13177   # If cross-compiling, check the size reported by the compiler and
13178 # trust that the arithmetic works.
13179 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13180 /* end confdefs.h.  */
13181
13182 int
13183 main ()
13184 {
13185 static int test_array [1 - 2 * !(sizeof(long long int) == 8)];
13186 test_array [0] = 0;
13187 return test_array [0];
13188
13189   ;
13190   return 0;
13191 }
13192 _ACEOF
13193 if ac_fn_c_try_compile "$LINENO"; then :
13194   pgac_cv_type_long_long_int_64=yes
13195 else
13196   pgac_cv_type_long_long_int_64=no
13197 fi
13198 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13199 else
13200   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13201 /* end confdefs.h.  */
13202 typedef long long int ac_int64;
13203
13204 /*
13205  * These are globals to discourage the compiler from folding all the
13206  * arithmetic tests down to compile-time constants.
13207  */
13208 ac_int64 a = 20000001;
13209 ac_int64 b = 40000005;
13210
13211 int does_int64_work()
13212 {
13213   ac_int64 c,d;
13214
13215   if (sizeof(ac_int64) != 8)
13216     return 0;                   /* definitely not the right size */
13217
13218   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
13219   c = a * b;
13220   d = (c + b) / b;
13221   if (d != a+1)
13222     return 0;
13223   return 1;
13224 }
13225 main() {
13226   exit(! does_int64_work());
13227 }
13228 _ACEOF
13229 if ac_fn_c_try_run "$LINENO"; then :
13230   pgac_cv_type_long_long_int_64=yes
13231 else
13232   pgac_cv_type_long_long_int_64=no
13233 fi
13234 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13235   conftest.$ac_objext conftest.beam conftest.$ac_ext
13236 fi
13237
13238 fi
13239 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_long_long_int_64" >&5
13240 $as_echo "$pgac_cv_type_long_long_int_64" >&6; }
13241
13242 HAVE_LONG_LONG_INT_64=$pgac_cv_type_long_long_int_64
13243 if test x"$pgac_cv_type_long_long_int_64" = xyes ; then
13244
13245 $as_echo "#define HAVE_LONG_LONG_INT_64 1" >>confdefs.h
13246
13247 fi
13248
13249   if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then
13250     pg_int64_type="long long int"
13251   else
13252     as_fn_error $? "Cannot find a working 64-bit integer type." "$LINENO" 5
13253   fi
13254 fi
13255
13256
13257 cat >>confdefs.h <<_ACEOF
13258 #define PG_INT64_TYPE $pg_int64_type
13259 _ACEOF
13260
13261
13262
13263 if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then
13264   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13265 /* end confdefs.h.  */
13266
13267 #define INT64CONST(x)  x##LL
13268 long long int foo = INT64CONST(0x1234567890123456);
13269
13270 _ACEOF
13271 if ac_fn_c_try_compile "$LINENO"; then :
13272
13273 $as_echo "#define HAVE_LL_CONSTANTS 1" >>confdefs.h
13274
13275 fi
13276 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13277 fi
13278
13279
13280 # If we found "long int" is 64 bits, assume snprintf handles it.  If
13281 # we found we need to use "long long int", better check.  We cope with
13282 # snprintfs that use %lld, %qd, or %I64d as the format.  If none of these
13283 # work, fall back to our own snprintf emulation (which we know uses %lld).
13284
13285 if test "$HAVE_LONG_LONG_INT_64" = yes ; then
13286   if test $pgac_need_repl_snprintf = no; then
13287     { $as_echo "$as_me:${as_lineno-$LINENO}: checking snprintf length modifier for long long int" >&5
13288 $as_echo_n "checking snprintf length modifier for long long int... " >&6; }
13289 if ${pgac_cv_snprintf_long_long_int_modifier+:} false; then :
13290   $as_echo_n "(cached) " >&6
13291 else
13292   for pgac_modifier in 'll' 'q' 'I64'; do
13293 if test "$cross_compiling" = yes; then :
13294   pgac_cv_snprintf_long_long_int_modifier=cross; break
13295 else
13296   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13297 /* end confdefs.h.  */
13298 #include <stdio.h>
13299 typedef long long int ac_int64;
13300 #define INT64_FORMAT "%${pgac_modifier}d"
13301
13302 ac_int64 a = 20000001;
13303 ac_int64 b = 40000005;
13304
13305 int does_int64_snprintf_work()
13306 {
13307   ac_int64 c;
13308   char buf[100];
13309
13310   if (sizeof(ac_int64) != 8)
13311     return 0;                   /* doesn't look like the right size */
13312
13313   c = a * b;
13314   snprintf(buf, 100, INT64_FORMAT, c);
13315   if (strcmp(buf, "800000140000005") != 0)
13316     return 0;                   /* either multiply or snprintf is busted */
13317   return 1;
13318 }
13319 main() {
13320   exit(! does_int64_snprintf_work());
13321 }
13322 _ACEOF
13323 if ac_fn_c_try_run "$LINENO"; then :
13324   pgac_cv_snprintf_long_long_int_modifier=$pgac_modifier; break
13325 fi
13326 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13327   conftest.$ac_objext conftest.beam conftest.$ac_ext
13328 fi
13329
13330 done
13331 fi
13332
13333 LONG_LONG_INT_MODIFIER=''
13334
13335 case $pgac_cv_snprintf_long_long_int_modifier in
13336   cross) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot test (not on host machine)" >&5
13337 $as_echo "cannot test (not on host machine)" >&6; };;
13338   ?*)    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_long_long_int_modifier" >&5
13339 $as_echo "$pgac_cv_snprintf_long_long_int_modifier" >&6; }
13340          LONG_LONG_INT_MODIFIER=$pgac_cv_snprintf_long_long_int_modifier;;
13341   *)     { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
13342 $as_echo "none" >&6; };;
13343 esac
13344     if test "$LONG_LONG_INT_MODIFIER" = ""; then
13345       # Force usage of our own snprintf, since system snprintf is broken
13346       pgac_need_repl_snprintf=yes
13347       LONG_LONG_INT_MODIFIER='ll'
13348     fi
13349   else
13350     # Here if we previously decided we needed to use our own snprintf
13351     LONG_LONG_INT_MODIFIER='ll'
13352   fi
13353 else
13354   # Here if we are not using 'long long int' at all
13355   LONG_LONG_INT_MODIFIER='l'
13356 fi
13357
13358 INT64_MODIFIER="\"$LONG_LONG_INT_MODIFIER\""
13359
13360
13361 cat >>confdefs.h <<_ACEOF
13362 #define INT64_MODIFIER $INT64_MODIFIER
13363 _ACEOF
13364
13365
13366 # Also force use of our snprintf if the system's doesn't support the %z flag.
13367 if test "$pgac_need_repl_snprintf" = no; then
13368   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf supports the %z modifier" >&5
13369 $as_echo_n "checking whether snprintf supports the %z modifier... " >&6; }
13370 if ${pgac_cv_snprintf_size_t_support+:} false; then :
13371   $as_echo_n "(cached) " >&6
13372 else
13373   if test "$cross_compiling" = yes; then :
13374   pgac_cv_snprintf_size_t_support=cross
13375 else
13376   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13377 /* end confdefs.h.  */
13378 #include <stdio.h>
13379 #include <string.h>
13380
13381 int main()
13382 {
13383   char bufz[100];
13384   char buf64[100];
13385
13386   /*
13387    * Print the largest unsigned number fitting in a size_t using both %zu
13388    * and the previously-determined format for 64-bit integers.  Note that
13389    * we don't run this code unless we know snprintf handles 64-bit ints.
13390    */
13391   bufz[0] = '\0';  /* in case snprintf fails to emit anything */
13392   snprintf(bufz, sizeof(bufz), "%zu", ~((size_t) 0));
13393   snprintf(buf64, sizeof(buf64), "%" INT64_MODIFIER "u",
13394     (unsigned PG_INT64_TYPE) ~((size_t) 0));
13395   if (strcmp(bufz, buf64) != 0)
13396     return 1;
13397   return 0;
13398 }
13399 _ACEOF
13400 if ac_fn_c_try_run "$LINENO"; then :
13401   pgac_cv_snprintf_size_t_support=yes
13402 else
13403   pgac_cv_snprintf_size_t_support=no
13404 fi
13405 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13406   conftest.$ac_objext conftest.beam conftest.$ac_ext
13407 fi
13408
13409
13410 fi
13411 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_size_t_support" >&5
13412 $as_echo "$pgac_cv_snprintf_size_t_support" >&6; }
13413
13414   if test "$pgac_cv_snprintf_size_t_support" != yes; then
13415     pgac_need_repl_snprintf=yes
13416   fi
13417 fi
13418
13419 # Now we have checked all the reasons to replace snprintf
13420 if test $pgac_need_repl_snprintf = yes; then
13421
13422 $as_echo "#define USE_REPL_SNPRINTF 1" >>confdefs.h
13423
13424   case " $LIBOBJS " in
13425   *" snprintf.$ac_objext "* ) ;;
13426   *) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
13427  ;;
13428 esac
13429
13430 fi
13431
13432 # Check size of void *, size_t (enables tweaks for > 32bit address space)
13433 # The cast to long int works around a bug in the HP C Compiler
13434 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
13435 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
13436 # This bug is HP SR number 8606223364.
13437 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
13438 $as_echo_n "checking size of void *... " >&6; }
13439 if ${ac_cv_sizeof_void_p+:} false; then :
13440   $as_echo_n "(cached) " >&6
13441 else
13442   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p"        "$ac_includes_default"; then :
13443
13444 else
13445   if test "$ac_cv_type_void_p" = yes; then
13446      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13447 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13448 as_fn_error 77 "cannot compute sizeof (void *)
13449 See \`config.log' for more details" "$LINENO" 5; }
13450    else
13451      ac_cv_sizeof_void_p=0
13452    fi
13453 fi
13454
13455 fi
13456 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
13457 $as_echo "$ac_cv_sizeof_void_p" >&6; }
13458
13459
13460
13461 cat >>confdefs.h <<_ACEOF
13462 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
13463 _ACEOF
13464
13465
13466 # The cast to long int works around a bug in the HP C Compiler
13467 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
13468 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
13469 # This bug is HP SR number 8606223364.
13470 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
13471 $as_echo_n "checking size of size_t... " >&6; }
13472 if ${ac_cv_sizeof_size_t+:} false; then :
13473   $as_echo_n "(cached) " >&6
13474 else
13475   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t"        "$ac_includes_default"; then :
13476
13477 else
13478   if test "$ac_cv_type_size_t" = yes; then
13479      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13480 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13481 as_fn_error 77 "cannot compute sizeof (size_t)
13482 See \`config.log' for more details" "$LINENO" 5; }
13483    else
13484      ac_cv_sizeof_size_t=0
13485    fi
13486 fi
13487
13488 fi
13489 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
13490 $as_echo "$ac_cv_sizeof_size_t" >&6; }
13491
13492
13493
13494 cat >>confdefs.h <<_ACEOF
13495 #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
13496 _ACEOF
13497
13498
13499 # The cast to long int works around a bug in the HP C Compiler
13500 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
13501 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
13502 # This bug is HP SR number 8606223364.
13503 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
13504 $as_echo_n "checking size of long... " >&6; }
13505 if ${ac_cv_sizeof_long+:} false; then :
13506   $as_echo_n "(cached) " >&6
13507 else
13508   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long"        "$ac_includes_default"; then :
13509
13510 else
13511   if test "$ac_cv_type_long" = yes; then
13512      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13513 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13514 as_fn_error 77 "cannot compute sizeof (long)
13515 See \`config.log' for more details" "$LINENO" 5; }
13516    else
13517      ac_cv_sizeof_long=0
13518    fi
13519 fi
13520
13521 fi
13522 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
13523 $as_echo "$ac_cv_sizeof_long" >&6; }
13524
13525
13526
13527 cat >>confdefs.h <<_ACEOF
13528 #define SIZEOF_LONG $ac_cv_sizeof_long
13529 _ACEOF
13530
13531
13532
13533 # Decide whether float4 is passed by value: user-selectable, enabled by default
13534 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float4 passed by value" >&5
13535 $as_echo_n "checking whether to build with float4 passed by value... " >&6; }
13536
13537
13538 # Check whether --enable-float4-byval was given.
13539 if test "${enable_float4_byval+set}" = set; then :
13540   enableval=$enable_float4_byval;
13541   case $enableval in
13542     yes)
13543
13544 $as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
13545
13546                float4passbyval=true
13547       ;;
13548     no)
13549       float4passbyval=false
13550       ;;
13551     *)
13552       as_fn_error $? "no argument expected for --enable-float4-byval option" "$LINENO" 5
13553       ;;
13554   esac
13555
13556 else
13557   enable_float4_byval=yes
13558
13559 $as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
13560
13561                float4passbyval=true
13562 fi
13563
13564
13565 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float4_byval" >&5
13566 $as_echo "$enable_float4_byval" >&6; }
13567
13568 cat >>confdefs.h <<_ACEOF
13569 #define FLOAT4PASSBYVAL $float4passbyval
13570 _ACEOF
13571
13572
13573 # Decide whether float8 is passed by value.
13574 # Note: this setting also controls int8 and related types such as timestamp.
13575 # If sizeof(Datum) >= 8, this is user-selectable, enabled by default.
13576 # If not, trying to select it is an error.
13577 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float8 passed by value" >&5
13578 $as_echo_n "checking whether to build with float8 passed by value... " >&6; }
13579 if test $ac_cv_sizeof_void_p -ge 8 ; then
13580
13581
13582 # Check whether --enable-float8-byval was given.
13583 if test "${enable_float8_byval+set}" = set; then :
13584   enableval=$enable_float8_byval;
13585   case $enableval in
13586     yes)
13587       :
13588       ;;
13589     no)
13590       :
13591       ;;
13592     *)
13593       as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5
13594       ;;
13595   esac
13596
13597 else
13598   enable_float8_byval=yes
13599
13600 fi
13601
13602
13603 else
13604
13605
13606 # Check whether --enable-float8-byval was given.
13607 if test "${enable_float8_byval+set}" = set; then :
13608   enableval=$enable_float8_byval;
13609   case $enableval in
13610     yes)
13611       :
13612       ;;
13613     no)
13614       :
13615       ;;
13616     *)
13617       as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5
13618       ;;
13619   esac
13620
13621 else
13622   enable_float8_byval=no
13623
13624 fi
13625
13626
13627   if test "$enable_float8_byval" = yes ; then
13628     as_fn_error $? "--enable-float8-byval is not supported on 32-bit platforms." "$LINENO" 5
13629   fi
13630 fi
13631 if test "$enable_float8_byval" = yes ; then
13632
13633 $as_echo "#define USE_FLOAT8_BYVAL 1" >>confdefs.h
13634
13635   float8passbyval=true
13636 else
13637   float8passbyval=false
13638 fi
13639 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float8_byval" >&5
13640 $as_echo "$enable_float8_byval" >&6; }
13641
13642 cat >>confdefs.h <<_ACEOF
13643 #define FLOAT8PASSBYVAL $float8passbyval
13644 _ACEOF
13645
13646
13647 # Determine memory alignment requirements for the basic C data types.
13648
13649 # The cast to long int works around a bug in the HP C Compiler,
13650 # see AC_CHECK_SIZEOF for more information.
13651 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of short" >&5
13652 $as_echo_n "checking alignment of short... " >&6; }
13653 if ${ac_cv_alignof_short+:} false; then :
13654   $as_echo_n "(cached) " >&6
13655 else
13656   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_short"        "$ac_includes_default
13657 #ifndef offsetof
13658 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
13659 #endif
13660 typedef struct { char x; short y; } ac__type_alignof_;"; then :
13661
13662 else
13663   if test "$ac_cv_type_short" = yes; then
13664      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13665 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13666 as_fn_error 77 "cannot compute alignment of short
13667 See \`config.log' for more details" "$LINENO" 5; }
13668    else
13669      ac_cv_alignof_short=0
13670    fi
13671 fi
13672
13673 fi
13674 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_short" >&5
13675 $as_echo "$ac_cv_alignof_short" >&6; }
13676
13677
13678
13679 cat >>confdefs.h <<_ACEOF
13680 #define ALIGNOF_SHORT $ac_cv_alignof_short
13681 _ACEOF
13682
13683
13684 # The cast to long int works around a bug in the HP C Compiler,
13685 # see AC_CHECK_SIZEOF for more information.
13686 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of int" >&5
13687 $as_echo_n "checking alignment of int... " >&6; }
13688 if ${ac_cv_alignof_int+:} false; then :
13689   $as_echo_n "(cached) " >&6
13690 else
13691   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_int"        "$ac_includes_default
13692 #ifndef offsetof
13693 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
13694 #endif
13695 typedef struct { char x; int y; } ac__type_alignof_;"; then :
13696
13697 else
13698   if test "$ac_cv_type_int" = yes; then
13699      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13700 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13701 as_fn_error 77 "cannot compute alignment of int
13702 See \`config.log' for more details" "$LINENO" 5; }
13703    else
13704      ac_cv_alignof_int=0
13705    fi
13706 fi
13707
13708 fi
13709 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_int" >&5
13710 $as_echo "$ac_cv_alignof_int" >&6; }
13711
13712
13713
13714 cat >>confdefs.h <<_ACEOF
13715 #define ALIGNOF_INT $ac_cv_alignof_int
13716 _ACEOF
13717
13718
13719 # The cast to long int works around a bug in the HP C Compiler,
13720 # see AC_CHECK_SIZEOF for more information.
13721 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of long" >&5
13722 $as_echo_n "checking alignment of long... " >&6; }
13723 if ${ac_cv_alignof_long+:} false; then :
13724   $as_echo_n "(cached) " >&6
13725 else
13726   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long"        "$ac_includes_default
13727 #ifndef offsetof
13728 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
13729 #endif
13730 typedef struct { char x; long y; } ac__type_alignof_;"; then :
13731
13732 else
13733   if test "$ac_cv_type_long" = yes; then
13734      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13735 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13736 as_fn_error 77 "cannot compute alignment of long
13737 See \`config.log' for more details" "$LINENO" 5; }
13738    else
13739      ac_cv_alignof_long=0
13740    fi
13741 fi
13742
13743 fi
13744 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long" >&5
13745 $as_echo "$ac_cv_alignof_long" >&6; }
13746
13747
13748
13749 cat >>confdefs.h <<_ACEOF
13750 #define ALIGNOF_LONG $ac_cv_alignof_long
13751 _ACEOF
13752
13753
13754 if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then
13755   # The cast to long int works around a bug in the HP C Compiler,
13756 # see AC_CHECK_SIZEOF for more information.
13757 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of long long int" >&5
13758 $as_echo_n "checking alignment of long long int... " >&6; }
13759 if ${ac_cv_alignof_long_long_int+:} false; then :
13760   $as_echo_n "(cached) " >&6
13761 else
13762   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long_long_int"        "$ac_includes_default
13763 #ifndef offsetof
13764 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
13765 #endif
13766 typedef struct { char x; long long int y; } ac__type_alignof_;"; then :
13767
13768 else
13769   if test "$ac_cv_type_long_long_int" = yes; then
13770      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13771 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13772 as_fn_error 77 "cannot compute alignment of long long int
13773 See \`config.log' for more details" "$LINENO" 5; }
13774    else
13775      ac_cv_alignof_long_long_int=0
13776    fi
13777 fi
13778
13779 fi
13780 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long_long_int" >&5
13781 $as_echo "$ac_cv_alignof_long_long_int" >&6; }
13782
13783
13784
13785 cat >>confdefs.h <<_ACEOF
13786 #define ALIGNOF_LONG_LONG_INT $ac_cv_alignof_long_long_int
13787 _ACEOF
13788
13789
13790 fi
13791 # The cast to long int works around a bug in the HP C Compiler,
13792 # see AC_CHECK_SIZEOF for more information.
13793 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of double" >&5
13794 $as_echo_n "checking alignment of double... " >&6; }
13795 if ${ac_cv_alignof_double+:} false; then :
13796   $as_echo_n "(cached) " >&6
13797 else
13798   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_double"        "$ac_includes_default
13799 #ifndef offsetof
13800 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
13801 #endif
13802 typedef struct { char x; double y; } ac__type_alignof_;"; then :
13803
13804 else
13805   if test "$ac_cv_type_double" = yes; then
13806      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13807 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13808 as_fn_error 77 "cannot compute alignment of double
13809 See \`config.log' for more details" "$LINENO" 5; }
13810    else
13811      ac_cv_alignof_double=0
13812    fi
13813 fi
13814
13815 fi
13816 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_double" >&5
13817 $as_echo "$ac_cv_alignof_double" >&6; }
13818
13819
13820
13821 cat >>confdefs.h <<_ACEOF
13822 #define ALIGNOF_DOUBLE $ac_cv_alignof_double
13823 _ACEOF
13824
13825
13826
13827 # Compute maximum alignment of any basic type.
13828 # We assume long's alignment is at least as strong as char, short, or int;
13829 # but we must check long long (if it exists) and double.
13830
13831 MAX_ALIGNOF=$ac_cv_alignof_long
13832 if test $MAX_ALIGNOF -lt $ac_cv_alignof_double ; then
13833   MAX_ALIGNOF=$ac_cv_alignof_double
13834 fi
13835 if test x"$HAVE_LONG_LONG_INT_64" = xyes && test $MAX_ALIGNOF -lt $ac_cv_alignof_long_long_int ; then
13836   MAX_ALIGNOF="$ac_cv_alignof_long_long_int"
13837 fi
13838
13839 cat >>confdefs.h <<_ACEOF
13840 #define MAXIMUM_ALIGNOF $MAX_ALIGNOF
13841 _ACEOF
13842
13843
13844
13845 # Some platforms predefine the types int8, int16, etc.  Only check
13846 # a (hopefully) representative subset.
13847 ac_fn_c_check_type "$LINENO" "int8" "ac_cv_type_int8" "#include <stdio.h>
13848 "
13849 if test "x$ac_cv_type_int8" = xyes; then :
13850
13851 cat >>confdefs.h <<_ACEOF
13852 #define HAVE_INT8 1
13853 _ACEOF
13854
13855
13856 fi
13857 ac_fn_c_check_type "$LINENO" "uint8" "ac_cv_type_uint8" "#include <stdio.h>
13858 "
13859 if test "x$ac_cv_type_uint8" = xyes; then :
13860
13861 cat >>confdefs.h <<_ACEOF
13862 #define HAVE_UINT8 1
13863 _ACEOF
13864
13865
13866 fi
13867 ac_fn_c_check_type "$LINENO" "int64" "ac_cv_type_int64" "#include <stdio.h>
13868 "
13869 if test "x$ac_cv_type_int64" = xyes; then :
13870
13871 cat >>confdefs.h <<_ACEOF
13872 #define HAVE_INT64 1
13873 _ACEOF
13874
13875
13876 fi
13877 ac_fn_c_check_type "$LINENO" "uint64" "ac_cv_type_uint64" "#include <stdio.h>
13878 "
13879 if test "x$ac_cv_type_uint64" = xyes; then :
13880
13881 cat >>confdefs.h <<_ACEOF
13882 #define HAVE_UINT64 1
13883 _ACEOF
13884
13885
13886 fi
13887
13888
13889 # We also check for sig_atomic_t, which *should* be defined per ANSI
13890 # C, but is missing on some old platforms.
13891 ac_fn_c_check_type "$LINENO" "sig_atomic_t" "ac_cv_type_sig_atomic_t" "#include <signal.h>
13892 "
13893 if test "x$ac_cv_type_sig_atomic_t" = xyes; then :
13894
13895 cat >>confdefs.h <<_ACEOF
13896 #define HAVE_SIG_ATOMIC_T 1
13897 _ACEOF
13898
13899
13900 fi
13901
13902
13903 # Check for extensions offering the integer scalar type __int128.
13904 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __int128" >&5
13905 $as_echo_n "checking for __int128... " >&6; }
13906 if ${pgac_cv__128bit_int+:} false; then :
13907   $as_echo_n "(cached) " >&6
13908 else
13909   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13910 /* end confdefs.h.  */
13911
13912 /*
13913  * These are globals to discourage the compiler from folding all the
13914  * arithmetic tests down to compile-time constants.  We do not have
13915  * convenient support for 64bit literals at this point...
13916  */
13917 __int128 a = 48828125;
13918 __int128 b = 97656255;
13919
13920 int
13921 main ()
13922 {
13923
13924 __int128 c,d;
13925 a = (a << 12) + 1; /* 200000000001 */
13926 b = (b << 12) + 5; /* 400000000005 */
13927 /* use the most relevant arithmetic ops */
13928 c = a * b;
13929 d = (c + b) / b;
13930 /* return different values, to prevent optimizations */
13931 if (d != a+1)
13932   return 0;
13933 return 1;
13934
13935   ;
13936   return 0;
13937 }
13938 _ACEOF
13939 if ac_fn_c_try_link "$LINENO"; then :
13940   pgac_cv__128bit_int=yes
13941 else
13942   pgac_cv__128bit_int=no
13943 fi
13944 rm -f core conftest.err conftest.$ac_objext \
13945     conftest$ac_exeext conftest.$ac_ext
13946 fi
13947 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__128bit_int" >&5
13948 $as_echo "$pgac_cv__128bit_int" >&6; }
13949 if test x"$pgac_cv__128bit_int" = xyes ; then
13950
13951 $as_echo "#define PG_INT128_TYPE __int128" >>confdefs.h
13952
13953 fi
13954
13955 # Check for various atomic operations now that we have checked how to declare
13956 # 64bit integers.
13957 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync char locking functions" >&5
13958 $as_echo_n "checking for builtin __sync char locking functions... " >&6; }
13959 if ${pgac_cv_gcc_sync_char_tas+:} false; then :
13960   $as_echo_n "(cached) " >&6
13961 else
13962   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13963 /* end confdefs.h.  */
13964
13965 int
13966 main ()
13967 {
13968 char lock = 0;
13969    __sync_lock_test_and_set(&lock, 1);
13970    __sync_lock_release(&lock);
13971   ;
13972   return 0;
13973 }
13974 _ACEOF
13975 if ac_fn_c_try_link "$LINENO"; then :
13976   pgac_cv_gcc_sync_char_tas="yes"
13977 else
13978   pgac_cv_gcc_sync_char_tas="no"
13979 fi
13980 rm -f core conftest.err conftest.$ac_objext \
13981     conftest$ac_exeext conftest.$ac_ext
13982 fi
13983 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_char_tas" >&5
13984 $as_echo "$pgac_cv_gcc_sync_char_tas" >&6; }
13985 if test x"$pgac_cv_gcc_sync_char_tas" = x"yes"; then
13986
13987 $as_echo "#define HAVE_GCC__SYNC_CHAR_TAS 1" >>confdefs.h
13988
13989 fi
13990 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int32 locking functions" >&5
13991 $as_echo_n "checking for builtin __sync int32 locking functions... " >&6; }
13992 if ${pgac_cv_gcc_sync_int32_tas+:} false; then :
13993   $as_echo_n "(cached) " >&6
13994 else
13995   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13996 /* end confdefs.h.  */
13997
13998 int
13999 main ()
14000 {
14001 int lock = 0;
14002    __sync_lock_test_and_set(&lock, 1);
14003    __sync_lock_release(&lock);
14004   ;
14005   return 0;
14006 }
14007 _ACEOF
14008 if ac_fn_c_try_link "$LINENO"; then :
14009   pgac_cv_gcc_sync_int32_tas="yes"
14010 else
14011   pgac_cv_gcc_sync_int32_tas="no"
14012 fi
14013 rm -f core conftest.err conftest.$ac_objext \
14014     conftest$ac_exeext conftest.$ac_ext
14015 fi
14016 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int32_tas" >&5
14017 $as_echo "$pgac_cv_gcc_sync_int32_tas" >&6; }
14018 if test x"$pgac_cv_gcc_sync_int32_tas" = x"yes"; then
14019
14020 $as_echo "#define HAVE_GCC__SYNC_INT32_TAS 1" >>confdefs.h
14021
14022 fi
14023 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int32 atomic operations" >&5
14024 $as_echo_n "checking for builtin __sync int32 atomic operations... " >&6; }
14025 if ${pgac_cv_gcc_sync_int32_cas+:} false; then :
14026   $as_echo_n "(cached) " >&6
14027 else
14028   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14029 /* end confdefs.h.  */
14030
14031 int
14032 main ()
14033 {
14034 int val = 0;
14035    __sync_val_compare_and_swap(&val, 0, 37);
14036   ;
14037   return 0;
14038 }
14039 _ACEOF
14040 if ac_fn_c_try_link "$LINENO"; then :
14041   pgac_cv_gcc_sync_int32_cas="yes"
14042 else
14043   pgac_cv_gcc_sync_int32_cas="no"
14044 fi
14045 rm -f core conftest.err conftest.$ac_objext \
14046     conftest$ac_exeext conftest.$ac_ext
14047 fi
14048 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int32_cas" >&5
14049 $as_echo "$pgac_cv_gcc_sync_int32_cas" >&6; }
14050 if test x"$pgac_cv_gcc_sync_int32_cas" = x"yes"; then
14051
14052 $as_echo "#define HAVE_GCC__SYNC_INT32_CAS 1" >>confdefs.h
14053
14054 fi
14055 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int64 atomic operations" >&5
14056 $as_echo_n "checking for builtin __sync int64 atomic operations... " >&6; }
14057 if ${pgac_cv_gcc_sync_int64_cas+:} false; then :
14058   $as_echo_n "(cached) " >&6
14059 else
14060   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14061 /* end confdefs.h.  */
14062
14063 int
14064 main ()
14065 {
14066 PG_INT64_TYPE lock = 0;
14067    __sync_val_compare_and_swap(&lock, 0, (PG_INT64_TYPE) 37);
14068   ;
14069   return 0;
14070 }
14071 _ACEOF
14072 if ac_fn_c_try_link "$LINENO"; then :
14073   pgac_cv_gcc_sync_int64_cas="yes"
14074 else
14075   pgac_cv_gcc_sync_int64_cas="no"
14076 fi
14077 rm -f core conftest.err conftest.$ac_objext \
14078     conftest$ac_exeext conftest.$ac_ext
14079 fi
14080 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int64_cas" >&5
14081 $as_echo "$pgac_cv_gcc_sync_int64_cas" >&6; }
14082 if test x"$pgac_cv_gcc_sync_int64_cas" = x"yes"; then
14083
14084 $as_echo "#define HAVE_GCC__SYNC_INT64_CAS 1" >>confdefs.h
14085
14086 fi
14087 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic int32 atomic operations" >&5
14088 $as_echo_n "checking for builtin __atomic int32 atomic operations... " >&6; }
14089 if ${pgac_cv_gcc_atomic_int32_cas+:} false; then :
14090   $as_echo_n "(cached) " >&6
14091 else
14092   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14093 /* end confdefs.h.  */
14094
14095 int
14096 main ()
14097 {
14098 int val = 0;
14099    int expect = 0;
14100    __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
14101   ;
14102   return 0;
14103 }
14104 _ACEOF
14105 if ac_fn_c_try_link "$LINENO"; then :
14106   pgac_cv_gcc_atomic_int32_cas="yes"
14107 else
14108   pgac_cv_gcc_atomic_int32_cas="no"
14109 fi
14110 rm -f core conftest.err conftest.$ac_objext \
14111     conftest$ac_exeext conftest.$ac_ext
14112 fi
14113 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_atomic_int32_cas" >&5
14114 $as_echo "$pgac_cv_gcc_atomic_int32_cas" >&6; }
14115 if test x"$pgac_cv_gcc_atomic_int32_cas" = x"yes"; then
14116
14117 $as_echo "#define HAVE_GCC__ATOMIC_INT32_CAS 1" >>confdefs.h
14118
14119 fi
14120 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic int64 atomic operations" >&5
14121 $as_echo_n "checking for builtin __atomic int64 atomic operations... " >&6; }
14122 if ${pgac_cv_gcc_atomic_int64_cas+:} false; then :
14123   $as_echo_n "(cached) " >&6
14124 else
14125   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14126 /* end confdefs.h.  */
14127
14128 int
14129 main ()
14130 {
14131 PG_INT64_TYPE val = 0;
14132    PG_INT64_TYPE expect = 0;
14133    __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
14134   ;
14135   return 0;
14136 }
14137 _ACEOF
14138 if ac_fn_c_try_link "$LINENO"; then :
14139   pgac_cv_gcc_atomic_int64_cas="yes"
14140 else
14141   pgac_cv_gcc_atomic_int64_cas="no"
14142 fi
14143 rm -f core conftest.err conftest.$ac_objext \
14144     conftest$ac_exeext conftest.$ac_ext
14145 fi
14146 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_atomic_int64_cas" >&5
14147 $as_echo "$pgac_cv_gcc_atomic_int64_cas" >&6; }
14148 if test x"$pgac_cv_gcc_atomic_int64_cas" = x"yes"; then
14149
14150 $as_echo "#define HAVE_GCC__ATOMIC_INT64_CAS 1" >>confdefs.h
14151
14152 fi
14153
14154
14155 # Check for x86 cpuid instruction
14156 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __get_cpuid" >&5
14157 $as_echo_n "checking for __get_cpuid... " >&6; }
14158 if ${pgac_cv__get_cpuid+:} false; then :
14159   $as_echo_n "(cached) " >&6
14160 else
14161   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14162 /* end confdefs.h.  */
14163 #include <cpuid.h>
14164 int
14165 main ()
14166 {
14167 unsigned int exx[4] = {0, 0, 0, 0};
14168   __get_cpuid(1, &exx[0], &exx[1], &exx[2], &exx[3]);
14169
14170   ;
14171   return 0;
14172 }
14173 _ACEOF
14174 if ac_fn_c_try_link "$LINENO"; then :
14175   pgac_cv__get_cpuid="yes"
14176 else
14177   pgac_cv__get_cpuid="no"
14178 fi
14179 rm -f core conftest.err conftest.$ac_objext \
14180     conftest$ac_exeext conftest.$ac_ext
14181 fi
14182 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__get_cpuid" >&5
14183 $as_echo "$pgac_cv__get_cpuid" >&6; }
14184 if test x"$pgac_cv__get_cpuid" = x"yes"; then
14185
14186 $as_echo "#define HAVE__GET_CPUID 1" >>confdefs.h
14187
14188 fi
14189
14190 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __cpuid" >&5
14191 $as_echo_n "checking for __cpuid... " >&6; }
14192 if ${pgac_cv__cpuid+:} false; then :
14193   $as_echo_n "(cached) " >&6
14194 else
14195   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14196 /* end confdefs.h.  */
14197 #include <intrin.h>
14198 int
14199 main ()
14200 {
14201 unsigned int exx[4] = {0, 0, 0, 0};
14202   __get_cpuid(exx[0], 1);
14203
14204   ;
14205   return 0;
14206 }
14207 _ACEOF
14208 if ac_fn_c_try_link "$LINENO"; then :
14209   pgac_cv__cpuid="yes"
14210 else
14211   pgac_cv__cpuid="no"
14212 fi
14213 rm -f core conftest.err conftest.$ac_objext \
14214     conftest$ac_exeext conftest.$ac_ext
14215 fi
14216 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__cpuid" >&5
14217 $as_echo "$pgac_cv__cpuid" >&6; }
14218 if test x"$pgac_cv__cpuid" = x"yes"; then
14219
14220 $as_echo "#define HAVE__CPUID 1" >>confdefs.h
14221
14222 fi
14223
14224 # Check for Intel SSE 4.2 intrinsics to do CRC calculations.
14225 #
14226 # First check if the _mm_crc32_u8 and _mm_crc32_u64 intrinsics can be used
14227 # with the default compiler flags. If not, check if adding the -msse4.2
14228 # flag helps. CFLAGS_SSE42 is set to -msse4.2 if that's required.
14229 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=" >&5
14230 $as_echo_n "checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=... " >&6; }
14231 if ${pgac_cv_sse42_crc32_intrinsics_+:} false; then :
14232   $as_echo_n "(cached) " >&6
14233 else
14234   pgac_save_CFLAGS=$CFLAGS
14235 CFLAGS="$pgac_save_CFLAGS "
14236 ac_save_c_werror_flag=$ac_c_werror_flag
14237 ac_c_werror_flag=yes
14238 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14239 /* end confdefs.h.  */
14240 #include <nmmintrin.h>
14241 int
14242 main ()
14243 {
14244 unsigned int crc = 0;
14245    crc = _mm_crc32_u8(crc, 0);
14246    crc = _mm_crc32_u32(crc, 0);
14247   ;
14248   return 0;
14249 }
14250 _ACEOF
14251 if ac_fn_c_try_link "$LINENO"; then :
14252   pgac_cv_sse42_crc32_intrinsics_=yes
14253 else
14254   pgac_cv_sse42_crc32_intrinsics_=no
14255 fi
14256 rm -f core conftest.err conftest.$ac_objext \
14257     conftest$ac_exeext conftest.$ac_ext
14258 ac_c_werror_flag=$ac_save_c_werror_flag
14259 CFLAGS="$pgac_save_CFLAGS"
14260 fi
14261 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_sse42_crc32_intrinsics_" >&5
14262 $as_echo "$pgac_cv_sse42_crc32_intrinsics_" >&6; }
14263 if test x"$pgac_cv_sse42_crc32_intrinsics_" = x"yes"; then
14264   CFLAGS_SSE42=""
14265   pgac_sse42_crc32_intrinsics=yes
14266 fi
14267
14268 if test x"$pgac_sse42_crc32_intrinsics" != x"yes"; then
14269   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=-msse4.2" >&5
14270 $as_echo_n "checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=-msse4.2... " >&6; }
14271 if ${pgac_cv_sse42_crc32_intrinsics__msse4_2+:} false; then :
14272   $as_echo_n "(cached) " >&6
14273 else
14274   pgac_save_CFLAGS=$CFLAGS
14275 CFLAGS="$pgac_save_CFLAGS -msse4.2"
14276 ac_save_c_werror_flag=$ac_c_werror_flag
14277 ac_c_werror_flag=yes
14278 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14279 /* end confdefs.h.  */
14280 #include <nmmintrin.h>
14281 int
14282 main ()
14283 {
14284 unsigned int crc = 0;
14285    crc = _mm_crc32_u8(crc, 0);
14286    crc = _mm_crc32_u32(crc, 0);
14287   ;
14288   return 0;
14289 }
14290 _ACEOF
14291 if ac_fn_c_try_link "$LINENO"; then :
14292   pgac_cv_sse42_crc32_intrinsics__msse4_2=yes
14293 else
14294   pgac_cv_sse42_crc32_intrinsics__msse4_2=no
14295 fi
14296 rm -f core conftest.err conftest.$ac_objext \
14297     conftest$ac_exeext conftest.$ac_ext
14298 ac_c_werror_flag=$ac_save_c_werror_flag
14299 CFLAGS="$pgac_save_CFLAGS"
14300 fi
14301 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_sse42_crc32_intrinsics__msse4_2" >&5
14302 $as_echo "$pgac_cv_sse42_crc32_intrinsics__msse4_2" >&6; }
14303 if test x"$pgac_cv_sse42_crc32_intrinsics__msse4_2" = x"yes"; then
14304   CFLAGS_SSE42="-msse4.2"
14305   pgac_sse42_crc32_intrinsics=yes
14306 fi
14307
14308 fi
14309
14310
14311 # Are we targeting a processor that supports SSE 4.2? gcc, clang and icc all
14312 # define __SSE4_2__ in that case.
14313 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14314 /* end confdefs.h.  */
14315
14316 int
14317 main ()
14318 {
14319
14320 #ifndef __SSE4_2__
14321 #error __SSE4_2__ not defined
14322 #endif
14323
14324   ;
14325   return 0;
14326 }
14327 _ACEOF
14328 if ac_fn_c_try_compile "$LINENO"; then :
14329   SSE4_2_TARGETED=1
14330 fi
14331 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14332
14333 # Select CRC-32C implementation.
14334 #
14335 # If we are targeting a processor that has SSE 4.2 instructions, we can use the
14336 # special CRC instructions for calculating CRC-32C. If we're not targeting such
14337 # a processor, but we can nevertheless produce code that uses the SSE
14338 # intrinsics, perhaps with some extra CFLAGS, compile both implementations and
14339 # select which one to use at runtime, depending on whether SSE 4.2 is supported
14340 # by the processor we're running on.
14341 #
14342 # You can override this logic by setting the appropriate USE_*_CRC32 flag to 1
14343 # in the template or configure command line.
14344 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
14345   if test x"$pgac_sse42_crc32_intrinsics" = x"yes" && test x"$SSE4_2_TARGETED" = x"1" ; then
14346     USE_SSE42_CRC32C=1
14347   else
14348     # the CPUID instruction is needed for the runtime check.
14349     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
14350       USE_SSE42_CRC32C_WITH_RUNTIME_CHECK=1
14351     else
14352       # fall back to slicing-by-8 algorithm which doesn't require any special
14353       # CPU support.
14354       USE_SLICING_BY_8_CRC32C=1
14355     fi
14356   fi
14357 fi
14358
14359 # Set PG_CRC32C_OBJS appropriately depending on the selected implementation.
14360 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which CRC-32C implementation to use" >&5
14361 $as_echo_n "checking which CRC-32C implementation to use... " >&6; }
14362 if test x"$USE_SSE42_CRC32C" = x"1"; then
14363
14364 $as_echo "#define USE_SSE42_CRC32C 1" >>confdefs.h
14365
14366   PG_CRC32C_OBJS="pg_crc32c_sse42.o"
14367   { $as_echo "$as_me:${as_lineno-$LINENO}: result: SSE 4.2" >&5
14368 $as_echo "SSE 4.2" >&6; }
14369 else
14370   if test x"$USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" = x"1"; then
14371
14372 $as_echo "#define USE_SSE42_CRC32C_WITH_RUNTIME_CHECK 1" >>confdefs.h
14373
14374     PG_CRC32C_OBJS="pg_crc32c_sse42.o pg_crc32c_sb8.o pg_crc32c_choose.o"
14375     { $as_echo "$as_me:${as_lineno-$LINENO}: result: SSE 4.2 with runtime check" >&5
14376 $as_echo "SSE 4.2 with runtime check" >&6; }
14377   else
14378
14379 $as_echo "#define USE_SLICING_BY_8_CRC32C 1" >>confdefs.h
14380
14381     PG_CRC32C_OBJS="pg_crc32c_sb8.o"
14382     { $as_echo "$as_me:${as_lineno-$LINENO}: result: slicing-by-8" >&5
14383 $as_echo "slicing-by-8" >&6; }
14384   fi
14385 fi
14386
14387
14388
14389 # Check that POSIX signals are available if thread safety is enabled.
14390 if test "$PORTNAME" != "win32"
14391 then
14392 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for POSIX signal interface" >&5
14393 $as_echo_n "checking for POSIX signal interface... " >&6; }
14394 if ${pgac_cv_func_posix_signals+:} false; then :
14395   $as_echo_n "(cached) " >&6
14396 else
14397   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14398 /* end confdefs.h.  */
14399 #include <signal.h>
14400
14401 int
14402 main ()
14403 {
14404 struct sigaction act, oact;
14405 sigemptyset(&act.sa_mask);
14406 act.sa_flags = SA_RESTART;
14407 sigaction(0, &act, &oact);
14408   ;
14409   return 0;
14410 }
14411 _ACEOF
14412 if ac_fn_c_try_link "$LINENO"; then :
14413   pgac_cv_func_posix_signals=yes
14414 else
14415   pgac_cv_func_posix_signals=no
14416 fi
14417 rm -f core conftest.err conftest.$ac_objext \
14418     conftest$ac_exeext conftest.$ac_ext
14419 fi
14420 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_posix_signals" >&5
14421 $as_echo "$pgac_cv_func_posix_signals" >&6; }
14422 if test x"$pgac_cv_func_posix_signals" = xyes ; then
14423
14424 $as_echo "#define HAVE_POSIX_SIGNALS 1" >>confdefs.h
14425
14426 fi
14427 HAVE_POSIX_SIGNALS=$pgac_cv_func_posix_signals
14428
14429 if test "$pgac_cv_func_posix_signals" != yes -a "$enable_thread_safety" = yes; then
14430   as_fn_error $? "
14431 Thread-safety requires POSIX signals, which are not supported by this
14432 operating system;  use --disable-thread-safety to disable thread safety." "$LINENO" 5
14433 fi
14434 fi
14435
14436
14437 # Select semaphore implementation type.
14438 if test "$PORTNAME" != "win32"; then
14439   if test x"$USE_NAMED_POSIX_SEMAPHORES" = x"1" ; then
14440
14441 $as_echo "#define USE_NAMED_POSIX_SEMAPHORES 1" >>confdefs.h
14442
14443     SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
14444   else
14445     if test x"$USE_UNNAMED_POSIX_SEMAPHORES" = x"1" ; then
14446
14447 $as_echo "#define USE_UNNAMED_POSIX_SEMAPHORES 1" >>confdefs.h
14448
14449       SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
14450     else
14451
14452 $as_echo "#define USE_SYSV_SEMAPHORES 1" >>confdefs.h
14453
14454       SEMA_IMPLEMENTATION="src/backend/port/sysv_sema.c"
14455     fi
14456   fi
14457 else
14458
14459 $as_echo "#define USE_WIN32_SEMAPHORES 1" >>confdefs.h
14460
14461   SEMA_IMPLEMENTATION="src/backend/port/win32_sema.c"
14462 fi
14463
14464
14465 # Select shared-memory implementation type.
14466 if test "$PORTNAME" != "win32"; then
14467
14468 $as_echo "#define USE_SYSV_SHARED_MEMORY 1" >>confdefs.h
14469
14470   SHMEM_IMPLEMENTATION="src/backend/port/sysv_shmem.c"
14471 else
14472
14473 $as_echo "#define USE_WIN32_SHARED_MEMORY 1" >>confdefs.h
14474
14475   SHMEM_IMPLEMENTATION="src/backend/port/win32_shmem.c"
14476 fi
14477
14478 # Select latch implementation type.
14479 if test "$PORTNAME" != "win32"; then
14480   LATCH_IMPLEMENTATION="src/backend/port/unix_latch.c"
14481 else
14482   LATCH_IMPLEMENTATION="src/backend/port/win32_latch.c"
14483 fi
14484
14485 # If not set in template file, set bytes to use libc memset()
14486 if test x"$MEMSET_LOOP_LIMIT" = x"" ; then
14487   MEMSET_LOOP_LIMIT=1024
14488 fi
14489
14490 cat >>confdefs.h <<_ACEOF
14491 #define MEMSET_LOOP_LIMIT ${MEMSET_LOOP_LIMIT}
14492 _ACEOF
14493
14494
14495
14496 if test "$enable_nls" = yes ; then
14497
14498   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing bind_textdomain_codeset" >&5
14499 $as_echo_n "checking for library containing bind_textdomain_codeset... " >&6; }
14500 if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
14501   $as_echo_n "(cached) " >&6
14502 else
14503   ac_func_search_save_LIBS=$LIBS
14504 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14505 /* end confdefs.h.  */
14506
14507 /* Override any GCC internal prototype to avoid an error.
14508    Use char because int might match the return type of a GCC
14509    builtin and then its argument prototype would still apply.  */
14510 #ifdef __cplusplus
14511 extern "C"
14512 #endif
14513 char bind_textdomain_codeset ();
14514 int
14515 main ()
14516 {
14517 return bind_textdomain_codeset ();
14518   ;
14519   return 0;
14520 }
14521 _ACEOF
14522 for ac_lib in '' intl; do
14523   if test -z "$ac_lib"; then
14524     ac_res="none required"
14525   else
14526     ac_res=-l$ac_lib
14527     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
14528   fi
14529   if ac_fn_c_try_link "$LINENO"; then :
14530   ac_cv_search_bind_textdomain_codeset=$ac_res
14531 fi
14532 rm -f core conftest.err conftest.$ac_objext \
14533     conftest$ac_exeext
14534   if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
14535   break
14536 fi
14537 done
14538 if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
14539
14540 else
14541   ac_cv_search_bind_textdomain_codeset=no
14542 fi
14543 rm conftest.$ac_ext
14544 LIBS=$ac_func_search_save_LIBS
14545 fi
14546 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_bind_textdomain_codeset" >&5
14547 $as_echo "$ac_cv_search_bind_textdomain_codeset" >&6; }
14548 ac_res=$ac_cv_search_bind_textdomain_codeset
14549 if test "$ac_res" != no; then :
14550   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
14551
14552 else
14553   as_fn_error $? "a gettext implementation is required for NLS" "$LINENO" 5
14554 fi
14555
14556   ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
14557 if test "x$ac_cv_header_libintl_h" = xyes; then :
14558
14559 else
14560   as_fn_error $? "header file <libintl.h> is required for NLS" "$LINENO" 5
14561 fi
14562
14563
14564   for ac_prog in msgfmt
14565 do
14566   # Extract the first word of "$ac_prog", so it can be a program name with args.
14567 set dummy $ac_prog; ac_word=$2
14568 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14569 $as_echo_n "checking for $ac_word... " >&6; }
14570 if ${ac_cv_prog_MSGFMT+:} false; then :
14571   $as_echo_n "(cached) " >&6
14572 else
14573   if test -n "$MSGFMT"; then
14574   ac_cv_prog_MSGFMT="$MSGFMT" # Let the user override the test.
14575 else
14576 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14577 for as_dir in $PATH
14578 do
14579   IFS=$as_save_IFS
14580   test -z "$as_dir" && as_dir=.
14581     for ac_exec_ext in '' $ac_executable_extensions; do
14582   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
14583     ac_cv_prog_MSGFMT="$ac_prog"
14584     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14585     break 2
14586   fi
14587 done
14588   done
14589 IFS=$as_save_IFS
14590
14591 fi
14592 fi
14593 MSGFMT=$ac_cv_prog_MSGFMT
14594 if test -n "$MSGFMT"; then
14595   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
14596 $as_echo "$MSGFMT" >&6; }
14597 else
14598   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14599 $as_echo "no" >&6; }
14600 fi
14601
14602
14603   test -n "$MSGFMT" && break
14604 done
14605
14606   if test -z "$MSGFMT"; then
14607     as_fn_error $? "msgfmt is required for NLS" "$LINENO" 5
14608   fi
14609   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msgfmt flags" >&5
14610 $as_echo_n "checking for msgfmt flags... " >&6; }
14611 if ${pgac_cv_msgfmt_flags+:} false; then :
14612   $as_echo_n "(cached) " >&6
14613 else
14614   if test x"$MSGFMT" != x"" && "$MSGFMT" --version 2>&1 | grep "GNU" >/dev/null; then
14615     pgac_cv_msgfmt_flags=-c
14616 fi
14617 fi
14618 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_msgfmt_flags" >&5
14619 $as_echo "$pgac_cv_msgfmt_flags" >&6; }
14620   MSGFMT_FLAGS=$pgac_cv_msgfmt_flags
14621
14622   for ac_prog in msgmerge
14623 do
14624   # Extract the first word of "$ac_prog", so it can be a program name with args.
14625 set dummy $ac_prog; ac_word=$2
14626 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14627 $as_echo_n "checking for $ac_word... " >&6; }
14628 if ${ac_cv_prog_MSGMERGE+:} false; then :
14629   $as_echo_n "(cached) " >&6
14630 else
14631   if test -n "$MSGMERGE"; then
14632   ac_cv_prog_MSGMERGE="$MSGMERGE" # Let the user override the test.
14633 else
14634 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14635 for as_dir in $PATH
14636 do
14637   IFS=$as_save_IFS
14638   test -z "$as_dir" && as_dir=.
14639     for ac_exec_ext in '' $ac_executable_extensions; do
14640   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
14641     ac_cv_prog_MSGMERGE="$ac_prog"
14642     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14643     break 2
14644   fi
14645 done
14646   done
14647 IFS=$as_save_IFS
14648
14649 fi
14650 fi
14651 MSGMERGE=$ac_cv_prog_MSGMERGE
14652 if test -n "$MSGMERGE"; then
14653   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
14654 $as_echo "$MSGMERGE" >&6; }
14655 else
14656   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14657 $as_echo "no" >&6; }
14658 fi
14659
14660
14661   test -n "$MSGMERGE" && break
14662 done
14663
14664   for ac_prog in xgettext
14665 do
14666   # Extract the first word of "$ac_prog", so it can be a program name with args.
14667 set dummy $ac_prog; ac_word=$2
14668 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14669 $as_echo_n "checking for $ac_word... " >&6; }
14670 if ${ac_cv_prog_XGETTEXT+:} false; then :
14671   $as_echo_n "(cached) " >&6
14672 else
14673   if test -n "$XGETTEXT"; then
14674   ac_cv_prog_XGETTEXT="$XGETTEXT" # Let the user override the test.
14675 else
14676 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14677 for as_dir in $PATH
14678 do
14679   IFS=$as_save_IFS
14680   test -z "$as_dir" && as_dir=.
14681     for ac_exec_ext in '' $ac_executable_extensions; do
14682   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
14683     ac_cv_prog_XGETTEXT="$ac_prog"
14684     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14685     break 2
14686   fi
14687 done
14688   done
14689 IFS=$as_save_IFS
14690
14691 fi
14692 fi
14693 XGETTEXT=$ac_cv_prog_XGETTEXT
14694 if test -n "$XGETTEXT"; then
14695   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
14696 $as_echo "$XGETTEXT" >&6; }
14697 else
14698   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14699 $as_echo "no" >&6; }
14700 fi
14701
14702
14703   test -n "$XGETTEXT" && break
14704 done
14705
14706
14707 fi
14708
14709 # Check for Tcl configuration script tclConfig.sh
14710 if test "$with_tcl" = yes; then
14711     for ac_prog in tclsh tcl tclsh8.6 tclsh86 tclsh8.5 tclsh85 tclsh8.4 tclsh84 tclsh8.3 tclsh83
14712 do
14713   # Extract the first word of "$ac_prog", so it can be a program name with args.
14714 set dummy $ac_prog; ac_word=$2
14715 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14716 $as_echo_n "checking for $ac_word... " >&6; }
14717 if ${ac_cv_path_TCLSH+:} false; then :
14718   $as_echo_n "(cached) " >&6
14719 else
14720   case $TCLSH in
14721   [\\/]* | ?:[\\/]*)
14722   ac_cv_path_TCLSH="$TCLSH" # Let the user override the test with a path.
14723   ;;
14724   *)
14725   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14726 for as_dir in $PATH
14727 do
14728   IFS=$as_save_IFS
14729   test -z "$as_dir" && as_dir=.
14730     for ac_exec_ext in '' $ac_executable_extensions; do
14731   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
14732     ac_cv_path_TCLSH="$as_dir/$ac_word$ac_exec_ext"
14733     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14734     break 2
14735   fi
14736 done
14737   done
14738 IFS=$as_save_IFS
14739
14740   ;;
14741 esac
14742 fi
14743 TCLSH=$ac_cv_path_TCLSH
14744 if test -n "$TCLSH"; then
14745   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLSH" >&5
14746 $as_echo "$TCLSH" >&6; }
14747 else
14748   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14749 $as_echo "no" >&6; }
14750 fi
14751
14752
14753   test -n "$TCLSH" && break
14754 done
14755
14756 if test x"$TCLSH" = x""; then
14757   as_fn_error $? "Tcl shell not found" "$LINENO" 5
14758 fi
14759
14760 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclConfig.sh" >&5
14761 $as_echo_n "checking for tclConfig.sh... " >&6; }
14762 # Let user override test
14763 if test -z "$TCL_CONFIG_SH"; then
14764     pgac_test_dirs="$with_tclconfig"
14765
14766     set X $pgac_test_dirs; shift
14767     if test $# -eq 0; then
14768         test -z "$TCLSH" && as_fn_error $? "unable to locate tclConfig.sh because no Tcl shell was found" "$LINENO" 5
14769         set X `echo 'puts $auto_path' | $TCLSH`; shift
14770     fi
14771
14772     for pgac_dir do
14773         if test -r "$pgac_dir/tclConfig.sh"; then
14774             TCL_CONFIG_SH=$pgac_dir/tclConfig.sh
14775             break
14776         fi
14777     done
14778 fi
14779
14780 if test -z "$TCL_CONFIG_SH"; then
14781     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14782 $as_echo "no" >&6; }
14783     as_fn_error $? "file 'tclConfig.sh' is required for Tcl" "$LINENO" 5
14784 else
14785     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCL_CONFIG_SH" >&5
14786 $as_echo "$TCL_CONFIG_SH" >&6; }
14787 fi
14788
14789
14790
14791     . "$TCL_CONFIG_SH"
14792 eval TCL_INCLUDE_SPEC=\"$TCL_INCLUDE_SPEC\"
14793 eval TCL_LIBS=\"$TCL_LIBS\"
14794 eval TCL_LIB_SPEC=\"$TCL_LIB_SPEC\"
14795 eval TCL_SHARED_BUILD=\"$TCL_SHARED_BUILD\"
14796
14797         if test "$TCL_SHARED_BUILD" != 1; then
14798       as_fn_error $? "cannot build PL/Tcl because Tcl is not a shared library
14799 Use --without-tcl to disable building PL/Tcl." "$LINENO" 5
14800     fi
14801     # now that we have TCL_INCLUDE_SPEC, we can check for <tcl.h>
14802     ac_save_CPPFLAGS=$CPPFLAGS
14803     CPPFLAGS="$TCL_INCLUDE_SPEC $CPPFLAGS"
14804     ac_fn_c_check_header_mongrel "$LINENO" "tcl.h" "ac_cv_header_tcl_h" "$ac_includes_default"
14805 if test "x$ac_cv_header_tcl_h" = xyes; then :
14806
14807 else
14808   as_fn_error $? "header file <tcl.h> is required for Tcl" "$LINENO" 5
14809 fi
14810
14811
14812     CPPFLAGS=$ac_save_CPPFLAGS
14813 fi
14814
14815 # check for <perl.h>
14816 if test "$with_perl" = yes; then
14817   ac_save_CPPFLAGS=$CPPFLAGS
14818   CPPFLAGS="$CPPFLAGS -I$perl_archlibexp/CORE"
14819   ac_fn_c_check_header_compile "$LINENO" "perl.h" "ac_cv_header_perl_h" "#include <EXTERN.h>
14820 "
14821 if test "x$ac_cv_header_perl_h" = xyes; then :
14822
14823 else
14824   as_fn_error $? "header file <perl.h> is required for Perl" "$LINENO" 5
14825 fi
14826
14827
14828   # While we're at it, check that we can link to libperl.
14829   # On most platforms, if perl.h is there then libperl.so will be too, but at
14830   # this writing Debian packages them separately.  There is no known reason to
14831   # waste cycles on separate probes for the Tcl or Python libraries, though.
14832   pgac_save_LIBS=$LIBS
14833   LIBS="$perl_embed_ldflags"
14834   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libperl" >&5
14835 $as_echo_n "checking for libperl... " >&6; }
14836   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14837 /* end confdefs.h.  */
14838
14839 #include <EXTERN.h>
14840 #include <perl.h>
14841
14842 int
14843 main ()
14844 {
14845 perl_alloc();
14846   ;
14847   return 0;
14848 }
14849 _ACEOF
14850 if ac_fn_c_try_link "$LINENO"; then :
14851   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14852 $as_echo "yes" >&6; }
14853 else
14854   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14855 $as_echo "no" >&6; }
14856      as_fn_error $? "libperl library is required for Perl" "$LINENO" 5
14857 fi
14858 rm -f core conftest.err conftest.$ac_objext \
14859     conftest$ac_exeext conftest.$ac_ext
14860   LIBS=$pgac_save_LIBS
14861   CPPFLAGS=$ac_save_CPPFLAGS
14862 fi
14863
14864 # check for <Python.h>
14865 if test "$with_python" = yes; then
14866   ac_save_CPPFLAGS=$CPPFLAGS
14867   CPPFLAGS="$python_includespec $CPPFLAGS"
14868   ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
14869 if test "x$ac_cv_header_Python_h" = xyes; then :
14870
14871 else
14872   as_fn_error $? "header file <Python.h> is required for Python" "$LINENO" 5
14873 fi
14874
14875
14876   CPPFLAGS=$ac_save_CPPFLAGS
14877 fi
14878
14879 #
14880 # Check for DocBook and tools
14881 #
14882 for ac_prog in onsgmls nsgmls
14883 do
14884   # Extract the first word of "$ac_prog", so it can be a program name with args.
14885 set dummy $ac_prog; ac_word=$2
14886 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14887 $as_echo_n "checking for $ac_word... " >&6; }
14888 if ${ac_cv_prog_NSGMLS+:} false; then :
14889   $as_echo_n "(cached) " >&6
14890 else
14891   if test -n "$NSGMLS"; then
14892   ac_cv_prog_NSGMLS="$NSGMLS" # Let the user override the test.
14893 else
14894 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14895 for as_dir in $PATH
14896 do
14897   IFS=$as_save_IFS
14898   test -z "$as_dir" && as_dir=.
14899     for ac_exec_ext in '' $ac_executable_extensions; do
14900   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
14901     ac_cv_prog_NSGMLS="$ac_prog"
14902     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14903     break 2
14904   fi
14905 done
14906   done
14907 IFS=$as_save_IFS
14908
14909 fi
14910 fi
14911 NSGMLS=$ac_cv_prog_NSGMLS
14912 if test -n "$NSGMLS"; then
14913   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NSGMLS" >&5
14914 $as_echo "$NSGMLS" >&6; }
14915 else
14916   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14917 $as_echo "no" >&6; }
14918 fi
14919
14920
14921   test -n "$NSGMLS" && break
14922 done
14923
14924 for ac_prog in openjade jade
14925 do
14926   # Extract the first word of "$ac_prog", so it can be a program name with args.
14927 set dummy $ac_prog; ac_word=$2
14928 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
14929 $as_echo_n "checking for $ac_word... " >&6; }
14930 if ${ac_cv_prog_JADE+:} false; then :
14931   $as_echo_n "(cached) " >&6
14932 else
14933   if test -n "$JADE"; then
14934   ac_cv_prog_JADE="$JADE" # Let the user override the test.
14935 else
14936 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14937 for as_dir in $PATH
14938 do
14939   IFS=$as_save_IFS
14940   test -z "$as_dir" && as_dir=.
14941     for ac_exec_ext in '' $ac_executable_extensions; do
14942   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
14943     ac_cv_prog_JADE="$ac_prog"
14944     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
14945     break 2
14946   fi
14947 done
14948   done
14949 IFS=$as_save_IFS
14950
14951 fi
14952 fi
14953 JADE=$ac_cv_prog_JADE
14954 if test -n "$JADE"; then
14955   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JADE" >&5
14956 $as_echo "$JADE" >&6; }
14957 else
14958   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14959 $as_echo "no" >&6; }
14960 fi
14961
14962
14963   test -n "$JADE" && break
14964 done
14965
14966
14967 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook V4.2" >&5
14968 $as_echo_n "checking for DocBook V4.2... " >&6; }
14969 if ${pgac_cv_check_docbook+:} false; then :
14970   $as_echo_n "(cached) " >&6
14971 else
14972   cat >conftest.sgml <<EOF
14973 <!doctype book PUBLIC "-//OASIS//DTD DocBook V4.2//EN">
14974 <book>
14975  <title>test</title>
14976  <chapter>
14977   <title>random</title>
14978    <sect1>
14979     <title>testsect</title>
14980     <para>text</para>
14981   </sect1>
14982  </chapter>
14983 </book>
14984 EOF
14985
14986 pgac_cv_check_docbook=no
14987
14988 if test -n "$NSGMLS"; then
14989   $NSGMLS -s conftest.sgml 1>&5 2>&1
14990   if test $? -eq 0; then
14991     pgac_cv_check_docbook=yes
14992   fi
14993 fi
14994 rm -f conftest.sgml
14995 fi
14996 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_docbook" >&5
14997 $as_echo "$pgac_cv_check_docbook" >&6; }
14998
14999 have_docbook=$pgac_cv_check_docbook
15000
15001
15002 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook stylesheets" >&5
15003 $as_echo_n "checking for DocBook stylesheets... " >&6; }
15004 if ${pgac_cv_path_stylesheets+:} false; then :
15005   $as_echo_n "(cached) " >&6
15006 else
15007   if test -n "$DOCBOOKSTYLE"; then
15008   pgac_cv_path_stylesheets=$DOCBOOKSTYLE
15009 else
15010   for pgac_prefix in /usr /usr/local /opt /sw; do
15011     for pgac_infix in share lib; do
15012       for pgac_postfix in \
15013         sgml/stylesheets/nwalsh-modular \
15014         sgml/stylesheets/docbook \
15015         sgml/stylesheets/dsssl/docbook \
15016         sgml/docbook-dsssl \
15017         sgml/docbook/dsssl/modular \
15018         sgml/docbook/stylesheet/dsssl/modular \
15019         sgml/docbook/dsssl-stylesheets \
15020         sgml/dsssl/docbook-dsssl-nwalsh
15021       do
15022         pgac_candidate=$pgac_prefix/$pgac_infix/$pgac_postfix
15023         if test -r "$pgac_candidate/html/docbook.dsl" \
15024            && test -r "$pgac_candidate/print/docbook.dsl"
15025         then
15026           pgac_cv_path_stylesheets=$pgac_candidate
15027           break 3
15028         fi
15029       done
15030     done
15031   done
15032 fi
15033 fi
15034
15035 DOCBOOKSTYLE=$pgac_cv_path_stylesheets
15036
15037 if test -n "$DOCBOOKSTYLE"; then
15038   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCBOOKSTYLE" >&5
15039 $as_echo "$DOCBOOKSTYLE" >&6; }
15040 else
15041   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15042 $as_echo "no" >&6; }
15043 fi
15044 if test -n "$DOCBOOKSTYLE" -a -r "$DOCBOOKSTYLE/bin/collateindex.pl"; then
15045   COLLATEINDEX="$DOCBOOKSTYLE/bin/collateindex.pl"
15046
15047 else
15048   # Extract the first word of "collateindex.pl", so it can be a program name with args.
15049 set dummy collateindex.pl; ac_word=$2
15050 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15051 $as_echo_n "checking for $ac_word... " >&6; }
15052 if ${ac_cv_path_COLLATEINDEX+:} false; then :
15053   $as_echo_n "(cached) " >&6
15054 else
15055   case $COLLATEINDEX in
15056   [\\/]* | ?:[\\/]*)
15057   ac_cv_path_COLLATEINDEX="$COLLATEINDEX" # Let the user override the test with a path.
15058   ;;
15059   *)
15060   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15061 for as_dir in $PATH
15062 do
15063   IFS=$as_save_IFS
15064   test -z "$as_dir" && as_dir=.
15065     for ac_exec_ext in '' $ac_executable_extensions; do
15066   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15067     ac_cv_path_COLLATEINDEX="$as_dir/$ac_word$ac_exec_ext"
15068     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15069     break 2
15070   fi
15071 done
15072   done
15073 IFS=$as_save_IFS
15074
15075   ;;
15076 esac
15077 fi
15078 COLLATEINDEX=$ac_cv_path_COLLATEINDEX
15079 if test -n "$COLLATEINDEX"; then
15080   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COLLATEINDEX" >&5
15081 $as_echo "$COLLATEINDEX" >&6; }
15082 else
15083   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15084 $as_echo "no" >&6; }
15085 fi
15086
15087
15088 fi
15089 for ac_prog in dbtoepub
15090 do
15091   # Extract the first word of "$ac_prog", so it can be a program name with args.
15092 set dummy $ac_prog; ac_word=$2
15093 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15094 $as_echo_n "checking for $ac_word... " >&6; }
15095 if ${ac_cv_prog_DBTOEPUB+:} false; then :
15096   $as_echo_n "(cached) " >&6
15097 else
15098   if test -n "$DBTOEPUB"; then
15099   ac_cv_prog_DBTOEPUB="$DBTOEPUB" # Let the user override the test.
15100 else
15101 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15102 for as_dir in $PATH
15103 do
15104   IFS=$as_save_IFS
15105   test -z "$as_dir" && as_dir=.
15106     for ac_exec_ext in '' $ac_executable_extensions; do
15107   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15108     ac_cv_prog_DBTOEPUB="$ac_prog"
15109     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15110     break 2
15111   fi
15112 done
15113   done
15114 IFS=$as_save_IFS
15115
15116 fi
15117 fi
15118 DBTOEPUB=$ac_cv_prog_DBTOEPUB
15119 if test -n "$DBTOEPUB"; then
15120   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
15121 $as_echo "$DBTOEPUB" >&6; }
15122 else
15123   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15124 $as_echo "no" >&6; }
15125 fi
15126
15127
15128   test -n "$DBTOEPUB" && break
15129 done
15130
15131 for ac_prog in xmllint
15132 do
15133   # Extract the first word of "$ac_prog", so it can be a program name with args.
15134 set dummy $ac_prog; ac_word=$2
15135 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15136 $as_echo_n "checking for $ac_word... " >&6; }
15137 if ${ac_cv_prog_XMLLINT+:} false; then :
15138   $as_echo_n "(cached) " >&6
15139 else
15140   if test -n "$XMLLINT"; then
15141   ac_cv_prog_XMLLINT="$XMLLINT" # Let the user override the test.
15142 else
15143 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15144 for as_dir in $PATH
15145 do
15146   IFS=$as_save_IFS
15147   test -z "$as_dir" && as_dir=.
15148     for ac_exec_ext in '' $ac_executable_extensions; do
15149   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15150     ac_cv_prog_XMLLINT="$ac_prog"
15151     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15152     break 2
15153   fi
15154 done
15155   done
15156 IFS=$as_save_IFS
15157
15158 fi
15159 fi
15160 XMLLINT=$ac_cv_prog_XMLLINT
15161 if test -n "$XMLLINT"; then
15162   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
15163 $as_echo "$XMLLINT" >&6; }
15164 else
15165   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15166 $as_echo "no" >&6; }
15167 fi
15168
15169
15170   test -n "$XMLLINT" && break
15171 done
15172
15173 for ac_prog in xsltproc
15174 do
15175   # Extract the first word of "$ac_prog", so it can be a program name with args.
15176 set dummy $ac_prog; ac_word=$2
15177 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15178 $as_echo_n "checking for $ac_word... " >&6; }
15179 if ${ac_cv_prog_XSLTPROC+:} false; then :
15180   $as_echo_n "(cached) " >&6
15181 else
15182   if test -n "$XSLTPROC"; then
15183   ac_cv_prog_XSLTPROC="$XSLTPROC" # Let the user override the test.
15184 else
15185 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15186 for as_dir in $PATH
15187 do
15188   IFS=$as_save_IFS
15189   test -z "$as_dir" && as_dir=.
15190     for ac_exec_ext in '' $ac_executable_extensions; do
15191   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15192     ac_cv_prog_XSLTPROC="$ac_prog"
15193     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15194     break 2
15195   fi
15196 done
15197   done
15198 IFS=$as_save_IFS
15199
15200 fi
15201 fi
15202 XSLTPROC=$ac_cv_prog_XSLTPROC
15203 if test -n "$XSLTPROC"; then
15204   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
15205 $as_echo "$XSLTPROC" >&6; }
15206 else
15207   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15208 $as_echo "no" >&6; }
15209 fi
15210
15211
15212   test -n "$XSLTPROC" && break
15213 done
15214
15215 for ac_prog in osx sgml2xml sx
15216 do
15217   # Extract the first word of "$ac_prog", so it can be a program name with args.
15218 set dummy $ac_prog; ac_word=$2
15219 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15220 $as_echo_n "checking for $ac_word... " >&6; }
15221 if ${ac_cv_prog_OSX+:} false; then :
15222   $as_echo_n "(cached) " >&6
15223 else
15224   if test -n "$OSX"; then
15225   ac_cv_prog_OSX="$OSX" # Let the user override the test.
15226 else
15227 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15228 for as_dir in $PATH
15229 do
15230   IFS=$as_save_IFS
15231   test -z "$as_dir" && as_dir=.
15232     for ac_exec_ext in '' $ac_executable_extensions; do
15233   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15234     ac_cv_prog_OSX="$ac_prog"
15235     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15236     break 2
15237   fi
15238 done
15239   done
15240 IFS=$as_save_IFS
15241
15242 fi
15243 fi
15244 OSX=$ac_cv_prog_OSX
15245 if test -n "$OSX"; then
15246   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OSX" >&5
15247 $as_echo "$OSX" >&6; }
15248 else
15249   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15250 $as_echo "no" >&6; }
15251 fi
15252
15253
15254   test -n "$OSX" && break
15255 done
15256
15257
15258 #
15259 # Check for test tools
15260 #
15261 if test "$enable_tap_tests" = yes; then
15262   for ac_prog in prove
15263 do
15264   # Extract the first word of "$ac_prog", so it can be a program name with args.
15265 set dummy $ac_prog; ac_word=$2
15266 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15267 $as_echo_n "checking for $ac_word... " >&6; }
15268 if ${ac_cv_prog_PROVE+:} false; then :
15269   $as_echo_n "(cached) " >&6
15270 else
15271   if test -n "$PROVE"; then
15272   ac_cv_prog_PROVE="$PROVE" # Let the user override the test.
15273 else
15274 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15275 for as_dir in $PATH
15276 do
15277   IFS=$as_save_IFS
15278   test -z "$as_dir" && as_dir=.
15279     for ac_exec_ext in '' $ac_executable_extensions; do
15280   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15281     ac_cv_prog_PROVE="$ac_prog"
15282     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15283     break 2
15284   fi
15285 done
15286   done
15287 IFS=$as_save_IFS
15288
15289 fi
15290 fi
15291 PROVE=$ac_cv_prog_PROVE
15292 if test -n "$PROVE"; then
15293   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROVE" >&5
15294 $as_echo "$PROVE" >&6; }
15295 else
15296   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15297 $as_echo "no" >&6; }
15298 fi
15299
15300
15301   test -n "$PROVE" && break
15302 done
15303
15304   if test -z "$PROVE"; then
15305     as_fn_error $? "prove not found" "$LINENO" 5
15306   fi
15307   if test -z "$PERL"; then
15308     as_fn_error $? "Perl not found" "$LINENO" 5
15309   fi
15310 fi
15311
15312 # Thread testing
15313
15314 # We have to run the thread test near the end so we have all our symbols
15315 # defined.  Cross compiling throws a warning.
15316 #
15317 if test "$enable_thread_safety" = yes; then
15318 if test "$PORTNAME" != "win32"
15319 then
15320 { $as_echo "$as_me:${as_lineno-$LINENO}: checking thread safety of required library functions" >&5
15321 $as_echo_n "checking thread safety of required library functions... " >&6; }
15322
15323 _CFLAGS="$CFLAGS"
15324 _LIBS="$LIBS"
15325 CFLAGS="$CFLAGS $PTHREAD_CFLAGS -DIN_CONFIGURE"
15326 LIBS="$LIBS $PTHREAD_LIBS"
15327 if test "$cross_compiling" = yes; then :
15328   { $as_echo "$as_me:${as_lineno-$LINENO}: result: maybe" >&5
15329 $as_echo "maybe" >&6; }
15330   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
15331 *** Skipping thread test program because of cross-compile build.
15332 *** Run the program in src/test/thread on the target machine.
15333 " >&5
15334 $as_echo "$as_me: WARNING:
15335 *** Skipping thread test program because of cross-compile build.
15336 *** Run the program in src/test/thread on the target machine.
15337 " >&2;}
15338 else
15339   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15340 /* end confdefs.h.  */
15341 #include "$srcdir/src/test/thread/thread_test.c"
15342 _ACEOF
15343 if ac_fn_c_try_run "$LINENO"; then :
15344   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15345 $as_echo "yes" >&6; }
15346 else
15347   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15348 $as_echo "no" >&6; }
15349   as_fn_error $? "thread test program failed
15350 This platform is not thread-safe.  Check the file 'config.log' or compile
15351 and run src/test/thread/thread_test for the exact reason.
15352 Use --disable-thread-safety to disable thread safety." "$LINENO" 5
15353 fi
15354 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15355   conftest.$ac_objext conftest.beam conftest.$ac_ext
15356 fi
15357
15358 CFLAGS="$_CFLAGS"
15359 LIBS="$_LIBS"
15360 else
15361 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** skipping thread test on Win32" >&5
15362 $as_echo "$as_me: WARNING: *** skipping thread test on Win32" >&2;}
15363 fi
15364 fi
15365
15366 # If compiler will take -Wl,--as-needed (or various platform-specific
15367 # spellings thereof) then add that to LDFLAGS.  This is much easier than
15368 # trying to filter LIBS to the minimum for each executable.
15369 # On (at least) some Red-Hat-derived systems, this switch breaks linking to
15370 # libreadline; therefore we postpone testing it until we know what library
15371 # dependencies readline has.  The test code will try to link with $LIBS.
15372 if test "$with_readline" = yes; then
15373   link_test_func=readline
15374 else
15375   link_test_func=exit
15376 fi
15377
15378 if test "$PORTNAME" = "darwin"; then
15379   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,-dead_strip_dylibs" >&5
15380 $as_echo_n "checking whether $CC supports -Wl,-dead_strip_dylibs... " >&6; }
15381 if ${pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs+:} false; then :
15382   $as_echo_n "(cached) " >&6
15383 else
15384   pgac_save_LDFLAGS=$LDFLAGS
15385 LDFLAGS="$pgac_save_LDFLAGS -Wl,-dead_strip_dylibs"
15386 if test "$cross_compiling" = yes; then :
15387   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs="assuming no"
15388 else
15389   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15390 /* end confdefs.h.  */
15391 extern void $link_test_func (); void (*fptr) () = $link_test_func;
15392 int
15393 main ()
15394 {
15395
15396   ;
15397   return 0;
15398 }
15399 _ACEOF
15400 if ac_fn_c_try_run "$LINENO"; then :
15401   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=yes
15402 else
15403   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=no
15404 fi
15405 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15406   conftest.$ac_objext conftest.beam conftest.$ac_ext
15407 fi
15408
15409 LDFLAGS="$pgac_save_LDFLAGS"
15410 fi
15411 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&5
15412 $as_echo "$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&6; }
15413 if test x"$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" = x"yes"; then
15414   LDFLAGS="$LDFLAGS -Wl,-dead_strip_dylibs"
15415 fi
15416
15417 elif test "$PORTNAME" = "openbsd"; then
15418   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,-Bdynamic" >&5
15419 $as_echo_n "checking whether $CC supports -Wl,-Bdynamic... " >&6; }
15420 if ${pgac_cv_prog_cc_ldflags__Wl__Bdynamic+:} false; then :
15421   $as_echo_n "(cached) " >&6
15422 else
15423   pgac_save_LDFLAGS=$LDFLAGS
15424 LDFLAGS="$pgac_save_LDFLAGS -Wl,-Bdynamic"
15425 if test "$cross_compiling" = yes; then :
15426   pgac_cv_prog_cc_ldflags__Wl__Bdynamic="assuming no"
15427 else
15428   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15429 /* end confdefs.h.  */
15430 extern void $link_test_func (); void (*fptr) () = $link_test_func;
15431 int
15432 main ()
15433 {
15434
15435   ;
15436   return 0;
15437 }
15438 _ACEOF
15439 if ac_fn_c_try_run "$LINENO"; then :
15440   pgac_cv_prog_cc_ldflags__Wl__Bdynamic=yes
15441 else
15442   pgac_cv_prog_cc_ldflags__Wl__Bdynamic=no
15443 fi
15444 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15445   conftest.$ac_objext conftest.beam conftest.$ac_ext
15446 fi
15447
15448 LDFLAGS="$pgac_save_LDFLAGS"
15449 fi
15450 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&5
15451 $as_echo "$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&6; }
15452 if test x"$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" = x"yes"; then
15453   LDFLAGS="$LDFLAGS -Wl,-Bdynamic"
15454 fi
15455
15456 else
15457   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,--as-needed" >&5
15458 $as_echo_n "checking whether $CC supports -Wl,--as-needed... " >&6; }
15459 if ${pgac_cv_prog_cc_ldflags__Wl___as_needed+:} false; then :
15460   $as_echo_n "(cached) " >&6
15461 else
15462   pgac_save_LDFLAGS=$LDFLAGS
15463 LDFLAGS="$pgac_save_LDFLAGS -Wl,--as-needed"
15464 if test "$cross_compiling" = yes; then :
15465   pgac_cv_prog_cc_ldflags__Wl___as_needed="assuming no"
15466 else
15467   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15468 /* end confdefs.h.  */
15469 extern void $link_test_func (); void (*fptr) () = $link_test_func;
15470 int
15471 main ()
15472 {
15473
15474   ;
15475   return 0;
15476 }
15477 _ACEOF
15478 if ac_fn_c_try_run "$LINENO"; then :
15479   pgac_cv_prog_cc_ldflags__Wl___as_needed=yes
15480 else
15481   pgac_cv_prog_cc_ldflags__Wl___as_needed=no
15482 fi
15483 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15484   conftest.$ac_objext conftest.beam conftest.$ac_ext
15485 fi
15486
15487 LDFLAGS="$pgac_save_LDFLAGS"
15488 fi
15489 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl___as_needed" >&5
15490 $as_echo "$pgac_cv_prog_cc_ldflags__Wl___as_needed" >&6; }
15491 if test x"$pgac_cv_prog_cc_ldflags__Wl___as_needed" = x"yes"; then
15492   LDFLAGS="$LDFLAGS -Wl,--as-needed"
15493 fi
15494
15495 fi
15496
15497 # Create compiler version string
15498 if test x"$GCC" = x"yes" ; then
15499   cc_string=`${CC} --version | sed q`
15500   case $cc_string in [A-Za-z]*) ;; *) cc_string="GCC $cc_string";; esac
15501 elif test x"$SUN_STUDIO_CC" = x"yes" ; then
15502   cc_string=`${CC} -V 2>&1 | sed q`
15503 else
15504   cc_string=$CC
15505 fi
15506
15507
15508 cat >>confdefs.h <<_ACEOF
15509 #define PG_VERSION_STR "PostgreSQL $PG_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"
15510 _ACEOF
15511
15512
15513 # Supply a numeric version string for use by 3rd party add-ons
15514 # awk -F is a regex on some platforms, and not on others, so make "." a tab
15515 PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |
15516 tr '.' '        ' |
15517 $AWK '{printf "%d%02d%02d", $1, $2, (NF >= 3) ? $3 : 0}'`"
15518
15519 cat >>confdefs.h <<_ACEOF
15520 #define PG_VERSION_NUM $PG_VERSION_NUM
15521 _ACEOF
15522
15523
15524
15525
15526 # Begin output steps
15527
15528 { $as_echo "$as_me:${as_lineno-$LINENO}: using compiler=$cc_string" >&5
15529 $as_echo "$as_me: using compiler=$cc_string" >&6;}
15530 { $as_echo "$as_me:${as_lineno-$LINENO}: using CFLAGS=$CFLAGS" >&5
15531 $as_echo "$as_me: using CFLAGS=$CFLAGS" >&6;}
15532 { $as_echo "$as_me:${as_lineno-$LINENO}: using CPPFLAGS=$CPPFLAGS" >&5
15533 $as_echo "$as_me: using CPPFLAGS=$CPPFLAGS" >&6;}
15534 { $as_echo "$as_me:${as_lineno-$LINENO}: using LDFLAGS=$LDFLAGS" >&5
15535 $as_echo "$as_me: using LDFLAGS=$LDFLAGS" >&6;}
15536
15537 # prepare build tree if outside source tree
15538 # Note 1: test -ef might not exist, but it's more reliable than `pwd`.
15539 # Note 2: /bin/pwd might be better than shell's built-in at getting
15540 #         a symlink-free name.
15541 if ( test "$srcdir" -ef . ) >/dev/null 2>&1 || test "`cd $srcdir && /bin/pwd`" = "`/bin/pwd`"; then
15542   vpath_build=no
15543 else
15544   vpath_build=yes
15545   if test "$no_create" != yes; then
15546     $as_echo_n "preparing build tree... " >&6
15547     pgac_abs_top_srcdir=`cd "$srcdir" && pwd`
15548     $SHELL "$ac_aux_dir/prep_buildtree" "$pgac_abs_top_srcdir" "." \
15549       || as_fn_error $? "failed" "$LINENO" 5
15550     { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
15551 $as_echo "done" >&6; }
15552   fi
15553 fi
15554
15555
15556
15557 ac_config_files="$ac_config_files GNUmakefile src/Makefile.global"
15558
15559
15560 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/backend/port/pg_latch.c:${LATCH_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}"
15561
15562
15563 if test "$PORTNAME" = "win32"; then
15564 ac_config_commands="$ac_config_commands check_win32_symlinks"
15565
15566 fi
15567
15568 ac_config_headers="$ac_config_headers src/include/pg_config.h"
15569
15570
15571 ac_config_headers="$ac_config_headers src/include/pg_config_ext.h"
15572
15573
15574 ac_config_headers="$ac_config_headers src/interfaces/ecpg/include/ecpg_config.h"
15575
15576
15577 cat >confcache <<\_ACEOF
15578 # This file is a shell script that caches the results of configure
15579 # tests run on this system so they can be shared between configure
15580 # scripts and configure runs, see configure's option --config-cache.
15581 # It is not useful on other systems.  If it contains results you don't
15582 # want to keep, you may remove or edit it.
15583 #
15584 # config.status only pays attention to the cache file if you give it
15585 # the --recheck option to rerun configure.
15586 #
15587 # `ac_cv_env_foo' variables (set or unset) will be overridden when
15588 # loading this file, other *unset* `ac_cv_foo' will be assigned the
15589 # following values.
15590
15591 _ACEOF
15592
15593 # The following way of writing the cache mishandles newlines in values,
15594 # but we know of no workaround that is simple, portable, and efficient.
15595 # So, we kill variables containing newlines.
15596 # Ultrix sh set writes to stderr and can't be redirected directly,
15597 # and sets the high bit in the cache file unless we assign to the vars.
15598 (
15599   for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
15600     eval ac_val=\$$ac_var
15601     case $ac_val in #(
15602     *${as_nl}*)
15603       case $ac_var in #(
15604       *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
15605 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
15606       esac
15607       case $ac_var in #(
15608       _ | IFS | as_nl) ;; #(
15609       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
15610       *) { eval $ac_var=; unset $ac_var;} ;;
15611       esac ;;
15612     esac
15613   done
15614
15615   (set) 2>&1 |
15616     case $as_nl`(ac_space=' '; set) 2>&1` in #(
15617     *${as_nl}ac_space=\ *)
15618       # `set' does not quote correctly, so add quotes: double-quote
15619       # substitution turns \\\\ into \\, and sed turns \\ into \.
15620       sed -n \
15621         "s/'/'\\\\''/g;
15622           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
15623       ;; #(
15624     *)
15625       # `set' quotes correctly as required by POSIX, so do not add quotes.
15626       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
15627       ;;
15628     esac |
15629     sort
15630 ) |
15631   sed '
15632      /^ac_cv_env_/b end
15633      t clear
15634      :clear
15635      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
15636      t end
15637      s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
15638      :end' >>confcache
15639 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
15640   if test -w "$cache_file"; then
15641     if test "x$cache_file" != "x/dev/null"; then
15642       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
15643 $as_echo "$as_me: updating cache $cache_file" >&6;}
15644       if test ! -f "$cache_file" || test -h "$cache_file"; then
15645         cat confcache >"$cache_file"
15646       else
15647         case $cache_file in #(
15648         */* | ?:*)
15649           mv -f confcache "$cache_file"$$ &&
15650           mv -f "$cache_file"$$ "$cache_file" ;; #(
15651         *)
15652           mv -f confcache "$cache_file" ;;
15653         esac
15654       fi
15655     fi
15656   else
15657     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
15658 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
15659   fi
15660 fi
15661 rm -f confcache
15662
15663 test "x$prefix" = xNONE && prefix=$ac_default_prefix
15664 # Let make expand exec_prefix.
15665 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
15666
15667 DEFS=-DHAVE_CONFIG_H
15668
15669 ac_libobjs=
15670 ac_ltlibobjs=
15671 U=
15672 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
15673   # 1. Remove the extension, and $U if already installed.
15674   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
15675   ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
15676   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
15677   #    will be set to the directory where LIBOBJS objects are built.
15678   as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
15679   as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
15680 done
15681 LIBOBJS=$ac_libobjs
15682
15683 LTLIBOBJS=$ac_ltlibobjs
15684
15685
15686
15687
15688 : "${CONFIG_STATUS=./config.status}"
15689 ac_write_fail=0
15690 ac_clean_files_save=$ac_clean_files
15691 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
15692 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
15693 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
15694 as_write_fail=0
15695 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
15696 #! $SHELL
15697 # Generated by $as_me.
15698 # Run this file to recreate the current configuration.
15699 # Compiler output produced by configure, useful for debugging
15700 # configure, is in config.log if it exists.
15701
15702 debug=false
15703 ac_cs_recheck=false
15704 ac_cs_silent=false
15705
15706 SHELL=\${CONFIG_SHELL-$SHELL}
15707 export SHELL
15708 _ASEOF
15709 cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
15710 ## -------------------- ##
15711 ## M4sh Initialization. ##
15712 ## -------------------- ##
15713
15714 # Be more Bourne compatible
15715 DUALCASE=1; export DUALCASE # for MKS sh
15716 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
15717   emulate sh
15718   NULLCMD=:
15719   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
15720   # is contrary to our usage.  Disable this feature.
15721   alias -g '${1+"$@"}'='"$@"'
15722   setopt NO_GLOB_SUBST
15723 else
15724   case `(set -o) 2>/dev/null` in #(
15725   *posix*) :
15726     set -o posix ;; #(
15727   *) :
15728      ;;
15729 esac
15730 fi
15731
15732
15733 as_nl='
15734 '
15735 export as_nl
15736 # Printing a long string crashes Solaris 7 /usr/bin/printf.
15737 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
15738 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
15739 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
15740 # Prefer a ksh shell builtin over an external printf program on Solaris,
15741 # but without wasting forks for bash or zsh.
15742 if test -z "$BASH_VERSION$ZSH_VERSION" \
15743     && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
15744   as_echo='print -r --'
15745   as_echo_n='print -rn --'
15746 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
15747   as_echo='printf %s\n'
15748   as_echo_n='printf %s'
15749 else
15750   if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
15751     as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
15752     as_echo_n='/usr/ucb/echo -n'
15753   else
15754     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
15755     as_echo_n_body='eval
15756       arg=$1;
15757       case $arg in #(
15758       *"$as_nl"*)
15759         expr "X$arg" : "X\\(.*\\)$as_nl";
15760         arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
15761       esac;
15762       expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
15763     '
15764     export as_echo_n_body
15765     as_echo_n='sh -c $as_echo_n_body as_echo'
15766   fi
15767   export as_echo_body
15768   as_echo='sh -c $as_echo_body as_echo'
15769 fi
15770
15771 # The user is always right.
15772 if test "${PATH_SEPARATOR+set}" != set; then
15773   PATH_SEPARATOR=:
15774   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
15775     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
15776       PATH_SEPARATOR=';'
15777   }
15778 fi
15779
15780
15781 # IFS
15782 # We need space, tab and new line, in precisely that order.  Quoting is
15783 # there to prevent editors from complaining about space-tab.
15784 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
15785 # splitting by setting IFS to empty value.)
15786 IFS=" ""        $as_nl"
15787
15788 # Find who we are.  Look in the path if we contain no directory separator.
15789 as_myself=
15790 case $0 in #((
15791   *[\\/]* ) as_myself=$0 ;;
15792   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15793 for as_dir in $PATH
15794 do
15795   IFS=$as_save_IFS
15796   test -z "$as_dir" && as_dir=.
15797     test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
15798   done
15799 IFS=$as_save_IFS
15800
15801      ;;
15802 esac
15803 # We did not find ourselves, most probably we were run as `sh COMMAND'
15804 # in which case we are not to be found in the path.
15805 if test "x$as_myself" = x; then
15806   as_myself=$0
15807 fi
15808 if test ! -f "$as_myself"; then
15809   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
15810   exit 1
15811 fi
15812
15813 # Unset variables that we do not need and which cause bugs (e.g. in
15814 # pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
15815 # suppresses any "Segmentation fault" message there.  '((' could
15816 # trigger a bug in pdksh 5.2.14.
15817 for as_var in BASH_ENV ENV MAIL MAILPATH
15818 do eval test x\${$as_var+set} = xset \
15819   && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
15820 done
15821 PS1='$ '
15822 PS2='> '
15823 PS4='+ '
15824
15825 # NLS nuisances.
15826 LC_ALL=C
15827 export LC_ALL
15828 LANGUAGE=C
15829 export LANGUAGE
15830
15831 # CDPATH.
15832 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
15833
15834
15835 # as_fn_error STATUS ERROR [LINENO LOG_FD]
15836 # ----------------------------------------
15837 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
15838 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
15839 # script with STATUS, using 1 if that was 0.
15840 as_fn_error ()
15841 {
15842   as_status=$1; test $as_status -eq 0 && as_status=1
15843   if test "$4"; then
15844     as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
15845     $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
15846   fi
15847   $as_echo "$as_me: error: $2" >&2
15848   as_fn_exit $as_status
15849 } # as_fn_error
15850
15851
15852 # as_fn_set_status STATUS
15853 # -----------------------
15854 # Set $? to STATUS, without forking.
15855 as_fn_set_status ()
15856 {
15857   return $1
15858 } # as_fn_set_status
15859
15860 # as_fn_exit STATUS
15861 # -----------------
15862 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
15863 as_fn_exit ()
15864 {
15865   set +e
15866   as_fn_set_status $1
15867   exit $1
15868 } # as_fn_exit
15869
15870 # as_fn_unset VAR
15871 # ---------------
15872 # Portably unset VAR.
15873 as_fn_unset ()
15874 {
15875   { eval $1=; unset $1;}
15876 }
15877 as_unset=as_fn_unset
15878 # as_fn_append VAR VALUE
15879 # ----------------------
15880 # Append the text in VALUE to the end of the definition contained in VAR. Take
15881 # advantage of any shell optimizations that allow amortized linear growth over
15882 # repeated appends, instead of the typical quadratic growth present in naive
15883 # implementations.
15884 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
15885   eval 'as_fn_append ()
15886   {
15887     eval $1+=\$2
15888   }'
15889 else
15890   as_fn_append ()
15891   {
15892     eval $1=\$$1\$2
15893   }
15894 fi # as_fn_append
15895
15896 # as_fn_arith ARG...
15897 # ------------------
15898 # Perform arithmetic evaluation on the ARGs, and store the result in the
15899 # global $as_val. Take advantage of shells that can avoid forks. The arguments
15900 # must be portable across $(()) and expr.
15901 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
15902   eval 'as_fn_arith ()
15903   {
15904     as_val=$(( $* ))
15905   }'
15906 else
15907   as_fn_arith ()
15908   {
15909     as_val=`expr "$@" || test $? -eq 1`
15910   }
15911 fi # as_fn_arith
15912
15913
15914 if expr a : '\(a\)' >/dev/null 2>&1 &&
15915    test "X`expr 00001 : '.*\(...\)'`" = X001; then
15916   as_expr=expr
15917 else
15918   as_expr=false
15919 fi
15920
15921 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
15922   as_basename=basename
15923 else
15924   as_basename=false
15925 fi
15926
15927 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
15928   as_dirname=dirname
15929 else
15930   as_dirname=false
15931 fi
15932
15933 as_me=`$as_basename -- "$0" ||
15934 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
15935          X"$0" : 'X\(//\)$' \| \
15936          X"$0" : 'X\(/\)' \| . 2>/dev/null ||
15937 $as_echo X/"$0" |
15938     sed '/^.*\/\([^/][^/]*\)\/*$/{
15939             s//\1/
15940             q
15941           }
15942           /^X\/\(\/\/\)$/{
15943             s//\1/
15944             q
15945           }
15946           /^X\/\(\/\).*/{
15947             s//\1/
15948             q
15949           }
15950           s/.*/./; q'`
15951
15952 # Avoid depending upon Character Ranges.
15953 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
15954 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
15955 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15956 as_cr_digits='0123456789'
15957 as_cr_alnum=$as_cr_Letters$as_cr_digits
15958
15959 ECHO_C= ECHO_N= ECHO_T=
15960 case `echo -n x` in #(((((
15961 -n*)
15962   case `echo 'xy\c'` in
15963   *c*) ECHO_T=' ';;     # ECHO_T is single tab character.
15964   xy)  ECHO_C='\c';;
15965   *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
15966        ECHO_T=' ';;
15967   esac;;
15968 *)
15969   ECHO_N='-n';;
15970 esac
15971
15972 rm -f conf$$ conf$$.exe conf$$.file
15973 if test -d conf$$.dir; then
15974   rm -f conf$$.dir/conf$$.file
15975 else
15976   rm -f conf$$.dir
15977   mkdir conf$$.dir 2>/dev/null
15978 fi
15979 if (echo >conf$$.file) 2>/dev/null; then
15980   if ln -s conf$$.file conf$$ 2>/dev/null; then
15981     as_ln_s='ln -s'
15982     # ... but there are two gotchas:
15983     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
15984     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
15985     # In both cases, we have to default to `cp -pR'.
15986     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
15987       as_ln_s='cp -pR'
15988   elif ln conf$$.file conf$$ 2>/dev/null; then
15989     as_ln_s=ln
15990   else
15991     as_ln_s='cp -pR'
15992   fi
15993 else
15994   as_ln_s='cp -pR'
15995 fi
15996 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
15997 rmdir conf$$.dir 2>/dev/null
15998
15999
16000 # as_fn_mkdir_p
16001 # -------------
16002 # Create "$as_dir" as a directory, including parents if necessary.
16003 as_fn_mkdir_p ()
16004 {
16005
16006   case $as_dir in #(
16007   -*) as_dir=./$as_dir;;
16008   esac
16009   test -d "$as_dir" || eval $as_mkdir_p || {
16010     as_dirs=
16011     while :; do
16012       case $as_dir in #(
16013       *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
16014       *) as_qdir=$as_dir;;
16015       esac
16016       as_dirs="'$as_qdir' $as_dirs"
16017       as_dir=`$as_dirname -- "$as_dir" ||
16018 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16019          X"$as_dir" : 'X\(//\)[^/]' \| \
16020          X"$as_dir" : 'X\(//\)$' \| \
16021          X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
16022 $as_echo X"$as_dir" |
16023     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
16024             s//\1/
16025             q
16026           }
16027           /^X\(\/\/\)[^/].*/{
16028             s//\1/
16029             q
16030           }
16031           /^X\(\/\/\)$/{
16032             s//\1/
16033             q
16034           }
16035           /^X\(\/\).*/{
16036             s//\1/
16037             q
16038           }
16039           s/.*/./; q'`
16040       test -d "$as_dir" && break
16041     done
16042     test -z "$as_dirs" || eval "mkdir $as_dirs"
16043   } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
16044
16045
16046 } # as_fn_mkdir_p
16047 if mkdir -p . 2>/dev/null; then
16048   as_mkdir_p='mkdir -p "$as_dir"'
16049 else
16050   test -d ./-p && rmdir ./-p
16051   as_mkdir_p=false
16052 fi
16053
16054
16055 # as_fn_executable_p FILE
16056 # -----------------------
16057 # Test if FILE is an executable regular file.
16058 as_fn_executable_p ()
16059 {
16060   test -f "$1" && test -x "$1"
16061 } # as_fn_executable_p
16062 as_test_x='test -x'
16063 as_executable_p=as_fn_executable_p
16064
16065 # Sed expression to map a string onto a valid CPP name.
16066 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
16067
16068 # Sed expression to map a string onto a valid variable name.
16069 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
16070
16071
16072 exec 6>&1
16073 ## ----------------------------------- ##
16074 ## Main body of $CONFIG_STATUS script. ##
16075 ## ----------------------------------- ##
16076 _ASEOF
16077 test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
16078
16079 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16080 # Save the log message, to keep $0 and so on meaningful, and to
16081 # report actual input values of CONFIG_FILES etc. instead of their
16082 # values after options handling.
16083 ac_log="
16084 This file was extended by PostgreSQL $as_me 9.6devel, which was
16085 generated by GNU Autoconf 2.69.  Invocation command line was
16086
16087   CONFIG_FILES    = $CONFIG_FILES
16088   CONFIG_HEADERS  = $CONFIG_HEADERS
16089   CONFIG_LINKS    = $CONFIG_LINKS
16090   CONFIG_COMMANDS = $CONFIG_COMMANDS
16091   $ $0 $@
16092
16093 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16094 "
16095
16096 _ACEOF
16097
16098 case $ac_config_files in *"
16099 "*) set x $ac_config_files; shift; ac_config_files=$*;;
16100 esac
16101
16102 case $ac_config_headers in *"
16103 "*) set x $ac_config_headers; shift; ac_config_headers=$*;;
16104 esac
16105
16106
16107 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16108 # Files that config.status was made for.
16109 config_files="$ac_config_files"
16110 config_headers="$ac_config_headers"
16111 config_links="$ac_config_links"
16112 config_commands="$ac_config_commands"
16113
16114 _ACEOF
16115
16116 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16117 ac_cs_usage="\
16118 \`$as_me' instantiates files and other configuration actions
16119 from templates according to the current configuration.  Unless the files
16120 and actions are specified as TAGs, all are instantiated by default.
16121
16122 Usage: $0 [OPTION]... [TAG]...
16123
16124   -h, --help       print this help, then exit
16125   -V, --version    print version number and configuration settings, then exit
16126       --config     print configuration, then exit
16127   -q, --quiet, --silent
16128                    do not print progress messages
16129   -d, --debug      don't remove temporary files
16130       --recheck    update $as_me by reconfiguring in the same conditions
16131       --file=FILE[:TEMPLATE]
16132                    instantiate the configuration file FILE
16133       --header=FILE[:TEMPLATE]
16134                    instantiate the configuration header FILE
16135
16136 Configuration files:
16137 $config_files
16138
16139 Configuration headers:
16140 $config_headers
16141
16142 Configuration links:
16143 $config_links
16144
16145 Configuration commands:
16146 $config_commands
16147
16148 Report bugs to <pgsql-bugs@postgresql.org>."
16149
16150 _ACEOF
16151 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16152 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
16153 ac_cs_version="\\
16154 PostgreSQL config.status 9.6devel
16155 configured by $0, generated by GNU Autoconf 2.69,
16156   with options \\"\$ac_cs_config\\"
16157
16158 Copyright (C) 2012 Free Software Foundation, Inc.
16159 This config.status script is free software; the Free Software Foundation
16160 gives unlimited permission to copy, distribute and modify it."
16161
16162 ac_pwd='$ac_pwd'
16163 srcdir='$srcdir'
16164 INSTALL='$INSTALL'
16165 MKDIR_P='$MKDIR_P'
16166 AWK='$AWK'
16167 test -n "\$AWK" || AWK=awk
16168 _ACEOF
16169
16170 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16171 # The default lists apply if the user does not specify any file.
16172 ac_need_defaults=:
16173 while test $# != 0
16174 do
16175   case $1 in
16176   --*=?*)
16177     ac_option=`expr "X$1" : 'X\([^=]*\)='`
16178     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
16179     ac_shift=:
16180     ;;
16181   --*=)
16182     ac_option=`expr "X$1" : 'X\([^=]*\)='`
16183     ac_optarg=
16184     ac_shift=:
16185     ;;
16186   *)
16187     ac_option=$1
16188     ac_optarg=$2
16189     ac_shift=shift
16190     ;;
16191   esac
16192
16193   case $ac_option in
16194   # Handling of the options.
16195   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16196     ac_cs_recheck=: ;;
16197   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
16198     $as_echo "$ac_cs_version"; exit ;;
16199   --config | --confi | --conf | --con | --co | --c )
16200     $as_echo "$ac_cs_config"; exit ;;
16201   --debug | --debu | --deb | --de | --d | -d )
16202     debug=: ;;
16203   --file | --fil | --fi | --f )
16204     $ac_shift
16205     case $ac_optarg in
16206     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
16207     '') as_fn_error $? "missing file argument" ;;
16208     esac
16209     as_fn_append CONFIG_FILES " '$ac_optarg'"
16210     ac_need_defaults=false;;
16211   --header | --heade | --head | --hea )
16212     $ac_shift
16213     case $ac_optarg in
16214     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
16215     esac
16216     as_fn_append CONFIG_HEADERS " '$ac_optarg'"
16217     ac_need_defaults=false;;
16218   --he | --h)
16219     # Conflict between --help and --header
16220     as_fn_error $? "ambiguous option: \`$1'
16221 Try \`$0 --help' for more information.";;
16222   --help | --hel | -h )
16223     $as_echo "$ac_cs_usage"; exit ;;
16224   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
16225   | -silent | --silent | --silen | --sile | --sil | --si | --s)
16226     ac_cs_silent=: ;;
16227
16228   # This is an error.
16229   -*) as_fn_error $? "unrecognized option: \`$1'
16230 Try \`$0 --help' for more information." ;;
16231
16232   *) as_fn_append ac_config_targets " $1"
16233      ac_need_defaults=false ;;
16234
16235   esac
16236   shift
16237 done
16238
16239 ac_configure_extra_args=
16240
16241 if $ac_cs_silent; then
16242   exec 6>/dev/null
16243   ac_configure_extra_args="$ac_configure_extra_args --silent"
16244 fi
16245
16246 _ACEOF
16247 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16248 if \$ac_cs_recheck; then
16249   set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
16250   shift
16251   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
16252   CONFIG_SHELL='$SHELL'
16253   export CONFIG_SHELL
16254   exec "\$@"
16255 fi
16256
16257 _ACEOF
16258 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16259 exec 5>>config.log
16260 {
16261   echo
16262   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
16263 ## Running $as_me. ##
16264 _ASBOX
16265   $as_echo "$ac_log"
16266 } >&5
16267
16268 _ACEOF
16269 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16270 _ACEOF
16271
16272 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16273
16274 # Handling of arguments.
16275 for ac_config_target in $ac_config_targets
16276 do
16277   case $ac_config_target in
16278     "src/backend/port/tas.s") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/tas.s:src/backend/port/tas/${tas_file}" ;;
16279     "GNUmakefile") CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;;
16280     "src/Makefile.global") CONFIG_FILES="$CONFIG_FILES src/Makefile.global" ;;
16281     "src/backend/port/dynloader.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c" ;;
16282     "src/backend/port/pg_sema.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}" ;;
16283     "src/backend/port/pg_shmem.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}" ;;
16284     "src/backend/port/pg_latch.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_latch.c:${LATCH_IMPLEMENTATION}" ;;
16285     "src/include/dynloader.h") CONFIG_LINKS="$CONFIG_LINKS src/include/dynloader.h:src/backend/port/dynloader/${template}.h" ;;
16286     "src/include/pg_config_os.h") CONFIG_LINKS="$CONFIG_LINKS src/include/pg_config_os.h:src/include/port/${template}.h" ;;
16287     "src/Makefile.port") CONFIG_LINKS="$CONFIG_LINKS src/Makefile.port:src/makefiles/Makefile.${template}" ;;
16288     "check_win32_symlinks") CONFIG_COMMANDS="$CONFIG_COMMANDS check_win32_symlinks" ;;
16289     "src/include/pg_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config.h" ;;
16290     "src/include/pg_config_ext.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config_ext.h" ;;
16291     "src/interfaces/ecpg/include/ecpg_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/interfaces/ecpg/include/ecpg_config.h" ;;
16292
16293   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
16294   esac
16295 done
16296
16297
16298 # If the user did not use the arguments to specify the items to instantiate,
16299 # then the envvar interface is used.  Set only those that are not.
16300 # We use the long form for the default assignment because of an extremely
16301 # bizarre bug on SunOS 4.1.3.
16302 if $ac_need_defaults; then
16303   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16304   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16305   test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
16306   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16307 fi
16308
16309 # Have a temporary directory for convenience.  Make it in the build tree
16310 # simply because there is no reason against having it here, and in addition,
16311 # creating and moving files from /tmp can sometimes cause problems.
16312 # Hook for its removal unless debugging.
16313 # Note that there is a small window in which the directory will not be cleaned:
16314 # after its creation but before its name has been assigned to `$tmp'.
16315 $debug ||
16316 {
16317   tmp= ac_tmp=
16318   trap 'exit_status=$?
16319   : "${ac_tmp:=$tmp}"
16320   { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
16321 ' 0
16322   trap 'as_fn_exit 1' 1 2 13 15
16323 }
16324 # Create a (secure) tmp directory for tmp files.
16325
16326 {
16327   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
16328   test -d "$tmp"
16329 }  ||
16330 {
16331   tmp=./conf$$-$RANDOM
16332   (umask 077 && mkdir "$tmp")
16333 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
16334 ac_tmp=$tmp
16335
16336 # Set up the scripts for CONFIG_FILES section.
16337 # No need to generate them if there are no CONFIG_FILES.
16338 # This happens for instance with `./config.status config.h'.
16339 if test -n "$CONFIG_FILES"; then
16340
16341
16342 ac_cr=`echo X | tr X '\015'`
16343 # On cygwin, bash can eat \r inside `` if the user requested igncr.
16344 # But we know of no other shell where ac_cr would be empty at this
16345 # point, so we can use a bashism as a fallback.
16346 if test "x$ac_cr" = x; then
16347   eval ac_cr=\$\'\\r\'
16348 fi
16349 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
16350 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
16351   ac_cs_awk_cr='\\r'
16352 else
16353   ac_cs_awk_cr=$ac_cr
16354 fi
16355
16356 echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
16357 _ACEOF
16358
16359
16360 {
16361   echo "cat >conf$$subs.awk <<_ACEOF" &&
16362   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
16363   echo "_ACEOF"
16364 } >conf$$subs.sh ||
16365   as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
16366 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
16367 ac_delim='%!_!# '
16368 for ac_last_try in false false false false false :; do
16369   . ./conf$$subs.sh ||
16370     as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
16371
16372   ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
16373   if test $ac_delim_n = $ac_delim_num; then
16374     break
16375   elif $ac_last_try; then
16376     as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
16377   else
16378     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
16379   fi
16380 done
16381 rm -f conf$$subs.sh
16382
16383 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16384 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
16385 _ACEOF
16386 sed -n '
16387 h
16388 s/^/S["/; s/!.*/"]=/
16389 p
16390 g
16391 s/^[^!]*!//
16392 :repl
16393 t repl
16394 s/'"$ac_delim"'$//
16395 t delim
16396 :nl
16397 h
16398 s/\(.\{148\}\)..*/\1/
16399 t more1
16400 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
16401 p
16402 n
16403 b repl
16404 :more1
16405 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
16406 p
16407 g
16408 s/.\{148\}//
16409 t nl
16410 :delim
16411 h
16412 s/\(.\{148\}\)..*/\1/
16413 t more2
16414 s/["\\]/\\&/g; s/^/"/; s/$/"/
16415 p
16416 b
16417 :more2
16418 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
16419 p
16420 g
16421 s/.\{148\}//
16422 t delim
16423 ' <conf$$subs.awk | sed '
16424 /^[^""]/{
16425   N
16426   s/\n//
16427 }
16428 ' >>$CONFIG_STATUS || ac_write_fail=1
16429 rm -f conf$$subs.awk
16430 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16431 _ACAWK
16432 cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
16433   for (key in S) S_is_set[key] = 1
16434   FS = "\a"
16435
16436 }
16437 {
16438   line = $ 0
16439   nfields = split(line, field, "@")
16440   substed = 0
16441   len = length(field[1])
16442   for (i = 2; i < nfields; i++) {
16443     key = field[i]
16444     keylen = length(key)
16445     if (S_is_set[key]) {
16446       value = S[key]
16447       line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
16448       len += length(value) + length(field[++i])
16449       substed = 1
16450     } else
16451       len += 1 + keylen
16452   }
16453
16454   print line
16455 }
16456
16457 _ACAWK
16458 _ACEOF
16459 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16460 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
16461   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
16462 else
16463   cat
16464 fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
16465   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
16466 _ACEOF
16467
16468 # VPATH may cause trouble with some makes, so we remove sole $(srcdir),
16469 # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
16470 # trailing colons and then remove the whole line if VPATH becomes empty
16471 # (actually we leave an empty line to preserve line numbers).
16472 if test "x$srcdir" = x.; then
16473   ac_vpsub='/^[  ]*VPATH[        ]*=[    ]*/{
16474 h
16475 s///
16476 s/^/:/
16477 s/[      ]*$/:/
16478 s/:\$(srcdir):/:/g
16479 s/:\${srcdir}:/:/g
16480 s/:@srcdir@:/:/g
16481 s/^:*//
16482 s/:*$//
16483 x
16484 s/\(=[   ]*\).*/\1/
16485 G
16486 s/\n//
16487 s/^[^=]*=[       ]*$//
16488 }'
16489 fi
16490
16491 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16492 fi # test -n "$CONFIG_FILES"
16493
16494 # Set up the scripts for CONFIG_HEADERS section.
16495 # No need to generate them if there are no CONFIG_HEADERS.
16496 # This happens for instance with `./config.status Makefile'.
16497 if test -n "$CONFIG_HEADERS"; then
16498 cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
16499 BEGIN {
16500 _ACEOF
16501
16502 # Transform confdefs.h into an awk script `defines.awk', embedded as
16503 # here-document in config.status, that substitutes the proper values into
16504 # config.h.in to produce config.h.
16505
16506 # Create a delimiter string that does not exist in confdefs.h, to ease
16507 # handling of long lines.
16508 ac_delim='%!_!# '
16509 for ac_last_try in false false :; do
16510   ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
16511   if test -z "$ac_tt"; then
16512     break
16513   elif $ac_last_try; then
16514     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
16515   else
16516     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
16517   fi
16518 done
16519
16520 # For the awk script, D is an array of macro values keyed by name,
16521 # likewise P contains macro parameters if any.  Preserve backslash
16522 # newline sequences.
16523
16524 ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
16525 sed -n '
16526 s/.\{148\}/&'"$ac_delim"'/g
16527 t rset
16528 :rset
16529 s/^[     ]*#[    ]*define[       ][      ]*/ /
16530 t def
16531 d
16532 :def
16533 s/\\$//
16534 t bsnl
16535 s/["\\]/\\&/g
16536 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
16537 D["\1"]=" \3"/p
16538 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2"/p
16539 d
16540 :bsnl
16541 s/["\\]/\\&/g
16542 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
16543 D["\1"]=" \3\\\\\\n"\\/p
16544 t cont
16545 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
16546 t cont
16547 d
16548 :cont
16549 n
16550 s/.\{148\}/&'"$ac_delim"'/g
16551 t clear
16552 :clear
16553 s/\\$//
16554 t bsnlc
16555 s/["\\]/\\&/g; s/^/"/; s/$/"/p
16556 d
16557 :bsnlc
16558 s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
16559 b cont
16560 ' <confdefs.h | sed '
16561 s/'"$ac_delim"'/"\\\
16562 "/g' >>$CONFIG_STATUS || ac_write_fail=1
16563
16564 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16565   for (key in D) D_is_set[key] = 1
16566   FS = "\a"
16567 }
16568 /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
16569   line = \$ 0
16570   split(line, arg, " ")
16571   if (arg[1] == "#") {
16572     defundef = arg[2]
16573     mac1 = arg[3]
16574   } else {
16575     defundef = substr(arg[1], 2)
16576     mac1 = arg[2]
16577   }
16578   split(mac1, mac2, "(") #)
16579   macro = mac2[1]
16580   prefix = substr(line, 1, index(line, defundef) - 1)
16581   if (D_is_set[macro]) {
16582     # Preserve the white space surrounding the "#".
16583     print prefix "define", macro P[macro] D[macro]
16584     next
16585   } else {
16586     # Replace #undef with comments.  This is necessary, for example,
16587     # in the case of _POSIX_SOURCE, which is predefined and required
16588     # on some systems where configure will not decide to define it.
16589     if (defundef == "undef") {
16590       print "/*", prefix defundef, macro, "*/"
16591       next
16592     }
16593   }
16594 }
16595 { print }
16596 _ACAWK
16597 _ACEOF
16598 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16599   as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
16600 fi # test -n "$CONFIG_HEADERS"
16601
16602
16603 eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS  :L $CONFIG_LINKS  :C $CONFIG_COMMANDS"
16604 shift
16605 for ac_tag
16606 do
16607   case $ac_tag in
16608   :[FHLC]) ac_mode=$ac_tag; continue;;
16609   esac
16610   case $ac_mode$ac_tag in
16611   :[FHL]*:*);;
16612   :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
16613   :[FH]-) ac_tag=-:-;;
16614   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
16615   esac
16616   ac_save_IFS=$IFS
16617   IFS=:
16618   set x $ac_tag
16619   IFS=$ac_save_IFS
16620   shift
16621   ac_file=$1
16622   shift
16623
16624   case $ac_mode in
16625   :L) ac_source=$1;;
16626   :[FH])
16627     ac_file_inputs=
16628     for ac_f
16629     do
16630       case $ac_f in
16631       -) ac_f="$ac_tmp/stdin";;
16632       *) # Look for the file first in the build tree, then in the source tree
16633          # (if the path is not absolute).  The absolute path cannot be DOS-style,
16634          # because $ac_f cannot contain `:'.
16635          test -f "$ac_f" ||
16636            case $ac_f in
16637            [\\/$]*) false;;
16638            *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
16639            esac ||
16640            as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
16641       esac
16642       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
16643       as_fn_append ac_file_inputs " '$ac_f'"
16644     done
16645
16646     # Let's still pretend it is `configure' which instantiates (i.e., don't
16647     # use $as_me), people would be surprised to read:
16648     #    /* config.h.  Generated by config.status.  */
16649     configure_input='Generated from '`
16650           $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
16651         `' by configure.'
16652     if test x"$ac_file" != x-; then
16653       configure_input="$ac_file.  $configure_input"
16654       { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
16655 $as_echo "$as_me: creating $ac_file" >&6;}
16656     fi
16657     # Neutralize special characters interpreted by sed in replacement strings.
16658     case $configure_input in #(
16659     *\&* | *\|* | *\\* )
16660        ac_sed_conf_input=`$as_echo "$configure_input" |
16661        sed 's/[\\\\&|]/\\\\&/g'`;; #(
16662     *) ac_sed_conf_input=$configure_input;;
16663     esac
16664
16665     case $ac_tag in
16666     *:-:* | *:-) cat >"$ac_tmp/stdin" \
16667       || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
16668     esac
16669     ;;
16670   esac
16671
16672   ac_dir=`$as_dirname -- "$ac_file" ||
16673 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16674          X"$ac_file" : 'X\(//\)[^/]' \| \
16675          X"$ac_file" : 'X\(//\)$' \| \
16676          X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
16677 $as_echo X"$ac_file" |
16678     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
16679             s//\1/
16680             q
16681           }
16682           /^X\(\/\/\)[^/].*/{
16683             s//\1/
16684             q
16685           }
16686           /^X\(\/\/\)$/{
16687             s//\1/
16688             q
16689           }
16690           /^X\(\/\).*/{
16691             s//\1/
16692             q
16693           }
16694           s/.*/./; q'`
16695   as_dir="$ac_dir"; as_fn_mkdir_p
16696   ac_builddir=.
16697
16698 case "$ac_dir" in
16699 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
16700 *)
16701   ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
16702   # A ".." for each directory in $ac_dir_suffix.
16703   ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
16704   case $ac_top_builddir_sub in
16705   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
16706   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
16707   esac ;;
16708 esac
16709 ac_abs_top_builddir=$ac_pwd
16710 ac_abs_builddir=$ac_pwd$ac_dir_suffix
16711 # for backward compatibility:
16712 ac_top_builddir=$ac_top_build_prefix
16713
16714 case $srcdir in
16715   .)  # We are building in place.
16716     ac_srcdir=.
16717     ac_top_srcdir=$ac_top_builddir_sub
16718     ac_abs_top_srcdir=$ac_pwd ;;
16719   [\\/]* | ?:[\\/]* )  # Absolute name.
16720     ac_srcdir=$srcdir$ac_dir_suffix;
16721     ac_top_srcdir=$srcdir
16722     ac_abs_top_srcdir=$srcdir ;;
16723   *) # Relative name.
16724     ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
16725     ac_top_srcdir=$ac_top_build_prefix$srcdir
16726     ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
16727 esac
16728 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
16729
16730
16731   case $ac_mode in
16732   :F)
16733   #
16734   # CONFIG_FILE
16735   #
16736
16737   case $INSTALL in
16738   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
16739   *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
16740   esac
16741   ac_MKDIR_P=$MKDIR_P
16742   case $MKDIR_P in
16743   [\\/$]* | ?:[\\/]* ) ;;
16744   */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
16745   esac
16746 _ACEOF
16747
16748 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16749 # If the template does not know about datarootdir, expand it.
16750 # FIXME: This hack should be removed a few years after 2.60.
16751 ac_datarootdir_hack=; ac_datarootdir_seen=
16752 ac_sed_dataroot='
16753 /datarootdir/ {
16754   p
16755   q
16756 }
16757 /@datadir@/p
16758 /@docdir@/p
16759 /@infodir@/p
16760 /@localedir@/p
16761 /@mandir@/p'
16762 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
16763 *datarootdir*) ac_datarootdir_seen=yes;;
16764 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
16765   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
16766 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
16767 _ACEOF
16768 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16769   ac_datarootdir_hack='
16770   s&@datadir@&$datadir&g
16771   s&@docdir@&$docdir&g
16772   s&@infodir@&$infodir&g
16773   s&@localedir@&$localedir&g
16774   s&@mandir@&$mandir&g
16775   s&\\\${datarootdir}&$datarootdir&g' ;;
16776 esac
16777 _ACEOF
16778
16779 # Neutralize VPATH when `$srcdir' = `.'.
16780 # Shell code in configure.ac might set extrasub.
16781 # FIXME: do we really want to maintain this feature?
16782 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16783 ac_sed_extra="$ac_vpsub
16784 $extrasub
16785 _ACEOF
16786 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16787 :t
16788 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
16789 s|@configure_input@|$ac_sed_conf_input|;t t
16790 s&@top_builddir@&$ac_top_builddir_sub&;t t
16791 s&@top_build_prefix@&$ac_top_build_prefix&;t t
16792 s&@srcdir@&$ac_srcdir&;t t
16793 s&@abs_srcdir@&$ac_abs_srcdir&;t t
16794 s&@top_srcdir@&$ac_top_srcdir&;t t
16795 s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
16796 s&@builddir@&$ac_builddir&;t t
16797 s&@abs_builddir@&$ac_abs_builddir&;t t
16798 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
16799 s&@INSTALL@&$ac_INSTALL&;t t
16800 s&@MKDIR_P@&$ac_MKDIR_P&;t t
16801 $ac_datarootdir_hack
16802 "
16803 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
16804   >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
16805
16806 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
16807   { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
16808   { ac_out=`sed -n '/^[  ]*datarootdir[  ]*:*=/p' \
16809       "$ac_tmp/out"`; test -z "$ac_out"; } &&
16810   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
16811 which seems to be undefined.  Please make sure it is defined" >&5
16812 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
16813 which seems to be undefined.  Please make sure it is defined" >&2;}
16814
16815   rm -f "$ac_tmp/stdin"
16816   case $ac_file in
16817   -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
16818   *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
16819   esac \
16820   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
16821  ;;
16822   :H)
16823   #
16824   # CONFIG_HEADER
16825   #
16826   if test x"$ac_file" != x-; then
16827     {
16828       $as_echo "/* $configure_input  */" \
16829       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
16830     } >"$ac_tmp/config.h" \
16831       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
16832     if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
16833       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
16834 $as_echo "$as_me: $ac_file is unchanged" >&6;}
16835     else
16836       rm -f "$ac_file"
16837       mv "$ac_tmp/config.h" "$ac_file" \
16838         || as_fn_error $? "could not create $ac_file" "$LINENO" 5
16839     fi
16840   else
16841     $as_echo "/* $configure_input  */" \
16842       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
16843       || as_fn_error $? "could not create -" "$LINENO" 5
16844   fi
16845  ;;
16846   :L)
16847   #
16848   # CONFIG_LINK
16849   #
16850
16851   if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
16852     :
16853   else
16854     # Prefer the file from the source tree if names are identical.
16855     if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
16856       ac_source=$srcdir/$ac_source
16857     fi
16858
16859     { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
16860 $as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
16861
16862     if test ! -r "$ac_source"; then
16863       as_fn_error $? "$ac_source: file not found" "$LINENO" 5
16864     fi
16865     rm -f "$ac_file"
16866
16867     # Try a relative symlink, then a hard link, then a copy.
16868     case $ac_source in
16869     [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
16870         *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
16871     esac
16872     ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
16873       ln "$ac_source" "$ac_file" 2>/dev/null ||
16874       cp -p "$ac_source" "$ac_file" ||
16875       as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
16876   fi
16877  ;;
16878   :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
16879 $as_echo "$as_me: executing $ac_file commands" >&6;}
16880  ;;
16881   esac
16882
16883
16884   case $ac_file$ac_mode in
16885     "check_win32_symlinks":C)
16886 # Links sometimes fail undetected on Mingw -
16887 # so here we detect it and warn the user
16888 for FILE in $CONFIG_LINKS
16889  do
16890         # test -e works for symlinks in the MinGW console
16891         test -e `expr "$FILE" : '\([^:]*\)'` || { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** link for $FILE -- please fix by hand" >&5
16892 $as_echo "$as_me: WARNING: *** link for $FILE -- please fix by hand" >&2;}
16893  done
16894  ;;
16895     "src/include/pg_config.h":H)
16896 # Update timestamp for pg_config.h (see Makefile.global)
16897 echo >src/include/stamp-h
16898  ;;
16899     "src/include/pg_config_ext.h":H)
16900 # Update timestamp for pg_config_ext.h (see Makefile.global)
16901 echo >src/include/stamp-ext-h
16902  ;;
16903     "src/interfaces/ecpg/include/ecpg_config.h":H) echo >src/interfaces/ecpg/include/stamp-h ;;
16904
16905   esac
16906 done # for ac_tag
16907
16908
16909 as_fn_exit 0
16910 _ACEOF
16911 ac_clean_files=$ac_clean_files_save
16912
16913 test $ac_write_fail = 0 ||
16914   as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
16915
16916
16917 # configure is writing to config.log, and then calls config.status.
16918 # config.status does its own redirection, appending to config.log.
16919 # Unfortunately, on DOS this fails, as config.log is still kept open
16920 # by configure, so config.status won't be able to write to it; its
16921 # output is simply discarded.  So we exec the FD to /dev/null,
16922 # effectively closing config.log, so it can be properly (re)opened and
16923 # appended to by config.status.  When coming back to configure, we
16924 # need to make the FD available again.
16925 if test "$no_create" != yes; then
16926   ac_cs_success=:
16927   ac_config_status_args=
16928   test "$silent" = yes &&
16929     ac_config_status_args="$ac_config_status_args --quiet"
16930   exec 5>/dev/null
16931   $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
16932   exec 5>>config.log
16933   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
16934   # would make configure fail if this is the last instruction.
16935   $ac_cs_success || as_fn_exit 1
16936 fi
16937 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
16938   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
16939 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
16940 fi
16941