]> granicus.if.org Git - postgresql/blob - configure
Replace references to COLLATE "en_US" with COLLATE "C".
[postgresql] / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by GNU Autoconf 2.69 for PostgreSQL 10devel.
4 #
5 # Report bugs to <pgsql-bugs@postgresql.org>.
6 #
7 #
8 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
9 #
10 #
11 # This configure script is free software; the Free Software Foundation
12 # gives unlimited permission to copy, distribute and modify it.
13 #
14 # Copyright (c) 1996-2016, PostgreSQL Global Development Group
15 ## -------------------- ##
16 ## M4sh Initialization. ##
17 ## -------------------- ##
18
19 # Be more Bourne compatible
20 DUALCASE=1; export DUALCASE # for MKS sh
21 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
22   emulate sh
23   NULLCMD=:
24   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
25   # is contrary to our usage.  Disable this feature.
26   alias -g '${1+"$@"}'='"$@"'
27   setopt NO_GLOB_SUBST
28 else
29   case `(set -o) 2>/dev/null` in #(
30   *posix*) :
31     set -o posix ;; #(
32   *) :
33      ;;
34 esac
35 fi
36
37
38 as_nl='
39 '
40 export as_nl
41 # Printing a long string crashes Solaris 7 /usr/bin/printf.
42 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
43 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
44 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
45 # Prefer a ksh shell builtin over an external printf program on Solaris,
46 # but without wasting forks for bash or zsh.
47 if test -z "$BASH_VERSION$ZSH_VERSION" \
48     && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
49   as_echo='print -r --'
50   as_echo_n='print -rn --'
51 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
52   as_echo='printf %s\n'
53   as_echo_n='printf %s'
54 else
55   if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
56     as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
57     as_echo_n='/usr/ucb/echo -n'
58   else
59     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
60     as_echo_n_body='eval
61       arg=$1;
62       case $arg in #(
63       *"$as_nl"*)
64         expr "X$arg" : "X\\(.*\\)$as_nl";
65         arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
66       esac;
67       expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
68     '
69     export as_echo_n_body
70     as_echo_n='sh -c $as_echo_n_body as_echo'
71   fi
72   export as_echo_body
73   as_echo='sh -c $as_echo_body as_echo'
74 fi
75
76 # The user is always right.
77 if test "${PATH_SEPARATOR+set}" != set; then
78   PATH_SEPARATOR=:
79   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
80     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
81       PATH_SEPARATOR=';'
82   }
83 fi
84
85
86 # IFS
87 # We need space, tab and new line, in precisely that order.  Quoting is
88 # there to prevent editors from complaining about space-tab.
89 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
90 # splitting by setting IFS to empty value.)
91 IFS=" ""        $as_nl"
92
93 # Find who we are.  Look in the path if we contain no directory separator.
94 as_myself=
95 case $0 in #((
96   *[\\/]* ) as_myself=$0 ;;
97   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
98 for as_dir in $PATH
99 do
100   IFS=$as_save_IFS
101   test -z "$as_dir" && as_dir=.
102     test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
103   done
104 IFS=$as_save_IFS
105
106      ;;
107 esac
108 # We did not find ourselves, most probably we were run as `sh COMMAND'
109 # in which case we are not to be found in the path.
110 if test "x$as_myself" = x; then
111   as_myself=$0
112 fi
113 if test ! -f "$as_myself"; then
114   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
115   exit 1
116 fi
117
118 # Unset variables that we do not need and which cause bugs (e.g. in
119 # pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
120 # suppresses any "Segmentation fault" message there.  '((' could
121 # trigger a bug in pdksh 5.2.14.
122 for as_var in BASH_ENV ENV MAIL MAILPATH
123 do eval test x\${$as_var+set} = xset \
124   && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
125 done
126 PS1='$ '
127 PS2='> '
128 PS4='+ '
129
130 # NLS nuisances.
131 LC_ALL=C
132 export LC_ALL
133 LANGUAGE=C
134 export LANGUAGE
135
136 # CDPATH.
137 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
138
139 # Use a proper internal environment variable to ensure we don't fall
140   # into an infinite loop, continuously re-executing ourselves.
141   if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
142     _as_can_reexec=no; export _as_can_reexec;
143     # We cannot yet assume a decent shell, so we have to provide a
144 # neutralization value for shells without unset; and this also
145 # works around shells that cannot unset nonexistent variables.
146 # Preserve -v and -x to the replacement shell.
147 BASH_ENV=/dev/null
148 ENV=/dev/null
149 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
150 case $- in # ((((
151   *v*x* | *x*v* ) as_opts=-vx ;;
152   *v* ) as_opts=-v ;;
153   *x* ) as_opts=-x ;;
154   * ) as_opts= ;;
155 esac
156 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
157 # Admittedly, this is quite paranoid, since all the known shells bail
158 # out after a failed `exec'.
159 $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
160 as_fn_exit 255
161   fi
162   # We don't want this to propagate to other subprocesses.
163           { _as_can_reexec=; unset _as_can_reexec;}
164 if test "x$CONFIG_SHELL" = x; then
165   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
166   emulate sh
167   NULLCMD=:
168   # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
169   # is contrary to our usage.  Disable this feature.
170   alias -g '\${1+\"\$@\"}'='\"\$@\"'
171   setopt NO_GLOB_SUBST
172 else
173   case \`(set -o) 2>/dev/null\` in #(
174   *posix*) :
175     set -o posix ;; #(
176   *) :
177      ;;
178 esac
179 fi
180 "
181   as_required="as_fn_return () { (exit \$1); }
182 as_fn_success () { as_fn_return 0; }
183 as_fn_failure () { as_fn_return 1; }
184 as_fn_ret_success () { return 0; }
185 as_fn_ret_failure () { return 1; }
186
187 exitcode=0
188 as_fn_success || { exitcode=1; echo as_fn_success failed.; }
189 as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
190 as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
191 as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
192 if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
193
194 else
195   exitcode=1; echo positional parameters were not saved.
196 fi
197 test x\$exitcode = x0 || exit 1
198 test -x / || exit 1"
199   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
200   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
201   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
202   test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
203 test \$(( 1 + 1 )) = 2 || exit 1"
204   if (eval "$as_required") 2>/dev/null; then :
205   as_have_required=yes
206 else
207   as_have_required=no
208 fi
209   if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
210
211 else
212   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
213 as_found=false
214 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
215 do
216   IFS=$as_save_IFS
217   test -z "$as_dir" && as_dir=.
218   as_found=:
219   case $as_dir in #(
220          /*)
221            for as_base in sh bash ksh sh5; do
222              # Try only shells that exist, to save several forks.
223              as_shell=$as_dir/$as_base
224              if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
225                     { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
226   CONFIG_SHELL=$as_shell as_have_required=yes
227                    if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
228   break 2
229 fi
230 fi
231            done;;
232        esac
233   as_found=false
234 done
235 $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
236               { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
237   CONFIG_SHELL=$SHELL as_have_required=yes
238 fi; }
239 IFS=$as_save_IFS
240
241
242       if test "x$CONFIG_SHELL" != x; then :
243   export CONFIG_SHELL
244              # We cannot yet assume a decent shell, so we have to provide a
245 # neutralization value for shells without unset; and this also
246 # works around shells that cannot unset nonexistent variables.
247 # Preserve -v and -x to the replacement shell.
248 BASH_ENV=/dev/null
249 ENV=/dev/null
250 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
251 case $- in # ((((
252   *v*x* | *x*v* ) as_opts=-vx ;;
253   *v* ) as_opts=-v ;;
254   *x* ) as_opts=-x ;;
255   * ) as_opts= ;;
256 esac
257 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
258 # Admittedly, this is quite paranoid, since all the known shells bail
259 # out after a failed `exec'.
260 $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
261 exit 255
262 fi
263
264     if test x$as_have_required = xno; then :
265   $as_echo "$0: This script requires a shell more modern than all"
266   $as_echo "$0: the shells that I found on your system."
267   if test x${ZSH_VERSION+set} = xset ; then
268     $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
269     $as_echo "$0: be upgraded to zsh 4.3.4 or later."
270   else
271     $as_echo "$0: Please tell bug-autoconf@gnu.org and
272 $0: pgsql-bugs@postgresql.org about your system, including
273 $0: any error possibly output before this message. Then
274 $0: install a modern shell, or manually run the script
275 $0: under such a shell if you do have one."
276   fi
277   exit 1
278 fi
279 fi
280 fi
281 SHELL=${CONFIG_SHELL-/bin/sh}
282 export SHELL
283 # Unset more variables known to interfere with behavior of common tools.
284 CLICOLOR_FORCE= GREP_OPTIONS=
285 unset CLICOLOR_FORCE GREP_OPTIONS
286
287 ## --------------------- ##
288 ## M4sh Shell Functions. ##
289 ## --------------------- ##
290 # as_fn_unset VAR
291 # ---------------
292 # Portably unset VAR.
293 as_fn_unset ()
294 {
295   { eval $1=; unset $1;}
296 }
297 as_unset=as_fn_unset
298
299 # as_fn_set_status STATUS
300 # -----------------------
301 # Set $? to STATUS, without forking.
302 as_fn_set_status ()
303 {
304   return $1
305 } # as_fn_set_status
306
307 # as_fn_exit STATUS
308 # -----------------
309 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
310 as_fn_exit ()
311 {
312   set +e
313   as_fn_set_status $1
314   exit $1
315 } # as_fn_exit
316
317 # as_fn_mkdir_p
318 # -------------
319 # Create "$as_dir" as a directory, including parents if necessary.
320 as_fn_mkdir_p ()
321 {
322
323   case $as_dir in #(
324   -*) as_dir=./$as_dir;;
325   esac
326   test -d "$as_dir" || eval $as_mkdir_p || {
327     as_dirs=
328     while :; do
329       case $as_dir in #(
330       *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
331       *) as_qdir=$as_dir;;
332       esac
333       as_dirs="'$as_qdir' $as_dirs"
334       as_dir=`$as_dirname -- "$as_dir" ||
335 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
336          X"$as_dir" : 'X\(//\)[^/]' \| \
337          X"$as_dir" : 'X\(//\)$' \| \
338          X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
339 $as_echo X"$as_dir" |
340     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
341             s//\1/
342             q
343           }
344           /^X\(\/\/\)[^/].*/{
345             s//\1/
346             q
347           }
348           /^X\(\/\/\)$/{
349             s//\1/
350             q
351           }
352           /^X\(\/\).*/{
353             s//\1/
354             q
355           }
356           s/.*/./; q'`
357       test -d "$as_dir" && break
358     done
359     test -z "$as_dirs" || eval "mkdir $as_dirs"
360   } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
361
362
363 } # as_fn_mkdir_p
364
365 # as_fn_executable_p FILE
366 # -----------------------
367 # Test if FILE is an executable regular file.
368 as_fn_executable_p ()
369 {
370   test -f "$1" && test -x "$1"
371 } # as_fn_executable_p
372 # as_fn_append VAR VALUE
373 # ----------------------
374 # Append the text in VALUE to the end of the definition contained in VAR. Take
375 # advantage of any shell optimizations that allow amortized linear growth over
376 # repeated appends, instead of the typical quadratic growth present in naive
377 # implementations.
378 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
379   eval 'as_fn_append ()
380   {
381     eval $1+=\$2
382   }'
383 else
384   as_fn_append ()
385   {
386     eval $1=\$$1\$2
387   }
388 fi # as_fn_append
389
390 # as_fn_arith ARG...
391 # ------------------
392 # Perform arithmetic evaluation on the ARGs, and store the result in the
393 # global $as_val. Take advantage of shells that can avoid forks. The arguments
394 # must be portable across $(()) and expr.
395 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
396   eval 'as_fn_arith ()
397   {
398     as_val=$(( $* ))
399   }'
400 else
401   as_fn_arith ()
402   {
403     as_val=`expr "$@" || test $? -eq 1`
404   }
405 fi # as_fn_arith
406
407
408 # as_fn_error STATUS ERROR [LINENO LOG_FD]
409 # ----------------------------------------
410 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
411 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
412 # script with STATUS, using 1 if that was 0.
413 as_fn_error ()
414 {
415   as_status=$1; test $as_status -eq 0 && as_status=1
416   if test "$4"; then
417     as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
418     $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
419   fi
420   $as_echo "$as_me: error: $2" >&2
421   as_fn_exit $as_status
422 } # as_fn_error
423
424 if expr a : '\(a\)' >/dev/null 2>&1 &&
425    test "X`expr 00001 : '.*\(...\)'`" = X001; then
426   as_expr=expr
427 else
428   as_expr=false
429 fi
430
431 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
432   as_basename=basename
433 else
434   as_basename=false
435 fi
436
437 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
438   as_dirname=dirname
439 else
440   as_dirname=false
441 fi
442
443 as_me=`$as_basename -- "$0" ||
444 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
445          X"$0" : 'X\(//\)$' \| \
446          X"$0" : 'X\(/\)' \| . 2>/dev/null ||
447 $as_echo X/"$0" |
448     sed '/^.*\/\([^/][^/]*\)\/*$/{
449             s//\1/
450             q
451           }
452           /^X\/\(\/\/\)$/{
453             s//\1/
454             q
455           }
456           /^X\/\(\/\).*/{
457             s//\1/
458             q
459           }
460           s/.*/./; q'`
461
462 # Avoid depending upon Character Ranges.
463 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
464 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
465 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
466 as_cr_digits='0123456789'
467 as_cr_alnum=$as_cr_Letters$as_cr_digits
468
469
470   as_lineno_1=$LINENO as_lineno_1a=$LINENO
471   as_lineno_2=$LINENO as_lineno_2a=$LINENO
472   eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
473   test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
474   # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
475   sed -n '
476     p
477     /[$]LINENO/=
478   ' <$as_myself |
479     sed '
480       s/[$]LINENO.*/&-/
481       t lineno
482       b
483       :lineno
484       N
485       :loop
486       s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
487       t loop
488       s/-\n.*//
489     ' >$as_me.lineno &&
490   chmod +x "$as_me.lineno" ||
491     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
492
493   # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
494   # already done that, so ensure we don't try to do so again and fall
495   # in an infinite loop.  This has already happened in practice.
496   _as_can_reexec=no; export _as_can_reexec
497   # Don't try to exec as it changes $[0], causing all sort of problems
498   # (the dirname of $[0] is not the place where we might find the
499   # original and so on.  Autoconf is especially sensitive to this).
500   . "./$as_me.lineno"
501   # Exit status is that of the last command.
502   exit
503 }
504
505 ECHO_C= ECHO_N= ECHO_T=
506 case `echo -n x` in #(((((
507 -n*)
508   case `echo 'xy\c'` in
509   *c*) ECHO_T=' ';;     # ECHO_T is single tab character.
510   xy)  ECHO_C='\c';;
511   *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
512        ECHO_T=' ';;
513   esac;;
514 *)
515   ECHO_N='-n';;
516 esac
517
518 rm -f conf$$ conf$$.exe conf$$.file
519 if test -d conf$$.dir; then
520   rm -f conf$$.dir/conf$$.file
521 else
522   rm -f conf$$.dir
523   mkdir conf$$.dir 2>/dev/null
524 fi
525 if (echo >conf$$.file) 2>/dev/null; then
526   if ln -s conf$$.file conf$$ 2>/dev/null; then
527     as_ln_s='ln -s'
528     # ... but there are two gotchas:
529     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
530     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
531     # In both cases, we have to default to `cp -pR'.
532     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
533       as_ln_s='cp -pR'
534   elif ln conf$$.file conf$$ 2>/dev/null; then
535     as_ln_s=ln
536   else
537     as_ln_s='cp -pR'
538   fi
539 else
540   as_ln_s='cp -pR'
541 fi
542 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
543 rmdir conf$$.dir 2>/dev/null
544
545 if mkdir -p . 2>/dev/null; then
546   as_mkdir_p='mkdir -p "$as_dir"'
547 else
548   test -d ./-p && rmdir ./-p
549   as_mkdir_p=false
550 fi
551
552 as_test_x='test -x'
553 as_executable_p=as_fn_executable_p
554
555 # Sed expression to map a string onto a valid CPP name.
556 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
557
558 # Sed expression to map a string onto a valid variable name.
559 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
560
561
562 test -n "$DJDIR" || exec 7<&0 </dev/null
563 exec 6>&1
564
565 # Name of the host.
566 # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
567 # so uname gets run too.
568 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
569
570 #
571 # Initializations.
572 #
573 ac_default_prefix=/usr/local
574 ac_clean_files=
575 ac_config_libobj_dir=.
576 LIBOBJS=
577 cross_compiling=no
578 subdirs=
579 MFLAGS=
580 MAKEFLAGS=
581
582 # Identity of this package.
583 PACKAGE_NAME='PostgreSQL'
584 PACKAGE_TARNAME='postgresql'
585 PACKAGE_VERSION='10devel'
586 PACKAGE_STRING='PostgreSQL 10devel'
587 PACKAGE_BUGREPORT='pgsql-bugs@postgresql.org'
588 PACKAGE_URL=''
589
590 ac_unique_file="src/backend/access/common/heaptuple.c"
591 ac_default_prefix=/usr/local/pgsql
592 # Factoring default headers for most tests.
593 ac_includes_default="\
594 #include <stdio.h>
595 #ifdef HAVE_SYS_TYPES_H
596 # include <sys/types.h>
597 #endif
598 #ifdef HAVE_SYS_STAT_H
599 # include <sys/stat.h>
600 #endif
601 #ifdef STDC_HEADERS
602 # include <stdlib.h>
603 # include <stddef.h>
604 #else
605 # ifdef HAVE_STDLIB_H
606 #  include <stdlib.h>
607 # endif
608 #endif
609 #ifdef HAVE_STRING_H
610 # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
611 #  include <memory.h>
612 # endif
613 # include <string.h>
614 #endif
615 #ifdef HAVE_STRINGS_H
616 # include <strings.h>
617 #endif
618 #ifdef HAVE_INTTYPES_H
619 # include <inttypes.h>
620 #endif
621 #ifdef HAVE_STDINT_H
622 # include <stdint.h>
623 #endif
624 #ifdef HAVE_UNISTD_H
625 # include <unistd.h>
626 #endif"
627
628 ac_subst_vars='LTLIBOBJS
629 vpath_build
630 PG_VERSION_NUM
631 PROVE
632 OSX
633 XSLTPROC
634 XMLLINT
635 DBTOEPUB
636 COLLATEINDEX
637 DOCBOOKSTYLE
638 have_docbook
639 JADE
640 NSGMLS
641 TCL_SHLIB_LD_LIBS
642 TCL_SHARED_BUILD
643 TCL_LIB_SPEC
644 TCL_LIBS
645 TCL_INCLUDE_SPEC
646 TCL_CONFIG_SH
647 TCLSH
648 XGETTEXT
649 MSGMERGE
650 MSGFMT_FLAGS
651 MSGFMT
652 PG_CRC32C_OBJS
653 CFLAGS_SSE42
654 have_win32_dbghelp
655 HAVE_IPV6
656 LIBOBJS
657 UUID_LIBS
658 LDAP_LIBS_BE
659 LDAP_LIBS_FE
660 PTHREAD_CFLAGS
661 PTHREAD_LIBS
662 PTHREAD_CC
663 ax_pthread_config
664 ZIC
665 python_additional_libs
666 python_libspec
667 python_libdir
668 python_includespec
669 python_version
670 python_majorversion
671 PYTHON
672 perl_embed_ldflags
673 perl_useshrplib
674 perl_privlibexp
675 perl_archlibexp
676 PERL
677 FLEXFLAGS
678 FLEX
679 BISONFLAGS
680 BISON
681 MKDIR_P
682 AWK
683 LN_S
684 TAR
685 install_bin
686 INSTALL_DATA
687 INSTALL_SCRIPT
688 INSTALL_PROGRAM
689 WINDRES
690 DLLWRAP
691 DLLTOOL
692 AR
693 STRIP_SHARED_LIB
694 STRIP_STATIC_LIB
695 STRIP
696 RANLIB
697 with_gnu_ld
698 LD
699 LDFLAGS_SL
700 LDFLAGS_EX
701 ELF_SYS
702 EGREP
703 GREP
704 with_zlib
705 with_system_tzdata
706 with_libxslt
707 with_libxml
708 XML2_CONFIG
709 UUID_EXTRA_OBJS
710 with_uuid
711 with_systemd
712 with_selinux
713 with_openssl
714 krb_srvtab
715 with_python
716 with_perl
717 with_tcl
718 enable_thread_safety
719 INCLUDES
720 autodepend
721 TAS
722 GCC
723 CPP
724 CFLAGS_VECTOR
725 SUN_STUDIO_CC
726 OBJEXT
727 EXEEXT
728 ac_ct_CC
729 CPPFLAGS
730 LDFLAGS
731 CFLAGS
732 CC
733 enable_tap_tests
734 enable_dtrace
735 DTRACEFLAGS
736 DTRACE
737 enable_coverage
738 GENHTML
739 LCOV
740 GCOV
741 enable_debug
742 enable_strong_random
743 enable_rpath
744 default_port
745 WANTED_LANGUAGES
746 enable_nls
747 PORTNAME
748 host_os
749 host_vendor
750 host_cpu
751 host
752 build_os
753 build_vendor
754 build_cpu
755 build
756 PG_MAJORVERSION
757 configure_args
758 target_alias
759 host_alias
760 build_alias
761 LIBS
762 ECHO_T
763 ECHO_N
764 ECHO_C
765 DEFS
766 mandir
767 localedir
768 libdir
769 psdir
770 pdfdir
771 dvidir
772 htmldir
773 infodir
774 docdir
775 oldincludedir
776 includedir
777 localstatedir
778 sharedstatedir
779 sysconfdir
780 datadir
781 datarootdir
782 libexecdir
783 sbindir
784 bindir
785 program_transform_name
786 prefix
787 exec_prefix
788 PACKAGE_URL
789 PACKAGE_BUGREPORT
790 PACKAGE_STRING
791 PACKAGE_VERSION
792 PACKAGE_TARNAME
793 PACKAGE_NAME
794 PATH_SEPARATOR
795 SHELL'
796 ac_subst_files=''
797 ac_user_opts='
798 enable_option_checking
799 with_extra_version
800 with_template
801 with_includes
802 with_libraries
803 with_libs
804 enable_integer_datetimes
805 enable_nls
806 with_pgport
807 enable_rpath
808 enable_spinlocks
809 enable_atomics
810 enable_strong_random
811 enable_debug
812 enable_profiling
813 enable_coverage
814 enable_dtrace
815 enable_tap_tests
816 with_blocksize
817 with_segsize
818 with_wal_blocksize
819 with_wal_segsize
820 with_CC
821 enable_depend
822 enable_cassert
823 enable_thread_safety
824 with_tcl
825 with_tclconfig
826 with_perl
827 with_python
828 with_gssapi
829 with_krb_srvnam
830 with_pam
831 with_bsd_auth
832 with_ldap
833 with_bonjour
834 with_openssl
835 with_selinux
836 with_systemd
837 with_readline
838 with_libedit_preferred
839 with_uuid
840 with_ossp_uuid
841 with_libxml
842 with_libxslt
843 with_system_tzdata
844 with_zlib
845 with_gnu_ld
846 enable_largefile
847 enable_float4_byval
848 enable_float8_byval
849 '
850       ac_precious_vars='build_alias
851 host_alias
852 target_alias
853 CC
854 CFLAGS
855 LDFLAGS
856 LIBS
857 CPPFLAGS
858 CPP
859 LDFLAGS_EX
860 LDFLAGS_SL
861 DOCBOOKSTYLE'
862
863
864 # Initialize some variables set by options.
865 ac_init_help=
866 ac_init_version=false
867 ac_unrecognized_opts=
868 ac_unrecognized_sep=
869 # The variables have the same names as the options, with
870 # dashes changed to underlines.
871 cache_file=/dev/null
872 exec_prefix=NONE
873 no_create=
874 no_recursion=
875 prefix=NONE
876 program_prefix=NONE
877 program_suffix=NONE
878 program_transform_name=s,x,x,
879 silent=
880 site=
881 srcdir=
882 verbose=
883 x_includes=NONE
884 x_libraries=NONE
885
886 # Installation directory options.
887 # These are left unexpanded so users can "make install exec_prefix=/foo"
888 # and all the variables that are supposed to be based on exec_prefix
889 # by default will actually change.
890 # Use braces instead of parens because sh, perl, etc. also accept them.
891 # (The list follows the same order as the GNU Coding Standards.)
892 bindir='${exec_prefix}/bin'
893 sbindir='${exec_prefix}/sbin'
894 libexecdir='${exec_prefix}/libexec'
895 datarootdir='${prefix}/share'
896 datadir='${datarootdir}'
897 sysconfdir='${prefix}/etc'
898 sharedstatedir='${prefix}/com'
899 localstatedir='${prefix}/var'
900 includedir='${prefix}/include'
901 oldincludedir='/usr/include'
902 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
903 infodir='${datarootdir}/info'
904 htmldir='${docdir}'
905 dvidir='${docdir}'
906 pdfdir='${docdir}'
907 psdir='${docdir}'
908 libdir='${exec_prefix}/lib'
909 localedir='${datarootdir}/locale'
910 mandir='${datarootdir}/man'
911
912 ac_prev=
913 ac_dashdash=
914 for ac_option
915 do
916   # If the previous option needs an argument, assign it.
917   if test -n "$ac_prev"; then
918     eval $ac_prev=\$ac_option
919     ac_prev=
920     continue
921   fi
922
923   case $ac_option in
924   *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
925   *=)   ac_optarg= ;;
926   *)    ac_optarg=yes ;;
927   esac
928
929   # Accept the important Cygnus configure options, so we can diagnose typos.
930
931   case $ac_dashdash$ac_option in
932   --)
933     ac_dashdash=yes ;;
934
935   -bindir | --bindir | --bindi | --bind | --bin | --bi)
936     ac_prev=bindir ;;
937   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
938     bindir=$ac_optarg ;;
939
940   -build | --build | --buil | --bui | --bu)
941     ac_prev=build_alias ;;
942   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
943     build_alias=$ac_optarg ;;
944
945   -cache-file | --cache-file | --cache-fil | --cache-fi \
946   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
947     ac_prev=cache_file ;;
948   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
949   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
950     cache_file=$ac_optarg ;;
951
952   --config-cache | -C)
953     cache_file=config.cache ;;
954
955   -datadir | --datadir | --datadi | --datad)
956     ac_prev=datadir ;;
957   -datadir=* | --datadir=* | --datadi=* | --datad=*)
958     datadir=$ac_optarg ;;
959
960   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
961   | --dataroo | --dataro | --datar)
962     ac_prev=datarootdir ;;
963   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
964   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
965     datarootdir=$ac_optarg ;;
966
967   -disable-* | --disable-*)
968     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
969     # Reject names that are not valid shell variable names.
970     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
971       as_fn_error $? "invalid feature name: $ac_useropt"
972     ac_useropt_orig=$ac_useropt
973     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
974     case $ac_user_opts in
975       *"
976 "enable_$ac_useropt"
977 "*) ;;
978       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
979          ac_unrecognized_sep=', ';;
980     esac
981     eval enable_$ac_useropt=no ;;
982
983   -docdir | --docdir | --docdi | --doc | --do)
984     ac_prev=docdir ;;
985   -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
986     docdir=$ac_optarg ;;
987
988   -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
989     ac_prev=dvidir ;;
990   -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
991     dvidir=$ac_optarg ;;
992
993   -enable-* | --enable-*)
994     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
995     # Reject names that are not valid shell variable names.
996     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
997       as_fn_error $? "invalid feature name: $ac_useropt"
998     ac_useropt_orig=$ac_useropt
999     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1000     case $ac_user_opts in
1001       *"
1002 "enable_$ac_useropt"
1003 "*) ;;
1004       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
1005          ac_unrecognized_sep=', ';;
1006     esac
1007     eval enable_$ac_useropt=\$ac_optarg ;;
1008
1009   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
1010   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
1011   | --exec | --exe | --ex)
1012     ac_prev=exec_prefix ;;
1013   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
1014   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
1015   | --exec=* | --exe=* | --ex=*)
1016     exec_prefix=$ac_optarg ;;
1017
1018   -gas | --gas | --ga | --g)
1019     # Obsolete; use --with-gas.
1020     with_gas=yes ;;
1021
1022   -help | --help | --hel | --he | -h)
1023     ac_init_help=long ;;
1024   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
1025     ac_init_help=recursive ;;
1026   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
1027     ac_init_help=short ;;
1028
1029   -host | --host | --hos | --ho)
1030     ac_prev=host_alias ;;
1031   -host=* | --host=* | --hos=* | --ho=*)
1032     host_alias=$ac_optarg ;;
1033
1034   -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
1035     ac_prev=htmldir ;;
1036   -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
1037   | --ht=*)
1038     htmldir=$ac_optarg ;;
1039
1040   -includedir | --includedir | --includedi | --included | --include \
1041   | --includ | --inclu | --incl | --inc)
1042     ac_prev=includedir ;;
1043   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
1044   | --includ=* | --inclu=* | --incl=* | --inc=*)
1045     includedir=$ac_optarg ;;
1046
1047   -infodir | --infodir | --infodi | --infod | --info | --inf)
1048     ac_prev=infodir ;;
1049   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
1050     infodir=$ac_optarg ;;
1051
1052   -libdir | --libdir | --libdi | --libd)
1053     ac_prev=libdir ;;
1054   -libdir=* | --libdir=* | --libdi=* | --libd=*)
1055     libdir=$ac_optarg ;;
1056
1057   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
1058   | --libexe | --libex | --libe)
1059     ac_prev=libexecdir ;;
1060   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
1061   | --libexe=* | --libex=* | --libe=*)
1062     libexecdir=$ac_optarg ;;
1063
1064   -localedir | --localedir | --localedi | --localed | --locale)
1065     ac_prev=localedir ;;
1066   -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
1067     localedir=$ac_optarg ;;
1068
1069   -localstatedir | --localstatedir | --localstatedi | --localstated \
1070   | --localstate | --localstat | --localsta | --localst | --locals)
1071     ac_prev=localstatedir ;;
1072   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
1073   | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
1074     localstatedir=$ac_optarg ;;
1075
1076   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
1077     ac_prev=mandir ;;
1078   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
1079     mandir=$ac_optarg ;;
1080
1081   -nfp | --nfp | --nf)
1082     # Obsolete; use --without-fp.
1083     with_fp=no ;;
1084
1085   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1086   | --no-cr | --no-c | -n)
1087     no_create=yes ;;
1088
1089   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1090   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1091     no_recursion=yes ;;
1092
1093   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
1094   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
1095   | --oldin | --oldi | --old | --ol | --o)
1096     ac_prev=oldincludedir ;;
1097   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1098   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1099   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1100     oldincludedir=$ac_optarg ;;
1101
1102   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1103     ac_prev=prefix ;;
1104   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1105     prefix=$ac_optarg ;;
1106
1107   -program-prefix | --program-prefix | --program-prefi | --program-pref \
1108   | --program-pre | --program-pr | --program-p)
1109     ac_prev=program_prefix ;;
1110   -program-prefix=* | --program-prefix=* | --program-prefi=* \
1111   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1112     program_prefix=$ac_optarg ;;
1113
1114   -program-suffix | --program-suffix | --program-suffi | --program-suff \
1115   | --program-suf | --program-su | --program-s)
1116     ac_prev=program_suffix ;;
1117   -program-suffix=* | --program-suffix=* | --program-suffi=* \
1118   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1119     program_suffix=$ac_optarg ;;
1120
1121   -program-transform-name | --program-transform-name \
1122   | --program-transform-nam | --program-transform-na \
1123   | --program-transform-n | --program-transform- \
1124   | --program-transform | --program-transfor \
1125   | --program-transfo | --program-transf \
1126   | --program-trans | --program-tran \
1127   | --progr-tra | --program-tr | --program-t)
1128     ac_prev=program_transform_name ;;
1129   -program-transform-name=* | --program-transform-name=* \
1130   | --program-transform-nam=* | --program-transform-na=* \
1131   | --program-transform-n=* | --program-transform-=* \
1132   | --program-transform=* | --program-transfor=* \
1133   | --program-transfo=* | --program-transf=* \
1134   | --program-trans=* | --program-tran=* \
1135   | --progr-tra=* | --program-tr=* | --program-t=*)
1136     program_transform_name=$ac_optarg ;;
1137
1138   -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
1139     ac_prev=pdfdir ;;
1140   -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
1141     pdfdir=$ac_optarg ;;
1142
1143   -psdir | --psdir | --psdi | --psd | --ps)
1144     ac_prev=psdir ;;
1145   -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
1146     psdir=$ac_optarg ;;
1147
1148   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1149   | -silent | --silent | --silen | --sile | --sil)
1150     silent=yes ;;
1151
1152   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1153     ac_prev=sbindir ;;
1154   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1155   | --sbi=* | --sb=*)
1156     sbindir=$ac_optarg ;;
1157
1158   -sharedstatedir | --sharedstatedir | --sharedstatedi \
1159   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1160   | --sharedst | --shareds | --shared | --share | --shar \
1161   | --sha | --sh)
1162     ac_prev=sharedstatedir ;;
1163   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1164   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1165   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1166   | --sha=* | --sh=*)
1167     sharedstatedir=$ac_optarg ;;
1168
1169   -site | --site | --sit)
1170     ac_prev=site ;;
1171   -site=* | --site=* | --sit=*)
1172     site=$ac_optarg ;;
1173
1174   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1175     ac_prev=srcdir ;;
1176   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1177     srcdir=$ac_optarg ;;
1178
1179   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1180   | --syscon | --sysco | --sysc | --sys | --sy)
1181     ac_prev=sysconfdir ;;
1182   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1183   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1184     sysconfdir=$ac_optarg ;;
1185
1186   -target | --target | --targe | --targ | --tar | --ta | --t)
1187     ac_prev=target_alias ;;
1188   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1189     target_alias=$ac_optarg ;;
1190
1191   -v | -verbose | --verbose | --verbos | --verbo | --verb)
1192     verbose=yes ;;
1193
1194   -version | --version | --versio | --versi | --vers | -V)
1195     ac_init_version=: ;;
1196
1197   -with-* | --with-*)
1198     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1199     # Reject names that are not valid shell variable names.
1200     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1201       as_fn_error $? "invalid package name: $ac_useropt"
1202     ac_useropt_orig=$ac_useropt
1203     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1204     case $ac_user_opts in
1205       *"
1206 "with_$ac_useropt"
1207 "*) ;;
1208       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1209          ac_unrecognized_sep=', ';;
1210     esac
1211     eval with_$ac_useropt=\$ac_optarg ;;
1212
1213   -without-* | --without-*)
1214     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1215     # Reject names that are not valid shell variable names.
1216     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1217       as_fn_error $? "invalid package name: $ac_useropt"
1218     ac_useropt_orig=$ac_useropt
1219     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1220     case $ac_user_opts in
1221       *"
1222 "with_$ac_useropt"
1223 "*) ;;
1224       *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1225          ac_unrecognized_sep=', ';;
1226     esac
1227     eval with_$ac_useropt=no ;;
1228
1229   --x)
1230     # Obsolete; use --with-x.
1231     with_x=yes ;;
1232
1233   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1234   | --x-incl | --x-inc | --x-in | --x-i)
1235     ac_prev=x_includes ;;
1236   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1237   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1238     x_includes=$ac_optarg ;;
1239
1240   -x-libraries | --x-libraries | --x-librarie | --x-librari \
1241   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1242     ac_prev=x_libraries ;;
1243   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1244   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1245     x_libraries=$ac_optarg ;;
1246
1247   -*) as_fn_error $? "unrecognized option: \`$ac_option'
1248 Try \`$0 --help' for more information"
1249     ;;
1250
1251   *=*)
1252     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1253     # Reject names that are not valid shell variable names.
1254     case $ac_envvar in #(
1255       '' | [0-9]* | *[!_$as_cr_alnum]* )
1256       as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
1257     esac
1258     eval $ac_envvar=\$ac_optarg
1259     export $ac_envvar ;;
1260
1261   *)
1262     # FIXME: should be removed in autoconf 3.0.
1263     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
1264     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1265       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1266     : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
1267     ;;
1268
1269   esac
1270 done
1271
1272 if test -n "$ac_prev"; then
1273   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1274   as_fn_error $? "missing argument to $ac_option"
1275 fi
1276
1277 if test -n "$ac_unrecognized_opts"; then
1278   case $enable_option_checking in
1279     no) ;;
1280     fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
1281     *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1282   esac
1283 fi
1284
1285 # Check all directory arguments for consistency.
1286 for ac_var in   exec_prefix prefix bindir sbindir libexecdir datarootdir \
1287                 datadir sysconfdir sharedstatedir localstatedir includedir \
1288                 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1289                 libdir localedir mandir
1290 do
1291   eval ac_val=\$$ac_var
1292   # Remove trailing slashes.
1293   case $ac_val in
1294     */ )
1295       ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1296       eval $ac_var=\$ac_val;;
1297   esac
1298   # Be sure to have absolute directory names.
1299   case $ac_val in
1300     [\\/$]* | ?:[\\/]* )  continue;;
1301     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1302   esac
1303   as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
1304 done
1305
1306 # There might be people who depend on the old broken behavior: `$host'
1307 # used to hold the argument of --host etc.
1308 # FIXME: To remove some day.
1309 build=$build_alias
1310 host=$host_alias
1311 target=$target_alias
1312
1313 # FIXME: To remove some day.
1314 if test "x$host_alias" != x; then
1315   if test "x$build_alias" = x; then
1316     cross_compiling=maybe
1317   elif test "x$build_alias" != "x$host_alias"; then
1318     cross_compiling=yes
1319   fi
1320 fi
1321
1322 ac_tool_prefix=
1323 test -n "$host_alias" && ac_tool_prefix=$host_alias-
1324
1325 test "$silent" = yes && exec 6>/dev/null
1326
1327
1328 ac_pwd=`pwd` && test -n "$ac_pwd" &&
1329 ac_ls_di=`ls -di .` &&
1330 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1331   as_fn_error $? "working directory cannot be determined"
1332 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1333   as_fn_error $? "pwd does not report name of working directory"
1334
1335
1336 # Find the source files, if location was not specified.
1337 if test -z "$srcdir"; then
1338   ac_srcdir_defaulted=yes
1339   # Try the directory containing this script, then the parent directory.
1340   ac_confdir=`$as_dirname -- "$as_myself" ||
1341 $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1342          X"$as_myself" : 'X\(//\)[^/]' \| \
1343          X"$as_myself" : 'X\(//\)$' \| \
1344          X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1345 $as_echo X"$as_myself" |
1346     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1347             s//\1/
1348             q
1349           }
1350           /^X\(\/\/\)[^/].*/{
1351             s//\1/
1352             q
1353           }
1354           /^X\(\/\/\)$/{
1355             s//\1/
1356             q
1357           }
1358           /^X\(\/\).*/{
1359             s//\1/
1360             q
1361           }
1362           s/.*/./; q'`
1363   srcdir=$ac_confdir
1364   if test ! -r "$srcdir/$ac_unique_file"; then
1365     srcdir=..
1366   fi
1367 else
1368   ac_srcdir_defaulted=no
1369 fi
1370 if test ! -r "$srcdir/$ac_unique_file"; then
1371   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1372   as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
1373 fi
1374 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1375 ac_abs_confdir=`(
1376         cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
1377         pwd)`
1378 # When building in place, set srcdir=.
1379 if test "$ac_abs_confdir" = "$ac_pwd"; then
1380   srcdir=.
1381 fi
1382 # Remove unnecessary trailing slashes from srcdir.
1383 # Double slashes in file names in object file debugging info
1384 # mess up M-x gdb in Emacs.
1385 case $srcdir in
1386 */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1387 esac
1388 for ac_var in $ac_precious_vars; do
1389   eval ac_env_${ac_var}_set=\${${ac_var}+set}
1390   eval ac_env_${ac_var}_value=\$${ac_var}
1391   eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1392   eval ac_cv_env_${ac_var}_value=\$${ac_var}
1393 done
1394
1395 #
1396 # Report the --help message.
1397 #
1398 if test "$ac_init_help" = "long"; then
1399   # Omit some internal or obsolete options to make the list less imposing.
1400   # This message is too long to be a string in the A/UX 3.1 sh.
1401   cat <<_ACEOF
1402 \`configure' configures PostgreSQL 10devel to adapt to many kinds of systems.
1403
1404 Usage: $0 [OPTION]... [VAR=VALUE]...
1405
1406 To assign environment variables (e.g., CC, CFLAGS...), specify them as
1407 VAR=VALUE.  See below for descriptions of some of the useful variables.
1408
1409 Defaults for the options are specified in brackets.
1410
1411 Configuration:
1412   -h, --help              display this help and exit
1413       --help=short        display options specific to this package
1414       --help=recursive    display the short help of all the included packages
1415   -V, --version           display version information and exit
1416   -q, --quiet, --silent   do not print \`checking ...' messages
1417       --cache-file=FILE   cache test results in FILE [disabled]
1418   -C, --config-cache      alias for \`--cache-file=config.cache'
1419   -n, --no-create         do not create output files
1420       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
1421
1422 Installation directories:
1423   --prefix=PREFIX         install architecture-independent files in PREFIX
1424                           [$ac_default_prefix]
1425   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
1426                           [PREFIX]
1427
1428 By default, \`make install' will install all the files in
1429 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
1430 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1431 for instance \`--prefix=\$HOME'.
1432
1433 For better control, use the options below.
1434
1435 Fine tuning of the installation directories:
1436   --bindir=DIR            user executables [EPREFIX/bin]
1437   --sbindir=DIR           system admin executables [EPREFIX/sbin]
1438   --libexecdir=DIR        program executables [EPREFIX/libexec]
1439   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1440   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1441   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1442   --libdir=DIR            object code libraries [EPREFIX/lib]
1443   --includedir=DIR        C header files [PREFIX/include]
1444   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
1445   --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
1446   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
1447   --infodir=DIR           info documentation [DATAROOTDIR/info]
1448   --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
1449   --mandir=DIR            man documentation [DATAROOTDIR/man]
1450   --docdir=DIR            documentation root [DATAROOTDIR/doc/postgresql]
1451   --htmldir=DIR           html documentation [DOCDIR]
1452   --dvidir=DIR            dvi documentation [DOCDIR]
1453   --pdfdir=DIR            pdf documentation [DOCDIR]
1454   --psdir=DIR             ps documentation [DOCDIR]
1455 _ACEOF
1456
1457   cat <<\_ACEOF
1458
1459 System types:
1460   --build=BUILD     configure for building on BUILD [guessed]
1461   --host=HOST       cross-compile to build programs to run on HOST [BUILD]
1462 _ACEOF
1463 fi
1464
1465 if test -n "$ac_init_help"; then
1466   case $ac_init_help in
1467      short | recursive ) echo "Configuration of PostgreSQL 10devel:";;
1468    esac
1469   cat <<\_ACEOF
1470
1471 Optional Features:
1472   --disable-option-checking  ignore unrecognized --enable/--with options
1473   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1474   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
1475   --disable-integer-datetimes
1476                           disable 64-bit integer date/time support
1477   --enable-nls[=LANGUAGES]
1478                           enable Native Language Support
1479   --disable-rpath         do not embed shared library search path in
1480                           executables
1481   --disable-spinlocks     do not use spinlocks
1482   --disable-atomics       do not use atomic operations
1483   --disable-strong-random do not use a strong random number source
1484   --enable-debug          build with debugging symbols (-g)
1485   --enable-profiling      build with profiling enabled
1486   --enable-coverage       build with coverage testing instrumentation
1487   --enable-dtrace         build with DTrace support
1488   --enable-tap-tests      enable TAP tests (requires Perl and IPC::Run)
1489   --enable-depend         turn on automatic dependency tracking
1490   --enable-cassert        enable assertion checks (for debugging)
1491   --disable-thread-safety disable thread-safety in client libraries
1492   --disable-largefile     omit support for large files
1493   --disable-float4-byval  disable float4 passed by value
1494   --disable-float8-byval  disable float8 passed by value
1495
1496 Optional Packages:
1497   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1498   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
1499   --with-extra-version=STRING
1500                           append STRING to version
1501   --with-template=NAME    override operating system template
1502   --with-includes=DIRS    look for additional header files in DIRS
1503   --with-libraries=DIRS   look for additional libraries in DIRS
1504   --with-libs=DIRS        alternative spelling of --with-libraries
1505   --with-pgport=PORTNUM   set default port number [5432]
1506   --with-blocksize=BLOCKSIZE
1507                           set table block size in kB [8]
1508   --with-segsize=SEGSIZE  set table segment size in GB [1]
1509   --with-wal-blocksize=BLOCKSIZE
1510                           set WAL block size in kB [8]
1511   --with-wal-segsize=SEGSIZE
1512                           set WAL segment size in MB [16]
1513   --with-CC=CMD           set compiler (deprecated)
1514   --with-tcl              build Tcl modules (PL/Tcl)
1515   --with-tclconfig=DIR    tclConfig.sh is in DIR
1516   --with-perl             build Perl modules (PL/Perl)
1517   --with-python           build Python modules (PL/Python)
1518   --with-gssapi           build with GSSAPI support
1519   --with-krb-srvnam=NAME  default service principal name in Kerberos (GSSAPI)
1520                           [postgres]
1521   --with-pam              build with PAM support
1522   --with-bsd-auth         build with BSD Authentication support
1523   --with-ldap             build with LDAP support
1524   --with-bonjour          build with Bonjour support
1525   --with-openssl          build with OpenSSL support
1526   --with-selinux          build with SELinux support
1527   --with-systemd          build with systemd support
1528   --without-readline      do not use GNU Readline nor BSD Libedit for editing
1529   --with-libedit-preferred
1530                           prefer BSD Libedit over GNU Readline
1531   --with-uuid=LIB         build contrib/uuid-ossp using LIB (bsd,e2fs,ossp)
1532   --with-ossp-uuid        obsolete spelling of --with-uuid=ossp
1533   --with-libxml           build with XML support
1534   --with-libxslt          use XSLT support when building contrib/xml2
1535   --with-system-tzdata=DIR
1536                           use system time zone data in DIR
1537   --without-zlib          do not use Zlib
1538   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
1539
1540 Some influential environment variables:
1541   CC          C compiler command
1542   CFLAGS      C compiler flags
1543   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
1544               nonstandard directory <lib dir>
1545   LIBS        libraries to pass to the linker, e.g. -l<library>
1546   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1547               you have headers in a nonstandard directory <include dir>
1548   CPP         C preprocessor
1549   LDFLAGS_EX  extra linker flags for linking executables only
1550   LDFLAGS_SL  extra linker flags for linking shared libraries only
1551   DOCBOOKSTYLE
1552               location of DocBook stylesheets
1553
1554 Use these variables to override the choices made by `configure' or to help
1555 it to find libraries and programs with nonstandard names/locations.
1556
1557 Report bugs to <pgsql-bugs@postgresql.org>.
1558 _ACEOF
1559 ac_status=$?
1560 fi
1561
1562 if test "$ac_init_help" = "recursive"; then
1563   # If there are subdirs, report their specific --help.
1564   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1565     test -d "$ac_dir" ||
1566       { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1567       continue
1568     ac_builddir=.
1569
1570 case "$ac_dir" in
1571 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1572 *)
1573   ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
1574   # A ".." for each directory in $ac_dir_suffix.
1575   ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1576   case $ac_top_builddir_sub in
1577   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1578   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1579   esac ;;
1580 esac
1581 ac_abs_top_builddir=$ac_pwd
1582 ac_abs_builddir=$ac_pwd$ac_dir_suffix
1583 # for backward compatibility:
1584 ac_top_builddir=$ac_top_build_prefix
1585
1586 case $srcdir in
1587   .)  # We are building in place.
1588     ac_srcdir=.
1589     ac_top_srcdir=$ac_top_builddir_sub
1590     ac_abs_top_srcdir=$ac_pwd ;;
1591   [\\/]* | ?:[\\/]* )  # Absolute name.
1592     ac_srcdir=$srcdir$ac_dir_suffix;
1593     ac_top_srcdir=$srcdir
1594     ac_abs_top_srcdir=$srcdir ;;
1595   *) # Relative name.
1596     ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1597     ac_top_srcdir=$ac_top_build_prefix$srcdir
1598     ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1599 esac
1600 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1601
1602     cd "$ac_dir" || { ac_status=$?; continue; }
1603     # Check for guested configure.
1604     if test -f "$ac_srcdir/configure.gnu"; then
1605       echo &&
1606       $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1607     elif test -f "$ac_srcdir/configure"; then
1608       echo &&
1609       $SHELL "$ac_srcdir/configure" --help=recursive
1610     else
1611       $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1612     fi || ac_status=$?
1613     cd "$ac_pwd" || { ac_status=$?; break; }
1614   done
1615 fi
1616
1617 test -n "$ac_init_help" && exit $ac_status
1618 if $ac_init_version; then
1619   cat <<\_ACEOF
1620 PostgreSQL configure 10devel
1621 generated by GNU Autoconf 2.69
1622
1623 Copyright (C) 2012 Free Software Foundation, Inc.
1624 This configure script is free software; the Free Software Foundation
1625 gives unlimited permission to copy, distribute and modify it.
1626
1627 Copyright (c) 1996-2016, PostgreSQL Global Development Group
1628 _ACEOF
1629   exit
1630 fi
1631
1632 ## ------------------------ ##
1633 ## Autoconf initialization. ##
1634 ## ------------------------ ##
1635
1636 # ac_fn_c_try_compile LINENO
1637 # --------------------------
1638 # Try to compile conftest.$ac_ext, and return whether this succeeded.
1639 ac_fn_c_try_compile ()
1640 {
1641   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1642   rm -f conftest.$ac_objext
1643   if { { ac_try="$ac_compile"
1644 case "(($ac_try" in
1645   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1646   *) ac_try_echo=$ac_try;;
1647 esac
1648 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1649 $as_echo "$ac_try_echo"; } >&5
1650   (eval "$ac_compile") 2>conftest.err
1651   ac_status=$?
1652   if test -s conftest.err; then
1653     grep -v '^ *+' conftest.err >conftest.er1
1654     cat conftest.er1 >&5
1655     mv -f conftest.er1 conftest.err
1656   fi
1657   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1658   test $ac_status = 0; } && {
1659          test -z "$ac_c_werror_flag" ||
1660          test ! -s conftest.err
1661        } && test -s conftest.$ac_objext; then :
1662   ac_retval=0
1663 else
1664   $as_echo "$as_me: failed program was:" >&5
1665 sed 's/^/| /' conftest.$ac_ext >&5
1666
1667         ac_retval=1
1668 fi
1669   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1670   as_fn_set_status $ac_retval
1671
1672 } # ac_fn_c_try_compile
1673
1674 # ac_fn_c_try_link LINENO
1675 # -----------------------
1676 # Try to link conftest.$ac_ext, and return whether this succeeded.
1677 ac_fn_c_try_link ()
1678 {
1679   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1680   rm -f conftest.$ac_objext conftest$ac_exeext
1681   if { { ac_try="$ac_link"
1682 case "(($ac_try" in
1683   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1684   *) ac_try_echo=$ac_try;;
1685 esac
1686 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1687 $as_echo "$ac_try_echo"; } >&5
1688   (eval "$ac_link") 2>conftest.err
1689   ac_status=$?
1690   if test -s conftest.err; then
1691     grep -v '^ *+' conftest.err >conftest.er1
1692     cat conftest.er1 >&5
1693     mv -f conftest.er1 conftest.err
1694   fi
1695   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1696   test $ac_status = 0; } && {
1697          test -z "$ac_c_werror_flag" ||
1698          test ! -s conftest.err
1699        } && test -s conftest$ac_exeext && {
1700          test "$cross_compiling" = yes ||
1701          test -x conftest$ac_exeext
1702        }; then :
1703   ac_retval=0
1704 else
1705   $as_echo "$as_me: failed program was:" >&5
1706 sed 's/^/| /' conftest.$ac_ext >&5
1707
1708         ac_retval=1
1709 fi
1710   # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1711   # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1712   # interfere with the next link command; also delete a directory that is
1713   # left behind by Apple's compiler.  We do this before executing the actions.
1714   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1715   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1716   as_fn_set_status $ac_retval
1717
1718 } # ac_fn_c_try_link
1719
1720 # ac_fn_c_try_cpp LINENO
1721 # ----------------------
1722 # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
1723 ac_fn_c_try_cpp ()
1724 {
1725   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1726   if { { ac_try="$ac_cpp conftest.$ac_ext"
1727 case "(($ac_try" in
1728   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1729   *) ac_try_echo=$ac_try;;
1730 esac
1731 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1732 $as_echo "$ac_try_echo"; } >&5
1733   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
1734   ac_status=$?
1735   if test -s conftest.err; then
1736     grep -v '^ *+' conftest.err >conftest.er1
1737     cat conftest.er1 >&5
1738     mv -f conftest.er1 conftest.err
1739   fi
1740   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1741   test $ac_status = 0; } > conftest.i && {
1742          test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
1743          test ! -s conftest.err
1744        }; then :
1745   ac_retval=0
1746 else
1747   $as_echo "$as_me: failed program was:" >&5
1748 sed 's/^/| /' conftest.$ac_ext >&5
1749
1750     ac_retval=1
1751 fi
1752   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1753   as_fn_set_status $ac_retval
1754
1755 } # ac_fn_c_try_cpp
1756
1757 # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
1758 # -------------------------------------------------------
1759 # Tests whether HEADER exists, giving a warning if it cannot be compiled using
1760 # the include files in INCLUDES and setting the cache variable VAR
1761 # accordingly.
1762 ac_fn_c_check_header_mongrel ()
1763 {
1764   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1765   if eval \${$3+:} false; then :
1766   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1767 $as_echo_n "checking for $2... " >&6; }
1768 if eval \${$3+:} false; then :
1769   $as_echo_n "(cached) " >&6
1770 fi
1771 eval ac_res=\$$3
1772                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1773 $as_echo "$ac_res" >&6; }
1774 else
1775   # Is the header compilable?
1776 { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
1777 $as_echo_n "checking $2 usability... " >&6; }
1778 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1779 /* end confdefs.h.  */
1780 $4
1781 #include <$2>
1782 _ACEOF
1783 if ac_fn_c_try_compile "$LINENO"; then :
1784   ac_header_compiler=yes
1785 else
1786   ac_header_compiler=no
1787 fi
1788 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1789 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
1790 $as_echo "$ac_header_compiler" >&6; }
1791
1792 # Is the header present?
1793 { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
1794 $as_echo_n "checking $2 presence... " >&6; }
1795 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1796 /* end confdefs.h.  */
1797 #include <$2>
1798 _ACEOF
1799 if ac_fn_c_try_cpp "$LINENO"; then :
1800   ac_header_preproc=yes
1801 else
1802   ac_header_preproc=no
1803 fi
1804 rm -f conftest.err conftest.i conftest.$ac_ext
1805 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
1806 $as_echo "$ac_header_preproc" >&6; }
1807
1808 # So?  What about this header?
1809 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
1810   yes:no: )
1811     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
1812 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
1813     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1814 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1815     ;;
1816   no:yes:* )
1817     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
1818 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
1819     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
1820 $as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
1821     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
1822 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
1823     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
1824 $as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
1825     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1826 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1827 ( $as_echo "## ---------------------------------------- ##
1828 ## Report this to pgsql-bugs@postgresql.org ##
1829 ## ---------------------------------------- ##"
1830      ) | sed "s/^/$as_me: WARNING:     /" >&2
1831     ;;
1832 esac
1833   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1834 $as_echo_n "checking for $2... " >&6; }
1835 if eval \${$3+:} false; then :
1836   $as_echo_n "(cached) " >&6
1837 else
1838   eval "$3=\$ac_header_compiler"
1839 fi
1840 eval ac_res=\$$3
1841                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1842 $as_echo "$ac_res" >&6; }
1843 fi
1844   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1845
1846 } # ac_fn_c_check_header_mongrel
1847
1848 # ac_fn_c_try_run LINENO
1849 # ----------------------
1850 # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
1851 # that executables *can* be run.
1852 ac_fn_c_try_run ()
1853 {
1854   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1855   if { { ac_try="$ac_link"
1856 case "(($ac_try" in
1857   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1858   *) ac_try_echo=$ac_try;;
1859 esac
1860 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1861 $as_echo "$ac_try_echo"; } >&5
1862   (eval "$ac_link") 2>&5
1863   ac_status=$?
1864   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1865   test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
1866   { { case "(($ac_try" in
1867   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1868   *) ac_try_echo=$ac_try;;
1869 esac
1870 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1871 $as_echo "$ac_try_echo"; } >&5
1872   (eval "$ac_try") 2>&5
1873   ac_status=$?
1874   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1875   test $ac_status = 0; }; }; then :
1876   ac_retval=0
1877 else
1878   $as_echo "$as_me: program exited with status $ac_status" >&5
1879        $as_echo "$as_me: failed program was:" >&5
1880 sed 's/^/| /' conftest.$ac_ext >&5
1881
1882        ac_retval=$ac_status
1883 fi
1884   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1885   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1886   as_fn_set_status $ac_retval
1887
1888 } # ac_fn_c_try_run
1889
1890 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
1891 # -------------------------------------------------------
1892 # Tests whether HEADER exists and can be compiled using the include files in
1893 # INCLUDES, setting the cache variable VAR accordingly.
1894 ac_fn_c_check_header_compile ()
1895 {
1896   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1897   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1898 $as_echo_n "checking for $2... " >&6; }
1899 if eval \${$3+:} false; then :
1900   $as_echo_n "(cached) " >&6
1901 else
1902   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1903 /* end confdefs.h.  */
1904 $4
1905 #include <$2>
1906 _ACEOF
1907 if ac_fn_c_try_compile "$LINENO"; then :
1908   eval "$3=yes"
1909 else
1910   eval "$3=no"
1911 fi
1912 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1913 fi
1914 eval ac_res=\$$3
1915                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1916 $as_echo "$ac_res" >&6; }
1917   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1918
1919 } # ac_fn_c_check_header_compile
1920
1921 # ac_fn_c_check_func LINENO FUNC VAR
1922 # ----------------------------------
1923 # Tests whether FUNC exists, setting the cache variable VAR accordingly
1924 ac_fn_c_check_func ()
1925 {
1926   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1927   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1928 $as_echo_n "checking for $2... " >&6; }
1929 if eval \${$3+:} false; then :
1930   $as_echo_n "(cached) " >&6
1931 else
1932   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1933 /* end confdefs.h.  */
1934 /* Define $2 to an innocuous variant, in case <limits.h> declares $2.
1935    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
1936 #define $2 innocuous_$2
1937
1938 /* System header to define __stub macros and hopefully few prototypes,
1939     which can conflict with char $2 (); below.
1940     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
1941     <limits.h> exists even on freestanding compilers.  */
1942
1943 #ifdef __STDC__
1944 # include <limits.h>
1945 #else
1946 # include <assert.h>
1947 #endif
1948
1949 #undef $2
1950
1951 /* Override any GCC internal prototype to avoid an error.
1952    Use char because int might match the return type of a GCC
1953    builtin and then its argument prototype would still apply.  */
1954 #ifdef __cplusplus
1955 extern "C"
1956 #endif
1957 char $2 ();
1958 /* The GNU C library defines this for functions which it implements
1959     to always fail with ENOSYS.  Some functions are actually named
1960     something starting with __ and the normal name is an alias.  */
1961 #if defined __stub_$2 || defined __stub___$2
1962 choke me
1963 #endif
1964
1965 int
1966 main ()
1967 {
1968 return $2 ();
1969   ;
1970   return 0;
1971 }
1972 _ACEOF
1973 if ac_fn_c_try_link "$LINENO"; then :
1974   eval "$3=yes"
1975 else
1976   eval "$3=no"
1977 fi
1978 rm -f core conftest.err conftest.$ac_objext \
1979     conftest$ac_exeext conftest.$ac_ext
1980 fi
1981 eval ac_res=\$$3
1982                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1983 $as_echo "$ac_res" >&6; }
1984   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1985
1986 } # ac_fn_c_check_func
1987
1988 # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
1989 # ----------------------------------------------------
1990 # Tries to find if the field MEMBER exists in type AGGR, after including
1991 # INCLUDES, setting cache variable VAR accordingly.
1992 ac_fn_c_check_member ()
1993 {
1994   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1995   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
1996 $as_echo_n "checking for $2.$3... " >&6; }
1997 if eval \${$4+:} false; then :
1998   $as_echo_n "(cached) " >&6
1999 else
2000   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2001 /* end confdefs.h.  */
2002 $5
2003 int
2004 main ()
2005 {
2006 static $2 ac_aggr;
2007 if (ac_aggr.$3)
2008 return 0;
2009   ;
2010   return 0;
2011 }
2012 _ACEOF
2013 if ac_fn_c_try_compile "$LINENO"; then :
2014   eval "$4=yes"
2015 else
2016   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2017 /* end confdefs.h.  */
2018 $5
2019 int
2020 main ()
2021 {
2022 static $2 ac_aggr;
2023 if (sizeof ac_aggr.$3)
2024 return 0;
2025   ;
2026   return 0;
2027 }
2028 _ACEOF
2029 if ac_fn_c_try_compile "$LINENO"; then :
2030   eval "$4=yes"
2031 else
2032   eval "$4=no"
2033 fi
2034 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2035 fi
2036 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2037 fi
2038 eval ac_res=\$$4
2039                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2040 $as_echo "$ac_res" >&6; }
2041   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2042
2043 } # ac_fn_c_check_member
2044
2045 # ac_fn_c_check_type LINENO TYPE VAR INCLUDES
2046 # -------------------------------------------
2047 # Tests whether TYPE exists after having included INCLUDES, setting cache
2048 # variable VAR accordingly.
2049 ac_fn_c_check_type ()
2050 {
2051   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2052   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2053 $as_echo_n "checking for $2... " >&6; }
2054 if eval \${$3+:} false; then :
2055   $as_echo_n "(cached) " >&6
2056 else
2057   eval "$3=no"
2058   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2059 /* end confdefs.h.  */
2060 $4
2061 int
2062 main ()
2063 {
2064 if (sizeof ($2))
2065          return 0;
2066   ;
2067   return 0;
2068 }
2069 _ACEOF
2070 if ac_fn_c_try_compile "$LINENO"; then :
2071   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2072 /* end confdefs.h.  */
2073 $4
2074 int
2075 main ()
2076 {
2077 if (sizeof (($2)))
2078             return 0;
2079   ;
2080   return 0;
2081 }
2082 _ACEOF
2083 if ac_fn_c_try_compile "$LINENO"; then :
2084
2085 else
2086   eval "$3=yes"
2087 fi
2088 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2089 fi
2090 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2091 fi
2092 eval ac_res=\$$3
2093                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2094 $as_echo "$ac_res" >&6; }
2095   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2096
2097 } # ac_fn_c_check_type
2098
2099 # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
2100 # --------------------------------------------
2101 # Tries to find the compile-time value of EXPR in a program that includes
2102 # INCLUDES, setting VAR accordingly. Returns whether the value could be
2103 # computed
2104 ac_fn_c_compute_int ()
2105 {
2106   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2107   if test "$cross_compiling" = yes; then
2108     # Depending upon the size, compute the lo and hi bounds.
2109 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2110 /* end confdefs.h.  */
2111 $4
2112 int
2113 main ()
2114 {
2115 static int test_array [1 - 2 * !(($2) >= 0)];
2116 test_array [0] = 0;
2117 return test_array [0];
2118
2119   ;
2120   return 0;
2121 }
2122 _ACEOF
2123 if ac_fn_c_try_compile "$LINENO"; then :
2124   ac_lo=0 ac_mid=0
2125   while :; do
2126     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2127 /* end confdefs.h.  */
2128 $4
2129 int
2130 main ()
2131 {
2132 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
2133 test_array [0] = 0;
2134 return test_array [0];
2135
2136   ;
2137   return 0;
2138 }
2139 _ACEOF
2140 if ac_fn_c_try_compile "$LINENO"; then :
2141   ac_hi=$ac_mid; break
2142 else
2143   as_fn_arith $ac_mid + 1 && ac_lo=$as_val
2144                         if test $ac_lo -le $ac_mid; then
2145                           ac_lo= ac_hi=
2146                           break
2147                         fi
2148                         as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
2149 fi
2150 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2151   done
2152 else
2153   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2154 /* end confdefs.h.  */
2155 $4
2156 int
2157 main ()
2158 {
2159 static int test_array [1 - 2 * !(($2) < 0)];
2160 test_array [0] = 0;
2161 return test_array [0];
2162
2163   ;
2164   return 0;
2165 }
2166 _ACEOF
2167 if ac_fn_c_try_compile "$LINENO"; then :
2168   ac_hi=-1 ac_mid=-1
2169   while :; do
2170     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2171 /* end confdefs.h.  */
2172 $4
2173 int
2174 main ()
2175 {
2176 static int test_array [1 - 2 * !(($2) >= $ac_mid)];
2177 test_array [0] = 0;
2178 return test_array [0];
2179
2180   ;
2181   return 0;
2182 }
2183 _ACEOF
2184 if ac_fn_c_try_compile "$LINENO"; then :
2185   ac_lo=$ac_mid; break
2186 else
2187   as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
2188                         if test $ac_mid -le $ac_hi; then
2189                           ac_lo= ac_hi=
2190                           break
2191                         fi
2192                         as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
2193 fi
2194 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2195   done
2196 else
2197   ac_lo= ac_hi=
2198 fi
2199 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2200 fi
2201 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2202 # Binary search between lo and hi bounds.
2203 while test "x$ac_lo" != "x$ac_hi"; do
2204   as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
2205   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2206 /* end confdefs.h.  */
2207 $4
2208 int
2209 main ()
2210 {
2211 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
2212 test_array [0] = 0;
2213 return test_array [0];
2214
2215   ;
2216   return 0;
2217 }
2218 _ACEOF
2219 if ac_fn_c_try_compile "$LINENO"; then :
2220   ac_hi=$ac_mid
2221 else
2222   as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
2223 fi
2224 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2225 done
2226 case $ac_lo in #((
2227 ?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
2228 '') ac_retval=1 ;;
2229 esac
2230   else
2231     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2232 /* end confdefs.h.  */
2233 $4
2234 static long int longval () { return $2; }
2235 static unsigned long int ulongval () { return $2; }
2236 #include <stdio.h>
2237 #include <stdlib.h>
2238 int
2239 main ()
2240 {
2241
2242   FILE *f = fopen ("conftest.val", "w");
2243   if (! f)
2244     return 1;
2245   if (($2) < 0)
2246     {
2247       long int i = longval ();
2248       if (i != ($2))
2249         return 1;
2250       fprintf (f, "%ld", i);
2251     }
2252   else
2253     {
2254       unsigned long int i = ulongval ();
2255       if (i != ($2))
2256         return 1;
2257       fprintf (f, "%lu", i);
2258     }
2259   /* Do not output a trailing newline, as this causes \r\n confusion
2260      on some platforms.  */
2261   return ferror (f) || fclose (f) != 0;
2262
2263   ;
2264   return 0;
2265 }
2266 _ACEOF
2267 if ac_fn_c_try_run "$LINENO"; then :
2268   echo >>conftest.val; read $3 <conftest.val; ac_retval=0
2269 else
2270   ac_retval=1
2271 fi
2272 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
2273   conftest.$ac_objext conftest.beam conftest.$ac_ext
2274 rm -f conftest.val
2275
2276   fi
2277   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2278   as_fn_set_status $ac_retval
2279
2280 } # ac_fn_c_compute_int
2281
2282 # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
2283 # ---------------------------------------------
2284 # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
2285 # accordingly.
2286 ac_fn_c_check_decl ()
2287 {
2288   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2289   as_decl_name=`echo $2|sed 's/ *(.*//'`
2290   as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
2291   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
2292 $as_echo_n "checking whether $as_decl_name is declared... " >&6; }
2293 if eval \${$3+:} false; then :
2294   $as_echo_n "(cached) " >&6
2295 else
2296   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2297 /* end confdefs.h.  */
2298 $4
2299 int
2300 main ()
2301 {
2302 #ifndef $as_decl_name
2303 #ifdef __cplusplus
2304   (void) $as_decl_use;
2305 #else
2306   (void) $as_decl_name;
2307 #endif
2308 #endif
2309
2310   ;
2311   return 0;
2312 }
2313 _ACEOF
2314 if ac_fn_c_try_compile "$LINENO"; then :
2315   eval "$3=yes"
2316 else
2317   eval "$3=no"
2318 fi
2319 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2320 fi
2321 eval ac_res=\$$3
2322                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2323 $as_echo "$ac_res" >&6; }
2324   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2325
2326 } # ac_fn_c_check_decl
2327 cat >config.log <<_ACEOF
2328 This file contains any messages produced by compilers while
2329 running configure, to aid debugging if configure makes a mistake.
2330
2331 It was created by PostgreSQL $as_me 10devel, which was
2332 generated by GNU Autoconf 2.69.  Invocation command line was
2333
2334   $ $0 $@
2335
2336 _ACEOF
2337 exec 5>>config.log
2338 {
2339 cat <<_ASUNAME
2340 ## --------- ##
2341 ## Platform. ##
2342 ## --------- ##
2343
2344 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
2345 uname -m = `(uname -m) 2>/dev/null || echo unknown`
2346 uname -r = `(uname -r) 2>/dev/null || echo unknown`
2347 uname -s = `(uname -s) 2>/dev/null || echo unknown`
2348 uname -v = `(uname -v) 2>/dev/null || echo unknown`
2349
2350 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
2351 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
2352
2353 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
2354 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
2355 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
2356 /usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
2357 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
2358 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
2359 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
2360
2361 _ASUNAME
2362
2363 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2364 for as_dir in $PATH
2365 do
2366   IFS=$as_save_IFS
2367   test -z "$as_dir" && as_dir=.
2368     $as_echo "PATH: $as_dir"
2369   done
2370 IFS=$as_save_IFS
2371
2372 } >&5
2373
2374 cat >&5 <<_ACEOF
2375
2376
2377 ## ----------- ##
2378 ## Core tests. ##
2379 ## ----------- ##
2380
2381 _ACEOF
2382
2383
2384 # Keep a trace of the command line.
2385 # Strip out --no-create and --no-recursion so they do not pile up.
2386 # Strip out --silent because we don't want to record it for future runs.
2387 # Also quote any args containing shell meta-characters.
2388 # Make two passes to allow for proper duplicate-argument suppression.
2389 ac_configure_args=
2390 ac_configure_args0=
2391 ac_configure_args1=
2392 ac_must_keep_next=false
2393 for ac_pass in 1 2
2394 do
2395   for ac_arg
2396   do
2397     case $ac_arg in
2398     -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
2399     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
2400     | -silent | --silent | --silen | --sile | --sil)
2401       continue ;;
2402     *\'*)
2403       ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
2404     esac
2405     case $ac_pass in
2406     1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2407     2)
2408       as_fn_append ac_configure_args1 " '$ac_arg'"
2409       if test $ac_must_keep_next = true; then
2410         ac_must_keep_next=false # Got value, back to normal.
2411       else
2412         case $ac_arg in
2413           *=* | --config-cache | -C | -disable-* | --disable-* \
2414           | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
2415           | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
2416           | -with-* | --with-* | -without-* | --without-* | --x)
2417             case "$ac_configure_args0 " in
2418               "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
2419             esac
2420             ;;
2421           -* ) ac_must_keep_next=true ;;
2422         esac
2423       fi
2424       as_fn_append ac_configure_args " '$ac_arg'"
2425       ;;
2426     esac
2427   done
2428 done
2429 { ac_configure_args0=; unset ac_configure_args0;}
2430 { ac_configure_args1=; unset ac_configure_args1;}
2431
2432 # When interrupted or exit'd, cleanup temporary files, and complete
2433 # config.log.  We remove comments because anyway the quotes in there
2434 # would cause problems or look ugly.
2435 # WARNING: Use '\'' to represent an apostrophe within the trap.
2436 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
2437 trap 'exit_status=$?
2438   # Save into config.log some information that might help in debugging.
2439   {
2440     echo
2441
2442     $as_echo "## ---------------- ##
2443 ## Cache variables. ##
2444 ## ---------------- ##"
2445     echo
2446     # The following way of writing the cache mishandles newlines in values,
2447 (
2448   for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
2449     eval ac_val=\$$ac_var
2450     case $ac_val in #(
2451     *${as_nl}*)
2452       case $ac_var in #(
2453       *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
2454 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2455       esac
2456       case $ac_var in #(
2457       _ | IFS | as_nl) ;; #(
2458       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
2459       *) { eval $ac_var=; unset $ac_var;} ;;
2460       esac ;;
2461     esac
2462   done
2463   (set) 2>&1 |
2464     case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
2465     *${as_nl}ac_space=\ *)
2466       sed -n \
2467         "s/'\''/'\''\\\\'\'''\''/g;
2468           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
2469       ;; #(
2470     *)
2471       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
2472       ;;
2473     esac |
2474     sort
2475 )
2476     echo
2477
2478     $as_echo "## ----------------- ##
2479 ## Output variables. ##
2480 ## ----------------- ##"
2481     echo
2482     for ac_var in $ac_subst_vars
2483     do
2484       eval ac_val=\$$ac_var
2485       case $ac_val in
2486       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2487       esac
2488       $as_echo "$ac_var='\''$ac_val'\''"
2489     done | sort
2490     echo
2491
2492     if test -n "$ac_subst_files"; then
2493       $as_echo "## ------------------- ##
2494 ## File substitutions. ##
2495 ## ------------------- ##"
2496       echo
2497       for ac_var in $ac_subst_files
2498       do
2499         eval ac_val=\$$ac_var
2500         case $ac_val in
2501         *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2502         esac
2503         $as_echo "$ac_var='\''$ac_val'\''"
2504       done | sort
2505       echo
2506     fi
2507
2508     if test -s confdefs.h; then
2509       $as_echo "## ----------- ##
2510 ## confdefs.h. ##
2511 ## ----------- ##"
2512       echo
2513       cat confdefs.h
2514       echo
2515     fi
2516     test "$ac_signal" != 0 &&
2517       $as_echo "$as_me: caught signal $ac_signal"
2518     $as_echo "$as_me: exit $exit_status"
2519   } >&5
2520   rm -f core *.core core.conftest.* &&
2521     rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
2522     exit $exit_status
2523 ' 0
2524 for ac_signal in 1 2 13 15; do
2525   trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
2526 done
2527 ac_signal=0
2528
2529 # confdefs.h avoids OS command line length limits that DEFS can exceed.
2530 rm -f -r conftest* confdefs.h
2531
2532 $as_echo "/* confdefs.h */" > confdefs.h
2533
2534 # Predefined preprocessor variables.
2535
2536 cat >>confdefs.h <<_ACEOF
2537 #define PACKAGE_NAME "$PACKAGE_NAME"
2538 _ACEOF
2539
2540 cat >>confdefs.h <<_ACEOF
2541 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
2542 _ACEOF
2543
2544 cat >>confdefs.h <<_ACEOF
2545 #define PACKAGE_VERSION "$PACKAGE_VERSION"
2546 _ACEOF
2547
2548 cat >>confdefs.h <<_ACEOF
2549 #define PACKAGE_STRING "$PACKAGE_STRING"
2550 _ACEOF
2551
2552 cat >>confdefs.h <<_ACEOF
2553 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
2554 _ACEOF
2555
2556 cat >>confdefs.h <<_ACEOF
2557 #define PACKAGE_URL "$PACKAGE_URL"
2558 _ACEOF
2559
2560
2561 # Let the site file select an alternate cache file if it wants to.
2562 # Prefer an explicitly selected file to automatically selected ones.
2563 ac_site_file1=NONE
2564 ac_site_file2=NONE
2565 if test -n "$CONFIG_SITE"; then
2566   # We do not want a PATH search for config.site.
2567   case $CONFIG_SITE in #((
2568     -*)  ac_site_file1=./$CONFIG_SITE;;
2569     */*) ac_site_file1=$CONFIG_SITE;;
2570     *)   ac_site_file1=./$CONFIG_SITE;;
2571   esac
2572 elif test "x$prefix" != xNONE; then
2573   ac_site_file1=$prefix/share/config.site
2574   ac_site_file2=$prefix/etc/config.site
2575 else
2576   ac_site_file1=$ac_default_prefix/share/config.site
2577   ac_site_file2=$ac_default_prefix/etc/config.site
2578 fi
2579 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
2580 do
2581   test "x$ac_site_file" = xNONE && continue
2582   if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
2583     { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2584 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
2585     sed 's/^/| /' "$ac_site_file" >&5
2586     . "$ac_site_file" \
2587       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2588 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2589 as_fn_error $? "failed to load site script $ac_site_file
2590 See \`config.log' for more details" "$LINENO" 5; }
2591   fi
2592 done
2593
2594 if test -r "$cache_file"; then
2595   # Some versions of bash will fail to source /dev/null (special files
2596   # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
2597   if test /dev/null != "$cache_file" && test -f "$cache_file"; then
2598     { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
2599 $as_echo "$as_me: loading cache $cache_file" >&6;}
2600     case $cache_file in
2601       [\\/]* | ?:[\\/]* ) . "$cache_file";;
2602       *)                      . "./$cache_file";;
2603     esac
2604   fi
2605 else
2606   { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
2607 $as_echo "$as_me: creating cache $cache_file" >&6;}
2608   >$cache_file
2609 fi
2610
2611 # Check that the precious variables saved in the cache have kept the same
2612 # value.
2613 ac_cache_corrupted=false
2614 for ac_var in $ac_precious_vars; do
2615   eval ac_old_set=\$ac_cv_env_${ac_var}_set
2616   eval ac_new_set=\$ac_env_${ac_var}_set
2617   eval ac_old_val=\$ac_cv_env_${ac_var}_value
2618   eval ac_new_val=\$ac_env_${ac_var}_value
2619   case $ac_old_set,$ac_new_set in
2620     set,)
2621       { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
2622 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
2623       ac_cache_corrupted=: ;;
2624     ,set)
2625       { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
2626 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
2627       ac_cache_corrupted=: ;;
2628     ,);;
2629     *)
2630       if test "x$ac_old_val" != "x$ac_new_val"; then
2631         # differences in whitespace do not lead to failure.
2632         ac_old_val_w=`echo x $ac_old_val`
2633         ac_new_val_w=`echo x $ac_new_val`
2634         if test "$ac_old_val_w" != "$ac_new_val_w"; then
2635           { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
2636 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
2637           ac_cache_corrupted=:
2638         else
2639           { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
2640 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
2641           eval $ac_var=\$ac_old_val
2642         fi
2643         { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
2644 $as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
2645         { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
2646 $as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
2647       fi;;
2648   esac
2649   # Pass precious variables to config.status.
2650   if test "$ac_new_set" = set; then
2651     case $ac_new_val in
2652     *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
2653     *) ac_arg=$ac_var=$ac_new_val ;;
2654     esac
2655     case " $ac_configure_args " in
2656       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
2657       *) as_fn_append ac_configure_args " '$ac_arg'" ;;
2658     esac
2659   fi
2660 done
2661 if $ac_cache_corrupted; then
2662   { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2663 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2664   { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
2665 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
2666   as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
2667 fi
2668 ## -------------------- ##
2669 ## Main body of script. ##
2670 ## -------------------- ##
2671
2672 ac_ext=c
2673 ac_cpp='$CPP $CPPFLAGS'
2674 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2675 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2676 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2677
2678
2679
2680
2681
2682
2683 ac_aux_dir=
2684 for ac_dir in config "$srcdir"/config; do
2685   if test -f "$ac_dir/install-sh"; then
2686     ac_aux_dir=$ac_dir
2687     ac_install_sh="$ac_aux_dir/install-sh -c"
2688     break
2689   elif test -f "$ac_dir/install.sh"; then
2690     ac_aux_dir=$ac_dir
2691     ac_install_sh="$ac_aux_dir/install.sh -c"
2692     break
2693   elif test -f "$ac_dir/shtool"; then
2694     ac_aux_dir=$ac_dir
2695     ac_install_sh="$ac_aux_dir/shtool install -c"
2696     break
2697   fi
2698 done
2699 if test -z "$ac_aux_dir"; then
2700   as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5
2701 fi
2702
2703 # These three variables are undocumented and unsupported,
2704 # and are intended to be withdrawn in a future Autoconf release.
2705 # They can cause serious problems if a builder's source tree is in a directory
2706 # whose full name contains unusual characters.
2707 ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
2708 ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
2709 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
2710
2711
2712
2713 configure_args=$ac_configure_args
2714
2715
2716 PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`
2717
2718
2719 cat >>confdefs.h <<_ACEOF
2720 #define PG_MAJORVERSION "$PG_MAJORVERSION"
2721 _ACEOF
2722
2723
2724
2725
2726
2727 # Check whether --with-extra-version was given.
2728 if test "${with_extra_version+set}" = set; then :
2729   withval=$with_extra_version;
2730   case $withval in
2731     yes)
2732       as_fn_error $? "argument required for --with-extra-version option" "$LINENO" 5
2733       ;;
2734     no)
2735       as_fn_error $? "argument required for --with-extra-version option" "$LINENO" 5
2736       ;;
2737     *)
2738       PG_VERSION="$PACKAGE_VERSION$withval"
2739       ;;
2740   esac
2741
2742 else
2743   PG_VERSION="$PACKAGE_VERSION"
2744 fi
2745
2746
2747
2748 cat >>confdefs.h <<_ACEOF
2749 #define PG_VERSION "$PG_VERSION"
2750 _ACEOF
2751
2752
2753 # Make sure we can run config.sub.
2754 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
2755   as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
2756
2757 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
2758 $as_echo_n "checking build system type... " >&6; }
2759 if ${ac_cv_build+:} false; then :
2760   $as_echo_n "(cached) " >&6
2761 else
2762   ac_build_alias=$build_alias
2763 test "x$ac_build_alias" = x &&
2764   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
2765 test "x$ac_build_alias" = x &&
2766   as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
2767 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
2768   as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
2769
2770 fi
2771 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
2772 $as_echo "$ac_cv_build" >&6; }
2773 case $ac_cv_build in
2774 *-*-*) ;;
2775 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
2776 esac
2777 build=$ac_cv_build
2778 ac_save_IFS=$IFS; IFS='-'
2779 set x $ac_cv_build
2780 shift
2781 build_cpu=$1
2782 build_vendor=$2
2783 shift; shift
2784 # Remember, the first character of IFS is used to create $*,
2785 # except with old shells:
2786 build_os=$*
2787 IFS=$ac_save_IFS
2788 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
2789
2790
2791 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
2792 $as_echo_n "checking host system type... " >&6; }
2793 if ${ac_cv_host+:} false; then :
2794   $as_echo_n "(cached) " >&6
2795 else
2796   if test "x$host_alias" = x; then
2797   ac_cv_host=$ac_cv_build
2798 else
2799   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
2800     as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
2801 fi
2802
2803 fi
2804 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
2805 $as_echo "$ac_cv_host" >&6; }
2806 case $ac_cv_host in
2807 *-*-*) ;;
2808 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
2809 esac
2810 host=$ac_cv_host
2811 ac_save_IFS=$IFS; IFS='-'
2812 set x $ac_cv_host
2813 shift
2814 host_cpu=$1
2815 host_vendor=$2
2816 shift; shift
2817 # Remember, the first character of IFS is used to create $*,
2818 # except with old shells:
2819 host_os=$*
2820 IFS=$ac_save_IFS
2821 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
2822
2823
2824
2825 template=
2826 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which template to use" >&5
2827 $as_echo_n "checking which template to use... " >&6; }
2828
2829
2830
2831
2832 # Check whether --with-template was given.
2833 if test "${with_template+set}" = set; then :
2834   withval=$with_template;
2835   case $withval in
2836     yes)
2837       as_fn_error $? "argument required for --with-template option" "$LINENO" 5
2838       ;;
2839     no)
2840       as_fn_error $? "argument required for --with-template option" "$LINENO" 5
2841       ;;
2842     *)
2843
2844   case $withval in
2845     list)   echo; ls "$srcdir/src/template"; exit;;
2846     *)      if test -f "$srcdir/src/template/$with_template" ; then
2847               template=$withval
2848             else
2849               as_fn_error $? "'$withval' is not a valid template name. Use 'list' for a list." "$LINENO" 5
2850             fi;;
2851   esac
2852
2853       ;;
2854   esac
2855
2856 else
2857
2858 # --with-template not given
2859
2860 case $host_os in
2861      aix*) template=aix ;;
2862   cygwin*) template=cygwin ;;
2863   darwin*) template=darwin ;;
2864 dragonfly*) template=netbsd ;;
2865  freebsd*) template=freebsd ;;
2866     hpux*) template=hpux ;;
2867  linux*|gnu*|k*bsd*-gnu)
2868            template=linux ;;
2869    mingw*) template=win32 ;;
2870   netbsd*) template=netbsd ;;
2871  openbsd*) template=openbsd ;;
2872  solaris*) template=solaris ;;
2873 esac
2874
2875   if test x"$template" = x"" ; then
2876     as_fn_error $? "
2877 *******************************************************************
2878 PostgreSQL has apparently not been ported to your platform yet.
2879 To try a manual configuration, look into the src/template directory
2880 for a similar platform and use the '--with-template=' option.
2881
2882 Please also contact <pgsql-bugs@postgresql.org> to see about
2883 rectifying this.  Include the above 'checking host system type...'
2884 line.
2885 *******************************************************************
2886 " "$LINENO" 5
2887   fi
2888
2889
2890 fi
2891
2892
2893
2894 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $template" >&5
2895 $as_echo "$template" >&6; }
2896
2897 PORTNAME=$template
2898
2899
2900 # Initialize default assumption that we do not need separate assembly code
2901 # for TAS (test-and-set).  This can be overridden by the template file
2902 # when it's executed.
2903 need_tas=no
2904 tas_file=dummy.s
2905
2906
2907
2908 ##
2909 ## Command line options
2910 ##
2911
2912 #
2913 # Add non-standard directories to the include path
2914 #
2915
2916
2917
2918 # Check whether --with-includes was given.
2919 if test "${with_includes+set}" = set; then :
2920   withval=$with_includes;
2921   case $withval in
2922     yes)
2923       as_fn_error $? "argument required for --with-includes option" "$LINENO" 5
2924       ;;
2925     no)
2926       as_fn_error $? "argument required for --with-includes option" "$LINENO" 5
2927       ;;
2928     *)
2929
2930       ;;
2931   esac
2932
2933 fi
2934
2935
2936
2937
2938 #
2939 # Add non-standard directories to the library search path
2940 #
2941
2942
2943
2944 # Check whether --with-libraries was given.
2945 if test "${with_libraries+set}" = set; then :
2946   withval=$with_libraries;
2947   case $withval in
2948     yes)
2949       as_fn_error $? "argument required for --with-libraries option" "$LINENO" 5
2950       ;;
2951     no)
2952       as_fn_error $? "argument required for --with-libraries option" "$LINENO" 5
2953       ;;
2954     *)
2955       LIBRARY_DIRS=$withval
2956       ;;
2957   esac
2958
2959 fi
2960
2961
2962
2963
2964
2965
2966 # Check whether --with-libs was given.
2967 if test "${with_libs+set}" = set; then :
2968   withval=$with_libs;
2969   case $withval in
2970     yes)
2971       as_fn_error $? "argument required for --with-libs option" "$LINENO" 5
2972       ;;
2973     no)
2974       as_fn_error $? "argument required for --with-libs option" "$LINENO" 5
2975       ;;
2976     *)
2977       LIBRARY_DIRS=$withval
2978       ;;
2979   esac
2980
2981 fi
2982
2983
2984
2985
2986 #
2987 # 64-bit integer date/time storage: enabled by default.
2988 #
2989 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with 64-bit integer date/time support" >&5
2990 $as_echo_n "checking whether to build with 64-bit integer date/time support... " >&6; }
2991
2992
2993 # Check whether --enable-integer-datetimes was given.
2994 if test "${enable_integer_datetimes+set}" = set; then :
2995   enableval=$enable_integer_datetimes;
2996   case $enableval in
2997     yes)
2998
2999 $as_echo "#define USE_INTEGER_DATETIMES 1" >>confdefs.h
3000
3001       ;;
3002     no)
3003       :
3004       ;;
3005     *)
3006       as_fn_error $? "no argument expected for --enable-integer-datetimes option" "$LINENO" 5
3007       ;;
3008   esac
3009
3010 else
3011   enable_integer_datetimes=yes
3012
3013 $as_echo "#define USE_INTEGER_DATETIMES 1" >>confdefs.h
3014
3015 fi
3016
3017
3018 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_integer_datetimes" >&5
3019 $as_echo "$enable_integer_datetimes" >&6; }
3020
3021
3022 #
3023 # NLS
3024 #
3025 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is wanted" >&5
3026 $as_echo_n "checking whether NLS is wanted... " >&6; }
3027
3028
3029 # Check whether --enable-nls was given.
3030 if test "${enable_nls+set}" = set; then :
3031   enableval=$enable_nls;
3032   case $enableval in
3033     yes)
3034       :
3035       ;;
3036     no)
3037       :
3038       ;;
3039     *)
3040       enable_nls=yes
3041 WANTED_LANGUAGES=$enableval
3042       ;;
3043   esac
3044
3045 else
3046   enable_nls=no
3047 fi
3048
3049
3050
3051 if test "$enable_nls" = yes; then
3052
3053 $as_echo "#define ENABLE_NLS 1" >>confdefs.h
3054
3055 fi
3056
3057 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_nls" >&5
3058 $as_echo "$enable_nls" >&6; }
3059
3060
3061
3062 #
3063 # Default port number (--with-pgport), default 5432
3064 #
3065 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for default port number" >&5
3066 $as_echo_n "checking for default port number... " >&6; }
3067
3068
3069
3070 # Check whether --with-pgport was given.
3071 if test "${with_pgport+set}" = set; then :
3072   withval=$with_pgport;
3073   case $withval in
3074     yes)
3075       as_fn_error $? "argument required for --with-pgport option" "$LINENO" 5
3076       ;;
3077     no)
3078       as_fn_error $? "argument required for --with-pgport option" "$LINENO" 5
3079       ;;
3080     *)
3081       default_port=$withval
3082       ;;
3083   esac
3084
3085 else
3086   default_port=5432
3087 fi
3088
3089
3090 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $default_port" >&5
3091 $as_echo "$default_port" >&6; }
3092 # Need both of these because some places want an integer and some a string
3093
3094 cat >>confdefs.h <<_ACEOF
3095 #define DEF_PGPORT ${default_port}
3096 _ACEOF
3097
3098
3099 cat >>confdefs.h <<_ACEOF
3100 #define DEF_PGPORT_STR "${default_port}"
3101 _ACEOF
3102
3103
3104
3105 # It's worth validating port; you can get very confusing errors otherwise
3106 if test x"$default_port" = x""; then
3107   as_fn_error $? "invalid --with-pgport specification: empty string" "$LINENO" 5
3108 elif test ! x`echo "$default_port" | sed -e 's/[0-9]*//'` = x""; then
3109   as_fn_error $? "invalid --with-pgport specification: must be a number" "$LINENO" 5
3110 elif test ! x`echo "$default_port" | sed -e 's/^0.//'` = x"$default_port"; then
3111   as_fn_error $? "invalid --with-pgport specification: must not have leading 0" "$LINENO" 5
3112 elif test "$default_port" -lt "1" -o "$default_port" -gt "65535"; then
3113   as_fn_error $? "invalid --with-pgport specification: must be between 1 and 65535" "$LINENO" 5
3114 fi
3115
3116 #
3117 # '-rpath'-like feature can be disabled
3118 #
3119
3120
3121 # Check whether --enable-rpath was given.
3122 if test "${enable_rpath+set}" = set; then :
3123   enableval=$enable_rpath;
3124   case $enableval in
3125     yes)
3126       :
3127       ;;
3128     no)
3129       :
3130       ;;
3131     *)
3132       as_fn_error $? "no argument expected for --enable-rpath option" "$LINENO" 5
3133       ;;
3134   esac
3135
3136 else
3137   enable_rpath=yes
3138
3139 fi
3140
3141
3142
3143
3144 #
3145 # Spinlocks
3146 #
3147
3148
3149 # Check whether --enable-spinlocks was given.
3150 if test "${enable_spinlocks+set}" = set; then :
3151   enableval=$enable_spinlocks;
3152   case $enableval in
3153     yes)
3154       :
3155       ;;
3156     no)
3157       :
3158       ;;
3159     *)
3160       as_fn_error $? "no argument expected for --enable-spinlocks option" "$LINENO" 5
3161       ;;
3162   esac
3163
3164 else
3165   enable_spinlocks=yes
3166
3167 fi
3168
3169
3170
3171 #
3172 # Atomic operations
3173 #
3174
3175
3176 # Check whether --enable-atomics was given.
3177 if test "${enable_atomics+set}" = set; then :
3178   enableval=$enable_atomics;
3179   case $enableval in
3180     yes)
3181       :
3182       ;;
3183     no)
3184       :
3185       ;;
3186     *)
3187       as_fn_error $? "no argument expected for --enable-atomics option" "$LINENO" 5
3188       ;;
3189   esac
3190
3191 else
3192   enable_atomics=yes
3193
3194 fi
3195
3196
3197
3198 #
3199 # Random number generation
3200 #
3201
3202
3203 # Check whether --enable-strong-random was given.
3204 if test "${enable_strong_random+set}" = set; then :
3205   enableval=$enable_strong_random;
3206   case $enableval in
3207     yes)
3208       :
3209       ;;
3210     no)
3211       :
3212       ;;
3213     *)
3214       as_fn_error $? "no argument expected for --enable-strong-random option" "$LINENO" 5
3215       ;;
3216   esac
3217
3218 else
3219   enable_strong_random=yes
3220
3221 fi
3222
3223
3224
3225
3226 #
3227 # --enable-debug adds -g to compiler flags
3228 #
3229
3230
3231 # Check whether --enable-debug was given.
3232 if test "${enable_debug+set}" = set; then :
3233   enableval=$enable_debug;
3234   case $enableval in
3235     yes)
3236       :
3237       ;;
3238     no)
3239       :
3240       ;;
3241     *)
3242       as_fn_error $? "no argument expected for --enable-debug option" "$LINENO" 5
3243       ;;
3244   esac
3245
3246 else
3247   enable_debug=no
3248
3249 fi
3250
3251
3252
3253
3254 #
3255 # --enable-profiling enables gcc profiling
3256 #
3257
3258
3259 # Check whether --enable-profiling was given.
3260 if test "${enable_profiling+set}" = set; then :
3261   enableval=$enable_profiling;
3262   case $enableval in
3263     yes)
3264       :
3265       ;;
3266     no)
3267       :
3268       ;;
3269     *)
3270       as_fn_error $? "no argument expected for --enable-profiling option" "$LINENO" 5
3271       ;;
3272   esac
3273
3274 else
3275   enable_profiling=no
3276
3277 fi
3278
3279
3280
3281 #
3282 # --enable-coverage enables generation of code coverage metrics with gcov
3283 #
3284
3285
3286 # Check whether --enable-coverage was given.
3287 if test "${enable_coverage+set}" = set; then :
3288   enableval=$enable_coverage;
3289   case $enableval in
3290     yes)
3291       for ac_prog in gcov
3292 do
3293   # Extract the first word of "$ac_prog", so it can be a program name with args.
3294 set dummy $ac_prog; ac_word=$2
3295 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3296 $as_echo_n "checking for $ac_word... " >&6; }
3297 if ${ac_cv_prog_GCOV+:} false; then :
3298   $as_echo_n "(cached) " >&6
3299 else
3300   if test -n "$GCOV"; then
3301   ac_cv_prog_GCOV="$GCOV" # Let the user override the test.
3302 else
3303 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3304 for as_dir in $PATH
3305 do
3306   IFS=$as_save_IFS
3307   test -z "$as_dir" && as_dir=.
3308     for ac_exec_ext in '' $ac_executable_extensions; do
3309   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3310     ac_cv_prog_GCOV="$ac_prog"
3311     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3312     break 2
3313   fi
3314 done
3315   done
3316 IFS=$as_save_IFS
3317
3318 fi
3319 fi
3320 GCOV=$ac_cv_prog_GCOV
3321 if test -n "$GCOV"; then
3322   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5
3323 $as_echo "$GCOV" >&6; }
3324 else
3325   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3326 $as_echo "no" >&6; }
3327 fi
3328
3329
3330   test -n "$GCOV" && break
3331 done
3332
3333 if test -z "$GCOV"; then
3334   as_fn_error $? "gcov not found" "$LINENO" 5
3335 fi
3336 for ac_prog in lcov
3337 do
3338   # Extract the first word of "$ac_prog", so it can be a program name with args.
3339 set dummy $ac_prog; ac_word=$2
3340 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3341 $as_echo_n "checking for $ac_word... " >&6; }
3342 if ${ac_cv_prog_LCOV+:} false; then :
3343   $as_echo_n "(cached) " >&6
3344 else
3345   if test -n "$LCOV"; then
3346   ac_cv_prog_LCOV="$LCOV" # Let the user override the test.
3347 else
3348 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3349 for as_dir in $PATH
3350 do
3351   IFS=$as_save_IFS
3352   test -z "$as_dir" && as_dir=.
3353     for ac_exec_ext in '' $ac_executable_extensions; do
3354   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3355     ac_cv_prog_LCOV="$ac_prog"
3356     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3357     break 2
3358   fi
3359 done
3360   done
3361 IFS=$as_save_IFS
3362
3363 fi
3364 fi
3365 LCOV=$ac_cv_prog_LCOV
3366 if test -n "$LCOV"; then
3367   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5
3368 $as_echo "$LCOV" >&6; }
3369 else
3370   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3371 $as_echo "no" >&6; }
3372 fi
3373
3374
3375   test -n "$LCOV" && break
3376 done
3377
3378 if test -z "$LCOV"; then
3379   as_fn_error $? "lcov not found" "$LINENO" 5
3380 fi
3381 for ac_prog in genhtml
3382 do
3383   # Extract the first word of "$ac_prog", so it can be a program name with args.
3384 set dummy $ac_prog; ac_word=$2
3385 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3386 $as_echo_n "checking for $ac_word... " >&6; }
3387 if ${ac_cv_prog_GENHTML+:} false; then :
3388   $as_echo_n "(cached) " >&6
3389 else
3390   if test -n "$GENHTML"; then
3391   ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test.
3392 else
3393 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3394 for as_dir in $PATH
3395 do
3396   IFS=$as_save_IFS
3397   test -z "$as_dir" && as_dir=.
3398     for ac_exec_ext in '' $ac_executable_extensions; do
3399   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3400     ac_cv_prog_GENHTML="$ac_prog"
3401     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3402     break 2
3403   fi
3404 done
3405   done
3406 IFS=$as_save_IFS
3407
3408 fi
3409 fi
3410 GENHTML=$ac_cv_prog_GENHTML
3411 if test -n "$GENHTML"; then
3412   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5
3413 $as_echo "$GENHTML" >&6; }
3414 else
3415   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3416 $as_echo "no" >&6; }
3417 fi
3418
3419
3420   test -n "$GENHTML" && break
3421 done
3422
3423 if test -z "$GENHTML"; then
3424   as_fn_error $? "genhtml not found" "$LINENO" 5
3425 fi
3426       ;;
3427     no)
3428       :
3429       ;;
3430     *)
3431       as_fn_error $? "no argument expected for --enable-coverage option" "$LINENO" 5
3432       ;;
3433   esac
3434
3435 else
3436   enable_coverage=no
3437
3438 fi
3439
3440
3441
3442
3443 #
3444 # DTrace
3445 #
3446
3447
3448 # Check whether --enable-dtrace was given.
3449 if test "${enable_dtrace+set}" = set; then :
3450   enableval=$enable_dtrace;
3451   case $enableval in
3452     yes)
3453       for ac_prog in dtrace
3454 do
3455   # Extract the first word of "$ac_prog", so it can be a program name with args.
3456 set dummy $ac_prog; ac_word=$2
3457 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3458 $as_echo_n "checking for $ac_word... " >&6; }
3459 if ${ac_cv_prog_DTRACE+:} false; then :
3460   $as_echo_n "(cached) " >&6
3461 else
3462   if test -n "$DTRACE"; then
3463   ac_cv_prog_DTRACE="$DTRACE" # Let the user override the test.
3464 else
3465 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3466 for as_dir in $PATH
3467 do
3468   IFS=$as_save_IFS
3469   test -z "$as_dir" && as_dir=.
3470     for ac_exec_ext in '' $ac_executable_extensions; do
3471   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3472     ac_cv_prog_DTRACE="$ac_prog"
3473     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3474     break 2
3475   fi
3476 done
3477   done
3478 IFS=$as_save_IFS
3479
3480 fi
3481 fi
3482 DTRACE=$ac_cv_prog_DTRACE
3483 if test -n "$DTRACE"; then
3484   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5
3485 $as_echo "$DTRACE" >&6; }
3486 else
3487   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3488 $as_echo "no" >&6; }
3489 fi
3490
3491
3492   test -n "$DTRACE" && break
3493 done
3494
3495 if test -z "$DTRACE"; then
3496   as_fn_error $? "dtrace not found" "$LINENO" 5
3497 fi
3498
3499       ;;
3500     no)
3501       :
3502       ;;
3503     *)
3504       as_fn_error $? "no argument expected for --enable-dtrace option" "$LINENO" 5
3505       ;;
3506   esac
3507
3508 else
3509   enable_dtrace=no
3510
3511 fi
3512
3513
3514
3515
3516 #
3517 # TAP tests
3518 #
3519
3520
3521 # Check whether --enable-tap-tests was given.
3522 if test "${enable_tap_tests+set}" = set; then :
3523   enableval=$enable_tap_tests;
3524   case $enableval in
3525     yes)
3526       :
3527       ;;
3528     no)
3529       :
3530       ;;
3531     *)
3532       as_fn_error $? "no argument expected for --enable-tap-tests option" "$LINENO" 5
3533       ;;
3534   esac
3535
3536 else
3537   enable_tap_tests=no
3538
3539 fi
3540
3541
3542
3543
3544 #
3545 # Block size
3546 #
3547 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for block size" >&5
3548 $as_echo_n "checking for block size... " >&6; }
3549
3550
3551
3552 # Check whether --with-blocksize was given.
3553 if test "${with_blocksize+set}" = set; then :
3554   withval=$with_blocksize;
3555   case $withval in
3556     yes)
3557       as_fn_error $? "argument required for --with-blocksize option" "$LINENO" 5
3558       ;;
3559     no)
3560       as_fn_error $? "argument required for --with-blocksize option" "$LINENO" 5
3561       ;;
3562     *)
3563       blocksize=$withval
3564       ;;
3565   esac
3566
3567 else
3568   blocksize=8
3569 fi
3570
3571
3572 case ${blocksize} in
3573   1) BLCKSZ=1024;;
3574   2) BLCKSZ=2048;;
3575   4) BLCKSZ=4096;;
3576   8) BLCKSZ=8192;;
3577  16) BLCKSZ=16384;;
3578  32) BLCKSZ=32768;;
3579   *) as_fn_error $? "Invalid block size. Allowed values are 1,2,4,8,16,32." "$LINENO" 5
3580 esac
3581 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${blocksize}kB" >&5
3582 $as_echo "${blocksize}kB" >&6; }
3583
3584
3585 cat >>confdefs.h <<_ACEOF
3586 #define BLCKSZ ${BLCKSZ}
3587 _ACEOF
3588
3589
3590 #
3591 # Relation segment size
3592 #
3593 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for segment size" >&5
3594 $as_echo_n "checking for segment size... " >&6; }
3595
3596
3597
3598 # Check whether --with-segsize was given.
3599 if test "${with_segsize+set}" = set; then :
3600   withval=$with_segsize;
3601   case $withval in
3602     yes)
3603       as_fn_error $? "argument required for --with-segsize option" "$LINENO" 5
3604       ;;
3605     no)
3606       as_fn_error $? "argument required for --with-segsize option" "$LINENO" 5
3607       ;;
3608     *)
3609       segsize=$withval
3610       ;;
3611   esac
3612
3613 else
3614   segsize=1
3615 fi
3616
3617
3618 # this expression is set up to avoid unnecessary integer overflow
3619 # blocksize is already guaranteed to be a factor of 1024
3620 RELSEG_SIZE=`expr '(' 1024 / ${blocksize} ')' '*' ${segsize} '*' 1024`
3621 test $? -eq 0 || exit 1
3622 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${segsize}GB" >&5
3623 $as_echo "${segsize}GB" >&6; }
3624
3625
3626 cat >>confdefs.h <<_ACEOF
3627 #define RELSEG_SIZE ${RELSEG_SIZE}
3628 _ACEOF
3629
3630
3631 #
3632 # WAL block size
3633 #
3634 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAL block size" >&5
3635 $as_echo_n "checking for WAL block size... " >&6; }
3636
3637
3638
3639 # Check whether --with-wal-blocksize was given.
3640 if test "${with_wal_blocksize+set}" = set; then :
3641   withval=$with_wal_blocksize;
3642   case $withval in
3643     yes)
3644       as_fn_error $? "argument required for --with-wal-blocksize option" "$LINENO" 5
3645       ;;
3646     no)
3647       as_fn_error $? "argument required for --with-wal-blocksize option" "$LINENO" 5
3648       ;;
3649     *)
3650       wal_blocksize=$withval
3651       ;;
3652   esac
3653
3654 else
3655   wal_blocksize=8
3656 fi
3657
3658
3659 case ${wal_blocksize} in
3660   1) XLOG_BLCKSZ=1024;;
3661   2) XLOG_BLCKSZ=2048;;
3662   4) XLOG_BLCKSZ=4096;;
3663   8) XLOG_BLCKSZ=8192;;
3664  16) XLOG_BLCKSZ=16384;;
3665  32) XLOG_BLCKSZ=32768;;
3666  64) XLOG_BLCKSZ=65536;;
3667   *) as_fn_error $? "Invalid WAL block size. Allowed values are 1,2,4,8,16,32,64." "$LINENO" 5
3668 esac
3669 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${wal_blocksize}kB" >&5
3670 $as_echo "${wal_blocksize}kB" >&6; }
3671
3672
3673 cat >>confdefs.h <<_ACEOF
3674 #define XLOG_BLCKSZ ${XLOG_BLCKSZ}
3675 _ACEOF
3676
3677
3678 #
3679 # WAL segment size
3680 #
3681 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAL segment size" >&5
3682 $as_echo_n "checking for WAL segment size... " >&6; }
3683
3684
3685
3686 # Check whether --with-wal-segsize was given.
3687 if test "${with_wal_segsize+set}" = set; then :
3688   withval=$with_wal_segsize;
3689   case $withval in
3690     yes)
3691       as_fn_error $? "argument required for --with-wal-segsize option" "$LINENO" 5
3692       ;;
3693     no)
3694       as_fn_error $? "argument required for --with-wal-segsize option" "$LINENO" 5
3695       ;;
3696     *)
3697       wal_segsize=$withval
3698       ;;
3699   esac
3700
3701 else
3702   wal_segsize=16
3703 fi
3704
3705
3706 case ${wal_segsize} in
3707   1) ;;
3708   2) ;;
3709   4) ;;
3710   8) ;;
3711  16) ;;
3712  32) ;;
3713  64) ;;
3714   *) as_fn_error $? "Invalid WAL segment size. Allowed values are 1,2,4,8,16,32,64." "$LINENO" 5
3715 esac
3716 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${wal_segsize}MB" >&5
3717 $as_echo "${wal_segsize}MB" >&6; }
3718
3719
3720 cat >>confdefs.h <<_ACEOF
3721 #define XLOG_SEG_SIZE (${wal_segsize} * 1024 * 1024)
3722 _ACEOF
3723
3724
3725 #
3726 # C compiler
3727 #
3728
3729 # For historical reasons you can also use --with-CC to specify the C compiler
3730 # to use, although the standard way to do this is to set the CC environment
3731 # variable.
3732
3733
3734
3735 # Check whether --with-CC was given.
3736 if test "${with_CC+set}" = set; then :
3737   withval=$with_CC;
3738   case $withval in
3739     yes)
3740       as_fn_error $? "argument required for --with-CC option" "$LINENO" 5
3741       ;;
3742     no)
3743       as_fn_error $? "argument required for --with-CC option" "$LINENO" 5
3744       ;;
3745     *)
3746       CC=$with_CC
3747       ;;
3748   esac
3749
3750 fi
3751
3752
3753
3754 case $template in
3755   aix) pgac_cc_list="gcc xlc";;
3756     *) pgac_cc_list="gcc cc";;
3757 esac
3758
3759 ac_ext=c
3760 ac_cpp='$CPP $CPPFLAGS'
3761 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3762 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3763 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3764 if test -n "$ac_tool_prefix"; then
3765   for ac_prog in $pgac_cc_list
3766   do
3767     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3768 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3769 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3770 $as_echo_n "checking for $ac_word... " >&6; }
3771 if ${ac_cv_prog_CC+:} false; then :
3772   $as_echo_n "(cached) " >&6
3773 else
3774   if test -n "$CC"; then
3775   ac_cv_prog_CC="$CC" # Let the user override the test.
3776 else
3777 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3778 for as_dir in $PATH
3779 do
3780   IFS=$as_save_IFS
3781   test -z "$as_dir" && as_dir=.
3782     for ac_exec_ext in '' $ac_executable_extensions; do
3783   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3784     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3785     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3786     break 2
3787   fi
3788 done
3789   done
3790 IFS=$as_save_IFS
3791
3792 fi
3793 fi
3794 CC=$ac_cv_prog_CC
3795 if test -n "$CC"; then
3796   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3797 $as_echo "$CC" >&6; }
3798 else
3799   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3800 $as_echo "no" >&6; }
3801 fi
3802
3803
3804     test -n "$CC" && break
3805   done
3806 fi
3807 if test -z "$CC"; then
3808   ac_ct_CC=$CC
3809   for ac_prog in $pgac_cc_list
3810 do
3811   # Extract the first word of "$ac_prog", so it can be a program name with args.
3812 set dummy $ac_prog; ac_word=$2
3813 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3814 $as_echo_n "checking for $ac_word... " >&6; }
3815 if ${ac_cv_prog_ac_ct_CC+:} false; then :
3816   $as_echo_n "(cached) " >&6
3817 else
3818   if test -n "$ac_ct_CC"; then
3819   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3820 else
3821 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3822 for as_dir in $PATH
3823 do
3824   IFS=$as_save_IFS
3825   test -z "$as_dir" && as_dir=.
3826     for ac_exec_ext in '' $ac_executable_extensions; do
3827   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3828     ac_cv_prog_ac_ct_CC="$ac_prog"
3829     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3830     break 2
3831   fi
3832 done
3833   done
3834 IFS=$as_save_IFS
3835
3836 fi
3837 fi
3838 ac_ct_CC=$ac_cv_prog_ac_ct_CC
3839 if test -n "$ac_ct_CC"; then
3840   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3841 $as_echo "$ac_ct_CC" >&6; }
3842 else
3843   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3844 $as_echo "no" >&6; }
3845 fi
3846
3847
3848   test -n "$ac_ct_CC" && break
3849 done
3850
3851   if test "x$ac_ct_CC" = x; then
3852     CC=""
3853   else
3854     case $cross_compiling:$ac_tool_warned in
3855 yes:)
3856 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3857 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3858 ac_tool_warned=yes ;;
3859 esac
3860     CC=$ac_ct_CC
3861   fi
3862 fi
3863
3864
3865 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3866 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3867 as_fn_error $? "no acceptable C compiler found in \$PATH
3868 See \`config.log' for more details" "$LINENO" 5; }
3869
3870 # Provide some information about the compiler.
3871 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
3872 set X $ac_compile
3873 ac_compiler=$2
3874 for ac_option in --version -v -V -qversion; do
3875   { { ac_try="$ac_compiler $ac_option >&5"
3876 case "(($ac_try" in
3877   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3878   *) ac_try_echo=$ac_try;;
3879 esac
3880 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3881 $as_echo "$ac_try_echo"; } >&5
3882   (eval "$ac_compiler $ac_option >&5") 2>conftest.err
3883   ac_status=$?
3884   if test -s conftest.err; then
3885     sed '10a\
3886 ... rest of stderr output deleted ...
3887          10q' conftest.err >conftest.er1
3888     cat conftest.er1 >&5
3889   fi
3890   rm -f conftest.er1 conftest.err
3891   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3892   test $ac_status = 0; }
3893 done
3894
3895 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3896 /* end confdefs.h.  */
3897
3898 int
3899 main ()
3900 {
3901
3902   ;
3903   return 0;
3904 }
3905 _ACEOF
3906 ac_clean_files_save=$ac_clean_files
3907 ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
3908 # Try to create an executable without -o first, disregard a.out.
3909 # It will help us diagnose broken compilers, and finding out an intuition
3910 # of exeext.
3911 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
3912 $as_echo_n "checking whether the C compiler works... " >&6; }
3913 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
3914
3915 # The possible output files:
3916 ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
3917
3918 ac_rmfiles=
3919 for ac_file in $ac_files
3920 do
3921   case $ac_file in
3922     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3923     * ) ac_rmfiles="$ac_rmfiles $ac_file";;
3924   esac
3925 done
3926 rm -f $ac_rmfiles
3927
3928 if { { ac_try="$ac_link_default"
3929 case "(($ac_try" in
3930   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3931   *) ac_try_echo=$ac_try;;
3932 esac
3933 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3934 $as_echo "$ac_try_echo"; } >&5
3935   (eval "$ac_link_default") 2>&5
3936   ac_status=$?
3937   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3938   test $ac_status = 0; }; then :
3939   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
3940 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
3941 # in a Makefile.  We should not override ac_cv_exeext if it was cached,
3942 # so that the user can short-circuit this test for compilers unknown to
3943 # Autoconf.
3944 for ac_file in $ac_files ''
3945 do
3946   test -f "$ac_file" || continue
3947   case $ac_file in
3948     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
3949         ;;
3950     [ab].out )
3951         # We found the default executable, but exeext='' is most
3952         # certainly right.
3953         break;;
3954     *.* )
3955         if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
3956         then :; else
3957            ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3958         fi
3959         # We set ac_cv_exeext here because the later test for it is not
3960         # safe: cross compilers may not add the suffix if given an `-o'
3961         # argument, so we may need to know it at that point already.
3962         # Even if this section looks crufty: it has the advantage of
3963         # actually working.
3964         break;;
3965     * )
3966         break;;
3967   esac
3968 done
3969 test "$ac_cv_exeext" = no && ac_cv_exeext=
3970
3971 else
3972   ac_file=''
3973 fi
3974 if test -z "$ac_file"; then :
3975   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3976 $as_echo "no" >&6; }
3977 $as_echo "$as_me: failed program was:" >&5
3978 sed 's/^/| /' conftest.$ac_ext >&5
3979
3980 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3981 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3982 as_fn_error 77 "C compiler cannot create executables
3983 See \`config.log' for more details" "$LINENO" 5; }
3984 else
3985   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3986 $as_echo "yes" >&6; }
3987 fi
3988 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
3989 $as_echo_n "checking for C compiler default output file name... " >&6; }
3990 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
3991 $as_echo "$ac_file" >&6; }
3992 ac_exeext=$ac_cv_exeext
3993
3994 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
3995 ac_clean_files=$ac_clean_files_save
3996 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
3997 $as_echo_n "checking for suffix of executables... " >&6; }
3998 if { { ac_try="$ac_link"
3999 case "(($ac_try" in
4000   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4001   *) ac_try_echo=$ac_try;;
4002 esac
4003 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4004 $as_echo "$ac_try_echo"; } >&5
4005   (eval "$ac_link") 2>&5
4006   ac_status=$?
4007   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4008   test $ac_status = 0; }; then :
4009   # If both `conftest.exe' and `conftest' are `present' (well, observable)
4010 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
4011 # work properly (i.e., refer to `conftest.exe'), while it won't with
4012 # `rm'.
4013 for ac_file in conftest.exe conftest conftest.*; do
4014   test -f "$ac_file" || continue
4015   case $ac_file in
4016     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
4017     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
4018           break;;
4019     * ) break;;
4020   esac
4021 done
4022 else
4023   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4024 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4025 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
4026 See \`config.log' for more details" "$LINENO" 5; }
4027 fi
4028 rm -f conftest conftest$ac_cv_exeext
4029 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
4030 $as_echo "$ac_cv_exeext" >&6; }
4031
4032 rm -f conftest.$ac_ext
4033 EXEEXT=$ac_cv_exeext
4034 ac_exeext=$EXEEXT
4035 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4036 /* end confdefs.h.  */
4037 #include <stdio.h>
4038 int
4039 main ()
4040 {
4041 FILE *f = fopen ("conftest.out", "w");
4042  return ferror (f) || fclose (f) != 0;
4043
4044   ;
4045   return 0;
4046 }
4047 _ACEOF
4048 ac_clean_files="$ac_clean_files conftest.out"
4049 # Check that the compiler produces executables we can run.  If not, either
4050 # the compiler is broken, or we cross compile.
4051 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
4052 $as_echo_n "checking whether we are cross compiling... " >&6; }
4053 if test "$cross_compiling" != yes; then
4054   { { ac_try="$ac_link"
4055 case "(($ac_try" in
4056   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4057   *) ac_try_echo=$ac_try;;
4058 esac
4059 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4060 $as_echo "$ac_try_echo"; } >&5
4061   (eval "$ac_link") 2>&5
4062   ac_status=$?
4063   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4064   test $ac_status = 0; }
4065   if { ac_try='./conftest$ac_cv_exeext'
4066   { { case "(($ac_try" in
4067   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4068   *) ac_try_echo=$ac_try;;
4069 esac
4070 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4071 $as_echo "$ac_try_echo"; } >&5
4072   (eval "$ac_try") 2>&5
4073   ac_status=$?
4074   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4075   test $ac_status = 0; }; }; then
4076     cross_compiling=no
4077   else
4078     if test "$cross_compiling" = maybe; then
4079         cross_compiling=yes
4080     else
4081         { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4082 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4083 as_fn_error $? "cannot run C compiled programs.
4084 If you meant to cross compile, use \`--host'.
4085 See \`config.log' for more details" "$LINENO" 5; }
4086     fi
4087   fi
4088 fi
4089 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
4090 $as_echo "$cross_compiling" >&6; }
4091
4092 rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
4093 ac_clean_files=$ac_clean_files_save
4094 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
4095 $as_echo_n "checking for suffix of object files... " >&6; }
4096 if ${ac_cv_objext+:} false; then :
4097   $as_echo_n "(cached) " >&6
4098 else
4099   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4100 /* end confdefs.h.  */
4101
4102 int
4103 main ()
4104 {
4105
4106   ;
4107   return 0;
4108 }
4109 _ACEOF
4110 rm -f conftest.o conftest.obj
4111 if { { ac_try="$ac_compile"
4112 case "(($ac_try" in
4113   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4114   *) ac_try_echo=$ac_try;;
4115 esac
4116 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4117 $as_echo "$ac_try_echo"; } >&5
4118   (eval "$ac_compile") 2>&5
4119   ac_status=$?
4120   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4121   test $ac_status = 0; }; then :
4122   for ac_file in conftest.o conftest.obj conftest.*; do
4123   test -f "$ac_file" || continue;
4124   case $ac_file in
4125     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
4126     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
4127        break;;
4128   esac
4129 done
4130 else
4131   $as_echo "$as_me: failed program was:" >&5
4132 sed 's/^/| /' conftest.$ac_ext >&5
4133
4134 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4135 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4136 as_fn_error $? "cannot compute suffix of object files: cannot compile
4137 See \`config.log' for more details" "$LINENO" 5; }
4138 fi
4139 rm -f conftest.$ac_cv_objext conftest.$ac_ext
4140 fi
4141 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
4142 $as_echo "$ac_cv_objext" >&6; }
4143 OBJEXT=$ac_cv_objext
4144 ac_objext=$OBJEXT
4145 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
4146 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
4147 if ${ac_cv_c_compiler_gnu+:} false; then :
4148   $as_echo_n "(cached) " >&6
4149 else
4150   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4151 /* end confdefs.h.  */
4152
4153 int
4154 main ()
4155 {
4156 #ifndef __GNUC__
4157        choke me
4158 #endif
4159
4160   ;
4161   return 0;
4162 }
4163 _ACEOF
4164 if ac_fn_c_try_compile "$LINENO"; then :
4165   ac_compiler_gnu=yes
4166 else
4167   ac_compiler_gnu=no
4168 fi
4169 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4170 ac_cv_c_compiler_gnu=$ac_compiler_gnu
4171
4172 fi
4173 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4174 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
4175 if test $ac_compiler_gnu = yes; then
4176   GCC=yes
4177 else
4178   GCC=
4179 fi
4180 ac_test_CFLAGS=${CFLAGS+set}
4181 ac_save_CFLAGS=$CFLAGS
4182 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4183 $as_echo_n "checking whether $CC accepts -g... " >&6; }
4184 if ${ac_cv_prog_cc_g+:} false; then :
4185   $as_echo_n "(cached) " >&6
4186 else
4187   ac_save_c_werror_flag=$ac_c_werror_flag
4188    ac_c_werror_flag=yes
4189    ac_cv_prog_cc_g=no
4190    CFLAGS="-g"
4191    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4192 /* end confdefs.h.  */
4193
4194 int
4195 main ()
4196 {
4197
4198   ;
4199   return 0;
4200 }
4201 _ACEOF
4202 if ac_fn_c_try_compile "$LINENO"; then :
4203   ac_cv_prog_cc_g=yes
4204 else
4205   CFLAGS=""
4206       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4207 /* end confdefs.h.  */
4208
4209 int
4210 main ()
4211 {
4212
4213   ;
4214   return 0;
4215 }
4216 _ACEOF
4217 if ac_fn_c_try_compile "$LINENO"; then :
4218
4219 else
4220   ac_c_werror_flag=$ac_save_c_werror_flag
4221          CFLAGS="-g"
4222          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4223 /* end confdefs.h.  */
4224
4225 int
4226 main ()
4227 {
4228
4229   ;
4230   return 0;
4231 }
4232 _ACEOF
4233 if ac_fn_c_try_compile "$LINENO"; then :
4234   ac_cv_prog_cc_g=yes
4235 fi
4236 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4237 fi
4238 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4239 fi
4240 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4241    ac_c_werror_flag=$ac_save_c_werror_flag
4242 fi
4243 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4244 $as_echo "$ac_cv_prog_cc_g" >&6; }
4245 if test "$ac_test_CFLAGS" = set; then
4246   CFLAGS=$ac_save_CFLAGS
4247 elif test $ac_cv_prog_cc_g = yes; then
4248   if test "$GCC" = yes; then
4249     CFLAGS="-g -O2"
4250   else
4251     CFLAGS="-g"
4252   fi
4253 else
4254   if test "$GCC" = yes; then
4255     CFLAGS="-O2"
4256   else
4257     CFLAGS=
4258   fi
4259 fi
4260 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
4261 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
4262 if ${ac_cv_prog_cc_c89+:} false; then :
4263   $as_echo_n "(cached) " >&6
4264 else
4265   ac_cv_prog_cc_c89=no
4266 ac_save_CC=$CC
4267 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4268 /* end confdefs.h.  */
4269 #include <stdarg.h>
4270 #include <stdio.h>
4271 struct stat;
4272 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4273 struct buf { int x; };
4274 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4275 static char *e (p, i)
4276      char **p;
4277      int i;
4278 {
4279   return p[i];
4280 }
4281 static char *f (char * (*g) (char **, int), char **p, ...)
4282 {
4283   char *s;
4284   va_list v;
4285   va_start (v,p);
4286   s = g (p, va_arg (v,int));
4287   va_end (v);
4288   return s;
4289 }
4290
4291 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
4292    function prototypes and stuff, but not '\xHH' hex character constants.
4293    These don't provoke an error unfortunately, instead are silently treated
4294    as 'x'.  The following induces an error, until -std is added to get
4295    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
4296    array size at least.  It's necessary to write '\x00'==0 to get something
4297    that's true only with -std.  */
4298 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
4299
4300 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
4301    inside strings and character constants.  */
4302 #define FOO(x) 'x'
4303 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
4304
4305 int test (int i, double x);
4306 struct s1 {int (*f) (int a);};
4307 struct s2 {int (*f) (double a);};
4308 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4309 int argc;
4310 char **argv;
4311 int
4312 main ()
4313 {
4314 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4315   ;
4316   return 0;
4317 }
4318 _ACEOF
4319 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
4320         -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4321 do
4322   CC="$ac_save_CC $ac_arg"
4323   if ac_fn_c_try_compile "$LINENO"; then :
4324   ac_cv_prog_cc_c89=$ac_arg
4325 fi
4326 rm -f core conftest.err conftest.$ac_objext
4327   test "x$ac_cv_prog_cc_c89" != "xno" && break
4328 done
4329 rm -f conftest.$ac_ext
4330 CC=$ac_save_CC
4331
4332 fi
4333 # AC_CACHE_VAL
4334 case "x$ac_cv_prog_cc_c89" in
4335   x)
4336     { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4337 $as_echo "none needed" >&6; } ;;
4338   xno)
4339     { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4340 $as_echo "unsupported" >&6; } ;;
4341   *)
4342     CC="$CC $ac_cv_prog_cc_c89"
4343     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
4344 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
4345 esac
4346 if test "x$ac_cv_prog_cc_c89" != xno; then :
4347
4348 fi
4349
4350 ac_ext=c
4351 ac_cpp='$CPP $CPPFLAGS'
4352 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4353 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4354 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4355
4356
4357 # Check if it's Intel's compiler, which (usually) pretends to be gcc,
4358 # but has idiosyncrasies of its own.  We assume icc will define
4359 # __INTEL_COMPILER regardless of CFLAGS.
4360
4361 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4362 /* end confdefs.h.  */
4363
4364 int
4365 main ()
4366 {
4367 #ifndef __INTEL_COMPILER
4368 choke me
4369 #endif
4370   ;
4371   return 0;
4372 }
4373 _ACEOF
4374 if ac_fn_c_try_compile "$LINENO"; then :
4375   ICC=yes
4376 else
4377   ICC=no
4378 fi
4379 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4380
4381 # Check if it's Sun Studio compiler. We assume that
4382 # __SUNPRO_C will be defined for Sun Studio compilers
4383 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4384 /* end confdefs.h.  */
4385
4386 int
4387 main ()
4388 {
4389 #ifndef __SUNPRO_C
4390 choke me
4391 #endif
4392   ;
4393   return 0;
4394 }
4395 _ACEOF
4396 if ac_fn_c_try_compile "$LINENO"; then :
4397   SUN_STUDIO_CC=yes
4398 else
4399   SUN_STUDIO_CC=no
4400 fi
4401 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4402
4403
4404
4405 unset CFLAGS
4406
4407 #
4408 # Read the template
4409 #
4410 . "$srcdir/src/template/$template" || exit
4411
4412 # CFLAGS are selected so:
4413 # If the user specifies something in the environment, that is used.
4414 # else:  If the template file set something, that is used.
4415 # else:  If coverage was enabled, don't set anything.
4416 # else:  If the compiler is GCC, then we use -O2.
4417 # else:  If the compiler is something else, then we use -O, unless debugging.
4418
4419 if test "$ac_env_CFLAGS_set" = set; then
4420   CFLAGS=$ac_env_CFLAGS_value
4421 elif test "${CFLAGS+set}" = set; then
4422   : # (keep what template set)
4423 elif test "$enable_coverage" = yes; then
4424   : # no optimization by default
4425 elif test "$GCC" = yes; then
4426   CFLAGS="-O2"
4427 else
4428   # if the user selected debug mode, don't use -O
4429   if test "$enable_debug" != yes; then
4430     CFLAGS="-O"
4431   fi
4432 fi
4433
4434 # CFLAGS we determined above will be added back at the end
4435 user_CFLAGS=$CFLAGS
4436 CFLAGS=""
4437
4438 # set CFLAGS_VECTOR from the environment, if available
4439 if test "$ac_env_CFLAGS_VECTOR_set" = set; then
4440   CFLAGS_VECTOR=$ac_env_CFLAGS_VECTOR_value
4441 fi
4442
4443 # Some versions of GCC support some additional useful warning flags.
4444 # Check whether they are supported, and add them to CFLAGS if so.
4445 # ICC pretends to be GCC but it's lying; it doesn't support these flags,
4446 # but has its own.  Also check other compiler-specific flags here.
4447
4448 if test "$GCC" = yes -a "$ICC" = no; then
4449   CFLAGS="-Wall -Wmissing-prototypes -Wpointer-arith"
4450   # These work in some but not all gcc versions
4451   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wdeclaration-after-statement" >&5
4452 $as_echo_n "checking whether $CC supports -Wdeclaration-after-statement... " >&6; }
4453 if ${pgac_cv_prog_cc_cflags__Wdeclaration_after_statement+:} false; then :
4454   $as_echo_n "(cached) " >&6
4455 else
4456   pgac_save_CFLAGS=$CFLAGS
4457 CFLAGS="$pgac_save_CFLAGS -Wdeclaration-after-statement"
4458 ac_save_c_werror_flag=$ac_c_werror_flag
4459 ac_c_werror_flag=yes
4460 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4461 /* end confdefs.h.  */
4462
4463 int
4464 main ()
4465 {
4466
4467   ;
4468   return 0;
4469 }
4470 _ACEOF
4471 if ac_fn_c_try_compile "$LINENO"; then :
4472   pgac_cv_prog_cc_cflags__Wdeclaration_after_statement=yes
4473 else
4474   pgac_cv_prog_cc_cflags__Wdeclaration_after_statement=no
4475 fi
4476 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4477 ac_c_werror_flag=$ac_save_c_werror_flag
4478 CFLAGS="$pgac_save_CFLAGS"
4479 fi
4480 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" >&5
4481 $as_echo "$pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" >&6; }
4482 if test x"$pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" = x"yes"; then
4483   CFLAGS="$CFLAGS -Wdeclaration-after-statement"
4484 fi
4485
4486   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wendif-labels" >&5
4487 $as_echo_n "checking whether $CC supports -Wendif-labels... " >&6; }
4488 if ${pgac_cv_prog_cc_cflags__Wendif_labels+:} false; then :
4489   $as_echo_n "(cached) " >&6
4490 else
4491   pgac_save_CFLAGS=$CFLAGS
4492 CFLAGS="$pgac_save_CFLAGS -Wendif-labels"
4493 ac_save_c_werror_flag=$ac_c_werror_flag
4494 ac_c_werror_flag=yes
4495 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4496 /* end confdefs.h.  */
4497
4498 int
4499 main ()
4500 {
4501
4502   ;
4503   return 0;
4504 }
4505 _ACEOF
4506 if ac_fn_c_try_compile "$LINENO"; then :
4507   pgac_cv_prog_cc_cflags__Wendif_labels=yes
4508 else
4509   pgac_cv_prog_cc_cflags__Wendif_labels=no
4510 fi
4511 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4512 ac_c_werror_flag=$ac_save_c_werror_flag
4513 CFLAGS="$pgac_save_CFLAGS"
4514 fi
4515 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wendif_labels" >&5
4516 $as_echo "$pgac_cv_prog_cc_cflags__Wendif_labels" >&6; }
4517 if test x"$pgac_cv_prog_cc_cflags__Wendif_labels" = x"yes"; then
4518   CFLAGS="$CFLAGS -Wendif-labels"
4519 fi
4520
4521   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wmissing-format-attribute" >&5
4522 $as_echo_n "checking whether $CC supports -Wmissing-format-attribute... " >&6; }
4523 if ${pgac_cv_prog_cc_cflags__Wmissing_format_attribute+:} false; then :
4524   $as_echo_n "(cached) " >&6
4525 else
4526   pgac_save_CFLAGS=$CFLAGS
4527 CFLAGS="$pgac_save_CFLAGS -Wmissing-format-attribute"
4528 ac_save_c_werror_flag=$ac_c_werror_flag
4529 ac_c_werror_flag=yes
4530 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4531 /* end confdefs.h.  */
4532
4533 int
4534 main ()
4535 {
4536
4537   ;
4538   return 0;
4539 }
4540 _ACEOF
4541 if ac_fn_c_try_compile "$LINENO"; then :
4542   pgac_cv_prog_cc_cflags__Wmissing_format_attribute=yes
4543 else
4544   pgac_cv_prog_cc_cflags__Wmissing_format_attribute=no
4545 fi
4546 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4547 ac_c_werror_flag=$ac_save_c_werror_flag
4548 CFLAGS="$pgac_save_CFLAGS"
4549 fi
4550 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wmissing_format_attribute" >&5
4551 $as_echo "$pgac_cv_prog_cc_cflags__Wmissing_format_attribute" >&6; }
4552 if test x"$pgac_cv_prog_cc_cflags__Wmissing_format_attribute" = x"yes"; then
4553   CFLAGS="$CFLAGS -Wmissing-format-attribute"
4554 fi
4555
4556   # This was included in -Wall/-Wformat in older GCC versions
4557   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wformat-security" >&5
4558 $as_echo_n "checking whether $CC supports -Wformat-security... " >&6; }
4559 if ${pgac_cv_prog_cc_cflags__Wformat_security+:} false; then :
4560   $as_echo_n "(cached) " >&6
4561 else
4562   pgac_save_CFLAGS=$CFLAGS
4563 CFLAGS="$pgac_save_CFLAGS -Wformat-security"
4564 ac_save_c_werror_flag=$ac_c_werror_flag
4565 ac_c_werror_flag=yes
4566 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4567 /* end confdefs.h.  */
4568
4569 int
4570 main ()
4571 {
4572
4573   ;
4574   return 0;
4575 }
4576 _ACEOF
4577 if ac_fn_c_try_compile "$LINENO"; then :
4578   pgac_cv_prog_cc_cflags__Wformat_security=yes
4579 else
4580   pgac_cv_prog_cc_cflags__Wformat_security=no
4581 fi
4582 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4583 ac_c_werror_flag=$ac_save_c_werror_flag
4584 CFLAGS="$pgac_save_CFLAGS"
4585 fi
4586 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wformat_security" >&5
4587 $as_echo "$pgac_cv_prog_cc_cflags__Wformat_security" >&6; }
4588 if test x"$pgac_cv_prog_cc_cflags__Wformat_security" = x"yes"; then
4589   CFLAGS="$CFLAGS -Wformat-security"
4590 fi
4591
4592   # Disable strict-aliasing rules; needed for gcc 3.3+
4593   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-strict-aliasing" >&5
4594 $as_echo_n "checking whether $CC supports -fno-strict-aliasing... " >&6; }
4595 if ${pgac_cv_prog_cc_cflags__fno_strict_aliasing+:} false; then :
4596   $as_echo_n "(cached) " >&6
4597 else
4598   pgac_save_CFLAGS=$CFLAGS
4599 CFLAGS="$pgac_save_CFLAGS -fno-strict-aliasing"
4600 ac_save_c_werror_flag=$ac_c_werror_flag
4601 ac_c_werror_flag=yes
4602 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4603 /* end confdefs.h.  */
4604
4605 int
4606 main ()
4607 {
4608
4609   ;
4610   return 0;
4611 }
4612 _ACEOF
4613 if ac_fn_c_try_compile "$LINENO"; then :
4614   pgac_cv_prog_cc_cflags__fno_strict_aliasing=yes
4615 else
4616   pgac_cv_prog_cc_cflags__fno_strict_aliasing=no
4617 fi
4618 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4619 ac_c_werror_flag=$ac_save_c_werror_flag
4620 CFLAGS="$pgac_save_CFLAGS"
4621 fi
4622 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&5
4623 $as_echo "$pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&6; }
4624 if test x"$pgac_cv_prog_cc_cflags__fno_strict_aliasing" = x"yes"; then
4625   CFLAGS="$CFLAGS -fno-strict-aliasing"
4626 fi
4627
4628   # Disable optimizations that assume no overflow; needed for gcc 4.3+
4629   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fwrapv" >&5
4630 $as_echo_n "checking whether $CC supports -fwrapv... " >&6; }
4631 if ${pgac_cv_prog_cc_cflags__fwrapv+:} false; then :
4632   $as_echo_n "(cached) " >&6
4633 else
4634   pgac_save_CFLAGS=$CFLAGS
4635 CFLAGS="$pgac_save_CFLAGS -fwrapv"
4636 ac_save_c_werror_flag=$ac_c_werror_flag
4637 ac_c_werror_flag=yes
4638 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4639 /* end confdefs.h.  */
4640
4641 int
4642 main ()
4643 {
4644
4645   ;
4646   return 0;
4647 }
4648 _ACEOF
4649 if ac_fn_c_try_compile "$LINENO"; then :
4650   pgac_cv_prog_cc_cflags__fwrapv=yes
4651 else
4652   pgac_cv_prog_cc_cflags__fwrapv=no
4653 fi
4654 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4655 ac_c_werror_flag=$ac_save_c_werror_flag
4656 CFLAGS="$pgac_save_CFLAGS"
4657 fi
4658 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fwrapv" >&5
4659 $as_echo "$pgac_cv_prog_cc_cflags__fwrapv" >&6; }
4660 if test x"$pgac_cv_prog_cc_cflags__fwrapv" = x"yes"; then
4661   CFLAGS="$CFLAGS -fwrapv"
4662 fi
4663
4664   # Disable FP optimizations that cause various errors on gcc 4.5+ or maybe 4.6+
4665   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fexcess-precision=standard" >&5
4666 $as_echo_n "checking whether $CC supports -fexcess-precision=standard... " >&6; }
4667 if ${pgac_cv_prog_cc_cflags__fexcess_precision_standard+:} false; then :
4668   $as_echo_n "(cached) " >&6
4669 else
4670   pgac_save_CFLAGS=$CFLAGS
4671 CFLAGS="$pgac_save_CFLAGS -fexcess-precision=standard"
4672 ac_save_c_werror_flag=$ac_c_werror_flag
4673 ac_c_werror_flag=yes
4674 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4675 /* end confdefs.h.  */
4676
4677 int
4678 main ()
4679 {
4680
4681   ;
4682   return 0;
4683 }
4684 _ACEOF
4685 if ac_fn_c_try_compile "$LINENO"; then :
4686   pgac_cv_prog_cc_cflags__fexcess_precision_standard=yes
4687 else
4688   pgac_cv_prog_cc_cflags__fexcess_precision_standard=no
4689 fi
4690 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4691 ac_c_werror_flag=$ac_save_c_werror_flag
4692 CFLAGS="$pgac_save_CFLAGS"
4693 fi
4694 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fexcess_precision_standard" >&5
4695 $as_echo "$pgac_cv_prog_cc_cflags__fexcess_precision_standard" >&6; }
4696 if test x"$pgac_cv_prog_cc_cflags__fexcess_precision_standard" = x"yes"; then
4697   CFLAGS="$CFLAGS -fexcess-precision=standard"
4698 fi
4699
4700   # Optimization flags for specific files that benefit from vectorization
4701   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -funroll-loops" >&5
4702 $as_echo_n "checking whether $CC supports -funroll-loops... " >&6; }
4703 if ${pgac_cv_prog_cc_cflags__funroll_loops+:} false; then :
4704   $as_echo_n "(cached) " >&6
4705 else
4706   pgac_save_CFLAGS=$CFLAGS
4707 CFLAGS="$pgac_save_CFLAGS -funroll-loops"
4708 ac_save_c_werror_flag=$ac_c_werror_flag
4709 ac_c_werror_flag=yes
4710 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4711 /* end confdefs.h.  */
4712
4713 int
4714 main ()
4715 {
4716
4717   ;
4718   return 0;
4719 }
4720 _ACEOF
4721 if ac_fn_c_try_compile "$LINENO"; then :
4722   pgac_cv_prog_cc_cflags__funroll_loops=yes
4723 else
4724   pgac_cv_prog_cc_cflags__funroll_loops=no
4725 fi
4726 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4727 ac_c_werror_flag=$ac_save_c_werror_flag
4728 CFLAGS="$pgac_save_CFLAGS"
4729 fi
4730 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__funroll_loops" >&5
4731 $as_echo "$pgac_cv_prog_cc_cflags__funroll_loops" >&6; }
4732 if test x"$pgac_cv_prog_cc_cflags__funroll_loops" = x"yes"; then
4733   CFLAGS_VECTOR="${CFLAGS_VECTOR} -funroll-loops"
4734 fi
4735
4736   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -ftree-vectorize" >&5
4737 $as_echo_n "checking whether $CC supports -ftree-vectorize... " >&6; }
4738 if ${pgac_cv_prog_cc_cflags__ftree_vectorize+:} false; then :
4739   $as_echo_n "(cached) " >&6
4740 else
4741   pgac_save_CFLAGS=$CFLAGS
4742 CFLAGS="$pgac_save_CFLAGS -ftree-vectorize"
4743 ac_save_c_werror_flag=$ac_c_werror_flag
4744 ac_c_werror_flag=yes
4745 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4746 /* end confdefs.h.  */
4747
4748 int
4749 main ()
4750 {
4751
4752   ;
4753   return 0;
4754 }
4755 _ACEOF
4756 if ac_fn_c_try_compile "$LINENO"; then :
4757   pgac_cv_prog_cc_cflags__ftree_vectorize=yes
4758 else
4759   pgac_cv_prog_cc_cflags__ftree_vectorize=no
4760 fi
4761 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4762 ac_c_werror_flag=$ac_save_c_werror_flag
4763 CFLAGS="$pgac_save_CFLAGS"
4764 fi
4765 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__ftree_vectorize" >&5
4766 $as_echo "$pgac_cv_prog_cc_cflags__ftree_vectorize" >&6; }
4767 if test x"$pgac_cv_prog_cc_cflags__ftree_vectorize" = x"yes"; then
4768   CFLAGS_VECTOR="${CFLAGS_VECTOR} -ftree-vectorize"
4769 fi
4770
4771   # We want to suppress clang's unhelpful unused-command-line-argument warnings
4772   # but gcc won't complain about unrecognized -Wno-foo switches, so we have to
4773   # test for the positive form and if that works, add the negative form
4774   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wunused-command-line-argument" >&5
4775 $as_echo_n "checking whether $CC supports -Wunused-command-line-argument... " >&6; }
4776 if ${pgac_cv_prog_cc_cflags__Wunused_command_line_argument+:} false; then :
4777   $as_echo_n "(cached) " >&6
4778 else
4779   pgac_save_CFLAGS=$CFLAGS
4780 CFLAGS="$pgac_save_CFLAGS -Wunused-command-line-argument"
4781 ac_save_c_werror_flag=$ac_c_werror_flag
4782 ac_c_werror_flag=yes
4783 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4784 /* end confdefs.h.  */
4785
4786 int
4787 main ()
4788 {
4789
4790   ;
4791   return 0;
4792 }
4793 _ACEOF
4794 if ac_fn_c_try_compile "$LINENO"; then :
4795   pgac_cv_prog_cc_cflags__Wunused_command_line_argument=yes
4796 else
4797   pgac_cv_prog_cc_cflags__Wunused_command_line_argument=no
4798 fi
4799 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4800 ac_c_werror_flag=$ac_save_c_werror_flag
4801 CFLAGS="$pgac_save_CFLAGS"
4802 fi
4803 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__Wunused_command_line_argument" >&5
4804 $as_echo "$pgac_cv_prog_cc_cflags__Wunused_command_line_argument" >&6; }
4805 if test x"$pgac_cv_prog_cc_cflags__Wunused_command_line_argument" = x"yes"; then
4806   NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wunused-command-line-argument"
4807 fi
4808
4809   if test -n "$NOT_THE_CFLAGS"; then
4810     CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
4811   fi
4812 elif test "$ICC" = yes; then
4813   # Intel's compiler has a bug/misoptimization in checking for
4814   # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
4815   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -mp1" >&5
4816 $as_echo_n "checking whether $CC supports -mp1... " >&6; }
4817 if ${pgac_cv_prog_cc_cflags__mp1+:} false; then :
4818   $as_echo_n "(cached) " >&6
4819 else
4820   pgac_save_CFLAGS=$CFLAGS
4821 CFLAGS="$pgac_save_CFLAGS -mp1"
4822 ac_save_c_werror_flag=$ac_c_werror_flag
4823 ac_c_werror_flag=yes
4824 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4825 /* end confdefs.h.  */
4826
4827 int
4828 main ()
4829 {
4830
4831   ;
4832   return 0;
4833 }
4834 _ACEOF
4835 if ac_fn_c_try_compile "$LINENO"; then :
4836   pgac_cv_prog_cc_cflags__mp1=yes
4837 else
4838   pgac_cv_prog_cc_cflags__mp1=no
4839 fi
4840 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4841 ac_c_werror_flag=$ac_save_c_werror_flag
4842 CFLAGS="$pgac_save_CFLAGS"
4843 fi
4844 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__mp1" >&5
4845 $as_echo "$pgac_cv_prog_cc_cflags__mp1" >&6; }
4846 if test x"$pgac_cv_prog_cc_cflags__mp1" = x"yes"; then
4847   CFLAGS="$CFLAGS -mp1"
4848 fi
4849
4850   # Make sure strict aliasing is off (though this is said to be the default)
4851   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-strict-aliasing" >&5
4852 $as_echo_n "checking whether $CC supports -fno-strict-aliasing... " >&6; }
4853 if ${pgac_cv_prog_cc_cflags__fno_strict_aliasing+:} false; then :
4854   $as_echo_n "(cached) " >&6
4855 else
4856   pgac_save_CFLAGS=$CFLAGS
4857 CFLAGS="$pgac_save_CFLAGS -fno-strict-aliasing"
4858 ac_save_c_werror_flag=$ac_c_werror_flag
4859 ac_c_werror_flag=yes
4860 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4861 /* end confdefs.h.  */
4862
4863 int
4864 main ()
4865 {
4866
4867   ;
4868   return 0;
4869 }
4870 _ACEOF
4871 if ac_fn_c_try_compile "$LINENO"; then :
4872   pgac_cv_prog_cc_cflags__fno_strict_aliasing=yes
4873 else
4874   pgac_cv_prog_cc_cflags__fno_strict_aliasing=no
4875 fi
4876 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4877 ac_c_werror_flag=$ac_save_c_werror_flag
4878 CFLAGS="$pgac_save_CFLAGS"
4879 fi
4880 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&5
4881 $as_echo "$pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&6; }
4882 if test x"$pgac_cv_prog_cc_cflags__fno_strict_aliasing" = x"yes"; then
4883   CFLAGS="$CFLAGS -fno-strict-aliasing"
4884 fi
4885
4886 elif test "$PORTNAME" = "aix"; then
4887   # AIX's xlc has to have strict aliasing turned off too
4888   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -qnoansialias" >&5
4889 $as_echo_n "checking whether $CC supports -qnoansialias... " >&6; }
4890 if ${pgac_cv_prog_cc_cflags__qnoansialias+:} false; then :
4891   $as_echo_n "(cached) " >&6
4892 else
4893   pgac_save_CFLAGS=$CFLAGS
4894 CFLAGS="$pgac_save_CFLAGS -qnoansialias"
4895 ac_save_c_werror_flag=$ac_c_werror_flag
4896 ac_c_werror_flag=yes
4897 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4898 /* end confdefs.h.  */
4899
4900 int
4901 main ()
4902 {
4903
4904   ;
4905   return 0;
4906 }
4907 _ACEOF
4908 if ac_fn_c_try_compile "$LINENO"; then :
4909   pgac_cv_prog_cc_cflags__qnoansialias=yes
4910 else
4911   pgac_cv_prog_cc_cflags__qnoansialias=no
4912 fi
4913 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4914 ac_c_werror_flag=$ac_save_c_werror_flag
4915 CFLAGS="$pgac_save_CFLAGS"
4916 fi
4917 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__qnoansialias" >&5
4918 $as_echo "$pgac_cv_prog_cc_cflags__qnoansialias" >&6; }
4919 if test x"$pgac_cv_prog_cc_cflags__qnoansialias" = x"yes"; then
4920   CFLAGS="$CFLAGS -qnoansialias"
4921 fi
4922
4923   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -qlonglong" >&5
4924 $as_echo_n "checking whether $CC supports -qlonglong... " >&6; }
4925 if ${pgac_cv_prog_cc_cflags__qlonglong+:} false; then :
4926   $as_echo_n "(cached) " >&6
4927 else
4928   pgac_save_CFLAGS=$CFLAGS
4929 CFLAGS="$pgac_save_CFLAGS -qlonglong"
4930 ac_save_c_werror_flag=$ac_c_werror_flag
4931 ac_c_werror_flag=yes
4932 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4933 /* end confdefs.h.  */
4934
4935 int
4936 main ()
4937 {
4938
4939   ;
4940   return 0;
4941 }
4942 _ACEOF
4943 if ac_fn_c_try_compile "$LINENO"; then :
4944   pgac_cv_prog_cc_cflags__qlonglong=yes
4945 else
4946   pgac_cv_prog_cc_cflags__qlonglong=no
4947 fi
4948 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4949 ac_c_werror_flag=$ac_save_c_werror_flag
4950 CFLAGS="$pgac_save_CFLAGS"
4951 fi
4952 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags__qlonglong" >&5
4953 $as_echo "$pgac_cv_prog_cc_cflags__qlonglong" >&6; }
4954 if test x"$pgac_cv_prog_cc_cflags__qlonglong" = x"yes"; then
4955   CFLAGS="$CFLAGS -qlonglong"
4956 fi
4957
4958 elif test "$PORTNAME" = "hpux"; then
4959   # On some versions of HP-UX, libm functions do not set errno by default.
4960   # Fix that by using +Olibmerrno if the compiler recognizes it.
4961   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports +Olibmerrno" >&5
4962 $as_echo_n "checking whether $CC supports +Olibmerrno... " >&6; }
4963 if ${pgac_cv_prog_cc_cflags_pOlibmerrno+:} false; then :
4964   $as_echo_n "(cached) " >&6
4965 else
4966   pgac_save_CFLAGS=$CFLAGS
4967 CFLAGS="$pgac_save_CFLAGS +Olibmerrno"
4968 ac_save_c_werror_flag=$ac_c_werror_flag
4969 ac_c_werror_flag=yes
4970 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4971 /* end confdefs.h.  */
4972
4973 int
4974 main ()
4975 {
4976
4977   ;
4978   return 0;
4979 }
4980 _ACEOF
4981 if ac_fn_c_try_compile "$LINENO"; then :
4982   pgac_cv_prog_cc_cflags_pOlibmerrno=yes
4983 else
4984   pgac_cv_prog_cc_cflags_pOlibmerrno=no
4985 fi
4986 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4987 ac_c_werror_flag=$ac_save_c_werror_flag
4988 CFLAGS="$pgac_save_CFLAGS"
4989 fi
4990 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_cflags_pOlibmerrno" >&5
4991 $as_echo "$pgac_cv_prog_cc_cflags_pOlibmerrno" >&6; }
4992 if test x"$pgac_cv_prog_cc_cflags_pOlibmerrno" = x"yes"; then
4993   CFLAGS="$CFLAGS +Olibmerrno"
4994 fi
4995
4996 fi
4997
4998 CFLAGS_VECTOR=$CFLAGS_VECTOR
4999
5000
5001 # supply -g if --enable-debug
5002 if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
5003   CFLAGS="$CFLAGS -g"
5004 fi
5005
5006 # enable code coverage if --enable-coverage
5007 if test "$enable_coverage" = yes; then
5008   if test "$GCC" = yes; then
5009     CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
5010   else
5011     as_fn_error $? "--enable-coverage is supported only when using GCC" "$LINENO" 5
5012   fi
5013 fi
5014
5015 # enable profiling if --enable-profiling
5016 if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then
5017   if test "$GCC" = yes; then
5018
5019 $as_echo "#define PROFILE_PID_DIR 1" >>confdefs.h
5020
5021     CFLAGS="$CFLAGS -pg $PLATFORM_PROFILE_FLAGS"
5022   else
5023     as_fn_error $? "--enable-profiling is supported only when using GCC" "$LINENO" 5
5024   fi
5025 fi
5026
5027 # We already have this in Makefile.win32, but configure needs it too
5028 if test "$PORTNAME" = "win32"; then
5029   CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32 -DEXEC_BACKEND"
5030 fi
5031
5032 # Now that we're done automatically adding stuff to CFLAGS, put back the
5033 # user-specified flags (if any) at the end.  This lets users override
5034 # the automatic additions.
5035 CFLAGS="$CFLAGS $user_CFLAGS"
5036
5037 # Check if the compiler still works with the final flag settings
5038 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler still works" >&5
5039 $as_echo_n "checking whether the C compiler still works... " >&6; }
5040 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5041 /* end confdefs.h.  */
5042
5043 int
5044 main ()
5045 {
5046 return 0;
5047   ;
5048   return 0;
5049 }
5050 _ACEOF
5051 if ac_fn_c_try_link "$LINENO"; then :
5052   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5053 $as_echo "yes" >&6; }
5054 else
5055   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5056 $as_echo "no" >&6; }
5057    as_fn_error $? "cannot proceed" "$LINENO" 5
5058 fi
5059 rm -f core conftest.err conftest.$ac_objext \
5060     conftest$ac_exeext conftest.$ac_ext
5061
5062 # Defend against gcc -ffast-math
5063 if test "$GCC" = yes; then
5064 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5065 /* end confdefs.h.  */
5066
5067 int
5068 main ()
5069 {
5070 #ifdef __FAST_MATH__
5071 choke me
5072 #endif
5073   ;
5074   return 0;
5075 }
5076 _ACEOF
5077 if ac_fn_c_try_compile "$LINENO"; then :
5078
5079 else
5080   as_fn_error $? "do not put -ffast-math in CFLAGS" "$LINENO" 5
5081 fi
5082 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5083 fi
5084
5085 ac_ext=c
5086 ac_cpp='$CPP $CPPFLAGS'
5087 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5088 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5089 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5090 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
5091 $as_echo_n "checking how to run the C preprocessor... " >&6; }
5092 # On Suns, sometimes $CPP names a directory.
5093 if test -n "$CPP" && test -d "$CPP"; then
5094   CPP=
5095 fi
5096 if test -z "$CPP"; then
5097   if ${ac_cv_prog_CPP+:} false; then :
5098   $as_echo_n "(cached) " >&6
5099 else
5100       # Double quotes because CPP needs to be expanded
5101     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
5102     do
5103       ac_preproc_ok=false
5104 for ac_c_preproc_warn_flag in '' yes
5105 do
5106   # Use a header file that comes with gcc, so configuring glibc
5107   # with a fresh cross-compiler works.
5108   # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5109   # <limits.h> exists even on freestanding compilers.
5110   # On the NeXT, cc -E runs the code through the compiler's parser,
5111   # not just through cpp. "Syntax error" is here to catch this case.
5112   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5113 /* end confdefs.h.  */
5114 #ifdef __STDC__
5115 # include <limits.h>
5116 #else
5117 # include <assert.h>
5118 #endif
5119                      Syntax error
5120 _ACEOF
5121 if ac_fn_c_try_cpp "$LINENO"; then :
5122
5123 else
5124   # Broken: fails on valid input.
5125 continue
5126 fi
5127 rm -f conftest.err conftest.i conftest.$ac_ext
5128
5129   # OK, works on sane cases.  Now check whether nonexistent headers
5130   # can be detected and how.
5131   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5132 /* end confdefs.h.  */
5133 #include <ac_nonexistent.h>
5134 _ACEOF
5135 if ac_fn_c_try_cpp "$LINENO"; then :
5136   # Broken: success on invalid input.
5137 continue
5138 else
5139   # Passes both tests.
5140 ac_preproc_ok=:
5141 break
5142 fi
5143 rm -f conftest.err conftest.i conftest.$ac_ext
5144
5145 done
5146 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
5147 rm -f conftest.i conftest.err conftest.$ac_ext
5148 if $ac_preproc_ok; then :
5149   break
5150 fi
5151
5152     done
5153     ac_cv_prog_CPP=$CPP
5154
5155 fi
5156   CPP=$ac_cv_prog_CPP
5157 else
5158   ac_cv_prog_CPP=$CPP
5159 fi
5160 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
5161 $as_echo "$CPP" >&6; }
5162 ac_preproc_ok=false
5163 for ac_c_preproc_warn_flag in '' yes
5164 do
5165   # Use a header file that comes with gcc, so configuring glibc
5166   # with a fresh cross-compiler works.
5167   # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
5168   # <limits.h> exists even on freestanding compilers.
5169   # On the NeXT, cc -E runs the code through the compiler's parser,
5170   # not just through cpp. "Syntax error" is here to catch this case.
5171   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5172 /* end confdefs.h.  */
5173 #ifdef __STDC__
5174 # include <limits.h>
5175 #else
5176 # include <assert.h>
5177 #endif
5178                      Syntax error
5179 _ACEOF
5180 if ac_fn_c_try_cpp "$LINENO"; then :
5181
5182 else
5183   # Broken: fails on valid input.
5184 continue
5185 fi
5186 rm -f conftest.err conftest.i conftest.$ac_ext
5187
5188   # OK, works on sane cases.  Now check whether nonexistent headers
5189   # can be detected and how.
5190   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5191 /* end confdefs.h.  */
5192 #include <ac_nonexistent.h>
5193 _ACEOF
5194 if ac_fn_c_try_cpp "$LINENO"; then :
5195   # Broken: success on invalid input.
5196 continue
5197 else
5198   # Passes both tests.
5199 ac_preproc_ok=:
5200 break
5201 fi
5202 rm -f conftest.err conftest.i conftest.$ac_ext
5203
5204 done
5205 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
5206 rm -f conftest.i conftest.err conftest.$ac_ext
5207 if $ac_preproc_ok; then :
5208
5209 else
5210   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5211 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5212 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
5213 See \`config.log' for more details" "$LINENO" 5; }
5214 fi
5215
5216 ac_ext=c
5217 ac_cpp='$CPP $CPPFLAGS'
5218 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5219 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5220 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5221
5222
5223
5224
5225 #
5226 # Set up TAS assembly code if needed; the template file has now had its
5227 # chance to request this.
5228 #
5229 ac_config_links="$ac_config_links src/backend/port/tas.s:src/backend/port/tas/${tas_file}"
5230
5231
5232 if test "$need_tas" = yes ; then
5233   TAS=tas.o
5234 else
5235   TAS=""
5236 fi
5237
5238
5239
5240 #
5241 # Automatic dependency tracking
5242 #
5243
5244
5245 # Check whether --enable-depend was given.
5246 if test "${enable_depend+set}" = set; then :
5247   enableval=$enable_depend;
5248   case $enableval in
5249     yes)
5250       autodepend=yes
5251       ;;
5252     no)
5253       :
5254       ;;
5255     *)
5256       as_fn_error $? "no argument expected for --enable-depend option" "$LINENO" 5
5257       ;;
5258   esac
5259
5260 else
5261   enable_depend=no
5262
5263 fi
5264
5265
5266
5267
5268
5269 #
5270 # Enable assert checks
5271 #
5272
5273
5274 # Check whether --enable-cassert was given.
5275 if test "${enable_cassert+set}" = set; then :
5276   enableval=$enable_cassert;
5277   case $enableval in
5278     yes)
5279
5280 $as_echo "#define USE_ASSERT_CHECKING 1" >>confdefs.h
5281
5282       ;;
5283     no)
5284       :
5285       ;;
5286     *)
5287       as_fn_error $? "no argument expected for --enable-cassert option" "$LINENO" 5
5288       ;;
5289   esac
5290
5291 else
5292   enable_cassert=no
5293
5294 fi
5295
5296
5297
5298
5299 #
5300 # Include directories
5301 #
5302 ac_save_IFS=$IFS
5303 IFS="${IFS}${PATH_SEPARATOR}"
5304 # SRCH_INC comes from the template file
5305 for dir in $with_includes $SRCH_INC; do
5306   if test -d "$dir"; then
5307     INCLUDES="$INCLUDES -I$dir"
5308   else
5309     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Include directory $dir does not exist." >&5
5310 $as_echo "$as_me: WARNING: *** Include directory $dir does not exist." >&2;}
5311   fi
5312 done
5313 IFS=$ac_save_IFS
5314
5315
5316
5317 #
5318 # Library directories
5319 #
5320 ac_save_IFS=$IFS
5321 IFS="${IFS}${PATH_SEPARATOR}"
5322 # LIBRARY_DIRS comes from command line, SRCH_LIB from template file.
5323 for dir in $LIBRARY_DIRS $SRCH_LIB; do
5324   if test -d "$dir"; then
5325     LIBDIRS="$LIBDIRS -L$dir"
5326   else
5327     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Library directory $dir does not exist." >&5
5328 $as_echo "$as_me: WARNING: *** Library directory $dir does not exist." >&2;}
5329   fi
5330 done
5331 IFS=$ac_save_IFS
5332
5333 #
5334 # Enable thread-safe client libraries
5335 #
5336 { $as_echo "$as_me:${as_lineno-$LINENO}: checking allow thread-safe client libraries" >&5
5337 $as_echo_n "checking allow thread-safe client libraries... " >&6; }
5338
5339
5340 # Check whether --enable-thread-safety was given.
5341 if test "${enable_thread_safety+set}" = set; then :
5342   enableval=$enable_thread_safety;
5343   case $enableval in
5344     yes)
5345       :
5346       ;;
5347     no)
5348       :
5349       ;;
5350     *)
5351       as_fn_error $? "no argument expected for --enable-thread-safety option" "$LINENO" 5
5352       ;;
5353   esac
5354
5355 else
5356   enable_thread_safety=yes
5357
5358 fi
5359
5360
5361 if test "$enable_thread_safety" = yes; then
5362
5363 $as_echo "#define ENABLE_THREAD_SAFETY 1" >>confdefs.h
5364
5365 fi
5366 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_thread_safety" >&5
5367 $as_echo "$enable_thread_safety" >&6; }
5368
5369
5370 #
5371 # Optionally build Tcl modules (PL/Tcl)
5372 #
5373 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Tcl" >&5
5374 $as_echo_n "checking whether to build with Tcl... " >&6; }
5375
5376
5377
5378 # Check whether --with-tcl was given.
5379 if test "${with_tcl+set}" = set; then :
5380   withval=$with_tcl;
5381   case $withval in
5382     yes)
5383       :
5384       ;;
5385     no)
5386       :
5387       ;;
5388     *)
5389       as_fn_error $? "no argument expected for --with-tcl option" "$LINENO" 5
5390       ;;
5391   esac
5392
5393 else
5394   with_tcl=no
5395
5396 fi
5397
5398
5399 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_tcl" >&5
5400 $as_echo "$with_tcl" >&6; }
5401
5402
5403 # We see if the path to the Tcl/Tk configuration scripts is specified.
5404 # This will override the use of tclsh to find the paths to search.
5405
5406
5407
5408
5409 # Check whether --with-tclconfig was given.
5410 if test "${with_tclconfig+set}" = set; then :
5411   withval=$with_tclconfig;
5412   case $withval in
5413     yes)
5414       as_fn_error $? "argument required for --with-tclconfig option" "$LINENO" 5
5415       ;;
5416     no)
5417       as_fn_error $? "argument required for --with-tclconfig option" "$LINENO" 5
5418       ;;
5419     *)
5420
5421       ;;
5422   esac
5423
5424 fi
5425
5426
5427
5428 #
5429 # Optionally build Perl modules (PL/Perl)
5430 #
5431 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Perl modules" >&5
5432 $as_echo_n "checking whether to build Perl modules... " >&6; }
5433
5434
5435
5436 # Check whether --with-perl was given.
5437 if test "${with_perl+set}" = set; then :
5438   withval=$with_perl;
5439   case $withval in
5440     yes)
5441       :
5442       ;;
5443     no)
5444       :
5445       ;;
5446     *)
5447       as_fn_error $? "no argument expected for --with-perl option" "$LINENO" 5
5448       ;;
5449   esac
5450
5451 else
5452   with_perl=no
5453
5454 fi
5455
5456
5457 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_perl" >&5
5458 $as_echo "$with_perl" >&6; }
5459
5460
5461 #
5462 # Optionally build Python modules (PL/Python)
5463 #
5464 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Python modules" >&5
5465 $as_echo_n "checking whether to build Python modules... " >&6; }
5466
5467
5468
5469 # Check whether --with-python was given.
5470 if test "${with_python+set}" = set; then :
5471   withval=$with_python;
5472   case $withval in
5473     yes)
5474       :
5475       ;;
5476     no)
5477       :
5478       ;;
5479     *)
5480       as_fn_error $? "no argument expected for --with-python option" "$LINENO" 5
5481       ;;
5482   esac
5483
5484 else
5485   with_python=no
5486
5487 fi
5488
5489
5490 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_python" >&5
5491 $as_echo "$with_python" >&6; }
5492
5493
5494 #
5495 # GSSAPI
5496 #
5497 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with GSSAPI support" >&5
5498 $as_echo_n "checking whether to build with GSSAPI support... " >&6; }
5499
5500
5501
5502 # Check whether --with-gssapi was given.
5503 if test "${with_gssapi+set}" = set; then :
5504   withval=$with_gssapi;
5505   case $withval in
5506     yes)
5507
5508
5509 $as_echo "#define ENABLE_GSS 1" >>confdefs.h
5510
5511   krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab"
5512
5513       ;;
5514     no)
5515       :
5516       ;;
5517     *)
5518       as_fn_error $? "no argument expected for --with-gssapi option" "$LINENO" 5
5519       ;;
5520   esac
5521
5522 else
5523   with_gssapi=no
5524
5525 fi
5526
5527
5528 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gssapi" >&5
5529 $as_echo "$with_gssapi" >&6; }
5530
5531
5532
5533
5534
5535 #
5536 # Kerberos configuration parameters
5537 #
5538
5539
5540
5541 # Check whether --with-krb-srvnam was given.
5542 if test "${with_krb_srvnam+set}" = set; then :
5543   withval=$with_krb_srvnam;
5544   case $withval in
5545     yes)
5546       as_fn_error $? "argument required for --with-krb-srvnam option" "$LINENO" 5
5547       ;;
5548     no)
5549       as_fn_error $? "argument required for --with-krb-srvnam option" "$LINENO" 5
5550       ;;
5551     *)
5552
5553       ;;
5554   esac
5555
5556 else
5557   with_krb_srvnam="postgres"
5558 fi
5559
5560
5561
5562 cat >>confdefs.h <<_ACEOF
5563 #define PG_KRB_SRVNAM "$with_krb_srvnam"
5564 _ACEOF
5565
5566
5567
5568 #
5569 # PAM
5570 #
5571 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with PAM support" >&5
5572 $as_echo_n "checking whether to build with PAM support... " >&6; }
5573
5574
5575
5576 # Check whether --with-pam was given.
5577 if test "${with_pam+set}" = set; then :
5578   withval=$with_pam;
5579   case $withval in
5580     yes)
5581
5582 $as_echo "#define USE_PAM 1" >>confdefs.h
5583
5584       ;;
5585     no)
5586       :
5587       ;;
5588     *)
5589       as_fn_error $? "no argument expected for --with-pam option" "$LINENO" 5
5590       ;;
5591   esac
5592
5593 else
5594   with_pam=no
5595
5596 fi
5597
5598
5599 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pam" >&5
5600 $as_echo "$with_pam" >&6; }
5601
5602
5603 #
5604 # BSD AUTH
5605 #
5606 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with BSD Authentication support" >&5
5607 $as_echo_n "checking whether to build with BSD Authentication support... " >&6; }
5608
5609
5610
5611 # Check whether --with-bsd-auth was given.
5612 if test "${with_bsd_auth+set}" = set; then :
5613   withval=$with_bsd_auth;
5614   case $withval in
5615     yes)
5616
5617 $as_echo "#define USE_BSD_AUTH 1" >>confdefs.h
5618
5619       ;;
5620     no)
5621       :
5622       ;;
5623     *)
5624       as_fn_error $? "no argument expected for --with-bsd-auth option" "$LINENO" 5
5625       ;;
5626   esac
5627
5628 else
5629   with_bsd_auth=no
5630
5631 fi
5632
5633
5634 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_bsd_auth" >&5
5635 $as_echo "$with_bsd_auth" >&6; }
5636
5637
5638 #
5639 # LDAP
5640 #
5641 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with LDAP support" >&5
5642 $as_echo_n "checking whether to build with LDAP support... " >&6; }
5643
5644
5645
5646 # Check whether --with-ldap was given.
5647 if test "${with_ldap+set}" = set; then :
5648   withval=$with_ldap;
5649   case $withval in
5650     yes)
5651
5652 $as_echo "#define USE_LDAP 1" >>confdefs.h
5653
5654       ;;
5655     no)
5656       :
5657       ;;
5658     *)
5659       as_fn_error $? "no argument expected for --with-ldap option" "$LINENO" 5
5660       ;;
5661   esac
5662
5663 else
5664   with_ldap=no
5665
5666 fi
5667
5668
5669 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ldap" >&5
5670 $as_echo "$with_ldap" >&6; }
5671
5672
5673 #
5674 # Bonjour
5675 #
5676 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Bonjour support" >&5
5677 $as_echo_n "checking whether to build with Bonjour support... " >&6; }
5678
5679
5680
5681 # Check whether --with-bonjour was given.
5682 if test "${with_bonjour+set}" = set; then :
5683   withval=$with_bonjour;
5684   case $withval in
5685     yes)
5686
5687 $as_echo "#define USE_BONJOUR 1" >>confdefs.h
5688
5689       ;;
5690     no)
5691       :
5692       ;;
5693     *)
5694       as_fn_error $? "no argument expected for --with-bonjour option" "$LINENO" 5
5695       ;;
5696   esac
5697
5698 else
5699   with_bonjour=no
5700
5701 fi
5702
5703
5704 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_bonjour" >&5
5705 $as_echo "$with_bonjour" >&6; }
5706
5707
5708 #
5709 # OpenSSL
5710 #
5711 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with OpenSSL support" >&5
5712 $as_echo_n "checking whether to build with OpenSSL support... " >&6; }
5713
5714
5715
5716 # Check whether --with-openssl was given.
5717 if test "${with_openssl+set}" = set; then :
5718   withval=$with_openssl;
5719   case $withval in
5720     yes)
5721
5722 $as_echo "#define USE_OPENSSL 1" >>confdefs.h
5723
5724       ;;
5725     no)
5726       :
5727       ;;
5728     *)
5729       as_fn_error $? "no argument expected for --with-openssl option" "$LINENO" 5
5730       ;;
5731   esac
5732
5733 else
5734   with_openssl=no
5735
5736 fi
5737
5738
5739 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_openssl" >&5
5740 $as_echo "$with_openssl" >&6; }
5741
5742
5743 #
5744 # SELinux
5745 #
5746 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with SELinux support" >&5
5747 $as_echo_n "checking whether to build with SELinux support... " >&6; }
5748
5749
5750
5751 # Check whether --with-selinux was given.
5752 if test "${with_selinux+set}" = set; then :
5753   withval=$with_selinux;
5754   case $withval in
5755     yes)
5756       :
5757       ;;
5758     no)
5759       :
5760       ;;
5761     *)
5762       as_fn_error $? "no argument expected for --with-selinux option" "$LINENO" 5
5763       ;;
5764   esac
5765
5766 else
5767   with_selinux=no
5768
5769 fi
5770
5771
5772
5773 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_selinux" >&5
5774 $as_echo "$with_selinux" >&6; }
5775
5776 #
5777 # Systemd
5778 #
5779 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with systemd support" >&5
5780 $as_echo_n "checking whether to build with systemd support... " >&6; }
5781
5782
5783
5784 # Check whether --with-systemd was given.
5785 if test "${with_systemd+set}" = set; then :
5786   withval=$with_systemd;
5787   case $withval in
5788     yes)
5789
5790 $as_echo "#define USE_SYSTEMD 1" >>confdefs.h
5791
5792       ;;
5793     no)
5794       :
5795       ;;
5796     *)
5797       as_fn_error $? "no argument expected for --with-systemd option" "$LINENO" 5
5798       ;;
5799   esac
5800
5801 else
5802   with_systemd=no
5803
5804 fi
5805
5806
5807
5808 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_systemd" >&5
5809 $as_echo "$with_systemd" >&6; }
5810
5811 #
5812 # Readline
5813 #
5814
5815
5816
5817 # Check whether --with-readline was given.
5818 if test "${with_readline+set}" = set; then :
5819   withval=$with_readline;
5820   case $withval in
5821     yes)
5822       :
5823       ;;
5824     no)
5825       :
5826       ;;
5827     *)
5828       as_fn_error $? "no argument expected for --with-readline option" "$LINENO" 5
5829       ;;
5830   esac
5831
5832 else
5833   with_readline=yes
5834
5835 fi
5836
5837
5838 # readline on MinGW has problems with backslashes in psql and other bugs.
5839 # This is particularly a problem with non-US code pages.
5840 # Therefore disable its use until we understand the cause. 2004-07-20
5841 if test "$PORTNAME" = "win32"; then
5842   if test "$with_readline" = yes; then
5843     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Readline does not work on MinGW --- disabling" >&5
5844 $as_echo "$as_me: WARNING: *** Readline does not work on MinGW --- disabling" >&2;}
5845     with_readline=no
5846   fi
5847 fi
5848
5849
5850 #
5851 # Prefer libedit
5852 #
5853
5854
5855
5856 # Check whether --with-libedit-preferred was given.
5857 if test "${with_libedit_preferred+set}" = set; then :
5858   withval=$with_libedit_preferred;
5859   case $withval in
5860     yes)
5861       :
5862       ;;
5863     no)
5864       :
5865       ;;
5866     *)
5867       as_fn_error $? "no argument expected for --with-libedit-preferred option" "$LINENO" 5
5868       ;;
5869   esac
5870
5871 else
5872   with_libedit_preferred=no
5873
5874 fi
5875
5876
5877
5878
5879 #
5880 # UUID library
5881 #
5882 # There are at least three UUID libraries in common use: the FreeBSD/NetBSD
5883 # library, the e2fsprogs libuuid (now part of util-linux-ng), and the OSSP
5884 # UUID library.  More than one of these might be present on a given platform,
5885 # so we make the user say which one she wants.
5886 #
5887
5888
5889
5890 # Check whether --with-uuid was given.
5891 if test "${with_uuid+set}" = set; then :
5892   withval=$with_uuid;
5893   case $withval in
5894     yes)
5895       as_fn_error $? "argument required for --with-uuid option" "$LINENO" 5
5896       ;;
5897     no)
5898       as_fn_error $? "argument required for --with-uuid option" "$LINENO" 5
5899       ;;
5900     *)
5901
5902       ;;
5903   esac
5904
5905 fi
5906
5907
5908 if test x"$with_uuid" = x"" ; then
5909   with_uuid=no
5910 fi
5911
5912
5913
5914 # Check whether --with-ossp-uuid was given.
5915 if test "${with_ossp_uuid+set}" = set; then :
5916   withval=$with_ossp_uuid;
5917   case $withval in
5918     yes)
5919       :
5920       ;;
5921     no)
5922       :
5923       ;;
5924     *)
5925       as_fn_error $? "no argument expected for --with-ossp-uuid option" "$LINENO" 5
5926       ;;
5927   esac
5928
5929 else
5930   with_ossp_uuid=no
5931
5932 fi
5933
5934
5935 if test "$with_ossp_uuid" = yes ; then
5936   with_uuid=ossp
5937 fi
5938
5939 if test "$with_uuid" = bsd ; then
5940
5941 $as_echo "#define HAVE_UUID_BSD 1" >>confdefs.h
5942
5943   UUID_EXTRA_OBJS="md5.o sha1.o"
5944 elif test "$with_uuid" = e2fs ; then
5945
5946 $as_echo "#define HAVE_UUID_E2FS 1" >>confdefs.h
5947
5948   UUID_EXTRA_OBJS="md5.o sha1.o"
5949 elif test "$with_uuid" = ossp ; then
5950
5951 $as_echo "#define HAVE_UUID_OSSP 1" >>confdefs.h
5952
5953   UUID_EXTRA_OBJS=""
5954 elif test "$with_uuid" = no ; then
5955   UUID_EXTRA_OBJS=""
5956 else
5957   as_fn_error $? "--with-uuid must specify one of bsd, e2fs, or ossp" "$LINENO" 5
5958 fi
5959
5960
5961
5962
5963 #
5964 # XML
5965 #
5966
5967
5968
5969 # Check whether --with-libxml was given.
5970 if test "${with_libxml+set}" = set; then :
5971   withval=$with_libxml;
5972   case $withval in
5973     yes)
5974
5975 $as_echo "#define USE_LIBXML 1" >>confdefs.h
5976
5977       ;;
5978     no)
5979       :
5980       ;;
5981     *)
5982       as_fn_error $? "no argument expected for --with-libxml option" "$LINENO" 5
5983       ;;
5984   esac
5985
5986 else
5987   with_libxml=no
5988
5989 fi
5990
5991
5992
5993 if test "$with_libxml" = yes ; then
5994   for ac_prog in xml2-config
5995 do
5996   # Extract the first word of "$ac_prog", so it can be a program name with args.
5997 set dummy $ac_prog; ac_word=$2
5998 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5999 $as_echo_n "checking for $ac_word... " >&6; }
6000 if ${ac_cv_prog_XML2_CONFIG+:} false; then :
6001   $as_echo_n "(cached) " >&6
6002 else
6003   if test -n "$XML2_CONFIG"; then
6004   ac_cv_prog_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test.
6005 else
6006 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6007 for as_dir in $PATH
6008 do
6009   IFS=$as_save_IFS
6010   test -z "$as_dir" && as_dir=.
6011     for ac_exec_ext in '' $ac_executable_extensions; do
6012   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6013     ac_cv_prog_XML2_CONFIG="$ac_prog"
6014     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6015     break 2
6016   fi
6017 done
6018   done
6019 IFS=$as_save_IFS
6020
6021 fi
6022 fi
6023 XML2_CONFIG=$ac_cv_prog_XML2_CONFIG
6024 if test -n "$XML2_CONFIG"; then
6025   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5
6026 $as_echo "$XML2_CONFIG" >&6; }
6027 else
6028   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6029 $as_echo "no" >&6; }
6030 fi
6031
6032
6033   test -n "$XML2_CONFIG" && break
6034 done
6035
6036   if test -n "$XML2_CONFIG"; then
6037     for pgac_option in `$XML2_CONFIG --cflags`; do
6038       case $pgac_option in
6039         -I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";;
6040       esac
6041     done
6042     for pgac_option in `$XML2_CONFIG --libs`; do
6043       case $pgac_option in
6044         -L*) LDFLAGS="$LDFLAGS $pgac_option";;
6045       esac
6046     done
6047   fi
6048 fi
6049
6050
6051
6052 #
6053 # XSLT
6054 #
6055
6056
6057
6058 # Check whether --with-libxslt was given.
6059 if test "${with_libxslt+set}" = set; then :
6060   withval=$with_libxslt;
6061   case $withval in
6062     yes)
6063
6064 $as_echo "#define USE_LIBXSLT 1" >>confdefs.h
6065
6066       ;;
6067     no)
6068       :
6069       ;;
6070     *)
6071       as_fn_error $? "no argument expected for --with-libxslt option" "$LINENO" 5
6072       ;;
6073   esac
6074
6075 else
6076   with_libxslt=no
6077
6078 fi
6079
6080
6081
6082
6083
6084
6085 #
6086 # tzdata
6087 #
6088
6089
6090
6091 # Check whether --with-system-tzdata was given.
6092 if test "${with_system_tzdata+set}" = set; then :
6093   withval=$with_system_tzdata;
6094   case $withval in
6095     yes)
6096       as_fn_error $? "argument required for --with-system-tzdata option" "$LINENO" 5
6097       ;;
6098     no)
6099       as_fn_error $? "argument required for --with-system-tzdata option" "$LINENO" 5
6100       ;;
6101     *)
6102
6103       ;;
6104   esac
6105
6106 fi
6107
6108
6109
6110
6111 #
6112 # Zlib
6113 #
6114
6115
6116
6117 # Check whether --with-zlib was given.
6118 if test "${with_zlib+set}" = set; then :
6119   withval=$with_zlib;
6120   case $withval in
6121     yes)
6122       :
6123       ;;
6124     no)
6125       :
6126       ;;
6127     *)
6128       as_fn_error $? "no argument expected for --with-zlib option" "$LINENO" 5
6129       ;;
6130   esac
6131
6132 else
6133   with_zlib=yes
6134
6135 fi
6136
6137
6138
6139
6140 #
6141 # Elf
6142 #
6143
6144 # Assume system is ELF if it predefines __ELF__ as 1,
6145 # otherwise believe host_os based default.
6146 case $host_os in
6147     freebsd1*|freebsd2*) elf=no;;
6148     freebsd3*|freebsd4*) elf=yes;;
6149 esac
6150
6151
6152 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
6153 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
6154 if ${ac_cv_path_GREP+:} false; then :
6155   $as_echo_n "(cached) " >&6
6156 else
6157   if test -z "$GREP"; then
6158   ac_path_GREP_found=false
6159   # Loop through the user's path and test for each of PROGNAME-LIST
6160   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6161 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
6162 do
6163   IFS=$as_save_IFS
6164   test -z "$as_dir" && as_dir=.
6165     for ac_prog in grep ggrep; do
6166     for ac_exec_ext in '' $ac_executable_extensions; do
6167       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
6168       as_fn_executable_p "$ac_path_GREP" || continue
6169 # Check for GNU ac_path_GREP and select it if it is found.
6170   # Check for GNU $ac_path_GREP
6171 case `"$ac_path_GREP" --version 2>&1` in
6172 *GNU*)
6173   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
6174 *)
6175   ac_count=0
6176   $as_echo_n 0123456789 >"conftest.in"
6177   while :
6178   do
6179     cat "conftest.in" "conftest.in" >"conftest.tmp"
6180     mv "conftest.tmp" "conftest.in"
6181     cp "conftest.in" "conftest.nl"
6182     $as_echo 'GREP' >> "conftest.nl"
6183     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
6184     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
6185     as_fn_arith $ac_count + 1 && ac_count=$as_val
6186     if test $ac_count -gt ${ac_path_GREP_max-0}; then
6187       # Best one so far, save it but keep looking for a better one
6188       ac_cv_path_GREP="$ac_path_GREP"
6189       ac_path_GREP_max=$ac_count
6190     fi
6191     # 10*(2^10) chars as input seems more than enough
6192     test $ac_count -gt 10 && break
6193   done
6194   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
6195 esac
6196
6197       $ac_path_GREP_found && break 3
6198     done
6199   done
6200   done
6201 IFS=$as_save_IFS
6202   if test -z "$ac_cv_path_GREP"; then
6203     as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
6204   fi
6205 else
6206   ac_cv_path_GREP=$GREP
6207 fi
6208
6209 fi
6210 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
6211 $as_echo "$ac_cv_path_GREP" >&6; }
6212  GREP="$ac_cv_path_GREP"
6213
6214
6215 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
6216 $as_echo_n "checking for egrep... " >&6; }
6217 if ${ac_cv_path_EGREP+:} false; then :
6218   $as_echo_n "(cached) " >&6
6219 else
6220   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
6221    then ac_cv_path_EGREP="$GREP -E"
6222    else
6223      if test -z "$EGREP"; then
6224   ac_path_EGREP_found=false
6225   # Loop through the user's path and test for each of PROGNAME-LIST
6226   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6227 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
6228 do
6229   IFS=$as_save_IFS
6230   test -z "$as_dir" && as_dir=.
6231     for ac_prog in egrep; do
6232     for ac_exec_ext in '' $ac_executable_extensions; do
6233       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
6234       as_fn_executable_p "$ac_path_EGREP" || continue
6235 # Check for GNU ac_path_EGREP and select it if it is found.
6236   # Check for GNU $ac_path_EGREP
6237 case `"$ac_path_EGREP" --version 2>&1` in
6238 *GNU*)
6239   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
6240 *)
6241   ac_count=0
6242   $as_echo_n 0123456789 >"conftest.in"
6243   while :
6244   do
6245     cat "conftest.in" "conftest.in" >"conftest.tmp"
6246     mv "conftest.tmp" "conftest.in"
6247     cp "conftest.in" "conftest.nl"
6248     $as_echo 'EGREP' >> "conftest.nl"
6249     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
6250     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
6251     as_fn_arith $ac_count + 1 && ac_count=$as_val
6252     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
6253       # Best one so far, save it but keep looking for a better one
6254       ac_cv_path_EGREP="$ac_path_EGREP"
6255       ac_path_EGREP_max=$ac_count
6256     fi
6257     # 10*(2^10) chars as input seems more than enough
6258     test $ac_count -gt 10 && break
6259   done
6260   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
6261 esac
6262
6263       $ac_path_EGREP_found && break 3
6264     done
6265   done
6266   done
6267 IFS=$as_save_IFS
6268   if test -z "$ac_cv_path_EGREP"; then
6269     as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
6270   fi
6271 else
6272   ac_cv_path_EGREP=$EGREP
6273 fi
6274
6275    fi
6276 fi
6277 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
6278 $as_echo "$ac_cv_path_EGREP" >&6; }
6279  EGREP="$ac_cv_path_EGREP"
6280
6281
6282 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6283 /* end confdefs.h.  */
6284 #if __ELF__
6285   yes
6286 #endif
6287
6288 _ACEOF
6289 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6290   $EGREP "yes" >/dev/null 2>&1; then :
6291   ELF_SYS=true
6292 else
6293   if test "X$elf" = "Xyes" ; then
6294   ELF_SYS=true
6295 else
6296   ELF_SYS=
6297 fi
6298 fi
6299 rm -f conftest*
6300
6301
6302
6303 #
6304 # Assignments
6305 #
6306
6307 CPPFLAGS="$CPPFLAGS $INCLUDES"
6308 LDFLAGS="$LDFLAGS $LIBDIRS"
6309
6310
6311
6312
6313
6314 # Check whether --with-gnu-ld was given.
6315 if test "${with_gnu_ld+set}" = set; then :
6316   withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
6317 else
6318   with_gnu_ld=no
6319 fi
6320
6321 ac_prog=ld
6322 if test "$GCC" = yes; then
6323   # Check if gcc -print-prog-name=ld gives a path.
6324   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5
6325 $as_echo_n "checking for ld used by GCC... " >&6; }
6326   case $host in
6327   *-*-mingw*)
6328     # gcc leaves a trailing carriage return which upsets mingw
6329     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
6330   *)
6331     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
6332   esac
6333   case "$ac_prog" in
6334     # Accept absolute paths.
6335     [\\/]* | [A-Za-z]:[\\/]*)
6336       re_direlt='/[^/][^/]*/\.\./'
6337       # Canonicalize the path of ld
6338       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
6339       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
6340         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
6341       done
6342       test -z "$LD" && LD="$ac_prog"
6343       ;;
6344   "")
6345     # If it fails, then pretend we aren't using GCC.
6346     ac_prog=ld
6347     ;;
6348   *)
6349     # If it is relative, then search for the first ld in PATH.
6350     with_gnu_ld=unknown
6351     ;;
6352   esac
6353 elif test "$with_gnu_ld" = yes; then
6354   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
6355 $as_echo_n "checking for GNU ld... " >&6; }
6356 else
6357   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
6358 $as_echo_n "checking for non-GNU ld... " >&6; }
6359 fi
6360 if ${ac_cv_path_LD+:} false; then :
6361   $as_echo_n "(cached) " >&6
6362 else
6363   if test -z "$LD"; then
6364   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
6365   for ac_dir in $PATH; do
6366     test -z "$ac_dir" && ac_dir=.
6367     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
6368       ac_cv_path_LD="$ac_dir/$ac_prog"
6369       # Check to see if the program is GNU ld.  I'd rather use --version,
6370       # but apparently some GNU ld's only accept -v.
6371       # Break only if it was the GNU/non-GNU ld that we prefer.
6372       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
6373         test "$with_gnu_ld" != no && break
6374       else
6375         test "$with_gnu_ld" != yes && break
6376       fi
6377     fi
6378   done
6379   IFS="$ac_save_ifs"
6380 else
6381   ac_cv_path_LD="$LD" # Let the user override the test with a path.
6382 fi
6383 fi
6384
6385 LD="$ac_cv_path_LD"
6386 if test -n "$LD"; then
6387   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
6388 $as_echo "$LD" >&6; }
6389 else
6390   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6391 $as_echo "no" >&6; }
6392 fi
6393 test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
6394 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
6395 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
6396 if ${ac_cv_prog_gnu_ld+:} false; then :
6397   $as_echo_n "(cached) " >&6
6398 else
6399   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
6400 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
6401   ac_cv_prog_gnu_ld=yes
6402 else
6403   ac_cv_prog_gnu_ld=no
6404 fi
6405 fi
6406 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gnu_ld" >&5
6407 $as_echo "$ac_cv_prog_gnu_ld" >&6; }
6408 with_gnu_ld=$ac_cv_prog_gnu_ld
6409
6410
6411
6412
6413 if test -n "$ac_tool_prefix"; then
6414   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
6415 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
6416 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6417 $as_echo_n "checking for $ac_word... " >&6; }
6418 if ${ac_cv_prog_RANLIB+:} false; then :
6419   $as_echo_n "(cached) " >&6
6420 else
6421   if test -n "$RANLIB"; then
6422   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
6423 else
6424 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6425 for as_dir in $PATH
6426 do
6427   IFS=$as_save_IFS
6428   test -z "$as_dir" && as_dir=.
6429     for ac_exec_ext in '' $ac_executable_extensions; do
6430   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6431     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
6432     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6433     break 2
6434   fi
6435 done
6436   done
6437 IFS=$as_save_IFS
6438
6439 fi
6440 fi
6441 RANLIB=$ac_cv_prog_RANLIB
6442 if test -n "$RANLIB"; then
6443   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
6444 $as_echo "$RANLIB" >&6; }
6445 else
6446   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6447 $as_echo "no" >&6; }
6448 fi
6449
6450
6451 fi
6452 if test -z "$ac_cv_prog_RANLIB"; then
6453   ac_ct_RANLIB=$RANLIB
6454   # Extract the first word of "ranlib", so it can be a program name with args.
6455 set dummy ranlib; ac_word=$2
6456 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6457 $as_echo_n "checking for $ac_word... " >&6; }
6458 if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
6459   $as_echo_n "(cached) " >&6
6460 else
6461   if test -n "$ac_ct_RANLIB"; then
6462   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
6463 else
6464 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6465 for as_dir in $PATH
6466 do
6467   IFS=$as_save_IFS
6468   test -z "$as_dir" && as_dir=.
6469     for ac_exec_ext in '' $ac_executable_extensions; do
6470   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6471     ac_cv_prog_ac_ct_RANLIB="ranlib"
6472     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6473     break 2
6474   fi
6475 done
6476   done
6477 IFS=$as_save_IFS
6478
6479 fi
6480 fi
6481 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
6482 if test -n "$ac_ct_RANLIB"; then
6483   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
6484 $as_echo "$ac_ct_RANLIB" >&6; }
6485 else
6486   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6487 $as_echo "no" >&6; }
6488 fi
6489
6490   if test "x$ac_ct_RANLIB" = x; then
6491     RANLIB=":"
6492   else
6493     case $cross_compiling:$ac_tool_warned in
6494 yes:)
6495 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6496 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6497 ac_tool_warned=yes ;;
6498 esac
6499     RANLIB=$ac_ct_RANLIB
6500   fi
6501 else
6502   RANLIB="$ac_cv_prog_RANLIB"
6503 fi
6504
6505
6506   if test -n "$ac_tool_prefix"; then
6507   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
6508 set dummy ${ac_tool_prefix}strip; ac_word=$2
6509 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6510 $as_echo_n "checking for $ac_word... " >&6; }
6511 if ${ac_cv_prog_STRIP+:} false; then :
6512   $as_echo_n "(cached) " >&6
6513 else
6514   if test -n "$STRIP"; then
6515   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
6516 else
6517 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6518 for as_dir in $PATH
6519 do
6520   IFS=$as_save_IFS
6521   test -z "$as_dir" && as_dir=.
6522     for ac_exec_ext in '' $ac_executable_extensions; do
6523   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6524     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
6525     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6526     break 2
6527   fi
6528 done
6529   done
6530 IFS=$as_save_IFS
6531
6532 fi
6533 fi
6534 STRIP=$ac_cv_prog_STRIP
6535 if test -n "$STRIP"; then
6536   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
6537 $as_echo "$STRIP" >&6; }
6538 else
6539   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6540 $as_echo "no" >&6; }
6541 fi
6542
6543
6544 fi
6545 if test -z "$ac_cv_prog_STRIP"; then
6546   ac_ct_STRIP=$STRIP
6547   # Extract the first word of "strip", so it can be a program name with args.
6548 set dummy strip; ac_word=$2
6549 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6550 $as_echo_n "checking for $ac_word... " >&6; }
6551 if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
6552   $as_echo_n "(cached) " >&6
6553 else
6554   if test -n "$ac_ct_STRIP"; then
6555   ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
6556 else
6557 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6558 for as_dir in $PATH
6559 do
6560   IFS=$as_save_IFS
6561   test -z "$as_dir" && as_dir=.
6562     for ac_exec_ext in '' $ac_executable_extensions; do
6563   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6564     ac_cv_prog_ac_ct_STRIP="strip"
6565     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6566     break 2
6567   fi
6568 done
6569   done
6570 IFS=$as_save_IFS
6571
6572 fi
6573 fi
6574 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
6575 if test -n "$ac_ct_STRIP"; then
6576   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
6577 $as_echo "$ac_ct_STRIP" >&6; }
6578 else
6579   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6580 $as_echo "no" >&6; }
6581 fi
6582
6583   if test "x$ac_ct_STRIP" = x; then
6584     STRIP=":"
6585   else
6586     case $cross_compiling:$ac_tool_warned in
6587 yes:)
6588 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6589 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6590 ac_tool_warned=yes ;;
6591 esac
6592     STRIP=$ac_ct_STRIP
6593   fi
6594 else
6595   STRIP="$ac_cv_prog_STRIP"
6596 fi
6597
6598
6599   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is possible to strip libraries" >&5
6600 $as_echo_n "checking whether it is possible to strip libraries... " >&6; }
6601   if test x"$STRIP" != x"" && "$STRIP" -V 2>&1 | grep "GNU strip" >/dev/null; then
6602     STRIP_STATIC_LIB="$STRIP -x"
6603     STRIP_SHARED_LIB="$STRIP --strip-unneeded"
6604     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6605 $as_echo "yes" >&6; }
6606   else
6607     case $host_os in
6608       darwin*)
6609         STRIP="$STRIP -x"
6610         STRIP_STATIC_LIB=$STRIP
6611         STRIP_SHARED_LIB=$STRIP
6612         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6613 $as_echo "yes" >&6; }
6614         ;;
6615       *)
6616         STRIP_STATIC_LIB=:
6617         STRIP_SHARED_LIB=:
6618         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6619 $as_echo "no" >&6; }
6620         ;;
6621     esac
6622   fi
6623
6624
6625
6626 if test -n "$ac_tool_prefix"; then
6627   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
6628 set dummy ${ac_tool_prefix}ar; ac_word=$2
6629 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6630 $as_echo_n "checking for $ac_word... " >&6; }
6631 if ${ac_cv_prog_AR+:} false; then :
6632   $as_echo_n "(cached) " >&6
6633 else
6634   if test -n "$AR"; then
6635   ac_cv_prog_AR="$AR" # Let the user override the test.
6636 else
6637 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6638 for as_dir in $PATH
6639 do
6640   IFS=$as_save_IFS
6641   test -z "$as_dir" && as_dir=.
6642     for ac_exec_ext in '' $ac_executable_extensions; do
6643   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6644     ac_cv_prog_AR="${ac_tool_prefix}ar"
6645     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6646     break 2
6647   fi
6648 done
6649   done
6650 IFS=$as_save_IFS
6651
6652 fi
6653 fi
6654 AR=$ac_cv_prog_AR
6655 if test -n "$AR"; then
6656   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
6657 $as_echo "$AR" >&6; }
6658 else
6659   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6660 $as_echo "no" >&6; }
6661 fi
6662
6663
6664 fi
6665 if test -z "$ac_cv_prog_AR"; then
6666   ac_ct_AR=$AR
6667   # Extract the first word of "ar", so it can be a program name with args.
6668 set dummy ar; ac_word=$2
6669 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6670 $as_echo_n "checking for $ac_word... " >&6; }
6671 if ${ac_cv_prog_ac_ct_AR+:} false; then :
6672   $as_echo_n "(cached) " >&6
6673 else
6674   if test -n "$ac_ct_AR"; then
6675   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
6676 else
6677 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6678 for as_dir in $PATH
6679 do
6680   IFS=$as_save_IFS
6681   test -z "$as_dir" && as_dir=.
6682     for ac_exec_ext in '' $ac_executable_extensions; do
6683   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6684     ac_cv_prog_ac_ct_AR="ar"
6685     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6686     break 2
6687   fi
6688 done
6689   done
6690 IFS=$as_save_IFS
6691
6692 fi
6693 fi
6694 ac_ct_AR=$ac_cv_prog_ac_ct_AR
6695 if test -n "$ac_ct_AR"; then
6696   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
6697 $as_echo "$ac_ct_AR" >&6; }
6698 else
6699   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6700 $as_echo "no" >&6; }
6701 fi
6702
6703   if test "x$ac_ct_AR" = x; then
6704     AR="ar"
6705   else
6706     case $cross_compiling:$ac_tool_warned in
6707 yes:)
6708 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6709 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6710 ac_tool_warned=yes ;;
6711 esac
6712     AR=$ac_ct_AR
6713   fi
6714 else
6715   AR="$ac_cv_prog_AR"
6716 fi
6717
6718 if test "$PORTNAME" = "win32"; then
6719   if test -n "$ac_tool_prefix"; then
6720   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
6721 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
6722 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6723 $as_echo_n "checking for $ac_word... " >&6; }
6724 if ${ac_cv_prog_DLLTOOL+:} false; then :
6725   $as_echo_n "(cached) " >&6
6726 else
6727   if test -n "$DLLTOOL"; then
6728   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
6729 else
6730 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6731 for as_dir in $PATH
6732 do
6733   IFS=$as_save_IFS
6734   test -z "$as_dir" && as_dir=.
6735     for ac_exec_ext in '' $ac_executable_extensions; do
6736   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6737     ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
6738     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6739     break 2
6740   fi
6741 done
6742   done
6743 IFS=$as_save_IFS
6744
6745 fi
6746 fi
6747 DLLTOOL=$ac_cv_prog_DLLTOOL
6748 if test -n "$DLLTOOL"; then
6749   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
6750 $as_echo "$DLLTOOL" >&6; }
6751 else
6752   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6753 $as_echo "no" >&6; }
6754 fi
6755
6756
6757 fi
6758 if test -z "$ac_cv_prog_DLLTOOL"; then
6759   ac_ct_DLLTOOL=$DLLTOOL
6760   # Extract the first word of "dlltool", so it can be a program name with args.
6761 set dummy dlltool; ac_word=$2
6762 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6763 $as_echo_n "checking for $ac_word... " >&6; }
6764 if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
6765   $as_echo_n "(cached) " >&6
6766 else
6767   if test -n "$ac_ct_DLLTOOL"; then
6768   ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
6769 else
6770 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6771 for as_dir in $PATH
6772 do
6773   IFS=$as_save_IFS
6774   test -z "$as_dir" && as_dir=.
6775     for ac_exec_ext in '' $ac_executable_extensions; do
6776   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6777     ac_cv_prog_ac_ct_DLLTOOL="dlltool"
6778     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6779     break 2
6780   fi
6781 done
6782   done
6783 IFS=$as_save_IFS
6784
6785 fi
6786 fi
6787 ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
6788 if test -n "$ac_ct_DLLTOOL"; then
6789   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
6790 $as_echo "$ac_ct_DLLTOOL" >&6; }
6791 else
6792   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6793 $as_echo "no" >&6; }
6794 fi
6795
6796   if test "x$ac_ct_DLLTOOL" = x; then
6797     DLLTOOL="dlltool"
6798   else
6799     case $cross_compiling:$ac_tool_warned in
6800 yes:)
6801 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6802 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6803 ac_tool_warned=yes ;;
6804 esac
6805     DLLTOOL=$ac_ct_DLLTOOL
6806   fi
6807 else
6808   DLLTOOL="$ac_cv_prog_DLLTOOL"
6809 fi
6810
6811   if test -n "$ac_tool_prefix"; then
6812   # Extract the first word of "${ac_tool_prefix}dllwrap", so it can be a program name with args.
6813 set dummy ${ac_tool_prefix}dllwrap; ac_word=$2
6814 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6815 $as_echo_n "checking for $ac_word... " >&6; }
6816 if ${ac_cv_prog_DLLWRAP+:} false; then :
6817   $as_echo_n "(cached) " >&6
6818 else
6819   if test -n "$DLLWRAP"; then
6820   ac_cv_prog_DLLWRAP="$DLLWRAP" # Let the user override the test.
6821 else
6822 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6823 for as_dir in $PATH
6824 do
6825   IFS=$as_save_IFS
6826   test -z "$as_dir" && as_dir=.
6827     for ac_exec_ext in '' $ac_executable_extensions; do
6828   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6829     ac_cv_prog_DLLWRAP="${ac_tool_prefix}dllwrap"
6830     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6831     break 2
6832   fi
6833 done
6834   done
6835 IFS=$as_save_IFS
6836
6837 fi
6838 fi
6839 DLLWRAP=$ac_cv_prog_DLLWRAP
6840 if test -n "$DLLWRAP"; then
6841   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLWRAP" >&5
6842 $as_echo "$DLLWRAP" >&6; }
6843 else
6844   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6845 $as_echo "no" >&6; }
6846 fi
6847
6848
6849 fi
6850 if test -z "$ac_cv_prog_DLLWRAP"; then
6851   ac_ct_DLLWRAP=$DLLWRAP
6852   # Extract the first word of "dllwrap", so it can be a program name with args.
6853 set dummy dllwrap; ac_word=$2
6854 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6855 $as_echo_n "checking for $ac_word... " >&6; }
6856 if ${ac_cv_prog_ac_ct_DLLWRAP+:} false; then :
6857   $as_echo_n "(cached) " >&6
6858 else
6859   if test -n "$ac_ct_DLLWRAP"; then
6860   ac_cv_prog_ac_ct_DLLWRAP="$ac_ct_DLLWRAP" # Let the user override the test.
6861 else
6862 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6863 for as_dir in $PATH
6864 do
6865   IFS=$as_save_IFS
6866   test -z "$as_dir" && as_dir=.
6867     for ac_exec_ext in '' $ac_executable_extensions; do
6868   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6869     ac_cv_prog_ac_ct_DLLWRAP="dllwrap"
6870     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6871     break 2
6872   fi
6873 done
6874   done
6875 IFS=$as_save_IFS
6876
6877 fi
6878 fi
6879 ac_ct_DLLWRAP=$ac_cv_prog_ac_ct_DLLWRAP
6880 if test -n "$ac_ct_DLLWRAP"; then
6881   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLWRAP" >&5
6882 $as_echo "$ac_ct_DLLWRAP" >&6; }
6883 else
6884   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6885 $as_echo "no" >&6; }
6886 fi
6887
6888   if test "x$ac_ct_DLLWRAP" = x; then
6889     DLLWRAP="dllwrap"
6890   else
6891     case $cross_compiling:$ac_tool_warned in
6892 yes:)
6893 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6894 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6895 ac_tool_warned=yes ;;
6896 esac
6897     DLLWRAP=$ac_ct_DLLWRAP
6898   fi
6899 else
6900   DLLWRAP="$ac_cv_prog_DLLWRAP"
6901 fi
6902
6903   if test -n "$ac_tool_prefix"; then
6904   # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
6905 set dummy ${ac_tool_prefix}windres; ac_word=$2
6906 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6907 $as_echo_n "checking for $ac_word... " >&6; }
6908 if ${ac_cv_prog_WINDRES+:} false; then :
6909   $as_echo_n "(cached) " >&6
6910 else
6911   if test -n "$WINDRES"; then
6912   ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
6913 else
6914 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6915 for as_dir in $PATH
6916 do
6917   IFS=$as_save_IFS
6918   test -z "$as_dir" && as_dir=.
6919     for ac_exec_ext in '' $ac_executable_extensions; do
6920   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6921     ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
6922     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6923     break 2
6924   fi
6925 done
6926   done
6927 IFS=$as_save_IFS
6928
6929 fi
6930 fi
6931 WINDRES=$ac_cv_prog_WINDRES
6932 if test -n "$WINDRES"; then
6933   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5
6934 $as_echo "$WINDRES" >&6; }
6935 else
6936   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6937 $as_echo "no" >&6; }
6938 fi
6939
6940
6941 fi
6942 if test -z "$ac_cv_prog_WINDRES"; then
6943   ac_ct_WINDRES=$WINDRES
6944   # Extract the first word of "windres", so it can be a program name with args.
6945 set dummy windres; ac_word=$2
6946 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6947 $as_echo_n "checking for $ac_word... " >&6; }
6948 if ${ac_cv_prog_ac_ct_WINDRES+:} false; then :
6949   $as_echo_n "(cached) " >&6
6950 else
6951   if test -n "$ac_ct_WINDRES"; then
6952   ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
6953 else
6954 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6955 for as_dir in $PATH
6956 do
6957   IFS=$as_save_IFS
6958   test -z "$as_dir" && as_dir=.
6959     for ac_exec_ext in '' $ac_executable_extensions; do
6960   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6961     ac_cv_prog_ac_ct_WINDRES="windres"
6962     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6963     break 2
6964   fi
6965 done
6966   done
6967 IFS=$as_save_IFS
6968
6969 fi
6970 fi
6971 ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
6972 if test -n "$ac_ct_WINDRES"; then
6973   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5
6974 $as_echo "$ac_ct_WINDRES" >&6; }
6975 else
6976   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6977 $as_echo "no" >&6; }
6978 fi
6979
6980   if test "x$ac_ct_WINDRES" = x; then
6981     WINDRES="windres"
6982   else
6983     case $cross_compiling:$ac_tool_warned in
6984 yes:)
6985 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6986 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6987 ac_tool_warned=yes ;;
6988 esac
6989     WINDRES=$ac_ct_WINDRES
6990   fi
6991 else
6992   WINDRES="$ac_cv_prog_WINDRES"
6993 fi
6994
6995 fi
6996
6997 # Find a good install program.  We prefer a C program (faster),
6998 # so one script is as good as another.  But avoid the broken or
6999 # incompatible versions:
7000 # SysV /etc/install, /usr/sbin/install
7001 # SunOS /usr/etc/install
7002 # IRIX /sbin/install
7003 # AIX /bin/install
7004 # AmigaOS /C/install, which installs bootblocks on floppy discs
7005 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
7006 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
7007 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
7008 # OS/2's system install, which has a completely different semantic
7009 # ./install, which can be erroneously created by make from ./install.sh.
7010 # Reject install programs that cannot install multiple files.
7011 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
7012 $as_echo_n "checking for a BSD-compatible install... " >&6; }
7013 if test -z "$INSTALL"; then
7014 if ${ac_cv_path_install+:} false; then :
7015   $as_echo_n "(cached) " >&6
7016 else
7017   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7018 for as_dir in $PATH
7019 do
7020   IFS=$as_save_IFS
7021   test -z "$as_dir" && as_dir=.
7022     # Account for people who put trailing slashes in PATH elements.
7023 case $as_dir/ in #((
7024   ./ | .// | /[cC]/* | \
7025   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
7026   ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
7027   /usr/ucb/* ) ;;
7028   *)
7029     # OSF1 and SCO ODT 3.0 have their own names for install.
7030     # Don't use installbsd from OSF since it installs stuff as root
7031     # by default.
7032     for ac_prog in ginstall scoinst install; do
7033       for ac_exec_ext in '' $ac_executable_extensions; do
7034         if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
7035           if test $ac_prog = install &&
7036             grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
7037             # AIX install.  It has an incompatible calling convention.
7038             :
7039           elif test $ac_prog = install &&
7040             grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
7041             # program-specific install script used by HP pwplus--don't use.
7042             :
7043           else
7044             rm -rf conftest.one conftest.two conftest.dir
7045             echo one > conftest.one
7046             echo two > conftest.two
7047             mkdir conftest.dir
7048             if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
7049               test -s conftest.one && test -s conftest.two &&
7050               test -s conftest.dir/conftest.one &&
7051               test -s conftest.dir/conftest.two
7052             then
7053               ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
7054               break 3
7055             fi
7056           fi
7057         fi
7058       done
7059     done
7060     ;;
7061 esac
7062
7063   done
7064 IFS=$as_save_IFS
7065
7066 rm -rf conftest.one conftest.two conftest.dir
7067
7068 fi
7069   if test "${ac_cv_path_install+set}" = set; then
7070     INSTALL=$ac_cv_path_install
7071   else
7072     # As a last resort, use the slow shell script.  Don't cache a
7073     # value for INSTALL within a source directory, because that will
7074     # break other packages using the cache if that directory is
7075     # removed, or if the value is a relative name.
7076     INSTALL=$ac_install_sh
7077   fi
7078 fi
7079 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
7080 $as_echo "$INSTALL" >&6; }
7081
7082 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
7083 # It thinks the first close brace ends the variable substitution.
7084 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
7085
7086 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
7087
7088 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
7089
7090 # When Autoconf chooses install-sh as install program it tries to generate
7091 # a relative path to it in each makefile where it subsitutes it. This clashes
7092 # with our Makefile.global concept. This workaround helps.
7093 case $INSTALL in
7094   *install-sh*) install_bin='';;
7095   *) install_bin=$INSTALL;;
7096 esac
7097
7098
7099 # Extract the first word of "tar", so it can be a program name with args.
7100 set dummy tar; ac_word=$2
7101 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7102 $as_echo_n "checking for $ac_word... " >&6; }
7103 if ${ac_cv_path_TAR+:} false; then :
7104   $as_echo_n "(cached) " >&6
7105 else
7106   case $TAR in
7107   [\\/]* | ?:[\\/]*)
7108   ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
7109   ;;
7110   *)
7111   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7112 for as_dir in $PATH
7113 do
7114   IFS=$as_save_IFS
7115   test -z "$as_dir" && as_dir=.
7116     for ac_exec_ext in '' $ac_executable_extensions; do
7117   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7118     ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext"
7119     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7120     break 2
7121   fi
7122 done
7123   done
7124 IFS=$as_save_IFS
7125
7126   ;;
7127 esac
7128 fi
7129 TAR=$ac_cv_path_TAR
7130 if test -n "$TAR"; then
7131   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5
7132 $as_echo "$TAR" >&6; }
7133 else
7134   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7135 $as_echo "no" >&6; }
7136 fi
7137
7138
7139 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
7140 $as_echo_n "checking whether ln -s works... " >&6; }
7141 LN_S=$as_ln_s
7142 if test "$LN_S" = "ln -s"; then
7143   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7144 $as_echo "yes" >&6; }
7145 else
7146   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
7147 $as_echo "no, using $LN_S" >&6; }
7148 fi
7149
7150 for ac_prog in gawk mawk nawk awk
7151 do
7152   # Extract the first word of "$ac_prog", so it can be a program name with args.
7153 set dummy $ac_prog; ac_word=$2
7154 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7155 $as_echo_n "checking for $ac_word... " >&6; }
7156 if ${ac_cv_prog_AWK+:} false; then :
7157   $as_echo_n "(cached) " >&6
7158 else
7159   if test -n "$AWK"; then
7160   ac_cv_prog_AWK="$AWK" # Let the user override the test.
7161 else
7162 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7163 for as_dir in $PATH
7164 do
7165   IFS=$as_save_IFS
7166   test -z "$as_dir" && as_dir=.
7167     for ac_exec_ext in '' $ac_executable_extensions; do
7168   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7169     ac_cv_prog_AWK="$ac_prog"
7170     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7171     break 2
7172   fi
7173 done
7174   done
7175 IFS=$as_save_IFS
7176
7177 fi
7178 fi
7179 AWK=$ac_cv_prog_AWK
7180 if test -n "$AWK"; then
7181   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
7182 $as_echo "$AWK" >&6; }
7183 else
7184   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7185 $as_echo "no" >&6; }
7186 fi
7187
7188
7189   test -n "$AWK" && break
7190 done
7191
7192 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
7193 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
7194 if test -z "$MKDIR_P"; then
7195   if ${ac_cv_path_mkdir+:} false; then :
7196   $as_echo_n "(cached) " >&6
7197 else
7198   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7199 for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
7200 do
7201   IFS=$as_save_IFS
7202   test -z "$as_dir" && as_dir=.
7203     for ac_prog in mkdir gmkdir; do
7204          for ac_exec_ext in '' $ac_executable_extensions; do
7205            as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
7206            case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
7207              'mkdir (GNU coreutils) '* | \
7208              'mkdir (coreutils) '* | \
7209              'mkdir (fileutils) '4.1*)
7210                ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
7211                break 3;;
7212            esac
7213          done
7214        done
7215   done
7216 IFS=$as_save_IFS
7217
7218 fi
7219
7220   test -d ./--version && rmdir ./--version
7221   if test "${ac_cv_path_mkdir+set}" = set; then
7222     MKDIR_P="$ac_cv_path_mkdir -p"
7223   else
7224     # As a last resort, use the slow shell script.  Don't cache a
7225     # value for MKDIR_P within a source directory, because that will
7226     # break other packages using the cache if that directory is
7227     # removed, or if the value is a relative name.
7228     MKDIR_P="$ac_install_sh -d"
7229   fi
7230 fi
7231 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
7232 $as_echo "$MKDIR_P" >&6; }
7233
7234 # When Autoconf chooses install-sh as mkdir -p program it tries to generate
7235 # a relative path to it in each makefile where it subsitutes it. This clashes
7236 # with our Makefile.global concept. This workaround helps.
7237 case $MKDIR_P in
7238   *install-sh*) MKDIR_P='\${SHELL} \${top_srcdir}/config/install-sh -c -d';;
7239 esac
7240
7241 # Let the user override the search
7242 if test -z "$BISON"; then
7243   for ac_prog in bison
7244 do
7245   # Extract the first word of "$ac_prog", so it can be a program name with args.
7246 set dummy $ac_prog; ac_word=$2
7247 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7248 $as_echo_n "checking for $ac_word... " >&6; }
7249 if ${ac_cv_path_BISON+:} false; then :
7250   $as_echo_n "(cached) " >&6
7251 else
7252   case $BISON in
7253   [\\/]* | ?:[\\/]*)
7254   ac_cv_path_BISON="$BISON" # Let the user override the test with a path.
7255   ;;
7256   *)
7257   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7258 for as_dir in $PATH
7259 do
7260   IFS=$as_save_IFS
7261   test -z "$as_dir" && as_dir=.
7262     for ac_exec_ext in '' $ac_executable_extensions; do
7263   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7264     ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext"
7265     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7266     break 2
7267   fi
7268 done
7269   done
7270 IFS=$as_save_IFS
7271
7272   ;;
7273 esac
7274 fi
7275 BISON=$ac_cv_path_BISON
7276 if test -n "$BISON"; then
7277   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5
7278 $as_echo "$BISON" >&6; }
7279 else
7280   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7281 $as_echo "no" >&6; }
7282 fi
7283
7284
7285   test -n "$BISON" && break
7286 done
7287
7288 fi
7289
7290 if test "$BISON"; then
7291   pgac_bison_version=`$BISON --version 2>/dev/null | sed q`
7292   { $as_echo "$as_me:${as_lineno-$LINENO}: using $pgac_bison_version" >&5
7293 $as_echo "$as_me: using $pgac_bison_version" >&6;}
7294   if echo "$pgac_bison_version" | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'
7295   then
7296     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7297 *** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
7298 *** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&5
7299 $as_echo "$as_me: WARNING:
7300 *** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
7301 *** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&2;}
7302     BISON=""
7303   fi
7304   # Bison >=3.0 issues warnings about %name-prefix="base_yy", instead
7305   # of the now preferred %name-prefix "base_yy", but the latter
7306   # doesn't work with Bison 2.3 or less.  So for now we silence the
7307   # deprecation warnings.
7308   if echo "$pgac_bison_version" | $AWK '{ if ($4 >= 3) exit 0; else exit 1;}'
7309   then
7310     BISONFLAGS="$BISONFLAGS -Wno-deprecated"
7311   fi
7312 fi
7313
7314 if test -z "$BISON"; then
7315   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7316 *** Without Bison you will not be able to build PostgreSQL from Git nor
7317 *** change any of the parser definition files.  You can obtain Bison from
7318 *** a GNU mirror site.  (If you are using the official distribution of
7319 *** PostgreSQL then you do not need to worry about this, because the Bison
7320 *** output is pre-generated.)" >&5
7321 $as_echo "$as_me: WARNING:
7322 *** Without Bison you will not be able to build PostgreSQL from Git nor
7323 *** change any of the parser definition files.  You can obtain Bison from
7324 *** a GNU mirror site.  (If you are using the official distribution of
7325 *** PostgreSQL then you do not need to worry about this, because the Bison
7326 *** output is pre-generated.)" >&2;}
7327 fi
7328 # We don't need AC_SUBST(BISON) because AC_PATH_PROG did it
7329
7330
7331 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flex" >&5
7332 $as_echo_n "checking for flex... " >&6; }
7333 if ${pgac_cv_path_flex+:} false; then :
7334   $as_echo_n "(cached) " >&6
7335 else
7336   # Let the user override the test
7337 if test -n "$FLEX"; then
7338   pgac_cv_path_flex=$FLEX
7339 else
7340   pgac_save_IFS=$IFS
7341   IFS=$PATH_SEPARATOR
7342   for pgac_dir in $PATH; do
7343     IFS=$pgac_save_IFS
7344     if test -z "$pgac_dir" || test x"$pgac_dir" = x"."; then
7345       pgac_dir=`pwd`
7346     fi
7347     for pgac_prog in flex lex; do
7348       pgac_candidate="$pgac_dir/$pgac_prog"
7349       if test -f "$pgac_candidate" \
7350         && $pgac_candidate --version </dev/null >/dev/null 2>&1
7351       then
7352         echo '%%'  > conftest.l
7353         if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
7354           pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
7355           if echo "$pgac_flex_version" | sed 's/[.a-z]/ /g' | $AWK '{ if ($1 == 2 && ($2 > 5 || ($2 == 5 && $3 >= 31))) exit 0; else exit 1;}'
7356           then
7357             pgac_cv_path_flex=$pgac_candidate
7358             break 2
7359           else
7360             { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7361 *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
7362 *** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&5
7363 $as_echo "$as_me: WARNING:
7364 *** The installed version of Flex, $pgac_candidate, is too old to use with PostgreSQL.
7365 *** Flex version 2.5.31 or later is required, but this is $pgac_flex_version." >&2;}
7366           fi
7367         fi
7368       fi
7369     done
7370   done
7371   rm -f conftest.l lex.yy.c
7372   : ${pgac_cv_path_flex=no}
7373 fi
7374
7375 fi
7376 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_path_flex" >&5
7377 $as_echo "$pgac_cv_path_flex" >&6; }
7378 if test x"$pgac_cv_path_flex" = x"no"; then
7379   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7380 *** Without Flex you will not be able to build PostgreSQL from Git nor
7381 *** change any of the scanner definition files.  You can obtain Flex from
7382 *** a GNU mirror site.  (If you are using the official distribution of
7383 *** PostgreSQL then you do not need to worry about this because the Flex
7384 *** output is pre-generated.)" >&5
7385 $as_echo "$as_me: WARNING:
7386 *** Without Flex you will not be able to build PostgreSQL from Git nor
7387 *** change any of the scanner definition files.  You can obtain Flex from
7388 *** a GNU mirror site.  (If you are using the official distribution of
7389 *** PostgreSQL then you do not need to worry about this because the Flex
7390 *** output is pre-generated.)" >&2;}
7391
7392   FLEX=
7393 else
7394   FLEX=$pgac_cv_path_flex
7395   pgac_flex_version=`$FLEX --version 2>/dev/null`
7396   { $as_echo "$as_me:${as_lineno-$LINENO}: using $pgac_flex_version" >&5
7397 $as_echo "$as_me: using $pgac_flex_version" >&6;}
7398 fi
7399
7400
7401
7402
7403
7404 # Let the user override the search
7405 if test -z "$PERL"; then
7406   # Extract the first word of "perl", so it can be a program name with args.
7407 set dummy perl; ac_word=$2
7408 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7409 $as_echo_n "checking for $ac_word... " >&6; }
7410 if ${ac_cv_path_PERL+:} false; then :
7411   $as_echo_n "(cached) " >&6
7412 else
7413   case $PERL in
7414   [\\/]* | ?:[\\/]*)
7415   ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
7416   ;;
7417   *)
7418   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7419 for as_dir in $PATH
7420 do
7421   IFS=$as_save_IFS
7422   test -z "$as_dir" && as_dir=.
7423     for ac_exec_ext in '' $ac_executable_extensions; do
7424   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7425     ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
7426     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7427     break 2
7428   fi
7429 done
7430   done
7431 IFS=$as_save_IFS
7432
7433   ;;
7434 esac
7435 fi
7436 PERL=$ac_cv_path_PERL
7437 if test -n "$PERL"; then
7438   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
7439 $as_echo "$PERL" >&6; }
7440 else
7441   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7442 $as_echo "no" >&6; }
7443 fi
7444
7445
7446 fi
7447
7448 if test "$PERL"; then
7449   pgac_perl_version=`$PERL -v 2>/dev/null | sed -n 's/This is perl.*v[a-z ]*\([0-9]\.[0-9][0-9.]*\).*$/\1/p'`
7450   { $as_echo "$as_me:${as_lineno-$LINENO}: using perl $pgac_perl_version" >&5
7451 $as_echo "$as_me: using perl $pgac_perl_version" >&6;}
7452   if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \
7453     $AWK '{ if ($1 == 5 && $2 >= 8) exit 1; else exit 0;}'
7454   then
7455     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7456 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
7457 *** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&5
7458 $as_echo "$as_me: WARNING:
7459 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
7460 *** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&2;}
7461     PERL=""
7462   fi
7463 fi
7464
7465 if test -z "$PERL"; then
7466   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
7467 *** Without Perl you will not be able to build PostgreSQL from Git.
7468 *** You can obtain Perl from any CPAN mirror site.
7469 *** (If you are using the official distribution of PostgreSQL then you do not
7470 *** need to worry about this, because the Perl output is pre-generated.)" >&5
7471 $as_echo "$as_me: WARNING:
7472 *** Without Perl you will not be able to build PostgreSQL from Git.
7473 *** You can obtain Perl from any CPAN mirror site.
7474 *** (If you are using the official distribution of PostgreSQL then you do not
7475 *** need to worry about this, because the Perl output is pre-generated.)" >&2;}
7476 fi
7477
7478 if test "$with_perl" = yes; then
7479   if test -z "$PERL"; then
7480     as_fn_error $? "Perl not found" "$LINENO" 5
7481   fi
7482
7483 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl archlibexp" >&5
7484 $as_echo_n "checking for Perl archlibexp... " >&6; }
7485 perl_archlibexp=`$PERL -MConfig -e 'print $Config{archlibexp}'`
7486 test "$PORTNAME" = "win32" && perl_archlibexp=`echo $perl_archlibexp | sed 's,\\\\,/,g'`
7487 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_archlibexp" >&5
7488 $as_echo "$perl_archlibexp" >&6; }
7489 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl privlibexp" >&5
7490 $as_echo_n "checking for Perl privlibexp... " >&6; }
7491 perl_privlibexp=`$PERL -MConfig -e 'print $Config{privlibexp}'`
7492 test "$PORTNAME" = "win32" && perl_privlibexp=`echo $perl_privlibexp | sed 's,\\\\,/,g'`
7493 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_privlibexp" >&5
7494 $as_echo "$perl_privlibexp" >&6; }
7495 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl useshrplib" >&5
7496 $as_echo_n "checking for Perl useshrplib... " >&6; }
7497 perl_useshrplib=`$PERL -MConfig -e 'print $Config{useshrplib}'`
7498 test "$PORTNAME" = "win32" && perl_useshrplib=`echo $perl_useshrplib | sed 's,\\\\,/,g'`
7499 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_useshrplib" >&5
7500 $as_echo "$perl_useshrplib" >&6; }
7501   if test "$perl_useshrplib" != yes && test "$perl_useshrplib" != true; then
7502     as_fn_error $? "cannot build PL/Perl because libperl is not a shared library
7503 You might have to rebuild your Perl installation.  Refer to the
7504 documentation for details.  Use --without-perl to disable building
7505 PL/Perl." "$LINENO" 5
7506   fi
7507
7508 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flags to link embedded Perl" >&5
7509 $as_echo_n "checking for flags to link embedded Perl... " >&6; }
7510 if test "$PORTNAME" = "win32" ; then
7511 perl_lib=`basename $perl_archlibexp/CORE/perl[5-9]*.lib .lib`
7512 test -e "$perl_archlibexp/CORE/$perl_lib.lib" && perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
7513 else
7514 pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
7515 pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
7516 perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e "s/ -arch [-a-zA-Z0-9_]*//g"`
7517 fi
7518 if test -z "$perl_embed_ldflags" ; then
7519         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7520 $as_echo "no" >&6; }
7521         as_fn_error $? "could not determine flags for linking embedded Perl.
7522 This probably means that ExtUtils::Embed or ExtUtils::MakeMaker is not
7523 installed." "$LINENO" 5
7524 else
7525         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perl_embed_ldflags" >&5
7526 $as_echo "$perl_embed_ldflags" >&6; }
7527 fi
7528
7529 fi
7530
7531 if test "$with_python" = yes; then
7532   # Extract the first word of "python", so it can be a program name with args.
7533 set dummy python; ac_word=$2
7534 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7535 $as_echo_n "checking for $ac_word... " >&6; }
7536 if ${ac_cv_path_PYTHON+:} false; then :
7537   $as_echo_n "(cached) " >&6
7538 else
7539   case $PYTHON in
7540   [\\/]* | ?:[\\/]*)
7541   ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
7542   ;;
7543   *)
7544   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7545 for as_dir in $PATH
7546 do
7547   IFS=$as_save_IFS
7548   test -z "$as_dir" && as_dir=.
7549     for ac_exec_ext in '' $ac_executable_extensions; do
7550   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7551     ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
7552     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7553     break 2
7554   fi
7555 done
7556   done
7557 IFS=$as_save_IFS
7558
7559   ;;
7560 esac
7561 fi
7562 PYTHON=$ac_cv_path_PYTHON
7563 if test -n "$PYTHON"; then
7564   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
7565 $as_echo "$PYTHON" >&6; }
7566 else
7567   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7568 $as_echo "no" >&6; }
7569 fi
7570
7571
7572 if test x"$PYTHON" = x""; then
7573   as_fn_error $? "Python not found" "$LINENO" 5
7574 fi
7575
7576
7577 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python distutils module" >&5
7578 $as_echo_n "checking for Python distutils module... " >&6; }
7579 if "${PYTHON}" -c 'import distutils' 2>&5
7580 then
7581     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7582 $as_echo "yes" >&6; }
7583 else
7584     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7585 $as_echo "no" >&6; }
7586     as_fn_error $? "distutils module not found" "$LINENO" 5
7587 fi
7588 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python configuration directory" >&5
7589 $as_echo_n "checking Python configuration directory... " >&6; }
7590 python_majorversion=`${PYTHON} -c "import sys; print(sys.version[0])"`
7591 python_version=`${PYTHON} -c "import sys; print(sys.version[:3])"`
7592 python_configdir=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBPL'))))"`
7593 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $python_configdir" >&5
7594 $as_echo "$python_configdir" >&6; }
7595
7596 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python include directories" >&5
7597 $as_echo_n "checking Python include directories... " >&6; }
7598 python_includespec=`${PYTHON} -c "
7599 import distutils.sysconfig
7600 a = '-I' + distutils.sysconfig.get_python_inc(False)
7601 b = '-I' + distutils.sysconfig.get_python_inc(True)
7602 if a == b:
7603     print(a)
7604 else:
7605     print(a + ' ' + b)"`
7606 if test "$PORTNAME" = win32 ; then
7607     python_includespec=`echo $python_includespec | sed 's,[\],/,g'`
7608 fi
7609 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $python_includespec" >&5
7610 $as_echo "$python_includespec" >&6; }
7611
7612
7613
7614 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link an embedded Python application" >&5
7615 $as_echo_n "checking how to link an embedded Python application... " >&6; }
7616
7617 python_libdir=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBDIR'))))"`
7618 python_ldlibrary=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LDLIBRARY'))))"`
7619
7620 # If LDLIBRARY exists and has a shlib extension, use it verbatim.
7621 ldlibrary=`echo "${python_ldlibrary}" | sed -e 's/\.so$//' -e 's/\.dll$//' -e 's/\.dylib$//' -e 's/\.sl$//'`
7622 if test -e "${python_libdir}/${python_ldlibrary}" -a x"${python_ldlibrary}" != x"${ldlibrary}"
7623 then
7624         ldlibrary=`echo "${ldlibrary}" | sed "s/^lib//"`
7625         found_shlib=1
7626 else
7627         # Otherwise, guess the base name of the shlib.
7628         # LDVERSION was added in Python 3.2, before that use VERSION,
7629         # or failing that, $python_version from _PGAC_CHECK_PYTHON_DIRS.
7630         python_ldversion=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LDVERSION'))))"`
7631         if test x"${python_ldversion}" != x""; then
7632                 ldlibrary="python${python_ldversion}"
7633         else
7634                 python_version_var=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('VERSION'))))"`
7635                 if test x"${python_version_var}" != x""; then
7636                         ldlibrary="python${python_version_var}"
7637                 else
7638                         ldlibrary="python${python_version}"
7639                 fi
7640         fi
7641         # Search for a likely-looking file.
7642         found_shlib=0
7643         for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib
7644         do
7645                 # We don't know the platform DLSUFFIX here, so check 'em all.
7646                 for e in .so .dll .dylib .sl; do
7647                         if test -e "$d/lib${ldlibrary}$e"; then
7648                                 python_libdir="$d"
7649                                 found_shlib=1
7650                                 break 2
7651                         fi
7652                 done
7653         done
7654         # Some platforms (OpenBSD) require us to accept a bare versioned shlib
7655         # (".so.n.n") as well. However, check this only after failing to find
7656         # ".so" anywhere, because yet other platforms (Debian) put the .so
7657         # symlink in a different directory from the underlying versioned shlib.
7658         if test "$found_shlib" != 1; then
7659                 for d in "${python_libdir}" "${python_configdir}" /usr/lib64 /usr/lib
7660                 do
7661                         for f in "$d/lib${ldlibrary}.so."* ; do
7662                                 if test -e "$f"; then
7663                                         python_libdir="$d"
7664                                         found_shlib=1
7665                                         break 2
7666                                 fi
7667                         done
7668                 done
7669         fi
7670         # As usual, Windows has its own ideas.  Possible default library
7671         # locations include c:/Windows/System32 and (for Cygwin) /usr/bin,
7672         # and the "lib" prefix might not be there.
7673         if test "$found_shlib" != 1 -a \( "$PORTNAME" = win32 -o "$PORTNAME" = cygwin \); then
7674                 for d in "${python_libdir}" "${python_configdir}" c:/Windows/System32 /usr/bin
7675                 do
7676                         for f in "$d/lib${ldlibrary}.dll" "$d/${ldlibrary}.dll" ; do
7677                                 if test -e "$f"; then
7678                                         python_libdir="$d"
7679                                         found_shlib=1
7680                                         break 2
7681                                 fi
7682                         done
7683                 done
7684         fi
7685 fi
7686 if test "$found_shlib" != 1; then
7687         as_fn_error $? "could not find shared library for Python
7688 You might have to rebuild your Python installation.  Refer to the
7689 documentation for details.  Use --without-python to disable building
7690 PL/Python." "$LINENO" 5
7691 fi
7692 python_libspec="-L${python_libdir} -l${ldlibrary}"
7693
7694 python_additional_libs=`${PYTHON} -c "import distutils.sysconfig; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','BASEMODLIBS'))))"`
7695
7696 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${python_libspec} ${python_additional_libs}" >&5
7697 $as_echo "${python_libspec} ${python_additional_libs}" >&6; }
7698
7699
7700
7701 fi
7702
7703 if test "$cross_compiling" = yes && test -z "$with_system_tzdata"; then
7704   # Extract the first word of "zic", so it can be a program name with args.
7705 set dummy zic; ac_word=$2
7706 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7707 $as_echo_n "checking for $ac_word... " >&6; }
7708 if ${ac_cv_path_ZIC+:} false; then :
7709   $as_echo_n "(cached) " >&6
7710 else
7711   case $ZIC in
7712   [\\/]* | ?:[\\/]*)
7713   ac_cv_path_ZIC="$ZIC" # Let the user override the test with a path.
7714   ;;
7715   *)
7716   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7717 for as_dir in $PATH
7718 do
7719   IFS=$as_save_IFS
7720   test -z "$as_dir" && as_dir=.
7721     for ac_exec_ext in '' $ac_executable_extensions; do
7722   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7723     ac_cv_path_ZIC="$as_dir/$ac_word$ac_exec_ext"
7724     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7725     break 2
7726   fi
7727 done
7728   done
7729 IFS=$as_save_IFS
7730
7731   ;;
7732 esac
7733 fi
7734 ZIC=$ac_cv_path_ZIC
7735 if test -n "$ZIC"; then
7736   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIC" >&5
7737 $as_echo "$ZIC" >&6; }
7738 else
7739   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7740 $as_echo "no" >&6; }
7741 fi
7742
7743
7744   if test -z "$ZIC"; then
7745     as_fn_error $? "
7746 When cross-compiling, either use the option --with-system-tzdata to use
7747 existing time-zone data, or set the environment variable ZIC to a zic
7748 program to use during the build." "$LINENO" 5
7749   fi
7750 fi
7751
7752 #
7753 # Pthreads
7754 #
7755 # For each platform, we need to know about any special compile and link
7756 # libraries, and whether the normal C function names are thread-safe.
7757 # See the comment at the top of src/port/thread.c for more information.
7758 # WIN32 doesn't need the pthread tests;  it always uses threads
7759 #
7760 # These tests are run before the library-tests, because linking with the
7761 # other libraries can pull in the pthread functions as a side-effect.  We
7762 # want to use the -pthread or similar flags directly, and not rely on
7763 # the side-effects of linking with some other library.
7764 #
7765 # note: We have to use AS_IF here rather than plain if. The AC_CHECK_HEADER
7766 # invocation below is the first one in the script, and autoconf generates
7767 # additional code for that, which must not be inside the if-block. AS_IF
7768 # knows how to do that.
7769 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
7770 $as_echo_n "checking for ANSI C header files... " >&6; }
7771 if ${ac_cv_header_stdc+:} false; then :
7772   $as_echo_n "(cached) " >&6
7773 else
7774   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7775 /* end confdefs.h.  */
7776 #include <stdlib.h>
7777 #include <stdarg.h>
7778 #include <string.h>
7779 #include <float.h>
7780
7781 int
7782 main ()
7783 {
7784
7785   ;
7786   return 0;
7787 }
7788 _ACEOF
7789 if ac_fn_c_try_compile "$LINENO"; then :
7790   ac_cv_header_stdc=yes
7791 else
7792   ac_cv_header_stdc=no
7793 fi
7794 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7795
7796 if test $ac_cv_header_stdc = yes; then
7797   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
7798   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7799 /* end confdefs.h.  */
7800 #include <string.h>
7801
7802 _ACEOF
7803 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7804   $EGREP "memchr" >/dev/null 2>&1; then :
7805
7806 else
7807   ac_cv_header_stdc=no
7808 fi
7809 rm -f conftest*
7810
7811 fi
7812
7813 if test $ac_cv_header_stdc = yes; then
7814   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
7815   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7816 /* end confdefs.h.  */
7817 #include <stdlib.h>
7818
7819 _ACEOF
7820 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7821   $EGREP "free" >/dev/null 2>&1; then :
7822
7823 else
7824   ac_cv_header_stdc=no
7825 fi
7826 rm -f conftest*
7827
7828 fi
7829
7830 if test $ac_cv_header_stdc = yes; then
7831   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
7832   if test "$cross_compiling" = yes; then :
7833   :
7834 else
7835   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7836 /* end confdefs.h.  */
7837 #include <ctype.h>
7838 #include <stdlib.h>
7839 #if ((' ' & 0x0FF) == 0x020)
7840 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
7841 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
7842 #else
7843 # define ISLOWER(c) \
7844                    (('a' <= (c) && (c) <= 'i') \
7845                      || ('j' <= (c) && (c) <= 'r') \
7846                      || ('s' <= (c) && (c) <= 'z'))
7847 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
7848 #endif
7849
7850 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
7851 int
7852 main ()
7853 {
7854   int i;
7855   for (i = 0; i < 256; i++)
7856     if (XOR (islower (i), ISLOWER (i))
7857         || toupper (i) != TOUPPER (i))
7858       return 2;
7859   return 0;
7860 }
7861 _ACEOF
7862 if ac_fn_c_try_run "$LINENO"; then :
7863
7864 else
7865   ac_cv_header_stdc=no
7866 fi
7867 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7868   conftest.$ac_objext conftest.beam conftest.$ac_ext
7869 fi
7870
7871 fi
7872 fi
7873 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
7874 $as_echo "$ac_cv_header_stdc" >&6; }
7875 if test $ac_cv_header_stdc = yes; then
7876
7877 $as_echo "#define STDC_HEADERS 1" >>confdefs.h
7878
7879 fi
7880
7881 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
7882 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
7883                   inttypes.h stdint.h unistd.h
7884 do :
7885   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7886 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
7887 "
7888 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7889   cat >>confdefs.h <<_ACEOF
7890 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7891 _ACEOF
7892
7893 fi
7894
7895 done
7896
7897
7898 if test "$enable_thread_safety" = yes -a "$PORTNAME" != "win32"; then :
7899    # then
7900
7901
7902
7903 ac_ext=c
7904 ac_cpp='$CPP $CPPFLAGS'
7905 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7906 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7907 ac_compiler_gnu=$ac_cv_c_compiler_gnu
7908
7909 ax_pthread_ok=no
7910
7911 # We used to check for pthread.h first, but this fails if pthread.h
7912 # requires special compiler flags (e.g. on Tru64 or Sequent).
7913 # It gets checked for in the link test anyway.
7914
7915 # First of all, check if the user has set any of the PTHREAD_LIBS,
7916 # etcetera environment variables, and if threads linking works using
7917 # them:
7918 if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
7919         save_CFLAGS="$CFLAGS"
7920         CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
7921         save_LIBS="$LIBS"
7922         LIBS="$PTHREAD_LIBS $LIBS"
7923         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5
7924 $as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; }
7925         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7926 /* end confdefs.h.  */
7927
7928 /* Override any GCC internal prototype to avoid an error.
7929    Use char because int might match the return type of a GCC
7930    builtin and then its argument prototype would still apply.  */
7931 #ifdef __cplusplus
7932 extern "C"
7933 #endif
7934 char pthread_join ();
7935 int
7936 main ()
7937 {
7938 return pthread_join ();
7939   ;
7940   return 0;
7941 }
7942 _ACEOF
7943 if ac_fn_c_try_link "$LINENO"; then :
7944   ax_pthread_ok=yes
7945 fi
7946 rm -f core conftest.err conftest.$ac_objext \
7947     conftest$ac_exeext conftest.$ac_ext
7948         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
7949 $as_echo "$ax_pthread_ok" >&6; }
7950         if test x"$ax_pthread_ok" = xno; then
7951                 PTHREAD_LIBS=""
7952                 PTHREAD_CFLAGS=""
7953         fi
7954         LIBS="$save_LIBS"
7955         CFLAGS="$save_CFLAGS"
7956 fi
7957
7958 # We must check for the threads library under a number of different
7959 # names; the ordering is very important because some systems
7960 # (e.g. DEC) have both -lpthread and -lpthreads, where one of the
7961 # libraries is broken (non-POSIX).
7962
7963 # Create a list of thread flags to try.  Items starting with a "-" are
7964 # C compiler flags, and other items are library names, except for "none"
7965 # which indicates that we try without any flags at all, and "pthread-config"
7966 # which is a program returning the flags for the Pth emulation library.
7967
7968 ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mt -mthreads pthread --thread-safe pthread-config"
7969
7970 # The ordering *is* (sometimes) important.  Some notes on the
7971 # individual items follow:
7972
7973 # pthreads: AIX (must check this before -lpthread)
7974 # none: in case threads are in libc; should be tried before -Kthread and
7975 #       other compiler flags to prevent continual compiler warnings
7976 # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
7977 # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
7978 # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
7979 # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
7980 # -pthreads: Solaris/gcc
7981 # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
7982 #      doesn't hurt to check since this sometimes defines pthreads and
7983 #      -D_REENTRANT too), HP C (must be checked before -lpthread, which
7984 #      is present but should not be used directly)
7985 # -mthreads: Mingw32/gcc, Lynx/gcc
7986 # pthread: Linux, etcetera
7987 # --thread-safe: KAI C++
7988 # pthread-config: use pthread-config program (for GNU Pth library)
7989
7990 case $host_os in
7991
7992         hpux*)
7993
7994         # From the cc(1) man page: "[-mt] Sets various -D flags to enable
7995         # multi-threading and also sets -lpthread."
7996
7997         ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
7998         ;;
7999
8000         openedition*)
8001
8002         # IBM z/OS requires a feature-test macro to be defined in order to
8003         # enable POSIX threads at all, so give the user a hint if this is
8004         # not set. (We don't define these ourselves, as they can affect
8005         # other portions of the system API in unpredictable ways.)
8006
8007         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8008 /* end confdefs.h.  */
8009
8010 #            if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
8011              AX_PTHREAD_ZOS_MISSING
8012 #            endif
8013
8014 _ACEOF
8015 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8016   $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then :
8017   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5
8018 $as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;}
8019 fi
8020 rm -f conftest*
8021
8022         ;;
8023
8024         solaris*)
8025
8026         # Newer versions of Solaris require the "-mt -lpthread" pair, and we
8027         # check that first.  On some older versions, libc contains stubbed
8028         # (non-functional) versions of the pthreads routines, so link-based
8029         # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
8030         # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
8031         # a function called by this macro, so we could check for that, but
8032         # who knows whether they'll stub that too in a future libc.)  So
8033         # we'll look for -pthreads and -lpthread shortly thereafter.
8034
8035         ax_pthread_flags="-mt,pthread -pthreads -pthread pthread $ax_pthread_flags"
8036         ;;
8037 esac
8038
8039 # Older versions of Clang only give a warning instead of an error for an
8040 # unrecognized option, unless we specify -Werror. (We throw in some extra
8041 # Clang warning flags for good measure.)
8042
8043 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler needs certain flags to reject unknown flags" >&5
8044 $as_echo_n "checking if compiler needs certain flags to reject unknown flags... " >&6; }
8045 if ${ax_cv_PTHREAD_REJECT_UNKNOWN+:} false; then :
8046   $as_echo_n "(cached) " >&6
8047 else
8048   ax_cv_PTHREAD_REJECT_UNKNOWN=unknown
8049      save_CFLAGS="$CFLAGS"
8050      ax_pthread_extra_flags="-Wunknown-warning-option -Wunused-command-line-argument"
8051      CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wfoobaz -foobaz"
8052      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8053 /* end confdefs.h.  */
8054 int foo(void);
8055 int
8056 main ()
8057 {
8058 foo()
8059   ;
8060   return 0;
8061 }
8062 _ACEOF
8063 if ac_fn_c_try_compile "$LINENO"; then :
8064   ax_cv_PTHREAD_REJECT_UNKNOWN="-Werror $ax_pthread_extra_flags"
8065 else
8066   ax_cv_PTHREAD_REJECT_UNKNOWN=no
8067 fi
8068 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8069      CFLAGS="$save_CFLAGS"
8070
8071 fi
8072 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_REJECT_UNKNOWN" >&5
8073 $as_echo "$ax_cv_PTHREAD_REJECT_UNKNOWN" >&6; }
8074 ax_pthread_extra_flags=
8075 if test "x$ax_cv_PTHREAD_REJECT_UNKNOWN" != "xno"; then :
8076   ax_pthread_extra_flags="$ax_cv_PTHREAD_REJECT_UNKNOWN"
8077 fi
8078
8079 if test x"$ax_pthread_ok" = xno; then
8080 for flag in $ax_pthread_flags; do
8081
8082         case $flag in
8083                 none)
8084                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
8085 $as_echo_n "checking whether pthreads work without any flags... " >&6; }
8086                 ;;
8087
8088                 -mt,pthread)
8089                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5
8090 $as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; }
8091                 PTHREAD_CFLAGS="-mt"
8092                 PTHREAD_LIBS="-lpthread"
8093                 ;;
8094
8095                 -*)
8096                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5
8097 $as_echo_n "checking whether pthreads work with $flag... " >&6; }
8098                 PTHREAD_CFLAGS="$flag"
8099                 ;;
8100
8101                 pthread-config)
8102                 # Extract the first word of "pthread-config", so it can be a program name with args.
8103 set dummy pthread-config; ac_word=$2
8104 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8105 $as_echo_n "checking for $ac_word... " >&6; }
8106 if ${ac_cv_prog_ax_pthread_config+:} false; then :
8107   $as_echo_n "(cached) " >&6
8108 else
8109   if test -n "$ax_pthread_config"; then
8110   ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
8111 else
8112 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8113 for as_dir in $PATH
8114 do
8115   IFS=$as_save_IFS
8116   test -z "$as_dir" && as_dir=.
8117     for ac_exec_ext in '' $ac_executable_extensions; do
8118   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8119     ac_cv_prog_ax_pthread_config="yes"
8120     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8121     break 2
8122   fi
8123 done
8124   done
8125 IFS=$as_save_IFS
8126
8127   test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
8128 fi
8129 fi
8130 ax_pthread_config=$ac_cv_prog_ax_pthread_config
8131 if test -n "$ax_pthread_config"; then
8132   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
8133 $as_echo "$ax_pthread_config" >&6; }
8134 else
8135   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8136 $as_echo "no" >&6; }
8137 fi
8138
8139
8140                 if test x"$ax_pthread_config" = xno; then continue; fi
8141                 PTHREAD_CFLAGS="`pthread-config --cflags`"
8142                 PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
8143                 ;;
8144
8145                 *)
8146                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5
8147 $as_echo_n "checking for the pthreads library -l$flag... " >&6; }
8148                 PTHREAD_LIBS="-l$flag"
8149                 ;;
8150         esac
8151
8152         save_LIBS="$LIBS"
8153         save_CFLAGS="$CFLAGS"
8154         LIBS="$PTHREAD_LIBS $LIBS"
8155         CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
8156
8157         # Check for various functions.  We must include pthread.h,
8158         # since some functions may be macros.  (On the Sequent, we
8159         # need a special flag -Kthread to make this header compile.)
8160         # We check for pthread_join because it is in -lpthread on IRIX
8161         # while pthread_create is in libc.  We check for pthread_attr_init
8162         # due to DEC craziness with -lpthreads.  We check for
8163         # pthread_cleanup_push because it is one of the few pthread
8164         # functions on Solaris that doesn't have a non-functional libc stub.
8165         # We try pthread_create on general principles.
8166         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8167 /* end confdefs.h.  */
8168 #include <pthread.h>
8169                         static void routine(void *a) { a = 0; }
8170                         static void *start_routine(void *a) { return a; }
8171 int
8172 main ()
8173 {
8174 pthread_t th; pthread_attr_t attr;
8175                         pthread_create(&th, 0, start_routine, 0);
8176                         pthread_join(th, 0);
8177                         pthread_attr_init(&attr);
8178                         pthread_cleanup_push(routine, 0);
8179                         pthread_cleanup_pop(0) /* ; */
8180   ;
8181   return 0;
8182 }
8183 _ACEOF
8184 if ac_fn_c_try_link "$LINENO"; then :
8185   ax_pthread_ok=yes
8186 fi
8187 rm -f core conftest.err conftest.$ac_objext \
8188     conftest$ac_exeext conftest.$ac_ext
8189
8190         LIBS="$save_LIBS"
8191         CFLAGS="$save_CFLAGS"
8192
8193         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
8194 $as_echo "$ax_pthread_ok" >&6; }
8195         if test "x$ax_pthread_ok" = xyes; then
8196                 break;
8197         fi
8198
8199         PTHREAD_LIBS=""
8200         PTHREAD_CFLAGS=""
8201 done
8202 fi
8203
8204 # Various other checks:
8205 if test "x$ax_pthread_ok" = xyes; then
8206         save_LIBS="$LIBS"
8207         LIBS="$PTHREAD_LIBS $LIBS"
8208         save_CFLAGS="$CFLAGS"
8209         CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
8210
8211         # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
8212         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
8213 $as_echo_n "checking for joinable pthread attribute... " >&6; }
8214 if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then :
8215   $as_echo_n "(cached) " >&6
8216 else
8217   ax_cv_PTHREAD_JOINABLE_ATTR=unknown
8218              for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
8219                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8220 /* end confdefs.h.  */
8221 #include <pthread.h>
8222 int
8223 main ()
8224 {
8225 int attr = $attr; return attr /* ; */
8226   ;
8227   return 0;
8228 }
8229 _ACEOF
8230 if ac_fn_c_try_link "$LINENO"; then :
8231   ax_cv_PTHREAD_JOINABLE_ATTR=$attr; break
8232 fi
8233 rm -f core conftest.err conftest.$ac_objext \
8234     conftest$ac_exeext conftest.$ac_ext
8235              done
8236
8237 fi
8238 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5
8239 $as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; }
8240         if test "$ax_cv_PTHREAD_JOINABLE_ATTR" != unknown && \
8241                test "$ax_cv_PTHREAD_JOINABLE_ATTR" != PTHREAD_CREATE_JOINABLE; then :
8242
8243 cat >>confdefs.h <<_ACEOF
8244 #define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR
8245 _ACEOF
8246
8247 fi
8248
8249         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5
8250 $as_echo_n "checking if more special flags are required for pthreads... " >&6; }
8251 if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then :
8252   $as_echo_n "(cached) " >&6
8253 else
8254   ax_cv_PTHREAD_SPECIAL_FLAGS=no
8255              ax_pthread_special_flags_added=no
8256              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8257 /* end confdefs.h.  */
8258
8259 #                 if !defined(_REENTRANT) && !defined(_THREAD_SAFE)
8260                   AX_PTHREAD_NEED_SPECIAL_FLAG
8261 #                 endif
8262
8263 _ACEOF
8264 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8265   $EGREP "AX_PTHREAD_NEED_SPECIAL_FLAG" >/dev/null 2>&1; then :
8266   case $host_os in
8267                   aix* | freebsd*)
8268                   ax_cv_PTHREAD_SPECIAL_FLAGS="-D_THREAD_SAFE"
8269                   ;;
8270                   darwin* | hpux* | osf* | solaris*)
8271                   ax_cv_PTHREAD_SPECIAL_FLAGS="-D_REENTRANT"
8272                   ;;
8273                   esac
8274
8275 fi
8276 rm -f conftest*
8277
8278
8279 fi
8280 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5
8281 $as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; }
8282         if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
8283                test "x$ax_pthread_special_flags_added" != "xyes"; then :
8284   PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
8285                ax_pthread_special_flags_added=yes
8286 fi
8287
8288         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5
8289 $as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; }
8290 if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then :
8291   $as_echo_n "(cached) " >&6
8292 else
8293   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8294 /* end confdefs.h.  */
8295 #include <pthread.h>
8296 int
8297 main ()
8298 {
8299 int i = PTHREAD_PRIO_INHERIT;
8300   ;
8301   return 0;
8302 }
8303 _ACEOF
8304 if ac_fn_c_try_link "$LINENO"; then :
8305   ax_cv_PTHREAD_PRIO_INHERIT=yes
8306 else
8307   ax_cv_PTHREAD_PRIO_INHERIT=no
8308 fi
8309 rm -f core conftest.err conftest.$ac_objext \
8310     conftest$ac_exeext conftest.$ac_ext
8311
8312 fi
8313 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5
8314 $as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; }
8315         if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then :
8316
8317 $as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h
8318
8319 fi
8320
8321         LIBS="$save_LIBS"
8322         CFLAGS="$save_CFLAGS"
8323
8324         # More AIX lossage: compile with *_r variant
8325         if test "x$GCC" != xyes; then
8326             case $host_os in
8327                 aix*)
8328                 case "x/$CC" in #(
8329   x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) :
8330     #handle absolute path differently from PATH based program lookup
8331                    case "x$CC" in #(
8332   x/*) :
8333     if as_fn_executable_p ${CC}_r; then :
8334   PTHREAD_CC="${CC}_r"
8335 fi ;; #(
8336   *) :
8337     for ac_prog in ${CC}_r
8338 do
8339   # Extract the first word of "$ac_prog", so it can be a program name with args.
8340 set dummy $ac_prog; ac_word=$2
8341 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8342 $as_echo_n "checking for $ac_word... " >&6; }
8343 if ${ac_cv_prog_PTHREAD_CC+:} false; then :
8344   $as_echo_n "(cached) " >&6
8345 else
8346   if test -n "$PTHREAD_CC"; then
8347   ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
8348 else
8349 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8350 for as_dir in $PATH
8351 do
8352   IFS=$as_save_IFS
8353   test -z "$as_dir" && as_dir=.
8354     for ac_exec_ext in '' $ac_executable_extensions; do
8355   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8356     ac_cv_prog_PTHREAD_CC="$ac_prog"
8357     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8358     break 2
8359   fi
8360 done
8361   done
8362 IFS=$as_save_IFS
8363
8364 fi
8365 fi
8366 PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
8367 if test -n "$PTHREAD_CC"; then
8368   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
8369 $as_echo "$PTHREAD_CC" >&6; }
8370 else
8371   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8372 $as_echo "no" >&6; }
8373 fi
8374
8375
8376   test -n "$PTHREAD_CC" && break
8377 done
8378 test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
8379  ;;
8380 esac ;; #(
8381   *) :
8382      ;;
8383 esac
8384                 ;;
8385             esac
8386         fi
8387 fi
8388
8389 test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
8390
8391
8392
8393
8394
8395 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
8396 if test x"$ax_pthread_ok" = xyes; then
8397
8398 $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
8399
8400         :
8401 else
8402         ax_pthread_ok=no
8403
8404 fi
8405 ac_ext=c
8406 ac_cpp='$CPP $CPPFLAGS'
8407 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8408 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8409 ac_compiler_gnu=$ac_cv_c_compiler_gnu
8410
8411         # set thread flags
8412
8413 # Some platforms use these, so just define them.  They can't hurt if they
8414 # are not supported.  For example, on Solaris -D_POSIX_PTHREAD_SEMANTICS
8415 # enables 5-arg getpwuid_r, among other things.
8416 PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
8417
8418 # Check for *_r functions
8419 _CFLAGS="$CFLAGS"
8420 _LIBS="$LIBS"
8421 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
8422 LIBS="$LIBS $PTHREAD_LIBS"
8423
8424 ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
8425 if test "x$ac_cv_header_pthread_h" = xyes; then :
8426
8427 else
8428   as_fn_error $? "
8429 pthread.h not found;  use --disable-thread-safety to disable thread safety" "$LINENO" 5
8430 fi
8431
8432
8433
8434 for ac_func in strerror_r getpwuid_r gethostbyname_r
8435 do :
8436   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
8437 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
8438 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
8439   cat >>confdefs.h <<_ACEOF
8440 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
8441 _ACEOF
8442
8443 fi
8444 done
8445
8446
8447 # Do test here with the proper thread flags
8448 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns int" >&5
8449 $as_echo_n "checking whether strerror_r returns int... " >&6; }
8450 if ${pgac_cv_func_strerror_r_int+:} false; then :
8451   $as_echo_n "(cached) " >&6
8452 else
8453   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8454 /* end confdefs.h.  */
8455 #include <string.h>
8456 int
8457 main ()
8458 {
8459 #ifndef _AIX
8460 int strerror_r(int, char *, size_t);
8461 #else
8462 /* Older AIX has 'int' for the third argument so we don't test the args. */
8463 int strerror_r();
8464 #endif
8465   ;
8466   return 0;
8467 }
8468 _ACEOF
8469 if ac_fn_c_try_compile "$LINENO"; then :
8470   pgac_cv_func_strerror_r_int=yes
8471 else
8472   pgac_cv_func_strerror_r_int=no
8473 fi
8474 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8475 fi
8476 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_strerror_r_int" >&5
8477 $as_echo "$pgac_cv_func_strerror_r_int" >&6; }
8478 if test x"$pgac_cv_func_strerror_r_int" = xyes ; then
8479
8480 $as_echo "#define STRERROR_R_INT 1" >>confdefs.h
8481
8482 fi
8483
8484
8485 CFLAGS="$_CFLAGS"
8486 LIBS="$_LIBS"
8487
8488
8489 else
8490    # else
8491 # do not use values from template file
8492 PTHREAD_CFLAGS=
8493 PTHREAD_LIBS=
8494
8495 fi # fi
8496
8497
8498
8499
8500
8501 ##
8502 ## Libraries
8503 ##
8504 ## Most libraries are included only if they demonstrably provide a function
8505 ## we need, but libm is an exception: always include it, because there are
8506 ## too many compilers that play cute optimization games that will break
8507 ## probes for standard functions such as pow().
8508 ##
8509
8510 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5
8511 $as_echo_n "checking for main in -lm... " >&6; }
8512 if ${ac_cv_lib_m_main+:} false; then :
8513   $as_echo_n "(cached) " >&6
8514 else
8515   ac_check_lib_save_LIBS=$LIBS
8516 LIBS="-lm  $LIBS"
8517 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8518 /* end confdefs.h.  */
8519
8520
8521 int
8522 main ()
8523 {
8524 return main ();
8525   ;
8526   return 0;
8527 }
8528 _ACEOF
8529 if ac_fn_c_try_link "$LINENO"; then :
8530   ac_cv_lib_m_main=yes
8531 else
8532   ac_cv_lib_m_main=no
8533 fi
8534 rm -f core conftest.err conftest.$ac_objext \
8535     conftest$ac_exeext conftest.$ac_ext
8536 LIBS=$ac_check_lib_save_LIBS
8537 fi
8538 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5
8539 $as_echo "$ac_cv_lib_m_main" >&6; }
8540 if test "x$ac_cv_lib_m_main" = xyes; then :
8541   cat >>confdefs.h <<_ACEOF
8542 #define HAVE_LIBM 1
8543 _ACEOF
8544
8545   LIBS="-lm $LIBS"
8546
8547 fi
8548
8549 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setproctitle" >&5
8550 $as_echo_n "checking for library containing setproctitle... " >&6; }
8551 if ${ac_cv_search_setproctitle+:} false; then :
8552   $as_echo_n "(cached) " >&6
8553 else
8554   ac_func_search_save_LIBS=$LIBS
8555 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8556 /* end confdefs.h.  */
8557
8558 /* Override any GCC internal prototype to avoid an error.
8559    Use char because int might match the return type of a GCC
8560    builtin and then its argument prototype would still apply.  */
8561 #ifdef __cplusplus
8562 extern "C"
8563 #endif
8564 char setproctitle ();
8565 int
8566 main ()
8567 {
8568 return setproctitle ();
8569   ;
8570   return 0;
8571 }
8572 _ACEOF
8573 for ac_lib in '' util; do
8574   if test -z "$ac_lib"; then
8575     ac_res="none required"
8576   else
8577     ac_res=-l$ac_lib
8578     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8579   fi
8580   if ac_fn_c_try_link "$LINENO"; then :
8581   ac_cv_search_setproctitle=$ac_res
8582 fi
8583 rm -f core conftest.err conftest.$ac_objext \
8584     conftest$ac_exeext
8585   if ${ac_cv_search_setproctitle+:} false; then :
8586   break
8587 fi
8588 done
8589 if ${ac_cv_search_setproctitle+:} false; then :
8590
8591 else
8592   ac_cv_search_setproctitle=no
8593 fi
8594 rm conftest.$ac_ext
8595 LIBS=$ac_func_search_save_LIBS
8596 fi
8597 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setproctitle" >&5
8598 $as_echo "$ac_cv_search_setproctitle" >&6; }
8599 ac_res=$ac_cv_search_setproctitle
8600 if test "$ac_res" != no; then :
8601   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8602
8603 fi
8604
8605 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
8606 $as_echo_n "checking for library containing dlopen... " >&6; }
8607 if ${ac_cv_search_dlopen+:} false; then :
8608   $as_echo_n "(cached) " >&6
8609 else
8610   ac_func_search_save_LIBS=$LIBS
8611 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8612 /* end confdefs.h.  */
8613
8614 /* Override any GCC internal prototype to avoid an error.
8615    Use char because int might match the return type of a GCC
8616    builtin and then its argument prototype would still apply.  */
8617 #ifdef __cplusplus
8618 extern "C"
8619 #endif
8620 char dlopen ();
8621 int
8622 main ()
8623 {
8624 return dlopen ();
8625   ;
8626   return 0;
8627 }
8628 _ACEOF
8629 for ac_lib in '' dl; do
8630   if test -z "$ac_lib"; then
8631     ac_res="none required"
8632   else
8633     ac_res=-l$ac_lib
8634     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8635   fi
8636   if ac_fn_c_try_link "$LINENO"; then :
8637   ac_cv_search_dlopen=$ac_res
8638 fi
8639 rm -f core conftest.err conftest.$ac_objext \
8640     conftest$ac_exeext
8641   if ${ac_cv_search_dlopen+:} false; then :
8642   break
8643 fi
8644 done
8645 if ${ac_cv_search_dlopen+:} false; then :
8646
8647 else
8648   ac_cv_search_dlopen=no
8649 fi
8650 rm conftest.$ac_ext
8651 LIBS=$ac_func_search_save_LIBS
8652 fi
8653 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
8654 $as_echo "$ac_cv_search_dlopen" >&6; }
8655 ac_res=$ac_cv_search_dlopen
8656 if test "$ac_res" != no; then :
8657   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8658
8659 fi
8660
8661 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
8662 $as_echo_n "checking for library containing socket... " >&6; }
8663 if ${ac_cv_search_socket+:} false; then :
8664   $as_echo_n "(cached) " >&6
8665 else
8666   ac_func_search_save_LIBS=$LIBS
8667 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8668 /* end confdefs.h.  */
8669
8670 /* Override any GCC internal prototype to avoid an error.
8671    Use char because int might match the return type of a GCC
8672    builtin and then its argument prototype would still apply.  */
8673 #ifdef __cplusplus
8674 extern "C"
8675 #endif
8676 char socket ();
8677 int
8678 main ()
8679 {
8680 return socket ();
8681   ;
8682   return 0;
8683 }
8684 _ACEOF
8685 for ac_lib in '' socket ws2_32; do
8686   if test -z "$ac_lib"; then
8687     ac_res="none required"
8688   else
8689     ac_res=-l$ac_lib
8690     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8691   fi
8692   if ac_fn_c_try_link "$LINENO"; then :
8693   ac_cv_search_socket=$ac_res
8694 fi
8695 rm -f core conftest.err conftest.$ac_objext \
8696     conftest$ac_exeext
8697   if ${ac_cv_search_socket+:} false; then :
8698   break
8699 fi
8700 done
8701 if ${ac_cv_search_socket+:} false; then :
8702
8703 else
8704   ac_cv_search_socket=no
8705 fi
8706 rm conftest.$ac_ext
8707 LIBS=$ac_func_search_save_LIBS
8708 fi
8709 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
8710 $as_echo "$ac_cv_search_socket" >&6; }
8711 ac_res=$ac_cv_search_socket
8712 if test "$ac_res" != no; then :
8713   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8714
8715 fi
8716
8717 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shl_load" >&5
8718 $as_echo_n "checking for library containing shl_load... " >&6; }
8719 if ${ac_cv_search_shl_load+:} false; then :
8720   $as_echo_n "(cached) " >&6
8721 else
8722   ac_func_search_save_LIBS=$LIBS
8723 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8724 /* end confdefs.h.  */
8725
8726 /* Override any GCC internal prototype to avoid an error.
8727    Use char because int might match the return type of a GCC
8728    builtin and then its argument prototype would still apply.  */
8729 #ifdef __cplusplus
8730 extern "C"
8731 #endif
8732 char shl_load ();
8733 int
8734 main ()
8735 {
8736 return shl_load ();
8737   ;
8738   return 0;
8739 }
8740 _ACEOF
8741 for ac_lib in '' dld; do
8742   if test -z "$ac_lib"; then
8743     ac_res="none required"
8744   else
8745     ac_res=-l$ac_lib
8746     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8747   fi
8748   if ac_fn_c_try_link "$LINENO"; then :
8749   ac_cv_search_shl_load=$ac_res
8750 fi
8751 rm -f core conftest.err conftest.$ac_objext \
8752     conftest$ac_exeext
8753   if ${ac_cv_search_shl_load+:} false; then :
8754   break
8755 fi
8756 done
8757 if ${ac_cv_search_shl_load+:} false; then :
8758
8759 else
8760   ac_cv_search_shl_load=no
8761 fi
8762 rm conftest.$ac_ext
8763 LIBS=$ac_func_search_save_LIBS
8764 fi
8765 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shl_load" >&5
8766 $as_echo "$ac_cv_search_shl_load" >&6; }
8767 ac_res=$ac_cv_search_shl_load
8768 if test "$ac_res" != no; then :
8769   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8770
8771 fi
8772
8773 # We only use libld in port/dynloader/aix.c
8774 case $host_os in
8775      aix*)
8776         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldopen" >&5
8777 $as_echo_n "checking for library containing ldopen... " >&6; }
8778 if ${ac_cv_search_ldopen+:} false; then :
8779   $as_echo_n "(cached) " >&6
8780 else
8781   ac_func_search_save_LIBS=$LIBS
8782 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8783 /* end confdefs.h.  */
8784
8785 /* Override any GCC internal prototype to avoid an error.
8786    Use char because int might match the return type of a GCC
8787    builtin and then its argument prototype would still apply.  */
8788 #ifdef __cplusplus
8789 extern "C"
8790 #endif
8791 char ldopen ();
8792 int
8793 main ()
8794 {
8795 return ldopen ();
8796   ;
8797   return 0;
8798 }
8799 _ACEOF
8800 for ac_lib in '' ld; do
8801   if test -z "$ac_lib"; then
8802     ac_res="none required"
8803   else
8804     ac_res=-l$ac_lib
8805     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8806   fi
8807   if ac_fn_c_try_link "$LINENO"; then :
8808   ac_cv_search_ldopen=$ac_res
8809 fi
8810 rm -f core conftest.err conftest.$ac_objext \
8811     conftest$ac_exeext
8812   if ${ac_cv_search_ldopen+:} false; then :
8813   break
8814 fi
8815 done
8816 if ${ac_cv_search_ldopen+:} false; then :
8817
8818 else
8819   ac_cv_search_ldopen=no
8820 fi
8821 rm conftest.$ac_ext
8822 LIBS=$ac_func_search_save_LIBS
8823 fi
8824 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldopen" >&5
8825 $as_echo "$ac_cv_search_ldopen" >&6; }
8826 ac_res=$ac_cv_search_ldopen
8827 if test "$ac_res" != no; then :
8828   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8829
8830 fi
8831
8832         ;;
8833 esac
8834 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getopt_long" >&5
8835 $as_echo_n "checking for library containing getopt_long... " >&6; }
8836 if ${ac_cv_search_getopt_long+:} false; then :
8837   $as_echo_n "(cached) " >&6
8838 else
8839   ac_func_search_save_LIBS=$LIBS
8840 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8841 /* end confdefs.h.  */
8842
8843 /* Override any GCC internal prototype to avoid an error.
8844    Use char because int might match the return type of a GCC
8845    builtin and then its argument prototype would still apply.  */
8846 #ifdef __cplusplus
8847 extern "C"
8848 #endif
8849 char getopt_long ();
8850 int
8851 main ()
8852 {
8853 return getopt_long ();
8854   ;
8855   return 0;
8856 }
8857 _ACEOF
8858 for ac_lib in '' getopt gnugetopt; do
8859   if test -z "$ac_lib"; then
8860     ac_res="none required"
8861   else
8862     ac_res=-l$ac_lib
8863     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8864   fi
8865   if ac_fn_c_try_link "$LINENO"; then :
8866   ac_cv_search_getopt_long=$ac_res
8867 fi
8868 rm -f core conftest.err conftest.$ac_objext \
8869     conftest$ac_exeext
8870   if ${ac_cv_search_getopt_long+:} false; then :
8871   break
8872 fi
8873 done
8874 if ${ac_cv_search_getopt_long+:} false; then :
8875
8876 else
8877   ac_cv_search_getopt_long=no
8878 fi
8879 rm conftest.$ac_ext
8880 LIBS=$ac_func_search_save_LIBS
8881 fi
8882 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getopt_long" >&5
8883 $as_echo "$ac_cv_search_getopt_long" >&6; }
8884 ac_res=$ac_cv_search_getopt_long
8885 if test "$ac_res" != no; then :
8886   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8887
8888 fi
8889
8890 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
8891 $as_echo_n "checking for library containing crypt... " >&6; }
8892 if ${ac_cv_search_crypt+:} false; then :
8893   $as_echo_n "(cached) " >&6
8894 else
8895   ac_func_search_save_LIBS=$LIBS
8896 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8897 /* end confdefs.h.  */
8898
8899 /* Override any GCC internal prototype to avoid an error.
8900    Use char because int might match the return type of a GCC
8901    builtin and then its argument prototype would still apply.  */
8902 #ifdef __cplusplus
8903 extern "C"
8904 #endif
8905 char crypt ();
8906 int
8907 main ()
8908 {
8909 return crypt ();
8910   ;
8911   return 0;
8912 }
8913 _ACEOF
8914 for ac_lib in '' crypt; do
8915   if test -z "$ac_lib"; then
8916     ac_res="none required"
8917   else
8918     ac_res=-l$ac_lib
8919     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8920   fi
8921   if ac_fn_c_try_link "$LINENO"; then :
8922   ac_cv_search_crypt=$ac_res
8923 fi
8924 rm -f core conftest.err conftest.$ac_objext \
8925     conftest$ac_exeext
8926   if ${ac_cv_search_crypt+:} false; then :
8927   break
8928 fi
8929 done
8930 if ${ac_cv_search_crypt+:} false; then :
8931
8932 else
8933   ac_cv_search_crypt=no
8934 fi
8935 rm conftest.$ac_ext
8936 LIBS=$ac_func_search_save_LIBS
8937 fi
8938 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5
8939 $as_echo "$ac_cv_search_crypt" >&6; }
8940 ac_res=$ac_cv_search_crypt
8941 if test "$ac_res" != no; then :
8942   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8943
8944 fi
8945
8946 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5
8947 $as_echo_n "checking for library containing shm_open... " >&6; }
8948 if ${ac_cv_search_shm_open+:} false; then :
8949   $as_echo_n "(cached) " >&6
8950 else
8951   ac_func_search_save_LIBS=$LIBS
8952 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8953 /* end confdefs.h.  */
8954
8955 /* Override any GCC internal prototype to avoid an error.
8956    Use char because int might match the return type of a GCC
8957    builtin and then its argument prototype would still apply.  */
8958 #ifdef __cplusplus
8959 extern "C"
8960 #endif
8961 char shm_open ();
8962 int
8963 main ()
8964 {
8965 return shm_open ();
8966   ;
8967   return 0;
8968 }
8969 _ACEOF
8970 for ac_lib in '' rt; do
8971   if test -z "$ac_lib"; then
8972     ac_res="none required"
8973   else
8974     ac_res=-l$ac_lib
8975     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
8976   fi
8977   if ac_fn_c_try_link "$LINENO"; then :
8978   ac_cv_search_shm_open=$ac_res
8979 fi
8980 rm -f core conftest.err conftest.$ac_objext \
8981     conftest$ac_exeext
8982   if ${ac_cv_search_shm_open+:} false; then :
8983   break
8984 fi
8985 done
8986 if ${ac_cv_search_shm_open+:} false; then :
8987
8988 else
8989   ac_cv_search_shm_open=no
8990 fi
8991 rm conftest.$ac_ext
8992 LIBS=$ac_func_search_save_LIBS
8993 fi
8994 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_open" >&5
8995 $as_echo "$ac_cv_search_shm_open" >&6; }
8996 ac_res=$ac_cv_search_shm_open
8997 if test "$ac_res" != no; then :
8998   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8999
9000 fi
9001
9002 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_unlink" >&5
9003 $as_echo_n "checking for library containing shm_unlink... " >&6; }
9004 if ${ac_cv_search_shm_unlink+:} false; then :
9005   $as_echo_n "(cached) " >&6
9006 else
9007   ac_func_search_save_LIBS=$LIBS
9008 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9009 /* end confdefs.h.  */
9010
9011 /* Override any GCC internal prototype to avoid an error.
9012    Use char because int might match the return type of a GCC
9013    builtin and then its argument prototype would still apply.  */
9014 #ifdef __cplusplus
9015 extern "C"
9016 #endif
9017 char shm_unlink ();
9018 int
9019 main ()
9020 {
9021 return shm_unlink ();
9022   ;
9023   return 0;
9024 }
9025 _ACEOF
9026 for ac_lib in '' rt; do
9027   if test -z "$ac_lib"; then
9028     ac_res="none required"
9029   else
9030     ac_res=-l$ac_lib
9031     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9032   fi
9033   if ac_fn_c_try_link "$LINENO"; then :
9034   ac_cv_search_shm_unlink=$ac_res
9035 fi
9036 rm -f core conftest.err conftest.$ac_objext \
9037     conftest$ac_exeext
9038   if ${ac_cv_search_shm_unlink+:} false; then :
9039   break
9040 fi
9041 done
9042 if ${ac_cv_search_shm_unlink+:} false; then :
9043
9044 else
9045   ac_cv_search_shm_unlink=no
9046 fi
9047 rm conftest.$ac_ext
9048 LIBS=$ac_func_search_save_LIBS
9049 fi
9050 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_unlink" >&5
9051 $as_echo "$ac_cv_search_shm_unlink" >&6; }
9052 ac_res=$ac_cv_search_shm_unlink
9053 if test "$ac_res" != no; then :
9054   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9055
9056 fi
9057
9058 # Solaris:
9059 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fdatasync" >&5
9060 $as_echo_n "checking for library containing fdatasync... " >&6; }
9061 if ${ac_cv_search_fdatasync+:} false; then :
9062   $as_echo_n "(cached) " >&6
9063 else
9064   ac_func_search_save_LIBS=$LIBS
9065 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9066 /* end confdefs.h.  */
9067
9068 /* Override any GCC internal prototype to avoid an error.
9069    Use char because int might match the return type of a GCC
9070    builtin and then its argument prototype would still apply.  */
9071 #ifdef __cplusplus
9072 extern "C"
9073 #endif
9074 char fdatasync ();
9075 int
9076 main ()
9077 {
9078 return fdatasync ();
9079   ;
9080   return 0;
9081 }
9082 _ACEOF
9083 for ac_lib in '' rt posix4; do
9084   if test -z "$ac_lib"; then
9085     ac_res="none required"
9086   else
9087     ac_res=-l$ac_lib
9088     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9089   fi
9090   if ac_fn_c_try_link "$LINENO"; then :
9091   ac_cv_search_fdatasync=$ac_res
9092 fi
9093 rm -f core conftest.err conftest.$ac_objext \
9094     conftest$ac_exeext
9095   if ${ac_cv_search_fdatasync+:} false; then :
9096   break
9097 fi
9098 done
9099 if ${ac_cv_search_fdatasync+:} false; then :
9100
9101 else
9102   ac_cv_search_fdatasync=no
9103 fi
9104 rm conftest.$ac_ext
9105 LIBS=$ac_func_search_save_LIBS
9106 fi
9107 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fdatasync" >&5
9108 $as_echo "$ac_cv_search_fdatasync" >&6; }
9109 ac_res=$ac_cv_search_fdatasync
9110 if test "$ac_res" != no; then :
9111   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9112
9113 fi
9114
9115 # Required for thread_test.c on Solaris
9116 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_yield" >&5
9117 $as_echo_n "checking for library containing sched_yield... " >&6; }
9118 if ${ac_cv_search_sched_yield+:} false; then :
9119   $as_echo_n "(cached) " >&6
9120 else
9121   ac_func_search_save_LIBS=$LIBS
9122 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9123 /* end confdefs.h.  */
9124
9125 /* Override any GCC internal prototype to avoid an error.
9126    Use char because int might match the return type of a GCC
9127    builtin and then its argument prototype would still apply.  */
9128 #ifdef __cplusplus
9129 extern "C"
9130 #endif
9131 char sched_yield ();
9132 int
9133 main ()
9134 {
9135 return sched_yield ();
9136   ;
9137   return 0;
9138 }
9139 _ACEOF
9140 for ac_lib in '' rt; do
9141   if test -z "$ac_lib"; then
9142     ac_res="none required"
9143   else
9144     ac_res=-l$ac_lib
9145     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9146   fi
9147   if ac_fn_c_try_link "$LINENO"; then :
9148   ac_cv_search_sched_yield=$ac_res
9149 fi
9150 rm -f core conftest.err conftest.$ac_objext \
9151     conftest$ac_exeext
9152   if ${ac_cv_search_sched_yield+:} false; then :
9153   break
9154 fi
9155 done
9156 if ${ac_cv_search_sched_yield+:} false; then :
9157
9158 else
9159   ac_cv_search_sched_yield=no
9160 fi
9161 rm conftest.$ac_ext
9162 LIBS=$ac_func_search_save_LIBS
9163 fi
9164 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_yield" >&5
9165 $as_echo "$ac_cv_search_sched_yield" >&6; }
9166 ac_res=$ac_cv_search_sched_yield
9167 if test "$ac_res" != no; then :
9168   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9169
9170 fi
9171
9172 # Required for thread_test.c on Solaris 2.5:
9173 # Other ports use it too (HP-UX) so test unconditionally
9174 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname_r" >&5
9175 $as_echo_n "checking for library containing gethostbyname_r... " >&6; }
9176 if ${ac_cv_search_gethostbyname_r+:} false; then :
9177   $as_echo_n "(cached) " >&6
9178 else
9179   ac_func_search_save_LIBS=$LIBS
9180 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9181 /* end confdefs.h.  */
9182
9183 /* Override any GCC internal prototype to avoid an error.
9184    Use char because int might match the return type of a GCC
9185    builtin and then its argument prototype would still apply.  */
9186 #ifdef __cplusplus
9187 extern "C"
9188 #endif
9189 char gethostbyname_r ();
9190 int
9191 main ()
9192 {
9193 return gethostbyname_r ();
9194   ;
9195   return 0;
9196 }
9197 _ACEOF
9198 for ac_lib in '' nsl; do
9199   if test -z "$ac_lib"; then
9200     ac_res="none required"
9201   else
9202     ac_res=-l$ac_lib
9203     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9204   fi
9205   if ac_fn_c_try_link "$LINENO"; then :
9206   ac_cv_search_gethostbyname_r=$ac_res
9207 fi
9208 rm -f core conftest.err conftest.$ac_objext \
9209     conftest$ac_exeext
9210   if ${ac_cv_search_gethostbyname_r+:} false; then :
9211   break
9212 fi
9213 done
9214 if ${ac_cv_search_gethostbyname_r+:} false; then :
9215
9216 else
9217   ac_cv_search_gethostbyname_r=no
9218 fi
9219 rm conftest.$ac_ext
9220 LIBS=$ac_func_search_save_LIBS
9221 fi
9222 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname_r" >&5
9223 $as_echo "$ac_cv_search_gethostbyname_r" >&6; }
9224 ac_res=$ac_cv_search_gethostbyname_r
9225 if test "$ac_res" != no; then :
9226   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9227
9228 fi
9229
9230 # Cygwin:
9231 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shmget" >&5
9232 $as_echo_n "checking for library containing shmget... " >&6; }
9233 if ${ac_cv_search_shmget+:} false; then :
9234   $as_echo_n "(cached) " >&6
9235 else
9236   ac_func_search_save_LIBS=$LIBS
9237 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9238 /* end confdefs.h.  */
9239
9240 /* Override any GCC internal prototype to avoid an error.
9241    Use char because int might match the return type of a GCC
9242    builtin and then its argument prototype would still apply.  */
9243 #ifdef __cplusplus
9244 extern "C"
9245 #endif
9246 char shmget ();
9247 int
9248 main ()
9249 {
9250 return shmget ();
9251   ;
9252   return 0;
9253 }
9254 _ACEOF
9255 for ac_lib in '' cygipc; do
9256   if test -z "$ac_lib"; then
9257     ac_res="none required"
9258   else
9259     ac_res=-l$ac_lib
9260     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9261   fi
9262   if ac_fn_c_try_link "$LINENO"; then :
9263   ac_cv_search_shmget=$ac_res
9264 fi
9265 rm -f core conftest.err conftest.$ac_objext \
9266     conftest$ac_exeext
9267   if ${ac_cv_search_shmget+:} false; then :
9268   break
9269 fi
9270 done
9271 if ${ac_cv_search_shmget+:} false; then :
9272
9273 else
9274   ac_cv_search_shmget=no
9275 fi
9276 rm conftest.$ac_ext
9277 LIBS=$ac_func_search_save_LIBS
9278 fi
9279 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shmget" >&5
9280 $as_echo "$ac_cv_search_shmget" >&6; }
9281 ac_res=$ac_cv_search_shmget
9282 if test "$ac_res" != no; then :
9283   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9284
9285 fi
9286
9287
9288 if test "$with_readline" = yes; then
9289
9290
9291 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing readline" >&5
9292 $as_echo_n "checking for library containing readline... " >&6; }
9293 if ${pgac_cv_check_readline+:} false; then :
9294   $as_echo_n "(cached) " >&6
9295 else
9296   pgac_cv_check_readline=no
9297 pgac_save_LIBS=$LIBS
9298 if test x"$with_libedit_preferred" != x"yes"
9299 then    READLINE_ORDER="-lreadline -ledit"
9300 else    READLINE_ORDER="-ledit -lreadline"
9301 fi
9302 for pgac_rllib in $READLINE_ORDER ; do
9303   for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
9304     LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS"
9305     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9306 /* end confdefs.h.  */
9307
9308 /* Override any GCC internal prototype to avoid an error.
9309    Use char because int might match the return type of a GCC
9310    builtin and then its argument prototype would still apply.  */
9311 #ifdef __cplusplus
9312 extern "C"
9313 #endif
9314 char readline ();
9315 int
9316 main ()
9317 {
9318 return readline ();
9319   ;
9320   return 0;
9321 }
9322 _ACEOF
9323 if ac_fn_c_try_link "$LINENO"; then :
9324
9325       # Older NetBSD, OpenBSD, and Irix have a broken linker that does not
9326       # recognize dependent libraries; assume curses is needed if we didn't
9327       # find any dependency.
9328       case $host_os in
9329         netbsd* | openbsd* | irix*)
9330           if test x"$pgac_lib" = x"" ; then
9331             pgac_lib=" -lcurses"
9332           fi ;;
9333       esac
9334
9335       pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"
9336       break
9337
9338 fi
9339 rm -f core conftest.err conftest.$ac_objext \
9340     conftest$ac_exeext conftest.$ac_ext
9341   done
9342   if test "$pgac_cv_check_readline" != no ; then
9343     break
9344   fi
9345 done
9346 LIBS=$pgac_save_LIBS
9347
9348 fi
9349 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_readline" >&5
9350 $as_echo "$pgac_cv_check_readline" >&6; }
9351 if test "$pgac_cv_check_readline" != no ; then
9352   LIBS="$pgac_cv_check_readline $LIBS"
9353
9354 $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
9355
9356 fi
9357
9358
9359   if test x"$pgac_cv_check_readline" = x"no"; then
9360     as_fn_error $? "readline library not found
9361 If you have readline already installed, see config.log for details on the
9362 failure.  It is possible the compiler isn't looking in the proper directory.
9363 Use --without-readline to disable readline support." "$LINENO" 5
9364   fi
9365 fi
9366
9367 if test "$with_zlib" = yes; then
9368   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5
9369 $as_echo_n "checking for inflate in -lz... " >&6; }
9370 if ${ac_cv_lib_z_inflate+:} false; then :
9371   $as_echo_n "(cached) " >&6
9372 else
9373   ac_check_lib_save_LIBS=$LIBS
9374 LIBS="-lz  $LIBS"
9375 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9376 /* end confdefs.h.  */
9377
9378 /* Override any GCC internal prototype to avoid an error.
9379    Use char because int might match the return type of a GCC
9380    builtin and then its argument prototype would still apply.  */
9381 #ifdef __cplusplus
9382 extern "C"
9383 #endif
9384 char inflate ();
9385 int
9386 main ()
9387 {
9388 return inflate ();
9389   ;
9390   return 0;
9391 }
9392 _ACEOF
9393 if ac_fn_c_try_link "$LINENO"; then :
9394   ac_cv_lib_z_inflate=yes
9395 else
9396   ac_cv_lib_z_inflate=no
9397 fi
9398 rm -f core conftest.err conftest.$ac_objext \
9399     conftest$ac_exeext conftest.$ac_ext
9400 LIBS=$ac_check_lib_save_LIBS
9401 fi
9402 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5
9403 $as_echo "$ac_cv_lib_z_inflate" >&6; }
9404 if test "x$ac_cv_lib_z_inflate" = xyes; then :
9405   cat >>confdefs.h <<_ACEOF
9406 #define HAVE_LIBZ 1
9407 _ACEOF
9408
9409   LIBS="-lz $LIBS"
9410
9411 else
9412   as_fn_error $? "zlib library not found
9413 If you have zlib already installed, see config.log for details on the
9414 failure.  It is possible the compiler isn't looking in the proper directory.
9415 Use --without-zlib to disable zlib support." "$LINENO" 5
9416 fi
9417
9418 fi
9419
9420 if test "$enable_spinlocks" = yes; then
9421
9422 $as_echo "#define HAVE_SPINLOCKS 1" >>confdefs.h
9423
9424 else
9425   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9426 *** Not using spinlocks will cause poor performance." >&5
9427 $as_echo "$as_me: WARNING:
9428 *** Not using spinlocks will cause poor performance." >&2;}
9429 fi
9430
9431 if test "$enable_atomics" = yes; then
9432
9433 $as_echo "#define HAVE_ATOMICS 1" >>confdefs.h
9434
9435 else
9436   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
9437 *** Not using atomic operations will cause poor performance." >&5
9438 $as_echo "$as_me: WARNING:
9439 *** Not using atomic operations will cause poor performance." >&2;}
9440 fi
9441
9442 if test "$with_gssapi" = yes ; then
9443   if test "$PORTNAME" != "win32"; then
9444     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gss_init_sec_context" >&5
9445 $as_echo_n "checking for library containing gss_init_sec_context... " >&6; }
9446 if ${ac_cv_search_gss_init_sec_context+:} false; then :
9447   $as_echo_n "(cached) " >&6
9448 else
9449   ac_func_search_save_LIBS=$LIBS
9450 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9451 /* end confdefs.h.  */
9452
9453 /* Override any GCC internal prototype to avoid an error.
9454    Use char because int might match the return type of a GCC
9455    builtin and then its argument prototype would still apply.  */
9456 #ifdef __cplusplus
9457 extern "C"
9458 #endif
9459 char gss_init_sec_context ();
9460 int
9461 main ()
9462 {
9463 return gss_init_sec_context ();
9464   ;
9465   return 0;
9466 }
9467 _ACEOF
9468 for ac_lib in '' gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'; do
9469   if test -z "$ac_lib"; then
9470     ac_res="none required"
9471   else
9472     ac_res=-l$ac_lib
9473     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9474   fi
9475   if ac_fn_c_try_link "$LINENO"; then :
9476   ac_cv_search_gss_init_sec_context=$ac_res
9477 fi
9478 rm -f core conftest.err conftest.$ac_objext \
9479     conftest$ac_exeext
9480   if ${ac_cv_search_gss_init_sec_context+:} false; then :
9481   break
9482 fi
9483 done
9484 if ${ac_cv_search_gss_init_sec_context+:} false; then :
9485
9486 else
9487   ac_cv_search_gss_init_sec_context=no
9488 fi
9489 rm conftest.$ac_ext
9490 LIBS=$ac_func_search_save_LIBS
9491 fi
9492 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gss_init_sec_context" >&5
9493 $as_echo "$ac_cv_search_gss_init_sec_context" >&6; }
9494 ac_res=$ac_cv_search_gss_init_sec_context
9495 if test "$ac_res" != no; then :
9496   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9497
9498 else
9499   as_fn_error $? "could not find function 'gss_init_sec_context' required for GSSAPI" "$LINENO" 5
9500 fi
9501
9502   else
9503     LIBS="$LIBS -lgssapi32"
9504   fi
9505 fi
9506
9507 if test "$with_openssl" = yes ; then
9508     if test "$PORTNAME" != "win32"; then
9509      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5
9510 $as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; }
9511 if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then :
9512   $as_echo_n "(cached) " >&6
9513 else
9514   ac_check_lib_save_LIBS=$LIBS
9515 LIBS="-lcrypto  $LIBS"
9516 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9517 /* end confdefs.h.  */
9518
9519 /* Override any GCC internal prototype to avoid an error.
9520    Use char because int might match the return type of a GCC
9521    builtin and then its argument prototype would still apply.  */
9522 #ifdef __cplusplus
9523 extern "C"
9524 #endif
9525 char CRYPTO_new_ex_data ();
9526 int
9527 main ()
9528 {
9529 return CRYPTO_new_ex_data ();
9530   ;
9531   return 0;
9532 }
9533 _ACEOF
9534 if ac_fn_c_try_link "$LINENO"; then :
9535   ac_cv_lib_crypto_CRYPTO_new_ex_data=yes
9536 else
9537   ac_cv_lib_crypto_CRYPTO_new_ex_data=no
9538 fi
9539 rm -f core conftest.err conftest.$ac_objext \
9540     conftest$ac_exeext conftest.$ac_ext
9541 LIBS=$ac_check_lib_save_LIBS
9542 fi
9543 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5
9544 $as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; }
9545 if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then :
9546   cat >>confdefs.h <<_ACEOF
9547 #define HAVE_LIBCRYPTO 1
9548 _ACEOF
9549
9550   LIBS="-lcrypto $LIBS"
9551
9552 else
9553   as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5
9554 fi
9555
9556      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl" >&5
9557 $as_echo_n "checking for SSL_new in -lssl... " >&6; }
9558 if ${ac_cv_lib_ssl_SSL_new+:} false; then :
9559   $as_echo_n "(cached) " >&6
9560 else
9561   ac_check_lib_save_LIBS=$LIBS
9562 LIBS="-lssl  $LIBS"
9563 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9564 /* end confdefs.h.  */
9565
9566 /* Override any GCC internal prototype to avoid an error.
9567    Use char because int might match the return type of a GCC
9568    builtin and then its argument prototype would still apply.  */
9569 #ifdef __cplusplus
9570 extern "C"
9571 #endif
9572 char SSL_new ();
9573 int
9574 main ()
9575 {
9576 return SSL_new ();
9577   ;
9578   return 0;
9579 }
9580 _ACEOF
9581 if ac_fn_c_try_link "$LINENO"; then :
9582   ac_cv_lib_ssl_SSL_new=yes
9583 else
9584   ac_cv_lib_ssl_SSL_new=no
9585 fi
9586 rm -f core conftest.err conftest.$ac_objext \
9587     conftest$ac_exeext conftest.$ac_ext
9588 LIBS=$ac_check_lib_save_LIBS
9589 fi
9590 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_new" >&5
9591 $as_echo "$ac_cv_lib_ssl_SSL_new" >&6; }
9592 if test "x$ac_cv_lib_ssl_SSL_new" = xyes; then :
9593   cat >>confdefs.h <<_ACEOF
9594 #define HAVE_LIBSSL 1
9595 _ACEOF
9596
9597   LIBS="-lssl $LIBS"
9598
9599 else
9600   as_fn_error $? "library 'ssl' is required for OpenSSL" "$LINENO" 5
9601 fi
9602
9603   else
9604      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing CRYPTO_new_ex_data" >&5
9605 $as_echo_n "checking for library containing CRYPTO_new_ex_data... " >&6; }
9606 if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
9607   $as_echo_n "(cached) " >&6
9608 else
9609   ac_func_search_save_LIBS=$LIBS
9610 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9611 /* end confdefs.h.  */
9612
9613 /* Override any GCC internal prototype to avoid an error.
9614    Use char because int might match the return type of a GCC
9615    builtin and then its argument prototype would still apply.  */
9616 #ifdef __cplusplus
9617 extern "C"
9618 #endif
9619 char CRYPTO_new_ex_data ();
9620 int
9621 main ()
9622 {
9623 return CRYPTO_new_ex_data ();
9624   ;
9625   return 0;
9626 }
9627 _ACEOF
9628 for ac_lib in '' eay32 crypto; do
9629   if test -z "$ac_lib"; then
9630     ac_res="none required"
9631   else
9632     ac_res=-l$ac_lib
9633     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9634   fi
9635   if ac_fn_c_try_link "$LINENO"; then :
9636   ac_cv_search_CRYPTO_new_ex_data=$ac_res
9637 fi
9638 rm -f core conftest.err conftest.$ac_objext \
9639     conftest$ac_exeext
9640   if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
9641   break
9642 fi
9643 done
9644 if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
9645
9646 else
9647   ac_cv_search_CRYPTO_new_ex_data=no
9648 fi
9649 rm conftest.$ac_ext
9650 LIBS=$ac_func_search_save_LIBS
9651 fi
9652 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_CRYPTO_new_ex_data" >&5
9653 $as_echo "$ac_cv_search_CRYPTO_new_ex_data" >&6; }
9654 ac_res=$ac_cv_search_CRYPTO_new_ex_data
9655 if test "$ac_res" != no; then :
9656   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9657
9658 else
9659   as_fn_error $? "library 'eay32' or 'crypto' is required for OpenSSL" "$LINENO" 5
9660 fi
9661
9662      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_new" >&5
9663 $as_echo_n "checking for library containing SSL_new... " >&6; }
9664 if ${ac_cv_search_SSL_new+:} false; then :
9665   $as_echo_n "(cached) " >&6
9666 else
9667   ac_func_search_save_LIBS=$LIBS
9668 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9669 /* end confdefs.h.  */
9670
9671 /* Override any GCC internal prototype to avoid an error.
9672    Use char because int might match the return type of a GCC
9673    builtin and then its argument prototype would still apply.  */
9674 #ifdef __cplusplus
9675 extern "C"
9676 #endif
9677 char SSL_new ();
9678 int
9679 main ()
9680 {
9681 return SSL_new ();
9682   ;
9683   return 0;
9684 }
9685 _ACEOF
9686 for ac_lib in '' ssleay32 ssl; do
9687   if test -z "$ac_lib"; then
9688     ac_res="none required"
9689   else
9690     ac_res=-l$ac_lib
9691     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9692   fi
9693   if ac_fn_c_try_link "$LINENO"; then :
9694   ac_cv_search_SSL_new=$ac_res
9695 fi
9696 rm -f core conftest.err conftest.$ac_objext \
9697     conftest$ac_exeext
9698   if ${ac_cv_search_SSL_new+:} false; then :
9699   break
9700 fi
9701 done
9702 if ${ac_cv_search_SSL_new+:} false; then :
9703
9704 else
9705   ac_cv_search_SSL_new=no
9706 fi
9707 rm conftest.$ac_ext
9708 LIBS=$ac_func_search_save_LIBS
9709 fi
9710 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SSL_new" >&5
9711 $as_echo "$ac_cv_search_SSL_new" >&6; }
9712 ac_res=$ac_cv_search_SSL_new
9713 if test "$ac_res" != no; then :
9714   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9715
9716 else
9717   as_fn_error $? "library 'ssleay32' or 'ssl' is required for OpenSSL" "$LINENO" 5
9718 fi
9719
9720   fi
9721   for ac_func in SSL_get_current_compression
9722 do :
9723   ac_fn_c_check_func "$LINENO" "SSL_get_current_compression" "ac_cv_func_SSL_get_current_compression"
9724 if test "x$ac_cv_func_SSL_get_current_compression" = xyes; then :
9725   cat >>confdefs.h <<_ACEOF
9726 #define HAVE_SSL_GET_CURRENT_COMPRESSION 1
9727 _ACEOF
9728
9729 fi
9730 done
9731
9732   # Functions introduced in OpenSSL 1.1.0. We used to check for
9733   # OPENSSL_VERSION_NUMBER, but that didn't work with 1.1.0, because LibreSSL
9734   # defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it
9735   # doesn't have these OpenSSL 1.1.0 functions. So check for individual
9736   # functions.
9737   for ac_func in OPENSSL_init_ssl BIO_get_data BIO_meth_new ASN1_STRING_get0_data RAND_OpenSSL
9738 do :
9739   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
9740 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
9741 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
9742   cat >>confdefs.h <<_ACEOF
9743 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
9744 _ACEOF
9745
9746 fi
9747 done
9748
9749   # OpenSSL versions before 1.1.0 required setting callback functions, for
9750   # thread-safety. In 1.1.0, it's no longer required, and CRYPTO_lock()
9751   # function was removed.
9752   for ac_func in CRYPTO_lock
9753 do :
9754   ac_fn_c_check_func "$LINENO" "CRYPTO_lock" "ac_cv_func_CRYPTO_lock"
9755 if test "x$ac_cv_func_CRYPTO_lock" = xyes; then :
9756   cat >>confdefs.h <<_ACEOF
9757 #define HAVE_CRYPTO_LOCK 1
9758 _ACEOF
9759
9760 fi
9761 done
9762
9763 fi
9764
9765 if test "$with_pam" = yes ; then
9766   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5
9767 $as_echo_n "checking for pam_start in -lpam... " >&6; }
9768 if ${ac_cv_lib_pam_pam_start+:} false; then :
9769   $as_echo_n "(cached) " >&6
9770 else
9771   ac_check_lib_save_LIBS=$LIBS
9772 LIBS="-lpam  $LIBS"
9773 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9774 /* end confdefs.h.  */
9775
9776 /* Override any GCC internal prototype to avoid an error.
9777    Use char because int might match the return type of a GCC
9778    builtin and then its argument prototype would still apply.  */
9779 #ifdef __cplusplus
9780 extern "C"
9781 #endif
9782 char pam_start ();
9783 int
9784 main ()
9785 {
9786 return pam_start ();
9787   ;
9788   return 0;
9789 }
9790 _ACEOF
9791 if ac_fn_c_try_link "$LINENO"; then :
9792   ac_cv_lib_pam_pam_start=yes
9793 else
9794   ac_cv_lib_pam_pam_start=no
9795 fi
9796 rm -f core conftest.err conftest.$ac_objext \
9797     conftest$ac_exeext conftest.$ac_ext
9798 LIBS=$ac_check_lib_save_LIBS
9799 fi
9800 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5
9801 $as_echo "$ac_cv_lib_pam_pam_start" >&6; }
9802 if test "x$ac_cv_lib_pam_pam_start" = xyes; then :
9803   cat >>confdefs.h <<_ACEOF
9804 #define HAVE_LIBPAM 1
9805 _ACEOF
9806
9807   LIBS="-lpam $LIBS"
9808
9809 else
9810   as_fn_error $? "library 'pam' is required for PAM" "$LINENO" 5
9811 fi
9812
9813 fi
9814
9815 if test "$with_libxml" = yes ; then
9816   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlSaveToBuffer in -lxml2" >&5
9817 $as_echo_n "checking for xmlSaveToBuffer in -lxml2... " >&6; }
9818 if ${ac_cv_lib_xml2_xmlSaveToBuffer+:} false; then :
9819   $as_echo_n "(cached) " >&6
9820 else
9821   ac_check_lib_save_LIBS=$LIBS
9822 LIBS="-lxml2  $LIBS"
9823 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9824 /* end confdefs.h.  */
9825
9826 /* Override any GCC internal prototype to avoid an error.
9827    Use char because int might match the return type of a GCC
9828    builtin and then its argument prototype would still apply.  */
9829 #ifdef __cplusplus
9830 extern "C"
9831 #endif
9832 char xmlSaveToBuffer ();
9833 int
9834 main ()
9835 {
9836 return xmlSaveToBuffer ();
9837   ;
9838   return 0;
9839 }
9840 _ACEOF
9841 if ac_fn_c_try_link "$LINENO"; then :
9842   ac_cv_lib_xml2_xmlSaveToBuffer=yes
9843 else
9844   ac_cv_lib_xml2_xmlSaveToBuffer=no
9845 fi
9846 rm -f core conftest.err conftest.$ac_objext \
9847     conftest$ac_exeext conftest.$ac_ext
9848 LIBS=$ac_check_lib_save_LIBS
9849 fi
9850 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlSaveToBuffer" >&5
9851 $as_echo "$ac_cv_lib_xml2_xmlSaveToBuffer" >&6; }
9852 if test "x$ac_cv_lib_xml2_xmlSaveToBuffer" = xyes; then :
9853   cat >>confdefs.h <<_ACEOF
9854 #define HAVE_LIBXML2 1
9855 _ACEOF
9856
9857   LIBS="-lxml2 $LIBS"
9858
9859 else
9860   as_fn_error $? "library 'xml2' (version >= 2.6.23) is required for XML support" "$LINENO" 5
9861 fi
9862
9863 fi
9864
9865 if test "$with_libxslt" = yes ; then
9866   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xsltCleanupGlobals in -lxslt" >&5
9867 $as_echo_n "checking for xsltCleanupGlobals in -lxslt... " >&6; }
9868 if ${ac_cv_lib_xslt_xsltCleanupGlobals+:} false; then :
9869   $as_echo_n "(cached) " >&6
9870 else
9871   ac_check_lib_save_LIBS=$LIBS
9872 LIBS="-lxslt  $LIBS"
9873 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9874 /* end confdefs.h.  */
9875
9876 /* Override any GCC internal prototype to avoid an error.
9877    Use char because int might match the return type of a GCC
9878    builtin and then its argument prototype would still apply.  */
9879 #ifdef __cplusplus
9880 extern "C"
9881 #endif
9882 char xsltCleanupGlobals ();
9883 int
9884 main ()
9885 {
9886 return xsltCleanupGlobals ();
9887   ;
9888   return 0;
9889 }
9890 _ACEOF
9891 if ac_fn_c_try_link "$LINENO"; then :
9892   ac_cv_lib_xslt_xsltCleanupGlobals=yes
9893 else
9894   ac_cv_lib_xslt_xsltCleanupGlobals=no
9895 fi
9896 rm -f core conftest.err conftest.$ac_objext \
9897     conftest$ac_exeext conftest.$ac_ext
9898 LIBS=$ac_check_lib_save_LIBS
9899 fi
9900 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xslt_xsltCleanupGlobals" >&5
9901 $as_echo "$ac_cv_lib_xslt_xsltCleanupGlobals" >&6; }
9902 if test "x$ac_cv_lib_xslt_xsltCleanupGlobals" = xyes; then :
9903   cat >>confdefs.h <<_ACEOF
9904 #define HAVE_LIBXSLT 1
9905 _ACEOF
9906
9907   LIBS="-lxslt $LIBS"
9908
9909 else
9910   as_fn_error $? "library 'xslt' is required for XSLT support" "$LINENO" 5
9911 fi
9912
9913 fi
9914
9915 # Note: We can test for libldap_r only after we know PTHREAD_LIBS
9916 if test "$with_ldap" = yes ; then
9917   _LIBS="$LIBS"
9918   if test "$PORTNAME" != "win32"; then
9919     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lldap" >&5
9920 $as_echo_n "checking for ldap_bind in -lldap... " >&6; }
9921 if ${ac_cv_lib_ldap_ldap_bind+:} false; then :
9922   $as_echo_n "(cached) " >&6
9923 else
9924   ac_check_lib_save_LIBS=$LIBS
9925 LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS"
9926 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9927 /* end confdefs.h.  */
9928
9929 /* Override any GCC internal prototype to avoid an error.
9930    Use char because int might match the return type of a GCC
9931    builtin and then its argument prototype would still apply.  */
9932 #ifdef __cplusplus
9933 extern "C"
9934 #endif
9935 char ldap_bind ();
9936 int
9937 main ()
9938 {
9939 return ldap_bind ();
9940   ;
9941   return 0;
9942 }
9943 _ACEOF
9944 if ac_fn_c_try_link "$LINENO"; then :
9945   ac_cv_lib_ldap_ldap_bind=yes
9946 else
9947   ac_cv_lib_ldap_ldap_bind=no
9948 fi
9949 rm -f core conftest.err conftest.$ac_objext \
9950     conftest$ac_exeext conftest.$ac_ext
9951 LIBS=$ac_check_lib_save_LIBS
9952 fi
9953 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_bind" >&5
9954 $as_echo "$ac_cv_lib_ldap_ldap_bind" >&6; }
9955 if test "x$ac_cv_lib_ldap_ldap_bind" = xyes; then :
9956   cat >>confdefs.h <<_ACEOF
9957 #define HAVE_LIBLDAP 1
9958 _ACEOF
9959
9960   LIBS="-lldap $LIBS"
9961
9962 else
9963   as_fn_error $? "library 'ldap' is required for LDAP" "$LINENO" 5
9964 fi
9965
9966     LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
9967     if test "$enable_thread_safety" = yes; then
9968       # on some platforms ldap_r fails to link without PTHREAD_LIBS
9969       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_simple_bind in -lldap_r" >&5
9970 $as_echo_n "checking for ldap_simple_bind in -lldap_r... " >&6; }
9971 if ${ac_cv_lib_ldap_r_ldap_simple_bind+:} false; then :
9972   $as_echo_n "(cached) " >&6
9973 else
9974   ac_check_lib_save_LIBS=$LIBS
9975 LIBS="-lldap_r $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $LIBS"
9976 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9977 /* end confdefs.h.  */
9978
9979 /* Override any GCC internal prototype to avoid an error.
9980    Use char because int might match the return type of a GCC
9981    builtin and then its argument prototype would still apply.  */
9982 #ifdef __cplusplus
9983 extern "C"
9984 #endif
9985 char ldap_simple_bind ();
9986 int
9987 main ()
9988 {
9989 return ldap_simple_bind ();
9990   ;
9991   return 0;
9992 }
9993 _ACEOF
9994 if ac_fn_c_try_link "$LINENO"; then :
9995   ac_cv_lib_ldap_r_ldap_simple_bind=yes
9996 else
9997   ac_cv_lib_ldap_r_ldap_simple_bind=no
9998 fi
9999 rm -f core conftest.err conftest.$ac_objext \
10000     conftest$ac_exeext conftest.$ac_ext
10001 LIBS=$ac_check_lib_save_LIBS
10002 fi
10003 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_r_ldap_simple_bind" >&5
10004 $as_echo "$ac_cv_lib_ldap_r_ldap_simple_bind" >&6; }
10005 if test "x$ac_cv_lib_ldap_r_ldap_simple_bind" = xyes; then :
10006   cat >>confdefs.h <<_ACEOF
10007 #define HAVE_LIBLDAP_R 1
10008 _ACEOF
10009
10010   LIBS="-lldap_r $LIBS"
10011
10012 else
10013   as_fn_error $? "library 'ldap_r' is required for LDAP" "$LINENO" 5
10014 fi
10015
10016       LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS"
10017     else
10018       LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
10019     fi
10020   else
10021     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lwldap32" >&5
10022 $as_echo_n "checking for ldap_bind in -lwldap32... " >&6; }
10023 if ${ac_cv_lib_wldap32_ldap_bind+:} false; then :
10024   $as_echo_n "(cached) " >&6
10025 else
10026   ac_check_lib_save_LIBS=$LIBS
10027 LIBS="-lwldap32  $LIBS"
10028 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10029 /* end confdefs.h.  */
10030
10031 /* Override any GCC internal prototype to avoid an error.
10032    Use char because int might match the return type of a GCC
10033    builtin and then its argument prototype would still apply.  */
10034 #ifdef __cplusplus
10035 extern "C"
10036 #endif
10037 char ldap_bind ();
10038 int
10039 main ()
10040 {
10041 return ldap_bind ();
10042   ;
10043   return 0;
10044 }
10045 _ACEOF
10046 if ac_fn_c_try_link "$LINENO"; then :
10047   ac_cv_lib_wldap32_ldap_bind=yes
10048 else
10049   ac_cv_lib_wldap32_ldap_bind=no
10050 fi
10051 rm -f core conftest.err conftest.$ac_objext \
10052     conftest$ac_exeext conftest.$ac_ext
10053 LIBS=$ac_check_lib_save_LIBS
10054 fi
10055 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wldap32_ldap_bind" >&5
10056 $as_echo "$ac_cv_lib_wldap32_ldap_bind" >&6; }
10057 if test "x$ac_cv_lib_wldap32_ldap_bind" = xyes; then :
10058   cat >>confdefs.h <<_ACEOF
10059 #define HAVE_LIBWLDAP32 1
10060 _ACEOF
10061
10062   LIBS="-lwldap32 $LIBS"
10063
10064 else
10065   as_fn_error $? "library 'wldap32' is required for LDAP" "$LINENO" 5
10066 fi
10067
10068     LDAP_LIBS_FE="-lwldap32"
10069     LDAP_LIBS_BE="-lwldap32"
10070   fi
10071   LIBS="$_LIBS"
10072 fi
10073
10074
10075
10076 # for contrib/sepgsql
10077 if test "$with_selinux" = yes; then
10078   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for security_compute_create_name in -lselinux" >&5
10079 $as_echo_n "checking for security_compute_create_name in -lselinux... " >&6; }
10080 if ${ac_cv_lib_selinux_security_compute_create_name+:} false; then :
10081   $as_echo_n "(cached) " >&6
10082 else
10083   ac_check_lib_save_LIBS=$LIBS
10084 LIBS="-lselinux  $LIBS"
10085 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10086 /* end confdefs.h.  */
10087
10088 /* Override any GCC internal prototype to avoid an error.
10089    Use char because int might match the return type of a GCC
10090    builtin and then its argument prototype would still apply.  */
10091 #ifdef __cplusplus
10092 extern "C"
10093 #endif
10094 char security_compute_create_name ();
10095 int
10096 main ()
10097 {
10098 return security_compute_create_name ();
10099   ;
10100   return 0;
10101 }
10102 _ACEOF
10103 if ac_fn_c_try_link "$LINENO"; then :
10104   ac_cv_lib_selinux_security_compute_create_name=yes
10105 else
10106   ac_cv_lib_selinux_security_compute_create_name=no
10107 fi
10108 rm -f core conftest.err conftest.$ac_objext \
10109     conftest$ac_exeext conftest.$ac_ext
10110 LIBS=$ac_check_lib_save_LIBS
10111 fi
10112 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_security_compute_create_name" >&5
10113 $as_echo "$ac_cv_lib_selinux_security_compute_create_name" >&6; }
10114 if test "x$ac_cv_lib_selinux_security_compute_create_name" = xyes; then :
10115   cat >>confdefs.h <<_ACEOF
10116 #define HAVE_LIBSELINUX 1
10117 _ACEOF
10118
10119   LIBS="-lselinux $LIBS"
10120
10121 else
10122   as_fn_error $? "library 'libselinux', version 2.1.10 or newer, is required for SELinux support" "$LINENO" 5
10123 fi
10124
10125 fi
10126
10127 # for contrib/uuid-ossp
10128 if test "$with_uuid" = bsd ; then
10129   # On BSD, the UUID functions are in libc
10130   ac_fn_c_check_func "$LINENO" "uuid_to_string" "ac_cv_func_uuid_to_string"
10131 if test "x$ac_cv_func_uuid_to_string" = xyes; then :
10132   UUID_LIBS=""
10133 else
10134   as_fn_error $? "BSD UUID functions are not present" "$LINENO" 5
10135 fi
10136
10137 elif test "$with_uuid" = e2fs ; then
10138   # On macOS, the UUID functions are in libc
10139   ac_fn_c_check_func "$LINENO" "uuid_generate" "ac_cv_func_uuid_generate"
10140 if test "x$ac_cv_func_uuid_generate" = xyes; then :
10141   UUID_LIBS=""
10142 else
10143   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5
10144 $as_echo_n "checking for uuid_generate in -luuid... " >&6; }
10145 if ${ac_cv_lib_uuid_uuid_generate+:} false; then :
10146   $as_echo_n "(cached) " >&6
10147 else
10148   ac_check_lib_save_LIBS=$LIBS
10149 LIBS="-luuid  $LIBS"
10150 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10151 /* end confdefs.h.  */
10152
10153 /* Override any GCC internal prototype to avoid an error.
10154    Use char because int might match the return type of a GCC
10155    builtin and then its argument prototype would still apply.  */
10156 #ifdef __cplusplus
10157 extern "C"
10158 #endif
10159 char uuid_generate ();
10160 int
10161 main ()
10162 {
10163 return uuid_generate ();
10164   ;
10165   return 0;
10166 }
10167 _ACEOF
10168 if ac_fn_c_try_link "$LINENO"; then :
10169   ac_cv_lib_uuid_uuid_generate=yes
10170 else
10171   ac_cv_lib_uuid_uuid_generate=no
10172 fi
10173 rm -f core conftest.err conftest.$ac_objext \
10174     conftest$ac_exeext conftest.$ac_ext
10175 LIBS=$ac_check_lib_save_LIBS
10176 fi
10177 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5
10178 $as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; }
10179 if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then :
10180   UUID_LIBS="-luuid"
10181 else
10182   as_fn_error $? "library 'uuid' is required for E2FS UUID" "$LINENO" 5
10183 fi
10184
10185 fi
10186
10187 elif test "$with_uuid" = ossp ; then
10188   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_export in -lossp-uuid" >&5
10189 $as_echo_n "checking for uuid_export in -lossp-uuid... " >&6; }
10190 if ${ac_cv_lib_ossp_uuid_uuid_export+:} false; then :
10191   $as_echo_n "(cached) " >&6
10192 else
10193   ac_check_lib_save_LIBS=$LIBS
10194 LIBS="-lossp-uuid  $LIBS"
10195 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10196 /* end confdefs.h.  */
10197
10198 /* Override any GCC internal prototype to avoid an error.
10199    Use char because int might match the return type of a GCC
10200    builtin and then its argument prototype would still apply.  */
10201 #ifdef __cplusplus
10202 extern "C"
10203 #endif
10204 char uuid_export ();
10205 int
10206 main ()
10207 {
10208 return uuid_export ();
10209   ;
10210   return 0;
10211 }
10212 _ACEOF
10213 if ac_fn_c_try_link "$LINENO"; then :
10214   ac_cv_lib_ossp_uuid_uuid_export=yes
10215 else
10216   ac_cv_lib_ossp_uuid_uuid_export=no
10217 fi
10218 rm -f core conftest.err conftest.$ac_objext \
10219     conftest$ac_exeext conftest.$ac_ext
10220 LIBS=$ac_check_lib_save_LIBS
10221 fi
10222 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossp_uuid_uuid_export" >&5
10223 $as_echo "$ac_cv_lib_ossp_uuid_uuid_export" >&6; }
10224 if test "x$ac_cv_lib_ossp_uuid_uuid_export" = xyes; then :
10225   UUID_LIBS="-lossp-uuid"
10226 else
10227   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_export in -luuid" >&5
10228 $as_echo_n "checking for uuid_export in -luuid... " >&6; }
10229 if ${ac_cv_lib_uuid_uuid_export+:} false; then :
10230   $as_echo_n "(cached) " >&6
10231 else
10232   ac_check_lib_save_LIBS=$LIBS
10233 LIBS="-luuid  $LIBS"
10234 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10235 /* end confdefs.h.  */
10236
10237 /* Override any GCC internal prototype to avoid an error.
10238    Use char because int might match the return type of a GCC
10239    builtin and then its argument prototype would still apply.  */
10240 #ifdef __cplusplus
10241 extern "C"
10242 #endif
10243 char uuid_export ();
10244 int
10245 main ()
10246 {
10247 return uuid_export ();
10248   ;
10249   return 0;
10250 }
10251 _ACEOF
10252 if ac_fn_c_try_link "$LINENO"; then :
10253   ac_cv_lib_uuid_uuid_export=yes
10254 else
10255   ac_cv_lib_uuid_uuid_export=no
10256 fi
10257 rm -f core conftest.err conftest.$ac_objext \
10258     conftest$ac_exeext conftest.$ac_ext
10259 LIBS=$ac_check_lib_save_LIBS
10260 fi
10261 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_export" >&5
10262 $as_echo "$ac_cv_lib_uuid_uuid_export" >&6; }
10263 if test "x$ac_cv_lib_uuid_uuid_export" = xyes; then :
10264   UUID_LIBS="-luuid"
10265 else
10266   as_fn_error $? "library 'ossp-uuid' or 'uuid' is required for OSSP UUID" "$LINENO" 5
10267 fi
10268
10269 fi
10270
10271 fi
10272
10273
10274
10275 ##
10276 ## Header files
10277 ##
10278
10279 for ac_header in atomic.h crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h pwd.h sys/epoll.h sys/ioctl.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/socket.h sys/sockio.h sys/tas.h sys/time.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h
10280 do :
10281   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
10282 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
10283 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
10284   cat >>confdefs.h <<_ACEOF
10285 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
10286 _ACEOF
10287
10288 fi
10289
10290 done
10291
10292
10293 # On BSD, test for net/if.h will fail unless sys/socket.h
10294 # is included first.
10295 for ac_header in net/if.h
10296 do :
10297   ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "$ac_includes_default
10298 #ifdef HAVE_SYS_SOCKET_H
10299 #include <sys/socket.h>
10300 #endif
10301
10302 "
10303 if test "x$ac_cv_header_net_if_h" = xyes; then :
10304   cat >>confdefs.h <<_ACEOF
10305 #define HAVE_NET_IF_H 1
10306 _ACEOF
10307
10308 fi
10309
10310 done
10311
10312
10313 # On OpenBSD, test for sys/ucred.h will fail unless sys/param.h
10314 # is included first.
10315 for ac_header in sys/ucred.h
10316 do :
10317   ac_fn_c_check_header_compile "$LINENO" "sys/ucred.h" "ac_cv_header_sys_ucred_h" "$ac_includes_default
10318 #include <sys/param.h>
10319
10320 "
10321 if test "x$ac_cv_header_sys_ucred_h" = xyes; then :
10322   cat >>confdefs.h <<_ACEOF
10323 #define HAVE_SYS_UCRED_H 1
10324 _ACEOF
10325
10326 fi
10327
10328 done
10329
10330
10331 # At least on IRIX, test for netinet/tcp.h will fail unless
10332 # netinet/in.h is included first.
10333 for ac_header in netinet/in.h
10334 do :
10335   ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
10336 if test "x$ac_cv_header_netinet_in_h" = xyes; then :
10337   cat >>confdefs.h <<_ACEOF
10338 #define HAVE_NETINET_IN_H 1
10339 _ACEOF
10340
10341 fi
10342
10343 done
10344
10345 for ac_header in netinet/tcp.h
10346 do :
10347   ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default
10348 #ifdef HAVE_NETINET_IN_H
10349 #include <netinet/in.h>
10350 #endif
10351
10352 "
10353 if test "x$ac_cv_header_netinet_tcp_h" = xyes; then :
10354   cat >>confdefs.h <<_ACEOF
10355 #define HAVE_NETINET_TCP_H 1
10356 _ACEOF
10357
10358 fi
10359
10360 done
10361
10362
10363 if expr x"$pgac_cv_check_readline" : 'x-lreadline' >/dev/null ; then
10364   for ac_header in readline/readline.h
10365 do :
10366   ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
10367 if test "x$ac_cv_header_readline_readline_h" = xyes; then :
10368   cat >>confdefs.h <<_ACEOF
10369 #define HAVE_READLINE_READLINE_H 1
10370 _ACEOF
10371
10372 else
10373   for ac_header in readline.h
10374 do :
10375   ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
10376 if test "x$ac_cv_header_readline_h" = xyes; then :
10377   cat >>confdefs.h <<_ACEOF
10378 #define HAVE_READLINE_H 1
10379 _ACEOF
10380
10381 else
10382   as_fn_error $? "readline header not found
10383 If you have readline already installed, see config.log for details on the
10384 failure.  It is possible the compiler isn't looking in the proper directory.
10385 Use --without-readline to disable readline support." "$LINENO" 5
10386 fi
10387
10388 done
10389
10390 fi
10391
10392 done
10393
10394   for ac_header in readline/history.h
10395 do :
10396   ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
10397 if test "x$ac_cv_header_readline_history_h" = xyes; then :
10398   cat >>confdefs.h <<_ACEOF
10399 #define HAVE_READLINE_HISTORY_H 1
10400 _ACEOF
10401
10402 else
10403   for ac_header in history.h
10404 do :
10405   ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
10406 if test "x$ac_cv_header_history_h" = xyes; then :
10407   cat >>confdefs.h <<_ACEOF
10408 #define HAVE_HISTORY_H 1
10409 _ACEOF
10410
10411 else
10412   as_fn_error $? "history header not found
10413 If you have readline already installed, see config.log for details on the
10414 failure.  It is possible the compiler isn't looking in the proper directory.
10415 Use --without-readline to disable readline support." "$LINENO" 5
10416 fi
10417
10418 done
10419
10420 fi
10421
10422 done
10423
10424 fi
10425
10426 if expr x"$pgac_cv_check_readline" : 'x-ledit' >/dev/null ; then
10427 # Some installations of libedit usurp /usr/include/readline/, which seems
10428 # bad practice, since in combined installations readline will have its headers
10429 # there.  We might have to resort to AC_EGREP checks to make sure we found
10430 # the proper header...
10431   for ac_header in editline/readline.h
10432 do :
10433   ac_fn_c_check_header_mongrel "$LINENO" "editline/readline.h" "ac_cv_header_editline_readline_h" "$ac_includes_default"
10434 if test "x$ac_cv_header_editline_readline_h" = xyes; then :
10435   cat >>confdefs.h <<_ACEOF
10436 #define HAVE_EDITLINE_READLINE_H 1
10437 _ACEOF
10438
10439 else
10440   for ac_header in readline.h
10441 do :
10442   ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default"
10443 if test "x$ac_cv_header_readline_h" = xyes; then :
10444   cat >>confdefs.h <<_ACEOF
10445 #define HAVE_READLINE_H 1
10446 _ACEOF
10447
10448 else
10449   for ac_header in readline/readline.h
10450 do :
10451   ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default"
10452 if test "x$ac_cv_header_readline_readline_h" = xyes; then :
10453   cat >>confdefs.h <<_ACEOF
10454 #define HAVE_READLINE_READLINE_H 1
10455 _ACEOF
10456
10457 else
10458   as_fn_error $? "readline header not found
10459 If you have libedit already installed, see config.log for details on the
10460 failure.  It is possible the compiler isn't looking in the proper directory.
10461 Use --without-readline to disable libedit support." "$LINENO" 5
10462 fi
10463
10464 done
10465
10466 fi
10467
10468 done
10469
10470 fi
10471
10472 done
10473
10474 # Note: in a libedit installation, history.h is sometimes a dummy, and may
10475 # not be there at all.  Hence, don't complain if not found.  We must check
10476 # though, since in yet other versions it is an independent header.
10477   for ac_header in editline/history.h
10478 do :
10479   ac_fn_c_check_header_mongrel "$LINENO" "editline/history.h" "ac_cv_header_editline_history_h" "$ac_includes_default"
10480 if test "x$ac_cv_header_editline_history_h" = xyes; then :
10481   cat >>confdefs.h <<_ACEOF
10482 #define HAVE_EDITLINE_HISTORY_H 1
10483 _ACEOF
10484
10485 else
10486   for ac_header in history.h
10487 do :
10488   ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default"
10489 if test "x$ac_cv_header_history_h" = xyes; then :
10490   cat >>confdefs.h <<_ACEOF
10491 #define HAVE_HISTORY_H 1
10492 _ACEOF
10493
10494 else
10495   for ac_header in readline/history.h
10496 do :
10497   ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default"
10498 if test "x$ac_cv_header_readline_history_h" = xyes; then :
10499   cat >>confdefs.h <<_ACEOF
10500 #define HAVE_READLINE_HISTORY_H 1
10501 _ACEOF
10502
10503 fi
10504
10505 done
10506
10507 fi
10508
10509 done
10510
10511 fi
10512
10513 done
10514
10515 fi
10516
10517 if test "$with_zlib" = yes; then
10518   ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
10519 if test "x$ac_cv_header_zlib_h" = xyes; then :
10520
10521 else
10522   as_fn_error $? "zlib header not found
10523 If you have zlib already installed, see config.log for details on the
10524 failure.  It is possible the compiler isn't looking in the proper directory.
10525 Use --without-zlib to disable zlib support." "$LINENO" 5
10526 fi
10527
10528
10529 fi
10530
10531 if test "$with_gssapi" = yes ; then
10532   for ac_header in gssapi/gssapi.h
10533 do :
10534   ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default"
10535 if test "x$ac_cv_header_gssapi_gssapi_h" = xyes; then :
10536   cat >>confdefs.h <<_ACEOF
10537 #define HAVE_GSSAPI_GSSAPI_H 1
10538 _ACEOF
10539
10540 else
10541   for ac_header in gssapi.h
10542 do :
10543   ac_fn_c_check_header_mongrel "$LINENO" "gssapi.h" "ac_cv_header_gssapi_h" "$ac_includes_default"
10544 if test "x$ac_cv_header_gssapi_h" = xyes; then :
10545   cat >>confdefs.h <<_ACEOF
10546 #define HAVE_GSSAPI_H 1
10547 _ACEOF
10548
10549 else
10550   as_fn_error $? "gssapi.h header file is required for GSSAPI" "$LINENO" 5
10551 fi
10552
10553 done
10554
10555 fi
10556
10557 done
10558
10559 fi
10560
10561 if test "$with_openssl" = yes ; then
10562   ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default"
10563 if test "x$ac_cv_header_openssl_ssl_h" = xyes; then :
10564
10565 else
10566   as_fn_error $? "header file <openssl/ssl.h> is required for OpenSSL" "$LINENO" 5
10567 fi
10568
10569
10570   ac_fn_c_check_header_mongrel "$LINENO" "openssl/err.h" "ac_cv_header_openssl_err_h" "$ac_includes_default"
10571 if test "x$ac_cv_header_openssl_err_h" = xyes; then :
10572
10573 else
10574   as_fn_error $? "header file <openssl/err.h> is required for OpenSSL" "$LINENO" 5
10575 fi
10576
10577
10578 fi
10579
10580 if test "$with_pam" = yes ; then
10581   for ac_header in security/pam_appl.h
10582 do :
10583   ac_fn_c_check_header_mongrel "$LINENO" "security/pam_appl.h" "ac_cv_header_security_pam_appl_h" "$ac_includes_default"
10584 if test "x$ac_cv_header_security_pam_appl_h" = xyes; then :
10585   cat >>confdefs.h <<_ACEOF
10586 #define HAVE_SECURITY_PAM_APPL_H 1
10587 _ACEOF
10588
10589 else
10590   for ac_header in pam/pam_appl.h
10591 do :
10592   ac_fn_c_check_header_mongrel "$LINENO" "pam/pam_appl.h" "ac_cv_header_pam_pam_appl_h" "$ac_includes_default"
10593 if test "x$ac_cv_header_pam_pam_appl_h" = xyes; then :
10594   cat >>confdefs.h <<_ACEOF
10595 #define HAVE_PAM_PAM_APPL_H 1
10596 _ACEOF
10597
10598 else
10599   as_fn_error $? "header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM." "$LINENO" 5
10600 fi
10601
10602 done
10603
10604 fi
10605
10606 done
10607
10608 fi
10609
10610 if test "$with_bsd_auth" = yes ; then
10611   ac_fn_c_check_header_mongrel "$LINENO" "bsd_auth.h" "ac_cv_header_bsd_auth_h" "$ac_includes_default"
10612 if test "x$ac_cv_header_bsd_auth_h" = xyes; then :
10613
10614 else
10615   as_fn_error $? "header file <bsd_auth.h> is required for BSD Authentication support" "$LINENO" 5
10616 fi
10617
10618
10619 fi
10620
10621 if test "$with_systemd" = yes ; then
10622   ac_fn_c_check_header_mongrel "$LINENO" "systemd/sd-daemon.h" "ac_cv_header_systemd_sd_daemon_h" "$ac_includes_default"
10623 if test "x$ac_cv_header_systemd_sd_daemon_h" = xyes; then :
10624
10625 else
10626   as_fn_error $? "header file <systemd/sd-daemon.h> is required for systemd support" "$LINENO" 5
10627 fi
10628
10629
10630 fi
10631
10632 if test "$with_libxml" = yes ; then
10633   ac_fn_c_check_header_mongrel "$LINENO" "libxml/parser.h" "ac_cv_header_libxml_parser_h" "$ac_includes_default"
10634 if test "x$ac_cv_header_libxml_parser_h" = xyes; then :
10635
10636 else
10637   as_fn_error $? "header file <libxml/parser.h> is required for XML support" "$LINENO" 5
10638 fi
10639
10640
10641 fi
10642
10643 if test "$with_libxslt" = yes ; then
10644   ac_fn_c_check_header_mongrel "$LINENO" "libxslt/xslt.h" "ac_cv_header_libxslt_xslt_h" "$ac_includes_default"
10645 if test "x$ac_cv_header_libxslt_xslt_h" = xyes; then :
10646
10647 else
10648   as_fn_error $? "header file <libxslt/xslt.h> is required for XSLT support" "$LINENO" 5
10649 fi
10650
10651
10652 fi
10653
10654 if test "$with_ldap" = yes ; then
10655   if test "$PORTNAME" != "win32"; then
10656      for ac_header in ldap.h
10657 do :
10658   ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default"
10659 if test "x$ac_cv_header_ldap_h" = xyes; then :
10660   cat >>confdefs.h <<_ACEOF
10661 #define HAVE_LDAP_H 1
10662 _ACEOF
10663
10664 else
10665   as_fn_error $? "header file <ldap.h> is required for LDAP" "$LINENO" 5
10666 fi
10667
10668 done
10669
10670      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compatible LDAP implementation" >&5
10671 $as_echo_n "checking for compatible LDAP implementation... " >&6; }
10672 if ${pgac_cv_ldap_safe+:} false; then :
10673   $as_echo_n "(cached) " >&6
10674 else
10675   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10676 /* end confdefs.h.  */
10677 #include <ldap.h>
10678 #if !defined(LDAP_VENDOR_VERSION) || \
10679      (defined(LDAP_API_FEATURE_X_OPENLDAP) && \
10680       LDAP_VENDOR_VERSION >= 20424 && LDAP_VENDOR_VERSION <= 20431)
10681 choke me
10682 #endif
10683 int
10684 main ()
10685 {
10686
10687   ;
10688   return 0;
10689 }
10690 _ACEOF
10691 if ac_fn_c_try_compile "$LINENO"; then :
10692   pgac_cv_ldap_safe=yes
10693 else
10694   pgac_cv_ldap_safe=no
10695 fi
10696 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10697 fi
10698 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_ldap_safe" >&5
10699 $as_echo "$pgac_cv_ldap_safe" >&6; }
10700
10701 if test "$pgac_cv_ldap_safe" != yes; then
10702   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
10703 *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
10704 *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
10705 *** also uses LDAP will crash on exit." >&5
10706 $as_echo "$as_me: WARNING:
10707 *** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
10708 *** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
10709 *** also uses LDAP will crash on exit." >&2;}
10710 fi
10711   else
10712      for ac_header in winldap.h
10713 do :
10714   ac_fn_c_check_header_compile "$LINENO" "winldap.h" "ac_cv_header_winldap_h" "$ac_includes_default
10715 #include <windows.h>
10716
10717 "
10718 if test "x$ac_cv_header_winldap_h" = xyes; then :
10719   cat >>confdefs.h <<_ACEOF
10720 #define HAVE_WINLDAP_H 1
10721 _ACEOF
10722
10723 else
10724   as_fn_error $? "header file <winldap.h> is required for LDAP" "$LINENO" 5
10725 fi
10726
10727 done
10728
10729   fi
10730 fi
10731
10732 if test "$with_bonjour" = yes ; then
10733   ac_fn_c_check_header_mongrel "$LINENO" "dns_sd.h" "ac_cv_header_dns_sd_h" "$ac_includes_default"
10734 if test "x$ac_cv_header_dns_sd_h" = xyes; then :
10735
10736 else
10737   as_fn_error $? "header file <dns_sd.h> is required for Bonjour" "$LINENO" 5
10738 fi
10739
10740
10741 fi
10742
10743 # for contrib/uuid-ossp
10744 if test "$with_uuid" = bsd ; then
10745   for ac_header in uuid.h
10746 do :
10747   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
10748 if test "x$ac_cv_header_uuid_h" = xyes; then :
10749   cat >>confdefs.h <<_ACEOF
10750 #define HAVE_UUID_H 1
10751 _ACEOF
10752  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10753 /* end confdefs.h.  */
10754 #include <uuid.h>
10755
10756 _ACEOF
10757 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10758   $EGREP "uuid_to_string" >/dev/null 2>&1; then :
10759
10760 else
10761   as_fn_error $? "header file <uuid.h> does not match BSD UUID library" "$LINENO" 5
10762 fi
10763 rm -f conftest*
10764
10765 else
10766   as_fn_error $? "header file <uuid.h> is required for BSD UUID" "$LINENO" 5
10767 fi
10768
10769 done
10770
10771 elif test "$with_uuid" = e2fs ; then
10772   for ac_header in uuid/uuid.h
10773 do :
10774   ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
10775 if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
10776   cat >>confdefs.h <<_ACEOF
10777 #define HAVE_UUID_UUID_H 1
10778 _ACEOF
10779  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10780 /* end confdefs.h.  */
10781 #include <uuid/uuid.h>
10782
10783 _ACEOF
10784 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10785   $EGREP "uuid_generate" >/dev/null 2>&1; then :
10786
10787 else
10788   as_fn_error $? "header file <uuid/uuid.h> does not match E2FS UUID library" "$LINENO" 5
10789 fi
10790 rm -f conftest*
10791
10792 else
10793   for ac_header in uuid.h
10794 do :
10795   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
10796 if test "x$ac_cv_header_uuid_h" = xyes; then :
10797   cat >>confdefs.h <<_ACEOF
10798 #define HAVE_UUID_H 1
10799 _ACEOF
10800  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10801 /* end confdefs.h.  */
10802 #include <uuid.h>
10803
10804 _ACEOF
10805 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10806   $EGREP "uuid_generate" >/dev/null 2>&1; then :
10807
10808 else
10809   as_fn_error $? "header file <uuid.h> does not match E2FS UUID library" "$LINENO" 5
10810 fi
10811 rm -f conftest*
10812
10813 else
10814   as_fn_error $? "header file <uuid/uuid.h> or <uuid.h> is required for E2FS UUID" "$LINENO" 5
10815 fi
10816
10817 done
10818
10819 fi
10820
10821 done
10822
10823 elif test "$with_uuid" = ossp ; then
10824   for ac_header in ossp/uuid.h
10825 do :
10826   ac_fn_c_check_header_mongrel "$LINENO" "ossp/uuid.h" "ac_cv_header_ossp_uuid_h" "$ac_includes_default"
10827 if test "x$ac_cv_header_ossp_uuid_h" = xyes; then :
10828   cat >>confdefs.h <<_ACEOF
10829 #define HAVE_OSSP_UUID_H 1
10830 _ACEOF
10831  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10832 /* end confdefs.h.  */
10833 #include <ossp/uuid.h>
10834
10835 _ACEOF
10836 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10837   $EGREP "uuid_export" >/dev/null 2>&1; then :
10838
10839 else
10840   as_fn_error $? "header file <ossp/uuid.h> does not match OSSP UUID library" "$LINENO" 5
10841 fi
10842 rm -f conftest*
10843
10844 else
10845   for ac_header in uuid.h
10846 do :
10847   ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
10848 if test "x$ac_cv_header_uuid_h" = xyes; then :
10849   cat >>confdefs.h <<_ACEOF
10850 #define HAVE_UUID_H 1
10851 _ACEOF
10852  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10853 /* end confdefs.h.  */
10854 #include <uuid.h>
10855
10856 _ACEOF
10857 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10858   $EGREP "uuid_export" >/dev/null 2>&1; then :
10859
10860 else
10861   as_fn_error $? "header file <uuid.h> does not match OSSP UUID library" "$LINENO" 5
10862 fi
10863 rm -f conftest*
10864
10865 else
10866   as_fn_error $? "header file <ossp/uuid.h> or <uuid.h> is required for OSSP UUID" "$LINENO" 5
10867 fi
10868
10869 done
10870
10871 fi
10872
10873 done
10874
10875 fi
10876
10877 if test "$PORTNAME" = "win32" ; then
10878    for ac_header in crtdefs.h
10879 do :
10880   ac_fn_c_check_header_mongrel "$LINENO" "crtdefs.h" "ac_cv_header_crtdefs_h" "$ac_includes_default"
10881 if test "x$ac_cv_header_crtdefs_h" = xyes; then :
10882   cat >>confdefs.h <<_ACEOF
10883 #define HAVE_CRTDEFS_H 1
10884 _ACEOF
10885
10886 fi
10887
10888 done
10889
10890 fi
10891
10892 ##
10893 ## Types, structures, compiler characteristics
10894 ##
10895
10896   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
10897 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
10898 if ${ac_cv_c_bigendian+:} false; then :
10899   $as_echo_n "(cached) " >&6
10900 else
10901   ac_cv_c_bigendian=unknown
10902     # See if we're dealing with a universal compiler.
10903     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10904 /* end confdefs.h.  */
10905 #ifndef __APPLE_CC__
10906                not a universal capable compiler
10907              #endif
10908              typedef int dummy;
10909
10910 _ACEOF
10911 if ac_fn_c_try_compile "$LINENO"; then :
10912
10913         # Check for potential -arch flags.  It is not universal unless
10914         # there are at least two -arch flags with different values.
10915         ac_arch=
10916         ac_prev=
10917         for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
10918          if test -n "$ac_prev"; then
10919            case $ac_word in
10920              i?86 | x86_64 | ppc | ppc64)
10921                if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
10922                  ac_arch=$ac_word
10923                else
10924                  ac_cv_c_bigendian=universal
10925                  break
10926                fi
10927                ;;
10928            esac
10929            ac_prev=
10930          elif test "x$ac_word" = "x-arch"; then
10931            ac_prev=arch
10932          fi
10933        done
10934 fi
10935 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10936     if test $ac_cv_c_bigendian = unknown; then
10937       # See if sys/param.h defines the BYTE_ORDER macro.
10938       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10939 /* end confdefs.h.  */
10940 #include <sys/types.h>
10941              #include <sys/param.h>
10942
10943 int
10944 main ()
10945 {
10946 #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
10947                      && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
10948                      && LITTLE_ENDIAN)
10949               bogus endian macros
10950              #endif
10951
10952   ;
10953   return 0;
10954 }
10955 _ACEOF
10956 if ac_fn_c_try_compile "$LINENO"; then :
10957   # It does; now see whether it defined to BIG_ENDIAN or not.
10958          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10959 /* end confdefs.h.  */
10960 #include <sys/types.h>
10961                 #include <sys/param.h>
10962
10963 int
10964 main ()
10965 {
10966 #if BYTE_ORDER != BIG_ENDIAN
10967                  not big endian
10968                 #endif
10969
10970   ;
10971   return 0;
10972 }
10973 _ACEOF
10974 if ac_fn_c_try_compile "$LINENO"; then :
10975   ac_cv_c_bigendian=yes
10976 else
10977   ac_cv_c_bigendian=no
10978 fi
10979 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10980 fi
10981 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10982     fi
10983     if test $ac_cv_c_bigendian = unknown; then
10984       # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
10985       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10986 /* end confdefs.h.  */
10987 #include <limits.h>
10988
10989 int
10990 main ()
10991 {
10992 #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
10993               bogus endian macros
10994              #endif
10995
10996   ;
10997   return 0;
10998 }
10999 _ACEOF
11000 if ac_fn_c_try_compile "$LINENO"; then :
11001   # It does; now see whether it defined to _BIG_ENDIAN or not.
11002          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11003 /* end confdefs.h.  */
11004 #include <limits.h>
11005
11006 int
11007 main ()
11008 {
11009 #ifndef _BIG_ENDIAN
11010                  not big endian
11011                 #endif
11012
11013   ;
11014   return 0;
11015 }
11016 _ACEOF
11017 if ac_fn_c_try_compile "$LINENO"; then :
11018   ac_cv_c_bigendian=yes
11019 else
11020   ac_cv_c_bigendian=no
11021 fi
11022 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11023 fi
11024 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11025     fi
11026     if test $ac_cv_c_bigendian = unknown; then
11027       # Compile a test program.
11028       if test "$cross_compiling" = yes; then :
11029   # Try to guess by grepping values from an object file.
11030          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11031 /* end confdefs.h.  */
11032 short int ascii_mm[] =
11033                   { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
11034                 short int ascii_ii[] =
11035                   { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
11036                 int use_ascii (int i) {
11037                   return ascii_mm[i] + ascii_ii[i];
11038                 }
11039                 short int ebcdic_ii[] =
11040                   { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
11041                 short int ebcdic_mm[] =
11042                   { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
11043                 int use_ebcdic (int i) {
11044                   return ebcdic_mm[i] + ebcdic_ii[i];
11045                 }
11046                 extern int foo;
11047
11048 int
11049 main ()
11050 {
11051 return use_ascii (foo) == use_ebcdic (foo);
11052   ;
11053   return 0;
11054 }
11055 _ACEOF
11056 if ac_fn_c_try_compile "$LINENO"; then :
11057   if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
11058               ac_cv_c_bigendian=yes
11059             fi
11060             if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
11061               if test "$ac_cv_c_bigendian" = unknown; then
11062                 ac_cv_c_bigendian=no
11063               else
11064                 # finding both strings is unlikely to happen, but who knows?
11065                 ac_cv_c_bigendian=unknown
11066               fi
11067             fi
11068 fi
11069 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11070 else
11071   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11072 /* end confdefs.h.  */
11073 $ac_includes_default
11074 int
11075 main ()
11076 {
11077
11078              /* Are we little or big endian?  From Harbison&Steele.  */
11079              union
11080              {
11081                long int l;
11082                char c[sizeof (long int)];
11083              } u;
11084              u.l = 1;
11085              return u.c[sizeof (long int) - 1] == 1;
11086
11087   ;
11088   return 0;
11089 }
11090 _ACEOF
11091 if ac_fn_c_try_run "$LINENO"; then :
11092   ac_cv_c_bigendian=no
11093 else
11094   ac_cv_c_bigendian=yes
11095 fi
11096 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11097   conftest.$ac_objext conftest.beam conftest.$ac_ext
11098 fi
11099
11100     fi
11101 fi
11102 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
11103 $as_echo "$ac_cv_c_bigendian" >&6; }
11104  case $ac_cv_c_bigendian in #(
11105    yes)
11106      $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
11107 ;; #(
11108    no)
11109       ;; #(
11110    universal)
11111
11112 $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
11113
11114      ;; #(
11115    *)
11116      as_fn_error $? "unknown endianness
11117  presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
11118  esac
11119
11120 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
11121 $as_echo_n "checking for inline... " >&6; }
11122 if ${ac_cv_c_inline+:} false; then :
11123   $as_echo_n "(cached) " >&6
11124 else
11125   ac_cv_c_inline=no
11126 for ac_kw in inline __inline__ __inline; do
11127   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11128 /* end confdefs.h.  */
11129 #ifndef __cplusplus
11130 typedef int foo_t;
11131 static $ac_kw foo_t static_foo () {return 0; }
11132 $ac_kw foo_t foo () {return 0; }
11133 #endif
11134
11135 _ACEOF
11136 if ac_fn_c_try_compile "$LINENO"; then :
11137   ac_cv_c_inline=$ac_kw
11138 fi
11139 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11140   test "$ac_cv_c_inline" != no && break
11141 done
11142
11143 fi
11144 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
11145 $as_echo "$ac_cv_c_inline" >&6; }
11146
11147 case $ac_cv_c_inline in
11148   inline | yes) ;;
11149   *)
11150     case $ac_cv_c_inline in
11151       no) ac_val=;;
11152       *) ac_val=$ac_cv_c_inline;;
11153     esac
11154     cat >>confdefs.h <<_ACEOF
11155 #ifndef __cplusplus
11156 #define inline $ac_val
11157 #endif
11158 _ACEOF
11159     ;;
11160 esac
11161
11162 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf format archetype" >&5
11163 $as_echo_n "checking for printf format archetype... " >&6; }
11164 if ${pgac_cv_printf_archetype+:} false; then :
11165   $as_echo_n "(cached) " >&6
11166 else
11167   ac_save_c_werror_flag=$ac_c_werror_flag
11168 ac_c_werror_flag=yes
11169 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11170 /* end confdefs.h.  */
11171 extern int
11172 pgac_write(int ignore, const char *fmt,...)
11173 __attribute__((format(gnu_printf, 2, 3)));
11174 int
11175 main ()
11176 {
11177
11178   ;
11179   return 0;
11180 }
11181 _ACEOF
11182 if ac_fn_c_try_compile "$LINENO"; then :
11183   pgac_cv_printf_archetype=gnu_printf
11184 else
11185   pgac_cv_printf_archetype=printf
11186 fi
11187 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11188 ac_c_werror_flag=$ac_save_c_werror_flag
11189 fi
11190 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_printf_archetype" >&5
11191 $as_echo "$pgac_cv_printf_archetype" >&6; }
11192
11193 cat >>confdefs.h <<_ACEOF
11194 #define PG_PRINTF_ATTRIBUTE $pgac_cv_printf_archetype
11195 _ACEOF
11196
11197
11198
11199   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array members" >&5
11200 $as_echo_n "checking for flexible array members... " >&6; }
11201 if ${ac_cv_c_flexmember+:} false; then :
11202   $as_echo_n "(cached) " >&6
11203 else
11204   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11205 /* end confdefs.h.  */
11206 #include <stdlib.h>
11207             #include <stdio.h>
11208             #include <stddef.h>
11209             struct s { int n; double d[]; };
11210 int
11211 main ()
11212 {
11213 int m = getchar ();
11214             struct s *p = malloc (offsetof (struct s, d)
11215                                   + m * sizeof (double));
11216             p->d[0] = 0.0;
11217             return p->d != (double *) NULL;
11218   ;
11219   return 0;
11220 }
11221 _ACEOF
11222 if ac_fn_c_try_compile "$LINENO"; then :
11223   ac_cv_c_flexmember=yes
11224 else
11225   ac_cv_c_flexmember=no
11226 fi
11227 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11228 fi
11229 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
11230 $as_echo "$ac_cv_c_flexmember" >&6; }
11231   if test $ac_cv_c_flexmember = yes; then
11232
11233 $as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
11234
11235   else
11236     $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
11237
11238   fi
11239
11240 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed types" >&5
11241 $as_echo_n "checking for signed types... " >&6; }
11242 if ${pgac_cv_c_signed+:} false; then :
11243   $as_echo_n "(cached) " >&6
11244 else
11245   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11246 /* end confdefs.h.  */
11247
11248 int
11249 main ()
11250 {
11251 signed char c; signed short s; signed int i;
11252   ;
11253   return 0;
11254 }
11255 _ACEOF
11256 if ac_fn_c_try_compile "$LINENO"; then :
11257   pgac_cv_c_signed=yes
11258 else
11259   pgac_cv_c_signed=no
11260 fi
11261 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11262 fi
11263 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_c_signed" >&5
11264 $as_echo "$pgac_cv_c_signed" >&6; }
11265 if test x"$pgac_cv_c_signed" = xno ; then
11266
11267 $as_echo "#define signed /**/" >>confdefs.h
11268
11269 fi
11270 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __func__" >&5
11271 $as_echo_n "checking for __func__... " >&6; }
11272 if ${pgac_cv_funcname_func_support+:} false; then :
11273   $as_echo_n "(cached) " >&6
11274 else
11275   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11276 /* end confdefs.h.  */
11277 #include <stdio.h>
11278 int
11279 main ()
11280 {
11281 printf("%s\n", __func__);
11282   ;
11283   return 0;
11284 }
11285 _ACEOF
11286 if ac_fn_c_try_compile "$LINENO"; then :
11287   pgac_cv_funcname_func_support=yes
11288 else
11289   pgac_cv_funcname_func_support=no
11290 fi
11291 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11292 fi
11293 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_func_support" >&5
11294 $as_echo "$pgac_cv_funcname_func_support" >&6; }
11295 if test x"$pgac_cv_funcname_func_support" = xyes ; then
11296
11297 $as_echo "#define HAVE_FUNCNAME__FUNC 1" >>confdefs.h
11298
11299 else
11300 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __FUNCTION__" >&5
11301 $as_echo_n "checking for __FUNCTION__... " >&6; }
11302 if ${pgac_cv_funcname_function_support+:} false; then :
11303   $as_echo_n "(cached) " >&6
11304 else
11305   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11306 /* end confdefs.h.  */
11307 #include <stdio.h>
11308 int
11309 main ()
11310 {
11311 printf("%s\n", __FUNCTION__);
11312   ;
11313   return 0;
11314 }
11315 _ACEOF
11316 if ac_fn_c_try_compile "$LINENO"; then :
11317   pgac_cv_funcname_function_support=yes
11318 else
11319   pgac_cv_funcname_function_support=no
11320 fi
11321 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11322 fi
11323 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_function_support" >&5
11324 $as_echo "$pgac_cv_funcname_function_support" >&6; }
11325 if test x"$pgac_cv_funcname_function_support" = xyes ; then
11326
11327 $as_echo "#define HAVE_FUNCNAME__FUNCTION 1" >>confdefs.h
11328
11329 fi
11330 fi
11331 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Static_assert" >&5
11332 $as_echo_n "checking for _Static_assert... " >&6; }
11333 if ${pgac_cv__static_assert+:} false; then :
11334   $as_echo_n "(cached) " >&6
11335 else
11336   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11337 /* end confdefs.h.  */
11338
11339 int
11340 main ()
11341 {
11342 ({ _Static_assert(1, "foo"); })
11343   ;
11344   return 0;
11345 }
11346 _ACEOF
11347 if ac_fn_c_try_link "$LINENO"; then :
11348   pgac_cv__static_assert=yes
11349 else
11350   pgac_cv__static_assert=no
11351 fi
11352 rm -f core conftest.err conftest.$ac_objext \
11353     conftest$ac_exeext conftest.$ac_ext
11354 fi
11355 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__static_assert" >&5
11356 $as_echo "$pgac_cv__static_assert" >&6; }
11357 if test x"$pgac_cv__static_assert" = xyes ; then
11358
11359 $as_echo "#define HAVE__STATIC_ASSERT 1" >>confdefs.h
11360
11361 fi
11362 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_types_compatible_p" >&5
11363 $as_echo_n "checking for __builtin_types_compatible_p... " >&6; }
11364 if ${pgac_cv__types_compatible+:} false; then :
11365   $as_echo_n "(cached) " >&6
11366 else
11367   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11368 /* end confdefs.h.  */
11369
11370 int
11371 main ()
11372 {
11373  int x; static int y[__builtin_types_compatible_p(__typeof__(x), int)];
11374   ;
11375   return 0;
11376 }
11377 _ACEOF
11378 if ac_fn_c_try_compile "$LINENO"; then :
11379   pgac_cv__types_compatible=yes
11380 else
11381   pgac_cv__types_compatible=no
11382 fi
11383 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11384 fi
11385 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__types_compatible" >&5
11386 $as_echo "$pgac_cv__types_compatible" >&6; }
11387 if test x"$pgac_cv__types_compatible" = xyes ; then
11388
11389 $as_echo "#define HAVE__BUILTIN_TYPES_COMPATIBLE_P 1" >>confdefs.h
11390
11391 fi
11392 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap32" >&5
11393 $as_echo_n "checking for __builtin_bswap32... " >&6; }
11394 if ${pgac_cv__builtin_bswap32+:} false; then :
11395   $as_echo_n "(cached) " >&6
11396 else
11397   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11398 /* end confdefs.h.  */
11399 static unsigned long int x = __builtin_bswap32(0xaabbccdd);
11400
11401 _ACEOF
11402 if ac_fn_c_try_compile "$LINENO"; then :
11403   pgac_cv__builtin_bswap32=yes
11404 else
11405   pgac_cv__builtin_bswap32=no
11406 fi
11407 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11408 fi
11409 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_bswap32" >&5
11410 $as_echo "$pgac_cv__builtin_bswap32" >&6; }
11411 if test x"$pgac_cv__builtin_bswap32" = xyes ; then
11412
11413 $as_echo "#define HAVE__BUILTIN_BSWAP32 1" >>confdefs.h
11414
11415 fi
11416 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_bswap64" >&5
11417 $as_echo_n "checking for __builtin_bswap64... " >&6; }
11418 if ${pgac_cv__builtin_bswap64+:} false; then :
11419   $as_echo_n "(cached) " >&6
11420 else
11421   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11422 /* end confdefs.h.  */
11423 static unsigned long int x = __builtin_bswap64(0xaabbccddeeff0011);
11424
11425 _ACEOF
11426 if ac_fn_c_try_compile "$LINENO"; then :
11427   pgac_cv__builtin_bswap64=yes
11428 else
11429   pgac_cv__builtin_bswap64=no
11430 fi
11431 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11432 fi
11433 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_bswap64" >&5
11434 $as_echo "$pgac_cv__builtin_bswap64" >&6; }
11435 if test x"$pgac_cv__builtin_bswap64" = xyes ; then
11436
11437 $as_echo "#define HAVE__BUILTIN_BSWAP64 1" >>confdefs.h
11438
11439 fi
11440 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_constant_p" >&5
11441 $as_echo_n "checking for __builtin_constant_p... " >&6; }
11442 if ${pgac_cv__builtin_constant_p+:} false; then :
11443   $as_echo_n "(cached) " >&6
11444 else
11445   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11446 /* end confdefs.h.  */
11447 static int x; static int y[__builtin_constant_p(x) ? x : 1];
11448
11449 _ACEOF
11450 if ac_fn_c_try_compile "$LINENO"; then :
11451   pgac_cv__builtin_constant_p=yes
11452 else
11453   pgac_cv__builtin_constant_p=no
11454 fi
11455 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11456 fi
11457 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_constant_p" >&5
11458 $as_echo "$pgac_cv__builtin_constant_p" >&6; }
11459 if test x"$pgac_cv__builtin_constant_p" = xyes ; then
11460
11461 $as_echo "#define HAVE__BUILTIN_CONSTANT_P 1" >>confdefs.h
11462
11463 fi
11464 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_unreachable" >&5
11465 $as_echo_n "checking for __builtin_unreachable... " >&6; }
11466 if ${pgac_cv__builtin_unreachable+:} false; then :
11467   $as_echo_n "(cached) " >&6
11468 else
11469   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11470 /* end confdefs.h.  */
11471
11472 int
11473 main ()
11474 {
11475 __builtin_unreachable();
11476   ;
11477   return 0;
11478 }
11479 _ACEOF
11480 if ac_fn_c_try_link "$LINENO"; then :
11481   pgac_cv__builtin_unreachable=yes
11482 else
11483   pgac_cv__builtin_unreachable=no
11484 fi
11485 rm -f core conftest.err conftest.$ac_objext \
11486     conftest$ac_exeext conftest.$ac_ext
11487 fi
11488 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_unreachable" >&5
11489 $as_echo "$pgac_cv__builtin_unreachable" >&6; }
11490 if test x"$pgac_cv__builtin_unreachable" = xyes ; then
11491
11492 $as_echo "#define HAVE__BUILTIN_UNREACHABLE 1" >>confdefs.h
11493
11494 fi
11495 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __VA_ARGS__" >&5
11496 $as_echo_n "checking for __VA_ARGS__... " >&6; }
11497 if ${pgac_cv__va_args+:} false; then :
11498   $as_echo_n "(cached) " >&6
11499 else
11500   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11501 /* end confdefs.h.  */
11502 #include <stdio.h>
11503 int
11504 main ()
11505 {
11506 #define debug(...) fprintf(stderr, __VA_ARGS__)
11507 debug("%s", "blarg");
11508
11509   ;
11510   return 0;
11511 }
11512 _ACEOF
11513 if ac_fn_c_try_compile "$LINENO"; then :
11514   pgac_cv__va_args=yes
11515 else
11516   pgac_cv__va_args=no
11517 fi
11518 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11519 fi
11520 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__va_args" >&5
11521 $as_echo "$pgac_cv__va_args" >&6; }
11522 if test x"$pgac_cv__va_args" = xyes ; then
11523
11524 $as_echo "#define HAVE__VA_ARGS 1" >>confdefs.h
11525
11526 fi
11527 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
11528 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
11529 if ${ac_cv_struct_tm+:} false; then :
11530   $as_echo_n "(cached) " >&6
11531 else
11532   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11533 /* end confdefs.h.  */
11534 #include <sys/types.h>
11535 #include <time.h>
11536
11537 int
11538 main ()
11539 {
11540 struct tm tm;
11541                                      int *p = &tm.tm_sec;
11542                                      return !p;
11543   ;
11544   return 0;
11545 }
11546 _ACEOF
11547 if ac_fn_c_try_compile "$LINENO"; then :
11548   ac_cv_struct_tm=time.h
11549 else
11550   ac_cv_struct_tm=sys/time.h
11551 fi
11552 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11553 fi
11554 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
11555 $as_echo "$ac_cv_struct_tm" >&6; }
11556 if test $ac_cv_struct_tm = sys/time.h; then
11557
11558 $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
11559
11560 fi
11561
11562 ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h>
11563 #include <$ac_cv_struct_tm>
11564
11565 "
11566 if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
11567
11568 cat >>confdefs.h <<_ACEOF
11569 #define HAVE_STRUCT_TM_TM_ZONE 1
11570 _ACEOF
11571
11572
11573 fi
11574
11575 if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
11576
11577 $as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h
11578
11579 fi
11580 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
11581 $as_echo_n "checking for tzname... " >&6; }
11582 if ${ac_cv_var_tzname+:} false; then :
11583   $as_echo_n "(cached) " >&6
11584 else
11585   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11586 /* end confdefs.h.  */
11587 #include <stdlib.h>
11588 #include <time.h>
11589 #ifndef tzname /* For SGI.  */
11590 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
11591 #endif
11592
11593 int
11594 main ()
11595 {
11596 atoi(*tzname);
11597   ;
11598   return 0;
11599 }
11600 _ACEOF
11601 if ac_fn_c_try_link "$LINENO"; then :
11602   ac_cv_var_tzname=yes
11603 else
11604   ac_cv_var_tzname=no
11605 fi
11606 rm -f core conftest.err conftest.$ac_objext \
11607     conftest$ac_exeext conftest.$ac_ext
11608 fi
11609 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5
11610 $as_echo "$ac_cv_var_tzname" >&6; }
11611 if test $ac_cv_var_tzname = yes; then
11612
11613 $as_echo "#define HAVE_TZNAME 1" >>confdefs.h
11614
11615 fi
11616
11617 ac_fn_c_check_type "$LINENO" "union semun" "ac_cv_type_union_semun" "#include <sys/types.h>
11618 #include <sys/ipc.h>
11619 #include <sys/sem.h>
11620 "
11621 if test "x$ac_cv_type_union_semun" = xyes; then :
11622
11623 cat >>confdefs.h <<_ACEOF
11624 #define HAVE_UNION_SEMUN 1
11625 _ACEOF
11626
11627
11628 fi
11629
11630 ac_fn_c_check_type "$LINENO" "struct sockaddr_un" "ac_cv_type_struct_sockaddr_un" "#include <sys/types.h>
11631 #ifdef HAVE_SYS_UN_H
11632 #include <sys/un.h>
11633 #endif
11634
11635 "
11636 if test "x$ac_cv_type_struct_sockaddr_un" = xyes; then :
11637
11638 $as_echo "#define HAVE_UNIX_SOCKETS 1" >>confdefs.h
11639
11640 fi
11641
11642 ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include <sys/types.h>
11643 #ifdef HAVE_SYS_SOCKET_H
11644 #include <sys/socket.h>
11645 #endif
11646
11647 "
11648 if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
11649
11650 cat >>confdefs.h <<_ACEOF
11651 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
11652 _ACEOF
11653
11654
11655 fi
11656
11657 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
11658 #ifdef HAVE_SYS_SOCKET_H
11659 #include <sys/socket.h>
11660 #endif
11661
11662 "
11663 if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
11664
11665 cat >>confdefs.h <<_ACEOF
11666 #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
11667 _ACEOF
11668
11669
11670 fi
11671 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_family" "ac_cv_member_struct_sockaddr_storage___ss_family" "#include <sys/types.h>
11672 #ifdef HAVE_SYS_SOCKET_H
11673 #include <sys/socket.h>
11674 #endif
11675
11676 "
11677 if test "x$ac_cv_member_struct_sockaddr_storage___ss_family" = xyes; then :
11678
11679 cat >>confdefs.h <<_ACEOF
11680 #define HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY 1
11681 _ACEOF
11682
11683
11684 fi
11685 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_len" "ac_cv_member_struct_sockaddr_storage_ss_len" "#include <sys/types.h>
11686 #ifdef HAVE_SYS_SOCKET_H
11687 #include <sys/socket.h>
11688 #endif
11689
11690 "
11691 if test "x$ac_cv_member_struct_sockaddr_storage_ss_len" = xyes; then :
11692
11693 cat >>confdefs.h <<_ACEOF
11694 #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1
11695 _ACEOF
11696
11697
11698 fi
11699 ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_len" "ac_cv_member_struct_sockaddr_storage___ss_len" "#include <sys/types.h>
11700 #ifdef HAVE_SYS_SOCKET_H
11701 #include <sys/socket.h>
11702 #endif
11703
11704 "
11705 if test "x$ac_cv_member_struct_sockaddr_storage___ss_len" = xyes; then :
11706
11707 cat >>confdefs.h <<_ACEOF
11708 #define HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN 1
11709 _ACEOF
11710
11711
11712 fi
11713 ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include <sys/types.h>
11714 #ifdef HAVE_SYS_SOCKET_H
11715 #include <sys/socket.h>
11716 #endif
11717
11718 "
11719 if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then :
11720
11721 cat >>confdefs.h <<_ACEOF
11722 #define HAVE_STRUCT_SOCKADDR_SA_LEN 1
11723 _ACEOF
11724
11725
11726 fi
11727
11728 ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "#include <sys/types.h>
11729 #include <sys/socket.h>
11730 #include <netdb.h>
11731
11732 "
11733 if test "x$ac_cv_type_struct_addrinfo" = xyes; then :
11734
11735 cat >>confdefs.h <<_ACEOF
11736 #define HAVE_STRUCT_ADDRINFO 1
11737 _ACEOF
11738
11739
11740 fi
11741
11742
11743   ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
11744 if test "x$ac_cv_type_intptr_t" = xyes; then :
11745
11746 $as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h
11747
11748 else
11749   for ac_type in 'int' 'long int' 'long long int'; do
11750        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11751 /* end confdefs.h.  */
11752 $ac_includes_default
11753 int
11754 main ()
11755 {
11756 static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
11757 test_array [0] = 0;
11758 return test_array [0];
11759
11760   ;
11761   return 0;
11762 }
11763 _ACEOF
11764 if ac_fn_c_try_compile "$LINENO"; then :
11765
11766 cat >>confdefs.h <<_ACEOF
11767 #define intptr_t $ac_type
11768 _ACEOF
11769
11770           ac_type=
11771 fi
11772 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11773        test -z "$ac_type" && break
11774      done
11775 fi
11776
11777
11778
11779   ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
11780 if test "x$ac_cv_type_uintptr_t" = xyes; then :
11781
11782 $as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
11783
11784 else
11785   for ac_type in 'unsigned int' 'unsigned long int' \
11786         'unsigned long long int'; do
11787        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11788 /* end confdefs.h.  */
11789 $ac_includes_default
11790 int
11791 main ()
11792 {
11793 static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
11794 test_array [0] = 0;
11795 return test_array [0];
11796
11797   ;
11798   return 0;
11799 }
11800 _ACEOF
11801 if ac_fn_c_try_compile "$LINENO"; then :
11802
11803 cat >>confdefs.h <<_ACEOF
11804 #define uintptr_t $ac_type
11805 _ACEOF
11806
11807           ac_type=
11808 fi
11809 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11810        test -z "$ac_type" && break
11811      done
11812 fi
11813
11814
11815
11816   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
11817 $as_echo_n "checking for unsigned long long int... " >&6; }
11818 if ${ac_cv_type_unsigned_long_long_int+:} false; then :
11819   $as_echo_n "(cached) " >&6
11820 else
11821   ac_cv_type_unsigned_long_long_int=yes
11822      if test "x${ac_cv_prog_cc_c99-no}" = xno; then
11823        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11824 /* end confdefs.h.  */
11825
11826   /* For now, do not test the preprocessor; as of 2007 there are too many
11827          implementations with broken preprocessors.  Perhaps this can
11828          be revisited in 2012.  In the meantime, code should not expect
11829          #if to work with literals wider than 32 bits.  */
11830       /* Test literals.  */
11831       long long int ll = 9223372036854775807ll;
11832       long long int nll = -9223372036854775807LL;
11833       unsigned long long int ull = 18446744073709551615ULL;
11834       /* Test constant expressions.   */
11835       typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
11836                      ? 1 : -1)];
11837       typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
11838                      ? 1 : -1)];
11839       int i = 63;
11840 int
11841 main ()
11842 {
11843 /* Test availability of runtime routines for shift and division.  */
11844       long long int llmax = 9223372036854775807ll;
11845       unsigned long long int ullmax = 18446744073709551615ull;
11846       return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
11847               | (llmax / ll) | (llmax % ll)
11848               | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
11849               | (ullmax / ull) | (ullmax % ull));
11850   ;
11851   return 0;
11852 }
11853
11854 _ACEOF
11855 if ac_fn_c_try_link "$LINENO"; then :
11856
11857 else
11858   ac_cv_type_unsigned_long_long_int=no
11859 fi
11860 rm -f core conftest.err conftest.$ac_objext \
11861     conftest$ac_exeext conftest.$ac_ext
11862      fi
11863 fi
11864 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
11865 $as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
11866   if test $ac_cv_type_unsigned_long_long_int = yes; then
11867
11868 $as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
11869
11870   fi
11871
11872
11873
11874   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
11875 $as_echo_n "checking for long long int... " >&6; }
11876 if ${ac_cv_type_long_long_int+:} false; then :
11877   $as_echo_n "(cached) " >&6
11878 else
11879   ac_cv_type_long_long_int=yes
11880       if test "x${ac_cv_prog_cc_c99-no}" = xno; then
11881         ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
11882         if test $ac_cv_type_long_long_int = yes; then
11883                                   if test "$cross_compiling" = yes; then :
11884   :
11885 else
11886   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11887 /* end confdefs.h.  */
11888 #include <limits.h>
11889                  #ifndef LLONG_MAX
11890                  # define HALF \
11891                           (1LL << (sizeof (long long int) * CHAR_BIT - 2))
11892                  # define LLONG_MAX (HALF - 1 + HALF)
11893                  #endif
11894 int
11895 main ()
11896 {
11897 long long int n = 1;
11898                  int i;
11899                  for (i = 0; ; i++)
11900                    {
11901                      long long int m = n << i;
11902                      if (m >> i != n)
11903                        return 1;
11904                      if (LLONG_MAX / 2 < m)
11905                        break;
11906                    }
11907                  return 0;
11908   ;
11909   return 0;
11910 }
11911 _ACEOF
11912 if ac_fn_c_try_run "$LINENO"; then :
11913
11914 else
11915   ac_cv_type_long_long_int=no
11916 fi
11917 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
11918   conftest.$ac_objext conftest.beam conftest.$ac_ext
11919 fi
11920
11921         fi
11922       fi
11923 fi
11924 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
11925 $as_echo "$ac_cv_type_long_long_int" >&6; }
11926   if test $ac_cv_type_long_long_int = yes; then
11927
11928 $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
11929
11930   fi
11931
11932
11933 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale_t" >&5
11934 $as_echo_n "checking for locale_t... " >&6; }
11935 if ${pgac_cv_type_locale_t+:} false; then :
11936   $as_echo_n "(cached) " >&6
11937 else
11938   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11939 /* end confdefs.h.  */
11940 #include <locale.h>
11941 locale_t x;
11942 int
11943 main ()
11944 {
11945
11946   ;
11947   return 0;
11948 }
11949 _ACEOF
11950 if ac_fn_c_try_compile "$LINENO"; then :
11951   pgac_cv_type_locale_t=yes
11952 else
11953   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11954 /* end confdefs.h.  */
11955 #include <xlocale.h>
11956 locale_t x;
11957 int
11958 main ()
11959 {
11960
11961   ;
11962   return 0;
11963 }
11964 _ACEOF
11965 if ac_fn_c_try_compile "$LINENO"; then :
11966   pgac_cv_type_locale_t='yes (in xlocale.h)'
11967 else
11968   pgac_cv_type_locale_t=no
11969 fi
11970 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11971 fi
11972 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
11973 fi
11974 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_locale_t" >&5
11975 $as_echo "$pgac_cv_type_locale_t" >&6; }
11976 if test "$pgac_cv_type_locale_t" != no; then
11977
11978 $as_echo "#define HAVE_LOCALE_T 1" >>confdefs.h
11979
11980 fi
11981 if test "$pgac_cv_type_locale_t" = 'yes (in xlocale.h)'; then
11982
11983 $as_echo "#define LOCALE_T_IN_XLOCALE 1" >>confdefs.h
11984
11985 fi
11986
11987 ac_fn_c_check_type "$LINENO" "struct cmsgcred" "ac_cv_type_struct_cmsgcred" "#include <sys/socket.h>
11988 #include <sys/param.h>
11989 #ifdef HAVE_SYS_UCRED_H
11990 #include <sys/ucred.h>
11991 #endif
11992 "
11993 if test "x$ac_cv_type_struct_cmsgcred" = xyes; then :
11994
11995 cat >>confdefs.h <<_ACEOF
11996 #define HAVE_STRUCT_CMSGCRED 1
11997 _ACEOF
11998
11999
12000 fi
12001
12002
12003 ac_fn_c_check_type "$LINENO" "struct option" "ac_cv_type_struct_option" "#ifdef HAVE_GETOPT_H
12004 #include <getopt.h>
12005 #endif
12006 "
12007 if test "x$ac_cv_type_struct_option" = xyes; then :
12008
12009 cat >>confdefs.h <<_ACEOF
12010 #define HAVE_STRUCT_OPTION 1
12011 _ACEOF
12012
12013
12014 fi
12015
12016
12017 if test "$with_zlib" = yes; then
12018   # Check that <zlib.h> defines z_streamp (versions before about 1.0.4
12019   # did not).  While we could work around the lack of z_streamp, it
12020   # seems unwise to encourage people to use such old zlib versions...
12021   ac_fn_c_check_type "$LINENO" "z_streamp" "ac_cv_type_z_streamp" "#include <zlib.h>
12022 "
12023 if test "x$ac_cv_type_z_streamp" = xyes; then :
12024
12025 else
12026   as_fn_error $? "zlib version is too old
12027 Use --without-zlib to disable zlib support." "$LINENO" 5
12028 fi
12029
12030 fi
12031
12032 # On PPC, check if assembler supports LWARX instruction's mutex hint bit
12033 case $host_cpu in
12034   ppc*|powerpc*)
12035     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether assembler supports lwarx hint bit" >&5
12036 $as_echo_n "checking whether assembler supports lwarx hint bit... " >&6; }
12037     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12038 /* end confdefs.h.  */
12039
12040 int
12041 main ()
12042 {
12043 int a = 0; int *p = &a; int r;
12044          __asm__ __volatile__ (" lwarx %0,0,%1,1\n" : "=&r"(r) : "r"(p));
12045   ;
12046   return 0;
12047 }
12048 _ACEOF
12049 if ac_fn_c_try_compile "$LINENO"; then :
12050   pgac_cv_have_ppc_mutex_hint=yes
12051 else
12052   pgac_cv_have_ppc_mutex_hint=no
12053 fi
12054 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12055     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_have_ppc_mutex_hint" >&5
12056 $as_echo "$pgac_cv_have_ppc_mutex_hint" >&6; }
12057     if test x"$pgac_cv_have_ppc_mutex_hint" = xyes ; then
12058
12059 $as_echo "#define HAVE_PPC_LWARX_MUTEX_HINT 1" >>confdefs.h
12060
12061     fi
12062   ;;
12063 esac
12064
12065 # Check largefile support.  You might think this is a system service not a
12066 # compiler characteristic, but you'd be wrong.  We must check this before
12067 # probing existence of related functions such as fseeko, since the largefile
12068 # defines can affect what is generated for that.
12069 if test "$PORTNAME" != "win32"; then
12070    # Check whether --enable-largefile was given.
12071 if test "${enable_largefile+set}" = set; then :
12072   enableval=$enable_largefile;
12073 fi
12074
12075 if test "$enable_largefile" != no; then
12076
12077   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
12078 $as_echo_n "checking for special C compiler options needed for large files... " >&6; }
12079 if ${ac_cv_sys_largefile_CC+:} false; then :
12080   $as_echo_n "(cached) " >&6
12081 else
12082   ac_cv_sys_largefile_CC=no
12083      if test "$GCC" != yes; then
12084        ac_save_CC=$CC
12085        while :; do
12086          # IRIX 6.2 and later do not support large files by default,
12087          # so use the C compiler's -n32 option if that helps.
12088          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12089 /* end confdefs.h.  */
12090 #include <sys/types.h>
12091  /* Check that off_t can represent 2**63 - 1 correctly.
12092     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12093     since some C++ compilers masquerading as C compilers
12094     incorrectly reject 9223372036854775807.  */
12095 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12096   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12097                        && LARGE_OFF_T % 2147483647 == 1)
12098                       ? 1 : -1];
12099 int
12100 main ()
12101 {
12102
12103   ;
12104   return 0;
12105 }
12106 _ACEOF
12107          if ac_fn_c_try_compile "$LINENO"; then :
12108   break
12109 fi
12110 rm -f core conftest.err conftest.$ac_objext
12111          CC="$CC -n32"
12112          if ac_fn_c_try_compile "$LINENO"; then :
12113   ac_cv_sys_largefile_CC=' -n32'; break
12114 fi
12115 rm -f core conftest.err conftest.$ac_objext
12116          break
12117        done
12118        CC=$ac_save_CC
12119        rm -f conftest.$ac_ext
12120     fi
12121 fi
12122 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
12123 $as_echo "$ac_cv_sys_largefile_CC" >&6; }
12124   if test "$ac_cv_sys_largefile_CC" != no; then
12125     CC=$CC$ac_cv_sys_largefile_CC
12126   fi
12127
12128   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
12129 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
12130 if ${ac_cv_sys_file_offset_bits+:} false; then :
12131   $as_echo_n "(cached) " >&6
12132 else
12133   while :; do
12134   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12135 /* end confdefs.h.  */
12136 #include <sys/types.h>
12137  /* Check that off_t can represent 2**63 - 1 correctly.
12138     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12139     since some C++ compilers masquerading as C compilers
12140     incorrectly reject 9223372036854775807.  */
12141 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12142   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12143                        && LARGE_OFF_T % 2147483647 == 1)
12144                       ? 1 : -1];
12145 int
12146 main ()
12147 {
12148
12149   ;
12150   return 0;
12151 }
12152 _ACEOF
12153 if ac_fn_c_try_compile "$LINENO"; then :
12154   ac_cv_sys_file_offset_bits=no; break
12155 fi
12156 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12157   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12158 /* end confdefs.h.  */
12159 #define _FILE_OFFSET_BITS 64
12160 #include <sys/types.h>
12161  /* Check that off_t can represent 2**63 - 1 correctly.
12162     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12163     since some C++ compilers masquerading as C compilers
12164     incorrectly reject 9223372036854775807.  */
12165 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12166   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12167                        && LARGE_OFF_T % 2147483647 == 1)
12168                       ? 1 : -1];
12169 int
12170 main ()
12171 {
12172
12173   ;
12174   return 0;
12175 }
12176 _ACEOF
12177 if ac_fn_c_try_compile "$LINENO"; then :
12178   ac_cv_sys_file_offset_bits=64; break
12179 fi
12180 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12181   ac_cv_sys_file_offset_bits=unknown
12182   break
12183 done
12184 fi
12185 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
12186 $as_echo "$ac_cv_sys_file_offset_bits" >&6; }
12187 case $ac_cv_sys_file_offset_bits in #(
12188   no | unknown) ;;
12189   *)
12190 cat >>confdefs.h <<_ACEOF
12191 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
12192 _ACEOF
12193 ;;
12194 esac
12195 rm -rf conftest*
12196   if test $ac_cv_sys_file_offset_bits = unknown; then
12197     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
12198 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
12199 if ${ac_cv_sys_large_files+:} false; then :
12200   $as_echo_n "(cached) " >&6
12201 else
12202   while :; do
12203   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12204 /* end confdefs.h.  */
12205 #include <sys/types.h>
12206  /* Check that off_t can represent 2**63 - 1 correctly.
12207     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12208     since some C++ compilers masquerading as C compilers
12209     incorrectly reject 9223372036854775807.  */
12210 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12211   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12212                        && LARGE_OFF_T % 2147483647 == 1)
12213                       ? 1 : -1];
12214 int
12215 main ()
12216 {
12217
12218   ;
12219   return 0;
12220 }
12221 _ACEOF
12222 if ac_fn_c_try_compile "$LINENO"; then :
12223   ac_cv_sys_large_files=no; break
12224 fi
12225 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12226   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12227 /* end confdefs.h.  */
12228 #define _LARGE_FILES 1
12229 #include <sys/types.h>
12230  /* Check that off_t can represent 2**63 - 1 correctly.
12231     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12232     since some C++ compilers masquerading as C compilers
12233     incorrectly reject 9223372036854775807.  */
12234 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12235   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12236                        && LARGE_OFF_T % 2147483647 == 1)
12237                       ? 1 : -1];
12238 int
12239 main ()
12240 {
12241
12242   ;
12243   return 0;
12244 }
12245 _ACEOF
12246 if ac_fn_c_try_compile "$LINENO"; then :
12247   ac_cv_sys_large_files=1; break
12248 fi
12249 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12250   ac_cv_sys_large_files=unknown
12251   break
12252 done
12253 fi
12254 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
12255 $as_echo "$ac_cv_sys_large_files" >&6; }
12256 case $ac_cv_sys_large_files in #(
12257   no | unknown) ;;
12258   *)
12259 cat >>confdefs.h <<_ACEOF
12260 #define _LARGE_FILES $ac_cv_sys_large_files
12261 _ACEOF
12262 ;;
12263 esac
12264 rm -rf conftest*
12265   fi
12266
12267
12268 fi
12269
12270
12271 fi
12272
12273 # Check for largefile support (must be after AC_SYS_LARGEFILE)
12274 # The cast to long int works around a bug in the HP C Compiler
12275 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
12276 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
12277 # This bug is HP SR number 8606223364.
12278 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
12279 $as_echo_n "checking size of off_t... " >&6; }
12280 if ${ac_cv_sizeof_off_t+:} false; then :
12281   $as_echo_n "(cached) " >&6
12282 else
12283   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t"        "$ac_includes_default"; then :
12284
12285 else
12286   if test "$ac_cv_type_off_t" = yes; then
12287      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
12288 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
12289 as_fn_error 77 "cannot compute sizeof (off_t)
12290 See \`config.log' for more details" "$LINENO" 5; }
12291    else
12292      ac_cv_sizeof_off_t=0
12293    fi
12294 fi
12295
12296 fi
12297 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
12298 $as_echo "$ac_cv_sizeof_off_t" >&6; }
12299
12300
12301
12302 cat >>confdefs.h <<_ACEOF
12303 #define SIZEOF_OFF_T $ac_cv_sizeof_off_t
12304 _ACEOF
12305
12306
12307
12308 # If we don't have largefile support, can't handle segsize >= 2GB.
12309 if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then
12310    as_fn_error $? "Large file support is not enabled. Segment size cannot be larger than 1GB." "$LINENO" 5
12311 fi
12312
12313
12314 ##
12315 ## Functions, global variables
12316 ##
12317
12318 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int timezone" >&5
12319 $as_echo_n "checking for int timezone... " >&6; }
12320 if ${pgac_cv_var_int_timezone+:} false; then :
12321   $as_echo_n "(cached) " >&6
12322 else
12323   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12324 /* end confdefs.h.  */
12325 #include <time.h>
12326 int res;
12327 int
12328 main ()
12329 {
12330 #ifndef __CYGWIN__
12331 res = timezone / 60;
12332 #else
12333 res = _timezone / 60;
12334 #endif
12335   ;
12336   return 0;
12337 }
12338 _ACEOF
12339 if ac_fn_c_try_link "$LINENO"; then :
12340   pgac_cv_var_int_timezone=yes
12341 else
12342   pgac_cv_var_int_timezone=no
12343 fi
12344 rm -f core conftest.err conftest.$ac_objext \
12345     conftest$ac_exeext conftest.$ac_ext
12346 fi
12347 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_timezone" >&5
12348 $as_echo "$pgac_cv_var_int_timezone" >&6; }
12349 if test x"$pgac_cv_var_int_timezone" = xyes ; then
12350
12351 $as_echo "#define HAVE_INT_TIMEZONE 1" >>confdefs.h
12352
12353 fi
12354 { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for accept()" >&5
12355 $as_echo_n "checking types of arguments for accept()... " >&6; }
12356  if ${ac_cv_func_accept_return+:} false; then :
12357   $as_echo_n "(cached) " >&6
12358 else
12359    if ${ac_cv_func_accept_arg1+:} false; then :
12360   $as_echo_n "(cached) " >&6
12361 else
12362     if ${ac_cv_func_accept_arg2+:} false; then :
12363   $as_echo_n "(cached) " >&6
12364 else
12365      if ${ac_cv_func_accept_arg3+:} false; then :
12366   $as_echo_n "(cached) " >&6
12367 else
12368       for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET WSAAPI'; do
12369       for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do
12370        for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
12371         for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
12372          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12373 /* end confdefs.h.  */
12374 #ifdef HAVE_SYS_TYPES_H
12375 #include <sys/types.h>
12376 #endif
12377 #ifdef HAVE_SYS_SOCKET_H
12378 #include <sys/socket.h>
12379 #endif
12380 extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);
12381 _ACEOF
12382 if ac_fn_c_try_compile "$LINENO"; then :
12383   ac_not_found=no; break 4
12384 else
12385   ac_not_found=yes
12386 fi
12387 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12388        done
12389       done
12390      done
12391     done
12392     if test "$ac_not_found" = yes; then
12393       as_fn_error $? "could not determine argument types" "$LINENO" 5
12394     fi
12395     if test "$ac_cv_func_accept_arg3" = "void"; then
12396       ac_cv_func_accept_arg3=int
12397     fi
12398
12399 fi
12400
12401 fi
12402
12403 fi
12404
12405 fi
12406  { $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
12407 $as_echo "$ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&6; }
12408
12409 cat >>confdefs.h <<_ACEOF
12410 #define ACCEPT_TYPE_RETURN $ac_cv_func_accept_return
12411 _ACEOF
12412
12413
12414 cat >>confdefs.h <<_ACEOF
12415 #define ACCEPT_TYPE_ARG1 $ac_cv_func_accept_arg1
12416 _ACEOF
12417
12418
12419 cat >>confdefs.h <<_ACEOF
12420 #define ACCEPT_TYPE_ARG2 $ac_cv_func_accept_arg2
12421 _ACEOF
12422
12423
12424 cat >>confdefs.h <<_ACEOF
12425 #define ACCEPT_TYPE_ARG3 $ac_cv_func_accept_arg3
12426 _ACEOF
12427
12428
12429 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday takes only one argument" >&5
12430 $as_echo_n "checking whether gettimeofday takes only one argument... " >&6; }
12431 if ${pgac_cv_func_gettimeofday_1arg+:} false; then :
12432   $as_echo_n "(cached) " >&6
12433 else
12434   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12435 /* end confdefs.h.  */
12436 #include <sys/time.h>
12437 int
12438 main ()
12439 {
12440 struct timeval *tp;
12441 struct timezone *tzp;
12442 gettimeofday(tp,tzp);
12443   ;
12444   return 0;
12445 }
12446 _ACEOF
12447 if ac_fn_c_try_compile "$LINENO"; then :
12448   pgac_cv_func_gettimeofday_1arg=no
12449 else
12450   pgac_cv_func_gettimeofday_1arg=yes
12451 fi
12452 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12453 fi
12454 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_gettimeofday_1arg" >&5
12455 $as_echo "$pgac_cv_func_gettimeofday_1arg" >&6; }
12456 if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
12457
12458 $as_echo "#define GETTIMEOFDAY_1ARG 1" >>confdefs.h
12459
12460 fi
12461
12462 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wcstombs_l declaration" >&5
12463 $as_echo_n "checking for wcstombs_l declaration... " >&6; }
12464 if ${pgac_cv_func_wcstombs_l+:} false; then :
12465   $as_echo_n "(cached) " >&6
12466 else
12467   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12468 /* end confdefs.h.  */
12469 #include <stdlib.h>
12470 #include <locale.h>
12471 int
12472 main ()
12473 {
12474 #ifndef wcstombs_l
12475 (void) wcstombs_l;
12476 #endif
12477   ;
12478   return 0;
12479 }
12480 _ACEOF
12481 if ac_fn_c_try_compile "$LINENO"; then :
12482   pgac_cv_func_wcstombs_l='yes'
12483 else
12484   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12485 /* end confdefs.h.  */
12486 #include <stdlib.h>
12487 #include <locale.h>
12488 #include <xlocale.h>
12489 int
12490 main ()
12491 {
12492 #ifndef wcstombs_l
12493 (void) wcstombs_l;
12494 #endif
12495   ;
12496   return 0;
12497 }
12498 _ACEOF
12499 if ac_fn_c_try_compile "$LINENO"; then :
12500   pgac_cv_func_wcstombs_l='yes (in xlocale.h)'
12501 else
12502   pgac_cv_func_wcstombs_l='no'
12503 fi
12504 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12505 fi
12506 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12507 fi
12508 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_wcstombs_l" >&5
12509 $as_echo "$pgac_cv_func_wcstombs_l" >&6; }
12510 if test "$pgac_cv_func_wcstombs_l" = 'yes (in xlocale.h)'; then
12511
12512 $as_echo "#define WCSTOMBS_L_IN_XLOCALE 1" >>confdefs.h
12513
12514 fi
12515
12516 # Some versions of libedit contain strlcpy(), setproctitle(), and other
12517 # symbols that that library has no business exposing to the world.  Pending
12518 # acquisition of a clue by those developers, ignore libedit (including its
12519 # possible alias of libreadline) while checking for everything else.
12520 LIBS_including_readline="$LIBS"
12521 LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
12522
12523 for ac_func in cbrt dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat pthread_is_threaded_np readlink setproctitle setsid shm_open symlink sync_file_range towlower utime utimes wcstombs wcstombs_l
12524 do :
12525   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
12526 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
12527 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
12528   cat >>confdefs.h <<_ACEOF
12529 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
12530 _ACEOF
12531
12532 fi
12533 done
12534
12535
12536 ac_fn_c_check_func "$LINENO" "fseeko" "ac_cv_func_fseeko"
12537 if test "x$ac_cv_func_fseeko" = xyes; then :
12538   $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
12539
12540 else
12541   case " $LIBOBJS " in
12542   *" fseeko.$ac_objext "* ) ;;
12543   *) LIBOBJS="$LIBOBJS fseeko.$ac_objext"
12544  ;;
12545 esac
12546
12547 fi
12548
12549
12550 case $host_os in
12551         # NetBSD uses a custom fseeko/ftello built on fsetpos/fgetpos
12552         # Mingw uses macros to access Win32 API calls
12553         netbsd*|mingw*)
12554
12555 $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
12556
12557                 ac_cv_func_fseeko=yes;;
12558         *)
12559                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
12560 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
12561 if ${ac_cv_sys_largefile_source+:} false; then :
12562   $as_echo_n "(cached) " >&6
12563 else
12564   while :; do
12565   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12566 /* end confdefs.h.  */
12567 #include <sys/types.h> /* for off_t */
12568      #include <stdio.h>
12569 int
12570 main ()
12571 {
12572 int (*fp) (FILE *, off_t, int) = fseeko;
12573      return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
12574   ;
12575   return 0;
12576 }
12577 _ACEOF
12578 if ac_fn_c_try_link "$LINENO"; then :
12579   ac_cv_sys_largefile_source=no; break
12580 fi
12581 rm -f core conftest.err conftest.$ac_objext \
12582     conftest$ac_exeext conftest.$ac_ext
12583   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12584 /* end confdefs.h.  */
12585 #define _LARGEFILE_SOURCE 1
12586 #include <sys/types.h> /* for off_t */
12587      #include <stdio.h>
12588 int
12589 main ()
12590 {
12591 int (*fp) (FILE *, off_t, int) = fseeko;
12592      return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
12593   ;
12594   return 0;
12595 }
12596 _ACEOF
12597 if ac_fn_c_try_link "$LINENO"; then :
12598   ac_cv_sys_largefile_source=1; break
12599 fi
12600 rm -f core conftest.err conftest.$ac_objext \
12601     conftest$ac_exeext conftest.$ac_ext
12602   ac_cv_sys_largefile_source=unknown
12603   break
12604 done
12605 fi
12606 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
12607 $as_echo "$ac_cv_sys_largefile_source" >&6; }
12608 case $ac_cv_sys_largefile_source in #(
12609   no | unknown) ;;
12610   *)
12611 cat >>confdefs.h <<_ACEOF
12612 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
12613 _ACEOF
12614 ;;
12615 esac
12616 rm -rf conftest*
12617
12618 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
12619 # in glibc 2.1.3, but that breaks too many other things.
12620 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
12621 if test $ac_cv_sys_largefile_source != unknown; then
12622
12623 $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
12624
12625 fi
12626 ;;
12627 esac
12628
12629 # posix_fadvise() is a no-op on Solaris, so don't incur function overhead
12630 # by calling it, 2009-04-02
12631 # http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/posix_fadvise.c
12632 if test "$PORTNAME" != "solaris"; then
12633 for ac_func in posix_fadvise
12634 do :
12635   ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise"
12636 if test "x$ac_cv_func_posix_fadvise" = xyes; then :
12637   cat >>confdefs.h <<_ACEOF
12638 #define HAVE_POSIX_FADVISE 1
12639 _ACEOF
12640
12641 fi
12642 done
12643
12644 ac_fn_c_check_decl "$LINENO" "posix_fadvise" "ac_cv_have_decl_posix_fadvise" "#include <fcntl.h>
12645 "
12646 if test "x$ac_cv_have_decl_posix_fadvise" = xyes; then :
12647   ac_have_decl=1
12648 else
12649   ac_have_decl=0
12650 fi
12651
12652 cat >>confdefs.h <<_ACEOF
12653 #define HAVE_DECL_POSIX_FADVISE $ac_have_decl
12654 _ACEOF
12655
12656 fi
12657
12658 ac_fn_c_check_decl "$LINENO" "fdatasync" "ac_cv_have_decl_fdatasync" "#include <unistd.h>
12659 "
12660 if test "x$ac_cv_have_decl_fdatasync" = xyes; then :
12661   ac_have_decl=1
12662 else
12663   ac_have_decl=0
12664 fi
12665
12666 cat >>confdefs.h <<_ACEOF
12667 #define HAVE_DECL_FDATASYNC $ac_have_decl
12668 _ACEOF
12669
12670 ac_fn_c_check_decl "$LINENO" "strlcat" "ac_cv_have_decl_strlcat" "$ac_includes_default"
12671 if test "x$ac_cv_have_decl_strlcat" = xyes; then :
12672   ac_have_decl=1
12673 else
12674   ac_have_decl=0
12675 fi
12676
12677 cat >>confdefs.h <<_ACEOF
12678 #define HAVE_DECL_STRLCAT $ac_have_decl
12679 _ACEOF
12680 ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" "$ac_includes_default"
12681 if test "x$ac_cv_have_decl_strlcpy" = xyes; then :
12682   ac_have_decl=1
12683 else
12684   ac_have_decl=0
12685 fi
12686
12687 cat >>confdefs.h <<_ACEOF
12688 #define HAVE_DECL_STRLCPY $ac_have_decl
12689 _ACEOF
12690
12691 # This is probably only present on macOS, but may as well check always
12692 ac_fn_c_check_decl "$LINENO" "F_FULLFSYNC" "ac_cv_have_decl_F_FULLFSYNC" "#include <fcntl.h>
12693 "
12694 if test "x$ac_cv_have_decl_F_FULLFSYNC" = xyes; then :
12695   ac_have_decl=1
12696 else
12697   ac_have_decl=0
12698 fi
12699
12700 cat >>confdefs.h <<_ACEOF
12701 #define HAVE_DECL_F_FULLFSYNC $ac_have_decl
12702 _ACEOF
12703
12704
12705 HAVE_IPV6=no
12706 ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "$ac_includes_default
12707 #include <netinet/in.h>
12708 "
12709 if test "x$ac_cv_type_struct_sockaddr_in6" = xyes; then :
12710
12711 $as_echo "#define HAVE_IPV6 1" >>confdefs.h
12712
12713          HAVE_IPV6=yes
12714 fi
12715
12716
12717
12718 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PS_STRINGS" >&5
12719 $as_echo_n "checking for PS_STRINGS... " >&6; }
12720 if ${pgac_cv_var_PS_STRINGS+:} false; then :
12721   $as_echo_n "(cached) " >&6
12722 else
12723   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12724 /* end confdefs.h.  */
12725 #include <machine/vmparam.h>
12726 #include <sys/exec.h>
12727
12728 int
12729 main ()
12730 {
12731 PS_STRINGS->ps_nargvstr = 1;
12732 PS_STRINGS->ps_argvstr = "foo";
12733   ;
12734   return 0;
12735 }
12736 _ACEOF
12737 if ac_fn_c_try_link "$LINENO"; then :
12738   pgac_cv_var_PS_STRINGS=yes
12739 else
12740   pgac_cv_var_PS_STRINGS=no
12741 fi
12742 rm -f core conftest.err conftest.$ac_objext \
12743     conftest$ac_exeext conftest.$ac_ext
12744 fi
12745 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_PS_STRINGS" >&5
12746 $as_echo "$pgac_cv_var_PS_STRINGS" >&6; }
12747 if test "$pgac_cv_var_PS_STRINGS" = yes ; then
12748
12749 $as_echo "#define HAVE_PS_STRINGS 1" >>confdefs.h
12750
12751 fi
12752
12753
12754 # We use our snprintf.c emulation if either snprintf() or vsnprintf()
12755 # is missing.  Yes, there are machines that have only one.  We may
12756 # also decide to use snprintf.c if snprintf() is present but does not
12757 # have all the features we need --- see below.
12758
12759 if test "$PORTNAME" = "win32"; then
12760   # Win32 gets snprintf.c built unconditionally.
12761   #
12762   # To properly translate all NLS languages strings, we must support the
12763   # *printf() %$ format, which allows *printf() arguments to be selected
12764   # by position in the translated string.
12765   #
12766   # libintl versions < 0.13 use the native *printf() functions, and Win32
12767   # *printf() doesn't understand %$, so we must use our /port versions,
12768   # which do understand %$. libintl versions >= 0.13 include their own
12769   # *printf versions on Win32.  The libintl 0.13 release note text is:
12770   #
12771   #   C format strings with positions, as they arise when a translator
12772   #   needs to reorder a sentence, are now supported on all platforms.
12773   #   On those few platforms (NetBSD and Woe32) for which the native
12774   #   printf()/fprintf()/... functions don't support such format
12775   #   strings, replacements are provided through <libintl.h>.
12776   #
12777   # We could use libintl >= 0.13's *printf() if we were sure that we had
12778   # a litint >= 0.13 at runtime, but seeing that there is no clean way
12779   # to guarantee that, it is best to just use our own, so we are sure to
12780   # get %$ support. In include/port.h we disable the *printf() macros
12781   # that might have been defined by libintl.
12782   #
12783   # We do this unconditionally whether NLS is used or not so we are sure
12784   # that all Win32 libraries and binaries behave the same.
12785   pgac_need_repl_snprintf=yes
12786 else
12787   pgac_need_repl_snprintf=no
12788   for ac_func in snprintf
12789 do :
12790   ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
12791 if test "x$ac_cv_func_snprintf" = xyes; then :
12792   cat >>confdefs.h <<_ACEOF
12793 #define HAVE_SNPRINTF 1
12794 _ACEOF
12795
12796 else
12797   pgac_need_repl_snprintf=yes
12798 fi
12799 done
12800
12801   for ac_func in vsnprintf
12802 do :
12803   ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf"
12804 if test "x$ac_cv_func_vsnprintf" = xyes; then :
12805   cat >>confdefs.h <<_ACEOF
12806 #define HAVE_VSNPRINTF 1
12807 _ACEOF
12808
12809 else
12810   pgac_need_repl_snprintf=yes
12811 fi
12812 done
12813
12814 fi
12815
12816
12817 # Check whether <stdio.h> declares snprintf() and vsnprintf(); if not,
12818 # include/c.h will provide declarations.  Note this is a separate test
12819 # from whether the functions exist in the C library --- there are
12820 # systems that have the functions but don't bother to declare them :-(
12821
12822 ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default"
12823 if test "x$ac_cv_have_decl_snprintf" = xyes; then :
12824   ac_have_decl=1
12825 else
12826   ac_have_decl=0
12827 fi
12828
12829 cat >>confdefs.h <<_ACEOF
12830 #define HAVE_DECL_SNPRINTF $ac_have_decl
12831 _ACEOF
12832 ac_fn_c_check_decl "$LINENO" "vsnprintf" "ac_cv_have_decl_vsnprintf" "$ac_includes_default"
12833 if test "x$ac_cv_have_decl_vsnprintf" = xyes; then :
12834   ac_have_decl=1
12835 else
12836   ac_have_decl=0
12837 fi
12838
12839 cat >>confdefs.h <<_ACEOF
12840 #define HAVE_DECL_VSNPRINTF $ac_have_decl
12841 _ACEOF
12842
12843
12844
12845 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf" >&5
12846 $as_echo_n "checking for isinf... " >&6; }
12847 if ${ac_cv_func_isinf+:} false; then :
12848   $as_echo_n "(cached) " >&6
12849 else
12850   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12851 /* end confdefs.h.  */
12852
12853 #include <math.h>
12854 double glob_double;
12855
12856 int
12857 main ()
12858 {
12859 return isinf(glob_double) ? 0 : 1;
12860   ;
12861   return 0;
12862 }
12863 _ACEOF
12864 if ac_fn_c_try_link "$LINENO"; then :
12865   ac_cv_func_isinf=yes
12866 else
12867   ac_cv_func_isinf=no
12868 fi
12869 rm -f core conftest.err conftest.$ac_objext \
12870     conftest$ac_exeext conftest.$ac_ext
12871 fi
12872 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_isinf" >&5
12873 $as_echo "$ac_cv_func_isinf" >&6; }
12874
12875 if test $ac_cv_func_isinf = yes ; then
12876
12877 $as_echo "#define HAVE_ISINF 1" >>confdefs.h
12878
12879 else
12880   case " $LIBOBJS " in
12881   *" isinf.$ac_objext "* ) ;;
12882   *) LIBOBJS="$LIBOBJS isinf.$ac_objext"
12883  ;;
12884 esac
12885
12886   # Look for a way to implement a substitute for isinf()
12887   for ac_func in fpclass fp_class fp_class_d class
12888 do :
12889   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
12890 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
12891 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
12892   cat >>confdefs.h <<_ACEOF
12893 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
12894 _ACEOF
12895  break
12896 fi
12897 done
12898
12899 fi
12900
12901 ac_fn_c_check_func "$LINENO" "crypt" "ac_cv_func_crypt"
12902 if test "x$ac_cv_func_crypt" = xyes; then :
12903   $as_echo "#define HAVE_CRYPT 1" >>confdefs.h
12904
12905 else
12906   case " $LIBOBJS " in
12907   *" crypt.$ac_objext "* ) ;;
12908   *) LIBOBJS="$LIBOBJS crypt.$ac_objext"
12909  ;;
12910 esac
12911
12912 fi
12913
12914 ac_fn_c_check_func "$LINENO" "fls" "ac_cv_func_fls"
12915 if test "x$ac_cv_func_fls" = xyes; then :
12916   $as_echo "#define HAVE_FLS 1" >>confdefs.h
12917
12918 else
12919   case " $LIBOBJS " in
12920   *" fls.$ac_objext "* ) ;;
12921   *) LIBOBJS="$LIBOBJS fls.$ac_objext"
12922  ;;
12923 esac
12924
12925 fi
12926
12927 ac_fn_c_check_func "$LINENO" "getopt" "ac_cv_func_getopt"
12928 if test "x$ac_cv_func_getopt" = xyes; then :
12929   $as_echo "#define HAVE_GETOPT 1" >>confdefs.h
12930
12931 else
12932   case " $LIBOBJS " in
12933   *" getopt.$ac_objext "* ) ;;
12934   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
12935  ;;
12936 esac
12937
12938 fi
12939
12940 ac_fn_c_check_func "$LINENO" "getrusage" "ac_cv_func_getrusage"
12941 if test "x$ac_cv_func_getrusage" = xyes; then :
12942   $as_echo "#define HAVE_GETRUSAGE 1" >>confdefs.h
12943
12944 else
12945   case " $LIBOBJS " in
12946   *" getrusage.$ac_objext "* ) ;;
12947   *) LIBOBJS="$LIBOBJS getrusage.$ac_objext"
12948  ;;
12949 esac
12950
12951 fi
12952
12953 ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton"
12954 if test "x$ac_cv_func_inet_aton" = xyes; then :
12955   $as_echo "#define HAVE_INET_ATON 1" >>confdefs.h
12956
12957 else
12958   case " $LIBOBJS " in
12959   *" inet_aton.$ac_objext "* ) ;;
12960   *) LIBOBJS="$LIBOBJS inet_aton.$ac_objext"
12961  ;;
12962 esac
12963
12964 fi
12965
12966 ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
12967 if test "x$ac_cv_func_mkdtemp" = xyes; then :
12968   $as_echo "#define HAVE_MKDTEMP 1" >>confdefs.h
12969
12970 else
12971   case " $LIBOBJS " in
12972   *" mkdtemp.$ac_objext "* ) ;;
12973   *) LIBOBJS="$LIBOBJS mkdtemp.$ac_objext"
12974  ;;
12975 esac
12976
12977 fi
12978
12979 ac_fn_c_check_func "$LINENO" "random" "ac_cv_func_random"
12980 if test "x$ac_cv_func_random" = xyes; then :
12981   $as_echo "#define HAVE_RANDOM 1" >>confdefs.h
12982
12983 else
12984   case " $LIBOBJS " in
12985   *" random.$ac_objext "* ) ;;
12986   *) LIBOBJS="$LIBOBJS random.$ac_objext"
12987  ;;
12988 esac
12989
12990 fi
12991
12992 ac_fn_c_check_func "$LINENO" "rint" "ac_cv_func_rint"
12993 if test "x$ac_cv_func_rint" = xyes; then :
12994   $as_echo "#define HAVE_RINT 1" >>confdefs.h
12995
12996 else
12997   case " $LIBOBJS " in
12998   *" rint.$ac_objext "* ) ;;
12999   *) LIBOBJS="$LIBOBJS rint.$ac_objext"
13000  ;;
13001 esac
13002
13003 fi
13004
13005 ac_fn_c_check_func "$LINENO" "srandom" "ac_cv_func_srandom"
13006 if test "x$ac_cv_func_srandom" = xyes; then :
13007   $as_echo "#define HAVE_SRANDOM 1" >>confdefs.h
13008
13009 else
13010   case " $LIBOBJS " in
13011   *" srandom.$ac_objext "* ) ;;
13012   *) LIBOBJS="$LIBOBJS srandom.$ac_objext"
13013  ;;
13014 esac
13015
13016 fi
13017
13018 ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror"
13019 if test "x$ac_cv_func_strerror" = xyes; then :
13020   $as_echo "#define HAVE_STRERROR 1" >>confdefs.h
13021
13022 else
13023   case " $LIBOBJS " in
13024   *" strerror.$ac_objext "* ) ;;
13025   *) LIBOBJS="$LIBOBJS strerror.$ac_objext"
13026  ;;
13027 esac
13028
13029 fi
13030
13031 ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat"
13032 if test "x$ac_cv_func_strlcat" = xyes; then :
13033   $as_echo "#define HAVE_STRLCAT 1" >>confdefs.h
13034
13035 else
13036   case " $LIBOBJS " in
13037   *" strlcat.$ac_objext "* ) ;;
13038   *) LIBOBJS="$LIBOBJS strlcat.$ac_objext"
13039  ;;
13040 esac
13041
13042 fi
13043
13044 ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy"
13045 if test "x$ac_cv_func_strlcpy" = xyes; then :
13046   $as_echo "#define HAVE_STRLCPY 1" >>confdefs.h
13047
13048 else
13049   case " $LIBOBJS " in
13050   *" strlcpy.$ac_objext "* ) ;;
13051   *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext"
13052  ;;
13053 esac
13054
13055 fi
13056
13057
13058
13059 case $host_os in
13060
13061         # Windows uses a specialised env handler
13062         # and doesn't need a replacement getpeereid because it doesn't use
13063         # Unix sockets.
13064         mingw*)
13065
13066 $as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
13067
13068
13069 $as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
13070
13071                 ac_cv_func_unsetenv=yes
13072                 ac_cv_func_getpeereid=yes;;
13073         *)
13074                 ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
13075 if test "x$ac_cv_func_unsetenv" = xyes; then :
13076   $as_echo "#define HAVE_UNSETENV 1" >>confdefs.h
13077
13078 else
13079   case " $LIBOBJS " in
13080   *" unsetenv.$ac_objext "* ) ;;
13081   *) LIBOBJS="$LIBOBJS unsetenv.$ac_objext"
13082  ;;
13083 esac
13084
13085 fi
13086
13087 ac_fn_c_check_func "$LINENO" "getpeereid" "ac_cv_func_getpeereid"
13088 if test "x$ac_cv_func_getpeereid" = xyes; then :
13089   $as_echo "#define HAVE_GETPEEREID 1" >>confdefs.h
13090
13091 else
13092   case " $LIBOBJS " in
13093   *" getpeereid.$ac_objext "* ) ;;
13094   *) LIBOBJS="$LIBOBJS getpeereid.$ac_objext"
13095  ;;
13096 esac
13097
13098 fi
13099
13100
13101                 ;;
13102 esac
13103
13104 # System's version of getaddrinfo(), if any, may be used only if we found
13105 # a definition for struct addrinfo; see notes in src/include/getaddrinfo.h.
13106 # We use only our own getaddrinfo.c on Windows, but it's time to revisit that.
13107 if test x"$ac_cv_type_struct_addrinfo" = xyes && \
13108    test "$PORTNAME" != "win32"; then
13109   ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo"
13110 if test "x$ac_cv_func_getaddrinfo" = xyes; then :
13111   $as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h
13112
13113 else
13114   case " $LIBOBJS " in
13115   *" getaddrinfo.$ac_objext "* ) ;;
13116   *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext"
13117  ;;
13118 esac
13119
13120 fi
13121
13122
13123 else
13124   case " $LIBOBJS " in
13125   *" getaddrinfo.$ac_objext "* ) ;;
13126   *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext"
13127  ;;
13128 esac
13129
13130 fi
13131
13132 # Similarly, use system's getopt_long() only if system provides struct option.
13133 if test x"$ac_cv_type_struct_option" = xyes ; then
13134   ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long"
13135 if test "x$ac_cv_func_getopt_long" = xyes; then :
13136   $as_echo "#define HAVE_GETOPT_LONG 1" >>confdefs.h
13137
13138 else
13139   case " $LIBOBJS " in
13140   *" getopt_long.$ac_objext "* ) ;;
13141   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
13142  ;;
13143 esac
13144
13145 fi
13146
13147
13148 else
13149   case " $LIBOBJS " in
13150   *" getopt_long.$ac_objext "* ) ;;
13151   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
13152  ;;
13153 esac
13154
13155 fi
13156
13157 # Solaris' getopt() doesn't do what we want for long options, so always use
13158 # our version on that platform.
13159 if test "$PORTNAME" = "solaris"; then
13160   case " $LIBOBJS " in
13161   *" getopt.$ac_objext "* ) ;;
13162   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
13163  ;;
13164 esac
13165
13166 fi
13167
13168 # mingw has adopted a GNU-centric interpretation of optind/optreset,
13169 # so always use our version on Windows.
13170 if test "$PORTNAME" = "win32"; then
13171   case " $LIBOBJS " in
13172   *" getopt.$ac_objext "* ) ;;
13173   *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
13174  ;;
13175 esac
13176
13177   case " $LIBOBJS " in
13178   *" getopt_long.$ac_objext "* ) ;;
13179   *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
13180  ;;
13181 esac
13182
13183 fi
13184
13185 # Win32 (really MinGW) support
13186 if test "$PORTNAME" = "win32"; then
13187   ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
13188 if test "x$ac_cv_func_gettimeofday" = xyes; then :
13189   $as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
13190
13191 else
13192   case " $LIBOBJS " in
13193   *" gettimeofday.$ac_objext "* ) ;;
13194   *) LIBOBJS="$LIBOBJS gettimeofday.$ac_objext"
13195  ;;
13196 esac
13197
13198 fi
13199
13200
13201   case " $LIBOBJS " in
13202   *" dirmod.$ac_objext "* ) ;;
13203   *) LIBOBJS="$LIBOBJS dirmod.$ac_objext"
13204  ;;
13205 esac
13206
13207   case " $LIBOBJS " in
13208   *" kill.$ac_objext "* ) ;;
13209   *) LIBOBJS="$LIBOBJS kill.$ac_objext"
13210  ;;
13211 esac
13212
13213   case " $LIBOBJS " in
13214   *" open.$ac_objext "* ) ;;
13215   *) LIBOBJS="$LIBOBJS open.$ac_objext"
13216  ;;
13217 esac
13218
13219   case " $LIBOBJS " in
13220   *" system.$ac_objext "* ) ;;
13221   *) LIBOBJS="$LIBOBJS system.$ac_objext"
13222  ;;
13223 esac
13224
13225   case " $LIBOBJS " in
13226   *" win32env.$ac_objext "* ) ;;
13227   *) LIBOBJS="$LIBOBJS win32env.$ac_objext"
13228  ;;
13229 esac
13230
13231   case " $LIBOBJS " in
13232   *" win32error.$ac_objext "* ) ;;
13233   *) LIBOBJS="$LIBOBJS win32error.$ac_objext"
13234  ;;
13235 esac
13236
13237   case " $LIBOBJS " in
13238   *" win32security.$ac_objext "* ) ;;
13239   *) LIBOBJS="$LIBOBJS win32security.$ac_objext"
13240  ;;
13241 esac
13242
13243   case " $LIBOBJS " in
13244   *" win32setlocale.$ac_objext "* ) ;;
13245   *) LIBOBJS="$LIBOBJS win32setlocale.$ac_objext"
13246  ;;
13247 esac
13248
13249
13250 $as_echo "#define HAVE_SYMLINK 1" >>confdefs.h
13251
13252   ac_fn_c_check_type "$LINENO" "MINIDUMP_TYPE" "ac_cv_type_MINIDUMP_TYPE" "
13253 #define WIN32_LEAN_AND_MEAN
13254 #include <windows.h>
13255 #include <string.h>
13256 #include <dbghelp.h>
13257 "
13258 if test "x$ac_cv_type_MINIDUMP_TYPE" = xyes; then :
13259
13260 cat >>confdefs.h <<_ACEOF
13261 #define HAVE_MINIDUMP_TYPE 1
13262 _ACEOF
13263
13264 pgac_minidump_type=yes
13265 else
13266   pgac_minidump_type=no
13267 fi
13268
13269 fi
13270 if test x"$pgac_minidump_type" = x"yes" ; then
13271   have_win32_dbghelp=yes
13272
13273 else
13274   have_win32_dbghelp=no
13275
13276 fi
13277
13278 # Cygwin needs only a bit of that
13279 if test "$PORTNAME" = "cygwin"; then
13280   case " $LIBOBJS " in
13281   *" dirmod.$ac_objext "* ) ;;
13282   *) LIBOBJS="$LIBOBJS dirmod.$ac_objext"
13283  ;;
13284 esac
13285
13286 fi
13287
13288 ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include <signal.h>
13289 /* NetBSD declares sys_siglist in unistd.h.  */
13290 #ifdef HAVE_UNISTD_H
13291 # include <unistd.h>
13292 #endif
13293
13294 "
13295 if test "x$ac_cv_have_decl_sys_siglist" = xyes; then :
13296   ac_have_decl=1
13297 else
13298   ac_have_decl=0
13299 fi
13300
13301 cat >>confdefs.h <<_ACEOF
13302 #define HAVE_DECL_SYS_SIGLIST $ac_have_decl
13303 _ACEOF
13304
13305
13306 ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog"
13307 if test "x$ac_cv_func_syslog" = xyes; then :
13308   ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default"
13309 if test "x$ac_cv_header_syslog_h" = xyes; then :
13310
13311 $as_echo "#define HAVE_SYSLOG 1" >>confdefs.h
13312
13313 fi
13314
13315
13316 fi
13317
13318
13319 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opterr" >&5
13320 $as_echo_n "checking for opterr... " >&6; }
13321 if ${pgac_cv_var_int_opterr+:} false; then :
13322   $as_echo_n "(cached) " >&6
13323 else
13324   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13325 /* end confdefs.h.  */
13326 #include <unistd.h>
13327 int
13328 main ()
13329 {
13330 extern int opterr; opterr = 1;
13331   ;
13332   return 0;
13333 }
13334 _ACEOF
13335 if ac_fn_c_try_link "$LINENO"; then :
13336   pgac_cv_var_int_opterr=yes
13337 else
13338   pgac_cv_var_int_opterr=no
13339 fi
13340 rm -f core conftest.err conftest.$ac_objext \
13341     conftest$ac_exeext conftest.$ac_ext
13342 fi
13343 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_opterr" >&5
13344 $as_echo "$pgac_cv_var_int_opterr" >&6; }
13345 if test x"$pgac_cv_var_int_opterr" = x"yes"; then
13346
13347 $as_echo "#define HAVE_INT_OPTERR 1" >>confdefs.h
13348
13349 fi
13350
13351 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for optreset" >&5
13352 $as_echo_n "checking for optreset... " >&6; }
13353 if ${pgac_cv_var_int_optreset+:} false; then :
13354   $as_echo_n "(cached) " >&6
13355 else
13356   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13357 /* end confdefs.h.  */
13358 #include <unistd.h>
13359 int
13360 main ()
13361 {
13362 extern int optreset; optreset = 1;
13363   ;
13364   return 0;
13365 }
13366 _ACEOF
13367 if ac_fn_c_try_link "$LINENO"; then :
13368   pgac_cv_var_int_optreset=yes
13369 else
13370   pgac_cv_var_int_optreset=no
13371 fi
13372 rm -f core conftest.err conftest.$ac_objext \
13373     conftest$ac_exeext conftest.$ac_ext
13374 fi
13375 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_int_optreset" >&5
13376 $as_echo "$pgac_cv_var_int_optreset" >&6; }
13377 if test x"$pgac_cv_var_int_optreset" = x"yes"; then
13378
13379 $as_echo "#define HAVE_INT_OPTRESET 1" >>confdefs.h
13380
13381 fi
13382
13383 for ac_func in strtoll strtoq
13384 do :
13385   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13386 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13387 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
13388   cat >>confdefs.h <<_ACEOF
13389 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
13390 _ACEOF
13391  break
13392 fi
13393 done
13394
13395 for ac_func in strtoull strtouq
13396 do :
13397   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13398 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13399 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
13400   cat >>confdefs.h <<_ACEOF
13401 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
13402 _ACEOF
13403  break
13404 fi
13405 done
13406
13407
13408 # Lastly, restore full LIBS list and check for readline/libedit symbols
13409 LIBS="$LIBS_including_readline"
13410
13411 if test "$with_readline" = yes; then
13412   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_append_character" >&5
13413 $as_echo_n "checking for rl_completion_append_character... " >&6; }
13414 if ${pgac_cv_var_rl_completion_append_character+:} false; then :
13415   $as_echo_n "(cached) " >&6
13416 else
13417   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13418 /* end confdefs.h.  */
13419 #include <stdio.h>
13420 #ifdef HAVE_READLINE_READLINE_H
13421 # include <readline/readline.h>
13422 #elif defined(HAVE_READLINE_H)
13423 # include <readline.h>
13424 #endif
13425
13426 int
13427 main ()
13428 {
13429 rl_completion_append_character = 'x';
13430   ;
13431   return 0;
13432 }
13433 _ACEOF
13434 if ac_fn_c_try_link "$LINENO"; then :
13435   pgac_cv_var_rl_completion_append_character=yes
13436 else
13437   pgac_cv_var_rl_completion_append_character=no
13438 fi
13439 rm -f core conftest.err conftest.$ac_objext \
13440     conftest$ac_exeext conftest.$ac_ext
13441 fi
13442 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_rl_completion_append_character" >&5
13443 $as_echo "$pgac_cv_var_rl_completion_append_character" >&6; }
13444 if test x"$pgac_cv_var_rl_completion_append_character" = x"yes"; then
13445
13446 $as_echo "#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1" >>confdefs.h
13447
13448 fi
13449   for ac_func in rl_completion_matches rl_filename_completion_function rl_reset_screen_size
13450 do :
13451   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13452 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13453 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
13454   cat >>confdefs.h <<_ACEOF
13455 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
13456 _ACEOF
13457
13458 fi
13459 done
13460
13461   for ac_func in append_history history_truncate_file
13462 do :
13463   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
13464 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
13465 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
13466   cat >>confdefs.h <<_ACEOF
13467 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
13468 _ACEOF
13469
13470 fi
13471 done
13472
13473 fi
13474
13475
13476 # This test makes sure that run tests work at all.  Sometimes a shared
13477 # library is found by the linker, but the runtime linker can't find it.
13478 # This check should come after all modifications of compiler or linker
13479 # variables, and before any other run tests.
13480 { $as_echo "$as_me:${as_lineno-$LINENO}: checking test program" >&5
13481 $as_echo_n "checking test program... " >&6; }
13482 if test "$cross_compiling" = yes; then :
13483   { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling" >&5
13484 $as_echo "cross-compiling" >&6; }
13485 else
13486   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13487 /* end confdefs.h.  */
13488 int main() { return 0; }
13489 _ACEOF
13490 if ac_fn_c_try_run "$LINENO"; then :
13491   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
13492 $as_echo "ok" >&6; }
13493 else
13494   { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
13495 $as_echo "failed" >&6; }
13496 as_fn_error $? "
13497 Could not execute a simple test program.  This may be a problem
13498 related to locating shared libraries.  Check the file 'config.log'
13499 for the exact reason." "$LINENO" 5
13500 fi
13501 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13502   conftest.$ac_objext conftest.beam conftest.$ac_ext
13503 fi
13504
13505
13506 # --------------------
13507 # Run tests below here
13508 # --------------------
13509
13510 # Force use of our snprintf if system's doesn't do arg control
13511 # See comment above at snprintf test for details.
13512 if test "$enable_nls" = yes -a "$pgac_need_repl_snprintf" = no; then
13513   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf supports argument control" >&5
13514 $as_echo_n "checking whether snprintf supports argument control... " >&6; }
13515 if ${pgac_cv_snprintf_arg_control+:} false; then :
13516   $as_echo_n "(cached) " >&6
13517 else
13518   if test "$cross_compiling" = yes; then :
13519   pgac_cv_snprintf_arg_control=cross
13520 else
13521   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13522 /* end confdefs.h.  */
13523 #include <stdio.h>
13524 #include <string.h>
13525
13526 int main()
13527 {
13528   char buf[100];
13529
13530   /* can it swap arguments? */
13531   snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
13532   if (strcmp(buf, "4 3") != 0)
13533     return 1;
13534   return 0;
13535 }
13536 _ACEOF
13537 if ac_fn_c_try_run "$LINENO"; then :
13538   pgac_cv_snprintf_arg_control=yes
13539 else
13540   pgac_cv_snprintf_arg_control=no
13541 fi
13542 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13543   conftest.$ac_objext conftest.beam conftest.$ac_ext
13544 fi
13545
13546
13547 fi
13548 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_arg_control" >&5
13549 $as_echo "$pgac_cv_snprintf_arg_control" >&6; }
13550
13551   if test $pgac_cv_snprintf_arg_control != yes ; then
13552     pgac_need_repl_snprintf=yes
13553   fi
13554 fi
13555
13556
13557
13558
13559 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long int is 64 bits" >&5
13560 $as_echo_n "checking whether long int is 64 bits... " >&6; }
13561 if ${pgac_cv_type_long_int_64+:} false; then :
13562   $as_echo_n "(cached) " >&6
13563 else
13564   if test "$cross_compiling" = yes; then :
13565   # If cross-compiling, check the size reported by the compiler and
13566 # trust that the arithmetic works.
13567 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13568 /* end confdefs.h.  */
13569
13570 int
13571 main ()
13572 {
13573 static int test_array [1 - 2 * !(sizeof(long int) == 8)];
13574 test_array [0] = 0;
13575 return test_array [0];
13576
13577   ;
13578   return 0;
13579 }
13580 _ACEOF
13581 if ac_fn_c_try_compile "$LINENO"; then :
13582   pgac_cv_type_long_int_64=yes
13583 else
13584   pgac_cv_type_long_int_64=no
13585 fi
13586 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13587 else
13588   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13589 /* end confdefs.h.  */
13590 typedef long int ac_int64;
13591
13592 /*
13593  * These are globals to discourage the compiler from folding all the
13594  * arithmetic tests down to compile-time constants.
13595  */
13596 ac_int64 a = 20000001;
13597 ac_int64 b = 40000005;
13598
13599 int does_int64_work()
13600 {
13601   ac_int64 c,d;
13602
13603   if (sizeof(ac_int64) != 8)
13604     return 0;                   /* definitely not the right size */
13605
13606   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
13607   c = a * b;
13608   d = (c + b) / b;
13609   if (d != a+1)
13610     return 0;
13611   return 1;
13612 }
13613
13614 int
13615 main() {
13616   return (! does_int64_work());
13617 }
13618 _ACEOF
13619 if ac_fn_c_try_run "$LINENO"; then :
13620   pgac_cv_type_long_int_64=yes
13621 else
13622   pgac_cv_type_long_int_64=no
13623 fi
13624 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13625   conftest.$ac_objext conftest.beam conftest.$ac_ext
13626 fi
13627
13628 fi
13629 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_long_int_64" >&5
13630 $as_echo "$pgac_cv_type_long_int_64" >&6; }
13631
13632 HAVE_LONG_INT_64=$pgac_cv_type_long_int_64
13633 if test x"$pgac_cv_type_long_int_64" = xyes ; then
13634
13635 $as_echo "#define HAVE_LONG_INT_64 1" >>confdefs.h
13636
13637 fi
13638
13639
13640 if test x"$HAVE_LONG_INT_64" = x"yes" ; then
13641   pg_int64_type="long int"
13642 else
13643   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long long int is 64 bits" >&5
13644 $as_echo_n "checking whether long long int is 64 bits... " >&6; }
13645 if ${pgac_cv_type_long_long_int_64+:} false; then :
13646   $as_echo_n "(cached) " >&6
13647 else
13648   if test "$cross_compiling" = yes; then :
13649   # If cross-compiling, check the size reported by the compiler and
13650 # trust that the arithmetic works.
13651 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13652 /* end confdefs.h.  */
13653
13654 int
13655 main ()
13656 {
13657 static int test_array [1 - 2 * !(sizeof(long long int) == 8)];
13658 test_array [0] = 0;
13659 return test_array [0];
13660
13661   ;
13662   return 0;
13663 }
13664 _ACEOF
13665 if ac_fn_c_try_compile "$LINENO"; then :
13666   pgac_cv_type_long_long_int_64=yes
13667 else
13668   pgac_cv_type_long_long_int_64=no
13669 fi
13670 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13671 else
13672   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13673 /* end confdefs.h.  */
13674 typedef long long int ac_int64;
13675
13676 /*
13677  * These are globals to discourage the compiler from folding all the
13678  * arithmetic tests down to compile-time constants.
13679  */
13680 ac_int64 a = 20000001;
13681 ac_int64 b = 40000005;
13682
13683 int does_int64_work()
13684 {
13685   ac_int64 c,d;
13686
13687   if (sizeof(ac_int64) != 8)
13688     return 0;                   /* definitely not the right size */
13689
13690   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
13691   c = a * b;
13692   d = (c + b) / b;
13693   if (d != a+1)
13694     return 0;
13695   return 1;
13696 }
13697
13698 int
13699 main() {
13700   return (! does_int64_work());
13701 }
13702 _ACEOF
13703 if ac_fn_c_try_run "$LINENO"; then :
13704   pgac_cv_type_long_long_int_64=yes
13705 else
13706   pgac_cv_type_long_long_int_64=no
13707 fi
13708 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13709   conftest.$ac_objext conftest.beam conftest.$ac_ext
13710 fi
13711
13712 fi
13713 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_type_long_long_int_64" >&5
13714 $as_echo "$pgac_cv_type_long_long_int_64" >&6; }
13715
13716 HAVE_LONG_LONG_INT_64=$pgac_cv_type_long_long_int_64
13717 if test x"$pgac_cv_type_long_long_int_64" = xyes ; then
13718
13719 $as_echo "#define HAVE_LONG_LONG_INT_64 1" >>confdefs.h
13720
13721 fi
13722
13723   if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then
13724     pg_int64_type="long long int"
13725   else
13726     as_fn_error $? "Cannot find a working 64-bit integer type." "$LINENO" 5
13727   fi
13728 fi
13729
13730
13731 cat >>confdefs.h <<_ACEOF
13732 #define PG_INT64_TYPE $pg_int64_type
13733 _ACEOF
13734
13735
13736
13737 if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then
13738   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13739 /* end confdefs.h.  */
13740
13741 #define INT64CONST(x)  x##LL
13742 long long int foo = INT64CONST(0x1234567890123456);
13743
13744 _ACEOF
13745 if ac_fn_c_try_compile "$LINENO"; then :
13746
13747 $as_echo "#define HAVE_LL_CONSTANTS 1" >>confdefs.h
13748
13749 fi
13750 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13751 fi
13752
13753
13754 # If we found "long int" is 64 bits, assume snprintf handles it.  If
13755 # we found we need to use "long long int", better check.  We cope with
13756 # snprintfs that use %lld, %qd, or %I64d as the format.  If none of these
13757 # work, fall back to our own snprintf emulation (which we know uses %lld).
13758
13759 if test "$HAVE_LONG_LONG_INT_64" = yes ; then
13760   if test $pgac_need_repl_snprintf = no; then
13761     { $as_echo "$as_me:${as_lineno-$LINENO}: checking snprintf length modifier for long long int" >&5
13762 $as_echo_n "checking snprintf length modifier for long long int... " >&6; }
13763 if ${pgac_cv_snprintf_long_long_int_modifier+:} false; then :
13764   $as_echo_n "(cached) " >&6
13765 else
13766   for pgac_modifier in 'll' 'q' 'I64'; do
13767 if test "$cross_compiling" = yes; then :
13768   pgac_cv_snprintf_long_long_int_modifier=cross; break
13769 else
13770   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13771 /* end confdefs.h.  */
13772 #include <stdio.h>
13773 #include <string.h>
13774 typedef long long int ac_int64;
13775 #define INT64_FORMAT "%${pgac_modifier}d"
13776
13777 ac_int64 a = 20000001;
13778 ac_int64 b = 40000005;
13779
13780 int does_int64_snprintf_work()
13781 {
13782   ac_int64 c;
13783   char buf[100];
13784
13785   if (sizeof(ac_int64) != 8)
13786     return 0;                   /* doesn't look like the right size */
13787
13788   c = a * b;
13789   snprintf(buf, 100, INT64_FORMAT, c);
13790   if (strcmp(buf, "800000140000005") != 0)
13791     return 0;                   /* either multiply or snprintf is busted */
13792   return 1;
13793 }
13794
13795 int
13796 main() {
13797   return (! does_int64_snprintf_work());
13798 }
13799 _ACEOF
13800 if ac_fn_c_try_run "$LINENO"; then :
13801   pgac_cv_snprintf_long_long_int_modifier=$pgac_modifier; break
13802 fi
13803 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13804   conftest.$ac_objext conftest.beam conftest.$ac_ext
13805 fi
13806
13807 done
13808 fi
13809
13810 LONG_LONG_INT_MODIFIER=''
13811
13812 case $pgac_cv_snprintf_long_long_int_modifier in
13813   cross) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot test (not on host machine)" >&5
13814 $as_echo "cannot test (not on host machine)" >&6; };;
13815   ?*)    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_long_long_int_modifier" >&5
13816 $as_echo "$pgac_cv_snprintf_long_long_int_modifier" >&6; }
13817          LONG_LONG_INT_MODIFIER=$pgac_cv_snprintf_long_long_int_modifier;;
13818   *)     { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
13819 $as_echo "none" >&6; };;
13820 esac
13821     if test "$LONG_LONG_INT_MODIFIER" = ""; then
13822       # Force usage of our own snprintf, since system snprintf is broken
13823       pgac_need_repl_snprintf=yes
13824       LONG_LONG_INT_MODIFIER='ll'
13825     fi
13826   else
13827     # Here if we previously decided we needed to use our own snprintf
13828     LONG_LONG_INT_MODIFIER='ll'
13829   fi
13830 else
13831   # Here if we are not using 'long long int' at all
13832   LONG_LONG_INT_MODIFIER='l'
13833 fi
13834
13835 INT64_MODIFIER="\"$LONG_LONG_INT_MODIFIER\""
13836
13837
13838 cat >>confdefs.h <<_ACEOF
13839 #define INT64_MODIFIER $INT64_MODIFIER
13840 _ACEOF
13841
13842
13843 # Also force use of our snprintf if the system's doesn't support the %z flag.
13844 if test "$pgac_need_repl_snprintf" = no; then
13845   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf supports the %z modifier" >&5
13846 $as_echo_n "checking whether snprintf supports the %z modifier... " >&6; }
13847 if ${pgac_cv_snprintf_size_t_support+:} false; then :
13848   $as_echo_n "(cached) " >&6
13849 else
13850   if test "$cross_compiling" = yes; then :
13851   pgac_cv_snprintf_size_t_support=cross
13852 else
13853   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13854 /* end confdefs.h.  */
13855 #include <stdio.h>
13856 #include <string.h>
13857
13858 int main()
13859 {
13860   char bufz[100];
13861   char buf64[100];
13862
13863   /*
13864    * Print the largest unsigned number fitting in a size_t using both %zu
13865    * and the previously-determined format for 64-bit integers.  Note that
13866    * we don't run this code unless we know snprintf handles 64-bit ints.
13867    */
13868   bufz[0] = '\0';  /* in case snprintf fails to emit anything */
13869   snprintf(bufz, sizeof(bufz), "%zu", ~((size_t) 0));
13870   snprintf(buf64, sizeof(buf64), "%" INT64_MODIFIER "u",
13871     (unsigned PG_INT64_TYPE) ~((size_t) 0));
13872   if (strcmp(bufz, buf64) != 0)
13873     return 1;
13874   return 0;
13875 }
13876 _ACEOF
13877 if ac_fn_c_try_run "$LINENO"; then :
13878   pgac_cv_snprintf_size_t_support=yes
13879 else
13880   pgac_cv_snprintf_size_t_support=no
13881 fi
13882 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13883   conftest.$ac_objext conftest.beam conftest.$ac_ext
13884 fi
13885
13886
13887 fi
13888 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_size_t_support" >&5
13889 $as_echo "$pgac_cv_snprintf_size_t_support" >&6; }
13890
13891   if test "$pgac_cv_snprintf_size_t_support" != yes; then
13892     pgac_need_repl_snprintf=yes
13893   fi
13894 fi
13895
13896 # Now we have checked all the reasons to replace snprintf
13897 if test $pgac_need_repl_snprintf = yes; then
13898
13899 $as_echo "#define USE_REPL_SNPRINTF 1" >>confdefs.h
13900
13901   case " $LIBOBJS " in
13902   *" snprintf.$ac_objext "* ) ;;
13903   *) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
13904  ;;
13905 esac
13906
13907 fi
13908
13909 # Check size of void *, size_t (enables tweaks for > 32bit address space)
13910 # The cast to long int works around a bug in the HP C Compiler
13911 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
13912 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
13913 # This bug is HP SR number 8606223364.
13914 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
13915 $as_echo_n "checking size of void *... " >&6; }
13916 if ${ac_cv_sizeof_void_p+:} false; then :
13917   $as_echo_n "(cached) " >&6
13918 else
13919   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p"        "$ac_includes_default"; then :
13920
13921 else
13922   if test "$ac_cv_type_void_p" = yes; then
13923      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13924 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13925 as_fn_error 77 "cannot compute sizeof (void *)
13926 See \`config.log' for more details" "$LINENO" 5; }
13927    else
13928      ac_cv_sizeof_void_p=0
13929    fi
13930 fi
13931
13932 fi
13933 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
13934 $as_echo "$ac_cv_sizeof_void_p" >&6; }
13935
13936
13937
13938 cat >>confdefs.h <<_ACEOF
13939 #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
13940 _ACEOF
13941
13942
13943 # The cast to long int works around a bug in the HP C Compiler
13944 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
13945 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
13946 # This bug is HP SR number 8606223364.
13947 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
13948 $as_echo_n "checking size of size_t... " >&6; }
13949 if ${ac_cv_sizeof_size_t+:} false; then :
13950   $as_echo_n "(cached) " >&6
13951 else
13952   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t"        "$ac_includes_default"; then :
13953
13954 else
13955   if test "$ac_cv_type_size_t" = yes; then
13956      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13957 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13958 as_fn_error 77 "cannot compute sizeof (size_t)
13959 See \`config.log' for more details" "$LINENO" 5; }
13960    else
13961      ac_cv_sizeof_size_t=0
13962    fi
13963 fi
13964
13965 fi
13966 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
13967 $as_echo "$ac_cv_sizeof_size_t" >&6; }
13968
13969
13970
13971 cat >>confdefs.h <<_ACEOF
13972 #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
13973 _ACEOF
13974
13975
13976 # The cast to long int works around a bug in the HP C Compiler
13977 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
13978 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
13979 # This bug is HP SR number 8606223364.
13980 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
13981 $as_echo_n "checking size of long... " >&6; }
13982 if ${ac_cv_sizeof_long+:} false; then :
13983   $as_echo_n "(cached) " >&6
13984 else
13985   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long"        "$ac_includes_default"; then :
13986
13987 else
13988   if test "$ac_cv_type_long" = yes; then
13989      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13990 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13991 as_fn_error 77 "cannot compute sizeof (long)
13992 See \`config.log' for more details" "$LINENO" 5; }
13993    else
13994      ac_cv_sizeof_long=0
13995    fi
13996 fi
13997
13998 fi
13999 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
14000 $as_echo "$ac_cv_sizeof_long" >&6; }
14001
14002
14003
14004 cat >>confdefs.h <<_ACEOF
14005 #define SIZEOF_LONG $ac_cv_sizeof_long
14006 _ACEOF
14007
14008
14009
14010 # Decide whether float4 is passed by value: user-selectable, enabled by default
14011 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float4 passed by value" >&5
14012 $as_echo_n "checking whether to build with float4 passed by value... " >&6; }
14013
14014
14015 # Check whether --enable-float4-byval was given.
14016 if test "${enable_float4_byval+set}" = set; then :
14017   enableval=$enable_float4_byval;
14018   case $enableval in
14019     yes)
14020
14021 $as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
14022
14023                float4passbyval=true
14024       ;;
14025     no)
14026       float4passbyval=false
14027       ;;
14028     *)
14029       as_fn_error $? "no argument expected for --enable-float4-byval option" "$LINENO" 5
14030       ;;
14031   esac
14032
14033 else
14034   enable_float4_byval=yes
14035
14036 $as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
14037
14038                float4passbyval=true
14039 fi
14040
14041
14042 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float4_byval" >&5
14043 $as_echo "$enable_float4_byval" >&6; }
14044
14045 cat >>confdefs.h <<_ACEOF
14046 #define FLOAT4PASSBYVAL $float4passbyval
14047 _ACEOF
14048
14049
14050 # Decide whether float8 is passed by value.
14051 # Note: this setting also controls int8 and related types such as timestamp.
14052 # If sizeof(Datum) >= 8, this is user-selectable, enabled by default.
14053 # If not, trying to select it is an error.
14054 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float8 passed by value" >&5
14055 $as_echo_n "checking whether to build with float8 passed by value... " >&6; }
14056 if test $ac_cv_sizeof_void_p -ge 8 ; then
14057
14058
14059 # Check whether --enable-float8-byval was given.
14060 if test "${enable_float8_byval+set}" = set; then :
14061   enableval=$enable_float8_byval;
14062   case $enableval in
14063     yes)
14064       :
14065       ;;
14066     no)
14067       :
14068       ;;
14069     *)
14070       as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5
14071       ;;
14072   esac
14073
14074 else
14075   enable_float8_byval=yes
14076
14077 fi
14078
14079
14080 else
14081
14082
14083 # Check whether --enable-float8-byval was given.
14084 if test "${enable_float8_byval+set}" = set; then :
14085   enableval=$enable_float8_byval;
14086   case $enableval in
14087     yes)
14088       :
14089       ;;
14090     no)
14091       :
14092       ;;
14093     *)
14094       as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5
14095       ;;
14096   esac
14097
14098 else
14099   enable_float8_byval=no
14100
14101 fi
14102
14103
14104   if test "$enable_float8_byval" = yes ; then
14105     as_fn_error $? "--enable-float8-byval is not supported on 32-bit platforms." "$LINENO" 5
14106   fi
14107 fi
14108 if test "$enable_float8_byval" = yes ; then
14109
14110 $as_echo "#define USE_FLOAT8_BYVAL 1" >>confdefs.h
14111
14112   float8passbyval=true
14113 else
14114   float8passbyval=false
14115 fi
14116 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float8_byval" >&5
14117 $as_echo "$enable_float8_byval" >&6; }
14118
14119 cat >>confdefs.h <<_ACEOF
14120 #define FLOAT8PASSBYVAL $float8passbyval
14121 _ACEOF
14122
14123
14124 # Determine memory alignment requirements for the basic C data types.
14125
14126 # The cast to long int works around a bug in the HP C Compiler,
14127 # see AC_CHECK_SIZEOF for more information.
14128 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of short" >&5
14129 $as_echo_n "checking alignment of short... " >&6; }
14130 if ${ac_cv_alignof_short+:} false; then :
14131   $as_echo_n "(cached) " >&6
14132 else
14133   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_short"        "$ac_includes_default
14134 #ifndef offsetof
14135 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
14136 #endif
14137 typedef struct { char x; short y; } ac__type_alignof_;"; then :
14138
14139 else
14140   if test "$ac_cv_type_short" = yes; then
14141      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14142 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14143 as_fn_error 77 "cannot compute alignment of short
14144 See \`config.log' for more details" "$LINENO" 5; }
14145    else
14146      ac_cv_alignof_short=0
14147    fi
14148 fi
14149
14150 fi
14151 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_short" >&5
14152 $as_echo "$ac_cv_alignof_short" >&6; }
14153
14154
14155
14156 cat >>confdefs.h <<_ACEOF
14157 #define ALIGNOF_SHORT $ac_cv_alignof_short
14158 _ACEOF
14159
14160
14161 # The cast to long int works around a bug in the HP C Compiler,
14162 # see AC_CHECK_SIZEOF for more information.
14163 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of int" >&5
14164 $as_echo_n "checking alignment of int... " >&6; }
14165 if ${ac_cv_alignof_int+:} false; then :
14166   $as_echo_n "(cached) " >&6
14167 else
14168   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_int"        "$ac_includes_default
14169 #ifndef offsetof
14170 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
14171 #endif
14172 typedef struct { char x; int y; } ac__type_alignof_;"; then :
14173
14174 else
14175   if test "$ac_cv_type_int" = yes; then
14176      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14177 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14178 as_fn_error 77 "cannot compute alignment of int
14179 See \`config.log' for more details" "$LINENO" 5; }
14180    else
14181      ac_cv_alignof_int=0
14182    fi
14183 fi
14184
14185 fi
14186 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_int" >&5
14187 $as_echo "$ac_cv_alignof_int" >&6; }
14188
14189
14190
14191 cat >>confdefs.h <<_ACEOF
14192 #define ALIGNOF_INT $ac_cv_alignof_int
14193 _ACEOF
14194
14195
14196 # The cast to long int works around a bug in the HP C Compiler,
14197 # see AC_CHECK_SIZEOF for more information.
14198 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of long" >&5
14199 $as_echo_n "checking alignment of long... " >&6; }
14200 if ${ac_cv_alignof_long+:} false; then :
14201   $as_echo_n "(cached) " >&6
14202 else
14203   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long"        "$ac_includes_default
14204 #ifndef offsetof
14205 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
14206 #endif
14207 typedef struct { char x; long y; } ac__type_alignof_;"; then :
14208
14209 else
14210   if test "$ac_cv_type_long" = yes; then
14211      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14212 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14213 as_fn_error 77 "cannot compute alignment of long
14214 See \`config.log' for more details" "$LINENO" 5; }
14215    else
14216      ac_cv_alignof_long=0
14217    fi
14218 fi
14219
14220 fi
14221 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long" >&5
14222 $as_echo "$ac_cv_alignof_long" >&6; }
14223
14224
14225
14226 cat >>confdefs.h <<_ACEOF
14227 #define ALIGNOF_LONG $ac_cv_alignof_long
14228 _ACEOF
14229
14230
14231 if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then
14232   # The cast to long int works around a bug in the HP C Compiler,
14233 # see AC_CHECK_SIZEOF for more information.
14234 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of long long int" >&5
14235 $as_echo_n "checking alignment of long long int... " >&6; }
14236 if ${ac_cv_alignof_long_long_int+:} false; then :
14237   $as_echo_n "(cached) " >&6
14238 else
14239   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long_long_int"        "$ac_includes_default
14240 #ifndef offsetof
14241 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
14242 #endif
14243 typedef struct { char x; long long int y; } ac__type_alignof_;"; then :
14244
14245 else
14246   if test "$ac_cv_type_long_long_int" = yes; then
14247      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14248 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14249 as_fn_error 77 "cannot compute alignment of long long int
14250 See \`config.log' for more details" "$LINENO" 5; }
14251    else
14252      ac_cv_alignof_long_long_int=0
14253    fi
14254 fi
14255
14256 fi
14257 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long_long_int" >&5
14258 $as_echo "$ac_cv_alignof_long_long_int" >&6; }
14259
14260
14261
14262 cat >>confdefs.h <<_ACEOF
14263 #define ALIGNOF_LONG_LONG_INT $ac_cv_alignof_long_long_int
14264 _ACEOF
14265
14266
14267 fi
14268 # The cast to long int works around a bug in the HP C Compiler,
14269 # see AC_CHECK_SIZEOF for more information.
14270 { $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of double" >&5
14271 $as_echo_n "checking alignment of double... " >&6; }
14272 if ${ac_cv_alignof_double+:} false; then :
14273   $as_echo_n "(cached) " >&6
14274 else
14275   if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_double"        "$ac_includes_default
14276 #ifndef offsetof
14277 # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
14278 #endif
14279 typedef struct { char x; double y; } ac__type_alignof_;"; then :
14280
14281 else
14282   if test "$ac_cv_type_double" = yes; then
14283      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14284 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14285 as_fn_error 77 "cannot compute alignment of double
14286 See \`config.log' for more details" "$LINENO" 5; }
14287    else
14288      ac_cv_alignof_double=0
14289    fi
14290 fi
14291
14292 fi
14293 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_double" >&5
14294 $as_echo "$ac_cv_alignof_double" >&6; }
14295
14296
14297
14298 cat >>confdefs.h <<_ACEOF
14299 #define ALIGNOF_DOUBLE $ac_cv_alignof_double
14300 _ACEOF
14301
14302
14303
14304 # Compute maximum alignment of any basic type.
14305 # We assume long's alignment is at least as strong as char, short, or int;
14306 # but we must check long long (if it exists) and double.
14307
14308 MAX_ALIGNOF=$ac_cv_alignof_long
14309 if test $MAX_ALIGNOF -lt $ac_cv_alignof_double ; then
14310   MAX_ALIGNOF=$ac_cv_alignof_double
14311 fi
14312 if test x"$HAVE_LONG_LONG_INT_64" = xyes && test $MAX_ALIGNOF -lt $ac_cv_alignof_long_long_int ; then
14313   MAX_ALIGNOF="$ac_cv_alignof_long_long_int"
14314 fi
14315
14316 cat >>confdefs.h <<_ACEOF
14317 #define MAXIMUM_ALIGNOF $MAX_ALIGNOF
14318 _ACEOF
14319
14320
14321
14322 # Some platforms predefine the types int8, int16, etc.  Only check
14323 # a (hopefully) representative subset.
14324 ac_fn_c_check_type "$LINENO" "int8" "ac_cv_type_int8" "#include <stdio.h>
14325 "
14326 if test "x$ac_cv_type_int8" = xyes; then :
14327
14328 cat >>confdefs.h <<_ACEOF
14329 #define HAVE_INT8 1
14330 _ACEOF
14331
14332
14333 fi
14334 ac_fn_c_check_type "$LINENO" "uint8" "ac_cv_type_uint8" "#include <stdio.h>
14335 "
14336 if test "x$ac_cv_type_uint8" = xyes; then :
14337
14338 cat >>confdefs.h <<_ACEOF
14339 #define HAVE_UINT8 1
14340 _ACEOF
14341
14342
14343 fi
14344 ac_fn_c_check_type "$LINENO" "int64" "ac_cv_type_int64" "#include <stdio.h>
14345 "
14346 if test "x$ac_cv_type_int64" = xyes; then :
14347
14348 cat >>confdefs.h <<_ACEOF
14349 #define HAVE_INT64 1
14350 _ACEOF
14351
14352
14353 fi
14354 ac_fn_c_check_type "$LINENO" "uint64" "ac_cv_type_uint64" "#include <stdio.h>
14355 "
14356 if test "x$ac_cv_type_uint64" = xyes; then :
14357
14358 cat >>confdefs.h <<_ACEOF
14359 #define HAVE_UINT64 1
14360 _ACEOF
14361
14362
14363 fi
14364
14365
14366 # Check for extensions offering the integer scalar type __int128.
14367 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __int128" >&5
14368 $as_echo_n "checking for __int128... " >&6; }
14369 if ${pgac_cv__128bit_int+:} false; then :
14370   $as_echo_n "(cached) " >&6
14371 else
14372   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14373 /* end confdefs.h.  */
14374
14375 /*
14376  * These are globals to discourage the compiler from folding all the
14377  * arithmetic tests down to compile-time constants.  We do not have
14378  * convenient support for 64bit literals at this point...
14379  */
14380 __int128 a = 48828125;
14381 __int128 b = 97656255;
14382
14383 int
14384 main ()
14385 {
14386
14387 __int128 c,d;
14388 a = (a << 12) + 1; /* 200000000001 */
14389 b = (b << 12) + 5; /* 400000000005 */
14390 /* use the most relevant arithmetic ops */
14391 c = a * b;
14392 d = (c + b) / b;
14393 /* return different values, to prevent optimizations */
14394 if (d != a+1)
14395   return 0;
14396 return 1;
14397
14398   ;
14399   return 0;
14400 }
14401 _ACEOF
14402 if ac_fn_c_try_link "$LINENO"; then :
14403   pgac_cv__128bit_int=yes
14404 else
14405   pgac_cv__128bit_int=no
14406 fi
14407 rm -f core conftest.err conftest.$ac_objext \
14408     conftest$ac_exeext conftest.$ac_ext
14409 fi
14410 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__128bit_int" >&5
14411 $as_echo "$pgac_cv__128bit_int" >&6; }
14412 if test x"$pgac_cv__128bit_int" = xyes ; then
14413
14414 $as_echo "#define PG_INT128_TYPE __int128" >>confdefs.h
14415
14416 fi
14417
14418 # Check for various atomic operations now that we have checked how to declare
14419 # 64bit integers.
14420 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync char locking functions" >&5
14421 $as_echo_n "checking for builtin __sync char locking functions... " >&6; }
14422 if ${pgac_cv_gcc_sync_char_tas+:} false; then :
14423   $as_echo_n "(cached) " >&6
14424 else
14425   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14426 /* end confdefs.h.  */
14427
14428 int
14429 main ()
14430 {
14431 char lock = 0;
14432    __sync_lock_test_and_set(&lock, 1);
14433    __sync_lock_release(&lock);
14434   ;
14435   return 0;
14436 }
14437 _ACEOF
14438 if ac_fn_c_try_link "$LINENO"; then :
14439   pgac_cv_gcc_sync_char_tas="yes"
14440 else
14441   pgac_cv_gcc_sync_char_tas="no"
14442 fi
14443 rm -f core conftest.err conftest.$ac_objext \
14444     conftest$ac_exeext conftest.$ac_ext
14445 fi
14446 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_char_tas" >&5
14447 $as_echo "$pgac_cv_gcc_sync_char_tas" >&6; }
14448 if test x"$pgac_cv_gcc_sync_char_tas" = x"yes"; then
14449
14450 $as_echo "#define HAVE_GCC__SYNC_CHAR_TAS 1" >>confdefs.h
14451
14452 fi
14453 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int32 locking functions" >&5
14454 $as_echo_n "checking for builtin __sync int32 locking functions... " >&6; }
14455 if ${pgac_cv_gcc_sync_int32_tas+:} false; then :
14456   $as_echo_n "(cached) " >&6
14457 else
14458   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14459 /* end confdefs.h.  */
14460
14461 int
14462 main ()
14463 {
14464 int lock = 0;
14465    __sync_lock_test_and_set(&lock, 1);
14466    __sync_lock_release(&lock);
14467   ;
14468   return 0;
14469 }
14470 _ACEOF
14471 if ac_fn_c_try_link "$LINENO"; then :
14472   pgac_cv_gcc_sync_int32_tas="yes"
14473 else
14474   pgac_cv_gcc_sync_int32_tas="no"
14475 fi
14476 rm -f core conftest.err conftest.$ac_objext \
14477     conftest$ac_exeext conftest.$ac_ext
14478 fi
14479 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int32_tas" >&5
14480 $as_echo "$pgac_cv_gcc_sync_int32_tas" >&6; }
14481 if test x"$pgac_cv_gcc_sync_int32_tas" = x"yes"; then
14482
14483 $as_echo "#define HAVE_GCC__SYNC_INT32_TAS 1" >>confdefs.h
14484
14485 fi
14486 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int32 atomic operations" >&5
14487 $as_echo_n "checking for builtin __sync int32 atomic operations... " >&6; }
14488 if ${pgac_cv_gcc_sync_int32_cas+:} false; then :
14489   $as_echo_n "(cached) " >&6
14490 else
14491   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14492 /* end confdefs.h.  */
14493
14494 int
14495 main ()
14496 {
14497 int val = 0;
14498    __sync_val_compare_and_swap(&val, 0, 37);
14499   ;
14500   return 0;
14501 }
14502 _ACEOF
14503 if ac_fn_c_try_link "$LINENO"; then :
14504   pgac_cv_gcc_sync_int32_cas="yes"
14505 else
14506   pgac_cv_gcc_sync_int32_cas="no"
14507 fi
14508 rm -f core conftest.err conftest.$ac_objext \
14509     conftest$ac_exeext conftest.$ac_ext
14510 fi
14511 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int32_cas" >&5
14512 $as_echo "$pgac_cv_gcc_sync_int32_cas" >&6; }
14513 if test x"$pgac_cv_gcc_sync_int32_cas" = x"yes"; then
14514
14515 $as_echo "#define HAVE_GCC__SYNC_INT32_CAS 1" >>confdefs.h
14516
14517 fi
14518 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __sync int64 atomic operations" >&5
14519 $as_echo_n "checking for builtin __sync int64 atomic operations... " >&6; }
14520 if ${pgac_cv_gcc_sync_int64_cas+:} false; then :
14521   $as_echo_n "(cached) " >&6
14522 else
14523   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14524 /* end confdefs.h.  */
14525
14526 int
14527 main ()
14528 {
14529 PG_INT64_TYPE lock = 0;
14530    __sync_val_compare_and_swap(&lock, 0, (PG_INT64_TYPE) 37);
14531   ;
14532   return 0;
14533 }
14534 _ACEOF
14535 if ac_fn_c_try_link "$LINENO"; then :
14536   pgac_cv_gcc_sync_int64_cas="yes"
14537 else
14538   pgac_cv_gcc_sync_int64_cas="no"
14539 fi
14540 rm -f core conftest.err conftest.$ac_objext \
14541     conftest$ac_exeext conftest.$ac_ext
14542 fi
14543 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_sync_int64_cas" >&5
14544 $as_echo "$pgac_cv_gcc_sync_int64_cas" >&6; }
14545 if test x"$pgac_cv_gcc_sync_int64_cas" = x"yes"; then
14546
14547 $as_echo "#define HAVE_GCC__SYNC_INT64_CAS 1" >>confdefs.h
14548
14549 fi
14550 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic int32 atomic operations" >&5
14551 $as_echo_n "checking for builtin __atomic int32 atomic operations... " >&6; }
14552 if ${pgac_cv_gcc_atomic_int32_cas+:} false; then :
14553   $as_echo_n "(cached) " >&6
14554 else
14555   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14556 /* end confdefs.h.  */
14557
14558 int
14559 main ()
14560 {
14561 int val = 0;
14562    int expect = 0;
14563    __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
14564   ;
14565   return 0;
14566 }
14567 _ACEOF
14568 if ac_fn_c_try_link "$LINENO"; then :
14569   pgac_cv_gcc_atomic_int32_cas="yes"
14570 else
14571   pgac_cv_gcc_atomic_int32_cas="no"
14572 fi
14573 rm -f core conftest.err conftest.$ac_objext \
14574     conftest$ac_exeext conftest.$ac_ext
14575 fi
14576 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_atomic_int32_cas" >&5
14577 $as_echo "$pgac_cv_gcc_atomic_int32_cas" >&6; }
14578 if test x"$pgac_cv_gcc_atomic_int32_cas" = x"yes"; then
14579
14580 $as_echo "#define HAVE_GCC__ATOMIC_INT32_CAS 1" >>confdefs.h
14581
14582 fi
14583 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic int64 atomic operations" >&5
14584 $as_echo_n "checking for builtin __atomic int64 atomic operations... " >&6; }
14585 if ${pgac_cv_gcc_atomic_int64_cas+:} false; then :
14586   $as_echo_n "(cached) " >&6
14587 else
14588   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14589 /* end confdefs.h.  */
14590
14591 int
14592 main ()
14593 {
14594 PG_INT64_TYPE val = 0;
14595    PG_INT64_TYPE expect = 0;
14596    __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
14597   ;
14598   return 0;
14599 }
14600 _ACEOF
14601 if ac_fn_c_try_link "$LINENO"; then :
14602   pgac_cv_gcc_atomic_int64_cas="yes"
14603 else
14604   pgac_cv_gcc_atomic_int64_cas="no"
14605 fi
14606 rm -f core conftest.err conftest.$ac_objext \
14607     conftest$ac_exeext conftest.$ac_ext
14608 fi
14609 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_gcc_atomic_int64_cas" >&5
14610 $as_echo "$pgac_cv_gcc_atomic_int64_cas" >&6; }
14611 if test x"$pgac_cv_gcc_atomic_int64_cas" = x"yes"; then
14612
14613 $as_echo "#define HAVE_GCC__ATOMIC_INT64_CAS 1" >>confdefs.h
14614
14615 fi
14616
14617
14618 # Check for x86 cpuid instruction
14619 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __get_cpuid" >&5
14620 $as_echo_n "checking for __get_cpuid... " >&6; }
14621 if ${pgac_cv__get_cpuid+:} false; then :
14622   $as_echo_n "(cached) " >&6
14623 else
14624   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14625 /* end confdefs.h.  */
14626 #include <cpuid.h>
14627 int
14628 main ()
14629 {
14630 unsigned int exx[4] = {0, 0, 0, 0};
14631   __get_cpuid(1, &exx[0], &exx[1], &exx[2], &exx[3]);
14632
14633   ;
14634   return 0;
14635 }
14636 _ACEOF
14637 if ac_fn_c_try_link "$LINENO"; then :
14638   pgac_cv__get_cpuid="yes"
14639 else
14640   pgac_cv__get_cpuid="no"
14641 fi
14642 rm -f core conftest.err conftest.$ac_objext \
14643     conftest$ac_exeext conftest.$ac_ext
14644 fi
14645 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__get_cpuid" >&5
14646 $as_echo "$pgac_cv__get_cpuid" >&6; }
14647 if test x"$pgac_cv__get_cpuid" = x"yes"; then
14648
14649 $as_echo "#define HAVE__GET_CPUID 1" >>confdefs.h
14650
14651 fi
14652
14653 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __cpuid" >&5
14654 $as_echo_n "checking for __cpuid... " >&6; }
14655 if ${pgac_cv__cpuid+:} false; then :
14656   $as_echo_n "(cached) " >&6
14657 else
14658   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14659 /* end confdefs.h.  */
14660 #include <intrin.h>
14661 int
14662 main ()
14663 {
14664 unsigned int exx[4] = {0, 0, 0, 0};
14665   __get_cpuid(exx[0], 1);
14666
14667   ;
14668   return 0;
14669 }
14670 _ACEOF
14671 if ac_fn_c_try_link "$LINENO"; then :
14672   pgac_cv__cpuid="yes"
14673 else
14674   pgac_cv__cpuid="no"
14675 fi
14676 rm -f core conftest.err conftest.$ac_objext \
14677     conftest$ac_exeext conftest.$ac_ext
14678 fi
14679 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__cpuid" >&5
14680 $as_echo "$pgac_cv__cpuid" >&6; }
14681 if test x"$pgac_cv__cpuid" = x"yes"; then
14682
14683 $as_echo "#define HAVE__CPUID 1" >>confdefs.h
14684
14685 fi
14686
14687 # Check for Intel SSE 4.2 intrinsics to do CRC calculations.
14688 #
14689 # First check if the _mm_crc32_u8 and _mm_crc32_u64 intrinsics can be used
14690 # with the default compiler flags. If not, check if adding the -msse4.2
14691 # flag helps. CFLAGS_SSE42 is set to -msse4.2 if that's required.
14692 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=" >&5
14693 $as_echo_n "checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=... " >&6; }
14694 if ${pgac_cv_sse42_crc32_intrinsics_+:} false; then :
14695   $as_echo_n "(cached) " >&6
14696 else
14697   pgac_save_CFLAGS=$CFLAGS
14698 CFLAGS="$pgac_save_CFLAGS "
14699 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14700 /* end confdefs.h.  */
14701 #include <nmmintrin.h>
14702 int
14703 main ()
14704 {
14705 unsigned int crc = 0;
14706    crc = _mm_crc32_u8(crc, 0);
14707    crc = _mm_crc32_u32(crc, 0);
14708    /* return computed value, to prevent the above being optimized away */
14709    return crc == 0;
14710   ;
14711   return 0;
14712 }
14713 _ACEOF
14714 if ac_fn_c_try_link "$LINENO"; then :
14715   pgac_cv_sse42_crc32_intrinsics_=yes
14716 else
14717   pgac_cv_sse42_crc32_intrinsics_=no
14718 fi
14719 rm -f core conftest.err conftest.$ac_objext \
14720     conftest$ac_exeext conftest.$ac_ext
14721 CFLAGS="$pgac_save_CFLAGS"
14722 fi
14723 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_sse42_crc32_intrinsics_" >&5
14724 $as_echo "$pgac_cv_sse42_crc32_intrinsics_" >&6; }
14725 if test x"$pgac_cv_sse42_crc32_intrinsics_" = x"yes"; then
14726   CFLAGS_SSE42=""
14727   pgac_sse42_crc32_intrinsics=yes
14728 fi
14729
14730 if test x"$pgac_sse42_crc32_intrinsics" != x"yes"; then
14731   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=-msse4.2" >&5
14732 $as_echo_n "checking for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=-msse4.2... " >&6; }
14733 if ${pgac_cv_sse42_crc32_intrinsics__msse4_2+:} false; then :
14734   $as_echo_n "(cached) " >&6
14735 else
14736   pgac_save_CFLAGS=$CFLAGS
14737 CFLAGS="$pgac_save_CFLAGS -msse4.2"
14738 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14739 /* end confdefs.h.  */
14740 #include <nmmintrin.h>
14741 int
14742 main ()
14743 {
14744 unsigned int crc = 0;
14745    crc = _mm_crc32_u8(crc, 0);
14746    crc = _mm_crc32_u32(crc, 0);
14747    /* return computed value, to prevent the above being optimized away */
14748    return crc == 0;
14749   ;
14750   return 0;
14751 }
14752 _ACEOF
14753 if ac_fn_c_try_link "$LINENO"; then :
14754   pgac_cv_sse42_crc32_intrinsics__msse4_2=yes
14755 else
14756   pgac_cv_sse42_crc32_intrinsics__msse4_2=no
14757 fi
14758 rm -f core conftest.err conftest.$ac_objext \
14759     conftest$ac_exeext conftest.$ac_ext
14760 CFLAGS="$pgac_save_CFLAGS"
14761 fi
14762 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_sse42_crc32_intrinsics__msse4_2" >&5
14763 $as_echo "$pgac_cv_sse42_crc32_intrinsics__msse4_2" >&6; }
14764 if test x"$pgac_cv_sse42_crc32_intrinsics__msse4_2" = x"yes"; then
14765   CFLAGS_SSE42="-msse4.2"
14766   pgac_sse42_crc32_intrinsics=yes
14767 fi
14768
14769 fi
14770
14771
14772 # Are we targeting a processor that supports SSE 4.2? gcc, clang and icc all
14773 # define __SSE4_2__ in that case.
14774 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14775 /* end confdefs.h.  */
14776
14777 int
14778 main ()
14779 {
14780
14781 #ifndef __SSE4_2__
14782 #error __SSE4_2__ not defined
14783 #endif
14784
14785   ;
14786   return 0;
14787 }
14788 _ACEOF
14789 if ac_fn_c_try_compile "$LINENO"; then :
14790   SSE4_2_TARGETED=1
14791 fi
14792 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14793
14794 # Select CRC-32C implementation.
14795 #
14796 # If we are targeting a processor that has SSE 4.2 instructions, we can use the
14797 # special CRC instructions for calculating CRC-32C. If we're not targeting such
14798 # a processor, but we can nevertheless produce code that uses the SSE
14799 # intrinsics, perhaps with some extra CFLAGS, compile both implementations and
14800 # select which one to use at runtime, depending on whether SSE 4.2 is supported
14801 # by the processor we're running on.
14802 #
14803 # You can override this logic by setting the appropriate USE_*_CRC32 flag to 1
14804 # in the template or configure command line.
14805 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
14806   if test x"$pgac_sse42_crc32_intrinsics" = x"yes" && test x"$SSE4_2_TARGETED" = x"1" ; then
14807     USE_SSE42_CRC32C=1
14808   else
14809     # the CPUID instruction is needed for the runtime check.
14810     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
14811       USE_SSE42_CRC32C_WITH_RUNTIME_CHECK=1
14812     else
14813       # fall back to slicing-by-8 algorithm which doesn't require any special
14814       # CPU support.
14815       USE_SLICING_BY_8_CRC32C=1
14816     fi
14817   fi
14818 fi
14819
14820 # Set PG_CRC32C_OBJS appropriately depending on the selected implementation.
14821 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which CRC-32C implementation to use" >&5
14822 $as_echo_n "checking which CRC-32C implementation to use... " >&6; }
14823 if test x"$USE_SSE42_CRC32C" = x"1"; then
14824
14825 $as_echo "#define USE_SSE42_CRC32C 1" >>confdefs.h
14826
14827   PG_CRC32C_OBJS="pg_crc32c_sse42.o"
14828   { $as_echo "$as_me:${as_lineno-$LINENO}: result: SSE 4.2" >&5
14829 $as_echo "SSE 4.2" >&6; }
14830 else
14831   if test x"$USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" = x"1"; then
14832
14833 $as_echo "#define USE_SSE42_CRC32C_WITH_RUNTIME_CHECK 1" >>confdefs.h
14834
14835     PG_CRC32C_OBJS="pg_crc32c_sse42.o pg_crc32c_sb8.o pg_crc32c_choose.o"
14836     { $as_echo "$as_me:${as_lineno-$LINENO}: result: SSE 4.2 with runtime check" >&5
14837 $as_echo "SSE 4.2 with runtime check" >&6; }
14838   else
14839
14840 $as_echo "#define USE_SLICING_BY_8_CRC32C 1" >>confdefs.h
14841
14842     PG_CRC32C_OBJS="pg_crc32c_sb8.o"
14843     { $as_echo "$as_me:${as_lineno-$LINENO}: result: slicing-by-8" >&5
14844 $as_echo "slicing-by-8" >&6; }
14845   fi
14846 fi
14847
14848
14849
14850 # Select semaphore implementation type.
14851 if test "$PORTNAME" != "win32"; then
14852   if test x"$PREFERRED_SEMAPHORES" = x"NAMED_POSIX" ; then
14853     # Need sem_open for this
14854     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_open" >&5
14855 $as_echo_n "checking for library containing sem_open... " >&6; }
14856 if ${ac_cv_search_sem_open+:} false; then :
14857   $as_echo_n "(cached) " >&6
14858 else
14859   ac_func_search_save_LIBS=$LIBS
14860 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14861 /* end confdefs.h.  */
14862
14863 /* Override any GCC internal prototype to avoid an error.
14864    Use char because int might match the return type of a GCC
14865    builtin and then its argument prototype would still apply.  */
14866 #ifdef __cplusplus
14867 extern "C"
14868 #endif
14869 char sem_open ();
14870 int
14871 main ()
14872 {
14873 return sem_open ();
14874   ;
14875   return 0;
14876 }
14877 _ACEOF
14878 for ac_lib in '' rt pthread; do
14879   if test -z "$ac_lib"; then
14880     ac_res="none required"
14881   else
14882     ac_res=-l$ac_lib
14883     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
14884   fi
14885   if ac_fn_c_try_link "$LINENO"; then :
14886   ac_cv_search_sem_open=$ac_res
14887 fi
14888 rm -f core conftest.err conftest.$ac_objext \
14889     conftest$ac_exeext
14890   if ${ac_cv_search_sem_open+:} false; then :
14891   break
14892 fi
14893 done
14894 if ${ac_cv_search_sem_open+:} false; then :
14895
14896 else
14897   ac_cv_search_sem_open=no
14898 fi
14899 rm conftest.$ac_ext
14900 LIBS=$ac_func_search_save_LIBS
14901 fi
14902 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_open" >&5
14903 $as_echo "$ac_cv_search_sem_open" >&6; }
14904 ac_res=$ac_cv_search_sem_open
14905 if test "$ac_res" != no; then :
14906   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
14907   USE_NAMED_POSIX_SEMAPHORES=1
14908 fi
14909
14910   fi
14911   if test x"$PREFERRED_SEMAPHORES" = x"UNNAMED_POSIX" ; then
14912     # Need sem_init for this
14913     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5
14914 $as_echo_n "checking for library containing sem_init... " >&6; }
14915 if ${ac_cv_search_sem_init+:} false; then :
14916   $as_echo_n "(cached) " >&6
14917 else
14918   ac_func_search_save_LIBS=$LIBS
14919 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14920 /* end confdefs.h.  */
14921
14922 /* Override any GCC internal prototype to avoid an error.
14923    Use char because int might match the return type of a GCC
14924    builtin and then its argument prototype would still apply.  */
14925 #ifdef __cplusplus
14926 extern "C"
14927 #endif
14928 char sem_init ();
14929 int
14930 main ()
14931 {
14932 return sem_init ();
14933   ;
14934   return 0;
14935 }
14936 _ACEOF
14937 for ac_lib in '' rt pthread; do
14938   if test -z "$ac_lib"; then
14939     ac_res="none required"
14940   else
14941     ac_res=-l$ac_lib
14942     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
14943   fi
14944   if ac_fn_c_try_link "$LINENO"; then :
14945   ac_cv_search_sem_init=$ac_res
14946 fi
14947 rm -f core conftest.err conftest.$ac_objext \
14948     conftest$ac_exeext
14949   if ${ac_cv_search_sem_init+:} false; then :
14950   break
14951 fi
14952 done
14953 if ${ac_cv_search_sem_init+:} false; then :
14954
14955 else
14956   ac_cv_search_sem_init=no
14957 fi
14958 rm conftest.$ac_ext
14959 LIBS=$ac_func_search_save_LIBS
14960 fi
14961 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_init" >&5
14962 $as_echo "$ac_cv_search_sem_init" >&6; }
14963 ac_res=$ac_cv_search_sem_init
14964 if test "$ac_res" != no; then :
14965   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
14966   USE_UNNAMED_POSIX_SEMAPHORES=1
14967 fi
14968
14969   fi
14970   { $as_echo "$as_me:${as_lineno-$LINENO}: checking which semaphore API to use" >&5
14971 $as_echo_n "checking which semaphore API to use... " >&6; }
14972   if test x"$USE_NAMED_POSIX_SEMAPHORES" = x"1" ; then
14973
14974 $as_echo "#define USE_NAMED_POSIX_SEMAPHORES 1" >>confdefs.h
14975
14976     SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
14977     sematype="named POSIX"
14978   else
14979     if test x"$USE_UNNAMED_POSIX_SEMAPHORES" = x"1" ; then
14980
14981 $as_echo "#define USE_UNNAMED_POSIX_SEMAPHORES 1" >>confdefs.h
14982
14983       SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
14984       sematype="unnamed POSIX"
14985     else
14986
14987 $as_echo "#define USE_SYSV_SEMAPHORES 1" >>confdefs.h
14988
14989       SEMA_IMPLEMENTATION="src/backend/port/sysv_sema.c"
14990       sematype="System V"
14991     fi
14992   fi
14993   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sematype" >&5
14994 $as_echo "$sematype" >&6; }
14995 else
14996
14997 $as_echo "#define USE_WIN32_SEMAPHORES 1" >>confdefs.h
14998
14999   SEMA_IMPLEMENTATION="src/backend/port/win32_sema.c"
15000 fi
15001
15002
15003 # Select shared-memory implementation type.
15004 if test "$PORTNAME" != "win32"; then
15005
15006 $as_echo "#define USE_SYSV_SHARED_MEMORY 1" >>confdefs.h
15007
15008   SHMEM_IMPLEMENTATION="src/backend/port/sysv_shmem.c"
15009 else
15010
15011 $as_echo "#define USE_WIN32_SHARED_MEMORY 1" >>confdefs.h
15012
15013   SHMEM_IMPLEMENTATION="src/backend/port/win32_shmem.c"
15014 fi
15015
15016 # Select random number source
15017 #
15018 # You can override this logic by setting the appropriate USE_*RANDOM flag to 1
15019 # in the template or configure command line.
15020
15021 # If not selected manually, try to select a source automatically.
15022 if test "$enable_strong_random" = "yes" && test x"$USE_OPENSSL_RANDOM" = x"" && test x"$USE_WIN32_RANDOM" = x"" && test x"$USE_DEV_URANDOM" = x"" ; then
15023   if test x"$with_openssl" = x"yes" ; then
15024     USE_OPENSSL_RANDOM=1
15025   elif test "$PORTNAME" = x"win32" ; then
15026     USE_WIN32_RANDOM=1
15027   else
15028     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/urandom" >&5
15029 $as_echo_n "checking for /dev/urandom... " >&6; }
15030 if ${ac_cv_file__dev_urandom+:} false; then :
15031   $as_echo_n "(cached) " >&6
15032 else
15033   test "$cross_compiling" = yes &&
15034   as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
15035 if test -r "/dev/urandom"; then
15036   ac_cv_file__dev_urandom=yes
15037 else
15038   ac_cv_file__dev_urandom=no
15039 fi
15040 fi
15041 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_urandom" >&5
15042 $as_echo "$ac_cv_file__dev_urandom" >&6; }
15043 if test "x$ac_cv_file__dev_urandom" = xyes; then :
15044
15045 fi
15046
15047
15048     if test x"$ac_cv_file__dev_urandom" = x"yes" ; then
15049       USE_DEV_URANDOM=1
15050     fi
15051   fi
15052 fi
15053
15054 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which random number source to use" >&5
15055 $as_echo_n "checking which random number source to use... " >&6; }
15056 if test "$enable_strong_random" = yes ; then
15057   if test x"$USE_OPENSSL_RANDOM" = x"1" ; then
15058
15059 $as_echo "#define USE_OPENSSL_RANDOM 1" >>confdefs.h
15060
15061     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL" >&5
15062 $as_echo "OpenSSL" >&6; }
15063   elif test x"$USE_WIN32_RANDOM" = x"1" ; then
15064
15065 $as_echo "#define USE_WIN32_RANDOM 1" >>confdefs.h
15066
15067     { $as_echo "$as_me:${as_lineno-$LINENO}: result: Windows native" >&5
15068 $as_echo "Windows native" >&6; }
15069   elif test x"$USE_DEV_URANDOM" = x"1" ; then
15070
15071 $as_echo "#define USE_DEV_URANDOM 1" >>confdefs.h
15072
15073     { $as_echo "$as_me:${as_lineno-$LINENO}: result: /dev/urandom" >&5
15074 $as_echo "/dev/urandom" >&6; }
15075   else
15076     as_fn_error $? "
15077 no source of strong random numbers was found
15078 PostgreSQL can use OpenSSL or /dev/urandom as a source of random numbers,
15079 for authentication protocols. You can use --disable-strong-random to use a
15080 built-in pseudo random number generator, but that may be insecure." "$LINENO" 5
15081   fi
15082
15083 $as_echo "#define HAVE_STRONG_RANDOM 1" >>confdefs.h
15084
15085 else
15086     { $as_echo "$as_me:${as_lineno-$LINENO}: result: weak builtin PRNG" >&5
15087 $as_echo "weak builtin PRNG" >&6; }
15088     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
15089 *** Not using a strong random number source may be insecure." >&5
15090 $as_echo "$as_me: WARNING:
15091 *** Not using a strong random number source may be insecure." >&2;}
15092 fi
15093
15094 # If not set in template file, set bytes to use libc memset()
15095 if test x"$MEMSET_LOOP_LIMIT" = x"" ; then
15096   MEMSET_LOOP_LIMIT=1024
15097 fi
15098
15099 cat >>confdefs.h <<_ACEOF
15100 #define MEMSET_LOOP_LIMIT ${MEMSET_LOOP_LIMIT}
15101 _ACEOF
15102
15103
15104
15105 if test "$enable_nls" = yes ; then
15106
15107   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing bind_textdomain_codeset" >&5
15108 $as_echo_n "checking for library containing bind_textdomain_codeset... " >&6; }
15109 if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
15110   $as_echo_n "(cached) " >&6
15111 else
15112   ac_func_search_save_LIBS=$LIBS
15113 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15114 /* end confdefs.h.  */
15115
15116 /* Override any GCC internal prototype to avoid an error.
15117    Use char because int might match the return type of a GCC
15118    builtin and then its argument prototype would still apply.  */
15119 #ifdef __cplusplus
15120 extern "C"
15121 #endif
15122 char bind_textdomain_codeset ();
15123 int
15124 main ()
15125 {
15126 return bind_textdomain_codeset ();
15127   ;
15128   return 0;
15129 }
15130 _ACEOF
15131 for ac_lib in '' intl; do
15132   if test -z "$ac_lib"; then
15133     ac_res="none required"
15134   else
15135     ac_res=-l$ac_lib
15136     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
15137   fi
15138   if ac_fn_c_try_link "$LINENO"; then :
15139   ac_cv_search_bind_textdomain_codeset=$ac_res
15140 fi
15141 rm -f core conftest.err conftest.$ac_objext \
15142     conftest$ac_exeext
15143   if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
15144   break
15145 fi
15146 done
15147 if ${ac_cv_search_bind_textdomain_codeset+:} false; then :
15148
15149 else
15150   ac_cv_search_bind_textdomain_codeset=no
15151 fi
15152 rm conftest.$ac_ext
15153 LIBS=$ac_func_search_save_LIBS
15154 fi
15155 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_bind_textdomain_codeset" >&5
15156 $as_echo "$ac_cv_search_bind_textdomain_codeset" >&6; }
15157 ac_res=$ac_cv_search_bind_textdomain_codeset
15158 if test "$ac_res" != no; then :
15159   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
15160
15161 else
15162   as_fn_error $? "a gettext implementation is required for NLS" "$LINENO" 5
15163 fi
15164
15165   ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
15166 if test "x$ac_cv_header_libintl_h" = xyes; then :
15167
15168 else
15169   as_fn_error $? "header file <libintl.h> is required for NLS" "$LINENO" 5
15170 fi
15171
15172
15173   for ac_prog in msgfmt
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_MSGFMT+:} false; then :
15180   $as_echo_n "(cached) " >&6
15181 else
15182   if test -n "$MSGFMT"; then
15183   ac_cv_prog_MSGFMT="$MSGFMT" # 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_MSGFMT="$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 MSGFMT=$ac_cv_prog_MSGFMT
15203 if test -n "$MSGFMT"; then
15204   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
15205 $as_echo "$MSGFMT" >&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 "$MSGFMT" && break
15213 done
15214
15215   if test -z "$MSGFMT"; then
15216     as_fn_error $? "msgfmt is required for NLS" "$LINENO" 5
15217   fi
15218   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msgfmt flags" >&5
15219 $as_echo_n "checking for msgfmt flags... " >&6; }
15220 if ${pgac_cv_msgfmt_flags+:} false; then :
15221   $as_echo_n "(cached) " >&6
15222 else
15223   if test x"$MSGFMT" != x"" && "$MSGFMT" --version 2>&1 | grep "GNU" >/dev/null; then
15224     pgac_cv_msgfmt_flags=-c
15225 fi
15226 fi
15227 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_msgfmt_flags" >&5
15228 $as_echo "$pgac_cv_msgfmt_flags" >&6; }
15229   MSGFMT_FLAGS=$pgac_cv_msgfmt_flags
15230
15231   for ac_prog in msgmerge
15232 do
15233   # Extract the first word of "$ac_prog", so it can be a program name with args.
15234 set dummy $ac_prog; ac_word=$2
15235 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15236 $as_echo_n "checking for $ac_word... " >&6; }
15237 if ${ac_cv_prog_MSGMERGE+:} false; then :
15238   $as_echo_n "(cached) " >&6
15239 else
15240   if test -n "$MSGMERGE"; then
15241   ac_cv_prog_MSGMERGE="$MSGMERGE" # Let the user override the test.
15242 else
15243 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15244 for as_dir in $PATH
15245 do
15246   IFS=$as_save_IFS
15247   test -z "$as_dir" && as_dir=.
15248     for ac_exec_ext in '' $ac_executable_extensions; do
15249   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15250     ac_cv_prog_MSGMERGE="$ac_prog"
15251     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15252     break 2
15253   fi
15254 done
15255   done
15256 IFS=$as_save_IFS
15257
15258 fi
15259 fi
15260 MSGMERGE=$ac_cv_prog_MSGMERGE
15261 if test -n "$MSGMERGE"; then
15262   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
15263 $as_echo "$MSGMERGE" >&6; }
15264 else
15265   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15266 $as_echo "no" >&6; }
15267 fi
15268
15269
15270   test -n "$MSGMERGE" && break
15271 done
15272
15273   for ac_prog in xgettext
15274 do
15275   # Extract the first word of "$ac_prog", so it can be a program name with args.
15276 set dummy $ac_prog; ac_word=$2
15277 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15278 $as_echo_n "checking for $ac_word... " >&6; }
15279 if ${ac_cv_prog_XGETTEXT+:} false; then :
15280   $as_echo_n "(cached) " >&6
15281 else
15282   if test -n "$XGETTEXT"; then
15283   ac_cv_prog_XGETTEXT="$XGETTEXT" # Let the user override the test.
15284 else
15285 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15286 for as_dir in $PATH
15287 do
15288   IFS=$as_save_IFS
15289   test -z "$as_dir" && as_dir=.
15290     for ac_exec_ext in '' $ac_executable_extensions; do
15291   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15292     ac_cv_prog_XGETTEXT="$ac_prog"
15293     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15294     break 2
15295   fi
15296 done
15297   done
15298 IFS=$as_save_IFS
15299
15300 fi
15301 fi
15302 XGETTEXT=$ac_cv_prog_XGETTEXT
15303 if test -n "$XGETTEXT"; then
15304   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
15305 $as_echo "$XGETTEXT" >&6; }
15306 else
15307   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15308 $as_echo "no" >&6; }
15309 fi
15310
15311
15312   test -n "$XGETTEXT" && break
15313 done
15314
15315
15316 fi
15317
15318 # Check for Tcl configuration script tclConfig.sh
15319 if test "$with_tcl" = yes; then
15320     for ac_prog in tclsh tcl tclsh8.6 tclsh86 tclsh8.5 tclsh85 tclsh8.4 tclsh84
15321 do
15322   # Extract the first word of "$ac_prog", so it can be a program name with args.
15323 set dummy $ac_prog; ac_word=$2
15324 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15325 $as_echo_n "checking for $ac_word... " >&6; }
15326 if ${ac_cv_path_TCLSH+:} false; then :
15327   $as_echo_n "(cached) " >&6
15328 else
15329   case $TCLSH in
15330   [\\/]* | ?:[\\/]*)
15331   ac_cv_path_TCLSH="$TCLSH" # Let the user override the test with a path.
15332   ;;
15333   *)
15334   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15335 for as_dir in $PATH
15336 do
15337   IFS=$as_save_IFS
15338   test -z "$as_dir" && as_dir=.
15339     for ac_exec_ext in '' $ac_executable_extensions; do
15340   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15341     ac_cv_path_TCLSH="$as_dir/$ac_word$ac_exec_ext"
15342     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15343     break 2
15344   fi
15345 done
15346   done
15347 IFS=$as_save_IFS
15348
15349   ;;
15350 esac
15351 fi
15352 TCLSH=$ac_cv_path_TCLSH
15353 if test -n "$TCLSH"; then
15354   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLSH" >&5
15355 $as_echo "$TCLSH" >&6; }
15356 else
15357   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15358 $as_echo "no" >&6; }
15359 fi
15360
15361
15362   test -n "$TCLSH" && break
15363 done
15364
15365 if test x"$TCLSH" = x""; then
15366   as_fn_error $? "Tcl shell not found" "$LINENO" 5
15367 fi
15368
15369 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclConfig.sh" >&5
15370 $as_echo_n "checking for tclConfig.sh... " >&6; }
15371 # Let user override test
15372 if test -z "$TCL_CONFIG_SH"; then
15373     pgac_test_dirs="$with_tclconfig"
15374
15375     set X $pgac_test_dirs; shift
15376     if test $# -eq 0; then
15377         test -z "$TCLSH" && as_fn_error $? "unable to locate tclConfig.sh because no Tcl shell was found" "$LINENO" 5
15378         set X `echo 'puts $auto_path' | $TCLSH`; shift
15379     fi
15380
15381     for pgac_dir do
15382         if test -r "$pgac_dir/tclConfig.sh"; then
15383             TCL_CONFIG_SH=$pgac_dir/tclConfig.sh
15384             break
15385         fi
15386     done
15387 fi
15388
15389 if test -z "$TCL_CONFIG_SH"; then
15390     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15391 $as_echo "no" >&6; }
15392     as_fn_error $? "file 'tclConfig.sh' is required for Tcl" "$LINENO" 5
15393 else
15394     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCL_CONFIG_SH" >&5
15395 $as_echo "$TCL_CONFIG_SH" >&6; }
15396 fi
15397
15398
15399
15400     . "$TCL_CONFIG_SH"
15401 eval TCL_INCLUDE_SPEC=\"$TCL_INCLUDE_SPEC\"
15402 eval TCL_LIBS=\"$TCL_LIBS\"
15403 eval TCL_LIB_SPEC=\"$TCL_LIB_SPEC\"
15404 eval TCL_SHARED_BUILD=\"$TCL_SHARED_BUILD\"
15405
15406         if test "$TCL_SHARED_BUILD" != 1; then
15407       as_fn_error $? "cannot build PL/Tcl because Tcl is not a shared library
15408 Use --without-tcl to disable building PL/Tcl." "$LINENO" 5
15409     fi
15410     # now that we have TCL_INCLUDE_SPEC, we can check for <tcl.h>
15411     ac_save_CPPFLAGS=$CPPFLAGS
15412     CPPFLAGS="$TCL_INCLUDE_SPEC $CPPFLAGS"
15413     ac_fn_c_check_header_mongrel "$LINENO" "tcl.h" "ac_cv_header_tcl_h" "$ac_includes_default"
15414 if test "x$ac_cv_header_tcl_h" = xyes; then :
15415
15416 else
15417   as_fn_error $? "header file <tcl.h> is required for Tcl" "$LINENO" 5
15418 fi
15419
15420
15421     CPPFLAGS=$ac_save_CPPFLAGS
15422 fi
15423
15424 # check for <perl.h>
15425 if test "$with_perl" = yes; then
15426   ac_save_CPPFLAGS=$CPPFLAGS
15427   CPPFLAGS="$CPPFLAGS -I$perl_archlibexp/CORE"
15428   ac_fn_c_check_header_compile "$LINENO" "perl.h" "ac_cv_header_perl_h" "#include <EXTERN.h>
15429 "
15430 if test "x$ac_cv_header_perl_h" = xyes; then :
15431
15432 else
15433   as_fn_error $? "header file <perl.h> is required for Perl" "$LINENO" 5
15434 fi
15435
15436
15437   # While we're at it, check that we can link to libperl.
15438   # On most platforms, if perl.h is there then libperl.so will be too, but at
15439   # this writing Debian packages them separately.  There is no known reason to
15440   # waste cycles on separate probes for the Tcl or Python libraries, though.
15441   pgac_save_LIBS=$LIBS
15442   LIBS="$perl_embed_ldflags"
15443   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libperl" >&5
15444 $as_echo_n "checking for libperl... " >&6; }
15445   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15446 /* end confdefs.h.  */
15447
15448 #include <EXTERN.h>
15449 #include <perl.h>
15450
15451 int
15452 main ()
15453 {
15454 perl_alloc();
15455   ;
15456   return 0;
15457 }
15458 _ACEOF
15459 if ac_fn_c_try_link "$LINENO"; then :
15460   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15461 $as_echo "yes" >&6; }
15462 else
15463   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15464 $as_echo "no" >&6; }
15465      as_fn_error $? "libperl library is required for Perl" "$LINENO" 5
15466 fi
15467 rm -f core conftest.err conftest.$ac_objext \
15468     conftest$ac_exeext conftest.$ac_ext
15469   LIBS=$pgac_save_LIBS
15470   CPPFLAGS=$ac_save_CPPFLAGS
15471 fi
15472
15473 # check for <Python.h>
15474 if test "$with_python" = yes; then
15475   ac_save_CPPFLAGS=$CPPFLAGS
15476   CPPFLAGS="$python_includespec $CPPFLAGS"
15477   ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
15478 if test "x$ac_cv_header_Python_h" = xyes; then :
15479
15480 else
15481   as_fn_error $? "header file <Python.h> is required for Python" "$LINENO" 5
15482 fi
15483
15484
15485   CPPFLAGS=$ac_save_CPPFLAGS
15486 fi
15487
15488 #
15489 # Check for DocBook and tools
15490 #
15491 for ac_prog in onsgmls nsgmls
15492 do
15493   # Extract the first word of "$ac_prog", so it can be a program name with args.
15494 set dummy $ac_prog; ac_word=$2
15495 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15496 $as_echo_n "checking for $ac_word... " >&6; }
15497 if ${ac_cv_prog_NSGMLS+:} false; then :
15498   $as_echo_n "(cached) " >&6
15499 else
15500   if test -n "$NSGMLS"; then
15501   ac_cv_prog_NSGMLS="$NSGMLS" # Let the user override the test.
15502 else
15503 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15504 for as_dir in $PATH
15505 do
15506   IFS=$as_save_IFS
15507   test -z "$as_dir" && as_dir=.
15508     for ac_exec_ext in '' $ac_executable_extensions; do
15509   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15510     ac_cv_prog_NSGMLS="$ac_prog"
15511     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15512     break 2
15513   fi
15514 done
15515   done
15516 IFS=$as_save_IFS
15517
15518 fi
15519 fi
15520 NSGMLS=$ac_cv_prog_NSGMLS
15521 if test -n "$NSGMLS"; then
15522   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NSGMLS" >&5
15523 $as_echo "$NSGMLS" >&6; }
15524 else
15525   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15526 $as_echo "no" >&6; }
15527 fi
15528
15529
15530   test -n "$NSGMLS" && break
15531 done
15532
15533 for ac_prog in openjade jade
15534 do
15535   # Extract the first word of "$ac_prog", so it can be a program name with args.
15536 set dummy $ac_prog; ac_word=$2
15537 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15538 $as_echo_n "checking for $ac_word... " >&6; }
15539 if ${ac_cv_prog_JADE+:} false; then :
15540   $as_echo_n "(cached) " >&6
15541 else
15542   if test -n "$JADE"; then
15543   ac_cv_prog_JADE="$JADE" # Let the user override the test.
15544 else
15545 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15546 for as_dir in $PATH
15547 do
15548   IFS=$as_save_IFS
15549   test -z "$as_dir" && as_dir=.
15550     for ac_exec_ext in '' $ac_executable_extensions; do
15551   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15552     ac_cv_prog_JADE="$ac_prog"
15553     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15554     break 2
15555   fi
15556 done
15557   done
15558 IFS=$as_save_IFS
15559
15560 fi
15561 fi
15562 JADE=$ac_cv_prog_JADE
15563 if test -n "$JADE"; then
15564   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JADE" >&5
15565 $as_echo "$JADE" >&6; }
15566 else
15567   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15568 $as_echo "no" >&6; }
15569 fi
15570
15571
15572   test -n "$JADE" && break
15573 done
15574
15575
15576 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook V4.2" >&5
15577 $as_echo_n "checking for DocBook V4.2... " >&6; }
15578 if ${pgac_cv_check_docbook+:} false; then :
15579   $as_echo_n "(cached) " >&6
15580 else
15581   cat >conftest.sgml <<EOF
15582 <!doctype book PUBLIC "-//OASIS//DTD DocBook V4.2//EN">
15583 <book>
15584  <title>test</title>
15585  <chapter>
15586   <title>random</title>
15587    <sect1>
15588     <title>testsect</title>
15589     <para>text</para>
15590   </sect1>
15591  </chapter>
15592 </book>
15593 EOF
15594
15595 pgac_cv_check_docbook=no
15596
15597 if test -n "$NSGMLS"; then
15598   $NSGMLS -s conftest.sgml 1>&5 2>&1
15599   if test $? -eq 0; then
15600     pgac_cv_check_docbook=yes
15601   fi
15602 fi
15603 rm -f conftest.sgml
15604 fi
15605 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_docbook" >&5
15606 $as_echo "$pgac_cv_check_docbook" >&6; }
15607
15608 have_docbook=$pgac_cv_check_docbook
15609
15610
15611 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook stylesheets" >&5
15612 $as_echo_n "checking for DocBook stylesheets... " >&6; }
15613 if ${pgac_cv_path_stylesheets+:} false; then :
15614   $as_echo_n "(cached) " >&6
15615 else
15616   if test -n "$DOCBOOKSTYLE"; then
15617   pgac_cv_path_stylesheets=$DOCBOOKSTYLE
15618 else
15619   for pgac_prefix in /usr /usr/local /opt /sw; do
15620     for pgac_infix in share lib; do
15621       for pgac_postfix in \
15622         sgml/stylesheets/nwalsh-modular \
15623         sgml/stylesheets/docbook \
15624         sgml/stylesheets/dsssl/docbook \
15625         sgml/docbook-dsssl \
15626         sgml/docbook/dsssl/modular \
15627         sgml/docbook/stylesheet/dsssl/modular \
15628         sgml/docbook/dsssl-stylesheets \
15629         sgml/dsssl/docbook-dsssl-nwalsh
15630       do
15631         pgac_candidate=$pgac_prefix/$pgac_infix/$pgac_postfix
15632         if test -r "$pgac_candidate/html/docbook.dsl" \
15633            && test -r "$pgac_candidate/print/docbook.dsl"
15634         then
15635           pgac_cv_path_stylesheets=$pgac_candidate
15636           break 3
15637         fi
15638       done
15639     done
15640   done
15641 fi
15642 fi
15643
15644 DOCBOOKSTYLE=$pgac_cv_path_stylesheets
15645
15646 if test -n "$DOCBOOKSTYLE"; then
15647   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCBOOKSTYLE" >&5
15648 $as_echo "$DOCBOOKSTYLE" >&6; }
15649 else
15650   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15651 $as_echo "no" >&6; }
15652 fi
15653 if test -n "$DOCBOOKSTYLE" -a -r "$DOCBOOKSTYLE/bin/collateindex.pl"; then
15654   COLLATEINDEX="$DOCBOOKSTYLE/bin/collateindex.pl"
15655
15656 else
15657   # Extract the first word of "collateindex.pl", so it can be a program name with args.
15658 set dummy collateindex.pl; ac_word=$2
15659 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15660 $as_echo_n "checking for $ac_word... " >&6; }
15661 if ${ac_cv_path_COLLATEINDEX+:} false; then :
15662   $as_echo_n "(cached) " >&6
15663 else
15664   case $COLLATEINDEX in
15665   [\\/]* | ?:[\\/]*)
15666   ac_cv_path_COLLATEINDEX="$COLLATEINDEX" # Let the user override the test with a path.
15667   ;;
15668   *)
15669   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15670 for as_dir in $PATH
15671 do
15672   IFS=$as_save_IFS
15673   test -z "$as_dir" && as_dir=.
15674     for ac_exec_ext in '' $ac_executable_extensions; do
15675   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15676     ac_cv_path_COLLATEINDEX="$as_dir/$ac_word$ac_exec_ext"
15677     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15678     break 2
15679   fi
15680 done
15681   done
15682 IFS=$as_save_IFS
15683
15684   ;;
15685 esac
15686 fi
15687 COLLATEINDEX=$ac_cv_path_COLLATEINDEX
15688 if test -n "$COLLATEINDEX"; then
15689   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COLLATEINDEX" >&5
15690 $as_echo "$COLLATEINDEX" >&6; }
15691 else
15692   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15693 $as_echo "no" >&6; }
15694 fi
15695
15696
15697 fi
15698 for ac_prog in dbtoepub
15699 do
15700   # Extract the first word of "$ac_prog", so it can be a program name with args.
15701 set dummy $ac_prog; ac_word=$2
15702 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15703 $as_echo_n "checking for $ac_word... " >&6; }
15704 if ${ac_cv_prog_DBTOEPUB+:} false; then :
15705   $as_echo_n "(cached) " >&6
15706 else
15707   if test -n "$DBTOEPUB"; then
15708   ac_cv_prog_DBTOEPUB="$DBTOEPUB" # Let the user override the test.
15709 else
15710 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15711 for as_dir in $PATH
15712 do
15713   IFS=$as_save_IFS
15714   test -z "$as_dir" && as_dir=.
15715     for ac_exec_ext in '' $ac_executable_extensions; do
15716   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15717     ac_cv_prog_DBTOEPUB="$ac_prog"
15718     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15719     break 2
15720   fi
15721 done
15722   done
15723 IFS=$as_save_IFS
15724
15725 fi
15726 fi
15727 DBTOEPUB=$ac_cv_prog_DBTOEPUB
15728 if test -n "$DBTOEPUB"; then
15729   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
15730 $as_echo "$DBTOEPUB" >&6; }
15731 else
15732   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15733 $as_echo "no" >&6; }
15734 fi
15735
15736
15737   test -n "$DBTOEPUB" && break
15738 done
15739
15740 for ac_prog in xmllint
15741 do
15742   # Extract the first word of "$ac_prog", so it can be a program name with args.
15743 set dummy $ac_prog; ac_word=$2
15744 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15745 $as_echo_n "checking for $ac_word... " >&6; }
15746 if ${ac_cv_prog_XMLLINT+:} false; then :
15747   $as_echo_n "(cached) " >&6
15748 else
15749   if test -n "$XMLLINT"; then
15750   ac_cv_prog_XMLLINT="$XMLLINT" # Let the user override the test.
15751 else
15752 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15753 for as_dir in $PATH
15754 do
15755   IFS=$as_save_IFS
15756   test -z "$as_dir" && as_dir=.
15757     for ac_exec_ext in '' $ac_executable_extensions; do
15758   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15759     ac_cv_prog_XMLLINT="$ac_prog"
15760     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15761     break 2
15762   fi
15763 done
15764   done
15765 IFS=$as_save_IFS
15766
15767 fi
15768 fi
15769 XMLLINT=$ac_cv_prog_XMLLINT
15770 if test -n "$XMLLINT"; then
15771   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
15772 $as_echo "$XMLLINT" >&6; }
15773 else
15774   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15775 $as_echo "no" >&6; }
15776 fi
15777
15778
15779   test -n "$XMLLINT" && break
15780 done
15781
15782 for ac_prog in xsltproc
15783 do
15784   # Extract the first word of "$ac_prog", so it can be a program name with args.
15785 set dummy $ac_prog; ac_word=$2
15786 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15787 $as_echo_n "checking for $ac_word... " >&6; }
15788 if ${ac_cv_prog_XSLTPROC+:} false; then :
15789   $as_echo_n "(cached) " >&6
15790 else
15791   if test -n "$XSLTPROC"; then
15792   ac_cv_prog_XSLTPROC="$XSLTPROC" # Let the user override the test.
15793 else
15794 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15795 for as_dir in $PATH
15796 do
15797   IFS=$as_save_IFS
15798   test -z "$as_dir" && as_dir=.
15799     for ac_exec_ext in '' $ac_executable_extensions; do
15800   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15801     ac_cv_prog_XSLTPROC="$ac_prog"
15802     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15803     break 2
15804   fi
15805 done
15806   done
15807 IFS=$as_save_IFS
15808
15809 fi
15810 fi
15811 XSLTPROC=$ac_cv_prog_XSLTPROC
15812 if test -n "$XSLTPROC"; then
15813   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
15814 $as_echo "$XSLTPROC" >&6; }
15815 else
15816   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15817 $as_echo "no" >&6; }
15818 fi
15819
15820
15821   test -n "$XSLTPROC" && break
15822 done
15823
15824 for ac_prog in osx sgml2xml sx
15825 do
15826   # Extract the first word of "$ac_prog", so it can be a program name with args.
15827 set dummy $ac_prog; ac_word=$2
15828 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15829 $as_echo_n "checking for $ac_word... " >&6; }
15830 if ${ac_cv_prog_OSX+:} false; then :
15831   $as_echo_n "(cached) " >&6
15832 else
15833   if test -n "$OSX"; then
15834   ac_cv_prog_OSX="$OSX" # Let the user override the test.
15835 else
15836 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15837 for as_dir in $PATH
15838 do
15839   IFS=$as_save_IFS
15840   test -z "$as_dir" && as_dir=.
15841     for ac_exec_ext in '' $ac_executable_extensions; do
15842   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15843     ac_cv_prog_OSX="$ac_prog"
15844     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15845     break 2
15846   fi
15847 done
15848   done
15849 IFS=$as_save_IFS
15850
15851 fi
15852 fi
15853 OSX=$ac_cv_prog_OSX
15854 if test -n "$OSX"; then
15855   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OSX" >&5
15856 $as_echo "$OSX" >&6; }
15857 else
15858   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15859 $as_echo "no" >&6; }
15860 fi
15861
15862
15863   test -n "$OSX" && break
15864 done
15865
15866
15867 #
15868 # Check for test tools
15869 #
15870 if test "$enable_tap_tests" = yes; then
15871   for ac_prog in prove
15872 do
15873   # Extract the first word of "$ac_prog", so it can be a program name with args.
15874 set dummy $ac_prog; ac_word=$2
15875 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
15876 $as_echo_n "checking for $ac_word... " >&6; }
15877 if ${ac_cv_prog_PROVE+:} false; then :
15878   $as_echo_n "(cached) " >&6
15879 else
15880   if test -n "$PROVE"; then
15881   ac_cv_prog_PROVE="$PROVE" # Let the user override the test.
15882 else
15883 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15884 for as_dir in $PATH
15885 do
15886   IFS=$as_save_IFS
15887   test -z "$as_dir" && as_dir=.
15888     for ac_exec_ext in '' $ac_executable_extensions; do
15889   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
15890     ac_cv_prog_PROVE="$ac_prog"
15891     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
15892     break 2
15893   fi
15894 done
15895   done
15896 IFS=$as_save_IFS
15897
15898 fi
15899 fi
15900 PROVE=$ac_cv_prog_PROVE
15901 if test -n "$PROVE"; then
15902   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROVE" >&5
15903 $as_echo "$PROVE" >&6; }
15904 else
15905   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15906 $as_echo "no" >&6; }
15907 fi
15908
15909
15910   test -n "$PROVE" && break
15911 done
15912
15913   if test -z "$PROVE"; then
15914     as_fn_error $? "prove not found" "$LINENO" 5
15915   fi
15916   if test -z "$PERL"; then
15917     as_fn_error $? "Perl not found" "$LINENO" 5
15918   fi
15919 fi
15920
15921 # Thread testing
15922
15923 # We have to run the thread test near the end so we have all our symbols
15924 # defined.  Cross compiling throws a warning.
15925 #
15926 if test "$enable_thread_safety" = yes; then
15927 if test "$PORTNAME" != "win32"
15928 then
15929 { $as_echo "$as_me:${as_lineno-$LINENO}: checking thread safety of required library functions" >&5
15930 $as_echo_n "checking thread safety of required library functions... " >&6; }
15931
15932 _CFLAGS="$CFLAGS"
15933 _LIBS="$LIBS"
15934 CFLAGS="$CFLAGS $PTHREAD_CFLAGS -DIN_CONFIGURE"
15935 LIBS="$LIBS $PTHREAD_LIBS"
15936 if test "$cross_compiling" = yes; then :
15937   { $as_echo "$as_me:${as_lineno-$LINENO}: result: maybe" >&5
15938 $as_echo "maybe" >&6; }
15939   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
15940 *** Skipping thread test program because of cross-compile build.
15941 *** Run the program in src/test/thread on the target machine.
15942 " >&5
15943 $as_echo "$as_me: WARNING:
15944 *** Skipping thread test program because of cross-compile build.
15945 *** Run the program in src/test/thread on the target machine.
15946 " >&2;}
15947 else
15948   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15949 /* end confdefs.h.  */
15950 #include "$srcdir/src/test/thread/thread_test.c"
15951 _ACEOF
15952 if ac_fn_c_try_run "$LINENO"; then :
15953   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15954 $as_echo "yes" >&6; }
15955 else
15956   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15957 $as_echo "no" >&6; }
15958   as_fn_error $? "thread test program failed
15959 This platform is not thread-safe.  Check the file 'config.log' or compile
15960 and run src/test/thread/thread_test for the exact reason.
15961 Use --disable-thread-safety to disable thread safety." "$LINENO" 5
15962 fi
15963 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15964   conftest.$ac_objext conftest.beam conftest.$ac_ext
15965 fi
15966
15967 CFLAGS="$_CFLAGS"
15968 LIBS="$_LIBS"
15969 else
15970 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** skipping thread test on Win32" >&5
15971 $as_echo "$as_me: WARNING: *** skipping thread test on Win32" >&2;}
15972 fi
15973 fi
15974
15975 # If compiler will take -Wl,--as-needed (or various platform-specific
15976 # spellings thereof) then add that to LDFLAGS.  This is much easier than
15977 # trying to filter LIBS to the minimum for each executable.
15978 # On (at least) some Red-Hat-derived systems, this switch breaks linking to
15979 # libreadline; therefore we postpone testing it until we know what library
15980 # dependencies readline has.  The test code will try to link with $LIBS.
15981 if test "$with_readline" = yes; then
15982   link_test_func=readline
15983 else
15984   link_test_func=exit
15985 fi
15986
15987 if test "$PORTNAME" = "darwin"; then
15988   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,-dead_strip_dylibs" >&5
15989 $as_echo_n "checking whether $CC supports -Wl,-dead_strip_dylibs... " >&6; }
15990 if ${pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs+:} false; then :
15991   $as_echo_n "(cached) " >&6
15992 else
15993   pgac_save_LDFLAGS=$LDFLAGS
15994 LDFLAGS="$pgac_save_LDFLAGS -Wl,-dead_strip_dylibs"
15995 if test "$cross_compiling" = yes; then :
15996   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs="assuming no"
15997 else
15998   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15999 /* end confdefs.h.  */
16000 extern void $link_test_func (); void (*fptr) () = $link_test_func;
16001 int
16002 main ()
16003 {
16004
16005   ;
16006   return 0;
16007 }
16008 _ACEOF
16009 if ac_fn_c_try_run "$LINENO"; then :
16010   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=yes
16011 else
16012   pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=no
16013 fi
16014 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16015   conftest.$ac_objext conftest.beam conftest.$ac_ext
16016 fi
16017
16018 LDFLAGS="$pgac_save_LDFLAGS"
16019 fi
16020 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&5
16021 $as_echo "$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&6; }
16022 if test x"$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" = x"yes"; then
16023   LDFLAGS="$LDFLAGS -Wl,-dead_strip_dylibs"
16024 fi
16025
16026 elif test "$PORTNAME" = "openbsd"; then
16027   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,-Bdynamic" >&5
16028 $as_echo_n "checking whether $CC supports -Wl,-Bdynamic... " >&6; }
16029 if ${pgac_cv_prog_cc_ldflags__Wl__Bdynamic+:} false; then :
16030   $as_echo_n "(cached) " >&6
16031 else
16032   pgac_save_LDFLAGS=$LDFLAGS
16033 LDFLAGS="$pgac_save_LDFLAGS -Wl,-Bdynamic"
16034 if test "$cross_compiling" = yes; then :
16035   pgac_cv_prog_cc_ldflags__Wl__Bdynamic="assuming no"
16036 else
16037   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16038 /* end confdefs.h.  */
16039 extern void $link_test_func (); void (*fptr) () = $link_test_func;
16040 int
16041 main ()
16042 {
16043
16044   ;
16045   return 0;
16046 }
16047 _ACEOF
16048 if ac_fn_c_try_run "$LINENO"; then :
16049   pgac_cv_prog_cc_ldflags__Wl__Bdynamic=yes
16050 else
16051   pgac_cv_prog_cc_ldflags__Wl__Bdynamic=no
16052 fi
16053 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16054   conftest.$ac_objext conftest.beam conftest.$ac_ext
16055 fi
16056
16057 LDFLAGS="$pgac_save_LDFLAGS"
16058 fi
16059 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&5
16060 $as_echo "$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&6; }
16061 if test x"$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" = x"yes"; then
16062   LDFLAGS="$LDFLAGS -Wl,-Bdynamic"
16063 fi
16064
16065 else
16066   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wl,--as-needed" >&5
16067 $as_echo_n "checking whether $CC supports -Wl,--as-needed... " >&6; }
16068 if ${pgac_cv_prog_cc_ldflags__Wl___as_needed+:} false; then :
16069   $as_echo_n "(cached) " >&6
16070 else
16071   pgac_save_LDFLAGS=$LDFLAGS
16072 LDFLAGS="$pgac_save_LDFLAGS -Wl,--as-needed"
16073 if test "$cross_compiling" = yes; then :
16074   pgac_cv_prog_cc_ldflags__Wl___as_needed="assuming no"
16075 else
16076   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16077 /* end confdefs.h.  */
16078 extern void $link_test_func (); void (*fptr) () = $link_test_func;
16079 int
16080 main ()
16081 {
16082
16083   ;
16084   return 0;
16085 }
16086 _ACEOF
16087 if ac_fn_c_try_run "$LINENO"; then :
16088   pgac_cv_prog_cc_ldflags__Wl___as_needed=yes
16089 else
16090   pgac_cv_prog_cc_ldflags__Wl___as_needed=no
16091 fi
16092 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16093   conftest.$ac_objext conftest.beam conftest.$ac_ext
16094 fi
16095
16096 LDFLAGS="$pgac_save_LDFLAGS"
16097 fi
16098 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_cc_ldflags__Wl___as_needed" >&5
16099 $as_echo "$pgac_cv_prog_cc_ldflags__Wl___as_needed" >&6; }
16100 if test x"$pgac_cv_prog_cc_ldflags__Wl___as_needed" = x"yes"; then
16101   LDFLAGS="$LDFLAGS -Wl,--as-needed"
16102 fi
16103
16104 fi
16105
16106 # Create compiler version string
16107 if test x"$GCC" = x"yes" ; then
16108   cc_string=`${CC} --version | sed q`
16109   case $cc_string in [A-Za-z]*) ;; *) cc_string="GCC $cc_string";; esac
16110 elif test x"$SUN_STUDIO_CC" = x"yes" ; then
16111   cc_string=`${CC} -V 2>&1 | sed q`
16112 else
16113   cc_string=$CC
16114 fi
16115
16116
16117 cat >>confdefs.h <<_ACEOF
16118 #define PG_VERSION_STR "PostgreSQL $PG_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"
16119 _ACEOF
16120
16121
16122 # Supply a numeric version string for use by 3rd party add-ons
16123 # awk -F is a regex on some platforms, and not on others, so make "." a tab
16124 PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |
16125 tr '.' '        ' |
16126 $AWK '{printf "%d%02d%02d", $1, $2, (NF >= 3) ? $3 : 0}'`"
16127
16128 cat >>confdefs.h <<_ACEOF
16129 #define PG_VERSION_NUM $PG_VERSION_NUM
16130 _ACEOF
16131
16132
16133
16134
16135 # Begin output steps
16136
16137 { $as_echo "$as_me:${as_lineno-$LINENO}: using compiler=$cc_string" >&5
16138 $as_echo "$as_me: using compiler=$cc_string" >&6;}
16139 { $as_echo "$as_me:${as_lineno-$LINENO}: using CFLAGS=$CFLAGS" >&5
16140 $as_echo "$as_me: using CFLAGS=$CFLAGS" >&6;}
16141 { $as_echo "$as_me:${as_lineno-$LINENO}: using CPPFLAGS=$CPPFLAGS" >&5
16142 $as_echo "$as_me: using CPPFLAGS=$CPPFLAGS" >&6;}
16143 { $as_echo "$as_me:${as_lineno-$LINENO}: using LDFLAGS=$LDFLAGS" >&5
16144 $as_echo "$as_me: using LDFLAGS=$LDFLAGS" >&6;}
16145
16146 # prepare build tree if outside source tree
16147 # Note 1: test -ef might not exist, but it's more reliable than `pwd`.
16148 # Note 2: /bin/pwd might be better than shell's built-in at getting
16149 #         a symlink-free name.
16150 if ( test "$srcdir" -ef . ) >/dev/null 2>&1 || test "`cd $srcdir && /bin/pwd`" = "`/bin/pwd`"; then
16151   vpath_build=no
16152 else
16153   vpath_build=yes
16154   if test "$no_create" != yes; then
16155     $as_echo_n "preparing build tree... " >&6
16156     pgac_abs_top_srcdir=`cd "$srcdir" && pwd`
16157     $SHELL "$ac_aux_dir/prep_buildtree" "$pgac_abs_top_srcdir" "." \
16158       || as_fn_error $? "failed" "$LINENO" 5
16159     { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
16160 $as_echo "done" >&6; }
16161   fi
16162 fi
16163
16164
16165
16166 ac_config_files="$ac_config_files GNUmakefile src/Makefile.global"
16167
16168
16169 ac_config_links="$ac_config_links src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION} src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION} src/include/dynloader.h:src/backend/port/dynloader/${template}.h src/include/pg_config_os.h:src/include/port/${template}.h src/Makefile.port:src/makefiles/Makefile.${template}"
16170
16171
16172 if test "$PORTNAME" = "win32"; then
16173 ac_config_commands="$ac_config_commands check_win32_symlinks"
16174
16175 fi
16176
16177 ac_config_headers="$ac_config_headers src/include/pg_config.h"
16178
16179
16180 ac_config_headers="$ac_config_headers src/include/pg_config_ext.h"
16181
16182
16183 ac_config_headers="$ac_config_headers src/interfaces/ecpg/include/ecpg_config.h"
16184
16185
16186 cat >confcache <<\_ACEOF
16187 # This file is a shell script that caches the results of configure
16188 # tests run on this system so they can be shared between configure
16189 # scripts and configure runs, see configure's option --config-cache.
16190 # It is not useful on other systems.  If it contains results you don't
16191 # want to keep, you may remove or edit it.
16192 #
16193 # config.status only pays attention to the cache file if you give it
16194 # the --recheck option to rerun configure.
16195 #
16196 # `ac_cv_env_foo' variables (set or unset) will be overridden when
16197 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16198 # following values.
16199
16200 _ACEOF
16201
16202 # The following way of writing the cache mishandles newlines in values,
16203 # but we know of no workaround that is simple, portable, and efficient.
16204 # So, we kill variables containing newlines.
16205 # Ultrix sh set writes to stderr and can't be redirected directly,
16206 # and sets the high bit in the cache file unless we assign to the vars.
16207 (
16208   for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
16209     eval ac_val=\$$ac_var
16210     case $ac_val in #(
16211     *${as_nl}*)
16212       case $ac_var in #(
16213       *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
16214 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
16215       esac
16216       case $ac_var in #(
16217       _ | IFS | as_nl) ;; #(
16218       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
16219       *) { eval $ac_var=; unset $ac_var;} ;;
16220       esac ;;
16221     esac
16222   done
16223
16224   (set) 2>&1 |
16225     case $as_nl`(ac_space=' '; set) 2>&1` in #(
16226     *${as_nl}ac_space=\ *)
16227       # `set' does not quote correctly, so add quotes: double-quote
16228       # substitution turns \\\\ into \\, and sed turns \\ into \.
16229       sed -n \
16230         "s/'/'\\\\''/g;
16231           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16232       ;; #(
16233     *)
16234       # `set' quotes correctly as required by POSIX, so do not add quotes.
16235       sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
16236       ;;
16237     esac |
16238     sort
16239 ) |
16240   sed '
16241      /^ac_cv_env_/b end
16242      t clear
16243      :clear
16244      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16245      t end
16246      s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16247      :end' >>confcache
16248 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
16249   if test -w "$cache_file"; then
16250     if test "x$cache_file" != "x/dev/null"; then
16251       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
16252 $as_echo "$as_me: updating cache $cache_file" >&6;}
16253       if test ! -f "$cache_file" || test -h "$cache_file"; then
16254         cat confcache >"$cache_file"
16255       else
16256         case $cache_file in #(
16257         */* | ?:*)
16258           mv -f confcache "$cache_file"$$ &&
16259           mv -f "$cache_file"$$ "$cache_file" ;; #(
16260         *)
16261           mv -f confcache "$cache_file" ;;
16262         esac
16263       fi
16264     fi
16265   else
16266     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
16267 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
16268   fi
16269 fi
16270 rm -f confcache
16271
16272 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16273 # Let make expand exec_prefix.
16274 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16275
16276 DEFS=-DHAVE_CONFIG_H
16277
16278 ac_libobjs=
16279 ac_ltlibobjs=
16280 U=
16281 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
16282   # 1. Remove the extension, and $U if already installed.
16283   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
16284   ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
16285   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
16286   #    will be set to the directory where LIBOBJS objects are built.
16287   as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
16288   as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
16289 done
16290 LIBOBJS=$ac_libobjs
16291
16292 LTLIBOBJS=$ac_ltlibobjs
16293
16294
16295
16296
16297 : "${CONFIG_STATUS=./config.status}"
16298 ac_write_fail=0
16299 ac_clean_files_save=$ac_clean_files
16300 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16301 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
16302 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
16303 as_write_fail=0
16304 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
16305 #! $SHELL
16306 # Generated by $as_me.
16307 # Run this file to recreate the current configuration.
16308 # Compiler output produced by configure, useful for debugging
16309 # configure, is in config.log if it exists.
16310
16311 debug=false
16312 ac_cs_recheck=false
16313 ac_cs_silent=false
16314
16315 SHELL=\${CONFIG_SHELL-$SHELL}
16316 export SHELL
16317 _ASEOF
16318 cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
16319 ## -------------------- ##
16320 ## M4sh Initialization. ##
16321 ## -------------------- ##
16322
16323 # Be more Bourne compatible
16324 DUALCASE=1; export DUALCASE # for MKS sh
16325 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
16326   emulate sh
16327   NULLCMD=:
16328   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
16329   # is contrary to our usage.  Disable this feature.
16330   alias -g '${1+"$@"}'='"$@"'
16331   setopt NO_GLOB_SUBST
16332 else
16333   case `(set -o) 2>/dev/null` in #(
16334   *posix*) :
16335     set -o posix ;; #(
16336   *) :
16337      ;;
16338 esac
16339 fi
16340
16341
16342 as_nl='
16343 '
16344 export as_nl
16345 # Printing a long string crashes Solaris 7 /usr/bin/printf.
16346 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
16347 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
16348 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
16349 # Prefer a ksh shell builtin over an external printf program on Solaris,
16350 # but without wasting forks for bash or zsh.
16351 if test -z "$BASH_VERSION$ZSH_VERSION" \
16352     && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
16353   as_echo='print -r --'
16354   as_echo_n='print -rn --'
16355 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
16356   as_echo='printf %s\n'
16357   as_echo_n='printf %s'
16358 else
16359   if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
16360     as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
16361     as_echo_n='/usr/ucb/echo -n'
16362   else
16363     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
16364     as_echo_n_body='eval
16365       arg=$1;
16366       case $arg in #(
16367       *"$as_nl"*)
16368         expr "X$arg" : "X\\(.*\\)$as_nl";
16369         arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
16370       esac;
16371       expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
16372     '
16373     export as_echo_n_body
16374     as_echo_n='sh -c $as_echo_n_body as_echo'
16375   fi
16376   export as_echo_body
16377   as_echo='sh -c $as_echo_body as_echo'
16378 fi
16379
16380 # The user is always right.
16381 if test "${PATH_SEPARATOR+set}" != set; then
16382   PATH_SEPARATOR=:
16383   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
16384     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
16385       PATH_SEPARATOR=';'
16386   }
16387 fi
16388
16389
16390 # IFS
16391 # We need space, tab and new line, in precisely that order.  Quoting is
16392 # there to prevent editors from complaining about space-tab.
16393 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
16394 # splitting by setting IFS to empty value.)
16395 IFS=" ""        $as_nl"
16396
16397 # Find who we are.  Look in the path if we contain no directory separator.
16398 as_myself=
16399 case $0 in #((
16400   *[\\/]* ) as_myself=$0 ;;
16401   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
16402 for as_dir in $PATH
16403 do
16404   IFS=$as_save_IFS
16405   test -z "$as_dir" && as_dir=.
16406     test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
16407   done
16408 IFS=$as_save_IFS
16409
16410      ;;
16411 esac
16412 # We did not find ourselves, most probably we were run as `sh COMMAND'
16413 # in which case we are not to be found in the path.
16414 if test "x$as_myself" = x; then
16415   as_myself=$0
16416 fi
16417 if test ! -f "$as_myself"; then
16418   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
16419   exit 1
16420 fi
16421
16422 # Unset variables that we do not need and which cause bugs (e.g. in
16423 # pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
16424 # suppresses any "Segmentation fault" message there.  '((' could
16425 # trigger a bug in pdksh 5.2.14.
16426 for as_var in BASH_ENV ENV MAIL MAILPATH
16427 do eval test x\${$as_var+set} = xset \
16428   && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
16429 done
16430 PS1='$ '
16431 PS2='> '
16432 PS4='+ '
16433
16434 # NLS nuisances.
16435 LC_ALL=C
16436 export LC_ALL
16437 LANGUAGE=C
16438 export LANGUAGE
16439
16440 # CDPATH.
16441 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
16442
16443
16444 # as_fn_error STATUS ERROR [LINENO LOG_FD]
16445 # ----------------------------------------
16446 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
16447 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
16448 # script with STATUS, using 1 if that was 0.
16449 as_fn_error ()
16450 {
16451   as_status=$1; test $as_status -eq 0 && as_status=1
16452   if test "$4"; then
16453     as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
16454     $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
16455   fi
16456   $as_echo "$as_me: error: $2" >&2
16457   as_fn_exit $as_status
16458 } # as_fn_error
16459
16460
16461 # as_fn_set_status STATUS
16462 # -----------------------
16463 # Set $? to STATUS, without forking.
16464 as_fn_set_status ()
16465 {
16466   return $1
16467 } # as_fn_set_status
16468
16469 # as_fn_exit STATUS
16470 # -----------------
16471 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
16472 as_fn_exit ()
16473 {
16474   set +e
16475   as_fn_set_status $1
16476   exit $1
16477 } # as_fn_exit
16478
16479 # as_fn_unset VAR
16480 # ---------------
16481 # Portably unset VAR.
16482 as_fn_unset ()
16483 {
16484   { eval $1=; unset $1;}
16485 }
16486 as_unset=as_fn_unset
16487 # as_fn_append VAR VALUE
16488 # ----------------------
16489 # Append the text in VALUE to the end of the definition contained in VAR. Take
16490 # advantage of any shell optimizations that allow amortized linear growth over
16491 # repeated appends, instead of the typical quadratic growth present in naive
16492 # implementations.
16493 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
16494   eval 'as_fn_append ()
16495   {
16496     eval $1+=\$2
16497   }'
16498 else
16499   as_fn_append ()
16500   {
16501     eval $1=\$$1\$2
16502   }
16503 fi # as_fn_append
16504
16505 # as_fn_arith ARG...
16506 # ------------------
16507 # Perform arithmetic evaluation on the ARGs, and store the result in the
16508 # global $as_val. Take advantage of shells that can avoid forks. The arguments
16509 # must be portable across $(()) and expr.
16510 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
16511   eval 'as_fn_arith ()
16512   {
16513     as_val=$(( $* ))
16514   }'
16515 else
16516   as_fn_arith ()
16517   {
16518     as_val=`expr "$@" || test $? -eq 1`
16519   }
16520 fi # as_fn_arith
16521
16522
16523 if expr a : '\(a\)' >/dev/null 2>&1 &&
16524    test "X`expr 00001 : '.*\(...\)'`" = X001; then
16525   as_expr=expr
16526 else
16527   as_expr=false
16528 fi
16529
16530 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
16531   as_basename=basename
16532 else
16533   as_basename=false
16534 fi
16535
16536 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
16537   as_dirname=dirname
16538 else
16539   as_dirname=false
16540 fi
16541
16542 as_me=`$as_basename -- "$0" ||
16543 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
16544          X"$0" : 'X\(//\)$' \| \
16545          X"$0" : 'X\(/\)' \| . 2>/dev/null ||
16546 $as_echo X/"$0" |
16547     sed '/^.*\/\([^/][^/]*\)\/*$/{
16548             s//\1/
16549             q
16550           }
16551           /^X\/\(\/\/\)$/{
16552             s//\1/
16553             q
16554           }
16555           /^X\/\(\/\).*/{
16556             s//\1/
16557             q
16558           }
16559           s/.*/./; q'`
16560
16561 # Avoid depending upon Character Ranges.
16562 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
16563 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
16564 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
16565 as_cr_digits='0123456789'
16566 as_cr_alnum=$as_cr_Letters$as_cr_digits
16567
16568 ECHO_C= ECHO_N= ECHO_T=
16569 case `echo -n x` in #(((((
16570 -n*)
16571   case `echo 'xy\c'` in
16572   *c*) ECHO_T=' ';;     # ECHO_T is single tab character.
16573   xy)  ECHO_C='\c';;
16574   *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
16575        ECHO_T=' ';;
16576   esac;;
16577 *)
16578   ECHO_N='-n';;
16579 esac
16580
16581 rm -f conf$$ conf$$.exe conf$$.file
16582 if test -d conf$$.dir; then
16583   rm -f conf$$.dir/conf$$.file
16584 else
16585   rm -f conf$$.dir
16586   mkdir conf$$.dir 2>/dev/null
16587 fi
16588 if (echo >conf$$.file) 2>/dev/null; then
16589   if ln -s conf$$.file conf$$ 2>/dev/null; then
16590     as_ln_s='ln -s'
16591     # ... but there are two gotchas:
16592     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
16593     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
16594     # In both cases, we have to default to `cp -pR'.
16595     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
16596       as_ln_s='cp -pR'
16597   elif ln conf$$.file conf$$ 2>/dev/null; then
16598     as_ln_s=ln
16599   else
16600     as_ln_s='cp -pR'
16601   fi
16602 else
16603   as_ln_s='cp -pR'
16604 fi
16605 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
16606 rmdir conf$$.dir 2>/dev/null
16607
16608
16609 # as_fn_mkdir_p
16610 # -------------
16611 # Create "$as_dir" as a directory, including parents if necessary.
16612 as_fn_mkdir_p ()
16613 {
16614
16615   case $as_dir in #(
16616   -*) as_dir=./$as_dir;;
16617   esac
16618   test -d "$as_dir" || eval $as_mkdir_p || {
16619     as_dirs=
16620     while :; do
16621       case $as_dir in #(
16622       *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
16623       *) as_qdir=$as_dir;;
16624       esac
16625       as_dirs="'$as_qdir' $as_dirs"
16626       as_dir=`$as_dirname -- "$as_dir" ||
16627 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16628          X"$as_dir" : 'X\(//\)[^/]' \| \
16629          X"$as_dir" : 'X\(//\)$' \| \
16630          X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
16631 $as_echo X"$as_dir" |
16632     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
16633             s//\1/
16634             q
16635           }
16636           /^X\(\/\/\)[^/].*/{
16637             s//\1/
16638             q
16639           }
16640           /^X\(\/\/\)$/{
16641             s//\1/
16642             q
16643           }
16644           /^X\(\/\).*/{
16645             s//\1/
16646             q
16647           }
16648           s/.*/./; q'`
16649       test -d "$as_dir" && break
16650     done
16651     test -z "$as_dirs" || eval "mkdir $as_dirs"
16652   } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
16653
16654
16655 } # as_fn_mkdir_p
16656 if mkdir -p . 2>/dev/null; then
16657   as_mkdir_p='mkdir -p "$as_dir"'
16658 else
16659   test -d ./-p && rmdir ./-p
16660   as_mkdir_p=false
16661 fi
16662
16663
16664 # as_fn_executable_p FILE
16665 # -----------------------
16666 # Test if FILE is an executable regular file.
16667 as_fn_executable_p ()
16668 {
16669   test -f "$1" && test -x "$1"
16670 } # as_fn_executable_p
16671 as_test_x='test -x'
16672 as_executable_p=as_fn_executable_p
16673
16674 # Sed expression to map a string onto a valid CPP name.
16675 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
16676
16677 # Sed expression to map a string onto a valid variable name.
16678 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
16679
16680
16681 exec 6>&1
16682 ## ----------------------------------- ##
16683 ## Main body of $CONFIG_STATUS script. ##
16684 ## ----------------------------------- ##
16685 _ASEOF
16686 test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
16687
16688 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16689 # Save the log message, to keep $0 and so on meaningful, and to
16690 # report actual input values of CONFIG_FILES etc. instead of their
16691 # values after options handling.
16692 ac_log="
16693 This file was extended by PostgreSQL $as_me 10devel, which was
16694 generated by GNU Autoconf 2.69.  Invocation command line was
16695
16696   CONFIG_FILES    = $CONFIG_FILES
16697   CONFIG_HEADERS  = $CONFIG_HEADERS
16698   CONFIG_LINKS    = $CONFIG_LINKS
16699   CONFIG_COMMANDS = $CONFIG_COMMANDS
16700   $ $0 $@
16701
16702 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16703 "
16704
16705 _ACEOF
16706
16707 case $ac_config_files in *"
16708 "*) set x $ac_config_files; shift; ac_config_files=$*;;
16709 esac
16710
16711 case $ac_config_headers in *"
16712 "*) set x $ac_config_headers; shift; ac_config_headers=$*;;
16713 esac
16714
16715
16716 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16717 # Files that config.status was made for.
16718 config_files="$ac_config_files"
16719 config_headers="$ac_config_headers"
16720 config_links="$ac_config_links"
16721 config_commands="$ac_config_commands"
16722
16723 _ACEOF
16724
16725 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16726 ac_cs_usage="\
16727 \`$as_me' instantiates files and other configuration actions
16728 from templates according to the current configuration.  Unless the files
16729 and actions are specified as TAGs, all are instantiated by default.
16730
16731 Usage: $0 [OPTION]... [TAG]...
16732
16733   -h, --help       print this help, then exit
16734   -V, --version    print version number and configuration settings, then exit
16735       --config     print configuration, then exit
16736   -q, --quiet, --silent
16737                    do not print progress messages
16738   -d, --debug      don't remove temporary files
16739       --recheck    update $as_me by reconfiguring in the same conditions
16740       --file=FILE[:TEMPLATE]
16741                    instantiate the configuration file FILE
16742       --header=FILE[:TEMPLATE]
16743                    instantiate the configuration header FILE
16744
16745 Configuration files:
16746 $config_files
16747
16748 Configuration headers:
16749 $config_headers
16750
16751 Configuration links:
16752 $config_links
16753
16754 Configuration commands:
16755 $config_commands
16756
16757 Report bugs to <pgsql-bugs@postgresql.org>."
16758
16759 _ACEOF
16760 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16761 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
16762 ac_cs_version="\\
16763 PostgreSQL config.status 10devel
16764 configured by $0, generated by GNU Autoconf 2.69,
16765   with options \\"\$ac_cs_config\\"
16766
16767 Copyright (C) 2012 Free Software Foundation, Inc.
16768 This config.status script is free software; the Free Software Foundation
16769 gives unlimited permission to copy, distribute and modify it."
16770
16771 ac_pwd='$ac_pwd'
16772 srcdir='$srcdir'
16773 INSTALL='$INSTALL'
16774 MKDIR_P='$MKDIR_P'
16775 AWK='$AWK'
16776 test -n "\$AWK" || AWK=awk
16777 _ACEOF
16778
16779 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16780 # The default lists apply if the user does not specify any file.
16781 ac_need_defaults=:
16782 while test $# != 0
16783 do
16784   case $1 in
16785   --*=?*)
16786     ac_option=`expr "X$1" : 'X\([^=]*\)='`
16787     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
16788     ac_shift=:
16789     ;;
16790   --*=)
16791     ac_option=`expr "X$1" : 'X\([^=]*\)='`
16792     ac_optarg=
16793     ac_shift=:
16794     ;;
16795   *)
16796     ac_option=$1
16797     ac_optarg=$2
16798     ac_shift=shift
16799     ;;
16800   esac
16801
16802   case $ac_option in
16803   # Handling of the options.
16804   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16805     ac_cs_recheck=: ;;
16806   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
16807     $as_echo "$ac_cs_version"; exit ;;
16808   --config | --confi | --conf | --con | --co | --c )
16809     $as_echo "$ac_cs_config"; exit ;;
16810   --debug | --debu | --deb | --de | --d | -d )
16811     debug=: ;;
16812   --file | --fil | --fi | --f )
16813     $ac_shift
16814     case $ac_optarg in
16815     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
16816     '') as_fn_error $? "missing file argument" ;;
16817     esac
16818     as_fn_append CONFIG_FILES " '$ac_optarg'"
16819     ac_need_defaults=false;;
16820   --header | --heade | --head | --hea )
16821     $ac_shift
16822     case $ac_optarg in
16823     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
16824     esac
16825     as_fn_append CONFIG_HEADERS " '$ac_optarg'"
16826     ac_need_defaults=false;;
16827   --he | --h)
16828     # Conflict between --help and --header
16829     as_fn_error $? "ambiguous option: \`$1'
16830 Try \`$0 --help' for more information.";;
16831   --help | --hel | -h )
16832     $as_echo "$ac_cs_usage"; exit ;;
16833   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
16834   | -silent | --silent | --silen | --sile | --sil | --si | --s)
16835     ac_cs_silent=: ;;
16836
16837   # This is an error.
16838   -*) as_fn_error $? "unrecognized option: \`$1'
16839 Try \`$0 --help' for more information." ;;
16840
16841   *) as_fn_append ac_config_targets " $1"
16842      ac_need_defaults=false ;;
16843
16844   esac
16845   shift
16846 done
16847
16848 ac_configure_extra_args=
16849
16850 if $ac_cs_silent; then
16851   exec 6>/dev/null
16852   ac_configure_extra_args="$ac_configure_extra_args --silent"
16853 fi
16854
16855 _ACEOF
16856 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16857 if \$ac_cs_recheck; then
16858   set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
16859   shift
16860   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
16861   CONFIG_SHELL='$SHELL'
16862   export CONFIG_SHELL
16863   exec "\$@"
16864 fi
16865
16866 _ACEOF
16867 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16868 exec 5>>config.log
16869 {
16870   echo
16871   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
16872 ## Running $as_me. ##
16873 _ASBOX
16874   $as_echo "$ac_log"
16875 } >&5
16876
16877 _ACEOF
16878 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16879 _ACEOF
16880
16881 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
16882
16883 # Handling of arguments.
16884 for ac_config_target in $ac_config_targets
16885 do
16886   case $ac_config_target in
16887     "src/backend/port/tas.s") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/tas.s:src/backend/port/tas/${tas_file}" ;;
16888     "GNUmakefile") CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;;
16889     "src/Makefile.global") CONFIG_FILES="$CONFIG_FILES src/Makefile.global" ;;
16890     "src/backend/port/dynloader.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c" ;;
16891     "src/backend/port/pg_sema.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}" ;;
16892     "src/backend/port/pg_shmem.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}" ;;
16893     "src/include/dynloader.h") CONFIG_LINKS="$CONFIG_LINKS src/include/dynloader.h:src/backend/port/dynloader/${template}.h" ;;
16894     "src/include/pg_config_os.h") CONFIG_LINKS="$CONFIG_LINKS src/include/pg_config_os.h:src/include/port/${template}.h" ;;
16895     "src/Makefile.port") CONFIG_LINKS="$CONFIG_LINKS src/Makefile.port:src/makefiles/Makefile.${template}" ;;
16896     "check_win32_symlinks") CONFIG_COMMANDS="$CONFIG_COMMANDS check_win32_symlinks" ;;
16897     "src/include/pg_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config.h" ;;
16898     "src/include/pg_config_ext.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config_ext.h" ;;
16899     "src/interfaces/ecpg/include/ecpg_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/interfaces/ecpg/include/ecpg_config.h" ;;
16900
16901   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
16902   esac
16903 done
16904
16905
16906 # If the user did not use the arguments to specify the items to instantiate,
16907 # then the envvar interface is used.  Set only those that are not.
16908 # We use the long form for the default assignment because of an extremely
16909 # bizarre bug on SunOS 4.1.3.
16910 if $ac_need_defaults; then
16911   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16912   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16913   test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
16914   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16915 fi
16916
16917 # Have a temporary directory for convenience.  Make it in the build tree
16918 # simply because there is no reason against having it here, and in addition,
16919 # creating and moving files from /tmp can sometimes cause problems.
16920 # Hook for its removal unless debugging.
16921 # Note that there is a small window in which the directory will not be cleaned:
16922 # after its creation but before its name has been assigned to `$tmp'.
16923 $debug ||
16924 {
16925   tmp= ac_tmp=
16926   trap 'exit_status=$?
16927   : "${ac_tmp:=$tmp}"
16928   { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
16929 ' 0
16930   trap 'as_fn_exit 1' 1 2 13 15
16931 }
16932 # Create a (secure) tmp directory for tmp files.
16933
16934 {
16935   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
16936   test -d "$tmp"
16937 }  ||
16938 {
16939   tmp=./conf$$-$RANDOM
16940   (umask 077 && mkdir "$tmp")
16941 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
16942 ac_tmp=$tmp
16943
16944 # Set up the scripts for CONFIG_FILES section.
16945 # No need to generate them if there are no CONFIG_FILES.
16946 # This happens for instance with `./config.status config.h'.
16947 if test -n "$CONFIG_FILES"; then
16948
16949
16950 ac_cr=`echo X | tr X '\015'`
16951 # On cygwin, bash can eat \r inside `` if the user requested igncr.
16952 # But we know of no other shell where ac_cr would be empty at this
16953 # point, so we can use a bashism as a fallback.
16954 if test "x$ac_cr" = x; then
16955   eval ac_cr=\$\'\\r\'
16956 fi
16957 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
16958 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
16959   ac_cs_awk_cr='\\r'
16960 else
16961   ac_cs_awk_cr=$ac_cr
16962 fi
16963
16964 echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
16965 _ACEOF
16966
16967
16968 {
16969   echo "cat >conf$$subs.awk <<_ACEOF" &&
16970   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
16971   echo "_ACEOF"
16972 } >conf$$subs.sh ||
16973   as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
16974 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
16975 ac_delim='%!_!# '
16976 for ac_last_try in false false false false false :; do
16977   . ./conf$$subs.sh ||
16978     as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
16979
16980   ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
16981   if test $ac_delim_n = $ac_delim_num; then
16982     break
16983   elif $ac_last_try; then
16984     as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
16985   else
16986     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
16987   fi
16988 done
16989 rm -f conf$$subs.sh
16990
16991 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
16992 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
16993 _ACEOF
16994 sed -n '
16995 h
16996 s/^/S["/; s/!.*/"]=/
16997 p
16998 g
16999 s/^[^!]*!//
17000 :repl
17001 t repl
17002 s/'"$ac_delim"'$//
17003 t delim
17004 :nl
17005 h
17006 s/\(.\{148\}\)..*/\1/
17007 t more1
17008 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
17009 p
17010 n
17011 b repl
17012 :more1
17013 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
17014 p
17015 g
17016 s/.\{148\}//
17017 t nl
17018 :delim
17019 h
17020 s/\(.\{148\}\)..*/\1/
17021 t more2
17022 s/["\\]/\\&/g; s/^/"/; s/$/"/
17023 p
17024 b
17025 :more2
17026 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
17027 p
17028 g
17029 s/.\{148\}//
17030 t delim
17031 ' <conf$$subs.awk | sed '
17032 /^[^""]/{
17033   N
17034   s/\n//
17035 }
17036 ' >>$CONFIG_STATUS || ac_write_fail=1
17037 rm -f conf$$subs.awk
17038 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
17039 _ACAWK
17040 cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
17041   for (key in S) S_is_set[key] = 1
17042   FS = "\a"
17043
17044 }
17045 {
17046   line = $ 0
17047   nfields = split(line, field, "@")
17048   substed = 0
17049   len = length(field[1])
17050   for (i = 2; i < nfields; i++) {
17051     key = field[i]
17052     keylen = length(key)
17053     if (S_is_set[key]) {
17054       value = S[key]
17055       line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
17056       len += length(value) + length(field[++i])
17057       substed = 1
17058     } else
17059       len += 1 + keylen
17060   }
17061
17062   print line
17063 }
17064
17065 _ACAWK
17066 _ACEOF
17067 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
17068 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
17069   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
17070 else
17071   cat
17072 fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
17073   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
17074 _ACEOF
17075
17076 # VPATH may cause trouble with some makes, so we remove sole $(srcdir),
17077 # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
17078 # trailing colons and then remove the whole line if VPATH becomes empty
17079 # (actually we leave an empty line to preserve line numbers).
17080 if test "x$srcdir" = x.; then
17081   ac_vpsub='/^[  ]*VPATH[        ]*=[    ]*/{
17082 h
17083 s///
17084 s/^/:/
17085 s/[      ]*$/:/
17086 s/:\$(srcdir):/:/g
17087 s/:\${srcdir}:/:/g
17088 s/:@srcdir@:/:/g
17089 s/^:*//
17090 s/:*$//
17091 x
17092 s/\(=[   ]*\).*/\1/
17093 G
17094 s/\n//
17095 s/^[^=]*=[       ]*$//
17096 }'
17097 fi
17098
17099 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
17100 fi # test -n "$CONFIG_FILES"
17101
17102 # Set up the scripts for CONFIG_HEADERS section.
17103 # No need to generate them if there are no CONFIG_HEADERS.
17104 # This happens for instance with `./config.status Makefile'.
17105 if test -n "$CONFIG_HEADERS"; then
17106 cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
17107 BEGIN {
17108 _ACEOF
17109
17110 # Transform confdefs.h into an awk script `defines.awk', embedded as
17111 # here-document in config.status, that substitutes the proper values into
17112 # config.h.in to produce config.h.
17113
17114 # Create a delimiter string that does not exist in confdefs.h, to ease
17115 # handling of long lines.
17116 ac_delim='%!_!# '
17117 for ac_last_try in false false :; do
17118   ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
17119   if test -z "$ac_tt"; then
17120     break
17121   elif $ac_last_try; then
17122     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
17123   else
17124     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
17125   fi
17126 done
17127
17128 # For the awk script, D is an array of macro values keyed by name,
17129 # likewise P contains macro parameters if any.  Preserve backslash
17130 # newline sequences.
17131
17132 ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
17133 sed -n '
17134 s/.\{148\}/&'"$ac_delim"'/g
17135 t rset
17136 :rset
17137 s/^[     ]*#[    ]*define[       ][      ]*/ /
17138 t def
17139 d
17140 :def
17141 s/\\$//
17142 t bsnl
17143 s/["\\]/\\&/g
17144 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
17145 D["\1"]=" \3"/p
17146 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2"/p
17147 d
17148 :bsnl
17149 s/["\\]/\\&/g
17150 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
17151 D["\1"]=" \3\\\\\\n"\\/p
17152 t cont
17153 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
17154 t cont
17155 d
17156 :cont
17157 n
17158 s/.\{148\}/&'"$ac_delim"'/g
17159 t clear
17160 :clear
17161 s/\\$//
17162 t bsnlc
17163 s/["\\]/\\&/g; s/^/"/; s/$/"/p
17164 d
17165 :bsnlc
17166 s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
17167 b cont
17168 ' <confdefs.h | sed '
17169 s/'"$ac_delim"'/"\\\
17170 "/g' >>$CONFIG_STATUS || ac_write_fail=1
17171
17172 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
17173   for (key in D) D_is_set[key] = 1
17174   FS = "\a"
17175 }
17176 /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
17177   line = \$ 0
17178   split(line, arg, " ")
17179   if (arg[1] == "#") {
17180     defundef = arg[2]
17181     mac1 = arg[3]
17182   } else {
17183     defundef = substr(arg[1], 2)
17184     mac1 = arg[2]
17185   }
17186   split(mac1, mac2, "(") #)
17187   macro = mac2[1]
17188   prefix = substr(line, 1, index(line, defundef) - 1)
17189   if (D_is_set[macro]) {
17190     # Preserve the white space surrounding the "#".
17191     print prefix "define", macro P[macro] D[macro]
17192     next
17193   } else {
17194     # Replace #undef with comments.  This is necessary, for example,
17195     # in the case of _POSIX_SOURCE, which is predefined and required
17196     # on some systems where configure will not decide to define it.
17197     if (defundef == "undef") {
17198       print "/*", prefix defundef, macro, "*/"
17199       next
17200     }
17201   }
17202 }
17203 { print }
17204 _ACAWK
17205 _ACEOF
17206 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
17207   as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
17208 fi # test -n "$CONFIG_HEADERS"
17209
17210
17211 eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS  :L $CONFIG_LINKS  :C $CONFIG_COMMANDS"
17212 shift
17213 for ac_tag
17214 do
17215   case $ac_tag in
17216   :[FHLC]) ac_mode=$ac_tag; continue;;
17217   esac
17218   case $ac_mode$ac_tag in
17219   :[FHL]*:*);;
17220   :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
17221   :[FH]-) ac_tag=-:-;;
17222   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
17223   esac
17224   ac_save_IFS=$IFS
17225   IFS=:
17226   set x $ac_tag
17227   IFS=$ac_save_IFS
17228   shift
17229   ac_file=$1
17230   shift
17231
17232   case $ac_mode in
17233   :L) ac_source=$1;;
17234   :[FH])
17235     ac_file_inputs=
17236     for ac_f
17237     do
17238       case $ac_f in
17239       -) ac_f="$ac_tmp/stdin";;
17240       *) # Look for the file first in the build tree, then in the source tree
17241          # (if the path is not absolute).  The absolute path cannot be DOS-style,
17242          # because $ac_f cannot contain `:'.
17243          test -f "$ac_f" ||
17244            case $ac_f in
17245            [\\/$]*) false;;
17246            *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
17247            esac ||
17248            as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
17249       esac
17250       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
17251       as_fn_append ac_file_inputs " '$ac_f'"
17252     done
17253
17254     # Let's still pretend it is `configure' which instantiates (i.e., don't
17255     # use $as_me), people would be surprised to read:
17256     #    /* config.h.  Generated by config.status.  */
17257     configure_input='Generated from '`
17258           $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
17259         `' by configure.'
17260     if test x"$ac_file" != x-; then
17261       configure_input="$ac_file.  $configure_input"
17262       { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
17263 $as_echo "$as_me: creating $ac_file" >&6;}
17264     fi
17265     # Neutralize special characters interpreted by sed in replacement strings.
17266     case $configure_input in #(
17267     *\&* | *\|* | *\\* )
17268        ac_sed_conf_input=`$as_echo "$configure_input" |
17269        sed 's/[\\\\&|]/\\\\&/g'`;; #(
17270     *) ac_sed_conf_input=$configure_input;;
17271     esac
17272
17273     case $ac_tag in
17274     *:-:* | *:-) cat >"$ac_tmp/stdin" \
17275       || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
17276     esac
17277     ;;
17278   esac
17279
17280   ac_dir=`$as_dirname -- "$ac_file" ||
17281 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17282          X"$ac_file" : 'X\(//\)[^/]' \| \
17283          X"$ac_file" : 'X\(//\)$' \| \
17284          X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
17285 $as_echo X"$ac_file" |
17286     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
17287             s//\1/
17288             q
17289           }
17290           /^X\(\/\/\)[^/].*/{
17291             s//\1/
17292             q
17293           }
17294           /^X\(\/\/\)$/{
17295             s//\1/
17296             q
17297           }
17298           /^X\(\/\).*/{
17299             s//\1/
17300             q
17301           }
17302           s/.*/./; q'`
17303   as_dir="$ac_dir"; as_fn_mkdir_p
17304   ac_builddir=.
17305
17306 case "$ac_dir" in
17307 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
17308 *)
17309   ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
17310   # A ".." for each directory in $ac_dir_suffix.
17311   ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
17312   case $ac_top_builddir_sub in
17313   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
17314   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
17315   esac ;;
17316 esac
17317 ac_abs_top_builddir=$ac_pwd
17318 ac_abs_builddir=$ac_pwd$ac_dir_suffix
17319 # for backward compatibility:
17320 ac_top_builddir=$ac_top_build_prefix
17321
17322 case $srcdir in
17323   .)  # We are building in place.
17324     ac_srcdir=.
17325     ac_top_srcdir=$ac_top_builddir_sub
17326     ac_abs_top_srcdir=$ac_pwd ;;
17327   [\\/]* | ?:[\\/]* )  # Absolute name.
17328     ac_srcdir=$srcdir$ac_dir_suffix;
17329     ac_top_srcdir=$srcdir
17330     ac_abs_top_srcdir=$srcdir ;;
17331   *) # Relative name.
17332     ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
17333     ac_top_srcdir=$ac_top_build_prefix$srcdir
17334     ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
17335 esac
17336 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
17337
17338
17339   case $ac_mode in
17340   :F)
17341   #
17342   # CONFIG_FILE
17343   #
17344
17345   case $INSTALL in
17346   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
17347   *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
17348   esac
17349   ac_MKDIR_P=$MKDIR_P
17350   case $MKDIR_P in
17351   [\\/$]* | ?:[\\/]* ) ;;
17352   */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
17353   esac
17354 _ACEOF
17355
17356 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
17357 # If the template does not know about datarootdir, expand it.
17358 # FIXME: This hack should be removed a few years after 2.60.
17359 ac_datarootdir_hack=; ac_datarootdir_seen=
17360 ac_sed_dataroot='
17361 /datarootdir/ {
17362   p
17363   q
17364 }
17365 /@datadir@/p
17366 /@docdir@/p
17367 /@infodir@/p
17368 /@localedir@/p
17369 /@mandir@/p'
17370 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
17371 *datarootdir*) ac_datarootdir_seen=yes;;
17372 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
17373   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
17374 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
17375 _ACEOF
17376 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
17377   ac_datarootdir_hack='
17378   s&@datadir@&$datadir&g
17379   s&@docdir@&$docdir&g
17380   s&@infodir@&$infodir&g
17381   s&@localedir@&$localedir&g
17382   s&@mandir@&$mandir&g
17383   s&\\\${datarootdir}&$datarootdir&g' ;;
17384 esac
17385 _ACEOF
17386
17387 # Neutralize VPATH when `$srcdir' = `.'.
17388 # Shell code in configure.ac might set extrasub.
17389 # FIXME: do we really want to maintain this feature?
17390 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
17391 ac_sed_extra="$ac_vpsub
17392 $extrasub
17393 _ACEOF
17394 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
17395 :t
17396 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17397 s|@configure_input@|$ac_sed_conf_input|;t t
17398 s&@top_builddir@&$ac_top_builddir_sub&;t t
17399 s&@top_build_prefix@&$ac_top_build_prefix&;t t
17400 s&@srcdir@&$ac_srcdir&;t t
17401 s&@abs_srcdir@&$ac_abs_srcdir&;t t
17402 s&@top_srcdir@&$ac_top_srcdir&;t t
17403 s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
17404 s&@builddir@&$ac_builddir&;t t
17405 s&@abs_builddir@&$ac_abs_builddir&;t t
17406 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
17407 s&@INSTALL@&$ac_INSTALL&;t t
17408 s&@MKDIR_P@&$ac_MKDIR_P&;t t
17409 $ac_datarootdir_hack
17410 "
17411 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
17412   >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
17413
17414 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
17415   { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
17416   { ac_out=`sed -n '/^[  ]*datarootdir[  ]*:*=/p' \
17417       "$ac_tmp/out"`; test -z "$ac_out"; } &&
17418   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
17419 which seems to be undefined.  Please make sure it is defined" >&5
17420 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
17421 which seems to be undefined.  Please make sure it is defined" >&2;}
17422
17423   rm -f "$ac_tmp/stdin"
17424   case $ac_file in
17425   -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
17426   *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
17427   esac \
17428   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
17429  ;;
17430   :H)
17431   #
17432   # CONFIG_HEADER
17433   #
17434   if test x"$ac_file" != x-; then
17435     {
17436       $as_echo "/* $configure_input  */" \
17437       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
17438     } >"$ac_tmp/config.h" \
17439       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
17440     if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
17441       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
17442 $as_echo "$as_me: $ac_file is unchanged" >&6;}
17443     else
17444       rm -f "$ac_file"
17445       mv "$ac_tmp/config.h" "$ac_file" \
17446         || as_fn_error $? "could not create $ac_file" "$LINENO" 5
17447     fi
17448   else
17449     $as_echo "/* $configure_input  */" \
17450       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
17451       || as_fn_error $? "could not create -" "$LINENO" 5
17452   fi
17453  ;;
17454   :L)
17455   #
17456   # CONFIG_LINK
17457   #
17458
17459   if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
17460     :
17461   else
17462     # Prefer the file from the source tree if names are identical.
17463     if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
17464       ac_source=$srcdir/$ac_source
17465     fi
17466
17467     { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
17468 $as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
17469
17470     if test ! -r "$ac_source"; then
17471       as_fn_error $? "$ac_source: file not found" "$LINENO" 5
17472     fi
17473     rm -f "$ac_file"
17474
17475     # Try a relative symlink, then a hard link, then a copy.
17476     case $ac_source in
17477     [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
17478         *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
17479     esac
17480     ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
17481       ln "$ac_source" "$ac_file" 2>/dev/null ||
17482       cp -p "$ac_source" "$ac_file" ||
17483       as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
17484   fi
17485  ;;
17486   :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
17487 $as_echo "$as_me: executing $ac_file commands" >&6;}
17488  ;;
17489   esac
17490
17491
17492   case $ac_file$ac_mode in
17493     "check_win32_symlinks":C)
17494 # Links sometimes fail undetected on Mingw -
17495 # so here we detect it and warn the user
17496 for FILE in $CONFIG_LINKS
17497  do
17498         # test -e works for symlinks in the MinGW console
17499         test -e `expr "$FILE" : '\([^:]*\)'` || { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** link for $FILE -- please fix by hand" >&5
17500 $as_echo "$as_me: WARNING: *** link for $FILE -- please fix by hand" >&2;}
17501  done
17502  ;;
17503     "src/include/pg_config.h":H)
17504 # Update timestamp for pg_config.h (see Makefile.global)
17505 echo >src/include/stamp-h
17506  ;;
17507     "src/include/pg_config_ext.h":H)
17508 # Update timestamp for pg_config_ext.h (see Makefile.global)
17509 echo >src/include/stamp-ext-h
17510  ;;
17511     "src/interfaces/ecpg/include/ecpg_config.h":H) echo >src/interfaces/ecpg/include/stamp-h ;;
17512
17513   esac
17514 done # for ac_tag
17515
17516
17517 as_fn_exit 0
17518 _ACEOF
17519 ac_clean_files=$ac_clean_files_save
17520
17521 test $ac_write_fail = 0 ||
17522   as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
17523
17524
17525 # configure is writing to config.log, and then calls config.status.
17526 # config.status does its own redirection, appending to config.log.
17527 # Unfortunately, on DOS this fails, as config.log is still kept open
17528 # by configure, so config.status won't be able to write to it; its
17529 # output is simply discarded.  So we exec the FD to /dev/null,
17530 # effectively closing config.log, so it can be properly (re)opened and
17531 # appended to by config.status.  When coming back to configure, we
17532 # need to make the FD available again.
17533 if test "$no_create" != yes; then
17534   ac_cs_success=:
17535   ac_config_status_args=
17536   test "$silent" = yes &&
17537     ac_config_status_args="$ac_config_status_args --quiet"
17538   exec 5>/dev/null
17539   $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
17540   exec 5>>config.log
17541   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17542   # would make configure fail if this is the last instruction.
17543   $ac_cs_success || as_fn_exit 1
17544 fi
17545 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
17546   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
17547 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
17548 fi
17549